Commit Graph

2184 Commits

Author SHA1 Message Date
Bert Belder
f6fb1dfef1 ChangeLog: fix incorrect release date 2013-04-22 17:37:22 -07:00
Ben Noordhuis
b3ab332b34 unix: fix EMFILE error handling
On Linux, the accept() and accept4() system calls checks for EMFILE
before checking for EAGAIN. Refine our EMFILE error handling tactic
to deal with that. Here is what used to happen:

 1. The event loop calls accept() and sees EMFILE.

 2. Libuv switches to EMFILE error handling mode. It closes a stashed
    file descriptor and calls accept() again.

 3. The accept() system call fails with EAGAIN.

 4. Libuv reopens the stashed file descriptor (reaching RLIMIT_NOFILE
    again) and returns control to the regular event loop.

 5. The regular event loop calls accept(), sees EMFILE and jumps to
    step 2 again. Effectively an infinite loop.

Avoid that by not calling accept() again when we've seen EAGAIN.

Fixes joyent/node#5389.
2013-05-01 19:37:45 +02:00
Fedor Indutny
67f9b91a8b stream: use harder sync restrictions for osx-hack
Synchronize harder to avoid excessive spins, invokations of async
callback and sporadic assertion failures on double-call of async
callback.
2013-04-30 14:07:30 +04:00
Ben Noordhuis
4e5b8dc2ef build: link with libkvm on openbsd
The Makefile already did and now the gyp build does too. Fixes the
OpenBSD build of node.js.

Fixes joyent/node#5363.
2013-04-29 13:40:12 +02:00
Fedor Indutny
ac4e7e7ff2 stream: fix small nit in select hack, add test 2013-04-27 18:50:55 +02:00
Fedor Indutny
2400716d87 stream: fix osx select hack
After latest twiddling, `stream->io_watcher.fd` doesn't contain a real
stream's file descriptior anymore. The one from `select_state` should be
used instead.

Zero-initialize `select_state->event` field.
2013-04-24 13:21:58 +02:00
isaacs
a0cb926e2e Now working on v0.10.6 2013-04-22 17:37:25 -07:00
isaacs
6595a7732c 2013.04.24, Version 0.10.5 (Stable)
Changes since version 0.10.4:

* unix: silence STATIC_ASSERT compiler warnings (Ben Noordhuis)

* windows: make timers handle large timeouts (Miroslav Bajtoš)

* windows: remove superfluous assert statement (Bert Belder)

* unix: silence STATIC_ASSERT compiler warnings (Ben Noordhuis)

* linux: don't use fopen() in uv_resident_set_memory() (Ben Noordhuis)
2013-04-22 17:37:22 -07:00
Ben Noordhuis
cd10637d0b linux: don't use fopen() in uv_resident_set_memory()
RSS is a reflection of the number of pages that a process has mapped.
glibc implements fopen() in terms of mmap() which means that trying
to read the number of mapped pages changes it. Switch to open().
2013-04-22 08:26:53 +02:00
Ben Noordhuis
105e4dcb23 unix: silence STATIC_ASSERT compiler warnings
Fix the following two warnings:

  src/unix/core.c:74:1: warning: ISO C90 forbids array
  'static_assert_failed' whose size can't be evaluated [-Wvla]
  src/unix/core.c:76:1: warning: ISO C90 forbids array
  'static_assert_failed' whose size can't be evaluated [-Wvla]
2013-04-22 07:48:09 +02:00
Bert Belder
a3963883b8 windows: remove superfluous assert statement 2013-04-18 02:56:07 +02:00
Miroslav Bajtoš
09ff5100e3 windows: make timers handle large timeouts
Fixes a bug where timers with very large timeouts run on the next tick.
Based on a similar bug fix for unix (9b61939).

Fixes joyent/node#5101.
2013-04-16 16:30:33 +02:00
Ben Noordhuis
ef85bdaffb unix: silence STATIC_ASSERT compiler warnings
Newer versions of gcc complain about the definition of the zero element
array. Squelch that warning by turning it into a one element array.
2013-04-12 19:40:57 +02:00
isaacs
5ed1d02cc0 Now working on v0.10.5 2013-04-11 09:00:10 -07:00
isaacs
85827e2640 2013.04.12, Version 0.10.4 (Stable)
Changes since version 0.10.3:

* include: update uv_backend_fd() documentation (Ben Noordhuis)

* unix: include uv.h in src/version.c (Ben Noordhuis)

* unix: don't write more than IOV_MAX iovecs (Fedor Indutny)

* mingw-w64: don't call _set_invalid_parameter_handler (Nils Maier)

* build: gyp disable thin archives (Timothy J. Fontaine)

* sunos: re-export entire library when static (Timothy J. Fontaine)

* unix: dtrace probes for tick-start and tick-stop (Timothy J. Fontaine)

* windows: fix memory leak in fs__sendfile (Shannen Saez)

* windows: remove double initialization in uv_tty_init (Shannen Saez)

* build: fix dtrace-enabled out of tree build (Ben Noordhuis)

* build: squelch -Wdollar-in-identifier-extension warnings (Ben
  Noordhuis)

* inet: snprintf returns int, not size_t (Brian White)

* win: refactor uv_cpu_info (Bert Belder)

* build: add support for Visual Studio 2012 (Nicholas Vavilov)

* build: -Wno-dollar-in-identifier-extension is clang only (Ben
  Noordhuis)
2013-04-11 09:00:06 -07:00
Ben Noordhuis
0ff06b4ac3 build: -Wno-dollar-in-identifier-extension is clang only
Add a compiler check because turning on the option unconditionally
breaks the build when CC=gcc.

This should also fix the build on versions of OS X that predate Apple's
switch to clang (10.6 and older.)
2013-04-10 23:46:24 +02:00
mscdex
633d33a92a cygwin: remove unused variable 2013-04-10 18:30:37 +02:00
Nicholas Vavilov
bc5fa794b9 build: add support for Visual Studio 2012
Closes #722
2013-04-10 16:13:32 +02:00
Bert Belder
a9bce29f0c win: refactor uv_cpu_info
Fixes a couple of error handling issues:

* Don't free an uninitialized pointer when allocating memory for
  `cpu_infos` fails.
* Don't return a bogus error value when NtQuerySystemInformation fails.
  That function returns an NTSTATUS code instead of setting the last
  error.
* Don't clobber out parameters when an error happens.
2013-04-10 16:04:15 +02:00
Brian White
9021dbcd8d inet: snprintf returns int, not size_t 2013-04-10 15:50:39 +02:00
Brian White
4d4f1496d9 windows, unix: remove dead code 2013-04-10 15:50:39 +02:00
Ben Noordhuis
8ea49c1223 build: squelch -Wdollar-in-identifier-extension warnings
The dtrace probes contain dollar signs. We know, llvm-gcc, and we don't
care. Suppress the warnings.
2013-04-10 14:31:39 +02:00
Ben Noordhuis
bad707db3f gitigore: ignore auto-generated uv-dtrace.h header 2013-04-10 14:23:55 +02:00
Ben Noordhuis
be5b16aabd build: fix dtrace-enabled out of tree build 2013-04-10 14:23:55 +02:00
Shannen Saez
603915dd00 windows: remove double initialization in uv_tty_init 2013-04-10 14:17:28 +02:00
Shannen Saez
7570a35b70 windows: fix memory leak in fs__sendfile 2013-04-10 14:17:28 +02:00
Timothy J Fontaine
e1ffc6c0ee unix: dtrace probes for tick-start and tick-stop 2013-04-10 14:10:05 +02:00
Timothy J Fontaine
0da533e84f sunos: re-export entire library when static
This is useful to make sure linker doesn't strip things like dtrace
2013-04-10 14:10:05 +02:00
Timothy J Fontaine
e294975bb4 build: gyp disable thin archives
Thin archives aren't available on all platforms, notably smartos
2013-04-10 14:10:05 +02:00
Nils Maier
5676924c5b mingw-w64: don't call _set_invalid_parameter_handler
Check the __MSVCRT_VERSION__, as mingw-w64 always defines
_WRITE_ABORT_MSG.

Closes #774
2013-04-10 14:03:23 +02:00
Fedor Indutny
895e77639e unix: don't write more than IOV_MAX iovecs
Write no more than `IOV_MAX` chunks with `writev()` at
once, otherwise `writev()` returns EINVAL.
2013-04-08 19:51:30 +04:00
Ben Noordhuis
f1215b7918 unix: include uv.h in src/version.c
Include uv.h so the compiler sees the right visibility attribute for
uv_version() and uv_version_string().

GYP builds compile with -fvisibility=hidden. Before this commit, the
symbols were not visible in libuv.so.

Fixes joyent/node#5213.
2013-04-04 03:05:38 +02:00
Ben Noordhuis
ec24bfac19 include: update uv_backend_fd() documentation
uv_run_once() is no more, replace with uv_run(UV_RUN_NOWAIT).

Fixes #759.
2013-03-31 20:02:25 +02:00
Bert Belder
9e90cdeae7 Now working on v0.10.4 2013-03-28 19:59:51 +01:00
Bert Belder
31ebe23973 2013.02.04, Version 0.10.3 (Stable)
Changes since version 0.10.2:

* include: remove extraneous const from uv_version() (Ben Noordhuis)

* doc: update README, replace `OS` by `PLATFORM` (Ben Noordhuis)

* build: simplify .buildstamp rule (Ben Noordhuis)

* build: disable -Wstrict-aliasing on darwin (Ben Noordhuis)

* darwin: don't select(&exceptfds) in fallback path (Ben Noordhuis)

* unix: don't clear flags after closing UDP handle (Saúl Ibarra
  Corretgé)
2013-03-28 19:56:36 +01:00
Saúl Ibarra Corretgé
a9a23dc28e unix: don't clear flags after closing UDP handle 2013-03-28 16:08:42 +01:00
Ben Noordhuis
75141493ba darwin: don't select(&exceptfds) in fallback path
The exceptfds set is for polling OOB data, not errors.

Fixes joyent/node#5155.
2013-03-28 00:15:59 +01:00
Ben Noordhuis
fe136cedb9 build: disable -Wstrict-aliasing on darwin
The antiquated gcc/clang that ships with Xcode emits waaaay too many
false positives.
2013-03-28 00:10:51 +01:00
Ben Noordhuis
0fb9b22ce6 build: simplify .buildstamp rule 2013-03-26 15:16:24 +01:00
Ben Noordhuis
bd20b37170 doc: update README, s/OS/PLATFORM/
Commit a9740c9 changed the name of the OS var to PLATFORM but forgot to
update the README.
2013-03-26 14:50:21 +01:00
Ben Noordhuis
3f6122b3f7 include: remove extraneous const from uv_version()
Fixes the following warning:

  include/uv.h:236:30: warning: type qualifiers ignored on function
  return type [-Wignored-qualifiers]
   UV_EXTERN const unsigned int uv_version(void);
2013-03-26 14:48:30 +01:00
Bert Belder
d5f8c1a4d3 Now working on v0.10.3 2013-03-25 15:41:25 +01:00
Bert Belder
0f36a00568 2013.03.25, Version 0.10.2 (Stable)
This is the first officially versioned release of libuv. Starting now
libuv will make releases independently of Node.js.

Changes since Node.js v0.10.0:

* test: add tap output for windows (Timothy J. Fontaine)

* unix: fix uv_tcp_simultaneous_accepts() logic (Ben Noordhuis)

* include: bump UV_VERSION_MINOR (Ben Noordhuis)

* unix: improve uv_guess_handle() implementation (Ben Noordhuis)

* stream: run try_select only for pipes and ttys (Fedor Indutny)

Changes since Node.js v0.10.1:

* build: rename OS to PLATFORM (Ben Noordhuis)

* unix: make uv_timer_init() initialize repeat (Brian Mazza)

* unix: make timers handle large timeouts (Ben Noordhuis)

* build: add OBJC makefile var (Ben Noordhuis)

* Add `uv_version()` and `uv_version_string()` APIs (Bert Belder)
2013-03-25 15:40:53 +01:00
Bert Belder
eeeb07934b Update AUTHORS and .mailmap 2013-03-25 15:36:20 +01:00
Bert Belder
c7b1c53ef1 Prepare for making releases, add uv_version/uv_version_string API 2013-03-25 15:35:00 +01:00
Ben Noordhuis
1487d5aea7 build: add OBJC makefile var
Overrides the Objective-C compiler that is used. Defaults to $(CC).
2013-03-23 23:16:54 +01:00
Ben Noordhuis
9b619396d9 unix: make timers handle large timeouts
This commit fixes two closely related integer overflow bugs:

* Timers with a timeout > INT_MAX cause uv__next_timeout() to return
  a negative value.

* Timers with very large timeouts (close or equal to ULLONG_MAX) run on
  the next tick.

In both cases, clamp the values to prevent the overflow from happening.

Fixes joyent/node#5101.
2013-03-21 14:54:36 +01:00
Brian Mazza
77cb29a723 unix: make uv_timer_init() initialize repeat
uv_timer_get_repeat() should return 0 for timers that haven't been
started.
2013-03-19 23:15:30 +01:00
Ben Noordhuis
a9740c9bc4 build: rename OS to PLATFORM
Rename the OS make variable to PLATFORM, it conflicts with the OS env
var. That is, running `make` when the OS env var is set, may cause
spurious build breakage.

Fixes #737.
2013-03-17 00:12:43 +01:00
Fedor Indutny
b45a74fab3 stream: run try_select only for pipes and ttys
Its not necesary for TCP and other streams, since fd is always working
with kqueue there.
2013-03-16 23:29:24 +01:00