summaryrefslogtreecommitdiff
path: root/lib/libc/gen
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gen')
-rw-r--r--lib/libc/gen/Makefile.inc4
-rw-r--r--lib/libc/gen/dirfd.c12
2 files changed, 14 insertions, 2 deletions
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc
index de2874f3163..56eb0518850 100644
--- a/lib/libc/gen/Makefile.inc
+++ b/lib/libc/gen/Makefile.inc
@@ -1,11 +1,11 @@
-# $OpenBSD: Makefile.inc,v 1.55 2012/03/21 23:20:35 matthew Exp $
+# $OpenBSD: Makefile.inc,v 1.56 2012/03/22 01:13:40 matthew Exp $
# gen sources
.PATH: ${LIBCSRCDIR}/arch/${MACHINE_CPU}/gen ${LIBCSRCDIR}/gen
SRCS+= alarm.c assert.c auth_subr.c authenticate.c \
basename.c clock.c closedir.c confstr.c ctermid.c ctype_.c \
- daemon.c devname.c dirname.c disklabel.c elf_hash.c err.c \
+ daemon.c devname.c dirfd.c dirname.c disklabel.c elf_hash.c err.c \
errx.c errlist.c errno.c exec.c fnmatch.c fpclassify.c frexp.c \
fstab.c ftok.c fts.c ftw.c getbsize.c getcap.c getcwd.c \
getdomainname.c getgrent.c getgrouplist.c gethostname.c \
diff --git a/lib/libc/gen/dirfd.c b/lib/libc/gen/dirfd.c
new file mode 100644
index 00000000000..5e3123c0fdc
--- /dev/null
+++ b/lib/libc/gen/dirfd.c
@@ -0,0 +1,12 @@
+/*
+ * Written by Matthew Dempsky, 2011.
+ * Public domain.
+ */
+
+#include <dirent.h>
+
+int
+(dirfd)(DIR *dirp)
+{
+ return (dirp->dd_fd);
+}