Path: blob/master/Utilities/cmlibuv/src/unix/os390-syscalls.h
3156 views
/* Copyright libuv project contributors. All rights reserved.1*2* Permission is hereby granted, free of charge, to any person obtaining a copy3* of this software and associated documentation files (the "Software"), to4* deal in the Software without restriction, including without limitation the5* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or6* sell copies of the Software, and to permit persons to whom the Software is7* furnished to do so, subject to the following conditions:8*9* The above copyright notice and this permission notice shall be included in10* all copies or substantial portions of the Software.11*12* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR13* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,14* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE15* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER16* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING17* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS18* IN THE SOFTWARE.19*/202122#ifndef UV_OS390_SYSCALL_H_23#define UV_OS390_SYSCALL_H_2425#include "uv.h"26#include "internal.h"27#include <dirent.h>28#include <poll.h>29#include <pthread.h>30#include "zos-base.h"3132#define EPOLL_CTL_ADD 133#define EPOLL_CTL_DEL 234#define EPOLL_CTL_MOD 335#define MAX_EPOLL_INSTANCES 25636#define MAX_ITEMS_PER_EPOLL 10243738#define UV__O_CLOEXEC 0x800003940struct epoll_event {41int events;42int fd;43int is_msg;44};4546typedef struct {47QUEUE member;48struct pollfd* items;49unsigned long size;50int msg_queue;51} uv__os390_epoll;5253/* epoll api */54uv__os390_epoll* epoll_create1(int flags);55int epoll_ctl(uv__os390_epoll* ep, int op, int fd, struct epoll_event *event);56int epoll_wait(uv__os390_epoll* ep, struct epoll_event *events, int maxevents, int timeout);57int epoll_file_close(int fd);5859/* utility functions */60int scandir(const char* maindir, struct dirent*** namelist,61int (*filter)(const struct dirent *),62int (*compar)(const struct dirent **,63const struct dirent **));64char *mkdtemp(char* path);65ssize_t os390_readlink(const char* path, char* buf, size_t len);66size_t strnlen(const char* str, size_t maxlen);67int sem_init(UV_PLATFORM_SEM_T* semid, int pshared, unsigned int value);68int sem_destroy(UV_PLATFORM_SEM_T* semid);69int sem_post(UV_PLATFORM_SEM_T* semid);70int sem_trywait(UV_PLATFORM_SEM_T* semid);71int sem_wait(UV_PLATFORM_SEM_T* semid);72void uv__os390_cleanup(void);7374#endif /* UV_OS390_SYSCALL_H_ */757677