[done] What to import to use gnu_get_libc_version function?

Linux specific forum
User avatar
Kukulkan
Addict
Addict
Posts: 1396
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

[done] What to import to use gnu_get_libc_version function?

Post by Kukulkan »

Hi,

I like to find the libc version (2.14, 2.15 etc) of the Linux machine I'm running on using PureBasic.

I wanted to use like this:

Code: Select all

Protected libcVersion.s = gnu_get_libc_version_()
But it is not available. What do I need to import to get this? No, I don't want to do a comandline call :-)

Thanks,

Kukulkan
Last edited by Kukulkan on Thu Apr 23, 2015 11:45 am, edited 1 time in total.
infratec
Always Here
Always Here
Posts: 7662
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: What to import to use gnu_get_libc_version() function?

Post by infratec »

Hi,

this works for me:

Code: Select all

ImportC "-lc"
  gnu_get_libc_version()
  gnu_get_libc_release()
EndImport

Debug PeekS(gnu_get_libc_version(), -1, #PB_UTF8)
Debug PeekS(gnu_get_libc_release(), -1, #PB_UTF8)
Bernd
User avatar
bbanelli
Enthusiast
Enthusiast
Posts: 544
Joined: Tue May 28, 2013 10:51 pm
Location: Europe
Contact:

Re: What to import to use gnu_get_libc_version() function?

Post by bbanelli »

infratec wrote:Hi,

this works for me:

Code: Select all

ImportC "-lc"
  gnu_get_libc_version()
  gnu_get_libc_release()
EndImport

Debug PeekS(gnu_get_libc_version(), -1, #PB_UTF8)
Debug PeekS(gnu_get_libc_release(), -1, #PB_UTF8)
Bernd
I can confirm it on Ubuntu too, it works, however, IMO, their versioning is quite bizarre. For some reason, the current version is 2.21, which is actually preceded by all natural numbers up to 3, where it has "normal" nomenclature such as 2.3.x. That being said, for example, version 2.8 is actually older than 2.21, etc. - but there is no build/revision designation. Strange people, those penguins...
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/
User avatar
Kukulkan
Addict
Addict
Posts: 1396
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: What to import to use gnu_get_libc_version() function?

Post by Kukulkan »

Thanks infratec! Works fine for me :-)

Kind regards,

Kukulkan
Post Reply