Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libc/gen/opendir.c
Show First 20 Lines • Show All 290 Lines • ▼ Show 20 Lines | __opendir_common(int fd, int flags, bool use_current_pos) | ||||
dirp->dd_buf = NULL; | dirp->dd_buf = NULL; | ||||
dirp->dd_fd = fd; | dirp->dd_fd = fd; | ||||
dirp->dd_flags = flags; | dirp->dd_flags = flags; | ||||
dirp->dd_loc = 0; | dirp->dd_loc = 0; | ||||
dirp->dd_lock = NULL; | dirp->dd_lock = NULL; | ||||
dirp->dd_td = (struct _telldir *)((char *)dirp + sizeof(DIR)); | dirp->dd_td = (struct _telldir *)((char *)dirp + sizeof(DIR)); | ||||
LIST_INIT(&dirp->dd_td->td_locq); | LIST_INIT(&dirp->dd_td->td_locq); | ||||
dirp->dd_td->td_loccnt = 0; | dirp->dd_td->td_loccnt = 0; | ||||
dirp->dd_compat_de = NULL; | |||||
/* | /* | ||||
* Use the system page size if that is a multiple of DIRBLKSIZ. | * Use the system page size if that is a multiple of DIRBLKSIZ. | ||||
* Hopefully this can be a big win someday by allowing page | * Hopefully this can be a big win someday by allowing page | ||||
* trades to user space to be done by _getdirentries(). | * trades to user space to be done by _getdirentries(). | ||||
*/ | */ | ||||
incr = getpagesize(); | incr = getpagesize(); | ||||
if ((incr % DIRBLKSIZ) != 0) | if ((incr % DIRBLKSIZ) != 0) | ||||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |