Неизвестное имя типа 'uid_t' в C - PullRequest
0 голосов
/ 10 июля 2019

Я разрабатываю программу, которая собирает результат системного вызова stat (), вызванного по некоторому пути, указанному пользователем в структуре, и затем сохраняет всю информацию в файле.Я использую CodeBlocks в Windows 10, и когда я пытаюсь создать вот что:это называется "structs.h":

#ifndef STRUCTS
#define STRUCTS

#include <sys/types.h>
#include <time.h>

#define HASOPT(OPTIONS, OPT) (OPTIONS & OPT) == OPT

#define T_INODE 'I'
#define T_SCANNED_PATH 'S'

#define MALLOC_ERROR "[Error]: Out of memory\n"

typedef struct s_input_file_argument{
    char *path;
    unsigned char options;
    struct s_input_file_argument *next;
} input_file_argument;

typedef struct s_filestat_configuration{
    unsigned char hasopt;
    char *history;
    uid_t user;
    gid_t group;
    off_t length_min;
    off_t length_max;
    char *output_file;
    input_file_argument *input_args;
} filestat_configuration;

typedef struct s_file_info{
    time_t date;
    uid_t uid;
    gid_t gid;
    off_t size;
    mode_t mode;
    time_t actime;
    time_t ctime;
    time_t mtime;
    nlink_t nlink;
    struct s_file_info *next;
} file_info;

typedef struct s_path {
    char *path;
    file_info *head;
    file_info *tail;
} scanned_path;

typedef struct s_program_stats{
    unsigned long int nfiles;
    off_t max_size;
    double execution_time;
} program_report;

typedef union u_treenode_data{
    scanned_path *file;
    ino_t inode;
} u_data;

typedef struct s_treenode_data{
    unsigned char type;
    union u_treenode_data data;
} treenode_data;

#endif

Я знаю, что эти типы предоставляются с "sys / types.h", так почему у меня возникла эта проблема и как я могу ее решить?

...