From: Thomas Dunbar (tdunbar@vttcf.cc.vt.edu)
Date: 09/29/92


From: Thomas Dunbar <tdunbar@vttcf.cc.vt.edu>
Subject: xfopen code in xdvi's util.c
Date: Tue, 29 Sep 1992 16:36:44 GMT


|
| In article <7474@vtserf.cc.vt.edu> you write:
|
| > when i run xdvi on a dvi file with more than 26 fonts, it tries to
| >make the fonts even tho they exist and then it dies. is this a problem
| >with xfopen/fopen functions?
| > i'm running xdvi on XFree86-v 1.0Ya, compiled with gcc 2.2.2d7 on Linux.
|
| What does fopen() do when you try to open more than that many files? It
| is supposed to return NULL and set errno equal to ENFILE or EMFILE.
| Try writing a small program to see what is different here.
|
| --Paul Vojta, vojta@math.berkeley.edu
|

 Mr Vojta,
   it does return NULL and set errno to "too many files open" if i put
     printf("f is %d\n",d);
     perror("errno is ");
   before the if; however it doesn't do the if.
     i'm not a C programmer (hardly a programmer at all!)..i just
     deleted the and condition and it worked fine. i'm posting to the
 comp.os.linux so those who know what they're doing can find and really
fix what's causing the problem (we [linux os] use: gcc 2.2.2 & XFree86 1Y)
   i wouldn't have uploaded my "patched" file but a while back people
were complaining about xdvi/MakeTeXPK and i, not normally using many
fonts, didnt know what the problem was. i think it was never resolved.
  the errno.h file has:
#define EMFILE 24 /* Too many files open */
  but printf("errno is %d", errno) gives
     errno is 0f
  
  i'd have thought the above was just my ignorance/installation (of gcc)
errors but for others having the same problems and my not having any trouble
with it and others i've compiled.
   
   thomas
 
ps for others: talking about code in the xfopen function in util.c from
the xdvi source.