Home
last modified time | relevance | path

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

/DragonOS-0.1.2/user/libs/libc/src/
Ddirent.c18 int fd = open(path, O_DIRECTORY); in opendir() local
19 if (fd < 0) // 目录打开失败 in opendir()
30 dirp->fd = fd; in opendir()
52 int retval = close(dirp->fd); in closedir()
57 int64_t getdents(int fd, struct dirent *dirent, long count) in getdents() argument
59 return syscall_invoke(SYS_GET_DENTS, fd, (uint64_t)dirent, count, 0, 0, 0, 0, 0); in getdents()
72 int len = getdents(dir->fd, (struct dirent *)dir->buf, DIR_BUF_SIZE); in readdir()
Dunistd.c15 int close(int fd) in close() argument
17 return syscall_invoke(SYS_CLOSE, fd, 0, 0, 0, 0, 0, 0, 0); in close()
28 ssize_t read(int fd, void *buf, size_t count) in read() argument
30 return (ssize_t)syscall_invoke(SYS_READ, fd, (uint64_t)buf, count, 0, 0, 0, 0, 0); in read()
41 ssize_t write(int fd, void const *buf, size_t count) in write() argument
43 return (ssize_t)syscall_invoke(SYS_WRITE, fd, (uint64_t)buf, count, 0, 0, 0, 0, 0); in write()
54 off_t lseek(int fd, off_t offset, int whence) in lseek() argument
56 return (off_t)syscall_invoke(SYS_LSEEK, fd, offset, whence, 0, 0, 0, 0, 0); in lseek()
Dunistd.h11 int close(int fd);
21 ssize_t read(int fd, void *buf, size_t count);
31 ssize_t write(int fd, void const *buf, size_t count);
41 off_t lseek(int fd, off_t offset, int whence);
Ddirent.h20 int fd; member
/DragonOS-0.1.2/user/apps/shell/
Dcmd_test.c10 int fd[2]; in shell_pipe_test() local
15 ret = pipe(fd); in shell_pipe_test()
23 ret = write(fd[1], msg, strlen(msg)); in shell_pipe_test()
27 ret = read(fd[0], buf, sizeof(buf)); in shell_pipe_test()
Dcmd.c311 int fd = open(file_path, 0); in shell_cmd_cat() local
313 int file_size = lseek(fd, 0, SEEK_END); in shell_cmd_cat()
315 lseek(fd, 0, SEEK_SET); in shell_cmd_cat()
321 int l = read(fd, buf, 511); in shell_cmd_cat()
327 close(fd); in shell_cmd_cat()
356 int fd = open(file_path, O_CREAT); in shell_cmd_touch() local
357 switch (fd) in shell_cmd_touch()
366 close(fd); in shell_cmd_touch()
Dshell.c22 int shell_readline(int fd, char *buf);
152 int shell_readline(int fd, char *buf) in shell_readline() argument
158 key = keyboard_analyze_keycode(fd); in shell_readline()
/DragonOS-0.1.2/user/libs/libKeyboard/
Dkeyboard.c290 int keyboard_analyze_keycode(int fd) in keyboard_analyze_keycode() argument
294 int c = keyboard_get_scancode(fd); in keyboard_analyze_keycode()
307 if (keyboard_get_scancode(fd) != pause_break_scan_code[i]) in keyboard_analyze_keycode()
316 scancode = keyboard_get_scancode(fd); in keyboard_analyze_keycode()
320 if (keyboard_get_scancode(fd) == 0xe0) in keyboard_analyze_keycode()
321 if (keyboard_get_scancode(fd) == 0x37) in keyboard_analyze_keycode()
328 if (keyboard_get_scancode(fd) == 0xe0) in keyboard_analyze_keycode()
329 if (keyboard_get_scancode(fd) == 0xaa) in keyboard_analyze_keycode()
527 int keyboard_get_scancode(int fd) in keyboard_get_scancode() argument
530 read(fd, &ret, 1); in keyboard_get_scancode()
Dkeyboard.h16 int keyboard_get_scancode(int fd);
22 int keyboard_analyze_keycode(int fd);
/DragonOS-0.1.2/docs/userland/libc/apis/api-list/
Dunistd.md9 ``int close(int fd)`` : 关闭文件
11 ``ssize_t read(int fd,void *buf,size_t count)`` : 从文件读取
17 ``ssize_t write(int fd,void const *buf,size_t count)`` : 写入文件
23 ``off_t lseek(int fd,off_t offset,int whence)`` : 调整文件访问位置
31 ``pid_t vfork(void)`` : fork 当前进程,与父进程共享 VM,flags,fd
Ddirent.md11 ``int fd`` : 文件夹id(不推荐修改)
/DragonOS-0.1.2/user/libs/libc/src/sys/
Dstat.c20 int pipe(int *fd) in pipe() argument
22 return syscall_invoke(SYS_PIPE, (uint64_t)fd, 0, 0,0,0,0,0,0); in pipe()
Dstat.h28 int pipe(int *fd);
/DragonOS-0.1.2/kernel/src/ipc/
Dpipe.c137 int *fd = NULL; in sys_pipe() local
142 fd = (int *)regs->r8; in sys_pipe()
148 fd[0] = process_fd_alloc(read_file); in sys_pipe()
149 if (fd[0] == -1) in sys_pipe()
157 fd[1] = process_fd_alloc(write_file); in sys_pipe()
158 if (fd[1] == -1) in sys_pipe()
/DragonOS-0.1.2/tools/
Drun-qemu.sh45 ${QEMU} -bios arch/x86_64/efi/OVMF-pure-efi.fd ${QEMU_ARGUMENT}
47 ${QEMU} -bios arch/i386/efi/OVMF-pure-efi.fd ${QEMU_ARGUMENT}
/DragonOS-0.1.2/kernel/src/syscall/
Dsyscall.c427 int fd = (int)regs->r8; in sys_getdents() local
431 if (fd < 0 || fd > PROC_MAX_FD_NUM) in sys_getdents()
437 struct vfs_file_t *filp = current_pcb->fds[fd]; in sys_getdents()