stropts.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_STROPTS_H
#define _SYS_STROPTS_H
#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 11.20 */
#include <sys/feature_tests.h>
/*
* For FMNAMESZ define.
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* Write options
*/
/* putmsg if sd_werror is set */
/*
* Read options
*/
#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
#endif
/*
* These next three read options are added for the sake of
* user-level transparency. RPROTDAT will cause the stream head
* to treat the contents of M_PROTO and M_PCPROTO message blocks
* as data. RPROTDIS will prevent the stream head from failing
* a read with EBADMSG if an M_PROTO or M_PCPROTO message is on
* the front of the stream head read queue. Rather, the protocol
* blocks will be silently discarded and the data associated with
* the message (in linked M_DATA blocks), if any, will be delivered
* to the user. RPROTNORM sets the default behavior, where read
* will fail with EBADMSG if an M_PROTO or M_PCPROTO are at the
* stream head.
*/
/* read data portion */
#define RPROTNORM 0x010
#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
/*
* The next read option is used so that a TPI aware module can tell the
* stream head to not flush M_PCPROTO messages when processing a read side
* flush. This will avoid problems where a flush removes a T_OK_ACK.
*/
#endif
/*
* Error options
*/
/*
* Error options to adjust the stream head error behavior with respect
* to M_ERROR message for read and write side errors respectively.
* to specify that errors are nonpersistent. In this case the error is cleared
* after having been returned to read(), getmsg(), ioctl(), write(), putmsg(),
* etc.
*/
#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
#endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
/*
* Flush options
*/
/* in next byte */
/*
* Copy options for M_SETOPS/SO_COPYOPT
*/
#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
/* pages instead of bcopy */
#endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
/*
* Events for which the SIGPOLL signal is to be sent.
*/
/* SIGURG instead of SIGPOLL */
/*
* Flags for getmsg() and putmsg() syscall arguments.
* recv() and send(), but were renamed to avoid confusion with the BSD
* calls of the same name. A value of zero will cause getmsg() to return
* the first message on the stream head read queue and putmsg() to send
* a normal priority message.
*
* Flags for strmakemsg() arguments (should define strmakemsg() flags).
* Used to determine the message type of the control part of a message,
* if RS_HIPRI, M_PCPROTO, else M_PROTO.
*/
/*
* Flags for getpmsg() and putpmsg() syscall arguments.
*/
/*
* These are settable by the user and will be set on return
* to indicate the priority of message received.
*/
#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
/*
* This is a private flag passed by libc to kernel to
* identify that it is a XPG4_2 application. No
* applications need to know about this flag.
*/
#define MSG_XPG4 0x08
#endif
#ifdef _KERNEL
/*
* Additional private flags for kstrgetmsg and kstrputmsg.
* These must be bit-wise distinct from the above MSG flags.
*/
#endif /* _KERNEL */
/*
* Flags returned as value of getmsg() and getpmsg() syscall.
*/
/*
* Define to indicate that all multiplexors beneath a stream should
* be unlinked.
*/
#define MUXID_ALL (-1)
/*
* Flag definitions for the I_ATMARK ioctl.
*/
#define ANYMARK 0x01
#define LASTMARK 0x02
/*
* Stream Ioctl defines
*/
/* (STR|000) in use */
/* (STR|016) in use */
#if defined(_KERNEL)
#else /* user level definition */
#endif /* defined(_KERNEL) */
/*
* IOCTLs (STR|050) - (STR|055) are available for use.
*/
/* Private Layered Driver ioctl's */
/*
* User level ioctl format for ioctls that go downstream (I_STR)
*/
struct strioctl {
int ic_cmd; /* command */
int ic_timout; /* timeout value */
int ic_len; /* length of data */
char *ic_dp; /* pointer to data */
};
#if defined(_SYSCALL32)
struct strioctl32 {
};
#endif /* _SYSCALL32 */
/*
* Value for timeouts (ioctl, select) that denotes infinity
*/
#define _INFTIM -1
#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
#endif
/*
* Stream buffer structure for putmsg and getmsg system calls
*/
struct strbuf {
int maxlen; /* no. of bytes in buffer */
int len; /* no. of bytes returned */
};
#if defined(_SYSCALL32)
struct strbuf32 {
};
#endif /* _SYSCALL32 */
/*
* Stream I_PEEK ioctl format
*/
struct strpeek {
};
#if defined(_SYSCALL32)
struct strpeek32 {
};
#endif /* _SYSCALL32 */
/*
* Stream I_FDINSERT ioctl format
*/
struct strfdinsert {
int fildes;
int offset;
};
#if defined(_SYSCALL32)
struct strfdinsert32 {
};
#endif /* _SYSCALL32 */
/*
* Receive file descriptor structure
*/
#if defined(_KERNEL)
struct o_strrecvfd { /* SVR3 syscall structure */
int fd;
char fill[8];
};
/*
* Although EFT is enabled in the kernel we kept the following definition
* to support an EFT application on a 4.0 non-EFT system.
*/
struct k_strrecvfd { /* SVR4 expanded syscall interface structure */
char fill[8];
};
/*
* Private _I_GETPEERCRED data.
*/
typedef struct k_peercred {
} k_peercred_t;
#endif /* defined(_KERNEL) */
struct strrecvfd {
int fd;
#if defined(_XPG4_2)
char __fill[8];
#else
char fill[8];
#endif
};
/*
* For I_LIST ioctl.
*/
struct str_mlist {
};
struct str_list {
int sl_nmods;
struct str_mlist *sl_modlist;
};
#if defined(_SYSCALL32)
struct str_list32 {
};
#endif /* _SYSCALL32 */
#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
/*
* Private, for _I_INSERT/_I_REMOVE ioctl.
*/
struct strmodconf {
};
#if defined(_SYSCALL32)
struct strmodconf32 {
};
#endif /* _SYSCALL32 */
#endif /* (_XPG4_2) || defined(__EXTENSIONS__) */
/*
* For I_FLUSHBAND ioctl. Describes the priority
* band for which the operation applies.
*/
struct bandinfo {
unsigned char bi_pri;
int bi_flag;
};
/*
* The argument for I_ESETSIG and I_EGETSIG ioctls.
*/
#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
struct strsigset {
int ss_events; /* S_ events */
};
#endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
#ifdef _XPG4_2
#ifdef __PRAGMA_REDEFINE_EXTNAME
#else /* __PRAGMA_REDEFINE_EXTNAME */
#define putmsg __xpg4_putmsg
#define putpmsg __xpg4_putpmsg
#endif /* __PRAGMA_REDEFINE_EXTNAME */
#endif /* _XPG4_2 */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_STROPTS_H */