Peter Postma <peter%pointless.nl@localhost> wrote: > [Added jschauma to cc] > > jschauma@ recently added set/getprogname() to make it more portable. > But if these functions aren't available outside NetBSD then I don't see > how it would be more portable. Through use of libnbcompat, which we provide for all supported OS. > > I see a few ways of fixing this: > 1) get rid of set/getprogname and hardcode it in the usage, as jmmv suggested. > 2) revert the set/getprogname changes and use extern char *__progname again. > (but will this work everywhere? e.g. IRIX?) > 3) add libnbcompat to systems that don't have set/getprogname. > > Personally, I would prefer 2) and then 1). I don't see a problem with (3): the systems that need it, would likely have libnbcompat installed anyway. However, the program is small enough so that eliminating the need of these might be more practical. Plus, it's your program, so it's your call. :-) > I've attached a diff that attempts to make it more portable, I would > appreciate if you could test it on a non-NetBSD system. IRIX needs limits.h for PATH_MAX, and it doesn't seem to know __progname. -Jan -- Life," said Marvin, "don't talk to me about life."
Attachment:
pgpjAAWsatjWV.pgp
Description: PGP signature