3 .\" Manual for file descriptor passing
5 .\" (c) 2003, 2005, 2007, 2009, 2024 Straylight/Edgeware
8 .\"----- Licensing notice ---------------------------------------------------
10 .\" This file is part of the mLib utilities library.
12 .\" mLib is free software: you can redistribute it and/or modify it under
13 .\" the terms of the GNU Library General Public License as published by
14 .\" the Free Software Foundation; either version 2 of the License, or (at
15 .\" your option) any later version.
17 .\" mLib is distributed in the hope that it will be useful, but WITHOUT
18 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
20 .\" License for more details.
22 .\" You should have received a copy of the GNU Library General Public
23 .\" License along with mLib. If not, write to the Free Software
24 .\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
27 .\"--------------------------------------------------------------------------
28 .so ../defs.man \" @@@PRE@@@
30 .\"--------------------------------------------------------------------------
31 .TH fdpass 3mLib "28 November 2003" "Straylight/Edgeware" "mLib utilities library"
35 .\"--------------------------------------------------------------------------
37 fdpass \- file descriptor passing
39 .\"--------------------------------------------------------------------------
43 .B "#include <mLib/fdpass.h>"
45 .BI "ssize_t fdpass_send(int " sock ", int " fd ", const void *" p ", size_t " sz );
46 .BI "ssize_t fdpass_recv(int " sock ", int *" fd ", void *" p ", size_t " sz );
49 .\"--------------------------------------------------------------------------
54 sends the file descriptor
56 as ancillary data attached to the buffer pointed to by
60 over the Unix-domain socket
62 It returns the amount of data sent, or \-1 on error. For more details,
72 bytes of data into the buffer pointed to by
74 together with at most one file descriptor passed as ancillary data,
75 which is written to the integer pointed to by
77 Other file descriptors received are closed; any other ancillary messages
78 are ignored. If no file descriptor is received,
80 is set to \-1. The function returns the number of bytes read, or \-1 on
81 error. For more details, see
86 .\"--------------------------------------------------------------------------
94 .\"--------------------------------------------------------------------------
97 Mark Wooding, <mdw@distorted.org.uk>
99 .\"----- That's all, folks --------------------------------------------------