Source-Changes-HG archive

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

[src/trunk]: src/share/doc/psd/05.sysman I'm a document, Jim, not a shell scr...



details:   https://anonhg.NetBSD.org/src/rev/6ae9b5312968
branches:  trunk
changeset: 790405:6ae9b5312968
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sun Oct 06 05:45:19 2013 +0000

description:
I'm a document, Jim, not a shell script.

Fix this to not use .sy to generate portions of the document.
Instead, generate the necessary bits with sed beforehand.

Apparently -ms is too feeble to be able to generate tables of contents
with automatically generated page numbers, so add the expected page
numbers into the document and make it possible to turn on a
rudimentary mechanism for crosschecking them. (This mechanism still
requires .sy though. Improvements welcome.)

This makes it unnecessary to build the document twice, or to use
groff in unsafe mode.

diffstat:

 share/doc/psd/05.sysman/0.t      |  22 +++++++++++++------
 share/doc/psd/05.sysman/1.0.t    |   4 +-
 share/doc/psd/05.sysman/1.1.t    |  16 +++++++-------
 share/doc/psd/05.sysman/1.2.t    |  14 ++++++------
 share/doc/psd/05.sysman/1.3.t    |  16 +++++++-------
 share/doc/psd/05.sysman/1.4.t    |   8 +++---
 share/doc/psd/05.sysman/1.5.t    |  12 +++++-----
 share/doc/psd/05.sysman/1.6.t    |  10 ++++----
 share/doc/psd/05.sysman/1.7.t    |  12 +++++-----
 share/doc/psd/05.sysman/2.0.t    |   4 +-
 share/doc/psd/05.sysman/2.1.t    |  10 ++++----
 share/doc/psd/05.sysman/2.2.t    |  34 +++++++++++++++---------------
 share/doc/psd/05.sysman/2.3.t    |  44 ++++++++++++++++++++--------------------
 share/doc/psd/05.sysman/2.4.t    |  14 ++++++------
 share/doc/psd/05.sysman/2.5.t    |   8 +++---
 share/doc/psd/05.sysman/Makefile |  21 ++++++++++++------
 share/doc/psd/05.sysman/a.t      |  24 ++++++++++----------
 17 files changed, 144 insertions(+), 129 deletions(-)

diffs (truncated from 994 to 300 lines):

diff -r 1b195e44fffa -r 6ae9b5312968 share/doc/psd/05.sysman/0.t
--- a/share/doc/psd/05.sysman/0.t       Sun Oct 06 01:21:24 2013 +0000
+++ b/share/doc/psd/05.sysman/0.t       Sun Oct 06 05:45:19 2013 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: 0.t,v 1.4 2005/12/26 20:04:46 perry Exp $
+.\"    $NetBSD: 0.t,v 1.5 2013/10/06 05:45:19 dholland Exp $
 .\"
 .\" Copyright (c) 1983, 1993, 1994
 .\"    The Regents of the University of California.  All rights reserved.
@@ -78,15 +78,24 @@
 .AE
 .LP
 .bp +3
-.sy echo -n >toc
+.\" The second argument of .Sh is the page number the section is
+.\" expected to begin on. This is extracted into the table of contents
+.\" before we begin typesetting. If you have been editing the document
+.\" and want to check that the page numbers are still correct,
+.\" uncomment the following line and the .sy line two lines down, then
+.\" run groff with -U so .sy is allowed. Then check the output pagelog
+.\" file. If anyone knows how to change this to an assertion, so .sy
+.\" isn't needed and groff will complain if $2 isn't equal to the page
+.\" number, please go ahead.
+.\".sy echo 'have should-be heading' >pagelog
 .de Sh
-.sy echo >>toc '.L\\$1 "\\$2" \\n%'
+.\".sy echo >>pagelog '\\$2 \\n% "\\$3"'
 .ie \\$1=0 \{\
-\fB\\$2\fP
+\fB\\$3\fP
 .\}
 .el \{\
 .NH \\$1
-\\$2
+\\$3
 .LP
 .\}
 ..
@@ -97,9 +106,8 @@
 \\$1\\$2
 ..
 .de Fd
-.sy echo >>toc '.Nm \\$1 \\$2 "\\$3'
 ..
-.Sh 0 "Notation and Types
+.Sh 0 4 "Notation and Types
 .PP
 The notation used to describe system calls is a variant of a
 C language function call, consisting of a prototype call followed by
diff -r 1b195e44fffa -r 6ae9b5312968 share/doc/psd/05.sysman/1.0.t
--- a/share/doc/psd/05.sysman/1.0.t     Sun Oct 06 01:21:24 2013 +0000
+++ b/share/doc/psd/05.sysman/1.0.t     Sun Oct 06 05:45:19 2013 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: 1.0.t,v 1.3 2003/08/07 10:30:48 agc Exp $
+.\"    $NetBSD: 1.0.t,v 1.4 2013/10/06 05:45:19 dholland Exp $
 .\"
 .\" Copyright (c) 1983, 1993, 1994
 .\"    The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"    @(#)1.0.t       8.3 (Berkeley) 5/26/94
 .\"
-.Sh 1 "Kernel primitives
+.Sh 1 4 "Kernel primitives
 .PP
 The facilities available to a user process are logically
 divided into two parts: kernel facilities directly implemented by
diff -r 1b195e44fffa -r 6ae9b5312968 share/doc/psd/05.sysman/1.1.t
--- a/share/doc/psd/05.sysman/1.1.t     Sun Oct 06 01:21:24 2013 +0000
+++ b/share/doc/psd/05.sysman/1.1.t     Sun Oct 06 05:45:19 2013 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: 1.1.t,v 1.3 2003/08/07 10:30:48 agc Exp $
+.\"    $NetBSD: 1.1.t,v 1.4 2013/10/06 05:45:19 dholland Exp $
 .\"
 .\" Copyright (c) 1983, 1993, 1994
 .\"    The Regents of the University of California.  All rights reserved.
@@ -29,8 +29,8 @@
 .\"
 .\"    @(#)1.1.t       8.5 (Berkeley) 5/26/94
 .\"
-.Sh 2 "Processes and protection
-.Sh 3 "Host identifiers
+.Sh 2 5 "Processes and protection
+.Sh 3 5 "Host identifiers
 .PP
 Each host has associated with it an integer host ID, and a host
 name of up to MAXHOSTNAMELEN (256) characters (as defined in
@@ -62,7 +62,7 @@
 len = gethostname(buf, buflen);
 result int len; result char *buf; int buflen;
 .DE
-.Sh 3 "Process identifiers
+.Sh 3 5 "Process identifiers
 Each host runs a set of \fIprocesses\fP.
 Each process is largely independent of other processes,
 having its own protection domain, address space, timers, and
@@ -90,7 +90,7 @@
 pid = getppid();
 result pid_t pid;
 .DE
-.Sh 3 "Process creation and termination
+.Sh 3 5 "Process creation and termination
 .LP
 A new process is created by making a logical duplicate of an
 existing process:
@@ -173,7 +173,7 @@
 Whether changed or not, the effective user ID is then copied to the
 saved user ID, and the effective group ID is copied to the
 saved group ID.
-.Sh 3 "User and group IDs
+.Sh 3 6 "User and group IDs
 .PP
 Each process in the system has associated with it three user IDs:
 a \fIreal user ID\fP, an \fIeffective user ID\fP, and a \fIsaved user ID\fP,
@@ -282,7 +282,7 @@
 setegid(gid);
 gid_t gid;
 .DE
-.Sh 3 "Sessions
+.Sh 3 7 "Sessions
 .PP
 When a user first logs onto the system,
 they are put into a session with a controlling process
@@ -313,7 +313,7 @@
 Unlike historic systems, the value returned by
 .Fn getlogin
 is stored in the kernel and can be trusted.
-.Sh 3 "Process groups
+.Sh 3 7 "Process groups
 .PP
 Each process in the system is also associated with a \fIprocess
 group\fP.  The group of processes in a process group is sometimes
diff -r 1b195e44fffa -r 6ae9b5312968 share/doc/psd/05.sysman/1.2.t
--- a/share/doc/psd/05.sysman/1.2.t     Sun Oct 06 01:21:24 2013 +0000
+++ b/share/doc/psd/05.sysman/1.2.t     Sun Oct 06 05:45:19 2013 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: 1.2.t,v 1.4 2004/02/13 11:36:08 wiz Exp $
+.\"    $NetBSD: 1.2.t,v 1.5 2013/10/06 05:45:19 dholland Exp $
 .\"
 .\" Copyright (c) 1983, 1993, 1994
 .\"    The Regents of the University of California.  All rights reserved.
@@ -29,8 +29,8 @@
 .\"
 .\"    @(#)1.2.t       8.9 (Berkeley) 5/29/94
 .\"
-.Sh 2 "Memory management
-.Sh 3 "Text, data, and stack
+.Sh 2 8 "Memory management
+.Sh 3 8 "Text, data, and stack
 .PP
 Each process begins execution with three logical areas of memory
 called text, data, and stack.  
@@ -63,7 +63,7 @@
 .LP
 There is no call for extending the stack,
 as it is automatically extended as needed.
-.Sh 3 "Mapping pages
+.Sh 3 8 "Mapping pages
 .PP
 The system supports sharing of data between processes
 by allowing pages to be mapped into memory.  These mapped
@@ -205,7 +205,7 @@
 This call deletes the mappings for the specified address range,
 and causes further references to addresses within the range
 to generate invalid memory references.
-.Sh 3 "Page protection control
+.Sh 3 10 "Page protection control
 .LP
 A process can control the protection of pages using the call:
 .DS
@@ -216,7 +216,7 @@
 This call changes the specified pages to have protection \fIprot\fP\|.
 Not all implementations will guarantee protection on a page basis;
 the granularity of protection changes may be as large as an entire region.
-.Sh 3 "Giving and getting advice
+.Sh 3 10 "Giving and getting advice
 .LP
 A process that has knowledge of its memory behavior may
 use the
@@ -282,7 +282,7 @@
 .Fn munlock
 call, the pages in the specified address range are still accessible
 but may be paged out if memory is needed and they are not accessed.
-.Sh 3 "Synchronization primitives
+.Sh 3 10 "Synchronization primitives
 Primitives are provided for synchronization using semaphores
 in shared memory.\(dd
 .FS
diff -r 1b195e44fffa -r 6ae9b5312968 share/doc/psd/05.sysman/1.3.t
--- a/share/doc/psd/05.sysman/1.3.t     Sun Oct 06 01:21:24 2013 +0000
+++ b/share/doc/psd/05.sysman/1.3.t     Sun Oct 06 05:45:19 2013 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: 1.3.t,v 1.3 2003/08/07 10:30:48 agc Exp $
+.\"    $NetBSD: 1.3.t,v 1.4 2013/10/06 05:45:19 dholland Exp $
 .\"
 .\" Copyright (c) 1983, 1993, 1994
 .\"    The Regents of the University of California.  All rights reserved.
@@ -29,9 +29,9 @@
 .\"
 .\"    @(#)1.3.t       8.6 (Berkeley) 5/29/94
 .\"
-.Sh 2 "Signals
+.Sh 2 11 "Signals
 .PP
-.Sh 3 "Overview
+.Sh 3 11 "Overview
 .PP
 The system defines a set of \fIsignals\fP that may be delivered
 to a process.  Signal delivery resembles the occurrence of a hardware
@@ -62,7 +62,7 @@
 as if signal handlers were interrupted by other signal handlers.
 Mechanisms are provided whereby critical sections
 of code may protect themselves against the occurrence of specified signals.
-.Sh 3 "Signal types
+.Sh 3 11 "Signal types
 .PP
 The signals defined by the system fall into one of
 five classes: hardware conditions,
@@ -111,7 +111,7 @@
 Exceeding resource limits may cause signals to be generated.
 SIGXCPU occurs when a process nears its CPU time limit and
 SIGXFSZ when a process reaches the limit on file size.
-.Sh 3 "Signal handlers
+.Sh 3 12 "Signal handlers
 .PP
 A process has a handler associated with each signal.
 The handler controls the way the signal is delivered.
@@ -200,7 +200,7 @@
 the signal mask at the time of the corresponding
 .Fn setjmp
 is restored.
-.Sh 3 "Sending signals
+.Sh 3 13 "Sending signals
 .LP
 A process can send a signal to another process or processes group
 with the call:
@@ -222,7 +222,7 @@
 Signals also are sent implicitly from a terminal device to the
 process group associated with the terminal when certain input characters
 are typed.
-.Sh 3 "Protecting critical sections
+.Sh 3 13 "Protecting critical sections
 .LP
 The
 .Fn sigprocmask
@@ -256,7 +256,7 @@
 sigpending(mask);
 result sigset_t *mask;
 .DE
-.Sh 3 "Signal stacks
+.Sh 3 14 "Signal stacks
 .LP
 Applications that maintain complex or fixed size stacks can use
 the call:
diff -r 1b195e44fffa -r 6ae9b5312968 share/doc/psd/05.sysman/1.4.t
--- a/share/doc/psd/05.sysman/1.4.t     Sun Oct 06 01:21:24 2013 +0000
+++ b/share/doc/psd/05.sysman/1.4.t     Sun Oct 06 05:45:19 2013 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: 1.4.t,v 1.3 2003/08/07 10:30:48 agc Exp $
+.\"    $NetBSD: 1.4.t,v 1.4 2013/10/06 05:45:19 dholland Exp $
 .\"
 .\" Copyright (c) 1983, 1993, 1994
 .\"    The Regents of the University of California.  All rights reserved.
@@ -29,8 +29,8 @@
 .\"
 .\"    @(#)1.4.t       8.5 (Berkeley) 5/29/94
 .\"
-.Sh 2 "Timers
-.Sh 3 "Real time
+.Sh 2 14 "Timers
+.Sh 3 14 "Real time
 .PP
 The system's notion of the current time is in Coordinated Universal Time
 (UTC, previously GMT) and the current time
@@ -88,7 +88,7 @@
 adjtime(delta, olddelta);
 struct timeval *delta; result struct timeval *olddelta;
 .DE
-.Sh 3 "Interval time
+.Sh 3 15 "Interval time
 .LP
 The system provides each process with three interval timers,
 defined in \fI<sys/time.h>\fP:
diff -r 1b195e44fffa -r 6ae9b5312968 share/doc/psd/05.sysman/1.5.t
--- a/share/doc/psd/05.sysman/1.5.t     Sun Oct 06 01:21:24 2013 +0000
+++ b/share/doc/psd/05.sysman/1.5.t     Sun Oct 06 05:45:19 2013 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: 1.5.t,v 1.3 2003/08/07 10:30:49 agc Exp $
+.\"    $NetBSD: 1.5.t,v 1.4 2013/10/06 05:45:19 dholland Exp $
 .\"
 .\" Copyright (c) 1983, 1993, 1994
 .\"    The Regents of the University of California.  All rights reserved.
@@ -29,8 +29,8 @@
 .\"
 .\"    @(#)1.5.t       8.6 (Berkeley) 5/29/94
 .\"
-.Sh 2 Descriptors
-.Sh 3 "The reference table
+.Sh 2 16 "Descriptors
+.Sh 3 16 "The reference table



Home | Main Index | Thread Index | Old Index