File:  [DVB] / dietlibc / lib / eventfd.c
Revision 1.1: download - view: text, annotated - select for diffs
Mon Sep 8 10:11:21 2014 UTC (9 years, 9 months ago) by leitner
Branches: MAIN
CVS tags: HEAD
  add eventfd, inotify_init1, epoll_init1, accept4, recvmmsg, sendmmsg
  add dup3, fanotify_init, fanotify_mark, signalfd4, timerfd_settime
  add timerfd_gettime

#include <sys/types.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/eventfd.h>

extern int __eventfd(unsigned int count);
extern int __eventfd2(unsigned int count,int flags);

int eventfd(unsigned int count,int flags) {
  int r=__eventfd2(count,flags);
  if (r==-1 && errno==ENOSYS) {
    r=__eventfd(count);
    if (r!=-1 && flags) {
      int x;
      x=fcntl(r,F_SETFD,flags);
      if (x==-1)
	close(r);
    }
  }
  return r;
}

LinuxTV legacy CVS <linuxtv.org/cvs>