Implement async i/o and fast operations
cover Implement async i/o and fast operations
These two were previously sent as an RFC. A minor issue was discovered in the previous implementation. One a case insensitive filesystem it had both _Exit.c and _exit.c which caused a conflict and problems. The implementation was updated to avoid this problem.
Yocto Project (wrynose) was used for testing, along with my layer configuration. For a build that had 32447 tasks, I prepopulated an sstate-cache, then removed the rootfs and package related cache objects.
The build difference was 45 seconds, 17:30 down to 16:45. I believe most of the time was rootfs construction. Offline testing showed a measurable improvement when running some 40,000+ operations. (This is on a 64 thread Epyc w/ plenty of ram, so I expect a larger difference on slower hardware.)
I'm running additional performance benchmarks with buildstats, but this is enough to send to give others a chance to comment. I'll reply with the buildstats info once I have it.
Mark Hatle (2):
Send client requests over one shared datagram socket Replace FASTOP with requests that don't wait for a reply
README.security | 4 +- doc/overview | 6 +- doc/program_flow | 11 ++ doc/pseudo_ipc | 73 +++++++++-- enums/msg_type.in | 2 +- enums/op.in | 50 +++---- ports/common/guts/_exit.c | 16 +++ ports/common/guts/execv.c | 4 + ports/common/guts/execve.c | 4 + ports/common/guts/execveat.c | 4 + ports/common/guts/execvp.c | 4 + ports/common/guts/execvpe.c | 4 + ports/common/guts/fexecve.c | 4 + ports/common/pseudo_wrappers.c | 24 ++++ ports/common/wrapfuncs.in | 1 + pseudo.1 | 23 +++- pseudo.c | 2 +- pseudo.h | 1 + pseudo_client.c | 230 ++++++++++++++++++++++++++------- pseudo_client.h | 2 + pseudo_ipc.c | 42 ++++++ pseudo_ipc.h | 8 ++ pseudo_server.c | 186 ++++++++++++++++++++++---- pseudo_util.c | 1 + pseudo_wrappers.c | 43 ++++++ test/test-async-abort.c | 48 +++++++ test/test-async-abort.sh | 40 ++++++ test/test-async-order.c | 188 +++++++++++++++++++++++++++ test/test-async-order.sh | 23 ++++ 29 files changed, 931 insertions(+), 117 deletions(-) create mode 100644 ports/common/guts/_exit.c create mode 100644 test/test-async-abort.c create mode 100755 test/test-async-abort.sh create mode 100644 test/test-async-order.c create mode 100755 test/test-async-order.sh
Signature · 1 line
2.34.1
PATCH 1/2 Send client requests over one shared datagram socket
The server handles each client's stream connection separately, so it has no way to tell the order of requests queued by different clients. That doesn't matter while every client waits for each reply, but it prevents sending requests without waiting: a process could change a file, tell another process, and that process's question could be answered first.
Have clients send all requests, after the initial PING, to a datagram socket shared by all clients, pseudo.request. The kernel queues datagrams in the order they were sent, so the server handles requests in that order even across processes. Replies still go back over each client's stream connection, which also carries PING and SHUTDOWN and tells the server when a client goes away.
Requests carry the client's slot and a per-connection serial number, returned by the PING, so a request still queued from a client that has gone away is applied but never answered on a reused slot. The server reads each request with one recv() instead of FIONREAD plus two reads, and drains the socket before exiting.
AI-Generated: Uses GitHub Copilot
--- README.security | 4 +- doc/overview | 3 +- doc/pseudo_ipc | 36 +++++++++++ pseudo.h | 1 + pseudo_client.c | 158 ++++++++++++++++++++++++++++++++++-------------- pseudo_ipc.c | 42 +++++++++++++ pseudo_ipc.h | 8 +++ pseudo_server.c | 154 +++++++++++++++++++++++++++++++++++++++++++++- 8 files changed, 356 insertions(+), 50 deletions(-)
README.security +2 -2
@@ -147,9 +147,9 @@ ignore mismatch errors in pseudo's log. 6. THE SERVER TRUSTS ITS CLIENTS -The pseudo server listens on a Unix socket in its local state directory +The pseudo server listens on Unix sockets in its local state directory and does not authenticate clients beyond the filesystem permissions of -that socket. Any process running as the build user can connect and +those sockets. Any process running as the build user can connect and change the database, and the database files themselves are writable by that user. The resulting metadata can only be trusted as much as every process running as the build user.
doc/overview +2 -1
@@ -19,7 +19,8 @@ to the virtual environment. Underlying this is access to a server process, which is automatically spawned by the library if one is not available. The server process maintains -a UNIX domain socket while it is active, and maintains a database (using +UNIX domain sockets while it is active (see doc/pseudo_ipc), and maintains a +database (using sqlite) of files known to the system. Files are recorded in the database only if they are created within the virtualized environment or have been altered by it; files merely read are not added.
doc/pseudo_ipc +36 -0
@@ -1,5 +1,28 @@ MESSAGE PASSING +The server has two UNIX domain sockets in its local state directory: + +pseudo.socket + A stream socket. Each client connects to it, sends a PING to + register, and gets every reply on this connection. pseudo -S + also sends its SHUTDOWN request here, and the server notices a + client going away when the connection closes. + +pseudo.request + A datagram socket shared by all clients. Every request after the + initial PING is sent here. + +The kernel queues datagrams from all senders on the one socket in the +order they were sent, so the server handles requests in that order even +across processes. Once a client's send has returned, its request is +queued ahead of anything another client sends afterwards. If a process +changes a file and then tells another process about it (through a pipe, +by exiting, or any other way), the server has already queued the change +by the time the second process can ask about the file. + +It also means the server reads each request with a single recv(), +rather than a header and then a path. + typedef struct { pseudo_msg_type_t type; pseudo_op_t op;
@@ -16,6 +39,8 @@ typedef struct { unsigned int pathlen; int nlink; int deleting; + int client_id; + unsigned int client_serial; char path[]; } pseudo_msg_t;
@@ -44,6 +69,11 @@ only sends PING, OP, or FASTOP. FASTOP is used for operations whose result the client doesn't need, but the server still replies with ACK (or NAK on failure) and the client still waits for that reply. +A PING on the stream socket registers the client: the reply gives it the +client_id and client_serial to put in its requests. A PING on the +request socket is answered once every request the client sent before it +has been handled. + When run with '-S', the pseudo program runs as a client, sending a SHUTDOWN message to a server -- but only if it can find one, it does not start a new one. In this case, the server
@@ -84,6 +114,12 @@ deleting carries the database's "deleting" mark (see doc/database) when the server looks up file entries. The server uses it internally; the client doesn't set or use it. +client_id and client_serial identify the client's stream connection in +requests on the shared socket, so the server knows where to reply. The +server numbers every connection, so a request still queued from a client +that has gone away is never answered on a connection that has since +reused its client_id; the server applies it without replying. + 32/64 bit: This structure should have the same offsets for every element, including path, on both 64-bit and 32-bit machines. (Check with 'offsets.c'.) It is *not* an error if sizeof(pseudo_msg_t) is different; the padding
pseudo.h +1 -0
@@ -131,6 +131,7 @@ extern char *pseudo_version;#define PSEUDO_PATHLOCK "pseudo.pathlock"#define PSEUDO_PIDFILE "pseudo.pid"#define PSEUDO_SOCKET "pseudo.socket" +#define PSEUDO_REQUEST_SOCKET "pseudo.request"#define PSEUDO_SEVERITY_DEFAULT "info,warn,error"
pseudo_client.c +112 -46
269 lines not on this page · raw message
pseudo_ipc.c +42 -0
48 lines not on this page · raw message
pseudo_ipc.h +8 -0
@@ -26,6 +26,8 @@ typedef struct {unsigned int pathlen;int nlink;int deleting; +int client_id; +unsigned int client_serial;char path[]; } pseudo_msg_t;
@@ -47,7 +49,13 @@ extern int pseudo_access_fopen(const char *);#define PSEUDO_HEADER_SIZE (offsetof(pseudo_msg_t, path)) +/* largest request sent over the datagram socket: two paths for rename, +* or a path plus an xattr name and value (at most 64KB) +*/ +#define PSEUDO_MAX_REQUEST (256 * 1024) +extern pseudo_msg_t *pseudo_msg_receive (int fd); +extern pseudo_msg_t *pseudo_msg_receive_request (int fd);extern pseudo_msg_t *pseudo_msg_dup (pseudo_msg_t *);extern pseudo_msg_t *pseudo_msg_dupheader (pseudo_msg_t *);extern pseudo_msg_t *pseudo_msg_new (size_t ,const char *);
pseudo_server.c +153 -1
214 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH 2/2 Replace FASTOP with requests that don't wait for a reply
In reply to Mark HatleMost requests only tell the server about a change, such as chown, chmod, creat, rename or unlink, and the client ignores the reply, but it still waited for every one.
FASTOP was meant to avoid that, but it sent requests over each client's own connection, so another process could overtake a change it had been told about, and it dropped errors. "Half-undo FASTOP" (449c234) fixed the errors by having the client wait for every reply again, leaving FASTOP identical to OP; the server's early-ACK path never ran because the message type had already been changed to ACK or NAK. Remove it, its op "wait" column and the dead server code.
Since requests are now handled in the order they were sent, even across processes, send these as a new PSEUDO_MSG_ASYNC type without waiting. The ops are marked in a new "async" column in enums/op.in.
The server only replies to an async request if the client must abort, for instance after a path mismatch. The client reads that reply ahead of the reply to its next synchronous request and aborts then. So that an abort isn't lost, a client with requests outstanding waits for them with a PING on the request socket before exec() and at exit; the exit check doesn't wait for the pseudo lock, which another thread may hold indefinitely. _exit() and _Exit() skip destructors, and are used by forked workers such as Python's multiprocessing, so wrap them to wait as well. PSEUDO_SYNC=1 makes every request wait, so the client aborts in the call that caused the problem.
On a tar/chown/find/ls/rm workload of 40,000 files this takes the run from 21.8s to 14.3s.
Add tests that changes made without waiting are seen by other processes told about them through a pipe or by reaping the process, and that an abort is still delivered, at the next synchronous request, _exit() or execvpe(), with and without PSEUDO_SYNC.
AI-Generated: Uses GitHub Copilot
--- doc/overview | 3 +- doc/program_flow | 11 ++ doc/pseudo_ipc | 43 +++++--- enums/msg_type.in | 2 +- enums/op.in | 50 ++++----- ports/common/guts/_exit.c | 16 +++ ports/common/guts/execv.c | 4 + ports/common/guts/execve.c | 4 + ports/common/guts/execveat.c | 4 + ports/common/guts/execvp.c | 4 + ports/common/guts/execvpe.c | 4 + ports/common/guts/fexecve.c | 4 + ports/common/pseudo_wrappers.c | 24 +++++ ports/common/wrapfuncs.in | 1 + pseudo.1 | 23 +++- pseudo.c | 2 +- pseudo_client.c | 72 ++++++++++++- pseudo_client.h | 2 + pseudo_server.c | 42 +++----- pseudo_util.c | 1 + pseudo_wrappers.c | 43 ++++++++ test/test-async-abort.c | 48 +++++++++ test/test-async-abort.sh | 40 +++++++ test/test-async-order.c | 188 +++++++++++++++++++++++++++++++++ test/test-async-order.sh | 23 ++++ 25 files changed, 583 insertions(+), 75 deletions(-) create mode 100644 ports/common/guts/_exit.c create mode 100644 test/test-async-abort.c create mode 100755 test/test-async-abort.sh create mode 100644 test/test-async-order.c create mode 100755 test/test-async-order.sh
doc/overview +2 -1
@@ -47,7 +47,8 @@ client can restart it.) 4. The server code. This code is fairly simple; all it does is maintain the database of file information. Operations consist either of a request for information (e.g., a stat(2) call) or notification of a change. The -server sends back failure or success notices. +server sends back failure or success notices for requests for information; +notifications of a change are sent without waiting for a reply. As a fairly typical example, the progress of a stat(2) call is:
doc/program_flow +11 -0
@@ -14,6 +14,8 @@ libpseudo execution flow: setup pseudo_functions setup log files (PSEUDO_DEBUG_FILE, PSEUDO_EVLOG_FILE) pseudo_client.c: pseudo_init_client() + wait for this process's asynchronous requests + setup PSEUDO_SYNC setup PSEUDO_DISABLED setup pseudo_localstate_dir_fd setup PSEUDO_NOSYMLINKEXP
@@ -30,6 +32,7 @@ libpseudo execution flow: pseudo_setupenv() if PSEUDO_UNLOAD pseudo_dropenv() + pseudo_client_flush() real_exec*() fork()
@@ -77,6 +80,14 @@ libpseudo execution flow: unmask signals (if they were blocked above) return rc + # on exit # + + pseudo_wrappers.c: (destructor) _libpseudo_fini(), or _exit()/_Exit() + pseudo_exit_flush() + if this process has asynchronous requests pending, + and the lock is free (or already ours) + pseudo_client_flush() + pseudo execution flow: pseudo.c: main() pseudo_util.c: pseudo_init_util()
doc/pseudo_ipc +30 -13
71 lines not on this page · raw message
enums/msg_type.in +1 -1
@@ -4,4 +4,4 @@ shutdown op ack nak -fastop +async
enums/op.in +25 -25
55 lines not on this page · raw message
ports/common/guts/_exit.c new file +16 -0
@@ -0,0 +1,16 @@ +/* +* SPDX-License-Identifier: LGPL-2.1-only +* +* void _exit(int status) +*/ + +/* NOTE THAT THIS IS NEVER USED! +* The hand-written _exit() in ../pseudo_wrappers.c flushes +* asynchronous requests and exits directly. +*/ + +real__exit (status); + +/* return; +* } +*/
ports/common/guts/execv.c +4 -0
@@ -33,6 +33,10 @@/* if exec() fails, we may end up taking signals unexpectedly... * not much we can do about that. */ +/* exec() skips destructors, so collect errors for requests +* sent without waiting now +*/ +pseudo_client_flush ();sigprocmask (SIG_SETMASK , &pseudo_saved_sigmask,NULL ); rc =real_execv (file, argv);
ports/common/guts/execve.c +4 -0
@@ -27,6 +27,10 @@/* if exec() fails, we may end up taking signals unexpectedly... * not much we can do about that. */ +/* exec() skips destructors, so collect errors for requests +* sent without waiting now +*/ +pseudo_client_flush ();sigprocmask (SIG_SETMASK , &pseudo_saved_sigmask,NULL ); rc =real_execve (file, argv, new_environ);
ports/common/guts/execveat.c +4 -0
@@ -19,6 +19,10 @@if (pseudo_has_unload (new_environ)) new_environ =pseudo_dropenvp (new_environ); +/* exec() skips destructors, so collect errors for requests +* sent without waiting now +*/ +pseudo_client_flush ();sigprocmask (SIG_SETMASK , &pseudo_saved_sigmask,NULL ); rc =real_execveat (dirfd, path, argv, new_environ, flags);
ports/common/guts/execvp.c +4 -0
@@ -33,6 +33,10 @@/* if exec() fails, we may end up taking signals unexpectedly... * not much we can do about that. */ +/* exec() skips destructors, so collect errors for requests +* sent without waiting now +*/ +pseudo_client_flush ();sigprocmask (SIG_SETMASK , &pseudo_saved_sigmask,NULL ); rc =real_execvp (file, argv);
ports/common/guts/execvpe.c +4 -0
@@ -19,6 +19,10 @@if (pseudo_has_unload (new_environ)) new_environ =pseudo_dropenvp (new_environ); +/* exec() skips destructors, so collect errors for requests +* sent without waiting now +*/ +pseudo_client_flush ();sigprocmask (SIG_SETMASK , &pseudo_saved_sigmask,NULL ); rc =real_execvpe (file, argv, new_environ);
ports/common/guts/fexecve.c +4 -0
@@ -11,6 +11,10 @@if (pseudo_has_unload (new_environ)) new_environ =pseudo_dropenvp (new_environ); +/* exec() skips destructors, so collect errors for requests +* sent without waiting now +*/ +pseudo_client_flush ();sigprocmask (SIG_SETMASK , &pseudo_saved_sigmask,NULL ); rc =real_fexecve (fd, argv, new_environ);
ports/common/pseudo_wrappers.c +24 -0
@@ -445,6 +445,24 @@ execveat(int dirfd, const char *path, char *const *argv, char *const *envp, intreturn rc; } +/* _exit() skips destructors, so collect errors for requests sent +* without waiting here instead. +*/ +void +_exit (int status) { +pseudo_exit_flush (); +if (real__exit) +real__exit (status); +syscall (SYS_exit_group, status); +for (;;) + ; +} + +/* _Exit() is equivalent to _exit(), and glibc makes it a weak alias of +* _exit, but callers bind to it by name, so it must be exported as well. +*/ +void _Exit (int status) __attribute__((alias ("_exit" ), noreturn)); +/* no profiling in fork because it wouldn't work anyway * half the time */
@@ -543,6 +561,12 @@ wrap_execveat(int dirfd, const char *path, char *const *argv, char *const *envp,return rc; } +/* not used, the hand-written wrappers flush and exit directly */ +static void +wrap__exit (int status) { + (void ) status; +} +static int wrap_fork (void ) {int rc =-1 ;
ports/common/wrapfuncs.in +1 -0
@@ -10,3 +10,4 @@ int posix_spawnp(pid_t *pid, const char *file, const posix_spawn_file_actions_t int execvpe(const char *file, char *const *argv, char *const *envp); /* hand_wrapped=1 */ int fexecve(int fd, char *const *argv, char *const *envp); /* hand_wrapped=1 */ int execveat(int dirfd, const char *path, char *const *argv, char *const *envp, int flags); /* hand_wrapped=1 */ +void _exit(int status); /* hand_wrapped=1 */
pseudo.1 +20 -3
@@ -880,6 +880,21 @@ suppresses informational messages or warnings; errors are always shown. The default is .IR info,warn,error . .TP 8 +.B PSEUDO_SYNC +By default, requests whose result the client doesn't use, such as +.IR chown(2) +or +.IR chmod(2) , +are sent to the server without waiting for it to handle them. The +server still handles every request in the order clients sent it, so +other processes always see the change. If the server asks the client +to abort, for instance after a path mismatch, the client aborts at its +next request that does wait for a reply, or before +.IR exec(3) +or exiting. If this variable is set to a value other than 0, the +client waits for every request, so it aborts in the call that caused +the problem. This is slower, but can help when debugging. +.TP 8 .BR PSEUDO_UIDS ,\ PSEUDO_GIDS These variables are used internally to pass information about the current emulated user and group identity from one process to another.
@@ -937,9 +952,11 @@ or debugged in that context. Filesystem performance is noticably worse under .I pseudo than it is otherwise. This is probably because nearly every operation -(other than reads and writes) involves at least one round-trip network -communication with the server, and probably some kind of database -activity. +(other than reads and writes) involves a message to the server, and +probably some kind of database activity. Operations that ask about a +file wait for the server's reply; ones that only report a change do not +(see +.BR PSEUDO_SYNC ). .SH SECURITY .I pseudo
pseudo.c +1 -1
@@ -1087,7 +1087,7 @@ pseudo_server_response(pseudo_msg_t *msg, const char *program, const char *tag,return 0 ;break ;case PSEUDO_MSG_OP : -case PSEUDO_MSG_FASTOP : +case PSEUDO_MSG_ASYNC :return pseudo_op (msg, program, tag, response_path, response_len);break ;case PSEUDO_MSG_ACK :/* FALLTHROUGH */
pseudo_client.c +68 -4
128 lines not on this page · raw message
pseudo_client.h +2 -0
@@ -19,6 +19,8 @@ extern void pseudo_magic(void);extern void pseudo_client_touchuid (void );extern void pseudo_client_touchgid (void );extern int pseudo_client_shutdown (int ); +extern void pseudo_client_flush (void ); +extern int pseudo_client_flush_needed (void );extern int pseudo_fd (int fd,int how);extern int pseudo_client_path_lock (int shared);extern void pseudo_client_path_unlock (int fd);
pseudo_server.c +15 -27
89 lines not on this page · raw message
pseudo_util.c +1 -0
@@ -60,6 +60,7 @@ static struct pseudo_variables pseudo_env[] = { { "PSEUDO_ALLOW_FSYNC", 18, NULL }, { "PSEUDO_IO_URING_SECCOMP", 23, NULL }, { "PSEUDO_IO_URING_FILTER", 22, NULL }, + { "PSEUDO_SYNC", 11, NULL }, #ifdef PSEUDO_PROFILING { "PSEUDO_PROFILE_PATH", 19, NULL }, #endif
pseudo_wrappers.c +43 -0
69 lines not on this page · raw message
test/test-async-abort.c new file +48 -0
48 lines not on this page · raw message
test/test-async-abort.sh new file +40 -0
@@ -0,0 +1,40 @@ +#!/bin/bash +# +# SPDX-License-Identifier: LGPL-2.1-only +# +# A chown() whose database entry has another name makes the server tell +# the client to abort. chown() is sent without waiting, so the client +# must still abort: at its next request that waits for a reply, or when +# it leaves with _exit() or _Exit() or execs another program. With PSEUDO_SYNC set, +# it must abort inside chown() itself. +# +# The temporary tree has to live below $PWD so that pseudo tracks it. + +tmpdir="$(mktemp -d -p "$PWD" async_abort_XXXXXX)" +trap "rm -rf '$tmpdir'" EXIT TERM INT + +rc=0 +check() { + local sync="$1" how="$2" expect="$3" out status + : > "$tmpdir/a" + # rename it behind pseudo's back, so the database still says "a" + PSEUDO_DISABLED=1 mv "$tmpdir/a" "$tmpdir/b" + out=$(PSEUDO_SYNC=$sync ./test/test-async-abort "$tmpdir/b" "$how" 2>/dev/null) + status=$? + # put the name back so the database entry can be removed cleanly + PSEUDO_DISABLED=1 mv "$tmpdir/b" "$tmpdir/a" + rm -f "$tmpdir/a" + if [ $status -ne 134 ]; then + echo "FAILED: $how: expected abort (PSEUDO_SYNC=${sync:-unset}), got status $status" + rc=1 + elif [ "$out" != "$expect" ]; then + echo "FAILED: $how: PSEUDO_SYNC=${sync:-unset}: expected output '$expect', got '$out'" + rc=1 + fi +} + +for how in stat _exit _Exit execvpe; do + check "" $how "returned" +done +check 1 stat "" +exit $rc
test/test-async-order.c new file +188 -0
188 lines not on this page · raw message
test/test-async-order.sh new file +23 -0
@@ -0,0 +1,23 @@ +#!/bin/bash +# +# SPDX-License-Identifier: LGPL-2.1-only +# +# Ownership and mode changes are sent to the server without waiting for a +# reply. Another process that learns of a change, through a pipe or by +# reaping the process that made it, must see the new values. Run it +# both with and without PSEUDO_SYNC, which makes every request wait. +# +# The temporary tree has to live below $PWD so that pseudo tracks it. + +tmpdir="$(mktemp -d -p "$PWD" async_order_XXXXXX)" +trap "rm -rf '$tmpdir'" EXIT TERM INT + +rc=0 +for sync in "" 1; do + rm -f "$tmpdir"/f* + if ! PSEUDO_SYNC=$sync ./test/test-async-order "$tmpdir" 500; then + echo "FAILED: ordering broken (PSEUDO_SYNC=${sync:-unset})" + rc=1 + fi +done +exit $rc
Signature · 1 line
2.34.1
This is JUST comparing do_rootfs times using buildstats.
Wrynose pseudo (before the file locking fix): 304s
The current master-next: 331s
master-next + async-io/fastop change: 272s
Moving this over the whole build, comparing master-next to +async-io was about a 2 1/2 minute difference. I don't have comparison of the wrynose pseudo I'm using, due to differences in build order.
But based on this, it looks like it is worth the additional complexity to enable this code.
--Mark
Quoted 58 lines · Mark Hatle via yocto-patches
These two were previously sent as an RFC. A minor issue was discovered in the previous implementation. One a case insensitive filesystem it had both
_Exit.cand_exit.cwhich caused a conflict and problems. The implementation was updated to avoid this problem.Yocto Project (wrynose) was used for testing, along with my layer configuration. For a build that had 32447 tasks, I prepopulated an sstate-cache, then removed the rootfs and package related cache objects.
The build difference was 45 seconds, 17:30 down to 16:45. I believe most of the time was rootfs construction. Offline testing showed a measurable improvement when running some 40,000+ operations. (This is on a 64 thread Epyc w/ plenty of ram, so I expect a larger difference on slower hardware.)
I'm running additional performance benchmarks with buildstats, but this is enough to send to give others a chance to comment. I'll reply with the buildstats info once I have it.
Mark Hatle (2):
Send client requests over one shared datagram socket Replace FASTOP with requests that don't wait for a replyREADME.security | 4 +- doc/overview | 6 +- doc/program_flow | 11 ++ doc/pseudo_ipc | 73 +++++++++-- enums/msg_type.in | 2 +- enums/op.in | 50 +++---- ports/common/guts/_exit.c | 16 +++ ports/common/guts/execv.c | 4 + ports/common/guts/execve.c | 4 + ports/common/guts/execveat.c | 4 + ports/common/guts/execvp.c | 4 + ports/common/guts/execvpe.c | 4 + ports/common/guts/fexecve.c | 4 + ports/common/pseudo_wrappers.c | 24 ++++ ports/common/wrapfuncs.in | 1 + pseudo.1 | 23 +++- pseudo.c | 2 +- pseudo.h | 1 + pseudo_client.c | 230 ++++++++++++++++++++++++++------- pseudo_client.h | 2 + pseudo_ipc.c | 42 ++++++ pseudo_ipc.h | 8 ++ pseudo_server.c | 186 ++++++++++++++++++++++---- pseudo_util.c | 1 + pseudo_wrappers.c | 43 ++++++ test/test-async-abort.c | 48 +++++++ test/test-async-abort.sh | 40 ++++++ test/test-async-order.c | 188 +++++++++++++++++++++++++++ test/test-async-order.sh | 23 ++++ 29 files changed, 931 insertions(+), 117 deletions(-)create mode 100644
ports/common/guts/_exit.c
create mode 100644test/test-async-abort.c
create mode 100755test/test-async-abort.sh
create mode 100644test/test-async-order.c
create mode 100755test/test-async-order.sh