freebsd-dev/sys/compat
Dmitry Chagin 76f8584e49 linux(4): Don't relie on process osreldata when testing features
The ELF note identifyies the operating-system ABI that the executable
was created for. The note data of the Glibc executable contains the
earliest release number of the Linux kernel that supports this ABI.
As of a current 2.37 version of Glibc, it is 3.2.0 for x86, 3.7.0
for Aarch64.
Glibc does not use this release number and the current kernel's
LINUX_VERSION_CODE to detect kernel features, using fallbacks to known
previous way in case of ENOSYS or something else instead.

A dynamically linked Glibc reads the current kernel's LINUX_VERSION_CODE
from the ELF note in the vDSO or fallback to uname syscall if the vDSO
can't be located and parse the release field in struct utsname. Glibc
uses the current kernel's LINUX_VERSION_CODE for "kernel too old" check.

While here use inlined LINUX_KERNVER for tests to improve readability,
as suggested by emaste@.

MFC after:		1 month
2023-04-26 16:56:41 +03:00
..
freebsd32 freebsd32: Regen 2023-04-21 10:25:10 -06:00
ia32 Retire sv_transtrap 2022-05-20 14:54:03 +03:00
lindebugfs lindebugfs: Add debugfs_create_file_size() 2023-01-25 23:23:16 +01:00
linprocfs linux(4): Migrate to IfAPI 2023-03-04 12:11:38 +03:00
linsysfs linsysfs(4): Reimplement listnics() using ifAPI 2023-04-03 11:22:16 +03:00
linux linux(4): Don't relie on process osreldata when testing features 2023-04-26 16:56:41 +03:00
linuxkpi linuxkpi: Migrate to IfAPI 2023-04-24 09:54:22 -04:00
x86bios pmap_unmapdev/bios: Accept a pointer instead of a vm_offset_t. 2022-09-22 15:08:52 -07:00