Commit Graph

196 Commits

Author SHA1 Message Date
Daisuke Murase
e8494dddc0 unix: use EVRUN_ONCE in uv_run_once()
EVRUN_NOWAIT means "poll and don't block". Use EVRUN_ONCE instead, "wait for
single event".
2012-01-11 10:15:25 +01:00
Paddy Byers
abf9654a55 unix: create separate eio result queue per loop
Makes the eio "done" callback run in the thread that submitted it. Makes it safe
to use libeio from multiple event loops.
2011-12-20 20:47:33 +01:00
Ben Noordhuis
10de090b9e unix: centralize loop init logic
Also fixes a bug where loops other than the main loop didn't pick the kqueue
backend, which broke the fs event watcher on Darwin and the BSDs.
2011-12-20 20:47:33 +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
mattn
e53cecb8c0 add uv_run_once() 2011-12-14 14:28:35 +01:00
Ben Noordhuis
4c6008f488 Merge branch 'v0.6'
Conflicts:
	test/test-list.h
2011-12-12 18:04:17 +01:00
Shigeki Ohtsu
ba52023ef3 Fix missing increments of loop->counters 2011-12-12 18:01:26 +01:00
Ben Noordhuis
0d8cb08f83 Merge branch 'v0.6' 2011-12-08 16:31:52 +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
f5c2a4a1ae Merge branch 'v0.6'
Conflicts:
	src/unix/core.c
	src/win/winapi.h
2011-12-02 18:15:04 +01:00
Igor Zinkovsky
dceb3e65ca uv_cwd + uv_chdir 2011-12-01 12:27:12 -08:00
Ben Noordhuis
b52b8c7128 util: add uv_strlcpy() and uv_strlcat() functions 2011-11-23 17:29:02 +01:00
Ben Noordhuis
d5b26154f7 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-11-17 18:05:53 +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
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
Ben Noordhuis
7b973eb4ad Fix uv_loop_new() and uv_default_loop() function prototypes. 2011-11-06 04:04:32 +01:00
Ben Noordhuis
77a2477c3f unix: add EAI_NODATA #ifdef guard, freebsd doesn't have it 2011-11-03 02:38:31 +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
Ben Noordhuis
ed2b5e60cb linux: use ioctl(FIONBIO) to set O_NONBLOCK, saves a syscall 2011-10-29 01:31:11 +02:00
Ben Noordhuis
f2c6b4106d unix: have uv_strerror() handle getaddrinfo() errors 2011-10-28 01:31:55 +02: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
81c4043c83 ipc on windows 2011-10-06 10:17:42 -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
saghul
b594dba248 unix: fix memcpy when copying hints on uv_getaddrinfo 2011-09-29 15:32:26 +02:00
Erick Tryzelaar
23796d208c Fixes #76. Unify OS error reporting
As a nice fringe benefit, this also shaves a word
off of a windows TCP handle by replacing "uv_err_t
bind_error" with "int bind_error".
2011-09-27 19:05:33 -07:00
Erick Tryzelaar
7e8645d101 unix,win: Make uv_freeaddrinfo to clean up addrinfo
Fixes #196
2011-09-23 09:31:01 -07:00
Ben Noordhuis
2a1c32a60c linux: implement file watcher API 2011-09-21 13:23:49 -07:00
Ryan Dahl
2ef8f359ee tty fixes for unix 2011-09-20 13:14:16 -07:00
Ben Noordhuis
37e8bf2556 unix: fix dangling pointer free() bug 2011-09-19 17:23:23 +02:00
Erick Tryzelaar
70e1032094 unix: Fix uv_getaddrinfo from deleting invalid data
If the uv_getaddrinfo_t handle is owned by its
data pointer, deleting the data in the callback
could cause uv_getaddrinfo_done to call freeaddrinfo
on an invalid pointer.
2011-09-19 17:11:34 +02:00
Ben Noordhuis
3c96410902 unix: bring back uv__stream_destroy()
This is the revised version of reverted commit 431195c.
2011-09-14 04:48:56 +02:00
Ryan Dahl
828b6eb11d unix: remove uv_init 2011-09-12 11:32:41 -07:00
Erick Tryzelaar
efa1b54076 Subclass uv_getaddrinfo_t from uv_req_t.
This patch also fixes #155. Since we no longer
memset clear the uv_getaddrinfo_t, the user can
now set the `uv_getaddrinfo_t->data` field without
problems.
2011-09-10 01:46:26 -07:00
Ben Noordhuis
ca5346f9ce unix: revert 98b9f58 and 431195c for now, corrupts memory 2011-09-09 23:40:10 +02:00
Ben Noordhuis
431195c944 unix: run callbacks of pending writes when handle is closed 2011-09-08 19:15:22 +02:00
Ben Noordhuis
cc91989cc2 unix: fix buffer overrun in uv__strlcpy()
Reported by Thomas Shinnick.
2011-09-06 15:44:47 +02:00
Ben Noordhuis
bb0c6e6d53 unix: move linux feature detection macros to internal.h 2011-09-05 16:05:28 +02:00
Ryan Dahl
142a70292b unix: fix fs_chmod 2011-09-04 16:09:45 -07:00
Bert Belder
12b01e95f9 Specialize uv_xxx_getsockname, add uv_tcp_getpeername 2011-09-04 04:49:13 +02:00
Ryan Dahl
836cc204b6 unix: Fix test-gethostbyname 2011-08-31 15:37:16 -07:00
Ryan Dahl
6fd340b8ca unix: split out stream into its own file 2011-08-31 13:41:22 -07:00
Ryan Dahl
38ce213b6a unix: split out pipe 2011-08-31 13:29:17 -07:00
Ryan Dahl
510407c03d unix: split out tcp module 2011-08-31 13:11:38 -07:00
Ryan Dahl
e553f96f94 unix: split out uv_spawn into src/unix/process.c 2011-08-31 11:50:08 -07:00
Ryan Dahl
490c83dd35 move src/uv-unix.c to src/unix/core.c 2011-08-31 11:26:43 -07:00