0

In the past, from time to time, while developing Linux software, I have noticed that some man pages which deal with developer documentation are missing on my systems.

This happens mainly on Debian systems. For example, yesterday I needed to use the fls() function, but man fls did not lead to anywhere, and despite researching and trying this and that, I still have no idea what I could do to install those missing man pages.

I believe that this problem is related to the fact that some functions which are available originally have been implemented on other platforms (for example, fls() seems to come from BSD. However, this finding did not help; there is no special POSIX or BSD developer documentation in Debian (at least, I couldn't find it).

Until now, I have worked around the problem by googling for man xxx, which worked (i.e. let me find the respective man page) every time. But this is crude and unsatisfying and makes me dependent on online services, so I think it's time to solve the problem.

How to install all of such documentation in recent Debian versions (notably the man pages which are not in the package glibc-doc)?

2 Answers 2

6

You should install manpages-dev, which provides manpages for system calls and a number of library functions, and the -dev and (if any) -doc packages for the libraries you’re developing with.

For kernel functions you should install linux-manual-4.9 (or whichever version is appropriate); this is where you’ll find man 9 fls.

To find manpages in general, install apt-file, update the indexes (apt update), then search for the manpage you want:

apt-file search -x man./fls\\.

(the -x option tells apt-file to interpret the argument as a Perl regex).

2
  • I see. Wouldn't have come to that idea. So ffs(), which logically belongs to the same function group (these functions return the highest or lowest set bit in an integer value) is in the normal documentation of glibc, while fls() is in the kernel documentation although its man page is titled "Basic C library functions". This is completely weird. However: problem solved, answer accepted.
    – Binarus
    Feb 21, 2019 at 8:15
  • The fls manpage title is misleading, fls is a function available in the kernel, not in the C library. (On Linux at least.) Feb 21, 2019 at 8:25
1

In addition to the manpages-dev package, on Ubuntu at least there's also manpages-posix and manpages-posix-dev.

1
  • 1
    Thanks for the hint, and +1. While @Stephen Kitt mentioned manpages-dev, I still didn't know about the two others yet. I'll examine whether they exist on Debian, too, which is likely because Ubuntu is derived from Debian.
    – Binarus
    Apr 28, 2021 at 6:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.