NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

misc/39513: reboot(2) doesn't explicitly mention that combining options is possible

>Number:         39513
>Category:       misc
>Synopsis:       reboot(2) doesn't explicitly mention that combining options is 
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 10 19:15:00 +0000 2008
>Originator:     Stathis Kamperis
>Release:        NetBSD 4.99.72
NetBSD netbsd 4.99.72 NetBSD 4.99.72 (XEN3_DOM0) #0: Fri Aug 29 23:49:07 EEST 
2008  root@netbsd:/usr/obj/sys/arch/i386/compile/XEN3_DOM0 i386

The man page of reboot(2) implies, but doesn't _explicitly_ mention 
that one can combine the various options by OR'ing them.
For example it is ok to pass 0x104 (the result of 0x0100 | 0x004)
which would be interpreted as: "Dump kernel memory before rebooting
(0x100), but don't sync the disks (0x04)"

The 0x104 value is mentioned in the following ling and it seems like
it fell from the sky :)

man 2 reboot

Index: reboot.2
RCS file: /cvsroot/src/lib/libc/sys/reboot.2,v
retrieving revision 1.23
diff -u -r1.23 reboot.2
--- reboot.2    5 Aug 2006 18:18:37 -0000       1.23
+++ reboot.2    10 Sep 2008 19:03:55 -0000
@@ -55,6 +55,9 @@
 .Aq Pa sys/reboot.h ,
 to be passed
 to the new kernel or the new bootstrap and init programs.
+Options can be combined together by OR'ing them, eg.
+RB_DUMP | RB_NOSYNC would be interpreted as
+.Dq dump kernel memory before rebooting and don't sync the disks .
 .Bl -column RB_INITNAMEA 0x0000
 .It Dv RB_AUTOBOOT Ta Li 0x0000 Ta
 The default, causing the system to reboot in its usual fashion.

Home | Main Index | Thread Index | Old Index