17688SAaron.Zang@Sun.COM /* 27688SAaron.Zang@Sun.COM * CDDL HEADER START 37688SAaron.Zang@Sun.COM * 47688SAaron.Zang@Sun.COM * The contents of this file are subject to the terms of the 57688SAaron.Zang@Sun.COM * Common Development and Distribution License (the "License"). 67688SAaron.Zang@Sun.COM * You may not use this file except in compliance with the License. 77688SAaron.Zang@Sun.COM * 87688SAaron.Zang@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97688SAaron.Zang@Sun.COM * or http://www.opensolaris.org/os/licensing. 107688SAaron.Zang@Sun.COM * See the License for the specific language governing permissions 117688SAaron.Zang@Sun.COM * and limitations under the License. 127688SAaron.Zang@Sun.COM * 137688SAaron.Zang@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 147688SAaron.Zang@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157688SAaron.Zang@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 167688SAaron.Zang@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 177688SAaron.Zang@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 187688SAaron.Zang@Sun.COM * 197688SAaron.Zang@Sun.COM * CDDL HEADER END 207688SAaron.Zang@Sun.COM */ 217688SAaron.Zang@Sun.COM 227688SAaron.Zang@Sun.COM /* 23*12195SAaron.Zang@Sun.COM * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. 247688SAaron.Zang@Sun.COM */ 257688SAaron.Zang@Sun.COM 267688SAaron.Zang@Sun.COM #ifndef _SYS_VT_H 277688SAaron.Zang@Sun.COM #define _SYS_VT_H 287688SAaron.Zang@Sun.COM 297688SAaron.Zang@Sun.COM #ifdef __cplusplus 307688SAaron.Zang@Sun.COM extern "C" { 317688SAaron.Zang@Sun.COM #endif 327688SAaron.Zang@Sun.COM 337688SAaron.Zang@Sun.COM #include <sys/types.h> 347688SAaron.Zang@Sun.COM 357688SAaron.Zang@Sun.COM /* 367688SAaron.Zang@Sun.COM * Public IOCTLs supported by the VT, which are shared with 377688SAaron.Zang@Sun.COM * other operating systems. 387688SAaron.Zang@Sun.COM */ 397688SAaron.Zang@Sun.COM #define VTIOC ('V'<<8) 407688SAaron.Zang@Sun.COM #define VT_OPENQRY (VTIOC|1) /* inquires if this vt already open */ 417688SAaron.Zang@Sun.COM #define VT_SETMODE (VTIOC|2) /* set vt into auto or process mode */ 427688SAaron.Zang@Sun.COM 437688SAaron.Zang@Sun.COM #define VT_GETMODE (VTIOC|3) /* returns mode vt is currently in */ 447688SAaron.Zang@Sun.COM #define VT_RELDISP (VTIOC|4) /* tells vt when display released */ 457688SAaron.Zang@Sun.COM #define VT_ACTIVATE (VTIOC|5) /* activates specified vt */ 467688SAaron.Zang@Sun.COM #define VT_WAITACTIVE (VTIOC|6) /* wait for vt to be activated */ 477688SAaron.Zang@Sun.COM #define VT_GETSTATE (VTIOC|100) /* returns active and open vts */ 487688SAaron.Zang@Sun.COM 497688SAaron.Zang@Sun.COM /* 507688SAaron.Zang@Sun.COM * Solaris specific public IOCTL. 517688SAaron.Zang@Sun.COM * Inquires if the vt functionality is available. 527688SAaron.Zang@Sun.COM */ 537688SAaron.Zang@Sun.COM #define VT_ENABLED (VTIOC|101) 547688SAaron.Zang@Sun.COM 55*12195SAaron.Zang@Sun.COM /* get/set the target of /dev/vt/console_user symbol link */ 56*12195SAaron.Zang@Sun.COM #define VT_GET_CONSUSER (VTIOC|108) 57*12195SAaron.Zang@Sun.COM #define VT_SET_CONSUSER (VTIOC|109) 58*12195SAaron.Zang@Sun.COM 597688SAaron.Zang@Sun.COM struct vt_mode { 607688SAaron.Zang@Sun.COM char mode; /* mode to set vt into, VT_AUTO or VT_PROCESS */ 617688SAaron.Zang@Sun.COM char waitv; /* if != 0, vt hangs on writes when not active */ 627688SAaron.Zang@Sun.COM short relsig; /* signal to use for release request */ 637688SAaron.Zang@Sun.COM short acqsig; /* signal to use for display acquired */ 647688SAaron.Zang@Sun.COM short frsig; /* signal to use for forced release */ 657688SAaron.Zang@Sun.COM }; 667688SAaron.Zang@Sun.COM 677688SAaron.Zang@Sun.COM /* vt switching mode */ 687688SAaron.Zang@Sun.COM enum { 697688SAaron.Zang@Sun.COM VT_AUTO = 0, /* this vt switching is automatic */ 707688SAaron.Zang@Sun.COM VT_PROCESS /* this vt switching controlled by process */ 717688SAaron.Zang@Sun.COM }; 727688SAaron.Zang@Sun.COM 737688SAaron.Zang@Sun.COM #define VT_ACKACQ 2 /* ack from v86 acquire routine */ 747688SAaron.Zang@Sun.COM 757688SAaron.Zang@Sun.COM /* 767688SAaron.Zang@Sun.COM * structure used by VT_GETSTATE ioctl 777688SAaron.Zang@Sun.COM */ 787688SAaron.Zang@Sun.COM 797688SAaron.Zang@Sun.COM struct vt_stat { 807688SAaron.Zang@Sun.COM unsigned short v_active; 817688SAaron.Zang@Sun.COM unsigned short v_signal; 827688SAaron.Zang@Sun.COM unsigned short v_state; 837688SAaron.Zang@Sun.COM }; 847688SAaron.Zang@Sun.COM 857688SAaron.Zang@Sun.COM /* project private IOCTLs */ 867688SAaron.Zang@Sun.COM #define VT_CONFIG (VTIOC|102) /* config virtual console number */ 877688SAaron.Zang@Sun.COM #define VT_SETDISPINFO (VTIOC|103) /* set display number */ 887688SAaron.Zang@Sun.COM #define VT_SETDISPLOGIN (VTIOC|104) /* set display login */ 897688SAaron.Zang@Sun.COM #define VT_GETDISPINFO (VTIOC|105) /* get display info */ 907688SAaron.Zang@Sun.COM 917688SAaron.Zang@Sun.COM /* 927688SAaron.Zang@Sun.COM * setting target console is only used by vtdaemon 937688SAaron.Zang@Sun.COM * to set target console while vtdaemon is authenticating 947688SAaron.Zang@Sun.COM * for it, which is returned in VT_GETSTATE. At that 957688SAaron.Zang@Sun.COM * time, the real active console is the vtdaemon special console, 967688SAaron.Zang@Sun.COM * but VT_GETSTATE should not be aware of it. Instead, VT_GETACTIVE 977688SAaron.Zang@Sun.COM * is used to get the real active console for vtdaemon. 987688SAaron.Zang@Sun.COM */ 997688SAaron.Zang@Sun.COM #define VT_SET_TARGET (VTIOC|106) 1007688SAaron.Zang@Sun.COM #define VT_GETACTIVE (VTIOC|107) 1017688SAaron.Zang@Sun.COM 1027688SAaron.Zang@Sun.COM /* 103*12195SAaron.Zang@Sun.COM * Used by cn to convert a VT_SET_CONSUSER to a internal interface 104*12195SAaron.Zang@Sun.COM * so that /dev/console and /dev/vt/0 could be differentiated. 105*12195SAaron.Zang@Sun.COM */ 106*12195SAaron.Zang@Sun.COM #define VT_RESET_CONSUSER (VTIOC|110) 107*12195SAaron.Zang@Sun.COM 108*12195SAaron.Zang@Sun.COM /* 1097688SAaron.Zang@Sun.COM * structure used by VT_GETDISPINFO 1107688SAaron.Zang@Sun.COM */ 1117688SAaron.Zang@Sun.COM struct vt_dispinfo { 1127688SAaron.Zang@Sun.COM pid_t v_pid; /* -1 if no display info (auto mode) */ 1137688SAaron.Zang@Sun.COM int v_dispnum; /* display number associated with vt */ 1147688SAaron.Zang@Sun.COM int v_login; /* if the user logged in the display */ 1157688SAaron.Zang@Sun.COM }; 1167688SAaron.Zang@Sun.COM 1177688SAaron.Zang@Sun.COM #ifdef __cplusplus 1187688SAaron.Zang@Sun.COM } 1197688SAaron.Zang@Sun.COM #endif 1207688SAaron.Zang@Sun.COM 1217688SAaron.Zang@Sun.COM #endif /* _SYS_VT_H */ 122