home *** CD-ROM | disk | FTP | other *** search
- From: seismo!BBN-LABS-B.ARPA!dan (Dan Franklin)
- To: ut-sally!BBN-LABS-B.ARPA!std-unix
- Subject: Re: a bit more on getopt
- Date: 19 Jul 85 11:32:03 EDT (Fri)
-
- > > Actually this is important in some applications which do not already use
- > > stdio and do not wish to load in the 10k or so overhead that using stdio
- > > incurs. AT&T's code does not use stdio in getopt(3).
- >
- > Not true. The size difference between:
- >
- > main() { puts("foo"); }
- > and
- > main() { write(0,"foo",3); }
- >
- > is exactly zero.
-
- Your second one-liner is still using stdio. The difference between
- main() { puts("foo"); }
- and
- main() { write(1, "foo", 3); } exit(n) { _exit(n); }
- on the other hand, is substantial, at least on my 4.2 VAX system (and, in my
- experience, on other UNIX systems as well):
-
- text data bss dec hex
- 2048 1024 15988 19060 4a74 stdio
- 1024 1024 0 2048 800 nostdio
-
- 1024 0 25988 17012 difference
-
- The point about not using stdio in a library routine if it's not necessary
- still stands.
-
- Dan Franklin
-
-
- Volume-Number: Volume 1, Number 32
-
-