Home
last modified time | relevance | path

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

12345678910>>...139

/external/linux-kselftest/tools/testing/selftests/memfd/
Dmemfd_test.c32 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/
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/dhcpcd-6.8.2/
Dcontrol.c74 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/icu/icu4c/source/test/intltest/
Ddcfmapts.cpp616 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/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/ltp/testcases/kernel/syscalls/eventfd/
Deventfd01.c86 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/
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/ltp/testcases/kernel/fs/dmapi/
Dhole.c86 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 …]
Dconfig.c62 int fd; in main() local
68 if ((fd = in main()
72 } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { in main()
73 close(fd); in main()
76 if (fd == -1 || rc == -1) { in main()
90 rc = close(fd); in main()
106 int fd; in main() local
112 if ((fd = in main()
116 } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { in main()
117 close(fd); in main()
[all …]
Dhandle.c180 int fd; in main() local
185 fd = open(DUMMY_FILE, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE); in main()
186 if (fd == -1) { in main()
205 rc = close(fd); in main()
221 int fd; in main() local
226 if ((fd = in main()
231 close(fd); in main()
234 if (fd == -1 || rc == -1) { in main()
253 rc = close(fd); in main()
342 int fd; in main() local
[all …]
Dpmr_pre.c108 int fd; local
117 fd = open(DUMMY_FILE, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE);
118 if (fd != -1) {
120 if (write(fd, DUMMY_STRING, DUMMY_STRLEN) !=
130 rc = close(fd);
151 int fd; local
163 if ((fd =
167 } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) {
168 close(fd);
171 if (rc == -1 || fd == -1) {
[all …]
/external/syslinux/efi/
Dfio.c145 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/
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 …]
Dxf86drm.c167 drmIoctl(int fd, unsigned long request, void *arg) in drmIoctl() argument
172 ret = ioctl(fd, request, arg); in drmIoctl()
177 static unsigned long drmGetKeyFromFd(int fd) in drmGetKeyFromFd() argument
182 fstat(fd, &st); in drmGetKeyFromFd()
186 drmHashEntry *drmGetEntry(int fd) in drmGetEntry() argument
188 unsigned long key = drmGetKeyFromFd(fd); in drmGetEntry()
197 entry->fd = fd; in drmGetEntry()
313 int fd; in drmOpenDevice() local
392 fd = open(buf, O_RDWR, 0); in drmOpenDevice()
394 fd, fd < 0 ? strerror(errno) : "OK"); in drmOpenDevice()
[all …]
/external/bison/lib/
Dpipe2.c40 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 …]
Ddup2.c44 ms_windows_dup2 (int fd, int desired_fd) in ms_windows_dup2() argument
51 if (fd == desired_fd) in ms_windows_dup2()
53 if ((HANDLE) _get_osfhandle (fd) == INVALID_HANDLE_VALUE) in ms_windows_dup2()
58 return fd; in ms_windows_dup2()
71 result = dup2 (fd, desired_fd); in ms_windows_dup2()
91 rpl_dup2 (int fd, int desired_fd) in rpl_dup2() argument
99 if (fd == desired_fd) in rpl_dup2()
100 return fcntl (fd, F_GETFL) == -1 ? -1 : fd; in rpl_dup2()
103 result = dup2 (fd, desired_fd); in rpl_dup2()
109 if (fd != desired_fd && result != -1) in rpl_dup2()
[all …]
/external/ltp/testcases/kernel/syscalls/fcntl/
Dfcntl01.c48 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/
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 …]
/external/ltp/testcases/kernel/syscalls/epoll_ctl/
Depoll_ctl01.c39 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 && close(fd[0])) in cleanup()
68 if (fd[1] > 0 && close(fd[1])) in cleanup()
73 int fd, unsigned int events) in has_event() argument
78 if ((epvs[i].data.fd == fd) && (epvs[i].events == events)) in has_event()
93 {.events = 0, .data.fd = 0}, in check_epoll_ctl()
[all …]
/external/linux-kselftest/tools/testing/selftests/efivarfs/
Dopen-unlink.c15 int fd; in set_immutable() local
19 fd = open(path, O_RDONLY); in set_immutable()
20 if (fd < 0) in set_immutable()
21 return fd; in set_immutable()
23 rc = ioctl(fd, FS_IOC_GETFLAGS, &flags); in set_immutable()
26 close(fd); in set_immutable()
36 rc = ioctl(fd, FS_IOC_SETFLAGS, &flags); in set_immutable()
38 close(fd); in set_immutable()
46 int fd; in get_immutable() local
50 fd = open(path, O_RDONLY); in get_immutable()
[all …]

12345678910>>...139