Home
last modified time | relevance | path

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

12345

/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/dup2/
Ddup203.c62 int fd0, fd1, fd2, rval; in main() local
89 if ((fd1 = creat(filename1, 0666)) == -1) in main()
91 if (write(fd1, filename1, strlen(filename1)) == -1) in main()
98 SAFE_CLOSE(cleanup, fd1); in main()
99 if ((fd1 = open(filename1, O_RDONLY)) == -1) in main()
102 TEST(dup2(fd0, fd1)); in main()
107 if (fd1 != fd2) { in main()
121 close(fd1); in main()
153 if ((fd1 = TEST_RETURN) == -1) { in main()
156 if (fd1 != fd2) { in main()
[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/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/pwritev2/
Dpwritev202.c30 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()
/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/ltp/testcases/kernel/syscalls/preadv2/
Dpreadv202.c32 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()
/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/net/
Dreuseaddr_conflict.c89 int fd1, fd2; in main() local
96 fd1 = open_port(0, 1); in main()
97 if (fd1 >= 0) in main()
100 fd1 = open_port(1, 1); in main()
101 if (fd1 < 0) in main()
107 close(fd1); in main()
109 fd1 = open_port(0, 1); in main()
110 if (fd1 >= 0) in main()
/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/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/linux-kselftest/tools/testing/selftests/kcmp/
Dkcmp_test.c23 static long sys_kcmp(int pid1, int pid2, int type, unsigned long fd1, unsigned long fd2) in sys_kcmp() argument
25 return syscall(__NR_kcmp, pid1, pid2, type, fd1, fd2); in sys_kcmp()
37 int fd1, fd2; in main() local
42 fd1 = open(kpath, O_RDWR | O_CREAT | O_TRUNC, 0644); in main()
45 if (fd1 < 0) { in main()
102 sys_kcmp(pid1, pid2, KCMP_FILE, fd1, fd2), in main()
114 ret = sys_kcmp(pid1, pid2, KCMP_FILE, fd1, fd1); in main()
/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/lseek/
Dlseek07.c36 static int fd1, fd2; variable
45 {&fd1, TFILE1, 7, 7, 10, "abcdefgijk"},
88 fd1 = SAFE_OPEN(TFILE1, O_RDWR | O_CREAT, 0644); in setup()
91 SAFE_WRITE(1, fd1, WR_STR1, sizeof(WR_STR1) - 1); in setup()
97 if (fd1 > 0) in cleanup()
98 SAFE_CLOSE(fd1); in cleanup()
/external/ltp/testcases/kernel/syscalls/flock/
Dflock06.c24 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()
Dflock03.c59 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()
/external/ltp/testcases/kernel/syscalls/fchmod/
Dfchmod06.c34 static int fd1; variable
43 {&fd1, 0644, EPERM},
75 fd1 = SAFE_OPEN("tfile_1", O_RDWR | O_CREAT, 0666); in setup()
84 if (fd1 > 0) in cleanup()
85 SAFE_CLOSE(fd1); in cleanup()
/external/ltp/testcases/kernel/syscalls/execveat/
Dexecveat01.c34 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()
/external/python/cpython3/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/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()

12345