]> sourceware.org Git - newlib-cygwin.git/blame - winsup/cygwin/include/sys/ioctl.h
newlib: Add more FreeBSD files for non LDBL_EQ_DBL support
[newlib-cygwin.git] / winsup / cygwin / include / sys / ioctl.h
CommitLineData
a887211b
CV
1/* sys/ioctl.h
2
a887211b
CV
3This file is part of Cygwin.
4
5This software is a copyrighted work licensed under the terms of the
6Cygwin license. Please consult the file "CYGWIN_LICENSE" for
7details. */
8
1fd5e000
CF
9/* sys/ioctl.h */
10
11#ifndef _SYS_IOCTL_H
12#define _SYS_IOCTL_H
13
14#include <sys/cdefs.h>
bf8ea306 15#include <sys/termios.h>
1fd5e000 16
728b9af5
CF
17__BEGIN_DECLS
18
1fd5e000
CF
19/* /dev/windows ioctls */
20
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 */
24
728b9af5
CF
25/* Some standard linux defines */
26
7d7d09ae
CF
27#define _IOC_NRBITS 8
28#define _IOC_TYPEBITS 8
29#define _IOC_SIZEBITS 14
30#define _IOC_DIRBITS 2
1cd06583 31
7d7d09ae
CF
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)
1cd06583 36
7d7d09ae
CF
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)
1cd06583 41
7d7d09ae
CF
42#define _IOC_NONE 0U
43#define _IOC_WRITE 1U
44#define _IOC_READ 2U
1cd06583 45
728b9af5 46#define _IOC(dir,type,nr,size) \
7d7d09ae
CF
47 (((dir) << _IOC_DIRSHIFT) | \
48 + ((type) << _IOC_TYPESHIFT) | \
49 + ((nr) << _IOC_NRSHIFT) | \
50 + ((size) << _IOC_SIZESHIFT))
728b9af5 51
7d7d09ae
CF
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))
56
57#ifdef __USE_LINUX_IOCTL_DEFS
ca487099
CF
58# define _IO _LINUX_IO
59# define _IOR _LINUX_IOR
60# define _IOW _LINUX_IOW
61# define _IOWR _LINUX_IOWR
7d7d09ae 62#endif /*__USE_LINUX_IOCTL_DEFS */
728b9af5 63
30c5411d 64int ioctl (int __fd, int __cmd, ...);
1fd5e000
CF
65
66__END_DECLS
1fd5e000 67#endif
This page took 0.604813 seconds and 6 git commands to generate.