Searched defs:fd1 (Results 1 - 25 of 75) sorted by relevance

123

/external/python/cpython2/Python/
H A Ddup2.c8 * Check to make sure that fd1 is a valid open file descriptor.
10 * Duplicate fd1 onto fd2; checking to make sure fd2 is a valid fd.
20 dup2(int fd1, int fd2) argument
22 if (fd1 != fd2) {
23 if (fcntl(fd1, F_GETFL) < 0)
27 if (fcntl(fd1, F_DUPFD, fd2) < 0)
/external/python/cpython3/Python/
H A Ddup2.c8 * Check to make sure that fd1 is a valid open file descriptor.
10 * Duplicate fd1 onto fd2; checking to make sure fd2 is a valid fd.
20 dup2(int fd1, int fd2) argument
22 if (fd1 != fd2) {
23 if (fcntl(fd1, F_GETFL) < 0)
27 if (fcntl(fd1, F_DUPFD, fd2) < 0)
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/
H A D8-1.c38 int fd1, fd2; local
41 fd1 = mkstemp(path);
42 if (fd1 == -1) {
57 if (fd2 == (fd1 + 1)) {
/external/valgrind/memcheck/tests/linux/
H A Dsys-openat.c12 __attribute__((unused)) int fd1 = openat (dfd, "abc", O_RDONLY); local
/external/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/
H A Dmember_swap.pass.cpp28 std::FILE *fd1 = std::fopen(names.first.c_str(), "w"); local
33 std::fclose(fd1);
H A Dnonmember_swap.pass.cpp30 std::FILE *fd1 = std::fopen(names.first.c_str(), "w"); local
35 std::fclose(fd1);
/external/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/
H A Dmember_swap.pass.cpp28 std::FILE *fd1 = std::fopen(names.first.c_str(), "w"); local
33 std::fclose(fd1);
H A Dnonmember_swap.pass.cpp29 std::FILE *fd1 = std::fopen(names.first.c_str(), "w"); local
34 std::fclose(fd1);
/external/ltp/testcases/kernel/fs/fs_di/
H A Dfrag.c48 int bytes_read = 0, bytes_written = 0, fd1 = -1, fd2 = -1; local
96 fd1 = fileno(fp_frag1);
99 fsync(fd1);
/external/ltp/testcases/kernel/syscalls/dup2/
H A Ddup203.c62 int fd0, fd1, fd2, rval; local
89 if ((fd1 = creat(filename1, 0666)) == -1)
91 if (write(fd1, filename1, strlen(filename1)) == -1)
98 SAFE_CLOSE(cleanup, fd1);
99 if ((fd1 = open(filename1, O_RDONLY)) == -1)
102 TEST(dup2(fd0, fd1));
107 if (fd1 != fd2) {
121 close(fd1);
153 if ((fd1 = TEST_RETURN) == -1) {
156 if (fd1 !
[all...]
/external/ltp/testcases/kernel/syscalls/flock/
H A Dflock04.c87 int fd, fd1, status; variable
110 fd1 = open(filename, O_RDONLY);
111 retval = flock(fd1, LOCK_SH | LOCK_NB);
131 fd1 = open(filename, O_RDWR);
132 retval = flock(fd1, LOCK_EX | LOCK_NB);
150 close(fd1);
H A Dflock05.c86 int fd, fd1, status; variable
111 fd1 = open(filename, O_RDWR);
112 retval = flock(fd1, LOCK_SH | LOCK_NB);
132 fd1 = open(filename, O_RDWR);
133 retval = flock(fd1, LOCK_EX | LOCK_NB);
157 close(fd1);
H A Dflock06.c90 int fd1, fd2; local
95 fd1 = open(filename, O_RDWR);
96 if (fd1 == -1)
100 TEST(flock(fd1, LOCK_EX | LOCK_NB));
118 TEST(flock(fd1, LOCK_UN));
120 tst_resm(TFAIL | TTERRNO, "Failed to unlock fd1");
122 tst_resm(TPASS, "Unlocked fd1");
129 close(fd1);
/external/ltp/testcases/kernel/syscalls/kcmp/
H A Dkcmp.h47 int kcmp(int pid1, int pid2, int type, int fd1, int fd2) argument
49 return tst_syscall(__NR_kcmp, pid1, pid2, type, fd1, fd2);
H A Dkcmp01.c36 static int fd1; variable
46 int *fd1; member in struct:test_case
50 {&pid1, &pid1, KCMP_FILE, &fd1, &fd1, 0},
51 {&pid2, &pid2, KCMP_FILE, &fd1, &fd2, 0},
52 {&pid1, &pid2, KCMP_FILE, &fd1, &fd1, 0},
53 {&pid1, &pid2, KCMP_FILE, &fd1, &fd2, 0},
54 {&pid1, &pid2, KCMP_FILE, &fd1, &fd3, 1},
59 fd1
[all...]
H A Dkcmp02.c38 static int fd1; variable
53 int *fd1; member in struct:test_case
57 {&pid1, &pid_unused, KCMP_FILE, &fd1, &fd2, ESRCH},
58 {&pid1, &pid1, KCMP_TYPES + 1, &fd1, &fd2, EINVAL},
59 {&pid1, &pid1, -1, &fd1, &fd2, EINVAL},
60 {&pid1, &pid1, INT_MIN, &fd1, &fd2, EINVAL},
61 {&pid1, &pid1, INT_MAX, &fd1, &fd2, EINVAL},
62 {&pid1, &pid1, KCMP_FILE, &fd1, &fd_fake, EBADF}
70 fd1 = SAFE_OPEN(TEST_FILE, O_CREAT | O_RDWR | O_TRUNC);
76 if (fd1 >
[all...]
/external/valgrind/memcheck/tests/
H A Dfile_locking.c79 int fd1; local
89 if ((fd1 = open_lock_and_map("parent", filename)) >= 0)
122 close(fd1);
/external/webrtc/webrtc/base/
H A Dlinuxfdwalk_unittest.cc58 int fd1 = open("/dev/null", O_RDONLY); local
59 EXPECT_LE(0, fd1);
66 EXPECT_TRUE(fds.insert(fd1).second);
71 EXPECT_EQ(0, close(fd1));
/external/clang/test/CXX/special/class.inhctor/
H A Dp3.cpp15 D1 fd1() { return 1; } function
/external/libdrm/
H A Dlibsync.h86 static inline int sync_merge(const char *name, int fd1, int fd2) argument
95 ret = ioctl(fd1, SYNC_IOC_MERGE, &data);
104 /* accumulate fd2 into fd1. If *fd1 is not a valid fd then dup fd2,
105 * otherwise sync_merge() and close the old *fd1. This can be used
121 static inline int sync_accumulate(const char *name, int *fd1, int fd2) argument
127 if (*fd1 < 0) {
128 *fd1 = dup(fd2);
132 ret = sync_merge(name, *fd1, fd2);
134 /* leave *fd1 a
[all...]
/external/linux-kselftest/tools/testing/selftests/kcmp/
H A Dkcmp_test.c23 static long sys_kcmp(int pid1, int pid2, int type, unsigned long fd1, unsigned long fd2) argument
25 return syscall(__NR_kcmp, pid1, pid2, type, fd1, fd2);
37 int fd1, fd2; local
42 fd1 = open(kpath, O_RDWR | O_CREAT | O_TRUNC, 0644);
45 if (fd1 < 0) {
102 sys_kcmp(pid1, pid2, KCMP_FILE, fd1, fd2),
114 ret = sys_kcmp(pid1, pid2, KCMP_FILE, fd1, fd1);
/external/linux-kselftest/tools/testing/selftests/net/
H A Dreuseaddr_conflict.c89 int fd1, fd2; local
96 fd1 = open_port(0, 1);
97 if (fd1 >= 0)
100 fd1 = open_port(1, 1);
101 if (fd1 < 0)
107 close(fd1);
109 fd1 = open_port(0, 1);
110 if (fd1 >= 0)
/external/linux-kselftest/tools/testing/selftests/powerpc/context_switch/
H A Dcp_abort.c70 int fd1[2], fd2[2], pid; local
84 FAIL_IF(pipe(fd1) || pipe(fd2));
91 FAIL_IF((write(fd1[WRITE_FD], &c, 1)) != 1);
98 FAIL_IF((read(fd1[READ_FD], &c, 1)) != 1);
/external/ltp/testcases/kernel/syscalls/fcntl/
H A Dfcntl32.c35 static int fd1; variable
101 fd1 = SAFE_OPEN(cleanup, "file", test_cases[i].fd1_flag);
104 TEST(fcntl(fd1, F_SETLEASE, F_WRLCK));
122 SAFE_CLOSE(cleanup, fd1);
123 fd1 = 0;
130 if (fd1 > 0 && close(fd1))
/external/ltp/testcases/kernel/syscalls/flistxattr/
H A Dflistxattr02.c46 static int fd1; variable
54 {&fd1, 1, ERANGE},
83 fd1 = SAFE_OPEN("testfile", O_RDWR | O_CREAT, 0644);
85 SAFE_FSETXATTR(fd1, SECURITY_KEY, VALUE, VALUE_SIZE, XATTR_CREATE);
90 if (fd1 > 0)
91 SAFE_CLOSE(fd1);

Completed in 535 milliseconds

123