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 57c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate * with the License. 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate * and limitations under the License. 137c478bd9Sstevel@tonic-gate * 147c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate * 207c478bd9Sstevel@tonic-gate * CDDL HEADER END 217c478bd9Sstevel@tonic-gate */ 227c478bd9Sstevel@tonic-gate /* 23*5d54f3d8Smuffin * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate #ifndef __sys_ttycom_h 287c478bd9Sstevel@tonic-gate #define __sys_ttycom_h 297c478bd9Sstevel@tonic-gate 30*5d54f3d8Smuffin #pragma ident "%Z%%M% %I% %E% SMI" 31*5d54f3d8Smuffin 327c478bd9Sstevel@tonic-gate #ifndef _POSIX_SOURCE 337c478bd9Sstevel@tonic-gate 347c478bd9Sstevel@tonic-gate /* 357c478bd9Sstevel@tonic-gate * Window/terminal size structure. 367c478bd9Sstevel@tonic-gate * This information is stored by the kernel 377c478bd9Sstevel@tonic-gate * in order to provide a consistent interface, 387c478bd9Sstevel@tonic-gate * but is not used by the kernel. 397c478bd9Sstevel@tonic-gate * 407c478bd9Sstevel@tonic-gate * Type must be "unsigned short" so that types.h not required. 417c478bd9Sstevel@tonic-gate */ 427c478bd9Sstevel@tonic-gate struct winsize { 437c478bd9Sstevel@tonic-gate unsigned short ws_row; /* rows, in characters */ 447c478bd9Sstevel@tonic-gate unsigned short ws_col; /* columns, in characters */ 457c478bd9Sstevel@tonic-gate unsigned short ws_xpixel; /* horizontal size, pixels - not used */ 467c478bd9Sstevel@tonic-gate unsigned short ws_ypixel; /* vertical size, pixels - not used */ 477c478bd9Sstevel@tonic-gate }; 487c478bd9Sstevel@tonic-gate 49*5d54f3d8Smuffin #define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */ 50*5d54f3d8Smuffin #define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */ 517c478bd9Sstevel@tonic-gate 527c478bd9Sstevel@tonic-gate /* 537c478bd9Sstevel@tonic-gate * Sun version of same. 547c478bd9Sstevel@tonic-gate */ 557c478bd9Sstevel@tonic-gate struct ttysize { 567c478bd9Sstevel@tonic-gate int ts_lines; /* number of lines on terminal */ 577c478bd9Sstevel@tonic-gate int ts_cols; /* number of columns on terminal */ 587c478bd9Sstevel@tonic-gate }; 597c478bd9Sstevel@tonic-gate 60*5d54f3d8Smuffin #define TIOCSSIZE _IOW('t',37,struct ttysize)/* set tty size */ 61*5d54f3d8Smuffin #define TIOCGSIZE _IOR('t',38,struct ttysize)/* get tty size */ 627c478bd9Sstevel@tonic-gate 637c478bd9Sstevel@tonic-gate /* 647c478bd9Sstevel@tonic-gate * 4.3BSD and SunOS terminal "ioctl"s with no "termios" equivalents. 657c478bd9Sstevel@tonic-gate * This file is included by <sys/termios.h> and indirectly by <sys/ioctl.h> 667c478bd9Sstevel@tonic-gate * so that programs that include either one have these "ioctl"s defined. 677c478bd9Sstevel@tonic-gate */ 68*5d54f3d8Smuffin #define TIOCSCTTY _IO('t', 132) /* get a ctty */ 69*5d54f3d8Smuffin #define TIOCGPGRP _IOR('t', 119, int) /* get pgrp of tty */ 70*5d54f3d8Smuffin #define TIOCGETPGRP _IOR('t', 131, int) /* get pgrp of tty (posix) */ 71*5d54f3d8Smuffin #define TIOCSPGRP _IOW('t', 118, int) /* set pgrp of tty */ 72*5d54f3d8Smuffin #define TIOCSETPGRP _IOW('t', 130, int) /* set pgrp of tty (posix) */ 73*5d54f3d8Smuffin #define TIOCOUTQ _IOR('t', 115, int) /* output queue size */ 74*5d54f3d8Smuffin #define TIOCSTI _IOW('t', 114, char) /* simulate terminal input */ 75*5d54f3d8Smuffin #define TIOCNOTTY _IO('t', 113) /* void tty association */ 76*5d54f3d8Smuffin #define TIOCPKT _IOW('t', 112, int) /* pty: set/clear packet mode */ 777c478bd9Sstevel@tonic-gate #define TIOCPKT_DATA 0x00 /* data packet */ 787c478bd9Sstevel@tonic-gate #define TIOCPKT_FLUSHREAD 0x01 /* flush data not yet written to controller */ 797c478bd9Sstevel@tonic-gate #define TIOCPKT_FLUSHWRITE 0x02 /* flush data read from controller but not yet processed */ 807c478bd9Sstevel@tonic-gate #define TIOCPKT_STOP 0x04 /* stop output */ 817c478bd9Sstevel@tonic-gate #define TIOCPKT_START 0x08 /* start output */ 827c478bd9Sstevel@tonic-gate #define TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */ 837c478bd9Sstevel@tonic-gate #define TIOCPKT_DOSTOP 0x20 /* now do ^S, ^Q */ 847c478bd9Sstevel@tonic-gate #define TIOCPKT_IOCTL 0x40 /* "ioctl" packet */ 85*5d54f3d8Smuffin #define TIOCMSET _IOW('t', 109, int) /* set all modem bits */ 86*5d54f3d8Smuffin #define TIOCMBIS _IOW('t', 108, int) /* bis modem bits */ 87*5d54f3d8Smuffin #define TIOCMBIC _IOW('t', 107, int) /* bic modem bits */ 88*5d54f3d8Smuffin #define TIOCMGET _IOR('t', 106, int) /* get all modem bits */ 897c478bd9Sstevel@tonic-gate #define TIOCM_LE 0001 /* line enable */ 907c478bd9Sstevel@tonic-gate #define TIOCM_DTR 0002 /* data terminal ready */ 917c478bd9Sstevel@tonic-gate #define TIOCM_RTS 0004 /* request to send */ 927c478bd9Sstevel@tonic-gate #define TIOCM_ST 0010 /* secondary transmit */ 937c478bd9Sstevel@tonic-gate #define TIOCM_SR 0020 /* secondary receive */ 947c478bd9Sstevel@tonic-gate #define TIOCM_CTS 0040 /* clear to send */ 957c478bd9Sstevel@tonic-gate #define TIOCM_CAR 0100 /* carrier detect */ 967c478bd9Sstevel@tonic-gate #define TIOCM_CD TIOCM_CAR 977c478bd9Sstevel@tonic-gate #define TIOCM_RNG 0200 /* ring */ 987c478bd9Sstevel@tonic-gate #define TIOCM_RI TIOCM_RNG 997c478bd9Sstevel@tonic-gate #define TIOCM_DSR 0400 /* data set ready */ 1007c478bd9Sstevel@tonic-gate 101*5d54f3d8Smuffin #define TIOCREMOTE _IOW('t', 105, int) /* remote input editing */ 102*5d54f3d8Smuffin #define TIOCUCNTL _IOW('t', 102, int) /* pty: set/clr usr cntl mode */ 1037c478bd9Sstevel@tonic-gate 1047c478bd9Sstevel@tonic-gate /* 1057c478bd9Sstevel@tonic-gate * Sun-specific ioctls with no "termios" equivalents. 1067c478bd9Sstevel@tonic-gate */ 107*5d54f3d8Smuffin #define TIOCTCNTL _IOW('t', 32, int) /* pty: set/clr intercept ioctl mode */ 108*5d54f3d8Smuffin #define TIOCSIGNAL _IOW('t', 33, int) /* pty: send signal to slave */ 109*5d54f3d8Smuffin #define TIOCCONS _IO('t', 36) /* get console I/O */ 110*5d54f3d8Smuffin #define TIOCSSOFTCAR _IOW('t', 101, int) /* set soft carrier flag */ 111*5d54f3d8Smuffin #define TIOCGSOFTCAR _IOR('t', 100, int) /* get soft carrier flag */ 112*5d54f3d8Smuffin #define TIOCISPACE _IOR('t', 128, int) /* space left in input queue */ 113*5d54f3d8Smuffin #define TIOCISIZE _IOR('t', 129, int) /* size of input queue */ 1147c478bd9Sstevel@tonic-gate 1157c478bd9Sstevel@tonic-gate #endif /* !_POSIX_SOURCE */ 1167c478bd9Sstevel@tonic-gate #endif /* !__sys_ttycom_h */ 117