Blame bits/stat.h

Packit 6c4009
/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#if !defined _SYS_STAT_H && !defined _FCNTL_H
Packit 6c4009
# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifndef _BITS_STAT_H
Packit 6c4009
#define _BITS_STAT_H	1
Packit 6c4009
Packit 6c4009
/* This structure needs to be defined in accordance with the
Packit 6c4009
   implementation of __stat, __fstat, and __lstat.  */
Packit 6c4009
Packit 6c4009
#include <bits/types.h>
Packit 6c4009
Packit 6c4009
/* Structure describing file characteristics.  */
Packit 6c4009
struct stat
Packit 6c4009
  {
Packit 6c4009
    /* These are the members that POSIX.1 requires.  */
Packit 6c4009
Packit 6c4009
    __mode_t st_mode;		/* File mode.  */
Packit 6c4009
#ifndef __USE_FILE_OFFSET64
Packit 6c4009
    __ino_t st_ino;		/* File serial number.  */
Packit 6c4009
#else
Packit 6c4009
    __ino64_t st_ino;		/* File serial number.	*/
Packit 6c4009
#endif
Packit 6c4009
    __dev_t st_dev;		/* Device containing the file.  */
Packit 6c4009
    __nlink_t st_nlink;		/* Link count.  */
Packit 6c4009
Packit 6c4009
    __uid_t st_uid;		/* User ID of the file's owner.  */
Packit 6c4009
    __gid_t st_gid;		/* Group ID of the file's group.  */
Packit 6c4009
#ifndef __USE_FILE_OFFSET64
Packit 6c4009
    __off_t st_size;		/* Size of file, in bytes.  */
Packit 6c4009
#else
Packit 6c4009
    __off64_t st_size;		/* Size of file, in bytes.  */
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
    __time_t st_atime;		/* Time of last access.  */
Packit 6c4009
    __time_t st_mtime;		/* Time of last modification.  */
Packit 6c4009
    __time_t st_ctime;		/* Time of last status change.  */
Packit 6c4009
Packit 6c4009
    /* This should be defined if there is a `st_blksize' member.  */
Packit 6c4009
#undef	_STATBUF_ST_BLKSIZE
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
/* Encoding of the file mode.  These are the standard Unix values,
Packit 6c4009
   but POSIX.1 does not specify what values should be used.  */
Packit 6c4009
Packit 6c4009
#define	__S_IFMT	0170000	/* These bits determine file type.  */
Packit 6c4009
Packit 6c4009
/* File types.  */
Packit 6c4009
#define	__S_IFDIR	0040000	/* Directory.  */
Packit 6c4009
#define	__S_IFCHR	0020000	/* Character device.  */
Packit 6c4009
#define	__S_IFBLK	0060000	/* Block device.  */
Packit 6c4009
#define	__S_IFREG	0100000	/* Regular file.  */
Packit 6c4009
#define	__S_IFIFO	0010000	/* FIFO.  */
Packit 6c4009
Packit 6c4009
/* POSIX.1b objects.  */
Packit 6c4009
#define __S_TYPEISMQ(buf) 0
Packit 6c4009
#define __S_TYPEISSEM(buf) 0
Packit 6c4009
#define __S_TYPEISSHM(buf) 0
Packit 6c4009
Packit 6c4009
/* Protection bits.  */
Packit 6c4009
Packit 6c4009
#define	__S_ISUID	04000	/* Set user ID on execution.  */
Packit 6c4009
#define	__S_ISGID	02000	/* Set group ID on execution.  */
Packit 6c4009
#define	__S_IREAD	0400	/* Read by owner.  */
Packit 6c4009
#define	__S_IWRITE	0200	/* Write by owner.  */
Packit 6c4009
#define	__S_IEXEC	0100	/* Execute by owner.  */
Packit 6c4009
Packit 6c4009
#ifdef __USE_LARGEFILE64
Packit 6c4009
struct stat64
Packit 6c4009
  {
Packit 6c4009
    __mode_t st_mode;		/* File mode.  */
Packit 6c4009
    __ino64_t st_ino;		/* File serial number.	*/
Packit 6c4009
    __dev_t st_dev;		/* Device.  */
Packit 6c4009
    __nlink_t st_nlink;		/* Link count.  */
Packit 6c4009
Packit 6c4009
    __uid_t st_uid;		/* User ID of the file's owner.	*/
Packit 6c4009
    __gid_t st_gid;		/* Group ID of the file's group.*/
Packit 6c4009
    __off64_t st_size;		/* Size of file, in bytes.  */
Packit 6c4009
Packit 6c4009
    __time_t st_atime;		/* Time of last access.  */
Packit 6c4009
    __time_t st_mtime;		/* Time of last modification.  */
Packit 6c4009
    __time_t st_ctime;		/* Time of last status change.  */
Packit 6c4009
  };
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#endif	/* bits/stat.h */