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; \
325 struct uv__queue queue; \
331#define UV_GETADDRINFO_PRIVATE_FIELDS \
332 struct uv__work work_req; \
333 uv_getaddrinfo_cb cb; \
334 struct addrinfo* hints; \
337 struct addrinfo* addrinfo; \
340#define UV_GETNAMEINFO_PRIVATE_FIELDS \
341 struct uv__work work_req; \
342 uv_getnameinfo_cb getnameinfo_cb; \
343 struct sockaddr_storage storage; \
345 char host[NI_MAXHOST]; \
346 char service[NI_MAXSERV]; \
349#define UV_PROCESS_PRIVATE_FIELDS \
350 struct uv__queue queue; \
353#define UV_FS_PRIVATE_FIELDS \
354 const char *new_path; \
358 unsigned int nbufs; \
365 struct uv__work work_req; \
366 uv_buf_t bufsml[4]; \
368#define UV_WORK_PRIVATE_FIELDS \
369 struct uv__work work_req;
371#define UV_TTY_PRIVATE_FIELDS \
372 struct termios orig_termios; \
375#define UV_SIGNAL_PRIVATE_FIELDS \
378 struct uv_signal_s* rbe_left; \
379 struct uv_signal_s* rbe_right; \
380 struct uv_signal_s* rbe_parent; \
384 unsigned int caught_signals; \
385 unsigned int dispatched_signals;
387#define UV_FS_EVENT_PRIVATE_FIELDS \
389 UV_PLATFORM_FS_EVENT_FIELDS \
393# define UV_FS_O_APPEND O_APPEND
395# define UV_FS_O_APPEND 0
398# define UV_FS_O_CREAT O_CREAT
400# define UV_FS_O_CREAT 0
403#if defined(__linux__) && defined(__arm__)
404# define UV_FS_O_DIRECT 0x10000
405#elif defined(__linux__) && defined(__m68k__)
406# define UV_FS_O_DIRECT 0x10000
407#elif defined(__linux__) && defined(__mips__)
408# define UV_FS_O_DIRECT 0x08000
409#elif defined(__linux__) && defined(__powerpc__)
410# define UV_FS_O_DIRECT 0x20000
411#elif defined(__linux__) && defined(__s390x__)
412# define UV_FS_O_DIRECT 0x04000
413#elif defined(__linux__) && defined(__x86_64__)
414# define UV_FS_O_DIRECT 0x04000
415#elif defined(__linux__) && defined(__loongarch__)
416# define UV_FS_O_DIRECT 0x04000
417#elif defined(O_DIRECT)
418# define UV_FS_O_DIRECT O_DIRECT
420# define UV_FS_O_DIRECT 0
423#if defined(O_DIRECTORY)
424# define UV_FS_O_DIRECTORY O_DIRECTORY
426# define UV_FS_O_DIRECTORY 0
429# define UV_FS_O_DSYNC O_DSYNC
431# define UV_FS_O_DSYNC 0
434# define UV_FS_O_EXCL O_EXCL
436# define UV_FS_O_EXCL 0
439# define UV_FS_O_EXLOCK O_EXLOCK
441# define UV_FS_O_EXLOCK 0
443#if defined(O_NOATIME)
444# define UV_FS_O_NOATIME O_NOATIME
446# define UV_FS_O_NOATIME 0
449# define UV_FS_O_NOCTTY O_NOCTTY
451# define UV_FS_O_NOCTTY 0
453#if defined(O_NOFOLLOW)
454# define UV_FS_O_NOFOLLOW O_NOFOLLOW
456# define UV_FS_O_NOFOLLOW 0
458#if defined(O_NONBLOCK)
459# define UV_FS_O_NONBLOCK O_NONBLOCK
461# define UV_FS_O_NONBLOCK 0
464# define UV_FS_O_RDONLY O_RDONLY
466# define UV_FS_O_RDONLY 0
469# define UV_FS_O_RDWR O_RDWR
471# define UV_FS_O_RDWR 0
473#if defined(O_SYMLINK)
474# define UV_FS_O_SYMLINK O_SYMLINK
476# define UV_FS_O_SYMLINK 0
479# define UV_FS_O_SYNC O_SYNC
481# define UV_FS_O_SYNC 0
484# define UV_FS_O_TRUNC O_TRUNC
486# define UV_FS_O_TRUNC 0
489# define UV_FS_O_WRONLY O_WRONLY
491# define UV_FS_O_WRONLY 0
495#define UV_FS_O_FILEMAP 0
496#define UV_FS_O_RANDOM 0
497#define UV_FS_O_SHORT_LIVED 0
498#define UV_FS_O_SEQUENTIAL 0
499#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 win.h:238
size_t len
Definition unix.h:114
char * base
Definition win.h:240
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
UV_PLATFORM_SEM_T uv_sem_t
Definition unix.h:128
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
int uv_file
Definition win.h:243