The problem is that when used typedef structto introduce a new structone that does not require a keyword struct, you cannot refer to the typedef-ed name inside the declaration struct. Instead, you need to use the full name for the structure. For instance:
typedef struct sharedData
{
sem_t* forks;
int id;
void (*forkFunc)(struct sharedData*);
};
, typedef , , struct sharedData. :
typedef struct sharedData
{
sem_t* forks;
int id;
void (*forkFunc)(struct sharedData*);
} sharedData;
struct sharedData sharedData.