30#include <sys/socket.h>
31#include <netinet/in.h>
32#include <netinet/tcp.h>
50#elif defined(__APPLE__)
52#elif defined(__DragonFly__) || \
53 defined(__FreeBSD__) || \
54 defined(__OpenBSD__) || \
57#elif defined(__CYGWIN__) || \
58 defined(__MSYS__) || \
59 defined(__HAIKU__) || \
66# define NI_MAXHOST 1025
73#ifndef UV_IO_PRIVATE_PLATFORM_FIELDS
74# define UV_IO_PRIVATE_PLATFORM_FIELDS
95#ifndef UV_PLATFORM_SEM_T
96# define UV_PLATFORM_SEM_T sem_t
99#ifndef UV_PLATFORM_LOOP_FIELDS
100# define UV_PLATFORM_LOOP_FIELDS
103#ifndef UV_PLATFORM_FS_EVENT_FIELDS
104# define UV_PLATFORM_FS_EVENT_FIELDS
107#ifndef UV_STREAM_PRIVATE_PLATFORM_FIELDS
108# define UV_STREAM_PRIVATE_PLATFORM_FIELDS
122#define UV_ONCE_INIT PTHREAD_ONCE_INIT
133#if defined(_AIX) || \
134 defined(__OpenBSD__) || \
135 !defined(PTHREAD_BARRIER_SERIAL_THREAD)
147# if defined(PTHREAD_BARRIER_SERIAL_THREAD)
149 char pad[
sizeof(pthread_barrier_t) -
sizeof(
struct _uv_barrier*)];
162#define UV_DIR_PRIVATE_FIELDS \
165#if defined(DT_UNKNOWN)
166# define HAVE_DIRENT_TYPES
168# define UV__DT_FILE DT_REG
170# define UV__DT_FILE -1
173# define UV__DT_DIR DT_DIR
175# define UV__DT_DIR -2
178# define UV__DT_LINK DT_LNK
180# define UV__DT_LINK -3
183# define UV__DT_FIFO DT_FIFO
185# define UV__DT_FIFO -4
188# define UV__DT_SOCKET DT_SOCK
190# define UV__DT_SOCKET -5
193# define UV__DT_CHAR DT_CHR
195# define UV__DT_CHAR -6
198# define UV__DT_BLOCK DT_BLK
200# define UV__DT_BLOCK -7
212#define UV_LOOP_PRIVATE_FIELDS \
213 unsigned long flags; \
215 struct uv__queue pending_queue; \
216 struct uv__queue watcher_queue; \
217 uv__io_t** watchers; \
218 unsigned int nwatchers; \
220 struct uv__queue wq; \
221 uv_mutex_t wq_mutex; \
222 uv_async_t wq_async; \
223 uv_rwlock_t cloexec_lock; \
224 uv_handle_t* closing_handles; \
225 struct uv__queue process_handles; \
226 struct uv__queue prepare_handles; \
227 struct uv__queue check_handles; \
228 struct uv__queue idle_handles; \
229 struct uv__queue async_handles; \
230 void (*async_unused)(void); \
231 uv__io_t async_io_watcher; \
235 unsigned int nelts; \
237 uint64_t timer_counter; \
239 int signal_pipefd[2]; \
240 uv__io_t signal_io_watcher; \
241 uv_signal_t child_watcher; \
243 UV_PLATFORM_LOOP_FIELDS \
245#define UV_REQ_TYPE_PRIVATE
247#define UV_REQ_PRIVATE_FIELDS
249#define UV_PRIVATE_REQ_TYPES
251#define UV_WRITE_PRIVATE_FIELDS \
252 struct uv__queue queue; \
253 unsigned int write_index; \
255 unsigned int nbufs; \
257 uv_buf_t bufsml[4]; \
259#define UV_CONNECT_PRIVATE_FIELDS \
260 struct uv__queue queue; \
262#define UV_SHUTDOWN_PRIVATE_FIELDS
264#define UV_UDP_SEND_PRIVATE_FIELDS \
265 struct uv__queue queue; \
266 struct sockaddr_storage addr; \
267 unsigned int nbufs; \
270 uv_udp_send_cb send_cb; \
271 uv_buf_t bufsml[4]; \
273#define UV_HANDLE_PRIVATE_FIELDS \
274 uv_handle_t* next_closing; \
275 unsigned int flags; \
277#define UV_STREAM_PRIVATE_FIELDS \
278 uv_connect_t *connect_req; \
279 uv_shutdown_t *shutdown_req; \
280 uv__io_t io_watcher; \
281 struct uv__queue write_queue; \
282 struct uv__queue write_completed_queue; \
283 uv_connection_cb connection_cb; \
287 UV_STREAM_PRIVATE_PLATFORM_FIELDS \
289#define UV_TCP_PRIVATE_FIELDS
291#define UV_UDP_PRIVATE_FIELDS \
292 uv_alloc_cb alloc_cb; \
293 uv_udp_recv_cb recv_cb; \
294 uv__io_t io_watcher; \
295 struct uv__queue write_queue; \
296 struct uv__queue write_completed_queue; \
298#define UV_PIPE_PRIVATE_FIELDS \
299 const char* pipe_fname;
301#define UV_POLL_PRIVATE_FIELDS \
304#define UV_PREPARE_PRIVATE_FIELDS \
305 uv_prepare_cb prepare_cb; \
306 struct uv__queue queue; \
308#define UV_CHECK_PRIVATE_FIELDS \
309 uv_check_cb check_cb; \
310 struct uv__queue queue; \
312#define UV_IDLE_PRIVATE_FIELDS \
313 uv_idle_cb idle_cb; \
314 struct uv__queue queue; \
316#define UV_ASYNC_PRIVATE_FIELDS \
317 uv_async_cb async_cb; \
318 struct uv__queue queue; \
321#define UV_TIMER_PRIVATE_FIELDS \
322 uv_timer_cb timer_cb; \
323 void* heap_node[3]; \
328#define UV_GETADDRINFO_PRIVATE_FIELDS \
329 struct uv__work work_req; \
330 uv_getaddrinfo_cb cb; \
331 struct addrinfo* hints; \
334 struct addrinfo* addrinfo; \
337#define UV_GETNAMEINFO_PRIVATE_FIELDS \
338 struct uv__work work_req; \
339 uv_getnameinfo_cb getnameinfo_cb; \
340 struct sockaddr_storage storage; \
342 char host[NI_MAXHOST]; \
343 char service[NI_MAXSERV]; \
346#define UV_PROCESS_PRIVATE_FIELDS \
347 struct uv__queue queue; \
350#define UV_FS_PRIVATE_FIELDS \
351 const char *new_path; \
355 unsigned int nbufs; \
362 struct uv__work work_req; \
363 uv_buf_t bufsml[4]; \
365#define UV_WORK_PRIVATE_FIELDS \
366 struct uv__work work_req;
368#define UV_TTY_PRIVATE_FIELDS \
369 struct termios orig_termios; \
372#define UV_SIGNAL_PRIVATE_FIELDS \
375 struct uv_signal_s* rbe_left; \
376 struct uv_signal_s* rbe_right; \
377 struct uv_signal_s* rbe_parent; \
381 unsigned int caught_signals; \
382 unsigned int dispatched_signals;
384#define UV_FS_EVENT_PRIVATE_FIELDS \
386 UV_PLATFORM_FS_EVENT_FIELDS \
390# define UV_FS_O_APPEND O_APPEND
392# define UV_FS_O_APPEND 0
395# define UV_FS_O_CREAT O_CREAT
397# define UV_FS_O_CREAT 0
400#if defined(__linux__) && defined(__arm__)
401# define UV_FS_O_DIRECT 0x10000
402#elif defined(__linux__) && defined(__m68k__)
403# define UV_FS_O_DIRECT 0x10000
404#elif defined(__linux__) && defined(__mips__)
405# define UV_FS_O_DIRECT 0x08000
406#elif defined(__linux__) && defined(__powerpc__)
407# define UV_FS_O_DIRECT 0x20000
408#elif defined(__linux__) && defined(__s390x__)
409# define UV_FS_O_DIRECT 0x04000
410#elif defined(__linux__) && defined(__x86_64__)
411# define UV_FS_O_DIRECT 0x04000
412#elif defined(__linux__) && defined(__loongarch__)
413# define UV_FS_O_DIRECT 0x04000
414#elif defined(O_DIRECT)
415# define UV_FS_O_DIRECT O_DIRECT
417# define UV_FS_O_DIRECT 0
420#if defined(O_DIRECTORY)
421# define UV_FS_O_DIRECTORY O_DIRECTORY
423# define UV_FS_O_DIRECTORY 0
426# define UV_FS_O_DSYNC O_DSYNC
428# define UV_FS_O_DSYNC 0
431# define UV_FS_O_EXCL O_EXCL
433# define UV_FS_O_EXCL 0
436# define UV_FS_O_EXLOCK O_EXLOCK
438# define UV_FS_O_EXLOCK 0
440#if defined(O_NOATIME)
441# define UV_FS_O_NOATIME O_NOATIME
443# define UV_FS_O_NOATIME 0
446# define UV_FS_O_NOCTTY O_NOCTTY
448# define UV_FS_O_NOCTTY 0
450#if defined(O_NOFOLLOW)
451# define UV_FS_O_NOFOLLOW O_NOFOLLOW
453# define UV_FS_O_NOFOLLOW 0
455#if defined(O_NONBLOCK)
456# define UV_FS_O_NONBLOCK O_NONBLOCK
458# define UV_FS_O_NONBLOCK 0
461# define UV_FS_O_RDONLY O_RDONLY
463# define UV_FS_O_RDONLY 0
466# define UV_FS_O_RDWR O_RDWR
468# define UV_FS_O_RDWR 0
470#if defined(O_SYMLINK)
471# define UV_FS_O_SYMLINK O_SYMLINK
473# define UV_FS_O_SYMLINK 0
476# define UV_FS_O_SYNC O_SYNC
478# define UV_FS_O_SYNC 0
481# define UV_FS_O_TRUNC O_TRUNC
483# define UV_FS_O_TRUNC 0
486# define UV_FS_O_WRONLY O_WRONLY
488# define UV_FS_O_WRONLY 0
492#define UV_FS_O_FILEMAP 0
493#define UV_FS_O_RANDOM 0
494#define UV_FS_O_SHORT_LIVED 0
495#define UV_FS_O_SEQUENTIAL 0
496#define UV_FS_O_TEMPORARY 0
unsigned out
Definition: unix.h:142
unsigned threshold
Definition: unix.h:140
uv_mutex_t mutex
Definition: unix.h:138
uv_cond_t cond
Definition: unix.h:139
unsigned in
Definition: unix.h:141
uv__io_cb cb
Definition: unix.h:86
struct uv__queue watcher_queue
Definition: unix.h:88
unsigned int events
Definition: unix.h:90
unsigned int pevents
Definition: unix.h:89
struct uv__queue pending_queue
Definition: unix.h:87
int fd
Definition: unix.h:91
struct _uv_barrier * b
Definition: unix.h:146
It should be possible to cast uv_buf_t[] to WSABUF[] see http://msdn.microsoft.com/en-us/library/ms74...
Definition: unix.h:112
size_t len
Definition: unix.h:114
char * base
Definition: unix.h:113
char * errmsg
Definition: unix.h:209
void * handle
Definition: unix.h:208
pthread_cond_t uv_cond_t
Definition: unix.h:129
uid_t uv_uid_t
Definition: unix.h:158
struct dirent uv__dirent_t
Definition: unix.h:160
UV_PLATFORM_SEM_T uv_sem_t
Definition: unix.h:128
int uv_file
Definition: unix.h:117
pid_t uv_pid_t
Definition: unix.h:120
pthread_rwlock_t uv_rwlock_t
Definition: unix.h:127
pthread_key_t uv_key_t
Definition: unix.h:130
#define UV_IO_PRIVATE_PLATFORM_FIELDS
Definition: unix.h:74
pthread_mutex_t uv_mutex_t
Definition: unix.h:126
pthread_t uv_thread_t
Definition: unix.h:125
void(* uv__io_cb)(struct uv_loop_s *loop, struct uv__io_s *w, unsigned int events)
Definition: unix.h:80
pthread_once_t uv_once_t
Definition: unix.h:124
int uv_os_fd_t
Definition: unix.h:119
gid_t uv_gid_t
Definition: unix.h:157
int uv_os_sock_t
Definition: unix.h:118
#define UV_PLATFORM_SEM_T
Definition: unix.h:96