Skip to content

Commit 633629e

Browse files
committed
Merge tag 'v1.46.0' into merge_1.46.0
2 parents 71ffdec + f0bb7e4 commit 633629e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1531
-795
lines changed

.readthedocs.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ sphinx:
66
fail_on_warning: false
77

88
build:
9+
os: "ubuntu-22.04"
910
tools:
1011
python: "3.9"
1112

AUTHORS

+6
Original file line numberDiff line numberDiff line change
@@ -542,3 +542,9 @@ Lewis Russell <[email protected]>
542542
sivadeilra <[email protected]>
543543
cui fliter <[email protected]>
544544
Mohammed Keyvanzadeh <[email protected]>
545+
Niklas Mischkulnig <[email protected]>
546+
Stefan Karpinski <[email protected]>
547+
liuxiang88 <[email protected]>
548+
Jeffrey H. Johnson <[email protected]>
549+
Abdirahim Musse <[email protected]>
550+

ChangeLog

+60-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,63 @@
1-
2023.05.19, Version 1.45.0 (Stable)
1+
2023.06.30, Version 1.46.0 (Stable)
2+
3+
Changes since version 1.45.0:
4+
5+
* Add SHA to ChangeLog (Santiago Gimeno)
6+
7+
* misc: update readthedocs config (Jameson Nash)
8+
9+
* test: remove erroneous RETURN_SKIP (Ben Noordhuis)
10+
11+
* android: disable io_uring support (Ben Noordhuis)
12+
13+
* linux: add some more iouring backed fs ops (Santiago Gimeno)
14+
15+
* build: add autoconf option for disable-maintainer-mode (Jameson Nash)
16+
17+
* fs: use WTF-8 on Windows (Stefan Karpinski)
18+
19+
* unix,win: replace QUEUE with struct uv__queue (Ben Noordhuis)
20+
21+
* linux: fs_read to use io_uring if iovcnt > IOV_MAX (Santiago Gimeno)
22+
23+
* ios: fix uv_getrusage() ru_maxrss calculation (Ben Noordhuis)
24+
25+
* include: update outdated code comment (Ben Noordhuis)
26+
27+
* linux: support abstract unix sockets (Ben Noordhuis)
28+
29+
* unix,win: add UV_PIPE_NO_TRUNCATE flag (Ben Noordhuis)
30+
31+
* unix: add loongarch support (liuxiang88)
32+
33+
* doc: add DPS8M to LINKS.md (Jeffrey H. Johnson)
34+
35+
* include: add EUNATCH errno mapping (Abdirahim Musse)
36+
37+
* src: don't run timers if loop is stopped/unref'd (Trevor Norris)
38+
39+
* win: fix -Wpointer-to-int-cast warning (Ben Noordhuis)
40+
41+
* test,win: fix -Wunused-variable warning (Ben Noordhuis)
42+
43+
* test,win: fix -Wformat warning (Ben Noordhuis)
44+
45+
* linux: work around io_uring IORING_OP_CLOSE bug (Ben Noordhuis)
46+
47+
* win: remove unused functions (Ben Noordhuis)
48+
49+
* bench: add bench to check uv_loop_alive (Trevor Norris)
50+
51+
* test: add uv_cancel test for threadpool (Trevor Norris)
52+
53+
* unix: skip prohibited syscalls on tvOS and watchOS (小明)
54+
55+
* unix,fs: make no_pwritev access thread-safe (Santiago Gimeno)
56+
57+
* unix: fix build for lower versions of Android (小明)
58+
59+
60+
2023.05.19, Version 1.45.0 (Stable), 96e05543f53b19d9642b4b0dd73b86ad3cea313e
261

362
Changes since version 1.44.2:
463

LINKS.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
* [clearskies_core](https://github.com/larroy/clearskies_core): Clearskies file synchronization program. (C++11)
77
* [CMake](https://cmake.org) open-source, cross-platform family of tools designed to build, test and package software
88
* [Cocos-Engine](https://github.com/cocos/cocos-engine): The runtime framework for Cocos Creator editor.
9-
* [Coherence](https://github.com/liesware/coherence/): Cryptographic server for modern web apps.
9+
* [Coherence](https://github.com/liesware/coherence/): Cryptographic server for modern web apps.
10+
* [DPS8M](https://dps8m.gitlab.io): GE ∕ Honeywell ∕ Bull DPS‑8/M and 6180/L68 mainframe simulator.
1011
* [DPS-For-IoT](https://github.com/intel/dps-for-iot/wiki): Fully distributed publish/subscribe protocol.
1112
* [HashLink](https://github.com/HaxeFoundation/hashlink): Haxe run-time with libuv support included.
1213
* [Haywire](https://github.com/kellabyte/Haywire): Asynchronous HTTP server.

configure.ac

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ m4_include([m4/libuv-extra-automake-flags.m4])
1919
m4_include([m4/as_case.m4])
2020
m4_include([m4/libuv-check-flags.m4])
2121
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects] UV_EXTRA_AUTOMAKE_FLAGS)
22+
AM_MAINTAINER_MODE([enable]) # pass --disable-maintainer-mode if autotools may be unavailable
2223
AC_CANONICAL_HOST
2324
AC_ENABLE_SHARED
2425
AC_ENABLE_STATIC

docs/src/errors.rst

+3
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,9 @@ Error constants
339339
340340
socket type not supported
341341

342+
.. c:macro:: UV_EUNATCH
343+
344+
protocol driver not attached
342345

343346
API
344347
---

docs/src/pipe.rst

+41-1
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,62 @@ API
5555
5656
Bind the pipe to a file path (Unix) or a name (Windows).
5757
58+
Does not support Linux abstract namespace sockets,
59+
unlike :c:func:`uv_pipe_bind2`.
60+
61+
Alias for ``uv_pipe_bind2(handle, name, strlen(name), 0)``.
62+
5863
.. note::
5964
If a path on Unix exceeds ``sizeof(sockaddr_un.sun_path)`` bytes, typically between
6065
92 and 108 bytes, ``uv_pipe_bind`` will fail with ``UV_ENAMETOOLONG``.
6166
6267
.. versionchanged:: 2.0.0 long filenames will lead to an error rather than being truncated
6368
69+
.. c:function:: int uv_pipe_bind2(uv_pipe_t* handle, const char* name, size_t namelen, unsigned int flags)
70+
71+
Bind the pipe to a file path (Unix) or a name (Windows).
72+
73+
``flags`` must be zero or ``UV_PIPE_NO_TRUNCATE``. Returns ``UV_EINVAL``
74+
for unsupported flags without performing the bind operation.
75+
76+
Supports Linux abstract namespace sockets. ``namelen`` must include
77+
the leading nul byte but not the trailing nul byte.
78+
79+
.. versionadded:: 1.46.0
80+
81+
.. note::
82+
``UV_PIPE_NO_TRUNCATE`` flag is ignored in v2.0 (already the default behavior).
83+
6484
.. c:function:: void uv_pipe_connect(uv_connect_t* req, uv_pipe_t* handle, const char* name, uv_connect_cb cb)
6585
66-
Connect to the Unix domain socket or the named pipe.
86+
Connect to the Unix domain socket or the Windows named pipe.
87+
88+
Does not support Linux abstract namespace sockets,
89+
unlike :c:func:`uv_pipe_connect2`.
90+
91+
Alias for ``uv_pipe_connect2(req, handle, name, strlen(name), 0, cb)``.
6792
6893
.. note::
6994
If a path on Unix exceeds ``sizeof(sockaddr_un.sun_path)`` bytes, typically between
7095
92 and 108 bytes, ``uv_pipe_bind`` will fail with ``UV_ENAMETOOLONG``.
7196
7297
.. versionchanged:: 2.0.0 long filenames will lead to an error rather than being truncated
7398
99+
.. c:function:: void uv_pipe_connect2(uv_connect_t* req, uv_pipe_t* handle, const char* name, size_t namelen, unsigned int flags, uv_connect_cb cb)
100+
101+
Connect to the Unix domain socket or the Windows named pipe.
102+
103+
``flags`` must be zero or ``UV_PIPE_NO_TRUNCATE``. Returns ``UV_EINVAL``
104+
for unsupported flags without performing the connect operation.
105+
106+
Supports Linux abstract namespace sockets. ``namelen`` must include
107+
the leading nul byte but not the trailing nul byte.
108+
109+
.. versionadded:: 1.46.0
110+
111+
.. note::
112+
``UV_PIPE_NO_TRUNCATE`` flag is ignored in v2.0 (already the default behavior).
113+
74114
.. c:function:: int uv_pipe_getsockname(const uv_pipe_t* handle, char* buffer, size_t* size)
75115
76116
Get the name of the Unix domain socket or the named pipe.

include/uv.h

+25-4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ extern "C" {
5858
#include <stddef.h>
5959
#include <stdint.h>
6060

61+
/* Internal type, do not use. */
62+
struct uv__queue {
63+
struct uv__queue* next;
64+
struct uv__queue* prev;
65+
};
66+
6167
#if defined(_WIN32)
6268
# include "uv/win.h"
6369
# if !defined(BUILDING_UV_SHARED)
@@ -152,6 +158,7 @@ extern "C" {
152158
XX(EILSEQ, "illegal byte sequence") \
153159
XX(ESOCKTNOSUPPORT, "socket type not supported") \
154160
XX(ENODATA, "no data available") \
161+
XX(EUNATCH, "protocol driver not attached") \
155162

156163
#define UV_HANDLE_TYPE_MAP(XX) \
157164
XX(ASYNC, async) \
@@ -285,13 +292,13 @@ UV_EXTERN int uv_loop_init(uv_loop_t* loop);
285292
UV_EXTERN int uv_loop_close(uv_loop_t* loop);
286293
/*
287294
* NOTE:
288-
* This function is DEPRECATED (to be removed after 0.12), users should
295+
* This function is DEPRECATED, users should
289296
* allocate the loop manually and use uv_loop_init instead.
290297
*/
291298
UV_EXTERN uv_loop_t* uv_loop_new(void);
292299
/*
293300
* NOTE:
294-
* This function is DEPRECATED (to be removed after 0.12). Users should use
301+
* This function is DEPRECATED. Users should use
295302
* uv_loop_close and free the memory manually instead.
296303
*/
297304
UV_EXTERN void uv_loop_delete(uv_loop_t*);
@@ -450,7 +457,7 @@ struct uv_shutdown_s {
450457
uv_handle_type type; \
451458
/* private */ \
452459
uv_close_cb close_cb; \
453-
void* handle_queue[2]; \
460+
struct uv__queue handle_queue; \
454461
UV_HANDLE_PRIVATE_FIELDS \
455462

456463
/* The abstract base class of all handles. */
@@ -848,6 +855,10 @@ inline int uv_tty_set_mode(uv_tty_t* handle, int mode) {
848855

849856
UV_EXTERN uv_handle_type uv_guess_handle(uv_os_fd_t file);
850857

858+
enum {
859+
UV_PIPE_NO_TRUNCATE = 1u << 0
860+
};
861+
851862
/*
852863
* uv_pipe_t is a subclass of uv_stream_t.
853864
*
@@ -864,10 +875,20 @@ struct uv_pipe_s {
864875
UV_EXTERN int uv_pipe_init(uv_loop_t*, uv_pipe_t* handle, int ipc);
865876
UV_EXTERN int uv_pipe_open(uv_pipe_t*, uv_os_fd_t file);
866877
UV_EXTERN int uv_pipe_bind(uv_pipe_t* handle, const char* name);
878+
UV_EXTERN int uv_pipe_bind2(uv_pipe_t* handle,
879+
const char* name,
880+
size_t namelen,
881+
unsigned int flags);
867882
UV_EXTERN void uv_pipe_connect(uv_connect_t* req,
868883
uv_pipe_t* handle,
869884
const char* name,
870885
uv_connect_cb cb);
886+
UV_EXTERN int uv_pipe_connect2(uv_connect_t* req,
887+
uv_pipe_t* handle,
888+
const char* name,
889+
size_t namelen,
890+
unsigned int flags,
891+
uv_connect_cb cb);
871892
UV_EXTERN int uv_pipe_getsockname(const uv_pipe_t* handle,
872893
char* buffer,
873894
size_t* size);
@@ -1924,7 +1945,7 @@ struct uv_loop_s {
19241945
void* data;
19251946
/* Loop reference counting. */
19261947
unsigned int active_handles;
1927-
void* handle_queue[2];
1948+
struct uv__queue handle_queue;
19281949
union {
19291950
void* unused;
19301951
unsigned int count;

include/uv/darwin.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@
4040
void* cf_state; \
4141
uv_mutex_t cf_mutex; \
4242
uv_sem_t cf_sem; \
43-
void* cf_signals[2]; \
43+
struct uv__queue cf_signals; \
4444

4545
#define UV_PLATFORM_FS_EVENT_FIELDS \
4646
uv__io_t event_watcher; \
4747
char* realpath; \
4848
int realpath_len; \
4949
int cf_flags; \
5050
uv_async_t* cf_cb; \
51-
void* cf_events[2]; \
52-
void* cf_member[2]; \
51+
struct uv__queue cf_events; \
52+
struct uv__queue cf_member; \
5353
int cf_error; \
5454
uv_mutex_t cf_mutex; \
5555

include/uv/errno.h

+6
Original file line numberDiff line numberDiff line change
@@ -468,4 +468,10 @@
468468
# define UV__ENODATA (-4024)
469469
#endif
470470

471+
#if defined(EUNATCH) && !defined(_WIN32)
472+
# define UV__EUNATCH UV__ERR(EUNATCH)
473+
#else
474+
# define UV__EUNATCH (-4023)
475+
#endif
476+
471477
#endif /* UV_ERRNO_H_ */

include/uv/linux.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
int inotify_fd; \
2929

3030
#define UV_PLATFORM_FS_EVENT_FIELDS \
31-
void* watchers[2]; \
31+
struct uv__queue watchers; \
3232
int wd; \
3333

3434
#endif /* UV_LINUX_H */

include/uv/threadpool.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct uv__work {
3131
void (*work)(struct uv__work *w);
3232
void (*done)(struct uv__work *w, int status);
3333
struct uv_loop_s* loop;
34-
void* wq[2];
34+
struct uv__queue wq;
3535
};
3636

3737
#endif /* UV_THREADPOOL_H_ */

0 commit comments

Comments
 (0)