33 #pragma linkage(BPX4CTW, OS)
34 #pragma linkage(BPX1CTW, OS)
42 int (*compar)(
const struct dirent**,
54 mdir = opendir(maindir);
70 if (nl_copy ==
NULL) {
81 (
int (*)(
const void *,
const void *)) compar);
113 unsigned int newsize;
118 if (len <= lst->
size)
134 for (
i = lst->
size;
i < newsize; ++
i)
138 newlst[newsize - 1] = event;
152 lst->
msg_queue = msgget(IPC_PRIVATE, 0600 | IPC_CREAT);
186 memcpy(&
once, &child_once,
sizeof(child_once));
225 lst->
items[lst->
size - 1].events = POLLIN;
263 lst->
items[
fd].events =
event->events;
271 lst->
items[
fd].events =
event->events;
280 #define EP_MAX_PFDS (ULONG_MAX / sizeof(struct pollfd))
281 #define EP_MAX_EVENTS (INT_MAX / sizeof(struct epoll_event))
293 if (!lst || !lst->
items || !events) {
309 _SET_FDS_MSGS(
size, 1, lst->
size - 1);
311 _SET_FDS_MSGS(
size, 0, 0);
319 pollret = _NFDS(pollret) + _NMSGS(pollret);
323 msg_fd = pfds[lst->
size - 1];
325 i < lst->
size &&
i < maxevents && reventcount < pollret; ++
i) {
330 if (pfd->fd == -1 || pfd->revents == 0)
336 if (pfd->revents & POLLIN && pfd->revents & POLLOUT)
338 else if (pfd->revents & (POLLIN | POLLOUT))
342 events[nevents++] = ev;
345 if (msg_fd.revents != 0 && msg_fd.fd != -1)
347 events[nevents - 1].
is_msg = 1;
395 seconds =
req->tv_sec;
401 BPX4CTW(&seconds, &nano, &events, &secrem, &nanorem, &rv, &
err, &rsn);
403 BPX1CTW(&seconds, &nano, &events, &secrem, &nanorem, &rv, &
err, &rsn);
425 static const char* tempchars =
426 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
427 static const size_t num_chars = 62;
428 static const size_t num_x = 6;
430 unsigned int tries,
i;
439 if (
len < num_x || strncmp(ep - num_x,
"XXXXXX", num_x)) {
451 if (
read(
fd, &
v,
sizeof(
v)) !=
sizeof(
v))
455 for (
i = 0;
i < num_x;
i++) {
456 *cp++ = tempchars[
v % num_chars];
491 char realpathstr[PATH_MAX + 1];
494 if (tmpbuf ==
NULL) {
505 if (rlen < 3 || strncmp(
"/$", tmpbuf, 2) != 0) {
517 delimiter = strchr(tmpbuf + 2,
'/');
518 if (delimiter ==
NULL)
520 delimiter = strchr(tmpbuf + 2,
'\0');
523 old_delim = *delimiter;
525 if (realpath(tmpbuf, realpathstr) ==
NULL) {
531 realpathstr[PATH_MAX] =
'\0';
534 *delimiter = old_delim;
535 plen = strlen(delimiter);
536 vlen = strlen(realpathstr);
540 errno = ENAMETOOLONG;
static static fork const void static count static fd const char const char static newpath const char static path const char path
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec req
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
static static sync static getppid static getegid const char static filename char static len readlink
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig mkdir
static const char struct stat static buf struct stat static buf static vhangup int struct rusage static rusage struct sysinfo static info unsigned static __unused struct utsname static buf const char static size const char static name static pid unsigned static persona static fsgid const void static flags const struct iovec static count static fd const void static len static munlockall struct sched_param static p static sched_yield static policy const struct timespec struct timespec static rem uid_t uid_t uid_t static suid poll
static static fork const void static count static fd const char static mode const char static pathname const char static path const char static dev const char static group static getpid static getuid void void static data static pause const char static mode static sync const char const char static newpath const char static pathname unsigned long static filedes void static end_data_segment static handler static getegid char static len static pgid const char static path static newfd static getpgrp static euid const sigset_t static mask const char static len const gid_t static list const char const char static newpath const char static library readdir
static void struct sockaddr socklen_t static fromlen static backlog static fork char char char static envp int struct rusage static rusage struct utsname static buf semid
#define header(is_bt, len_min, ret_op)
assert(limit<=UINT32_MAX/2)
int sem_wait(UV_PLATFORM_SEM_T *semid)
int nanosleep(const struct timespec *req, struct timespec *rem)
int sem_destroy(UV_PLATFORM_SEM_T *semid)
void epoll_queue_close(uv__os390_epoll *lst)
static QUEUE global_epoll_queue
static void init_message_queue(uv__os390_epoll *lst)
static void maybe_resize(uv__os390_epoll *lst, unsigned int len)
int sem_trywait(UV_PLATFORM_SEM_T *semid)
int sem_post(UV_PLATFORM_SEM_T *semid)
ssize_t os390_readlink(const char *path, char *buf, size_t len)
static void child_fork(void)
static unsigned int next_power_of_two(unsigned int val)
int epoll_file_close(int fd)
int scandir(const char *maindir, struct dirent ***namelist, int(*filter)(const struct dirent *), int(*compar)(const struct dirent **, const struct dirent **))
static void epoll_init(void)
int sem_init(UV_PLATFORM_SEM_T *semid, int pshared, unsigned int value)
int epoll_wait(uv__os390_epoll *lst, struct epoll_event *events, int maxevents, int timeout)
int epoll_ctl(uv__os390_epoll *lst, int op, int fd, struct epoll_event *event)
static void after_fork(void)
size_t strnlen(const char *str, size_t maxlen)
static void before_fork(void)
uv__os390_epoll * epoll_create1(int flags)
static uv_mutex_t global_epoll_lock
char * mkdtemp(char *path)
#define UV_PLATFORM_SEM_T
static bool filter(RzParse *p, ut64 addr, RzFlag *f, RzAnalysisHint *hint, char *data, char *str, int len, bool big_endian)
void qsort(void *a, size_t n, size_t es, int(*cmp)(const void *, const void *))
#define QUEUE_FOREACH(q, h)
#define QUEUE_DATA(ptr, type, field)
#define QUEUE_INSERT_TAIL(h, q)
static struct sockaddr static addrlen static backlog const void static flags void flags
static struct sockaddr static addrlen static backlog const void msg
pthread_mutex_t uv_mutex_t
void error(const char *msg)
void * uv__reallocf(void *ptr, size_t size)
void * uv__realloc(void *ptr, size_t size)
void * uv__malloc(size_t size)
UV_EXTERN void uv_mutex_lock(uv_mutex_t *handle)
UV_EXTERN void uv_once(uv_once_t *guard, void(*callback)(void))
UV_EXTERN void uv_mutex_destroy(uv_mutex_t *handle)
UV_EXTERN void uv_mutex_unlock(uv_mutex_t *handle)
UV_EXTERN int uv_mutex_init(uv_mutex_t *handle)
static const z80_opcode fd[]
int read(izstream &zs, T *x, Items items)