Normalize COMPAT_43 syscall declarations.

Have ogetkerninfo, ogetpagesize, ogethostname, osethostname, and oaccept
declare o<foo>_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
This commit is contained in:
brooks 2018-12-04 16:48:47 +00:00
parent 6b63037a39
commit 3456e102d5
4 changed files with 10 additions and 48 deletions

View File

@ -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;

View File

@ -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,

View File

@ -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,

View File

@ -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;