xref: /titanic_52/usr/src/lib/libbc/inc/include/sys/stropts.h (revision 5d54f3d8999eac1762fe0a8c7177d20f1f201fae)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
22*5d54f3d8Smuffin /*
23*5d54f3d8Smuffin  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24*5d54f3d8Smuffin  * Use is subject to license terms.
25*5d54f3d8Smuffin  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984 AT&T	*/
287c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #ifndef _sys_stropts_h
317c478bd9Sstevel@tonic-gate #define	_sys_stropts_h
327c478bd9Sstevel@tonic-gate 
33*5d54f3d8Smuffin #pragma ident	"%Z%%M%	%I%	%E% SMI"
34*5d54f3d8Smuffin 
357c478bd9Sstevel@tonic-gate /*
367c478bd9Sstevel@tonic-gate  * Read options
377c478bd9Sstevel@tonic-gate  */
387c478bd9Sstevel@tonic-gate #define RNORM	0			/* read msg norm */
397c478bd9Sstevel@tonic-gate #define RMSGD	1			/* read msg discard */
407c478bd9Sstevel@tonic-gate #define RMSGN	2			/* read msg no discard */
417c478bd9Sstevel@tonic-gate 
427c478bd9Sstevel@tonic-gate /*
437c478bd9Sstevel@tonic-gate  * Flush options
447c478bd9Sstevel@tonic-gate  */
457c478bd9Sstevel@tonic-gate 
467c478bd9Sstevel@tonic-gate #define FLUSHR	1			/* flush read queue */
477c478bd9Sstevel@tonic-gate #define FLUSHW	2			/* flush write queue */
487c478bd9Sstevel@tonic-gate #define FLUSHRW	3			/* flush both queues */
497c478bd9Sstevel@tonic-gate 
507c478bd9Sstevel@tonic-gate /*
517c478bd9Sstevel@tonic-gate  * Events for which to be sent SIGPOLL signal
527c478bd9Sstevel@tonic-gate  */
537c478bd9Sstevel@tonic-gate #define S_INPUT		001		/* regular priority msg on read Q */
547c478bd9Sstevel@tonic-gate #define S_HIPRI		002		/* high priority msg on read Q */
557c478bd9Sstevel@tonic-gate #define S_OUTPUT	004		/* write Q no longer full */
567c478bd9Sstevel@tonic-gate #define S_MSG		010		/* signal msg at front of read Q */
577c478bd9Sstevel@tonic-gate 
587c478bd9Sstevel@tonic-gate /*
597c478bd9Sstevel@tonic-gate  * Flags for recv() and send() syscall arguments
607c478bd9Sstevel@tonic-gate  */
617c478bd9Sstevel@tonic-gate #define RS_HIPRI	1		/* send/recv high priority message */
627c478bd9Sstevel@tonic-gate 
637c478bd9Sstevel@tonic-gate /*
647c478bd9Sstevel@tonic-gate  * Flags returned as value of recv() syscall
657c478bd9Sstevel@tonic-gate  */
667c478bd9Sstevel@tonic-gate #define MORECTL		1		/* more ctl info is left in message */
677c478bd9Sstevel@tonic-gate #define MOREDATA	2		/* more data is left in message */
687c478bd9Sstevel@tonic-gate 
697c478bd9Sstevel@tonic-gate #ifndef FMNAMESZ
707c478bd9Sstevel@tonic-gate #define	FMNAMESZ	8
717c478bd9Sstevel@tonic-gate #endif
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate #include <sys/ioccom.h>
747c478bd9Sstevel@tonic-gate 
757c478bd9Sstevel@tonic-gate /*
767c478bd9Sstevel@tonic-gate  *  Stream Ioctl defines
777c478bd9Sstevel@tonic-gate  */
78*5d54f3d8Smuffin #define I_NREAD		_IOR('S',01,int)
79*5d54f3d8Smuffin #define I_PUSH		_IOWN('S',02,FMNAMESZ+1)
80*5d54f3d8Smuffin #define I_POP		_IO('S',03)
81*5d54f3d8Smuffin #define I_LOOK		_IORN('S',04,FMNAMESZ+1)
82*5d54f3d8Smuffin #define I_FLUSH		_IO('S',05)
83*5d54f3d8Smuffin #define I_SRDOPT	_IO('S',06)
84*5d54f3d8Smuffin #define I_GRDOPT	_IOR('S',07,int)
85*5d54f3d8Smuffin #define I_STR		_IOWR('S',010,struct strioctl)
86*5d54f3d8Smuffin #define I_SETSIG	_IO('S',011)
87*5d54f3d8Smuffin #define I_GETSIG	_IOR('S',012,int)
88*5d54f3d8Smuffin #define I_FIND		_IOWN('S',013,FMNAMESZ+1)
89*5d54f3d8Smuffin #define I_LINK		_IO('S',014)
90*5d54f3d8Smuffin #define I_UNLINK	_IO('S',015)
91*5d54f3d8Smuffin #define I_PEEK		_IOWR('S',017,struct strpeek)
92*5d54f3d8Smuffin #define I_FDINSERT	_IOW('S',020,struct strfdinsert)
93*5d54f3d8Smuffin #define I_SENDFD	_IO('S',021)
94*5d54f3d8Smuffin #define I_RECVFD	_IOR('S',022,struct strrecvfd)
95*5d54f3d8Smuffin #define I_PLINK		_IO('S',023)
96*5d54f3d8Smuffin #define I_PUNLINK	_IO('S',024)
977c478bd9Sstevel@tonic-gate 
987c478bd9Sstevel@tonic-gate 
997c478bd9Sstevel@tonic-gate /*
1007c478bd9Sstevel@tonic-gate  * User level ioctl format for ioctl that go downstream I_STR
1017c478bd9Sstevel@tonic-gate  */
1027c478bd9Sstevel@tonic-gate struct strioctl {
1037c478bd9Sstevel@tonic-gate 	int 	ic_cmd;			/* command */
1047c478bd9Sstevel@tonic-gate 	int	ic_timout;		/* timeout value */
1057c478bd9Sstevel@tonic-gate 	int	ic_len;			/* length of data */
1067c478bd9Sstevel@tonic-gate 	char	*ic_dp;			/* pointer to data */
1077c478bd9Sstevel@tonic-gate };
1087c478bd9Sstevel@tonic-gate 
1097c478bd9Sstevel@tonic-gate 
1107c478bd9Sstevel@tonic-gate /*
1117c478bd9Sstevel@tonic-gate  * Value for timeouts (ioctl, select) that denotes infinity
1127c478bd9Sstevel@tonic-gate  */
1137c478bd9Sstevel@tonic-gate #define INFTIM		-1
1147c478bd9Sstevel@tonic-gate 
1157c478bd9Sstevel@tonic-gate 
1167c478bd9Sstevel@tonic-gate /*
1177c478bd9Sstevel@tonic-gate  * Stream buffer structure for send and recv system calls
1187c478bd9Sstevel@tonic-gate  */
1197c478bd9Sstevel@tonic-gate struct strbuf {
1207c478bd9Sstevel@tonic-gate 	int	maxlen;			/* no. of bytes in buffer */
1217c478bd9Sstevel@tonic-gate 	int	len;			/* no. of bytes returned */
1227c478bd9Sstevel@tonic-gate 	char	*buf;			/* pointer to data */
1237c478bd9Sstevel@tonic-gate };
1247c478bd9Sstevel@tonic-gate 
1257c478bd9Sstevel@tonic-gate 
1267c478bd9Sstevel@tonic-gate /*
1277c478bd9Sstevel@tonic-gate  * stream I_PEEK ioctl format
1287c478bd9Sstevel@tonic-gate  */
1297c478bd9Sstevel@tonic-gate 
1307c478bd9Sstevel@tonic-gate struct strpeek {
1317c478bd9Sstevel@tonic-gate 	struct strbuf ctlbuf;
1327c478bd9Sstevel@tonic-gate 	struct strbuf databuf;
1337c478bd9Sstevel@tonic-gate 	long	      flags;
1347c478bd9Sstevel@tonic-gate };
1357c478bd9Sstevel@tonic-gate 
1367c478bd9Sstevel@tonic-gate /*
1377c478bd9Sstevel@tonic-gate  * stream I_FDINSERT ioctl format
1387c478bd9Sstevel@tonic-gate  */
1397c478bd9Sstevel@tonic-gate struct strfdinsert {
1407c478bd9Sstevel@tonic-gate 	struct strbuf ctlbuf;
1417c478bd9Sstevel@tonic-gate 	struct strbuf databuf;
1427c478bd9Sstevel@tonic-gate 	long	      flags;
1437c478bd9Sstevel@tonic-gate 	int	      fildes;
1447c478bd9Sstevel@tonic-gate 	int	      offset;
1457c478bd9Sstevel@tonic-gate };
1467c478bd9Sstevel@tonic-gate 
1477c478bd9Sstevel@tonic-gate 
1487c478bd9Sstevel@tonic-gate /*
1497c478bd9Sstevel@tonic-gate  * receive file descriptor structure
1507c478bd9Sstevel@tonic-gate  */
1517c478bd9Sstevel@tonic-gate struct strrecvfd {
1527c478bd9Sstevel@tonic-gate 	int fd;
1537c478bd9Sstevel@tonic-gate 	unsigned short uid;
1547c478bd9Sstevel@tonic-gate 	unsigned short gid;
1557c478bd9Sstevel@tonic-gate 	char fill[8];
1567c478bd9Sstevel@tonic-gate };
1577c478bd9Sstevel@tonic-gate 
1587c478bd9Sstevel@tonic-gate #endif /* !_sys_stropts_h */
159