Lines Matching refs:fd
115 ** file descriptor (fd) if possible. The 'fd' is needed to possibly
124 ** Iff (yes "iff") the 'fd' is "-1" in value then the mode change
131 ** fd -- to become the file descriptor value from 'fp'
145 # define SM_CONVERT_TIME(fp, fd, val, time) { \
146 if (((fd) = sm_io_getinfo(fp, SM_IO_WHAT_FD, NULL)) == -1) \
148 /* can't get an fd, likely internal 'fake' fp */ \
165 if ((fp)->f_timeoutstate == SM_TIME_NONBLOCK && (fd) != -1) \
168 ret = fcntl((fd), F_GETFL, 0); \
169 if (ret == -1 || fcntl((fd), F_SETFL, \
181 if ((fp)->f_timeoutstate == SM_TIME_BLOCK && (fd) != -1) \
184 ret = fcntl((fd), F_GETFL, 0); \
185 if (ret == -1 || fcntl((fd), F_SETFL, \
201 ** This #define uses a select() to wait for the 'fd' to become writable.
210 ** Note: if a valid 'fd' doesn't exist yet, don't use this (e.g. the
214 ** fd -- a file descriptor for doing select() with
224 #define SM_IO_WR_TIMEOUT(fp, fd, to) { \
247 if (FD_SETSIZE > 0 && (fd) >= FD_SETSIZE) \
253 FD_SET((fd), &sm_io_to_mask); \
255 FD_SET((fd), &sm_io_x_mask); \
260 sm_io_to_sel = select((fd) + 1, NULL, &sm_io_to_mask, \
285 ** If there is no 'fd' just error (we can't timeout). If the timeout
292 #define IS_IO_ERROR(fd, ret, to) \
293 ((fd) < 0 || \