epoll.c 981 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * epoll_create() / epoll_ctl() / epoll_wait() for uClibc
  4. *
  5. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  6. *
  7. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  8. */
  9. #include "syscalls.h"
  10. #include <sys/epoll.h>
  11. /*
  12. * epoll_create()
  13. */
  14. #ifdef __NR_epoll_create
  15. _syscall1(int, epoll_create, int, size);
  16. #else
  17. int epoll_create(int size)
  18. {
  19. __set_errno(ENOSYS);
  20. return -1;
  21. }
  22. #endif
  23. /*
  24. * epoll_ctl()
  25. */
  26. #ifdef __NR_epoll_ctl
  27. _syscall4(int,epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event *, event);
  28. #else
  29. int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)
  30. {
  31. __set_errno(ENOSYS);
  32. return -1;
  33. }
  34. #endif
  35. /*
  36. * epoll_wait()
  37. */
  38. #ifdef __NR_epoll_wait
  39. _syscall4(int, epoll_wait, int, epfd, struct epoll_event *, events, int, maxevents, int, timeout);
  40. #else
  41. int epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout)
  42. {
  43. __set_errno(ENOSYS);
  44. return -1;
  45. }
  46. #endif