Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!mtune!mtuxo!mtgzz!tgl From: tgl@mtgzz.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: MSC 4.0 bugs Message-ID: <2687@mtgzz.UUCP> Date: Wed, 13-May-87 11:48:45 EDT Article-I.D.: mtgzz.2687 Posted: Wed May 13 11:48:45 1987 Date-Received: Sat, 16-May-87 21:23:21 EDT References: <699@sdcc18.ucsd.EDU> <96@eagle_snax.UUCP> Organization: AT&T, Middletown NJ Lines: 44 Keywords: Microsoft C 4.0 bugs Summary: 3 known bugs in stat() routine /* statbugs.c */ #include "assert.h" #include "stdio.h" #include "sys/types.h" #include "stat.h" char *Device = "CON"; char *Executable = "\\COMMAND.COM"; char *Subdirdotdot = "\\BIN\\.."; struct stat Statb; main() { int v; v = stat(Device, &Statb); assert(v == 0); if ((Statb.st_mode & S_IFMT) != S_IFCHR) printf("stat(%s,-).st_mode = %#x\t\tSHOULD BE 0x2---\n", Device, Statb.st_mode); v = stat(Executable, &Statb); assert(v == 0); if ((Statb.st_mode & S_IEXEC) == 0) printf("stat(%s,-).st_mode = %#x\tSHOULD INCLUDE 0x--4-\n", Executable, Statb.st_mode); v = stat(Subdirdotdot, &Statb); if (v != 0) printf("stat(%s,-) = %d\t\t\tSHOULD BE 0\n", Subdirdotdot); } /** C>statbugs stat(CON,-).st_mode = 0x81b6 SHOULD BE 0x2--- stat(\COMMAND.COM,-).st_mode = 0x8124 SHOULD INCLUDE 0x--4- stat(\BIN\..,-) = -1 SHOULD BE 0 **/