/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/ |
7-1.c | 46 int fd; local 50 fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR); 51 if (fd == -1) { 58 if (write(fd, data, size) != size) { 63 pa = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); 80 pa = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); 90 close(fd); 96 close(fd);
|
7-2.c | 46 int fd; local 50 fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR); 51 if (fd == -1) { 58 if (write(fd, data, size) != size) { 63 pa = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); 80 pa = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); 92 close(fd);
|
7-3.c | 46 int fd; local 53 fd = shm_open(tmpfname, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); 54 if (fd == -1) { 60 if (ftruncate(fd, size) == -1) { 65 pa = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); 79 pa = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 104 close(fd);
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/ |
2-1.c | 32 int rc, fd, map_size; local 36 fd = open("/dev/zero", O_RDWR); 37 if (fd == -1) { 44 map_addr = mmap(NULL, map_size, PROT_NONE, MAP_PRIVATE, fd, 0); 49 close(fd); 53 close(fd); 60 close(fd);
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/ |
1-1.c | 35 int fd; local 39 fd = shm_open(SHM_NAME, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); 40 if (fd == -1) { 45 if (ftruncate(fd, BUF_SIZE) != 0) { 51 buf = mmap(NULL, BUF_SIZE, PROT_WRITE, MAP_SHARED, fd, 0); 60 fd = shm_open(SHM_NAME, O_RDONLY, S_IRUSR | S_IWUSR); 61 if (fd == -1) { 67 buf = mmap(NULL, BUF_SIZE, PROT_READ, MAP_SHARED, fd, 0);
|
14-2.c | 35 int fd; local 39 fd = shm_open(SHM_NAME, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); 40 if (fd == -1) { 45 if (ftruncate(fd, BUF_SIZE) != 0) { 50 buf = mmap(NULL, BUF_SIZE, PROT_WRITE, MAP_SHARED, fd, 0); 58 fd = shm_open(SHM_NAME, O_RDWR, S_IRUSR | S_IWUSR); 59 if (fd == -1) { 64 buf = mmap(NULL, BUF_SIZE, PROT_READ, MAP_SHARED, fd, 0);
|
20-3.c | 29 int fd, result; local 40 fd = shm_open(SHM_NAME, O_RDWR | O_CREAT, 0); 41 if (fd == -1) { 46 if (ftruncate(fd, BUF_SIZE) != 0) { 52 ptr = mmap(NULL, BUF_SIZE, PROT_NONE, MAP_SHARED, fd, 0);
|
26-1.c | 32 int fd; local 36 fd = shm_open(SHM_NAME, O_RDWR | O_CREAT, CREATION_MODE); 37 if (fd == -1) { 42 if (fstat(fd, &stat_buf) != 0) { 49 fd = shm_open(SHM_NAME, O_RDWR | O_TRUNC, OPEN_MODE); 50 if (fd == -1) { 56 if (fstat(fd, &stat_buf) != 0) {
|
28-1.c | 35 int fd; local 39 fd = shm_open(SHM_NAME, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); 40 if (fd == -1) { 45 if (ftruncate(fd, BUF_SIZE) != 0) { 51 buf = mmap(NULL, BUF_SIZE, PROT_WRITE, MAP_SHARED, fd, 0); 66 if (close(fd) != 0) { 74 fd = shm_open(SHM_NAME, O_RDONLY, S_IRUSR | S_IWUSR); 75 if (fd == -1 && errno == ENOENT) { 78 } else if (fd == -1) { 84 buf = mmap(NULL, BUF_SIZE, PROT_READ, MAP_SHARED, fd, 0) [all...] |
28-2.c | 35 int fd; local 39 fd = shm_open(SHM_NAME, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); 40 if (fd == -1) { 45 if (ftruncate(fd, BUF_SIZE) != 0) { 51 buf = mmap(NULL, BUF_SIZE, PROT_WRITE | PROT_READ, MAP_SHARED, fd, 0); 60 if (close(fd) != 0) {
|
28-3.c | 36 int fd; local 40 fd = shm_open(SHM_NAME, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); 41 if (fd == -1) { 46 if (ftruncate(fd, BUF_SIZE) != 0) { 52 buf = mmap(NULL, BUF_SIZE, PROT_WRITE, MAP_SHARED, fd, 0); 74 buf = mmap(NULL, BUF_SIZE, PROT_READ, MAP_SHARED, fd, 0);
|
39-2.c | 32 int fd, i, path_max; local 46 fd = shm_open(shm_name, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); 48 if (fd == -1 && errno == ENAMETOOLONG) { 51 } else if (fd != -1) {
|
/external/mesa3d/src/util/ |
rand_xor.c | 61 int fd = open("/dev/urandom", O_RDONLY); local 62 if (fd < 0) 66 if (read(fd, seed, seed_size) != seed_size) { 67 close(fd); 71 close(fd);
|
/external/nanopb-c/examples/network_server/ |
common.c | 13 int fd = (intptr_t)stream->state; local 14 return send(fd, buf, count, 0) == count; 19 int fd = (intptr_t)stream->state; local 22 result = recv(fd, buf, count, MSG_WAITALL); 30 pb_ostream_t pb_ostream_from_socket(int fd) 32 pb_ostream_t stream = {&write_callback, (void*)(intptr_t)fd, SIZE_MAX, 0}; 36 pb_istream_t pb_istream_from_socket(int fd) 38 pb_istream_t stream = {&read_callback, (void*)(intptr_t)fd, SIZE_MAX};
|
/external/openssh/regress/unittests/sshkey/ |
common.c | 42 int fd; local 46 ASSERT_INT_NE(fd = open(test_data_file(name), O_RDONLY), -1); 47 ASSERT_INT_EQ(sshkey_load_file(fd, ret), 0); 48 close(fd);
|
/external/pdfium/third_party/libtiff/ |
tif_close.c | 126 thandle_t fd = tif->tif_clientdata; local 129 (void) (*closeproc)(fd);
|
/external/selinux/libselinux/src/ |
check_context.c | 15 int fd, ret; local 23 fd = open(path, O_RDWR | O_CLOEXEC); 24 if (fd < 0) 27 ret = write(fd, con, strlen(con) + 1); 28 close(fd);
|
checkreqprot.c | 14 int fd, ret, checkreqprot = 0; local 24 fd = open(path, O_RDONLY | O_CLOEXEC); 25 if (fd < 0) 29 ret = read(fd, buf, sizeof(buf) - 1); 30 close(fd);
|
deny_unknown.c | 14 int fd, ret, deny_unknown = 0; local 24 fd = open(path, O_RDONLY | O_CLOEXEC); 25 if (fd < 0) 29 ret = read(fd, buf, sizeof(buf) - 1); 30 close(fd);
|
enabled.c | 33 int fd, ret, enabled = 0; local 39 fd = open(path, O_RDONLY | O_CLOEXEC); 40 if (fd < 0) 46 ret = read(fd, buf, sizeof buf - 1); 48 close(fd);
|
getenforce.c | 14 int fd, ret, enforce = 0; local 24 fd = open(path, O_RDONLY | O_CLOEXEC); 25 if (fd < 0) 29 ret = read(fd, buf, sizeof buf - 1); 30 close(fd);
|
policyvers.c | 15 int fd, ret; local 26 fd = open(path, O_RDONLY | O_CLOEXEC); 27 if (fd < 0) { 34 ret = read(fd, buf, sizeof buf - 1); 35 close(fd);
|
reject_unknown.c | 14 int fd, ret, reject_unknown = 0; local 24 fd = open(path, O_RDONLY | O_CLOEXEC); 25 if (fd < 0) 29 ret = read(fd, buf, sizeof(buf) - 1); 30 close(fd);
|
/external/strace/tests/ |
ioctl_nbd.c | 49 int fd = open(null_path, O_RDONLY); local 50 if (fd < 0) 53 skip_if_unavailable("/proc/self/fd/"); 65 ioctl(-1, NBD_SET_SOCK, fd); 66 printf("ioctl(-1, NBD_SET_SOCK, %d</dev/null>)" RVAL_EBADF, fd);
|
ioctl_uffdio.c | 54 int fd = syscall(__NR_userfaultfd, O_NONBLOCK); local 57 if (fd < 0) 63 /* With a bad fd */ 69 rc = ioctl(fd, UFFDIO_API, NULL); 71 fd, rc, errno2name()); 75 rc = ioctl(fd, UFFDIO_API, api_struct); 76 printf("ioctl(%d, UFFDIO_API, {api=0xaa, features=0", fd); 114 rc = ioctl(fd, UFFDIO_REGISTER, NULL); 116 fd, rc, errno2name()); 121 rc = ioctl(fd, UFFDIO_REGISTER, register_struct) [all...] |