From d48719bd96c9472952c05fc9fec8e3bcc82e40b6 Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Tue, 4 Dec 2018 16:48:47 +0000 Subject: [PATCH] Normalize COMPAT_43 syscall declarations. Have ogetkerninfo, ogetpagesize, ogethostname, osethostname, and oaccept declare o_args structs rather than non-compat ones. Due to a failure to use NOARGS in most cases this adds only one new declaration. No changes required in freebsd32 as only ogetpagesize() is implemented and it has a 32-bit specific implementation. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15816 --- sys/kern/kern_xxx.c | 36 +++--------------------------------- sys/kern/syscalls.master | 10 +++++----- sys/kern/uipc_syscalls.c | 4 +--- sys/vm/vm_mmap.c | 8 +------- 4 files changed, 10 insertions(+), 48 deletions(-) diff --git a/sys/kern/kern_xxx.c b/sys/kern/kern_xxx.c index 9db3b439589a..c170d4dbe29d 100644 --- a/sys/kern/kern_xxx.c +++ b/sys/kern/kern_xxx.c @@ -50,15 +50,8 @@ __FBSDID("$FreeBSD$"); #if defined(COMPAT_43) -#ifndef _SYS_SYSPROTO_H_ -struct gethostname_args { - char *hostname; - u_int len; -}; -#endif -/* ARGSUSED */ int -ogethostname(struct thread *td, struct gethostname_args *uap) +ogethostname(struct thread *td, struct ogethostname_args *uap) { int name[2]; size_t len = uap->len; @@ -69,15 +62,8 @@ ogethostname(struct thread *td, struct gethostname_args *uap) 1, 0, 0, 0, 0)); } -#ifndef _SYS_SYSPROTO_H_ -struct sethostname_args { - char *hostname; - u_int len; -}; -#endif -/* ARGSUSED */ int -osethostname(struct thread *td, struct sethostname_args *uap) +osethostname(struct thread *td, struct osethostname_args *uap) { int name[2]; @@ -104,15 +90,7 @@ ogethostid(struct thread *td, struct ogethostid_args *uap) return (kernel_sysctl(td, name, 2, (long *)td->td_retval, &len, NULL, 0, NULL, 0)); } -#endif /* COMPAT_43 */ -#ifdef COMPAT_43 -#ifndef _SYS_SYSPROTO_H_ -struct osethostid_args { - long hostid; -}; -#endif -/* ARGSUSED */ int osethostid(struct thread *td, struct osethostid_args *uap) { @@ -187,16 +165,8 @@ static struct { */ static char bsdi_strings[80]; /* It had better be less than this! */ -#ifndef _SYS_SYSPROTO_H_ -struct getkerninfo_args { - int op; - char *where; - size_t *size; - int arg; -}; -#endif int -ogetkerninfo(struct thread *td, struct getkerninfo_args *uap) +ogetkerninfo(struct thread *td, struct ogetkerninfo_args *uap) { int error, name[6]; size_t size; diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index 384f297dac27..469ed918b29e 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -453,10 +453,10 @@ _Inout_opt_ size_t *size, int arg ); - } getkerninfo getkerninfo_args int + } 64 AUE_NULL COMPAT { int getpagesize(void); - } getpagesize getpagesize_args int + } 65 AUE_MSYNC STD { int msync( _In_ void *addr, @@ -570,13 +570,13 @@ _Out_writes_z_(len) char *hostname, u_int len ); - } gethostname gethostname_args int + } 88 AUE_SYSCTL COMPAT { int sethostname( _In_reads_z_(len) char *hostname, u_int len ); - } sethostname sethostname_args int + } 89 AUE_GETDTABLESIZE STD { int getdtablesize(void); } @@ -638,7 +638,7 @@ _Out_writes_bytes_opt_(*anamelen) struct sockaddr *name, int *anamelen ); - } accept accept_args int + } 100 AUE_GETPRIORITY STD { int getpriority( int which, diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 202d5c868de4..b86f041c54ef 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -455,9 +455,7 @@ sys_accept4(td, uap) #ifdef COMPAT_OLDSOCK int -oaccept(td, uap) - struct thread *td; - struct accept_args *uap; +oaccept(struct thread *td, struct oaccept_args *uap) { return (accept1(td, uap->s, uap->name, uap->anamelen, diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index e8772a1eadde..c767d33151af 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -129,14 +129,8 @@ sys_sstk(struct thread *td, struct sstk_args *uap) } #if defined(COMPAT_43) -#ifndef _SYS_SYSPROTO_H_ -struct getpagesize_args { - int dummy; -}; -#endif - int -ogetpagesize(struct thread *td, struct getpagesize_args *uap) +ogetpagesize(struct thread *td, struct ogetpagesize_args *uap) { td->td_retval[0] = PAGE_SIZE;