Lines Matching refs:fd
23 intptr_t fd = (intptr_t)_fd;
33 if (fcntl(fd, F_SETLK, &flock) == 0) {
43 if (fcntl(fd, F_SETLKW, &flock) == -1) {
51 if (fcntl(fd, F_SETLK, &flock) == -1) {
64 intptr_t fd = open("/etc/passwd", O_RDONLY);
65 if (fd < 0) {
78 if (fcntl(fd, F_SETLK, &flock) == 0) {
87 if (fcntl(fd, F_SETLK, &flock) == -1) {
93 close(fd);
95 fd = open("/etc/passwd", O_RDWR);
96 if (fd < 0) {
105 if (fcntl(fd, F_SETLK, &flock) == -1) {
113 if (fcntl(fd, F_SETLK, &flock) == -1) {
121 if (fcntl(fd, F_SETLK, &flock) == 0) {
130 if (fcntl(fd, F_SETLK, &flock) == -1) {
139 if (fcntl(fd, F_SETLK, &flock) == -1) {
145 thread_id thread = spawn_thread(try_to_lock, "try", B_NORMAL_PRIORITY, (void *)fd);
159 if (fcntl(fd, F_SETLK, &flock) == -1) {
168 close(fd);