小编lka*_*nab的帖子

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
查看次数

模板基类初始化

在visual c ++中接受下面的代码,g ++将生成错误:"类Derived没有任何字段名Base",它遵循标准?

template <class T>
class Base
{
public:
    Base(){};
};

template <class T>
class Derived:public Base<T>
{
public:
    Derived():Base(){}
};
Run Code Online (Sandbox Code Playgroud)

顺便说一句:都接受

Derived():Base<T>(){}
Run Code Online (Sandbox Code Playgroud)

所以,我会跟着gcc

c++ gcc templates initialization

4
推荐指数
1
解决办法
794
查看次数

VxWorks:我如何确保从DDR而不是从缓存读取数据

例:

int foo(void)
{
    static volatile int data;
    data = 0xaaa;
    /* something to assure cache flushing */
    if (data == 0xaaa)
        return 1;
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

问题是什么可以保证冲洗.谢谢.

c vxworks

3
推荐指数
1
解决办法
559
查看次数

标签 统计

c ×2

c++ ×1

gcc ×1

initialization ×1

linux ×1

signals ×1

templates ×1

vxworks ×1