summaryrefslogtreecommitdiff
path: root/StdLib/Include/sys/ioccom.h
diff options
context:
space:
mode:
Diffstat (limited to 'StdLib/Include/sys/ioccom.h')
-rw-r--r--StdLib/Include/sys/ioccom.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/StdLib/Include/sys/ioccom.h b/StdLib/Include/sys/ioccom.h
index 210c918..852a082 100644
--- a/StdLib/Include/sys/ioccom.h
+++ b/StdLib/Include/sys/ioccom.h
@@ -30,7 +30,6 @@
*
* @(#)ioccom.h 8.3 (Berkeley) 1/9/95
*/
-
#ifndef _SYS_IOCCOM_H_
#define _SYS_IOCCOM_H_
@@ -40,6 +39,7 @@
* upper word are used to encode the in/out status of the parameter.
*/
#define IOCPARM_MASK 0x1fff /* parameter length, at most 13 bits */
+
#define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK)
#define IOCBASECMD(x) ((x) & ~(IOCPARM_MASK << 16))
#define IOCGROUP(x) (((x) >> 8) & 0xff)
@@ -56,11 +56,12 @@
/* mask for IN/OUT/VOID */
#define IOC_DIRMASK (unsigned long)0xe0000000
-#define _IOC(inout,group,num,len) \
- (inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num))
+#define _IOC(inout,group,num,len) (inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num))
+
#define _IO(g,n) _IOC(IOC_VOID, (g), (n), 0)
#define _IOR(g,n,t) _IOC(IOC_OUT, (g), (n), sizeof(t))
#define _IOW(g,n,t) _IOC(IOC_IN, (g), (n), sizeof(t))
+
/* this should be _IORW, but stdio got there first */
#define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t))