Lines Matching defs:fd

314    int fd;
316 fd = open(name, flags);
317 if (fd == -1)
320 DEBUG(1, "opened %s %s fd %d\n", name, desc, fd);
321 return fd;
324 /* acquire a lock on the first byte of the given fd. If not successful,
329 void acquire_lock (int fd, int valgrind_pid)
336 if (fcntl(fd, F_SETLK, &fl) < 0) {
348 /* Here, we have the lock. It will be released when fd will be closed. */
360 /* read some characters from fd.
364 int read_buf (int fd, char* buf, const char* desc)
368 nrread = read(fd, buf, PBUFSIZ);
378 /* write size bytes from buf to fd.
384 Bool write_buf(int fd, char* buf, int size, const char* desc, Bool notify)
392 nrw = write (fd, buf+nrwritten, size - nrwritten);
556 /* Returns next char from fd. -1 if error, -2 if EOF.
557 NB: must always call it with the same fd */
559 readchar (int fd)
569 bufcnt = read_buf (fd, buf, "static buf readchar");
819 int from_pid = -1; /* fd to read from pid */
820 int to_pid = -1; /* fd to write to pid */
842 /* watch data written by gdb, watch POLLERR on both gdb fd */
843 pollfds[FROM_GDB].fd = from_gdb;
846 pollfds[TO_GDB].fd = to_gdb;
850 /* watch data written by pid, watch POLLERR on both pid fd */
851 pollfds[FROM_PID].fd = from_pid;
854 pollfds[TO_PID].fd = to_pid;
890 /* check for an fd being in error condition */
893 DEBUG(1, "connection %s fd %d POLLERR error condition\n",
894 ppConnectionKind(ck), pollfds[ck].fd);
899 DEBUG(1, "connection %s fd %d POLLHUP error condition\n",
900 ppConnectionKind(ck), pollfds[ck].fd);
905 DEBUG(1, "connection %s fd %d POLLNVAL error condition\n",
906 ppConnectionKind(ck), pollfds[ck].fd);
936 int from_pid = -1; /* fd to read from pid */
937 int to_pid = -1; /* fd to write to pid */
1052 int fd;
1056 fd = open (cmdline_file, O_RDONLY);
1057 if (fd == -1) {
1062 sz = read(fd, cmdline, 1000);
1073 close (fd);