Bug 217884

Summary: libprocstat(3): multiple manpage bugs
Product: Documentation Reporter: Tobias Kortkamp <tobik>
Component: Manual PagesAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Some People CC: brooks, doc, ngie
Priority: --- Keywords: patch
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
libprocstat.3.diff
none
libprocstat.3.diff
none
libprocstat.3.diff none

Description Tobias Kortkamp freebsd_committer freebsd_triage 2017-03-17 23:40:41 UTC
Created attachment 180918 [details]
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?
Comment 1 Tobias Kortkamp freebsd_committer freebsd_triage 2017-03-18 00:02:16 UTC
Created attachment 180920 [details]
libprocstat.3.diff

Small update: Both procstat_{getenvv,getargv} prototypes are wrong.  They don't take an errbuf argument.
Comment 2 Tobias Kortkamp freebsd_committer freebsd_triage 2017-03-18 00:30:06 UTC
Created attachment 180921 [details]
libprocstat.3.diff

... and a typo: procstat_freeenv -> procstat_freeenvv
Comment 3 Enji Cooper freebsd_committer freebsd_triage 2017-07-22 16:05:19 UTC
I'll commit the individual patches -- once done, please submit a PR for any other doc bugs you might find with libprocstat(3). Thanks!
Comment 4 commit-hook freebsd_committer freebsd_triage 2017-07-29 22:16:22 UTC
A commit references this bug:

Author: ngie
Date: Sat Jul 29 22:16:05 UTC 2017
New revision: 321704
URL: https://svnweb.freebsd.org/changeset/base/321704

Log:
  Add sys/socket.h to SYNOPSIS for libprocstat(3)

  sys/socket.h is required for procstat_get_socket_info(3), added in
  r221807.

  MFC after:	1 month
  PR:		217884
  Submitted by:	tobik

Changes:
  head/lib/libprocstat/libprocstat.3
Comment 5 commit-hook freebsd_committer freebsd_triage 2017-07-29 22:19:27 UTC
A commit references this bug:

Author: ngie
Date: Sat Jul 29 22:19:00 UTC 2017
New revision: 321705
URL: https://svnweb.freebsd.org/changeset/base/321705

Log:
  libprocstat(3): fix reference (typo) to procstat_freeenvv in description for
  procstat_getargv(3)

  PR:		217884
  MFC after:	1 month
  Submitted by:	tobik

Changes:
  head/lib/libprocstat/libprocstat.3
Comment 6 commit-hook freebsd_committer freebsd_triage 2017-07-29 22:26:34 UTC
A commit references this bug:

Author: ngie
Date: Sat Jul 29 22:25:45 UTC 2017
New revision: 321706
URL: https://svnweb.freebsd.org/changeset/base/321706

Log:
  libprocstat(3): fix arguments list for procstat_getargv(3) and procstat_getenvv(3)

  Neither libcall takes a fourth argument (`char *errbuf`).

  PR:		217884
  Submitted by:	tobik
  MFC after:	1 month

Changes:
  head/lib/libprocstat/libprocstat.3
Comment 7 commit-hook freebsd_committer freebsd_triage 2017-09-08 04:46:08 UTC
A commit references this bug:

Author: ngie
Date: Fri Sep  8 04:45:19 UTC 2017
New revision: 323301
URL: https://svnweb.freebsd.org/changeset/base/323301

Log:
  MFC r321704,r321705,r321706:

  r321704:

  Add sys/socket.h to SYNOPSIS for libprocstat(3)

  sys/socket.h is required for procstat_get_socket_info(3), added in
  r221807.

  PR:		217884

  r321705:

  libprocstat(3): fix reference (typo) to procstat_freeenvv in description for
  procstat_getargv(3)

  PR:		217884

  r321706:

  libprocstat(3): fix arguments list for procstat_getargv(3) and procstat_getenvv(3)

  Neither libcall takes a fourth argument (`char *errbuf`).

  PR:		217884

Changes:
_U  stable/11/
  stable/11/lib/libprocstat/libprocstat.3
Comment 8 commit-hook freebsd_committer freebsd_triage 2017-09-08 04:46:10 UTC
A commit references this bug:

Author: ngie
Date: Fri Sep  8 04:45:19 UTC 2017
New revision: 323301
URL: https://svnweb.freebsd.org/changeset/base/323301

Log:
  MFC r321704,r321705,r321706:

  r321704:

  Add sys/socket.h to SYNOPSIS for libprocstat(3)

  sys/socket.h is required for procstat_get_socket_info(3), added in
  r221807.

  PR:		217884

  r321705:

  libprocstat(3): fix reference (typo) to procstat_freeenvv in description for
  procstat_getargv(3)

  PR:		217884

  r321706:

  libprocstat(3): fix arguments list for procstat_getargv(3) and procstat_getenvv(3)

  Neither libcall takes a fourth argument (`char *errbuf`).

  PR:		217884

Changes:
_U  stable/11/
  stable/11/lib/libprocstat/libprocstat.3
Comment 9 commit-hook freebsd_committer freebsd_triage 2017-09-08 04:46:12 UTC
A commit references this bug:

Author: ngie
Date: Fri Sep  8 04:45:19 UTC 2017
New revision: 323301
URL: https://svnweb.freebsd.org/changeset/base/323301

Log:
  MFC r321704,r321705,r321706:

  r321704:

  Add sys/socket.h to SYNOPSIS for libprocstat(3)

  sys/socket.h is required for procstat_get_socket_info(3), added in
  r221807.

  PR:		217884

  r321705:

  libprocstat(3): fix reference (typo) to procstat_freeenvv in description for
  procstat_getargv(3)

  PR:		217884

  r321706:

  libprocstat(3): fix arguments list for procstat_getargv(3) and procstat_getenvv(3)

  Neither libcall takes a fourth argument (`char *errbuf`).

  PR:		217884

Changes:
_U  stable/11/
  stable/11/lib/libprocstat/libprocstat.3
Comment 10 Enji Cooper freebsd_committer freebsd_triage 2017-11-05 20:13:24 UTC
I think bdrewery backported this.
Comment 11 Tobias Kortkamp freebsd_committer freebsd_triage 2018-04-21 11:57:32 UTC
Thanks. This seems to be fixed.