Bug 217884 - libprocstat(3): multiple manpage bugs
Summary: libprocstat(3): multiple manpage bugs
Status: Closed FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-03-17 23:40 UTC by Tobias Kortkamp
Modified: 2018-04-21 11:57 UTC (History)
3 users (show)

See Also:


Attachments
libprocstat.3.diff (476 bytes, patch)
2017-03-17 23:40 UTC, Tobias Kortkamp
no flags Details | Diff
libprocstat.3.diff (1009 bytes, patch)
2017-03-18 00:02 UTC, Tobias Kortkamp
no flags Details | Diff
libprocstat.3.diff (1.25 KB, patch)
2017-03-18 00:30 UTC, Tobias Kortkamp
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Kortkamp freebsd_committer 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 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 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 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 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 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 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 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 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 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 2017-11-05 20:13:24 UTC
I think bdrewery backported this.
Comment 11 Tobias Kortkamp freebsd_committer 2018-04-21 11:57:32 UTC
Thanks. This seems to be fixed.