home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
d
/
ddx-mips.zip
/
MIPSOSSY.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-07-31
|
3KB
|
121 lines
/*
* $XConsortium$
*
* Copyright 1991 MIPS Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of MIPS not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. MIPS makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* MIPS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL MIPS
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ident "$Header: mipsOsSYSV.c,v 1.5 91/12/12 17:24:44 dd Exp $"
/*
* OS support code which requires svr3 include files
*/
#include <sysv/sys/types.h>
#include <sysv/sys.s>
#include "mips.h"
/*
* plock
*/
#ifdef BSD43
plock(op)
int op;
{
return syscall(SYS_plock, op);
}
#endif /* BSD43 */
/*
* System V SHM
*/
#if defined(BSD43) && MIPS_RISCOS_VERSION < 5
#include <sysv/sys/ipc.h>
#include <sysv/sys/shm.h>
#define SHMAT 0
#define SHMCTL 1
#define SHMDT 2
#define SHMGET 3
char *
shmat(shmid, shmaddr, shmflg)
int shmid;
char *shmaddr;
int shmflg;
{
return (char *) syscall(SYS_shmsys, SHMAT, shmid, shmaddr, shmflg);
}
shmget(key, size, shmflg)
key_t key;
int size, shmflg;
{
return (syscall(SYS_shmsys, SHMGET, key, size, shmflg));
}
shmctl(shmid, cmd, buf)
int shmid, cmd;
struct shmid_ds *buf;
{
return (syscall(SYS_shmsys, SHMCTL, shmid, cmd, buf));
}
shmdt(shmaddr)
char *shmaddr;
{
return (syscall(SYS_shmsys, SHMDT, shmaddr));
}
#endif /* defined(BSD43) && MIPS_RISCOS_VERSION < 5 */
/*
* Async enable
*/
#define _BSD43_SYS_TYPES_ /* don't include bsd43/sys/types.h */
#define _SYS_TYPES_H /* don't include svr4/sys/types.h */
#include <sysv/sys/stropts.h>
mipsStreamAsync(fd, on)
int fd;
int on;
{
return ioctl(fd, I_SETSIG, on ? S_INPUT | S_HIPRI : 0);
}
/*
* An SVR3 ioctl call has to be used for KTCWRTCOLOR because (as of 4.x)
* struct colorm is too large for the BSD ioctl code to handle.
*
* It is also used for KTMBLANK but I don't know if that's necessary.
*/
sysvIoctl(fd, req, data)
int fd;
int req;
char *data;
{
return syscall(SYS_ioctl, fd, req, data);
}