summaryrefslogtreecommitdiffstats
path: root/StdLib/Include/sys/stat.h
diff options
context:
space:
mode:
authordarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-28 02:34:10 +0000
committerdarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-28 02:34:10 +0000
commit53e1e5c647b73e45569ed6e8b8a0a5b276aa685e (patch)
treeffb715b3aa7f6299b7e370e2b8a3f50b3df903c5 /StdLib/Include/sys/stat.h
parentb00771f50a1f9d72852de544cff5cbfd951e71ac (diff)
downloadedk2-53e1e5c647b73e45569ed6e8b8a0a5b276aa685e.tar.gz
edk2-53e1e5c647b73e45569ed6e8b8a0a5b276aa685e.tar.bz2
edk2-53e1e5c647b73e45569ed6e8b8a0a5b276aa685e.zip
Add device abstraction code for the UEFI Console and UEFI Shell-based file systems.
Make argv use narrow characters instead of wide characters. Add setenv functionality. Add poll() system call. Change signal names into macros – required for standards compliance. The enums were renamed and moved to sys/signal.h and the new macros reference the enums. Added SIGBREAK, which is required for Python. Modify stdio functions to fail cleanly when called with a NULL File Pointer argument. Added <sys/cdefs.h> that just includes <sys/EfiCdefs.h>. By adding this wrapper, we improve compatibility with *nix files which assume <sys/cdefs> exists. Add <netdb.h> Added macros for bcopy(), bcmp() and strsep(). Modify the clock() function so that it does not hang when running under an emulation environment such as NT32. Move TM structure specific macros from the private tzfile.h into <time.h> Add strncasecmp function. Add strptime function. Add gettimeofday function. Add getcwd function. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11908 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'StdLib/Include/sys/stat.h')
-rw-r--r--StdLib/Include/sys/stat.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/StdLib/Include/sys/stat.h b/StdLib/Include/sys/stat.h
index adc61ecf80..47e993b8be 100644
--- a/StdLib/Include/sys/stat.h
+++ b/StdLib/Include/sys/stat.h
@@ -1,6 +1,6 @@
/** @file
- Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made
available under the terms and conditions of the BSD License that
accompanies this distribution. The full text of the license may be found at
@@ -54,6 +54,7 @@
struct stat {
off_t st_size; /* file size, in bytes */
off_t st_physsize; /* physical space the file consumes */
+ off_t st_curpos; /* current position within the file, or XY coord. for Console */
dtime_t st_birthtime; /* time of creation */
dtime_t st_atime; /* time of last access */
dtime_t st_mtime; /* time of last data modification */
@@ -113,7 +114,8 @@ struct stat {
Traditionally, the remainder of the flags are specified in Octal
but they are expressed in Hex here for modern clarity.
*/
-#define _S_IFMT 0x0001F000 /* type-of-file mask */
+#define _S_IFMT 0x000FF000 /* type-of-file mask */
+#define _S_IFIFO 0x00001000 /* named pipe (fifo) */
#define _S_IFCHR 0x00002000 /* character special */
#define _S_IFDIR 0x00004000 /* directory */
#define _S_IFBLK 0x00006000 /* block special */
@@ -121,9 +123,10 @@ struct stat {
#define _S_IFSOCK 0x0000C000 /* socket */
#define _S_ITTY 0x00010000 /* File connects to a TTY device */
#define _S_IWTTY 0x00020000 /* TTY receives Wide characters */
+#define _S_ICONSOLE 0x00030000 /* UEFI Console Device */
/* UEFI specific (FAT file system) File attributes.
- Specifiec in Hexadecimal instead of Octal.
+ Specified in Hexadecimal instead of Octal.
These bits correspond to the xx portion of _S_IFMT
*/
#define S_IREADONLY 0x00100000 // Read Only File
@@ -133,9 +136,10 @@ struct stat {
#define S_IARCHIVE 0x02000000 // Archive Bit
#define S_IROFS 0x08000000 /* Read Only File System */
+#define S_EFIONLY 0xF0000000 /* Flags only used by the EFI system calls. */
+
#define S_EFISHIFT 20 // LS bit of the UEFI attributes
-//#define _S_IFIFO 0010000 /* named pipe (fifo) */
//#define _S_IFLNK 0120000 /* symbolic link */
//#define _S_IFWHT 0160000 /* whiteout */
//#define _S_ARCH1 0200000 /* Archive state 1, ls -l shows 'a' */
@@ -146,12 +150,12 @@ struct stat {
#define S_IFMT _S_IFMT
#define S_IFBLK _S_IFBLK
#define S_IFREG _S_IFREG
-//#define S_IFIFO _S_IFIFO
-//#define S_IFCHR _S_IFCHR
-//#define S_IFDIR _S_IFDIR
+#define S_IFIFO _S_IFIFO
+#define S_IFCHR _S_IFCHR
+#define S_IFDIR _S_IFDIR
//#define S_IFLNK _S_IFLNK
//#define S_ISVTX _S_ISVTX
-//#define S_IFSOCK _S_IFSOCK
+#define S_IFSOCK _S_IFSOCK
//#define S_IFWHT _S_IFWHT
//#define S_ARCH1 _S_ARCH1
@@ -163,7 +167,7 @@ struct stat {
#define S_ISBLK(m) ((m & _S_IFMT) == _S_IFBLK) /* block special */
#define S_ISSOCK(m) ((m & _S_IFMT) == _S_IFSOCK) /* socket */
-//#define S_ISFIFO(m) ((m & _S_IFMT) == _S_IFIFO) /* fifo */
+#define S_ISFIFO(m) ((m & _S_IFMT) == _S_IFIFO) /* fifo */
//#define S_ISLNK(m) ((m & _S_IFMT) == _S_IFLNK) /* symbolic link */
//#define S_ISWHT(m) ((m & _S_IFMT) == _S_IFWHT) /* whiteout */