xref: /titanic_50/usr/src/uts/common/sys/stropts.h (revision ca9327a6de44d69ddab3668cc1e143ce781387a3)
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
5*ca9327a6Smeem  * Common Development and Distribution License (the "License").
6*ca9327a6Smeem  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
227c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
237c478bd9Sstevel@tonic-gate 
247c478bd9Sstevel@tonic-gate 
257c478bd9Sstevel@tonic-gate /*
26*ca9327a6Smeem  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
277c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
287c478bd9Sstevel@tonic-gate  */
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #ifndef _SYS_STROPTS_H
317c478bd9Sstevel@tonic-gate #define	_SYS_STROPTS_H
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 11.20	*/
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate #include <sys/feature_tests.h>
367c478bd9Sstevel@tonic-gate #include <sys/types.h>
377c478bd9Sstevel@tonic-gate /*
387c478bd9Sstevel@tonic-gate  * For FMNAMESZ define.
397c478bd9Sstevel@tonic-gate  */
407c478bd9Sstevel@tonic-gate #include <sys/conf.h>
417c478bd9Sstevel@tonic-gate 
427c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
437c478bd9Sstevel@tonic-gate extern "C" {
447c478bd9Sstevel@tonic-gate #endif
457c478bd9Sstevel@tonic-gate 
467c478bd9Sstevel@tonic-gate /*
477c478bd9Sstevel@tonic-gate  * Write options
487c478bd9Sstevel@tonic-gate  */
497c478bd9Sstevel@tonic-gate #define	SNDZERO		0x001		/* send a zero length message */
507c478bd9Sstevel@tonic-gate #define	SNDPIPE		0x002		/* send SIGPIPE on write and */
517c478bd9Sstevel@tonic-gate 					/* putmsg if sd_werror is set */
527c478bd9Sstevel@tonic-gate 
537c478bd9Sstevel@tonic-gate /*
547c478bd9Sstevel@tonic-gate  * Read options
557c478bd9Sstevel@tonic-gate  */
567c478bd9Sstevel@tonic-gate #define	RNORM		0x000		/* read msg norm */
577c478bd9Sstevel@tonic-gate #define	RMSGD		0x001		/* read msg discard */
587c478bd9Sstevel@tonic-gate #define	RMSGN		0x002		/* read msg no discard */
597c478bd9Sstevel@tonic-gate 
607c478bd9Sstevel@tonic-gate #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
617c478bd9Sstevel@tonic-gate #define	RMODEMASK	0x003		/* all above bits */
627c478bd9Sstevel@tonic-gate #endif
637c478bd9Sstevel@tonic-gate 
647c478bd9Sstevel@tonic-gate /*
657c478bd9Sstevel@tonic-gate  * These next three read options are added for the sake of
667c478bd9Sstevel@tonic-gate  * user-level transparency.  RPROTDAT will cause the stream head
677c478bd9Sstevel@tonic-gate  * to treat the contents of M_PROTO and M_PCPROTO message blocks
687c478bd9Sstevel@tonic-gate  * as data.  RPROTDIS will prevent the stream head from failing
697c478bd9Sstevel@tonic-gate  * a read with EBADMSG if an M_PROTO or M_PCPROTO message is on
707c478bd9Sstevel@tonic-gate  * the front of the stream head read queue.  Rather, the protocol
717c478bd9Sstevel@tonic-gate  * blocks will be silently discarded and the data associated with
727c478bd9Sstevel@tonic-gate  * the message (in linked M_DATA blocks), if any, will be delivered
737c478bd9Sstevel@tonic-gate  * to the user.  RPROTNORM sets the default behavior, where read
747c478bd9Sstevel@tonic-gate  * will fail with EBADMSG if an M_PROTO or M_PCPROTO are at the
757c478bd9Sstevel@tonic-gate  * stream head.
767c478bd9Sstevel@tonic-gate  */
777c478bd9Sstevel@tonic-gate #define	RPROTDAT	0x004		/* read protocol messages as data */
787c478bd9Sstevel@tonic-gate #define	RPROTDIS	0x008		/* discard protocol messages, but */
797c478bd9Sstevel@tonic-gate 					/* read data portion */
807c478bd9Sstevel@tonic-gate #define	RPROTNORM	0x010
817c478bd9Sstevel@tonic-gate 
827c478bd9Sstevel@tonic-gate #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
837c478bd9Sstevel@tonic-gate #define	RPROTMASK	0x01c		/* all RPROT bits */
847c478bd9Sstevel@tonic-gate 
857c478bd9Sstevel@tonic-gate /*
867c478bd9Sstevel@tonic-gate  * The next read option is used so that a TPI aware module can tell the
877c478bd9Sstevel@tonic-gate  * stream head to not flush M_PCPROTO messages when processing a read side
887c478bd9Sstevel@tonic-gate  * flush. This will avoid problems where a flush removes a T_OK_ACK.
897c478bd9Sstevel@tonic-gate  */
907c478bd9Sstevel@tonic-gate #define	RFLUSHMASK	0x020		/* all RFLUSH bits */
917c478bd9Sstevel@tonic-gate 
927c478bd9Sstevel@tonic-gate #define	RFLUSHPCPROT	0x020		/* do not flush PCPROTOs */
937c478bd9Sstevel@tonic-gate 
947c478bd9Sstevel@tonic-gate #endif
957c478bd9Sstevel@tonic-gate 
967c478bd9Sstevel@tonic-gate /*
977c478bd9Sstevel@tonic-gate  * Error options
987c478bd9Sstevel@tonic-gate  */
997c478bd9Sstevel@tonic-gate 
1007c478bd9Sstevel@tonic-gate /*
1017c478bd9Sstevel@tonic-gate  * Error options to adjust the stream head error behavior with respect
1027c478bd9Sstevel@tonic-gate  * to M_ERROR message for read and write side errors respectively.
1037c478bd9Sstevel@tonic-gate  * The normal case is that the read/write side error is
1047c478bd9Sstevel@tonic-gate  * persistent and these options allow the application or streams module/driver
1057c478bd9Sstevel@tonic-gate  * to specify that errors are nonpersistent. In this case the error is cleared
1067c478bd9Sstevel@tonic-gate  * after having been returned to read(), getmsg(), ioctl(), write(), putmsg(),
1077c478bd9Sstevel@tonic-gate  * etc.
1087c478bd9Sstevel@tonic-gate  */
1097c478bd9Sstevel@tonic-gate #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
1107c478bd9Sstevel@tonic-gate #define	RERRNORM	0x001		/* Normal, persistent read errors */
1117c478bd9Sstevel@tonic-gate #define	RERRNONPERSIST	0x002		/* Nonpersistent read errors */
1127c478bd9Sstevel@tonic-gate 
1137c478bd9Sstevel@tonic-gate #define	RERRMASK	(RERRNORM|RERRNONPERSIST)
1147c478bd9Sstevel@tonic-gate 
1157c478bd9Sstevel@tonic-gate #define	WERRNORM	0x004		/* Normal, persistent write errors */
1167c478bd9Sstevel@tonic-gate #define	WERRNONPERSIST	0x008		/* Nonpersistent write errors */
1177c478bd9Sstevel@tonic-gate 
1187c478bd9Sstevel@tonic-gate #define	WERRMASK	(WERRNORM|WERRNONPERSIST)
1197c478bd9Sstevel@tonic-gate #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
1207c478bd9Sstevel@tonic-gate 
1217c478bd9Sstevel@tonic-gate /*
1227c478bd9Sstevel@tonic-gate  * Flush options
1237c478bd9Sstevel@tonic-gate  */
1247c478bd9Sstevel@tonic-gate 
1257c478bd9Sstevel@tonic-gate #define	FLUSHR		0x01		/* flush read queue */
1267c478bd9Sstevel@tonic-gate #define	FLUSHW		0x02		/* flush write queue */
1277c478bd9Sstevel@tonic-gate #define	FLUSHRW		0x03		/* flush both queues */
1287c478bd9Sstevel@tonic-gate #define	FLUSHBAND	0x04		/* flush only band specified */
1297c478bd9Sstevel@tonic-gate 					/* in next byte */
1307c478bd9Sstevel@tonic-gate /*
1317c478bd9Sstevel@tonic-gate  * Copy options for M_SETOPS/SO_COPYOPT
1327c478bd9Sstevel@tonic-gate  */
1337c478bd9Sstevel@tonic-gate #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
1347c478bd9Sstevel@tonic-gate #define	ZCVMSAFE	0x01		/* safe to borrow file (segmapped) */
1357c478bd9Sstevel@tonic-gate 					/* pages instead of bcopy */
1367c478bd9Sstevel@tonic-gate #define	ZCVMUNSAFE	0x02		/* unsafe to borrow file pages */
1377c478bd9Sstevel@tonic-gate #define	COPYCACHED	0x04		/* copy should NOT bypass cache */
1387c478bd9Sstevel@tonic-gate #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
1397c478bd9Sstevel@tonic-gate 
1407c478bd9Sstevel@tonic-gate /*
1417c478bd9Sstevel@tonic-gate  * Events for which the SIGPOLL signal is to be sent.
1427c478bd9Sstevel@tonic-gate  */
1437c478bd9Sstevel@tonic-gate #define	S_INPUT		0x0001		/* any msg but hipri on read Q */
1447c478bd9Sstevel@tonic-gate #define	S_HIPRI		0x0002		/* high priority msg on read Q */
1457c478bd9Sstevel@tonic-gate #define	S_OUTPUT	0x0004		/* write Q no longer full */
1467c478bd9Sstevel@tonic-gate #define	S_MSG		0x0008		/* signal msg at front of read Q */
1477c478bd9Sstevel@tonic-gate #define	S_ERROR		0x0010		/* error msg arrived at stream head */
1487c478bd9Sstevel@tonic-gate #define	S_HANGUP	0x0020		/* hangup msg arrived at stream head */
1497c478bd9Sstevel@tonic-gate #define	S_RDNORM	0x0040		/* normal msg on read Q */
1507c478bd9Sstevel@tonic-gate #define	S_WRNORM	S_OUTPUT
1517c478bd9Sstevel@tonic-gate #define	S_RDBAND	0x0080		/* out of band msg on read Q */
1527c478bd9Sstevel@tonic-gate #define	S_WRBAND	0x0100		/* can write out of band */
1537c478bd9Sstevel@tonic-gate #define	S_BANDURG	0x0200		/* modifier to S_RDBAND, to generate */
1547c478bd9Sstevel@tonic-gate 					/* SIGURG instead of SIGPOLL */
1557c478bd9Sstevel@tonic-gate 
1567c478bd9Sstevel@tonic-gate /*
1577c478bd9Sstevel@tonic-gate  * Flags for getmsg() and putmsg() syscall arguments.
1587c478bd9Sstevel@tonic-gate  * "RS" stands for recv/send.  The system calls were originally called
1597c478bd9Sstevel@tonic-gate  * recv() and send(), but were renamed to avoid confusion with the BSD
1607c478bd9Sstevel@tonic-gate  * calls of the same name.  A value of zero will cause getmsg() to return
1617c478bd9Sstevel@tonic-gate  * the first message on the stream head read queue and putmsg() to send
1627c478bd9Sstevel@tonic-gate  * a normal priority message.
1637c478bd9Sstevel@tonic-gate  *
1647c478bd9Sstevel@tonic-gate  * Flags for strmakemsg() arguments (should define strmakemsg() flags).
1657c478bd9Sstevel@tonic-gate  * Used to determine the message type of the control part of a message,
1667c478bd9Sstevel@tonic-gate  * if RS_HIPRI, M_PCPROTO, else M_PROTO.
1677c478bd9Sstevel@tonic-gate  */
1687c478bd9Sstevel@tonic-gate 
1697c478bd9Sstevel@tonic-gate #define	RS_HIPRI	0x01		/* send/recv high priority message */
1707c478bd9Sstevel@tonic-gate #define	STRUIO_POSTPONE	0x08		/* postpone copyin() for struio() */
1717c478bd9Sstevel@tonic-gate 
1727c478bd9Sstevel@tonic-gate /*
1737c478bd9Sstevel@tonic-gate  * Flags for getpmsg() and putpmsg() syscall arguments.
1747c478bd9Sstevel@tonic-gate  */
1757c478bd9Sstevel@tonic-gate 
1767c478bd9Sstevel@tonic-gate /*
1777c478bd9Sstevel@tonic-gate  * These are settable by the user and will be set on return
1787c478bd9Sstevel@tonic-gate  * to indicate the priority of message received.
1797c478bd9Sstevel@tonic-gate  */
1807c478bd9Sstevel@tonic-gate #define	MSG_HIPRI	0x01		/* send/recv high priority message */
1817c478bd9Sstevel@tonic-gate #define	MSG_ANY		0x02		/* recv any messages */
1827c478bd9Sstevel@tonic-gate #define	MSG_BAND	0x04		/* recv messages from specified band */
1837c478bd9Sstevel@tonic-gate #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
1847c478bd9Sstevel@tonic-gate /*
1857c478bd9Sstevel@tonic-gate  * This is a private flag passed by libc to kernel to
1867c478bd9Sstevel@tonic-gate  * identify that it is a XPG4_2 application. No
1877c478bd9Sstevel@tonic-gate  * applications need to know about this flag.
1887c478bd9Sstevel@tonic-gate  */
1897c478bd9Sstevel@tonic-gate #define	MSG_XPG4	0x08
1907c478bd9Sstevel@tonic-gate #endif
1917c478bd9Sstevel@tonic-gate 
1927c478bd9Sstevel@tonic-gate #ifdef _KERNEL
1937c478bd9Sstevel@tonic-gate 
1947c478bd9Sstevel@tonic-gate /*
1957c478bd9Sstevel@tonic-gate  * Additional private flags for kstrgetmsg and kstrputmsg.
1967c478bd9Sstevel@tonic-gate  * These must be bit-wise distinct from the above MSG flags.
1977c478bd9Sstevel@tonic-gate  */
1987c478bd9Sstevel@tonic-gate #define	MSG_IPEEK	0x10		/* Peek - don't remove the message */
1997c478bd9Sstevel@tonic-gate #define	MSG_DISCARDTAIL	0x20		/* Discard tail if it doesn't fit */
2007c478bd9Sstevel@tonic-gate #define	MSG_HOLDSIG	0x40		/* Ignore signals. */
2017c478bd9Sstevel@tonic-gate #define	MSG_IGNERROR	0x80		/* Ignore stream head errors */
2027c478bd9Sstevel@tonic-gate #define	MSG_DELAYERROR	0x100		/* Delay error check until we sleep */
2037c478bd9Sstevel@tonic-gate #define	MSG_IGNFLOW	0x200		/* Ignore flow control */
2047c478bd9Sstevel@tonic-gate #define	MSG_NOMARK	0x400		/* Do not read if message is marked */
2057c478bd9Sstevel@tonic-gate 
2067c478bd9Sstevel@tonic-gate #endif /* _KERNEL */
2077c478bd9Sstevel@tonic-gate 
2087c478bd9Sstevel@tonic-gate /*
2097c478bd9Sstevel@tonic-gate  * Flags returned as value of getmsg() and getpmsg() syscall.
2107c478bd9Sstevel@tonic-gate  */
2117c478bd9Sstevel@tonic-gate #define	MORECTL		1		/* more ctl info is left in message */
2127c478bd9Sstevel@tonic-gate #define	MOREDATA	2		/* more data is left in message */
2137c478bd9Sstevel@tonic-gate 
2147c478bd9Sstevel@tonic-gate /*
2157c478bd9Sstevel@tonic-gate  * Define to indicate that all multiplexors beneath a stream should
2167c478bd9Sstevel@tonic-gate  * be unlinked.
2177c478bd9Sstevel@tonic-gate  */
2187c478bd9Sstevel@tonic-gate #define	MUXID_ALL	(-1)
2197c478bd9Sstevel@tonic-gate 
2207c478bd9Sstevel@tonic-gate /*
2217c478bd9Sstevel@tonic-gate  * Flag definitions for the I_ATMARK ioctl.
2227c478bd9Sstevel@tonic-gate  */
2237c478bd9Sstevel@tonic-gate #define	ANYMARK		0x01
2247c478bd9Sstevel@tonic-gate #define	LASTMARK	0x02
2257c478bd9Sstevel@tonic-gate 
2267c478bd9Sstevel@tonic-gate /*
2277c478bd9Sstevel@tonic-gate  *  Stream Ioctl defines
2287c478bd9Sstevel@tonic-gate  */
2297c478bd9Sstevel@tonic-gate #define	STR		('S'<<8)
2307c478bd9Sstevel@tonic-gate /* (STR|000) in use */
2317c478bd9Sstevel@tonic-gate #define	I_NREAD		(STR|01)
2327c478bd9Sstevel@tonic-gate #define	I_PUSH		(STR|02)
2337c478bd9Sstevel@tonic-gate #define	I_POP		(STR|03)
2347c478bd9Sstevel@tonic-gate #define	I_LOOK		(STR|04)
2357c478bd9Sstevel@tonic-gate #define	I_FLUSH		(STR|05)
2367c478bd9Sstevel@tonic-gate #define	I_SRDOPT	(STR|06)
2377c478bd9Sstevel@tonic-gate #define	I_GRDOPT	(STR|07)
2387c478bd9Sstevel@tonic-gate #define	I_STR		(STR|010)
2397c478bd9Sstevel@tonic-gate #define	I_SETSIG	(STR|011)
2407c478bd9Sstevel@tonic-gate #define	I_GETSIG	(STR|012)
2417c478bd9Sstevel@tonic-gate #define	I_FIND		(STR|013)
2427c478bd9Sstevel@tonic-gate #define	I_LINK		(STR|014)
2437c478bd9Sstevel@tonic-gate #define	I_UNLINK	(STR|015)
2447c478bd9Sstevel@tonic-gate /* (STR|016) in use */
2457c478bd9Sstevel@tonic-gate #define	I_PEEK		(STR|017)
2467c478bd9Sstevel@tonic-gate #define	I_FDINSERT	(STR|020)
2477c478bd9Sstevel@tonic-gate #define	I_SENDFD	(STR|021)
2487c478bd9Sstevel@tonic-gate 
2497c478bd9Sstevel@tonic-gate #if defined(_KERNEL)
2507c478bd9Sstevel@tonic-gate #define	I_RECVFD	(STR|022)
2517c478bd9Sstevel@tonic-gate #define	I_E_RECVFD	(STR|016)
2527c478bd9Sstevel@tonic-gate #else	/* user level definition */
2537c478bd9Sstevel@tonic-gate #define	I_RECVFD	(STR|016)	/* maps to kernel I_E_RECVFD */
2547c478bd9Sstevel@tonic-gate #endif /* defined(_KERNEL) */
2557c478bd9Sstevel@tonic-gate 
2567c478bd9Sstevel@tonic-gate #define	I_SWROPT	(STR|023)
2577c478bd9Sstevel@tonic-gate #define	I_GWROPT	(STR|024)
2587c478bd9Sstevel@tonic-gate #define	I_LIST		(STR|025)
2597c478bd9Sstevel@tonic-gate #define	I_PLINK		(STR|026)
2607c478bd9Sstevel@tonic-gate #define	I_PUNLINK	(STR|027)
2617c478bd9Sstevel@tonic-gate #define	I_ANCHOR	(STR|030)
2627c478bd9Sstevel@tonic-gate #define	I_FLUSHBAND	(STR|034)
2637c478bd9Sstevel@tonic-gate #define	I_CKBAND	(STR|035)
2647c478bd9Sstevel@tonic-gate #define	I_GETBAND	(STR|036)
2657c478bd9Sstevel@tonic-gate #define	I_ATMARK	(STR|037)
2667c478bd9Sstevel@tonic-gate #define	I_SETCLTIME	(STR|040)
2677c478bd9Sstevel@tonic-gate #define	I_GETCLTIME	(STR|041)
2687c478bd9Sstevel@tonic-gate #define	I_CANPUT	(STR|042)
2697c478bd9Sstevel@tonic-gate #define	I_SERROPT	(STR|043)
2707c478bd9Sstevel@tonic-gate #define	I_GERROPT	(STR|044)
2717c478bd9Sstevel@tonic-gate #define	I_ESETSIG	(STR|045)
2727c478bd9Sstevel@tonic-gate #define	I_EGETSIG	(STR|046)
2737c478bd9Sstevel@tonic-gate 
2747c478bd9Sstevel@tonic-gate #define	__I_PUSH_NOCTTY	(STR|047)	/* push module, no cntrl tty */
2757c478bd9Sstevel@tonic-gate 
2767c478bd9Sstevel@tonic-gate /*
2777c478bd9Sstevel@tonic-gate  * IOCTLs (STR|050) - (STR|055) are available for use.
2787c478bd9Sstevel@tonic-gate  */
2797c478bd9Sstevel@tonic-gate 
280*ca9327a6Smeem #define	_I_MUXID2FD	(STR|056)	/* Private: get a fd from a muxid */
281*ca9327a6Smeem #define	_I_INSERT	(STR|057)	/* Private: insert a module */
282*ca9327a6Smeem #define	_I_REMOVE	(STR|060)	/* Private: remove a module */
283*ca9327a6Smeem #define	_I_GETPEERCRED	(STR|061)	/* Private: get peer cred */
284*ca9327a6Smeem #define	_I_PLINK_LH	(STR|062)	/* Private: Layered Driver ioctl */
285*ca9327a6Smeem #define	_I_CMD		(STR|063) 	/* Private: send ioctl via M_CMD */
2867c478bd9Sstevel@tonic-gate 
2877c478bd9Sstevel@tonic-gate /*
2887c478bd9Sstevel@tonic-gate  * User level ioctl format for ioctls that go downstream (I_STR)
2897c478bd9Sstevel@tonic-gate  */
2907c478bd9Sstevel@tonic-gate struct strioctl {
2917c478bd9Sstevel@tonic-gate 	int 	ic_cmd;			/* command */
2927c478bd9Sstevel@tonic-gate 	int	ic_timout;		/* timeout value */
2937c478bd9Sstevel@tonic-gate 	int	ic_len;			/* length of data */
2947c478bd9Sstevel@tonic-gate 	char	*ic_dp;			/* pointer to data */
2957c478bd9Sstevel@tonic-gate };
2967c478bd9Sstevel@tonic-gate 
2977c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
2987c478bd9Sstevel@tonic-gate 
2997c478bd9Sstevel@tonic-gate struct strioctl32 {
3007c478bd9Sstevel@tonic-gate 	int32_t 	ic_cmd;			/* command */
3017c478bd9Sstevel@tonic-gate 	int32_t		ic_timout;		/* timeout value */
3027c478bd9Sstevel@tonic-gate 	int32_t		ic_len;			/* length of data */
3037c478bd9Sstevel@tonic-gate 	caddr32_t	ic_dp;			/* pointer to data */
3047c478bd9Sstevel@tonic-gate };
3057c478bd9Sstevel@tonic-gate 
3067c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */
3077c478bd9Sstevel@tonic-gate 
3087c478bd9Sstevel@tonic-gate /*
3097c478bd9Sstevel@tonic-gate  * Value for timeouts (ioctl, select) that denotes infinity
3107c478bd9Sstevel@tonic-gate  */
3117c478bd9Sstevel@tonic-gate #define	_INFTIM		-1
3127c478bd9Sstevel@tonic-gate #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
3137c478bd9Sstevel@tonic-gate #define	INFTIM		_INFTIM
3147c478bd9Sstevel@tonic-gate #endif
3157c478bd9Sstevel@tonic-gate 
316*ca9327a6Smeem #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
317*ca9327a6Smeem /*
318*ca9327a6Smeem  * For _I_CMD: similar to strioctl, but with included buffer (to avoid copyin/
319*ca9327a6Smeem  * copyout from another address space).  NOTE: the size of this structure must
320*ca9327a6Smeem  * be less than libproc.h`MAXARGL for pr_ioctl() to handle it.
321*ca9327a6Smeem  */
322*ca9327a6Smeem #define	STRCMDBUFSIZE			2048
323*ca9327a6Smeem typedef struct strcmd {
324*ca9327a6Smeem 	int 	sc_cmd;			/* ioctl command */
325*ca9327a6Smeem 	int	sc_timeout;		/* timeout value (in seconds) */
326*ca9327a6Smeem 	int	sc_len;			/* length of data */
327*ca9327a6Smeem 	int	sc_pad;
328*ca9327a6Smeem 	char	sc_buf[STRCMDBUFSIZE];	/* data buffer */
329*ca9327a6Smeem } strcmd_t;
330*ca9327a6Smeem #endif
331*ca9327a6Smeem 
3327c478bd9Sstevel@tonic-gate /*
3337c478bd9Sstevel@tonic-gate  * Stream buffer structure for putmsg and getmsg system calls
3347c478bd9Sstevel@tonic-gate  */
3357c478bd9Sstevel@tonic-gate struct strbuf {
3367c478bd9Sstevel@tonic-gate 	int	maxlen;		/* no. of bytes in buffer */
3377c478bd9Sstevel@tonic-gate 	int	len;		/* no. of bytes returned */
3387c478bd9Sstevel@tonic-gate 	caddr_t	buf;		/* pointer to data */
3397c478bd9Sstevel@tonic-gate };
3407c478bd9Sstevel@tonic-gate 
3417c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
3427c478bd9Sstevel@tonic-gate 
3437c478bd9Sstevel@tonic-gate struct strbuf32 {
3447c478bd9Sstevel@tonic-gate 	int32_t	maxlen;		/* no. of bytes in buffer */
3457c478bd9Sstevel@tonic-gate 	int32_t	len;		/* no. of bytes returned */
3467c478bd9Sstevel@tonic-gate 	caddr32_t buf;		/* pointer to data */
3477c478bd9Sstevel@tonic-gate };
3487c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */
3497c478bd9Sstevel@tonic-gate 
3507c478bd9Sstevel@tonic-gate /*
3517c478bd9Sstevel@tonic-gate  * Stream I_PEEK ioctl format
3527c478bd9Sstevel@tonic-gate  */
3537c478bd9Sstevel@tonic-gate struct strpeek {
3547c478bd9Sstevel@tonic-gate 	struct strbuf	ctlbuf;
3557c478bd9Sstevel@tonic-gate 	struct strbuf	databuf;
3567c478bd9Sstevel@tonic-gate 	t_uscalar_t	flags;
3577c478bd9Sstevel@tonic-gate };
3587c478bd9Sstevel@tonic-gate 
3597c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
3607c478bd9Sstevel@tonic-gate 
3617c478bd9Sstevel@tonic-gate struct strpeek32 {
3627c478bd9Sstevel@tonic-gate 	struct strbuf32	ctlbuf;
3637c478bd9Sstevel@tonic-gate 	struct strbuf32	databuf;
3647c478bd9Sstevel@tonic-gate 	uint32_t	flags;
3657c478bd9Sstevel@tonic-gate };
3667c478bd9Sstevel@tonic-gate 
3677c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */
3687c478bd9Sstevel@tonic-gate 
3697c478bd9Sstevel@tonic-gate /*
3707c478bd9Sstevel@tonic-gate  * Stream I_FDINSERT ioctl format
3717c478bd9Sstevel@tonic-gate  */
3727c478bd9Sstevel@tonic-gate struct strfdinsert {
3737c478bd9Sstevel@tonic-gate 	struct strbuf	ctlbuf;
3747c478bd9Sstevel@tonic-gate 	struct strbuf	databuf;
3757c478bd9Sstevel@tonic-gate 	t_uscalar_t	flags;
3767c478bd9Sstevel@tonic-gate 	int		fildes;
3777c478bd9Sstevel@tonic-gate 	int		offset;
3787c478bd9Sstevel@tonic-gate };
3797c478bd9Sstevel@tonic-gate 
3807c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
3817c478bd9Sstevel@tonic-gate 
3827c478bd9Sstevel@tonic-gate struct strfdinsert32 {
3837c478bd9Sstevel@tonic-gate 	struct strbuf32	ctlbuf;
3847c478bd9Sstevel@tonic-gate 	struct strbuf32	databuf;
3857c478bd9Sstevel@tonic-gate 	uint32_t	flags;
3867c478bd9Sstevel@tonic-gate 	int32_t		fildes;
3877c478bd9Sstevel@tonic-gate 	int32_t		offset;
3887c478bd9Sstevel@tonic-gate };
3897c478bd9Sstevel@tonic-gate 
3907c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */
3917c478bd9Sstevel@tonic-gate 
3927c478bd9Sstevel@tonic-gate /*
3937c478bd9Sstevel@tonic-gate  * Receive file descriptor structure
3947c478bd9Sstevel@tonic-gate  */
3957c478bd9Sstevel@tonic-gate #if defined(_KERNEL)
3967c478bd9Sstevel@tonic-gate 
3977c478bd9Sstevel@tonic-gate struct o_strrecvfd {	/* SVR3 syscall structure */
3987c478bd9Sstevel@tonic-gate 	int fd;
3997c478bd9Sstevel@tonic-gate 	o_uid_t uid;		/* always ushort */
4007c478bd9Sstevel@tonic-gate 	o_gid_t gid;
4017c478bd9Sstevel@tonic-gate 	char fill[8];
4027c478bd9Sstevel@tonic-gate };
4037c478bd9Sstevel@tonic-gate 
4047c478bd9Sstevel@tonic-gate /*
4057c478bd9Sstevel@tonic-gate  * Although EFT is enabled in the kernel we kept the following definition
4067c478bd9Sstevel@tonic-gate  * to support an EFT application on a 4.0 non-EFT system.
4077c478bd9Sstevel@tonic-gate  */
4087c478bd9Sstevel@tonic-gate struct k_strrecvfd {	/* SVR4 expanded syscall interface structure */
4097c478bd9Sstevel@tonic-gate 	struct file *fp;
4107c478bd9Sstevel@tonic-gate 	uid_t uid;
4117c478bd9Sstevel@tonic-gate 	gid_t gid;
4127c478bd9Sstevel@tonic-gate 	char fill[8];
4137c478bd9Sstevel@tonic-gate };
4147c478bd9Sstevel@tonic-gate 
4157c478bd9Sstevel@tonic-gate /*
4167c478bd9Sstevel@tonic-gate  * Private _I_GETPEERCRED data.
4177c478bd9Sstevel@tonic-gate  */
4187c478bd9Sstevel@tonic-gate 
4197c478bd9Sstevel@tonic-gate typedef struct k_peercred {
4207c478bd9Sstevel@tonic-gate 	cred_t	*pc_cr;
4217c478bd9Sstevel@tonic-gate 	pid_t	pc_cpid;
4227c478bd9Sstevel@tonic-gate } k_peercred_t;
4237c478bd9Sstevel@tonic-gate 
4247c478bd9Sstevel@tonic-gate #endif	/* defined(_KERNEL) */
4257c478bd9Sstevel@tonic-gate 
4267c478bd9Sstevel@tonic-gate struct strrecvfd {
4277c478bd9Sstevel@tonic-gate 	int fd;
4287c478bd9Sstevel@tonic-gate 	uid_t uid;
4297c478bd9Sstevel@tonic-gate 	gid_t gid;
4307c478bd9Sstevel@tonic-gate #if defined(_XPG4_2)
4317c478bd9Sstevel@tonic-gate 	char __fill[8];
4327c478bd9Sstevel@tonic-gate #else
4337c478bd9Sstevel@tonic-gate 	char fill[8];
4347c478bd9Sstevel@tonic-gate #endif
4357c478bd9Sstevel@tonic-gate };
4367c478bd9Sstevel@tonic-gate 
4377c478bd9Sstevel@tonic-gate 
4387c478bd9Sstevel@tonic-gate /*
4397c478bd9Sstevel@tonic-gate  * For I_LIST ioctl.
4407c478bd9Sstevel@tonic-gate  */
4417c478bd9Sstevel@tonic-gate struct str_mlist {
4427c478bd9Sstevel@tonic-gate 	char l_name[FMNAMESZ+1];
4437c478bd9Sstevel@tonic-gate };
4447c478bd9Sstevel@tonic-gate 
4457c478bd9Sstevel@tonic-gate struct str_list {
4467c478bd9Sstevel@tonic-gate 	int sl_nmods;
4477c478bd9Sstevel@tonic-gate 	struct str_mlist *sl_modlist;
4487c478bd9Sstevel@tonic-gate };
4497c478bd9Sstevel@tonic-gate 
4507c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
4517c478bd9Sstevel@tonic-gate 
4527c478bd9Sstevel@tonic-gate struct str_list32 {
4537c478bd9Sstevel@tonic-gate 	int32_t 	sl_nmods;
4547c478bd9Sstevel@tonic-gate 	caddr32_t 	sl_modlist;
4557c478bd9Sstevel@tonic-gate };
4567c478bd9Sstevel@tonic-gate 
4577c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */
4587c478bd9Sstevel@tonic-gate 
4597c478bd9Sstevel@tonic-gate #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
4607c478bd9Sstevel@tonic-gate /*
4617c478bd9Sstevel@tonic-gate  * Private, for _I_INSERT/_I_REMOVE ioctl.
4627c478bd9Sstevel@tonic-gate  */
4637c478bd9Sstevel@tonic-gate struct strmodconf {
4647c478bd9Sstevel@tonic-gate 	int	pos;			/* Position to be inserted/removed. */
4657c478bd9Sstevel@tonic-gate 	caddr_t	mod_name;		/* Name of module. */
4667c478bd9Sstevel@tonic-gate };
4677c478bd9Sstevel@tonic-gate 
4687c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
4697c478bd9Sstevel@tonic-gate 
4707c478bd9Sstevel@tonic-gate struct strmodconf32 {
4717c478bd9Sstevel@tonic-gate 	int32_t		pos;
4727c478bd9Sstevel@tonic-gate 	caddr32_t	mod_name;
4737c478bd9Sstevel@tonic-gate };
4747c478bd9Sstevel@tonic-gate 
4757c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */
4767c478bd9Sstevel@tonic-gate #endif /* (_XPG4_2) || defined(__EXTENSIONS__) */
4777c478bd9Sstevel@tonic-gate 
4787c478bd9Sstevel@tonic-gate /*
4797c478bd9Sstevel@tonic-gate  * For I_FLUSHBAND ioctl.  Describes the priority
4807c478bd9Sstevel@tonic-gate  * band for which the operation applies.
4817c478bd9Sstevel@tonic-gate  */
4827c478bd9Sstevel@tonic-gate struct bandinfo {
4837c478bd9Sstevel@tonic-gate 	unsigned char	bi_pri;
4847c478bd9Sstevel@tonic-gate 	int		bi_flag;
4857c478bd9Sstevel@tonic-gate };
4867c478bd9Sstevel@tonic-gate 
4877c478bd9Sstevel@tonic-gate 
4887c478bd9Sstevel@tonic-gate /*
4897c478bd9Sstevel@tonic-gate  * The argument for I_ESETSIG and I_EGETSIG ioctls.
4907c478bd9Sstevel@tonic-gate  */
4917c478bd9Sstevel@tonic-gate #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
4927c478bd9Sstevel@tonic-gate struct strsigset {
4937c478bd9Sstevel@tonic-gate 	pid_t		ss_pid;		/* pgrp if negative */
4947c478bd9Sstevel@tonic-gate 	int		ss_events;	/* S_ events */
4957c478bd9Sstevel@tonic-gate };
4967c478bd9Sstevel@tonic-gate #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
4977c478bd9Sstevel@tonic-gate 
4987c478bd9Sstevel@tonic-gate #ifdef	_XPG4_2
4997c478bd9Sstevel@tonic-gate #ifdef	__PRAGMA_REDEFINE_EXTNAME
5007c478bd9Sstevel@tonic-gate 
5017c478bd9Sstevel@tonic-gate #pragma	redefine_extname putmsg		__xpg4_putmsg
5027c478bd9Sstevel@tonic-gate #pragma	redefine_extname putpmsg	__xpg4_putpmsg
5037c478bd9Sstevel@tonic-gate 
5047c478bd9Sstevel@tonic-gate #else	/* __PRAGMA_REDEFINE_EXTNAME */
5057c478bd9Sstevel@tonic-gate 
5067c478bd9Sstevel@tonic-gate #define	putmsg	__xpg4_putmsg
5077c478bd9Sstevel@tonic-gate #define	putpmsg	__xpg4_putpmsg
5087c478bd9Sstevel@tonic-gate 
5097c478bd9Sstevel@tonic-gate #endif	/* __PRAGMA_REDEFINE_EXTNAME */
5107c478bd9Sstevel@tonic-gate #endif	/* _XPG4_2 */
5117c478bd9Sstevel@tonic-gate 
5127c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
5137c478bd9Sstevel@tonic-gate }
5147c478bd9Sstevel@tonic-gate #endif
5157c478bd9Sstevel@tonic-gate 
5167c478bd9Sstevel@tonic-gate #endif	/* _SYS_STROPTS_H */
517