home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / aux / 3377 < prev    next >
Encoding:
Text File  |  1992-09-07  |  2.6 KB  |  53 lines

  1. Newsgroups: comp.unix.aux
  2. Path: sparky!uunet!mcsun!Germany.EU.net!ubrinf!thomas
  3. From: thomas@mathematik.uni-Bremen.de (Thomas Eberhardt)
  4. Subject: Re: csh is screwed up
  5. Message-ID: <thomas.715639089@mathematik.uni-Bremen.de>
  6. Sender: news@informatik.uni-bremen.de (NEWS Service)
  7. Nntp-Posting-Host: 134.102.232.14
  8. Organization: Univ. Bremen, Informatik
  9. References: <1992Aug27.171503.794@colorado.edu> <1992Aug29.085228.2232@panix.com> <1992Aug31.171710.2035@colorado.edu>
  10. Date: Fri, 4 Sep 1992 20:38:09 GMT
  11. Lines: 40
  12.  
  13. powellb@samwise.colorado.edu (Brian Powell) writes:
  14.  
  15. [...]
  16. >#!/bin/csh -f
  17. >set test = `/bin/pwd`
  18. >echo $test
  19. >exit
  20.  
  21. >There, everything is explicit, and should work for everybody.  However, it will
  22. >only work on my A/UX 3.0, Mac IIfx, with 16 megs erratically.  I ran it 10 times, consecutively, and it worked 3 out of the ten.  The others, it never
  23. >executed the pwd command.  I ran it both under csh and tcsh with the same
  24. >results.  I realize that this should work for everybody; however, has anyone
  25. >else had this problem or resolved a similar one?
  26.  
  27. I just tried it on my IIfx, 20MB, A/UX 3.0.  It also sometimes fails on
  28. my machine.  The echo is indeed executed every time.  I've verified it by
  29. changing the echo to "echo x $test".  It seems the csh is sometimes missing
  30. the output from /bin/pwd.  This very much looks like the problems I had with
  31. emacs, which were caused by interrupted systems calls and the usage of
  32. SIGCHLD inside emacs.  Emacs includes workarounds (#defines for read, write,
  33. etc.) for this problems, but these don't catch the problem inside the C
  34. library.  So I recently replaced the offending system calls directly with
  35. new version that reissue the system call if it fails with EINTR.
  36. This solved my problems.  I think that the csh (since it comes from BSD
  37. where EINTR to my knowledge isn't known) has probably the same problem with
  38. the usage of asynchronous child status change (SIGCHLD) handling that
  39. sometimes interrupts the read system call of the backquote operator at
  40. bad times, so that the output of the child gets lost.
  41.  
  42. Yes, I've read setcompat(2), that states that COMPAT_SYSCALLS disables
  43. this nasty EINTR.  But this doesn't cured my problems with emacs (which
  44. anyway calls set42sig at the very beginning and so selects COMPAT_SYSCALLS).
  45.  
  46. PS: Sorry, if this is already discussed, but our news system is currently
  47.     5 days behind the rest of the world... :-(
  48. --
  49. thomas@mathematik.uni-Bremen.de  | Institut fuer dynamische Systeme
  50. Thomas Eberhardt                 | Universitaet Bremen, FB 3, Postfach 330 440
  51. Koelner Str. 4, W-2800 Bremen 41 | W-2800 Bremen 33, Germany
  52. Phone: +49 421 472527            | FAX: +49 421 218-4236
  53.