Message ID | 20150624223049.02D0A2C3B00@topped-with-meat.com |
---|---|
State | New |
Headers | show |
On 06/25/2015 12:30 AM, Roland McGrath wrote: > -#include <unistd.h> /* Declares getlogin_r. */ > +#include <unistd.h> /* Declares __getlogin_r. */ The change itself is good, though I wonder why the include is needed at all. Would you help me understand ? Best regards, Tolga Dalman
On 29 Jun 2015 22:38, Tolga Dalman wrote: > On 06/25/2015 12:30 AM, Roland McGrath wrote: > > -#include <unistd.h> /* Declares getlogin_r. */ > > +#include <unistd.h> /* Declares __getlogin_r. */ > > The change itself is good, though I wonder why the include is needed at all. > Would you help me understand ? because this file does: #define __getlogin_r(name, len) (ENOSYS) #include <sysdeps/wordsize-64/glob.c> if the later glob.c files include unistd.h, then the preprocessor will produce invalid code. the prototype will go from something like: extern int __getlogin_r (char *__name, size_t __name_len) __nonnull ((1)); to: extern int (ENOSYS) __nonnull ((1)); note: i didn't load up the exact source to see what line(s) would fail, but if you're interested, you should be able to reproduce :) -mike
diff --git a/sysdeps/nacl/glob.c b/sysdeps/nacl/glob.c index 36d62e8..eda6e9e 100644 --- a/sysdeps/nacl/glob.c +++ b/sysdeps/nacl/glob.c @@ -16,11 +16,11 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <unistd.h> /* Declares getlogin_r. */ +#include <unistd.h> /* Declares __getlogin_r. */ /* We do not have getlogin_r in the library at all for NaCl. Define it away so the glob code does not try to use it. */ -#define getlogin_r(name, len) (ENOSYS) +#define __getlogin_r(name, len) (ENOSYS) /* Fetch the version that defines glob64 as an alias. */ #include <sysdeps/wordsize-64/glob.c>