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 >
C/C++ Source or Header  |  1992-07-31  |  3KB  |  121 lines

  1. /*
  2.  * $XConsortium$
  3.  *
  4.  * Copyright 1991 MIPS Computer Systems, Inc.
  5.  *
  6.  * Permission to use, copy, modify, distribute, and sell this software and its
  7.  * documentation for any purpose is hereby granted without fee, provided that
  8.  * the above copyright notice appear in all copies and that both that
  9.  * copyright notice and this permission notice appear in supporting
  10.  * documentation, and that the name of MIPS not be used in advertising or
  11.  * publicity pertaining to distribution of the software without specific,
  12.  * written prior permission.  MIPS makes no representations about the
  13.  * suitability of this software for any purpose.  It is provided "as is"
  14.  * without express or implied warranty.
  15.  *
  16.  * MIPS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
  17.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL MIPS
  18.  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  19.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  20.  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
  21.  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  22.  */
  23. #ident    "$Header: mipsOsSYSV.c,v 1.5 91/12/12 17:24:44 dd Exp $"
  24.  
  25. /*
  26.  * OS support code which requires svr3 include files
  27.  */
  28.  
  29. #include <sysv/sys/types.h>
  30. #include <sysv/sys.s>
  31.  
  32. #include "mips.h"
  33.  
  34. /*
  35.  * plock
  36.  */
  37.  
  38. #ifdef BSD43
  39. plock(op)
  40.     int op;
  41. {
  42.     return syscall(SYS_plock, op);
  43. }
  44. #endif /* BSD43 */
  45.  
  46.  
  47. /*
  48.  * System V SHM
  49.  */
  50.  
  51. #if defined(BSD43) && MIPS_RISCOS_VERSION < 5
  52.  
  53. #include <sysv/sys/ipc.h>
  54. #include <sysv/sys/shm.h>
  55.  
  56. #define    SHMAT    0
  57. #define    SHMCTL    1
  58. #define    SHMDT    2
  59. #define    SHMGET    3
  60.  
  61. char *
  62. shmat(shmid, shmaddr, shmflg)
  63.     int shmid;
  64.     char *shmaddr;
  65.     int shmflg;
  66. {
  67.     return (char *) syscall(SYS_shmsys, SHMAT, shmid, shmaddr, shmflg);
  68. }
  69.  
  70. shmget(key, size, shmflg)
  71.     key_t key;
  72.     int size, shmflg;
  73. {
  74.     return (syscall(SYS_shmsys, SHMGET, key, size, shmflg));
  75. }
  76.  
  77. shmctl(shmid, cmd, buf)
  78.     int shmid, cmd;
  79.     struct shmid_ds *buf;
  80. {
  81.     return (syscall(SYS_shmsys, SHMCTL, shmid, cmd, buf));
  82. }
  83.  
  84. shmdt(shmaddr)
  85.     char *shmaddr;
  86. {
  87.     return (syscall(SYS_shmsys, SHMDT, shmaddr));
  88. }
  89. #endif /* defined(BSD43) && MIPS_RISCOS_VERSION < 5 */
  90.  
  91.  
  92. /*
  93.  * Async enable
  94.  */
  95.  
  96. #define    _BSD43_SYS_TYPES_    /* don't include bsd43/sys/types.h */
  97. #define    _SYS_TYPES_H        /* don't include svr4/sys/types.h */
  98. #include <sysv/sys/stropts.h>
  99.  
  100. mipsStreamAsync(fd, on)
  101.     int fd;
  102.     int on;
  103. {
  104.     return ioctl(fd, I_SETSIG, on ? S_INPUT | S_HIPRI : 0);
  105. }
  106.  
  107.  
  108. /*
  109.  * An SVR3 ioctl call has to be used for KTCWRTCOLOR because (as of 4.x)
  110.  * struct colorm is too large for the BSD ioctl code to handle.
  111.  *
  112.  * It is also used for KTMBLANK but I don't know if that's necessary.
  113.  */
  114. sysvIoctl(fd, req, data)
  115.     int fd;
  116.     int req;
  117.     char *data;
  118. {
  119.     return syscall(SYS_ioctl, fd, req, data);
  120. }
  121.