drop <minix/termios.h>, use clean <sys/termios.h>

. also implement some netbsd-style tty ioctls
	. also implement SIGINFO
	. also import netbsd stty
	. rename keymap minix CMIN (for ctrl+minus on numeric keypad)
	  to CNMIN; to keep unchanged control character default CMIN in
	  new <sys/ttydefaults.h>
	. convert CS[5678] logic in rs232 driver to explicit setting of LC
	  bits

Change-Id: I9b7d2963fe9aec00fb6e7535ef565b3191fc1c1d
This commit is contained in:
Ben Gras
2013-09-10 21:36:48 +00:00
committed by Lionel Sambuc
parent a06e2ab395
commit 7120f34ec1
69 changed files with 2734 additions and 2006 deletions

View File

@@ -66,18 +66,20 @@
#define O_RDWR 0x00000002 /* open for reading and writing */
#define O_ACCMODE 0x00000003 /* mask for above modes */
/* File status flags for open() and fcntl(). POSIX Table 6-5. */
#define O_APPEND 02000 /* set append mode */
#define O_NONBLOCK 04000 /* no delay */
#define O_REOPEN 010000 /* automatically re-open device after driver
* restart
*/
#define O_CLOEXEC 020000 /* close on exec */
/*
* Kernel encoding of open mode; separate read and write bits that are
* independently testable: 1 greater than the above.
*
* XXX
* FREAD and FWRITE are excluded from the #ifdef _KERNEL so that TIOCFLUSH,
* which was documented to use FREAD/FWRITE, continues to work.
*/
#if defined(_NETBSD_SOURCE)
#define O_NOSIGPIPE 040000 /* don't deliver sigpipe */
#define FREAD 0x00000001
#define FWRITE 0x00000002
#endif
#ifndef __minix /* NOT SUPPORTED! */
#define O_NONBLOCK 0x00000004 /* no delay */
#define O_APPEND 0x00000008 /* set append mode */
#if defined(_NETBSD_SOURCE)
#define O_SHLOCK 0x00000010 /* open with shared file lock */
#define O_EXLOCK 0x00000020 /* open with exclusive file lock */
@@ -92,15 +94,13 @@
#define O_NOFOLLOW 0x00000100 /* don't follow symlinks on the last */
/* path component */
#endif
#endif /* !__minix */
#define O_CREAT 0x00000200 /* create if nonexistent */
#define O_TRUNC 0x00000400 /* truncate to zero length */
#define O_EXCL 0x00000800 /* error if already exists */
/* Oflag values for open(). POSIX Table 6-4. */
#define O_CREAT 00100 /* creat file if it doesn't exist */
#define O_EXCL 00200 /* exclusive use flag */
#define O_NOCTTY 00400 /* do not assign a controlling terminal */
#define O_TRUNC 01000 /* truncate flag */
/* defined by POSIX 1003.1; BSD default, but required to be bitwise distinct */
#define O_NOCTTY 0x00008000 /* don't assign controlling terminal */
#ifndef __minix /* NOT SUPPORTED! */
#if (_POSIX_C_SOURCE - 0) >= 199309L || (_XOPEN_SOURCE - 0) >= 500 || \
defined(_NETBSD_SOURCE)
#define O_DSYNC 0x00010000 /* write: I/O data completion */
@@ -111,54 +111,165 @@
#define O_ALT_IO 0x00040000 /* use alternate i/o semantics */
#define O_DIRECT 0x00080000 /* direct I/O hint */
#endif
#endif /* !__minix */
#define O_DIRECTORY 0x00200000 /* fail if not a directory */
#define O_CLOEXEC 0x00400000 /* set close on exec */
#if defined(_INCOMPLETE_XOPEN_C063) || defined(_KERNEL)
#define O_SEARCH 0x00800000 /* skip search permission checks */
#endif
#if defined(_NETBSD_SOURCE)
#define O_NOSIGPIPE 0x01000000 /* don't deliver sigpipe */
#endif
#ifdef __minix
#define O_REOPEN 0x10000000 /* automatically re-open after driver crash */
#endif
#ifdef _KERNEL
/* convert from open() flags to/from fflags; convert O_RD/WR to FREAD/FWRITE */
#define FFLAGS(oflags) ((oflags) + 1)
#define OFLAGS(fflags) ((fflags) - 1)
/* all bits settable during open(2) */
#define O_MASK (O_ACCMODE|O_NONBLOCK|O_APPEND|O_SHLOCK|O_EXLOCK|\
O_ASYNC|O_SYNC|O_CREAT|O_TRUNC|O_EXCL|O_DSYNC|\
O_RSYNC|O_NOCTTY|O_ALT_IO|O_NOFOLLOW|O_DIRECT|\
O_DIRECTORY|O_CLOEXEC|O_NOSIGPIPE)
#define FMARK 0x00001000 /* mark during gc() */
#define FDEFER 0x00002000 /* defer for next gc pass */
#define FHASLOCK 0x00004000 /* descriptor holds advisory lock */
#define FSCAN 0x00100000 /* scan during gc passes */
#define FSILENT 0x40000000 /* suppress kernel error messages */
#define FKIOCTL 0x80000000 /* kernel originated ioctl */
/* bits settable by fcntl(F_SETFL, ...) */
#define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|FDSYNC|FRSYNC|FALTIO|\
FDIRECT|FNOSIGPIPE)
/* bits to save after open(2) */
#define FMASK (FREAD|FWRITE|FCNTLFLAGS)
#endif /* _KERNEL */
/*
* The O_* flags used to have only F* names, which were used in the kernel
* and by fcntl. We retain the F* names for the kernel f_flags field
* and for backward compatibility for fcntl.
*/
#if defined(_NETBSD_SOURCE)
#define FAPPEND O_APPEND /* kernel/compat */
#define FASYNC O_ASYNC /* kernel/compat */
#define O_FSYNC O_SYNC /* compat */
#define FNDELAY O_NONBLOCK /* compat */
#define O_NDELAY O_NONBLOCK /* compat */
#endif
#if defined(_KERNEL)
#define FNOSIGPIPE O_NOSIGPIPE /* kernel */
#define FNONBLOCK O_NONBLOCK /* kernel */
#define FFSYNC O_SYNC /* kernel */
#define FDSYNC O_DSYNC /* kernel */
#define FRSYNC O_RSYNC /* kernel */
#define FALTIO O_ALT_IO /* kernel */
#define FDIRECT O_DIRECT /* kernel */
#endif
/*
* Constants used for fcntl(2)
*/
/* command values */
/* These values are used for cmd in fcntl(). POSIX Table 6-1. */
#define F_DUPFD 0 /* duplicate file descriptor */
#define F_GETFD 1 /* get file descriptor flags */
#define F_SETFD 2 /* set file descriptor flags */
#define F_GETFL 3 /* get file status flags */
#define F_SETFL 4 /* set file status flags */
#define F_GETLK 5 /* get record locking information */
#define F_SETLK 6 /* set record locking information */
#define F_SETLKW 7 /* set record locking info; wait if blocked */
#define F_FREESP 8 /* free a section of a regular file */
#define F_DUPFD 0 /* duplicate file descriptor */
#define F_GETFD 1 /* get file descriptor flags */
#define F_SETFD 2 /* set file descriptor flags */
#define F_GETFL 3 /* get file status flags */
#define F_SETFL 4 /* set file status flags */
#if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 500 || \
defined(_NETBSD_SOURCE)
#define F_GETOWN 5 /* get SIGIO/SIGURG proc/pgrp */
#define F_SETOWN 6 /* set SIGIO/SIGURG proc/pgrp */
#endif
#define F_GETLK 7 /* get record locking information */
#define F_SETLK 8 /* set record locking information */
#define F_SETLKW 9 /* F_SETLK; wait if blocked */
#if defined(_NETBSD_SOURCE)
#define F_GETNOSIGPIPE 9
#define F_SETNOSIGPIPE 10
#define F_CLOSEM 10 /* close all fds >= to the one given */
#define F_MAXFD 11 /* return the max open fd */
#define F_DUPFD_CLOEXEC 12 /* close on exec duplicated fd */
#define F_GETNOSIGPIPE 13 /* get SIGPIPE disposition */
#define F_SETNOSIGPIPE 14 /* set SIGPIPE disposition */
#endif
/* File descriptor flags used for fcntl(). POSIX Table 6-2. */
#define FD_CLOEXEC 1 /* close on exec flag for third arg of fcntl */
#ifdef __minix
#define F_FREESP 100
#endif
/* file descriptor flags (F_GETFD, F_SETFD) */
#define FD_CLOEXEC 1 /* close-on-exec flag */
/* record locking flags (F_GETLK, F_SETLK, F_SETLKW) */
#define F_RDLCK 1 /* shared or read lock */
#define F_WRLCK 2 /* exclusive or write lock */
#define F_UNLCK 3 /* unlock */
#define F_RDLCK 1 /* shared or read lock */
#define F_UNLCK 2 /* unlock */
#define F_WRLCK 3 /* exclusive or write lock */
#ifdef _KERNEL
#define F_WAIT 0x010 /* Wait until lock is granted */
#define F_FLOCK 0x020 /* Use flock(2) semantics for lock */
#define F_POSIX 0x040 /* Use POSIX semantics for lock */
#endif
/* Constants for fcntl's passed to the underlying fs - like ioctl's. */
#if defined(_NETBSD_SOURCE)
#define F_PARAM_MASK 0xfff
#define F_PARAM_LEN(x) (((x) >> 16) & F_PARAM_MASK)
#define F_PARAM_MAX 4095
#define F_FSCTL (int)0x80000000 /* This fcntl goes to the fs */
#define F_FSVOID (int)0x40000000 /* no parameters */
#define F_FSOUT (int)0x20000000 /* copy out parameter */
#define F_FSIN (int)0x10000000 /* copy in parameter */
#define F_FSINOUT (F_FSIN | F_FSOUT)
#define F_FSDIRMASK (int)0x70000000 /* mask for IN/OUT/VOID */
#define F_FSPRIV (int)0x00008000 /* command is fs-specific */
/*
* Define command macros for operations which, if implemented, must be
* the same for all fs's.
*/
#define _FCN(inout, num, len) \
(F_FSCTL | inout | ((len & F_PARAM_MASK) << 16) | (num))
#define _FCNO(c) _FCN(F_FSVOID, (c), 0)
#define _FCNR(c, t) _FCN(F_FSIN, (c), (int)sizeof(t))
#define _FCNW(c, t) _FCN(F_FSOUT, (c), (int)sizeof(t))
#define _FCNRW(c, t) _FCN(F_FSINOUT, (c), (int)sizeof(t))
/*
* Define command macros for fs-specific commands.
*/
#define _FCN_FSPRIV(inout, fs, num, len) \
(F_FSCTL | F_FSPRIV | inout | ((len & F_PARAM_MASK) << 16) | \
(fs) << 8 | (num))
#define _FCNO_FSPRIV(f, c) _FCN_FSPRIV(F_FSVOID, (f), (c), 0)
#define _FCNR_FSPRIV(f, c, t) _FCN_FSPRIV(F_FSIN, (f), (c), (int)sizeof(t))
#define _FCNW_FSPRIV(f, c, t) _FCN_FSPRIV(F_FSOUT, (f), (c), (int)sizeof(t))
#define _FCNRW_FSPRIV(f, c, t) _FCN_FSPRIV(F_FSINOUT, (f), (c), (int)sizeof(t))
#endif /* _NETBSD_SOURCE */
/*
* Advisory file segment locking data type -
* information passed to system by user
*/
struct flock {
short l_type; /* type: F_RDLCK, F_WRLCK, or F_UNLCK */
short l_whence; /* flag for starting offset */
off_t l_start; /* relative offset in bytes */
off_t l_len; /* size; if 0, then until EOF */
pid_t l_pid; /* process id of the locks' owner */
off_t l_start; /* starting offset */
off_t l_len; /* len = 0 means until end of file */
pid_t l_pid; /* lock owner */
short l_type; /* lock type: read/write, etc. */
short l_whence; /* type of l_start */
};
#if defined(_NETBSD_SOURCE)
/* lock operations for flock(2) */
#define LOCK_SH F_RDLCK /* Shared lock */
#define LOCK_EX F_WRLCK /* Exclusive lock */
#define LOCK_NB 0x0080 /* Do not block when locking */
#define LOCK_UN F_UNLCK /* Unlock */
#define LOCK_SH 0x01 /* shared file lock */
#define LOCK_EX 0x02 /* exclusive file lock */
#define LOCK_NB 0x04 /* don't block when locking */
#define LOCK_UN 0x08 /* unlock file */
#endif
/* Always ensure that these are consistent with <stdio.h> and <unistd.h>! */
@@ -185,18 +296,14 @@ struct flock {
/*
* Constants for X/Open Extended API set 2 (a.k.a. C063)
* linkat(2) - also part of Posix-2008/XPG7
*/
#if (_POSIX_C_SOURCE - 0) >= 200809L || (_XOPEN_SOURCE - 0) >= 700 || \
defined(_NETBSD_SOURCE)
#if defined(_INCOMPLETE_XOPEN_C063) || defined(_KERNEL) || defined(__minix)
#define AT_FDCWD -100 /* Use cwd for relative link target */
#define AT_EACCESS 0x100 /* Use euid/egid for access checks */
#define AT_EACCESS 0x100 /* Use euig/egid for access checks */
#define AT_SYMLINK_NOFOLLOW 0x200 /* Do not follow symlinks */
#define AT_SYMLINK_FOLLOW 0x400 /* Follow symlinks */
#define AT_REMOVEDIR 0x800 /* Remove directory only */
#endif
#endif
#ifndef _KERNEL
@@ -209,7 +316,15 @@ int fcntl(int, int, ...);
#if defined(_NETBSD_SOURCE)
int flock(int, int);
#endif /* _NETBSD_SOURCE */
int posix_fadvise(int, off_t, off_t, int);
/*
* X/Open Extended API set 2 (a.k.a. C063)
*/
#if defined(_INCOMPLETE_XOPEN_C063)
int openat(int, const char *, int oflags, ...);
#endif
__END_DECLS
#endif /* _KERNEL */
#endif /* !_KERNEL */
#endif /* !_SYS_FCNTL_H_ */

View File

@@ -13,7 +13,7 @@
* used in each header file are shown in the comment following.
*/
#include <sys/ioc_tty.h> /* 'T' 't' 'k' */
#include <sys/ttycom.h> /* 't' */
#include <sys/ioc_net.h> /* 'n' */
#include <sys/ioc_disk.h> /* 'd' */
#include <sys/ioc_file.h> /* 'f' */
@@ -25,12 +25,7 @@
#include <sys/ioc_fb.h> /* 'V' */
#include <dev/vndvar.h> /* 'F' */
#if defined(_NETBSD_SOURCE)
#define TIOCDRAIN TCDRAIN
#define TIOCGETA TCGETS
#define TIOCSETA TCSETS
#define TIOCSETAW TCSETSW
#define TIOCSETAF TCSETSF
#endif
#define TIOCGSIZE TIOCGWINSZ
#define TIOCSSIZE TIOCSWINSZ
#endif /* _S_IOCTL_H */

View File

@@ -42,7 +42,7 @@
#include <sys/featuretest.h>
#include <sys/sigtypes.h>
#define _NSIG 26
#define _NSIG 27
#define NSIG _NSIG
@@ -67,6 +67,7 @@
#define SIGWINCH 21 /* window size has changed */
#define SIGVTALRM 24 /* virtual alarm */
#define SIGPROF 25 /* profiler alarm */
#define SIGINFO 26 /* information request */
/* POSIX requires the following signals to be defined, even if they are
* not supported. Here are the definitions, but they are not supported.
@@ -86,17 +87,17 @@
* processes in user-space. Higher-priority signals should be first.
*/
/* Signals delivered by a signal manager. */
#define SIGSNDELAY 26 /* end of delay for signal delivery */
#define SIGSNDELAY 27 /* end of delay for signal delivery */
#define SIGS_FIRST SIGHUP /* first system signal */
#define SIGS_LAST SIGSNDELAY /* last system signal */
#define IS_SIGS(signo) (signo>=SIGS_FIRST && signo<=SIGS_LAST)
/* Signals delivered by the kernel. */
#define SIGKMEM 27 /* kernel memory request pending */
#define SIGKMESS 28 /* new kernel message */
#define SIGKSIGSM 29 /* kernel signal pending for signal manager */
#define SIGKSIG 30 /* kernel signal pending */
#define SIGKMEM 28 /* kernel memory request pending */
#define SIGKMESS 29 /* new kernel message */
#define SIGKSIGSM 30 /* kernel signal pending for signal manager */
#define SIGKSIG 31 /* kernel signal pending */
#define SIGK_FIRST SIGKMEM /* first kernel signal */
#define SIGK_LAST SIGKSIG /* last kernel signal */

View File

@@ -34,17 +34,273 @@
#ifndef _SYS_TERMIOS_H_
#define _SYS_TERMIOS_H_
#include <sys/ansi.h>
#include <sys/featuretest.h>
/*
* Special Control Characters
*
* Index into c_cc[] character array.
*
* Name Subscript Enabled by
*/
#define VEOF 0 /* ICANON */
#define VEOL 1 /* ICANON */
#if defined(_NETBSD_SOURCE)
#define VEOL2 2 /* ICANON */
#endif
#define VERASE 3 /* ICANON */
#if defined(_NETBSD_SOURCE)
#define VWERASE 4 /* ICANON */
#endif
#define VKILL 5 /* ICANON */
#if defined(_NETBSD_SOURCE)
#define VREPRINT 6 /* ICANON */
#endif
/* 7 spare 1 */
#define VINTR 8 /* ISIG */
#define VQUIT 9 /* ISIG */
#define VSUSP 10 /* ISIG */
#if defined(_NETBSD_SOURCE)
#define VDSUSP 11 /* ISIG */
#endif
#define VSTART 12 /* IXON, IXOFF */
#define VSTOP 13 /* IXON, IXOFF */
#if defined(_NETBSD_SOURCE)
#define VLNEXT 14 /* IEXTEN */
#define VDISCARD 15 /* IEXTEN */
#endif
#define VMIN 16 /* !ICANON */
#define VTIME 17 /* !ICANON */
#if defined(_NETBSD_SOURCE)
#define VSTATUS 18 /* ICANON */
/* 19 spare 2 */
#endif
#define NCCS 20
#define _POSIX_VDISABLE __CAST(unsigned char, '\377')
#if defined(_NETBSD_SOURCE)
#define CCEQ(val, c) (c == val ? val != _POSIX_VDISABLE : 0)
#endif
/*
* Input flags - software input processing
*/
#define IGNBRK 0x00000001 /* ignore BREAK condition */
#define BRKINT 0x00000002 /* map BREAK to SIGINT */
#define IGNPAR 0x00000004 /* ignore (discard) parity errors */
#define PARMRK 0x00000008 /* mark parity and framing errors */
#define INPCK 0x00000010 /* enable checking of parity errors */
#define ISTRIP 0x00000020 /* strip 8th bit off chars */
#define INLCR 0x00000040 /* map NL into CR */
#define IGNCR 0x00000080 /* ignore CR */
#define ICRNL 0x00000100 /* map CR to NL (ala CRMOD) */
#define IXON 0x00000200 /* enable output flow control */
#define IXOFF 0x00000400 /* enable input flow control */
#if defined(_NETBSD_SOURCE)
#define IXANY 0x00000800 /* any char will restart after stop */
#endif
#if defined(_NETBSD_SOURCE)
#define IMAXBEL 0x00002000 /* ring bell on input queue full */
#endif
#ifdef __minix
#define SCANCODES 0x00001000 /* send scancodes */
#endif
/*
* Output flags - software output processing
*/
#define OPOST 0x00000001 /* enable following output processing */
#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
#define ONLCR 0x00000002 /* map NL to CR-NL (ala CRMOD) */
#endif
#if defined(_NETBSD_SOURCE)
#define OXTABS 0x00000004 /* expand tabs to spaces */
#define ONOEOT 0x00000008 /* discard EOT's (^D) on output */
#endif
#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
#define OCRNL 0x00000010 /* map CR to NL */
#define ONOCR 0x00000020 /* discard CR's when on column 0 */
#define ONLRET 0x00000040 /* move to column 0 on CR */
#endif /* defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE) */
/*
* Control flags - hardware control of terminal
*/
#if defined(_NETBSD_SOURCE)
#define CIGNORE 0x00000001 /* ignore control flags */
#endif
#define CSIZE 0x00000300 /* character size mask */
#define CS5 0x00000000 /* 5 bits (pseudo) */
#define CS6 0x00000100 /* 6 bits */
#define CS7 0x00000200 /* 7 bits */
#define CS8 0x00000300 /* 8 bits */
#define CSTOPB 0x00000400 /* send 2 stop bits */
#define CREAD 0x00000800 /* enable receiver */
#define PARENB 0x00001000 /* parity enable */
#define PARODD 0x00002000 /* odd parity, else even */
#define HUPCL 0x00004000 /* hang up on last close */
#define CLOCAL 0x00008000 /* ignore modem status lines */
#if defined(_NETBSD_SOURCE)
#define CRTSCTS 0x00010000 /* RTS/CTS full-duplex flow control */
#define CRTS_IFLOW CRTSCTS /* XXX compat */
#define CCTS_OFLOW CRTSCTS /* XXX compat */
#define CDTRCTS 0x00020000 /* DTR/CTS full-duplex flow control */
#define MDMBUF 0x00100000 /* DTR/DCD hardware flow control */
#define CHWFLOW (MDMBUF|CRTSCTS|CDTRCTS) /* all types of hw flow control */
#endif
/*
* "Local" flags - dumping ground for other state
*
* Warning: some flags in this structure begin with
* the letter "I" and look like they belong in the
* input flag.
*/
#if defined(_NETBSD_SOURCE)
#define ECHOKE 0x00000001 /* visual erase for line kill */
#endif
#define ECHOE 0x00000002 /* visually erase chars */
#define ECHOK 0x00000004 /* echo NL after line kill */
#define ECHO 0x00000008 /* enable echoing */
#define ECHONL 0x00000010 /* echo NL even if ECHO is off */
#if defined(_NETBSD_SOURCE)
#define ECHOPRT 0x00000020 /* visual erase mode for hardcopy */
#define ECHOCTL 0x00000040 /* echo control chars as ^(Char) */
#endif /* defined(_NETBSD_SOURCE) */
#define ISIG 0x00000080 /* enable signals INT, QUIT, [D]SUSP */
#define ICANON 0x00000100 /* canonicalize input lines */
#if defined(_NETBSD_SOURCE)
#define ALTWERASE 0x00000200 /* use alternate WERASE algorithm */
#endif /* defined(_NETBSD_SOURCE) */
#define IEXTEN 0x00000400 /* enable DISCARD and LNEXT */
#if defined(_NETBSD_SOURCE)
#define EXTPROC 0x00000800 /* external processing */
#endif /* defined(_NETBSD_SOURCE) */
#define TOSTOP 0x00400000 /* stop background jobs on output */
#if defined(_NETBSD_SOURCE)
#define FLUSHO 0x00800000 /* output being flushed (state) */
#define NOKERNINFO 0x02000000 /* no kernel output from VSTATUS */
#define PENDIN 0x20000000 /* re-echo input buffer at next read */
#endif /* defined(_NETBSD_SOURCE) */
#define NOFLSH 0x80000000 /* don't flush output on signal */
typedef unsigned int tcflag_t;
typedef unsigned char cc_t;
typedef unsigned int speed_t;
struct termios {
tcflag_t c_iflag; /* input flags */
tcflag_t c_oflag; /* output flags */
tcflag_t c_cflag; /* control flags */
tcflag_t c_lflag; /* local flags */
cc_t c_cc[NCCS]; /* control chars */
int c_ispeed; /* input speed */
int c_ospeed; /* output speed */
};
/*
* Commands passed to tcsetattr() for setting the termios structure.
*/
#define TCSANOW 0 /* make change immediate */
#define TCSADRAIN 1 /* drain output, then change */
#define TCSAFLUSH 2 /* drain output, flush input */
#if defined(_NETBSD_SOURCE)
#define TCSASOFT 0x10 /* flag - don't alter h.w. state */
#endif
/*
* Standard speeds
*/
#define B0 0
#define B50 50
#define B75 75
#define B110 110
#define B134 134
#define B150 150
#define B200 200
#define B300 300
#define B600 600
#define B1200 1200
#define B1800 1800
#define B2400 2400
#define B4800 4800
#define B9600 9600
#define B19200 19200
#define B38400 38400
#if defined(_NETBSD_SOURCE)
#define B7200 7200
#define B14400 14400
#define B28800 28800
#define B57600 57600
#define B76800 76800
#define B115200 115200
#define B230400 230400
#define B460800 460800
#define B921600 921600
#define EXTA 19200
#define EXTB 38400
#endif /* defined(_NETBSD_SOURCE) */
#ifndef _KERNEL
#define TCIFLUSH 1
#define TCOFLUSH 2
#define TCIOFLUSH 3
#define TCOOFF 1
#define TCOON 2
#define TCIOFF 3
#define TCION 4
#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
#ifndef pid_t
typedef __pid_t pid_t;
#define pid_t __pid_t
#endif
#endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
#include <sys/cdefs.h>
#include <minix/termios.h>
__BEGIN_DECLS
speed_t cfgetispeed(const struct termios *);
speed_t cfgetospeed(const struct termios *);
int cfsetispeed(struct termios *, speed_t);
int cfsetospeed(struct termios *, speed_t);
int tcgetattr(int, struct termios *);
int tcsetattr(int, int, const struct termios *);
int tcdrain(int);
int tcflow(int, int);
int tcflush(int, int);
int tcsendbreak(int, int);
#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
pid_t tcgetsid(int);
#endif /* defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE) */
#if defined(_NETBSD_SOURCE)
void cfmakeraw(struct termios *);
int cfsetspeed(struct termios *, speed_t);
#endif /* defined(_NETBSD_SOURCE) */
__END_DECLS
#endif /* !_KERNEL */
#if defined(_NETBSD_SOURCE)
/*
* Include tty ioctl's that aren't just for backwards compatibility
* with the old tty driver. These ioctl definitions were previously
* in <sys/ioctl.h>.
*/
#include <sys/ttycom.h>
#endif
/*
* END OF PROTECTED INCLUDE.
*/
#endif /* !_SYS_TERMIOS_H_ */
#if defined(_NETBSD_SOURCE)

View File

@@ -35,11 +35,6 @@
*
* @(#)ttycom.h 8.1 (Berkeley) 3/28/94
*/
#include <minix/termios.h>
/* LSC FIXME: Wouldn't it be simpler to use that instead of including here
termios? for now disabled, pending investigation. */
#define _SYS_TTYCOM_H_
#ifndef _SYS_TTYCOM_H_
#define _SYS_TTYCOM_H_
@@ -168,4 +163,21 @@ typedef char linedn_t[TTLINEDNAMELEN];
#define STRIPDISC 6 /* metricom wireless IP discipline */
#define HDLCDISC 9 /* HDLC discipline */
#ifdef __minix
#include <minix/ioctl.h>
/* Terminal ioctls. Use big T. */
#define TIOCSFON _IOW_BIG(1, u8_t [8192]) /* new font */
/* Keyboard ioctls. */
#define KIOCBELL _IOW('k', 1, struct kio_bell)
#define KIOCSLEDS _IOW('k', 2, struct kio_leds)
#define KIOCSMAP _IOW('k', 3, keymap_t)
/* /dev/video ioctls. */
#define TIOCMAPMEM _IORW('v', 1, struct mapreqvm)
#define TIOCUNMAPMEM _IORW('v', 2, struct mapreqvm)
#endif
#endif /* !_SYS_TTYCOM_H_ */

View File

@@ -49,7 +49,11 @@
#define TTYDEF_OFLAG (OPOST | ONLCR )
#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE)
#define TTYDEF_CFLAG (CREAD | CS8 | HUPCL)
#ifdef __minix
#define TTYDEF_SPEED (B115200)
#else
#define TTYDEF_SPEED (B9600)
#endif
/*
* Control Character Defaults