xref: /haiku/headers/posix/compat/sys/stat.h (revision 1c09002cbee8e797a0f8bbfc5678dfadd39ee1a7)
1 /*
2  * Copyright 2002-2010 Haiku Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _COMPAT_SYS_STAT_H_
6 #define _COMPAT_SYS_STAT_H_
7 
8 
9 #include <sys/stat.h>
10 
11 
12 /* helper struct allowing us to avoid problems with the st_*time macros */
13 typedef struct {
14 	time_t	tv_sec;
15 } stat_beos_time;
16 
17 
18 struct stat_beos {
19 	dev_t			st_dev;			/* device ID that this file resides on */
20 	ino_t			st_ino;			/* this file's serial inode ID */
21 	mode_t			st_mode;		/* file mode (rwx for user, group, etc) */
22 	nlink_t			st_nlink;		/* number of hard links to this file */
23 	uid_t			st_uid;			/* user ID of the owner of this file */
24 	gid_t			st_gid;			/* group ID of the owner of this file */
25 	off_t			st_size;		/* size in bytes of this file */
26 	dev_t			st_rdev;		/* device type (not used) */
27 	blksize_t		st_blksize;		/* preferred block size for I/O */
28 	stat_beos_time	st_atim;		/* last access time */
29 	stat_beos_time	st_mtim;		/* last modification time */
30 	stat_beos_time	st_ctim;		/* last change time, not creation time */
31 	stat_beos_time	st_crtim;		/* creation time */
32 };
33 
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 extern void		convert_to_stat_beos(const struct stat* stat,
40 					struct stat_beos* beosStat);
41 extern void		convert_from_stat_beos(const struct stat_beos* beosStat,
42 					struct stat* stat);
43 
44 #ifdef __cplusplus
45 }
46 #endif
47 
48 #endif	/* _COMPAT_SYS_STAT_H_ */
49