vfs: check userland buffers before reading them.
[haiku.git] / headers / posix / compat / sys / stat.h
blob94aeca1933d4bd82da255b8da32079f8f97c4d1e
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_
9 #include <sys/stat.h>
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;
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 */
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
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);
44 #ifdef __cplusplus
46 #endif
48 #endif /* _COMPAT_SYS_STAT_H_ */