summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen
diff options
context:
space:
mode:
authormatthew <matthew@openbsd.org>2013-04-15 16:38:21 +0000
committermatthew <matthew@openbsd.org>2013-04-15 16:38:21 +0000
commitaa96fc3dc04fe319783a4886e24b151213e6b69c (patch)
tree52745291923f19b5692f01a948118d064f6a6804 /lib/libc/gen
parentTweak check rule to match change to the manpage formatting (diff)
downloadwireguard-openbsd-aa96fc3dc04fe319783a4886e24b151213e6b69c.tar.xz
wireguard-openbsd-aa96fc3dc04fe319783a4886e24b151213e6b69c.zip
Implement fdatasync() as a wrapper around fsync()
ok guenther, deraadt, jmc
Diffstat (limited to 'lib/libc/gen')
-rw-r--r--lib/libc/gen/Makefile.inc5
-rw-r--r--lib/libc/gen/fdatasync.c13
2 files changed, 16 insertions, 2 deletions
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc
index 64d8df708c3..e39258c979b 100644
--- a/lib/libc/gen/Makefile.inc
+++ b/lib/libc/gen/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.58 2012/09/15 20:59:38 miod Exp $
+# $OpenBSD: Makefile.inc,v 1.59 2013/04/15 16:38:21 matthew Exp $
# gen sources
.PATH: ${LIBCSRCDIR}/arch/${MACHINE_CPU}/gen ${LIBCSRCDIR}/gen
@@ -6,7 +6,8 @@
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 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 \
+ errx.c errlist.c errno.c exec.c \
+ fdatasync.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 \
getloadavg.c getlogin.c getmntinfo.c getnetgrent.c getpagesize.c \
diff --git a/lib/libc/gen/fdatasync.c b/lib/libc/gen/fdatasync.c
new file mode 100644
index 00000000000..26612123a2c
--- /dev/null
+++ b/lib/libc/gen/fdatasync.c
@@ -0,0 +1,13 @@
+/* $OpenBSD: fdatasync.c,v 1.1 2013/04/15 16:38:21 matthew Exp $ */
+/*
+ * Written by Matthew Dempsky, 2013.
+ * Public domain.
+ */
+
+#include <unistd.h>
+
+int
+fdatasync(int fd)
+{
+ return (fsync(fd));
+}