home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / mod.std.unix.v3 / text0026.txt < prev    next >
Encoding:
Internet Message Format  |  1987-06-30  |  1.2 KB

  1. Date: Mon, 18 Nov 85 13:28:03 cst
  2. From: ihnp4!uiucdcs!ccvaxa!preece@SEISMO.CSS.GOV (Scott Preece)
  3.  
  4. > From: Dan Franklin <dan@BBN-PROPHET.ARPA>
  5. > Instead of one system call which returns *everything*, there should be
  6. > one system call which takes a numeric index "naming" the limit to be
  7. > returned.  An index of 0 would return the total number of limits.
  8. > Limits.h would give the indices.
  9. ----------
  10. I'd get rid of the numeric constants part of that, too.  Use a call
  11. like getenv, supplying a name as an Ascii string.
  12.  
  13. But does this mean we would have to malloc space for anything that
  14. was sized to a system limit (i.e., one could no longer say
  15.     char buf[PATH_MAX]
  16. but would have to do:
  17.     char *buf;
  18.     long bufsize;
  19.     ...
  20.     bufsize = getlimit("PATH_MAX");
  21.     if (bufsize >= 0)
  22.         buf = (char *)malloc(bufsize);
  23.     else
  24.         perror("bufalloc:");
  25. at run time?
  26.  
  27. Nobody ever said programming had to be easy, but this could
  28. get old pretty quickly...
  29.  
  30. [ If the limits are taken from <limits.h>, presumably a program could,
  31. if the programmer so chose, #include that file and size arrays at
  32. compile time.  -mod ]
  33.  
  34. __
  35. scott preece
  36. gould/csd urbana
  37. ihnp4!uiucdcs!ccvaxa!preece
  38.  
  39. Volume-Number: Volume 3, Number 28
  40.  
  41.