home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / mod.std.unix.v1 / text0036.txt < prev    next >
Encoding:
Text File  |  1987-06-30  |  1.5 KB  |  48 lines

  1. ----------------------------------------------------------------------
  2.  
  3. From: seismo!BBN-LABS-B.ARPA!dan (Dan Franklin)
  4. To: ut-sally!BBN-LABS-B.ARPA!std-unix
  5. Subject: Re: a bit more on getopt
  6. Date: 19 Jul 85 11:32:03 EDT (Fri)
  7.  
  8. >  > Actually this is important in some applications which do not already use
  9. >  > stdio and do not wish to load in the 10k or so overhead that using stdio
  10. >  > incurs. AT&T's code does not use stdio in getopt(3).
  11. >  Not true.  The size difference between:
  12. >      main() { puts("foo"); }
  13. >  and
  14. >      main() { write(0,"foo",3); }
  15. >  is exactly zero.
  16.  
  17. Your second one-liner is still using stdio.  The difference between
  18.        main() { puts("foo"); }
  19. and
  20.        main() { write(1, "foo", 3); }   exit(n) { _exit(n); }
  21. on the other hand, is substantial, at least on my 4.2 VAX system (and, in my
  22. experience, on other UNIX systems as well):
  23.  
  24. text    data    bss    dec    hex
  25. 2048    1024    15988    19060    4a74    stdio
  26. 1024    1024    0     2048     800    nostdio
  27.  
  28. 1024       0    25988   17012           difference
  29.  
  30. The point about not using stdio in a library routine if it's not necessary
  31. still stands.
  32.  
  33.     Dan Franklin
  34.  
  35. ------------------------------
  36.  
  37. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  38. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  39. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  40. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  41. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  42.  
  43. Volume-Number: Volume 1, Number 37
  44.  
  45.