home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / gnu / gcc / bug / 2784 < prev    next >
Encoding:
Text File  |  1992-11-17  |  3.0 KB  |  101 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ttc.rdc.ricoh.co.JP!urabe
  3. From: urabe@ttc.rdc.ricoh.co.JP
  4. Subject: ioctl does not work in gcc 2.3.1
  5. Message-ID: <9211180232.AA11984@luke.ttc.rdc.ricoh.co.jp>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Wed, 18 Nov 1992 02:32:33 GMT
  10. Approved: bug-gcc@prep.ai.mit.edu
  11. Lines: 88
  12.  
  13.     I encountered the problem using gcc 2.3.1 on SS2 SUNOS 4.1.2.
  14.     I compiled the folowing program using gcc2.3.1 and cc and run
  15.     under the Openwindow2.0's comannd tool. I expected
  16.     the result is the same, but not.
  17.  
  18. % cat ttt.c
  19. #include <stdio.h>
  20. #include <stdlib.h>
  21. #include <sys/ioctl.h>
  22. #include <sgtty.h>
  23.  
  24.  
  25. #define EXIT_OK 0
  26. #define EXIT_FAILURE 1
  27.  
  28.  
  29. main()
  30. {
  31.     struct sgttyb arg;
  32.  
  33.     if (!isatty(fileno(stdin))) {
  34.         fprintf(stderr, "stdin is not tty\n") ;
  35.         exit(EXIT_FAILURE);
  36.     }
  37.     fprintf(stderr, "tty name is %s\n", ttyname(fileno(stdin))) ;
  38.     if (ioctl(fileno(stdin), TIOCGETP, (char *)&arg) < 0) {
  39.         perror("ioctl - TIOCGETP");
  40.         exit(EXIT_FAILURE);
  41.     }
  42.     fprintf(stderr, "We can do ioctl\n") ;
  43.     exit(EXIT_OK);
  44. }
  45.  
  46.     The config.status of gcc is the following.
  47.  
  48. % cat config.status
  49. #!/bin/sh
  50. # GCC was configured as follows:
  51. ./configure --target=sparc-sun-sunos4.1 --prefix=/usr/gnu
  52. echo host=sparc-sun-sunos4.1 target=sparc-sun-sunos4.1 build=sparc-sun-sunos4.1
  53.  
  54.     And the script of the result is the following.
  55.  
  56. % gcc -v -o ttt.gcc ttt.c
  57. Reading specs from /usr/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/specs
  58. gcc version 2.3.1
  59.  /usr/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/cpp -lang-c -v -undef -D__GNUC__=2 -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix ttt.c /tmp/cca11931.i
  60. GNU CPP version 2.3.1 (sparc)
  61.  /usr/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/cc1 /tmp/cca11931.i -quiet -dumpbase ttt.c -version -o /tmp/cca11931.s
  62. GNU C version 2.3.1 (sparc) compiled by GNU C version 2.3.1.
  63.  as -o /tmp/cca119311.o /tmp/cca11931.s
  64.  /usr/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/ld -e start -dc -dp -o ttt.gcc /lib/crt0.o -L/usr/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1 -L/usr/gnu/lib /tmp/cca119311.o -lgcc -lc -lgcc
  65.  
  66. % ttt.gcc
  67. tty name is /dev/ttyp4
  68. ioctl - TIOCGETP: Inappropriate ioctl for device
  69.  
  70.     And the result of the default SUN cc is the following.
  71.  
  72. % cc -v -o ttt.cc ttt.c
  73. /lib/cpp -undef -Dunix -Dsun -Dsparc ttt.c >/tmp/cpp.11939.0.i
  74. /lib/ccom - </tmp/cpp.11939.0.i >/tmp/ccom.11939.1.s
  75. rm /tmp/cpp.11939.0.i
  76. /bin/as -o ttt.o -Q /tmp/ccom.11939.1.s
  77. rm /tmp/ccom.11939.1.s
  78. /bin/ld -dc -dp -e start -X -o ttt.cc /usr/lib/crt0.o ttt.o -lc
  79. rm ttt.o
  80.  
  81. % ttt.cc
  82. tty name is /dev/ttyp4
  83. We can do ioctl
  84.  
  85.  
  86.     I hope this information is useful to you.
  87.  
  88.  
  89.                 701 Development Group
  90.                 NA Development Department
  91.                 Advanced Technology Development Center    
  92.                 Research and Development Group
  93.                 RICOH Co. Ltd.
  94.  
  95.                     Akio Urabe
  96.  
  97.                 urabe@ttc.rdc.ricoh.co.jp
  98.                 tel +81-45-593-3411 ext 3021    
  99.                 FAX 81-45-593-3487 (G3)
  100.  
  101.