• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  * include/nuttx/fs/file.h
3  *
4  * Licensed to the Apache Software Foundation (ASF) under one or more
5  * contributor license agreements.  See the NOTICE file distributed with
6  * this work for additional information regarding copyright ownership.  The
7  * ASF licenses this file to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance with the
9  * License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
16  * License for the specific language governing permissions and limitations
17  * under the License.
18  *
19  ****************************************************************************/
20 
21 #ifndef __INCLUDE_FS_FILE_H
22 #define __INCLUDE_FS_FILE_H
23 
24 /****************************************************************************
25  * Included Files
26  ****************************************************************************/
27 
28 #include <compiler.h>
29 
30 #include <sys/types.h>
31 #include <stdarg.h>
32 #include <stdint.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif /* __cplusplus */
37 
38 
39 /****************************************************************************
40  * Global Function Prototypes
41  ****************************************************************************/
42 
43 /****************************************************************************
44 * Name: nxsched_get_files
45 *
46 * Description:
47 *   Get the file list.
48 *
49 ****************************************************************************/
50 
51 struct filelist *nxsched_get_files(void);
52 
53 /****************************************************************************
54  * Name: file_pread
55  *
56  * Description:
57  *   Equivalent to the standard pread function except that is accepts a
58  *   struct file instance instead of a file descriptor.  Currently used
59  *   only by aio_read().
60  *
61  ****************************************************************************/
62 
63 ssize_t file_pread(FAR struct file *filep, FAR void *buf, size_t nbytes,
64                    off_t offset);
65 
66 /****************************************************************************
67  * Name: file_pwrite
68  *
69  * Description:
70  *   Equivalent to the standard pwrite function except that is accepts a
71  *   struct file instance instead of a file descriptor.  Currently used
72  *   only by aio_write().
73  *
74  ****************************************************************************/
75 
76 ssize_t file_pwrite(FAR struct file *filep, FAR const void *buf,
77                     size_t nbytes, off_t offset);
78 
79 /****************************************************************************
80  * Name: file_seek64
81  *
82  * Description:
83  *   Equivalent to the standard lseek64() function except that is accepts a
84  *   struct file instance instead of a file descriptor.  Currently used
85  *   only by net_sendfile()
86  *
87  ****************************************************************************/
88 
89 off64_t file_seek64(FAR struct file *filep, off64_t offset, int whence);
90 
91 #ifdef __cplusplus
92 }
93 #endif /* __cplusplus */
94 #endif /* __INCLUDE_FS_FILE_H */
95