|
@@ -20,10 +20,10 @@
|
|
* Change Logs:
|
|
* Change Logs:
|
|
* Date Author Notes
|
|
* Date Author Notes
|
|
* 2009-05-27 Yi.qiu The first version.
|
|
* 2009-05-27 Yi.qiu The first version.
|
|
- * 2010-07-18 Bernard add stat and statfs structure definitions.
|
|
|
|
|
|
+ * 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.
|
|
* 2011-05-16 Yi.qiu Change parameter name of rename, "new" is C++ key word.
|
|
*/
|
|
*/
|
|
-
|
|
|
|
|
|
+
|
|
#ifndef __DFS_POSIX_H__
|
|
#ifndef __DFS_POSIX_H__
|
|
#define __DFS_POSIX_H__
|
|
#define __DFS_POSIX_H__
|
|
|
|
|
|
@@ -49,15 +49,15 @@ extern "C" {
|
|
#if !defined(_WIN32)
|
|
#if !defined(_WIN32)
|
|
#define S_IFMT DFS_S_IFMT
|
|
#define S_IFMT DFS_S_IFMT
|
|
#define S_IFSOCK DFS_S_IFSOCK
|
|
#define S_IFSOCK DFS_S_IFSOCK
|
|
-#define S_IFLNK DFS_S_IFLNK
|
|
|
|
-#define S_IFREG DFS_S_IFREG
|
|
|
|
-#define S_IFBLK DFS_S_IFBLK
|
|
|
|
-#define S_IFDIR DFS_S_IFDIR
|
|
|
|
-#define S_IFCHR DFS_S_IFCHR
|
|
|
|
-#define S_IFIFO DFS_S_IFIFO
|
|
|
|
-#define S_ISUID DFS_S_ISUID
|
|
|
|
-#define S_ISGID DFS_S_ISGID
|
|
|
|
-#define S_ISVTX DFS_S_ISVTX
|
|
|
|
|
|
+#define S_IFLNK DFS_S_IFLNK
|
|
|
|
+#define S_IFREG DFS_S_IFREG
|
|
|
|
+#define S_IFBLK DFS_S_IFBLK
|
|
|
|
+#define S_IFDIR DFS_S_IFDIR
|
|
|
|
+#define S_IFCHR DFS_S_IFCHR
|
|
|
|
+#define S_IFIFO DFS_S_IFIFO
|
|
|
|
+#define S_ISUID DFS_S_ISUID
|
|
|
|
+#define S_ISGID DFS_S_ISGID
|
|
|
|
+#define S_ISVTX DFS_S_ISVTX
|
|
|
|
|
|
#define S_ISLNK(m) (((m) & DFS_S_IFMT) == DFS_S_IFLNK)
|
|
#define S_ISLNK(m) (((m) & DFS_S_IFMT) == DFS_S_IFLNK)
|
|
#define S_ISREG(m) (((m) & DFS_S_IFMT) == DFS_S_IFREG)
|
|
#define S_ISREG(m) (((m) & DFS_S_IFMT) == DFS_S_IFREG)
|
|
@@ -94,7 +94,7 @@ extern "C" {
|
|
#define SEEK_END DFS_SEEK_END
|
|
#define SEEK_END DFS_SEEK_END
|
|
#endif
|
|
#endif
|
|
|
|
|
|
-typedef struct
|
|
|
|
|
|
+typedef struct
|
|
{
|
|
{
|
|
int fd; /* directory file */
|
|
int fd; /* directory file */
|
|
char buf[512];
|
|
char buf[512];
|
|
@@ -119,7 +119,7 @@ int closedir(DIR* d);
|
|
struct stat;
|
|
struct stat;
|
|
|
|
|
|
/* file api*/
|
|
/* file api*/
|
|
-int open(const char *file, int flags, int mode);
|
|
|
|
|
|
+int open(const char *file, int flags, ...);
|
|
int close(int d);
|
|
int close(int d);
|
|
#ifdef RT_USING_NEWLIB
|
|
#ifdef RT_USING_NEWLIB
|
|
_READ_WRITE_RETURN_TYPE _EXFUN(read, (int __fd, void *__buf, size_t __nbyte));
|
|
_READ_WRITE_RETURN_TYPE _EXFUN(read, (int __fd, void *__buf, size_t __nbyte));
|