NetBSD Problem Report #39513

From www@NetBSD.org  Wed Sep 10 19:10:49 2008
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id B213363B92A
	for <gnats-bugs@gnats.netbsd.org>; Wed, 10 Sep 2008 19:10:49 +0000 (UTC)
Message-Id: <20080910191049.4F5BF63B853@narn.NetBSD.org>
Date: Wed, 10 Sep 2008 19:10:49 +0000 (UTC)
From: ekamperi@gmail.com
Reply-To: ekamperi@gmail.com
To: gnats-bugs@NetBSD.org
Subject: reboot(2) doesn't explicitly mention that combining options is possible
X-Send-Pr-Version: www-1.0

>Number:         39513
>Category:       misc
>Synopsis:       reboot(2) doesn't explicitly mention that combining options is possible
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          closed
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 10 19:15:00 +0000 2008
>Closed-Date:    Thu Sep 11 17:03:58 +0000 2008
>Last-Modified:  Thu Sep 11 17:05:02 +0000 2008
>Originator:     Stathis Kamperis
>Release:        NetBSD 4.99.72
>Organization:
>Environment:
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

>Description:
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 :)

http://www.netbsd.org/docs/kernel/#generating-a-crash-dump

>How-To-Repeat:
man 2 reboot

>Fix:
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.

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: christos@NetBSD.org
State-Changed-When: Thu, 11 Sep 2008 13:03:58 -0400
State-Changed-Why:
fixed, thanks


From: Christos Zoulas <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/39513 CVS commit: src/lib/libc/sys
Date: Thu, 11 Sep 2008 17:03:24 +0000 (UTC)

 Module Name:	src
 Committed By:	christos
 Date:		Thu Sep 11 17:03:23 UTC 2008

 Modified Files:
 	src/lib/libc/sys: reboot.2

 Log Message:
 PR/39513: Stathis Kamperis: reboot(2) doesn't explicitly mention that combining
 options is possible
 Also remove RB_DFLTROOT.


 To generate a diff of this commit:
 cvs rdiff -r1.23 -r1.24 src/lib/libc/sys/reboot.2

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.