+++ /dev/null
-/** @file\r
-\r
- Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
- This program and the accompanying materials are licensed and made\r
- available under the terms and conditions of the BSD License that\r
- accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
- Copyright (c) 1982, 1986, 1989, 1993\r
- The Regents of the University of California. All rights reserved.\r
- (c) UNIX System Laboratories, Inc.\r
- All or some portions of this file are derived from material licensed\r
- to the University of California by American Telephone and Telegraph\r
- Co. or Unix System Laboratories, Inc. and are reproduced herein with\r
- the permission of UNIX System Laboratories, Inc.\r
-\r
- Redistribution and use in source and binary forms, with or without\r
- modification, are permitted provided that the following conditions\r
- are met:\r
- 1. Redistributions of source code must retain the above copyright\r
- notice, this list of conditions and the following disclaimer.\r
- 2. Redistributions in binary form must reproduce the above copyright\r
- notice, this list of conditions and the following disclaimer in the\r
- documentation and/or other materials provided with the distribution.\r
- 3. Neither the name of the University nor the names of its contributors\r
- may be used to endorse or promote products derived from this software\r
- without specific prior written permission.\r
-\r
- THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\r
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
- ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\r
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
- SUCH DAMAGE.\r
-\r
- stat.h 8.12 (Berkeley) 8/17/94\r
- NetBSD: stat.h,v 1.54 2006/02/24 22:01:30 thorpej Exp\r
- */\r
-#ifndef _SYS_STAT_H_\r
-#define _SYS_STAT_H_\r
-\r
-#include <sys/featuretest.h>\r
-#include <sys/types.h>\r
-#include <sys/time.h>\r
-\r
-struct stat {\r
- off_t st_size; ///< file size, in bytes\r
- off_t st_physsize; ///< physical space the file consumes\r
- off_t st_curpos; ///< current position within the file, or XY coord. for Console\r
- dtime_t st_birthtime; ///< time of creation\r
- dtime_t st_atime; ///< time of last access\r
- dtime_t st_mtime; ///< time of last data modification\r
- mode_t st_mode; ///< file attributes\r
-\r
- blksize_t st_blksize; ///< optimal blocksize for I/O\r
- uint32_t st_spare[1];\r
-};\r
-\r
-#define S_ISUID 0004000 ///< set user id on execution\r
-#define S_ISGID 0002000 ///< set group id on execution\r
-#define S_ISTXT 0001000 ///< sticky bit\r
-\r
-#define S_IRWXU 0000700 ///< RWX mask for owner\r
-#define S_IRUSR 0000400 ///< R for owner\r
-#define S_IWUSR 0000200 ///< W for owner\r
-#define S_IXUSR 0000100 ///< X for owner\r
-\r
-#define S_IREAD S_IRUSR\r
-#define S_IWRITE S_IWUSR\r
-#define S_IEXEC S_IXUSR\r
-\r
-#define S_IRWXG 0000070 ///< RWX mask for group\r
-#define S_IRGRP 0000040 ///< R for group\r
-#define S_IWGRP 0000020 ///< W for group\r
-#define S_IXGRP 0000010 ///< X for group\r
-\r
-#define S_IRWXO 0000007 ///< RWX mask for other\r
-#define S_IROTH 0000004 ///< R for other\r
-#define S_IWOTH 0000002 ///< W for other\r
-#define S_IXOTH 0000001 ///< X for other\r
-\r
-/* The Octal access modes, above, fall into the Hex mask 0x00000FFF.\r
- Traditionally, the remainder of the flags are specified in Octal\r
- but they are expressed in Hex here for modern clarity.\r
-\r
- The basic file types, specified within 0x0000F000, are mutually exclusive.\r
-*/\r
-#define _S_IFMT 0x000FF000 ///< type-of-file mask\r
-#define _S_IFIFO 0x00001000 ///< named pipe (fifo)\r
-#define _S_IFCHR 0x00002000 ///< character special device\r
-#define _S_IFDIR 0x00004000 ///< directory\r
-#define _S_IFBLK 0x00006000 ///< block special device\r
-#define _S_IFREG 0x00008000 ///< regular\r
-#define _S_IFSOCK 0x0000C000 ///< socket\r
-#define _S_ITTY 0x00010000 ///< File connects to a TTY device\r
-#define _S_IWTTY 0x00020000 ///< TTY sends and receives Wide characters\r
-#define _S_ICONSOLE 0x00030000 ///< UEFI Console Device\r
-\r
-/* UEFI specific (FAT file system) File attributes.\r
- Specified in Hexadecimal instead of Octal.\r
- These bits correspond to the xx portion of _S_IFMT\r
-*/\r
-#define S_IREADONLY 0x00100000 // Read Only File\r
-#define S_IHIDDEN 0x00200000 // Hidden File\r
-#define S_ISYSTEM 0x00400000 // System File\r
-#define S_IDIRECTORY 0x01000000 // Directory\r
-#define S_IARCHIVE 0x02000000 // Archive Bit\r
-#define S_IROFS 0x08000000 ///< Read Only File System\r
-\r
-#define S_EFIONLY 0xFFF00000 ///< Flags only used by the EFI system calls.\r
-\r
-#define S_EFISHIFT 20 // LS bit of the UEFI attributes\r
-\r
-#define S_IFMT _S_IFMT\r
-#define S_IFIFO _S_IFIFO\r
-#define S_IFCHR _S_IFCHR\r
-#define S_IFDIR _S_IFDIR\r
-#define S_IFBLK _S_IFBLK\r
-#define S_IFREG _S_IFREG\r
-#define S_IFSOCK _S_IFSOCK\r
-#define S_ITTY _S_ITTY\r
-#define S_IWTTY _S_IWTTY\r
-#define S_ICONSOLE _S_ICONSOLE\r
-\r
-#define S_ISFIFO(m) ((m & _S_IFMT) == _S_IFIFO) ///< fifo\r
-#define S_ISCHR(m) ((m & _S_IFMT) == _S_IFCHR) ///< char special\r
-#define S_ISDIR(m) ((m & _S_IFMT) == _S_IFDIR) ///< directory\r
-#define S_ISBLK(m) ((m & _S_IFMT) == _S_IFBLK) ///< block special\r
-#define S_ISREG(m) ((m & _S_IFMT) == _S_IFREG) ///< regular file\r
-#define S_ISSOCK(m) ((m & _S_IFMT) == _S_IFSOCK) ///< socket\r
-\r
-\r
-/* The following three macros have been changed to reflect\r
- access permissions that better reflect the UEFI FAT file system.\r
- UEFI only supports Read or Read+Write instead of the *nix\r
- rwx paradigm. Thus, using 0777 is the closest analog.\r
-*/\r
-#define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) ///< 0777\r
-#define ALLPERMS (S_IRWXU|S_IRWXG|S_IRWXO) ///< 0777\r
-#define DEFFILEMODE (S_IRWXU|S_IRWXG|S_IRWXO) ///< 0777\r
-\r
-#define READ_PERMS (S_IRUSR | S_IRGRP | S_IROTH) ///< 0444\r
-#define WRITE_PERMS (S_IWUSR | S_IWGRP | S_IWOTH) ///< 0222\r
-#define EXEC_PERMS (S_IXUSR | S_IXGRP | S_IXOTH) ///< 0111\r
-\r
-#define S_BLKSIZE 512 ///< block size used in the stat struct\r
-\r
-/*\r
- * Definitions of flags stored in file flags word.\r
- *\r
- * Super-user and owner changeable flags.\r
- */\r
-#define UF_SETTABLE 0x0000ffff ///< mask of owner changeable flags\r
-#define UF_NODUMP 0x00000001 ///< do not dump file\r
-#define UF_IMMUTABLE 0x00000002 ///< file may not be changed\r
-#define UF_APPEND 0x00000004 ///< writes to file may only append\r
-/* UF_NOUNLINK 0x00000010 [NOT IMPLEMENTED] */\r
-/*\r
- * Super-user changeable flags.\r
- */\r
-#define SF_SETTABLE 0xffff0000 ///< mask of superuser changeable flags\r
-#define SF_ARCHIVED 0x00010000 ///< file is archived\r
-#define SF_IMMUTABLE 0x00020000 ///< file may not be changed\r
-#define SF_APPEND 0x00040000 ///< writes to file may only append\r
-/* SF_NOUNLINK 0x00100000 [NOT IMPLEMENTED] */\r
-\r
-#include <sys/EfiCdefs.h>\r
-\r
-__BEGIN_DECLS\r
-#ifndef __STAT_SYSCALLS_DECLARED\r
- #define __STAT_SYSCALLS_DECLARED\r
-\r
- /**\r
- **/\r
- mode_t umask (mode_t);\r
-\r
- /**\r
- **/\r
- int mkdir (const char *, mode_t);\r
-\r
- /**\r
- **/\r
- int fstat (int, struct stat *);\r
-\r
- /**\r
- **/\r
- int lstat (const char *, struct stat *);\r
-\r
-/** Obtains information about the file pointed to by path.\r
-\r
- Opens the file pointed to by path, calls _EFI_FileInfo with the file's handle,\r
- then closes the file.\r
-\r
- @param[in] path Path to the file to obtain information about.\r
- @param[out] statbuf Buffer in which the file status is put.\r
-\r
- @retval 0 Successful Completion.\r
- @retval -1 An error has occurred and errno has been set to\r
- identify the error.\r
-**/\r
- int stat (const char *, struct stat *);\r
-\r
- /**\r
- **/\r
- int chmod (const char *, mode_t);\r
-#endif // __STAT_SYSCALLS_DECLARED\r
-__END_DECLS\r
-\r
-#endif /* !_SYS_STAT_H_ */\r