/third_party/ltp/testcases/kernel/syscalls/fstatfs/ |
H A D | fstatfs01.c | 21 static int file_fd; variable 28 {&file_fd, "fstatfs() on a file"}, 44 file_fd = SAFE_OPEN(TEMP_FILE, O_RDWR | O_CREAT, 0700); in setup() 52 if (file_fd > 0) in cleanup() 53 SAFE_CLOSE(file_fd); in cleanup()
|
/third_party/ltp/testcases/kernel/syscalls/fcntl/ |
H A D | fcntl17.c | 71 int file_fd; variable 131 if ((file_fd = mkstemp(template)) < 0) { in setup() 135 if (write(file_fd, buf, STRINGSIZE) < 0) { in setup() 172 close(file_fd); in cleanup() 190 if (fcntl(file_fd, F_SETLK, &lock1) < 0) { in do_child1() 201 fcntl(file_fd, F_SETLK, &unlock); in do_child1() 222 if (fcntl(file_fd, F_SETLK, &lock2) < 0) { in do_child2() 233 if (fcntl(file_fd, F_SETLKW, &lock4) < 0) { in do_child2() 260 if (fcntl(file_fd, F_SETLK, &lock3) < 0) { in do_child3() 271 if (fcntl(file_fd, F_SETLK in do_child3() [all...] |
H A D | fcntl07.c | 69 static int file_fd, pipe_fds[2], fifo_fd; variable 77 {&file_fd, "regular file"}, 170 file_fd = SAFE_OPEN(cleanup, "test_file", O_CREAT | O_RDWR, 0666); in setup() 178 if (file_fd > 0 && close(file_fd)) in cleanup() 179 tst_resm(TWARN | TERRNO, "close(file_fd) failed"); in cleanup()
|
/third_party/ltp/testcases/kernel/syscalls/ioctl/ |
H A D | ioctl_loop03.c | 24 static int dev_num, dev_fd, file_fd, attach_flag; variable 28 TEST(ioctl(dev_fd, LOOP_CHANGE_FD, file_fd)); in verify_ioctl_loop() 53 file_fd = SAFE_OPEN("test.img", O_RDWR); in setup() 64 if (file_fd > 0) in cleanup() 65 SAFE_CLOSE(file_fd); in cleanup()
|
H A D | ioctl_loop02.c | 29 static int file_fd, file_change_fd, file_fd_invalid; variable 55 file_fd = SAFE_OPEN("test.img", tc->mode); in verify_ioctl_loop() 58 SAFE_IOCTL(dev_fd, LOOP_SET_FD, file_fd); in verify_ioctl_loop() 60 loopconfig.fd = file_fd; in verify_ioctl_loop() 102 SAFE_CLOSE(file_fd); in verify_ioctl_loop() 146 if (file_fd > 0) in cleanup() 147 SAFE_CLOSE(file_fd); in cleanup()
|
H A D | ioctl_loop04.c | 30 static int dev_num, dev_fd, file_fd, attach_flag; variable 42 file_fd = SAFE_OPEN("test.img", O_RDWR); in verify_ioctl_loop() 64 SAFE_CLOSE(file_fd); in verify_ioctl_loop() 86 if (file_fd > 0) in cleanup() 87 SAFE_CLOSE(file_fd); in cleanup()
|
H A D | ioctl_loop07.c | 28 static int dev_num, dev_fd, file_fd, attach_flag, loop_configure_sup = 1; variable 129 file_fd = SAFE_OPEN("test.img", O_RDWR); in setup() 140 loopconfig.fd = file_fd; in setup() 147 if (file_fd > 0) in cleanup() 148 SAFE_CLOSE(file_fd); in cleanup()
|
H A D | ioctl_loop06.c | 23 static int dev_num, dev_fd, file_fd, attach_flag, loop_configure_sup = 1; variable 116 file_fd = SAFE_OPEN("test.img", O_RDWR); in setup() 124 loopconfig.fd = file_fd; in setup() 131 if (file_fd > 0) in cleanup() 132 SAFE_CLOSE(file_fd); in cleanup()
|
/third_party/ltp/testcases/kernel/syscalls/faccessat/ |
H A D | faccessat02.c | 25 static int dir_fd, file_fd; variable 32 {&file_fd, ENOTDIR}, 49 file_fd = SAFE_OPEN(FILEPATH, O_CREAT | O_RDWR, 0600); in setup() 57 if (file_fd > -1) in cleanup() 58 SAFE_CLOSE(file_fd); in cleanup()
|
H A D | faccessat01.c | 31 static int dir_fd, file_fd; variable 65 file_fd = SAFE_OPEN(FILEPATH, O_CREAT | O_RDWR, 0600); in setup() 73 if (file_fd > -1) in cleanup() 74 SAFE_CLOSE(file_fd); in cleanup()
|
/third_party/ltp/testcases/kernel/syscalls/statx/ |
H A D | statx02.c | 38 static int file_fd; variable 44 TEST(statx(file_fd, "", AT_EMPTY_PATH, 0, &buf)); in test_empty_path() 47 "statx(file_fd, \"\", AT_EMPTY_PATH, 0, &buf)"); in test_empty_path() 50 "statx(file_fd, \"\", AT_EMPTY_PATH, 0, &buff)"); in test_empty_path() 110 file_fd = SAFE_OPEN(TESTFILE, O_RDWR | O_CREAT, MODE); in setup() 111 SAFE_WRITE(SAFE_WRITE_ANY, file_fd, data_buf, sizeof(data_buf)); in setup() 118 if (file_fd > 0) in cleanup() 119 SAFE_CLOSE(file_fd); in cleanup()
|
H A D | statx12.c | 29 static int dir_fd = -1, file_fd = -1; variable 37 {TESTFILE, 0, &file_fd} 74 file_fd = SAFE_OPEN(TESTFILE, O_RDWR); in setup() 82 if (file_fd > -1) in cleanup() 83 SAFE_CLOSE(file_fd); in cleanup()
|
H A D | statx01.c | 50 static int file_fd = -1; variable 94 snprintf(line, PATH_MAX, "/proc/%d/fdinfo/%d", pid, file_fd); in test_mnt_id() 207 file_fd = SAFE_OPEN(TESTFILE, O_RDWR|O_CREAT, MODE); in setup() 208 SAFE_WRITE(SAFE_WRITE_ALL, file_fd, data_buff, sizeof(data_buff)); in setup() 215 if (file_fd > -1) in cleanup() 216 SAFE_CLOSE(file_fd); in cleanup()
|
H A D | statx03.c | 92 int file_fd; in setup() local 94 file_fd = SAFE_OPEN(TESTFILE, O_RDWR | O_CREAT, MODE); in setup() 95 SAFE_CLOSE(file_fd); in setup()
|
/third_party/ltp/testcases/kernel/syscalls/open_by_handle_at/ |
H A D | open_by_handle_at01.c | 24 static int dir_fd, fd_atcwd = AT_FDCWD, file_fd; variable 36 {&file_fd, &f_fhp, O_RDWR}, 37 {&file_fd, &f_fhp, O_RDONLY}, 38 {&file_fd, &f_fhp, O_WRONLY}, 47 SAFE_CLOSE(file_fd); in cleanup() 58 file_fd = SAFE_OPEN("foo_file", O_RDWR | O_CREAT, 0600); in setup() 64 TEST(name_to_handle_at(file_fd, "", f_fhp, &mount_id, AT_EMPTY_PATH)); in setup()
|
/third_party/ltp/testcases/kernel/syscalls/readlinkat/ |
H A D | readlinkat02.c | 32 static int file_fd, dir_fd; variable 43 {&file_fd, SYMLINK_FILE, BUFF_SIZE, ENOTDIR}, 65 file_fd = SAFE_OPEN(TEST_FILE, O_RDWR | O_CREAT, 0644); in setup() 72 if (file_fd > -1) in cleanup() 73 SAFE_CLOSE(file_fd); in cleanup()
|
H A D | readlinkat01.c | 32 static int file_fd, dir_fd, dir_fd2; variable 44 {&file_fd, &abspath}, 74 file_fd = SAFE_OPEN(TEST_FILE, O_CREAT, 0600); in setup() 82 if (file_fd > -1) in cleanup() 83 SAFE_CLOSE(file_fd); in cleanup()
|
/third_party/elfutils/src/ |
H A D | elfclassify.c | 49 static int file_fd = -1; variable 86 file_fd = open (current_path, O_RDONLY | (flag_only_regular_files in open_file() 88 if (file_fd < 0) in open_file() 96 if (fstat (file_fd, &st) != 0) in open_file() 113 if (file_fd >= 0) in close_file() 115 close (file_fd); in close_file() 116 file_fd = -1; in close_file() 137 elf = dwelf_elf_begin (file_fd); in open_elf() 139 elf = elf_begin (file_fd, ELF_C_READ, NULL); in open_elf() 807 else if (file_fd in process_current_path() [all...] |
/third_party/ltp/testcases/kernel/syscalls/name_to_handle_at/ |
H A D | name_to_handle_at01.c | 24 static int dir_fd, fd_atcwd = AT_FDCWD, file_fd; variable 46 {&file_fd, "", AT_EMPTY_PATH, O_RDONLY}, 66 SAFE_CLOSE(file_fd); in cleanup() 75 file_fd = SAFE_OPEN("foo_file", O_RDWR | O_CREAT, 0600); in setup()
|
/third_party/ltp/testcases/kernel/syscalls/readdir/ |
H A D | readdir21.c | 28 static unsigned int del_dir_fd, file_fd; variable 41 {&file_fd, &dirp, sizeof(struct old_linux_dirent), ENOTDIR, "not a directory"}, 55 file_fd = SAFE_OPEN(TEST_FILE, O_RDWR | O_CREAT, 0777); in setup()
|
/third_party/ltp/lib/ |
H A D | tst_device.c | 154 int dev_fd, file_fd; in tst_attach_device() local 163 file_fd = open(file, O_RDWR); in tst_attach_device() 164 if (file_fd < 0) { in tst_attach_device() 170 if (ioctl(dev_fd, LOOP_SET_FD, file_fd) < 0) { in tst_attach_device() 172 close(file_fd); in tst_attach_device() 187 close(file_fd); in tst_attach_device() 194 close(file_fd); in tst_attach_device()
|