Lines Matching +full:close +full:- +full:range
2 * socket.c - low-level socket operations
27 * integer range. stdio usually will make use
28 * of the file descriptors in the range of
30 * in order to keep this range clean, for socket
36 * - keep a current socket fd boundary initialized with
37 * max(0, min(GETDTABLESIZE() - FD_CHUNK, FOPEN_MAX))
38 * - attempt to move the descriptor to the boundary or
40 * - if that fails and boundary > 0 set boundary
41 * to min(0, socket_fd_boundary - FD_CHUNK)
42 * -> retry
44 * - on success close old fd return new fd
47 * - fds will be moved above the socket fd boundary
49 * - the socket boundary will be reduced until
50 * allocation is possible or 0 is reached - at this
78 static SOCKET socket_boundary = -1;
87 if (socket_boundary == -1) {
88 socket_boundary = max(0, min(GETDTABLESIZE() - FD_CHUNK,
101 /* inside reserved range: attempt to move fd */
104 if (newfd != -1) {
105 /* success: drop the old one - return the new one */
106 close(fd);
110 /* outside reserved range: no work - return the original one */
113 socket_boundary = max(0, socket_boundary - FD_CHUNK);
125 * make_socket_nonblocking() - set up descriptor to be non blocking
133 * set non-blocking,
181 # include "Bletch: Need non-blocking I/O!"