Bug 247386 - Description of the last argument of procctl is confusing
Summary: Description of the last argument of procctl is confusing
Status: Closed FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
Keywords: needs-patch
Depends on:
Reported: 2020-06-18 18:07 UTC by Paul Floyd
Modified: 2021-06-05 22:02 UTC (History)
4 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
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 2020-06-18 19:06:49 UTC
Thanks a lot for the report!
Comment 2 PauAmma freebsd_triage 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 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

  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.

Comment 4 Ceri Davies freebsd_committer 2021-06-05 22:02:28 UTC
This was MFC'd back to 12.2, so closing.