1. 2.5 Suggestion (Bob Craig)
- Posted by Ron Tarrant <rtarrant at sympatico.ca> Jun 05, 2004
- 418 views
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.
2. Re: 2.5 Suggestion (Bob Craig)
- Posted by Robert Craig <rds at RapidEuphoria.com> Jun 05, 2004
- 412 views
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
3. Re: 2.5 Suggestion (Bob Craig)
- Posted by irv mullins <irvm at ellijay.com> Jun 05, 2004
- 399 views
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
4. Re: 2.5 Suggestion (Bob Craig)
- Posted by irv mullins <irvm at ellijay.com> Jun 05, 2004
- 407 views
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
5. Re: 2.5 Suggestion (Bob Craig)
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Jun 05, 2004
- 403 views
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
6. Re: 2.5 Suggestion (Bob Craig)
- Posted by "Mike Nelson" <MichaelANelson at worldnet.att.net> Jun 06, 2004
- 419 views
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