* Introduced new fs_lopen_attr_dir() function that opens the attribute

directory of a file without traversing leaf links (just like lstat()).
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42620 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2011-08-10 21:08:00 +00:00
parent 33272012fb
commit d5e36fb599
5 changed files with 52 additions and 55 deletions
+3 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009, Haiku Inc. All Rights Reserved.
* Copyright 2002-2011, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _FS_ATTR_H
@@ -35,6 +35,7 @@ extern int fs_fopen_attr(int fd, const char *attribute, uint32 type,
extern int fs_close_attr(int fd);
extern DIR *fs_open_attr_dir(const char *path);
extern DIR *fs_lopen_attr_dir(const char *path);
extern DIR *fs_fopen_attr_dir(int fd);
extern int fs_close_attr_dir(DIR *dir);
extern struct dirent *fs_read_attr_dir(DIR *dir);
@@ -44,4 +45,5 @@ extern void fs_rewind_attr_dir(DIR *dir);
}
#endif
#endif /* _FS_ATTR_H */
+3 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009, Axel Dörfler, [email protected].
* Copyright 2002-2011, Axel Dörfler, [email protected].
* Distributed under the terms of the MIT License.
*
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
@@ -199,7 +199,8 @@ status_t _user_access(int fd, const char *path, int mode,
ssize_t _user_select(int numfds, fd_set *readSet, fd_set *writeSet,
fd_set *errorSet, bigtime_t timeout, const sigset_t *sigMask);
ssize_t _user_poll(struct pollfd *fds, int numfds, bigtime_t timeout);
int _user_open_attr_dir(int fd, const char *path);
int _user_open_attr_dir(int fd, const char *path,
bool traverseLeafLink);
ssize_t _user_read_attr(int fd, const char *attribute, off_t pos,
void *buffer, size_t readBytes);
ssize_t _user_write_attr(int fd, const char *attribute, uint32 type,
+4 -5
View File
@@ -280,7 +280,8 @@ extern ssize_t _kern_select(int numfds, struct fd_set *readSet,
extern ssize_t _kern_poll(struct pollfd *fds, int numFDs,
bigtime_t timeout);
extern int _kern_open_attr_dir(int fd, const char *path);
extern int _kern_open_attr_dir(int fd, const char *path,
bool traverseLeafLink);
extern ssize_t _kern_read_attr(int fd, const char *attribute, off_t pos,
void *buffer, size_t readBytes);
extern ssize_t _kern_write_attr(int fd, const char *attribute, uint32 type,
@@ -435,10 +436,8 @@ extern status_t _kern_sync_memory(void *address, size_t size, int flags);
extern status_t _kern_memory_advice(void *address, size_t size,
uint32 advice);
extern status_t _kern_get_memory_properties(team_id teamID,
const void *address,
uint32* _protected,
uint32* _lock);
extern status_t _kern_get_memory_properties(team_id teamID,
const void *address, uint32* _protected, uint32* _lock);
/* kernel port functions */
extern port_id _kern_create_port(int32 queue_length, const char *name);