hjl / source-git / glibc

Forked from source-git/glibc 3 years ago
Clone

Blame bits/stropts.h

Packit 6c4009
/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _STROPTS_H
Packit 6c4009
# error "Never include <bits/stropts.h> directly; use <stropts.h> instead."
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifndef _BITS_STROPTS_H
Packit 6c4009
#define _BITS_STROPTS_H	1
Packit 6c4009
Packit 6c4009
#include <bits/types.h>
Packit 6c4009
Packit 6c4009
/* Macros used as `request' argument to `ioctl'.  */
Packit 6c4009
#define __SID		('S' << 8)
Packit 6c4009
Packit 6c4009
#define I_NREAD	    (__SID | 1)	/* Counts the number of data bytes in the data
Packit 6c4009
				   block in the first message.  */
Packit 6c4009
#define I_PUSH	    (__SID | 2)	/* Push STREAMS module onto top of the current
Packit 6c4009
				   STREAM, just below the STREAM head.  */
Packit 6c4009
#define I_POP	    (__SID | 3)	/* Remove STREAMS module from just below the
Packit 6c4009
				   STREAM head.  */
Packit 6c4009
#define I_LOOK	    (__SID | 4)	/* Retrieve the name of the module just below
Packit 6c4009
				   the STREAM head and place it in a character
Packit 6c4009
				   string.  */
Packit 6c4009
#define I_FLUSH	    (__SID | 5)	/* Flush all input and/or output.  */
Packit 6c4009
#define I_SRDOPT    (__SID | 6)	/* Sets the read mode.  */
Packit 6c4009
#define I_GRDOPT    (__SID | 7)	/* Returns the current read mode setting.  */
Packit 6c4009
#define I_STR	    (__SID | 8)	/* Construct an internal STREAMS `ioctl'
Packit 6c4009
				   message and send that message downstream. */
Packit 6c4009
#define I_SETSIG    (__SID | 9)	/* Inform the STREAM head that the process
Packit 6c4009
				   wants the SIGPOLL signal issued.  */
Packit 6c4009
#define I_GETSIG    (__SID |10) /* Return the events for which the calling
Packit 6c4009
				   process is currently registered to be sent
Packit 6c4009
				   a SIGPOLL signal.  */
Packit 6c4009
#define I_FIND	    (__SID |11) /* Compares the names of all modules currently
Packit 6c4009
				   present in the STREAM to the name pointed to
Packit 6c4009
				   by `arg'.  */
Packit 6c4009
#define I_LINK	    (__SID |12) /* Connect two STREAMs.  */
Packit 6c4009
#define I_UNLINK    (__SID |13) /* Disconnects the two STREAMs.  */
Packit 6c4009
#define I_PEEK	    (__SID |15) /* Allows a process to retrieve the information
Packit 6c4009
				   in the first message on the STREAM head read
Packit 6c4009
				   queue without taking the message off the
Packit 6c4009
				   queue.  */
Packit 6c4009
#define I_FDINSERT  (__SID |16) /* Create a message from the specified
Packit 6c4009
				   buffer(s), adds information about another
Packit 6c4009
				   STREAM, and send the message downstream.  */
Packit 6c4009
#define I_SENDFD    (__SID |17) /* Requests the STREAM associated with `fildes'
Packit 6c4009
				   to send a message, containing a file
Packit 6c4009
				   pointer, to the STREAM head at the other end
Packit 6c4009
				   of a STREAMS pipe.  */
Packit 6c4009
#define I_RECVFD    (__SID |14) /* Non-EFT definition.  */
Packit 6c4009
#define I_SWROPT    (__SID |19) /* Set the write mode.  */
Packit 6c4009
#define I_GWROPT    (__SID |20) /* Return the current write mode setting.  */
Packit 6c4009
#define I_LIST	    (__SID |21) /* List all the module names on the STREAM, up
Packit 6c4009
				   to and including the topmost driver name. */
Packit 6c4009
#define I_PLINK	    (__SID |22) /* Connect two STREAMs with a persistent
Packit 6c4009
				   link.  */
Packit 6c4009
#define I_PUNLINK   (__SID |23) /* Disconnect the two STREAMs that were
Packit 6c4009
				   connected with a persistent link.  */
Packit 6c4009
#define I_FLUSHBAND (__SID |28) /* Flush only band specified.  */
Packit 6c4009
#define I_CKBAND    (__SID |29) /* Check if the message of a given priority
Packit 6c4009
				   band exists on the STREAM head read
Packit 6c4009
				   queue.  */
Packit 6c4009
#define I_GETBAND   (__SID |30) /* Return the priority band of the first
Packit 6c4009
				   message on the STREAM head read queue.  */
Packit 6c4009
#define I_ATMARK    (__SID |31) /* See if the current message on the STREAM
Packit 6c4009
				   head read queue is "marked" by some module
Packit 6c4009
				   downstream.  */
Packit 6c4009
#define I_SETCLTIME (__SID |32) /* Set the time the STREAM head will delay when
Packit 6c4009
				   a STREAM is closing and there is data on
Packit 6c4009
				   the write queues.  */
Packit 6c4009
#define I_GETCLTIME (__SID |33) /* Get current value for closing timeout.  */
Packit 6c4009
#define I_CANPUT    (__SID |34) /* Check if a certain band is writable.  */
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Used in `I_LOOK' request.  */
Packit 6c4009
#define FMNAMESZ	8	/* compatibility w/UnixWare/Solaris.  */
Packit 6c4009
Packit 6c4009
/* Flush options.  */
Packit 6c4009
#define FLUSHR		0x01	/* Flush read queues.  */
Packit 6c4009
#define FLUSHW		0x02	/* Flush write queues.  */
Packit 6c4009
#define FLUSHRW		0x03	/* Flush read and write queues.  */
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
# define FLUSHBAND	0x04	/* Flush only specified band.  */
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Possible arguments for `I_SETSIG'.  */
Packit 6c4009
#define S_INPUT		0x0001	/* A message, other than a high-priority
Packit 6c4009
				   message, has arrived.  */
Packit 6c4009
#define S_HIPRI		0x0002	/* A high-priority message is present.  */
Packit 6c4009
#define S_OUTPUT	0x0004	/* The write queue for normal data is no longer
Packit 6c4009
				   full.  */
Packit 6c4009
#define S_MSG		0x0008	/* A STREAMS signal message that contains the
Packit 6c4009
				   SIGPOLL signal reaches the front of the
Packit 6c4009
				   STREAM head read queue.  */
Packit 6c4009
#define S_ERROR		0x0010	/* Notification of an error condition.  */
Packit 6c4009
#define S_HANGUP	0x0020	/* Notification of a hangup.  */
Packit 6c4009
#define S_RDNORM	0x0040	/* A normal message has arrived.  */
Packit 6c4009
#define S_WRNORM	S_OUTPUT
Packit 6c4009
#define S_RDBAND	0x0080	/* A message with a non-zero priority has
Packit 6c4009
				   arrived.  */
Packit 6c4009
#define S_WRBAND	0x0100	/* The write queue for a non-zero priority
Packit 6c4009
				   band is no longer full.  */
Packit 6c4009
#define S_BANDURG	0x0200	/* When used in conjunction with S_RDBAND,
Packit 6c4009
				   SIGURG is generated instead of SIGPOLL when
Packit 6c4009
				   a priority message reaches the front of the
Packit 6c4009
				   STREAM head read queue.  */
Packit 6c4009
Packit 6c4009
/* Option for `I_PEEK'.  */
Packit 6c4009
#define RS_HIPRI	0x01	/* Only look for high-priority messages.  */
Packit 6c4009
Packit 6c4009
/* Options for `I_SRDOPT'.  */
Packit 6c4009
#define RNORM		0x0000	/* Byte-STREAM mode, the default.  */
Packit 6c4009
#define RMSGD		0x0001	/* Message-discard mode.   */
Packit 6c4009
#define RMSGN		0x0002	/* Message-nondiscard mode.   */
Packit 6c4009
#define RPROTDAT	0x0004	/* Deliver the control part of a message as
Packit 6c4009
				   data.  */
Packit 6c4009
#define RPROTDIS	0x0008	/* Discard the control part of a message,
Packit 6c4009
				   delivering any data part.  */
Packit 6c4009
#define RPROTNORM	0x0010	/* Fail `read' with EBADMSG if a message
Packit 6c4009
				   containing a control part is at the front
Packit 6c4009
				   of the STREAM head read queue.  */
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
# define RPROTMASK	0x001C	/* The RPROT bits */
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Possible mode for `I_SWROPT'.  */
Packit 6c4009
#define SNDZERO		0x001	/* Send a zero-length message downstream when a
Packit 6c4009
				   `write' of 0 bytes occurs.  */
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
# define SNDPIPE	0x002	/* Send SIGPIPE on write and putmsg if
Packit 6c4009
				   sd_werror is set.  */
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Arguments for `I_ATMARK'.  */
Packit 6c4009
#define ANYMARK		0x01	/* Check if the message is marked.  */
Packit 6c4009
#define LASTMARK	0x02	/* Check if the message is the last one marked
Packit 6c4009
				   on the queue.  */
Packit 6c4009
Packit 6c4009
/* Argument for `I_UNLINK'.  */
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
# define MUXID_ALL	(-1)	/* Unlink all STREAMs linked to the STREAM
Packit 6c4009
				   associated with `fildes'.  */
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Macros for `getmsg', `getpmsg', `putmsg' and `putpmsg'.  */
Packit 6c4009
#define MSG_HIPRI	0x01	/* Send/receive high priority message.  */
Packit 6c4009
#define MSG_ANY		0x02	/* Receive any message.  */
Packit 6c4009
#define MSG_BAND	0x04	/* Receive message from specified band.  */
Packit 6c4009
Packit 6c4009
/* Values returned by getmsg and getpmsg */
Packit 6c4009
#define MORECTL		1	/* More control information is left in
Packit 6c4009
				   message.  */
Packit 6c4009
#define MOREDATA	2	/* More data is left in message.  */
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Structure used for the I_FLUSHBAND ioctl on streams.  */
Packit 6c4009
struct bandinfo
Packit 6c4009
  {
Packit 6c4009
    unsigned char bi_pri;
Packit 6c4009
    int bi_flag;
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
struct strbuf
Packit 6c4009
  {
Packit 6c4009
    int maxlen;		/* Maximum buffer length.  */
Packit 6c4009
    int len;		/* Length of data.  */
Packit 6c4009
    char *buf;		/* Pointer to buffer.  */
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
struct strpeek
Packit 6c4009
  {
Packit 6c4009
    struct strbuf ctlbuf;
Packit 6c4009
    struct strbuf databuf;
Packit 6c4009
    t_uscalar_t flags;			/* UnixWare/Solaris compatibility.  */
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
struct strfdinsert
Packit 6c4009
  {
Packit 6c4009
    struct strbuf ctlbuf;
Packit 6c4009
    struct strbuf databuf;
Packit 6c4009
    t_uscalar_t flags;			/* UnixWare/Solaris compatibility.  */
Packit 6c4009
    int fildes;
Packit 6c4009
    int offset;
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
struct strioctl
Packit 6c4009
  {
Packit 6c4009
    int ic_cmd;
Packit 6c4009
    int ic_timout;
Packit 6c4009
    int ic_len;
Packit 6c4009
    char *ic_dp;
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
struct strrecvfd
Packit 6c4009
  {
Packit 6c4009
    int fd;
Packit 6c4009
    uid_t uid;
Packit 6c4009
    gid_t gid;
Packit 6c4009
    char __fill[8];			/* UnixWare/Solaris compatibility */
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
Packit 6c4009
struct str_mlist
Packit 6c4009
  {
Packit 6c4009
    char l_name[FMNAMESZ + 1];
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
struct str_list
Packit 6c4009
  {
Packit 6c4009
    int sl_nmods;
Packit 6c4009
    struct str_mlist *sl_modlist;
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
#endif /* bits/stropts.h */