raz / commit 82f30b3c

commit
82f30b3cdbfde5385d9b8645deee860d0074f445
author
Luis <42945842+ldiaz94@users.noreply.github.com>
date
parent
7924cbb7
Sys: closeWrite, peer, socketPair, nonblocking and errConnAborted

What a server needs: end this side's writing, say who is at the other
end (Remote), make a pair of sockets, open a fifo without waiting, and
name a client gone before accept. CAbi gains shutWr, soPeercred and
struct ucred's fields, written again by tools/cabi.c. In both
backends; tests in Sys.main.

patch · log

6 files changed, +248 -10

doc/raz-lib.md (history) modified +29 -3

@@ -208,12 +208,12 @@
208208 errNotDir* = -20; errIsDir* = -21; errInvalid* = -22;
209209 errNotTerminal* = -25; errNoSpace* = -28; errPipe* = -32;
210210 errNameTooLong* = -36; errNotEmpty* = -39; errLoop* = -40;
211- errAddrInUse* = -98; errNetUnreach* = -101; errConnReset* = -104;
211+ errAddrInUse* = -98; errNetUnreach* = -101; errConnAborted* = -103; errConnReset* = -104;
212212 errTimedOut* = -110; errRefused* = -111; errHostUnreach* = -113;
213213 errInProgress* = -115;
214214
215215 type
216- Access* = (reading, writing, creating, exclusive, truncating, appending, executing);
216+ Access* = (reading, writing, creating, exclusive, truncating, appending, executing, nonblocking);
217217 Accesses* = set of Access;
218218 Info* = record
219219 size*: I64; (* in bytes *)
@@ -246,6 +246,13 @@
246246 Status* = (running, exited, killed, stopped);
247247 Mode* = record ... end; (* a terminal's modes; its fields are the target's *)
248248 Peer* = record ... end; (* whom a datagram came from *)
249+ Remote* = record (* who is at the other end of a connected socket *)
250+ unix*: BOOL; (* a Unix socket: uid and pid say who *)
251+ ipv6*: BOOL; (* addr is 16 bytes of IPv6, else 4 bytes of IPv4 then zeros *)
252+ addr*: [16]U8;
253+ port*: INT;
254+ uid*, pid*: INT;
255+ end;
249256
250257 proc write*(fd: INT; s: []U8): INT; (* the bytes written *)
251258 proc read*(fd: INT; buf: []U8): INT; (* the bytes read; 0 at the end *)
@@ -359,6 +366,9 @@
359366 proc receive*(fd: INT; buf: []U8): (INT, Peer); (* the next datagram, in buf, and who sent it *)
360367 proc reply*(fd: INT; peer: Peer; s: []U8): INT; (* s, as one datagram, to peer *)
361368 proc localPort*(fd: INT): INT; (* the port the socket fd is bound to *)
369+proc closeWrite*(fd: INT): INT; (* no more writing to the socket fd; the other end reads an end *)
370+proc peer*(fd: INT): (Remote, INT); (* who is at the other end of the connected socket fd *)
371+proc socketPair*: (INT, INT, INT); (* two connected stream sockets, and 0 *)
362372 proc sendFds*(fd: INT; s: []U8; fds: []INT): INT; (* send, and with it fds, to a Unix socket *)
363373 proc receiveFds*(fd: INT; buf: []U8; fds: []INT): (INT, INT); (* read, and the fds that came with it *)
364374
@@ -523,7 +533,11 @@
523533 `access` says whether this user, by its real ids, may read, write or
524534 execute a file, as `test -r`, `-w` and `-x` ask, which `Info.mode`
525535 alone can't say; an empty `how` asks only whether it is there.
526-`open` refuses `executing`, with -22 (EINVAL). `umask` sets the bits
536+`open` refuses `executing`, with -22 (EINVAL). `nonblocking` opens a file without waiting: a fifo opened to write
537+waits for a reader and a fifo opened to read waits for a writer, but
538+with `nonblocking` the open returns at once (-6, ENXIO, for a write
539+with no reader), and a read or write that would wait is -11 later, as
540+`setBlocking(fd, false)` makes it. `umask` sets the bits
527541 taken away from the mode of every file this program, and those it
528542 starts, make, and says what they were. `envAt` gives the environment
529543 one variable at a time, from 0, for a shell to list it and to pass it
@@ -615,6 +629,18 @@
615629 datagrams from anyone, as a name server has. `receive` gives the next
616630 datagram, at most `LEN(buf)` bytes of it, the rest lost, and a `Peer`
617631 that `reply` sends an answer to.
632+
633+`closeWrite` ends this side's writing to a socket, so that the other
634+end reads an end of input and can still answer on the same socket: a
635+client sends its request, says it is done, and reads the reply. `peer`
636+says who is at the other end of a connected socket: for a TCP one its
637+address and port; for a Unix one the user and process that made the
638+connection, as the system recorded them, so that a server can check
639+that its client is the same user instead of trusting a directory's
640+mode. `socketPair` makes two connected stream sockets at once, as a
641+`listen`, `connect` and `accept` would, with no name on disk. Each is
642+closed in a program exec starts. `accept` gives -103 (`errConnAborted`)
643+for a client that went before it was taken.
618644
619645 **Passing files and sharing memory.** A program can give another an
620646 open file over a Unix socket: `sendFds` sends `s`, at least one byte,

lib/C.raz (history) modified +3 -0

@@ -44,6 +44,9 @@
4444 extern proc accept4*(fd: I32; addr: ^U8; len: ^U32; flags: I32): I32;
4545 extern proc setsockopt*(fd, level, name: I32; value: ^U8; len: U32): I32;
4646 extern proc getsockopt*(fd, level, name: I32; value: ^U8; len: ^U32): I32;
47+extern proc getpeername*(fd: I32; addr: ^U8; len: ^U32): I32;
48+extern proc shutdown*(fd, how: I32): I32;
49+extern proc socketpair*(domain, kind, protocol: I32; fds: ^I32): I32;
4750 extern proc getsockname*(fd: I32; addr: ^U8; len: ^U32): I32;
4851 extern proc recvfrom*(fd: I32; buf: ^U8; n: UINT; flags: I32; addr: ^U8; len: ^U32): INT;
4952 extern proc sendto*(fd: I32; buf: ^U8; n: UINT; flags: I32; addr: ^U8; len: U32): INT;

lib/CAbi.linux-x86_64.raz (history) modified +6 -0

@@ -97,6 +97,8 @@
9797 solSocket* = 1;
9898 soReuseaddr* = 2;
9999 soError* = 4;
100+ soPeercred* = 17;
101+ shutWr* = 1;
100102 msgNosignal* = 16384;
101103 msgCmsgCloexec* = 1073741824;
102104 scmRights* = 1;
@@ -113,6 +115,10 @@
113115 sockaddrIn6Len* = 28;
114116 sin6PortAt* = 2;
115117 sin6AddrAt* = 8;
118+ ucPidAt* = 0;
119+ ucPidLen* = 4;
120+ ucUidAt* = 4;
121+ ucUidLen* = 4;
116122 msghdrLen* = 56;
117123 msgIovAt* = 16;
118124 msgIovlenAt* = 24;

lib/Sys.linux-x86_64.raz (history) modified +102 -3

@@ -30,15 +30,16 @@
3030 errNotDir* = -20; errIsDir* = -21; errInvalid* = -22;
3131 errNotTerminal* = -25; errNoSpace* = -28; errPipe* = -32;
3232 errNameTooLong* = -36; errNotEmpty* = -39; errLoop* = -40;
33- errAddrInUse* = -98; errNetUnreach* = -101; errConnReset* = -104;
33+ errAddrInUse* = -98; errNetUnreach* = -101; errConnAborted* = -103; errConnReset* = -104;
3434 errTimedOut* = -110; errRefused* = -111; errHostUnreach* = -113;
3535 errInProgress* = -115;
3636
3737 type
3838 (* What open is asked for: reading, writing or both, and what else
39- it does to the file. *)
39+ it does to the file; nonblocking, that open doesn't wait (for a
40+ fifo's other end) and reads and writes on the file don't either. *)
4041 Access* = (reading, writing, creating, exclusive, truncating,
41- appending, executing);
42+ appending, executing, nonblocking);
4243 Accesses* = set of Access; (* what open is given *)
4344
4445 (* What info says of a file. *)
@@ -118,6 +119,14 @@
118119 a: Sockaddr;
119120 size: INT;
120121 end;
122+ (* Who is at the other end of a connected socket, as peer says. *)
123+ Remote* = record
124+ unix*: BOOL; (* a Unix socket: uid and pid say who; no addr or port *)
125+ ipv6*: BOOL; (* addr is an IPv6 address, 16 bytes; else an IPv4 one, 4 bytes then zeros *)
126+ addr*: [16]U8; (* an IP peer's address *)
127+ port*: INT; (* an IP peer's port *)
128+ uid*, pid*: INT; (* a Unix peer's user and process, as the system recorded them when it connected *)
129+ end;
121130 (* struct msghdr, what sendmsg and recvmsg take: no address, one
122131 buffer, and a control message; the sizes and flags are ints
123132 with room after them, kept zero *)
@@ -197,6 +206,7 @@
197206 if exclusive in how then f := f | 80H; end;
198207 if truncating in how then f := f | 200H; end;
199208 if appending in how then f := f | 400H; end;
209+ if nonblocking in how then f := f | 800H; end; (* O_NONBLOCK *)
200210 return f;
201211 end;
202212
@@ -920,6 +930,53 @@
920930 return SYSCALL(288, fd, 0, 0, 80000H); (* accept4, SOCK_CLOEXEC *)
921931 end;
922932
933+(* Ends this side's writing to the socket fd, so that the other end
934+ reads an end of input and can still answer on it. 0, or minus an
935+ errno. *)
936+proc closeWrite*(fd: INT): INT;
937+begin
938+ return SYSCALL(48, fd, 1); (* shutdown, SHUT_WR *)
939+end;
940+
941+(* Who is at the other end of the connected socket fd, and 0; or minus
942+ an errno. *)
943+proc peer*(fd: INT): (Remote, INT);
944+var r: Remote; a: Sockaddr; size, credSize: I32; cred: [3]I32; e: INT;
945+begin
946+ r := {unix: false, ipv6: false};
947+ size := I32(SIZE(Sockaddr));
948+ e := SYSCALL(52, fd, ADR(a), ADR(size)); (* getpeername *)
949+ if e < 0 then return r, e; end;
950+ if a.family = 1 then (* AF_UNIX: ask who made the connection *)
951+ credSize := I32(4 * LEN(cred));
952+ e := SYSCALL(55, fd, 1, 17, ADR(cred), ADR(credSize)); (* getsockopt: SOL_SOCKET, SO_PEERCRED *)
953+ if e < 0 then return r, e; end;
954+ r.unix := true;
955+ r.pid := INT(cred[0]);
956+ r.uid := INT(cred[1]);
957+ else
958+ r.port := (INT(a.port[0]) shl 8) | INT(a.port[1]);
959+ if a.family = 10 then (* AF_INET6 *)
960+ r.ipv6 := true;
961+ COPY(r.addr[0..16], a.data[4..20]);
962+ else
963+ COPY(r.addr[0..4], a.data[0..4]);
964+ end;
965+ end;
966+ return r, 0;
967+end;
968+
969+(* Two connected stream sockets, as a Unix socket and the one that
970+ connects to it make: their fds and 0, closed in a program exec
971+ starts; or -1, -1 and minus an errno. *)
972+proc socketPair*: (INT, INT, INT);
973+var fds: [2]I32; r: INT;
974+begin
975+ r := SYSCALL(53, 1, 1 | 80000H, 0, ADR(fds)); (* socketpair: AF_UNIX, SOCK_STREAM, SOCK_CLOEXEC *)
976+ if r < 0 then return -1, -1, r; end;
977+ return INT(fds[0]), INT(fds[1]), 0;
978+end;
979+
923980 (* Writes s to the socket fd, as write does, but returns -32 (EPIPE)
924981 where write would stop the program with SIGPIPE: when the other end
925982 has closed it. *)
@@ -2300,6 +2357,47 @@
23002357 if processors() < 1 then exit(2); end;
23012358 end;
23022359
2360+(* The test of what a server needs: a pair of sockets, one end told
2361+ it has no more to read, who is at the other end of a Unix socket and
2362+ of a TCP one, and a fifo opened without waiting. *)
2363+proc testServer;
2364+var a, b, l, c, s, port, child, r, how: INT; buf: [8]U8; w: Remote; st: Status;
2365+begin
2366+ a, b, r := socketPair();
2367+ if (r # 0) or (send(a, "hi") # 2) or (read(b, buf) # 2) or (buf[0..2] # "hi") then exit(2); end;
2368+ if (closeWrite(a) # 0) or (read(b, buf) # 0) then exit(2); end; (* b reads an end, *)
2369+ if (send(b, "yo") # 2) or (read(a, buf) # 2) or (buf[0..2] # "yo") then exit(2); end; (* and can still answer *)
2370+ w, r := peer(a);
2371+ if (r # 0) or not w.unix or (w.pid # pid()) or (w.uid # uid()) or (w.port # 0) or (w.addr[0] # 0) then exit(2); end;
2372+ close(a);
2373+ close(b);
2374+ _, r := peer(-1);
2375+ if r # errBadFd then exit(2); end;
2376+ l := listenTcp("127.0.0.1", 0);
2377+ port := localPort(l);
2378+ c := connectTcp("127.0.0.1", port);
2379+ s := accept(l);
2380+ if (l < 0) or (c < 0) or (s < 0) then exit(2); end;
2381+ w, r := peer(c);
2382+ if (r # 0) or w.unix or w.ipv6 or (w.port # port) or (w.addr[0..4] # "\x7f\x00\x00\x01") then exit(2); end;
2383+ w, r := peer(s);
2384+ if (r # 0) or (w.port = port) or (w.addr[3] # 1) or (w.addr[4] # 0) then exit(2); end;
2385+ close(s);
2386+ close(c);
2387+ close(l);
2388+ _ := remove("/tmp/raz-sys-fifo");
2389+ child := spawn({path: "mkfifo", args: ["mkfifo", "/tmp/raz-sys-fifo"]});
2390+ r, st, how := waitExit(child);
2391+ if (st # exited) or (how # 0) then exit(2); end;
2392+ if open("/tmp/raz-sys-fifo", {writing, nonblocking}) # -6 then exit(2); end; (* ENXIO: no reader, and it didn't wait *)
2393+ a := open("/tmp/raz-sys-fifo", {reading, nonblocking});
2394+ b := open("/tmp/raz-sys-fifo", {writing, nonblocking});
2395+ if (a < 0) or (b < 0) or (read(a, buf) # errAgain) then exit(2); end; (* nothing to read, and it didn't wait *)
2396+ close(a);
2397+ close(b);
2398+ _ := remove("/tmp/raz-sys-fifo");
2399+end;
2400+
23032401 (* The module's test: a file written, read back and closed; a
23042402 directory made, listed and emptied; no terminal; a socket, sent to
23052403 after its end; programs; time and the network. *)
@@ -2527,6 +2625,7 @@
25272625 testShell;
25282626 testNet;
25292627 testProcess;
2628+ testServer;
25302629 end;
25312630
25322631 end Sys.

lib/Sys.raz (history) modified +105 -3

@@ -47,15 +47,16 @@
4747 errNotDir* = -20; errIsDir* = -21; errInvalid* = -22;
4848 errNotTerminal* = -25; errNoSpace* = -28; errPipe* = -32;
4949 errNameTooLong* = -36; errNotEmpty* = -39; errLoop* = -40;
50- errAddrInUse* = -98; errNetUnreach* = -101; errConnReset* = -104;
50+ errAddrInUse* = -98; errNetUnreach* = -101; errConnAborted* = -103; errConnReset* = -104;
5151 errTimedOut* = -110; errRefused* = -111; errHostUnreach* = -113;
5252 errInProgress* = -115;
5353
5454 type
5555 (* What open is asked for: reading, writing or both, and what else
56- it does to the file. *)
56+ it does to the file; nonblocking, that open doesn't wait (for a
57+ fifo's other end) and reads and writes on the file don't either. *)
5758 Access* = (reading, writing, creating, exclusive, truncating,
58- appending, executing);
59+ appending, executing, nonblocking);
5960 Accesses* = set of Access; (* what open is given *)
6061
6162 (* What info says of a file. *)
@@ -127,6 +128,14 @@
127128 a: Sockaddr;
128129 size: INT;
129130 end;
131+ (* Who is at the other end of a connected socket, as peer says. *)
132+ Remote* = record
133+ unix*: BOOL; (* a Unix socket: uid and pid say who; no addr or port *)
134+ ipv6*: BOOL; (* addr is an IPv6 address, 16 bytes; else an IPv4 one, 4 bytes then zeros *)
135+ addr*: [16]U8; (* an IP peer's address *)
136+ port*: INT; (* an IP peer's port *)
137+ uid*, pid*: INT; (* a Unix peer's user and process, as the system recorded them when it connected *)
138+ end;
130139 (* struct msghdr, what sendmsg and recvmsg take, as bytes: no
131140 address, one buffer, and a control message, a struct cmsghdr
132141 and the fds sent, at most 16 *)
@@ -238,6 +247,7 @@
238247 if exclusive in how then f := f | CAbi.oExcl; end;
239248 if truncating in how then f := f | CAbi.oTrunc; end;
240249 if appending in how then f := f | CAbi.oAppend; end;
250+ if nonblocking in how then f := f | CAbi.oNonblock; end;
241251 return f;
242252 end;
243253
@@ -958,8 +968,58 @@
958968 r := C.accept4(I32(fd), nil, nil, CAbi.sockCloexec);
959969 if r < 0 then return failed(); end;
960970 return INT(r);
971+end;
972+
973+(* Ends this side's writing to the socket fd, so that the other end
974+ reads an end of input and can still answer on it. 0, or minus an
975+ errno. *)
976+proc closeWrite*(fd: INT): INT;
977+begin
978+ if C.shutdown(I32(fd), CAbi.shutWr) # 0 then return failed(); end;
979+ return 0;
980+end;
981+
982+(* Who is at the other end of the connected socket fd, and 0; or minus
983+ an errno. *)
984+proc peer*(fd: INT): (Remote, INT);
985+var r: Remote; a: Sockaddr; size, credSize: U32; cred: [CAbi.ucUidAt + CAbi.ucUidLen]U8; p: ^U8;
986+begin
987+ r := {unix: false, ipv6: false};
988+ size := U32(SIZE(Sockaddr));
989+ p := ^U8(ADR(a));
990+ if C.getpeername(I32(fd), p, ADR(size)) # 0 then return r, failed(); end;
991+ if familyOf(p) = CAbi.afUnix then (* ask who made the connection *)
992+ credSize := U32(LEN(cred));
993+ if C.getsockopt(I32(fd), CAbi.solSocket, CAbi.soPeercred, ADR(cred[0]), ADR(credSize)) # 0 then
994+ return r, failed();
995+ end;
996+ r.unix := true;
997+ r.pid := INT(field(ADR(cred[0]), CAbi.ucPidAt, CAbi.ucPidLen));
998+ r.uid := INT(field(ADR(cred[0]), CAbi.ucUidAt, CAbi.ucUidLen));
999+ else
1000+ r.port := portOf(p);
1001+ if familyOf(p) = CAbi.afInet6 then
1002+ r.ipv6 := true;
1003+ COPY(r.addr[0..16], p[CAbi.sin6AddrAt..CAbi.sin6AddrAt + 16]);
1004+ else
1005+ COPY(r.addr[0..4], p[CAbi.sinAddrAt..CAbi.sinAddrAt + 4]);
1006+ end;
1007+ end;
1008+ return r, 0;
9611009 end;
9621010
1011+(* Two connected stream sockets, as a Unix socket and the one that
1012+ connects to it make: their fds and 0, closed in a program exec
1013+ starts; or -1, -1 and minus an errno. *)
1014+proc socketPair*: (INT, INT, INT);
1015+var fds: [2]I32;
1016+begin
1017+ if C.socketpair(CAbi.afUnix, CAbi.sockStream | CAbi.sockCloexec, 0, ADR(fds[0])) # 0 then
1018+ return -1, -1, failed();
1019+ end;
1020+ return INT(fds[0]), INT(fds[1]), 0;
1021+end;
1022+
9631023 (* Writes s to the socket fd, as write does, but returns -32 (EPIPE)
9641024 where write would stop the program with SIGPIPE: when the other end
9651025 has closed it. *)
@@ -2242,6 +2302,47 @@
22422302 if processors() < 1 then exit(2); end;
22432303 end;
22442304
2305+(* The test of what a server needs: a pair of sockets, one end told
2306+ it has no more to read, who is at the other end of a Unix socket and
2307+ of a TCP one, and a fifo opened without waiting. *)
2308+proc testServer;
2309+var a, b, l, c, s, port, child, r, how: INT; buf: [8]U8; w: Remote; st: Status;
2310+begin
2311+ a, b, r := socketPair();
2312+ if (r # 0) or (send(a, "hi") # 2) or (read(b, buf) # 2) or (buf[0..2] # "hi") then exit(2); end;
2313+ if (closeWrite(a) # 0) or (read(b, buf) # 0) then exit(2); end; (* b reads an end, *)
2314+ if (send(b, "yo") # 2) or (read(a, buf) # 2) or (buf[0..2] # "yo") then exit(2); end; (* and can still answer *)
2315+ w, r := peer(a);
2316+ if (r # 0) or not w.unix or (w.pid # pid()) or (w.uid # uid()) or (w.port # 0) or (w.addr[0] # 0) then exit(2); end;
2317+ close(a);
2318+ close(b);
2319+ _, r := peer(-1);
2320+ if r # errBadFd then exit(2); end;
2321+ l := listenTcp("127.0.0.1", 0);
2322+ port := localPort(l);
2323+ c := connectTcp("127.0.0.1", port);
2324+ s := accept(l);
2325+ if (l < 0) or (c < 0) or (s < 0) then exit(2); end;
2326+ w, r := peer(c);
2327+ if (r # 0) or w.unix or w.ipv6 or (w.port # port) or (w.addr[0..4] # "\x7f\x00\x00\x01") then exit(2); end;
2328+ w, r := peer(s);
2329+ if (r # 0) or (w.port = port) or (w.addr[3] # 1) or (w.addr[4] # 0) then exit(2); end;
2330+ close(s);
2331+ close(c);
2332+ close(l);
2333+ _ := remove("/tmp/raz-sys-fifo");
2334+ child := spawn({path: "mkfifo", args: ["mkfifo", "/tmp/raz-sys-fifo"]});
2335+ r, st, how := waitExit(child);
2336+ if (st # exited) or (how # 0) then exit(2); end;
2337+ if open("/tmp/raz-sys-fifo", {writing, nonblocking}) # -6 then exit(2); end; (* ENXIO: no reader, and it didn't wait *)
2338+ a := open("/tmp/raz-sys-fifo", {reading, nonblocking});
2339+ b := open("/tmp/raz-sys-fifo", {writing, nonblocking});
2340+ if (a < 0) or (b < 0) or (read(a, buf) # errAgain) then exit(2); end; (* nothing to read, and it didn't wait *)
2341+ close(a);
2342+ close(b);
2343+ _ := remove("/tmp/raz-sys-fifo");
2344+end;
2345+
22452346 (* The module's test, as Linux's Sys has it: a file written, read back
22462347 and closed; a directory made, listed and emptied; no terminal; a
22472348 socket, sent to after its end; programs; time and the network. *)
@@ -2468,6 +2569,7 @@
24682569 testShell;
24692570 testNet;
24702571 testProcess;
2572+ testServer;
24712573 end;
24722574
24732575 end Sys.

tools/cabi.c (history) modified +3 -1

@@ -151,7 +151,8 @@
151151 K("sockStream", SOCK_STREAM); K("sockDgram", SOCK_DGRAM);
152152 K("sockCloexec", SOCK_CLOEXEC); K("sockNonblock", SOCK_NONBLOCK);
153153 K("solSocket", SOL_SOCKET); K("soReuseaddr", SO_REUSEADDR);
154- K("soError", SO_ERROR); K("msgNosignal", MSG_NOSIGNAL);
154+ K("soError", SO_ERROR); K("soPeercred", SO_PEERCRED); /* Linux's */
155+ K("shutWr", SHUT_WR); K("msgNosignal", MSG_NOSIGNAL);
155156 K("msgCmsgCloexec", MSG_CMSG_CLOEXEC); K("scmRights", SCM_RIGHTS);
156157 K("sockaddrLen", sizeof(struct sockaddr_storage));
157158 READ("saFamily", struct sockaddr, sa_family);
@@ -168,6 +169,7 @@
168169 K("sockaddrIn6Len", sizeof(struct sockaddr_in6));
169170 AT("sin6Port", struct sockaddr_in6, sin6_port);
170171 AT("sin6Addr", struct sockaddr_in6, sin6_addr);
172+ READ("ucPid", struct ucred, pid); READ("ucUid", struct ucred, uid);
171173 K("msghdrLen", sizeof(struct msghdr));
172174 AT("msgIov", struct msghdr, msg_iov);
173175 WRITE("msgIovlen", struct msghdr, msg_iovlen, msg_control);