diff options
Diffstat (limited to 'public/sdk/inc/posix')
-rw-r--r-- | public/sdk/inc/posix/dirent.h | 46 | ||||
-rw-r--r-- | public/sdk/inc/posix/errno.h | 31 | ||||
-rw-r--r-- | public/sdk/inc/posix/fcntl.h | 83 | ||||
-rw-r--r-- | public/sdk/inc/posix/grp.h | 39 | ||||
-rw-r--r-- | public/sdk/inc/posix/pwd.h | 40 | ||||
-rw-r--r-- | public/sdk/inc/posix/setjmp.h | 269 | ||||
-rw-r--r-- | public/sdk/inc/posix/signal.h | 88 | ||||
-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 | ||||
-rw-r--r-- | public/sdk/inc/posix/tar.h | 52 | ||||
-rw-r--r-- | public/sdk/inc/posix/termios.h | 178 | ||||
-rw-r--r-- | public/sdk/inc/posix/types.h | 20 | ||||
-rw-r--r-- | public/sdk/inc/posix/unistd.h | 168 | ||||
-rw-r--r-- | public/sdk/inc/posix/utime.h | 34 |
18 files changed, 1509 insertions, 0 deletions
diff --git a/public/sdk/inc/posix/dirent.h b/public/sdk/inc/posix/dirent.h new file mode 100644 index 000000000..284d12004 --- /dev/null +++ b/public/sdk/inc/posix/dirent.h @@ -0,0 +1,46 @@ +/*++ + +Copyright (c) 1989-1996 Microsoft Corporation + +Module Name: + + dirent.h + +Abstract: + + This module contains the directory entry procedure + prototypes + +--*/ + +#ifndef _DIRENT_ +#define _DIRENT_ + +#include <types.h> +#include <limits.h> + +#ifdef __cplusplus +extern "C" { +#endif + +struct dirent { + char d_name[NAME_MAX+1]; +}; + +typedef struct _DIR { + int Directory; + unsigned long Index; + char RestartScan; /* really BOOLEAN */ + struct dirent Dirent; +} DIR; + +DIR * _CRTAPI1 opendir(const char *); +struct dirent * _CRTAPI1 readdir(DIR *); +void _CRTAPI1 rewinddir(DIR *); +int _CRTAPI1 closedir(DIR *); + +#ifdef __cplusplus +} +#endif + +#endif /* _DIRENT_H */ diff --git a/public/sdk/inc/posix/errno.h b/public/sdk/inc/posix/errno.h new file mode 100644 index 000000000..ca1801f66 --- /dev/null +++ b/public/sdk/inc/posix/errno.h @@ -0,0 +1,31 @@ +/*++ + +Copyright (c) 1989-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. + +--*/ + +#ifndef _ERRNO_ +#define _ERRNO_ + +#include <sys/errno.h> + +#ifdef __cplusplus +extern "C" { +#endif + +extern int errno; + +#ifdef __cplusplus +} +#endif + +#endif /* _ERRNO_ */ diff --git a/public/sdk/inc/posix/fcntl.h b/public/sdk/inc/posix/fcntl.h new file mode 100644 index 000000000..327cf36d0 --- /dev/null +++ b/public/sdk/inc/posix/fcntl.h @@ -0,0 +1,83 @@ +/*++ + +Copyright (c) 1989-1996 Microsoft Corporation + +Module Name: + + fcntl.h + +Abstract: + + This module contains the required contents of fcntl + +--*/ + +#ifndef _FCNTL_ +#define _FCNTL_ + +#include <sys/types.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#define O_RDONLY 0x00000000 +#define O_WRONLY 0x00000001 +#define O_RDWR 0x00000002 + +#define O_ACCMODE 0x00000007 + +#define O_APPEND 0x00000008 +#define O_CREAT 0x00000100 +#define O_TRUNC 0x00000200 +#define O_EXCL 0x00000400 +#define O_NOCTTY 0x00000800 + +#define O_NONBLOCK 0x00001000 + +/* + * Control operations on files, 1003.1-88 (6.5.2.2). Use as 'command' + * argument to fcntl(). + */ + +#define F_DUPFD 0 +#define F_GETFD 1 +#define F_GETLK 2 +#define F_SETFD 3 +#define F_GETFL 4 +#define F_SETFL 5 +#define F_SETLK 6 +#define F_SETLKW 7 + +/* + * File descriptor flags, 1003.1-90 (6-2). Used as argument to F_SETFD + * command. + */ + +#define FD_CLOEXEC 0x1 + +struct flock { + short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */ + short l_whence; /* flag for starting offset */ + off_t l_start; /* relative offset in bytes */ + off_t l_len; /* size; if 0 then until EOF */ + pid_t l_pid; /* pid of process holding the lock */ +}; + +/* + * Values for the l_type field. + */ + +#define F_RDLCK 1 +#define F_UNLCK 2 +#define F_WRLCK 3 + +int _CRTAPI2 open(const char *, int,...); +int _CRTAPI1 creat(const char *, mode_t); +int _CRTAPI2 fcntl(int, int, ...); + +#ifdef __cplusplus +} +#endif + +#endif /* _FCNTL_ */ diff --git a/public/sdk/inc/posix/grp.h b/public/sdk/inc/posix/grp.h new file mode 100644 index 000000000..a7801dcea --- /dev/null +++ b/public/sdk/inc/posix/grp.h @@ -0,0 +1,39 @@ +/*++ + +Copyright (c) 1992-1996 Microsoft Corporation + +Module Name: + + grp.h + +Abstract: + + Defines data types and declares routines necessary for group database + access, as required by 1003.1-88 (9.2.1). + +--*/ + +#ifndef _GRP_ +#define _GRP_ + +#include <sys/types.h> + +#ifdef __cplusplus +extern "C" { +#endif + +struct group { + char *gr_name; /* the name of the group */ + gid_t gr_gid; /* the numerical group ID */ + char **gr_mem; /* null-terminated vector of pointers*/ + /* to the individual member names*/ +}; + +struct group * _CRTAPI1 getgrgid(gid_t); +struct group * _CRTAPI1 getgrnam(const char *); + +#ifdef __cplusplus +} +#endif + +#endif /* _GRP_ */ diff --git a/public/sdk/inc/posix/pwd.h b/public/sdk/inc/posix/pwd.h new file mode 100644 index 000000000..9be567e29 --- /dev/null +++ b/public/sdk/inc/posix/pwd.h @@ -0,0 +1,40 @@ +/*++ + +Copyright (c) 1992-1996 Microsoft Corporation + +Module Name: + + pwd.h + +Abstract: + + Defines data types and declares routines necessary for user database + access, as required by 1003.1-88 (9.2.2). + +--*/ + +#ifndef _PWD_ +#define _PWD_ + +#include <sys/types.h> + +#ifdef __cplusplus +extern "C" { +#endif + +struct passwd { + char *pw_name; /* users login name */ + uid_t pw_uid; /* user id number */ + gid_t pw_gid; /* group id number */ + char *pw_dir; /* home directory */ + char *pw_shell; /* shell */ +}; + +struct passwd * _CRTAPI1 getpwuid(uid_t); +struct passwd * _CRTAPI1 getpwnam(const char *); + +#ifdef __cplusplus +} +#endif + +#endif /* _PWD_ */ diff --git a/public/sdk/inc/posix/setjmp.h b/public/sdk/inc/posix/setjmp.h new file mode 100644 index 000000000..afcba1ce0 --- /dev/null +++ b/public/sdk/inc/posix/setjmp.h @@ -0,0 +1,269 @@ +/*** +*setjmp.h - definitions/declarations for setjmp/longjmp routines +* +* Copyright (c) 1985-1996, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines the machine-dependent buffer used by +* setjmp/longjmp to save and restore the program state, and +* declarations for those routines. +* [ANSI/System V] +* +* The setjmp() that will be used by those who include this file +* is _setjmpex, which is safe for use with try/except/finally, +* but is slow. See <crt/setjmpex.h> and <crt/setjmp.h> for more. +* +****/ + +#ifndef _INC_SETJMP + +#include <signal.h> + +#ifndef __cplusplus + + +/* + * Conditional macro definition for function calling type and variable type + * qualifiers. + */ +#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 programs use _setjmpex by default. + */ + + +/* + * Definitions specific to particular setjmp implementations. + */ +#if defined(_M_IX86) +#define longjmp _longjmpex +#define setjmp _setjmp + +/* + * MS C8-32 or older MS C6-386 compilers + */ +#define _JBLEN 16 +#define _JBTYPE int + +/* + * Define jump buffer layout for x86 setjmp/longjmp + */ + +typedef struct __JUMP_BUFFER { + unsigned long Ebp; + unsigned long Ebx; + unsigned long Edi; + unsigned long Esi; + unsigned long Esp; + unsigned long Eip; + unsigned long Registration; + unsigned long TryLevel; + unsigned long Cookie; + unsigned long UnwindFunc; + unsigned long UnwindData[6]; +} _JUMP_BUFFER; + +#elif ( defined(_M_MRX000) || defined(_MIPS_) ) + +/* + * All MIPS implementations need _JBLEN of 16 + */ +#define _JBLEN 16 +#define _JBTYPE double +#define _setjmp setjmp + +/* + * Define jump buffer layout for MIPS setjmp/longjmp. + */ + +typedef struct __JUMP_BUFFER { + unsigned long FltF20; + unsigned long FltF21; + unsigned long FltF22; + unsigned long FltF23; + unsigned long FltF24; + unsigned long FltF25; + unsigned long FltF26; + unsigned long FltF27; + unsigned long FltF28; + unsigned long FltF29; + unsigned long FltF30; + unsigned long FltF31; + unsigned long IntS0; + unsigned long IntS1; + unsigned long IntS2; + unsigned long IntS3; + unsigned long IntS4; + unsigned long IntS5; + unsigned long IntS6; + unsigned long IntS7; + unsigned long IntS8; + unsigned long Type; + unsigned long Fir; +} _JUMP_BUFFER; + +#elif defined(_ALPHA_) + +/* + * Alpha implementations need a _JBLEN of 20 quadwords. + * A double is used only to obtain quadword size and alignment. + */ + +#define _JBLEN 20 +#define _JBTYPE double +#define _setjmp setjmp + +/* + * Define jump buffer layout for Alpha setjmp/longjmp. + * A double is used only to obtain quadword size and alignment. + */ + +typedef struct __JUMP_BUFFER { + unsigned long Fp; + unsigned long Pc; + unsigned long Seb; + unsigned long Type; + double FltF2; + double FltF3; + double FltF4; + double FltF5; + double FltF6; + double FltF7; + double FltF8; + double FltF9; + double IntS0; + double IntS1; + double IntS2; + double IntS3; + double IntS4; + double IntS5; + double IntS6; + double IntSp; + double Fir; + double Fill; +} _JUMP_BUFFER; + +#elif defined(_PPC_) +/* + * Min length is 240 bytes; round to 256 bytes. + * Since this is allocated as an array of "double", the + * number of entries required is 32. + * + * All PPC implementations need _JBLEN of 32 + */ + +#define _JBLEN 32 +#define _JBTYPE double +#define _setjmp setjmp + +/* + * Define jump buffer layout for PowerPC setjmp/longjmp. + */ + +typedef struct __JUMP_BUFFER { + double Fpr14; + double Fpr15; + double Fpr16; + double Fpr17; + double Fpr18; + double Fpr19; + double Fpr20; + double Fpr21; + double Fpr22; + double Fpr23; + double Fpr24; + double Fpr25; + double Fpr26; + double Fpr27; + double Fpr28; + double Fpr29; + double Fpr30; + double Fpr31; + unsigned long Gpr1; + unsigned long Gpr2; + unsigned long Gpr13; + unsigned long Gpr14; + unsigned long Gpr15; + unsigned long Gpr16; + unsigned long Gpr17; + unsigned long Gpr18; + unsigned long Gpr19; + unsigned long Gpr20; + unsigned long Gpr21; + unsigned long Gpr22; + unsigned long Gpr23; + unsigned long Gpr24; + unsigned long Gpr25; + unsigned long Gpr26; + unsigned long Gpr27; + unsigned long Gpr28; + unsigned long Gpr29; + unsigned long Gpr30; + unsigned long Gpr31; + unsigned long Cr; + unsigned long Iar; + unsigned long Type; +} _JUMP_BUFFER; + +#endif /* MIPS/Alpha/PPC */ + +/* define the buffer type for holding the state information */ + +#ifndef _JMP_BUF_DEFINED +typedef _JBTYPE jmp_buf[_JBLEN]; +#define _JMP_BUF_DEFINED +#endif + +#ifndef _SIGJMP_BUF_DEFINED +#define _SIGJMP_BUF_DEFINED +/* + * sigjmp buf is just a jmp_buf plus an int to say whether the sigmask + * is saved or not, and a sigmask_t for the mask if it is saved. + */ + +typedef _JBTYPE sigjmp_buf[_JBLEN + 2]; +#endif /* _SIGJMP_BUF_DEFINED */ + +extern _JBTYPE * _CRTAPI1 _sigjmp_store_mask(sigjmp_buf, int); + +#define sigsetjmp(_env, _save) \ + setjmp(_sigjmp_store_mask((_env), (_save))) + +/* function prototypes */ + +int _CRTAPI1 setjmp(jmp_buf); +void _CRTAPI1 longjmp(jmp_buf, int); +void _CRTAPI1 siglongjmp(sigjmp_buf, int); + +/* function prototypes */ + +#endif /* __cplusplus */ + +#define _INC_SETJMP +#endif /* _INC_SETJMP */ diff --git a/public/sdk/inc/posix/signal.h b/public/sdk/inc/posix/signal.h new file mode 100644 index 000000000..9d7015dff --- /dev/null +++ b/public/sdk/inc/posix/signal.h @@ -0,0 +1,88 @@ +/*++ + +Copyright (c) 1989-1996 Microsoft Corporation + +Module Name: + + signal.h + +Abstract: + + This module contains the signal related types and data structures described + in sections 3.3.1 thru 3.3.7 of IEEE P1003.1/Draft 13. + +--*/ + +#ifndef _SIGNAL_ +#define _SIGNAL_ + +#include <sys/types.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef unsigned long sigset_t; + +#ifndef _SIG_ATOMIC_T_DEFINED +typedef int sig_atomic_t; +#define _SIG_ATOMIC_T_DEFINED +#endif + +#define SIG_DFL (void (_CRTAPI1 *)(int))0xffffffff /* default signal action */ +#define SIG_ERR (void (_CRTAPI1 *)(int))0 /* signal error value */ +#define SIG_IGN (void (_CRTAPI1 *)(int))1 /* ignore signal */ + +#define SIGABRT 1 +#define SIGALRM 2 +#define SIGFPE 3 +#define SIGHUP 4 +#define SIGILL 5 +#define SIGINT 6 +#define SIGKILL 7 +#define SIGPIPE 8 +#define SIGQUIT 9 +#define SIGSEGV 10 +#define SIGTERM 11 +#define SIGUSR1 12 +#define SIGUSR2 13 +#define SIGCHLD 14 +#define SIGCONT 15 +#define SIGSTOP 16 +#define SIGTSTP 17 +#define SIGTTIN 18 +#define SIGTTOU 19 + +typedef void (_CRTAPI1 * _handler)(int); + +struct sigaction { + _handler sa_handler; + sigset_t sa_mask; + int sa_flags; +}; + +#define SA_NOCLDSTOP 0x00000001 + +#define SIG_BLOCK 1 +#define SIG_UNBLOCK 2 +#define SIG_SETMASK 3 + +int _CRTAPI1 kill(pid_t, int); +int _CRTAPI1 sigemptyset(sigset_t *); +int _CRTAPI1 sigfillset(sigset_t *); +int _CRTAPI1 sigaddset(sigset_t *, int); +int _CRTAPI1 sigdelset(sigset_t *, int); +int _CRTAPI1 sigismember(const sigset_t *, int); +int _CRTAPI1 sigaction(int, const struct sigaction *, struct sigaction *); +int _CRTAPI1 sigprocmask(int, const sigset_t *, sigset_t *); +int _CRTAPI1 sigpending(sigset_t *); +int _CRTAPI1 sigsuspend(const sigset_t *); + +_handler _CRTAPI1 signal(int, _handler); +int _CRTAPI1 raise(int); + +#ifdef __cplusplus +} +#endif + +#endif /* _SIGNAL_ */ 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_ */ diff --git a/public/sdk/inc/posix/tar.h b/public/sdk/inc/posix/tar.h new file mode 100644 index 000000000..b981a4900 --- /dev/null +++ b/public/sdk/inc/posix/tar.h @@ -0,0 +1,52 @@ +/*++ + +Copyright (c) 1992-1996 Microsoft Corporation + +Module Name: + + tar.h + +Abstract: + + Stuff for the 'tar' data interchange format, as in 1003.1-88 + (10.1.1) + +--*/ + +#ifndef _TAR_ +#define _TAR_ + +#define TMAGIC "ustar" /* ustar and a nul */ +#define TMAGLEN 6 +#define TVERSION "00" /* 00 and no nul */ +#define TVERSLEN 2 + +/* Values used in typeflag field */ + +#define REGTYPE '0' /* regular file */ +#define AREGTYPE '\0' /* regular file */ +#define LNKTYPE '1' /* link */ +#define SYMTYPE '2' /* symlink */ +#define CHRTYPE '3' /* character special */ +#define BLKTYPE '4' /* block special */ +#define DIRTYPE '5' /* directory */ +#define FIFOTYPE '6' /* FIFO special */ +#define CONTTYPE '7' /* high-performance */ + +/* Bits used in the mode field -- values in octal */ + +#define TSUID 04000 /* set UID on execution */ +#define TSGID 02000 /* set GID on execution */ +#define TSVTX 01000 /* reserved */ + /* File Permissions */ +#define TUREAD 00400 /* read by owner */ +#define TUWRITE 00200 /* write by owner */ +#define TUEXEC 00100 /* execute/search by owner */ +#define TGREAD 00040 /* read by group */ +#define TGWRITE 00020 /* write by group */ +#define TGEXEC 00010 /* execute/search by group */ +#define TOREAD 00004 /* read by other */ +#define TOWRITE 00002 /* write by other */ +#define TOEXEC 00001 /* execute/search by other */ + +#endif /* _TAR_ */ diff --git a/public/sdk/inc/posix/termios.h b/public/sdk/inc/posix/termios.h new file mode 100644 index 000000000..2c294afb8 --- /dev/null +++ b/public/sdk/inc/posix/termios.h @@ -0,0 +1,178 @@ +/*++ + +Copyright (c) 1991-1996 Microsoft Corporation + +Module Name: + + termios.h + +Abstract: + + This module contains the primitive system data types described in section + 7.1.2.1 of IEEE P1003.1-1990 + +--*/ + +#ifndef _TERMIOS_ +#define _TERMIOS_ + +#include <sys/types.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef unsigned long cc_t; +typedef unsigned long speed_t; +typedef unsigned long tcflag_t; + +#define NCCS 11 + +struct termios { + tcflag_t c_iflag; /* input modes */ + tcflag_t c_oflag; /* output modes */ + tcflag_t c_cflag; /* control modes */ + tcflag_t c_lflag; /* local modes */ + speed_t c_ispeed; /* input speed */ + speed_t c_ospeed; /* output speed */ + cc_t c_cc[NCCS]; /* control characters */ +}; + +/* + * Input modes, for c_iflag member + */ + +#define BRKINT 0x00000001 /* signal interrupt on break */ +#define ICRNL 0x00000002 /* map CR to NL on input */ +#define IGNBRK 0x00000004 /* ignore break condition */ +#define IGNCR 0x00000008 /* ignore CR */ +#define IGNPAR 0x00000010 /* ignore characters with parity errors */ +#define INLCR 0x00000020 /* map NL to CR on input */ +#define INPCK 0x00000040 /* Enable input parity check */ +#define ISTRIP 0x00000080 /* strip character */ +#define IXOFF 0x00000100 /* enable start/stop input control */ +#define IXON 0x00000200 /* enable start/stop output control */ +#define PARMRK 0x00000400 /* mark parity errors */ + +/* + * Output modes, for c_oflag member + */ + +#define OPOST 0x00000001 /* perform output processing */ +#define ONLCR 0x00000002 /* map NL to ASCII CR-NL on output */ +#define ONLRET 0x00000004 /* NL performs ASCII CR function */ +#define OCRNL 0x00000008 /* map ASCII CR to NL on output */ +#define ONOCR 0x00000010 /* No ASCII CR output at column 0. */ + +/* + * Control modes, for c_cflag member + */ + +#define CLOCAL 0x00000001 /* ignore modem status lines */ +#define CREAD 0x00000002 /* enable receiver */ +#define CSIZE 0x000000F0 /* number of bits per byte */ +#define CS5 0x00000010 /* 5 bits */ +#define CS6 0x00000020 /* 6 bits */ +#define CS7 0x00000040 /* 7 bits */ +#define CS8 0x00000080 /* 8 bits */ +#define CSTOPB 0x00000100 /* send two stop bits, else one */ +#define HUPCL 0x00000200 /* hang up on last close */ +#define PARENB 0x00000400 /* parity enable */ +#define PARODD 0x00000800 /* odd parity, else even */ + +/* + * Local modes, for c_lflag member + */ + +#define ECHO 0x00000001 /* enable echo */ +#define ECHOE 0x00000002 /* echo ERASE as an error-correcting backspace */ +#define ECHOK 0x00000004 /* echo KILL */ +#define ECHONL 0x00000008 /* echo '\n' */ +#define ICANON 0x00000010 /* canonical input (erase and kill processing) */ +#define IEXTEN 0x00000020 /* enable extended functions */ +#define ISIG 0x00000040 /* enable signals */ +#define NOFLSH 0x00000080 /* disable flush after intr, quit, or suspend */ +#define TOSTOP 0x00000100 /* send SIGTTOU for background output */ + +/* + * Indices into c_cc array + */ + +#define VEOF 0 /* EOF character */ +#define VEOL 1 /* EOL character */ +#define VERASE 2 /* ERASE character */ +#define VINTR 3 /* INTR character */ +#define VKILL 4 /* KILL character */ +#define VMIN 5 /* MIN value */ +#define VQUIT 6 /* QUIT character */ +#define VSUSP 7 /* SUSP character */ +#define VTIME 8 /* TIME value */ +#define VSTART 9 /* START character */ +#define VSTOP 10 /* STOP character */ + +/* + * Values for speed_t's + */ + +#define B0 0 +#define B50 1 +#define B75 2 +#define B110 3 +#define B134 4 +#define B150 5 +#define B200 6 +#define B300 7 +#define B600 8 +#define B1200 9 +#define B1800 10 +#define B2400 11 +#define B4800 12 +#define B9600 13 +#define B19200 14 +#define B38400 15 + +/* + * Optional actions for tcsetattr() + */ +#define TCSANOW 1 +#define TCSADRAIN 2 +#define TCSAFLUSH 3 + +/* + * Queue selectors for tcflush() + */ + +#define TCIFLUSH 0 +#define TCOFLUSH 1 +#define TCIOFLUSH 2 + +/* + * Actions for tcflow() + */ + +#define TCOOFF 0 +#define TCOON 1 +#define TCIOFF 2 +#define TCION 3 + + +int _CRTAPI1 tcgetattr(int, struct termios *); +int _CRTAPI1 tcsetattr(int, int, const struct termios *); +int _CRTAPI1 tcsendbreak(int, int); +int _CRTAPI1 tcdrain(int); +int _CRTAPI1 tcflush(int, int); +int _CRTAPI1 tcflow(int, int); + +pid_t _CRTAPI1 tcgetpgrp(int); +int _CRTAPI1 tcsetpgrp(int, pid_t); + +speed_t _CRTAPI1 cfgetospeed(const struct termios *); +int _CRTAPI1 cfsetospeed(struct termios *, speed_t); +speed_t _CRTAPI1 cfgetispeed(const struct termios *); +int _CRTAPI1 cfsetispeed(struct termios *, speed_t); + +#ifdef __cplusplus +} +#endif + +#endif /* _TERMIOS_ */ diff --git a/public/sdk/inc/posix/types.h b/public/sdk/inc/posix/types.h new file mode 100644 index 000000000..cbf092dc7 --- /dev/null +++ b/public/sdk/inc/posix/types.h @@ -0,0 +1,20 @@ +/*++ + +Copyright (c) 1992-1996 Microsoft Corporation + +Module Name: + + types.h + +Abstract: + + Types. + +--*/ + +#ifndef _TYPES_ +#define _TYPES_ + +#include <sys/types.h> + +#endif /* _TYPES_ */ diff --git a/public/sdk/inc/posix/unistd.h b/public/sdk/inc/posix/unistd.h new file mode 100644 index 000000000..fe86e7c66 --- /dev/null +++ b/public/sdk/inc/posix/unistd.h @@ -0,0 +1,168 @@ +/*++ + +Copyright (c) 1989-1996 Microsoft Corporation + +Module Name: + + unistd.h + +Abstract: + + This module contains the "symbolic constants and structures referenced + elsewhere in the standard" IEEE P1003.1/Draft 13. + +--*/ + +#ifndef _UNISTD_ +#define _UNISTD_ + +#include <sys/types.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#define STDIN_FILENO 0 +#define STDOUT_FILENO 1 +#define STDERR_FILENO 2 + +/* + * Section 2.9.1 + */ + +#define F_OK 00 +#define X_OK 01 +#define W_OK 02 +#define R_OK 04 + +/* + * Section 2.9.2 + */ + +#define SEEK_SET 0 +#define SEEK_CUR 1 +#define SEEK_END 2 + +/* + * Section 2.9.3 + */ + +#define _POSIX_JOB_CONTROL +#define _POSIX_VERSION 199009L +#define _POSIX_SAVED_IDS + +/* + * Section 2.9.4 + */ + +#define _POSIX_CHOWN_RESTRICTED 1 +#define _POSIX_NO_TRUNC 1 +#define _POSIX_VDISABLE 0 + +/* + * Section 4.8.1 + * sysconf 'name' values + */ + +#define _SC_ARG_MAX 1 +#define _SC_CHILD_MAX 2 +#define _SC_CLK_TCK 3 +#define _SC_NGROUPS_MAX 4 +#define _SC_OPEN_MAX 5 +#define _SC_JOB_CONTROL 6 +#define _SC_SAVED_IDS 7 +#define _SC_STREAM_MAX 8 +#define _SC_TZNAME_MAX 9 +#define _SC_VERSION 10 + +/* + * Section 5.7.1 + * pathconf and fpathconf 'name' values + */ + +#define _PC_LINK_MAX 1 +#define _PC_MAX_CANON 2 +#define _PC_MAX_INPUT 3 +#define _PC_NAME_MAX 4 +#define _PC_PATH_MAX 5 +#define _PC_PIPE_BUF 6 +#define _PC_CHOWN_RESTRICTED 7 +#define _PC_NO_TRUNC 8 +#define _PC_VDISABLE 9 + +#ifndef NULL +#define NULL ((void *)0) +#endif + +/* + * Function Prototypes + */ + +pid_t _CRTAPI1 fork(void); + +int _CRTAPI2 execl(const char *, const char *, ...); +int _CRTAPI1 execv(const char *, char * const []); +int _CRTAPI2 execle(const char *, const char *arg, ...); +int _CRTAPI1 execve(const char *, char * const [], char * const []); +int _CRTAPI2 execlp(const char *, const char *, ...); +int _CRTAPI1 execvp(const char *, char * const []); + +void _CRTAPI1 _exit(int); +unsigned int _CRTAPI1 alarm(unsigned int); +int _CRTAPI1 pause(void); +unsigned int _CRTAPI1 sleep(unsigned int); +pid_t _CRTAPI1 getpid(void); +pid_t _CRTAPI1 getppid(void); +uid_t _CRTAPI1 getuid(void); +uid_t _CRTAPI1 geteuid(void); +gid_t _CRTAPI1 getgid(void); +gid_t _CRTAPI1 getegid(void); +int _CRTAPI1 setuid(uid_t); +int _CRTAPI1 setgid(gid_t); +int _CRTAPI1 getgroups(int gidsetsize, gid_t grouplist[]); +char *_CRTAPI1 getlogin(void); +pid_t _CRTAPI1 getpgrp(void); +pid_t _CRTAPI1 setsid(void); +int _CRTAPI1 setpgid(pid_t, pid_t); + +struct utsname; +int _CRTAPI1 uname(struct utsname *); + +time_t _CRTAPI1 time(time_t *); +char * _CRTAPI1 getenv(const char *); +char * _CRTAPI1 ctermid(char *s); +char * _CRTAPI1 ttyname(int); +int _CRTAPI1 isatty(int); + +long _CRTAPI1 sysconf(int); + +int _CRTAPI1 chdir(const char *); +char * _CRTAPI1 getcwd(char *, size_t); +int _CRTAPI1 link(const char *, const char *); +int _CRTAPI1 unlink(const char *); +int _CRTAPI1 rmdir(const char *); +int _CRTAPI1 rename(const char *, const char *); +int _CRTAPI1 access(const char *, int); +int _CRTAPI1 chown(const char *, uid_t, gid_t); + +struct utimbuf; +int _CRTAPI1 utime(const char *, const struct utimbuf *); + +long _CRTAPI1 pathconf(const char *, int); +long _CRTAPI1 fpathconf(int, int); + +int _CRTAPI1 pipe(int *); +int _CRTAPI1 dup(int); +int _CRTAPI1 dup2(int, int); +int _CRTAPI1 close(int); +ssize_t _CRTAPI1 read(int, void *, size_t); +ssize_t _CRTAPI1 write(int, const void *, size_t); +off_t _CRTAPI1 lseek(int, off_t, int); + +char * _CRTAPI1 cuserid(char *); + +#ifdef __cplusplus +} +#endif + +#endif /* _UNISTD_ */ diff --git a/public/sdk/inc/posix/utime.h b/public/sdk/inc/posix/utime.h new file mode 100644 index 000000000..c2167d173 --- /dev/null +++ b/public/sdk/inc/posix/utime.h @@ -0,0 +1,34 @@ +/*++ + +Copyright (c) 1989-1996 Microsoft Corporation + +Module Name: + + utime.h + +Abstract: + + This module contains the utimbuf structure described in section 5.6.6.2 + of IEEE P1003.1/Draft 13. + +--*/ + +#ifndef _UTIME_ +#define _UTIME_ + +#include <types.h> + +#ifdef __cplusplus +extern "C" { +#endif + +struct utimbuf { + time_t actime; + time_t modtime; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* _UTIME_ */ |