freebsd32: remove redundent osig*() implementations

ofreebsd32_sigprocmask, ofreebsd32_sigblock, ofreebsd32_sigsetmask,
and ofreebsd32_sigsuspend were all duplicates of the default ABI
versions and there are no type concerns as all arguments are the
same.

Reviewed by:	kevans
This commit is contained in:
Brooks Davis 2021-11-17 20:12:25 +00:00
parent dbb47e9264
commit 1de34945f4
6 changed files with 16 additions and 85 deletions

View File

@ -2688,19 +2688,6 @@ ofreebsd32_sigaction(struct thread *td,
return (error);
}
int
ofreebsd32_sigprocmask(struct thread *td,
struct ofreebsd32_sigprocmask_args *uap)
{
sigset_t set, oset;
int error;
OSIG2SIG(uap->mask, set);
error = kern_sigprocmask(td, uap->how, &set, &oset, SIGPROCMASK_OLD);
SIG2OSIG(oset, td->td_retval[0]);
return (error);
}
struct sigvec32 {
u_int32_t sv_handler;
int sv_mask;
@ -2741,40 +2728,6 @@ ofreebsd32_sigvec(struct thread *td,
return (error);
}
int
ofreebsd32_sigblock(struct thread *td,
struct ofreebsd32_sigblock_args *uap)
{
sigset_t set, oset;
OSIG2SIG(uap->mask, set);
kern_sigprocmask(td, SIG_BLOCK, &set, &oset, 0);
SIG2OSIG(oset, td->td_retval[0]);
return (0);
}
int
ofreebsd32_sigsetmask(struct thread *td,
struct ofreebsd32_sigsetmask_args *uap)
{
sigset_t set, oset;
OSIG2SIG(uap->mask, set);
kern_sigprocmask(td, SIG_SETMASK, &set, &oset, 0);
SIG2OSIG(oset, td->td_retval[0]);
return (0);
}
int
ofreebsd32_sigsuspend(struct thread *td,
struct ofreebsd32_sigsuspend_args *uap)
{
sigset_t mask;
OSIG2SIG(uap->mask, mask);
return (kern_sigsuspend(td, mask));
}
struct sigstack32 {
u_int32_t ss_sp;
int ss_onstack;

View File

@ -910,10 +910,6 @@ struct ofreebsd32_sigaction_args {
char nsa_l_[PADL_(struct osigaction32 *)]; struct osigaction32 * nsa; char nsa_r_[PADR_(struct osigaction32 *)];
char osa_l_[PADL_(struct osigaction32 *)]; struct osigaction32 * osa; char osa_r_[PADR_(struct osigaction32 *)];
};
struct ofreebsd32_sigprocmask_args {
char how_l_[PADL_(int)]; int how; char how_r_[PADR_(int)];
char mask_l_[PADL_(osigset_t)]; osigset_t mask; char mask_r_[PADR_(osigset_t)];
};
struct ofreebsd32_fstat_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char sb_l_[PADL_(struct ostat32 *)]; struct ostat32 * sb; char sb_r_[PADR_(struct ostat32 *)];
@ -934,15 +930,6 @@ struct ofreebsd32_sigvec_args {
char nsv_l_[PADL_(struct sigvec32 *)]; struct sigvec32 * nsv; char nsv_r_[PADR_(struct sigvec32 *)];
char osv_l_[PADL_(struct sigvec32 *)]; struct sigvec32 * osv; char osv_r_[PADR_(struct sigvec32 *)];
};
struct ofreebsd32_sigblock_args {
char mask_l_[PADL_(int)]; int mask; char mask_r_[PADR_(int)];
};
struct ofreebsd32_sigsetmask_args {
char mask_l_[PADL_(int)]; int mask; char mask_r_[PADR_(int)];
};
struct ofreebsd32_sigsuspend_args {
char mask_l_[PADL_(int)]; int mask; char mask_r_[PADR_(int)];
};
struct ofreebsd32_sigstack_args {
char nss_l_[PADL_(struct sigstack32 *)]; struct sigstack32 * nss; char nss_r_[PADR_(struct sigstack32 *)];
char oss_l_[PADL_(struct sigstack32 *)]; struct sigstack32 * oss; char oss_r_[PADR_(struct sigstack32 *)];
@ -972,14 +959,10 @@ int ofreebsd32_lseek(struct thread *, struct ofreebsd32_lseek_args *);
int ofreebsd32_stat(struct thread *, struct ofreebsd32_stat_args *);
int ofreebsd32_lstat(struct thread *, struct ofreebsd32_lstat_args *);
int ofreebsd32_sigaction(struct thread *, struct ofreebsd32_sigaction_args *);
int ofreebsd32_sigprocmask(struct thread *, struct ofreebsd32_sigprocmask_args *);
int ofreebsd32_fstat(struct thread *, struct ofreebsd32_fstat_args *);
int ofreebsd32_mmap(struct thread *, struct ofreebsd32_mmap_args *);
int ofreebsd32_sigreturn(struct thread *, struct ofreebsd32_sigreturn_args *);
int ofreebsd32_sigvec(struct thread *, struct ofreebsd32_sigvec_args *);
int ofreebsd32_sigblock(struct thread *, struct ofreebsd32_sigblock_args *);
int ofreebsd32_sigsetmask(struct thread *, struct ofreebsd32_sigsetmask_args *);
int ofreebsd32_sigsuspend(struct thread *, struct ofreebsd32_sigsuspend_args *);
int ofreebsd32_sigstack(struct thread *, struct ofreebsd32_sigstack_args *);
int ofreebsd32_getdirentries(struct thread *, struct ofreebsd32_getdirentries_args *);
@ -1322,7 +1305,6 @@ int freebsd11_freebsd32_fstatat(struct thread *, struct freebsd11_freebsd32_fsta
#define FREEBSD32_SYS_AUE_ofreebsd32_stat AUE_STAT
#define FREEBSD32_SYS_AUE_ofreebsd32_lstat AUE_LSTAT
#define FREEBSD32_SYS_AUE_ofreebsd32_sigaction AUE_SIGACTION
#define FREEBSD32_SYS_AUE_ofreebsd32_sigprocmask AUE_SIGPROCMASK
#define FREEBSD32_SYS_AUE_freebsd32_sigaltstack AUE_SIGALTSTACK
#define FREEBSD32_SYS_AUE_freebsd32_ioctl AUE_IOCTL
#define FREEBSD32_SYS_AUE_freebsd32_execve AUE_EXECVE
@ -1335,9 +1317,6 @@ int freebsd11_freebsd32_fstatat(struct thread *, struct freebsd11_freebsd32_fsta
#define FREEBSD32_SYS_AUE_freebsd32_select AUE_SELECT
#define FREEBSD32_SYS_AUE_ofreebsd32_sigreturn AUE_SIGRETURN
#define FREEBSD32_SYS_AUE_ofreebsd32_sigvec AUE_O_SIGVEC
#define FREEBSD32_SYS_AUE_ofreebsd32_sigblock AUE_O_SIGBLOCK
#define FREEBSD32_SYS_AUE_ofreebsd32_sigsetmask AUE_O_SIGSETMASK
#define FREEBSD32_SYS_AUE_ofreebsd32_sigsuspend AUE_SIGSUSPEND
#define FREEBSD32_SYS_AUE_ofreebsd32_sigstack AUE_O_SIGSTACK
#define FREEBSD32_SYS_AUE_freebsd32_gettimeofday AUE_GETTIMEOFDAY
#define FREEBSD32_SYS_AUE_freebsd32_getrusage AUE_GETRUSAGE

View File

@ -53,7 +53,7 @@
#define FREEBSD32_SYS_ktrace 45
/* 46 is old freebsd32_sigaction */
#define FREEBSD32_SYS_getgid 47
/* 48 is old freebsd32_sigprocmask */
/* 48 is old sigprocmask */
#define FREEBSD32_SYS_getlogin 49
#define FREEBSD32_SYS_setlogin 50
#define FREEBSD32_SYS_acct 51
@ -112,9 +112,9 @@
#define FREEBSD32_SYS_listen 106
/* 107 is obsolete vtimes */
/* 108 is old freebsd32_sigvec */
/* 109 is old freebsd32_sigblock */
/* 110 is old freebsd32_sigsetmask */
/* 111 is old freebsd32_sigsuspend */
/* 109 is old sigblock */
/* 110 is old sigsetmask */
/* 111 is old sigsuspend */
/* 112 is old freebsd32_sigstack */
/* 113 is obsolete orecvmsg */
/* 114 is obsolete osendmsg */

View File

@ -57,7 +57,7 @@ const char *freebsd32_syscallnames[] = {
"ktrace", /* 45 = ktrace */
"compat.freebsd32_sigaction", /* 46 = old freebsd32_sigaction */
"getgid", /* 47 = getgid */
"compat.freebsd32_sigprocmask", /* 48 = old freebsd32_sigprocmask */
"compat.sigprocmask", /* 48 = old sigprocmask */
"getlogin", /* 49 = getlogin */
"setlogin", /* 50 = setlogin */
"acct", /* 51 = acct */
@ -118,9 +118,9 @@ const char *freebsd32_syscallnames[] = {
"listen", /* 106 = listen */
"obs_vtimes", /* 107 = obsolete vtimes */
"compat.freebsd32_sigvec", /* 108 = old freebsd32_sigvec */
"compat.freebsd32_sigblock", /* 109 = old freebsd32_sigblock */
"compat.freebsd32_sigsetmask", /* 110 = old freebsd32_sigsetmask */
"compat.freebsd32_sigsuspend", /* 111 = old freebsd32_sigsuspend */
"compat.sigblock", /* 109 = old sigblock */
"compat.sigsetmask", /* 110 = old sigsetmask */
"compat.sigsuspend", /* 111 = old sigsuspend */
"compat.freebsd32_sigstack", /* 112 = old freebsd32_sigstack */
"obs_orecvmsg", /* 113 = obsolete orecvmsg */
"obs_osendmsg", /* 114 = obsolete osendmsg */

View File

@ -110,7 +110,7 @@ struct sysent freebsd32_sysent[] = {
{ .sy_narg = AS(ktrace_args), .sy_call = (sy_call_t *)sys_ktrace, .sy_auevent = AUE_KTRACE, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 45 = ktrace */
{ compat(AS(ofreebsd32_sigaction_args),freebsd32_sigaction), .sy_auevent = AUE_SIGACTION, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 46 = old freebsd32_sigaction */
{ .sy_narg = 0, .sy_call = (sy_call_t *)sys_getgid, .sy_auevent = AUE_GETGID, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 47 = getgid */
{ compat(AS(ofreebsd32_sigprocmask_args),freebsd32_sigprocmask), .sy_auevent = AUE_SIGPROCMASK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 48 = old freebsd32_sigprocmask */
{ compat(AS(osigprocmask_args),sigprocmask), .sy_auevent = AUE_SIGPROCMASK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 48 = old sigprocmask */
{ .sy_narg = AS(getlogin_args), .sy_call = (sy_call_t *)sys_getlogin, .sy_auevent = AUE_GETLOGIN, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 49 = getlogin */
{ .sy_narg = AS(setlogin_args), .sy_call = (sy_call_t *)sys_setlogin, .sy_auevent = AUE_SETLOGIN, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 50 = setlogin */
{ .sy_narg = AS(acct_args), .sy_call = (sy_call_t *)sys_acct, .sy_auevent = AUE_ACCT, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 51 = acct */
@ -171,9 +171,9 @@ struct sysent freebsd32_sysent[] = {
{ .sy_narg = AS(listen_args), .sy_call = (sy_call_t *)sys_listen, .sy_auevent = AUE_LISTEN, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 106 = listen */
{ .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 107 = obsolete vtimes */
{ compat(AS(ofreebsd32_sigvec_args),freebsd32_sigvec), .sy_auevent = AUE_O_SIGVEC, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 108 = old freebsd32_sigvec */
{ compat(AS(ofreebsd32_sigblock_args),freebsd32_sigblock), .sy_auevent = AUE_O_SIGBLOCK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 109 = old freebsd32_sigblock */
{ compat(AS(ofreebsd32_sigsetmask_args),freebsd32_sigsetmask), .sy_auevent = AUE_O_SIGSETMASK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 110 = old freebsd32_sigsetmask */
{ compat(AS(ofreebsd32_sigsuspend_args),freebsd32_sigsuspend), .sy_auevent = AUE_SIGSUSPEND, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 111 = old freebsd32_sigsuspend */
{ compat(AS(osigblock_args),sigblock), .sy_auevent = AUE_O_SIGBLOCK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 109 = old sigblock */
{ compat(AS(osigsetmask_args),sigsetmask), .sy_auevent = AUE_O_SIGSETMASK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 110 = old sigsetmask */
{ compat(AS(osigsuspend_args),sigsuspend), .sy_auevent = AUE_SIGSUSPEND, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 111 = old sigsuspend */
{ compat(AS(ofreebsd32_sigstack_args),freebsd32_sigstack), .sy_auevent = AUE_O_SIGSTACK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 112 = old freebsd32_sigstack */
{ .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 113 = obsolete orecvmsg */
{ .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 114 = obsolete osendmsg */

View File

@ -142,8 +142,7 @@
struct osigaction32 *nsa, \
struct osigaction32 *osa); }
47 AUE_GETGID NOPROTO { gid_t getgid(void); }
48 AUE_SIGPROCMASK COMPAT { int freebsd32_sigprocmask(int how, \
osigset_t mask); }
48 AUE_SIGPROCMASK COMPAT|NOPROTO { int sigprocmask(int how, osigset_t mask); }
49 AUE_GETLOGIN NOPROTO { int getlogin(char *namebuf, \
u_int namelen); }
50 AUE_SETLOGIN NOPROTO { int setlogin(const char *namebuf); }
@ -235,9 +234,9 @@
108 AUE_O_SIGVEC COMPAT { int freebsd32_sigvec(int signum, \
struct sigvec32 *nsv, \
struct sigvec32 *osv); }
109 AUE_O_SIGBLOCK COMPAT { int freebsd32_sigblock(int mask); }
110 AUE_O_SIGSETMASK COMPAT { int freebsd32_sigsetmask( int mask); }
111 AUE_SIGSUSPEND COMPAT { int freebsd32_sigsuspend( int mask); }
109 AUE_O_SIGBLOCK COMPAT|NOPROTO { int sigblock(int mask); }
110 AUE_O_SIGSETMASK COMPAT|NOPROTO { int sigsetmask(int mask); }
111 AUE_SIGSUSPEND COMPAT|NOPROTO { int sigsuspend( int mask); }
112 AUE_O_SIGSTACK COMPAT { int freebsd32_sigstack( \
struct sigstack32 *nss, \
struct sigstack32 *oss); }