C structures are usually detailled in the man page of the feature or function they're most associated with. For instance:
- The
struct sockaddr
structure is defined in bind(2)
(system call).
- The
struct utmp
structure is defined in utmp(5)
(file formats: utmp).
It is also not specifically required from developers to provide details about their structures in man pages, since this is basically the job of nicely-commented header files (see /usr/include
).
In general, if you're looking for details about a structure, have a look at the function you're using it for. For instance, if you want to know more about asctime
's argument (struct tm
), just have a look at asctime
's man page. Most structures come with a set of functions used to manipulate them, and these usually have a man page. If there is no function associated to your structure, here are a few options:
- The structure is closely related to a concept (e.g.
struct sockaddr_un
for UNIX sockets). Have a look at the man page associated to that concept (here, unix(7)
).
- The structure is associated to a file, or is used to parse this file (e.g.
struct utmp
) : have a look at this file's man page if it has any (here, utmp(5)
).
- The structure does not seem to be documented in any man page, have a look at the header file it is defined in. Here is the example of
struct ifaddrs
, even though it has a man page at getifaddrs(3)
:
File: /usr/include/ifaddrs.h
struct ifaddrs
{
struct ifaddrs *ifa_next; /* Pointer to the next structure. */
char *ifa_name; /* Name of this network interface. */
unsigned int ifa_flags; /* Flags as from SIOCGIFFLAGS ioctl. */
struct sockaddr *ifa_addr; /* Network address of this interface. */
struct sockaddr *ifa_netmask; /* Netmask of this interface. */
// ...
};