Home
last modified time | relevance | path

Searched refs:filep (Results 1 - 25 of 40) sorted by relevance

12

/third_party/NuttX/fs/vfs/include/
H A Dfile.h127 int (*open)(struct file *filep);
134 int (*close)(struct file *filep);
135 ssize_t (*read)(struct file *filep, char *buffer, size_t buflen);
136 ssize_t (*write)(struct file *filep, const char *buffer, size_t buflen);
137 off_t (*seek)(struct file *filep, off_t offset, int whence);
138 int (*ioctl)(struct file *filep, int cmd, unsigned long arg);
139 int (*mmap)(struct file* filep, struct VmMapRegion *region);
142 int (*poll)(struct file *filep, poll_table *fds);
143 int (*stat)(struct file *filep, struct stat* st);
144 int (*fallocate)(struct file* filep, in
[all...]
/third_party/NuttX/fs/vfs/
H A Dfs_lseek64.c76 off64_t file_seek64(struct file *filep, off64_t offset, int whence) in file_seek64() argument
82 DEBUGASSERT(filep); in file_seek64()
83 vnode = filep->f_vnode; in file_seek64()
93 if (filep->ops != NULL && filep->ops->seek != NULL) in file_seek64()
95 pos = filep->ops->seek(filep, offset, whence); in file_seek64()
103 filep->f_pos = pos; in file_seek64()
111 offset += filep->f_pos; in file_seek64()
118 filep in file_seek64()
183 struct file *filep; lseek64() local
[all...]
H A Dfs_lseek.c58 off_t file_seek(struct file *filep, off_t offset, int whence) in file_seek() argument
64 vnode = filep->f_vnode; in file_seek()
74 if (filep->ops != NULL && filep->ops->seek != NULL) in file_seek()
76 pos = filep->ops->seek(filep, offset, whence); in file_seek()
84 filep->f_pos = pos; in file_seek()
92 offset += (off_t)filep->f_pos; in file_seek()
99 filep->f_pos = (loff_t)offset; /* Might be beyond the end-of-file */ in file_seek()
117 return (off_t)filep in file_seek()
163 struct file *filep; lseek() local
[all...]
H A Dfs_dupfd.c79 int file_dup(struct file *filep, int minfd) in file_dup() argument
85 if ((filep->f_vnode == NULL) || (filep->f_path == NULL)) in file_dup()
93 filep2 = files_allocate(filep->f_vnode, filep->f_oflags, filep->f_pos, filep->f_priv, minfd); in file_dup()
99 filep2->f_refcount = filep->f_refcount; in file_dup()
123 struct file *filep; in fs_dupfd() local
127 int ret = fs_getfilep(fd, &filep); in fs_dupfd()
[all...]
H A Dfs_fsync.c50 int file_fsync(struct file *filep) in file_fsync() argument
56 if ((filep->f_oflags & O_ACCMODE) == 0) in file_fsync()
67 if (!filep || !filep->ops || !filep->ops->fsync) in file_fsync()
75 ret = filep->ops->fsync(filep); in file_fsync()
98 struct file *filep = NULL; in fsync() local
102 int ret = fs_getfilep(fd, &filep); in fsync()
111 return file_fsync(filep); in fsync()
[all...]
H A Dfs_fcntl.c55 * filep - Instance for struct file for the opened file.
67 int file_vfcntl(struct file *filep, int cmd, va_list ap) in file_vfcntl() argument
74 if (!filep || !filep->f_vnode) in file_vfcntl()
96 ret = file_dup(filep, va_arg(ap, int)); in file_vfcntl()
108 ret = (filep->f_oflags & O_CLOEXEC) ? FD_CLOEXEC : 0; in file_vfcntl()
125 filep->f_oflags |= O_CLOEXEC; in file_vfcntl()
145 ret = filep->f_oflags; in file_vfcntl()
163 filep->f_oflags &= ~FFCNTL; in file_vfcntl()
164 filep in file_vfcntl()
259 struct file *filep = NULL; fcntl() local
321 struct file *filep = NULL; fcntl64() local
[all...]
H A Dfs_write.c55 * filep - Instance of struct file to use with the write
66 ssize_t file_write(struct file *filep, const void *buf, size_t nbytes) in file_write() argument
79 if ((((unsigned int)(filep->f_oflags)) & O_ACCMODE) == O_RDONLY) in file_write()
87 if (!filep->ops || !filep->ops->write) in file_write()
95 ret = filep->ops->write(filep, (const char *)buf, nbytes); in file_write()
160 struct file *filep; in write() local
219 int ret = fs_getfilep(fd, &filep); in write()
226 if (filep in write()
[all...]
H A Dfs_pread64.c65 ssize_t file_pread64(struct file *filep, void *buf, size_t nbytes, in file_pread64() argument
77 savepos = file_seek64(filep, 0, SEEK_CUR); in file_pread64()
87 pos = file_seek64(filep, offset, SEEK_SET); in file_pread64()
97 ret = file_read(filep, buf, nbytes); in file_pread64()
102 pos = file_seek64(filep, savepos, SEEK_SET); in file_pread64()
148 struct file *filep; in pread64() local
152 int ret = fs_getfilep(fd, &filep); in pread64()
159 if (filep->f_oflags & O_DIRECTORY) in pread64()
167 return file_pread64(filep, buf, nbytes, offset); in pread64()
H A Dfs_pread.c47 ssize_t file_pread(struct file *filep, void *buf, size_t nbytes, in file_pread() argument
59 savepos = file_seek(filep, 0, SEEK_CUR); in file_pread()
69 pos = file_seek(filep, offset, SEEK_SET); in file_pread()
79 ret = file_read(filep, buf, nbytes); in file_pread()
84 pos = file_seek(filep, savepos, SEEK_SET); in file_pread()
130 struct file *filep; in pread() local
134 int ret = fs_getfilep(fd, &filep); in pread()
142 if (filep->f_oflags & O_DIRECTORY) in pread()
150 return file_pread(filep, buf, nbytes, offset); in pread()
H A Dfs_pwrite64.c65 static ssize_t file_pwrite64(struct file *filep, const void *buf, in file_pwrite64() argument
77 savepos = file_seek64(filep, 0, SEEK_CUR); in file_pwrite64()
87 pos = file_seek64(filep, offset, SEEK_SET); in file_pwrite64()
97 ret = file_write(filep, buf, nbytes); in file_pwrite64()
102 pos = file_seek64(filep, savepos, SEEK_SET); in file_pwrite64()
152 struct file *filep; in pwrite64() local
156 int ret = fs_getfilep(fd, &filep); in pwrite64()
163 if (filep->f_oflags & O_DIRECTORY) in pwrite64()
171 return file_pwrite64(filep, buf, nbytes, offset); in pwrite64()
H A Dfs_pwrite.c47 ssize_t file_pwrite(struct file *filep, const void *buf, in file_pwrite() argument
59 savepos = file_seek(filep, 0, SEEK_CUR); in file_pwrite()
69 pos = file_seek(filep, offset, SEEK_SET); in file_pwrite()
79 ret = file_write(filep, buf, nbytes); in file_pwrite()
84 pos = file_seek(filep, savepos, SEEK_SET); in file_pwrite()
134 struct file *filep; in pwrite() local
138 int ret = fs_getfilep(fd, &filep); in pwrite()
146 if (filep->f_oflags & O_DIRECTORY) in pwrite()
154 return file_pwrite(filep, buf, nbytes, offset); in pwrite()
H A Dfs_read.c54 * filep - File structure instance
64 ssize_t file_read(struct file *filep, void *buf, size_t nbytes) in file_read() argument
75 else if (((unsigned int)(filep->f_oflags) & O_ACCMODE) == O_WRONLY) in file_read()
86 else if (filep->ops && filep->ops->read) in file_read()
93 ret = (int)filep->ops->read(filep, (char *)buf, (size_t)nbytes); in file_read()
136 struct file *filep = NULL; in read() local
200 int ret = fs_getfilep(fd, &filep); in read()
207 if (filep in read()
[all...]
H A Dfs_truncate64.c63 static int file_truncate64(struct file *filep, off64_t length) in file_truncate64() argument
70 if (((unsigned int)(filep->f_oflags) & O_ACCMODE) == O_RDONLY) in file_truncate64()
81 vnode = filep->f_vnode; in file_truncate64()
141 struct file *filep = NULL; in ftruncate64() local
159 int ret = fs_getfilep(fd, &filep); in ftruncate64()
166 if (filep->f_oflags & O_DIRECTORY) in ftruncate64()
174 return file_truncate64(filep, length); in ftruncate64()
H A Dfs_truncate.c44 static int file_truncate(struct file *filep, off_t length) in file_truncate() argument
52 if (((unsigned int)(filep->f_oflags) & O_ACCMODE) == O_RDONLY) in file_truncate()
63 vnode = filep->f_vnode; in file_truncate()
124 struct file *filep = NULL; in ftruncate() local
142 int ret = fs_getfilep(fd, &filep); in ftruncate()
150 if (filep->f_oflags & O_DIRECTORY) in ftruncate()
158 return file_truncate(filep, length); in ftruncate()
H A Dfs_ioctl.c81 struct file *filep; in fs_ioctl() local
126 ret = fs_getfilep(fd, &filep); in fs_ioctl()
135 if (filep->ops && filep->ops->ioctl) in fs_ioctl()
139 ret = (int) filep->ops->ioctl(filep, req, arg); in fs_ioctl()
H A Dfs_getfilep.c65 * filep - The location to return the struct file instance
73 static int fs_getfilep_normal(int fd, struct file **filep) in fs_getfilep_normal() argument
77 *filep = (struct file *)NULL; in fs_getfilep_normal()
109 *filep = &list->fl_files[fd]; in fs_getfilep_normal()
113 int fs_getfilep(int fd, struct file **filep) in fs_getfilep() argument
115 int ret = fs_getfilep_normal(fd, filep); in fs_getfilep()
/third_party/NuttX/drivers/bch/
H A Dbchdev_driver.c45 static int bch_open(struct file *filep);
46 static int bch_close(struct file *filep);
47 static off_t bch_seek(struct file *filep, off_t offset, int whence);
48 static ssize_t bch_read(struct file *filep, char *buffer,
50 static ssize_t bch_write(struct file *filep, const char *buffer,
52 static int bch_ioctl(struct file *filep, int cmd,
84 static int bch_open(struct file *filep) in bch_open() argument
86 struct Vnode *vnode = filep->f_vnode; in bch_open()
115 static int bch_close(struct file *filep) in bch_close() argument
117 struct Vnode *vnode = filep in bch_close()
174 bch_seek(struct file *filep, off_t offset, int whence) bch_seek() argument
238 bch_read(struct file *filep, char *buffer, size_t len) bch_read() argument
261 bch_write(struct file *filep, const char *buffer, size_t len) bch_write() argument
292 bch_ioctl(struct file *filep, int cmd, unsigned long arg) bch_ioctl() argument
[all...]
/third_party/NuttX/drivers/video/
H A Dfb.c64 static int fb_open(struct file *filep);
65 static int fb_close(struct file *filep);
66 static ssize_t fb_read(struct file *filep, char *buffer, size_t buflen);
67 static ssize_t fb_write(struct file *filep, const char *buffer, size_t buflen);
68 static off_t fb_seek(struct file *filep, off_t offset, int whence);
69 static int fb_ioctl(struct file *filep, int cmd, unsigned long arg);
70 static ssize_t fb_mmap(struct file* filep, LosVmMapRegion *region);
97 static ssize_t fb_mmap(struct file *filep, LosVmMapRegion *region) in fb_mmap() argument
104 drvData = (struct drv_data *)filep->f_vnode->data; in fb_mmap()
133 static int fb_open(struct file *filep) in fb_open() argument
170 fb_close(struct file *filep) fb_close() argument
203 fb_read(struct file *filep, char *buffer, size_t len) fb_read() argument
248 fb_write(struct file *filep, const char *buffer, size_t len) fb_write() argument
301 fb_seek(struct file *filep, off_t offset, int whence) fb_seek() argument
369 fb_ioctl(struct file *filep, int cmd, unsigned long arg) fb_ioctl() argument
[all...]
/third_party/NuttX/fs/inode/
H A Dfs_files.c145 void file_hold(struct file *filep) in file_hold() argument
154 if (filep != NULL) in file_hold()
156 assert(filep->f_refcount > 0); in file_hold()
157 filep->f_refcount++; in file_hold()
162 void file_release(struct file *filep) in file_release() argument
171 if (filep != NULL) in file_release()
173 assert(filep->f_refcount > 0); in file_release()
174 filep->f_refcount--; in file_release()
190 static int _files_close(struct file *filep) in _files_close() argument
192 struct Vnode *vnode = filep in _files_close()
428 struct file *filep = NULL; files_allocate() local
555 struct file *filep = &list->fl_files[fd]; files_release() local
648 struct file *filep = NULL; files_refer() local
[all...]
/third_party/musl/libc-test/src/functionalext/supplement/stdio/
H A Dfunlockfile.c28 FILE *filep = fopen(path, "r+"); in child_func() local
29 if (filep == NULL) { in child_func()
33 flockfile(filep); in child_func()
35 if (fseek(filep, 0L, SEEK_SET) == -1) { in child_func()
38 int ret = fread(buf, 64, 1, filep); in child_func()
44 if (fseek(filep, 0L, SEEK_SET) == -1) { in child_func()
47 ret = fwrite(buf, strlen(buf), 1, filep); in child_func()
49 funlockfile(filep); in child_func()
51 fclose(filep); in child_func()
/third_party/musl/porting/uniproton/kernel/src/stdio/
H A D__stdio_seek.c8 struct file *filep = NULL;
12 ret = fs_getfilep(fd, &filep);
20 if (filep->f_oflags & O_DIRECTORY) {
22 if (filep->f_dir == NULL) {
26 rewinddir(filep->f_dir);
28 seekdir(filep->f_dir, offsetLow);
30 ret = telldir(filep->f_dir);
38 ret = file_seek64(filep, offset, whence);
/third_party/musl/porting/liteos_m/kernel/src/stdio/
H A D__stdio_seek.c8 struct file *filep = NULL;
12 ret = fs_getfilep(fd, &filep);
20 if (filep->f_oflags & O_DIRECTORY) {
22 if (filep->f_dir == NULL) {
26 rewinddir(filep->f_dir);
28 seekdir(filep->f_dir, offsetLow);
30 ret = telldir(filep->f_dir);
38 ret = file_seek64(filep, offset, whence);
/third_party/NuttX/drivers/usbdev/gadget/
H A Dusbd_hid.c47 static int hid_open(FAR struct file *filep);
48 static int hid_close(FAR struct file *filep);
49 static ssize_t hid_read(FAR struct file *filep, FAR char *buffer, size_t buflen);
50 static ssize_t hid_write(FAR struct file *filep, FAR const char *buffer, size_t buflen);
51 static ssize_t hid_poll(FAR struct file *filep, poll_table *fds);
68 static int hid_open(FAR struct file *filep) in hid_open() argument
70 struct hid_dev_s *hid = (struct hid_dev_s *)filep->f_inode->i_private; in hid_open()
83 static int hid_close(FAR struct file *filep) in hid_close() argument
85 struct hid_dev_s *hid = (struct hid_dev_s *)filep->f_inode->i_private; in hid_close()
209 static ssize_t hid_poll(FAR struct file *filep, poll_tabl argument
234 hid_read(FAR struct file *filep, FAR char *buffer, size_t buflen) hid_read() argument
272 hid_write(FAR struct file *filep, FAR const char *buffer, size_t buflen) hid_write() argument
[all...]
/third_party/NuttX/drivers/pipes/
H A Dpipe_common.c169 int pipecommon_open(struct file *filep) in pipecommon_open() argument
171 struct Vnode *vnode = filep->f_vnode; in pipecommon_open()
210 if ((filep->f_oflags & O_WRONLY) != 0) in pipecommon_open()
229 if ((filep->f_oflags & O_WRONLY) == 0) in pipecommon_open()
241 if ((filep->f_oflags & O_WRONLY) == 0 && /* Read-only */ in pipecommon_open()
265 (void)pipecommon_close(filep); in pipecommon_open()
278 int pipecommon_close(struct file *filep) in pipecommon_close() argument
280 struct Vnode *vnode = filep->f_vnode; in pipecommon_close()
284 if (dev == NULL || filep->f_vnode->useCount <= 1) in pipecommon_close()
308 if ((filep in pipecommon_close()
376 pipecommon_read(struct file *filep, char *buffer, size_t len) pipecommon_read() argument
536 pipecommon_write(struct file *filep, const char *buffer, size_t len) pipecommon_write() argument
698 pipecommon_poll(struct file *filep, poll_table *table) pipecommon_poll() argument
775 pipecommon_ioctl(struct file *filep, int cmd, unsigned long arg) pipecommon_ioctl() argument
[all...]
H A Dpipe.c51 static int pipe_close(struct file *filep);
60 static ssize_t pipe_map(struct file* filep, LosVmMapRegion *region) in pipe_map() argument
131 static int pipe_close(struct file *filep) in pipe_close() argument
133 struct Vnode *vnode = filep->f_vnode; in pipe_close()
144 ret = pipecommon_close(filep); in pipe_close()
249 struct file *filep = NULL; in pipe() local
329 ret = fs_getfilep(fd[0], &filep); in pipe()
330 filep->ops = &pipe_fops; in pipe()
332 ret = fs_getfilep(fd[1], &filep); in pipe()
333 filep in pipe()
[all...]

Completed in 9 milliseconds

12