linux(4): Use inlined LINUX_KERNVER for tests to improve readability
MFC after: 1 month
This commit is contained in:
parent
76f8584e49
commit
e185d83fc4
@ -513,7 +513,7 @@ __linuxN(copyout_auxargs)(struct image_params *imgp, uintptr_t base)
|
|||||||
* is not present.
|
* is not present.
|
||||||
* Also see linux_times() implementation.
|
* Also see linux_times() implementation.
|
||||||
*/
|
*/
|
||||||
if (linux_kernver(curthread) >= LINUX_KERNVER_2004000)
|
if (linux_kernver(td) >= LINUX_KERNVER(2,4,0))
|
||||||
AUXARGS_ENTRY(pos, LINUX_AT_CLKTCK, stclohz);
|
AUXARGS_ENTRY(pos, LINUX_AT_CLKTCK, stclohz);
|
||||||
AUXARGS_ENTRY(pos, AT_PAGESZ, args->pagesz);
|
AUXARGS_ENTRY(pos, AT_PAGESZ, args->pagesz);
|
||||||
AUXARGS_ENTRY(pos, AT_PHDR, args->phdr);
|
AUXARGS_ENTRY(pos, AT_PHDR, args->phdr);
|
||||||
|
@ -57,12 +57,6 @@ int linux_kernver(struct thread *td);
|
|||||||
#define LINUX_XKERNVERSTR(x) LINUX_KERNVERSTR(x)
|
#define LINUX_XKERNVERSTR(x) LINUX_KERNVERSTR(x)
|
||||||
#define LINUX_VERSION_STR LINUX_XKERNVERSTR(LINUX_KVERSION.LINUX_KPATCHLEVEL.LINUX_KSUBLEVEL)
|
#define LINUX_VERSION_STR LINUX_XKERNVERSTR(LINUX_KVERSION.LINUX_KPATCHLEVEL.LINUX_KSUBLEVEL)
|
||||||
|
|
||||||
#define LINUX_KERNVER_2004000 LINUX_KERNVER(2,4,0)
|
|
||||||
#define LINUX_KERNVER_2006039 LINUX_KERNVER(2,6,39)
|
|
||||||
#define LINUX_KERNVER_5004000 LINUX_KERNVER(5,4,0)
|
|
||||||
|
|
||||||
#define linux_use54(t) (linux_kernver(t) >= LINUX_KERNVER_5004000)
|
|
||||||
|
|
||||||
extern int linux_debug;
|
extern int linux_debug;
|
||||||
extern int linux_default_openfiles;
|
extern int linux_default_openfiles;
|
||||||
extern int linux_default_stacksize;
|
extern int linux_default_stacksize;
|
||||||
|
@ -384,7 +384,7 @@ struct l_times_argv {
|
|||||||
#define CONVOTCK(r) (r.tv_sec * CLK_TCK + r.tv_usec / (1000000 / CLK_TCK))
|
#define CONVOTCK(r) (r.tv_sec * CLK_TCK + r.tv_usec / (1000000 / CLK_TCK))
|
||||||
#define CONVNTCK(r) (r.tv_sec * stclohz + r.tv_usec / (1000000 / stclohz))
|
#define CONVNTCK(r) (r.tv_sec * stclohz + r.tv_usec / (1000000 / stclohz))
|
||||||
|
|
||||||
#define CONVTCK(r) (linux_kernver(td) >= LINUX_KERNVER_2004000 ? \
|
#define CONVTCK(r) (linux_kernver(td) >= LINUX_KERNVER(2,4,0) ? \
|
||||||
CONVNTCK(r) : CONVOTCK(r))
|
CONVNTCK(r) : CONVOTCK(r))
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -850,7 +850,7 @@ linux_waitid(struct thread *td, struct linux_waitid_args *args)
|
|||||||
idtype = P_PID;
|
idtype = P_PID;
|
||||||
break;
|
break;
|
||||||
case LINUX_P_PGID:
|
case LINUX_P_PGID:
|
||||||
if (linux_use54(td) && args->id == 0) {
|
if (linux_kernver(td) >= LINUX_KERNVER(5,4,0) && args->id == 0) {
|
||||||
p = td->td_proc;
|
p = td->td_proc;
|
||||||
PROC_LOCK(p);
|
PROC_LOCK(p);
|
||||||
id = p->p_pgid;
|
id = p->p_pgid;
|
||||||
|
@ -776,7 +776,7 @@ lsiginfo_to_siginfo(struct thread *td, const l_siginfo_t *lsi,
|
|||||||
|
|
||||||
switch (lsi->lsi_code) {
|
switch (lsi->lsi_code) {
|
||||||
case LINUX_SI_TKILL:
|
case LINUX_SI_TKILL:
|
||||||
if (linux_kernver(td) >= LINUX_KERNVER_2006039) {
|
if (linux_kernver(td) >= LINUX_KERNVER(2,6,39)) {
|
||||||
linux_msg(td, "SI_TKILL forbidden since 2.6.39");
|
linux_msg(td, "SI_TKILL forbidden since 2.6.39");
|
||||||
return (EPERM);
|
return (EPERM);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user