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(__FreeBSD_kernel__) || \
55 defined(__OpenBSD__) || \
58#elif defined(__CYGWIN__) || \
59 defined(__MSYS__) || \
60 defined(__HAIKU__) || \
67# define NI_MAXHOST 1025
74#ifndef UV_IO_PRIVATE_PLATFORM_FIELDS
75# define UV_IO_PRIVATE_PLATFORM_FIELDS
96#ifndef UV_PLATFORM_SEM_T
97# define UV_PLATFORM_SEM_T sem_t
100#ifndef UV_PLATFORM_LOOP_FIELDS
101# define UV_PLATFORM_LOOP_FIELDS
104#ifndef UV_PLATFORM_FS_EVENT_FIELDS
105# define UV_PLATFORM_FS_EVENT_FIELDS
108#ifndef UV_STREAM_PRIVATE_PLATFORM_FIELDS
109# define UV_STREAM_PRIVATE_PLATFORM_FIELDS
123#define UV_ONCE_INIT PTHREAD_ONCE_INIT
134#if defined(_AIX) || \
135 defined(__OpenBSD__) || \
136 !defined(PTHREAD_BARRIER_SERIAL_THREAD)
148# if defined(PTHREAD_BARRIER_SERIAL_THREAD)
150 char pad[
sizeof(pthread_barrier_t) -
sizeof(
struct _uv_barrier*)];
163#define UV_DIR_PRIVATE_FIELDS \
166#if defined(DT_UNKNOWN)
167# define HAVE_DIRENT_TYPES
169# define UV__DT_FILE DT_REG
171# define UV__DT_FILE -1
174# define UV__DT_DIR DT_DIR
176# define UV__DT_DIR -2
179# define UV__DT_LINK DT_LNK
181# define UV__DT_LINK -3
184# define UV__DT_FIFO DT_FIFO
186# define UV__DT_FIFO -4
189# define UV__DT_SOCKET DT_SOCK
191# define UV__DT_SOCKET -5
194# define UV__DT_CHAR DT_CHR
196# define UV__DT_CHAR -6
199# define UV__DT_BLOCK DT_BLK
201# define UV__DT_BLOCK -7
213#define UV_LOOP_PRIVATE_FIELDS \
214 unsigned long flags; \
216 void* pending_queue[2]; \
217 void* watcher_queue[2]; \
219 unsigned int nwatchers; \
222 uv_mutex_t wq_mutex; \
223 uv_async_t wq_async; \
224 uv_rwlock_t cloexec_lock; \
225 uv_handle_t* closing_handles; \
226 void* process_handles[2]; \
227 void* prepare_handles[2]; \
228 void* check_handles[2]; \
229 void* idle_handles[2]; \
230 void* async_handles[2]; \
231 void (*async_unused)(void); \
232 uv__io_t async_io_watcher; \
236 unsigned int nelts; \
238 uint64_t timer_counter; \
240 int signal_pipefd[2]; \
241 uv__io_t signal_io_watcher; \
242 uv_signal_t child_watcher; \
244 UV_PLATFORM_LOOP_FIELDS \
246#define UV_REQ_TYPE_PRIVATE
248#define UV_REQ_PRIVATE_FIELDS
250#define UV_PRIVATE_REQ_TYPES
252#define UV_WRITE_PRIVATE_FIELDS \
254 unsigned int write_index; \
256 unsigned int nbufs; \
258 uv_buf_t bufsml[4]; \
260#define UV_CONNECT_PRIVATE_FIELDS \
263#define UV_SHUTDOWN_PRIVATE_FIELDS
265#define UV_UDP_SEND_PRIVATE_FIELDS \
267 struct sockaddr_storage addr; \
268 unsigned int nbufs; \
271 uv_udp_send_cb send_cb; \
272 uv_buf_t bufsml[4]; \
274#define UV_HANDLE_PRIVATE_FIELDS \
275 uv_handle_t* next_closing; \
276 unsigned int flags; \
278#define UV_STREAM_PRIVATE_FIELDS \
279 uv_connect_t *connect_req; \
280 uv_shutdown_t *shutdown_req; \
281 uv__io_t io_watcher; \
282 void* write_queue[2]; \
283 void* write_completed_queue[2]; \
284 uv_connection_cb connection_cb; \
288 UV_STREAM_PRIVATE_PLATFORM_FIELDS \
290#define UV_TCP_PRIVATE_FIELDS
292#define UV_UDP_PRIVATE_FIELDS \
293 uv_alloc_cb alloc_cb; \
294 uv_udp_recv_cb recv_cb; \
295 uv__io_t io_watcher; \
296 void* write_queue[2]; \
297 void* write_completed_queue[2]; \
299#define UV_PIPE_PRIVATE_FIELDS \
300 const char* pipe_fname;
302#define UV_POLL_PRIVATE_FIELDS \
305#define UV_PREPARE_PRIVATE_FIELDS \
306 uv_prepare_cb prepare_cb; \
309#define UV_CHECK_PRIVATE_FIELDS \
310 uv_check_cb check_cb; \
313#define UV_IDLE_PRIVATE_FIELDS \
314 uv_idle_cb idle_cb; \
317#define UV_ASYNC_PRIVATE_FIELDS \
318 uv_async_cb async_cb; \
322#define UV_TIMER_PRIVATE_FIELDS \
323 uv_timer_cb timer_cb; \
324 void* heap_node[3]; \
329#define UV_GETADDRINFO_PRIVATE_FIELDS \
330 struct uv__work work_req; \
331 uv_getaddrinfo_cb cb; \
332 struct addrinfo* hints; \
335 struct addrinfo* addrinfo; \
338#define UV_GETNAMEINFO_PRIVATE_FIELDS \
339 struct uv__work work_req; \
340 uv_getnameinfo_cb getnameinfo_cb; \
341 struct sockaddr_storage storage; \
343 char host[NI_MAXHOST]; \
344 char service[NI_MAXSERV]; \
347#define UV_PROCESS_PRIVATE_FIELDS \
351#define UV_FS_PRIVATE_FIELDS \
352 const char *new_path; \
356 unsigned int nbufs; \
363 struct uv__work work_req; \
364 uv_buf_t bufsml[4]; \
366#define UV_WORK_PRIVATE_FIELDS \
367 struct uv__work work_req;
369#define UV_TTY_PRIVATE_FIELDS \
370 struct termios orig_termios; \
373#define UV_SIGNAL_PRIVATE_FIELDS \
376 struct uv_signal_s* rbe_left; \
377 struct uv_signal_s* rbe_right; \
378 struct uv_signal_s* rbe_parent; \
382 unsigned int caught_signals; \
383 unsigned int dispatched_signals;
385#define UV_FS_EVENT_PRIVATE_FIELDS \
387 UV_PLATFORM_FS_EVENT_FIELDS \
391# define UV_FS_O_APPEND O_APPEND
393# define UV_FS_O_APPEND 0
396# define UV_FS_O_CREAT O_CREAT
398# define UV_FS_O_CREAT 0
401#if defined(__linux__) && defined(__arm__)
402# define UV_FS_O_DIRECT 0x10000
403#elif defined(__linux__) && defined(__m68k__)
404# define UV_FS_O_DIRECT 0x10000
405#elif defined(__linux__) && defined(__mips__)
406# define UV_FS_O_DIRECT 0x08000
407#elif defined(__linux__) && defined(__powerpc__)
408# define UV_FS_O_DIRECT 0x20000
409#elif defined(__linux__) && defined(__s390x__)
410# define UV_FS_O_DIRECT 0x04000
411#elif defined(__linux__) && defined(__x86_64__)
412# define UV_FS_O_DIRECT 0x04000
413#elif defined(O_DIRECT)
414# define UV_FS_O_DIRECT O_DIRECT
416# define UV_FS_O_DIRECT 0
419#if defined(O_DIRECTORY)
420# define UV_FS_O_DIRECTORY O_DIRECTORY
422# define UV_FS_O_DIRECTORY 0
425# define UV_FS_O_DSYNC O_DSYNC
427# define UV_FS_O_DSYNC 0
430# define UV_FS_O_EXCL O_EXCL
432# define UV_FS_O_EXCL 0
435# define UV_FS_O_EXLOCK O_EXLOCK
437# define UV_FS_O_EXLOCK 0
439#if defined(O_NOATIME)
440# define UV_FS_O_NOATIME O_NOATIME
442# define UV_FS_O_NOATIME 0
445# define UV_FS_O_NOCTTY O_NOCTTY
447# define UV_FS_O_NOCTTY 0
449#if defined(O_NOFOLLOW)
450# define UV_FS_O_NOFOLLOW O_NOFOLLOW
452# define UV_FS_O_NOFOLLOW 0
454#if defined(O_NONBLOCK)
455# define UV_FS_O_NONBLOCK O_NONBLOCK
457# define UV_FS_O_NONBLOCK 0
460# define UV_FS_O_RDONLY O_RDONLY
462# define UV_FS_O_RDONLY 0
465# define UV_FS_O_RDWR O_RDWR
467# define UV_FS_O_RDWR 0
469#if defined(O_SYMLINK)
470# define UV_FS_O_SYMLINK O_SYMLINK
472# define UV_FS_O_SYMLINK 0
475# define UV_FS_O_SYNC O_SYNC
477# define UV_FS_O_SYNC 0
480# define UV_FS_O_TRUNC O_TRUNC
482# define UV_FS_O_TRUNC 0
485# define UV_FS_O_WRONLY O_WRONLY
487# define UV_FS_O_WRONLY 0
491#define UV_FS_O_FILEMAP 0
492#define UV_FS_O_RANDOM 0
493#define UV_FS_O_SHORT_LIVED 0
494#define UV_FS_O_SEQUENTIAL 0
495#define UV_FS_O_TEMPORARY 0
unsigned out
Definition: unix.h:143
unsigned threshold
Definition: unix.h:141
uv_mutex_t mutex
Definition: unix.h:139
uv_cond_t cond
Definition: unix.h:140
unsigned in
Definition: unix.h:142
uv__io_cb cb
Definition: unix.h:87
void * watcher_queue[2]
Definition: unix.h:89
unsigned int events
Definition: unix.h:91
unsigned int pevents
Definition: unix.h:90
void * pending_queue[2]
Definition: unix.h:88
int fd
Definition: unix.h:92
struct _uv_barrier * b
Definition: unix.h:147
It should be possible to cast uv_buf_t[] to WSABUF[] see http://msdn.microsoft.com/en-us/library/ms74...
Definition: win.h:234
size_t len
Definition: unix.h:115
char * base
Definition: win.h:236
void * handle
Definition: unix.h:209
pthread_cond_t uv_cond_t
Definition: unix.h:130
uid_t uv_uid_t
Definition: unix.h:159
UV_PLATFORM_SEM_T uv_sem_t
Definition: unix.h:129
int uv_file
Definition: unix.h:118
pid_t uv_pid_t
Definition: unix.h:121
pthread_rwlock_t uv_rwlock_t
Definition: unix.h:128
pthread_key_t uv_key_t
Definition: unix.h:131
#define UV_IO_PRIVATE_PLATFORM_FIELDS
Definition: unix.h:75
pthread_mutex_t uv_mutex_t
Definition: unix.h:127
pthread_t uv_thread_t
Definition: unix.h:126
void(* uv__io_cb)(struct uv_loop_s *loop, struct uv__io_s *w, unsigned int events)
Definition: unix.h:81
pthread_once_t uv_once_t
Definition: unix.h:125
int uv_os_fd_t
Definition: unix.h:120
gid_t uv_gid_t
Definition: unix.h:158
int uv_os_sock_t
Definition: unix.h:119
#define UV_PLATFORM_SEM_T
Definition: unix.h:97
CRITICAL_SECTION uv_mutex_t
Definition: win.h:248