home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / vms / 18120 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  1.6 KB

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!ohstpy!viznyuk
  2. From: viznyuk@ohstpy.mps.ohio-state.edu
  3. Newsgroups: comp.os.vms
  4. Subject: The problem with $CREMBX System_Service
  5. Message-ID: <14709.2b092769@ohstpy.mps.ohio-state.edu>
  6. Date: 17 Nov 92 17:10:01 EST
  7. Lines: 42
  8.  
  9.    Hello VMS community !
  10.  
  11. I have a little question about
  12. $CREMBX System_Service.
  13. Here is a piece of program
  14. which is supposed to read data
  15. from terminal and then write them
  16. to mailbox, where they are supposed
  17. to be picked up by parallel subprocess
  18. (usually - DCL).
  19.  
  20.    [......]
  21. char w;
  22. static short tt,ch;
  23. $DESCRIPTOR(TT,"SYS$INPUT");
  24. $DESCRIPTOR(MB,"MAILBOX");
  25. short iosb[4];
  26. unsigned flag = CLI$M_NOWAIT;
  27.    [......]
  28. SYS$ASSIGN(&TT,&tt,0,0,0); 
  29. SYS$CREMBX(0,&ch,0,0,0,0,&MB,0);
  30. LIB$SPAWN(0,&MB,0,&flag,0,0,0,0,0,0,0,0,0);     /* starts parallel subprocess */
  31. for (;;)
  32.   {
  33.   SYS$QIOW(0,tt,IO$_TTYREADALL+IO$M_NOECHO+IO$M_TRMNOECHO+
  34.   IO$M_ESCAPE,iosb,0,0,&w,1,0,0,0,0);     /*    ----->  Reads single char w
  35.                                                       from terminal  */
  36.   SYS$QIO(0,ch,IO$_WRITELBLK+IO$M_NOW,iosb,0,0,
  37.   &w,1,0,0,0,0);                          /* --->  writes char w to mailbox  */
  38.   }
  39.  
  40.  
  41. Now the problem is that DCL which is run in the subprocess
  42. started by LIB$SPAWN  understands each write made by second
  43. SYS$QIO above, as if it is followed by <RET> keystroke, that
  44. is as if terminal is in "raw" mode.
  45. Does anybody know how to make DCL in subprocess read
  46. data from mailbox in its usual way - by strings, not by
  47. single chars ?   May be I missed some flags ?
  48.  
  49. I would appreciate any suggestions.
  50. S.Viznyuk
  51.