home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / coherent / 6613 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  3.2 KB

  1. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!gatech!usenet.ins.cwru.edu!agate!ames!ig!invid.mwc.com!ed
  2. From: ed@invid.mwc.com (Ed Bravo)
  3. Newsgroups: comp.os.coherent
  4. Subject: Re: how many open files in 4.0.1?
  5. Message-ID: <9301061307.AA10689@invid.mwc.com>
  6. Date: 6 Jan 93 19:49:16 GMT
  7. References: <9212212304.AA12222@relay1.UU.NET>
  8. Sender: daemon@presto.ig.com
  9. Reply-To: "Coherent operating system" <COHERENT@indycms.bitnet>
  10. Lines: 81
  11.  
  12. >
  13. > I've been running a test program on many systems latey, to see how many
  14. > files each system allows a single process to oopen. I was astonished
  15. > to find that I could open 2000 files on AIX 3.2 on an RS/6000.
  16. >
  17. > I was further astonished to see that the program thought it failed after
  18. > opening 13 files on Coherent 4.0.1.
  19.  
  20. At present Coherent supports 20 files but with other processes running the
  21. system may have only 13 to 18.  On the next version of Coherent you will
  22. have 60!
  23.  
  24.  
  25. >
  26. > Here's the program:
  27. > ---------------------------------------------------------------------------
  28. >
  29. > #include <stdio.h>
  30. > #include <fcntl.h>
  31. >
  32. > #define NUMFILES 5000
  33. > main ()
  34. >         {
  35. >         int fds[NUMFILES];
  36. >         char fname[50];
  37. >         int index;
  38. >
  39. >         for ( index = 0 ; index < NUMFILES ; index++ )
  40. >                 {
  41. >                 sprintf (fname, "file.%d", index);
  42. >                 fds[index] = creat (fname, 0666);
  43. >                 printf ("%d\n", fds[index]);
  44. >                 if (fds[index] == -1)
  45. >                         {
  46. >                         fprintf (stderr, "Failure opening file %s\n", fname);
  47. >                         break;
  48. >                         }
  49. >                 printf ("opened file handle %d, filename %s\n", fds[index],
  50.  fname);
  51. >                 sleep (1);
  52. >                 }
  53. >
  54. >         getchar();
  55. >         for ( --index ; index >= 0 ; index-- )
  56. >                 {
  57. >                 close (fds[index]);
  58. >                 sprintf (fname, "file.%d", index);
  59. >                 printf ("unlinking %s\n", fname);
  60. >                 unlink (fname);
  61. >                 }
  62. >         }
  63. >
  64. > ---------------------------------------------------------------------------
  65. >
  66. > Now, another thing that's interesting, is that even though the creat call
  67. > returns -1 when opening file.13, IT STILL CREATES THE FILE. If I hack it
  68. > up a bit so that it loops 20 times without regard to the return from
  69. > creat() IT CREATES 20 FILES. The same thing happens when using open()
  70. > rather than creat().
  71. >
  72. > Firstly, isn't this an unusually low limit on how many files a process
  73. > can have open ?? (especially on a 4mb machine!?!??), and secondly,
  74. > isn't this bizarre behavior of creating the file even though the
  75. > returned file handle indicates an error rather BIZARRE?  Is this
  76. > a bug (or two) or what?
  77. >
  78. > Fred
  79. >
  80. >
  81.  -------------------------------------------------------------------------------
  82. >  .----   Fred Smith    /                Office: 508-663-2524|Home:
  83.  617-438-5471
  84. > ( /__  ,__.   __   __ /  __   : /
  85.  fredex%fcshome@merk.merk.com
  86. >  /    /  /   /__) /  /  /__) .+'                   or
  87.  uunet!merk!fcshome!fredex
  88. > /    /  (__ (___ (__(_ (___ / :__   BIX: fredex    or
  89.  primerd!fcshome!fredex
  90. >
  91.  -------------------------------------------------------------------------------
  92. >
  93.