Home
last modified time | relevance | path

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

/tests/
Dwritetest.c23 write(int fd, int i) in write() argument
30 ret = OSWrite(fd, inbuf, off, sizeof(inbuf)); in write()
45 int fd; in writetest() local
48 fd = OSOpen(TMPFILE, 0); in writetest()
49 if (fd < 0) { in writetest()
55 write(fd, i); in writetest()
59 read(int fd, int i) in read() argument
64 ret = OSRead(fd, outbuf, off, sizeof(outbuf)); in read()
88 int fd; in readtest() local
91 fd = OSOpen(TMPFILE, 0); in readtest()
[all …]
Dfiotest.c14 uint64_t fd = OSOpen("/LICENSE", 0); in main() local
17 int status = OSWrite(fd, "123456789\n", i*10, 10); in main()
/lib/libc/
Dsyscall.c59 OSRead(uint64_t fd, void *addr, uint64_t off, uint64_t length) in OSRead() argument
61 return syscall(SYSCALL_READ, fd, addr, off, length); in OSRead()
65 OSWrite(uint64_t fd, const void *addr, uint64_t off, uint64_t length) in OSWrite() argument
67 return syscall(SYSCALL_WRITE, fd, addr, off, length); in OSWrite()
71 OSFlush(uint64_t fd) in OSFlush() argument
73 return syscall(SYSCALL_FLUSH, fd); in OSFlush()
83 OSClose(uint64_t fd) in OSClose() argument
85 return syscall(SYSCALL_CLOSE, fd); in OSClose()
95 OSReadDir(uint64_t fd, char *buf, size_t length, uint64_t *offset) in OSReadDir() argument
97 return syscall(SYSCALL_READDIR, fd, buf, length, offset); in OSReadDir()
[all …]
Dfile.c58 fh->fd = 0; in _free_file()
68 uint64_t fd; in fopen() local
72 fd = OSOpen(path, 0); in fopen()
73 if (fd == 0) in fopen()
77 fh->fd = fd; in fopen()
88 int status = OSClose(fh->fd); in fclose()
112 return OSRead(fh->fd, buf, 0, size * nmemb); in fread()
119 return OSWrite(fh->fd, buf, 0, size * nmemb); in fwrite()
Ddir.c15 d->fd = OSOpen(path, 0); in opendir()
16 if (d->fd < 0) { in opendir()
27 int status = OSReadDir(d->fd, (char *)&d->de, sizeof(struct dirent), &d->offset); in readdir()
56 OSClose(d->fd); in closedir()
/sys/kern/
Dhandle.c51 handle->fd = proc->nextFD; in Handle_Add()
55 slot = handle->fd % PROCESS_HANDLE_SLOTS; in Handle_Add()
59 return handle->fd; in Handle_Add()
65 int slot = handle->fd % PROCESS_HANDLE_SLOTS; in Handle_Remove()
71 Handle_Lookup(Process *proc, uint64_t fd) in Handle_Lookup() argument
73 int slot = fd % PROCESS_HANDLE_SLOTS; in Handle_Lookup()
77 if (handle->fd == fd) in Handle_Lookup()
Dsyscall.c219 Syscall_Read(uint64_t fd, uint64_t addr, uint64_t off, uint64_t length) in Syscall_Read() argument
223 Handle *handle = Handle_Lookup(cur->proc, fd); in Syscall_Read()
237 Syscall_Write(uint64_t fd, uint64_t addr, uint64_t off, uint64_t length) in Syscall_Write() argument
241 Handle *handle = Handle_Lookup(cur->proc, fd); in Syscall_Write()
255 Syscall_Flush(uint64_t fd) in Syscall_Flush() argument
259 Handle *handle = Handle_Lookup(cur->proc, fd); in Syscall_Flush()
314 Syscall_Close(uint64_t fd) in Syscall_Close() argument
318 Handle *handle = Handle_Lookup(cur->proc, fd); in Syscall_Close()
358 Syscall_ReadDir(uint64_t fd, char *user_buf, size_t len, uintptr_t user_off) in Syscall_ReadDir() argument
362 Handle *handle = Handle_Lookup(cur->proc, fd); in Syscall_ReadDir()
/lib/liblwip/src/include/lwip/
Dsio.h72 void sio_send(u8_t c, sio_fd_t fd);
83 u8_t sio_recv(sio_fd_t fd);
98 u32_t sio_read(sio_fd_t fd, u8_t *data, u32_t len);
111 u32_t sio_tryread(sio_fd_t fd, u8_t *data, u32_t len);
125 u32_t sio_write(sio_fd_t fd, u8_t *data, u32_t len);
134 void sio_read_abort(sio_fd_t fd);
/bin/ls/
Dls.c15 int fd; in main() local
24 fd = OSOpen(argv[1], 0); in main()
25 if (fd < 0) { in main()
33 status = OSReadDir(fd, (char *)&de, sizeof(de), &offset); in main()
/include/
Dsyscall.h22 int OSRead(uint64_t fd, void *addr, uint64_t off, uint64_t length);
23 int OSWrite(uint64_t fd, const void *addr, uint64_t off, uint64_t length);
24 int OSFlush(uint64_t fd);
26 int OSClose(uint64_t fd);
30 int OSReadDir(uint64_t fd, char *buf, size_t length, uint64_t *offset);
Ddirent.h8 int fd; member
Dstdio.h10 uint64_t fd; /* Kernel File Descriptor */ member
/bin/cat/
Dcat.c16 int status, fd; in main() local
35 fd = OSOpen(argv[1], 0); in main()
39 OSRead(fd, &buf, i, len); in main()
/sbin/newfs_o2fs/
Dnewfs_o2fs.c46 int fd = open(manifest, O_RDONLY); in LoadManifest() local
49 if (fd < 0) { in LoadManifest()
54 fstat(fd, &manifeststat); in LoadManifest()
56 read(fd, tokenBuf, manifeststat.st_size); in LoadManifest()
128 int fd; in AddFile() local
139 fd = open(file, O_RDONLY); in AddFile()
140 if (fd < 0) { in AddFile()
145 int len = read(fd, tempbuf, blockSize); in AddFile()
159 close(fd); in AddFile()
/lib/liblwip/src/netif/ppp/
Dppp.h143 int pppOverSerialOpen(sio_fd_t fd, pppLinkStatusCB_fn linkStatusCB, void *linkStatusCtx);
155 #define pppOpen(fd,cb,ls) pppOverSerialOpen(fd,cb,ls) argument
Dppp.c173 sio_fd_t fd; member
204 sio_fd_t fd; /* File device ID of port. */ member
352 sio_read_abort(pppControl[pd].fd); in pppRecvWakeup()
537 pppOverSerialOpen(sio_fd_t fd, pppLinkStatusCB_fn linkStatusCB, void *linkStatusCtx) in pppOverSerialOpen() argument
560 pc->rx.fd = fd; in pppOverSerialOpen()
563 pc->fd = fd; in pppOverSerialOpen()
709 if((c = sio_write(pc->fd, b->payload, b->len)) != b->len) { in nPut()
711 … incomplete sio_write(fd:%"SZT_F", len:%d, c: 0x%"X8_F") c = %d\n", (size_t)pc->fd, b->len, c, c)); in nPut()
994 *(sio_fd_t *)arg = pc->fd; in pppIOCtl()
1524 count = sio_read(pcrx->fd, pcrx->rxbuf, PPPOS_RX_BUFSIZE); in pppInputThread()
/sys/include/
Dmman.h18 void *mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset);
Dhandle.h18 uint64_t fd; // FD Number member
Dthread.h140 Handle *Handle_Lookup(Process *proc, uint64_t fd);
/lib/libc/posix/
Dmman.c35 mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset) in mmap() argument