TIL: Number in man page titles (e.g. sleep(3))

If you do Linux systems programming, you will have likely pored over man pages, either on the command line or, my personal preference, using the excellent man7.org or linux.die.net. I’ve always seen the numbers in sleep(3) and read(2) and idly wondered what they meant, but never actually bothered to look them up. That is, until a review comment on a pull request: // Behaves like man 2 basename reviewer: nit: it’s not a syscall, so “man 2” is incorrect So I looked it up. The answer was in the man(1) page (also accessible via the delightful man man command): The table below shows the section numbers of the manual followed by the types of pages they contain. 1 Executable programs or shell commands 2 System calls (functions provided by the kernel) 3 Library calls (functions within program libraries) (... less common section numbers) So my colleague was right and the code should have read // behaves like man 3 basename as basename(3) is a libc library call.

Lalit Maganti

My favorite piece of man trivia is from the source of the tunefs BSD man page, which contains:

.\" Take this out and a Unix Daemon will dog your steps from now until
.\" the time_t's wrap around.
.Pp
You can tune a file system, but you cannot tune a fish.

https://github.com/freebsd/freebsd-src/blob/main/sbin/tunefs...

freebsd-src/sbin/tunefs/tunefs.8 at main · freebsd/freebsd-src

The FreeBSD src tree publish-only repository. Experimenting with 'simple' pull requests.... - freebsd/freebsd-src

GitHub
I guess the joke is you can scale a file system or a fish, but can only tune a file system?
Tuna is a type of fish so the joke is that they sound the same.
There was also the record You Can Tune a Piano, but You Can't Tuna Fish by REO Speedwagon, I had assumed that's what the tunefs man page was referencing as that was a best-selling record at around the time Unix was being developed.
Yes. It had been a popular joke in the US, I believe about a generation before. (Probably the joke came in around the same time as canned tuna.)
You can tune a fish, it's that the command for that is fish_config instead.