Searched refs:fd1 (Results 1 - 25 of 94) sorted by relevance

1234

/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/kernel/syscalls/kcmp/
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...]
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);
/external/strace/tests/
H A Dredirect-fds.test39 fd1="$LOG.fd1"
51 rm -f "$LOG" "$fd0" "$fd1" "$fd2"
64 check_fd "$fd0" "$fd1" "$fd2"
65 check_fd '' "$fd1" "$fd2"
67 check_fd "$fd0" "$fd1" ''
69 check_fd '' "$fd1" ''
/external/strace/tests-m32/
H A Dredirect-fds.test39 fd1="$LOG.fd1"
51 rm -f "$LOG" "$fd0" "$fd1" "$fd2"
64 check_fd "$fd0" "$fd1" "$fd2"
65 check_fd '' "$fd1" "$fd2"
67 check_fd "$fd0" "$fd1" ''
69 check_fd '' "$fd1" ''
/external/strace/tests-mx32/
H A Dredirect-fds.test39 fd1="$LOG.fd1"
51 rm -f "$LOG" "$fd0" "$fd1" "$fd2"
64 check_fd "$fd0" "$fd1" "$fd2"
65 check_fd '' "$fd1" "$fd2"
67 check_fd "$fd0" "$fd1" ''
69 check_fd '' "$fd1" ''
/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/ltp/testcases/kernel/syscalls/pwritev/
H A Dpwritev02.c46 static int fd1; variable
72 {&fd1, wr_iovec1, 1, 0, EINVAL},
73 {&fd1, wr_iovec2, -1, 0, EINVAL},
74 {&fd1, wr_iovec2, 1, -1, EINVAL},
75 {&fd1, wr_iovec3, 1, 0, EFAULT},
102 fd1 = SAFE_OPEN("file", O_RDWR | O_CREAT, 0644);
103 SAFE_FTRUNCATE(fd1, getpagesize());
110 if (fd1 > 0)
111 SAFE_CLOSE(fd1);
/external/ltp/testcases/kernel/syscalls/eventfd2/
H A Deventfd2_03.c80 static void sem_player(int fd1, int fd2) argument
82 fprintf(stdout, "[%u] posting 1 on %d\n", getpid(), fd1);
83 xsem_post(fd1, 1);
88 fprintf(stdout, "[%u] posting 1 on %d\n", getpid(), fd1);
89 xsem_post(fd1, 1);
94 fprintf(stdout, "[%u] posting 5 on %d\n", getpid(), fd1);
95 xsem_post(fd1, 5);
112 int c, fd1, fd2, status; local
127 if ((fd1 = eventfd2(0, EFD_SEMLIKE)) == -1 ||
133 sem_player(fd1, fd
[all...]
/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/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/preadv/
H A Dpreadv02.c48 static int fd1; variable
75 {&fd1, rd_iovec1, 1, 0, EINVAL},
76 {&fd1, rd_iovec2, -1, 0, EINVAL},
77 {&fd1, rd_iovec2, 1, -1, EINVAL},
78 {&fd1, rd_iovec3, 1, 0, EFAULT},
107 fd1 = SAFE_OPEN("file1", O_RDWR | O_CREAT, 0644);
108 SAFE_FTRUNCATE(fd1, getpagesize());
116 if (fd1 > 0)
117 SAFE_CLOSE(fd1);
/external/linux-kselftest/tools/testing/selftests/sync/
H A Dsync.h36 int sync_merge(const char *name, int fd1, int fd2);
/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/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);
/external/ltp/testcases/kernel/syscalls/flock/
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 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 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/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/lseek/
H A Dlseek07.c36 static int fd1, fd2; variable
45 {&fd1, TFILE1, 7, 7, 10, "abcdefgijk"},
88 fd1 = SAFE_OPEN(TFILE1, O_RDWR | O_CREAT, 0644);
91 SAFE_WRITE(1, fd1, WR_STR1, sizeof(WR_STR1) - 1);
97 if (fd1 > 0)
98 SAFE_CLOSE(fd1);
/external/ltp/testcases/kernel/io/direct_io/
H A Ddiotest1.c57 static int fd1, fd2; variable
71 if (fd1 > 0)
72 close(fd1);
129 fd1 = SAFE_OPEN(cleanup, infile, O_DIRECT | O_RDWR | O_CREAT, 0666);
140 SAFE_WRITE(cleanup, 1, fd1, buf, bufsize);
145 SAFE_LSEEK(cleanup, fd1, offset, SEEK_SET);
147 while ((n = read(fd1, buf, bufsize)) > 0) {
153 SAFE_LSEEK(cleanup, fd1, offset, SEEK_SET);
/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/ioctl/
H A Dioctl01.c69 static int fd, fd1; variable
94 &fd1, TCGETA, &termio, ENOTTY},
171 fd1 = open("x", O_CREAT, 0777);
172 if (fd1 == -1)
178 close(fd1);

Completed in 1376 milliseconds

1234