Blame src/unix/os390-syscalls.h

Packit Service 7c31a4
/* Copyright libuv project contributors. All rights reserved.
Packit Service 7c31a4
 *
Packit Service 7c31a4
 * Permission is hereby granted, free of charge, to any person obtaining a copy
Packit Service 7c31a4
 * of this software and associated documentation files (the "Software"), to
Packit Service 7c31a4
 * deal in the Software without restriction, including without limitation the
Packit Service 7c31a4
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
Packit Service 7c31a4
 * sell copies of the Software, and to permit persons to whom the Software is
Packit Service 7c31a4
 * furnished to do so, subject to the following conditions:
Packit Service 7c31a4
 *
Packit Service 7c31a4
 * The above copyright notice and this permission notice shall be included in
Packit Service 7c31a4
 * all copies or substantial portions of the Software.
Packit Service 7c31a4
 *
Packit Service 7c31a4
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Packit Service 7c31a4
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Packit Service 7c31a4
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Packit Service 7c31a4
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
Packit Service 7c31a4
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
Packit Service 7c31a4
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
Packit Service 7c31a4
 * IN THE SOFTWARE.
Packit Service 7c31a4
 */
Packit Service 7c31a4
Packit Service 7c31a4
Packit Service 7c31a4
#ifndef UV_OS390_SYSCALL_H_
Packit Service 7c31a4
#define UV_OS390_SYSCALL_H_
Packit Service 7c31a4
Packit Service 7c31a4
#include "uv.h"
Packit Service 7c31a4
#include "internal.h"
Packit Service 7c31a4
#include <dirent.h>
Packit Service 7c31a4
#include <poll.h>
Packit Service 7c31a4
#include <pthread.h>
Packit Service 7c31a4
Packit Service 7c31a4
#define EPOLL_CTL_ADD             1
Packit Service 7c31a4
#define EPOLL_CTL_DEL             2
Packit Service 7c31a4
#define EPOLL_CTL_MOD             3
Packit Service 7c31a4
#define MAX_EPOLL_INSTANCES       256
Packit Service 7c31a4
#define MAX_ITEMS_PER_EPOLL       1024
Packit Service 7c31a4
Packit Service 7c31a4
#define UV__O_CLOEXEC             0x80000
Packit Service 7c31a4
Packit Service 7c31a4
struct epoll_event {
Packit Service 7c31a4
  int events;
Packit Service 7c31a4
  int fd;
Packit Service 7c31a4
  int is_msg;
Packit Service 7c31a4
};
Packit Service 7c31a4
Packit Service 7c31a4
typedef struct {
Packit Service 7c31a4
  QUEUE member;
Packit Service 7c31a4
  struct pollfd* items;
Packit Service 7c31a4
  unsigned long size;
Packit Service 7c31a4
  int msg_queue;
Packit Service 7c31a4
} uv__os390_epoll;
Packit Service 7c31a4
Packit Service 7c31a4
/* epoll api */
Packit Service 7c31a4
uv__os390_epoll* epoll_create1(int flags);
Packit Service 7c31a4
int epoll_ctl(uv__os390_epoll* ep, int op, int fd, struct epoll_event *event);
Packit Service 7c31a4
int epoll_wait(uv__os390_epoll* ep, struct epoll_event *events, int maxevents, int timeout);
Packit Service 7c31a4
int epoll_file_close(int fd);
Packit Service 7c31a4
Packit Service 7c31a4
/* utility functions */
Packit Service 7c31a4
int nanosleep(const struct timespec* req, struct timespec* rem);
Packit Service 7c31a4
int scandir(const char* maindir, struct dirent*** namelist,
Packit Service 7c31a4
            int (*filter)(const struct dirent *),
Packit Service 7c31a4
            int (*compar)(const struct dirent **,
Packit Service 7c31a4
            const struct dirent **));
Packit Service 7c31a4
char *mkdtemp(char* path);
Packit Service 7c31a4
ssize_t os390_readlink(const char* path, char* buf, size_t len);
Packit Service 7c31a4
size_t strnlen(const char* str, size_t maxlen);
Packit Service 7c31a4
int sem_init(UV_PLATFORM_SEM_T* semid, int pshared, unsigned int value);
Packit Service 7c31a4
int sem_destroy(UV_PLATFORM_SEM_T* semid);
Packit Service 7c31a4
int sem_post(UV_PLATFORM_SEM_T* semid);
Packit Service 7c31a4
int sem_trywait(UV_PLATFORM_SEM_T* semid);
Packit Service 7c31a4
int sem_wait(UV_PLATFORM_SEM_T* semid);
Packit Service 7c31a4
Packit Service 7c31a4
#endif /* UV_OS390_SYSCALL_H_ */