Lines Matching refs:fd
49 close_on_exec(int fd)
51 int flags = fcntl(fd, F_GETFD, 0);
52 if ((flags != -1) && (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) != -1))
84 int n, fd;
97 fd = open64(path, oflag);
98 if (fd != -1) {
99 if (close_on_exec(fd) == -1) {
101 (void) close(fd);
106 return (fd);
112 int fd, err;
114 fd = contract_open(ctid, "all", "ctl", O_WRONLY);
115 if (fd == -1)
118 err = ct_ctl_abandon(fd);
119 (void) close(fd);
127 int fd;
130 if ((fd = open("/proc/self/psinfo", O_RDONLY)) == -1)
132 if (read(fd, &ps, sizeof (ps)) != sizeof (ps)) {
133 (void) close(fd);
136 (void) close(fd);
184 int fd;
192 if ((fd = contract_open(my_ctid, "process", "status",
197 if ((e = ct_status_read(fd, CTD_ALL, &status)) != 0) {
198 (void) close(fd);
202 (void) close(fd);