我不确定“分组描述”是否是正确的调用方式,但我很好奇知道手册页的第一行通常是在哪里定义的。这些描述中的大多数并不只针对一个程序。例如,在 Slackware 中:
man rpc
印刷:
RPC(3) BSD 库函数手册 RPC(3) 姓名 rpc — 远程过程调用的库例程 概要 ...
在手册页中,“BSD 库函数手册”描述是在哪里定义的?我递归地搜索了这个包的整个源代码及其手册页,但没有找到任何东西。
答案1
rpc(3) 中的 header 由.Dt
title 宏定义:
$ zcat $(man -w 3 rpc) | head
.\" @(#)rpc.3n 1.31 93/08/31 SMI; from SVr4
.\" Copyright 1989 AT&T
.Dd May 7, 1993
.Dt RPC 3
.Os
.Sh NAME
.Nm rpc
.Nd library routines for remote procedure calls
.Sh SYNOPSIS
.In rpc/rpc.h
您可以在以下位置阅读相关内容man 7 groff_mdoc
:
TITLE MACROS
The title macros are part of the page structure domain but are presented
first and separately for someone who wishes to start writing a man page
yesterday. Three header macros designate the document title or manual
page title, the operating system, and the date of authorship. These
macros are called once at the very beginning of the document and are used
to construct headers and footers only.
.Dt [⟨document title⟩] [⟨section number⟩] [⟨volume⟩]
The document title is the subject of the man page and must be in
CAPITALS due to troff limitations. If omitted, ‘UNTITLED’ is
used. The section number may be a number in the range 1, ..., 9
or ‘unass’, ‘draft’, or ‘paper’. If it is specified, and no vol‐
ume name is given, a default volume name is used.
Under BSD, the following sections are defined:
1 BSD General Commands Manual
2 BSD System Calls Manual
3 BSD Library Functions Manual
4 BSD Kernel Interfaces Manual
5 BSD File Formats Manual
6 BSD Games Manual
7 BSD Miscellaneous Information Manual
8 BSD System Manager's Manual
9 BSD Kernel Developer's Manual
例如,如果你将其更改为.Dt RPC 9
你会得到:
RPC(9) BSD Kernel Developer's Manual RPC(9)