[Bug 217884] libprocstat(3): Synopsis is missing an #include

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Mar 17 23:40:41 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217884

            Bug ID: 217884
           Summary: libprocstat(3): Synopsis is missing an #include
           Product: Documentation
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Keywords: patch
          Severity: Affects Only Me
          Priority: ---
         Component: Documentation
          Assignee: freebsd-doc at FreeBSD.org
          Reporter: tobik at freebsd.org

Created attachment 180918
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=180918&action=edit
libprocstat.3.diff

libprocstat(3) says to include these three headers, but this simple
program fails to compile:

#include <sys/param.h>
#include <sys/queue.h>
#include <libprocstat.h>
int main(int argc, char *argv[]) {}

/usr/include/libprocstat.h:154:26: error: field has incomplete type
      'struct sockaddr_storage'
        struct sockaddr_storage sa_local;       /* Socket address. */
                                ^
/usr/include/libprocstat.h:154:9: note: forward declaration of
      'struct sockaddr_storage'
        struct sockaddr_storage sa_local;       /* Socket address. */
               ^
/usr/include/libprocstat.h:155:26: error: field has incomplete type
      'struct sockaddr_storage'
        struct sockaddr_storage sa_peer;        /* Peer address. */
                                ^
/usr/include/libprocstat.h:154:9: note: forward declaration of
      'struct sockaddr_storage'
        struct sockaddr_storage sa_local;       /* Socket address. */
               ^
2 errors generated.

Clearly more headers are needed and the documentation is incomplete.
Since adding sys/_sockaddr_storage.h is probably wrong, we could
add sys/user.h, netinet/in.h, or sys/socket.h.

procstat(1)'s sources all include sys/user.h, so I suspect that it is
the header that is missing.  sys/user.h already includes sys/queue.h,
so it is maybe not needed?

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-doc mailing list