Lines Matching defs:fd
287 int fd;
299 fd = socket(AF_UNIX, SOCK_STREAM, 0);
300 if (fd == -1)
304 flags = fcntl(fd, F_GETFL, 0);
306 (void) fcntl(fd, F_SETFL, flags | O_NONBLOCK);
313 if (connect(fd, (struct sockaddr *)&servaddr, sizeof (servaddr)) == -1)
335 if (ipadm_ndpd_write(fd, &msg, sizeof (msg)) < 0 ||
336 ipadm_ndpd_read(fd, &retval, sizeof (retval)) < 0)
338 (void) close(fd);
360 (void) close(fd);
365 * Attempt to read `buflen' worth of bytes from `fd' into the buffer pointed
369 ipadm_ndpd_read(int fd, void *buffer, size_t buflen)
378 pfd.fd = fd;
394 prbytes = read(fd, (caddr_t)buffer + nbytes, buflen - nbytes);
407 * Write `buflen' bytes from `buffer' to open file `fd'. Returns 0
411 ipadm_ndpd_write(int fd, const void *buffer, size_t buflen)
418 nbytes = write(fd, &buf[nwritten], buflen - nwritten);