login
Header Space

 
 

[PATCH] flag parameters add-on: remove epoll_create size param

Previous thread: none

Next thread: [PATCH] MMC: Fix omap compile by replacing dev_name with dma_dev_name by Tony Lindgren on Tuesday, May 6, 2008 - 7:36 pm. (2 messages)
To: <linux-kernel@...>
Cc: <akpm@...>, <davidel@...>, <torvalds@...>
Date: Tuesday, May 6, 2008 - 7:36 pm

This patch is to be applied on top of the series which adds the flag
parameters.  It removes the size parameter from the new epoll_create
syscall and renames the syscall itself.  The updated test program
follows.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include &lt;fcntl.h&gt;
#include &lt;stdio.h&gt;
#include &lt;time.h&gt;
#include &lt;unistd.h&gt;
#include &lt;sys/syscall.h&gt;

#ifndef __NR_epoll_create2
# ifdef __x86_64__
#  define __NR_epoll_create2 291
# elif defined __i386__
#  define __NR_epoll_create2 329
# else
#  error "need __NR_epoll_create2"
# endif
#endif

#define EPOLL_CLOEXEC O_CLOEXEC

int
main (void)
{
  int fd = syscall (__NR_epoll_create2, 0);
  if (fd == -1)
    {
      puts ("epoll_create2(0) failed");
      return 1;
    }
  int coe = fcntl (fd, F_GETFD);
  if (coe == -1)
    {
      puts ("fcntl failed");
      return 1;
    }
  if (coe &amp; FD_CLOEXEC)
    {
      puts ("epoll_create2(0) set close-on-exec flag");
      return 1;
    }
  close (fd);

  fd = syscall (__NR_epoll_create2, EPOLL_CLOEXEC);
  if (fd == -1)
    {
      puts ("epoll_create2(EPOLL_CLOEXEC) failed");
      return 1;
    }
  coe = fcntl (fd, F_GETFD);
  if (coe == -1)
    {
      puts ("fcntl failed");
      return 1;
    }
  if ((coe &amp; FD_CLOEXEC) == 0)
    {
      puts ("epoll_create2(EPOLL_CLOEXEC) set close-on-exec flag");
      return 1;
    }
  close (fd);

  puts ("OK");

  return 0;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 arch/x86/ia32/ia32entry.S          |    2 +-
 arch/x86/kernel/syscall_table_32.S |    2 +-
 fs/eventpoll.c                     |   18 ++++++++++--------
 include/asm-x86/unistd_32.h        |    2 +-
 include/asm-x86/unistd_64.h        |    4 ++--
 include/linux/eventpoll.h          |    2 +-
 include/linux/syscalls.h           |    2 +-
 7 files changed, 17 insertions(+), 15 deletions(-)


Signed-off-by: Ulrich Drepper &lt;drepper@redhat...
To: Ulrich Drepper <drepper@...>
Cc: Linux Kernel Mailing List <linux-kernel@...>, Andrew Morton <akpm@...>, Linus Torvalds <torvalds@...>, Michael Kerrisk <mtk.manpages@...>, Matthew Helsley <matthltc@...>
Date: Tuesday, May 6, 2008 - 8:01 pm

We're driving Uli crazy :)
Thank you Matthew and Michael for noticing this before it went in.

Acked-by: Davide Libenzi &lt;davidel@xmailserver.org&gt;



- Davide


--
Previous thread: none

Next thread: [PATCH] MMC: Fix omap compile by replacing dev_name with dma_dev_name by Tony Lindgren on Tuesday, May 6, 2008 - 7:36 pm. (2 messages)
speck-geostationary