Date: Tue, 7 Dec 2004 00:04:22 EST-10EDT,10,-1,0,7200,3,-1,0,7200,3600 Subject: [UnixOS2_Archive] No. 469 ************************************************** Monday 06 December 2004 Number 469 ************************************************** Subjects for today 1 uname.c : Dave Saville" 2 Re: uname.c : Tobias Huerlimann 3 Re: uname.c : Tobias Huerlimann 4 Re: uname.c : John Poltorak 5 Re: uname.c : Yuri Dario" 6 Re: uname.c : John Poltorak 7 Re: uname.c : Stefan.Neis at t-online.de 8 Re: uname.c : Dave Saville" 9 Re: uname.c : Yuri Dario" 10 Re: uname.c : Dave Yeo" 11 Anyone built Jade : lsunley at mb.sympatico.ca 12 Re: Anyone built Jade : Dave Yeo" 13 Re: uname.c : Dave Saville" **= Email 1 ==========================** Date: Sun, 05 Dec 2004 19:24:10 +0000 (GMT) From: "Dave Saville" Subject: uname.c Anyone know where I can find the source of uname? Or how do I find the same info? Basically I need to find the hostname and its possible ip addresses. I know how to do the last bit, but I am stumped on getting *my* hostname. I can't rely on an environmental being set as it is sometimes. I need the c code for uname -n TIA -- Regards Dave Saville **= Email 2 ==========================** Date: Sun, 05 Dec 2004 21:10:22 +0100 From: Tobias Huerlimann Subject: Re: uname.c Dave Saville wrote: > Anyone know where I can find the source of uname? > > Or how do I find the same info? Basically I need to find the hostname > and its possible ip addresses. I know how to do the last bit, but I > am stumped on getting *my* hostname. I can't rely on an environmental > being set as it is sometimes. I need the c code for uname -n Hm, uname seems to **= Email 3 ==========================** Date: Sun, 05 Dec 2004 21:18:01 +0100 From: Tobias Huerlimann Subject: Re: uname.c [Sorry for the first, empty mail, accidently hit the "Send" button. Damn Ctrl-Enter in Thunderbird!] Dave Saville wrote: > Anyone know where I can find the source of uname? > > Or how do I find the same info? Basically I need to find the hostname > and its possible ip addresses. I know how to do the last bit, but I > am stumped on getting *my* hostname. I can't rely on an environmental > being set as it is sometimes. I need the c code for uname -n > > TIA Hm, on BSD the "uname" program seems to use a libc function uname(), which itself gets its values from a sysctl() call. uname program source: http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/uname/ uname() libc call is here (see uname.c): http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/gen/ This uname function seems to be present in OS/2 GCC as well, refer to the "utsname.h" header in include/sys. The output of "uname -n" is the "nodename" string in "struct utsname". I haven't tried if it actually works, but maybe this solves your problem. Hope it helps, Tobias Huerlimman **= Email 4 ==========================** Date: Sun, 5 Dec 2004 20:20:26 +0000 From: John Poltorak Subject: Re: uname.c On Sun, Dec 05, 2004 at 07:24:10PM +0000, Dave Saville wrote: > Anyone know where I can find the source of uname? GNU Shell Utilities:- ftp://ftp.gnu.org/pub/gnu/sh-utils/sh-utils-1.12.tar.gz or newer... > TIA > > -- > Regards > > Dave Saville > -- John **= Email 5 ==========================** Date: Sun, 05 Dec 2004 21:36:56 +0100 (CET) From: "Yuri Dario" Subject: Re: uname.c Hi, >GNU Shell Utilities:- now merged in the GNU Core Utilities. Bye, Yuri Dario /* * member of TeamOS/2 - Italy * http://www.os2power.com/yuri * http://www.teamos2.it */ **= Email 6 ==========================** Date: Sun, 5 Dec 2004 21:27:22 +0000 From: John Poltorak Subject: Re: uname.c On Sun, Dec 05, 2004 at 09:36:56PM +0100, Yuri Dario wrote: > Hi, > > >GNU Shell Utilities:- > > now merged in the GNU Core Utilities. Hmmm.... I wonder how far anyone could expect to get in trying to build the Core Utilities using gcc 3.3.5... We've fallen quite a way behind with the File, Shell and Text Utilities. It would be nice to get bang up to date. > > Bye, > > Yuri Dario > > /* > * member of TeamOS/2 - Italy > * http://www.os2power.com/yuri > * http://www.teamos2.it > */ -- John **= Email 7 ==========================** Date: Sun, 5 Dec 2004 23:20:02 +0100 From: Stefan.Neis at t-online.de Subject: Re: uname.c Hi, > Or how do I find the same info? Basically I need to find the hostname > and its possible ip addresses. I know how to do the last bit, but I > am stumped on getting *my* hostname. I can't rely on an environmental > being set as it is sometimes. I need the c code for uname -n char hostname[128]; gethostname(hostname, sizeof(hostname)); printf("%s", hostname); Is that, what you're looking for? Regards, Stefan **= Email 8 ==========================** Date: Sun, 05 Dec 2004 22:33:14 +0000 (GMT) From: "Dave Saville" Subject: Re: uname.c Thanks guys - seems to be what I need. -- Regards Dave Saville **= Email 9 ==========================** Date: Mon, 06 Dec 2004 00:30:50 +0100 (CET) From: "Yuri Dario" Subject: Re: uname.c On Sun, 5 Dec 2004 21:27:22 +0000, John Poltorak wrote: >Hmmm.... I wonder how far anyone could expect to get in trying to build >the Core Utilities using gcc 3.3.5... We've fallen quite a way behind with it builds, the real problem is to merge the patches made for earlier releases to support OS/2 EA (and other). Bye, Yuri Dario /* * member of TeamOS/2 - Italy * http://www.os2power.com/yuri * http://www.teamos2.it */ **= Email 10 ==========================** Date: Sun, 05 Dec 2004 16:29:59 -0800 From: "Dave Yeo" Subject: Re: uname.c On Sun, 5 Dec 2004 21:27:22 +0000, John Poltorak wrote: >On Sun, Dec 05, 2004 at 09:36:56PM +0100, Yuri Dario wrote: >> Hi, >> >> >GNU Shell Utilities:- >> >> now merged in the GNU Core Utilities. > >Hmmm.... I wonder how far anyone could expect to get in trying to build >the Core Utilities using gcc 3.3.5... We've fallen quite a way behind with >the File, Shell and Text Utilities. It would be nice to get bang up to >date. I built the file utilities (to have a working ln) without much problem but they need quite a bit of patching. EA support, wildcard support, backslash support and doing ls / (and others) gives a file name to long error Dave **= Email 11 ==========================** Date: Sun, 05 Dec 2004 23:35:13 -0500 From: lsunley at mb.sympatico.ca Subject: Anyone built Jade Does anyone here have a build of Jade? The URL is http://www.jclark.com/jade/ When I try it with GCC 3.3.5 I get a number of errors. The makefiles have a comment for os/2 but the compiler referenced is 2.92 Thanks Lorne -- ----------------------------------------------------------- lsunley at mb.sympatico.ca ----------------------------------------------------------- **= Email 12 ==========================** Date: Sun, 05 Dec 2004 22:23:00 -0800 From: "Dave Yeo" Subject: Re: Anyone built Jade On Sun, 05 Dec 2004 23:35:13 -0500, lsunley at mb.sympatico.ca wrote: >Does anyone here have a build of Jade? > >The URL is >http://www.jclark.com/jade/ > >When I try it with GCC 3.3.5 I get a number of errors. > >The makefiles have a comment for os/2 but the compiler referenced is 2.92 Have you tried the experimental autoconf support? The guy adding the autoconf support is interested in feedback and patches. Also maybe just use 2.95.3 (I take it 2.92 is a typo). In my experience 2.95.3 is the most stable EMX compiler after the included 2.8.1 Dave **= Email 13 ==========================** Date: Mon, 06 Dec 2004 07:35:09 +0000 (GMT) From: "Dave Saville" Subject: Re: uname.c On Sun, 5 Dec 2004 23:20:02 +0100, Stefan.Neis at t-online.de wrote: >char hostname[128]; gethostname(hostname, sizeof(hostname)); printf("%s", hostname); Thats odd - I tried that and it failed - said it was (null) Now it works and I have not rebooted. Wonder if my mucking about set something? -- Regards Dave Saville