LINUX C中DIR结构的长度?
刘爱贵
博客专家认证 2006-04-16 09:29:45 LINUX C 中DIR结构是这样定义的:
struct __dirstream
{
void *__fd; /* `struct hurd_fd' pointer for descriptor. */
char *__data; /* Directory block. */
int __entry_data; /* Entry number `__data' corresponds to. */
char *__ptr; /* Current pointer into the block. */
int __entry_ptr; /* Entry number `__ptr' corresponds to. */
size_t __allocation; /* Space allocated for the block. */
size_t __size; /* Total valid data in the block. */
__libc_lock_define (, __lock) /* Mutex lock for this structure. */
};
typedef struct __dirstream DIR;
可是我在程序中获取中长度时总是出错:
printf("size_DIR = %d\n", sizeof(DIR));
出错信息:sizeof applied to an incomplete type
为什么呢?试了半天了,没有成功