WPILibC++  2019.1.1-beta-2-44-g608d824
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
win.h
1 /* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a copy
4  * of this software and associated documentation files (the "Software"), to
5  * deal in the Software without restriction, including without limitation the
6  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7  * sell copies of the Software, and to permit persons to whom the Software is
8  * furnished to do so, subject to the following conditions:
9  *
10  * The above copyright notice and this permission notice shall be included in
11  * all copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19  * IN THE SOFTWARE.
20  */
21 
22 #ifndef _WIN32_WINNT
23 # define _WIN32_WINNT 0x0600
24 #endif
25 
26 #if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED)
27 typedef intptr_t ssize_t;
28 # define _SSIZE_T_
29 # define _SSIZE_T_DEFINED
30 #endif
31 
32 #include <winsock2.h>
33 
34 #if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
35 typedef struct pollfd {
36  SOCKET fd;
37  short events;
38  short revents;
39 } WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;
40 #endif
41 
42 #ifndef LOCALE_INVARIANT
43 # define LOCALE_INVARIANT 0x007f
44 #endif
45 
46 #include <mswsock.h>
47 #include <ws2tcpip.h>
48 #include <windows.h>
49 
50 #include <process.h>
51 #include <signal.h>
52 #include <fcntl.h>
53 #include <sys/stat.h>
54 
55 #include <stdint.h>
56 
57 #include "uv/tree.h"
58 #include "uv/threadpool.h"
59 
60 #define MAX_PIPENAME_LEN 256
61 
62 #ifndef S_IFLNK
63 # define S_IFLNK 0xA000
64 #endif
65 
66 /* Additional signals supported by uv_signal and or uv_kill. The CRT defines
67  * the following signals already:
68  *
69  * #define SIGINT 2
70  * #define SIGILL 4
71  * #define SIGABRT_COMPAT 6
72  * #define SIGFPE 8
73  * #define SIGSEGV 11
74  * #define SIGTERM 15
75  * #define SIGBREAK 21
76  * #define SIGABRT 22
77  *
78  * The additional signals have values that are common on other Unix
79  * variants (Linux and Darwin)
80  */
81 #define SIGHUP 1
82 #define SIGKILL 9
83 #define SIGWINCH 28
84 
85 /* The CRT defines SIGABRT_COMPAT as 6, which equals SIGABRT on many unix-like
86  * platforms. However MinGW doesn't define it, so we do. */
87 #ifndef SIGABRT_COMPAT
88 # define SIGABRT_COMPAT 6
89 #endif
90 
91 /*
92  * Guids and typedefs for winsock extension functions
93  * Mingw32 doesn't have these :-(
94  */
95 #ifndef WSAID_ACCEPTEX
96 # define WSAID_ACCEPTEX \
97  {0xb5367df1, 0xcbac, 0x11cf, \
98  {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}}
99 
100 # define WSAID_CONNECTEX \
101  {0x25a207b9, 0xddf3, 0x4660, \
102  {0x8e, 0xe9, 0x76, 0xe5, 0x8c, 0x74, 0x06, 0x3e}}
103 
104 # define WSAID_GETACCEPTEXSOCKADDRS \
105  {0xb5367df2, 0xcbac, 0x11cf, \
106  {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}}
107 
108 # define WSAID_DISCONNECTEX \
109  {0x7fda2e11, 0x8630, 0x436f, \
110  {0xa0, 0x31, 0xf5, 0x36, 0xa6, 0xee, 0xc1, 0x57}}
111 
112 # define WSAID_TRANSMITFILE \
113  {0xb5367df0, 0xcbac, 0x11cf, \
114  {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}}
115 
116  typedef BOOL (PASCAL *LPFN_ACCEPTEX)
117  (SOCKET sListenSocket,
118  SOCKET sAcceptSocket,
119  PVOID lpOutputBuffer,
120  DWORD dwReceiveDataLength,
121  DWORD dwLocalAddressLength,
122  DWORD dwRemoteAddressLength,
123  LPDWORD lpdwBytesReceived,
124  LPOVERLAPPED lpOverlapped);
125 
126  typedef BOOL (PASCAL *LPFN_CONNECTEX)
127  (SOCKET s,
128  const struct sockaddr* name,
129  int namelen,
130  PVOID lpSendBuffer,
131  DWORD dwSendDataLength,
132  LPDWORD lpdwBytesSent,
133  LPOVERLAPPED lpOverlapped);
134 
135  typedef void (PASCAL *LPFN_GETACCEPTEXSOCKADDRS)
136  (PVOID lpOutputBuffer,
137  DWORD dwReceiveDataLength,
138  DWORD dwLocalAddressLength,
139  DWORD dwRemoteAddressLength,
140  LPSOCKADDR* LocalSockaddr,
141  LPINT LocalSockaddrLength,
142  LPSOCKADDR* RemoteSockaddr,
143  LPINT RemoteSockaddrLength);
144 
145  typedef BOOL (PASCAL *LPFN_DISCONNECTEX)
146  (SOCKET hSocket,
147  LPOVERLAPPED lpOverlapped,
148  DWORD dwFlags,
149  DWORD reserved);
150 
151  typedef BOOL (PASCAL *LPFN_TRANSMITFILE)
152  (SOCKET hSocket,
153  HANDLE hFile,
154  DWORD nNumberOfBytesToWrite,
155  DWORD nNumberOfBytesPerSend,
156  LPOVERLAPPED lpOverlapped,
157  LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers,
158  DWORD dwFlags);
159 
160  typedef PVOID RTL_SRWLOCK;
161  typedef RTL_SRWLOCK SRWLOCK, *PSRWLOCK;
162 #endif
163 
164 typedef int (WSAAPI* LPFN_WSARECV)
165  (SOCKET socket,
166  LPWSABUF buffers,
167  DWORD buffer_count,
168  LPDWORD bytes,
169  LPDWORD flags,
170  LPWSAOVERLAPPED overlapped,
171  LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine);
172 
173 typedef int (WSAAPI* LPFN_WSARECVFROM)
174  (SOCKET socket,
175  LPWSABUF buffers,
176  DWORD buffer_count,
177  LPDWORD bytes,
178  LPDWORD flags,
179  struct sockaddr* addr,
180  LPINT addr_len,
181  LPWSAOVERLAPPED overlapped,
182  LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine);
183 
184 #ifndef _NTDEF_
185  typedef LONG NTSTATUS;
186  typedef NTSTATUS *PNTSTATUS;
187 #endif
188 
189 #ifndef RTL_CONDITION_VARIABLE_INIT
190  typedef PVOID CONDITION_VARIABLE, *PCONDITION_VARIABLE;
191 #endif
192 
193 typedef struct _AFD_POLL_HANDLE_INFO {
194  HANDLE Handle;
195  ULONG Events;
196  NTSTATUS Status;
198 
199 typedef struct _AFD_POLL_INFO {
200  LARGE_INTEGER Timeout;
201  ULONG NumberOfHandles;
202  ULONG Exclusive;
203  AFD_POLL_HANDLE_INFO Handles[1];
205 
206 #define UV_MSAFD_PROVIDER_COUNT 3
207 
208 
213 typedef struct uv_buf_t {
214  ULONG len;
215  char* base;
216 } uv_buf_t;
217 
218 typedef int uv_file;
219 typedef SOCKET uv_os_sock_t;
220 typedef HANDLE uv_os_fd_t;
221 typedef int uv_pid_t;
222 
223 typedef HANDLE uv_thread_t;
224 
225 typedef HANDLE uv_sem_t;
226 
227 typedef CRITICAL_SECTION uv_mutex_t;
228 
229 /* This condition variable implementation is based on the SetEvent solution
230  * (section 3.2) at http://www.cs.wustl.edu/~schmidt/win32-cv-1.html
231  * We could not use the SignalObjectAndWait solution (section 3.4) because
232  * it want the 2nd argument (type uv_mutex_t) of uv_cond_wait() and
233  * uv_cond_timedwait() to be HANDLEs, but we use CRITICAL_SECTIONs.
234  */
235 
236 typedef union {
237  CONDITION_VARIABLE cond_var;
238  struct {
239  unsigned int waiters_count;
240  CRITICAL_SECTION waiters_count_lock;
241  HANDLE signal_event;
242  HANDLE broadcast_event;
243  } unused_; /* TODO: retained for ABI compatibility; remove me in v2.x. */
244 } uv_cond_t;
245 
246 typedef union {
247  struct {
248  unsigned int num_readers_;
249  CRITICAL_SECTION num_readers_lock_;
250  HANDLE write_semaphore_;
251  } state_;
252  /* TODO: remove me in v2.x. */
253  struct {
254  SRWLOCK unused_;
255  } unused1_;
256  /* TODO: remove me in v2.x. */
257  struct {
258  uv_mutex_t unused1_;
259  uv_mutex_t unused2_;
260  } unused2_;
261 } uv_rwlock_t;
262 
263 typedef struct {
264  unsigned int n;
265  unsigned int count;
266  uv_mutex_t mutex;
267  uv_sem_t turnstile1;
268  uv_sem_t turnstile2;
269 } uv_barrier_t;
270 
271 typedef struct {
272  DWORD tls_index;
273 } uv_key_t;
274 
275 #define UV_ONCE_INIT { 0, NULL }
276 
277 typedef struct uv_once_s {
278  unsigned char ran;
279  HANDLE event;
280 } uv_once_t;
281 
282 /* Platform-specific definitions for uv_spawn support. */
283 typedef unsigned char uv_uid_t;
284 typedef unsigned char uv_gid_t;
285 
286 typedef struct uv__dirent_s {
287  int d_type;
288  char d_name[1];
289 } uv__dirent_t;
290 
291 #define HAVE_DIRENT_TYPES
292 #define UV__DT_DIR UV_DIRENT_DIR
293 #define UV__DT_FILE UV_DIRENT_FILE
294 #define UV__DT_LINK UV_DIRENT_LINK
295 #define UV__DT_FIFO UV_DIRENT_FIFO
296 #define UV__DT_SOCKET UV_DIRENT_SOCKET
297 #define UV__DT_CHAR UV_DIRENT_CHAR
298 #define UV__DT_BLOCK UV_DIRENT_BLOCK
299 
300 /* Platform-specific definitions for uv_dlopen support. */
301 #define UV_DYNAMIC FAR WINAPI
302 typedef struct {
303  HMODULE handle;
304  char* errmsg;
305 } uv_lib_t;
306 
307 RB_HEAD(uv_timer_tree_s, uv_timer_s);
308 
309 #define UV_LOOP_PRIVATE_FIELDS \
310  /* The loop's I/O completion port */ \
311  HANDLE iocp; \
312  /* The current time according to the event loop. in msecs. */ \
313  uint64_t time; \
314  /* Tail of a single-linked circular queue of pending reqs. If the queue */ \
315  /* is empty, tail_ is NULL. If there is only one item, */ \
316  /* tail_->next_req == tail_ */ \
317  uv_req_t* pending_reqs_tail; \
318  /* Head of a single-linked list of closed handles */ \
319  uv_handle_t* endgame_handles; \
320  /* The head of the timers tree */ \
321  struct uv_timer_tree_s timers; \
322  /* Lists of active loop (prepare / check / idle) watchers */ \
323  uv_prepare_t* prepare_handles; \
324  uv_check_t* check_handles; \
325  uv_idle_t* idle_handles; \
326  /* This pointer will refer to the prepare/check/idle handle whose */ \
327  /* callback is scheduled to be called next. This is needed to allow */ \
328  /* safe removal from one of the lists above while that list being */ \
329  /* iterated over. */ \
330  uv_prepare_t* next_prepare_handle; \
331  uv_check_t* next_check_handle; \
332  uv_idle_t* next_idle_handle; \
333  /* This handle holds the peer sockets for the fast variant of uv_poll_t */ \
334  SOCKET poll_peer_sockets[UV_MSAFD_PROVIDER_COUNT]; \
335  /* Counter to keep track of active tcp streams */ \
336  unsigned int active_tcp_streams; \
337  /* Counter to keep track of active udp streams */ \
338  unsigned int active_udp_streams; \
339  /* Counter to started timer */ \
340  uint64_t timer_counter; \
341  /* Threadpool */ \
342  void* wq[2]; \
343  uv_mutex_t wq_mutex; \
344  uv_async_t wq_async;
345 
346 #define UV_REQ_TYPE_PRIVATE \
347  /* TODO: remove the req suffix */ \
348  UV_ACCEPT, \
349  UV_FS_EVENT_REQ, \
350  UV_POLL_REQ, \
351  UV_PROCESS_EXIT, \
352  UV_READ, \
353  UV_UDP_RECV, \
354  UV_WAKEUP, \
355  UV_SIGNAL_REQ,
356 
357 #define UV_REQ_PRIVATE_FIELDS \
358  union { \
359  /* Used by I/O operations */ \
360  struct { \
361  OVERLAPPED overlapped; \
362  size_t queued_bytes; \
363  } io; \
364  } u; \
365  struct uv_req_s* next_req;
366 
367 #define UV_WRITE_PRIVATE_FIELDS \
368  int coalesced; \
369  uv_buf_t write_buffer; \
370  HANDLE event_handle; \
371  HANDLE wait_handle;
372 
373 #define UV_CONNECT_PRIVATE_FIELDS \
374  /* empty */
375 
376 #define UV_SHUTDOWN_PRIVATE_FIELDS \
377  /* empty */
378 
379 #define UV_UDP_SEND_PRIVATE_FIELDS \
380  /* empty */
381 
382 #define UV_PRIVATE_REQ_TYPES \
383  typedef struct uv_pipe_accept_s { \
384  UV_REQ_FIELDS \
385  HANDLE pipeHandle; \
386  struct uv_pipe_accept_s* next_pending; \
387  } uv_pipe_accept_t; \
388  \
389  typedef struct uv_tcp_accept_s { \
390  UV_REQ_FIELDS \
391  SOCKET accept_socket; \
392  char accept_buffer[sizeof(struct sockaddr_storage) * 2 + 32]; \
393  HANDLE event_handle; \
394  HANDLE wait_handle; \
395  struct uv_tcp_accept_s* next_pending; \
396  } uv_tcp_accept_t; \
397  \
398  typedef struct uv_read_s { \
399  UV_REQ_FIELDS \
400  HANDLE event_handle; \
401  HANDLE wait_handle; \
402  } uv_read_t;
403 
404 #define uv_stream_connection_fields \
405  unsigned int write_reqs_pending; \
406  uv_shutdown_t* shutdown_req;
407 
408 #define uv_stream_server_fields \
409  uv_connection_cb connection_cb;
410 
411 #define UV_STREAM_PRIVATE_FIELDS \
412  unsigned int reqs_pending; \
413  int activecnt; \
414  uv_read_t read_req; \
415  union { \
416  struct { uv_stream_connection_fields } conn; \
417  struct { uv_stream_server_fields } serv; \
418  } stream;
419 
420 #define uv_tcp_server_fields \
421  uv_tcp_accept_t* accept_reqs; \
422  unsigned int processed_accepts; \
423  uv_tcp_accept_t* pending_accepts; \
424  LPFN_ACCEPTEX func_acceptex;
425 
426 #define uv_tcp_connection_fields \
427  uv_buf_t read_buffer; \
428  LPFN_CONNECTEX func_connectex;
429 
430 #define UV_TCP_PRIVATE_FIELDS \
431  SOCKET socket; \
432  int delayed_error; \
433  union { \
434  struct { uv_tcp_server_fields } serv; \
435  struct { uv_tcp_connection_fields } conn; \
436  } tcp;
437 
438 #define UV_UDP_PRIVATE_FIELDS \
439  SOCKET socket; \
440  unsigned int reqs_pending; \
441  int activecnt; \
442  uv_req_t recv_req; \
443  uv_buf_t recv_buffer; \
444  struct sockaddr_storage recv_from; \
445  int recv_from_len; \
446  uv_udp_recv_cb recv_cb; \
447  uv_alloc_cb alloc_cb; \
448  LPFN_WSARECV func_wsarecv; \
449  LPFN_WSARECVFROM func_wsarecvfrom;
450 
451 #define uv_pipe_server_fields \
452  int pending_instances; \
453  uv_pipe_accept_t* accept_reqs; \
454  uv_pipe_accept_t* pending_accepts;
455 
456 #define uv_pipe_connection_fields \
457  uv_timer_t* eof_timer; \
458  uv_write_t dummy; /* TODO: retained for ABI compat; remove this in v2.x. */ \
459  DWORD ipc_remote_pid; \
460  union { \
461  uint32_t payload_remaining; \
462  uint64_t dummy; /* TODO: retained for ABI compat; remove this in v2.x. */ \
463  } ipc_data_frame; \
464  void* ipc_xfer_queue[2]; \
465  int ipc_xfer_queue_length; \
466  uv_write_t* non_overlapped_writes_tail; \
467  CRITICAL_SECTION readfile_thread_lock; \
468  volatile HANDLE readfile_thread_handle;
469 
470 #define UV_PIPE_PRIVATE_FIELDS \
471  HANDLE handle; \
472  WCHAR* name; \
473  union { \
474  struct { uv_pipe_server_fields } serv; \
475  struct { uv_pipe_connection_fields } conn; \
476  } pipe;
477 
478 /* TODO: put the parser states in an union - TTY handles are always half-duplex
479  * so read-state can safely overlap write-state. */
480 #define UV_TTY_PRIVATE_FIELDS \
481  HANDLE handle; \
482  union { \
483  struct { \
484  /* Used for readable TTY handles */ \
485  /* TODO: remove me in v2.x. */ \
486  HANDLE unused_; \
487  uv_buf_t read_line_buffer; \
488  HANDLE read_raw_wait; \
489  /* Fields used for translating win keystrokes into vt100 characters */ \
490  char last_key[8]; \
491  unsigned char last_key_offset; \
492  unsigned char last_key_len; \
493  WCHAR last_utf16_high_surrogate; \
494  INPUT_RECORD last_input_record; \
495  } rd; \
496  struct { \
497  /* Used for writable TTY handles */ \
498  /* utf8-to-utf16 conversion state */ \
499  unsigned int utf8_codepoint; \
500  unsigned char utf8_bytes_left; \
501  /* eol conversion state */ \
502  unsigned char previous_eol; \
503  /* ansi parser state */ \
504  unsigned char ansi_parser_state; \
505  unsigned char ansi_csi_argc; \
506  unsigned short ansi_csi_argv[4]; \
507  COORD saved_position; \
508  WORD saved_attributes; \
509  } wr; \
510  } tty;
511 
512 #define UV_POLL_PRIVATE_FIELDS \
513  SOCKET socket; \
514  /* Used in fast mode */ \
515  SOCKET peer_socket; \
516  AFD_POLL_INFO afd_poll_info_1; \
517  AFD_POLL_INFO afd_poll_info_2; \
518  /* Used in fast and slow mode. */ \
519  uv_req_t poll_req_1; \
520  uv_req_t poll_req_2; \
521  unsigned char submitted_events_1; \
522  unsigned char submitted_events_2; \
523  unsigned char mask_events_1; \
524  unsigned char mask_events_2; \
525  unsigned char events;
526 
527 #define UV_TIMER_PRIVATE_FIELDS \
528  RB_ENTRY(uv_timer_s) tree_entry; \
529  uint64_t due; \
530  uint64_t repeat; \
531  uint64_t start_id; \
532  uv_timer_cb timer_cb;
533 
534 #define UV_ASYNC_PRIVATE_FIELDS \
535  struct uv_req_s async_req; \
536  uv_async_cb async_cb; \
537  /* char to avoid alignment issues */ \
538  char volatile async_sent;
539 
540 #define UV_PREPARE_PRIVATE_FIELDS \
541  uv_prepare_t* prepare_prev; \
542  uv_prepare_t* prepare_next; \
543  uv_prepare_cb prepare_cb;
544 
545 #define UV_CHECK_PRIVATE_FIELDS \
546  uv_check_t* check_prev; \
547  uv_check_t* check_next; \
548  uv_check_cb check_cb;
549 
550 #define UV_IDLE_PRIVATE_FIELDS \
551  uv_idle_t* idle_prev; \
552  uv_idle_t* idle_next; \
553  uv_idle_cb idle_cb;
554 
555 #define UV_HANDLE_PRIVATE_FIELDS \
556  uv_handle_t* endgame_next; \
557  unsigned int flags;
558 
559 #define UV_GETADDRINFO_PRIVATE_FIELDS \
560  struct uv__work work_req; \
561  uv_getaddrinfo_cb getaddrinfo_cb; \
562  void* alloc; \
563  WCHAR* node; \
564  WCHAR* service; \
565  /* The addrinfoW field is used to store a pointer to the hints, and */ \
566  /* later on to store the result of GetAddrInfoW. The final result will */ \
567  /* be converted to struct addrinfo* and stored in the addrinfo field. */ \
568  struct addrinfoW* addrinfow; \
569  struct addrinfo* addrinfo; \
570  int retcode;
571 
572 #define UV_GETNAMEINFO_PRIVATE_FIELDS \
573  struct uv__work work_req; \
574  uv_getnameinfo_cb getnameinfo_cb; \
575  struct sockaddr_storage storage; \
576  int flags; \
577  char host[NI_MAXHOST]; \
578  char service[NI_MAXSERV]; \
579  int retcode;
580 
581 #define UV_PROCESS_PRIVATE_FIELDS \
582  struct uv_process_exit_s { \
583  UV_REQ_FIELDS \
584  } exit_req; \
585  BYTE* child_stdio_buffer; \
586  int exit_signal; \
587  HANDLE wait_handle; \
588  HANDLE process_handle; \
589  volatile char exit_cb_pending;
590 
591 #define UV_FS_PRIVATE_FIELDS \
592  struct uv__work work_req; \
593  int flags; \
594  DWORD sys_errno_; \
595  union { \
596  /* TODO: remove me in 0.9. */ \
597  WCHAR* pathw; \
598  int fd; \
599  } file; \
600  union { \
601  struct { \
602  int mode; \
603  WCHAR* new_pathw; \
604  int file_flags; \
605  int fd_out; \
606  unsigned int nbufs; \
607  uv_buf_t* bufs; \
608  int64_t offset; \
609  uv_buf_t bufsml[4]; \
610  } info; \
611  struct { \
612  double atime; \
613  double mtime; \
614  } time; \
615  } fs;
616 
617 #define UV_WORK_PRIVATE_FIELDS \
618  struct uv__work work_req;
619 
620 #define UV_FS_EVENT_PRIVATE_FIELDS \
621  struct uv_fs_event_req_s { \
622  UV_REQ_FIELDS \
623  } req; \
624  HANDLE dir_handle; \
625  int req_pending; \
626  uv_fs_event_cb cb; \
627  WCHAR* filew; \
628  WCHAR* short_filew; \
629  WCHAR* dirw; \
630  char* buffer;
631 
632 #define UV_SIGNAL_PRIVATE_FIELDS \
633  RB_ENTRY(uv_signal_s) tree_entry; \
634  struct uv_req_s signal_req; \
635  unsigned long pending_signum;
636 
637 #ifndef F_OK
638 #define F_OK 0
639 #endif
640 #ifndef R_OK
641 #define R_OK 4
642 #endif
643 #ifndef W_OK
644 #define W_OK 2
645 #endif
646 #ifndef X_OK
647 #define X_OK 1
648 #endif
649 
650 /* fs open() flags supported on this platform: */
651 #define UV_FS_O_APPEND _O_APPEND
652 #define UV_FS_O_CREAT _O_CREAT
653 #define UV_FS_O_EXCL _O_EXCL
654 #define UV_FS_O_RANDOM _O_RANDOM
655 #define UV_FS_O_RDONLY _O_RDONLY
656 #define UV_FS_O_RDWR _O_RDWR
657 #define UV_FS_O_SEQUENTIAL _O_SEQUENTIAL
658 #define UV_FS_O_SHORT_LIVED _O_SHORT_LIVED
659 #define UV_FS_O_TEMPORARY _O_TEMPORARY
660 #define UV_FS_O_TRUNC _O_TRUNC
661 #define UV_FS_O_WRONLY _O_WRONLY
662 
663 /* fs open() flags supported on other platforms (or mapped on this platform): */
664 #define UV_FS_O_DIRECT 0x02000000 /* FILE_FLAG_NO_BUFFERING */
665 #define UV_FS_O_DIRECTORY 0
666 #define UV_FS_O_DSYNC 0x04000000 /* FILE_FLAG_WRITE_THROUGH */
667 #define UV_FS_O_EXLOCK 0x10000000 /* EXCLUSIVE SHARING MODE */
668 #define UV_FS_O_NOATIME 0
669 #define UV_FS_O_NOCTTY 0
670 #define UV_FS_O_NOFOLLOW 0
671 #define UV_FS_O_NONBLOCK 0
672 #define UV_FS_O_SYMLINK 0
673 #define UV_FS_O_SYNC 0x08000000 /* FILE_FLAG_WRITE_THROUGH */
Definition: win.h:199
Definition: win.h:302
Definition: win.h:236
Definition: uv.h:784
Definition: win.h:246
It should be possible to cast uv_buf_t[] to WSABUF[] see http://msdn.microsoft.com/en-us/library/ms74...
Definition: win.h:213
Definition: win.h:263
Definition: win.h:277
Definition: win.h:286
Definition: win.h:193
Definition: win.h:271