ioctl.h

来自「俄罗斯高人Mamaich的Pocket gcc编译器(运行在PocketPC上)」· C头文件 代码 · 共 84 行

H
84
字号
/* Copyright (C) 1991, 92, 93, 94, 96, 98, 99 Free Software Foundation, Inc.   This file is part of the GNU C Library.   The GNU C Library is free software; you can redistribute it and/or   modify it under the terms of the GNU Lesser General Public   License as published by the Free Software Foundation; either   version 2.1 of the License, or (at your option) any later version.   The GNU C Library is distributed in the hope that it will be useful,   but WITHOUT ANY WARRANTY; without even the implied warranty of   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU   Lesser General Public License for more details.   You should have received a copy of the GNU Lesser General Public   License along with the GNU C Library; if not, write to the Free   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA   02111-1307 USA.  */#ifndef	_SYS_IOCTL_H#define	_SYS_IOCTL_H	1#include <features.h>__BEGIN_DECLS/*  * SOCKET IOCTL's: * Ioctl's have the command encoded in the lower word, * and the size of any in or out parameters in the upper * word.  The high 2 bits of the upper word are used * to encode the in/out status of the parameter; for now * we restrict parameters to at most 128 bytes. */#define IOCPARM_MASK   (0x7ff)          /* parameters must be < 2k bytes */#define	IOCGROUP(x)	   (((x) >> 8) & 0xff)#define IOC_VOID       (0x20000000)     /* no parameters */#define IOC_OUT        (0x40000000)     /* copy out parameters */#define IOC_IN         (0x80000000_     /* copy in parameters */#define IOC_INOUT      (IOC_IN|IOC_OUT)#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))#define FIONREAD    _IOR('f', 127, unsigned long) /* get # bytes to read */#define FIONBIO     _IOW('f', 126, unsigned long) /* set/clear non-blocking i/o */#define FIOASYNC    _IOW('f', 125, unsigned long) /* set/clear async i/o *//* Socket I/O Controls */#define SIOCSHIWAT  _IOW('s',  0, unsigned long)  /* set high watermark */#define SIOCGHIWAT  _IOR('s',  1, unsigned long)  /* get high watermark */#define SIOCSLOWAT  _IOW('s',  2, unsigned long)  /* set low watermark */#define SIOCGLOWAT  _IOR('s',  3, unsigned long)  /* get low watermark */#define SIOCATMARK  _IOR('s',  7, unsigned long)  /* at oob mark? *//*!! CAV */#if 0/* Get the list of `ioctl' requests and related constants.  */#include <bits/ioctls.h>/* Define some types used by `ioctl' requests.  */#include <bits/ioctl-types.h>/* On a Unix system, the system <sys/ioctl.h> probably defines some of   the symbols we define in <sys/ttydefaults.h> (usually with the same   values).  The code to generate <bits/ioctls.h> has omitted these   symbols to avoid the conflict, but a Unix program expects <sys/ioctl.h>   to define them, so we must include <sys/ttydefaults.h> here.  */#include <sys/ttydefaults.h>#endif/* Perform the I/O control operation specified by REQUEST on FD.   One argument may follow; its presence and type depend on REQUEST.   Return value depends on REQUEST.  Usually -1 indicates error.  */extern int ioctl (int __fd, unsigned int __request, void *arg) __THROW;__END_DECLS#endif /* sys/ioctl.h */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?