Lines Matching refs:fd
116 int fd;
118 fd = open(name, O_RDONLY);
120 if (fd == -1) {
126 ret = read(fd, (char *) alpid, SIZEOFPID+1); /* +1 for '\n' */
127 (void) close(fd);
300 register int fd;
303 fd=creat(tempfile, (mode_t) 0444);
304 if(fd < 0){
312 if (write(fd, pid, SIZEOFPID+1) != (SIZEOFPID+1)) {
320 (void) close(fd);
339 * fd_mklock(fd) - lock the device indicated by fd is possible
342 * SUCCESS - this process now has the fd locked
343 * FAIL - this process was not able to lock the fd
347 fd_mklock(fd)
348 int fd;
352 if ( fstat(fd, &_st_buf) != 0 )
363 while ( lockf(fd, F_TLOCK, 0L) != 0 ) {
403 * fd_cklock(fd) - determine if the device indicated by fd is locked
406 * SUCCESS - the fd is not locked
407 * FAIL - the fd is locked by another process
411 fd_cklock(fd)
412 int fd;
414 if ( fstat(fd, &_st_buf) != 0 )
425 return( lockf(fd, F_TEST, 0L) );
437 fd_rmlock(fd)
438 int fd;
440 if ( fstat(fd, &_st_buf) == 0 ) {
447 (void) lockf(fd, F_ULOCK, 0L);