errno.h

#ifndef _ABI_UTIL_ERRNO_H
#define _ABI_UTIL_ERRNO_H

#ident "%W% %G%"

#include <asm/abi_machdep.h>
#include <abi/util/map.h>

/*
 * Translate the errno numbers from linux to current personality.
 * This should be removed and all other sources changed to call the
 * map function above directly.
 */
#define iABI_errors(errno) \
        (map_value(current->exec_domain->err_map, errno, 1))

#endif /* _ABI_UTIL_ERRNO_H */

Error.map

Mapping of error codes from Linux to various personalities. Codes which Linux
may generate but which can't be mapped directly in a given personality must
be mapped to the nearest equivalent which may invoke the correct behaviour
in the application. This is especially true for things like the ERESTART*
set of error returns!

NOTES:

The Xenix set was built with reference to an old SCO Xenix manual rather
than by reference to a real system. It may be incomplete or wrong. If anyone
has access to the Xenix TCP/IP kit we need to add mappings for the TCP/IP
error codes.

Other personalities may need adding. COFF binaries default

Linux Name	Linux	ABI	SCO	Wyse	Xenix	386bsd

EPERM		 1						/* Operation not permitted */
ENOENT		 2						/* No such file or directory */
ESRCH		 3						/* No such process */
EINTR		 4						/* Interrupted system call */
EIO		 5						/* I/O error */
ENXIO		 6						/* No such device or address */
E2BIG		 7						/* Arg list too long */
ENOEXEC		 8						/* Exec format error */
EBADF		 9						/* Bad file number */
ECHILD		10						/* No child processes */
EAGAIN		11					35	/* Try again */
ENOMEM		12						/* Out of memory */
EACCES		13						/* Permission denied */
EFAULT		14						/* Bad address */
ENOTBLK		15						/* Block device required */
EBUSY		16						/* Device or resource busy */
EEXIST		17						/* File exists */
EXDEV		18						/* Cross-device link */
ENODEV		19						/* No such device */
ENOTDIR		20						/* Not a directory */
EISDIR		21						/* Is a directory */
EINVAL		22						/* Invalid argument */
ENFILE		23						/* File table overflow */
EMFILE		24						/* Too many open files */
ENOTTY		25						/* Not a typewriter */
ETXTBSY		26						/* Text file busy */
EFBIG		27						/* File too large */
ENOSPC		28						/* No space left on device */
ESPIPE		29						/* Illegal seek */
EROFS		30						/* Read-only file system */
EMLINK		31						/* Too many links */
EPIPE		32						/* Broken pipe */
EDOM		33						/* Math argument out of domain of func */
ERANGE		34						/* Math result not representable */
EDEADLK		35	45	45	45	36	11	/* Resource deadlock would occur */
ENAMETOOLONG	36	78	78	228	EINVAL	63	/* File name too long */
ENOLCK		37	46	46	46	45	77	/* No record locks available */
ENOSYS		38	89	89	EINVAL	EINVAL	78	/* Function not implemented */
ENOTEMPTY	39	93	145	231	EINVAL	66	/* Directory not empty */
ELOOP		40	90	150	227	EINVAL	62	/* Too many symbolic links encountered */
EWOULDBLOCK	EAGAIN	90	90	200	EINVAL	35	/* Operation would block */
ENOMSG		42	35	35	35	43	?	/* No message of desired type */
EIDRM		43	36	36	36	44	?	/* Identifier removed */
ECHRNG		44	37	37	37	EINVAL	?	/* Channel number out of range */
EL2NSYNC	45	38	38	38	EINVAL	?	/* Level 2 not synchronized */
EL3HLT		46	39	39	39	EINVAL	?	/* Level 3 halted */
EL3RST		47	40	40	40	EINVAL	?	/* Level 3 reset */
ELNRNG		48	41	41	41	EINVAL	?	/* Link number out of range */
EUNATCH		49	42	42	42	EINVAL	?	/* Protocol driver not attached */
ENOCSI		50	43	43	43	EINVAL	?	/* No CSI structure available */
EL2HLT		51	44	44	44	EINVAL	?	/* Level 2 halted */
EBADE		52	?	50	50	EINVAL	?	/* Invalid exchange */
EBADR		53	?	51	51	EINVAL	?	/* Invalid request descriptor */
EXFULL		54	?	52	52	EINVAL	?	/* Exchange full */
ENOANO		55	?	53	53	EINVAL	?	/* No anode */
EBADRQC		56	?	54	54	EINVAL	?	/* Invalid request code */
EBADSLT		57	?	55	55	EINVAL	?	/* Invalid slot */
EDEADLOCK	58	?	56	56	36	11	/* File locking deadlock error */
EBFONT		59	?	57	57	EINVAL	?	/* Bad font file format */
ENOSTR		60				EINVAL	?	/* Device not a stream */
ENODATA		61				EINVAL	?	/* No data available */
ETIME		62				EINVAL	?	/* Timer expired */
ENOSR		63				EINVAL	?	/* Out of streams resources */
ENONET		64				EINVAL	?	/* Machine is not on the network */
ENOPKG		65				EINVAL	?	/* Package not installed */
EREMOTE		66				EINVAL	71	/* Object is remote */
ENOLINK		67				EINVAL	?	/* Link has been severed */
EADV		68				EINVAL	?	/* Advertise error */
ESRMNT		69				EINVAL	?	/* Srmount error */
ECOMM		70				EINVAL	?	/* Communication error on send */
EPROTO		71				?	?	/* Protocol error */
EMULTIHOP	72	74	74	74	?	?	/* Multihop attempted */
EDOTDOT		73	76	76	76	?	?	/* RFS specific error */
EBADMSG		74	77	77	77	?	?	/* Not a data message */
EOVERFLOW	75	79	EINVAL	EINVAL	?	?	/* Value too large for defined data type */
ENOTUNIQ	76	80	80	80	?	?	/* Name not unique on network */
EBADFD		77	81	81	81	?	?	/* File descriptor in bad state */
EREMCHG		78	82	82	82	?	?	/* Remote address changed */
ELIBACC		79	83	83	83	?	?	/* Can not access a needed shared library */
ELIBBAD		80	84	84	84	?	?	/* Accessing a corrupted shared library */
ELIBSCN		81	85	85	85	?	?	/* .lib section in a.out corrupted */
ELIBMAX		82	86	86	86	?	?	/* Attempting to link in too many shared libraries */
ELIBEXEC	83	87	87	87	?	?	/* Cannot exec a shared library directly */
EILSEQ		84	88	EINVAL	EINVAL	?	?	/* Illegal byte sequence */
ERESTART	85	91	EINTR	EINTR	?	?	/* Interrupted system call should be restarted */
ESTRPIPE	86	92	EINVAL	EINVAL	?	?	/* Streams pipe error */
EUSERS		87	94	EINVAL	233	?	68	/* Too many users */
ENOTSOCK	88	95	93	203	?	38	/* Socket operation on non-socket */
EDESTADDRREQ	89	96	94	204	?	39	/* Destination address required */
EMSGSIZE	90	97	95	205	?	40	/* Message too long */
EPROTOTYPE	91	98	96	206	?	41	/* Protocol wrong type for socket */
ENOPROTOOPT	92	99	EINVAL	207	?	42	/* Protocol not available */
EPROTONOSUPPORT	93	120	97	208	?	43	/* Protocol not supported */
ESOCKTNOSUPPORT	94	121	98	209	?	44	/* Socket type not supported */
EOPNOTSUPP	95	122	99	210	?	45	/* Operation not supported on transport endpoint */
EPFNOSUPPORT	96	123	100	211	?	46	/* Protocol family not supported */
EAFNOSUPPORT	97	124	101	212	?	47	/* Address family not supported by protocol */
EADDRINUSE	98	125	102	213	?	48	/* Address already in use */
EADDRNOTAVAIL	99	126	103	214	?	49	/* Cannot assign requested address */
ENETDOWN	100	127	104	215	?	50	/* Network is down */
ENETUNREACH	101	128	105	216	?	51	/* Network is unreachable */
ENETRESET	102	129	106	217	?	52	/* Network dropped connection because of reset */
ECONNABORTED	103	130	107	218	?	53	/* Software caused connection abort */
ECONNRESET	104	131	108	219	?	54	/* Connection reset by peer */
ENOBUFS		105	132	63	220	?	55	/* No buffer space available */
EISCONN		106	133	110	221	?	56	/* Transport endpoint is already connected */
ENOTCONN	107	134	111	222	?	57	/* Transport endpoint is not connected */
ESHUTDOWN	108	143	112	223	?	58	/* Cannot send after transport endpoint shutdown */
ETOOMANYREFS	109	144	113	224	?	59	/* Too many references: cannot splice */
ETIMEDOUT	110	145	114	225	?	60	/* Connection timed out */
ECONNREFUSED	111	146	115	226	?	61	/* Connection refused */
EHOSTDOWN	112	147	116	229	?	64	/* Host is down */
EHOSTUNREACH	113	148	117	230	?	65	/* No route to host */
EALREADY	114	149	92	202	?	37	/* Operation already in progress */
EINPROGRESS	115	150	91	201	?	36	/* Operation now in progress */
ESTALE		116	EINVAL	EINVAL	237	?	70	/* Stale NFS file handle */
EUCLEAN		117	?	135	135	35	?	/* Structure needs cleaning */
ENOTNAM		118	?	137	137	37	?	/* Not a XENIX named type file */
ENAVAIL		119	?	138	138	38	?	/* No XENIX semaphores available */
EISNAM		120	?	139	139	39	?	/* Is a named type file */
EREMOTEIO	121	?	140	140	EINVAL	?	/* Remote I/O error */
EDQUOT		122	?	ENOSPC	234	ENOSPC	69	/* Quota exceeded */

ERESTARTSYS	512	EINTR	EINTR	EINTR	EINTR	EINTR
ERESTARTNOINTR	513	EINTR	EINTR	EINTR	EINTR	EINTR
ERESTARTNOHAND	514	EINTR	EINTR	EINTR	EINTR	EINTR	/* restart if no handler.. */

ioctl.h

/*
 * Copyright (C) 1994  Mike Jagdis (jaggy@purplet.demon.co.uk)
 * Copyright (C) 2001  Caldera Deutschland GmbH
 */
#ifndef _ABI_IOCTL_H
#define _ABI_IOCTL_H

#ident "%W% %G%"

/*
 * Ioctl's have the command encoded in the lower word, and the size of
 * any in or out parameters in the upper word.  The high 3 bits of the
 * upper word are used to encode the in/out status of the parameter.
 *
 * Note that Linux does the same but has the IOC_IN and IOC_OUT values
 * round the other way and uses 0 for IOC_VOID.
 */
enum {
	/* parameter length, at most 13 bits */
	BSD_IOCPARM_MASK	= 0x1fff,
	/* no parameters */
	BSD_IOC_VOID		= 0x20000000,
	/* copy out parameters */
	BSD_IOC_OUT		= 0x40000000,
	/* copy in parameters */
	BSD_IOC_IN		= 0x80000000,
	/* possibly copy in and out parameters */
	BSD_IOC_INOUT		= BSD_IOC_IN|BSD_IOC_OUT,
};


#define BSD__IOC(inout,group,num,len) \
	(inout | ((len & BSD_IOCPARM_MASK) << 16) | ((group) << 8) | (num))

#define	BSD__IO(g,n)		BSD__IOC(BSD_IOC_VOID, (g), (n), 0)
#define	BSD__IOR(g,n,t)		BSD__IOC(BSD_IOC_OUT, (g), (n), sizeof(t))
#define	BSD__IOW(g,n,t)		BSD__IOC(BSD_IOC_IN, (g), (n), sizeof(t))
#define	BSD__IOWR(g,n,t)	BSD__IOC(BSD_IOC_INOUT,	(g), (n), sizeof(t))

/* Some SYSV systems exhibit "compatible" BSD ioctls without the bumf. */
#define BSD__IOV(c,d)	(((c) << 8) | (d))

#endif /* _ABI_IOCTL_H */

ipc.h

/*
 * Copyright (c) 1994 Mike Jagdis.
 * Copyright (c) 2001 Christoph Hellwig.
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
#ifndef _ABI_SVR4_IPC_H
#define _ABI_SVR4_IPC_H

#ident "%W% %G%"

/*
 * General IPC
 */
enum {
	SVR4_IPC_RMID =		0,
	SVR4_IPC_SET =		1,
	SVR4_IPC_STAT =		2,
	SVR4_IPC_RMID_L =	10,
	SVR4_IPC_SET_L =	11,
	SVR4_IPC_STAT_L =	12,
};

struct ibcs2_ipc_perm {
	u_int16_t		uid;	/* owner's user id */
	u_int16_t		gid;	/* owner's group id */
	u_int16_t		cuid;	/* creator's user id */
	u_int16_t		cgid;	/* creator's group id */
	u_int16_t		mode;	/* access modes */
	u_int16_t		seq;	/* slot usage sequence number */
	int32_t			key;	/* key */
};

struct abi4_ipc_perm {
	u_int32_t		uid;	/* owner's user id */
	u_int32_t		gid;	/* owner's group id */
	u_int32_t		cuid;	/* creator's user id */
	u_int32_t		cgid;	/* creator's group id */
	u_int32_t		mode;	/* access modes */
	u_int32_t		seq;	/* slot usage sequence number */
	int32_t			key;	/* key */
	int32_t			pad[4];	/* reserved */
};

/*
 * Message queues
 */
enum {
	SVR4_msgget =	0,
	SVR4_msgctl =	1,
	SVR4_msgrcv =	2,
	SVR4_msgsnd =	3,
};

struct ibcs2_msqid_ds {
	struct ibcs2_ipc_perm	msg_perm;
	struct msg		*msg_first;
	struct msg		*msg_last;
	u_int16_t		msg_cbytes;
	u_int16_t		msg_qnum;
	u_int16_t		msg_qbytes;
	u_int16_t		msg_lspid;
	u_int16_t		msg_lrpid;
	time_t			msg_stime;
	time_t			msg_rtime;
	time_t			msg_ctime;
};

struct abi4_msg {
	struct abi4_msg		*msg_next;
	int32_t			msg_type;
	u_int16_t		msg_ts;
	int16_t			msg_spot;
};

struct abi4_msqid_ds {
	struct abi4_ipc_perm	msg_perm;
	struct msg		*msg_first;
	struct msg		*msg_last;
	u_int32_t		msg_cbytes;
	u_int32_t		msg_qnum;
	u_int32_t		msg_qbytes;
	u_int32_t		msg_lspid;
	u_int32_t		msg_lrpid;
	u_int32_t		msg_stime;
	u_int32_t		msg_pad1;
	u_int32_t		msg_rtime;
	u_int32_t		msg_pad2;
	u_int32_t		msg_ctime;
	u_int32_t		msg_pad3;
	u_int32_t		msg_pad4[4];
};

/*
 * Shared memory
 */
enum {
	SVR4_shmat =	0,
	SVR4_shmctl =	1,
	SVR4_shmdt =	2,
	SVR4_shmget =	3,
};
 
/* shmctl() operations */
enum {
	SVR4_SHM_LOCK =		3,
	SVR4_SHM_UNLOCK =	4,
};

struct ibcs2_shmid_ds {
	struct ibcs2_ipc_perm	shm_perm;	/* operation permissions */
	int32_t			shm_segsz;	/* size of segment in bytes */
	struct region		*__pad1;	/* ptr to region structure */
	char			__pad2[4];	/* for swap compatibility */
	u_int16_t		shm_lpid;	/* pid of last shmop */
	u_int16_t		shm_cpid;	/* pid of creator */
	u_int16_t		shm_nattch;	/* used only for shminfo */
	u_int16_t		 __pad3;
	time_t			shm_atime;	/* last shmat time */
	time_t			shm_dtime;	/* last shmdt time */
	time_t			shm_ctime;	/* last change time */
};

struct abi4_shmid_ds {
	struct abi4_ipc_perm	shm_perm;	/* operation permissions */
	int32_t			shm_segsz;	/* size of segment in bytes */
	struct region		*__pad1;	/* ptr to region structure */
	u_int16_t		shm_lckcnt;	/* number of locks */
	char			__pad2[2];	/* for swap compatibility */
	u_int32_t		shm_lpid;	/* pid of last shmop */
	u_int32_t		shm_cpid;	/* pid of creator */
	u_int32_t		shm_nattch;/* used only for shminfo */
	u_int32_t		shm_cnattch;
	u_int32_t		shm_atime;	/* last shmat time */
	u_int32_t		shm_pad1;
	u_int32_t		shm_dtime;	/* last shmdt time */
	u_int32_t		shm_pad2;
	u_int32_t		shm_ctime;	/* last change time */
	u_int32_t		shm_pad3;
	u_int32_t		shm_pad4[4];
};

/*
 * Semaphores
 */
enum {
	SVR4_semctl =	0,
	SVR4_semget =	1,
	SVR4_semop =	2,
};
 
/* semctl() operations */
enum {
	SVR4_SEM_GETNCNT =	3,
	SVR4_SEM_GETPID =	4,
	SVR4_SEM_GETVAL	=	5,
	SVR4_SEM_GETALL	=	6,
	SVR4_SEM_GETZCNT =	7,
	SVR4_SEM_SETVAL =	8,
	SVR4_SEM_SETALL =	9,
};

/* mapping of svr4 semaphore operations to Linux (if available) */
static int svr4sem2linux[] = {
	[SVR4_IPC_RMID]	=	IPC_RMID,
	[SVR4_IPC_SET] =	IPC_SET,
	[SVR4_IPC_STAT] =	IPC_STAT,
	[SVR4_SEM_GETNCNT] =	GETNCNT,
	[SVR4_SEM_GETPID] =	GETPID,
	[SVR4_SEM_GETVAL] =	GETVAL,
	[SVR4_SEM_GETALL] =	GETALL,
	[SVR4_SEM_GETZCNT] =	GETZCNT,
	[SVR4_SEM_SETVAL] =	SETVAL,
	[SVR4_SEM_SETALL] =	SETALL,
	[SVR4_IPC_RMID_L] =	IPC_RMID,
	[SVR4_IPC_SET_L] =	IPC_SET,
	[SVR4_IPC_STAT_L] =	IPC_STAT,
};

struct ibcs2_semid_ds {
	struct ibcs2_ipc_perm	sem_perm;
	struct sem		*sem_base;
	u_int16_t		sem_nsems;
	char			__pad[2];
	u_int32_t		sem_otime;
	u_int32_t		sem_ctime;
};

struct abi4_semid_ds {
	struct abi4_ipc_perm	sem_perm;
	struct sem		*sem_base;
	u_int16_t		sem_nsems;
	char			__pad[2]; /* this pad is not in the abi doc! */
	u_int32_t		sem_otime;
	u_int32_t		sem_pad1;
	u_int32_t		sem_ctime;
	u_int32_t		sem_pad2;
	u_int32_t		sem_pad3[4];
};

#endif /* _ABI_SVR4_IPC_H */

Notes.Signal

Drew, Joe, and Brandon.

This file contains my code for the signal functions. I realized that the
existing signal functions will not suffice. This module should do the
proper processing for iBCS signals.

There are patches to the emulate module offered by Drew in his pl14n code
release. The Makefile was changed to include the module.

In addition, I have include a signal.doc file which contains the text from
my UNIX S5 manual describing the functions used by iBCS. I based the
emulator code on this document. Please look it over and see if I have
messed up. I believe it to be correct. However, it never hurts to have
someone check the work before we can trust it.

It follows what I believe to be the proper calling sequence for signals. I
sent a message to the IBSC2 group with the text from the McGraw Hill book
concerning signals. If you would like a copy of the message, then let me
know.

Of couse, this could be totally wrong. That is the whole point about
sending this out to a limited distribution.

In addition to the processing for the various function requests, you may
have noticed that the signal _numbers_ must be changed between the values
used by iBCS and Linux.

I have had to modify the emulate.c module to export an additional
procedure (and for emulate.c to use the procedure itself.) In addition, I
change the branch table to re-direct the signal processing to the signal.c
module.

I hope that this will help the project when it has been proven workable.
Please let me know how this turns out -- one way or the other.

If it does work, then I'll give the final code to Drew to merge into the
master code. That is unless, Drew, you already have it. :-)

Thanks much.

--
Al Longyear           longyear@netcom.com         longyear@sii.com

Personality

*** Why are multiple personalities necessary?

Personalities are used to provide the expected set of syscalls and error
code mapping for non-Linux processes. In theory the set of syscalls and
error codes should be standardised across all SYSV systems. In practice
this is the case for SVR4, however SVR3 is a much older code base and
many vendors have extended it leading to incompatibilities between the
expected interfaces. Personalities allow us to vary the interface presented
on a per-process basis thus allowing Linux to run binaries created for
different vendor's extended SVR3s simultaneously.


*** How are personalities implemented?

The per-process task structure contains a field "personality". This defaults
to 0 for Linux binaries, 1 (SVR4) for ELF binaries and 2 (SVR3) for COFF
binaries. However when the COFF loader is called on to load a new binary
it looks at the first 1k of data in each .comment section and compares
the strings it finds with a built in table. If it finds a match it will
set the personality appropriately.

  When the application makes a system call the iBCS emulation layer uses
the personality code in the per-process task structure to determine which
system call mappings to use to locate the correct function.

  If the function returns an (Linux) error code the iBCS emulation layer
uses the personality code to determine which error code mappings to use
to translate the error code in to a value the application will understand.


*** What personalities are implemented?

Currently the implemented personalities are SVR4, SVR3 (as a direct
subset of SVR4), SCO 3.[24] and Wyse V/386 3.2.1. Of these the Wyse
emulation is the most complete at this time. Rather than using the
more common streams based TCP/IP stack on their SVR3, Wyse used a BSD
implementation with a system call interface. Currently the Wyse emulation
is the only one capable of running non-Linux TCP/IP binaries.


*** When do I need to add a personality rather than use the default?

When your applications start failing for inexplicable reasons! Seriously,
if you have an SVR3 based Unix which does not currently have its own
personality defined then you should check some things very carefully.

  Firstly compare your system's /usr/include/sys/errno.h with the data
in the Error.map file. If the values defined in your errno.h do not
match those in the ABI column then you will need to create a new
personality in order to map error codes to the correct values.

  Next compare your system's /usr/include/sys.s with the data in the
Syscall.map file. If there are system calls in your sys.s that don't
do the same thing as those in the ABI column (other than ones that
simply aren't implemented on your system) then you will need to create
a new personality in order to mapp system calls to the correct functions.


*** How do I add a new personality?

The first step is to find a way for the COFF loader to recognise your
binaries as being different. To do this you need to examine the comments
embedded in a range of binaries, system executables, bought programs of
various ages and locally compiled programs, using "mcs -p" to list the
.comments sections. If you don't have "mcs" use "strings" and look for
version or copyright messages. You are looking for one or more strings
near the top which uniquely identify the system.

  Once you have your identifying strings you must add a value for the
new personality to linux/include/linux/personality.h (just use the
next highest number) and add the strings to the table in the COFF loader
linux/fs/binfmt_coff.c.

  The next step is to modify the error map. Edit the file errmap.inc and
look at the end of the file where there is an array of pointers to error
maps call err_map. There is one entry for each personality. Add a new
entry to the end for your personality. If your personality is compatible
with an exising personality you can simply reuse the same error map (see
the duplicate entries for the SVR4 map which is use for both SVR4 and
SVR3 personalities), otherwise you must figure out how to create a new
error mapping. One day it may be documented here :-).

  Next you must modify the syscall mapping. Edit the file callmap.inc
and look at the end of the file where there is an array containg one
pointer for each personality. Add a new entry to the end. If your syscalls
match one of the existing personalities you may reuse the existing map.
Otherwise you have to build a new one. Again, one day it may be documented
here...

signal.h

#ifndef _ABI_CXENIX_SIGNAL_H
#define _ABI_CXENIX_SIGNAL_H

enum {
	SCO_SA_NOCLDSTOP =	0x001,
	SCO_SA_COMPAT =		0x080, /* 3.2.2 compatibilty. */
	SCO_SA_SIGNAL =		0x100,
};

struct sco_sigaction {
	void		(*sa_handler)(int);
	unsigned long	sa_mask;
	int		sa_flags;
};

#endif /* _ABI_CXENIX_SIGNAL_H */

stat.h

#ifndef _ABI_SCO_STAT_H
#define _ABI_SCO_STAT_H

#ident "%W% %G%"

#include <abi/sco/types.h>


struct sco_xstat {
	sco_dev_t	st_dev;
	u_int32_t	__pad1[3];
	sco_ino_t	st_ino;
	sco_mode_t	st_mode;
	sco_nlink_t	st_nlink;
	sco_uid_t	st_uid;
	sco_gid_t	st_gid;
	sco_dev_t	st_rdev;
	u_int32_t	__pad2[2];
	sco_off_t	st_size;
	u_int32_t	__pad3;
	sco_time_t	st_atime;
	sco_time_t	st_mtime;
	sco_time_t	st_ctime;
	int32_t		st_blksize;
	int32_t		st_blocks;
	char		st_fstype[16];
	u_int32_t	__pad4[7];
	int32_t		st_sco_flags;
};

#endif /* _ABI_SCO_STAT_H */

Syscall.map

Call	ABI		SCO 3.2		SCO 3.4		Wyse V/386 3.2.1	386bsd

  1	exit
  2	fork
  3	read
  4	write
  5	open
  6	close
  7	wait
  8	creat
  9	link
 10	unlink
 11	exec
 12	chdir
 13	time									fchdir
 14	mknod
 15	chmod
 16	chown
 17	brk/break
 18	stat									getfsstat
 19	seek/seek
 20	getpid
 21	mount
 22	umount
 23	setuid
 24	getuid
 25	stime									geteuid
 26	ptrace
 27	alarm									recvmsg
 28	fstat									sendmsg
 29	pause									recvfrom
 30	utime									accept
 31	stty									getpeername
 32	gtty									getsockname
 33	access
 34	nice									chflags
 35	statfs									fchflags
 36	sync
 37	kill
 38	fstatfs									stat
 39	setpgrp									getppid
 40	cxenix									lstat
 41	dup
 42	pipe
 43	times									getegid
 44	prof
 45	lock/plock								ktrace
 46	setgid									sigaction
 47	getgid
 48	signal									sigprocmask
 49	msgsys									getlogin
 50	sysi86/sys3b								setlogin
 51	sysacct/acct
 52	shmsys									sigpending
 53	semsys									sigaltstack
 54	ioctl
 55	uadmin									reboot
 56	???									revoke
 57	utssys									symlink
 58	???									readlink
 59	execv
 60	umask
 61	chroot
 62	fcntl									fstat
 63	ulimit									getkerninfo
 64	???									getpagesize
 65	???									msync
 66	???									vfork
 67	???									vread
 68	???									vwrite
 69	???									sbrk
 70	advfs									sstk
 71	unadvfs									mmap
 72	rmount									vadvise
 73	rumount									munmap
 74	rfstart									mprotect
 75	???									madvise
 76	rdebug									vhangup
 77	rfstop									vlimit
 78	rfsys									mincore
 79	rmdir									getgroups
 80	mkdir									setgroups
 81	getdents								getpgrp
 82	libattach								setpgid
 83	libdetach								setitimer
 84	sysfs									wait
 85	getmsg									swapon
 86	putmsg									getitimer
 87	poll									gethostname
 88	lstat		---		---		---			sethostname
 89	symlink		---		---		---			getdtablesize
 90	readlink	---		symlink		---			dup2
 91	setgroups	---		lstat		---			---
 92	getgroups	---		readlink	---			fcntl
 93	fchmod		---		---		---			select
 94	fchown		---		---		---			---
 95	sigprocmask	---		---		---			fsync
 96	sigsuspend	---		---		---			setpriority
 97	sigaltstack	---		---		---			socket
 98	sigaction	---		---		---			connect
 99	sigpending	---		---		---			accept
100	context		---		---		---			getpriority
101	evsys		---		---		---			send
102	evtrapret	---		---		---			recv
103	statvfs		---		---		---			sigreturn
104	fstatvfs	---		---		---			bind
105	???									setsockopt
106	nfssys		---		---		---			listen
107	waitsys		---		---		---			vtimes
108	sigsendsys	---		---		---			sigvec
109	hrtsys		---		---		---			sigblock
110	acancel		---		---		---			sigsetmask
111	async		---		---		---			sigsuspend
112	priocntlsys	---		---		---			sigstack
113	pathconf	---		---		---			recvmsg
114	mincore		---		---		---			sendmsg
115	mmap		---		---		---			vtrace
116	mprotect	---		---		---			gettimeofday
117	munmap		---		---		---			getrusage
118	fpathconf	---		---		---			getsockopt
119	vfork		---		---		---			resuba
120	fchdir		---		---		---			readv
121	readv		---		---		---			writev
122	writev		---		---		---			settimeofday
123	xstat		---		---		---			fchown
124	lxstat		---		---		---			fchmod
125	fxstat		---		---		---			recvfrom
126	xmknod		---		---		---			setreuid
127	clocal									setregid
128	setrlimit	---		---		lstat			rename
129	getrlimit	---		---		readlink		truncate
130	lchown		---		---		symlink			ftruncate
131	memcntl		---		---		---			flock
132	getpmsg		---		---		---			mkfifo
133	putpmsg		---		---		gethostname		sendto
134	rename		---		---		sethostname		shutdown
135	uname		---		---		getdomainname		socketpair
136	setegid		---		---		setdomainname		mkdir
137	sysconfig	---		---		---			rmdir
138	adjtime		---		---		setreuid		utimes
139	systeminfo	---		---		setregid		sigreturn
140	???									adjtime
141	seteuid		---		---		---			getpeername
142	---		---		---		---			gethostid
143	---		---		---		---			sethostid
144	---		---		---		---			getrlimit
145	---		---		---		---			setrlimit
146	---		---		---		---			killpg
147	---		---		---		---			setsid
148	---		---		---		---			quotactl
149	---		---		---		---			quota
150	---		---		---		---			getsockname
151	---		---		---		---
152	---		---		---		---
153	---		---		---		---
154	---		---		---		---
155	---		---		---		---			nfssvc
156	---		---		---		---			getdirentries
157	---		---		---		---			statfs
158	---		---		---		---			fstatfs
159	---		---		---		---
160	---		---		---		---			async_daemon
161	---		---		---		---			getfh
162	---		---		---		---			getdomainname
163	---		---		---		---			setdomainname
164	---		---		---		---			uname
165	---		---		---		---			sysarch
166	---		---		---		---
167	---		---		---		---
168	---		---		---		---
169	---		---		---		---			semsys
170	---		---		---		---			msgsys
171	---		---		---		---			shmsys
172	---		---		---		---
173	---		---		---		---
174	---		---		---		---
175	---		---		---		---			ntp_gettime
176	---		---		---		---			ntp_adjtime
177	---		---		---		---			vm_allocate
178	---		---		---		---			vm_deallocate
179	---		---		---		---			vm_inherit
180	---		---		---		---			vm_protect
181	---		---		---		---			setgid
182	---		---		---		---			setegid
183	---		---		---		---			seteuid