RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
|
宏定义 | |
#define | AT_FDCWD (-100) |
函数 | |
int | open (const char *file, int flags,...) |
RTM_EXPORT (open) | |
int | openat (int dirfd, const char *path, int flag,...) |
int | utimensat (int __fd, const char *__path, const struct timespec __times[2], int __flags) |
int | creat (const char *path, mode_t mode) |
RTM_EXPORT (creat) | |
int | close (int fd) |
RTM_EXPORT (close) | |
ssize_t | read (int fd, void *buf, size_t len) |
RTM_EXPORT (read) | |
ssize_t | write (int fd, const void *buf, size_t len) |
RTM_EXPORT (write) | |
off_t | lseek (int fd, off_t offset, int whence) |
RTM_EXPORT (lseek) | |
int | rename (const char *old_file, const char *new_file) |
RTM_EXPORT (rename) | |
int | unlink (const char *pathname) |
RTM_EXPORT (unlink) | |
int | stat (const char *file, struct stat *buf) |
RTM_EXPORT (stat) | |
int | fstat (int fildes, struct stat *buf) |
RTM_EXPORT (fstat) | |
int | fsync (int fildes) |
RTM_EXPORT (fsync) | |
int | fcntl (int fildes, int cmd,...) |
RTM_EXPORT (fcntl) | |
int | ioctl (int fildes, int cmd,...) |
RTM_EXPORT (ioctl) | |
int | ftruncate (int fd, off_t length) |
RTM_EXPORT (ftruncate) | |
int | statfs (const char *path, struct statfs *buf) |
RTM_EXPORT (statfs) | |
int | fstatfs (int fildes, struct statfs *buf) |
RTM_EXPORT (fstatfs) | |
int | mkdir (const char *path, mode_t mode) |
RTM_EXPORT (mkdir) | |
FINSH_FUNCTION_EXPORT (mkdir, create a directory) | |
int | rmdir (const char *pathname) |
RTM_EXPORT (rmdir) | |
DIR * | opendir (const char *name) |
RTM_EXPORT (opendir) | |
struct dirent * | readdir (DIR *d) |
RTM_EXPORT (readdir) | |
long | telldir (DIR *d) |
RTM_EXPORT (telldir) | |
void | seekdir (DIR *d, long offset) |
RTM_EXPORT (seekdir) | |
void | rewinddir (DIR *d) |
RTM_EXPORT (rewinddir) | |
int | closedir (DIR *d) |
RTM_EXPORT (closedir) | |
int | access (const char *path, int amode) |
void | setcwd (char *buf) |
RTM_EXPORT (setcwd) | |
char * | getcwd (char *buf, size_t size) |
RTM_EXPORT (getcwd) | |
ssize_t | pread (int fd, void *buf, size_t len, off_t offset) |
RTM_EXPORT (pread) | |
ssize_t | pwrite (int fd, const void *buf, size_t len, off_t offset) |
RTM_EXPORT (pwrite) | |
#define AT_FDCWD (-100) |
在文件 dfs_posix.c 第 92 行定义.
int open | ( | const char * | file, |
int | flags, | ||
... ) |
this function is a POSIX compliant version, which will open a file and return a file descriptor according specified flags.
file | the path name of file. |
flags | the file open flags. Common values include:
|
在文件 dfs_posix.c 第 48 行定义.
引用了 dfs_file_open(), fd_get(), fd_new(), fd_release(), dfs_file::flags, dfs_file::mode , 以及 RT_NULL.
int openat | ( | int | dirfd, |
const char * | path, | ||
int | flag, | ||
... ) |
Opens a file relative to a directory file descriptor.
dirfd | The file descriptor of the directory to base the relative path on. |
path | The path to the file to be opened, relative to the directory specified by dirfd . Can be an absolute path (in which case dirfd is ignored). |
flag | File access and status flags (e.g., O_RDONLY , O_WRONLY , O_CREAT ). |
-1
and sets errno
to indicate the error.dirfd
is a valid directory descriptor. When pathname
is absolute, the dirfd
argument is ignored. 在文件 dfs_posix.c 第 110 行定义.
引用了 AT_FDCWD, dfs_file::dentry, dfs_dentry_full_path(), fd_get(), open(), rt_free() , 以及 dfs_file::vnode.
int utimensat | ( | int | __fd, |
const char * | __path, | ||
const struct timespec | __times[2], | ||
int | __flags ) |
在文件 dfs_posix.c 第 154 行定义.
引用了 AT_FDCWD, AT_SYMLINK_NOFOLLOW, ATTR_ATIME_SET, ATTR_MTIME_SET, dfs_file::dentry, dfs_dentry_full_path(), dfs_file_lstat(), dfs_file_readlink(), dfs_file_setattr(), dfs_file_stat(), DFS_PATH_MAX, fd_get(), dfs_attr::ia_atime, dfs_attr::ia_mtime, dfs_attr::ia_valid, rt_free(), rt_malloc(), dfs_attr::st_mode, stat(), UTIME_NOW, UTIME_OMIT , 以及 dfs_file::vnode.
int creat | ( | const char * | path, |
mode_t | mode ) |
this function is a POSIX compliant version, which will create a new file or rewrite an existing one
path | the path name of file. |
mode | the file permission bits to be used in creating the file (not used, can be 0) |
在文件 dfs_posix.c 第 270 行定义.
引用了 open().
int close | ( | int | fd | ) |
this function is a POSIX compliant version, which will close the open file descriptor.
fd | the file descriptor. |
在文件 dfs_posix.c 第 284 行定义.
引用了 dfs_file_close(), fd_get() , 以及 fd_release().
ssize_t read | ( | int | fd, |
void * | buf, | ||
size_t | len ) |
this function is a POSIX compliant version, which will read specified data buffer length for an open file descriptor.
fd | the file descriptor. |
buf | the buffer to save the read data. |
len | the maximal length of data buffer |
在文件 dfs_posix.c 第 325 行定义.
引用了 dfs_file_read() , 以及 fd_get().
ssize_t write | ( | int | fd, |
const void * | buf, | ||
size_t | len ) |
this function is a POSIX compliant version, which will write specified data buffer length for an open file descriptor.
fd | the file descriptor |
buf | the data buffer to be written. |
len | the data buffer length. |
在文件 dfs_posix.c 第 370 行定义.
引用了 dfs_file_write() , 以及 fd_get().
off_t lseek | ( | int | fd, |
off_t | offset, | ||
int | whence ) |
this function is a POSIX compliant version, which will Reposition the file offset for an open file descriptor.
The lseek
function sets the file offset for the file descriptor fd
to a new value, determined by the offset
and whence
parameters. It can be used to seek to specific positions in a file for reading or writing.
fd | the file descriptor. |
offset | The offset, in bytes, to set the file position. The meaning of offset depends on the value of whence . |
whence | the directive of seek. It can be one of:
|
在文件 dfs_posix.c 第 420 行定义.
引用了 dfs_file_lseek() , 以及 fd_get().
int rename | ( | const char * | old_file, |
const char * | new_file ) |
this function is a POSIX compliant version, which will rename old file name to new file name.
old_file | the old file name. |
new_file | the new file name. |
note: the old and new file name must be belong to a same file system.
在文件 dfs_posix.c 第 456 行定义.
引用了 dfs_file_rename().
int unlink | ( | const char * | pathname | ) |
this function is a POSIX compliant version, which will unlink (remove) a specified path file from file system.
pathname | the specified path name to be unlinked. |
在文件 dfs_posix.c 第 486 行定义.
引用了 dfs_file_lstat(), dfs_file_unlink() , 以及 stat().
int stat | ( | const char * | file, |
struct stat * | buf ) |
this function is a POSIX compliant version, which will get file information.
file | the file name |
buf | the data buffer to save stat description. |
在文件 dfs_posix.c 第 526 行定义.
引用了 dfs_file_stat() , 以及 stat().
int fstat | ( | int | fildes, |
struct stat * | buf ) |
this function is a POSIX compliant version, which will get file status.
fildes | the file description |
buf | the data buffer to save stat description. |
在文件 dfs_posix.c 第 554 行定义.
引用了 dfs_file::dentry, dfs_is_mounted(), fd_get(), dfs_mnt::fs_ops, dfs_dentry::mnt, dfs_filesystem_ops::stat , 以及 stat().
int fsync | ( | int | fildes | ) |
this function is a POSIX compliant version, which shall request that all data for the open file descriptor named by fildes is to be transferred to the storage device associated with the file described by fildes.
fildes | the file description |
在文件 dfs_posix.c 第 594 行定义.
引用了 dfs_file_fsync() , 以及 fd_get().
int fcntl | ( | int | fildes, |
int | cmd, | ||
... ) |
this function is a POSIX compliant version, which shall perform a variety of control functions on devices.
fildes | the file description |
cmd | the specified command, Common values include:
|
... | represents the additional information that is needed by this specific device to perform the requested function. For example:
|
在文件 dfs_posix.c 第 631 行定义.
引用了 dfs_file_fcntl(), dfs_file_ioctl() , 以及 fd_get().
int ioctl | ( | int | fildes, |
int | cmd, | ||
... ) |
this function is a POSIX compliant version, which shall perform a variety of control functions on devices.
fildes | the file description |
cmd | the specified command |
... | represents the additional information that is needed by this specific device to perform the requested function. |
在文件 dfs_posix.c 第 679 行定义.
引用了 fcntl().
int ftruncate | ( | int | fd, |
off_t | length ) |
this function is a POSIX compliant version, which cause the regular file referenced by fd to be truncated to a size of precisely length bytes.
fd | the file descriptor. |
length | the length to be truncated. |
在文件 dfs_posix.c 第 703 行定义.
引用了 dfs_file_ftruncate() , 以及 fd_get().
RTM_EXPORT | ( | ftruncate | ) |
int statfs | ( | const char * | path, |
struct statfs * | buf ) |
this function is a POSIX compliant version, which will return the information about a mounted file system.
path | the path which mounted file system. |
buf | the buffer to save the returned information. |
在文件 dfs_posix.c 第 744 行定义.
引用了 dfs_statfs() , 以及 statfs().
int fstatfs | ( | int | fildes, |
struct statfs * | buf ) |
this function is a POSIX compliant version, which will return the information about a mounted file system.
fildes | the file description. |
buf | the buffer to save the returned information. |
在文件 dfs_posix.c 第 775 行定义.
引用了 dfs_file::dentry, dfs_is_mounted(), fd_get(), dfs_mnt::fs_ops, dfs_dentry::mnt, dfs_filesystem_ops::statfs , 以及 statfs().
int mkdir | ( | const char * | path, |
mode_t | mode ) |
this function is a POSIX compliant version, which will make a directory
path | the directory path to be made. |
mode | The permission mode for the new directory (unused here, can be set to 0). |
在文件 dfs_posix.c 第 812 行定义.
引用了 dfs_file_close(), dfs_file_deinit(), dfs_file_init(), dfs_file_lstat(), dfs_file_open(), dfs_file::mode , 以及 stat().
int rmdir | ( | const char * | pathname | ) |
this function is a POSIX compliant version, which will remove a directory.
pathname | the path name to be removed. |
在文件 dfs_posix.c 第 862 行定义.
引用了 closedir(), dfs_file_lstat(), dfs_file_unlink(), opendir(), readdir(), RT_NULL , 以及 stat().
DIR * opendir | ( | const char * | name | ) |
this function is a POSIX compliant version, which will open a directory.
name | the path name to be open. |
在文件 dfs_posix.c 第 928 行定义.
引用了 dfs_file_close(), dfs_file_isdir(), dfs_file_open(), fd_get(), fd_new(), fd_release(), rt_malloc() , 以及 RT_NULL.
struct dirent * readdir | ( | DIR * | d | ) |
this function is a POSIX compliant version, which will return a pointer to a dirent structure representing the next directory entry in the directory stream.
d | the directory stream pointer. |
在文件 dfs_posix.c 第 987 行定义.
引用了 dfs_file_getdents() , 以及 fd_get().
long telldir | ( | DIR * | d | ) |
this function is a POSIX compliant version, which will return current location in directory stream.
d | the directory stream pointer. |
在文件 dfs_posix.c 第 1044 行定义.
引用了 fd_get() , 以及 dfs_file::fpos.
void seekdir | ( | DIR * | d, |
long | offset ) |
this function is a POSIX compliant version, which will set position of next directory structure in the directory stream.
d | the directory stream. |
offset | the offset in directory stream. |
在文件 dfs_posix.c 第 1076 行定义.
引用了 dfs_file_lseek(), fd_get(), dfs_file::fpos , 以及 readdir().
void rewinddir | ( | DIR * | d | ) |
this function is a POSIX compliant version, which will reset directory stream.
d | the directory stream. |
在文件 dfs_posix.c 第 1120 行定义.
引用了 dfs_file_lseek() , 以及 fd_get().
RTM_EXPORT | ( | rewinddir | ) |
int closedir | ( | DIR * | d | ) |
this function is a POSIX compliant version, which will close a directory stream.
d | the directory stream. |
在文件 dfs_posix.c 第 1139 行定义.
引用了 dfs_file_close(), fd_get(), fd_release() , 以及 rt_free().
RTM_EXPORT | ( | closedir | ) |
int access | ( | const char * | path, |
int | amode ) |
this function is a POSIX compliant version, which shall check the file named by the pathname pointed to by the path argument for accessibility according to the bit pattern contained in amode.
path | the specified file/dir path. |
amode | the value is either the bitwise-inclusive OR of the access permissions to be checked (R_OK, W_OK, X_OK) or the existence test (F_OK). |
在文件 dfs_posix.c 第 1258 行定义.
引用了 stat().
void setcwd | ( | char * | buf | ) |
this function is a POSIX compliant version, which will set current working directory.
buf | the current directory. |
在文件 dfs_posix.c 第 1306 行定义.
引用了 dfs_lock(), DFS_PATH_MAX, dfs_unlock(), NO_WORKING_DIR, rt_kprintf , 以及 working_directory.
char * getcwd | ( | char * | buf, |
size_t | size ) |
this function is a POSIX compliant version, which will return current working directory.
buf | the returned current directory. |
size | the buffer size. |
在文件 dfs_posix.c 第 1339 行定义.
引用了 dfs_lock(), dfs_unlock(), NO_WORKING_DIR, rt_kprintf, RT_NULL , 以及 working_directory.
ssize_t pread | ( | int | fd, |
void * | buf, | ||
size_t | len, | ||
off_t | offset ) |
this function is a POSIX compliant version, which will read specified data buffer length for an open file descriptor.
fd | the file descriptor. |
buf | the buffer to save the read data. |
len | the maximal length of data buffer |
offset | the file pos |
在文件 dfs_posix.c 第 1385 行定义.
引用了 dfs_file_get_fpos(), dfs_file_pread(), dfs_file_set_fpos(), fd_get() , 以及 dfs_file::fpos.
ssize_t pwrite | ( | int | fd, |
const void * | buf, | ||
size_t | len, | ||
off_t | offset ) |
this function is a POSIX compliant version, which will write specified data buffer length for an open file descriptor.
fd | the file descriptor |
buf | the data buffer to be written. |
len | the data buffer length. |
offset | the file pos |
在文件 dfs_posix.c 第 1432 行定义.
引用了 dfs_file_get_fpos(), dfs_file_pwrite(), dfs_file_set_fpos(), fd_get() , 以及 dfs_file::fpos.