home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / de / comp / os / unix / 2574 < prev    next >
Encoding:
Text File  |  1993-01-01  |  1.2 KB  |  44 lines

  1. Path: sparky!uunet!spool.mu.edu!sol.ctr.columbia.edu!ira.uka.de!smurf.sub.org!news
  2. From: urlichs@smurf.sub.org (Matthias Urlichs)
  3. Newsgroups: de.comp.os.unix
  4. Subject: Re: TIOCSTI ( ioctl / BSD4.3 )
  5. Date: 2 Jan 1993 01:16:24 +0100
  6. Organization: University of Karlsruhe, FRG
  7. Lines: 32
  8. Message-ID: <1i2msoINN3dm@smurf.sub.org>
  9. References: <C04s6w.31y@malihh.hanse.de>
  10. NNTP-Posting-Host: 127.0.0.1
  11.  
  12. In de.comp.os.unix, article <C04s6w.31y@malihh.hanse.de>,
  13.   root@malihh.hanse.de (Carsten Lutz) writes:
  14. > #include <stdio.h>
  15. > #include <sys/ioctl.h>
  16. > main() {
  17. >   char c='a';
  18. >   ioctl(stdin, TIOCSTI, &c);
  19. >   printf("%c\n", getchar());
  20. > }
  21. > muesste nach meiner Auffassung also ein 'a' ausgeben. Tut es aber nicht,
  22. > der ioctl() bewirkt scheinbar gar nichts.
  23. AUA!!!
  24.  
  25. > Was mache ich falsch ?
  26. "man ioctl". "man stdio". Ersetze "stdin" durch "0".
  27.  
  28. Naechstes Mal teste bitte die Fehlermeldungen diverser Systemaufrufe --
  29. dein ioctl meldet -1 und setzt errno auf EBADF...
  30.  
  31. -- 
  32. Rule of Accuracy:
  33.       When working toward the solution of a problem it always helps you to
  34.       know the answer.
  35. -- 
  36. Matthias Urlichs  --  urlichs@smurf.sub.org -- urlichs@smurf.ira.uka.de   /(o\
  37. Humboldtstrasse 7 -- 7500 Karlsruhe 1 -- Germany  --  +49-721-9612521     \o)/
  38.