Home
last modified time | relevance | path

Searched refs:fd1 (Results 1 – 25 of 93) sorted by relevance

1234

/external/ltp/testcases/kernel/syscalls/kcmp/
Dkcmp01.c36 static int fd1; variable
46 int *fd1; member
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 = SAFE_OPEN(TEST_FILE, O_CREAT | O_RDWR | O_TRUNC); in setup()
64 if (fd1 > 0) in cleanup()
65 SAFE_CLOSE(fd1); in cleanup()
[all …]
Dkcmp02.c38 static int fd1; variable
53 int *fd1; member
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); in setup()
76 if (fd1 > 0) in cleanup()
[all …]
/external/ltp/testcases/kernel/syscalls/eventfd2/
Deventfd2_03.c80 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 …]
/external/ltp/testcases/kernel/syscalls/dup2/
Ddup203.c61 int fd0, fd1, fd2, rval; in main() local
88 if ((fd1 = creat(filename1, 0666)) == -1) in main()
90 if (write(fd1, filename1, strlen(filename1)) == -1) in main()
98 if (close(fd1) == -1) in main()
100 if ((fd1 = open(filename1, O_RDONLY)) == -1) in main()
103 TEST(dup2(fd0, fd1)); in main()
108 if (fd1 != fd2) { in main()
122 close(fd1); in main()
154 if ((fd1 = TEST_RETURN) == -1) { in main()
157 if (fd1 != fd2) { in main()
[all …]
/external/ltp/testcases/kernel/syscalls/pwritev/
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); in setup()
103 SAFE_FTRUNCATE(fd1, getpagesize()); in setup()
110 if (fd1 > 0) in cleanup()
111 SAFE_CLOSE(fd1); in cleanup()
/external/ltp/testcases/kernel/syscalls/preadv/
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); in setup()
108 SAFE_FTRUNCATE(fd1, getpagesize()); in setup()
116 if (fd1 > 0) in cleanup()
117 SAFE_CLOSE(fd1); in cleanup()
/external/libdrm/
Dlibsync.h86 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()
/external/linux-kselftest/tools/testing/selftests/kcmp/
Dkcmp_test.c22 static long sys_kcmp(int pid1, int pid2, int type, int fd1, int fd2) in sys_kcmp() argument
24 return syscall(__NR_kcmp, pid1, pid2, type, fd1, fd2); in sys_kcmp()
31 int fd1, fd2; in main() local
34 fd1 = open(kpath, O_RDWR | O_CREAT | O_TRUNC, 0644); in main()
37 if (fd1 < 0) { in main()
63 sys_kcmp(pid1, pid2, KCMP_FILE, fd1, fd2), in main()
75 ret = sys_kcmp(pid1, pid2, KCMP_FILE, fd1, fd1); in main()
/external/strace/tests-m32/
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/
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/
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/kernel/io/direct_io/
Ddiotest1.c57 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()
Ddiotest_routines.c114 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()
/external/ltp/testcases/kernel/syscalls/flistxattr/
Dflistxattr02.c46 static int fd1; variable
54 {&fd1, 1, ERANGE},
83 fd1 = SAFE_OPEN("testfile", O_RDWR | O_CREAT, 0644); in setup()
85 SAFE_FSETXATTR(fd1, SECURITY_KEY, VALUE, VALUE_SIZE, XATTR_CREATE); in setup()
90 if (fd1 > 0) in cleanup()
91 SAFE_CLOSE(fd1); in cleanup()
/external/ltp/testcases/kernel/syscalls/fcntl/
Dfcntl32.c35 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()
/external/ltp/testcases/kernel/syscalls/flock/
Dflock06.c89 int fd1, fd2; in main() local
94 fd1 = open(filename, O_RDWR); in main()
95 if (fd1 == -1) in main()
99 TEST(flock(fd1, LOCK_EX | LOCK_NB)); in main()
117 TEST(flock(fd1, LOCK_UN)); in main()
128 close(fd1); in main()
Dflock05.c86 int fd, fd1, status; variable
111 fd1 = open(filename, O_RDWR); in main()
112 retval = flock(fd1, LOCK_SH | LOCK_NB); in main()
132 fd1 = open(filename, O_RDWR); in main()
133 retval = flock(fd1, LOCK_EX | LOCK_NB); in main()
157 close(fd1); in main()
Dflock04.c86 int fd, fd1, status; variable
109 fd1 = open(filename, O_RDONLY); in main()
110 retval = flock(fd1, LOCK_SH | LOCK_NB); in main()
130 fd1 = open(filename, O_RDWR); in main()
131 retval = flock(fd1, LOCK_EX | LOCK_NB); in main()
149 close(fd1); in main()
/external/python/cpython2/Python/
Ddup2.c20 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()
/external/valgrind/none/tests/
Dfdleak_cmsg.c38 int s, fd1, fd2; in server() local
41 fd1 = DO( open(filea, O_RDWR | O_CREAT | O_TRUNC, 0750) ); in server()
71 ((int *)CMSG_DATA(cmsg))[0] = fd1; in server()
86 int s, fd1 = -1, fd2 = -1, size, count = 0, ret; in client() local
135 fd1 = ((int *)CMSG_DATA(cmsg))[0]; in client()
142 if (fd1 != -1) write(fd1, "Yeah 1\n", 8); in client()
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/
D8-1.c38 int fd1, fd2; in main() local
41 fd1 = mkstemp(path); in main()
42 if (fd1 == -1) { in main()
57 if (fd2 == (fd1 + 1)) { in main()
/external/ltp/testcases/kernel/fs/dmapi/
Devent_am.c306 int fd1, fd2; in main() local
314 } else if ((fd1 = open(DummySubdir, O_DIRECTORY)) == -1) { in main()
317 close(fd1); in main()
320 if (fd1 == -1 || fd2 == -1 || fd1 == fd2) { in main()
330 DMLOG_PRINT(DMLVL_DEBUG, "close(%d) #1\n", fd1); in main()
331 rc = close(fd1); in main()
333 fd1, rc); in main()
531 int fd1, fd2; in main() local
537 if ((fd1 = in main()
542 close(fd1); in main()
[all …]
/external/ltp/testcases/kernel/syscalls/ioctl/
Dioctl01.c68 static int fd, fd1; variable
93 &fd1, TCGETA, &termio, ENOTTY},
172 fd1 = open("x", O_CREAT, 0777); in setup()
173 if (fd1 == -1) in setup()
179 close(fd1); in cleanup()
/external/ltp/testcases/kernel/syscalls/fchmod/
Dfchmod06.c46 static int fd1; variable
58 {"EPERM", &fd1, 0644, EPERM},
151 fd1 = SAFE_OPEN(cleanup, "tfile_1", O_RDWR | O_CREAT, 0666); in setup()
167 if (fd1 > 0 && close(fd1)) in cleanup()
/external/linux-kselftest/tools/testing/selftests/powerpc/context_switch/
Dcp_abort.c70 int fd1[2], fd2[2], pid; in test_cp_abort() local
84 FAIL_IF(pipe(fd1) || pipe(fd2)); in test_cp_abort()
91 FAIL_IF((write(fd1[WRITE_FD], &c, 1)) != 1); in test_cp_abort()
98 FAIL_IF((read(fd1[READ_FD], &c, 1)) != 1); in test_cp_abort()

1234