[klibc] module-init-tools ported to klibc
Vassilis Virvilis
vasvir at iit.demokritos.gr
Mon May 23 08:30:29 PDT 2005
Olaf Hering wrote:
> On Mon, May 23, Vassilis Virvilis wrote:
>
>
>
>>-#include <getopt.h>
>>+#ifndef __KLIBC__
>>+# include <getopt.h>
>>+#else
>>+# include "mod_libc_wrapper.h"
>>+#endif
>
>
> This looks bogus, better give klibc a real getopt.h
>
The reason I did it like this was that
my getopt_long is really a wrapper around getopt(). That means
module-init-tools cannot use --long-arguments. My getopt long is only a
hack in order to port module-init-tools to klibc. Now consider also:
getopt lives <unistd.h> while getopt_long in
#define _GNU_SOURCE
#include <getopt.h>
If I give klibc a getopt.h I should also give it a real getopt_long()
implementation which I haven't provide. That's why I pushed this
ugliness to module-init-tools instead. Programs IMO can use quick &
dirty hacks to achieve short term portability but giving klibc a
getopt_long that is not really functional would be a mistake.
.bill
More information about the klibc
mailing list