On Sat, Jun 21, 2014 at 11:43:57AM +0200, Jan Stary wrote: > The mandatory .Os macro of an mdoc(7) manpage > makes the rendered manpage have "OpenBSD Reference Manual" > at the top center, and "OpenBSD X.Y" at the bottom. > As the mdoc(7) manual says, > > Left unspecified, it defaults to the local > operating system version. This is the suggested form. > > Viewing the same page on Linux with mandoc, > it renders "General Commands Manual" and "Linux 3.2.0-4-amd64". > > Now, vieweing the same manpage on Linux with groff -mdoc, > it renders "BSD General Commands Manual" at the top center > and "BSD" at the bottom. > > I suppose there is a difference between how mandoc and groff > figure out the OS information to use for .Os; groff_mdoc(7) says > > .Os [<operating system>] [<release>] > If the first parameter is empty, the default `' is used. > This may be overridden in the local configuration file, mdoc.local. > > Could someone please eleborate on this difference between > mandoc and groff regarding how they get the OS information? > Of course my Linux users wonder why the manpage says "BSD". >
mandoc uses the code in mdoc_validate.c (ingo will correct me if i'm wrong) and it's commented thus: Set the operating system by way of the `Os' macro. * The order of precedence is: * 1. the argument of the `Os' macro, unless empty * 2. the -Ios=foo command line argument, if provided * 3. -DOSNAME="\"foo\"", if provided during compilation * 4. "sysname release" from uname(3) groff uses the stuff in the tmac files in doc-common. it is not a pretty sight, but you can see where it sets stuff like "General Commands Manual". i don;t have access to a linux system, but maybe groff classes mdoc pages as BSD by default, or maybe your linux distro does. jmc