/third_party/ltp/testcases/kernel/syscalls/kcmp/ |
D | kcmp01.c | 23 static int fd1; variable 33 int *fd1; member 37 {&pid1, &pid1, KCMP_FILE, &fd1, &fd1, 0}, 38 {&pid2, &pid2, KCMP_FILE, &fd1, &fd2, 0}, 39 {&pid1, &pid2, KCMP_FILE, &fd1, &fd1, 0}, 40 {&pid1, &pid2, KCMP_FILE, &fd1, &fd2, 0}, 41 {&pid1, &pid2, KCMP_FILE, &fd1, &fd3, 1}, 46 fd1 = SAFE_OPEN(TEST_FILE, O_CREAT | O_RDWR | O_TRUNC, 0666); in setup() 51 if (fd1 > 0) in cleanup() 52 SAFE_CLOSE(fd1); in cleanup() [all …]
|
D | kcmp02.c | 25 static int fd1; variable 40 int *fd1; member 44 {&pid1, &pid_unused, KCMP_FILE, &fd1, &fd2, ESRCH}, 45 {&pid1, &pid1, KCMP_TYPES + 1, &fd1, &fd2, EINVAL}, 46 {&pid1, &pid1, -1, &fd1, &fd2, EINVAL}, 47 {&pid1, &pid1, INT_MIN, &fd1, &fd2, EINVAL}, 48 {&pid1, &pid1, INT_MAX, &fd1, &fd2, EINVAL}, 49 {&pid1, &pid1, KCMP_FILE, &fd1, &fd_fake, EBADF} 57 fd1 = SAFE_OPEN(TEST_FILE, O_CREAT | O_RDWR | O_TRUNC, 0644); in setup() 63 if (fd1 > 0) in cleanup() [all …]
|
/third_party/musl/libc-test/src/functionalext/supplement/unistd/ |
D | linkat.c | 30 int fd1 = creat("/etc/test.txt", CREAT_MODE); in linkat_0100() local 32 if (fd1 < 0) { in linkat_0100() 33 EXPECT_MT("linkat_0100", fd1, 0); in linkat_0100() 36 close(fd1); in linkat_0100() 38 int result = linkat(fd1, "/etc/test.txt", fd2, "/etc/linkat.txt", AT_SYMLINK_FOLLOW); in linkat_0100() 51 int fd1 = creat("/etc/test.txt", CREAT_MODE); in linkat_0200() local 55 if (fd1 < 0) { in linkat_0200() 56 EXPECT_MT("linkat_0100", fd1, 0); in linkat_0200() 59 close(fd1); in linkat_0200() 61 int result = linkat(fd1, "/etc/test.txt", fd2, "/etc/linkat.txt", AT_SYMLINK_FOLLOW); in linkat_0200() [all …]
|
/third_party/ltp/testcases/kernel/syscalls/eventfd2/ |
D | eventfd2_03.c | 80 static void sem_player(int fd1, int fd2) in sem_player() argument 82 fprintf(stdout, "[%u] posting 1 on %d\n", getpid(), fd1); in sem_player() 83 xsem_post(fd1, 1); in sem_player() 88 fprintf(stdout, "[%u] posting 1 on %d\n", getpid(), fd1); in sem_player() 89 xsem_post(fd1, 1); in sem_player() 94 fprintf(stdout, "[%u] posting 5 on %d\n", getpid(), fd1); in sem_player() 95 xsem_post(fd1, 5); in sem_player() 112 int c, fd1, fd2, status; in main() local 127 if ((fd1 = eventfd2(0, EFD_SEMLIKE)) == -1 || in main() 133 sem_player(fd1, fd2); in main() [all …]
|
/third_party/ltp/testcases/kernel/syscalls/pwritev/ |
D | pwritev02.c | 38 static int fd1; variable 64 {&fd1, wr_iovec1, 1, 0, EINVAL}, 65 {&fd1, wr_iovec2, -1, 0, EINVAL}, 66 {&fd1, wr_iovec2, 1, -1, EINVAL}, 67 {&fd1, wr_iovec3, 1, 0, EFAULT}, 94 fd1 = SAFE_OPEN("file", O_RDWR | O_CREAT, 0644); in setup() 95 SAFE_FTRUNCATE(fd1, getpagesize()); in setup() 102 if (fd1 > 0) in cleanup() 103 SAFE_CLOSE(fd1); in cleanup()
|
/third_party/ltp/testcases/kernel/syscalls/pwritev2/ |
D | pwritev202.c | 30 static int fd1; variable 57 {&fd1, wr_iovec1, 1, 0, 0, EINVAL}, 58 {&fd1, wr_iovec2, -1, 0, 0, EINVAL}, 59 {&fd1, wr_iovec2, 1, 1, -1, EOPNOTSUPP}, 60 {&fd1, wr_iovec3, 1, 0, 0, EFAULT}, 88 fd1 = SAFE_OPEN("file1", O_RDWR | O_CREAT, 0644); in setup() 89 SAFE_FTRUNCATE(fd1, getpagesize()); in setup() 98 if (fd1 > 0) in cleanup() 99 SAFE_CLOSE(fd1); in cleanup()
|
/third_party/ltp/testcases/kernel/syscalls/preadv/ |
D | preadv02.c | 40 static int fd1; variable 67 {&fd1, rd_iovec1, 1, 0, EINVAL}, 68 {&fd1, rd_iovec2, -1, 0, EINVAL}, 69 {&fd1, rd_iovec2, 1, -1, EINVAL}, 70 {&fd1, rd_iovec3, 1, 0, EFAULT}, 99 fd1 = SAFE_OPEN("file1", O_RDWR | O_CREAT, 0644); in setup() 100 SAFE_FTRUNCATE(fd1, getpagesize()); in setup() 108 if (fd1 > 0) in cleanup() 109 SAFE_CLOSE(fd1); in cleanup()
|
/third_party/ltp/testcases/kernel/syscalls/preadv2/ |
D | preadv202.c | 32 static int fd1; variable 60 {&fd1, rd_iovec1, 1, 0, 0, EINVAL}, 61 {&fd1, rd_iovec2, -1, 0, 0, EINVAL}, 62 {&fd1, rd_iovec2, 1, 1, -1, EOPNOTSUPP}, 63 {&fd1, rd_iovec3, 1, 0, 0, EFAULT}, 92 fd1 = SAFE_OPEN("file1", O_RDWR | O_CREAT, 0644); in setup() 93 SAFE_FTRUNCATE(fd1, getpagesize()); in setup() 103 if (fd1 > 0) in cleanup() 104 SAFE_CLOSE(fd1); in cleanup()
|
/third_party/libdrm/ |
D | libsync.h | 86 static inline int sync_merge(const char *name, int fd1, int fd2) in sync_merge() argument 95 ret = ioctl(fd1, SYNC_IOC_MERGE, &data); in sync_merge() 121 static inline int sync_accumulate(const char *name, int *fd1, int fd2) in sync_accumulate() argument 127 if (*fd1 < 0) { in sync_accumulate() 128 *fd1 = dup(fd2); in sync_accumulate() 132 ret = sync_merge(name, *fd1, fd2); in sync_accumulate() 138 close(*fd1); in sync_accumulate() 139 *fd1 = ret; in sync_accumulate()
|
/third_party/ltp/testcases/kernel/syscalls/dup2/ |
D | dup203.c | 23 static int fd0 = -1, fd1 = -1; variable 46 fd1 = SAFE_CREAT(filename1, 0666); in run() 47 SAFE_WRITE(1, fd1, filename1, strlen(filename1)); in run() 54 rval = fd1; in run() 58 TEST(dup2(fd0, fd1)); in run() 64 if (fd1 != fd2) { in run() 84 SAFE_CLOSE(fd1); in run() 101 close(fd1); in cleanup()
|
/third_party/mesa3d/src/util/ |
D | libsync.h | 126 static inline int sync_merge(const char *name, int fd1, int fd2) 135 ret = ioctl(fd1, SYNC_IOC_MERGE, &data); 173 static inline int sync_accumulate(const char *name, int *fd1, int fd2) in sync_accumulate() argument 179 if (*fd1 < 0) { in sync_accumulate() 180 *fd1 = dup(fd2); in sync_accumulate() 184 ret = sync_merge(name, *fd1, fd2); in sync_accumulate() 190 close(*fd1); in sync_accumulate() 191 *fd1 = ret; in sync_accumulate()
|
/third_party/ltp/testcases/kernel/io/direct_io/ |
D | diotest1.c | 57 static int fd1, fd2; variable 71 if (fd1 > 0) in cleanup() 72 close(fd1); in cleanup() 129 fd1 = SAFE_OPEN(cleanup, infile, O_DIRECT | O_RDWR | O_CREAT, 0666); in main() 140 SAFE_WRITE(cleanup, 1, fd1, buf, bufsize); in main() 145 SAFE_LSEEK(cleanup, fd1, offset, SEEK_SET); in main() 147 while ((n = read(fd1, buf, bufsize)) > 0) { in main() 153 SAFE_LSEEK(cleanup, fd1, offset, SEEK_SET); in main()
|
D | diotest_routines.c | 114 int fd1, fd2; in filecmp() local 119 if ((fd1 = open(f1, O_RDONLY)) == -1) { in filecmp() 127 close(fd1); in filecmp() 132 while ((ret1 = read(fd1, buf1, BUFSIZ)) > 0) { in filecmp() 138 close(fd1); in filecmp() 151 close(fd1); in filecmp() 157 close(fd1); in filecmp()
|
/third_party/ltp/testcases/kernel/syscalls/flistxattr/ |
D | flistxattr02.c | 36 static int fd1; variable 44 {&fd1, 1, ERANGE}, 73 fd1 = SAFE_OPEN("testfile", O_RDWR | O_CREAT, 0644); in setup() 75 SAFE_FSETXATTR(fd1, SECURITY_KEY, VALUE, VALUE_SIZE, XATTR_CREATE); in setup() 80 if (fd1 > 0) in cleanup() 81 SAFE_CLOSE(fd1); in cleanup()
|
/third_party/ltp/testcases/kernel/syscalls/fcntl/ |
D | fcntl32.c | 35 static int fd1; variable 101 fd1 = SAFE_OPEN(cleanup, "file", test_cases[i].fd1_flag); in verify_fcntl() 104 TEST(fcntl(fd1, F_SETLEASE, F_WRLCK)); in verify_fcntl() 122 SAFE_CLOSE(cleanup, fd1); in verify_fcntl() 123 fd1 = 0; in verify_fcntl() 130 if (fd1 > 0 && close(fd1)) in cleanup()
|
/third_party/NuttX/fs/vfs/ |
D | fs_dupfd2.c | 80 int fs_dupfd2(int fd1, int fd2) in fs_dupfd2() argument 82 int dup2(int fd1, int fd2) in fs_dupfd2() 91 ret = fs_getfilep(fd1, &filep1); in fs_dupfd2() 114 if (fd1 == fd2) in fs_dupfd2() 116 return fd1; in fs_dupfd2()
|
D | fs_dup2.c | 52 int dup2(int fd1, int fd2) in dup2() argument 58 if ((unsigned int)fd1 >= CONFIG_NFILE_DESCRIPTORS) in dup2() 62 if ((unsigned int)fd1 < (unsigned int)(CONFIG_NFILE_DESCRIPTORS + CONFIG_NSOCKET_DESCRIPTORS)) in dup2() 83 return fs_dupfd2(fd1, fd2); in dup2()
|
/third_party/ltp/testcases/kernel/syscalls/lseek/ |
D | lseek07.c | 24 static int fd1, fd2; variable 33 {&fd1, TFILE1, 7, 7, 10, "abcdefgijk"}, 76 fd1 = SAFE_OPEN(TFILE1, O_RDWR | O_CREAT, 0644); in setup() 79 SAFE_WRITE(1, fd1, WR_STR1, sizeof(WR_STR1) - 1); in setup() 85 if (fd1 > 0) in cleanup() 86 SAFE_CLOSE(fd1); in cleanup()
|
/third_party/ltp/testcases/kernel/syscalls/flock/ |
D | flock06.c | 24 int fd1, fd2; in verify_flock() local 26 fd1 = SAFE_OPEN("testfile", O_RDWR); in verify_flock() 27 TEST(flock(fd1, LOCK_EX | LOCK_NB)); in verify_flock() 40 TEST(flock(fd1, LOCK_UN)); in verify_flock() 52 SAFE_CLOSE(fd1); in verify_flock()
|
D | flock03.c | 59 int fd1; in verify_flock() local 62 fd1 = SAFE_OPEN("testfile", O_RDWR); in verify_flock() 66 childfunc(fd1); in verify_flock() 68 TEST(flock(fd1, LOCK_EX | LOCK_NB)); in verify_flock() 81 SAFE_CLOSE(fd1); in verify_flock()
|
/third_party/python/Python/ |
D | dup2.c | 20 dup2(int fd1, int fd2) in dup2() argument 22 if (fd1 != fd2) { in dup2() 23 if (fcntl(fd1, F_GETFL) < 0) in dup2() 27 if (fcntl(fd1, F_DUPFD, fd2) < 0) in dup2()
|
/third_party/ltp/testcases/kernel/syscalls/fchmod/ |
D | fchmod06.c | 21 static int fd1; variable 30 {&fd1, 0644, EPERM}, 62 fd1 = SAFE_OPEN("tfile_1", O_RDWR | O_CREAT, 0666); in setup() 71 if (fd1 > 0) in cleanup() 72 SAFE_CLOSE(fd1); in cleanup()
|
/third_party/ltp/testcases/kernel/syscalls/fchown/ |
D | fchown04.c | 33 static int fd1; variable 41 {&fd1, EPERM}, 50 fd1 = SAFE_OPEN(TEST_FILE, O_RDWR | O_CREAT, MODE); in setup() 71 if (fd1 > 0) in cleanup() 72 SAFE_CLOSE(fd1); in cleanup()
|
/third_party/ltp/testcases/kernel/syscalls/execveat/ |
D | execveat01.c | 34 static int fd1, fd4; variable 43 {&fd1, TEST_APP, 0}, 74 fd1 = SAFE_OPEN(TESTDIR, O_DIRECTORY); in setup() 80 if (fd1 > 0) in cleanup() 81 SAFE_CLOSE(fd1); in cleanup()
|
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/ |
D | 8-1.c | 37 int fd1, fd2; in main() local 40 fd1 = mkstemp(path); in main() 41 if (fd1 == -1) { in main() 56 if (fd2 == (fd1 + 1)) { in main()
|