home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cis.ohio-state.edu!news.sei.cmu.edu!drycas.club.cc.cmu.edu!ghod
- From: ghod@drycas.club.cc.cmu.edu
- Newsgroups: comp.os.linux
- Subject: csh core dumps explained/fixed ANNOUNCE: BSD C Shell for linux)
- Message-ID: <1993Jan9.005316.2860@drycas.club.cc.cmu.edu>
- Date: 9 Jan 93 00:53:15 -0500
- References: <1993Jan8.152644.21983@klaava.Helsinki.FI>
- Followup-To: comp.os.linux
- Organization: Carnegie Mellon Computer Club
- Lines: 58
-
- In article <1993Jan8.152644.21983@klaava.Helsinki.FI>, rchen@sfu.ca (Robert Chen) writes:
- > Here is my port of BSD C Shell (ver 5.26) from the 386BSD source tree.
- > It works well for me, but as this is a first release so your milage may vary.
- > While this csh may lack some of the bells and wistles you have come to
- > expect from bash or tcsh, it has some advantages:
- >
- > - Good man page included. (I wish bash had this)
- > - It works. (I wish my tcsh did)
- > - About as "standard" a csh as you can get. Any decent introduction to Unix
- > book has a section devoted to the C shell.
- > - Weighs in at only 95k.
- >
- > If you wish to compile the source, you will need gcc 2.3.3 and the new
- > 4.2 libraries. (It will compile with gcc 2.2.2d but core dumps on execution).
- > This release has only been tested with Linux 0.99.2, but should work okay
- > with 0.97.3 and above. It probably requires the 4.2 shared libraries
- > to run.
- FYI, I got the thing compiled on my box with gcc 2.2.2d & the 4.1 shared libs,
- and I found out why it dumps core when you run it. As I suspected, it's sht
- same thing that makes tcsh dump core: sigaction(). Your implementation of
- sigaction() in csh.c was correct, but for some reason it barfs if you feed
- it a NULL as one of the args. (I get the distinct impression this subject has
- come up before, and I'll probably get flamed for hauling it out into the open
- again, but dem's da breaks I guess). Anyway, if you do:
-
- sigaction (SIGINT, &nact, &oact);
-
- everything works fine. But if you do:
-
- sigaction (SIGINT, NULL, &oact);
-
- whammo! SIGSEGV, core dumped.
- There's two ways to fix this. Either rig it so that you simply don't use NULL
- as an argument, or use signal() instead which, in the context in which this
- particular sigaction() call is being used, would work just fine as a
- substitute.
-
- If you're going to use solution one, you'll have to define an extra sigaction
- structure and add a second sigaction() call to undo the mess that the first
- one will make. This is what I ended up doing for tcsh and for csh.
-
- I had to do a few other things to get csh to compile with gcc 2.2.2, but the
- only change that seems to have affected csh's functionality is a small mod I
- made to glob.c. I had to comment out a small part of the code because I was
- missing certain definitions in my /usr/include/glob.h file. Apparently, the
- glob-related functions in my version of gcc don't cut the mustard. I've noticed
- that file completion doesn't work, which may be a direct result of my
- incredibly un-subtle hack. I'm not certain though: if anyone has csh running
- and can confirm that filec does indeed work fior them, please let me know.
- In the mean time, I'm gonna try stripping the glob code from tcsh and shoehorn
- it into csh as a temporary replacement. If all goes well, I'll probably submit
- the binary for archiving on sunsite for those who still have the old libs &
- stuff.
-
- -Bill
-
- ghod@drycas.club.cc.cmu.edu
-
-