]>
sourceware.org Git - newlib-cygwin.git/blob - winsup/cygwin/include/sys/ioctl.h
6289e7da79ad9912548eb0485f7c694141945182
3 This file is part of Cygwin.
5 This software is a copyrighted work licensed under the terms of the
6 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
14 #include <sys/cdefs.h>
15 #include <sys/termios.h>
19 /* /dev/windows ioctls */
21 #define WINDOWS_POST 0 /* Set write() behavior to PostMessage() */
22 #define WINDOWS_SEND 1 /* Set write() behavior to SendMessage() */
23 #define WINDOWS_HWND 2 /* Set hWnd for read() calls */
25 /* Some standard linux defines */
28 #define _IOC_TYPEBITS 8
29 #define _IOC_SIZEBITS 14
30 #define _IOC_DIRBITS 2
32 #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
33 #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
34 #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
35 #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
37 #define _IOC_NRSHIFT 0
38 #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
39 #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
40 #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
46 #define _IOC(dir,type,nr,size) \
47 (((dir) << _IOC_DIRSHIFT) | \
48 + ((type) << _IOC_TYPESHIFT) | \
49 + ((nr) << _IOC_NRSHIFT) | \
50 + ((size) << _IOC_SIZESHIFT))
52 #define _LINUX_IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
53 #define _LINUX_IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
54 #define _LINUX_IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
55 #define _LINUX_IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
57 #ifdef __USE_LINUX_IOCTL_DEFS
58 # define _IO _LINUX_IO
59 # define _IOR _LINUX_IOR
60 # define _IOW _LINUX_IOW
61 # define _IOWR _LINUX_IOWR
62 #endif /*__USE_LINUX_IOCTL_DEFS */
64 int ioctl (int __fd
, int __cmd
, ...);
This page took 0.045428 seconds and 6 git commands to generate.