Commit Graph

2169 Commits

Author SHA1 Message Date
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
Ben Noordhuis
7b66ea18ff unix: improve uv_guess_handle() implementation
Make it understand FIFOs, character devices and sockets.
2013-03-14 14:22:04 +01:00
Ben Noordhuis
9f714a1d25 include: bump UV_VERSION_MINOR
Fixes #740.
2013-03-14 12:49:21 +01:00
Ben Noordhuis
905d56c140 unix: fix uv_tcp_simultaneous_accepts() logic
Inverts the meaning of the 'enable' argument. Before, it actually set
the UV_TCP_SINGLE_ACCEPT flag when enable=1. Now it clears it, which is
what uv-win does and what you would expect it to do.
2013-03-12 12:39:37 +01:00
Timothy J Fontaine
2f84a57566 test: add tap output for windows 2013-03-11 18:12:25 +01:00
Bert Belder
5462dab889 win/tcp: don't enable iocp sync bypass when iocp emulation is used
When iocp sync bypass is in use libuv doesn't expect the system to
generate events when an i/o operation completes synchronously. However
when iocp emulation is enabled an event will always be generated because
SetFileCompletionNotificationModes() doesn't stop OVERLAPPED.hEvent from
becoming signaled.

This should fix joyent/node#4959.
2013-03-09 20:22:50 +01:00
Bert Belder
f59dc221e6 win: fix potential HANDLE corruption due to incorrect cast
Closes #738.
2013-03-09 18:24:59 +01:00
isaacs
b68ee40496 win: Map ERROR_INVALID_FUNCTION to EISDIR
This error is raised when calling read() or write() on a directory.

A bit of googling turns up some cases where this error can be raised
that are not properly mapped to EISDIR, but are also cases that libuv
doesn't really care about, like the Password Manager API,
GetFirmwareEnvironmentVariable, or CreateTapePartition.

If libuv ever needs to handle these cases, then I suppose that the
ERROR_INVALID_FUNCTION->EISDIR mapping could be done directly in the
fs read() and write() functions, but doing so at this point seems
premature, as it makes the error code mapping a bit more messy.

Fixes joyent/node#4951
2013-03-07 16:00:50 -08:00
Ben Noordhuis
8fbe43379d unix: please valgrind, free memory in threadpool.c 2013-03-07 01:57:30 +01:00
Ben Noordhuis
dac5a758f8 unix: replace volatile cast with ACCESS_ONCE macro 2013-03-07 00:53:07 +01:00
Ben Noordhuis
e0df7b6873 unix: fix strict aliasing warning in udp.c 2013-03-07 00:53:06 +01:00
Ben Noordhuis
b6a50c7295 unix: add uv_buf_t static asserts to core.c
Verify that our uv_buf_t type is ABI-compatible with struct iovec.
2013-03-07 00:53:06 +01:00
Ben Noordhuis
ef9b065532 unix: add STATIC_ASSERT macro 2013-03-07 00:52:50 +01:00
Ben Noordhuis
ee9899e28b unix: fix strict aliasing warnings, macro-ify functions
Replace a few internal functions in uv-common.h with macros to avoid
strict aliasing warnings with older versions of gcc.

It's not smart enough to figure out that e.g. a uv_tcp_t is an instance
of uv_handle_t with similar alignment requirements and therefore no
aliasing happens. More recent versions of gcc don't suffer from this.

I'm not normally in the habit of catering to compiler defects but the
aliasing warnings drown out legitimate warnings, hence the change.
2013-03-06 23:47:43 +01:00
Ben Noordhuis
1e97b4567e unix: honor UV_THREADPOOL_SIZE environment var
Make the size of the thread pool configurable through an environment
variable. For sanity reasons, the size is clamped to the range 1-128.
2013-03-06 23:19:34 +01:00
Bert Belder
f89125e0e6 win/tty: fix typo in color attributes enumeration 2013-03-05 20:31:52 +01:00