os390-syscalls.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* Copyright libuv project contributors. All rights reserved.
  2. *
  3. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4. * of this software and associated documentation files (the "Software"), to
  5. * deal in the Software without restriction, including without limitation the
  6. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  7. * sell copies of the Software, and to permit persons to whom the Software is
  8. * furnished to do so, subject to the following conditions:
  9. *
  10. * The above copyright notice and this permission notice shall be included in
  11. * all copies or substantial portions of the Software.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  18. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  19. * IN THE SOFTWARE.
  20. */
  21. #ifndef UV_OS390_SYSCALL_H_
  22. #define UV_OS390_SYSCALL_H_
  23. #include "uv.h"
  24. #include "internal.h"
  25. #include <dirent.h>
  26. #include <poll.h>
  27. #include <pthread.h>
  28. #define EPOLL_CTL_ADD 1
  29. #define EPOLL_CTL_DEL 2
  30. #define EPOLL_CTL_MOD 3
  31. #define MAX_EPOLL_INSTANCES 256
  32. #define MAX_ITEMS_PER_EPOLL 1024
  33. #define UV__O_CLOEXEC 0x80000
  34. struct epoll_event {
  35. int events;
  36. int fd;
  37. };
  38. typedef struct {
  39. QUEUE member;
  40. struct pollfd* items;
  41. unsigned long size;
  42. int msg_queue;
  43. } uv__os390_epoll;
  44. /* epoll api */
  45. uv__os390_epoll* epoll_create1(int flags);
  46. int epoll_ctl(uv__os390_epoll* ep, int op, int fd, struct epoll_event *event);
  47. int epoll_wait(uv__os390_epoll* ep, struct epoll_event *events, int maxevents, int timeout);
  48. int epoll_file_close(int fd);
  49. /* utility functions */
  50. int nanosleep(const struct timespec* req, struct timespec* rem);
  51. int scandir(const char* maindir, struct dirent*** namelist,
  52. int (*filter)(const struct dirent *),
  53. int (*compar)(const struct dirent **,
  54. const struct dirent **));
  55. char *mkdtemp(char* path);
  56. ssize_t os390_readlink(const char* path, char* buf, size_t len);
  57. size_t strnlen(const char* str, size_t maxlen);
  58. #endif /* UV_OS390_SYSCALL_H_ */