1. 2.5 Suggestion (Bob Craig)

How much trouble would it be to change the platform value for FREEBSD 
it's different from the LINUX value?

For some things, like getting information using read_proc(), Linux and 
FreeBSD are quite different, so distinguishing between them would be 
handy.

-Ron T.

new topic     » topic index » view message » categorize

2. Re: 2.5 Suggestion (Bob Craig)

Ron Tarrant wrote:
> How much trouble would it be to change the platform value for FREEBSD 
> it's different from the LINUX value?

It would break a lot of code.
I thought about this carefully when I ported to FreeBSD.
At first I was going to have a new platform() value.
Then I noticed that in almost every case, Linux code
would run without change on FreeBSD, provided the
platform() value was the same. So I made it the same.
 
> For some things, like getting information using read_proc(), Linux and 
> FreeBSD are quite different, so distinguishing between them would be 
> handy.

I guess you'll have to use some other test to 
make your code work on both Linux and FreeBSD.
Maybe test directly to see if a .so exists
or not, or look at the values returned from
a library call, etc.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

3. Re: 2.5 Suggestion (Bob Craig)

Ron Tarrant wrote:
> 
> How much trouble would it be to change the platform value for FREEBSD 
> it's different from the LINUX value?
> 
> For some things, like getting information using read_proc(), Linux and 
> FreeBSD are quite different, so distinguishing between them would be 
> handy.

I don't know if this is universal, but there's an evironment variable
$OSTYPE which returns linux-gnu on my (Mandrake) machine.

Irv

new topic     » goto parent     » topic index » view message » categorize

4. Re: 2.5 Suggestion (Bob Craig)

irv mullins wrote:
> 
> 
> Ron Tarrant wrote:
> > 
> > How much trouble would it be to change the platform value for FREEBSD 
> > it's different from the LINUX value?
> > 
> > For some things, like getting information using read_proc(), Linux and 
> > FreeBSD are quite different, so distinguishing between them would be 
> > handy.
> 
> I don't know if this is universal, but there's an evironment variable
> $OSTYPE which returns linux-gnu on my (Mandrake) machine.

Might also try uname - it returns linux here.

Irv

new topic     » goto parent     » topic index » view message » categorize

5. Re: 2.5 Suggestion (Bob Craig)

On Sat, 05 Jun 2004 13:34:58 -0700, irv mullins
<guest at RapidEuphoria.com> wrote:

>Ron Tarrant wrote:
>> 
>> How much trouble would it be to change the platform value for FREEBSD 
>> it's different from the LINUX value?
>> 
>> For some things, like getting information using read_proc(), Linux and 
>> FreeBSD are quite different, so distinguishing between them would be 
>> handy.
>
>I don't know if this is universal, but there's an evironment variable
>$OSTYPE which returns linux-gnu on my (Mandrake) machine.

It's been a while, and I no longer have unix installed, but you could
easily check: I think uname (as in eg system("uname>tmp.txt")) will
give you what you need. Try man uname, as well, obviously.

Regards,
Pete

new topic     » goto parent     » topic index » view message » categorize

6. Re: 2.5 Suggestion (Bob Craig)

I'm sure that this has been suggeted before, but how about adding a
subplatform() function. This could return 1 for Linux and 2 for FreeBSD,
with new values defind when Eu is ported to other compatible Unix flavors.
For Dos and Windows where the issue is inapplicable, subplatform() would
return 0.

-- Mike Nelson

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu