Lines Matching refs:fd
25 * sync all outstanding file operations for file opened on fd
26 * if file==0 then fd used
27 * if fd<0 then file used
28 * if mode<0 then fd not created
40 cosync(Coshell_t* co, const char* file, int fd, int mode)
73 if (fd >= 0 && mode >= 0)
77 close(fd);
78 dup2(td, fd);
88 if (fd < 0)
90 if (!file || mode < 0 || (fd = open(file, O_RDONLY|O_cloexec)) < 0) return(-1);
102 if (!fcntl(fd, F_SETLK, &lock))
105 fcntl(fd, F_SETLK, &lock);
107 if (clean) close(fd);
120 fd = strlen(tmp) - 1;
121 tmp[fd] = (tmp[fd] == '*') ? '?' : '*';