home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / linux / 23331 < prev    next >
Encoding:
Internet Message Format  |  1993-01-09  |  3.3 KB

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