| | @@ -978,6 +978,7 @@ |
| 978 | 978 | proc workDir*(var buf: [4096]U8): I64; (* the working directory into buf: its length *) |
| 979 | 979 | |
| 980 | 980 | proc connect*(path: []U8): I64; (* a stream socket, connected to the Unix socket at path: its fd *) |
| 981 | +proc send*(fd: I64; s: []U8): I64; (* write, to a socket: -32 (EPIPE), not a signal, if it is closed *) |
| 981 | 982 | proc readyOf*(fds: []I64; ms: I64): I64; (* the first of fds with something to read within ms, or -1 *) |
| 982 | 983 | |
| 983 | 984 | proc openPty*: I64; (* a pseudo-terminal: the fd of its controlling side *) |
| | @@ -1000,8 +1001,12 @@ |
| 1000 | 1001 | restores it before it ends: `Rt.atExit` is the place. |
| 1001 | 1002 | |
| 1002 | 1003 | `connect` is for talking to a server on the same machine, an X server |
| 1003 | | -at `/tmp/.X11-unix/X0` say; what is sent and received goes by `read` |
| 1004 | | -and `write`, and `close` ends it. `readyOf` waits on several file |
| 1004 | +at `/tmp/.X11-unix/X0` say; what it receives comes by `read`, what it |
| 1005 | +sends goes by `send`, and `close` ends it. `send` is `write` for a |
| 1006 | +socket, except when the other end has closed it: `write` would stop |
| 1007 | +the program with the signal SIGPIPE, where `send` returns -32 |
| 1008 | +(EPIPE), so that a program learns its server has gone and can end as |
| 1009 | +it wants. `readyOf` waits on several file |
| 1005 | 1010 | descriptors at once, as a program does that listens to a server and a |
| 1006 | 1011 | terminal both. |
| 1007 | 1012 | |
| | @@ -1070,4 +1075,6 @@ |
| 1070 | 1075 | directories searched is an error, unless the first is a link to one |
| 1071 | 1076 | of the others (section 3). |
| 1072 | 1077 | - **2026-10.6.** `Sys.Info` says whether the path is a symbolic link |
| 1078 | + (section 11). |
| 1079 | +- **2026-10.7.** `Sys.send` writes to a socket without SIGPIPE |
| 1073 | 1080 | (section 11). |