* Made our struct stat POSIX compliant again -- the time_t fields have been
replaced by timespec fields. Via macros the structure is still source compatible with the old one. * Introduced header <compat/sys/stat.h> that defines the old stat structure (as stat_beos) and conversion functions * Introduced versions for [l,f]stat(). * Added symbol versions for BDirectory::GetStatFor() for sake of binary compatibility. * BStatable::GetStat(): Renamed the old method, changed its parameter to stat_beos*, and and made it private. Added a new version (using up a reserved vtable slot). It remains source and binary compatible. * BRefFilter::Filter(): Changed the struct stat* parameter to struct stat_beos* for sake of binary compatibility. This breaks source compatibility, though, which we can't help, since the class doesn't have reserved vtable slots. * Fixed several issues with the stat structure change, mostly adjusted uses of BRefFilter. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30830 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
|
||||
|
||||
struct stat {
|
||||
@@ -19,14 +20,21 @@ struct stat {
|
||||
off_t st_size; /* size in bytes of this file */
|
||||
dev_t st_rdev; /* device type (not used) */
|
||||
blksize_t st_blksize; /* preferred block size for I/O */
|
||||
time_t st_atime; /* last access time */
|
||||
time_t st_mtime; /* last modification time */
|
||||
time_t st_ctime; /* last change time, not creation time */
|
||||
time_t st_crtime; /* creation time */
|
||||
struct timespec st_atim; /* last access time */
|
||||
struct timespec st_mtim; /* last modification time */
|
||||
struct timespec st_ctim; /* last change time, not creation time */
|
||||
struct timespec st_crtim; /* creation time */
|
||||
unsigned int st_type; /* attribute/index type */
|
||||
blkcnt_t st_blocks; /* number of blocks allocated for object */
|
||||
};
|
||||
|
||||
/* source compatibility with old stat structure */
|
||||
#define st_atime st_atim.tv_sec
|
||||
#define st_mtime st_mtim.tv_sec
|
||||
#define st_ctime st_ctim.tv_sec
|
||||
#define st_crtime st_crtim.tv_sec
|
||||
|
||||
|
||||
/* extended file types */
|
||||
#define S_ATTR_DIR 01000000000 /* attribute directory */
|
||||
#define S_ATTR 02000000000 /* attribute */
|
||||
|
||||
Reference in New Issue
Block a user