3 ?RCS: Copyright (c) 2001, Jarkko Hietaniemi
5 ?RCS: You may redistribute only under the terms of the Artistic Licence,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic Licence; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 3.0.
12 ?MAKE:d_dirfd: Compile cat rm Setvar i_dirent i_sysdir i_sysndir i_systypes i_stdlib
13 ?MAKE: -pick add $@ %<
15 ?S: This variable conditionally defines the HAS_DIRFD constant,
16 ?S: which indicates to the C program that dirfd() is available
17 ?S: to return the file descriptor of a directory stream.
20 ?C: This manifest constant lets the C program know that dirfd
23 ?H:#$d_dirfd HAS_DIRFD /**/
26 ?X: Can't use Inlibc because dirfd() might be a macro.
35 #$i_dirent I_DIRENT /**/
36 #$i_sysdir I_SYS_DIR /**/
37 #$i_sysndir I_SYS_NDIR /**/
38 #$i_systypes I_SYS_TYPES /**/
39 #if defined(I_SYS_TYPES)
40 #include <sys/types.h>
44 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
53 #include <ndir.h> /* may be wrong in the future */
61 DIR *dirp = opendir(".");
69 if eval $compile; then
73 $define) echo "dirfd() found." >&4 ;;
74 *) echo "dirfd() NOT found." >&4 ;;