xref: /haiku/src/system/libroot/posix/glibc/include/bits/stat.h (revision 544e3d2523c83293ae3950e4cc61bed99d3c8356)
187e239b9SJérôme Duval /* Copyright (C) 1992, 1996, 1997, 2000 Free Software Foundation, Inc.
287e239b9SJérôme Duval    This file is part of the GNU C Library.
387e239b9SJérôme Duval 
487e239b9SJérôme Duval    The GNU C Library is free software; you can redistribute it and/or
587e239b9SJérôme Duval    modify it under the terms of the GNU Lesser General Public
687e239b9SJérôme Duval    License as published by the Free Software Foundation; either
787e239b9SJérôme Duval    version 2.1 of the License, or (at your option) any later version.
887e239b9SJérôme Duval 
987e239b9SJérôme Duval    The GNU C Library is distributed in the hope that it will be useful,
1087e239b9SJérôme Duval    but WITHOUT ANY WARRANTY; without even the implied warranty of
1187e239b9SJérôme Duval    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1287e239b9SJérôme Duval    Lesser General Public License for more details.
1387e239b9SJérôme Duval 
1487e239b9SJérôme Duval    You should have received a copy of the GNU Lesser General Public
1587e239b9SJérôme Duval    License along with the GNU C Library; if not, write to the Free
1687e239b9SJérôme Duval    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1787e239b9SJérôme Duval    02111-1307 USA.  */
1887e239b9SJérôme Duval 
1987e239b9SJérôme Duval #ifndef _SYS_STAT_H
2087e239b9SJérôme Duval # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
2187e239b9SJérôme Duval #endif
2287e239b9SJérôme Duval 
2387e239b9SJérôme Duval /* This structure needs to be defined in accordance with the
2487e239b9SJérôme Duval    implementation of __stat, __fstat, and __lstat.  */
2587e239b9SJérôme Duval 
2687e239b9SJérôme Duval #include <bits/types.h>
2787e239b9SJérôme Duval 
2887e239b9SJérôme Duval #if 0
2987e239b9SJérôme Duval /* Structure describing file characteristics.  */
3087e239b9SJérôme Duval struct stat
3187e239b9SJérôme Duval   {
3287e239b9SJérôme Duval     /* These are the members that POSIX.1 requires.  */
3387e239b9SJérôme Duval 
3487e239b9SJérôme Duval     __mode_t st_mode;		/* File mode.  */
3587e239b9SJérôme Duval #ifndef __USE_FILE_OFFSET64
3687e239b9SJérôme Duval     __ino_t st_ino;		/* File serial number.  */
3787e239b9SJérôme Duval #else
3887e239b9SJérôme Duval     __ino64_t st_ino;		/* File serial number.	*/
3987e239b9SJérôme Duval #endif
4087e239b9SJérôme Duval     __dev_t st_dev;		/* Device containing the file.  */
4187e239b9SJérôme Duval     __nlink_t st_nlink;		/* Link count.  */
4287e239b9SJérôme Duval 
4387e239b9SJérôme Duval     __uid_t st_uid;		/* User ID of the file's owner.  */
4487e239b9SJérôme Duval     __gid_t st_gid;		/* Group ID of the file's group.  */
4587e239b9SJérôme Duval #ifndef __USE_FILE_OFFSET64
4687e239b9SJérôme Duval     __off_t st_size;		/* Size of file, in bytes.  */
4787e239b9SJérôme Duval #else
4887e239b9SJérôme Duval     __off64_t st_size;		/* Size of file, in bytes.  */
4987e239b9SJérôme Duval #endif
5087e239b9SJérôme Duval 
5187e239b9SJérôme Duval     __time_t st_atime;		/* Time of last access.  */
5287e239b9SJérôme Duval     __time_t st_mtime;		/* Time of last modification.  */
5387e239b9SJérôme Duval     __time_t st_ctime;		/* Time of last status change.  */
5487e239b9SJérôme Duval 
5587e239b9SJérôme Duval     /* This should be defined if there is a `st_blksize' member.  */
5687e239b9SJérôme Duval #undef	_STATBUF_ST_BLKSIZE
5787e239b9SJérôme Duval   };
5887e239b9SJérôme Duval #endif
5987e239b9SJérôme Duval 
6087e239b9SJérôme Duval /* Encoding of the file mode.  These are the standard Unix values,
6187e239b9SJérôme Duval    but POSIX.1 does not specify what values should be used.  */
6287e239b9SJérôme Duval 
6387e239b9SJérôme Duval #define	__S_IFMT	0170000	/* These bits determine file type.  */
6487e239b9SJérôme Duval 
6587e239b9SJérôme Duval /* File types.  */
6687e239b9SJérôme Duval #define	__S_IFDIR	0040000	/* Directory.  */
6787e239b9SJérôme Duval #define	__S_IFCHR	0020000	/* Character device.  */
6887e239b9SJérôme Duval #define	__S_IFBLK	0060000	/* Block device.  */
6987e239b9SJérôme Duval #define	__S_IFREG	0100000	/* Regular file.  */
7087e239b9SJérôme Duval #define	__S_IFIFO	0010000	/* FIFO.  */
7187e239b9SJérôme Duval 
7287e239b9SJérôme Duval /* POSIX.1b objects.  */
7387e239b9SJérôme Duval #define __S_TYPEISMQ(buf) 0
7487e239b9SJérôme Duval #define __S_TYPEISSEM(buf) 0
7587e239b9SJérôme Duval #define __S_TYPEISSHM(buf) 0
7687e239b9SJérôme Duval 
7787e239b9SJérôme Duval /* Protection bits.  */
7887e239b9SJérôme Duval 
7987e239b9SJérôme Duval #define	__S_ISUID	04000	/* Set user ID on execution.  */
8087e239b9SJérôme Duval #define	__S_ISGID	02000	/* Set group ID on execution.  */
8187e239b9SJérôme Duval #define	__S_IREAD	0400	/* Read by owner.  */
8287e239b9SJérôme Duval #define	__S_IWRITE	0200	/* Write by owner.  */
8387e239b9SJérôme Duval #define	__S_IEXEC	0100	/* Execute by owner.  */
8487e239b9SJérôme Duval 
85*544e3d25SIngo Weinhold #if 0
8687e239b9SJérôme Duval #ifdef __USE_LARGEFILE64
8787e239b9SJérôme Duval struct stat64
8887e239b9SJérôme Duval   {
8987e239b9SJérôme Duval     __mode_t st_mode;		/* File mode.  */
9087e239b9SJérôme Duval     __ino64_t st_ino;		/* File serial number.	*/
9187e239b9SJérôme Duval     __dev_t st_dev;		/* Device.  */
9287e239b9SJérôme Duval     __nlink_t st_nlink;		/* Link count.  */
9387e239b9SJérôme Duval 
9487e239b9SJérôme Duval     __uid_t st_uid;		/* User ID of the file's owner.	*/
9587e239b9SJérôme Duval     __gid_t st_gid;		/* Group ID of the file's group.*/
9687e239b9SJérôme Duval     __off64_t st_size;		/* Size of file, in bytes.  */
9787e239b9SJérôme Duval 
9887e239b9SJérôme Duval     __time_t st_atime;		/* Time of last access.  */
9987e239b9SJérôme Duval     __time_t st_mtime;		/* Time of last modification.  */
10087e239b9SJérôme Duval     __time_t st_ctime;		/* Time of last status change.  */
10187e239b9SJérôme Duval   };
10287e239b9SJérôme Duval #endif
103*544e3d25SIngo Weinhold #endif
104