Commit Graph

638 Commits

Author SHA1 Message Date
Ben Noordhuis
e9235a39f8 unix: the dl functions don't set errno 2011-12-18 16:47:06 +01:00
Ben Noordhuis
d808cf9023 linux: detect if inotify syscalls are supported 2011-12-16 15:50:27 +01:00
Ben Noordhuis
6b3075cd73 linux: improve kernel feature detection
Do not check for minimum kernel and glibc versions, just check that the kernel
headers export the syscall number and invoke the syscall directly. Effectively
bypasses glibc.
2011-12-16 15:16:31 +01:00
Igor Zinkovsky
a4c8ffa3c2 windows: correctly check the result of malloc 2011-12-12 19:10:11 -08:00
Igor Zinkovsky
4e99cd4e29 windows: fix memory leak when non-zero tcp reads are used 2011-12-12 12:30:12 -08:00
Shigeki Ohtsu
ba52023ef3 Fix missing increments of loop->counters 2011-12-12 18:01:26 +01:00
Ben Noordhuis
b89c31b936 unix: fix warning: return 0 in function returning void 2011-12-06 22:20:30 +01:00
Ben Noordhuis
0db3274f8a unix: check UV_CLOSING flag in uv__write()
uv__write() runs after the read callbacks have fired. Said callbacks may have
closed the handle, handle that graciously.
2011-12-05 16:56:30 +01:00
Ben Noordhuis
34e95d1a4c unix: make it safe to delete the default loop
Fixes a potential free() of non-malloc'ed memory.
2011-12-04 13:20:23 +01:00
Ben Noordhuis
248ca5d612 unix: translate ETIMEDOUT to UV_ETIMEDOUT 2011-12-03 23:31:02 +01:00
Igor Zinkovsky
60630dab0f windows: enable pending pipe instances knob 2011-12-01 13:48:57 -08:00
Bert Belder
9c064fbbd2 Win: utf-8 decoder bug when compiling with gcc 2011-12-01 22:45:58 +01:00
Bert Belder
2a6a4a0864 Fix MinGW and MinGW-w64 builds 2011-12-01 22:45:40 +01:00
Yuki Okumura
f71f5a02e6 Win: lower case tlhelp32.h to support cross compilation 2011-12-01 22:42:35 +01:00
Igor Zinkovsky
dceb3e65ca uv_cwd + uv_chdir 2011-12-01 12:27:12 -08:00
Bruce Mitchener
d513d9bb41 Fix typos. 2011-11-30 14:35:13 +01:00
Bert Belder
fce90652ed Windows: avoid the loop starvation bug. Closes GH-154 2011-11-28 19:36:41 +01:00
Bert Belder
01f64f6612 Win: get rid of UV_EAINONAME, use UV_ENOENT instead 2011-11-25 10:11:29 +01:00
Bert Belder
b4698d414b Strip trailing whitespace 2011-11-25 10:03:27 +01:00
Igor Zinkovsky
cfa4112950 windows: make uv_fs_stat use open + fstat to support long paths 2011-11-24 19:18:17 -08:00
Bert Belder
3a50f8fca0 Win: fix uv_getaddrinfo error reporting 2011-11-25 02:05:07 +01:00
Bert Belder
45b976abd9 Win: add mapping for ERROR_ACCESS_DENIED 2011-11-25 00:59:40 +01:00
Bert Belder
ea63f06987 Win: ignore ECONNRESET when receiving udp packets 2011-11-24 19:16:24 +01:00
Bert Belder
261d792a7a Win: map STATUS_HOPLIMIT_EXCEEDED status to WSAECONNRESET error 2011-11-24 19:16:18 +01:00
Bert Belder
0ded5d29cd Win: fix improper treatment of real ntstatus codes as mapped win32 errors 2011-11-24 19:16:12 +01:00
Ben Noordhuis
96c230344d linux: fix build when compiling with -std=c89 -pedantic 2011-11-23 19:05:46 +01:00
Ben Noordhuis
92c9e95721 unix: fix stray pointer free() when HAVE_FUTIMES=0
uv_fs_futime() failed to initialize req.path when HAVE_FUTIMES=0.
uv_fs_req_cleanup() later on tried to free the bogus pointer.
2011-11-22 00:00:52 +01:00
Shimon Doodkin
1b9d00fb42 cygwin: fix undefined _SC_PAGESIZE
unistd.h was not included, when tried to build node 0.5.9 had an error of:
_SC_PAGESIZE undefined
2011-11-20 15:02:16 +01:00
Ben Noordhuis
2bd181a8d2 unix: properly disarm kqueue fs watcher
Fixes "Assertion failed: (revents == EV_LIBUV_KQUEUE_HACK),
function uv__fs_event, file ../src/unix/kqueue.c, line 58."
2011-11-18 01:40:11 +01:00
Igor Zinkovsky
08a5546753 windows: return UV_FILE for non-console FILE_TYPE_CHAR 2011-11-17 15:36:34 -08:00
Ryan Dahl
2007eb813d Set uv_write_t errno correctly
Fixes #206.
2011-11-16 13:02:18 -08:00
Frank Denis
89ea3be6c2 Add support for DragonFly BSD by sharing code for FreeBSD. 2011-11-13 19:46:24 +01:00
Frank Denis
93faeb2189 Fix typo that broke libuv on NetBSD: psysconf() -> sysconf() 2011-11-13 19:42:57 +01:00
Ben Noordhuis
224584c53e sunos: check that event ports supports fs watching 2011-11-10 20:04:55 +01:00
Ben Noordhuis
26806e2b1c sunos: add getaddrinfo() compatibility hack
getaddrinfo() returns EAI_MEMORY if strlen(hostname) >= MAXHOSTNAMELEN
2011-11-10 16:39:03 +00:00
Ben Noordhuis
04dfd46349 unix: remove unused uv__translate_lib_error() function 2011-11-10 15:26:12 +00:00
Ben Noordhuis
61ef8cc962 freebsd: remove unused variables 2011-11-10 13:57:58 +01:00
Ryan Dahl
808bb8ed0b Shared uv_strerror 2011-11-09 18:06:49 -08:00
Ryan Dahl
fd2b04d784 Alternative errno strategy 2011-11-09 17:47:24 -08:00
Igor Zinkovsky
f17d4837a8 windows: turn WSAECONNABORTED from WSARecv to UV_ECONNRESET 2011-11-09 14:57:41 -08:00
Ben Noordhuis
4794c12f58 linux: fall back to traditional syscalls if necessary
libuv uses feature checks to determine if newer syscalls like pipe2() are
available. This works fine until someone compiles libuv against kernel headers
that are newer than the actual kernel our software runs on.

Fall back to traditional (but race-y!) syscalls when the kernel reports ENOSYS
or EINVAL.
2011-11-09 15:38:51 +01:00
Igor Zinkovsky
942c68b80e windows: fix utf16->utf8 conversion in uv_fs_readdir 2011-11-08 19:23:30 -08:00
Ryan Dahl
196e14528f Map UV_ESRCH in uv_err_name 2011-11-08 16:59:05 -08:00
Bert Belder
2b7774ae49 Windows: return UV_ESRCH from uv_kill 2011-11-09 01:48:04 +01:00
Tj Holowaychuk
a378110f9e Add UV_ESRCH
Fixes #239.
2011-11-08 16:36:20 -08:00
Ryan Dahl
b7da0a69bf Add uv__new_artificial_error() 2011-11-08 15:11:16 -08:00
Igor Zinkovsky
f1859eb841 windows: convert WSAECONNABORTED to EOF 2011-11-07 16:53:27 -08:00
Ben Noordhuis
51df5e3b00 unix: map EISDIR 2011-11-07 09:20:54 +01:00
Ben Noordhuis
16d48befba win: add uv_loop_new() and uv_loop_delete() stubs 2011-11-06 04:08:43 +01:00
Ben Noordhuis
7b973eb4ad Fix uv_loop_new() and uv_default_loop() function prototypes. 2011-11-06 04:04:32 +01:00
Ben Noordhuis
cee56c96f8 unix: unbreak linux build, broken in 1997e10 2011-11-05 02:58:48 +01:00
Bert Belder
1997e10b50 Add flags to uv_fs_event_init 2011-11-05 01:42:08 +01:00
Igor Zinkovsky
faca1402ef make uv_pipe_connect return void 2011-11-04 16:06:53 -07:00
Igor Zinkovsky
82cf0b38c0 windows: remove quotes from PATH in uv_spawn 2011-11-04 15:08:53 -07:00
Igor Zinkovsky
fe97c4dc63 windows: honor O_APPEND in uv_fs_open 2011-11-04 12:41:23 -07:00
saghul
677bb70bfb Added missing error codes to uv_err_name 2011-11-04 05:37:56 +01:00
Ryan Dahl
9c7ed0dad0 One more EACCESS -> EACCES 2011-11-03 16:30:19 -07:00
Ryan Dahl
681bd290e6 UV_EACCESS -> UV_EACCES
In order to match existing Node API. See
https://github.com/joyent/node/pull/2001
2011-11-03 16:17:12 -07:00
Ryan Dahl
147487afe6 UNIX: Error map ENOTSOCK 2011-11-03 16:08:58 -07:00
Ryan Dahl
0698e3f905 Fix UNIX pipe connect error reporting, add test 2011-11-03 15:47:43 -07:00
Igor Zinkovsky
ee8a681ace windows: uv_kill and uv_process_kill to terminate the process on SIGINT 2011-11-03 14:03:42 -07:00
Igor Zinkovsky
0fb3769586 windows: don't emit fs-event callback after uv_fs_event handle is closed 2011-11-02 19:10:04 -07:00
Ben Noordhuis
77a2477c3f unix: add EAI_NODATA #ifdef guard, freebsd doesn't have it 2011-11-03 02:38:31 +01:00
Ryan Dahl
e1bee05ecd UNIX: Loop on blocking streams
Also removes a superfluous syscall during uv_tty_init for writable TTY
streams.
2011-11-02 16:47:01 -07:00
Igor Zinkovsky
74b49e821b uv_kill 2011-11-02 14:34:07 -07:00
Ben Noordhuis
8d5c64adf5 unix: map EAFNOSUPPORT error code 2011-11-02 17:20:00 +01:00
Igor Zinkovsky
7a53924aed windows: call SetErrorMode on startup to ask the system not to handle critical errors 2011-11-01 15:36:04 -07:00
Igor Zinkovsky
90b0b7d099 windows: increase the number of OVERLAPPED_ENTRYs passed to GetQueuedCompletionStatusEx 2011-11-01 10:27:46 -07:00
Igor Zinkovsky
9c6103a479 windows: add tests for uv_tcp_simultaneous_accepts 2011-11-01 01:13:13 -07:00
Igor Zinkovsky
78f4b120a1 windows: knob for tuning number of concurrent accept requests 2011-10-31 23:37:45 -07:00
Ben Noordhuis
bd82d02467 ev: fix epoll_init file descriptor leak
Fix the edge case where epoll_init() leaks a file descriptor when it is called
when the process has no open file descriptors.
2011-10-31 04:21:24 +01:00
Ben Noordhuis
70381cef9b unix: add getaddrinfo compatibility hack
Revisit in the future. This is not a good hack.
2011-10-30 02:55:12 +01:00
Ben Noordhuis
84bc18684e linux: omit superfluous fcntl(F_GETFD) syscall 2011-10-29 05:32:34 +02:00
Bert Belder
c0792e5405 Windows: the correct way to make TCP_KEEPALIVE work on MinGW 2011-10-29 02:00:04 +02:00
Luis Lavena
99b512e890 Windows: use SO_KEEPALIVE instead of TCP_KEEPALIVE
MinGW doesn't understand the latter. Closes GH-228.
2011-10-29 01:47:47 +02:00
Ben Noordhuis
ed2b5e60cb linux: use ioctl(FIONBIO) to set O_NONBLOCK, saves a syscall 2011-10-29 01:31:11 +02:00
Bert Belder
90e15f1110 Implement uv_dlopen and friends 2011-10-29 00:52:34 +02:00
Bert Belder
c985ea4b10 Add uv__new_sys_error 2011-10-29 00:52:33 +02:00
Bert Belder
e9472fe02b Prepare libuv for shared library build 2011-10-29 00:52:32 +02:00
Ben Noordhuis
f2c6b4106d unix: have uv_strerror() handle getaddrinfo() errors 2011-10-28 01:31:55 +02:00
Igor Zinkovsky
314d0ee4f6 windows: don't fail uv_listen with UV_EALREADY if already listening. fixes #227. 2011-10-26 13:48:53 -07:00
Ben Noordhuis
3e4af533ae sunos: implement file watcher API 2011-10-26 03:49:34 +00:00
Igor Zinkovsky
d15b88a935 windows: implement uv_tcp_nodelay and uv_tcp_keepalive 2011-10-25 16:30:04 -07:00
Igor Zinkovsky
0cb2213db0 windows: when sharing a server socket, only call listen in the parent process 2011-10-25 13:23:53 -07:00
Ryan Dahl
b5d69f9a3e Map EHOSTUNREACH on Unix 2011-10-24 14:07:49 -07:00
Bert Belder
179f475b2a win: fix fs__readdir buffer overflow bug
Thanks Runner Mei for pointing this out. Closes GH-224.
2011-10-21 18:42:40 -07:00
Bert Belder
66f39250b7 Fix MinGW build 2011-10-21 18:42:39 -07:00
Bert Belder
45882e0bdc win: flush output buffer before doing a console reset 2011-10-21 18:42:38 -07:00
Ben Noordhuis
2dd02829c1 win: fix function prototype
Mea culpa.
2011-10-21 18:27:24 -07:00
Ben Noordhuis
ec825ffc62 unix: add TCP keepalive and no-delay control knobs 2011-10-21 16:08:26 -07:00
Ben Noordhuis
9da53df457 unix: fix uv_freeaddrinfo() segfault on sunos
The system freeaddrinfo() on SunOS does not handle NULL values graciously.
2011-10-21 14:20:36 -07:00
Igor Zinkovsky
773830604d windows: fixes queued_bytes for ipc pipes 2011-10-21 13:37:38 -07:00
Ben Noordhuis
d396799210 Change return type of uv_get_*_memory() functions
... from double to uint64_t. Limit use of floating point in public API as much
as possible.
2011-10-21 10:09:59 -07:00
Ben Noordhuis
9757a43a57 unix: remove unused variable 2011-10-21 10:09:43 -07:00
Bert Belder
fb7138614d Improve ansi escape code support on windows 2011-10-20 19:31:24 -07:00
Ryan Dahl
2c7e8bb137 Map EAI_NONAME to ENOENT 2011-10-20 17:13:48 -07:00
Igor Zinkovsky
28234d7336 windows: ref pipe writes to keep the event loop alive 2011-10-20 15:14:55 -07:00
Igor Zinkovsky
54982a23ef windows: stdio over non-overlapped pipes 2011-10-20 15:14:39 -07:00
Bert Belder
cb474b24c1 Ignore rogue DNS servers reported by windows 2011-10-20 15:10:14 -07:00
Ben Noordhuis
c0e5db2d49 linux: fix events after close bug 2011-10-20 15:02:50 -07:00
Bert Belder
51e9dbc2bb Work around windows udp bug, allow zero reads 2011-10-20 15:01:31 -07:00
Ben Noordhuis
2069a24e8c unix: fix file descriptor leak 2011-10-15 02:34:30 +02:00
Igor Zinkovsky
456f831389 windows: ensure that the ipc frame header is properly initialized 2011-10-14 15:38:02 -07:00
Frank DENIS
4ab1990064 unix: add support for OpenBSD 2011-10-14 01:59:45 +02:00
Igor Zinkovsky
fd9dbb1279 fix mingw build 2011-10-12 21:46:06 -07:00
Igor Zinkovsky
72b5976e83 windows: support utf8 in uv_fs functions
fixes #201
2011-10-12 13:24:22 -07:00
Ryan Dahl
c903bc3f32 unix: fix a few compiler warnings 2011-10-12 12:25:05 -07:00
Igor Zinkovsky
81303a72be fix fs_readdir_file on windows 2011-10-12 11:37:22 -07:00
Igor Zinkovsky
2216d38c29 windows: enable uv_fs_open to open directories 2011-10-12 10:42:41 -07:00
Ben Noordhuis
197f591ebc common: add UV_ENOTDIR error code 2011-10-12 16:43:29 +02:00
Ben Noordhuis
721ad8c74f sunos: implement uv_fs_futime() 2011-10-12 02:05:52 +00:00
Igor Zinkovsky
72fb469a43 windows: check for fd==-1 in uv_fs functions 2011-10-11 18:22:10 -07:00
Ben Noordhuis
e0a4e72640 sunos: look up free memory with sysconf(_SC_AVPHYS_PAGES) 2011-10-12 00:27:30 +00:00
Ben Noordhuis
04daabd58f win: unbreak build, use UV_ENOSYS 2011-10-11 23:17:58 +02:00
Ben Noordhuis
61343ecfbd common: add UV_ENOSYS error code 2011-10-11 23:15:41 +02:00
Ben Noordhuis
a3d495c0bc win: make uv_process_kill(proc, 0) report process status 2011-10-11 21:36:54 +02:00
Roman Shtylman
a3d1f6fd6f add uv_udp_set_membership for unix multicast support
- test-udp-multicast-join tests that multicast packets can be received
- stub src/win/udp.c until support added
2011-10-11 21:25:20 +02:00
Igor Zinkovsky
40b64a81cb windows: don't alloc readdir buffer for empty dirs 2011-10-11 11:47:05 -07:00
Igor Zinkovsky
4ac13090ca fix mingw build 2011-10-11 10:45:02 -07:00
Ben Noordhuis
47d22acfb2 unix: stub kqueue support functions on old platforms 2011-10-11 16:53:42 +02:00
Ben Noordhuis
f7f518aa7e sunos: fix uv_spawn()
SunOS does not set POLLHUP when the read end of a pipe is closed.
2011-10-10 23:59:54 +00:00
Ryan Dahl
5656e3c8bd Prepare for writable TTY to be blocking 2011-10-10 13:25:46 -07:00
Ben Noordhuis
41e8574920 unix: don't alloc memory for readdir on empty dir 2011-10-10 16:27:55 +02:00
Igor Zinkovsky
9f6024a6fa windows: fixes crash in pipe.c 2011-10-07 15:05:01 -07:00
Bert Belder
81c09cb2e3 win: add error mappings for ECONNRESET 2011-10-07 15:53:28 +02:00
Ryan Dahl
1c72aebd78 unix: IPC stdio stream should be duplex 2011-10-07 01:41:42 -07:00
Igor Zinkovsky
012fc0799f windows: fixes #193. Ensures that uv_fs_event deals with short and long names 2011-10-06 19:39:06 -07:00
Ben Noordhuis
5816f2d21c unix: avoid unnecessary read() syscall 2011-10-07 02:32:52 +02:00
Ryan Dahl
e3bcecdc42 unix: clean up messy code 2011-10-06 14:52:44 -07:00
Ryan Dahl
60c639fd57 Merge branch 'ipc2' 2011-10-06 10:18:13 -07:00
Igor Zinkovsky
34f719d7a5 windows ipc fixes 2011-10-06 10:17:42 -07:00
Igor Zinkovsky
90e88aabf6 remove stdio.c 2011-10-06 10:17:42 -07:00
Igor Zinkovsky
81c4043c83 ipc on windows 2011-10-06 10:17:42 -07:00
Ryan Dahl
61fab8d1ba unix: return UV_UNKNOWN_HANDLE when read2 doesn't recv one
unix passes ipc test on this comment.
2011-10-06 10:17:42 -07:00
Ryan Dahl
c920db9fd1 unix: handle passing kind of working 2011-10-06 10:17:42 -07:00
Ryan Dahl
bb6b629e6a make test-ipc accept the pending tcp server 2011-10-06 10:17:18 -07:00
Ryan Dahl
45306f2e7f unix: implement uv_write2 2011-10-06 10:17:18 -07:00
Ryan Dahl
6921d2fc07 Add argument to uv_pipe_init for IPC, unix impl 2011-10-06 10:17:07 -07:00
okuoku
d1016de597 FreeBSD: Fix FreeBSD build. 2011-10-06 17:00:50 +02:00
Ben Noordhuis
c7870465aa error reporting: return sensible messages for synthetic errors 2011-10-06 01:17:46 +02:00
Erick Tryzelaar
0303197a57 win: unify uv_{tcp,udp}_set_socket.
Fixes #205.
2011-10-04 16:48:19 -07:00
Erick Tryzelaar
4c329060ca unix,win: Start unifying shared bind code. 2011-10-04 16:46:39 -07:00
Erick Tryzelaar
85368e8d45 unix,win: Start unifying shared tcp connect code. 2011-10-04 16:46:39 -07:00
Erick Tryzelaar
e3f2631127 unix: bad connect addresses should error with EINVAL 2011-10-04 16:46:39 -07:00
Erick Tryzelaar
65fa8873f7 win: Fix error message. 2011-10-04 16:46:39 -07:00
Ryan Dahl
b590e12148 Fix darwin build 2011-10-04 16:44:36 -07:00
Ben Noordhuis
8e9a3384c9 unix: implement kqueue file watcher API
kqueue fds are not embeddable into other pollsets (select, poll, kqueue).
Hack the libev event loop to receive kqueue events with filter flags intact.
2011-10-04 23:28:36 +02:00
Fedor Indutny
a35591bbfc os: implement loadavg (not working on cygwin/win) 2011-10-04 18:15:14 +02:00
Fedor Indutny
33cb8775bc os: implement memory bindings
* us_get_free_memory
* us_get_total_memory
2011-10-04 18:10:35 +02:00
Ben Noordhuis
914a6fa241 sunos: pull in uv__set_sys_error prototype 2011-10-01 22:43:47 +00:00