Files
tegra-linux-noble/include/asm-x86
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-18 14:35:14 +02:00
2008-07-22 10:43:44 +02:00
2008-01-30 13:34:07 +01:00
2008-05-23 20:33:28 +02:00
2008-07-21 21:35:38 +02:00
2008-04-17 17:41:33 +02:00
2008-07-09 09:14:12 +02:00
2008-04-19 19:19:54 +02:00
2008-02-04 16:48:04 +01:00
2008-07-16 12:15:17 -07:00
2008-07-08 13:10:58 +02:00
2008-05-25 08:58:35 +02:00
2008-07-09 09:13:59 +02:00
2008-07-14 11:37:46 +02:00
2008-05-01 08:03:58 -07:00
2008-07-18 14:10:27 +02:00
2007-10-17 20:17:21 +02:00
2008-07-11 11:00:54 +02:00
2008-01-30 13:33:35 +01:00
2008-07-08 10:38:19 +02:00
2008-07-09 07:43:25 +02:00
2008-01-30 13:33:14 +01:00
2008-04-18 00:46:35 +02:00
2008-01-30 13:30:28 +01:00
2008-07-16 00:29:07 +02:00
2008-05-12 21:28:05 +02:00
2008-01-30 13:30:16 +01:00
2008-05-24 11:22:12 +02:00
2008-04-17 20:05:37 +02:00
2008-01-30 13:31:55 +01:00
2007-10-17 20:26:15 +02:00
2008-07-08 13:10:31 +02:00
2008-07-08 13:10:31 +02:00
2008-07-08 13:10:31 +02:00
2008-01-30 13:31:43 +01:00
2008-07-08 12:24:13 +02:00
2007-10-23 22:37:24 +02:00
2008-06-10 15:52:07 +02:00
2008-07-08 13:10:24 +02:00
2008-04-17 17:40:58 +02:00
2008-07-13 08:19:45 +02:00
2008-04-19 19:19:55 +02:00
2008-07-08 11:31:25 +02:00
2008-07-22 10:43:45 +02:00
2008-07-22 10:43:45 +02:00
2008-07-16 12:15:17 -07:00
2008-06-02 12:48:23 +02:00
2008-05-25 08:58:30 +02:00
2008-05-25 07:09:47 +02:00
2008-04-19 19:19:57 +02:00
2008-06-18 12:27:03 +02:00
2008-04-17 10:42:34 -04:00
2007-10-23 22:37:24 +02:00
2008-07-18 17:59:13 +02:00
2008-07-16 10:55:07 +02:00
2008-07-08 15:49:08 +02:00
2007-10-23 22:37:24 +02:00
2007-10-23 22:37:24 +02:00
2008-06-18 12:27:03 +02:00
2008-02-06 10:41:02 -08:00
2007-10-17 20:26:18 +02:00
2008-07-18 18:51:57 +02:00
2008-07-09 07:43:27 +02:00
2008-07-24 10:47:28 -07:00
2008-07-24 10:47:28 -07:00
2008-04-26 17:35:46 +02:00
2007-10-17 20:32:38 +02:00
2008-06-02 12:48:23 +02:00
2008-06-18 12:27:03 +02:00
2008-06-18 12:27:03 +02:00