home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / aix / 11619 < prev    next >
Encoding:
Text File  |  1992-11-16  |  2.8 KB  |  80 lines

  1. Newsgroups: comp.unix.aix
  2. Path: sparky!uunet!pmafire!mica.inel.gov!ux1!news.byu.edu!eff!sol.ctr.columbia.edu!usc!rpi!ghost.dsi.unimi.it!univ-lyon1.fr!chx400!aragorn.unibe.ch!iacrs1!haedener
  3. From: haedener@iacrs1.unibe.ch (Konrad Haedener)
  4. Subject: stat() bug or feature in 3.2.1+ ?
  5. Message-ID: <1992Nov16.154056.3062@aragorn.unibe.ch>
  6. Sender: haedener@iacrs1 (Konrad Haedener)
  7. Reply-To: haedener@iacrs1.unibe.ch
  8. Organization: University of Berne
  9. Date: Mon, 16 Nov 1992 15:40:56 GMT
  10. Lines: 68
  11.  
  12. The following test program apparently behaves differently under AIX 3.2.0
  13. and under my updated 3.2.1 + addtnl PTFs.
  14.  
  15. #include <stdio.h>
  16. #include <sys/stat.h>
  17. #include <errno.h>
  18.  
  19. char t_line1[]="/dev/ptc";
  20. char t_line2[]="/dev/ptc/0";
  21. char t_line3[]="/dev/ptyp0";
  22.  
  23. main()
  24. {
  25.   
  26.    int r_stat;
  27.    struct stat statbuf;
  28.  
  29.    printf("Testing `stat()' on %s ...:   ", t_line1);
  30.    r_stat = stat(t_line1, &statbuf);
  31.    printf("r_stat is %d and errno is %d\n", r_stat, errno);
  32.    errno=0;
  33.  
  34.    printf("Testing `stat()' on %s ...: ", t_line2);
  35.    r_stat = stat(t_line2, &statbuf);
  36.    printf("r_stat is %d and errno is %d\n", r_stat, errno);
  37.    errno=0;
  38.  
  39.    printf("Testing `stat()' on %s ...: ", t_line3);
  40.    r_stat = stat(t_line3, &statbuf);
  41.    printf("r_stat is %d and errno is %d\n\n", r_stat, errno);
  42.    errno=0;
  43.  
  44.    printf("Testing `lstat()' on %s ...:   ", t_line1);
  45.    r_stat = lstat(t_line1, &statbuf);
  46.    printf("r_stat for is %d and errno is %d\n",  r_stat, errno);
  47.    errno=0;
  48.  
  49.    printf("Testing `lstat()' on %s ...: ", t_line2);
  50.    r_stat = lstat(t_line2, &statbuf);
  51.    printf("r_stat is %d and errno is %d\n", r_stat, errno);
  52.    errno=0;
  53.  
  54.    printf("Testing `lstat()' on %s ...: ", t_line3);
  55.    r_stat = lstat(t_line3, &statbuf);
  56.    printf("r_stat is %d and errno is %d\n", r_stat, errno);
  57. }
  58.  
  59.  
  60. Testing `stat()' on /dev/ptc ...:   r_stat is 0 and errno is 0
  61. Testing `stat()' on /dev/ptc/0 ...: r_stat is -1 and errno is 5  <<<<<<<<<<<<
  62. Testing `stat()' on /dev/ptyp0 ...: r_stat is -1 and errno is 5  <<<<<<<<<<<<
  63.  
  64. Testing `lstat()' on /dev/ptc ...:   r_stat for is 0 and errno is 0
  65. Testing `lstat()' on /dev/ptc/0 ...: r_stat is -1 and errno is 5
  66. Testing `lstat()' on /dev/ptyp0 ...: r_stat is 0 and errno is 0
  67.  
  68. crw-rw-rwT   1 root     system    23,  0 Jul 13 13:41 /dev/ptc
  69. crw-rw-rwT   1 root     system    22,  0 Jul 13 13:41 /dev/pts
  70. lrwxrwxrwx   1 root     system        10 Jul 13 13:41 /dev/ptyp0 -> /dev/ptc/0
  71.  
  72. The above output is from the updated system. Under 3.2 gold, /dev/ptc/0
  73. seems to have looked different to stat() (sorry to be vague, I don't have a
  74. 3.2.0 system at hand). Should we settle with this or is it a bug ?
  75. -- 
  76. Konrad Haedener                             Phone: +41 31 65 42 25
  77. Institute for Physical Chemistry            FAX:   +41 31 65 39 94
  78. University of Berne
  79. Switzerland                                 haedener@iacrs1.unibe.ch
  80.