diff options
author | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
---|---|---|
committer | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
commit | e611b132f9b8abe35b362e5870b74bce94a1e58e (patch) | |
tree | a5781d2ec0e085eeca33cf350cf878f2efea6fe5 /public/sdk/inc/posix/sys | |
download | NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2 NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip |
Diffstat (limited to 'public/sdk/inc/posix/sys')
-rw-r--r-- | public/sdk/inc/posix/sys/errno.h | 72 | ||||
-rw-r--r-- | public/sdk/inc/posix/sys/stat.h | 95 | ||||
-rw-r--r-- | public/sdk/inc/posix/sys/times.h | 43 | ||||
-rw-r--r-- | public/sdk/inc/posix/sys/types.h | 124 | ||||
-rw-r--r-- | public/sdk/inc/posix/sys/utsname.h | 37 | ||||
-rw-r--r-- | public/sdk/inc/posix/sys/wait.h | 90 |
6 files changed, 461 insertions, 0 deletions
diff --git a/public/sdk/inc/posix/sys/errno.h b/public/sdk/inc/posix/sys/errno.h new file mode 100644 index 000000000..17f5f5408 --- /dev/null +++ b/public/sdk/inc/posix/sys/errno.h @@ -0,0 +1,72 @@ +/*++ + +Copyright (c) 1991-1996 Microsoft Corporation + +Module Name: + + errno.h + +Abstract: + + This module contains the implementation defined values for the POSIX error + number as described in section 2.5 of IEEE P1003.1/Draft 13 as well as + additional error codes for streams and sockets. + +--*/ + + +#ifndef _SYS_ERRNO_ +#define _SYS_ERRNO_ + +/* + * POSIX error codes + */ + +#define EZERO 0 /* No error */ +#define EPERM 1 /* Operation no permitted */ +#define ENOENT 2 /* No such file or directory */ +#define ESRCH 3 /* No such process */ +#define EINTR 4 /* Interrupted function call */ +#define EIO 5 /* Input/output error */ +#define ENXIO 6 /* No such device or address */ +#define E2BIG 7 /* Arg list too long */ +#define ENOEXEC 8 /* Exec format error */ +#define EBADF 9 /* Bad file descriptor */ +#define ECHILD 10 /* No child processes */ +#define EAGAIN 11 /* Resource temporarily unavailable */ +#define ENOMEM 12 /* Not enough space */ +#define EACCES 13 /* Permission denied */ +#define EFAULT 14 /* Bad address */ +#define ENOTBLK 15 /* Unknown error */ +#define EBUSY 16 /* Resource device */ +#define EEXIST 17 /* File exists */ +#define EXDEV 18 /* Improper link */ +#define ENODEV 19 /* No such device */ +#define ENOTDIR 20 /* Not a directory */ +#define EISDIR 21 /* Is a directory */ +#define EINVAL 22 /* Invalid argument */ +#define ENFILE 23 /* Too many open files in system */ +#define EMFILE 24 /* Too many open files */ +#define ENOTTY 25 /* Inappropriate I/O control operation */ +#define ETXTBUSY 26 /* Unknown error */ +#define EFBIG 27 /* File too large */ +#define ENOSPC 28 /* No space left on device */ +#define ESPIPE 29 /* Invalid seek */ +#define EROFS 30 /* Read-only file system */ +#define EMLINK 31 /* Too many links */ +#define EPIPE 32 /* Broken pipe */ +#define EDOM 33 /* Domain error */ +#define ERANGE 34 /* Result too large */ +#define EUCLEAN 35 /* Unknown error */ +#define EDEADLOCK 36 /* Resource deadlock avoided */ +#define EDEADLK 36 /* Resource deadlock avoided */ +#ifndef _POSIX_SOURCE +#define UNKNOWN 37 /* Unknown error */ +#endif /* _POSIX_SOURCE */ +#define ENAMETOOLONG 38 /* Filename too long */ +#define ENOLCK 39 /* No locks available */ +#define ENOSYS 40 /* Function not implemented */ +#define ENOTEMPTY 41 /* Direcotory not empty */ +#define EILSEQ 42 /* Invalid multi-byte character */ + +#endif /* _SYS_ERRNO_ */ diff --git a/public/sdk/inc/posix/sys/stat.h b/public/sdk/inc/posix/sys/stat.h new file mode 100644 index 000000000..2ce180e06 --- /dev/null +++ b/public/sdk/inc/posix/sys/stat.h @@ -0,0 +1,95 @@ +/*++ + +Copyright (c) 1989-1996 Microsoft Corporation + +Module Name: + + stat.h + +Abstract: + + This module contains the stat structure described in section 5.6.1 + of IEEE P1003.1/Draft 13. + +--*/ + +#ifndef _SYS_STAT_ +#define _SYS_STAT_ + +#include <sys/types.h> + +#ifdef __cplusplus +extern "C" { +#endif + +struct stat { + mode_t st_mode; + ino_t st_ino; + dev_t st_dev; + nlink_t st_nlink; + uid_t st_uid; + gid_t st_gid; + off_t st_size; + time_t st_atime; + time_t st_mtime; + time_t st_ctime; +}; + +/* + * Type bits for mode field + */ + +#define S_IFMT 000770000 + +#define S_IFIFO 000010000 +#define S_IFCHR 000020000 +#define S_IFDIR 000040000 +#define S_IFBLK 000060000 +#define S_IFREG 000100000 + +/* + * Set Id Bits for mode + */ + +#define S_ISUID 000004000 +#define S_ISGID 000002000 + +/* + * Protection Bits for mode + */ + +#define _S_PROT 000000777 + +#define S_IRWXU 000000700 +#define S_IRUSR 000000400 +#define S_IWUSR 000000200 +#define S_IXUSR 000000100 + +#define S_IRWXG 000000070 +#define S_IRGRP 000000040 +#define S_IWGRP 000000020 +#define S_IXGRP 000000010 + +#define S_IRWXO 000000007 +#define S_IROTH 000000004 +#define S_IWOTH 000000002 +#define S_IXOTH 000000001 + +#define S_ISDIR(m) ( ((m) & S_IFMT) == S_IFDIR ) +#define S_ISCHR(m) ( ((m) & S_IFMT) == S_IFCHR ) +#define S_ISBLK(m) ( ((m) & S_IFMT) == S_IFBLK ) +#define S_ISREG(m) ( ((m) & S_IFMT) == S_IFREG ) +#define S_ISFIFO(m) ( ((m) & S_IFMT) == S_IFIFO ) + +mode_t _CRTAPI1 umask(mode_t); +int _CRTAPI1 mkdir(const char *, mode_t); +int _CRTAPI1 mkfifo(const char *, mode_t); +int _CRTAPI1 stat(const char *, struct stat *); +int _CRTAPI1 fstat(int, struct stat *); +int _CRTAPI1 chmod(const char *, mode_t); + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_STAT_ */ diff --git a/public/sdk/inc/posix/sys/times.h b/public/sdk/inc/posix/sys/times.h new file mode 100644 index 000000000..730747fce --- /dev/null +++ b/public/sdk/inc/posix/sys/times.h @@ -0,0 +1,43 @@ +/*++ + +Copyright (c) 1989-1996 Microsoft Corporation + +Module Name: + + times.h + +Abstract: + + This module contains the tms structure and clock_t described in section + 4.5.2.2 of IEEE P1003.1/Draft 13. + +--*/ + +#ifndef _SYS_TIMES_ +#define _SYS_TIMES_ + +#include <sys/types.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _CLOCK_T_DEFINED +#define _CLOCK_T_DEFINED +typedef long clock_t; +#endif + +struct tms { + clock_t tms_utime; + clock_t tms_stime; + clock_t tms_cutime; + clock_t tms_cstime; +}; + +clock_t _CRTAPI1 times(struct tms *); + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_TIMES_ */ diff --git a/public/sdk/inc/posix/sys/types.h b/public/sdk/inc/posix/sys/types.h new file mode 100644 index 000000000..e454e98a7 --- /dev/null +++ b/public/sdk/inc/posix/sys/types.h @@ -0,0 +1,124 @@ +/*++ + +Copyright (c) 1991-1996 Microsoft Corporation + +Module Name: + + types.h + +Abstract: + + This module contains the primitive system data types described + in section 2.6 of IEEE P1003.1/Draft 13 as well as type definitions + for sockets and streams + +--*/ + +#ifndef _SYS_TYPES_ +#define _SYS_TYPES_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Conditional macro definition for function calling type and variable type + * qualifiers. + * + * Convention: _CRTAPI1 is for functions with a fixed number of arguments + * _CRTAPI2 is for functions with a variable number of arguments + */ +#if ( (_MSC_VER >= 800) && (_M_IX86 >= 300) ) + +/* + * Definitions for MS C8-32 (386/486) compiler + */ +#define _CRTAPI1 __cdecl +#define _CRTAPI2 __cdecl + +#elif ( _MSC_VER == 600 ) + +/* + * Definitions for old MS C6-386 compiler + */ +#define _CRTAPI1 _cdecl +#define _CRTAPI2 _cdecl +#define _M_IX86 300 + +#else + +/* + * Other compilers (e.g., MIPS) + */ +#define _CRTAPI1 +#define _CRTAPI2 + +#endif + + +/* + * POSIX data types + */ + +typedef unsigned long gid_t; +typedef unsigned long mode_t; +typedef unsigned long nlink_t; +typedef long pid_t; +typedef unsigned long uid_t; + +#ifndef _OFF_T_DEFINED +typedef long off_t; +#define _OFF_T_DEFINED +#endif + +#ifndef _DEV_T_DEFINED +typedef unsigned long dev_t; +#define _DEV_T_DEFINED +#endif + +#ifndef _INO_T_DEFINED +typedef unsigned long ino_t; +#define _INO_T_DEFINED +#endif + +#ifndef _TIME_T_DEFINED +typedef long time_t; +#define _TIME_T_DEFINED +#endif + +#ifndef _SIZE_T_DEFINED +typedef unsigned int size_t; +#define _SIZE_T_DEFINED +#endif + +#ifndef _SSIZE_T_DEFINED +typedef signed int ssize_t; +#define _SSIZE_T_DEFINED +#endif + +#ifndef _POSIX_SOURCE + +/* + * Additional types for sockets and streams + */ + +typedef unsigned char u_char; +typedef unsigned short u_short; +typedef unsigned short ushort; +typedef unsigned int u_int; +typedef unsigned long u_long; + +typedef unsigned int uint; +typedef unsigned long ulong; +typedef unsigned char unchar; + +typedef char *caddr_t; +typedef int key_t; /* Imported!!! */ + +#endif /* _POSIX_SOURCE */ + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_TYPES_ */ diff --git a/public/sdk/inc/posix/sys/utsname.h b/public/sdk/inc/posix/sys/utsname.h new file mode 100644 index 000000000..5a7d8835b --- /dev/null +++ b/public/sdk/inc/posix/sys/utsname.h @@ -0,0 +1,37 @@ +/*++ + +Copyright (c) 1989-1996 Microsoft Corporation + +Module Name: + + utsname.h + +Abstract: + + This module contains the utsname structure described in section 4.4.1.2 + of IEEE P1003.1/Draft 13. + +--*/ + +#ifndef _UTSNAME_ +#define _UTSNAME_ + +#include <limits.h> + +#ifdef __cplusplus +extern "C" { +#endif + +struct utsname { + char sysname[_POSIX_NAME_MAX]; + char nodename[_POSIX_NAME_MAX]; + char release[_POSIX_NAME_MAX]; + char version[_POSIX_NAME_MAX]; + char machine[_POSIX_NAME_MAX]; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* _UTSNAME_ */ diff --git a/public/sdk/inc/posix/sys/wait.h b/public/sdk/inc/posix/sys/wait.h new file mode 100644 index 000000000..35632231e --- /dev/null +++ b/public/sdk/inc/posix/sys/wait.h @@ -0,0 +1,90 @@ +/*++ + +Copyright (c) 1989-1996 Microsoft Corporation + +Module Name: + + wait.h + +Abstract: + + This module contains the symbolic constants, macros, and structures needed to + support wait, waitpid, and _exit in in IEEE P1003.1/Draft 13. + +--*/ + +#ifndef _SYS_WAIT_ +#define _SYS_WAIT_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * wait options + */ + +#define WNOHANG 0x00000001 +#define WUNTRACED 0x00000002 + +/* + * Structure of wait status value + * + * Bit 32 - 0 if process terminated normally + * 1 if process was signaled + * Bit 31 - 0 if process is not stopped + * 1 if process is stopped + * Bits 0-7 exit status or signal number + */ + +/* + * Evaluate to non-zero if process terminated normally (by calling _exit) + */ + +#define WIFEXITED(stat_val) \ + (((stat_val) & 0xff) == 0) + +/* + * Returns the low-order 8 bits of the status argument passed to _exit + */ + +#define WEXITSTATUS(stat_val) \ + (((stat_val) & 0xff00) >> 8) + +/* + * Evaluate to non-zero if process terminated due to receipt of a signal + * that was not caught + */ + +#define WIFSIGNALED(stat_val) \ + (!WIFSTOPPED(stat_val) && !WIFEXITED(stat_val)) + +/* + * Returns the signal number of the signal that caused the process to terminate + */ + +#define WTERMSIG(stat_val) \ + ((stat_val) & 0xff) + +/* + * Evaluate to non-zero if process is currently stopped + */ + +#define WIFSTOPPED(stat_val) \ + (((stat_val) & 0xff) == 0177) + +/* + * Returns the signal number of the signal that caused the process to stop + */ + +#define WSTOPSIG(stat_val) \ + (((stat_val) & 0xff00) >> 8) + +pid_t _CRTAPI1 wait(int *); +pid_t _CRTAPI1 waitpid(pid_t, int *, int); + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_WAIT_ */ |