25 #include <sys/types.h>
30 #include <sys/socket.h>
31 #include <netinet/in.h>
32 #include <netinet/tcp.h>
33 #include <arpa/inet.h>
40 #include <semaphore.h>
41 #include <sys/param.h>
48 #if defined(__linux__)
50 #elif defined (__MVS__)
52 #elif defined(__PASE__)
58 #elif defined(__APPLE__)
60 #elif defined(__DragonFly__) || \
61 defined(__FreeBSD__) || \
62 defined(__FreeBSD_kernel__) || \
63 defined(__OpenBSD__) || \
66 #elif defined(__CYGWIN__) || \
67 defined(__MSYS__) || \
70 #elif defined(__HAIKU__)
72 #elif defined(__QNX__)
77 # define NI_MAXHOST 1025
81 # define NI_MAXSERV 32
84 #ifndef UV_IO_PRIVATE_PLATFORM_FIELDS
85 # define UV_IO_PRIVATE_PLATFORM_FIELDS
106 #ifndef UV_PLATFORM_SEM_T
107 # define UV_PLATFORM_SEM_T sem_t
110 #ifndef UV_PLATFORM_LOOP_FIELDS
111 # define UV_PLATFORM_LOOP_FIELDS
114 #ifndef UV_PLATFORM_FS_EVENT_FIELDS
115 # define UV_PLATFORM_FS_EVENT_FIELDS
118 #ifndef UV_STREAM_PRIVATE_PLATFORM_FIELDS
119 # define UV_STREAM_PRIVATE_PLATFORM_FIELDS
133 #define UV_ONCE_INIT PTHREAD_ONCE_INIT
144 #if defined(_AIX) || \
145 defined(__OpenBSD__) || \
146 !defined(PTHREAD_BARRIER_SERIAL_THREAD)
158 # if defined(PTHREAD_BARRIER_SERIAL_THREAD)
160 char pad[
sizeof(pthread_barrier_t) -
sizeof(
struct _uv_barrier*)];
173 #define UV_DIR_PRIVATE_FIELDS \
176 #if defined(DT_UNKNOWN)
177 # define HAVE_DIRENT_TYPES
179 # define UV__DT_FILE DT_REG
181 # define UV__DT_FILE -1
184 # define UV__DT_DIR DT_DIR
186 # define UV__DT_DIR -2
189 # define UV__DT_LINK DT_LNK
191 # define UV__DT_LINK -3
193 # if defined(DT_FIFO)
194 # define UV__DT_FIFO DT_FIFO
196 # define UV__DT_FIFO -4
198 # if defined(DT_SOCK)
199 # define UV__DT_SOCKET DT_SOCK
201 # define UV__DT_SOCKET -5
204 # define UV__DT_CHAR DT_CHR
206 # define UV__DT_CHAR -6
209 # define UV__DT_BLOCK DT_BLK
211 # define UV__DT_BLOCK -7
223 #define UV_LOOP_PRIVATE_FIELDS \
224 unsigned long flags; \
226 void* pending_queue[2]; \
227 void* watcher_queue[2]; \
228 uv__io_t** watchers; \
229 unsigned int nwatchers; \
232 uv_mutex_t wq_mutex; \
233 uv_async_t wq_async; \
234 uv_rwlock_t cloexec_lock; \
235 uv_handle_t* closing_handles; \
236 void* process_handles[2]; \
237 void* prepare_handles[2]; \
238 void* check_handles[2]; \
239 void* idle_handles[2]; \
240 void* async_handles[2]; \
241 void (*async_unused)(void); \
242 uv__io_t async_io_watcher; \
246 unsigned int nelts; \
248 uint64_t timer_counter; \
250 int signal_pipefd[2]; \
251 uv__io_t signal_io_watcher; \
252 uv_signal_t child_watcher; \
254 UV_PLATFORM_LOOP_FIELDS \
256 #define UV_REQ_TYPE_PRIVATE
258 #define UV_REQ_PRIVATE_FIELDS
260 #define UV_PRIVATE_REQ_TYPES
262 #define UV_WRITE_PRIVATE_FIELDS \
264 unsigned int write_index; \
266 unsigned int nbufs; \
268 uv_buf_t bufsml[4]; \
270 #define UV_CONNECT_PRIVATE_FIELDS \
273 #define UV_SHUTDOWN_PRIVATE_FIELDS
275 #define UV_UDP_SEND_PRIVATE_FIELDS \
277 struct sockaddr_storage addr; \
278 unsigned int nbufs; \
281 uv_udp_send_cb send_cb; \
282 uv_buf_t bufsml[4]; \
284 #define UV_HANDLE_PRIVATE_FIELDS \
285 uv_handle_t* next_closing; \
286 unsigned int flags; \
288 #define UV_STREAM_PRIVATE_FIELDS \
289 uv_connect_t *connect_req; \
290 uv_shutdown_t *shutdown_req; \
291 uv__io_t io_watcher; \
292 void* write_queue[2]; \
293 void* write_completed_queue[2]; \
294 uv_connection_cb connection_cb; \
298 UV_STREAM_PRIVATE_PLATFORM_FIELDS \
300 #define UV_TCP_PRIVATE_FIELDS
302 #define UV_UDP_PRIVATE_FIELDS \
303 uv_alloc_cb alloc_cb; \
304 uv_udp_recv_cb recv_cb; \
305 uv__io_t io_watcher; \
306 void* write_queue[2]; \
307 void* write_completed_queue[2]; \
309 #define UV_PIPE_PRIVATE_FIELDS \
310 const char* pipe_fname;
312 #define UV_POLL_PRIVATE_FIELDS \
315 #define UV_PREPARE_PRIVATE_FIELDS \
316 uv_prepare_cb prepare_cb; \
319 #define UV_CHECK_PRIVATE_FIELDS \
320 uv_check_cb check_cb; \
323 #define UV_IDLE_PRIVATE_FIELDS \
324 uv_idle_cb idle_cb; \
327 #define UV_ASYNC_PRIVATE_FIELDS \
328 uv_async_cb async_cb; \
332 #define UV_TIMER_PRIVATE_FIELDS \
333 uv_timer_cb timer_cb; \
334 void* heap_node[3]; \
339 #define UV_GETADDRINFO_PRIVATE_FIELDS \
340 struct uv__work work_req; \
341 uv_getaddrinfo_cb cb; \
342 struct addrinfo* hints; \
345 struct addrinfo* addrinfo; \
348 #define UV_GETNAMEINFO_PRIVATE_FIELDS \
349 struct uv__work work_req; \
350 uv_getnameinfo_cb getnameinfo_cb; \
351 struct sockaddr_storage storage; \
353 char host[NI_MAXHOST]; \
354 char service[NI_MAXSERV]; \
357 #define UV_PROCESS_PRIVATE_FIELDS \
361 #define UV_FS_PRIVATE_FIELDS \
362 const char *new_path; \
366 unsigned int nbufs; \
373 struct uv__work work_req; \
374 uv_buf_t bufsml[4]; \
376 #define UV_WORK_PRIVATE_FIELDS \
377 struct uv__work work_req;
379 #define UV_TTY_PRIVATE_FIELDS \
380 struct termios orig_termios; \
383 #define UV_SIGNAL_PRIVATE_FIELDS \
386 struct uv_signal_s* rbe_left; \
387 struct uv_signal_s* rbe_right; \
388 struct uv_signal_s* rbe_parent; \
392 unsigned int caught_signals; \
393 unsigned int dispatched_signals;
395 #define UV_FS_EVENT_PRIVATE_FIELDS \
397 UV_PLATFORM_FS_EVENT_FIELDS \
400 #if defined(O_APPEND)
401 # define UV_FS_O_APPEND O_APPEND
403 # define UV_FS_O_APPEND 0
406 # define UV_FS_O_CREAT O_CREAT
408 # define UV_FS_O_CREAT 0
411 #if defined(__linux__) && defined(__arm__)
412 # define UV_FS_O_DIRECT 0x10000
413 #elif defined(__linux__) && defined(__m68k__)
414 # define UV_FS_O_DIRECT 0x10000
415 #elif defined(__linux__) && defined(__mips__)
416 # define UV_FS_O_DIRECT 0x08000
417 #elif defined(__linux__) && defined(__powerpc__)
418 # define UV_FS_O_DIRECT 0x20000
419 #elif defined(__linux__) && defined(__s390x__)
420 # define UV_FS_O_DIRECT 0x04000
421 #elif defined(__linux__) && defined(__x86_64__)
422 # define UV_FS_O_DIRECT 0x04000
423 #elif defined(O_DIRECT)
424 # define UV_FS_O_DIRECT O_DIRECT
426 # define UV_FS_O_DIRECT 0
429 #if defined(O_DIRECTORY)
430 # define UV_FS_O_DIRECTORY O_DIRECTORY
432 # define UV_FS_O_DIRECTORY 0
435 # define UV_FS_O_DSYNC O_DSYNC
437 # define UV_FS_O_DSYNC 0
440 # define UV_FS_O_EXCL O_EXCL
442 # define UV_FS_O_EXCL 0
444 #if defined(O_EXLOCK)
445 # define UV_FS_O_EXLOCK O_EXLOCK
447 # define UV_FS_O_EXLOCK 0
449 #if defined(O_NOATIME)
450 # define UV_FS_O_NOATIME O_NOATIME
452 # define UV_FS_O_NOATIME 0
454 #if defined(O_NOCTTY)
455 # define UV_FS_O_NOCTTY O_NOCTTY
457 # define UV_FS_O_NOCTTY 0
459 #if defined(O_NOFOLLOW)
460 # define UV_FS_O_NOFOLLOW O_NOFOLLOW
462 # define UV_FS_O_NOFOLLOW 0
464 #if defined(O_NONBLOCK)
465 # define UV_FS_O_NONBLOCK O_NONBLOCK
467 # define UV_FS_O_NONBLOCK 0
469 #if defined(O_RDONLY)
470 # define UV_FS_O_RDONLY O_RDONLY
472 # define UV_FS_O_RDONLY 0
475 # define UV_FS_O_RDWR O_RDWR
477 # define UV_FS_O_RDWR 0
479 #if defined(O_SYMLINK)
480 # define UV_FS_O_SYMLINK O_SYMLINK
482 # define UV_FS_O_SYMLINK 0
485 # define UV_FS_O_SYNC O_SYNC
487 # define UV_FS_O_SYNC 0
490 # define UV_FS_O_TRUNC O_TRUNC
492 # define UV_FS_O_TRUNC 0
494 #if defined(O_WRONLY)
495 # define UV_FS_O_WRONLY O_WRONLY
497 # define UV_FS_O_WRONLY 0
501 #define UV_FS_O_FILEMAP 0
502 #define UV_FS_O_RANDOM 0
503 #define UV_FS_O_SHORT_LIVED 0
504 #define UV_FS_O_SEQUENTIAL 0
505 #define UV_FS_O_TEMPORARY 0
static void pad(RzStrBuf *sb, ut32 count)
UV_PLATFORM_SEM_T uv_sem_t
pthread_rwlock_t uv_rwlock_t
#define UV_IO_PRIVATE_PLATFORM_FIELDS
pthread_mutex_t uv_mutex_t
void(* uv__io_cb)(struct uv_loop_s *loop, struct uv__io_s *w, unsigned int events)
#define UV_PLATFORM_SEM_T