macosunixmanpage

Install C standard library man pages on macOS


I recently updated the 2020 M1 Macbook pro I use for school to macOS Ventura, 13.4.1. Since then, I haven't been able to access C standard library man pages from the terminal. Any idea how I can regain access to the man pages?

For example, typing 'man 2 exit' just returns 'no manual entry for exit'. I have downloaded homebrew and xcode, but just downloading these resources hasn't fixed the problem.

Edit: I meant 'man 3 exit'.


Solution

  • The pages you're looking for are distributed with Xcode. man finds them using xcode-select --show-manpaths, so try running that to see if everything is installed correctly. On my machine, the exit(3) page is in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/share/man/man3/exit.3.

    How do I know that? Well, man is open source. You can go look at how it works. (And it's just a shell script.)

    Also useful, you can pass -d (or -dd) to get information about where man is looking for things and where it find them.

    My guess is that xcode-select isn't set up properly. It might point to some uninstalled version. In that case use xcode-select -s to set the correct version as default. If you use multiple versions of Xcode, I highly recommend Xcodes.app, which does a great job of maintaining that correctly.