mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-22 20:11:06 +01:00
libc: move __getosreldate to libsys
Reviewed by: kib, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/908
This commit is contained in:
parent
f70c5a0925
commit
10f1b536ad
@ -6,7 +6,7 @@ CONFS+= group master.passwd shells
|
||||
CONFSMODE_master.passwd= 600
|
||||
CONFSPACKAGE= runtime
|
||||
|
||||
SRCS+= __getosreldate.c \
|
||||
SRCS+= \
|
||||
__pthread_mutex_init_calloc_cb_stub.c \
|
||||
__xuname.c \
|
||||
_pthread_stubs.c \
|
||||
|
@ -32,6 +32,7 @@ PSEUDO+= _clock_gettime.o _gettimeofday.o
|
||||
# Sources common to both syscall interfaces:
|
||||
SRCS+= \
|
||||
__error.c \
|
||||
__getosreldate.c \
|
||||
_once_stub.c \
|
||||
getpagesize.c \
|
||||
getpagesizes.c \
|
||||
|
@ -44,23 +44,10 @@ int
|
||||
__getosreldate(void)
|
||||
{
|
||||
static int osreldate;
|
||||
size_t len;
|
||||
int oid[2];
|
||||
int error, osrel;
|
||||
|
||||
if (osreldate != 0)
|
||||
return (osreldate);
|
||||
|
||||
error = _elf_aux_info(AT_OSRELDATE, &osreldate, sizeof(osreldate));
|
||||
if (error == 0 && osreldate != 0)
|
||||
return (osreldate);
|
||||
|
||||
oid[0] = CTL_KERN;
|
||||
oid[1] = KERN_OSRELDATE;
|
||||
osrel = 0;
|
||||
len = sizeof(osrel);
|
||||
error = sysctl(oid, 2, &osrel, &len, NULL, 0);
|
||||
if (error == 0 && osrel > 0 && len == sizeof(osrel))
|
||||
osreldate = osrel;
|
||||
(void)_elf_aux_info(AT_OSRELDATE, &osreldate, sizeof(osreldate));
|
||||
return (osreldate);
|
||||
}
|
Loading…
Reference in New Issue
Block a user