Date: Thu, 25 Nov 2004 00:04:21 EST-10EDT,10,-1,0,7200,3,-1,0,7200,3600 Subject: [UnixOS2_Archive] No. 457 ************************************************** Wednesday 24 November 2004 Number 457 ************************************************** Subjects for today 1 Re: Network Time Protocol : Knut St. Osmundsen" 2 Re: setsid() ?? : Dave Yeo" 3 Re: No controlling tty : Dave Yeo" 4 Re: setsid() ?? : John Poltorak 5 Re: No controlling tty : John Poltorak 6 Re: System V Semaphore emulation : Knut St. Osmundsen" 7 Re: setsid() ?? : Knut St. Osmundsen" 8 Recently accessed files : John Poltorak 9 Re: No controlling tty : John Poltorak 10 imake crashing on fork with libc : Dave Yeo" 11 Re: No controlling tty : Dave Yeo" 12 Re: No controlling tty : John Poltorak 13 Re: setsid() ?? : Stefan.Neis at t-online.de **= Email 1 ==========================** Date: Tue, 23 Nov 2004 14:05:50 +0100 From: "Knut St. Osmundsen" Subject: Re: Network Time Protocol John Poltorak wrote: > On Tue, Nov 23, 2004 at 10:27:13AM +0000, John Poltorak wrote: > >>Is there an OS/2 port of the Network Time Protocol daemon? >> >>NTP is one of the most important programs on the Internet and it would be >>nice to get it to build on OS/2. It would also show how Posix compliant >>OS/2 can be. >> >>If anyone wants to have a look at it, the source is here:- >> >>ftp://ftp.udel.edu/pub/ntp/ntp4/ntp-4.2.0.tar.gz > > > I gave it a try and here's what happened? > > > Making all in libntp > make[2]: Entering directory `U:/ux2bs/workdir/ntp-4.2.0/libntp' > source='systime.c' object='systime.o' libtool=no \ > depfile='.deps/systime.Po' tmpdepfile='.deps/systime.TPo' \ > depmode=gcc u:/bin/sh ../depcomp \ > gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall > -Wcast-qual -Wmissing-prototypes -Wpointer-arith -Wshadow > -Wstrict-prototypes -c `test -f 'systime.c' || echo './'`systime.c > In file included from ..\include\ntp_fp.h:10, > from systime.c:8: > ..\include\ntp_rfc2553.h:177: redefinition of `struct sockaddr_storage' > systime.c: In function `adj_systime': > systime.c:139: warning: implicit declaration of function `adjtime' > make[2]: *** [systime.o] Error 1 > make[2]: Leaving directory `U:/ux2bs/workdir/ntp-4.2.0/libntp' > make[1]: *** [all-recursive] Error 1 > make[1]: Leaving directory `U:/ux2bs/workdir/ntp-4.2.0' > make: *** [all] Error 2 Guess that was to be expected. I saw adjtime the other day when I was working on setitimer. Shouldn't be hard to do that one. Seeing that adjtime() is not present on Linux (but it is on BSD) I would've expected there to be some alternative codepaths. Could you check that out and when I look into the time stuff I could implement them all. And as always, if anyone happens to have an implementation of adjtime() somewhere don't be afraid to mail it to me. :-) Kind Regards, knut **= Email 2 ==========================** Date: Tue, 23 Nov 2004 07:07:19 -0800 From: "Dave Yeo" Subject: Re: setsid() ?? On Tue, 23 Nov 2004 07:28:25 +1000, Paul Smedley wrote: >Anyway, am building with UX2BS - configure ran fine, ran make - got >errors due to missing syslog.h - thought this would have been in >/include already but wasn't... copied over syslog.h, syslog.a & >syslog.lib from my EMX setup - added -lsyslog to makefile and now stuck >with setsid() > >Whilst I'm tempted just to comment out the setsid code from below - is >there a 'standard' workaround for this? Setsid() is a strange one here. It is defined in unistd.h (make sure you have a #include and is in c.lib and c_import.lib I've had this error appear and disappear by simply changing the optimization. Often I just comment it out. One idea is to try adding -lc_import to your ldflags or do a SET LIBS=-lc_import before running configure Dave **= Email 3 ==========================** Date: Tue, 23 Nov 2004 07:07:53 -0800 From: "Dave Yeo" Subject: Re: No controlling tty On Sun, 21 Nov 2004 20:14:29 +0000, John Poltorak wrote: > >The way PDKSH gets built is a real mess which I would like to tidy up at >some point. If you are currently installing UX2BS the system may well have >built PDKSH by now so you could take a look to see what I mean. > >As far as the requirement for Innotek is concerned, I'm developing a new >UX2BS based around gcc 3.3.5 instead of 2.8.1 and have managed to get >PDKSH built automatically under that, although it requires a modified diff >file. Well there will most likely need to quite a few changes, right of I see you don't need CFLAGS -Dstrncasecmp=strnicmp -Dstrcasecmp=stricmp as Innotek includes strcasecmp etc. At that it looks like pdksh includes these. Also I doubt we need to worry about running under Windows (RSX). I tried building pdksh and had errors related to _emx_env which seems to only be used in the DOS (not supported) and RSX areas. At the end I still had a few unresolved symbols. Need to find time to play with it more. Dave **= Email 4 ==========================** Date: Tue, 23 Nov 2004 15:25:38 +0000 From: John Poltorak Subject: Re: setsid() ?? On Tue, Nov 23, 2004 at 07:07:19AM -0800, Dave Yeo wrote: > On Tue, 23 Nov 2004 07:28:25 +1000, Paul Smedley wrote: > > >Anyway, am building with UX2BS - configure ran fine, ran make - got > >errors due to missing syslog.h - thought this would have been in > >/include already but wasn't... copied over syslog.h, syslog.a & > >syslog.lib from my EMX setup - added -lsyslog to makefile and now stuck > >with setsid() > > > >Whilst I'm tempted just to comment out the setsid code from below - is > >there a 'standard' workaround for this? > > Setsid() is a strange one here. It is defined in unistd.h (make sure you have a #include and is in c.lib and c_import.lib > I've had this error appear and disappear by simply changing the optimization. Often I just comment it out. > One idea is to try adding -lc_import to your ldflags or do a > SET LIBS=-lc_import > before running configure I don't think this should be necessary when using UX2BS since it enables Posix/2 by default which runs a different version of gcc that assumes those settings, if I'm not mistaken... Stefan would be able to clarify. > Dave -- John **= Email 5 ==========================** Date: Tue, 23 Nov 2004 15:21:18 +0000 From: John Poltorak Subject: Re: No controlling tty On Tue, Nov 23, 2004 at 07:07:53AM -0800, Dave Yeo wrote: > On Sun, 21 Nov 2004 20:14:29 +0000, John Poltorak wrote: > > > > >The way PDKSH gets built is a real mess which I would like to tidy up at > >some point. If you are currently installing UX2BS the system may well have > >built PDKSH by now so you could take a look to see what I mean. > > > >As far as the requirement for Innotek is concerned, I'm developing a new > >UX2BS based around gcc 3.3.5 instead of 2.8.1 and have managed to get > >PDKSH built automatically under that, although it requires a modified diff > >file. > > Well there will most likely need to quite a few changes, right of I see you don't need CFLAGS -Dstrncasecmp=strnicmp -Dstrcasecmp=stricmp as Innotek includes strcasecmp etc. At that it looks like pdksh includes these. Also I doubt we need to worry about running under Windows (RSX). > I tried building pdksh and had errors related to _emx_env which seems to only be used in the DOS (not supported) and RSX areas. At the end I still had a few unresolved symbols. Need to find time to play with it more. With PDKSH I've made a few changes to enable it to build under GCC 3.3.5 but those changes aren't specific to GCC so I will add them to the normal UX2BS diffs. Maybe you can try rebuuilding it when the new patch is available... > Dave -- John **= Email 6 ==========================** Date: Tue, 23 Nov 2004 18:29:04 +0100 From: "Knut St. Osmundsen" Subject: Re: System V Semaphore emulation Andrew MacIntyre wrote: > On Mon, 22 Nov 2004, Knut St. Osmundsen wrote: > > >>Sys V sems means semctl(), semget(), semop(), right? If so, that's on >>the todo list for LIBC. If someone have some half decent code for this, >>please tell me. Same goes for the the simple shared memory interface >>(not the one using filehandles and mmap). > > > The big trap with these, as far as I understand, is that they are > persistent - ie they survive after all referencing processes die, and can > be picked up later by new processes. This applies to the Sys V shared > memory (shm*()) and message queues as well. > > What I've read of the CP docs suggest to me that OS/2's semaphores and > shared memory don't match these semantics, disappearing after the last > referencing process dies. > > Venuto's implementation uses a daemon process to implement these > semantics on OS/2; FreeBSD & Solaris use kernel modules (Linux may do this > too). Interesting, didn't know about that aspect of the ipc stuff. OTOH I'm not sure if SuS/Posix specifies it that way. It's quite possible that they leave this behaviour open. In any case I don't wanna have a wine solution with a libc daemon if it can be helped, nor do I wanna have resources which aren't automatically cleaned up when we exit a process. The [shm|msg|sem]ctl(,IPC_RMID,) calls can be implemented although OS/2 doesn't support removing any shared resource from all processes (officially anyway). This might mean that the semaphore implementation won't be very fast for instance. Will have to ponder this a bit more... Kind Regards, knut **= Email 7 ==========================** Date: Tue, 23 Nov 2004 18:30:03 +0100 From: "Knut St. Osmundsen" Subject: Re: setsid() ?? I'm very curious about how setsid() could be implemented on OS/2. But to my disapointment I couldn't find it in the posix2 cvs.... Kind Regards, knut John Poltorak wrote: > On Tue, Nov 23, 2004 at 07:07:19AM -0800, Dave Yeo wrote: > >>On Tue, 23 Nov 2004 07:28:25 +1000, Paul Smedley wrote: >> >> >>>Anyway, am building with UX2BS - configure ran fine, ran make - got >>>errors due to missing syslog.h - thought this would have been in >>>/include already but wasn't... copied over syslog.h, syslog.a & >>>syslog.lib from my EMX setup - added -lsyslog to makefile and now stuck >>>with setsid() >>> >>>Whilst I'm tempted just to comment out the setsid code from below - is >>>there a 'standard' workaround for this? >> >>Setsid() is a strange one here. It is defined in unistd.h (make sure you have a #include and is in c.lib and c_import.lib >>I've had this error appear and disappear by simply changing the optimization. Often I just comment it out. >>One idea is to try adding -lc_import to your ldflags or do a >>SET LIBS=-lc_import >>before running configure > > > I don't think this should be necessary when using UX2BS since it enables > Posix/2 by default which runs a different version of gcc that assumes > those settings, if I'm not mistaken... Stefan would be able to clarify. > > >>Dave > > > **= Email 8 ==========================** Date: Tue, 23 Nov 2004 19:20:32 +0000 From: John Poltorak Subject: Recently accessed files This is probably obvious to all you long time Unix gurus, but since I've never really delved into GNU Find until now I've never been aware of a really neat way of finding which files have been accessed recently... To find all the files on the current drive which have been accessed within the last hour, run this:- find / -amin -60 -print I guess it only works on HPFS (and JFS) drives. -- John **= Email 9 ==========================** Date: Tue, 23 Nov 2004 19:40:21 +0000 From: John Poltorak Subject: Re: No controlling tty On Tue, Nov 23, 2004 at 03:21:18PM +0000, John Poltorak wrote: > On Tue, Nov 23, 2004 at 07:07:53AM -0800, Dave Yeo wrote: > > >As far as the requirement for Innotek is concerned, I'm developing a new > > >UX2BS based around gcc 3.3.5 instead of 2.8.1 and have managed to get > > >PDKSH built automatically under that, although it requires a modified diff > > >file. > > > > Well there will most likely need to quite a few changes, right of I see you don't need CFLAGS -Dstrncasecmp=strnicmp -Dstrcasecmp=stricmp as Innotek includes strcasecmp etc. At that it looks like pdksh includes these. Also I doubt we need to worry about running under Windows (RSX). > > I tried building pdksh and had errors related to _emx_env which seems to only be used in the DOS (not supported) and RSX areas. At the end I still had a few unresolved symbols. Need to find time to play with it more. > > With PDKSH I've made a few changes to enable it to build under GCC 3.3.5 > but those changes aren't specific to GCC so I will add them to the normal > UX2BS diffs. > > Maybe you can try rebuuilding it when the new patch is available... If you run ux2_refresh you should pull in the changes I've made for building PDKSH, although be sure to save build.table if you have made any changes yourself. I'd be interested to know how you get on with building PDKSH... You may well need to delete sh.exe from \bin and \usr\bin first. And if you have gcc 3.3.5 installed, it would also be interesting to see if PDKSH builds with that... > > Dave -- John **= Email 10 ==========================** Date: Tue, 23 Nov 2004 17:18:17 -0800 From: "Dave Yeo" Subject: imake crashing on fork with libc Hi attempting to build XFree86 the first step (after cleaning) is to build imake and create makefiles. Imake segfaults, Process terminated by SIGILL - pid=0x4c35 - tid=0x01 - R:\TMP\IMAKE.EXE So I built a debug version and ran it thru sd386. This shows imake dieing when forking, pid=fork() which goes to an illegal instruction in libc Exception-IllegalInstruction At 1313E444. Dave **= Email 11 ==========================** Date: Tue, 23 Nov 2004 20:50:48 -0800 From: "Dave Yeo" Subject: Re: No controlling tty On Tue, 23 Nov 2004 19:40:21 +0000, John Poltorak wrote: >> Maybe you can try rebuuilding it when the new patch is available... > >If you run ux2_refresh you should pull in the changes I've made for >building PDKSH, although be sure to save build.table if you have made any >changes yourself. > >I'd be interested to know how you get on with building PDKSH... You may >well need to delete sh.exe from \bin and \usr\bin first. Hi John. ran ux2_refresh then after deleting workdir/pdksh-5.2.14 ran lib/build ksh. I saw quite a few problems with the patching process such as patching file `./os2/os2.c' Reversed (or previously applied) patch detected! Assume -R? [n] Apply anyway? [n] Skipping patch. 7 out of 7 hunks ignored -- saving rejects to ./os2/os2.c.rej The build went fine besides the install failing due to sh.exe in use, which it was. Deleting /usr/bin/sh.exe seems to stop the build command from working Ran make check and got Total failed: 72 (69 unexpected) Total passed: 126 with over 20 sys3175s popping up. Using the sh from pdksh-5.2.14-bin I get Total failed: 42 (39 unexpected) Total passed: 156 with no 3175s > >And if you have gcc 3.3.5 installed, it would also be interesting to see >if PDKSH builds with that... Ok, it built fine but after make check I get Total failed: 97 (94 unexpected) Total passed: 101 with no 3175s. For setting up libc I just ran /usr/bin/gccenv Dave **= Email 12 ==========================** Date: Wed, 24 Nov 2004 09:54:58 +0000 From: John Poltorak Subject: Re: No controlling tty On Tue, Nov 23, 2004 at 08:50:48PM -0800, Dave Yeo wrote: > On Tue, 23 Nov 2004 19:40:21 +0000, John Poltorak wrote: > > >> Maybe you can try rebuuilding it when the new patch is available... > > > >If you run ux2_refresh you should pull in the changes I've made for > >building PDKSH, although be sure to save build.table if you have made any > >changes yourself. > > > >I'd be interested to know how you get on with building PDKSH... You may > >well need to delete sh.exe from \bin and \usr\bin first. > > Hi John. ran ux2_refresh then after deleting workdir/pdksh-5.2.14 ran lib/build ksh. > I saw quite a few problems with the patching process such as > patching file `./os2/os2.c' > Reversed (or previously applied) patch detected! Assume -R? [n] > Apply anyway? [n] > Skipping patch. > 7 out of 7 hunks ignored -- saving rejects to ./os2/os2.c.rej This is probably because I have removed pdksh pre-processing:- \unixos2\scripts\pre-process\pdksh but the rsync refresh does not delete redundant files so on your system this step has been run. > The build went fine besides the install failing due to sh.exe in use, which it was. Deleting /usr/bin/sh.exe seems to stop the build command from working Actually.... there is another sh in \unixos2\bin from the initial baseline set of apps - the ones required to do anything at all in the first place. It is my aim to make this directory redundant as early as possible in the UX2BS installation process and remove it from %PATH%. > Ran make check and got > Total failed: 72 (69 unexpected) > Total passed: 126 > with over 20 sys3175s popping up. > Using the sh from pdksh-5.2.14-bin I get > Total failed: 42 (39 unexpected) > Total passed: 156 > with no 3175s I hadn't actually run make check before but this suggests that the sh.exe built using Posix/2 is not as reliable, although I'm quite surprised at the number of failed tests in the 'good' version. Not really sure what to make of all that. Should I backout the changes just made for the pdksh build? > >And if you have gcc 3.3.5 installed, it would also be interesting to see > >if PDKSH builds with that... > > Ok, it built fine but after make check I get > Total failed: 97 (94 unexpected) > Total passed: 101 :-(... > with no 3175s. Well that's better, at least > For setting up libc I just ran /usr/bin/gccenv > Dave > > Thanks for the feedback. -- John **= Email 13 ==========================** Date: Wed, 24 Nov 2004 11:28:39 +0100 From: Stefan.Neis at t-online.de Subject: Re: setsid() ?? Hi, > Looking through \unixos2\posix2\lib\cExt.lib I do see a reference to > setsid - maybe Stefan can shed some light on whether it should get picked > up by make.. "nm cExt.a | grep setsid" gives me > U __setsid so it is just _using_ EMX's dummy implementation of _setsid, it's _not_ providing an implementation. The point probably was to make "daemon" (the function which is actually using setsid) work as intended as soon as there's a C library below it which provides a working setsid implementation... Regards, Stefan