Commit Graph

328 Commits

Author SHA1 Message Date
Stephen Belanger
43744c3708
doc: fix uv_get_free_memory doc
There was a formatting error that prevented the uv_get_free_memory
function from appearing on the page.

PR-URL: https://github.com/libuv/libuv/pull/2163
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
2019-02-05 08:30:01 +01:00
cjihrig
d4288bbeab
unix,win: add uv_os_uname()
Fixes: https://github.com/libuv/libuv/issues/2126
PR-URL: https://github.com/libuv/libuv/pull/2128
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-01-14 10:47:20 -05:00
Ben Noordhuis
3233ccf169 Revert "win,fs: retry if uv_fs_rename fails"
This reverts commit e94c184c7c.

Concerns were raised about the suitability of this policy and I, for
one, agree with them.

Fixes: https://github.com/libuv/libuv/issues/2098
PR-URL: https://github.com/libuv/libuv/pull/2122
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-12-27 08:19:30 +01:00
Ivan Krylov
5b64cc60b9 doc: clarify expected memory management strategy
Right now, docs don't make it clear when exactly does it become okay to
free memory belonging to `uv_handle_t`. It's only stated that
`uv_close` must be called before freeing the memory, which is a source
of confusion for new users: they call `uv_close(handle, NULL)`, then
free the memory (see e.g. #2078, https://stackoverflow.com/q/25615340).

PR-URL: https://github.com/libuv/libuv/pull/2087
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-12-02 15:50:39 +01:00
Bartosz Sosnowski
4c2dcca27b
win: support more fine-grained windows hiding
Added UV_PROCESS_WINDOWS_HIDE_CONSOLE and
UV_PROCESS_WINDOWS_HIDE_GUI for specifying if console or GUI
subprocess windows are to be hidden.

Refs: https://github.com/nodejs/node/pull/24034
PR-URL: https://github.com/libuv/libuv/pull/2073
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-10 14:43:23 -05:00
Bartosz Sosnowski
e94c184c7c win,fs: retry if uv_fs_rename fails
On Windows rename operation can fail randomly in presence of antivirus
or indexing software. Make `uv_fs_rename` retry up to four times with
250ms delay between attempts before giving up.

PR-URL: https://github.com/libuv/libuv/pull/1981
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-01 11:46:00 +01:00
hitesh
4772d44087
win,doc: path encoding in uv_fs_XX is UTF-8
Fixes: https://github.com/libuv/libuv/issues/1554
PR-URL: https://github.com/libuv/libuv/pull/1943
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2018-10-11 12:11:55 +02:00
Ben Noordhuis
6781db5c78 doc: remove extraneous "on"
Fixes: https://github.com/libuv/libuv/issues/2000
PR-URL: https://github.com/libuv/libuv/pull/2010
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jamie Davis <davisjam@vt.edu>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-10-02 12:58:39 +02:00
Jameson Nash
40498795ab stream: autodetect direction
Previously, we required the user to specify the expected read/write
flags for a pipe or tty. But we've already been asking the OS to tell us
what they actually are (fcntl F_GETFL), so we can hopefully just use
that information directly.

Fixes: https://github.com/libuv/libuv/issues/1936
PR-URL: https://github.com/libuv/libuv/pull/1964
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-09-19 18:19:28 +02:00
Bartosz Sosnowski
b721891ad4
win,doc: improve uv_os_setpriority() documentation
Refs: https://github.com/nodejs/node/pull/22817
PR-URL: https://github.com/libuv/libuv/pull/1985
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-09-18 12:13:01 -04:00
Bert Belder
baa621c85e
doc: clarify that some remarks apply to windows
PR-URL: https://github.com/libuv/libuv/pull/1988
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-09-18 10:05:06 -04:00
Emil Bay
89a9ea672b
doc: fix argument name in tcp.rts
PR-URL: https://github.com/libuv/libuv/pull/1974
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-09-03 14:46:35 +02:00
Emil Bay
ff45b0d789
doc: add missing slash in stream.rst
PR-URL: https://github.com/libuv/libuv/pull/1973
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2018-09-01 13:01:10 +02:00
cjihrig
e57e07172e
unix,win: add uv_os_{get,set}priority()
Refs: https://github.com/nodejs/node/pull/21675
PR-URL: https://github.com/libuv/libuv/pull/1945
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-08-15 09:17:55 -04:00
Bartosz Sosnowski
8f96a5b07b fs: add uv_open_osfhandle
Adds uv_open_osfhandle to complete uv_get_osfhandle

Ref: https://github.com/nodejs/node/issues/15433
Ref: https://github.com/nodejs/node-addon-api/issues/304
PR-URL: https://github.com/libuv/libuv/pull/1927
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-08-09 11:19:15 +02:00
Ujjwal Sharma
4f43a8673b
fs: change position of uv_fs_lchown
Change the position of UV_LS_LCHOWN, moving it to the end in order to go
around a bug due to it's initial position.

The original position of UV_LS_LCHOWN broke ABI compat, causing a binary
using UV_FS_REALPATH or UV_FS_COPYFILE to break, as the values point to
wrong function.

Refs: https://github.com/yarnpkg/yarn/issues/6043
Fixes: https://github.com/libuv/libuv/issues/1908
PR-URL: https://github.com/libuv/libuv/pull/1913
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-07-07 15:48:44 +02:00
Shelley Vohr
5124b27d35
src: add new error apis to prevent memory leaks
This PR creates two new externally-facing APIs, uv_err_name_r() and
uv_strerror_r().

In keeping with the precedent set by POSIX, the *_r() suffix of these
two new methods indicate that the caller does the memory management and
passes in the memory that the output will be stored in, which provides
an alternative for the two existent methods (uv_err_name() and
uv_strerror()), which, when called with an unknown error code, leak a
few bytes of memory.

PR-URL: https://github.com/libuv/libuv/pull/1898
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno santiago.gimeno@gmail.com
2018-07-06 19:35:21 +02:00
Ed Schouten
0802c81966
doc: document UV_*_MAP() macros
UV_ERRNO_MAP(), UV_HANDLE_TYPE_MAP(), and UV_REQ_TYPE_MAP() are
considered part of the public API. This commit documents them.

Fixes: https://github.com/libuv/libuv/issues/1607
PR-URL: https://github.com/libuv/libuv/pull/1653
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-06-19 22:58:50 -04:00
Ed Schouten
46464dd1b7
doc: undocument uv_req_type's UV_REQ_TYPE_PRIVATE
This is merely an internal definition that may expand to OS
specific request types. It is not an actual symbolic constant
part of the enumeration.

Fixes: https://github.com/libuv/libuv/issues/1607
PR-URL: https://github.com/libuv/libuv/pull/1653
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-06-19 22:57:08 -04:00
Ed Schouten
295311dca1
doc: document uv_pipe_t::ipc
Fixes: https://github.com/libuv/libuv/issues/1607
PR-URL: https://github.com/libuv/libuv/pull/1653
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-06-19 22:53:10 -04:00
Paolo Greppi
aa28f7d5bf
unix,win: add uv_fs_lchown()
Fixes: https://github.com/libuv/libuv/issues/1790
PR-URL: https://github.com/libuv/libuv/pull/1826
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-06-19 10:05:01 -04:00
John Barboza
8ab14e2cb9
doc: add uv_fs_fsync() AIX limitations
Unlike other platforms, the fsync call on aix will not accept
non-regular file file-descriptors.

Refs: https://github.com/nodejs/node/pull/21298
PR-URL: https://github.com/libuv/libuv/pull/1879
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-06-19 09:35:45 -04:00
Saúl Ibarra Corretgé
99ae3edf28 core: move all include files except uv.h to uv/
This is a cherry-pick of commit d010030ad5 from the master branch.

Conflicts:
 	Makefile.am
 	include/uv.h
 	include/uv/unix.h
 	libuv.nsi (deleted)
 	src/unix/pthread-barrier.c (deleted)

PR-URL: https://github.com/libuv/libuv/pull/1850
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-06-14 18:39:32 +02:00
Björn Linse
62a0f763a7
win,process: allow child pipe handles to be opened in overlapped mode
PR-URL: https://github.com/libuv/libuv/pull/1784
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
2018-05-25 15:32:32 -07:00
Thomas Versteeg
9afb013574
doc: clarify platform specific pipe naming
Pipe naming conventions differ on Windows and Unix. This
commit calls out the naming conventions and requirements.

PR-URL: https://github.com/libuv/libuv/pull/1765
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
2018-04-07 14:26:26 -04:00
Bob Burger
1d1287d764
doc,fs: improve documentation
Update description of `uv_fs_readlink` and `uv_fs_realpath` to describe
where the resulting string goes.

Fixes: https://github.com/libuv/libuv/issues/1771
PR_URL: https://github.com/libuv/libuv/pull/1786
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-04-06 08:53:30 +02:00
cjihrig
3ae88200d6
unix,win: add UV_FS_COPYFILE_FICLONE_FORCE support
UV_FS_COPYFILE_FICLONE_FORCE attempts to use copy-on-write
semantics in uv_fs_copyfile(). If CoW is not available, an
error is returned.

Refs: https://github.com/libuv/libuv/pull/1465
Refs: https://github.com/libuv/libuv/pull/1491
PR-URL: https://github.com/libuv/libuv/pull/1768
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-03-16 01:00:43 -04:00
cjihrig
db918361eb
unix: add UV_FS_COPYFILE_FICLONE support
UV_FS_COPYFILE_FICLONE attemps to use copy-on-write
semantics in uv_fs_copyfile(). If CoW is not available,
it falls back to a normal copy operation.

Refs: https://github.com/libuv/libuv/pull/1465
PR-URL: https://github.com/libuv/libuv/pull/1491
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-03-05 10:18:30 -05:00
Bartosz Sosnowski
a4b2e32228
doc: fix syntax error in loop documentation
PR-URL: https://github.com/libuv/libuv/pull/1748
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-02-21 09:16:48 -05:00
Bartosz Sosnowski
10fe8c8065
doc: add note about handle movability
Add note that explaining pointers to handles need to
remain valid during the requested operations.

Refs: https://github.com/libuv/libuv/issues/1731
PR-URL: https://github.com/libuv/libuv/pull/1749
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-02-21 09:09:25 -05:00
Vladimír Čunát
9d74b27ad4
doc: document uv_timer_start() on an active timer
Fixes: https://github.com/libuv/libuv/issues/1401
PR-URL: https://github.com/libuv/libuv/pull/1538
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-02-21 09:07:05 -05:00
John Barboza
1ded66908d zos: fix timeout for condition variable
The pthread_cond_timedwait requires a timeout relative to the Epoch.
So don't use uv__hrtime to set the timeout because it is relative to an
arbitrary time in the past. Use gettimeofday instead.

PR-URL: https://github.com/libuv/libuv/pull/1711
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jamie Davis <davisjam@vt.edu>
2018-02-15 16:15:23 +01:00
Bartosz Sosnowski
2b32e77bb6 win: map 0.0.0.0 and :: addresses to localhost
On Linux when connecting IP addresses 0.0.0.0 and :: are automatically
converted to localhost. This adds same functionality to Windows.

PR-URL: https://github.com/libuv/libuv/pull/1515
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-12-28 10:42:11 +01:00
John Barboza
b01de7341f
zos: implement uv_fs_event* functions
This commit uses the Register File Interest feature on z/OS
to enable users to monitor file system events.
The poll call is used to check for file descriptors as well
as a message queue that z/OS will report file system events
on. The last item on the list used by poll will contain the
message queue id instead of a file descriptor.

Limitation:
Writes to a directory (that is, file creation and deletion)
do not generate a change message for a registered directory.

PR-URL: https://github.com/libuv/libuv/pull/1311
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-12-15 11:04:16 +01:00
Matt Harrison
8a6d1b32c5 unix: make get(set)_process_title MT-safe
Used a shared uv_mutex_t in unix implementations of these functions
to prevent simultaneous execution.

Fixes: https://github.com/libuv/libuv/issues/271
PR-URL: https://github.com/libuv/libuv/pull/1640
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-12-02 12:06:34 +01:00
Anna Henningsen
0d6525acae core: add getter/setter functions for easier ABI compat
Add getter/setter functions for the fields of public structs that
might be relevant to e.g. Node.js addons.

Through these methods, ABI compatibility for a subset of the ABI
is easier to achieve, since using them makes code independent
of the exact offsets of these fields.

The intended use case that prompted this are N-API addons for
Node.js, which look for more long-term ABI compatibility guarantees
than typical Node code. With these helper functions, using libuv
directly should no longer be an obstacle for such addons.

PR-URL: https://github.com/libuv/libuv/pull/1657
Refs: https://github.com/nodejs/node/issues/13512
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-12-02 09:51:25 +01:00
Bartosz Sosnowski
d708df110a
unix,win: add uv_os_getpid()
Adds a multi platform way to get current process id.

PR-URL: https://github.com/libuv/libuv/pull/1661
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-30 20:11:21 -05:00
Bartosz Sosnowski
c845245e43 doc: remove note about SIGWINCH on Windows
SIGWINCH support was improved by
6ad1e81547

PR-URL: https://github.com/libuv/libuv/pull/1638
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-28 14:48:09 +01:00
Joran Dirk Greef
1c4de1916e win: map UV_FS_O_EXLOCK to a share mode of 0
This is necessary to enable writing past the MBR of a raw block device.

Fixes: https://github.com/libuv/libuv/issues/1605
PR-URL: https://github.com/libuv/libuv/pull/1613
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
2017-11-16 15:14:52 +01:00
Ed Schouten
7ef23d9e85 doc: clarify the description of uv_loop_alive()
This function not only returns true if there are active handles or
requests. First of all, it also takes into account whether handles are
referenced. Second, handles that are being closed also contribute to
whether a loop is alive.

Fixes: https://github.com/libuv/libuv/issues/1592
PR-URL: https://github.com/libuv/libuv/pull/1594
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-11-15 13:59:34 +01:00
Pekka Nikander
695afe8322
unix,win: add uv_if_{indextoname,indextoiid}
uv_if_indextoname() is used to convert an IPv6 scope_id
to an interface identifier string such as %eth0 or %lo.

uv_if_indextoiid() returns an IPv6 interface identifier.
On Unix it calls uv_if_indextoname(). On Windows it uses
snprintf() to return the numeric interface identifier as
a string.

Refs: https://github.com/nodejs/node/pull/14500
PR-URL: https://github.com/libuv/libuv/pull/1445
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-06 09:54:47 -05:00
Bartosz Sosnowski
fd02ab681b pipe: allow access from other users
Adds new uv_pipe_chmod function which can be used to make the pipe
writable or readable by all users.

PR-URL: https://github.com/libuv/libuv/pull/1386
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-06 15:45:00 +01:00
rayrase
7a93b12f1d
doc: mark uv_default_loop() as not thread safe
Fixes: https://github.com/libuv/libuv/issues/1461
PR-URL: https://github.com/libuv/libuv/pull/1590
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-01 11:05:50 -04:00
cjihrig
e8e6a8a500
unix,win: add uv_os_getppid()
Refs: https://github.com/nodejs/node/issues/14957
PR-URL: https://github.com/libuv/libuv/pull/1610
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-11-01 10:32:12 -04:00
Joran Dirk Greef
4b666bd2d8 unix,win: add fs open flags, map O_DIRECT|O_DSYNC
Define stable cross-platform file open constants so that users can
pass `UV_FS_O_RDWR` rather than `_O_RDWR` (win) or `O_RDWR` (unix).

Map `UV_FS_O_DIRECT`, `UV_FS_O_DSYNC` and `UV_FS_O_SYNC` to
`FILE_FLAG_NO_BUFFERING` and `FILE_FLAG_WRITE_THROUGH` (win).

Fixes: https://github.com/libuv/libuv/issues/1550
PR-URL: https://github.com/libuv/libuv/pull/1567
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
2017-10-03 12:49:54 +02:00
Scott Parker
ec96b55438
unix,win: add uv_mutex_init_recursive()
Support the creation of recursive mutexes on Unix. A matching
API is added on Windows, however mutexes on Windows are always
recursive.

Refs: https://github.com/libuv/libuv/issues/1022
PR-URL: https://github.com/libuv/libuv/pull/1555
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-10-02 10:01:09 -04:00
Vladimír Čunát
737b482baa
doc: fix a trivial typo
PR-URL: https://github.com/libuv/libuv/pull/1516
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-09-01 13:33:33 +02:00
cjihrig
766d7e9c0b
unix, windows: add basic uv_fs_copyfile()
Fixes: https://github.com/libuv/libuv/issues/925
PR-URL: https://github.com/libuv/libuv/pull/1465
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-08-15 10:43:49 -04:00
Ben Noordhuis
19e51ae51f doc: document uv_async_(init|send) return values
Fixes: https://github.com/libuv/libuv/issues/576
PR-URL: https://github.com/libuv/libuv/pull/1435
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-07-27 17:54:45 +02:00
Anticrisis
cf38297b60 docs: fix guide source code example paths
Source code examples in the User guide were not appearing in the built
documentation because the relative paths were incorrect.

PR-URL: https://github.com/libuv/libuv/pull/1428
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-07-25 00:28:17 +02:00
CurlyMoo
d731fd1bd9 poll: add support for OOB TCP and GPIO interrupts
Out-of-band TCP messages are used for TCP data
transmission outside (outband) the inbound TCP
data. These packets are sent with an
"urgent pointer", but previously discarded.

Additionally, when using (e)poll a POLLPRI is
triggered when an interrupt signal is received
on GPIO capable systems such as the Raspberry Pi.

PR-URL: https://github.com/libuv/libuv/pull/1040
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-07-12 23:04:34 +02:00
Matthew Taylor
bdc87005a1 doc: add thread safety warning for process title
Add a small warning about uv_get_process_title()
and uv_set_process_title() not being thread safe on platforms
other than Windows. Also add a reminder for users to call
uv_setup_args() first.

Fixes: https://github.com/libuv/libuv/issues/1395
PR-URL: https://github.com/libuv/libuv/pull/1396
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-07-12 09:42:44 -04:00
Bernardo Ramos
f737f941c5 doc: use valid pipe name in pipe-echo-server
PR-URL: https://github.com/libuv/libuv/pull/1330
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-05-30 12:02:45 -04:00
Juan Cruz Viotti
e133923e93 win: make uv__get_osfhandle() public
The uv__get_osfhandle() function is a private functio of the
Windows subsystem, and its used to get a Windows HANDLE out
of a file descriptor number.

The motivation behind making this function public is to
allow Node.js programs to pass file descriptors created
using fs.open() to native Node.js C++ add-ons, and be able to
successfully convert them to Windows HANDLEs.

Refs: https://github.com/libuv/libuv/pull/1166
Refs: https://github.com/nodejs/node/issues/6369
Fixes: https://github.com/libuv/libuv/issues/1291
PR-URL: https://github.com/libuv/libuv/pull/1323
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-05-30 11:53:31 -04:00
Bernardo Ramos
ce770a6c3b doc: fix memory leak in tcp-echo-server example
Fixes: https://github.com/libuv/help/issues/4
PR-URL: https://github.com/libuv/libuv/pull/1363
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-05-29 13:24:30 -04:00
cjihrig
6c2fd34e39 doc: mark uv_loop_fork() as experimental
uv_loop_fork() was recently added, but is known to contain
bugs. This commit marks the function as experimental so that
bugs can be addressed without blocking further libuv releases.

Refs: https://github.com/libuv/libuv/pull/846
Refs: https://github.com/libuv/libuv/pull/1269
Refs: https://github.com/libuv/libuv/issues/1264
PR-URL: https://github.com/libuv/libuv/pull/1356
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-05-25 11:41:27 -04:00
cjihrig
d8cd08bd98 unix,win: add uv_os_gethostname()
Fixes: https://github.com/libuv/libuv/issues/1315
PR-URL: https://github.com/libuv/libuv/pull/1342
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2017-05-18 10:27:47 -04:00
Saúl Ibarra Corretgé
d59d6e6f22 doc: add code samples from uvbook (unadapted)
PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-28 11:16:15 +02:00
Saúl Ibarra Corretgé
0227060489 doc: add warning note to user guide
PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-28 11:15:53 +02:00
Saúl Ibarra Corretgé
481f454403 doc: remove licensing note from guide/about
PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-28 11:15:47 +02:00
Saúl Ibarra Corretgé
1caae80cd6 doc: update guide/about and mention new maintainership
PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-28 11:15:38 +02:00
Saúl Ibarra Corretgé
a94f83e4d8 doc: removed unused file
We use guide.rst as our index, so there is no need for a secondary one.

PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-28 11:15:29 +02:00
Saúl Ibarra Corretgé
b80106de45 doc: add initial version of the User Guide
This is a fresh import of uvbook [0], as is. It is to be considered
"beta", as the entire content hasn't been revised / adapted yet.

PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-28 11:15:10 +02:00
Saúl Ibarra Corretgé
521146dac4 doc: move "upgrading" to a standalone document
PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-28 11:15:04 +02:00
Saúl Ibarra Corretgé
afb37ce451 doc: move documentation section up
PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-28 11:14:56 +02:00
Saúl Ibarra Corretgé
8e95cba175 doc: move TOC to a dedicated document
PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-28 11:14:50 +02:00
Saúl Ibarra Corretgé
d2eca716f1 doc: update copyright years
PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-28 11:14:39 +02:00
Saúl Ibarra Corretgé
93415e662b doc: rename docs to "libuv documentation"
PR-URL: https://github.com/libuv/libuv/pull/1246
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-28 11:13:39 +02:00
Daniel Kahn Gillmor
e4bc694b36 doc: fix documentation for uv_handle_t.type
PR-URL: https://github.com/libuv/libuv/pull/1316
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-04-25 08:15:11 +02:00
Ben Noordhuis
a76e7830ca doc: libuv does not touch uv_loop_t.data
Mea culpa, I forgot to update the documentation in commit ff0ae10
("unix: preserve loop->data across loop init/done") from July 2016.

PR-URL: https://github.com/libuv/libuv/pull/1299
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-18 10:42:23 +02:00
Daniel Bevenius
12f18159cf
doc: suggestions for design page
While reading the design page I came across a few sentences that could
perhaps be improved, and this commit contains suggestions for such
improvements.

PR-URL: https://github.com/libuv/libuv/pull/1302
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-12 12:12:52 +02:00
Daniel Bevenius
a3d9d8ed73 doc: minor grammar fix in Installation section
PR-URL: https://github.com/libuv/libuv/pull/1301
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-11 10:45:40 -04:00
Daniel Bevenius
5e5ac86a54 doc: fix docs/src/fs.rst build warning
This commit fixes a warning about the title underline
being too short.

PR-URL: https://github.com/libuv/libuv/pull/1300
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-04-11 10:43:23 -04:00
Jamie Davis
eb8509210d doc: fix multiple doc typos
Use "file system" instead of "filesystem" throughout the document and
some other minor fixes.

PR-URL: https://github.com/libuv/libuv/pull/1278
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-04-01 19:25:17 +02:00
Jason Madden
fd7ce57f2b unix: make loops and watchers usable after fork()
Added the uv_loop_fork() API that must be called in a child process to
continue using an existing loop. Internally this calls a uv__io_fork
function for each supported platform, similar to the way
uv__platform_loop_init works.

After this call, existing and new IO, async and signal watchers will
contiue working as before on all platforms, as will the
threadpool (although any threads it was using are of course gone).

On Linux and BSDs that use kqueue, existing and new fsevent watchers
will also continue to work as expected. On OS X, though, directory
fsevents will not be able to use the optimized CoreFoundation path if
they had already been used in the parent process, instead falling back
to the kqueue path used on other BSDs.

Existing fsevent watchers will not function on AIX or SunOS. This
could be relatively easily fixed by someone with AIX knowledge in the
future, but SunOS will require some additional work to keep track if
the watchers.

A new test file, test/test-fork.c, was added to contain fork-related
tests to verify functionality in the child process.

PR-URL: https://github.com/libuv/libuv/pull/846
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-03-21 12:23:44 +01:00
cjihrig
c4bd9f48e0 docs: improve UV_ENOBUFS scenario documentation
This commit adds additional documentation to the UV_ENOBUFS
scenario for several methods.

Fixes: https://github.com/libuv/libuv/issues/1179
PR-URL: https://github.com/libuv/libuv/pull/1235
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-03-08 20:55:40 -05:00
cjihrig
ee02f60c90 unix,win: add uv_os_{get,set,unset}env()
These functions are used to create, retrieve, update, and delete
environment variables.

Fixes: https://github.com/libuv/libuv/issues/1198
PR-URL: https://github.com/libuv/libuv/pull/1234
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-03-08 20:39:33 -05:00
Santiago Gimeno
45616f542d
signal: add uv_signal_start_oneshot method
It behaves as `uv_signal_start` but it resets the signal handler as soon
as the signal is received.

Fixes: https://github.com/libuv/libuv/issues/1104
PR-URL: https://github.com/libuv/libuv/pull/1106
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
2017-02-28 14:16:54 +01:00
Howard Hellyer
d6427e4beb
aix: enable uv_get/set_process_title
This patch enables querying and setting the process title on AIX.
libuv takes ownership of the memory for argv and returns a deep copy
of the array and its contents.
It also enables the process_title test case.

The process title can be changed on AIX but is handled differently
to Linux/Mac. Commands like ps read the original argv array passed
to the process instead of the memory at argv[0]. To change the process
title we need to update argv[0] to point at a new string and set
argv[1] to NULL (if it exists). This means the process title
can be set to a string of any length.

PR-URL: https://github.com/libuv/libuv/pull/1187
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-01-26 12:50:49 +01:00
Daniel Bevenius
c722b8d278 doc: add repitition qualifier to version regexs
Currently the libuv version is reported as unknown on the
website. This is because the UV_VERSION_MINOR is no longer
a single digit and the regex is not getting a match for
the minor number. This commit makes the version regexs
capture multiple digit numbers.

PR-URL: https://github.com/libuv/libuv/pull/1205
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2017-01-20 09:52:39 -05:00
Michele Caini
5f34766a14 doc: fix wrong man page link for uv_fs_lstat()
PR-URL: https://github.com/libuv/libuv/pull/1134
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Imran Iqbal <imran@imraniqbal.org>
2016-11-11 15:43:14 -05:00
Philippe Laferriere
f1863dae6b unix,win: add uv_translate_sys_error() public API
uv_translate_sys_error() was a private function for Windows.
This commit adds an equivalent function on other platforms, and
exposes it as public API.

Exposing this is useful in scenarios where the application uses
both libuv functions and platform-specific system calls and wants
to report errors uniformly as libuv errors.

Fixes: https://github.com/libuv/libuv/issues/79
PR-URL: https://github.com/libuv/libuv/pull/1060
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-10-16 17:47:42 -04:00
Alex Hultman
8ebecf6eab doc: add reference to uv_update_time on uv_timer_start
PR-URL: https://github.com/libuv/libuv/pull/1079
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-10-14 07:26:17 +02:00
Vladimír Čunát
1bcdca290d doc: note buffer lifetime requirements in uv_write
Fixes: https://github.com/libuv/libuv/issues/1072
PR-URL: https://github.com/libuv/libuv/pull/1074
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-10-09 13:00:09 -04:00
Vit Gottwald
20c9c0105b doc: add description of uv_handle_type
Fixes: https://github.com/libuv/libuv/issues/1044
PR-URL: https://github.com/libuv/libuv/pull/1059
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-09-22 01:50:09 +02:00
Bart Robinson
d38edefc73 doc: fix confusing doc of uv_tcp_nodelay
Previous description implied enabling nodelay enabled Nagle, but it is
the other way around.

PR-URL: https://github.com/libuv/libuv/pull/1050
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-09-15 10:38:34 +02:00
Imran Iqbal
30d852f9e0
doc: update supported fields for uv_rusage_t
Fixes: https://github.com/libuv/libuv/issues/342
PR-URL: https://github.com/libuv/libuv/pull/1041
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-09-11 17:04:39 -04:00
Saúl Ibarra Corretgé
bf0301c33c doc: improve documentation on uv_alloc_cb
Refs: https://github.com/libuv/libuv/issues/1027#issuecomment-244386298
PR-URL: https://github.com/libuv/libuv/pull/1033
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Imran Iqbal <imran@imraniqbal.org>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2016-09-07 22:09:17 +02:00
Saúl Ibarra Corretgé
f046ebb409 doc: uv_buf_t members are not readonly
This is probably a reminiscent of the usage in libuv 0.x, where alloc_cb
used to return a uv_buf_t.

Refs: https://github.com/libuv/libuv/issues/1027#issuecomment-244386298
PR-URL: https://github.com/libuv/libuv/pull/1033
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Imran Iqbal <imran@imraniqbal.org>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2016-09-07 22:07:11 +02:00
Saúl Ibarra Corretgé
6938f6b0bd doc: document uv_fs_realpath caveats
Fixes: https://github.com/libuv/libuv/issues/1017
PR-URL: https://github.com/libuv/libuv/pull/1026
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Imran Iqbal <imran@imraniqbal.org>
2016-09-02 09:57:25 +02:00
Michele Caini
f001a67e1d doc: add missing entry in uv_fs_type enum
PR-URL: https://github.com/libuv/libuv/pull/958
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-07-28 12:47:56 +01:00
cjihrig
840a8c599e unix,win: make uv_get_process_title() stricter
This commit causes uv_get_process_title() to:
 - return EINVAL if the buffer is null or size is 0
 - return ENOBUFS if the title is too big for the buffer
 - null terminate the buffer on success

Fixes: https://github.com/libuv/libuv/issues/315
PR-URL: https://github.com/libuv/libuv/pull/928
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-07-14 09:47:23 -04:00
neevek
1d27bbbb8d doc: add a note on safe reuse of uv_write_t
uv_write_t can be reused safely only after the callback passed to
uv_write is fired.

PR-URL: https://github.com/libuv/libuv/pull/927
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-06-28 10:15:13 -04:00
Saúl Ibarra Corretgé
cdccd4f990 doc: clarify callbacks won't be called in error case
PR-URL: https://github.com/libuv/libuv/pull/918
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-06-22 01:23:12 +02:00
Pierre-Marie de Rodat
23043a7e95 doc: fix stream typos
PR-URL: https://github.com/libuv/libuv/pull/910
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-06-13 09:38:09 -04:00
Imran Iqbal
71bd07e588 doc: update docs with AIX related information
Fixes: https://github.com/libuv/libuv/issues/882
PR-URL: https://github.com/libuv/libuv/pull/896
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-06-02 10:21:15 -04:00
Jason Ginchereau
399e2c8140 win: support sub-second precision in uv_fs_futimes()
Fixes: https://github.com/libuv/libuv/issues/800
PR-URL: https://github.com/libuv/libuv/pull/849
Reviewed-by: Bert Belder <bertbelder@gmail.com>
2016-05-29 11:58:46 +02:00
Saúl Ibarra Corretgé
bd0e8e82de doc: fix generation the first time livehtml runs
PR-URL: https://github.com/libuv/libuv/pull/886
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-05-26 09:48:28 +02:00
Imran Iqbal
337e9fd0f5 test: fix POLLHDRUP related failures for AIX
`POLLHDRUP` is not implemented on AIX. Therefore `UV_DISCONNECT` will
never be set on `events`. This causes the socket to never be closed and
the tests to be stuck inside `pollset_poll` indefinitely, resulting in a
timeout.

This fixes the following tests:
- poll_duplex
- poll_unidirectional

Updated docs to let end users know that `UV_DISCONNECT` can be set, but
is unsupported on AIX.

Fixes: https://github.com/libuv/libuv/issues/844
PR-URL: https://github.com/libuv/libuv/pull/857
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-05-05 23:23:28 +02:00
Saúl Ibarra Corretgé
341097403d doc: add ability to live reload and regenerate HTML
PR-URL: https://github.com/libuv/libuv/pull/819
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-04-11 12:52:59 -03:00
Enno Boland
387102b247 unix: open ttyname instead of /dev/tty
Find the real name of the tty using ttyname_r(3) instead of
opening "/dev/tty" which causes trouble if the fd doesn't point to the
controlling terminal.

PR-URL: https://github.com/libuv/libuv/pull/779
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-04-01 11:13:22 +02:00
cjihrig
217f81b6a1 unix,win: add uv_get_passwd()
This commit adds the uv_get_passwd() function, which returns a
subset of the current effective user's password file entry.

Refs: https://github.com/libuv/libuv/issues/11
Fixes: https://github.com/libuv/libuv/issues/731
PR-URL: https://github.com/libuv/libuv/pull/742
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-03-29 08:13:59 -04:00
Ben Noordhuis
df96163702 doc: clarify uv_loop_close()
Make explicit that handles and requests should be closed before calling
uv_loop_close().

Fixes: https://github.com/libuv/libuv/issues/765
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-03-20 10:15:20 +01:00
Santiago Gimeno
c7c8e916b8 poll: add UV_DISCONNECT event
It allows detecting the remote socket closing the connection. It's
emitted when `EPOLLRDHUP`(Linux), `EV_EOF`(BSD), `POLLRDHUP`(Solaris,
AIX) and `AFD_POLL_DISCONNECT`(Windows) events are received.

PR-URL: https://github.com/libuv/libuv/pull/691
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-03-15 23:39:49 +01:00
Saúl Ibarra Corretgé
2606ba22a7 unix, win: count null byte on UV_ENOBUFS
If an API function returns UV_ENOBUFS make sure we count the terminating
null, which we need space for. In case of success the null byte is not
included in the count, but the buffer *is* null terminated.

PR-URL: https://github.com/libuv/libuv/pull/690
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-03-03 09:23:10 +01:00
Nándor István Krácser
729d68596c doc: add missing write callback to example
PR-URL: https://github.com/libuv/libuv/pull/734
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-02-25 08:56:54 +01:00
cjihrig
c0fa2e7518 unix,win: add uv_os_tmpdir()
PR-URL: https://github.com/libuv/libuv/pull/672
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-01-21 09:11:56 +01:00
Yuval Brik
e76b8838e5 fs: add uv_fs_realpath()
Equivalent to realpath(3), returns the full resolved absolute path of a
file or directory.

PR-URL: https://github.com/libuv/libuv/pull/531
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-12-05 11:32:58 +01:00
Petka Antonov
6490c508a9 misc: expose handle print APIs
PR-URL: https://github.com/libuv/libuv/pull/291
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-11-16 09:34:34 +01:00
Andrius Bentkus
e9b5a86aa6 docs: clarify documentation of uv_tcp_init_ex
I think this makes it clear that the flags can't contain any other
information.

PR-URL: https://github.com/libuv/libuv/pull/592
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-10-29 01:27:04 +01:00
Eli Skeggs
36b79057c5 doc: clarify repeat timer behavior
Signed-off-by: Eli Skeggs <skeggse@gmail.com>

Fixes: https://github.com/libuv/libuv/issues/181
PR-URL: https://github.com/libuv/libuv/pull/520
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-09-11 09:35:05 +02:00
Devchandra Meetei L
eddff0a675 doc: fix typo
PR-URL: https://github.com/libuv/libuv/pull/509
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-09-04 09:41:35 +02:00
Brian White
866dc3f98b doc: add uv_dlsym() return type
PR-URL: https://github.com/libuv/libuv/pull/503
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-09-02 09:58:55 +02:00
Ben Trask
9ef523e281 doc: uv_read_start and uv_read_cb clarifications
PR-URL: https://github.com/libuv/libuv/pull/500
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-08-31 10:04:07 +02:00
Ben Noordhuis
96fc77d5d9 unix,windows: don't assert on unknown error code
Make uv_err_name() and uv_strerror() return a dynamically allocated
string when the error code is not recognized.

It leaks a few bytes of memory but that can't be helped.  Asserting
and aborting is, in my opinion, much less helpful.

Fixes: https://github.com/nodejs/node/issues/63
PR-URL: https://github.com/libuv/libuv/pull/467
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-08-18 16:10:37 +02:00
Corbin Simpson
fc556acbb4 doc: clarify uv_read_stop() is idempotent
PR-URL: https://github.com/libuv/libuv/pull/478
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-08-10 09:20:51 +02:00
Saúl Ibarra Corretgé
b3fde348e4 doc: add a note about uv_dirent_t.type
On Linux getting the type is only supported by some filesystems, check
getdents(2).
2015-07-17 09:26:08 +02:00
Yosuke Furukawa
e110c46b81 doc: add missing variable name
PR-URL: https://github.com/libuv/libuv/pull/432
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-07-10 09:22:00 +02:00
Saúl Ibarra Corretgé
188e0e94ac win: add support for recursive file watching
Original patch by @ghostoy, modified by @bpasero and yours truly.

Refs: https://github.com/joyent/libuv/pull/1473
Refs: https://github.com/libuv/libuv/pull/198
PR-URL: https://github.com/libuv/libuv/pull/421
Reviewed-By: Bert Belder <bertbelder@gmail.com>
2015-07-08 23:40:47 +02:00
Saúl Ibarra Corretgé
c48950ed04 doc: add note about uv_fs_scandir
The '.' and '..' entries are always skipped on Unix systems.

Refs: https://github.com/libuv/libuv/issues/426
PR-URL: https://github.com/libuv/libuv/pull/427
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-07-08 22:39:46 +02:00
Saúl Ibarra Corretgé
ac89bb4d30 docs: add Windows specific note for uv_fs_open 2015-07-07 09:55:52 +02:00
Saúl Ibarra Corretgé
c1fe25f654 doc: add section with version-checking macros and functions 2015-06-29 23:09:14 +02:00
Saúl Ibarra Corretgé
f8f59824c4 unix, win: add ability to create tcp/udp sockets early
Introduce two new APIs:

int uv_tcp_init_ex(uv_loop_t*, uv_tcp_t* handle, int flags)
int uv_udp_init_ex(uv_loop_t*, uv_udp_t* handle, int flags)

The lower 8 bits of the flags field are used for the socket domain.
AF_INET, AF_INET6 and AF_UNSPEC are supported. If AF_UNSPEC is specified
the socket is created lazily, just like uv_{tcp,udp}_init.

Some Windows notes:

getsockname fails with WSAEINVAL if the socket is not bound. This could
potentially be improved by detecting the socket family and filling
the sockaddr_in/6 struct manually.

bind returns WSAEFAULT if we try to bind a socket to the wrong family.
Unix returns EINVAL.

PR-URL: https://github.com/libuv/libuv/pull/400
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-06-19 09:37:19 +02:00
cjihrig
a0c8815294 win: add XP support to uv_os_homedir()
The previous Windows implementation used SHGetKnownFolderPath(),
which is only supported on Vista and up. This commit switches to
GetUserProfileDirectoryW(), which returns the same information,
but is supported back to Windows 2000, and is not deprecated.

PR-URL: https://github.com/libuv/libuv/pull/375
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-06-03 00:26:56 +02:00
Saúl Ibarra Corretgé
bddd6a8489 core: add ability to customize memory allocator
This patch is composed by the work done in
https://github.com/libuv/libuv/pull/231 and
https://github.com/libuv/libuv/pull/287 plus some changes by yours
truly.

Thanks @beevik and @mattsta for their work on this!

PR-URL: https://github.com/libuv/libuv/pull/368
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-06-02 12:05:20 +02:00
cjihrig
a62c2d5928 unix,win: add uv_os_homedir()
PR-URL: https://github.com/libuv/libuv/pull/350
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-05-21 17:31:35 +02:00
Igor Soarez
ccf90a1ea5 doc: fix typo in tcp.rst
PR-URL: https://github.com/libuv/libuv/pull/355
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-05-19 11:27:46 +02:00
Ben Noordhuis
7639dd510e doc: fix uv_run(UV_RUN_DEFAULT) description
Saying uv_run() always returns zero is incorrect in the presence of
calls to uv_stop().

PR-URL: https://github.com/libuv/libuv/pull/337
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-05-01 01:20:39 +02:00
Saúl Ibarra Corretgé
1f711e4d6d Revert "memory: add uv_replace_allocator"
This reverts commit c272f1f1bc.

The concept will come back to libuv, but it needs some more work.
2015-04-29 09:37:02 +02:00
Daryl Haresign
706362083e docs: add some missing words
PR-URL: https://github.com/libuv/libuv/pull/332
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-04-28 22:36:33 +02:00
Corey Farrell
e2e218b760 doc: document uv_buf_t members
PR-URL: https://github.com/libuv/libuv/pull/307
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-04-07 17:13:01 +02:00
Saúl Ibarra Corretgé
db39a6ce71 doc: clarify what uv_*_open accepts
Fixes: https://github.com/libuv/libuv/issues/281
PR-URL: https://github.com/libuv/libuv/pull/284
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-23 10:55:38 +01:00
Ben Noordhuis
fc9e66e555 unix: reject non-tty fds in uv_tty_init()
Reject file descriptors that correspond to regular files or char/block
devices.  Such file descriptors are incompatible with epoll and trigger
a run-time assert.

Fixes: https://github.com/libuv/libuv/issues/255
PR-URL: https://github.com/libuv/libuv/pull/259
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-11 16:45:51 +01:00
Ben Noordhuis
868700952b doc: fix long lines in tty.rst
PR-URL: https://github.com/libuv/libuv/pull/259
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-11 16:45:24 +01:00
Brett Vickers
c272f1f1bc memory: add uv_replace_allocator
With uv_replace_allocator, it's possible to override the default
memory allocator's malloc and free calls with functions of the user's
choosing. This allows libuv to interoperate with projects requiring a
custom memory allocator.

Internally, all calls to malloc and free have been replaced with
uv__malloc and uv__free, respectively. The uv__malloc and uv__free
functions call malloc and free unless they have been overridden by a
previous call to uv_replace_allocator.

As part of this change, the special aligned memory allocations
performed in src/win/fs-event.c have been replaced with standard
allocations. The 4-byte alignment being requested in this file was
unnecessary, since standard allocators already guarantee at least an
8-byte alignment.

PR-URL: https://github.com/libuv/libuv/pull/231
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-05 20:02:16 +01:00
Saúl Ibarra Corretgé
8ef34592a9 doc: document uv_getnameinfo_t.{host|service}
Fixes: https://github.com/libuv/libuv/issues/182
PR-URL: https://github.com/libuv/libuv/pull/233
Reviewed-By: Tim Caswell <tim@creationix.com>
2015-03-02 16:53:57 +01:00
Saúl Ibarra Corretgé
3b0998c935 doc: link system and library calls to man pages
PR-URL: https://github.com/libuv/libuv/pull/236
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-02 14:20:51 +01:00
Saúl Ibarra Corretgé
5ba687f422 doc: add Sphinx plugin for generating links to man pages
PR-URL: https://github.com/libuv/libuv/pull/236
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-02 14:20:02 +01:00
Andrius Bentkus
901824ba77 doc: clarify that the thread pool primites are not thread safe
PR-URL: https://github.com/libuv/libuv/pull/227
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-02-26 11:35:01 +01:00
Saúl Ibarra Corretgé
7a3af176bd doc: adjust next version to 1.4.1 2015-02-24 20:44:02 +01:00
Ben Noordhuis
ff0316813d unix,windows: make uv_thread_create() return errno
Before this commit, UNIX returned -1 on failure.  Windows sometimes
returned a UV_E* error code and sometimes a bogus status code, courtesy
of errno values not mapping to UV_E* error codes on that platform.

PR-URL: https://github.com/libuv/libuv/pull/204
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-02-17 22:25:01 +01:00
Ben Noordhuis
b36d4ff930 unix: implement uv_stream_set_blocking()
Commit 393c1c5 ("unix: set non-block mode in uv_{pipe,tcp,udp}_open")
causes a regression in the io.js cluster module.

The io.js documentation states that `worker.send()` and `process.send()`
are synchronous but they no longer were after upgrading to libuv v1.2.1.

The reason they are synchronous is because of backpressure - or rather,
lack of backpressure: a slow consumer eventually causes a fast producer
to run out of memory because the backlog of pending messages in the
producer can grow unchecked.

Ergo, implement uv_stream_set_blocking() on UNIX platforms to let io.js
enable the old blocking behavior for pipes again.

Refs: https://github.com/iojs/io.js/issues/760
PR-URL: https://github.com/libuv/libuv/pull/187
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-02-09 13:28:52 +01:00
Andrius Bentkus
39a0936fec win, unix: add pipe_peername implementation
PR-URL: https://github.com/libuv/libuv/pull/166
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-01-28 21:40:32 +01:00
Andrius Bentkus
2bfa2e5e22 style: rename buf to buffer and len to size for consistency
PR-URL: https://github.com/libuv/libuv/pull/159
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-01-27 11:31:16 +01:00
Andrius Bentkus
1e59ab1d49 fs, pipe: no trailing terminator in exact sized buffers
uv_fs_poll_getpath, uv_pipe_getsockname, uv_fs_event_getpath used
to return the trailing null terminator, even though the functions
returned the size.

Fixes: https://github.com/libuv/libuv/issues/155
PR-URL: https://github.com/libuv/libuv/pull/159
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-01-27 11:31:16 +01:00
Saúl Ibarra Corretgé
f2bb8d394c unix, win: add synchronous uv_get{addr,name}info
PR-URL: https://github.com/libuv/libuv/pull/156
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
2015-01-23 01:12:05 +01:00
Saúl Ibarra Corretgé
737cd1fb4f doc: clarify uv_default_loop
Indicate that it can (and should) also be closed, currently it's not
"special" in any way.

PR-URL: https://github.com/libuv/libuv/pull/147
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-21 09:12:25 +01:00
Alex Mo
ea5f1f98e0 doc: explain how the threadpool is allocated
Add an explanation about how libuv implements the threadpool and why.
This is so users know what behavior they should expect when they make
use of threads.

Related issue: https://github.com/libuv/libuv/issues/145

PR-URL: https://github.com/libuv/libuv/pull/146
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-21 01:16:04 +01:00
Saúl Ibarra Corretgé
7a19a48df8 doc: clarify which flags are supported in uv_fs_event_start
PR-URL: https://github.com/libuv/libuv/pull/135
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-17 09:16:32 +01:00
Saúl Ibarra Corretgé
b30a3e677b unix, windows: set non-block mode in uv_poll_init
libuv requires that the socket/fd is in non-blocking mode, so do it
internally so the user doesn't need to write platform specific code to
do so.

This also makes the API consistent with uv_{tcp,udp,pipe}_open, since
it's not required to pass the fd in non-blocking mode there either.

PR-URL: https://github.com/libuv/libuv/pull/136
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-16 10:41:00 +01:00
Ben Noordhuis
393c1c59a2 unix: set non-block mode in uv_{pipe,tcp,udp}_open
The contract specifies that the file descriptor should already be in
non-blocking mode before passing it to libuv.

However, node users don't really have an opportunity to do so, never
mind the fact that the call to uv_pipe_open() or uv_tcp_open() is an
implementation detail that most users won't be aware of.

Let's be nice and set the non-blocking flag explicitly.  It's a cheap
operation anyway.

Fixes: https://github.com/libuv/libuv/issues/124

PR: https://github.com/libuv/libuv/pull/134
Reviewed-by: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-01-14 19:46:54 +01:00
Saúl Ibarra Corretgé
c9c00cdc0d doc: clarify how uv_async_send behaves
Closes #29

PR-URL: https://github.com/libuv/libuv/pull/122
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-07 14:01:16 +01:00
Saúl Ibarra Corretgé
85d6624768 doc: clarify the behavior of uv_tty_init
Closes #120

PR-URL: https://github.com/libuv/libuv/pull/121
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-07 13:58:55 +01:00
Saúl Ibarra Corretgé
36f90342a3 doc: updated version reference for TTY mode changes 2015-01-05 20:21:57 +01:00
Saúl Ibarra Corretgé
c71e7b753c doc: indicate the version where uv_tty_set_mode was changed
PR-URL: https://github.com/libuv/libuv/pull/89
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-27 19:04:59 +01:00
Yuri D'Elia
025602da13 tty: implement binary I/O terminal mode
Introduce a uv_tty_mode_t enum for uv_tty_set_mode(), with backward
compatible values.  Add a new mode UV_TTY_MODE_IO, which uses
cfmakeraw() internally.

PR-URL: https://github.com/libuv/libuv/pull/86
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2014-12-27 18:18:24 +01:00
Saúl Ibarra Corretgé
d4d1f32858 unix: change uv_cwd not to return a trailing slash
This aligns the behavior with the Windows implementation.

PR-URL: https://github.com/libuv/libuv/pull/63
Reviewed-By: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-16 08:12:07 +01:00
Saúl Ibarra Corretgé
460907279e doc: fix sphinx warning 2014-12-11 17:29:24 +01:00
Saúl Ibarra Corretgé
3fef323e7c doc: indicate what version uv_loop_configure was added on
PR-URL: https://github.com/libuv/libuv/pull/60
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-11 17:29:14 +01:00
Ben Noordhuis
d3b1ccd6fb doc: document uv_loop_configure()
Move the comments from commit 9da5fd4 from the v0.10 branch into docs/.
2014-12-05 20:20:52 +01:00
Tim Caswell
dfdcfc0c4d doc: document how to get result of uv_fs_mkdtemp
PR-URL: https://github.com/libuv/libuv/pull/31
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-05 17:20:53 +01:00
Joey Geralnik
45c7ccce21 doc: fix spelling
Fix various typos and spelling mistakes in the documentation

PR-URL: https://github.com/libuv/libuv/pull/17
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-11-29 04:22:56 +01:00
Michael Ira Krufky
06b78e1ead doc: fix typo: Strcutures -> Structures
Signed-off-by: Michael Ira Krufky <m.krufky@samsung.com>
2014-11-26 08:42:08 +01:00
Ben Noordhuis
7ce1113885 doc,build,include: update project links
The project home has moved from https://github.com/joyent/libuv to
https://github.com/libuv/libuv.  Update the links inside the repo.
2014-11-25 15:39:12 +01:00
Elijah Andrews
156069130f readme: remove Rust from users
Closes #1572
2014-11-20 19:40:35 +01:00
Manos Nikolaidis
0fc24f6f74 doc: fix link in misc.rst 2014-11-18 08:24:48 +01:00
Alexis Campailla
6591d000d1 win: fix uv_thread_self()
59658a8de7 changed uv_thread_self()
to return uv_thread_t, but uv_thread_t is a thread's HANDLE while
uv_thread_self() returns the current thread's id.
This means that uv_thread_equal() is also broken, as we are
potentially comparing HANDLES to ids.

Changed uv_thread_self() to return the current thread's creation handle.
Fixed small doc issue.
2014-11-10 20:03:01 -03:00
Saúl Ibarra Corretgé
e03c0c7383 doc: fix parameter name in uv_fs_access
Closes #1560
2014-11-06 21:14:57 -05:00
Tomasz Kołodziejski
59658a8de7 unix, windows: add uv_thread_equal 2014-10-20 09:51:49 +02:00
cjihrig
c18205a1c5 unix, windows: add uv_fs_access() 2014-10-13 10:23:53 +02:00
Saúl Ibarra Corretgé
e4dc4aaac5 doc: add documentation for missing functions and structures
* uv_process_kill, uv_kill
* uv_fs_poll_init
* uv_timespec_t
2014-10-01 09:23:09 +02:00
Saúl Ibarra Corretgé
00df3ec75b doc: clarify uv_loop_t.data field lifetime
Fixes #1503
2014-09-30 09:14:56 +02:00
Saúl Ibarra Corretgé
9486e462fc doc: document missing stream related structures
uv_connect_t, uv_write_t and uv_shutdown_t.

Closes #1507
2014-09-30 09:09:59 +02:00
Saúl Ibarra Corretgé
958009bb04 doc: add migration guide from version 0.10 2014-09-26 10:05:23 +02:00
Saúl Ibarra Corretgé
5e822033b4 doc: document uv_alloc_cb
Fixes #1498
2014-09-25 21:38:03 +02:00
Saúl Ibarra Corretgé
03e53f1cf7 fs: rename uv_fs_readdir to uv_fs_scandir
Closes #1431
2014-09-25 10:09:58 +02:00
Saúl Ibarra Corretgé
f70b3fae8b version: add ability to specify a version suffix 2014-09-11 20:58:41 +02:00
Saúl Ibarra Corretgé
32e2e75f60 doc: add API documentation 2014-09-11 09:38:35 +02:00