1/*
2 * Copyright 2002-2012 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 */
13typedef struct {
14	time_t	tv_sec;
15} stat_beos_time;
16
17
18struct 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
36extern "C" {
37#endif
38
39extern void		convert_to_stat_beos(const struct stat* stat,
40					struct stat_beos* beosStat);
41extern 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