/external/ltp/testcases/kernel/syscalls/memfd_create/ |
D | memfd_create01.c | 22 static void test_basic(int fd) in test_basic() argument 25 CHECK_MFD_HAS_SEALS(fd, 0); in test_basic() 26 CHECK_MFD_ADD_SEALS(fd, F_SEAL_SHRINK | F_SEAL_WRITE); in test_basic() 27 CHECK_MFD_HAS_SEALS(fd, F_SEAL_SHRINK | F_SEAL_WRITE); in test_basic() 30 CHECK_MFD_ADD_SEALS(fd, F_SEAL_SHRINK | F_SEAL_WRITE); in test_basic() 31 CHECK_MFD_HAS_SEALS(fd, F_SEAL_SHRINK | F_SEAL_WRITE); in test_basic() 34 CHECK_MFD_ADD_SEALS(fd, F_SEAL_GROW | F_SEAL_SEAL); in test_basic() 35 CHECK_MFD_HAS_SEALS(fd, F_SEAL_SHRINK | F_SEAL_GROW | in test_basic() 39 CHECK_MFD_FAIL_ADD_SEALS(fd, F_SEAL_GROW); in test_basic() 40 CHECK_MFD_FAIL_ADD_SEALS(fd, 0); in test_basic() [all …]
|
D | memfd_create_common.h | 41 #define CHECK_MMAP(addr, length, prot, flags, fd, offset) \ argument 43 (flags), (fd), (offset)) 45 #define CHECK_MMAP_FAIL(addr, length, prot, flags, fd, offset) \ argument 47 (flags), (fd), (offset)) 52 #define CHECK_MFD_HAS_SEALS(fd, seals) \ argument 53 check_mfd_has_seals(__FILE__, __LINE__, (fd), (seals)); 55 #define CHECK_MFD_ADD_SEALS(fd, seals) \ argument 56 ({int r = SAFE_FCNTL((fd), F_ADD_SEALS, (seals)); \ 58 (fd), (seals)); r; }) 60 #define CHECK_MFD_FAIL_ADD_SEALS(fd, seals) \ argument [all …]
|
D | memfd_create_common.c | 32 int check_fallocate(const char *filename, const int lineno, int fd, in check_fallocate() argument 37 r = fallocate(fd, mode, offset, len); in check_fallocate() 40 "fallocate(%d, %d, %ld, %ld) failed", fd, mode, in check_fallocate() 45 "fallocate(%d, %d, %ld, %ld) succeeded", fd, mode, in check_fallocate() 51 int check_fallocate_fail(const char *filename, const int lineno, int fd, in check_fallocate_fail() argument 56 r = fallocate(fd, mode, offset, len); in check_fallocate_fail() 60 fd, mode, offset, len); in check_fallocate_fail() 66 "fallocate(%d, %d, %ld, %ld) failed as expected", fd, in check_fallocate_fail() 72 void check_ftruncate(const char *filename, const int lineno, int fd, in check_ftruncate() argument 75 safe_ftruncate(filename, lineno, fd, length); in check_ftruncate() [all …]
|
/external/linux-kselftest/tools/testing/selftests/memfd/ |
D | memfd_test.c | 39 int r, fd; in mfd_assert_new() local 41 fd = sys_memfd_create(name, flags); in mfd_assert_new() 42 if (fd < 0) { in mfd_assert_new() 48 r = ftruncate(fd, sz); in mfd_assert_new() 54 return fd; in mfd_assert_new() 59 int r, fd; in mfd_assert_reopen_fd() local 64 fd = open(path, O_RDWR); in mfd_assert_reopen_fd() 65 if (fd < 0) { in mfd_assert_reopen_fd() 70 return fd; in mfd_assert_reopen_fd() 86 static unsigned int mfd_assert_get_seals(int fd) in mfd_assert_get_seals() argument [all …]
|
/external/igt-gpu-tools/tests/i915/ |
D | gem_eio.c | 55 int fd, ret; in i915_reset_control() local 59 fd = open(path, O_RDWR); in i915_reset_control() 60 igt_require(fd >= 0); in i915_reset_control() 62 ret = write(fd, &"01"[enable], 1) == 1; in i915_reset_control() 63 close(fd); in i915_reset_control() 68 static void trigger_reset(int fd) in trigger_reset() argument 75 igt_force_gpu_reset(fd); in trigger_reset() 79 gem_test_engine(fd, ALL_ENGINES); in trigger_reset() 80 igt_drop_caches_set(fd, DROP_ACTIVE); in trigger_reset() 95 static void wedge_gpu(int fd) in wedge_gpu() argument [all …]
|
D | gem_reset_stats.c | 71 int fd = drm_open_driver(DRIVER_INTEL); in sync_gpu() local 72 gem_quiescent_gpu(fd); in sync_gpu() 73 close(fd); in sync_gpu() 76 static int noop(int fd, uint32_t ctx, const struct intel_execution_engine *e) in noop() argument 84 exec.handle = gem_create(fd, 4096); in noop() 86 gem_write(fd, exec.handle, 0, &bbe, sizeof(bbe)); in noop() 94 ret = __gem_execbuf(fd, &eb); in noop() 96 gem_close(fd, exec.handle); in noop() 103 static int has_engine(int fd, in has_engine() argument 107 int handle = noop(fd, ctx, e); in has_engine() [all …]
|
D | gem_wait.c | 31 static int __gem_wait(int fd, struct drm_i915_gem_wait *w) in __gem_wait() argument 36 if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_WAIT, w)) in __gem_wait() 42 static void invalid_flags(int fd) in invalid_flags() argument 47 wait.bo_handle = gem_create(fd, 4096); in invalid_flags() 54 igt_assert_eq(__gem_wait(fd, &wait), -EINVAL); in invalid_flags() 56 gem_close(fd, wait.bo_handle); in invalid_flags() 59 static void invalid_buf(int fd) in invalid_buf() argument 64 igt_assert_eq(__gem_wait(fd, &wait), -ENOENT); in invalid_buf() 72 static void basic(int fd, unsigned engine, unsigned flags) in basic() argument 76 flags & (WRITE | AWAIT) ? igt_cork_plug(&cork, fd) : 0; in basic() [all …]
|
D | gem_mmap_wc.c | 59 local_gem_mmap__wc(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot) in local_gem_mmap__wc() argument 63 ptr = __gem_mmap__wc(fd, handle, 0, OBJECT_SIZE, PROT_READ | PROT_WRITE); in local_gem_mmap__wc() 69 static void set_domain(int fd, uint32_t handle) in set_domain() argument 71 gem_set_domain(fd, handle, I915_GEM_DOMAIN_WC, I915_GEM_DOMAIN_WC); in set_domain() 75 mmap_bo(int fd, uint32_t handle) in mmap_bo() argument 79 ptr = local_gem_mmap__wc(fd, handle, 0, OBJECT_SIZE, PROT_READ | PROT_WRITE); in mmap_bo() 85 create_pointer(int fd) in create_pointer() argument 90 handle = gem_create(fd, OBJECT_SIZE); in create_pointer() 92 ptr = mmap_bo(fd, handle); in create_pointer() 93 set_domain(fd, handle); in create_pointer() [all …]
|
D | gem_exec_schedule.c | 67 uint32_t __sync_read_u32(int fd, uint32_t handle, uint64_t offset) in __sync_read_u32() argument 71 gem_set_domain(fd, handle, /* No write hazard lies! */ in __sync_read_u32() 73 gem_read(fd, handle, offset, &value, sizeof(value)); in __sync_read_u32() 79 void __sync_read_u32_count(int fd, uint32_t handle, uint32_t *dst, uint64_t size) in __sync_read_u32_count() argument 81 gem_set_domain(fd, handle, /* No write hazard lies! */ in __sync_read_u32_count() 83 gem_read(fd, handle, 0, dst, size); in __sync_read_u32_count() 86 static uint32_t __store_dword(int fd, uint32_t ctx, unsigned ring, in __store_dword() argument 90 const int gen = intel_gen(intel_get_drm_devid(fd)); in __store_dword() 108 obj[2].handle = gem_create(fd, 4096); in __store_dword() 135 gem_write(fd, obj[2].handle, 0, batch, sizeof(batch)); in __store_dword() [all …]
|
D | gem_shrink.c | 41 static void get_pages(int fd, uint64_t alloc) in get_pages() argument 43 uint32_t handle = gem_create(fd, alloc); in get_pages() 44 gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, 0); in get_pages() 45 gem_madvise(fd, handle, I915_MADV_DONTNEED); in get_pages() 48 static void get_pages_dirty(int fd, uint64_t alloc) in get_pages_dirty() argument 50 uint32_t handle = gem_create(fd, alloc); in get_pages_dirty() 51 gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); in get_pages_dirty() 52 gem_madvise(fd, handle, I915_MADV_DONTNEED); in get_pages_dirty() 55 static void pwrite_(int fd, uint64_t alloc) in pwrite_() argument 58 uint32_t handle = gem_create(fd, alloc); in pwrite_() [all …]
|
/external/openscreen/tools/cddl/ |
D | codegen.cc | 85 bool WriteEnumEqualityOperatorSwitchCases(int fd, in WriteEnumEqualityOperatorSwitchCases() argument 91 dprintf(fd, " case %s::%s: return parent == %s::%s;\n", in WriteEnumEqualityOperatorSwitchCases() 97 [&fd, &child_name, &parent_name](CppType* new_parent) { in WriteEnumEqualityOperatorSwitchCases() 99 fd, *new_parent, child_name, parent_name); in WriteEnumEqualityOperatorSwitchCases() 104 bool WriteEnumEqualityOperator(int fd, in WriteEnumEqualityOperator() argument 111 dprintf(fd, "inline bool operator==(const %s& child, const %s& parent) {\n", in WriteEnumEqualityOperator() 113 dprintf(fd, " switch (child) {\n"); in WriteEnumEqualityOperator() 114 if (!WriteEnumEqualityOperatorSwitchCases(fd, parent, name, parent_name)) { in WriteEnumEqualityOperator() 117 dprintf(fd, " default: return false;\n"); in WriteEnumEqualityOperator() 118 dprintf(fd, " }\n}\n"); in WriteEnumEqualityOperator() [all …]
|
/external/pdfium/third_party/libtiff/ |
D | tif_print.c | 36 _TIFFprintAsciiBounded(FILE* fd, const char* cp, size_t max_chars); 67 _TIFFPrintField(FILE* fd, const TIFFField *fip, in _TIFFPrintField() argument 72 fprintf(fd, " %s: ", fip->field_name); in _TIFFPrintField() 76 fprintf(fd, "%u", ((uint8 *) raw_data)[j]); in _TIFFPrintField() 78 fprintf(fd, "0x%x", in _TIFFPrintField() 81 fprintf(fd, "%d", ((int8 *) raw_data)[j]); in _TIFFPrintField() 83 fprintf(fd, "%u", ((uint16 *) raw_data)[j]); in _TIFFPrintField() 85 fprintf(fd, "%d", ((int16 *) raw_data)[j]); in _TIFFPrintField() 87 fprintf(fd, "%lu", in _TIFFPrintField() 90 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/igt-gpu-tools/tests/ |
D | syncobj_wait.c | 65 syncobj_attach_sw_sync(int fd, uint32_t handle) in syncobj_attach_sw_sync() argument 72 syncobj_import_sync_file(fd, handle, fence); in syncobj_attach_sw_sync() 79 syncobj_trigger(int fd, uint32_t handle) in syncobj_trigger() argument 81 int timeline = syncobj_attach_sw_sync(fd, handle); in syncobj_trigger() 111 int fd; member 125 syncobj_trigger(pair->fd, pair->handle); in syncobj_trigger_free_pair_func() 130 syncobj_trigger_delayed(int fd, uint32_t syncobj, uint64_t nsec) in syncobj_trigger_delayed() argument 134 pair->fd = fd; in syncobj_trigger_delayed() 141 test_wait_bad_flags(int fd) in test_wait_bad_flags() argument 145 igt_assert_eq(__syncobj_wait(fd, &wait), -EINVAL); in test_wait_bad_flags() [all …]
|
D | syncobj_basic.c | 34 test_bad_destroy(int fd) in test_bad_destroy() argument 42 ret = ioctl(fd, DRM_IOCTL_SYNCOBJ_DESTROY, &destroy); in test_bad_destroy() 49 test_bad_handle_to_fd(int fd) in test_bad_handle_to_fd() argument 56 igt_assert_eq(__syncobj_handle_to_fd(fd, &handle), -EINVAL); in test_bad_handle_to_fd() 61 test_bad_fd_to_handle(int fd) in test_bad_fd_to_handle() argument 65 handle.fd = -1; in test_bad_fd_to_handle() 68 igt_assert_eq(__syncobj_fd_to_handle(fd, &handle), -EINVAL); in test_bad_fd_to_handle() 73 test_illegal_fd_to_handle(int fd) in test_illegal_fd_to_handle() argument 77 handle.fd = fd; in test_illegal_fd_to_handle() 80 igt_assert_eq(__syncobj_fd_to_handle(fd, &handle), -EINVAL); in test_illegal_fd_to_handle() [all …]
|
D | kms_addfb_basic.c | 47 static int legacy_addfb(int fd, struct drm_mode_fb_cmd *arg) in legacy_addfb() argument 52 if (igt_ioctl(fd, DRM_IOCTL_MODE_ADDFB, arg)) in legacy_addfb() 59 static int rmfb(int fd, uint32_t id) in rmfb() argument 64 if (igt_ioctl(fd, DRM_IOCTL_MODE_RMFB, &id)) in rmfb() 71 static void invalid_tests(int fd) in invalid_tests() argument 81 gem_bo = igt_create_bo_with_dimensions(fd, 1024, 1024, in invalid_tests() 84 gem_bo_small = igt_create_bo_with_dimensions(fd, 1024, 1023, in invalid_tests() 90 igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == 0); in invalid_tests() 91 igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0); in invalid_tests() 98 igt_require_fb_modifiers(fd); in invalid_tests() [all …]
|
/external/llvm-project/clang/test/Analysis/ |
D | unix-api.c | 16 int fd; in open_1() local 17 fd = open(path, O_RDONLY); // no-warning in open_1() 18 if (fd > -1) in open_1() 19 close(fd); in open_1() 23 int fd; in open_2() local 25 …fd = open(path, O_RDONLY, mode, NULL); // expected-warning{{Call to 'open' with more than 3 argume… in open_2() 26 if (fd > -1) in open_2() 27 close(fd); in open_2() 31 int fd; in openat_2() local 33 …fd = openat(base_fd, path, O_RDONLY, mode, NULL); // expected-warning{{Call to 'openat' with more … in openat_2() [all …]
|
/external/igt-gpu-tools/lib/ |
D | ioctl_wrappers.h | 51 extern int (*igt_ioctl)(int fd, unsigned long request, void *arg); 54 drm_intel_bo * gem_handle_to_libdrm_bo(drm_intel_bufmgr *bufmgr, int fd, 60 bool gem_get_tiling(int fd, uint32_t handle, uint32_t *tiling, uint32_t *swizzle); 61 void gem_set_tiling(int fd, uint32_t handle, uint32_t tiling, uint32_t stride); 62 int __gem_set_tiling(int fd, uint32_t handle, uint32_t tiling, uint32_t stride); 64 int __gem_set_caching(int fd, uint32_t handle, uint32_t caching); 65 void gem_set_caching(int fd, uint32_t handle, uint32_t caching); 66 uint32_t gem_get_caching(int fd, uint32_t handle); 67 uint32_t gem_flink(int fd, uint32_t handle); 68 uint32_t gem_open(int fd, uint32_t name); [all …]
|
D | ioctl_wrappers.c | 89 int (*igt_ioctl)(int fd, unsigned long request, void *arg) = drmIoctl; 105 gem_handle_to_libdrm_bo(drm_intel_bufmgr *bufmgr, int fd, const char *name, uint32_t handle) in gem_handle_to_libdrm_bo() argument 113 ret = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink); in gem_handle_to_libdrm_bo() 124 __gem_get_tiling(int fd, struct drm_i915_gem_get_tiling *arg) in __gem_get_tiling() argument 129 if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_GET_TILING, arg)) in __gem_get_tiling() 148 gem_get_tiling(int fd, uint32_t handle, uint32_t *tiling, uint32_t *swizzle) in gem_get_tiling() argument 155 igt_assert_eq(__gem_get_tiling(fd, &get_tiling), 0); in gem_get_tiling() 163 int __gem_set_tiling(int fd, uint32_t handle, uint32_t tiling, uint32_t stride) in __gem_set_tiling() argument 178 ret = ioctl(fd, DRM_IOCTL_I915_GEM_SET_TILING, &st); in __gem_set_tiling() 197 void gem_set_tiling(int fd, uint32_t handle, uint32_t tiling, uint32_t stride) in gem_set_tiling() argument [all …]
|
D | drmtest.c | 79 static int __get_drm_device_name(int fd, char *name, int name_size) in __get_drm_device_name() argument 87 if (!drmIoctl(fd, DRM_IOCTL_VERSION, &version)){ in __get_drm_device_name() 94 static bool __is_device(int fd, const char *expect) in __is_device() argument 98 if (__get_drm_device_name(fd, name, sizeof(name) - 1)) in __is_device() 104 bool is_amdgpu_device(int fd) in is_amdgpu_device() argument 106 return __is_device(fd, "amdgpu"); in is_amdgpu_device() 109 bool is_i915_device(int fd) in is_i915_device() argument 111 return __is_device(fd, "i915"); in is_i915_device() 114 bool is_vc4_device(int fd) in is_vc4_device() argument 116 return __is_device(fd, "vc4"); in is_vc4_device() [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/rust/crates/grpcio-sys/grpc/src/core/lib/iomgr/ |
D | ev_poll_posix.cc | 62 grpc_fd* fd; member 71 grpc_fd* fd; member 79 int fd; member 149 static uint32_t fd_begin_poll(grpc_fd* fd, grpc_pollset* pollset, 159 static bool fd_is_orphaned(grpc_fd* fd); 162 static void fd_ref(grpc_fd* fd, const char* reason, const char* file, int line); 163 static void fd_unref(grpc_fd* fd, const char* reason, const char* file, 165 #define GRPC_FD_REF(fd, reason) fd_ref(fd, reason, __FILE__, __LINE__) argument 166 #define GRPC_FD_UNREF(fd, reason) fd_unref(fd, reason, __FILE__, __LINE__) argument 168 static void fd_ref(grpc_fd* fd); [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/ltp/testcases/kernel/syscalls/eventfd/ |
D | eventfd01.c | 85 static int clear_counter(int fd) in clear_counter() argument 90 ret = read(fd, &dummy, sizeof(dummy)); in clear_counter() 111 static int set_counter(int fd, uint64_t val) in set_counter() argument 115 ret = clear_counter(fd); in set_counter() 119 ret = write(fd, &val, sizeof(val)); in set_counter() 131 static void read_test(int fd, uint64_t required) in read_test() argument 136 ret = read(fd, &val, sizeof(val)); in read_test() 152 static void read_eagain_test(int fd) in read_eagain_test() argument 157 ret = clear_counter(fd); in read_eagain_test() 163 ret = read(fd, &val, sizeof(val)); in read_eagain_test() [all …]
|