1*4a5d661aSToomas Soome /*- 2*4a5d661aSToomas Soome * Copyright (c) 1982, 1986, 1989, 1993 3*4a5d661aSToomas Soome * The Regents of the University of California. All rights reserved. 4*4a5d661aSToomas Soome * (c) UNIX System Laboratories, Inc. 5*4a5d661aSToomas Soome * All or some portions of this file are derived from material licensed 6*4a5d661aSToomas Soome * to the University of California by American Telephone and Telegraph 7*4a5d661aSToomas Soome * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8*4a5d661aSToomas Soome * the permission of UNIX System Laboratories, Inc. 9*4a5d661aSToomas Soome * 10*4a5d661aSToomas Soome * Redistribution and use in source and binary forms, with or without 11*4a5d661aSToomas Soome * modification, are permitted provided that the following conditions 12*4a5d661aSToomas Soome * are met: 13*4a5d661aSToomas Soome * 1. Redistributions of source code must retain the above copyright 14*4a5d661aSToomas Soome * notice, this list of conditions and the following disclaimer. 15*4a5d661aSToomas Soome * 2. Redistributions in binary form must reproduce the above copyright 16*4a5d661aSToomas Soome * notice, this list of conditions and the following disclaimer in the 17*4a5d661aSToomas Soome * documentation and/or other materials provided with the distribution. 18*4a5d661aSToomas Soome * 4. Neither the name of the University nor the names of its contributors 19*4a5d661aSToomas Soome * may be used to endorse or promote products derived from this software 20*4a5d661aSToomas Soome * without specific prior written permission. 21*4a5d661aSToomas Soome * 22*4a5d661aSToomas Soome * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23*4a5d661aSToomas Soome * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24*4a5d661aSToomas Soome * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25*4a5d661aSToomas Soome * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26*4a5d661aSToomas Soome * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27*4a5d661aSToomas Soome * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28*4a5d661aSToomas Soome * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29*4a5d661aSToomas Soome * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30*4a5d661aSToomas Soome * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31*4a5d661aSToomas Soome * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32*4a5d661aSToomas Soome * SUCH DAMAGE. 33*4a5d661aSToomas Soome * 34*4a5d661aSToomas Soome * @(#)stat.h 8.12 (Berkeley) 6/16/95 35*4a5d661aSToomas Soome * $FreeBSD$ 36*4a5d661aSToomas Soome */ 37*4a5d661aSToomas Soome 38*4a5d661aSToomas Soome #ifndef _SYS_STAT_H_ 39*4a5d661aSToomas Soome #define _SYS_STAT_H_ 40*4a5d661aSToomas Soome 41*4a5d661aSToomas Soome #include <sys/cdefs.h> 42*4a5d661aSToomas Soome #include <sys/_timespec.h> 43*4a5d661aSToomas Soome #include <sys/_types.h> 44*4a5d661aSToomas Soome 45*4a5d661aSToomas Soome #ifndef _BLKSIZE_T_DECLARED 46*4a5d661aSToomas Soome typedef __blksize_t blksize_t; 47*4a5d661aSToomas Soome #define _BLKSIZE_T_DECLARED 48*4a5d661aSToomas Soome #endif 49*4a5d661aSToomas Soome 50*4a5d661aSToomas Soome #ifndef _BLKCNT_T_DECLARED 51*4a5d661aSToomas Soome typedef __blkcnt_t blkcnt_t; 52*4a5d661aSToomas Soome #define _BLKCNT_T_DECLARED 53*4a5d661aSToomas Soome #endif 54*4a5d661aSToomas Soome 55*4a5d661aSToomas Soome #ifndef _DEV_T_DECLARED 56*4a5d661aSToomas Soome typedef __dev_t dev_t; 57*4a5d661aSToomas Soome #define _DEV_T_DECLARED 58*4a5d661aSToomas Soome #endif 59*4a5d661aSToomas Soome 60*4a5d661aSToomas Soome #ifndef _FFLAGS_T_DECLARED 61*4a5d661aSToomas Soome typedef __fflags_t fflags_t; 62*4a5d661aSToomas Soome #define _FFLAGS_T_DECLARED 63*4a5d661aSToomas Soome #endif 64*4a5d661aSToomas Soome 65*4a5d661aSToomas Soome #ifndef _GID_T_DECLARED 66*4a5d661aSToomas Soome typedef __gid_t gid_t; 67*4a5d661aSToomas Soome #define _GID_T_DECLARED 68*4a5d661aSToomas Soome #endif 69*4a5d661aSToomas Soome 70*4a5d661aSToomas Soome #ifndef _INO_T_DECLARED 71*4a5d661aSToomas Soome typedef __ino_t ino_t; 72*4a5d661aSToomas Soome #define _INO_T_DECLARED 73*4a5d661aSToomas Soome #endif 74*4a5d661aSToomas Soome 75*4a5d661aSToomas Soome #ifndef _MODE_T_DECLARED 76*4a5d661aSToomas Soome typedef __mode_t mode_t; 77*4a5d661aSToomas Soome #define _MODE_T_DECLARED 78*4a5d661aSToomas Soome #endif 79*4a5d661aSToomas Soome 80*4a5d661aSToomas Soome #ifndef _NLINK_T_DECLARED 81*4a5d661aSToomas Soome typedef __nlink_t nlink_t; 82*4a5d661aSToomas Soome #define _NLINK_T_DECLARED 83*4a5d661aSToomas Soome #endif 84*4a5d661aSToomas Soome 85*4a5d661aSToomas Soome #ifndef _OFF_T_DECLARED 86*4a5d661aSToomas Soome typedef __off_t off_t; 87*4a5d661aSToomas Soome #define _OFF_T_DECLARED 88*4a5d661aSToomas Soome #endif 89*4a5d661aSToomas Soome 90*4a5d661aSToomas Soome #ifndef _UID_T_DECLARED 91*4a5d661aSToomas Soome typedef __uid_t uid_t; 92*4a5d661aSToomas Soome #define _UID_T_DECLARED 93*4a5d661aSToomas Soome #endif 94*4a5d661aSToomas Soome 95*4a5d661aSToomas Soome #if !defined(_KERNEL) && __BSD_VISIBLE 96*4a5d661aSToomas Soome /* 97*4a5d661aSToomas Soome * XXX We get miscellaneous namespace pollution with this. 98*4a5d661aSToomas Soome */ 99*4a5d661aSToomas Soome #include <sys/time.h> 100*4a5d661aSToomas Soome #endif 101*4a5d661aSToomas Soome 102*4a5d661aSToomas Soome #ifdef _KERNEL 103*4a5d661aSToomas Soome struct ostat { 104*4a5d661aSToomas Soome __uint16_t st_dev; /* inode's device */ 105*4a5d661aSToomas Soome ino_t st_ino; /* inode's number */ 106*4a5d661aSToomas Soome mode_t st_mode; /* inode protection mode */ 107*4a5d661aSToomas Soome nlink_t st_nlink; /* number of hard links */ 108*4a5d661aSToomas Soome __uint16_t st_uid; /* user ID of the file's owner */ 109*4a5d661aSToomas Soome __uint16_t st_gid; /* group ID of the file's group */ 110*4a5d661aSToomas Soome __uint16_t st_rdev; /* device type */ 111*4a5d661aSToomas Soome __int32_t st_size; /* file size, in bytes */ 112*4a5d661aSToomas Soome struct timespec st_atim; /* time of last access */ 113*4a5d661aSToomas Soome struct timespec st_mtim; /* time of last data modification */ 114*4a5d661aSToomas Soome struct timespec st_ctim; /* time of last file status change */ 115*4a5d661aSToomas Soome __int32_t st_blksize; /* optimal blocksize for I/O */ 116*4a5d661aSToomas Soome __int32_t st_blocks; /* blocks allocated for file */ 117*4a5d661aSToomas Soome fflags_t st_flags; /* user defined flags for file */ 118*4a5d661aSToomas Soome __uint32_t st_gen; /* file generation number */ 119*4a5d661aSToomas Soome }; 120*4a5d661aSToomas Soome #endif 121*4a5d661aSToomas Soome 122*4a5d661aSToomas Soome struct stat { 123*4a5d661aSToomas Soome __dev_t st_dev; /* inode's device */ 124*4a5d661aSToomas Soome ino_t st_ino; /* inode's number */ 125*4a5d661aSToomas Soome mode_t st_mode; /* inode protection mode */ 126*4a5d661aSToomas Soome nlink_t st_nlink; /* number of hard links */ 127*4a5d661aSToomas Soome uid_t st_uid; /* user ID of the file's owner */ 128*4a5d661aSToomas Soome gid_t st_gid; /* group ID of the file's group */ 129*4a5d661aSToomas Soome __dev_t st_rdev; /* device type */ 130*4a5d661aSToomas Soome struct timespec st_atim; /* time of last access */ 131*4a5d661aSToomas Soome struct timespec st_mtim; /* time of last data modification */ 132*4a5d661aSToomas Soome struct timespec st_ctim; /* time of last file status change */ 133*4a5d661aSToomas Soome off_t st_size; /* file size, in bytes */ 134*4a5d661aSToomas Soome blkcnt_t st_blocks; /* blocks allocated for file */ 135*4a5d661aSToomas Soome blksize_t st_blksize; /* optimal blocksize for I/O */ 136*4a5d661aSToomas Soome fflags_t st_flags; /* user defined flags for file */ 137*4a5d661aSToomas Soome __uint32_t st_gen; /* file generation number */ 138*4a5d661aSToomas Soome __int32_t st_lspare; 139*4a5d661aSToomas Soome struct timespec st_birthtim; /* time of file creation */ 140*4a5d661aSToomas Soome /* 141*4a5d661aSToomas Soome * Explicitly pad st_birthtim to 16 bytes so that the size of 142*4a5d661aSToomas Soome * struct stat is backwards compatible. We use bitfields instead 143*4a5d661aSToomas Soome * of an array of chars so that this doesn't require a C99 compiler 144*4a5d661aSToomas Soome * to compile if the size of the padding is 0. We use 2 bitfields 145*4a5d661aSToomas Soome * to cover up to 64 bits on 32-bit machines. We assume that 146*4a5d661aSToomas Soome * CHAR_BIT is 8... 147*4a5d661aSToomas Soome */ 148*4a5d661aSToomas Soome unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); 149*4a5d661aSToomas Soome unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); 150*4a5d661aSToomas Soome }; 151*4a5d661aSToomas Soome 152*4a5d661aSToomas Soome #ifdef _KERNEL 153*4a5d661aSToomas Soome struct nstat { 154*4a5d661aSToomas Soome __dev_t st_dev; /* inode's device */ 155*4a5d661aSToomas Soome ino_t st_ino; /* inode's number */ 156*4a5d661aSToomas Soome __uint32_t st_mode; /* inode protection mode */ 157*4a5d661aSToomas Soome __uint32_t st_nlink; /* number of hard links */ 158*4a5d661aSToomas Soome uid_t st_uid; /* user ID of the file's owner */ 159*4a5d661aSToomas Soome gid_t st_gid; /* group ID of the file's group */ 160*4a5d661aSToomas Soome __dev_t st_rdev; /* device type */ 161*4a5d661aSToomas Soome struct timespec st_atim; /* time of last access */ 162*4a5d661aSToomas Soome struct timespec st_mtim; /* time of last data modification */ 163*4a5d661aSToomas Soome struct timespec st_ctim; /* time of last file status change */ 164*4a5d661aSToomas Soome off_t st_size; /* file size, in bytes */ 165*4a5d661aSToomas Soome blkcnt_t st_blocks; /* blocks allocated for file */ 166*4a5d661aSToomas Soome blksize_t st_blksize; /* optimal blocksize for I/O */ 167*4a5d661aSToomas Soome fflags_t st_flags; /* user defined flags for file */ 168*4a5d661aSToomas Soome __uint32_t st_gen; /* file generation number */ 169*4a5d661aSToomas Soome struct timespec st_birthtim; /* time of file creation */ 170*4a5d661aSToomas Soome /* 171*4a5d661aSToomas Soome * See above about the following padding. 172*4a5d661aSToomas Soome */ 173*4a5d661aSToomas Soome unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); 174*4a5d661aSToomas Soome unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); 175*4a5d661aSToomas Soome }; 176*4a5d661aSToomas Soome #endif 177*4a5d661aSToomas Soome 178*4a5d661aSToomas Soome #ifndef _KERNEL 179*4a5d661aSToomas Soome #define st_atime st_atim.tv_sec 180*4a5d661aSToomas Soome #define st_mtime st_mtim.tv_sec 181*4a5d661aSToomas Soome #define st_ctime st_ctim.tv_sec 182*4a5d661aSToomas Soome #if __BSD_VISIBLE 183*4a5d661aSToomas Soome #define st_birthtime st_birthtim.tv_sec 184*4a5d661aSToomas Soome #endif 185*4a5d661aSToomas Soome 186*4a5d661aSToomas Soome /* For compatibility. */ 187*4a5d661aSToomas Soome #if __BSD_VISIBLE 188*4a5d661aSToomas Soome #define st_atimespec st_atim 189*4a5d661aSToomas Soome #define st_mtimespec st_mtim 190*4a5d661aSToomas Soome #define st_ctimespec st_ctim 191*4a5d661aSToomas Soome #define st_birthtimespec st_birthtim 192*4a5d661aSToomas Soome #endif 193*4a5d661aSToomas Soome #endif /* !_KERNEL */ 194*4a5d661aSToomas Soome 195*4a5d661aSToomas Soome #define S_ISUID 0004000 /* set user id on execution */ 196*4a5d661aSToomas Soome #define S_ISGID 0002000 /* set group id on execution */ 197*4a5d661aSToomas Soome #if __BSD_VISIBLE 198*4a5d661aSToomas Soome #define S_ISTXT 0001000 /* sticky bit */ 199*4a5d661aSToomas Soome #endif 200*4a5d661aSToomas Soome 201*4a5d661aSToomas Soome #define S_IRWXU 0000700 /* RWX mask for owner */ 202*4a5d661aSToomas Soome #define S_IRUSR 0000400 /* R for owner */ 203*4a5d661aSToomas Soome #define S_IWUSR 0000200 /* W for owner */ 204*4a5d661aSToomas Soome #define S_IXUSR 0000100 /* X for owner */ 205*4a5d661aSToomas Soome 206*4a5d661aSToomas Soome #if __BSD_VISIBLE 207*4a5d661aSToomas Soome #define S_IREAD S_IRUSR 208*4a5d661aSToomas Soome #define S_IWRITE S_IWUSR 209*4a5d661aSToomas Soome #define S_IEXEC S_IXUSR 210*4a5d661aSToomas Soome #endif 211*4a5d661aSToomas Soome 212*4a5d661aSToomas Soome #define S_IRWXG 0000070 /* RWX mask for group */ 213*4a5d661aSToomas Soome #define S_IRGRP 0000040 /* R for group */ 214*4a5d661aSToomas Soome #define S_IWGRP 0000020 /* W for group */ 215*4a5d661aSToomas Soome #define S_IXGRP 0000010 /* X for group */ 216*4a5d661aSToomas Soome 217*4a5d661aSToomas Soome #define S_IRWXO 0000007 /* RWX mask for other */ 218*4a5d661aSToomas Soome #define S_IROTH 0000004 /* R for other */ 219*4a5d661aSToomas Soome #define S_IWOTH 0000002 /* W for other */ 220*4a5d661aSToomas Soome #define S_IXOTH 0000001 /* X for other */ 221*4a5d661aSToomas Soome 222*4a5d661aSToomas Soome #if __XSI_VISIBLE 223*4a5d661aSToomas Soome #define S_IFMT 0170000 /* type of file mask */ 224*4a5d661aSToomas Soome #define S_IFIFO 0010000 /* named pipe (fifo) */ 225*4a5d661aSToomas Soome #define S_IFCHR 0020000 /* character special */ 226*4a5d661aSToomas Soome #define S_IFDIR 0040000 /* directory */ 227*4a5d661aSToomas Soome #define S_IFBLK 0060000 /* block special */ 228*4a5d661aSToomas Soome #define S_IFREG 0100000 /* regular */ 229*4a5d661aSToomas Soome #define S_IFLNK 0120000 /* symbolic link */ 230*4a5d661aSToomas Soome #define S_IFSOCK 0140000 /* socket */ 231*4a5d661aSToomas Soome #define S_ISVTX 0001000 /* save swapped text even after use */ 232*4a5d661aSToomas Soome #endif 233*4a5d661aSToomas Soome #if __BSD_VISIBLE 234*4a5d661aSToomas Soome #define S_IFWHT 0160000 /* whiteout */ 235*4a5d661aSToomas Soome #endif 236*4a5d661aSToomas Soome 237*4a5d661aSToomas Soome #define S_ISDIR(m) (((m) & 0170000) == 0040000) /* directory */ 238*4a5d661aSToomas Soome #define S_ISCHR(m) (((m) & 0170000) == 0020000) /* char special */ 239*4a5d661aSToomas Soome #define S_ISBLK(m) (((m) & 0170000) == 0060000) /* block special */ 240*4a5d661aSToomas Soome #define S_ISREG(m) (((m) & 0170000) == 0100000) /* regular file */ 241*4a5d661aSToomas Soome #define S_ISFIFO(m) (((m) & 0170000) == 0010000) /* fifo or socket */ 242*4a5d661aSToomas Soome #if __POSIX_VISIBLE >= 200112 243*4a5d661aSToomas Soome #define S_ISLNK(m) (((m) & 0170000) == 0120000) /* symbolic link */ 244*4a5d661aSToomas Soome #define S_ISSOCK(m) (((m) & 0170000) == 0140000) /* socket */ 245*4a5d661aSToomas Soome #endif 246*4a5d661aSToomas Soome #if __BSD_VISIBLE 247*4a5d661aSToomas Soome #define S_ISWHT(m) (((m) & 0170000) == 0160000) /* whiteout */ 248*4a5d661aSToomas Soome #endif 249*4a5d661aSToomas Soome 250*4a5d661aSToomas Soome #if __BSD_VISIBLE 251*4a5d661aSToomas Soome #define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */ 252*4a5d661aSToomas Soome /* 7777 */ 253*4a5d661aSToomas Soome #define ALLPERMS (S_ISUID|S_ISGID|S_ISTXT|S_IRWXU|S_IRWXG|S_IRWXO) 254*4a5d661aSToomas Soome /* 0666 */ 255*4a5d661aSToomas Soome #define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) 256*4a5d661aSToomas Soome 257*4a5d661aSToomas Soome #define S_BLKSIZE 512 /* block size used in the stat struct */ 258*4a5d661aSToomas Soome 259*4a5d661aSToomas Soome /* 260*4a5d661aSToomas Soome * Definitions of flags stored in file flags word. 261*4a5d661aSToomas Soome * 262*4a5d661aSToomas Soome * Super-user and owner changeable flags. 263*4a5d661aSToomas Soome */ 264*4a5d661aSToomas Soome #define UF_SETTABLE 0x0000ffff /* mask of owner changeable flags */ 265*4a5d661aSToomas Soome #define UF_NODUMP 0x00000001 /* do not dump file */ 266*4a5d661aSToomas Soome #define UF_IMMUTABLE 0x00000002 /* file may not be changed */ 267*4a5d661aSToomas Soome #define UF_APPEND 0x00000004 /* writes to file may only append */ 268*4a5d661aSToomas Soome #define UF_OPAQUE 0x00000008 /* directory is opaque wrt. union */ 269*4a5d661aSToomas Soome #define UF_NOUNLINK 0x00000010 /* file may not be removed or renamed */ 270*4a5d661aSToomas Soome /* 271*4a5d661aSToomas Soome * These two bits are defined in MacOS X. They are not currently used in 272*4a5d661aSToomas Soome * FreeBSD. 273*4a5d661aSToomas Soome */ 274*4a5d661aSToomas Soome #if 0 275*4a5d661aSToomas Soome #define UF_COMPRESSED 0x00000020 /* file is compressed */ 276*4a5d661aSToomas Soome #define UF_TRACKED 0x00000040 /* renames and deletes are tracked */ 277*4a5d661aSToomas Soome #endif 278*4a5d661aSToomas Soome 279*4a5d661aSToomas Soome #define UF_SYSTEM 0x00000080 /* Windows system file bit */ 280*4a5d661aSToomas Soome #define UF_SPARSE 0x00000100 /* sparse file */ 281*4a5d661aSToomas Soome #define UF_OFFLINE 0x00000200 /* file is offline */ 282*4a5d661aSToomas Soome #define UF_REPARSE 0x00000400 /* Windows reparse point file bit */ 283*4a5d661aSToomas Soome #define UF_ARCHIVE 0x00000800 /* file needs to be archived */ 284*4a5d661aSToomas Soome #define UF_READONLY 0x00001000 /* Windows readonly file bit */ 285*4a5d661aSToomas Soome /* This is the same as the MacOS X definition of UF_HIDDEN. */ 286*4a5d661aSToomas Soome #define UF_HIDDEN 0x00008000 /* file is hidden */ 287*4a5d661aSToomas Soome 288*4a5d661aSToomas Soome /* 289*4a5d661aSToomas Soome * Super-user changeable flags. 290*4a5d661aSToomas Soome */ 291*4a5d661aSToomas Soome #define SF_SETTABLE 0xffff0000 /* mask of superuser changeable flags */ 292*4a5d661aSToomas Soome #define SF_ARCHIVED 0x00010000 /* file is archived */ 293*4a5d661aSToomas Soome #define SF_IMMUTABLE 0x00020000 /* file may not be changed */ 294*4a5d661aSToomas Soome #define SF_APPEND 0x00040000 /* writes to file may only append */ 295*4a5d661aSToomas Soome #define SF_NOUNLINK 0x00100000 /* file may not be removed or renamed */ 296*4a5d661aSToomas Soome #define SF_SNAPSHOT 0x00200000 /* snapshot inode */ 297*4a5d661aSToomas Soome 298*4a5d661aSToomas Soome #ifdef _KERNEL 299*4a5d661aSToomas Soome /* 300*4a5d661aSToomas Soome * Shorthand abbreviations of above. 301*4a5d661aSToomas Soome */ 302*4a5d661aSToomas Soome #define OPAQUE (UF_OPAQUE) 303*4a5d661aSToomas Soome #define APPEND (UF_APPEND | SF_APPEND) 304*4a5d661aSToomas Soome #define IMMUTABLE (UF_IMMUTABLE | SF_IMMUTABLE) 305*4a5d661aSToomas Soome #define NOUNLINK (UF_NOUNLINK | SF_NOUNLINK) 306*4a5d661aSToomas Soome #endif 307*4a5d661aSToomas Soome 308*4a5d661aSToomas Soome #endif /* __BSD_VISIBLE */ 309*4a5d661aSToomas Soome 310*4a5d661aSToomas Soome #if __POSIX_VISIBLE >= 200809 311*4a5d661aSToomas Soome #define UTIME_NOW -1 312*4a5d661aSToomas Soome #define UTIME_OMIT -2 313*4a5d661aSToomas Soome #endif 314*4a5d661aSToomas Soome 315*4a5d661aSToomas Soome #ifndef _KERNEL 316*4a5d661aSToomas Soome __BEGIN_DECLS 317*4a5d661aSToomas Soome #if __BSD_VISIBLE 318*4a5d661aSToomas Soome int chflags(const char *, unsigned long); 319*4a5d661aSToomas Soome int chflagsat(int, const char *, unsigned long, int); 320*4a5d661aSToomas Soome #endif 321*4a5d661aSToomas Soome int chmod(const char *, mode_t); 322*4a5d661aSToomas Soome #if __BSD_VISIBLE 323*4a5d661aSToomas Soome int fchflags(int, unsigned long); 324*4a5d661aSToomas Soome #endif 325*4a5d661aSToomas Soome #if __POSIX_VISIBLE >= 200112 326*4a5d661aSToomas Soome int fchmod(int, mode_t); 327*4a5d661aSToomas Soome #endif 328*4a5d661aSToomas Soome #if __POSIX_VISIBLE >= 200809 329*4a5d661aSToomas Soome int fchmodat(int, const char *, mode_t, int); 330*4a5d661aSToomas Soome int futimens(int fd, const struct timespec times[2]); 331*4a5d661aSToomas Soome int utimensat(int fd, const char *path, const struct timespec times[2], 332*4a5d661aSToomas Soome int flag); 333*4a5d661aSToomas Soome #endif 334*4a5d661aSToomas Soome int fstat(int, struct stat *); 335*4a5d661aSToomas Soome #if __BSD_VISIBLE 336*4a5d661aSToomas Soome int lchflags(const char *, unsigned long); 337*4a5d661aSToomas Soome int lchmod(const char *, mode_t); 338*4a5d661aSToomas Soome #endif 339*4a5d661aSToomas Soome #if __POSIX_VISIBLE >= 200112 340*4a5d661aSToomas Soome int lstat(const char * __restrict, struct stat * __restrict); 341*4a5d661aSToomas Soome #endif 342*4a5d661aSToomas Soome int mkdir(const char *, mode_t); 343*4a5d661aSToomas Soome int mkfifo(const char *, mode_t); 344*4a5d661aSToomas Soome #if !defined(_MKNOD_DECLARED) && __XSI_VISIBLE 345*4a5d661aSToomas Soome int mknod(const char *, mode_t, dev_t); 346*4a5d661aSToomas Soome #define _MKNOD_DECLARED 347*4a5d661aSToomas Soome #endif 348*4a5d661aSToomas Soome int stat(const char * __restrict, struct stat * __restrict); 349*4a5d661aSToomas Soome mode_t umask(mode_t); 350*4a5d661aSToomas Soome #if __POSIX_VISIBLE >= 200809 351*4a5d661aSToomas Soome int fstatat(int, const char *, struct stat *, int); 352*4a5d661aSToomas Soome int mkdirat(int, const char *, mode_t); 353*4a5d661aSToomas Soome int mkfifoat(int, const char *, mode_t); 354*4a5d661aSToomas Soome #endif 355*4a5d661aSToomas Soome #if __XSI_VISIBLE >= 700 356*4a5d661aSToomas Soome int mknodat(int, const char *, mode_t, dev_t); 357*4a5d661aSToomas Soome #endif 358*4a5d661aSToomas Soome __END_DECLS 359*4a5d661aSToomas Soome #endif /* !_KERNEL */ 360*4a5d661aSToomas Soome 361*4a5d661aSToomas Soome #endif /* !_SYS_STAT_H_ */ 362