This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via dfa593d4d881116723a4401b466ea964fb12327b (commit)
via b8cfcb3f9b565100c24b0f8de1e31a45dc4370a5 (commit)
from a3312d2264a8f84c854bf9cd0fb05634baba5e87 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit dfa593d4d881116723a4401b466ea964fb12327b
Author: Bartosz Golaszewski <bartekgola(a)gmail.com>
Date: Wed Oct 14 17:14:01 2015 +0200
syncfs: add system call support
Add support for the syncfs() system call.
Signed-off-by: Bartosz Golaszewski <bartekgola(a)gmail.com>
commit b8cfcb3f9b565100c24b0f8de1e31a45dc4370a5
Author: Bartosz Golaszewski <bartekgola(a)gmail.com>
Date: Wed Oct 14 17:14:00 2015 +0200
fanotify: add system call support
Add support for fanotify_init() and fanotify_mark() syscalls. The header
file is taken from glibc.
Signed-off-by: Bartosz Golaszewski <bartekgola(a)gmail.com>
-----------------------------------------------------------------------
Summary of changes:
include/unistd.h | 2 +-
libc/sysdeps/linux/common/Makefile.in | 1 +
libc/sysdeps/linux/common/fanotify.c | 32 ++++++++++++++++++++
libc/sysdeps/linux/common/{getppid.c => syncfs.c} | 10 +++---
.../{x86_64/sys/perm.h => common/sys/fanotify.h} | 25 ++++++++-------
5 files changed, 52 insertions(+), 18 deletions(-)
create mode 100644 libc/sysdeps/linux/common/fanotify.c
copy libc/sysdeps/linux/common/{getppid.c => syncfs.c} (52%)
copy libc/sysdeps/linux/{x86_64/sys/perm.h => common/sys/fanotify.h} (59%)
diff --git a/include/unistd.h b/include/unistd.h
index 3793d2d..4701dab 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -1073,7 +1073,7 @@ extern char *getpass (const char *__prompt) __nonnull ((1));
extern int fsync (int __fd);
#endif /* Use BSD || X/Open || Unix98. */
-#if 0 /*def __USE_GNU */
+#if __USE_GNU
/* Make all changes done to all files on the file system associated
* with FD actually appear on disk. */
extern int syncfs (int __fd) __THROW;
diff --git a/libc/sysdeps/linux/common/Makefile.in
b/libc/sysdeps/linux/common/Makefile.in
index 8252598..b75b712 100644
--- a/libc/sysdeps/linux/common/Makefile.in
+++ b/libc/sysdeps/linux/common/Makefile.in
@@ -27,6 +27,7 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \
eventfd.c \
eventfd_read.c \
eventfd_write.c \
+ fanotify.c \
getrandom.c \
inotify.c \
ioperm.c \
diff --git a/libc/sysdeps/linux/common/fanotify.c b/libc/sysdeps/linux/common/fanotify.c
new file mode 100644
index 0000000..431e0e5
--- /dev/null
+++ b/libc/sysdeps/linux/common/fanotify.c
@@ -0,0 +1,32 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * fanotify interface for uClibc
+ *
+ * Copyright (C) 2015 by Bartosz Golaszewski <bartekgola(a)gmail.com>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/fanotify.h>
+
+#ifdef __NR_fanotify_init
+_syscall2(int, fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
+#endif
+
+#ifdef __NR_fanotify_mark
+# include <bits/wordsize.h>
+# include <fcntl.h>
+
+# if __WORDSIZE == 64
+_syscall5(int, fanotify_mark, int, fanotify_fd, unsigned int, flags,
+ uint64_t, mask, int, dirfd, const char *, pathname)
+# else
+int fanotify_mark(int fanotify_fd, unsigned int flags,
+ uint64_t mask, int dirfd, const char *pathname)
+{
+ return INLINE_SYSCALL(fanotify_mark, 6, fanotify_fd, flags,
+ OFF64_HI_LO(mask), dirfd, pathname);
+}
+# endif
+#endif
diff --git a/libc/sysdeps/linux/common/getppid.c b/libc/sysdeps/linux/common/syncfs.c
similarity index 52%
copy from libc/sysdeps/linux/common/getppid.c
copy to libc/sysdeps/linux/common/syncfs.c
index 9d85661..831f765 100644
--- a/libc/sysdeps/linux/common/getppid.c
+++ b/libc/sysdeps/linux/common/syncfs.c
@@ -1,15 +1,13 @@
/* vi: set sw=4 ts=4: */
/*
- * getppid() for uClibc
- *
- * Copyright (C) 2000-2006 by Erik Andersen <andersen(a)codepoet.org>
+ * Copyright (C) 2015 Bartosz Golaszewski <bartekgola(a)gmail.com>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <sys/syscall.h>
-#include <unistd.h>
-#ifdef __NR_getppid
-_syscall_noerr0(pid_t, getppid)
+#if defined(__NR_syncfs) && __USE_GNU
+#include <unistd.h>
+_syscall1(int, syncfs, int, fd)
#endif
diff --git a/libc/sysdeps/linux/x86_64/sys/perm.h
b/libc/sysdeps/linux/common/sys/fanotify.h
similarity index 59%
copy from libc/sysdeps/linux/x86_64/sys/perm.h
copy to libc/sysdeps/linux/common/sys/fanotify.h
index cbfeaf8..5eec3e5 100644
--- a/libc/sysdeps/linux/x86_64/sys/perm.h
+++ b/libc/sysdeps/linux/common/sys/fanotify.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1999, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -15,21 +15,24 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifndef _SYS_PERM_H
+#ifndef _SYS_FANOTIFY_H
+#define _SYS_FANOTIFY_H 1
-#define _SYS_PERM_H 1
-#include <features.h>
+#include <stdint.h>
+#include <linux/fanotify.h>
-__BEGIN_DECLS
-/* Set port input/output permissions. */
-extern int ioperm (unsigned long int __from, unsigned long int __num,
- int __turn_on) __THROW;
+__BEGIN_DECLS
+/* Create and initialize fanotify group. */
+extern int fanotify_init (unsigned int __flags, unsigned int __event_f_flags)
+ __THROW;
-/* Change I/O privilege level. */
-extern int iopl (int __level) __THROW;
+/* Add, remove, or modify an fanotify mark on a filesystem object. */
+extern int fanotify_mark (int __fanotify_fd, unsigned int __flags,
+ uint64_t __mask, int __dfd, const char *__pathname)
+ __THROW;
__END_DECLS
-#endif /* _SYS_PERM_H */
+#endif /* sys/fanotify.h */
hooks/post-receive
--
uClibc-ng - small C library for embedded systems