home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / ioccom.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  2.2 KB  |  60 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. #ifndef _SYS_IOCCOM_H
  11. #define _SYS_IOCCOM_H
  12.  
  13. #ident    "@(#)/usr/include/sys/ioccom.h.sl 1.1 4.0 12/08/90 51789 AT&T-USL"
  14.  
  15. /*    @(#)ioccom.h 1.3 88/02/08 SMI; from UCB ioctl.h 7.1 6/4/86    */
  16.  
  17. /*
  18.  *          PROPRIETARY NOTICE (Combined)
  19.  *  
  20.  *  This source code is unpublished proprietary information
  21.  *  constituting, or derived under license from AT&T's Unix(r) System V.
  22.  *  In addition, portions of such source code were derived from Berkeley
  23.  *  4.3 BSD under license from the Regents of the University of
  24.  *  California.
  25.  *  
  26.  *  
  27.  *  
  28.  *          Copyright Notice 
  29.  *  
  30.  *  Notice of copyright on this source code product does not indicate 
  31.  *  publication.
  32.  *  
  33.  *      (c) 1986,1987,1988,1989  Sun Microsystems, Inc.
  34.  *      (c) 1983,1984,1985,1986,1987,1988,1989  AT&T.
  35.  *                All rights reserved.
  36.  */
  37.  
  38. /*
  39.  * Ioctl's have the command encoded in the lower word,
  40.  * and the size of any in or out parameters in the upper
  41.  * word.  The high 2 bits of the upper word are used
  42.  * to encode the in/out status of the parameter; for now
  43.  * we restrict parameters to at most 255 bytes.
  44.  */
  45. #define    IOCPARM_MASK    0xff        /* parameters must be < 256 bytes */
  46. #define    IOC_VOID    0x20000000    /* no parameters */
  47. #define    IOC_OUT        0x40000000    /* copy out parameters */
  48. #define    IOC_IN        0x80000000    /* copy in parameters */
  49. #define    IOC_INOUT    (IOC_IN|IOC_OUT)
  50. /* the 0x20000000 is so we can distinguish new ioctl's from old */
  51. #define    _IO(x,y)    (IOC_VOID|(x<<8)|y)
  52. #define    _IOR(x,y,t)    (IOC_OUT|((((int)sizeof(t))&IOCPARM_MASK)<<16)|(x<<8)|y)
  53. #define    _IORN(x,y,t)    (IOC_OUT|(((t)&IOCPARM_MASK)<<16)|(x<<8)|y)
  54. #define    _IOW(x,y,t)    (IOC_IN|((((int)sizeof(t))&IOCPARM_MASK)<<16)|(x<<8)|y)
  55. #define    _IOWN(x,y,t)    (IOC_IN|(((t)&IOCPARM_MASK)<<16)|(x<<8)|y)
  56. /* this should be _IORW, but stdio got there first */
  57. #define    _IOWR(x,y,t)    (IOC_INOUT|((((int)sizeof(t))&IOCPARM_MASK)<<16)|(x<<8)|y)
  58.  
  59. #endif    /* _SYS_IOCCOM_H */
  60.