Bug 247386

Summary: Description of the last argument of procctl is confusing
Product: Documentation Reporter: Paul Floyd <paulf>
Component: Manual PagesAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me CC: 0mp, ceri, doc, pauamma
Priority: --- Keywords: needs-patch
Version: Latest   
Hardware: Any   
OS: Any   

Description Paul Floyd 2020-06-18 18:07:54 UTC
The man page gives the following signature

int     procctl(idtype_t idtype, id_t id, int cmd,	void *arg);

(note the name of the last argument, 'arg').

In the following descriptions 'arg' is used for PROC_ASLR_CTL, PROC_ASLR_STATUS, PROC_SPROTECT. 

PROC_REAP_ACQUIRE seems not to use the 4th argument.

Then the 7 following descriptions starting with PROC_REAP_STATUS use 'data'

PROC_PDEATHSIG_STATUS switches back to 'arg'. And the last two are 'data' again.

I see that syscalls.master calls the last argument 'data', so there seems to be a mix of the signature given in the man page and the one in syscalls.master.

I think that it would be clearer to use 'arg' consistently.
Comment 1 Mateusz Piotrowski freebsd_committer freebsd_triage 2020-06-18 19:06:49 UTC
Thanks a lot for the report!
Comment 2 Pau Amma 2020-07-11 16:46:21 UTC
procctl(2) in -current seems to have settled on "data" throughout instead, except that PROC_PDEATHSIG_CTL and PROC_PDEATHSIG_STATUS still use "arg".
Comment 3 commit-hook freebsd_committer freebsd_triage 2020-07-11 18:05:03 UTC
A commit references this bug:

Author: allanjude
Date: Sat Jul 11 18:04:09 UTC 2020
New revision: 363104
URL: https://svnweb.freebsd.org/changeset/base/363104

Log:
  procctl(2): consistently refer to the last agrument as 'data'

  Some older references called it 'arg'

  Also fix a syntax error that was underlining an entire sentence.

  PR:		247386
  Reported by:	Paul Floyd <paulf@free.fr>, PauAmma (research)
  MFC after:	2 weeks
  Sponsored by:	Klara Inc.

Changes:
  head/lib/libc/sys/procctl.2
Comment 4 Ceri Davies freebsd_committer freebsd_triage 2021-06-05 22:02:28 UTC
This was MFC'd back to 12.2, so closing.