diff options
| author | Brooks Davis <brooks@FreeBSD.org> | 2023-11-17 20:13:40 +0000 |
|---|---|---|
| committer | Brooks Davis <brooks@FreeBSD.org> | 2024-02-05 20:34:56 +0000 |
| commit | 10f1b536ad71fddc725da58d9e30a42fa66d183c (patch) | |
| tree | 05a672653fa6b7a6a4858e886717827dfbed6284 | |
| parent | f70c5a0925c621ce862327a1f335394e731fbaed (diff) | |
libc: move __getosreldate to libsys
Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908
| -rw-r--r-- | lib/libc/gen/Makefile.inc | 2 | ||||
| -rw-r--r-- | lib/libsys/Makefile.sys | 1 | ||||
| -rw-r--r-- | lib/libsys/__getosreldate.c (renamed from lib/libc/gen/__getosreldate.c) | 15 |
3 files changed, 3 insertions, 15 deletions
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index 6d1f98c241d4..bbd090e46b27 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -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 \ diff --git a/lib/libsys/Makefile.sys b/lib/libsys/Makefile.sys index e299396585b9..f7fd08f1702d 100644 --- a/lib/libsys/Makefile.sys +++ b/lib/libsys/Makefile.sys @@ -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 \ diff --git a/lib/libc/gen/__getosreldate.c b/lib/libsys/__getosreldate.c index 053ec4c94a9b..0bb2efd2ba6a 100644 --- a/lib/libc/gen/__getosreldate.c +++ b/lib/libsys/__getosreldate.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); } |
