Lines Matching full:fd
21 #define ioctl(fd, opt, val) ioctlsocket(fd, opt, (u_long *)(val))
36 * - keep a current socket fd boundary initialized with
43 * if failure and boundary == 0 return old fd
44 * - on success close old fd return new fd
47 * - fds will be moved above the socket fd boundary
55 SOCKET fd
81 REQUIRE((int)fd >= 0);
100 if (fd >= 0 && fd < socket_boundary) {
101 /* inside reserved range: attempt to move fd */
102 newfd = fcntl(fd, F_DUPFD, socket_boundary);
106 close(fd);
111 return fd;
118 ENSURE((int)fd >= 0);
120 return fd;
129 SOCKET fd
146 if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) {
148 "fcntl(O_NONBLOCK) fails on fd #%d: %m", fd);
152 if (fcntl(fd, F_SETFL, FNDELAY) < 0) {
153 msyslog(LOG_ERR, "fcntl(FNDELAY) fails on fd #%d: %m",
154 fd);
158 if (fcntl(fd, F_SETFL, O_NDELAY) < 0) {
159 msyslog(LOG_ERR, "fcntl(O_NDELAY) fails on fd #%d: %m",
160 fd);
167 if (ioctl(fd, FIONBIO, &on) < 0) {
169 "ioctl(FIONBIO) fails on fd #%d: %m",
170 fd);
175 if (ioctl(fd, FIOSNBIO, &on) < 0) {
177 "ioctl(FIOSNBIO) fails on fd #%d: %m", fd);
206 read_refclock_packet(SOCKET fd, struct refclockio *rp, l_fp ts)
210 SOCKET fd,