Subject: lib/30503: swapctl(2) prototype does not match corresponding syscall
To: None <lib-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <njoly@pasteur.fr>
List: netbsd-bugs
Date: 06/11/2005 22:32:00
>Number:         30503
>Category:       lib
>Synopsis:       swapctl(2) prototype does not match corresponding syscall
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 11 22:32:00 +0000 2005
>Originator:     Nicolas Joly
>Release:        NetBSD 3.99.5
>Organization:
Institut Pasteur, Paris.
>Environment:
System: NetBSD cixy.dial.pasteur.fr 3.99.5 NetBSD 3.99.5 (CIXY) #10: Wed Jun 8 09:09:00 CEST 2005 njoly@cixy.dial.pasteur.fr:/local/src/NetBSD/obj/i386/sys/arch/i386/compile/CIXY i386
Architecture: i386
Machine: i386
>Description:
swapctl(2) prototype does not match corresponding syscall entry. The second
argument is both defined as `const void *' and `void *':

njoly@cixy [NetBSD/src]> grep swapctl include/unistd.h
int      swapctl(int, const void *, int);
int      swapon(const char *);                  /* obsoleted by swapctl() */
njoly@cixy [NetBSD/src]> grep swapctl sys/kern/syscalls.master 
271     STD             { int sys_swapctl(int cmd, void *arg, int misc); }

The swapctl(2) man page define the second argument as `void *', like in
syscall.master file.

>How-To-Repeat:
Run lint(1) on the following piece of code:

njoly@cixy [tmp/lint]> cat check.c 
#include <unistd.h>
#include <sys/swap.h>

int main() { return 0; }

njoly@cixy [tmp/lint]> lint -chapbxzF check.c
check.c:
Lint pass2:
swapctl, arg 2 declared inconsistently          llib-lc.ln :: check.c?(1)

>Fix:
n/a