home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.aix
- 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
- From: haedener@iacrs1.unibe.ch (Konrad Haedener)
- Subject: stat() bug or feature in 3.2.1+ ?
- Message-ID: <1992Nov16.154056.3062@aragorn.unibe.ch>
- Sender: haedener@iacrs1 (Konrad Haedener)
- Reply-To: haedener@iacrs1.unibe.ch
- Organization: University of Berne
- Date: Mon, 16 Nov 1992 15:40:56 GMT
- Lines: 68
-
- The following test program apparently behaves differently under AIX 3.2.0
- and under my updated 3.2.1 + addtnl PTFs.
-
- #include <stdio.h>
- #include <sys/stat.h>
- #include <errno.h>
-
- char t_line1[]="/dev/ptc";
- char t_line2[]="/dev/ptc/0";
- char t_line3[]="/dev/ptyp0";
-
- main()
- {
-
- int r_stat;
- struct stat statbuf;
-
- printf("Testing `stat()' on %s ...: ", t_line1);
- r_stat = stat(t_line1, &statbuf);
- printf("r_stat is %d and errno is %d\n", r_stat, errno);
- errno=0;
-
- printf("Testing `stat()' on %s ...: ", t_line2);
- r_stat = stat(t_line2, &statbuf);
- printf("r_stat is %d and errno is %d\n", r_stat, errno);
- errno=0;
-
- printf("Testing `stat()' on %s ...: ", t_line3);
- r_stat = stat(t_line3, &statbuf);
- printf("r_stat is %d and errno is %d\n\n", r_stat, errno);
- errno=0;
-
- printf("Testing `lstat()' on %s ...: ", t_line1);
- r_stat = lstat(t_line1, &statbuf);
- printf("r_stat for is %d and errno is %d\n", r_stat, errno);
- errno=0;
-
- printf("Testing `lstat()' on %s ...: ", t_line2);
- r_stat = lstat(t_line2, &statbuf);
- printf("r_stat is %d and errno is %d\n", r_stat, errno);
- errno=0;
-
- printf("Testing `lstat()' on %s ...: ", t_line3);
- r_stat = lstat(t_line3, &statbuf);
- printf("r_stat is %d and errno is %d\n", r_stat, errno);
- }
-
-
- Testing `stat()' on /dev/ptc ...: r_stat is 0 and errno is 0
- Testing `stat()' on /dev/ptc/0 ...: r_stat is -1 and errno is 5 <<<<<<<<<<<<
- Testing `stat()' on /dev/ptyp0 ...: r_stat is -1 and errno is 5 <<<<<<<<<<<<
-
- Testing `lstat()' on /dev/ptc ...: r_stat for is 0 and errno is 0
- Testing `lstat()' on /dev/ptc/0 ...: r_stat is -1 and errno is 5
- Testing `lstat()' on /dev/ptyp0 ...: r_stat is 0 and errno is 0
-
- crw-rw-rwT 1 root system 23, 0 Jul 13 13:41 /dev/ptc
- crw-rw-rwT 1 root system 22, 0 Jul 13 13:41 /dev/pts
- lrwxrwxrwx 1 root system 10 Jul 13 13:41 /dev/ptyp0 -> /dev/ptc/0
-
- The above output is from the updated system. Under 3.2 gold, /dev/ptc/0
- seems to have looked different to stat() (sorry to be vague, I don't have a
- 3.2.0 system at hand). Should we settle with this or is it a bug ?
- --
- Konrad Haedener Phone: +41 31 65 42 25
- Institute for Physical Chemistry FAX: +41 31 65 39 94
- University of Berne
- Switzerland haedener@iacrs1.unibe.ch
-