bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: declare getusershell in unistd.h


From: Bruno Haible
Subject: Re: declare getusershell in unistd.h
Date: Sun, 19 Oct 2008 13:10:55 +0200
User-agent: KMail/1.5.4

> 2008-10-18  Bruno Haible  <address@hidden>
> 
>       * lib/unistd.in.h (getusershell, setusershell, endusershell): New
>       declarations.
>       * lib/getusershell.c: Include unistd.h.
>       * m4/getusershell.m4 (gl_FUNC_GETUSERSHELL): Require
>       gl_UNISTD_H_DEFAULTS and AC_USE_SYSTEM_EXTENSIONS. Set
>       HAVE_GETUSERSHELL.
>       * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_GETUSERSHELL
>       and HAVE_GETUSERSHELL.
>       * modules/getusershell (Depends-on): Add unistd, extensions.
>       (configure.ac): Invoke gl_UNISTD_MODULE_INDICATOR.
>       (Include): Specify <unistd.h>.
>       * modules/unistd (Makefile.am): Substitute GNULIB_GETUSERSHELL and
>       HAVE_GETUSERSHELL.

Applied.

I now see that coreutils/src/su.c has this:


/* Hide any system prototype for getusershell.
   This is necessary because some Cray systems have a conflicting
   prototype (returning `int') in <unistd.h>.  */
#define getusershell _getusershell_sys_proto_

#include "system.h"
#include "getpass.h"

#undef getusershell


If Cray systems are still a portability target, the current idiom for this
kind of problem is to add
  #define getusershell rpl_getusershell
in unistd.in.h.

Bruno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]