PDA

View Full Version : What version of FC3?


sl4ck3r
23rd November 2004, 03:49 PM
how can i tell what version of FC3 i have installed?

lisicky
23rd November 2004, 03:59 PM
FC3 is the version, Fedora Core version 3. If you want know kernel version, run uname -a in terminal.

jayemef
23rd November 2004, 04:22 PM
The -a argument will actually provide everything (which includes kernel). But if you want just the kernel, you would want uname -r.

ilja
23rd November 2004, 04:33 PM
cat /etc/redhat-release
will tell you the Version of your Fedora

sideways
23rd November 2004, 04:41 PM
'cat /proc/version' gives os version and gcc version :)

ghaefb
23rd November 2004, 05:11 PM
Or... you can use this simple program -> http://ghaefb.r8.org/projects.html
:p

And yes it's cat /etc/redhat-release :)

sl4ck3r
24th November 2004, 03:17 AM
cool app ghaefb and yeah, checking the contents of redhat-release is what i was looking for, thanks ilja. mine is Fedora Core release 3 (Heidelberg). so i do not have one of the test versions correct? isnt there like FC3 test 1, FC3 test 2 and so on?

ilja
24th November 2004, 07:00 AM
Yes, you have the final version (or a manipulated content of /etc/redhat-release :p )

sl4ck3r
24th November 2004, 01:49 PM
:D thanks

Pegasus
25th November 2004, 09:56 AM
@ghaefb: To make your application more independent:

Release Information File

Novell SuSE /etc/SuSE-release
Red Hat /etc/redhat-release
Fedora /etc/fedora-release
Slackware /etc/slackware-release
Debian /etc/debian_release
Mandrake /etc/mandrake-release
Yellow dog /etc/yellowdog-release
Sun JDS /etc/sun-release
Solaris/Sparc /etc/release
Gentoo /etc/gentoo-release


... the rest (meminfo, cpuinfo etc.) is still the same ;)

ghaefb
25th November 2004, 03:10 PM
Many thanks Pegasus.
That's some great info.

I'm working on it right now :)

Pegasus
26th November 2004, 04:23 PM
Hi again ;)
I've seen that there is no network information in your sysinfo application.
Might be needful, so here's the code :D

The attached picture shows how it could look like...


// taken from pvt_sysinfo.c (Pegasus-2004)
#include <stdio.h>
#include <string.h>
#include <netinet/in.h>
#include <linux/sockios.h> // ioctl
#include <net/if.h> // if_nameindex
#include <unistd.h> // gethostname

#define NIPQUAD(addr) ((unsigned char *)&addr)[0],((unsigned char *)&addr)[1], ((unsigned char *)&addr)[2], ((unsigned char *)&addr)[3]

...
char theNetworkhostname[80];
char theNetworkipLO[40];
char theNetworkipETH0[40];
char theNetworkipETH1[40];
char theNetworkipPPP0[40];
...

void pvt_getNetworkinfo()
{
char buffer[40];
char hostname[80];
int sock = 0;
struct ifreq ifreq;
struct sockaddr_in *saptr = NULL;
struct if_nameindex *iflist = NULL, *listsave = NULL;

// prepare default values
strcpy(theNetworkhostname, "host -> Unknown");
strcpy(theNetworkipLO, "lo -> Unknown");
strcpy(theNetworkipETH0, "eth0 -> Unknown");
strcpy(theNetworkipETH1, "eth1 -> Unknown");
strcpy(theNetworkipPPP0, "ppp0 -> Unknown");

// get the hostname
if (gethostname(hostname,80) == 0)
{
strcpy(theNetworkhostname,hostname);
}

// get socket for ioctl
sock = socket(AF_INET, SOCK_STREAM, 0);

//returns pointer to dynamically allocated list of structs
iflist = listsave = if_nameindex();

//walk thru the array returned and query for each interface adress
for(iflist; *(char *)iflist != 0; iflist++)
{
//copy in the interface name to look up address of
strncpy(ifreq.ifr_name, iflist->if_name, IF_NAMESIZE);

//get the address for this interface
if(ioctl(sock, SIOCGIFADDR, &ifreq) == 0)
{
//print out the address
saptr = (struct sockaddr_in *)&ifreq.ifr_addr;
sprintf(buffer,"%-5s :: %d.%d.%d.%d", ifreq.ifr_name, NIPQUAD(saptr->sin_addr.s_addr) );
if (strstr(ifreq.ifr_name,"lo"))
{
strcpy(theNetworkipLO,buffer);
}
if (strstr(ifreq.ifr_name,"eth0"))
{
strcpy(theNetworkipETH0,buffer);
}
if (strstr(ifreq.ifr_name,"eth1"))
{
strcpy(theNetworkipETH1,buffer);
}
if (strstr(ifreq.ifr_name,"ppp0"))
{
strcpy(theNetworkipPPP0,buffer);
}
}
}
//free the dynamic memory kernel allocated for us
if_freenameindex(listsave);
}

ghaefb
27th November 2004, 01:00 PM
Thanks again.
I did the release info upgrade.
I will examine this code...