Home
last modified time | relevance | path

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

/examples/utest/testcases/posix/unistd_h/functions/
A Dopen_read_write_fsync_close_tc.c14 int fd = 0; in open_read_write_fsync_close_entry() local
21 if (fd < 0) in open_read_write_fsync_close_entry()
26 write(fd, s, FILE_TEST_LENGTH(s)); in open_read_write_fsync_close_entry()
29 read(fd,buffer,FILE_TEST_LENGTH(s)); in open_read_write_fsync_close_entry()
33 if(fsync(fd)!=0) in open_read_write_fsync_close_entry()
39 read(fd,buffer,FILE_TEST_LENGTH(s)); in open_read_write_fsync_close_entry()
42 close(fd); in open_read_write_fsync_close_entry()
45 fd = open(FILE_TEST_NAME, O_RDONLY); in open_read_write_fsync_close_entry()
46 if (fd>= 0) in open_read_write_fsync_close_entry()
48 size = read(fd, buffer, sizeof(buffer)); in open_read_write_fsync_close_entry()
[all …]
A Dftruncate_tc.c10 int fd = 0; in ftruncate_entry() local
12 fd = open(TRUNCATE_TEST_NAME, O_RDWR | O_CREAT | O_APPEND); in ftruncate_entry()
13 if (fd < 0) in ftruncate_entry()
18 write(fd, "hello", 6); in ftruncate_entry()
20 res = ftruncate(fd, TRUN_SIZE); in ftruncate_entry()
21 close(fd); in ftruncate_entry()
/examples/file/
A Dreadwrite.c24 int fd; in readwrite() local
32 if (fd < 0) in readwrite()
42 close(fd); in readwrite()
50 close(fd); in readwrite()
66 close(fd); in readwrite()
71 close(fd); in readwrite()
75 if (fd < 0) in readwrite()
85 close(fd); in readwrite()
89 close(fd); in readwrite()
93 if (fd < 0) in readwrite()
[all …]
A Dreadspeed.c21 int fd; in readspeed() local
26 fd = open(filename, 0, O_RDONLY); in readspeed()
27 if (fd < 0) in readspeed()
37 close(fd); in readspeed()
46 length = read(fd, buff_ptr, block_size); in readspeed()
54 close(fd); in readspeed()
A Dwritespeed.c20 int fd, index, length; in writespeed() local
24 fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0); in writespeed()
25 if (fd < 0) in writespeed()
35 close(fd); in writespeed()
50 length = write(fd, buff_ptr, block_size); in writespeed()
62 close(fd); in writespeed()
/examples/libc/
A Dtermios_test.c64 int fd; in open_comm() local
66 if(fd == -1) in open_comm()
76 return fd; in open_comm()
81 if(fd != -1) in close_comm()
83 close(fd); in close_comm()
170 if(fd == -1) in recv_comm()
264 if(fd == -1) in send_comm()
277 if(fd == -1) in flush_comm()
288 int fd = -1; in termios_test_entry() local
305 flush_comm(fd); in termios_test_entry()
[all …]
A Dprintf.c185 int fd; in libc_dprintf() local
187 fd = open("/dev/console", O_WRONLY, 0); in libc_dprintf()
188 if (fd >0) in libc_dprintf()
190 dprintf(fd, "fd:%d printf test!!\n", fd); in libc_dprintf()
191 close(fd); in libc_dprintf()
199 int fd; in libc_fdopen() local
202 fd = open("/dev/console", O_WRONLY, 0); in libc_fdopen()
203 if (fd >0) in libc_fdopen()
205 fp = fdopen(fd, "w"); in libc_fdopen()
A Dfile.c21 int fd; in libc_fstat() local
25 if (fd < 0) in libc_fstat()
36 close(fd); in libc_fstat()
42 int fd; in libc_lseek() local
45 if (fd < 0) in libc_lseek()
54 close(fd); in libc_lseek()
67 int fd; in libc_fseek() local
89 fd = mkstemp(fname); in libc_fseek()
90 if (fd == -1) in libc_fseek()
96 fp = fdopen(fd, "w+"); in libc_fseek()
[all …]
/examples/test/
A Dfs_test.c28 int fd; in fsrw1_thread_entry() local
50 if (fd < 0) in fsrw1_thread_entry()
72 close(fd); in fsrw1_thread_entry()
82 close(fd); in fsrw1_thread_entry()
86 if (fd < 0) in fsrw1_thread_entry()
128 close(fd); in fsrw1_thread_entry()
136 int fd; in fsrw2_thread_entry() local
158 if (fd < 0) in fsrw2_thread_entry()
190 close(fd); in fsrw2_thread_entry()
194 if (fd < 0) in fsrw2_thread_entry()
[all …]
/examples/utest/testcases/posix/stdio_h/functions/
A Dfdopen_tc.c7 int fd; in fdopen_entry() local
10 fd = open("fdopen_file.txt", O_CREAT | O_RDWR | O_APPEND); in fdopen_entry()
11 if (fd < 0) in fdopen_entry()
18 stream = fdopen(fd, "w"); in fdopen_entry()
/examples/ymodem/
A Dtofile.c24 int fd; member
38 cctx->fd = open(cctx->fpath, O_CREAT | O_WRONLY | O_TRUNC, 0); in _rym_bg()
39 if (cctx->fd < 0) in _rym_bg()
59 RT_ASSERT(cctx->fd >= 0); in _rym_tof()
62 write(cctx->fd, buf, len); in _rym_tof()
67 write(cctx->fd, buf, wlen); in _rym_tof()
80 RT_ASSERT(cctx->fd >= 0); in _rym_end()
81 close(cctx->fd); in _rym_end()
82 cctx->fd = -1; in _rym_end()
/examples/rt-link/
A Drtlink_dev_example.c58 int fd = -1; variable
64 if (fd < 0) in rtlink_fopen()
73 LOG_D("colse %d", fd); in rtlink_fclose()
74 close(fd); in rtlink_fclose()
75 fd = -1; in rtlink_fclose()
102 ret = write(fd, data, length); in rtlink_fwrite()
138 if (fd < 0) in listen_thread()
150 FD_SET(fd, &readfds); in listen_thread()
151 FD_SET(fd, &writefds); in listen_thread()
155 if (FD_ISSET(fd, &readfds)) in listen_thread()
[all …]
/examples/utest/testcases/mm/
A Dlwp_mmap_expand.c16 static long fd = -1; variable
51 next_va = lwp_mmap2(lwp, next_va, map_size, prot1, flags, fd, pgoffset); in test_mmap_expand()
61 lwp_mmap2(lwp, next_va, map_size, prot1, flags, fd, pgoffset) in test_mmap_expand()
71 lwp_mmap2(lwp, next_va, map_size, prot1, flags, fd, pgoffset) in test_mmap_expand()
A Dlwp_mmap_map_fixed.c25 static long fd = -1; variable
56 vaddr = lwp_mmap2(lwp, vaddr, ex_size, ex_prot, ex_flags, fd, pgoffset); in test_map_fixed()
65 …rride = lwp_mmap2(lwp, override_start, override_size, override_prot, override_flags, fd, pgoffset); in test_map_fixed()
A Dlwp_mmap_fd.c100 static void _setup_file_content(long fd) in _setup_file_content() argument
107 write(fd, page_sz_buf, PAGE_SZ); in _setup_file_content()
A Dlwp_mmap_fix_private.c17 static long fd = -1; variable
65 next_va = lwp_mmap2(lwp, next_va, ex_size, prot, flags, fd, pgoffset); in test_mmap_fix_private()
A Dlwp_mmap_fd_map_fixed_merge.c175 static void _setup_file_content(long fd) in _setup_file_content() argument
181 write(fd, page_sz_buf, PAGE_SZ); in _setup_file_content()
A Dlwp_mmap_fd_map_fixed_split.c176 static void _setup_file_content(long fd) in _setup_file_content() argument
182 write(fd, page_sz_buf, PAGE_SZ); in _setup_file_content()
/examples/utest/testcases/drivers/serial_v2/posix/
A Duart_posix_nonblock.c38 static rt_err_t configureSerial(int fd, int baud) in configureSerial() argument
43 result = tcgetattr(fd, &options); // 获取当前端口的属性 in configureSerial()
73 result = tcsetattr(fd, TCSANOW, &options); in configureSerial()
A Duart_posix_echo_block.c40 static rt_err_t configureSerial(int fd, int baud) in configureSerial() argument
45 result = tcgetattr(fd, &options); // 获取当前端口的属性 in configureSerial()
75 result = tcsetattr(fd, TCSANOW, &options); in configureSerial()

Completed in 23 milliseconds