Lines Matching refs:fd
61 int fd;
63 fd = open(file, O_RDWR);
65 if (fd < 0)
67 amt = write(fd, string, len);
68 close(fd);
187 static int read_request(int fd, debugger_request_t* out_request) {
190 int status = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &len);
197 fcntl(fd, F_SETFL, O_NONBLOCK);
200 pollfds[0].fd = fd;
210 status = TEMP_FAILURE_RETRY(read(fd, &msg, sizeof(msg)));
264 static void handle_request(int fd) {
265 XLOG("handle_request(%d)\n", fd);
268 int status = read_request(fd, &request);
289 if (TEMP_FAILURE_RETRY(write(fd, "\0", 1)) != 1) {
295 close(fd);
296 fd = -1;
314 XLOG("stopped -- dumping to fd\n");
315 dump_backtrace(fd, request.pid, request.tid, &detach_failed,
363 write(fd, tombstone_path, strlen(tombstone_path));
365 close(fd);
366 fd = -1;
410 if (fd >= 0) {
411 close(fd);
458 int fd;
462 fd = accept(s, &addr, &alen);
463 if(fd < 0) {
468 fcntl(fd, F_SETFD, FD_CLOEXEC);
470 handle_request(fd);