9 #include <sys/syslog.h>
10 #include <sys/utsname.h>
13 #define UTS_RELEASE "0.0.0"
17 #define RTLD_NEXT ((void *) -1l)
20 typedef int (*uname_t) (struct utsname * buf);
22 static void *get_libc_func(const char *funcname)
27 func = dlsym(RTLD_NEXT, funcname);
28 if ((error = dlerror()) != NULL) {
29 fprintf(stderr, "Can't locate libc function `%s' error: %s", funcname, error);
35 int uname(struct utsname *buf)
39 uname_t real_uname = (uname_t) get_libc_func("uname");
41 ret = real_uname((struct utsname *) buf);
42 strncpy(buf->release, ((env = getenv("UTS_RELEASE")) == NULL) ? UTS_RELEASE : env, 65);