Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 25 of 4397) sorted by relevance

12345678910>>...176

/external/linux-kselftest/tools/testing/selftests/memfd/
Dmemfd_test.c39 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()
70 static unsigned int mfd_assert_get_seals(int fd) in mfd_assert_get_seals() argument
74 r = fcntl(fd, F_GET_SEALS); in mfd_assert_get_seals()
76 printf("GET_SEALS(%d) failed: %m\n", fd); in mfd_assert_get_seals()
83 static void mfd_assert_has_seals(int fd, unsigned int seals) in mfd_assert_has_seals() argument
87 s = mfd_assert_get_seals(fd); in mfd_assert_has_seals()
[all …]
/external/ltp/testcases/kernel/syscalls/memfd_create/
Dmemfd_create01.c32 static void test_basic(int fd) in test_basic() argument
35 CHECK_MFD_HAS_SEALS(fd, 0); in test_basic()
36 CHECK_MFD_ADD_SEALS(fd, F_SEAL_SHRINK | F_SEAL_WRITE); in test_basic()
37 CHECK_MFD_HAS_SEALS(fd, F_SEAL_SHRINK | F_SEAL_WRITE); in test_basic()
40 CHECK_MFD_ADD_SEALS(fd, F_SEAL_SHRINK | F_SEAL_WRITE); in test_basic()
41 CHECK_MFD_HAS_SEALS(fd, F_SEAL_SHRINK | F_SEAL_WRITE); in test_basic()
44 CHECK_MFD_ADD_SEALS(fd, F_SEAL_GROW | F_SEAL_SEAL); in test_basic()
45 CHECK_MFD_HAS_SEALS(fd, F_SEAL_SHRINK | F_SEAL_GROW | in test_basic()
49 CHECK_MFD_FAIL_ADD_SEALS(fd, F_SEAL_GROW); in test_basic()
50 CHECK_MFD_FAIL_ADD_SEALS(fd, 0); in test_basic()
[all …]
Dmemfd_create_common.h41 #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 …]
Dmemfd_create_common.c42 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/pdfium/third_party/libtiff/
Dtif_print.c38 _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/
Dtomoyo_new_file_test.c96 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 …]
Dtomoyo_rewrite_test.c58 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/
Drandom_exercise.c51 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/
Dunix-api.c15 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
24fd = 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/
Deventfd01.c85 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 …]
/external/ltp/testcases/kernel/input/
Dinput_helper.c40 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/adhd/cras/src/common/
Dcras_shm.c21 static void cras_shm_restorecon(int fd) in cras_shm_restorecon() argument
26 if (snprintf(fd_proc_path, sizeof(fd_proc_path), "/proc/self/fd/%d", fd) < 0) { in cras_shm_restorecon()
28 "Couldn't construct proc symlink path of fd: %d", fd); in cras_shm_restorecon()
53 int fd; in cras_shm_open_rw() local
58 fd = ashmem_create_region(name, size); in cras_shm_open_rw()
59 if (fd < 0) { in cras_shm_open_rw()
60 fd = -errno; in cras_shm_open_rw()
62 name, strerror(-fd)); in cras_shm_open_rw()
64 return fd; in cras_shm_open_rw()
67 int cras_shm_reopen_ro (const char *name, int fd) in cras_shm_reopen_ro() argument
[all …]
/external/icu/icu4c/source/test/intltest/
Ddcfmapts.cpp650 number::impl::DecimalQuantity fd; in TestFixedDecimal() local
651 df->formatToDecimalQuantity(44, fd, status); in TestFixedDecimal()
653 ASSERT_EQUAL(44, fd.getPluralOperand(PLURAL_OPERAND_N)); in TestFixedDecimal()
654 ASSERT_EQUAL(0, fd.getPluralOperand(PLURAL_OPERAND_V)); in TestFixedDecimal()
655 ASSERT_EQUAL(FALSE, fd.isNegative()); in TestFixedDecimal()
657 df->formatToDecimalQuantity(-44, fd, status); in TestFixedDecimal()
659 ASSERT_EQUAL(44, fd.getPluralOperand(PLURAL_OPERAND_N)); in TestFixedDecimal()
660 ASSERT_EQUAL(0, fd.getPluralOperand(PLURAL_OPERAND_V)); in TestFixedDecimal()
661 ASSERT_EQUAL(TRUE, fd.isNegative()); in TestFixedDecimal()
665 df->formatToDecimalQuantity(123.456, fd, status); in TestFixedDecimal()
[all …]
/external/wayland/src/
Dwayland-os.c39 set_cloexec_or_close(int fd) in set_cloexec_or_close() argument
43 if (fd == -1) in set_cloexec_or_close()
46 flags = fcntl(fd, F_GETFD); in set_cloexec_or_close()
50 if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) == -1) in set_cloexec_or_close()
53 return fd; in set_cloexec_or_close()
56 close(fd); in set_cloexec_or_close()
63 int fd; in wl_os_socket_cloexec() local
65 fd = socket(domain, type | SOCK_CLOEXEC, protocol); in wl_os_socket_cloexec()
66 if (fd >= 0) in wl_os_socket_cloexec()
67 return fd; in wl_os_socket_cloexec()
[all …]
/external/strace/tests/
Dnetlink_route.c87 test_nlmsg_type(const int fd) in test_nlmsg_type() argument
96 rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); in test_nlmsg_type()
100 fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); in test_nlmsg_type()
104 test_nlmsg_flags(const int fd) in test_nlmsg_flags() argument
113 rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); in test_nlmsg_flags()
117 fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); in test_nlmsg_flags()
121 rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); in test_nlmsg_flags()
125 fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); in test_nlmsg_flags()
129 rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); in test_nlmsg_flags()
133 fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); in test_nlmsg_flags()
[all …]
/external/strace/tests-m32/
Dnetlink_route.c87 test_nlmsg_type(const int fd) in test_nlmsg_type() argument
96 rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); in test_nlmsg_type()
100 fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); in test_nlmsg_type()
104 test_nlmsg_flags(const int fd) in test_nlmsg_flags() argument
113 rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); in test_nlmsg_flags()
117 fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); in test_nlmsg_flags()
121 rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); in test_nlmsg_flags()
125 fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); in test_nlmsg_flags()
129 rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); in test_nlmsg_flags()
133 fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); in test_nlmsg_flags()
[all …]
/external/strace/tests-mx32/
Dnetlink_route.c87 test_nlmsg_type(const int fd) in test_nlmsg_type() argument
96 rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); in test_nlmsg_type()
100 fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); in test_nlmsg_type()
104 test_nlmsg_flags(const int fd) in test_nlmsg_flags() argument
113 rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); in test_nlmsg_flags()
117 fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); in test_nlmsg_flags()
121 rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); in test_nlmsg_flags()
125 fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); in test_nlmsg_flags()
129 rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); in test_nlmsg_flags()
133 fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); in test_nlmsg_flags()
[all …]
/external/libdrm/
Dxf86drm.h116 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/grpc-grpc/src/core/lib/iomgr/
Dev_poll_posix.cc60 grpc_fd* fd; member
69 grpc_fd* fd; member
77 int fd; member
147 static uint32_t fd_begin_poll(grpc_fd* fd, grpc_pollset* pollset,
157 static bool fd_is_orphaned(grpc_fd* fd);
160 static void fd_ref(grpc_fd* fd, const char* reason, const char* file, int line);
161 static void fd_unref(grpc_fd* fd, const char* reason, const char* file,
163 #define GRPC_FD_REF(fd, reason) fd_ref(fd, reason, __FILE__, __LINE__) argument
164 #define GRPC_FD_UNREF(fd, reason) fd_unref(fd, reason, __FILE__, __LINE__) argument
166 static void fd_ref(grpc_fd* fd);
[all …]
/external/linux-kselftest/tools/testing/selftests/bpf/
Dtest_maps.c49 int fd; in test_hashmap() local
51 fd = bpf_create_map(BPF_MAP_TYPE_HASH, sizeof(key), sizeof(value), in test_hashmap()
53 if (fd < 0) { in test_hashmap()
61 assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0); in test_hashmap()
65 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) == -1 && in test_hashmap()
70 assert(bpf_map_update_elem(fd, &key, &value, -1) == -1 && in test_hashmap()
74 assert(bpf_map_lookup_elem(fd, &key, &value) == 0 && value == 1234); in test_hashmap()
78 assert(bpf_map_lookup_elem(fd, &key, &value) == -1 && errno == ENOENT); in test_hashmap()
81 assert(bpf_map_update_elem(fd, &key, &value, BPF_EXIST) == -1 && in test_hashmap()
86 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) == 0); in test_hashmap()
[all …]
/external/ltp/testcases/open_posix_testsuite/include/
Dmq_send.h14 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/
Dopenvt.c46 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/syzkaller/sys/linux/
Dtty.txt9 resource fd_tty[fd]
11 openat$ptmx(fd const[AT_FDCWD], file ptr[in, string["/dev/ptmx"]], flags flags[open_flags], mode co…
12 syz_open_pts(fd fd_tty, flags flags[open_flags]) fd_tty
13 ioctl$TCGETS(fd fd_tty, cmd const[TCGETS], arg ptr[out, termios])
14 ioctl$TCSETS(fd fd_tty, cmd const[TCSETS], arg ptr[in, termios])
15 ioctl$TCSETSW(fd fd_tty, cmd const[TCSETSW], arg ptr[in, termios])
16 ioctl$TCSETSF(fd fd_tty, cmd const[TCSETSF], arg ptr[in, termios])
17 ioctl$TCGETA(fd fd_tty, cmd const[TCGETA], arg ptr[out, termio])
18 ioctl$TCSETA(fd fd_tty, cmd const[TCSETA], arg ptr[in, termio])
19 ioctl$TCSETAW(fd fd_tty, cmd const[TCSETAW], arg ptr[in, termio])
[all …]
/external/ltp/testcases/kernel/syscalls/mq_timedsend/
Dmq_timedsend01.c27 static int fd, fd_root, fd_nonblock, fd_maxint = INT_MAX - 1, fd_invalid = -1; variable
34 .fd = &fd,
40 .fd = &fd,
46 .fd = &fd,
52 .fd = &fd,
59 .fd = &fd,
65 .fd = &fd_invalid,
71 .fd = &fd_maxint,
77 .fd = &fd_root,
83 .fd = &fd_nonblock,
[all …]
/external/compiler-rt/lib/tsan/rtl/
Dtsan_fd.cc45 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 …]

12345678910>>...176