mirror of
https://git.savannah.gnu.org/git/gnulib.git
synced 2025-08-14 14:01:48 +03:00
* lib/closedir.c (closedir): Unregister fd if closedir() succeeds. * lib/dirent.in.h (_gl_register_dirp_fd, _gl_unregister_dirp_fd): Declare on kLIBC. * lib/dirfd.c (struct dirp_fd_list): New. Structures to keep track of fd associated with dirp. (_gl_register_dirp_fd): New. Register fd associated with dirp to dirp_fd_list. (_gl_unregister_dirp_fd): New. Unregister fd with closing it. (dirfd): Implemented for kLIBC. * lib/fdopendir.c (fdopendir): Implemented for kLIBC. * lib/opendir.c (opendir): New. Register fd and dirp pair if open() succeeds. * m4/closedir.m4 (gl_FUNC_CLOSEDIR): Replace if OS/2. * m4/dirfd.m4 (gl_FUNC_DIRFD): Likewise. (REPLACE_DIRFD): Define to 1 if replaced. * m4/opendir.m4 (gl_FUNC_OPENDIR): Likewise. * modules/closedir (Depends-on): Add dirfd. * modules/dirfd (Depends-on): Add 'test $REPLACE_DIRFD = 1' to errno condition. (configure.ac): Add dirfd to LIBOBJS if $REPLACE_DIRFD = 1 as well. * modules/opendir (Depends-on): Add dirfd.
32 lines
553 B
Plaintext
32 lines
553 B
Plaintext
Description:
|
|
Retrieving the file descriptor of an open directory stream. (Unportable.)
|
|
|
|
Files:
|
|
lib/dirfd.c
|
|
m4/dirfd.m4
|
|
|
|
Depends-on:
|
|
dirent
|
|
extensions
|
|
errno [test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no || test $REPLACE_DIRFD = 1]
|
|
|
|
configure.ac:
|
|
gl_FUNC_DIRFD
|
|
if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no \
|
|
|| test $REPLACE_DIRFD = 1; then
|
|
AC_LIBOBJ([dirfd])
|
|
gl_PREREQ_DIRFD
|
|
fi
|
|
gl_DIRENT_MODULE_INDICATOR([dirfd])
|
|
|
|
Makefile.am:
|
|
|
|
Include:
|
|
<dirent.h>
|
|
|
|
License:
|
|
LGPLv2+
|
|
|
|
Maintainer:
|
|
Jim Meyering
|