简体   繁体   English

如何查找C结构的手册页(struct sockaddr_in)?

[英]How to find man pages for C structs (struct sockaddr_in)?

I am having a hard time finding man pages for the structures used in socket. 我很难找到插座中使用的结构的手册页。 So I am currently learning about them from a separate online tutorial. 所以我目前正在通过单独的在线教程了解它们。 But it would be nice to know how to lookup these structures in the man pages itself. 但是知道如何在手册页中查找这些结构会很好。

I am using a Debian 8.3 Linux system. 我使用的是Debian 8.3 Linux系统。

For example, I found information about struct addrinfo in man getaddrinfo . 例如,我在man getaddrinfo找到了有关struct addrinfo信息。

But I have not been able to find information about struct sockaddr_in in any man page. 但我无法在任何手册页中找到有关struct sockaddr_in信息。 Which man page contains the details about this struct? 哪个手册页包含有关此结构的详细信息? And how to find out the man pages for such structures in general? 如何找到一般这类结构的手册页?

You can find that specific structure by typing man 7 ip and then searching manually for it or pressing / and typing sockaddr_in . 您可以通过键入man 7 ip然后手动搜索它或按/并键入sockaddr_in来找到该特定结构。

If you don't know what section to look in you can try using a quick search with man -k sockaddr_in . 如果您不知道要查看哪个部分,可以尝试使用man -k sockaddr_in进行快速搜索。 If that doesn't give you the result you are looking for try brute-forcing it with man -K sockaddr_in , this might be very slow because it will scan all the man files on your system. 如果这没有给你结果你正在寻找尝试用man -K sockaddr_in强制它,这可能会非常慢,因为它会扫描你系统上的所有 man文件。

@Jean-FrançoisFabre his comment about using a search engine is probably the fastest way to find the information you want though. @ Jean-FrançoisFabre他关于使用搜索引擎的评论可能是找到你想要的信息的最快方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM