diff --git a/include/fcntl.h b/include/fcntl.h index 381cf5cad8..7671c0aca0 100644 --- a/include/fcntl.h +++ b/include/fcntl.h @@ -128,6 +128,13 @@ #define DN_RENAME 4 /* A file was renamed */ #define DN_ATTRIB 5 /* Attributes of a file were changed */ +/* int creat(const char *path, mode_t mode); + * + * is equivalent to open with O_WRONLY|O_CREAT|O_TRUNC. + */ + +#define creat(path, mode) open(path, O_WRONLY|O_CREAT|O_TRUNC, mode) + /******************************************************************************** * Public Type Definitions ********************************************************************************/ @@ -143,10 +150,6 @@ struct flock pid_t l_pid; /* PID of process blocking our lock (F_GETLK only) */ }; -/******************************************************************************** - * Public Variables - ********************************************************************************/ - /******************************************************************************** * Public Function Prototypes ********************************************************************************/ @@ -154,16 +157,20 @@ struct flock #undef EXTERN #if defined(__cplusplus) #define EXTERN extern "C" -extern "C" { +extern "C" +{ #else #define EXTERN extern #endif +/******************************************************************************** + * Public Data + ********************************************************************************/ + /* POSIX-like File System Interfaces */ -EXTERN int creat(const char *path, mode_t mode); -EXTERN int open(const char *path, int oflag, ...); -EXTERN int fcntl(int fd, int cmd, ...); +int open(const char *path, int oflag, ...); +int fcntl(int fd, int cmd, ...); #undef EXTERN #if defined(__cplusplus)