当前位置: 技术问答>linux和unix
请问:在linux下如何编程实现机器重起???
来源: 互联网 发布时间:2014-11-28
本文导语: 不用system(“reboot”),不知该如何实现??? | how to reboot in c programme SYNOPSIS int reboot(int magic, int magic_too, int flag); PARAMETERS magic: [in] 0xfee1dead. magic_too: [in] 672274793. flag: [in] ...
不用system(“reboot”),不知该如何实现???
|
how to reboot in c programme SYNOPSIS
int reboot(int magic, int magic_too, int flag);
PARAMETERS
magic: [in] 0xfee1dead.
magic_too: [in] 672274793.
flag: [in] see description.
DESCRIPTION
Reboots the machine or enable the Ctrl-Alt-Del combinaison. magic must be 0xfee1dead and magic_too must be 672274793. If those two conditions are true, then the following values of flag perform the specified operations:
0x1234567
preform a hard reset.
0x89abcdef
Ctrl-Alt-Del is enabled.
0
Ctrl-Atl-Del is disabled and a signal is send to init.
Does not sync!!! The calling task must have superuser privileges.
RETURN VALUE
On success zero is returned. On error -1 is returned and errno is set to one of the following values:
EINVAL: the value of magic, magic_too or flag is invalid.
EPERM: the calling task does not have superuser privileges.
本人收藏的一个好象是国外的帖子,没翻译。
你看怎么样
int reboot(int magic, int magic_too, int flag);
PARAMETERS
magic: [in] 0xfee1dead.
magic_too: [in] 672274793.
flag: [in] see description.
DESCRIPTION
Reboots the machine or enable the Ctrl-Alt-Del combinaison. magic must be 0xfee1dead and magic_too must be 672274793. If those two conditions are true, then the following values of flag perform the specified operations:
0x1234567
preform a hard reset.
0x89abcdef
Ctrl-Alt-Del is enabled.
0
Ctrl-Atl-Del is disabled and a signal is send to init.
Does not sync!!! The calling task must have superuser privileges.
RETURN VALUE
On success zero is returned. On error -1 is returned and errno is set to one of the following values:
EINVAL: the value of magic, magic_too or flag is invalid.
EPERM: the calling task does not have superuser privileges.
本人收藏的一个好象是国外的帖子,没翻译。
你看怎么样
|
man -S2 reboot