home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / server / ddx / mips / mipsOsSYSV.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-07-18  |  2.7 KB  |  107 lines

  1. /*
  2.  * $XConsortium: mipsOsSYSV.c,v 1.2 91/07/18 22:58:55 keith Exp $
  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.2 91/07/18 22:58:55 keith 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. #include <sysv/sys/ipc.h>
  32. #include <sysv/sys/shm.h>
  33.  
  34. /* XXX 5.0 brain damage */
  35. #define    _BSD43_SYS_TYPES_    /* don't include bsd43/sys/types.h */
  36. /*#include <sysv/sys/conf.h>*/    /* bsd43/sys/conf.h has no guards! */
  37. #define FMNAMESZ    8
  38. #include <sysv/sys/stropts.h>
  39.  
  40. #include "mips.h"
  41.  
  42. #ifndef SYSV
  43. plock(op)
  44.     int op;
  45. {
  46.     return syscall(SYS_plock, op);
  47. }
  48. #endif /* SYSV */
  49.  
  50. #ifndef SYSV
  51.  
  52. #define    SHMAT    0
  53. #define    SHMCTL    1
  54. #define    SHMDT    2
  55. #define    SHMGET    3
  56.  
  57. char *
  58. shmat(shmid, shmaddr, shmflg)
  59.     int shmid;
  60.     char *shmaddr;
  61.     int shmflg;
  62. {
  63.     return (char *) syscall(SYS_shmsys, SHMAT, shmid, shmaddr, shmflg);
  64. }
  65.  
  66. shmget(key, size, shmflg)
  67.     key_t key;
  68.     int size, shmflg;
  69. {
  70.     return (syscall(SYS_shmsys, SHMGET, key, size, shmflg));
  71. }
  72.  
  73. shmctl(shmid, cmd, buf)
  74.     int shmid, cmd;
  75.     struct shmid_ds *buf;
  76. {
  77.     return (syscall(SYS_shmsys, SHMCTL, shmid, cmd, buf));
  78. }
  79.  
  80. shmdt(shmaddr)
  81.     char *shmaddr;
  82. {
  83.     return (syscall(SYS_shmsys, SHMDT, shmaddr));
  84. }
  85. #endif /* SYSV */
  86.  
  87. mipsStreamAsync(fd, on)
  88.     int fd;
  89.     int on;
  90. {
  91.     return ioctl(fd, I_SETSIG, on ? S_INPUT | S_HIPRI : 0);
  92. }
  93.  
  94. /*
  95.  * An SVR3 ioctl call has to be used for KTCWRTCOLOR because (as of 4.x)
  96.  * struct colorm is too large for the BSD ioctl code to handle.
  97.  *
  98.  * It is also used for KTMBLANK but I don't know if that's necessary.
  99.  */
  100. sysvIoctl(fd, req, data)
  101.     int fd;
  102.     int req;
  103.     char *data;
  104. {
  105.     return syscall(SYS_ioctl, fd, req, data);
  106. }
  107.