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 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
|
.\" Copyright (c) 1998 Andries Brouwer (aeb@cwi.nl), 24 September 1998
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" Translated into Spanish Thu Jan 22 1998 by Gerardo Aburruzaga
.\" García <gerardo.aburruzaga@uca.es>
.\" Translation revised Sat Oct 3 1998 by Juan Piernas <piernas@ditec.um.es>
.\" Translation revised Wed Dec 30 1998 by Juan Piernas <piernas@ditec.um.es>
.\"
.TH REBOOT 2 "24 Septiembre 1998" "Linux 2.1.122" "Manual del Programador de Linux"
.SH NOMBRE
reboot \- rearranca o habilita/inhabilita Ctrl-Alt-Supr
.SH SINOPSIS
Para libc4 y libc5 la función de biblioteca y la llamada al sistema son
idénticas, y desde la versión 2.1.30 del núcleo existen nombres simbólicos
LINUX_REBOOT_* para las constantes y un cuarto argumento para la llamada:
.sp
.B #include <unistd.h>
.br
.B #include <linux/reboot.h>
.sp
.BI "int reboot (int " magico ", int " otro_magico ", int " flag ", void *" arg );
.sp
Bajo glibc se han asignado nombres simbólicos RB_* a algunas de las contantes
involucradas y la función de biblioteca es un envoltorio de 1 argumento
de la llamada al sistema de 3 argumentos:
.sp
.B #include <unistd.h>
.br
.B #include <sys/reboot.h>
.sp
.BI "int reboot (int " flag );
.SH DESCRIPCIÓN
La llamada
.B reboot
rearranca el sistema o habilita/inhabilita la pulsación de rearranque
(abreviada CAS, ya que por defecto es Ctrl-Alt-Supr; se puede cambiar usando
.BR loadkeys (1)).
.PP
Esta llamada al sistema fallará (con EINVAL) a menos que
.I magico
sea igual a LINUX_REBOOT_MAGIC1 (esto es, 0xfee1dead) y
.I otro_magico
sea igual a LINUX_REBOOT_MAGIC2 (o sea, 672274793).
Sin embargo, también se permiten como valores de
.I otro_magico
LINUX_REBOOT_MAGIC2A (esto es, 85072278)
desde la versión 2.1.17
y LINUX_REBOOT_MAGIC2B (es decir, 369367448)
desde la versión 2.1.97.
(Los valores hexadecimales de estas constantes no tienen sentido.)
El argumento
.I flag
puede tener los siguientes valores:
.TP
.B LINUX_REBOOT_CMD_RESTART
(RB_AUTOBOOT, 0x1234567).
Se muestra el mensaje `Restarting system.' y se realiza inmediatamente un
rearranque por defecto.
Si no se precede por una llamada a
.BR sync (2)
se perderán datos.
.TP
.B LINUX_REBOOT_CMD_HALT
(RB_HALT_SYSTEM, 0xcdef0123; desde la versión 1.1.76).
Se muestra el mensaje `System halted.' y se detiene el sistema. El control
se cede al monitor en ROM, si existe alguno.
Si no se precede por una llamada a
.BR sync (2)
se perderán datos.
.TP
.B LINUX_REBOOT_CMD_POWER_OFF
(0x4321fedc; desde la versión 2.1.30).
Se muestra el mensaje `Power down.', se detiene el sistema y se apaga el
sistema, si es posible.
Si no se precede por una llamada a
.BR sync (2)
se perderán datos.
.TP
.B LINUX_REBOOT_CMD_RESTART2
(0xa1b2c3d4; desde la versión 2.1.30).
Se muestra el mensaje `Restarting system with command '%s'' y se realiza
inmediatamente un rearranque (usando la cadena de orden dada en
.IR arg ).
Si no se precede por una llamada a
.BR sync (2)
se perderán datos.
.TP
.B LINUX_REBOOT_CMD_CAD_ON
(RB_ENABLE_CAD, 0x89abcdef).
Se habilita la combinación de teclas CAS.
Esto significa que una pulsación CAS producirá inmediatamente la acción
asociada a LINUX_REBOOT_CMD_RESTART.
.TP
.B LINUX_REBOOT_CMD_CAD_OFF
(RB_DISABLE_CAD, 0).
Se inhabilita la combinación de teclas CAS.
Esto significa que una pulsación CAS producirá el envío de la señal SIGINT a
init (el proceso 1), y como consecuencia de esto este proceso puede
decidir una acción apropiada (quizás, matar todos los procesos, llamar a
sync y reiniciar).
.LP
Sólo el súperusuario puede utilizar esta función.
.LP
El efecto exacto de las acciones anteriores depende de la arquitectura. Para
la arquitectura i386, el argumento adicional no hace nada por el momento
(2.1.122), pero el tipo de rearranque se puede determinar mediante
argumentos en la línea de órdenes del núcleo (`Reboot=...') para que sea
bien `en caliente', bien `en frio', y bien hardware, bien a través de la
BIOS.
.SH "VALOR DEVUELTO"
En caso de éxito, se devuelve 0. En caso de error, se devuelve \-1 y
se pone un valor apropiado en \fIerrno\fP.
.SH ERRORES
.TP
.B EINVAL
Números mágicos o \fIflag\fP incorrectos.
.TP
.B EPERM
Un usuario distinto de root intenta llamar a
.BR reboot .
.SH "CONFORME A"
.B reboot
es específico de Linux y no debería emplearse en programas que se
pretendan transportables.
.SH FALLOS
En un sistema basado en glibc, los parámetros
.I magico
y
.I otro_magico
no existen. Sólo existe el parámetro
.IR flag .
.SH "VÉASE TAMBIÉN"
.BR sync (2),
.BR bootparam (7),
.BR ctrlaltdel (8),
.BR halt (8),
.BR reboot (8)
|