What caught my attention is that the author, Eric Schnoebelen, says that you should use, for example, "HAVE_GETHOSTNAME_R" instead of just testing the platform with "defined __LINUX__", because it's better to test the API than the platform.
The problem with this, of course, is that he chose to use a re-entrant function in his example. The problem with re-entrant functions is that several platforms implement them, but each with their own API. Thus, the *only* way to tell *which* API to use is to test the platform at some point.
Oops.
Linux Magazine article 0 Comments More | Login | Reply /