Wireshark-bugs: [Wireshark-bugs] [Bug 5608] build fails when it tries to #include <getopt.h>, no
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5608
--- Comment #3 from Guy Harris <guy@xxxxxxxxxxxx> 2011-01-23 12:43:53 PST ---
http://download.oracle.com/docs/cd/E19683-01/816-0213/6m6ne381o/index.html#indexterm-472
says <stdlib.h> on Solaris 9. getopt() is a UN*X routine, not a C-language
routine, so <unistd.h> - which is what the Single UNIX Specification says - is
probably where it ultimately belongs. Where it's been declared throughout the
history of UN*X is another matter.
For what it's worth, according to the man pages I've found online:
Tru64 UNIX 4.0 - <unistd.h>
HP-UX 10.01, from the FreeBSD man page site - <unistd.h>
SunOS 5.5.1 (Solaris 2.5.1's core OS) - <stdlib.h>
My inclination, in the short term, is to use <unistd.h> and see whether that
breaks on any platform and, if so, fall back on <stdlib.h> on platforms where
<unistd.h> doesn't work.
(In the longer term, we should probably use getopt_long() and either supply the
GNU libc version on OSes that don't have it or require a newer version of GLib
and use GLib's version.)
--
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.