mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-16 16:53:32 +08:00
60 lines
1.4 KiB
C
60 lines
1.4 KiB
C
/*
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*
|
|
* Change Logs:
|
|
* Date Author Notes
|
|
* 2009-05-27 Yi.qiu The first version.
|
|
* 2010-07-18 Bernard add stat and statfs structure definitions.
|
|
* 2011-05-16 Yi.qiu Change parameter name of rename, "new" is C++ key word.
|
|
* 2017-12-27 Bernard Add fcntl API.
|
|
* 2018-02-07 Bernard Change the 3rd parameter of open/fcntl/ioctl to '...'
|
|
*/
|
|
|
|
#ifndef __DFS_POSIX_H__
|
|
#define __DFS_POSIX_H__
|
|
|
|
#include <dfs_file.h>
|
|
#include <sys/stat.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
|
|
/* file api*/
|
|
|
|
int close(int d);
|
|
|
|
#if defined(RT_USING_NEWLIB) && defined(_EXFUN)
|
|
_READ_WRITE_RETURN_TYPE _EXFUN(read, (int __fd, void *__buf, size_t __nbyte));
|
|
_READ_WRITE_RETURN_TYPE _EXFUN(write, (int __fd, const void *__buf, size_t __nbyte));
|
|
#else
|
|
int read(int fd, void *buf, size_t len);
|
|
int write(int fd, const void *buf, size_t len);
|
|
#endif
|
|
|
|
off_t lseek(int fd, off_t offset, int whence);
|
|
int rename(const char *from, const char *to);
|
|
int unlink(const char *pathname);
|
|
int fsync(int fildes);
|
|
int ftruncate(int fd, off_t length);
|
|
|
|
/* directory api*/
|
|
int rmdir(const char *path);
|
|
int chdir(const char *path);
|
|
char *getcwd(char *buf, size_t size);
|
|
|
|
/* file system api */
|
|
int statfs(const char *path, struct statfs *buf);
|
|
|
|
int access(const char *path, int amode);
|
|
int pipe(int fildes[2]);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|