cstructerror-handlingheader

‘struct' declared inside parameter list


Here's my header file that was included in another file but not yet used:

#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);

Here are the errors I'm getting:

> 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

Solution

  • Typo, should be struct ksm_info_t, not struct ksminfo_t.