Blame src/unix/os390-syscalls.h

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