REBOOT

Section: Linux Programmer's Manual (2)
Updated: 24 September 1998
Index
Return to Main Contents
 

À̸§

reboot - Àç½ÃÀÛ È¤Àº Ctrl-Alt-DelÀÇ »ç¿ë/»ç¿ë¾ÈÇÔ  

»ç¿ë¹ý

libc4°úlibc5¿¡°Ô ¶óÀ̺귯¸® È£Ãâ°ú ½Ã½ºÅÛ È£ÃâÀº µ¿ÀϽà µÇ°í, Ä¿³Î ¹öÀü 2.1.30ÀÌÈķΠȣÃâÀ» À§ÇÑ »ó¼ö¿Í ³×¹ø° µ¶¸³º¯¼ö·Î¼­ symbolic names LINUX_REBOOT_*°¡ ÀÖ´Ù:

#include <unistd.h>
#include <linux/reboot.h>

int reboot (int magic, int magic2, int flag, void *arg);

glibcÇÏ¿¡¼­ ¾î¶² º¹ÀâÇÑ »ó¼ö´Â symbolic names RB_*¸¦ °¡Áö°í, ¶óÀ̺귯¸® È£ÃâÀº 3-µµ¸³º¯¼ö ½Ã½ºÅÛ È£Ãâ ÁÖº¯¿¡ 1-argument wrapperÀÌ´Ù:

#include <unistd.h>
#include <sys/reboot.h>

int reboot (int flag);  

¼³¸í

reboot È£ÃâÀº ½Ã½ºÅÛÀ» Àç½ÃÀÛÇϰųª, Àç½ÃÀÛ Å°ÀÔ·ÂÀ» °¡´É/ºÒ°¡´É ÇÏ°Ô ÇÑ´Ù. (°£°áÇÏ°Ô µÈ CAD, µðÆúÆ®´Â Ctrl-Alt-DeleteÀ̱⠶§¹®¿¡; loadkeys(1)). »ç¿ëÀ¸·Î ¹Ù²Ü ¼ö ÀÖ´Ù.

ÀÌ ½Ã½ºÅÛ È£ÃâÀº(EINVAL¿Í ÇÔ²²) magic °¡ LINUX_REBOOT_MAGIC1 (ÀÌ°ÍÀº 0xfee1dead)¿Í °°°í magic2 °¡ LINUX_REBOOT_MAGIC2 (ÀÌ°ÍÀº 672274793)¿Í °°Áö ¾ÊÀ¸¸é ½ÇÆÐÇÒ ¼ö ÀÖ´Ù. ÇÏÁö¸¸, 2.1.17ÀÌÈÄÀÇ LINUX_REBOOT_MAGIC2A (ÀÌ°ÍÀº 85072278)¿Í 2.1.97ÀÌÈÄÀÇ LINUX_REBOOT_MAGIC2B (ÀÌ°ÍÀº 369367448)Àº magic2. ÀÇ °ªÀ¸·Î ¿©°ÜÁø´Ù.(ÀÌ »ó¼öÀÇ 16Áø¼ö °ªÀº Àǹ̽ÉÀåÇÑ °ÍÀÌ´Ù.) flag µ¶¸³º¯¼ö´Â ¾Æ·¡¿Í °°Àº °ªÀ» °¡Áú ¼ö ÀÖ´Ù:

LINUX_REBOOT_CMD_RESTART
(RB_AUTOBOOT, 0x1234567). `Restarting system' (½Ã½ºÅÛ Àç½ÃÀÛ) ¸Þ½ÃÁö°¡ Ãâ·ÂµÈ´Ù. ±×¸®°í µðÆúÆ® Àç½ÃÀÛÀÌ °ð ½ÇÇàµÈ´Ù. sync(2) °¡ ¼±ÇàµÇÁö ¾ÊÀ¸¸é, ÀÚ·á°¡ »ç¶óÁø´Ù.
LINUX_REBOOT_CMD_HALT
(RB_HALT_SYSTEM, 0xcdef0123; since 1.1.76). stem halted'(½Ã½ºÅÛ Á¤Áö) ¸Þ½ÃÁö¸¦ Ãâ·ÂµÈ´Ù. ±×¸®°í ½Ã½ºÅÛÀÌ ¸ØÃá´Ù. Çϳª ÀÖ´Ù¸é, Á¦¾î´Â ROM ¸ð´ÏÅÍ¿¡°Ô ³Ñ¾î°£´Ù. sync(2) °¡ ¼±ÇàµÇÁö ¾ÊÀ¸¸é ÀÚ·á°¡ »ç¶óÁø´Ù.
LINUX_REBOOT_CMD_POWER_OFF
(0x4321fedc; since 2.1.30). `Power down'(Àü¿ø ²¨Áü) ¸Þ½ÃÁö°¡ Ãâ·ÂµÈ´Ù. ±×¸®°í ½Ã½ºÅÛÀÌ ¸ØÃß°í, °¡´ÉÇÏ¸é ½Ã½ºÅÛÀÇ ¸ðµç ÆÄ¿ö°¡ »ç¶óÁø´Ù. sync(2) °¡ ¼±ÇàµÇÁö ¾ÊÀ¸¸é ÀÚ·á°¡ »ç¶óÁø´Ù.
LINUX_REBOOT_CMD_RESTART2
(0xa1b2c3d4; since 2.1.30). `Restarting system with command '%s''¸Þ½ÃÁö°¡ Ãâ·ÂµÇ°í °ð Àç½ÃÀÛ ÇÑ´Ù.
 (.IR arg ¿¡ ÀÖ´Â ¸í·É ¹®ÀÚ¿­ÀÌ »ç¿ëµÈ´Ù.) sync(2) °¡ ¼±ÇàµÇÁö ¾ÊÀ¸¸é, ÀÚ·á°¡ »ç¶óÁø´Ù.
LINUX_REBOOT_CMD_CAD_ON
(RB_ENABLE_CAD, 0x89abcdef). CAD °¡ °¡´ÉÇØÁø´Ù. ÀÌ°ÍÀº CAD Å° ÀԷ¿¡ ÀÇÇØ Áï½Ã LINUX_REBOOT_CMD_RESTART¿Í °ü·ÃµÈ ÀÛµ¿ÀÌ ÀϾ´Ù´Â °ÍÀ» ¶æÇÑ´Ù.
LINUX_REBOOT_CMD_CAD_OFF
(RB_DISABLE_CAD, 0). CAD¸¦ »ç¿ëÇÏÁö ¾Ê´Â´Ù. ÀÌ°ÍÀº CAD Å° ÀÔ·ÂÀÌ init (process 1)¿¡ º¸³»Áö´Â SIGINT ½ÅÈ£¸¦ ¹ß»ý½ÃŲ´Ù. ±×·¡¼­ ÇÁ·Î¼¼½º´Â °íÀ¯ÀÇ ¿ªÇÒÀ» °áÁ¤ÇÑ´Ù.(¾Æ¸¶: ¸ðµç ÇÁ·Î¼¼½º Áß´Ü. sync, Àç½ÃÀÛ)

½´ÆÛ À¯Àú¸¸ÀÌ ÀÌ ÇÔ¼ö¸¦ »ç¿ëÇÒ ¼ö ÀÖ´Ù.

À§ÀÇ ÀÛµ¿ÀÌ Á¤È®ÇÑ È¿°ú¸¦ ³ªÅ¸³»´Â °ÍÀº ±¸Á¶¿¡ ´Þ·Á ÀÖ´Ù. i386 ±¸Á¶¿¡¼­. Ãß°¡ µ¶¸³º¯¼ö´Â ÇöÀç(2.1.122) ¾Æ¹«·± ÀÛ¿ëµµ ÇÏÁö ¾Ê´Â´Ù. ÇÏÁö¸¸ Ä¿³Î ¸í·É ¶óÀÎ µ¶¸³º¯¼ö¿¡ ÀÇÇØ Àç½ÃÀÛÀÇ Å¸ÀÔÀÌ warm ºÎÆà ȤÀº cold ºÎÆÃÀ¸·Î °áÁ¤ µÉ ¼ö ÀÖ´Ù.  

¹Ýȯ°ª

¼º°ø½Ã, 0ÀÌ ¹ÝȯµÈ´Ù. ¿¡·¯ ½Ã, -1ÀÌ ¹ÝȯµÇ°í, errno ´Â ÀûÀýÈ÷ ¼³Á¤µÈ´Ù.  

¿¡·¯

EINVAL
ºÎÀû´çÇÑ ¸ÅÁ÷ ³Ñ¹ö ȤÀº flag.
EPERM
·çÆ® »ç¿ëÀÚ°¡ ¾Æ´Ñ »ç¶÷ÀÌ reboot. ¸¦ È£ÃâÇÏ·Á ÇÏ¿´´Ù.
 

ȣȯ

reboot ´Â ¸®´ª½º¿¡ ƯȭµÇ¾î ÀÖÀ¸¹Ç·Î À̽ÄÀ» ¸ñÀûÀ¸·Î ÇÏ´Â ÇÁ·Î±×·¥¿¡¼± »ç¿ëÇÏ¸é ¾ÈµÈ´Ù.  

°ü·Ã Ç׸ñ

sync(2), bootparam(7), ctrlaltdel(8), halt(8), reboot(8)  

¿ªÀÚ

ASPLINUX<man@asp-linux.co.kr>, 2000³â 7¿ù 31


 

Index

À̸§
»ç¿ë¹ý
¼³¸í
¹Ýȯ°ª
¿¡·¯
ȣȯ
°ü·Ã Ç׸ñ
¿ªÀÚ

This document was created by man2html, using the manual pages.
Time: 08:07:01 GMT, March 25, 2004