Path: utzoo!yunexus!maccs!innovus!martin From: martin@innovus.UUCP (Martin Renters) Newsgroups: comp.sys.hp Subject: Strange behaviour on HP9000/825 Keywords: errno 25 cc errors Message-ID: <227@innovus.UUCP> Date: 25 Jul 89 21:37:45 GMT Article-I.D.: innovus.227 Organization: Innovus Inc, Hamilton, Ont. Canada Lines: 43 We just found some rather strange behaviour on our 9000/825 running HP-UX 3.0. Seems we get an errno 25 (not a typewriter) on the first I/O we do on any newly opened file, although the I/O is actually carried out. Any subsequent I/Os work fine, without error. Both HFS and NFS filesystems seem to have this problem. Here's a test program (a.c) that illustrates this problem: #include #include extern int errno; main() { FILE *fp; char buffer[80]; buffer[0]='\0'; if ((fp=fopen("a.c","r")) == NULL) { printf("File fails to open\n"); exit(2); } printf("File opens, errno=%d, fp=%d\n",errno,fp); fgets(buffer,64,fp); printf("File read, errno=%d, fp=%d, buffer=%s",errno,fp,buffer); clearerr(fp); errno=0; fgets(buffer,64,fp); printf("File read2, errno=%d, fp=%d, buffer=%s",errno,fp,buffer); } When compiled with 'cc a.c' and executed the following output results: File opens, errno=0, fp=1073742056 File read, errno=25, fp=1073742056, buffer=#include File read2, errno=0, fp=1073742056, buffer=#include Anybody care to comment about why this is happening? Martin Renters martin@innovus Technical Analyst ..utgpu!maccs!innovus!martin Innovus Inc.