Date: Sun, 18 Apr 2004 00:04:20 EST-10EDT,10,-1,0,7200,3,-1,0,7200,3600 Subject: [UnixOS2_Archive] No. 352 ************************************************** Saturday 17 April 2004 Number 352 ************************************************** Subjects for today 1 Re: patch -p : Thomas Dickey 2 Re: setpgrp : Thomas Dickey 3 Re: setpgrp : Thomas Dickey 4 Re: patch -p : Thomas Dickey 5 Re: setpgrp : John Poltorak 6 Re: setpgrp : John Merryweather Cooper 7 cc'ing to list : John Poltorak 8 Re: setpgrp : John Merryweather Cooper 9 Re: setpgrp : John Poltorak 10 Re: cc'ing to list : Stefan Neis 11 Re: Warnings and errors : Stefan Neis 12 Re: Warnings and errors : John Poltorak 13 Re: cc'ing to list : John Poltorak 14 Re: patch -p : John Poltorak 15 adding to aclocal.m4 : Dave and Natalie" 16 Re: adding to aclocal.m4 : John Poltorak 17 Combining INSTALL and TOUCH : John Poltorak 18 setpgrp : John Poltorak 19 patch -p : John Poltorak 20 Re: setpgrp : John Merryweather Cooper 21 Re: setpgrp : John Merryweather Cooper 22 Re: setpgrp : John Merryweather Cooper 23 Re: setpgrp : John Merryweather Cooper **= Email 1 ==========================** Date: Fri, 16 Apr 2004 12:30:50 -0400 (EDT) From: Thomas Dickey Subject: Re: patch -p On Fri, 16 Apr 2004, John Poltorak wrote: > > How do I work out the correct value for -p for a patch file? I experiment, using --dry-run to avoid updating the files. (yes, you can count slashes, too). -- Thomas E. Dickey http://invisible-island.net ftp://invisible-island.net **= Email 2 ==========================** Date: Fri, 16 Apr 2004 12:34:11 -0400 (EDT) From: Thomas Dickey Subject: Re: setpgrp On Fri, 16 Apr 2004, John Merryweather Cooper wrote: > Make a dummy setpgrp() function (that does nothing) and allow it to be > linked in. Unless you've got UNIX-style group behavior coded (in which > case you'd have already come up with a working setpgrp()), this is the > correct behavior. > > Note that much Linux code violates POSIX by assuming that you can call um no - POSIX setpgrp has no parameters. (when I first looked at FreeBSD, both "POSIX" and "ANSI C" were treated as bad jokes by its developers). > setpgrp() without arguments (this is a common incompatibility between > Linux and FreeBSD since FreeBSD requires setpgrp to have two arguments. > The work-around on FreeBSD is to change all occurrences of setpgrp() to > setpgrp(0, 0). portable code is resigned to ifdef'ing this. -- Thomas E. Dickey http://invisible-island.net ftp://invisible-island.net **= Email 3 ==========================** Date: Fri, 16 Apr 2004 12:34:11 -0400 (EDT) From: Thomas Dickey Subject: Re: setpgrp On Fri, 16 Apr 2004, John Merryweather Cooper wrote: > Make a dummy setpgrp() function (that does nothing) and allow it to be > linked in. Unless you've got UNIX-style group behavior coded (in which > case you'd have already come up with a working setpgrp()), this is the > correct behavior. > > Note that much Linux code violates POSIX by assuming that you can call um no - POSIX setpgrp has no parameters. (when I first looked at FreeBSD, both "POSIX" and "ANSI C" were treated as bad jokes by its developers). > setpgrp() without arguments (this is a common incompatibility between > Linux and FreeBSD since FreeBSD requires setpgrp to have two arguments. > The work-around on FreeBSD is to change all occurrences of setpgrp() to > setpgrp(0, 0). portable code is resigned to ifdef'ing this. -- Thomas E. Dickey http://invisible-island.net ftp://invisible-island.net **= Email 4 ==========================** Date: Fri, 16 Apr 2004 12:30:50 -0400 (EDT) From: Thomas Dickey Subject: Re: patch -p On Fri, 16 Apr 2004, John Poltorak wrote: > > How do I work out the correct value for -p for a patch file? I experiment, using --dry-run to avoid updating the files. (yes, you can count slashes, too). -- Thomas E. Dickey http://invisible-island.net ftp://invisible-island.net **= Email 5 ==========================** Date: Fri, 16 Apr 2004 17:28:47 +0100 From: John Poltorak Subject: Re: setpgrp I'm trying to build the JOE editor which includes this in tty.c:- #ifndef SETPGRP_VOID setpgrp(0, 0); #else setpgrp(); #endif There is even a specific m4 macro to handle setpgrp in acinclude.m4:- dnl ------------------ dnl Check if setpgrp must have two arguments dnl autoconf-own macro is damaged for *BSD systems dnl ------------------ AC_DEFUN(joe_SETPGRP, [AC_CACHE_CHECK([whether setpgrp() takes no arguments], [joe_cv_setpgrp_void], [AC_TRY_RUN([ #if HAVE_UNISTD_H #include #endif int main() { /* exit succesfully if setpgrp() takes two args (*BSD systems) */ exit(setpgrp(0, 0) != 0); }], [joe_cv_setpgrp_void=no], [joe_cv_setpgrp_void=yes], [joe_cv_setpgrp_void=yes]) ]) if test "$joe_cv_setpgrp_void" = yes; then AC_DEFINE([SETPGRP_VOID], 1, [Define if setpgrp() takes no arguments]) fi ]) autoconf.h has defined the following:- /* We have and */ #define HAVE_POSIX_TERMIOS 1 /* Define if setpgrp() takes no arguments */ #define SETPGRP_VOID 1 I wonder if these settings are correct, or is there something missing from one of my libs?... On Fri, Apr 16, 2004 at 08:54:40AM -0700, John Merryweather Cooper wrote: > Make a dummy setpgrp() function (that does nothing) and allow it to be > linked in. Unless you've got UNIX-style group behavior coded (in which > case you'd have already come up with a working setpgrp()), this is the > correct behavior. > > Note that much Linux code violates POSIX by assuming that you can call > setpgrp() without arguments (this is a common incompatibility between > Linux and FreeBSD since FreeBSD requires setpgrp to have two arguments. > The work-around on FreeBSD is to change all occurrences of setpgrp() to > setpgrp(0, 0). > > jmc > > On Fri, 2004-04-16 at 07:31, John Poltorak wrote: > > Anyone how I can overcome:- ? > > > > error L2029: 'setpgrp' : unresolved external > > > > -- John **= Email 6 ==========================** Date: Fri, 16 Apr 2004 09:48:41 -0700 From: John Merryweather Cooper Subject: Re: setpgrp I got setpgid() confused with setpgrp(). Yes, setpgrp() retains it's older calling convention in BSD's. New stuff is supposed to used setpgid() which is supposed to be POSIX compliant. jmc On Fri, 2004-04-16 at 09:34, Thomas Dickey wrote: > On Fri, 16 Apr 2004, John Merryweather Cooper wrote: > > > Make a dummy setpgrp() function (that does nothing) and allow it to be > > linked in. Unless you've got UNIX-style group behavior coded (in which > > case you'd have already come up with a working setpgrp()), this is the > > correct behavior. > > > > Note that much Linux code violates POSIX by assuming that you can call > > um no - POSIX setpgrp has no parameters. > > (when I first looked at FreeBSD, both "POSIX" and "ANSI C" were treated as > bad jokes by its developers). > > > setpgrp() without arguments (this is a common incompatibility between > > Linux and FreeBSD since FreeBSD requires setpgrp to have two arguments. > > The work-around on FreeBSD is to change all occurrences of setpgrp() to > > setpgrp(0, 0). > > portable code is resigned to ifdef'ing this. **= Email 7 ==========================** Date: Fri, 16 Apr 2004 17:49:16 +0100 From: John Poltorak Subject: cc'ing to list I've just checked a couple of posts on the list that have been duplicated and it appears that the msg is sent to os2-unix at warpix.org and it is cc'ed to os2-unix at mail.warpix.org, but both of these addresses are the same system so they get sent to the list twice. Why is there a both a reply and a cc to the list? I suspect this may be due to the way I've set the list up under Majordomo... Is there anything which can be done about it? I'm no Majordomo expert, BTW... -- John **= Email 8 ==========================** Date: Fri, 16 Apr 2004 09:48:41 -0700 From: John Merryweather Cooper Subject: Re: setpgrp I got setpgid() confused with setpgrp(). Yes, setpgrp() retains it's older calling convention in BSD's. New stuff is supposed to used setpgid() which is supposed to be POSIX compliant. jmc On Fri, 2004-04-16 at 09:34, Thomas Dickey wrote: > On Fri, 16 Apr 2004, John Merryweather Cooper wrote: > > > Make a dummy setpgrp() function (that does nothing) and allow it to be > > linked in. Unless you've got UNIX-style group behavior coded (in which > > case you'd have already come up with a working setpgrp()), this is the > > correct behavior. > > > > Note that much Linux code violates POSIX by assuming that you can call > > um no - POSIX setpgrp has no parameters. > > (when I first looked at FreeBSD, both "POSIX" and "ANSI C" were treated as > bad jokes by its developers). > > > setpgrp() without arguments (this is a common incompatibility between > > Linux and FreeBSD since FreeBSD requires setpgrp to have two arguments. > > The work-around on FreeBSD is to change all occurrences of setpgrp() to > > setpgrp(0, 0). > > portable code is resigned to ifdef'ing this. **= Email 9 ==========================** Date: Fri, 16 Apr 2004 17:54:21 +0100 From: John Poltorak Subject: Re: setpgrp On Fri, Apr 16, 2004 at 12:34:11PM -0400, Thomas Dickey wrote: > > setpgrp() without arguments (this is a common incompatibility between > > Linux and FreeBSD since FreeBSD requires setpgrp to have two arguments. > > The work-around on FreeBSD is to change all occurrences of setpgrp() to > > setpgrp(0, 0). > > portable code is resigned to ifdef'ing this. If you manage to get UX2BS set up, maybe you could try 'build joe' and add the required ifdef'ing ;-)... > -- > Thomas E. Dickey > http://invisible-island.net > ftp://invisible-island.net -- John **= Email 10 ==========================** Date: Fri, 16 Apr 2004 19:08:35 +0200 (CEST) From: Stefan Neis Subject: Re: cc'ing to list On Fri, 16 Apr 2004, John Poltorak wrote: > Why is there a both a reply and a cc to the list? Problem seems to be that users tend to send mail to os2-unix at warpix.org while the Reply-To adress is set to os2-unix at mail.warpix.org. So, e.g. pine asks you if you want to reply to "all recipients" (normally a good idea to answer yes, IMHO) and you end up sending the reply to - the Reply-To adress given in the mail (... at mail.warpix...) - All the other people that got the mail (... at warpix) as a cc. Easiest would probably be to either tell majordomo to set the Reply-To to "os2-unix at warpix.org" and deprecate the other adress or to deprecate the os2-unix at warpix.org adress and ask everybody to send his mails to "os2-unix at mail.warpix.org". More complicated: make sure that To and Reply-To fields do match, no matter what adress is used ... Actually, that might not be that complicated. If majordomo allows you to rewrite the To field as well, you could always put whatever of the two you prefer into both fields and be done. Regards, StefanA -- Micro$oft is not an answer. It is a question. The answer is 'no'. **= Email 11 ==========================** Date: Fri, 16 Apr 2004 19:16:22 +0200 (CEST) From: Stefan Neis Subject: Re: Warnings and errors On Wed, 14 Apr 2004, John Poltorak wrote: > ./makemsg ../msgs/mess.en gripedefs.h msg.c > gcc -O -c -Wall -Wstrict-prototypes -Wmissing-prototypes -Zomf -O2 -s > -D__ST_MT_ERRNO__ -I. -DUSG -Duid_t= -Dgid_t= -DALLOCA_MISSING -DNONLS ^^^^^^^^^^^^^^^^^ > -DNOGETOPT -DGREPSILENT=\'q\' man.c > In file included from u:\unixos2\posix2\include\sys/fcntl.h:15, > from u:\unixos2\emx\include\sys/file.h:5, > from man.c:27: > u:\unixos2\posix2\include\sys/types.h:84: warning: empty declaration > u:\unixos2\posix2\include\sys/types.h:94: warning: empty declaration > In file included from u:\unixos2\posix2\include\sys/fcntl.h:16, > from u:\unixos2\emx\include\sys/file.h:5, > from man.c:27: > u:\unixos2\posix2\include\sys/stat.h:73: parse error before `st_uid' Well, that line (line 73 of posix2/include/sys/stat.h) is reading > uid_t st_uid; /* user ID of the file's owner */ Your compiler flag (-Duid_t=) is explicitly defining the typename uid_t (supposed to be typedef'ed to something like int) as empty, so the result is not a valid C (or C++) declaration. I have no idea where those two defines are coming from (both -Duid_t= and -Dgid_t=), but you need to get rid of them ... HTH, Stefan -- Micro$oft is not an answer. It is a question. The answer is 'no'. **= Email 12 ==========================** Date: Fri, 16 Apr 2004 19:51:44 +0100 From: John Poltorak Subject: Re: Warnings and errors On Fri, Apr 16, 2004 at 07:16:22PM +0200, Stefan Neis wrote: > Well, that line (line 73 of posix2/include/sys/stat.h) is reading > > uid_t st_uid; /* user ID of the file's owner */ > Your compiler flag (-Duid_t=) is explicitly defining the typename uid_t > (supposed to be typedef'ed to something like int) as empty, so the result > is not a valid C (or C++) declaration. > I have no idea where those two defines are coming from (both -Duid_t= and > -Dgid_t=), but you need to get rid of them ... They appear in the Makefile created for MAN:- DEFS = -DDO_COMPRESS -DDIRENT -DUSG -Duid_t=uid_t -Dgid_t=uid_t \ -DALLOCA_MISSING -DNONLS -DNOGETOPT $(GS) Configure must find some reason to set them up in this routine:- echo checking whether sys/types.h defines uid_t echo '#include main() { uid_t x; exit(0); }' > conftest.c eval $compile if test -s conftest && ./conftest 2>/dev/null; then : else uid_t=`awk '/pw_uid;/ {print $1}' $INCLUDEDIR/pwd.h` DEFS="$DEFS -Duid_t=${uid_t} -Dgid_t=${uid_t}" fi rm -f conftest conftest.c Maybe conftest should be changed to conftest.exe... Unfortunately MAN does not come with a configure.in but uses a hand built configure script. > HTH, > Stefan > -- > Micro$oft is not an answer. It is a question. The answer is 'no'. > -- John **= Email 13 ==========================** Date: Fri, 16 Apr 2004 19:56:03 +0100 From: John Poltorak Subject: Re: cc'ing to list On Fri, Apr 16, 2004 at 07:08:35PM +0200, Stefan Neis wrote: > On Fri, 16 Apr 2004, John Poltorak wrote: > > > Why is there a both a reply and a cc to the list? > > Problem seems to be that users tend to send mail to os2-unix at warpix.org > while the Reply-To adress is set to os2-unix at mail.warpix.org. > So, e.g. pine asks you if you want to reply to "all recipients" (normally > a good idea to answer yes, IMHO) and you end up sending the reply to > - the Reply-To adress given in the mail (... at mail.warpix...) > - All the other people that got the mail (... at warpix) as a cc. > > Easiest would probably be to either tell majordomo to set the Reply-To to > "os2-unix at warpix.org" and deprecate the other adress or to deprecate the > os2-unix at warpix.org adress and ask everybody to send his mails to > "os2-unix at mail.warpix.org". The reply_to is just set to os2-unix. It's probably Sendmail appending mail.warpix.org and I get a bit nervous updating sendmail.cf because all mail can suddenly come to a halt ...:-) > Regards, > StefanA > -- > Micro$oft is not an answer. It is a question. The answer is 'no'. > -- John **= Email 14 ==========================** Date: Fri, 16 Apr 2004 22:42:54 +0100 From: John Poltorak Subject: Re: patch -p On Fri, Apr 16, 2004 at 12:30:50PM -0400, Thomas Dickey wrote: > On Fri, 16 Apr 2004, John Poltorak wrote: > > > > > How do I work out the correct value for -p for a patch file? > > I experiment, using --dry-run to avoid updating the files. > (yes, you can count slashes, too). I have some code - which I don't understand at all, but until now it has always correctly identified the number of leading components to filenames, but it doesn't work on one particular patch file. This is marvellous bit of code I'm referring to:- PATCHFILE=$BLD_HOME/patches/$ARCHIVE.diff if test -f $PATCHFILE; then { patch -p`awk 'BEGIN { min_p = 1234567 } $1 == "+++" || $1 == "***" { gsub (ARCHIVE ".*", "", $2) gsub (/[^/]/, "", $2) if (length($2) < min_p) min_p = length($2) } END { print min_p + 1 }' ARCHIVE=$ARCHIVE $PATCHFILE` < $PATCHFILE } fi I can't fathom how this works, but wonder if I have hit a bug... How could I include a msg showing what was being processed in the middle of this code? > -- > Thomas E. Dickey > http://invisible-island.net > ftp://invisible-island.net -- John **= Email 15 ==========================** Date: Fri, 16 Apr 2004 20:32:35 -0800 From: "Dave and Natalie" Subject: adding to aclocal.m4 When running mk.sh from blackbox-cvs I get this error (from aclocal? libtoolize?) You should add the contents of `/usr/share/aclocal/libtool.m4' to `aclocal.m4'. How would I go about this? Just cat them to a new file and rename? Dave **= Email 16 ==========================** Date: Sat, 17 Apr 2004 11:57:50 +0100 From: John Poltorak Subject: Re: adding to aclocal.m4 On Fri, Apr 16, 2004 at 08:32:35PM -0800, Dave and Natalie wrote: > When running mk.sh from blackbox-cvs I get this error (from aclocal? libtoolize?) > You should add the contents of `/usr/share/aclocal/libtool.m4' to `aclocal.m4'. > How would I go about this? Just cat them to a new file and rename? cat /usr/share/aclocal/libtool.m4 >>aclocal.m4 > Dave -- John **= Email 17 ==========================** Date: Sat, 17 Apr 2004 12:10:31 +0100 From: John Poltorak Subject: Combining INSTALL and TOUCH Is there any way I can combine the functionality of INSTALL and TOUCH into a single command, possibly a shell script? What I would like to do while installing programs is to change their datestamp to that of a reference file for that package. This can be done with the '-r' option to touch, but I can't think of a way of integrating it into 'make install'. -- John **= Email 18 ==========================** Date: Fri, 16 Apr 2004 15:31:11 +0100 From: John Poltorak Subject: setpgrp Anyone how I can overcome:- ? error L2029: 'setpgrp' : unresolved external -- John **= Email 19 ==========================** Date: Fri, 16 Apr 2004 16:42:23 +0100 From: John Poltorak Subject: patch -p How do I work out the correct value for -p for a patch file? -- John **= Email 20 ==========================** Date: Fri, 16 Apr 2004 08:54:40 -0700 From: John Merryweather Cooper Subject: Re: setpgrp Make a dummy setpgrp() function (that does nothing) and allow it to be linked in. Unless you've got UNIX-style group behavior coded (in which case you'd have already come up with a working setpgrp()), this is the correct behavior. Note that much Linux code violates POSIX by assuming that you can call setpgrp() without arguments (this is a common incompatibility between Linux and FreeBSD since FreeBSD requires setpgrp to have two arguments. The work-around on FreeBSD is to change all occurrences of setpgrp() to setpgrp(0, 0). jmc On Fri, 2004-04-16 at 07:31, John Poltorak wrote: > Anyone how I can overcome:- ? > > error L2029: 'setpgrp' : unresolved external > > **= Email 21 ==========================** Date: Fri, 16 Apr 2004 08:54:40 -0700 From: John Merryweather Cooper Subject: Re: setpgrp Make a dummy setpgrp() function (that does nothing) and allow it to be linked in. Unless you've got UNIX-style group behavior coded (in which case you'd have already come up with a working setpgrp()), this is the correct behavior. Note that much Linux code violates POSIX by assuming that you can call setpgrp() without arguments (this is a common incompatibility between Linux and FreeBSD since FreeBSD requires setpgrp to have two arguments. The work-around on FreeBSD is to change all occurrences of setpgrp() to setpgrp(0, 0). jmc On Fri, 2004-04-16 at 07:31, John Poltorak wrote: > Anyone how I can overcome:- ? > > error L2029: 'setpgrp' : unresolved external > > **= Email 22 ==========================** Date: Fri, 16 Apr 2004 08:54:40 -0700 From: John Merryweather Cooper Subject: Re: setpgrp Make a dummy setpgrp() function (that does nothing) and allow it to be linked in. Unless you've got UNIX-style group behavior coded (in which case you'd have already come up with a working setpgrp()), this is the correct behavior. Note that much Linux code violates POSIX by assuming that you can call setpgrp() without arguments (this is a common incompatibility between Linux and FreeBSD since FreeBSD requires setpgrp to have two arguments. The work-around on FreeBSD is to change all occurrences of setpgrp() to setpgrp(0, 0). jmc On Fri, 2004-04-16 at 07:31, John Poltorak wrote: > Anyone how I can overcome:- ? > > error L2029: 'setpgrp' : unresolved external > > **= Email 23 ==========================** Date: Fri, 16 Apr 2004 08:54:40 -0700 From: John Merryweather Cooper Subject: Re: setpgrp Make a dummy setpgrp() function (that does nothing) and allow it to be linked in. Unless you've got UNIX-style group behavior coded (in which case you'd have already come up with a working setpgrp()), this is the correct behavior. Note that much Linux code violates POSIX by assuming that you can call setpgrp() without arguments (this is a common incompatibility between Linux and FreeBSD since FreeBSD requires setpgrp to have two arguments. The work-around on FreeBSD is to change all occurrences of setpgrp() to setpgrp(0, 0). jmc On Fri, 2004-04-16 at 07:31, John Poltorak wrote: > Anyone how I can overcome:- ? > > error L2029: 'setpgrp' : unresolved external > >