How to install man pages for C standard library functions in Mac OS X
Asked Answered
I

3

7

I want to see the man page of some c standard library functions in Mac OS X. When I typed in man setsockopt, it returns: No manual entry for setsockopt. Does that mean I haven't installed man pages for c standard? How should I install it?

Infare answered 22/8, 2013 at 12:46 Comment(4)
It works for me and I didn't have to install anything. What does /etc/manpaths contain?Alfredoalfresco
You need to make sure you install the BSD stuff (command line tools) when you install Xcode - how you do this depends on the version of Xcode. Please clarify which version of OS X and Xcode you are using.Gabby
/etc/manpaths contains /usr/share/man /usr/local/share/man.Mac os 10.8.4, and Xcode Version 4.6.3 (4H1503)Infare
Yeah I lied; I did install stuff; the Xcode Command Line Tools. Ooops.Alfredoalfresco
D
7

macOS is not feature complete out of the box when it comes to development. Installing the Xcode command line tools will give you what you need, as well as a compiler etc.

For macOS and newer versions of Mac OS X, installing the Command Line Tools package is done with the command xcode-select --install.

For older versions of Mac OS X you'll need to install Xcode (free in the Mac App Store) first. Then you can install the Command Line Tools module after you installed Xcode, by going into Xcode->Preferences->Downloads->Components

Dauphin answered 22/8, 2013 at 12:59 Comment(0)
N
4

The piece in all this that was missing for me was that I had previously set an environment variable MANPATH, and this did not point to all the places man pages could be found. Deleting that variable was enough to fix my problem.

Needful answered 19/7, 2019 at 5:52 Comment(0)
H
-1

You can copy a man page from another system, such as Ubuntu.

First, make sure you have a working Docker installation.

Then, use Docker to copy the man pages of the latest version of Ubuntu Linux to your host:

docker run -v $HOME/ubuntu-man:/host-ubuntu-man ubuntu:latest bash -c 'echo y | unminimize ; apt-get install -y manpages manpages-dev manpages-posix manpages-posix-dev net-tools; cp -Rf /usr/share/man/* /host-ubuntu-man'

Finally, add this line to your ~/.zshrc (if you use ZSH) or ~/.bashrc (if you use Bash):

alias lman="man -M $HOME/ubuntu-man"

At last and try our new lman command:

lman ifconfig

For more details, you can refer to this link:read-the-linux-manual-pages-on-mac-and-bsd-directly-from-the-terminal

Humidistat answered 29/1 at 1:44 Comment(1)
rigortek, a link to a solution is welcome, but please ensure your answer is useful without it: add context around the link so your fellow users will have some idea what it is and why it is there, then quote the most relevant part of the page you are linking to in case the target page is unavailable. Answers that are little more than a link may be deleted.Dispensatory

© 2022 - 2024 — McMap. All rights reserved.