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