这是我的头文件,它包含在另一个文件中但尚未使用:
#define ksm_read 0X01
#define ksm_rdwr 0x00
struct ksm_info_t {
uint ksmsz; //size of shared mem
int cpid; //pid of the creator
int mpid; //pid of the last modifier
uint attached_nr; //number of attached processes
uint atime; //last attached time
uint dtime; //last deattach time
uint total_shrg_nr; //total number of existing shared regions
uint total_shpg_nr; //total number of existing shared pages
};
int ksmget(char* name, uint size);
int ksmattach(int hd, int flag);
int ksmdetach(int hd);
int ksminfo(int hd, struct ksminfo_t* info);
int ksmdelete(int hd);
以下是我得到的错误:
> ksm.h:18: error: ‘struct ksminfo_t’ declared inside parameter list
> ksm.h:18: error: its scope is only this definition or declaration, which is prob