Implemented POSIX.1-2008 functions unlinkat(), symlinkat(), mkdirat(),

utimensat(), and futimens().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34010 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-11-12 19:14:42 +00:00
parent 3f98707eb3
commit 6c00aabc9e
7 changed files with 114 additions and 29 deletions
+1
View File
@@ -70,6 +70,7 @@
#define AT_SYMLINK_NOFOLLOW 0x1 /* fstatat(), fchmodat(), fchownat(),
utimensat() */
#define AT_SYMLINK_FOLLOW 0x2 /* linkat() */
#define AT_REMOVEDIR 0x04 /* unlinkat() */
#endif
/* advisory file locking */
+13
View File
@@ -101,6 +101,10 @@ struct stat {
#define DEFFILEMODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
/* default file mode, everyone can read/write */
/* special values for timespec::tv_nsec passed to utimensat(), futimens() */
#define UTIME_NOW 1000000000
#define UTIME_OMIT 1000000001
#ifdef __cplusplus
extern "C" {
#endif
@@ -114,9 +118,18 @@ extern int lstat(const char *path, struct stat *st);
extern int fstatat(int fd, const char *path, struct stat *st, int flag);
#endif
extern int mkdir(const char *path, mode_t mode);
#ifdef B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT
extern int mkdirat(int fd, const char *path, mode_t mode);
#endif
extern int mkfifo(const char *path, mode_t mode);
extern mode_t umask(mode_t cmask);
#ifdef B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT
extern int utimensat(int fd, const char *path,
const struct timespec times[2], int flag);
#endif
extern int futimens(int fd, const struct timespec times[2]);
#ifdef __cplusplus
}
#endif
+7 -1
View File
@@ -135,6 +135,9 @@ extern int dup2(int fd1, int fd2);
extern int close(int fd);
extern int link(const char *name, const char *new_name);
extern int unlink(const char *name);
#ifdef B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT
extern int unlinkat(int fd, const char *path, int flag);
#endif
extern int rmdir(const char *path);
extern ssize_t readlink(const char *path, char *buffer, size_t bufferSize);
@@ -142,7 +145,10 @@ extern ssize_t readlink(const char *path, char *buffer, size_t bufferSize);
extern ssize_t readlinkat(int fd, const char *path, char *buffer,
size_t bufferSize);
#endif
extern int symlink(const char *from, const char *to);
extern int symlink(const char *toPath, const char *symlinkPath);
#ifdef B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT
extern int symlinkat(const char *toPath, int fd, const char *symlinkPath);
#endif
extern int ftruncate(int fd, off_t newSize);
extern int truncate(const char *path, off_t newSize);