Home
last modified time | relevance | path

Searched refs:filep (Results 1 – 25 of 42) sorted by relevance

12

/third_party/NuttX/fs/vfs/include/
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, int mode, off_t offset, off_t len);
[all …]
/third_party/NuttX/drivers/bch/
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->f_vnode; in bch_close()
[all …]
/third_party/NuttX/fs/vfs/
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->f_pos = offset; /* Might be beyond the end-of-file */ in file_seek64()
137 return filep->f_pos; in file_seek64()
183 struct file *filep; in lseek64() local
[all …]
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->f_pos; in file_seek()
163 struct file *filep; in lseek() local
167 int ret = fs_getfilep(fd, &filep); in lseek()
[all …]
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()
136 return file_dup(filep, minfd); in fs_dupfd()
Dfs_fcntl.c67 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->f_oflags |= oflags; in file_vfcntl()
259 struct file *filep = NULL; in fcntl() local
275 ret = fs_getfilep(fd, &filep); in fcntl()
[all …]
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()
Dfs_write.c66 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->f_oflags & O_DIRECTORY) in write()
232 if (filep->f_oflags & O_APPEND) in write()
234 if (file_seek64(filep, 0, SEEK_END) == -1) in write()
242 return file_write(filep, buf, nbytes); in write()
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()
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()
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()
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()
Dfs_read.c64 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->f_oflags & O_DIRECTORY) in read()
215 return file_read(filep, buf, nbytes); in read()
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()
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()
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()
Dfs_getfilep.c73 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/fs/inode/
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->f_vnode; in _files_close()
[all …]
/third_party/NuttX/drivers/video/
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
[all …]
/third_party/musl/libc-test/src/functionalext/supplement/stdio/
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/NuttX/drivers/pipes/
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->f_oflags & O_WRONLY) != 0) in pipecommon_close()
[all …]
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->ops = &pipe_fops; in pipe()
/third_party/musl/porting/liteos_m/kernel/src/stdio/
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/uniproton/kernel/src/stdio/
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/
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_table *fds) in hid_poll() argument
[all …]

12