Staging
v0.5.2
https://github.com/torvalds/linux
Raw File
Tip revision: 0c744ea4f77d72b3dcebb7a8f2684633ec79be88 authored by Linus Torvalds on 01 January 2017, 22:31:53 UTC
Linux 4.10-rc2
Tip revision: 0c744ea
test-glibc.c
#include <stdlib.h>

#if !defined(__UCLIBC__)
#include <gnu/libc-version.h>
#else
#define XSTR(s) STR(s)
#define STR(s) #s
#endif

int main(void)
{
#if !defined(__UCLIBC__)
	const char *version = gnu_get_libc_version();
#else
	const char *version = XSTR(__GLIBC__) "." XSTR(__GLIBC_MINOR__);
#endif

	return (long)version;
}
back to top