File: vcs.4

package info (click to toggle)
manpages-es 1.24a-6
  • links: PTS
  • area: main
  • in suites: potato
  • size: 4,256 kB
  • ctags: 7
  • sloc: makefile: 66; sh: 62
file content (110 lines) | stat: -rw-r--r-- 3,978 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
.\" Copyright (c) 1995 James R. Van Zandt <jrv@vanzandt.mv.com>
.\" Sat Feb 18 09:11:07 EST 1995
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
.\" USA.
.\"
.\" Modified, Sun Feb 26 15:08:05 1995, faith@cs.unc.edu
.\" "
.\" Translated Tue Jul 2 1996 by
.\"   Ignacio Arenaza (Ignacio.Arenaza@studi.epfl.ch)
.\" Translation revised on Wed May 13 1998 by
.\" 	Gerardo Aburruzaga Garca <gerardo.aburruzaga@uca.es>
.\" Translation revised on Tue Apr 6 1999 by Juan Piernas <piernas@ditec.um.es
.\"
.TH VCS 4 "2 Julio 1996" "Linux" "Manual del Programador de Linux"
.SH NOMBRE
vcs, vcsa \- memoria de la consola virtual
.SH DESCRIPCIN
\fB/dev/vcs0\fP es un dispositivo de carcter con nmero mayor 7 y
nmero menor 0, creado normalmente con modo 0644 y propietario
root.tty. Designa la memoria del terminal de consola virtual
visualizado en ese momento.
.LP
\fB/dev/vcs[1-63]\fP son los dispositivos de carcter para los
terminales de consola virtual. Tienen el nmero mayor 7 y el nmero
menor de 1 a 63, y se crean normalmente con el modo 0644 y propietario
root.tty. \fB/dev/vcsa[0-63]\fP son lo mismo, pero incluyendo los
atributos, y prefijados con cuatro bytes que indican las dimensiones
de la pantalla y la posicin del cursor: \fIlneas\fP, \fIcolumnas\fP,
\fIx\fP, \fIy\fP (\fIx\fP = \fIy\fP = 0 en la esquina superior
izquierda de la pantalla).
.PP
Estos dispositivos reemplazan las ioctl de volcado de pantalla de
\fBconsole\fP(4), de forma que el administrador del sistema pueda
controlar el acceso a travs de los permisos del sistema de ficheros.
.PP
Los dispositivos de las ocho primeras consolas virtuales se pueden
crear con:

.nf
	for x in 0 1 2 3 4 5 6 7 8; do 
		mknod -m 644 /dev/vcs$x c 7 $x;
		mknod -m 644 /dev/vcsa$x c 7 $[$x+128];
	done
	chown root:tty /dev/vcs*
.fi

No se aceptan peticiones de \fBioctl()\fP.
.SH EJEMPLOS
Se puede hacer un volcado de pantalla de vt3 conmutando a vt1 y
tecleando \fIcat /dev/vcs3 >foo\fP. Ntese que la salida no contiene
caracteres de nueva lnea, por lo que puede ser necesario algo de
procesamiento adicional, como por ejemplo en \fIfold -w 81 /dev/vcs3 |
lpr\fP o en (horror) \fIsetterm -dump 3 -file /proc/self/fd/1\fP.

El siguiente programa visualiza los atributos de carcter y 
pantalla que se encuentran en la posicin del cursor de la segunda
consola virtual, y despus cambia su color de fondo all:

.nf
	#include <unistd.h>
	#include <stdio.h>
	#include <fcntl.h>

	int main()
	{	int fd;
		struct {char lines, cols, x, y;} scrn;
		char ch, attrib;

		fd = open("/dev/vcsa2", O_RDWR);
		(void)read(fd, &scrn, 4);
		(void)lseek(fd, 4 + 2*(scrn.y*scrn.cols + scrn.x), 0);
		(void)read(fd, &ch, 1);
		(void)read(fd, &attrib, 1);
		(void)printf("c='%c' atrib=0x%02x\\n", ch, attrib);
		attrib ^= 0x10;
		(void)lseek(fd, -1, 1);
		(void)write(fd, &attrib, 1);
		return 0;
	}
.fi

.SH FICHEROS
/dev/vcs[0-63]
.br
/dev/vcsa[0-63]
.SH AUTOR
Andries Brouwer <aeb@cwi.nl>
.SH HISTORIA
Disponible a partir de la versin 1.1.92 del ncleo de Linux.
.SH "VASE TAMBIN"
.BR console "(4), " tty "(4), " ttys "(4), "
.BR selection (1).