Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/gen/gen-private.h
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
struct _dirdesc { | struct _dirdesc { | ||||
int dd_fd; /* file descriptor associated with directory */ | int dd_fd; /* file descriptor associated with directory */ | ||||
long dd_loc; /* offset in current buffer */ | long dd_loc; /* offset in current buffer */ | ||||
long dd_size; /* amount of data returned by getdirentries */ | long dd_size; /* amount of data returned by getdirentries */ | ||||
char *dd_buf; /* data buffer */ | char *dd_buf; /* data buffer */ | ||||
int dd_len; /* size of data buffer */ | int dd_len; /* size of data buffer */ | ||||
off_t dd_seek; /* magic cookie returned by getdirentries */ | off_t dd_seek; /* magic cookie returned by getdirentries */ | ||||
int dd_flags; /* flags for readdir */ | int dd_flags; /* flags for readdir */ | ||||
#ifndef IN_RTLD | |||||
struct pthread_mutex *dd_lock; /* lock */ | struct pthread_mutex *dd_lock; /* lock */ | ||||
#else | |||||
kib: Can you keep the member for rtld, perhaps changing it to void * ? I want the structure to have… | |||||
Done Inline ActionsSure, sounds good. I only added the ifdef to make sure that the lock is not accidentally being used. I chose not to use void* since that will implicitly convert to struct pthread_mutex * arichardson: Sure, sounds good. I only added the ifdef to make sure that the lock is not accidentally being… | |||||
struct _donotuse *dd_lock; /* unused in rtld, keep same layout */ | |||||
#endif | |||||
struct _telldir *dd_td; /* telldir position recording */ | struct _telldir *dd_td; /* telldir position recording */ | ||||
void *dd_compat_de; /* compat dirent */ | void *dd_compat_de; /* compat dirent */ | ||||
}; | }; | ||||
#define _dirfd(dirp) ((dirp)->dd_fd) | #define _dirfd(dirp) ((dirp)->dd_fd) | ||||
struct dirent; | struct dirent; | ||||
int __readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result); | int __readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result); | ||||
#endif /* !_GEN_PRIVATE_H_ */ | #endif /* !_GEN_PRIVATE_H_ */ |
Can you keep the member for rtld, perhaps changing it to void * ? I want the structure to have the same layout inside rtld.