Home
last modified time | relevance | path

Searched refs:a (Results 1 – 25 of 77) sorted by relevance

1234

/libuv/test/
H A Dtask.h72 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) argument
195 #define ASSERT_EQ(a, b) ASSERT_BASE(a, ==, b, int64_t, PRId64) argument
197 #define ASSERT_GT(a, b) ASSERT_BASE(a, >, b, int64_t, PRId64) argument
199 #define ASSERT_LT(a, b) ASSERT_BASE(a, <, b, int64_t, PRId64) argument
201 #define ASSERT_OK(a) ASSERT_BASE(a, ==, 0, int64_t, PRId64) argument
218 ASSERT_BASE_STR(strcmp(a, b) == 0, a, == , b, char*, "s")
221 ASSERT_BASE_STR(strcmp(a, b) != 0, a, !=, b, char*, "s")
224 ASSERT_BASE_LEN(memcmp(a, b, size) == 0, a, ==, b, s, size)
227 ASSERT_BASE_LEN(memcmp(a, b, size) != 0, a, !=, b, s, size)
230 ASSERT_BASE_HEX(memcmp(a, b, size) == 0, a, ==, b, size)
[all …]
H A Dtest-test-macros.c31 char* a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; in TEST_IMPL() local
37 ASSERT_STR_NE(a, b); in TEST_IMPL()
38 ASSERT_STR_EQ(a, c); in TEST_IMPL()
H A Dtest-hrtime.c35 uint64_t a, b, diff; in TEST_IMPL() local
38 a = uv_hrtime(); in TEST_IMPL()
42 diff = b - a; in TEST_IMPL()
/libuv/src/
H A Didna.c79 if (a > 0xF7) in uv__utf8_decode1_slow()
84 if (a > 0xEF) { in uv__utf8_decode1_slow()
86 a = a & 7; in uv__utf8_decode1_slow()
99 a = 0; in uv__utf8_decode1_slow()
109 a = 0; in uv__utf8_decode1_slow()
123 a = (a << 18) | (b << 12) | (c << 6) | d; in uv__utf8_decode1_slow()
125 if (a < min) in uv__utf8_decode1_slow()
131 if (a >= 0xD800 && a <= 0xDFFF) in uv__utf8_decode1_slow()
134 return a; in uv__utf8_decode1_slow()
139 unsigned a; in uv__utf8_decode1() local
[all …]
H A Dfs-poll.c259 return a->st_ctim.tv_nsec == b->st_ctim.tv_nsec in statbuf_eq()
262 && a->st_ctim.tv_sec == b->st_ctim.tv_sec in statbuf_eq()
263 && a->st_mtim.tv_sec == b->st_mtim.tv_sec in statbuf_eq()
265 && a->st_size == b->st_size in statbuf_eq()
266 && a->st_mode == b->st_mode in statbuf_eq()
267 && a->st_uid == b->st_uid in statbuf_eq()
268 && a->st_gid == b->st_gid in statbuf_eq()
269 && a->st_ino == b->st_ino in statbuf_eq()
270 && a->st_dev == b->st_dev in statbuf_eq()
271 && a->st_flags == b->st_flags in statbuf_eq()
[all …]
/libuv/docs/src/
H A Dmigration_010_100.rst7 Some APIs changed quite a bit throughout the 1.0.0 development process. Here
8 is a migration guide for the most significant changes that happened after 0.10
48 to fetch the error code, which was a positive number.
51 a negative number in case of error.
57 ... assume 'server' is a TCP server which is already listening
68 ... assume 'server' is a TCP server which is already listening
98 In libuv 1.0 a pointer to a buffer is passed to the callback, which the user
116 ``struct sockaddr_in6``. Now functions take a ``struct sockaddr*`` (note it's a pointer).
147 The streams and UDP data receive callbacks now get a pointer to a :c:type:`uv_buf_t` buffer,
148 not a structure by value.
[all …]
H A Ddesign.rst12 The library provides much more than a simple abstraction over different I/O polling mechanisms:
13 'handles' and 'streams' provide a high level abstraction for sockets and other entities;
37 don't need a handle they run directly on the loop.
56 stages of a loop iteration:
66 for a time before the loop's concept of *now* get their callbacks called.
69 when is a loop considered to be *alive*? If a loop has active and ref'd handles, active
95 for a read or write operation get their callbacks called at this point.
115 libuv uses a thread pool to make asynchronous file I/O operations possible, but
116 network I/O is **always** performed in a single thread, each loop's thread.
127 so the current approach is to run blocking file I/O operations in a thread pool.
[all …]
H A Dstream.rst7 Stream handles provide an abstraction of a duplex communication channel.
30 this type. When a stream is in non-blocking mode, write requests sent
37 Callback called when data was read on a stream.
41 the `buf` parameter might not point to a valid buffer; in that case
169 uv_buf_t a[] = {
183 uv_write(&req1, stream, a, 2, cb);
196 `send_handle` must be a TCP, pipe and UDP handle on Unix, or a TCP
197 handle on Windows, which is a server or a connection (listening or
214 handles over a pipe like c:func:`uv_write2`.
216 Try to send a handle is not supported on Windows,
[all …]
H A Dversion.rst9 a major release. In this section you'll find all macros and functions that
33 Set to 1 to indicate a release version of libuv, 0 for a development
39 might have a suffix such as "rc".
43 Returns the libuv version packed into a single integer. 8 bits are used for
59 Returns the libuv version number as a string. For non-release versions the
H A Dsignal.rst7 Signal handles implement Unix style signal handling on a per-event loop bases.
24 resized. When a libuv app is running under a console emulator, or when a
26 such cases SIGWINCH signals may not always be delivered in a timely manner.
27 For a writable :c:type:`uv_tty_t` handle libuv will only detect size changes
28 when the cursor is moved. When a readable :c:type:`uv_tty_t` handle is used,
36 * Calls to raise() or abort() to programmatically raise a signal are
37 not detected by libuv; these will not trigger a signal watcher.
H A Ddll.rst30 Opens a shared library. The filename is in utf-8. Returns 0 on success and
39 Retrieves a data pointer from a dynamic library. It is legal for a symbol
H A Dfs_event.rst7 FS Event handles allow the user to monitor a given path for changes, for example,
8 if the file was renamed or there was a generic change in it. This handle uses
17 - Events for file modification (writing to a file) are not received if only the
23 creation/deletion within a directory that is being monitored.
44 If the handle was started with a directory the `filename` parameter will
45 be a relative path to a file contained in the directory, or `NULL` if the
70 * By default, if the fs event watcher is given a directory name, we will
78 * By default uv_fs_event will try to use a kernel interface such as inotify
80 * as NFS mounts. This flag makes fs_event fall back to calling stat() on a
H A Dtcp.rst9 :c:type:`uv_tcp_t` is a 'subclass' of :c:type:`uv_stream_t`.
68 Open an existing file descriptor or SOCKET as a TCP handle.
74 it's required that it represents a valid stream socket.
87 at the end of this procedure, then the handle is destroyed with a
99 This setting is used to tune a TCP server for the desired performance.
138 a valid and big enough chunk of memory, ``struct sockaddr_storage`` is
144 a valid and big enough chunk of memory, ``struct sockaddr_storage`` is
157 The callback is made when the connection has been established or when a
167 Resets a TCP connection by sending a RST packet. This is accomplished by
177 Create a pair of connected sockets with the specified properties.
[all …]
/libuv/docs/src/guide/
H A Dthreads.rst4 Wait a minute? Why are we on threads? Aren't event loops supposed to be **the
102 locked a mutex attempts to lock it again. For example, a construct like::
123 held by a reader. A reader or writer may not acquire a lock when a writer is
136 readers get a chance again.
152 threads can attempt to call ``uv_once()`` with a given guard and a function
192 a task in a separate thread, and have a callback that is triggered when the
205 a convenient abstraction for this.
239 is to use a baton to exchange data.
252 up a signal handler for termination.
298 to the main thread. This is a simple example of having a download manager
[all …]
H A Dintroduction.rst4 This 'book' is a small set of tutorials about using libuv_ as
5 a high performance evented I/O library which offers the same API on Windows and Unix.
7 It is meant to cover the main areas of libuv, but is not a comprehensive
13 This book is still a work in progress, so sections may be incomplete, but
21 1) a systems programmer, creating low-level programs such as daemons or network
25 2) a node.js module writer, who wants to wrap platform APIs
26 written in C or C++ with a set of (a)synchronous APIs that are exposed to
36 The node.js_ project began in 2009 as a JavaScript environment decoupled
38 combined a model of I/O -- evented -- with a language that was well suited to
46 Since then libuv has continued to mature and become a high quality standalone
[all …]
H A Dbasics.rst22 if there is a callback associated with e:
35 rather than a lot of number-crunching. The problem with using conventional
37 **blocking**. The actual write to a hard disk or reading from a network, takes
44 started in a separate thread (or in a thread pool). When the blocking function
50 subsystems. For example, a normal ``read`` call on a socket would block until
67 polling to perform tasks in a non-blocking manner.
71 either libuv or libev, it is a quick, useful watch.
86 nothing, except start a loop which will exit immediately.
194 a ``uv_udp_t``, while individual writes to the socket use a ``uv_udp_send_t``
197 Handles are setup by a corresponding::
[all …]
H A Dutilities.rst12 Timers invoke the callback after a certain time has elapsed since the timer was
16 Simple use is to init a watcher and start it with a ``timeout``, and optional ``repeat``.
40 a timer callback, it means:
73 These functions can be used to allow a loop to exit even when a watcher is
104 you could dispatch a summary of the daily application performance to the
107 a GUI application. Say you are using an event loop for a file download. If the
138 to the worker thread. The solution is to use a ``struct`` and set
238 So we add each argument as a URL
371 Text terminals have supported basic formatting for a long time, with a `pretty
399 ``grep``. To check if the file descriptor is indeed a TTY, call
[all …]
H A Dprocesses.rst9 such a case, a process often uses multiple child processes to achieve tasks
19 running an event loop, and each process getting assigned to a separate CPU
37 ``options`` is implicitly initialized with zeros since it is a global
38 variable. If you change ``options`` to a local variable, remember to
141 a handle and associate it with a loop. To listen for particular signals on
254 is great. Just be warned that creating processes is a costly task.
276 `UV_CREATE_PIPE` flag, it opts for creating a `socketpair(2)`_.
291 Since domain sockets [#]_ can have a well known name and a location in the
317 A client which wants to connect to a domain socket will use::
322 point to a valid file (e.g. ``/tmp/echo.sock``). On Windows, ``name`` follows a
[all …]
H A Dfilesystem.rst12 internally, but invoke these functions in a `thread pool`_ and notify
53 a callback for when the file is opened:
55 .. rubric:: uvcat/main.c - opening a file
76 ``UV_EOF`` constant would have been passed as a status instead.
78 Here you see a common pattern when writing asynchronous programs. The
100 a write that 'succeeds' may not be committed to disk yet.
189 a collection of a pointer to bytes (``uv_buf_t.base``) and the length
202 free a buffer until it has been written.
260 get around this we wrap a write request and a buffer in ``write_req_t`` and
270 receiving a SIGPIPE`_. It is a good idea to insert::
[all …]
H A Deventloops.rst6 event loop into another event loop based library -- imagine a Qt based UI, and
7 Qt's event loop driving a libuv backend which does intensive system level
16 processed, so ``uv_stop()`` can't be used as a kill switch. When ``uv_stop()``
18 these things can be a bit difficult to understand, so let's look at
38 ``uv_stop()`` is useful to shutdown a loop when a result has been computed or
42 Here is a simple example that stops the loop and demonstrates how the current
H A Dnetworking.rst21 TCP is a connection oriented, stream protocol and is therefore based on the
31 3. Call ``uv_listen`` on the handle to have a callback invoked whenever a new
32 connection is established by a client.
37 Here is a simple echo server
78 a matter of calling ``uv_tcp_connect``. The same ``uv_connect_cb`` style
99 communication. Hence libuv doesn't offer a stream. Instead libuv provides
104 address from a `DHCP`_ server -- DHCP Discover.
123 randomly assigns a port.
129 Then we setup a similar send socket and use ``uv_udp_send`` to send
130 a *broadcast message* on port 67 (DHCP server).
[all …]
/libuv/
H A DLICENSE-docs7 Creative Commons public licenses does not create a lawyer-client or
79 synched in timed relation with a moving image.
120 public may access the material from a place and at a time
135 a. License grant.
153 6(a).
187 provided in Section 3(a)(1)(A)(i).
215 a. Attribution.
229 ii. a copyright notice;
267 a. for the avoidance of doubt, Section 2(a)(1) grants You the right
321 Section 6(a), it reinstates:
[all …]
H A DSECURITY.md11 ## Reporting a Vulnerability
13a security vulnerability in `libuv`, please use the [GitHub's private vulnerability reporting feat…
15 This will allow us to assess the risk, and make a fix available before we add a bug report to the G…
H A DSUPPORTED_PLATFORMS.md25 without being a top priority.
30 ## Adding support for a new platform
32 **IMPORTANT**: Before attempting to add support for a new platform please open
41 If the new platform requires extra fields for any handle structure, create a
46 file inside ``src/unix/`` unless it's already done in a common file, in which
55 Windows is treated as a single platform, so adding support for a new platform
56 would mean adding support for a new version.
58 Compilation and runtime must succeed for the minimum supported version. If a
/libuv/m4/
H A Dax_pthread.m433 # has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to
40 # ACTION-IF-FOUND is a list of shell commands to run if a threads library
121 # We must check for the threads library under a number of different
126 # Create a list of thread flags to try. Items starting with a "-" are
194 # that too in a future libc.) So we'll check first for the
235 [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
248 # option in a rather... idiosyncratic way
281 # linking. Such a scenario is extremely rare in practice.
284 # a warning, this can be a nuisance for well-run software projects
374 static void routine(void *a) { a = 0; }
[all …]

Completed in 66 milliseconds

1234