Staging
v0.5.1
https://github.com/torvalds/linux
Raw File
Tip revision: 6eaae198076080886b9e7d57f4ae06fa782f90ef authored by Linus Torvalds on 23 July 2023, 22:24:10 UTC
Linux 6.5-rc3
Tip revision: 6eaae19
test-glibc.c
// SPDX-License-Identifier: GPL-2.0
#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