Lines Matching defs:fd
51 int fd;
63 * Attempt to open the psinfo file, and return the fd if we can
66 if ((fd = open64(path, O_RDONLY)) >= 0) {
67 if (fstat64(fd, &st) != 0 || !S_ISREG(st.st_mode) ||
69 (void) close(fd);
70 fd = -1;
75 return (fd);
87 int fd;
91 * Attempt to open the core file, and return the fd if we can confirm
94 if ((fd = open64(arg, O_RDONLY)) >= 0) {
95 if (read(fd, &ehdr, sizeof (ehdr)) != sizeof (ehdr)) {
96 (void) close(fd);
97 fd = -1;
100 (void) close(fd);
101 fd = -1;
109 return (fd);
135 int fd;
150 (fd = open_psinfo(arg, perr)) != -1) {
151 if (read(fd, &psinfo,
153 (void) close(fd);
168 (void) close(fd);
175 (fd = open_core(arg, perr)) != -1) {
183 if ((Pr = Pfgrab_core(fd, path == NULL ?
199 if ((oflag & PR_ARG_PIDS) && (fd = open_psinfo(arg, perr)) != -1) {
200 if (read(fd, &psinfo, sizeof (psinfo_t)) == sizeof (psinfo_t)) {
201 (void) close(fd);
213 (void) close(fd);
216 if ((oflag & PR_ARG_CORES) && (fd = open_core(arg, perr)) != -1) {
218 if ((Pr = Pfgrab_core(fd, path == NULL ? dirname(core) : path,
439 int fd, i;
457 fd = open(pidstr, O_RDONLY);
458 if (fd < 0)
460 if (read(fd, &psinfo, sizeof (psinfo)) != sizeof (psinfo) ||
462 (void) close(fd);
465 (void) close(fd);
474 fd = open(pidstr, O_RDONLY);
475 if (fd < 0)
477 if (read(fd, &prheader, sizeof (prheader)) !=
479 (void) close(fd);
484 (void) close(fd);
489 if (pread(fd, buf, bufsz, sizeof (prheader)) != bufsz) {
491 (void) close(fd);
494 (void) close(fd);