|
meet a strange problem when am writting , the struct that I defined in /sys/sys/proc.h can not be used , but struct proc could be used.
For example:
In file---------- ----/sys/sys/proc.h
struct proc /* old proc struct in proc.h*/
{ ... };
struct fox_test
{ int a; } ; /**my new defined struct */
In ------------------------/tmp/test.c
#include<fcntl.h>
#include<sys/param.h>
#include<sys/proc.h>
struct proc ppc;
//struct fox_test ftt;
/*
//if I add this line above("struct fox_test ftt;"), this file will fall in compile; error:storage size of 'ftt' isn't known
// however , this file could be compiled successfully without "struct fox_test ftt;"
*/
int main()
{
return 0;
}
>cc ./test.c
>error:storage size of 'ftt' isn't known
I even try to test this problem in /usr/src/bin/ps
I can define "struct proc ppc;" in ps.c , then I usd make command. It compiles correct.
But when I add "struct fox_test ftt; " ,then I usd make command. It fails with the same error;
thanks, |
|