| /src/lib/libc/gen/ |
| closedir.c | 64 int fd; local 72 fd = dirp->dd_fd; 84 return(close(fd));
|
| daemon.c | 54 int fd; local 71 if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { 72 (void)dup2(fd, STDIN_FILENO); 73 (void)dup2(fd, STDOUT_FILENO); 74 (void)dup2(fd, STDERR_FILENO); 75 if (fd > STDERR_FILENO) 76 (void)close(fd);
|
| rewinddir.c | 58 int fd; local 65 fd = dirp->dd_fd; 67 dirp->dd_seek = lseek(fd, (off_t)0, SEEK_SET); 68 _initdir(dirp, fd, NULL);
|
| /src/lib/libc/stdio/ |
| mkostemp.c | 33 int fd; local 35 return GETTEMP(path, &fd, 0, 0, oflags) ? fd : -1;
|
| mkostemps.c | 33 int fd; local 35 return GETTEMP(path, &fd, 0, slen, oflags) ? fd : -1;
|
| mkstemp.c | 51 int fd; local 55 return GETTEMP(path, &fd, 0, 0, 0) ? fd : -1;
|
| mkstemps.c | 35 int fd; local 37 return GETTEMP(path, &fd, 0, slen, 0) ? fd : -1;
|
| /src/tests/compat/linux/ |
| h_inotify_init.c | 44 int fd; local 47 RS(fd = syscall(LINUX_SYS_inotify_init)); 48 REQUIRE(fcntl(fd, LINUX_F_GETFD) == 0); 49 REQUIRE((fcntl(fd, LINUX_F_GETFL) & LINUX_O_NONBLOCK) == 0); 50 RS(close(fd)); 53 RS(fd = syscall(LINUX_SYS_inotify_init1, LINUX_IN_NONBLOCK)); 54 REQUIRE(fcntl(fd, LINUX_F_GETFD) == 0); 55 REQUIRE((fcntl(fd, LINUX_F_GETFL) & LINUX_O_NONBLOCK) != 0); 56 RS(close(fd)); 59 RS(fd = syscall(LINUX_SYS_inotify_init1, LINUX_IN_CLOEXEC)) [all...] |
| /src/usr.sbin/sesd/srcs/ |
| inienc.c | 47 int fd; local 50 fd = open(*v, O_RDWR); 51 if (fd < 0) { 55 if (ioctl(fd, SESIOC_INIT, NULL) < 0) { 58 (void) close(fd);
|
| /src/lib/libutil/ |
| login.c | 55 int fd; local 61 if (tty > 0 && (fd = open(_PATH_UTMP, O_WRONLY|O_CREAT, 0644)) >= 0) { 62 (void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET); 63 (void)write(fd, ut, sizeof(struct utmp)); 64 (void)close(fd); 66 if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) >= 0) { 67 (void)write(fd, ut, sizeof(struct utmp)); 68 (void)close(fd);
|
| logout.c | 56 int fd, rval; local 61 if ((fd = open(_PATH_UTMP, O_RDWR, 0)) < 0) 64 while (read(fd, &ut, sizeof(ut)) == sizeof(ut)) { 71 (void)lseek(fd, -(off_t)sizeof(ut), SEEK_CUR); 72 (void)write(fd, &ut, sizeof(ut)); 75 (void)close(fd);
|
| logwtmp.c | 58 int fd; local 64 if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) < 0) 66 if (fstat(fd, &buf) == 0) { 71 if (write(fd, &ut, sizeof(struct utmp)) != sizeof(struct utmp)) 72 (void) ftruncate(fd, buf.st_size); 74 (void) close(fd);
|
| /src/regress/sys/kern/kqueue/vnode/ |
| write.c | 45 int fd, n; local 51 fd = open(argv[1], O_WRONLY); 52 if (fd < 0) 55 lseek(fd, 0, SEEK_SET); 58 n = write(fd, buffer, sizeof(buffer)); 64 close(fd);
|
| /src/sbin/nvmectl/ |
| reset.c | 63 int ch, fd; local 76 open_dev(argv[optind], &fd, 1, 1); 77 if (ioctl(fd, NVME_RESET_CONTROLLER) < 0)
|
| /src/share/examples/pud/intro/ |
| doioctl.c | 16 int fd, i; local 21 fd = open(argv[1], O_RDWR); 22 if (fd == -1) 28 if (ioctl(fd, INTROTOGGLE, &i) == -1) 31 if (ioctl(fd, INTROTOGGLE_R, &i) == -1)
|
| /src/sys/arch/alpha/stand/common/ |
| bootxx.c | 89 int fd; local 101 fd = open("boot", 0); 102 if (fd == -1 || (fstat(fd, &sb) == -1)) { 112 if (read(fd, (void*)SECONDARY_LOAD_ADDRESS, sb.st_size) != sb.st_size) {
|
| /src/sys/arch/evbmips/stand/sbmips/common/ |
| bootxx.c | 85 int fd; local 98 fd = open("boot", 0); 99 if (fd == -1 || (fstat(fd, &sb) == -1)) { 109 if (read(fd, (void*)SECONDARY_LOAD_ADDRESS, sb.st_size) != sb.st_size) {
|
| /src/sys/arch/sbmips/stand/common/ |
| bootxx.c | 85 int fd; local 98 fd = open("boot", 0); 99 if (fd == -1 || (fstat(fd, &sb) == -1)) { 109 if (read(fd, (void*)SECONDARY_LOAD_ADDRESS, sb.st_size) != sb.st_size) {
|
| /src/sys/arch/x68k/usr.bin/loadkmap/ |
| loadkmap.c | 39 int fd; local 41 if ((fd = open(file, 0)) >= 0) { 42 if (read(fd, buf, sizeof(buf)) == sizeof(buf)) { 51 close (fd);
|
| /src/sys/dev/microcode/ral/ |
| build.c | 34 int fd; local 38 fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644); 39 if (fd == -1) 42 rlen = write(fd, ucode, size); 48 close(fd);
|
| /src/sys/dev/microcode/rum/ |
| build.c | 34 int fd; local 38 fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644); 39 if (fd == -1) 42 rlen = write(fd, ucode, size); 48 close(fd);
|
| /src/sys/dev/microcode/run/ |
| build.c | 34 int fd; local 38 fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644); 39 if (fd == -1) 42 rlen = write(fd, ucode, size); 48 close(fd);
|
| /src/sys/dev/microcode/zyd/ |
| build.c | 33 int fd; local 37 fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644); 38 if (fd == -1) 41 rlen = write(fd, ucode, size); 47 close(fd);
|
| /src/sys/lib/libsa/ |
| getfile.c | 40 int fd; local 48 } while ((fd = open(buf, mode)) < 0); 50 return fd;
|
| stat.c | 39 int fd, rv; local 41 fd = open(str, 0); 42 if (fd < 0) 44 rv = fstat(fd, sb); 45 (void)close(fd);
|