Improved compatibility with other Unix systems.

This commit is contained in:
Philip Homburg
2005-06-10 15:12:03 +00:00
parent d9b609c70f
commit dc23e18cef
27 changed files with 659 additions and 17 deletions

View File

@@ -12,6 +12,8 @@
#include <ansi.h>
#endif
#include <sys/time.h>
typedef struct {
char state;
char op;

6
include/sys/socket.h Normal file
View File

@@ -0,0 +1,6 @@
/*
sys/socket.h
*/
/* Open Group Base Specifications Issue 6 (not complete) */
#include <net/gen/socket.h>

View File

@@ -29,6 +29,7 @@ struct stat {
* extensions such as S_IFREG != (mode_t) S_IFREG when ints are 32 bits.
*/
#define S_IFMT ((mode_t) 0170000) /* type of file */
#define S_IFLNK ((mode_t) 0120000) /* symbolic link, not implemented */
#define S_IFREG ((mode_t) 0100000) /* regular */
#define S_IFBLK 0060000 /* block special */
#define S_IFDIR 0040000 /* directory */
@@ -61,7 +62,7 @@ struct stat {
#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) /* is a char spec */
#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) /* is a block spec */
#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) /* is a pipe/FIFO */
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) /* is a sym link */
/* Function Prototypes. */
_PROTOTYPE( int chmod, (const char *_path, Mode_t _mode) );
@@ -71,4 +72,7 @@ _PROTOTYPE( int mkfifo, (const char *_path, Mode_t _mode) );
_PROTOTYPE( int stat, (const char *_path, struct stat *_buf) );
_PROTOTYPE( mode_t umask, (Mode_t _cmask) );
/* Open Group Base Specifications Issue 6 (not complete) */
_PROTOTYPE( int lstat, (const char *_path, struct stat *_buf) );
#endif /* _STAT_H */

22
include/sys/time.h Normal file
View File

@@ -0,0 +1,22 @@
/*
sys/time.h
*/
#ifndef _SYS__TIME_H
#define _SYS__TIME_H
#include <ansi.h>
/* Open Group Base Specifications Issue 6 (not complete) */
struct timeval
{
long /*time_t*/ tv_sec;
long /*useconds_t*/ tv_usec;
};
int gettimeofday(struct timeval *_RESTRICT tp, void *_RESTRICT tzp);
/* Compatibility with other Unix systems */
int settimeofday(const struct timeval *tp, const void *tzp);
#endif /* _SYS__TIME_H */

View File

@@ -43,6 +43,9 @@ typedef long clock_t; /* unit for system accounting */
typedef unsigned long sigset_t;
#endif
/* Open Group Base Specifications Issue 6 (not complete) */
typedef long useconds_t; /* Time in microseconds */
/* Types used in disk, inode, etc. data structures. */
typedef short dev_t; /* holds (major|minor) device pair */
typedef char gid_t; /* group id */
@@ -116,4 +119,10 @@ typedef int Mode_t;
/* Signal handler type, e.g. SIG_IGN */
typedef void _PROTOTYPE( (*sighandler_t), (int) );
/* Compatibility with other systems */
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
#endif /* _TYPES_H */