/external/ltp/testcases/cve/ |
cve-2017-2618.c | 46 int i, fd; local 50 fd = SAFE_OPEN(PATH_ATTRFS, O_WRONLY); 51 write(fd, "\n", 1); 52 SAFE_CLOSE(fd);
|
/external/ltp/testcases/kernel/fs/fs_di/ |
create_datafile.c | 44 off_t fd; local 59 if ((fd = creat(argv[2], 0755)) == -1) 63 if (write(fd, buf, BSIZE) == -1) 69 fsync(fd); 71 close(fd);
|
/external/ltp/testcases/kernel/fs/mongo/ |
mongo_read.c | 20 int fd, rd, i; local 40 fd = open(argv[i], O_RDONLY); 41 if (fd == -1) { 47 while ((rd = read(fd, buf, bufsize)) == bufsize) ; 52 close(fd);
|
/external/ltp/testcases/kernel/security/filecaps/ |
print_caps.c | 46 int fd; local 58 fd = open(FIFOFILE, O_WRONLY); 59 if (!fd) { 65 write(fd, buf, strlen(buf) + 1); 66 close(fd);
|
/external/ltp/testcases/kernel/security/integrity/ima/src/ |
ima_mmap.c | 30 int fd; local 38 fd = open(filename, O_CREAT | O_RDWR, S_IRWXU); 39 if (fd < 0) { 44 file = mmap(NULL, 1024, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); 49 close(fd);
|
/external/ltp/testcases/kernel/security/tomoyo/ |
tomoyo_rewrite_test.c | 58 int fd; local 77 fd = open(REWRITE_PATH, O_RDONLY); 78 show_result(fd); 79 close(fd); 82 fd = open(REWRITE_PATH, O_WRONLY | O_APPEND); 83 show_result(fd); 84 close(fd); 88 fd = open(REWRITE_PATH, O_WRONLY); 89 show_result(fd); 90 close(fd); [all...] |
/external/ltp/testcases/kernel/syscalls/creat/ |
creat03.c | 34 static int fd; variable 40 fd = creat(pfilname, 444); 42 if (fd == -1) { 47 SAFE_FSTAT(fd, &statbuf); 56 SAFE_CLOSE(fd); 66 if (fd > 0) 67 SAFE_CLOSE(fd);
|
/external/ltp/testcases/kernel/syscalls/dup3/ |
dup3_01.c | 81 int fd, coe; local 90 fd = ltp_syscall(__NR_dup3, 1, 4, 0); 91 if (fd == -1) { 94 coe = fcntl(fd, F_GETFD); 101 close(fd); 103 fd = ltp_syscall(__NR_dup3, 1, 4, O_CLOEXEC); 104 if (fd == -1) { 107 coe = fcntl(fd, F_GETFD); 115 close(fd);
|
/external/ltp/testcases/kernel/syscalls/fchdir/ |
fchdir03.c | 39 static int fd; variable 43 TEST(fchdir(fd)); 66 fd = SAFE_OPEN(DIRNAME, O_RDONLY);
|
/external/ltp/testcases/kernel/syscalls/fchown/ |
fchown01.c | 52 static int fd; variable 69 TEST(FCHOWN(cleanup, fd, geteuid(), getegid())); 75 "fchown(fd, geteuid(), getegid()) " 91 fd = SAFE_OPEN(cleanup, "tempfile", O_RDWR | O_CREAT, 0700); 96 if (fd > 0 && close(fd)) 97 tst_resm(TWARN | TERRNO, "Failed to close fd");
|
/external/ltp/testcases/kernel/syscalls/fcntl/ |
fcntl03.c | 48 static int fd; variable 52 TEST(fcntl(fd, F_GETFD, 0)); 67 fd = SAFE_OPEN(fname, O_RDWR | O_CREAT, 0700); 72 if (fd > 0) 73 SAFE_CLOSE(fd);
|
fcntl04.c | 46 static int fd; variable 51 TEST(fcntl(fd, F_GETFL, 0)); 73 fd = SAFE_OPEN(fname, O_RDWR | O_CREAT, 0700); 78 if (fd > 0) 79 SAFE_CLOSE(fd);
|
fcntl08.c | 53 static int fd; variable 67 TEST(fcntl(fd, F_SETFL, O_NDELAY | O_APPEND | O_NONBLOCK)); 91 fd = SAFE_OPEN(cleanup, "test_file", O_RDWR | O_CREAT, 0700); 96 if (close(fd) == -1)
|
/external/ltp/testcases/kernel/syscalls/ioctl/ |
ioctl04.c | 29 static int fd; variable 35 SAFE_IOCTL(fd, BLKROGET, &ro); 43 SAFE_IOCTL(fd, BLKROSET, &ro); 46 SAFE_IOCTL(fd, BLKROGET, &ro); 80 SAFE_IOCTL(fd, BLKROSET, &ro); 86 fd = SAFE_OPEN(tst_device->dev, O_RDONLY); 91 if (fd > 0) 92 SAFE_CLOSE(fd);
|
/external/ltp/testcases/kernel/syscalls/pselect/ |
pselect03.c | 31 static int fd; variable 39 FD_SET(fd, &readfds); 41 TEST(pselect(fd, &readfds, 0, 0, &tv, NULL)); 50 fd = SAFE_OPEN("pselect03_file", O_CREAT | O_RDWR, 0777); 55 if (fd > 0) 56 SAFE_CLOSE(fd);
|
/external/ltp/testcases/kernel/syscalls/read/ |
read01.c | 39 static int fd; variable 44 SAFE_LSEEK(fd, 0, SEEK_SET); 46 TEST(read(fd, buf, SIZE)); 57 fd = SAFE_OPEN("testfile", O_RDWR | O_CREAT, 0700); 58 SAFE_WRITE(1, fd, buf, SIZE); 63 if (fd > 0) 64 SAFE_CLOSE(fd);
|
/external/ltp/testcases/kernel/syscalls/umask/ |
umask01.c | 36 int fd; local 53 fd = SAFE_CREAT("testfile", 0777); 54 SAFE_CLOSE(fd);
|
/external/ltp/testcases/network/nfs/nfs_stress/ |
nfs04_create_file.c | 44 off_t fd; local 59 if ((fd = creat(argv[2], 0755)) == -1) 63 if (write(fd, buf, BSIZE) == -1) 69 fsync(fd); 71 close(fd);
|
/external/ltp/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_createdestroy_svc_destroy/ |
rpc_svc_destroy.c | 44 int fd = 0; local 48 svcr = svcfd_create(fd, 0, 0);
|
/external/ltp/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_createdestroy_svcfd_create/ |
rpc_svcfd_create.c | 44 int fd = 0; local 48 svcr = svcfd_create(fd, 0, 0);
|
/external/ltp/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_regunreg_xprt_register/ |
rpc_xprt_register.c | 48 int fd = 0; local 51 svcr = svcfd_create(fd, 1024, 1024);
|
/external/ltp/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_regunreg_xprt_unregister/ |
rpc_xprt_unregister.c | 52 int fd = 0; local 55 svcr = svcfd_create(fd, 1024, 1024);
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/fsync/ |
4-1.c | 35 int fd; local 39 fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR); 40 if (fd == -1) { 49 if (write(fd, data, total_size) != total_size) { 56 if (fsync(fd) == -1) { 61 close(fd);
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/ |
3-7.c | 27 int result, fd; local 37 fd = mkstemp(filename); 38 if (fd == -1) { 44 foo = mmap(NULL, page_size, PROT_READ, MAP_SHARED, fd, 0);
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/ |
1-1.c | 36 int fd; local 40 fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR); 41 if (fd == -1) { 49 if (write(fd, data, len) != len) { 54 pa = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); 65 close(fd);
|