2 .TH fdpass 3 "28 November 2003" "Straylight/Edgeware" "mLib utilities library"
4 fdpass \- file descriptor passing
9 .B "#include <mLib/fdpass.h>"
11 .BI "ssize_t fdpass_send(int " sock ", int " fd ", const void *" p ", size_t " sz );
12 .BI "ssize_t fdpass_recv(int " sock ", int *" fd ", void *" p ", size_t " sz );
17 sends the file descriptor
19 as ancillary data attached to the buffer pointed to by
23 over the Unix-domain socket
25 It returns the amount of data sent, or \-1 on error. For more details,
35 bytes of data into the buffer pointed to by
37 together with at most one file descriptor passed as ancillary data,
38 which is written to the integer pointed to by
40 Other file descriptors received are closed; any other ancillary messages
41 are ignored. If no file descriptor is received,
43 is set to \-1. The function returns the number of bytes read, or \-1 on
44 error. For more details, see
54 Mark Wooding, <mdw@distorted.org.uk>