/external/bison/lib/ |
H A D | dup-safer.c | 31 dup_safer (int fd) argument 33 return fcntl (fd, F_DUPFD, STDERR_FILENO + 1);
|
H A D | dup-safer-flag.c | 34 dup_safer_flag (int fd, int flag) argument 36 return fcntl (fd, (flag & O_CLOEXEC) ? F_DUPFD_CLOEXEC : F_DUPFD,
|
H A D | fd-safer.c | 37 fd_safer (int fd) argument 39 if (STDIN_FILENO <= fd && fd <= STDERR_FILENO) 41 int f = dup_safer (fd); 43 close (fd); 45 fd = f; 48 return fd;
|
H A D | pipe-safer.c | 31 pipe_safer (int fd[2]) argument 34 if (pipe (fd) == 0) 39 fd[i] = fd_safer (fd[i]); 40 if (fd[i] < 0) 43 close (fd[1 - i]);
|
/external/toybox/toys/other/ |
H A D | freeramdisk.c | 22 int fd; local 24 fd = xopen(toys.optargs[0], O_RDWR); 25 xioctl(fd, BLKFLSBUF, toys.optargs[0]); 26 if (CFG_TOYBOX_FREE) xclose(fd);
|
/external/valgrind/memcheck/tests/ |
H A D | mmaptest.c | 9 int fd; local 12 fd = open("dir", O_RDONLY); 13 mmap(NULL, 4711, PROT_READ, MAP_PRIVATE, fd, 0);
|
/external/android-clat/ |
H A D | mtu.c | 33 int fd; local 36 fd = socket(AF_INET, SOCK_STREAM, 0); 37 if(fd < 0) { 42 if(ioctl(fd, SIOCGIFMTU, &if_mtu) < 0) {
|
/external/e2fsprogs/lib/e2p/ |
H A D | getflags.c | 31 int getflags (int fd, unsigned long * flags) argument 36 if (fstat (fd, &buf) == -1) 58 if (!fstat(fd, &buf) && 61 r = ioctl(fd, EXT2_IOC_GETFLAGS, &f);
|
H A D | setversion.c | 27 int setversion (int fd, unsigned long version) argument 33 return ioctl (fd, EXT2_IOC_SETVERSION, &ver);
|
/external/libdrm/tests/ |
H A D | openclose.c | 32 int fd; local 34 fd = drm_open_any(); 35 close(fd);
|
/external/ltp/testcases/kernel/controllers/cpuctl_fj/ |
H A D | cpuctl_fj_simple_echo.c | 48 int fd = 1; local 57 if ((fd = open(argv[2], O_RDWR | O_SYNC)) == -1) 60 if (write(fd, argv[1], strlen(argv[1])) == -1) 63 if (fd != 1) 64 if (close(fd) == -1)
|
/external/ltp/testcases/kernel/syscalls/epoll_create1/ |
H A D | epoll_create1_01.c | 39 int fd, coe; local 41 fd = tst_syscall(__NR_epoll_create1, 0); 42 if (fd == -1) 45 coe = SAFE_FCNTL(fd, F_GETFD); 49 SAFE_CLOSE(fd); 51 fd = tst_syscall(__NR_epoll_create1, EPOLL_CLOEXEC); 52 if (fd == -1) 55 coe = SAFE_FCNTL(fd, F_GETFD); 59 SAFE_CLOSE(fd);
|
/external/ltp/testcases/kernel/syscalls/futex/ |
H A D | futex_common.h | 29 int fd; local 31 fd = shm_open("/LTP_futex_wait", O_RDWR | O_CREAT | O_EXCL, 0); 33 if (fd < 0) { 41 MAP_ANONYMOUS | MAP_SHARED, fd, 0); 43 SAFE_CLOSE(NULL, fd);
|
/external/ltp/testcases/kernel/syscalls/pipe/ |
H A D | pipe03.c | 27 static int fd[2]; variable 33 TEST(pipe(fd)); 39 TEST(write(fd[0], "A", 1)); 48 TEST(read(fd[1], buf, 1)); 57 SAFE_CLOSE(fd[0]); 58 SAFE_CLOSE(fd[1]);
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/fsync/ |
H A D | 5-1.c | 26 int fd; local 28 /* -1 is an invalid fd */ 30 fd = -1; 31 if (fsync(fd) == -1 && errno == EBADF) { 32 printf("Got EBADF when fd=-1\n");
|
H A D | 7-1.c | 33 int fd[2]; local 35 if (pipe(fd) == -1) { 41 if (fsync(fd[1]) == -1 && errno == EINVAL) { 44 close(fd[0]); 45 close(fd[1]); 50 close(fd[0]); 51 close(fd[1]);
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/ |
H A D | 19-1.c | 31 int fd = -1; local 33 pa = mmap(NULL, 1024, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); 43 printf("Test FAILED: Did not get EBADF when fd is invalid\n");
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/ |
H A D | 11-1.c | 26 int fd, flags; local 28 fd = shm_open(SHM_NAME, O_RDONLY | O_CREAT, S_IRUSR | S_IWUSR); 29 if (fd == -1) { 34 flags = fcntl(fd, F_GETFD);
|
H A D | 22-1.c | 26 int fd; local 29 fd = shm_open(SHM_NAME, O_RDONLY | O_CREAT, S_IRUSR | S_IWUSR); 30 if (fd == -1) { 35 fd = shm_open(SHM_NAME, O_RDONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); 37 if (fd == -1 && errno == EEXIST) { 41 } else if (fd != -1) {
|
H A D | 38-1.c | 25 int fd = 0, count = 0; local 27 while (fd != -1) { 28 fd = shm_open(SHM_NAME, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
|
H A D | 41-1.c | 25 int fd, result; local 35 fd = shm_open(SHM_NAME, O_RDONLY, S_IRUSR); 37 if (fd == -1 && errno == ENOENT) { 40 } else if (fd != -1) {
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/ |
H A D | 1-1.c | 26 int fd; local 28 fd = shm_open(SHM_NAME, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); 29 if (fd == -1) { 34 if (close(fd) != 0) { 45 fd = shm_open(SHM_NAME, O_RDONLY, 0); 47 if (fd == -1 && errno == ENOENT) { 50 } else if (fd == -1) {
|
H A D | 2-1.c | 26 int fd; local 28 fd = shm_open(SHM_NAME, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); 29 if (fd == -1) { 39 fd = shm_open(SHM_NAME, O_RDONLY, 0); 41 if (fd == -1 && errno == ENOENT) { 44 } else if (fd == -1) {
|
H A D | 5-1.c | 26 int fd; local 28 fd = shm_open(SHM_NAME, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); 29 if (fd == -1) { 39 fd = shm_open(SHM_NAME, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); 40 if (fd == -1 && errno == EEXIST) { 43 } else if (fd == -1) {
|
H A D | 6-1.c | 23 int fd; local 25 fd = shm_open(SHM_NAME, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); 26 if (fd == -1) {
|