Ulrich Drepper
4006553b06
flag parameters: inotify_init
...
This patch introduces the new syscall inotify_init1 (note: the 1 stands for
the one parameter the syscall takes, as opposed to no parameter before). The
values accepted for this parameter are function-specific and defined in the
inotify.h header. Here the values must match the O_* flags, though. In this
patch CLOEXEC support is introduced.
The following test must be adjusted for architectures other than x86 and
x86-64 and in case the syscall numbers changed.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/syscall.h>
#ifndef __NR_inotify_init1
# ifdef __x86_64__
# define __NR_inotify_init1 294
# elif defined __i386__
# define __NR_inotify_init1 332
# else
# error "need __NR_inotify_init1"
# endif
#endif
#define IN_CLOEXEC O_CLOEXEC
int
main (void)
{
int fd;
fd = syscall (__NR_inotify_init1, 0);
if (fd == -1)
{
puts ("inotify_init1(0) failed");
return 1;
}
int coe = fcntl (fd, F_GETFD);
if (coe == -1)
{
puts ("fcntl failed");
return 1;
}
if (coe & FD_CLOEXEC)
{
puts ("inotify_init1(0) set close-on-exit");
return 1;
}
close (fd);
fd = syscall (__NR_inotify_init1, IN_CLOEXEC);
if (fd == -1)
{
puts ("inotify_init1(IN_CLOEXEC) failed");
return 1;
}
coe = fcntl (fd, F_GETFD);
if (coe == -1)
{
puts ("fcntl failed");
return 1;
}
if ((coe & FD_CLOEXEC) == 0)
{
puts ("inotify_init1(O_CLOEXEC) does not set close-on-exit");
return 1;
}
close (fd);
puts ("OK");
return 0;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[akpm@linux-foundation.org: add sys_ni stub]
Signed-off-by: Ulrich Drepper <drepper@redhat.com>
Acked-by: Davide Libenzi <davidel@xmailserver.org>
Cc: Michael Kerrisk <mtk.manpages@googlemail.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:28 -07:00
..
2008-07-24 10:47:24 -07:00
2008-07-23 18:37:44 -07:00
2008-07-10 10:13:51 -07:00
2008-05-23 21:56:52 +02:00
Merge branches 'x86/urgent', 'x86/amd-iommu', 'x86/apic', 'x86/cleanups', 'x86/core', 'x86/cpu', 'x86/fixmap', 'x86/gart', 'x86/kprobes', 'x86/memtest', 'x86/modules', 'x86/nmi', 'x86/pat', 'x86/reboot', 'x86/setup', 'x86/step', 'x86/unify-pci', 'x86/uv', 'x86/xen' and 'xen-64bit' into x86/for-linus
2008-07-21 16:37:17 +02:00
Merge branches 'x86/urgent', 'x86/amd-iommu', 'x86/apic', 'x86/cleanups', 'x86/core', 'x86/cpu', 'x86/fixmap', 'x86/gart', 'x86/kprobes', 'x86/memtest', 'x86/modules', 'x86/nmi', 'x86/pat', 'x86/reboot', 'x86/setup', 'x86/step', 'x86/unify-pci', 'x86/uv', 'x86/xen' and 'xen-64bit' into x86/for-linus
2008-07-21 16:37:17 +02:00
2008-07-11 11:00:54 +02:00
Merge branches 'x86/urgent', 'x86/amd-iommu', 'x86/apic', 'x86/cleanups', 'x86/core', 'x86/cpu', 'x86/fixmap', 'x86/gart', 'x86/kprobes', 'x86/memtest', 'x86/modules', 'x86/nmi', 'x86/pat', 'x86/reboot', 'x86/setup', 'x86/step', 'x86/unify-pci', 'x86/uv', 'x86/xen' and 'xen-64bit' into x86/for-linus
2008-07-21 16:37:17 +02:00
Merge branches 'x86/urgent', 'x86/amd-iommu', 'x86/apic', 'x86/cleanups', 'x86/core', 'x86/cpu', 'x86/fixmap', 'x86/gart', 'x86/kprobes', 'x86/memtest', 'x86/modules', 'x86/nmi', 'x86/pat', 'x86/reboot', 'x86/setup', 'x86/step', 'x86/unify-pci', 'x86/uv', 'x86/xen' and 'xen-64bit' into x86/for-linus
2008-07-21 16:37:17 +02:00
2008-07-24 10:47:22 -07:00
2008-07-08 13:13:15 +02:00
2008-07-16 10:58:55 +02:00
2007-10-11 11:17:01 +02:00
2007-10-11 11:17:24 +02:00
2008-07-18 14:35:14 +02:00
2008-01-30 13:32:31 +01:00
2008-07-21 21:54:46 -07:00
2007-10-19 11:53:33 -07:00
2007-10-13 10:01:23 -07:00
2008-04-27 12:00:29 +03:00
2008-01-30 13:31:31 +01:00
2008-04-17 17:41:34 +02:00
2008-07-20 09:18:17 +02:00
2008-06-18 13:11:01 +02:00
Merge branches 'x86/urgent', 'x86/amd-iommu', 'x86/apic', 'x86/cleanups', 'x86/core', 'x86/cpu', 'x86/fixmap', 'x86/gart', 'x86/kprobes', 'x86/memtest', 'x86/modules', 'x86/nmi', 'x86/pat', 'x86/reboot', 'x86/setup', 'x86/step', 'x86/unify-pci', 'x86/uv', 'x86/xen' and 'xen-64bit' into x86/for-linus
2008-07-21 16:37:17 +02:00
2008-07-03 08:19:18 +02:00
2008-07-08 11:49:49 +02:00
2007-10-11 11:17:01 +02:00
2008-01-30 13:31:19 +01:00
2008-07-11 10:24:04 +02:00
2008-07-23 18:00:30 -07:00
2008-07-23 17:55:22 -07:00
2008-06-23 22:10:56 +02:00
2008-06-10 11:32:09 +02:00
2008-07-20 10:21:10 +02:00
2008-07-23 18:37:44 -07:00
2008-06-19 14:19:03 +02:00
2008-06-05 15:10:02 +02:00
2008-07-16 10:58:13 +02:00
2008-07-08 12:48:18 +02:00
2008-07-16 11:07:30 +02:00
2008-07-08 13:16:14 +02:00
2008-07-14 09:24:17 +02:00
2008-06-23 22:10:56 +02:00
2008-07-01 11:03:31 +02:00
2008-01-24 20:40:40 -08:00
2008-04-26 17:35:47 +02:00
2008-06-02 11:55:52 +02:00
2008-05-16 17:22:20 -04:00
2008-07-18 14:27:47 +02:00
2008-07-23 18:37:44 -07:00
2008-07-09 13:57:54 +02:00
2008-01-30 13:33:10 +01:00
2008-07-18 12:51:21 +02:00
2008-07-16 10:54:39 +02:00
2008-05-25 07:11:49 +02:00
2008-05-24 16:47:39 +02:00
2008-07-15 21:55:59 +02:00
2007-10-11 11:17:24 +02:00
2008-07-18 17:22:04 -07:00
2008-04-19 19:19:54 +02:00
2008-07-15 11:18:03 +02:00
2008-04-27 12:00:28 +03:00
2008-07-20 12:42:37 +03:00
2008-07-18 22:02:58 +02:00
2008-07-14 16:11:52 +02:00
2008-07-14 16:11:52 +02:00
2008-07-21 16:45:56 +02:00
2008-04-17 17:40:49 +02:00
2008-06-12 21:25:51 +02:00
2008-07-23 18:37:44 -07:00
2008-05-30 15:45:17 -07:00
2007-10-11 11:17:01 +02:00
2008-07-24 10:47:21 -07:00
2008-07-20 09:25:52 +02:00
2008-07-21 21:54:46 -07:00
Merge branches 'x86/urgent', 'x86/amd-iommu', 'x86/apic', 'x86/cleanups', 'x86/core', 'x86/cpu', 'x86/fixmap', 'x86/gart', 'x86/kprobes', 'x86/memtest', 'x86/modules', 'x86/nmi', 'x86/pat', 'x86/reboot', 'x86/setup', 'x86/step', 'x86/unify-pci', 'x86/uv', 'x86/xen' and 'xen-64bit' into x86/for-linus
2008-07-21 16:37:17 +02:00
2008-07-20 09:25:52 +02:00
2008-04-29 08:06:07 -07:00
2008-07-08 13:13:15 +02:00
2008-07-08 13:15:52 +02:00
2008-07-22 10:41:18 +02:00
2008-07-11 11:00:54 +02:00
2008-07-21 21:54:53 -07:00
2008-07-21 21:54:53 -07:00
2008-07-11 11:00:54 +02:00
2008-07-11 11:00:54 +02:00
2007-10-11 11:17:01 +02:00
2008-01-30 13:30:18 +01:00
2008-07-08 12:50:05 +02:00
2008-07-14 16:11:52 +02:00
2008-07-16 10:54:25 +02:00
Merge branches 'x86/urgent', 'x86/amd-iommu', 'x86/apic', 'x86/cleanups', 'x86/core', 'x86/cpu', 'x86/fixmap', 'x86/gart', 'x86/kprobes', 'x86/memtest', 'x86/modules', 'x86/nmi', 'x86/pat', 'x86/reboot', 'x86/setup', 'x86/step', 'x86/unify-pci', 'x86/uv', 'x86/xen' and 'xen-64bit' into x86/for-linus
2008-07-21 16:37:17 +02:00
2008-07-16 12:15:17 -07:00
2008-06-24 21:02:31 +03:00
2008-07-15 10:39:57 -07:00
2008-05-25 08:58:30 +02:00
2008-07-23 18:37:44 -07:00
2008-04-17 17:41:29 +02:00
2008-04-17 17:41:29 +02:00
2008-06-12 18:05:42 -07:00
2008-01-31 22:05:45 +01:00
2008-07-21 21:35:38 +02:00
2008-07-22 09:05:45 +02:00
2008-04-17 17:40:46 +02:00
2008-07-23 19:36:53 -07:00
2008-07-23 19:36:53 -07:00
2008-07-06 14:01:50 +02:00
2008-07-23 18:37:44 -07:00
2008-06-26 11:21:54 +02:00
2008-06-30 09:20:55 +02:00
2008-07-16 12:15:17 -07:00
2008-06-10 11:34:42 +02:00
2008-06-10 12:34:54 +02:00
2008-05-03 13:50:33 -07:00
2008-04-17 17:40:48 +02:00
2008-07-24 10:47:28 -07:00
2007-10-17 20:16:12 +02:00
2008-04-17 17:41:15 +02:00
2008-02-14 23:30:20 +01:00
2008-07-20 09:25:52 +02:00
2008-07-09 07:43:27 +02:00
2008-06-26 11:24:38 +02:00
2008-07-15 21:55:59 +02:00
2008-07-08 12:23:31 +02:00
2008-04-10 17:28:26 -07:00
2008-01-30 13:31:52 +01:00
2008-02-19 16:18:30 +01:00
2008-04-26 17:35:47 +02:00
2008-04-17 17:41:37 +02:00
2008-05-25 10:55:11 +02:00
2008-07-18 18:51:57 +02:00
2008-07-18 18:51:57 +02:00
2008-01-30 13:33:24 +01:00
2008-07-15 22:46:47 +02:00
2007-10-11 11:17:24 +02:00
2008-07-20 09:18:17 +02:00
2008-04-17 17:41:33 +02:00
2008-07-18 12:51:21 +02:00
2008-07-09 07:43:28 +02:00
2008-07-14 15:28:10 -07:00
2008-07-14 15:28:10 -07:00
2007-10-11 11:17:01 +02:00
2008-05-25 08:58:24 +02:00
2008-07-15 21:55:59 +02:00
2008-07-14 16:11:52 +02:00