xref: /onnv-gate/usr/src/lib/libbc/inc/include/sys/stropts.h (revision 722:636b850d4ee9)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
50Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
60Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
70Sstevel@tonic-gate  * with the License.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate  * See the License for the specific language governing permissions
120Sstevel@tonic-gate  * and limitations under the License.
130Sstevel@tonic-gate  *
140Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate  *
200Sstevel@tonic-gate  * CDDL HEADER END
210Sstevel@tonic-gate  */
22*722Smuffin /*
23*722Smuffin  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24*722Smuffin  * Use is subject to license terms.
25*722Smuffin  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate /*	Copyright (c) 1984 AT&T	*/
280Sstevel@tonic-gate /*	  All Rights Reserved  	*/
290Sstevel@tonic-gate 
30*722Smuffin #ifndef _sys_stropts_h
31*722Smuffin #define	_sys_stropts_h
320Sstevel@tonic-gate 
33*722Smuffin #pragma ident	"%Z%%M%	%I%	%E% SMI"
340Sstevel@tonic-gate 
350Sstevel@tonic-gate /*
360Sstevel@tonic-gate  * Read options
370Sstevel@tonic-gate  */
380Sstevel@tonic-gate #define RNORM	0			/* read msg norm */
390Sstevel@tonic-gate #define RMSGD	1			/* read msg discard */
400Sstevel@tonic-gate #define RMSGN	2			/* read msg no discard */
410Sstevel@tonic-gate 
420Sstevel@tonic-gate /*
430Sstevel@tonic-gate  * Flush options
440Sstevel@tonic-gate  */
450Sstevel@tonic-gate 
460Sstevel@tonic-gate #define FLUSHR	1			/* flush read queue */
470Sstevel@tonic-gate #define FLUSHW	2			/* flush write queue */
480Sstevel@tonic-gate #define FLUSHRW	3			/* flush both queues */
490Sstevel@tonic-gate 
500Sstevel@tonic-gate /*
510Sstevel@tonic-gate  * Events for which to be sent SIGPOLL signal
520Sstevel@tonic-gate  */
530Sstevel@tonic-gate #define S_INPUT		001		/* regular priority msg on read Q */
540Sstevel@tonic-gate #define S_HIPRI		002		/* high priority msg on read Q */
550Sstevel@tonic-gate #define S_OUTPUT	004		/* write Q no longer full */
560Sstevel@tonic-gate #define S_MSG		010		/* signal msg at front of read Q */
570Sstevel@tonic-gate 
580Sstevel@tonic-gate /*
590Sstevel@tonic-gate  * Flags for recv() and send() syscall arguments
600Sstevel@tonic-gate  */
610Sstevel@tonic-gate #define RS_HIPRI	1		/* send/recv high priority message */
620Sstevel@tonic-gate 
630Sstevel@tonic-gate /*
640Sstevel@tonic-gate  * Flags returned as value of recv() syscall
650Sstevel@tonic-gate  */
660Sstevel@tonic-gate #define MORECTL		1		/* more ctl info is left in message */
670Sstevel@tonic-gate #define MOREDATA	2		/* more data is left in message */
680Sstevel@tonic-gate 
690Sstevel@tonic-gate #ifndef FMNAMESZ
700Sstevel@tonic-gate #define	FMNAMESZ	8
710Sstevel@tonic-gate #endif
720Sstevel@tonic-gate 
730Sstevel@tonic-gate #include <sys/ioccom.h>
740Sstevel@tonic-gate 
750Sstevel@tonic-gate /*
760Sstevel@tonic-gate  *  Stream Ioctl defines
770Sstevel@tonic-gate  */
78*722Smuffin #define I_NREAD		_IOR('S',01,int)
79*722Smuffin #define I_PUSH		_IOWN('S',02,FMNAMESZ+1)
80*722Smuffin #define I_POP		_IO('S',03)
81*722Smuffin #define I_LOOK		_IORN('S',04,FMNAMESZ+1)
82*722Smuffin #define I_FLUSH		_IO('S',05)
83*722Smuffin #define I_SRDOPT	_IO('S',06)
84*722Smuffin #define I_GRDOPT	_IOR('S',07,int)
85*722Smuffin #define I_STR		_IOWR('S',010,struct strioctl)
86*722Smuffin #define I_SETSIG	_IO('S',011)
87*722Smuffin #define I_GETSIG	_IOR('S',012,int)
88*722Smuffin #define I_FIND		_IOWN('S',013,FMNAMESZ+1)
89*722Smuffin #define I_LINK		_IO('S',014)
90*722Smuffin #define I_UNLINK	_IO('S',015)
91*722Smuffin #define I_PEEK		_IOWR('S',017,struct strpeek)
92*722Smuffin #define I_FDINSERT	_IOW('S',020,struct strfdinsert)
93*722Smuffin #define I_SENDFD	_IO('S',021)
94*722Smuffin #define I_RECVFD	_IOR('S',022,struct strrecvfd)
95*722Smuffin #define I_PLINK		_IO('S',023)
96*722Smuffin #define I_PUNLINK	_IO('S',024)
970Sstevel@tonic-gate 
980Sstevel@tonic-gate 
990Sstevel@tonic-gate /*
1000Sstevel@tonic-gate  * User level ioctl format for ioctl that go downstream I_STR
1010Sstevel@tonic-gate  */
1020Sstevel@tonic-gate struct strioctl {
1030Sstevel@tonic-gate 	int 	ic_cmd;			/* command */
1040Sstevel@tonic-gate 	int	ic_timout;		/* timeout value */
1050Sstevel@tonic-gate 	int	ic_len;			/* length of data */
1060Sstevel@tonic-gate 	char	*ic_dp;			/* pointer to data */
1070Sstevel@tonic-gate };
1080Sstevel@tonic-gate 
1090Sstevel@tonic-gate 
1100Sstevel@tonic-gate /*
1110Sstevel@tonic-gate  * Value for timeouts (ioctl, select) that denotes infinity
1120Sstevel@tonic-gate  */
1130Sstevel@tonic-gate #define INFTIM		-1
1140Sstevel@tonic-gate 
1150Sstevel@tonic-gate 
1160Sstevel@tonic-gate /*
1170Sstevel@tonic-gate  * Stream buffer structure for send and recv system calls
1180Sstevel@tonic-gate  */
1190Sstevel@tonic-gate struct strbuf {
1200Sstevel@tonic-gate 	int	maxlen;			/* no. of bytes in buffer */
1210Sstevel@tonic-gate 	int	len;			/* no. of bytes returned */
1220Sstevel@tonic-gate 	char	*buf;			/* pointer to data */
1230Sstevel@tonic-gate };
1240Sstevel@tonic-gate 
1250Sstevel@tonic-gate 
1260Sstevel@tonic-gate /*
1270Sstevel@tonic-gate  * stream I_PEEK ioctl format
1280Sstevel@tonic-gate  */
1290Sstevel@tonic-gate 
1300Sstevel@tonic-gate struct strpeek {
1310Sstevel@tonic-gate 	struct strbuf ctlbuf;
1320Sstevel@tonic-gate 	struct strbuf databuf;
1330Sstevel@tonic-gate 	long	      flags;
1340Sstevel@tonic-gate };
1350Sstevel@tonic-gate 
1360Sstevel@tonic-gate /*
1370Sstevel@tonic-gate  * stream I_FDINSERT ioctl format
1380Sstevel@tonic-gate  */
1390Sstevel@tonic-gate struct strfdinsert {
1400Sstevel@tonic-gate 	struct strbuf ctlbuf;
1410Sstevel@tonic-gate 	struct strbuf databuf;
1420Sstevel@tonic-gate 	long	      flags;
1430Sstevel@tonic-gate 	int	      fildes;
1440Sstevel@tonic-gate 	int	      offset;
1450Sstevel@tonic-gate };
1460Sstevel@tonic-gate 
1470Sstevel@tonic-gate 
1480Sstevel@tonic-gate /*
1490Sstevel@tonic-gate  * receive file descriptor structure
1500Sstevel@tonic-gate  */
1510Sstevel@tonic-gate struct strrecvfd {
1520Sstevel@tonic-gate 	int fd;
1530Sstevel@tonic-gate 	unsigned short uid;
1540Sstevel@tonic-gate 	unsigned short gid;
1550Sstevel@tonic-gate 	char fill[8];
1560Sstevel@tonic-gate };
1570Sstevel@tonic-gate 
158*722Smuffin #endif /* !_sys_stropts_h */
159