Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!gatech!dscatl!wa4mei!nanovx!msa3b!kevin From: kevin@msa3b.UUCP (Kevin P. Kleinfelter) Newsgroups: comp.unix.aix Subject: Re: pg problem under ksh Message-ID: <1164@msa3b.UUCP> Date: 22 Oct 89 16:47:58 GMT References: <1156@msa3b.UUCP> <185@eliza.edvvie.at> Organization: Management Science America, Inc., Atlanta, GA Lines: 41 johnny@edvvie.at (Johann Schweigl) writes: >From article <1156@msa3b.UUCP>, by kevin@msa3b.UUCP (Kevin P. Kleinfelter): >> ksh and get a prompt. Then I type >> pg foo >> and I get >> pg: cannot reopen stdout >> >Under AIX PS/2 ksh is running fine, just compile with all the BSD defines. The "88b" version of ksh sources, now distributed by the toolchest, self-configures. This means I cannot just tell it that I am "BSD" or "SYSV". The source of this problem is that the ksh configure decides that "setpgrp" should be used to create a process group, and creates a #define to do this. Since setpgrp loses /dev/tty, one must "#define" this to "setpgid(0,0)". This brings me to the following list of changes necessary to make the "88b" version of ksh sources work properly on AIX PS/2 V1.1: 1) Change #define in include/sh_config to #define setpgrp to setpgid(0,0). 2) Edit "include/io.h" to remove "#undef O_NDELAY" and edit "sh/io.c" to change "#ifdef O_NDELAY" to "#ifndef FNDELAY". The problem here is that ksh #undefs O_NDELAY, but later uses FNDELAY, and in AIX FNDELAY is #defined using O_NDELAY. 3) "#undef dirent" before "#include sys/dir.h" in "sh/expand.c" because dir.h defines dirent too (so you get 2 definitions of dirent). 4) Edit "install/config" to echo "#undef SIG_NORESTART". The configure process decides that AIX does not restart I/O to the tty on interrupts. It is wrong, it does. I post this because several other people have indicated trouble in porting ksh to AIX. These comments probably apply only to 88b ksh and to AIX PS/2 V1.1. With these changes it seems to work pretty well, although I have only tested the features that I use. Lotsa luck to other porters. I have an email address for David Korn, and after I use ksh a little longer, I will email these problems to him, so perhaps ksh will work better with AIX in the future. -- Kevin Kleinfelter @ Management Science America, Inc (404) 239-2347 gatech!nanovx!msa3b!kevin