Lines Matching refs:fd
97 int fd;
99 fd = open(name, O_RDONLY);
101 if (fd == -1) {
109 ret = read(fd, (char *)alpid, SIZEOFPID + 1); /* +1 for '\n' */
110 (void) close(fd);
198 int fd;
201 fd = creat(tempfile, (mode_t)0444);
202 if (fd < 0) {
211 if (write(fd, pid, SIZEOFPID+1) != (SIZEOFPID+1)) {
220 (void) close(fd);
240 * fd_mklock(fd) - lock the device indicated by fd is possible
243 * SUCCESS - this process now has the fd locked
244 * FAIL - this process was not able to lock the fd
248 fd_mklock(int fd)
254 if (fstat64(fd, &_st_buf) != 0)
266 while (lockf(fd, F_TLOCK, 0L) != 0) {
288 fd_rmlock(int fd)
293 if (fstat64(fd, &_st_buf) == 0) {
301 (void) lockf(fd, F_ULOCK, 0L);