/external/ltp/testcases/kernel/syscalls/memfd_create/ |
D | memfd_create01.c | 31 static void test_basic(int fd) in test_basic() argument 34 CHECK_MFD_HAS_SEALS(fd, 0); in test_basic() 35 CHECK_MFD_ADD_SEALS(fd, F_SEAL_SHRINK | F_SEAL_WRITE); in test_basic() 36 CHECK_MFD_HAS_SEALS(fd, F_SEAL_SHRINK | F_SEAL_WRITE); in test_basic() 39 CHECK_MFD_ADD_SEALS(fd, F_SEAL_SHRINK | F_SEAL_WRITE); in test_basic() 40 CHECK_MFD_HAS_SEALS(fd, F_SEAL_SHRINK | F_SEAL_WRITE); in test_basic() 43 CHECK_MFD_ADD_SEALS(fd, F_SEAL_GROW | F_SEAL_SEAL); in test_basic() 44 CHECK_MFD_HAS_SEALS(fd, F_SEAL_SHRINK | F_SEAL_GROW | in test_basic() 48 CHECK_MFD_FAIL_ADD_SEALS(fd, F_SEAL_GROW); in test_basic() 49 CHECK_MFD_FAIL_ADD_SEALS(fd, 0); in test_basic() [all …]
|
D | memfd_create_common.h | 34 #define CHECK_MMAP(addr, length, prot, flags, fd, offset) \ argument 36 (flags), (fd), (offset)) 38 #define CHECK_MMAP_FAIL(addr, length, prot, flags, fd, offset) \ argument 40 (flags), (fd), (offset)) 45 #define CHECK_MFD_HAS_SEALS(fd, seals) \ argument 46 check_mfd_has_seals(__FILE__, __LINE__, (fd), (seals)); 48 #define CHECK_MFD_ADD_SEALS(fd, seals) \ argument 49 ({int r = SAFE_FCNTL((fd), F_ADD_SEALS, (seals)); \ 51 (fd), (seals)); r; }) 53 #define CHECK_MFD_FAIL_ADD_SEALS(fd, seals) \ argument [all …]
|
D | memfd_create_common.c | 42 int check_fallocate(const char *filename, const int lineno, int fd, in check_fallocate() argument 47 r = fallocate(fd, mode, offset, len); in check_fallocate() 50 "fallocate(%d, %d, %ld, %ld) failed", fd, mode, in check_fallocate() 55 "fallocate(%d, %d, %ld, %ld) succeeded", fd, mode, in check_fallocate() 61 int check_fallocate_fail(const char *filename, const int lineno, int fd, in check_fallocate_fail() argument 66 r = fallocate(fd, mode, offset, len); in check_fallocate_fail() 70 fd, mode, offset, len); in check_fallocate_fail() 76 "fallocate(%d, %d, %ld, %ld) failed as expected", fd, in check_fallocate_fail() 82 void check_ftruncate(const char *filename, const int lineno, int fd, in check_ftruncate() argument 85 safe_ftruncate(filename, lineno, fd, length); in check_ftruncate() [all …]
|
/external/linux-kselftest/tools/testing/selftests/memfd/ |
D | memfd_test.c | 32 int r, fd; in mfd_assert_new() local 34 fd = sys_memfd_create(name, flags); in mfd_assert_new() 35 if (fd < 0) { in mfd_assert_new() 41 r = ftruncate(fd, sz); in mfd_assert_new() 47 return fd; in mfd_assert_new() 63 static unsigned int mfd_assert_get_seals(int fd) in mfd_assert_get_seals() argument 67 r = fcntl(fd, F_GET_SEALS); in mfd_assert_get_seals() 69 printf("GET_SEALS(%d) failed: %m\n", fd); in mfd_assert_get_seals() 76 static void mfd_assert_has_seals(int fd, unsigned int seals) in mfd_assert_has_seals() argument 80 s = mfd_assert_get_seals(fd); in mfd_assert_has_seals() [all …]
|
/external/pdfium/third_party/libtiff/ |
D | tif_print.c | 38 _TIFFprintAsciiBounded(FILE* fd, const char* cp, size_t max_chars); 69 _TIFFPrintField(FILE* fd, const TIFFField *fip, in _TIFFPrintField() argument 74 fprintf(fd, " %s: ", fip->field_name); in _TIFFPrintField() 78 fprintf(fd, "%u", ((uint8 *) raw_data)[j]); in _TIFFPrintField() 80 fprintf(fd, "0x%x", in _TIFFPrintField() 83 fprintf(fd, "%d", ((int8 *) raw_data)[j]); in _TIFFPrintField() 85 fprintf(fd, "%u", ((uint16 *) raw_data)[j]); in _TIFFPrintField() 87 fprintf(fd, "%d", ((int16 *) raw_data)[j]); in _TIFFPrintField() 89 fprintf(fd, "%lu", in _TIFFPrintField() 92 fprintf(fd, "%ld", (long)((int32 *) raw_data)[j]); in _TIFFPrintField() [all …]
|
/external/ltp/testcases/kernel/security/tomoyo/ |
D | tomoyo_new_file_test.c | 96 int fd; in stage_file_test() local 190 fd = open("/dev/null", O_RDONLY); in stage_file_test() 191 show_result(fd, 1); in stage_file_test() 192 if (fd != EOF) in stage_file_test() 193 close(fd); in stage_file_test() 195 fd = open("/dev/null", O_RDONLY); in stage_file_test() 196 show_result(fd, 0); in stage_file_test() 197 if (fd != EOF) in stage_file_test() 198 close(fd); in stage_file_test() 202 fd = open("/dev/null", O_RDONLY); in stage_file_test() [all …]
|
D | tomoyo_rewrite_test.c | 58 int fd; in stage_rewrite_test() local 77 fd = open(REWRITE_PATH, O_RDONLY); in stage_rewrite_test() 78 show_result(fd); in stage_rewrite_test() 79 close(fd); in stage_rewrite_test() 82 fd = open(REWRITE_PATH, O_WRONLY | O_APPEND); in stage_rewrite_test() 83 show_result(fd); in stage_rewrite_test() 84 close(fd); in stage_rewrite_test() 88 fd = open(REWRITE_PATH, O_WRONLY); in stage_rewrite_test() 89 show_result(fd); in stage_rewrite_test() 90 close(fd); in stage_rewrite_test() [all …]
|
/external/e2fsprogs/tests/progs/ |
D | random_exercise.c | 51 int fd; in get_random_fd() local 54 fd = ((int) random()) % MAXFDS; in get_random_fd() 55 if (fd > 2) in get_random_fd() 56 return fd; in get_random_fd() 60 unsigned int get_inode_num(int fd) in get_inode_num() argument 64 if (fstat(fd, &st) < 0) { in get_inode_num() 75 int fd; in create_random_file() local 84 fd = open(template, O_RDONLY, 0600); in create_random_file() 86 template, fd); in create_random_file() 89 fd = open(template, O_CREAT|O_RDWR, 0600); in create_random_file() [all …]
|
/external/clang/test/Analysis/ |
D | unix-api.c | 15 int fd; in open_1() local 16 fd = open(path, O_RDONLY); // no-warning in open_1() 17 if (fd > -1) in open_1() 18 close(fd); in open_1() 22 int fd; in open_2() local 24 …fd = open(path, O_RDONLY, mode, NULL); // expected-warning{{Call to 'open' with more than three ar… in open_2() 25 if (fd > -1) in open_2() 26 close(fd); in open_2() 30 int fd; in open_3() local 31 fd = open(path, O_RDONLY, NULL); // expected-warning{{Third argument to 'open' is not an integer}} in open_3() [all …]
|
/external/linux-kselftest/tools/testing/selftests/bpf/ |
D | test_maps.c | 32 int fd; in test_hashmap() local 34 fd = bpf_create_map(BPF_MAP_TYPE_HASH, sizeof(key), sizeof(value), in test_hashmap() 36 if (fd < 0) { in test_hashmap() 44 assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0); in test_hashmap() 48 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) == -1 && in test_hashmap() 53 assert(bpf_map_update_elem(fd, &key, &value, -1) == -1 && in test_hashmap() 57 assert(bpf_map_lookup_elem(fd, &key, &value) == 0 && value == 1234); in test_hashmap() 61 assert(bpf_map_lookup_elem(fd, &key, &value) == -1 && errno == ENOENT); in test_hashmap() 64 assert(bpf_map_update_elem(fd, &key, &value, BPF_EXIST) == -1 && in test_hashmap() 69 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) == 0); in test_hashmap() [all …]
|
/external/dhcpcd-6.8.2/ |
D | control.c | 74 control_queue_free(struct fd_list *fd) in control_queue_free() argument 78 while ((fdp = TAILQ_FIRST(&fd->queue))) { in control_queue_free() 79 TAILQ_REMOVE(&fd->queue, fdp, next); in control_queue_free() 81 control_queue_purge(fd->ctx, fdp->data); in control_queue_free() 84 while ((fdp = TAILQ_FIRST(&fd->free_queue))) { in control_queue_free() 85 TAILQ_REMOVE(&fd->free_queue, fdp, next); in control_queue_free() 91 control_delete(struct fd_list *fd) in control_delete() argument 94 TAILQ_REMOVE(&fd->ctx->control_fds, fd, next); in control_delete() 95 eloop_event_delete(fd->ctx->eloop, fd->fd, 0); in control_delete() 96 close(fd->fd); in control_delete() [all …]
|
/external/ltp/testcases/kernel/input/ |
D | input_helper.c | 40 int ret, fd = -1; in try_open_device() local 46 fd = open(path, O_RDONLY); in try_open_device() 48 if (fd < 0 && errno == ENOENT) in try_open_device() 51 if (fd < 0) { in try_open_device() 56 ret = ioctl(fd, EVIOCGNAME(sizeof(name)), name); in try_open_device() 65 return fd; in try_open_device() 66 close(fd); in try_open_device() 74 int fd; in open_device() local 78 fd = try_open_device(); in open_device() 79 if (fd > 0) in open_device() [all …]
|
/external/icu/icu4c/source/test/intltest/ |
D | dcfmapts.cpp | 616 FixedDecimal fd = df->getFixedDecimal(44, status); in TestFixedDecimal() local 618 ASSERT_EQUAL(44, fd.source); in TestFixedDecimal() 619 ASSERT_EQUAL(0, fd.visibleDecimalDigitCount); in TestFixedDecimal() 620 ASSERT_EQUAL(FALSE, fd.isNegative); in TestFixedDecimal() 622 fd = df->getFixedDecimal(-44, status); in TestFixedDecimal() 624 ASSERT_EQUAL(44, fd.source); in TestFixedDecimal() 625 ASSERT_EQUAL(0, fd.visibleDecimalDigitCount); in TestFixedDecimal() 626 ASSERT_EQUAL(TRUE, fd.isNegative); in TestFixedDecimal() 630 fd = df->getFixedDecimal(123.456, status); in TestFixedDecimal() 632 ASSERT_EQUAL(3, fd.visibleDecimalDigitCount); // v in TestFixedDecimal() [all …]
|
/external/ltp/testcases/kernel/syscalls/eventfd/ |
D | eventfd01.c | 86 static int clear_counter(int fd) in clear_counter() argument 91 ret = read(fd, &dummy, sizeof(dummy)); in clear_counter() 112 static int set_counter(int fd, uint64_t val) in set_counter() argument 116 ret = clear_counter(fd); in set_counter() 120 ret = write(fd, &val, sizeof(val)); in set_counter() 132 static void read_test(int fd, uint64_t required) in read_test() argument 137 ret = read(fd, &val, sizeof(val)); in read_test() 153 static void read_eagain_test(int fd) in read_eagain_test() argument 158 ret = clear_counter(fd); in read_eagain_test() 164 ret = read(fd, &val, sizeof(val)); in read_eagain_test() [all …]
|
/external/ltp/testcases/open_posix_testsuite/include/ |
D | mq_send.h | 14 int sync_pipe_create(int fd[]) in sync_pipe_create() argument 16 return pipe (fd); in sync_pipe_create() 19 int sync_pipe_close(int fd[]) in sync_pipe_close() argument 23 if (fd[0] != -1) in sync_pipe_close() 24 r = close (fd[0]); in sync_pipe_close() 25 if (fd[1] != -1) in sync_pipe_close() 26 r |= close (fd[1]); in sync_pipe_close() 30 int sync_pipe_wait(int fd[]) in sync_pipe_wait() argument 35 if (fd[1] != -1) { in sync_pipe_wait() 36 close (fd[1]); in sync_pipe_wait() [all …]
|
/external/toybox/toys/pending/ |
D | openvt.c | 46 int i, fd; local 49 fd = open(console_name[i], O_RDWR); 50 if (fd >= 0) { 52 if (!ioctl(fd, KDGKBTYPE, &arg)) return fd; 53 close(fd); 58 for (fd = 0; fd < 3; fd++) { 60 if (0 == ioctl(fd, KDGKBTYPE, &arg)) return fd; 66 int xvtnum(int fd) in xvtnum() argument 70 ret = ioctl(fd, VT_OPENQRY, (int *)&TT.vt_num); in xvtnum() 78 int fd, vt_fd, ret = 0; in openvt_main() local [all …]
|
/external/mesa3d/src/gallium/auxiliary/target-helpers/ |
D | drm_helper.h | 13 pipe_i915_create_screen(int fd) in pipe_i915_create_screen() argument 18 iws = i915_drm_winsys_create(fd); in pipe_i915_create_screen() 29 pipe_i915_create_screen(int fd) in pipe_i915_create_screen() argument 42 pipe_ilo_create_screen(int fd) in pipe_ilo_create_screen() argument 47 iws = intel_winsys_create_for_fd(fd); in pipe_ilo_create_screen() 58 pipe_ilo_create_screen(int fd) in pipe_ilo_create_screen() argument 70 pipe_nouveau_create_screen(int fd) in pipe_nouveau_create_screen() argument 74 screen = nouveau_drm_screen_create(fd); in pipe_nouveau_create_screen() 81 pipe_nouveau_create_screen(int fd) in pipe_nouveau_create_screen() argument 95 pipe_r300_create_screen(int fd) in pipe_r300_create_screen() argument [all …]
|
/external/ltp/testcases/kernel/fs/dmapi/ |
D | hole.c | 86 int fd; in main() local 88 fd = open(DUMMY_TMP, O_RDWR | O_CREAT | O_TRUNC, in main() 90 if (fd != -1) { in main() 92 if (write(fd, DUMMY_STRING, DUMMY_STRLEN) != in main() 102 rc = close(fd); in main() 122 int fd; in main() local 132 } else if ((fd = open(DUMMY_FILE, O_RDWR)) == -1) { in main() 134 } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { in main() 135 close(fd); in main() 138 if (fd == -1 || rc == -1) { in main() [all …]
|
/external/syslinux/efi/ |
D | fio.c | 145 EFI_FILE_HANDLE fd = NULL; in efi_open() local 153 &fd, in efi_open() 157 return fd; in efi_open() 171 size_t efi_xpread(EFI_FILE_HANDLE fd, void *buf, size_t count, off_t offset) in efi_xpread() argument 173 ASSERT(fd); in efi_xpread() 174 efi_errno = uefi_call_wrapper(fd->SetPosition, in efi_xpread() 176 fd, in efi_xpread() 179 efi_errno = uefi_call_wrapper(fd->Read, in efi_xpread() 181 fd, in efi_xpread() 189 size_t efi_xpwrite(EFI_FILE_HANDLE fd, void *buf, size_t count, off_t offset) in efi_xpwrite() argument [all …]
|
/external/libdrm/ |
D | xf86drm.h | 116 int fd; member 121 extern int drmIoctl(int fd, unsigned long request, void *arg); 123 extern drmHashEntry *drmGetEntry(int fd); 487 #define DRM_LIGHT_LOCK(fd,lock,context) \ argument 491 if (__ret) drmGetLock(fd,context,0); \ 496 #define DRM_LIGHT_LOCK_COUNT(fd,lock,context,count) \ argument 500 if (__ret) drmGetLock(fd,context,0); \ 504 #define DRM_LOCK(fd,lock,context,flags) \ argument 506 if (flags) drmGetLock(fd,context,flags); \ 507 else DRM_LIGHT_LOCK(fd,lock,context); \ [all …]
|
/external/ltp/testcases/kernel/syscalls/epoll_ctl/ |
D | epoll_ctl01.c | 39 static int fd[2]; variable 53 SAFE_PIPE(fd); in setup() 55 events[0].data.fd = fd[0]; in setup() 56 events[1].data.fd = fd[1]; in setup() 57 events[2].data.fd = fd[1]; in setup() 65 if (fd[0] > 0) in cleanup() 66 SAFE_CLOSE(fd[0]); in cleanup() 68 if (fd[1] > 0) in cleanup() 69 SAFE_CLOSE(fd[1]); in cleanup() 73 int fd, unsigned int events) in has_event() argument [all …]
|
/external/bison/lib/ |
D | pipe2.c | 40 pipe2 (int fd[2], int flags) in pipe2() 46 tmp[0] = fd[0]; in pipe2() 47 tmp[1] = fd[1]; in pipe2() 58 int result = pipe2 (fd, flags); in pipe2() 79 if (_pipe (fd, 4096, flags & ~O_NONBLOCK) < 0) in pipe2() 81 fd[0] = tmp[0]; in pipe2() 82 fd[1] = tmp[1]; in pipe2() 92 if (set_nonblocking_flag (fd[0], true) != 0 in pipe2() 93 || set_nonblocking_flag (fd[1], true) != 0) in pipe2() 107 if (pipe (fd) < 0) in pipe2() [all …]
|
/external/ltp/testcases/kernel/syscalls/fcntl/ |
D | fcntl01.c | 48 int fd[10], fd2[10]; in main() local 64 if ((fd[i] = in main() 67 fd2[i] = fd[i]; in main() 70 close(fd[2]); in main() 71 close(fd[3]); in main() 72 close(fd[4]); in main() 73 close(fd[5]); in main() 75 if ((fd[2] = fcntl(fd[1], F_DUPFD, 1)) == -1) in main() 78 if (fd[2] < fd2[2]) in main() 80 "got %d, expected greater than %d", fd[2], 5); in main() [all …]
|
/external/compiler-rt/lib/tsan/rtl/ |
D | tsan_fd.cc | 45 static bool bogusfd(int fd) { in bogusfd() argument 47 return fd < 0 || fd >= kTableSize; in bogusfd() 74 static FdDesc *fddesc(ThreadState *thr, uptr pc, int fd) { in fddesc() argument 75 CHECK_GE(fd, 0); in fddesc() 76 CHECK_LT(fd, kTableSize); in fddesc() 77 atomic_uintptr_t *pl1 = &fdctx.tab[fd / kTableSizeL2]; in fddesc() 90 return &((FdDesc*)l1)[fd % kTableSizeL2]; // NOLINT in fddesc() 94 static void init(ThreadState *thr, uptr pc, int fd, FdSync *s, in init() argument 96 FdDesc *d = fddesc(thr, pc, fd); in init() 143 bool FdLocation(uptr addr, int *fd, int *tid, u32 *stack) { in FdLocation() argument [all …]
|
/external/strace/tests-m32/ |
D | netlink_sock_diag.c | 52 test_nlmsg_type(const int fd) in test_nlmsg_type() argument 61 rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); in test_nlmsg_type() 65 fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); in test_nlmsg_type() 69 test_nlmsg_flags(const int fd) in test_nlmsg_flags() argument 78 rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); in test_nlmsg_flags() 82 fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); in test_nlmsg_flags() 86 test_odd_family_req(const int fd) in test_odd_family_req() argument 104 rc = sendto(fd, nlh, NLMSG_HDRLEN + sizeof(*family), MSG_DONTWAIT, in test_odd_family_req() 111 fd, NLMSG_HDRLEN + (unsigned int) sizeof(*family), in test_odd_family_req() 118 rc = sendto(fd, nlh, NLMSG_HDRLEN + sizeof(*family), MSG_DONTWAIT, in test_odd_family_req() [all …]
|