相关疑难解决方法(0)

struct sigaction不完整错误

虽然包括<signal.h>我得到一个错误,说这struct sigaction是一个不完整的类型.

我不知道该怎么做.

请帮忙

#include <signal.h>
struct sigaction act;

int main(int argc, char** argv)
{
    int depth;

    /* validate arguments number*/
    if(argc < 2)
    {
        printf("fatal error: please use arguments <MaxChild> <MaxDepth>\n");
        exit(1);
    }

    /* register the realtime signal handler for sigchld*/

/*173*/
    memset(&act,0,sizeof(act));
    act.sa_handler = sigproc;
    sigaction(SIGCHLD,  /* signal number whose action will be changed */
             &act,      /* new action to do when SIGCHLD arrives*/
             NULL);     /* old action - not stored */


    srand(time(NULL));
    depth …
Run Code Online (Sandbox Code Playgroud)

c linux signals

13
推荐指数
2
解决办法
7693
查看次数

标签 统计

c ×1

linux ×1

signals ×1