home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / ultrix / 8265 < prev    next >
Encoding:
Internet Message Format  |  1992-11-12  |  1.5 KB

  1. Path: sparky!uunet!mcsun!Germany.EU.net!ira.uka.de!uka!irau35!s_uriart
  2. From: s_uriart@irau35.ira.uka.de (Juan Uriarte)
  3. Newsgroups: comp.unix.ultrix
  4. Subject: Sockets on a 5000/120
  5. Date: 12 Nov 1992 17:01:47 GMT
  6. Organization: University of Karlsruhe, FRG
  7. Lines: 24
  8. Distribution: world
  9. Message-ID: <1du2lrINNiue@iraul1.ira.uka.de>
  10. NNTP-Posting-Host: irau35.ira.uka.de
  11.  
  12. Hi.
  13. Im trying to do the following:
  14. start a process on a socket (a daemon)
  15. wait for someone to call
  16. fork and exec a process for the caller
  17.  
  18. I can do all but i cant change stdin and stdout of the exec'ed 
  19. process to the socket.I've tried 3 aprouches now and none will 
  20. work.First directly dup2 of stdout to the socket,wont work.
  21. Them creating a pipe and having 3 processes in the background,
  22. one reads from the pipe and writes into the socket,another reads
  23. the socket and writes into the pipe,while the third does and exec
  24. of the program i want to run after changing stdin and stdout to 
  25. the ends of the pipes.But the damned system wont let me close
  26. stdin and stdout,so it just wont work.And now i just did something
  27. like: fd=dup(socket);  myfile=fopen(fd,"r+'); and then a dup2 .
  28. But as usual the dup2 wont work,giving me the habitual errno 9.
  29. I can write into the socket with fprintf(myfile,"something\n"),
  30. and see at the other end what i wrote(after fflush),but i want it
  31. to be completely transparent to program being exec'd.
  32. Any clues? Any pointer for TSM?
  33. Thanks in advcance.
  34. BTW:if you didnt notice i am new to unix.Did a two week course,just
  35. to get my actual account,but that was obviously not enough.
  36.