Solaris: nss_wrapper: conflicting types

Ralph Böhme rb at sernet.de
Sun Oct 5 11:24:33 MDT 2014


Hi,

there's more non-portable code that breaks compilation on
Solaris. This one is in nss_wrapper:

$ waf
Waf: Entering directory `/home/ralph/samba/master/bin'
    Selected embedded Heimdal build
[2093/4090] Compiling lib/nss_wrapper/nss_wrapper.c
../lib/nss_wrapper/nss_wrapper.c:2405:5: error: conflicting types for ‘gethostbyname_r’
/usr/include/netdb.h:227:17: note: previous declaration of ‘gethostbyname_r’ was here
../lib/nss_wrapper/nss_wrapper.c:3016:5: error: conflicting types for ‘getpwnam_r’
/usr/include/pwd.h:133:12: note: previous declaration of ‘getpwnam_r’ was here
../lib/nss_wrapper/nss_wrapper.c:3082:5: error: conflicting types for ‘getpwuid_r’
/usr/include/pwd.h:132:12: note: previous declaration of ‘getpwuid_r’ was here
../lib/nss_wrapper/nss_wrapper.c:3305:5: error: conflicting types for ‘getgrnam_r’
/usr/include/grp.h:120:12: note: previous declaration of ‘getgrnam_r’ was here
../lib/nss_wrapper/nss_wrapper.c:3376:5: error: conflicting types for ‘getgrgid_r’
/usr/include/grp.h:119:12: note: previous declaration of ‘getgrgid_r’ was here
../lib/nss_wrapper/nss_wrapper.c:3491:5: error: conflicting types for ‘getgrent_r’
/usr/include/grp.h:37:22: note: previous declaration of ‘getgrent_r’ was here
Waf: Leaving directory `/home/ralph/samba/master/bin'
Build failed:  -> task failed (err #1): 
        {task: cc nss_wrapper.c -> nss_wrapper_1.o}
Makefile:8: recipe for target 'all' failed
gmake: *** [all] Error 1
$

OS is Solaris 11.1.

gethostbyname_r
===============

SUS:
nope

Solaris:

struct hostent *
gethostbyname_r(const char *name,
                struct hostent *result,
                char *buffer,
                int buflen,
                int *h_errnop);

Linux:

int
gethostbyname_r(const char *name,
                struct hostent *ret,
                char *buf,
                size_t buflen,
                struct hostent **result,
                int *h_errnop);

getpwnam_r
==========

SUSv4:

int
getpwnam_r(const char *name,
           struct passwd *pwd,
           char *buffer,
           size_t bufsize,
           struct passwd **result);

Solaris:

struct passwd *
getpwnam_r(const char *name,
           struct passwd *pwd,
           char *buffer,
           int buflen);

Linux:

int
getpwnam_r(const char *name,
           struct passwd *pwd,
           char *buf,
           size_t buflen,
           struct passwd **result);

asf.

Anyone with an idea for an easy fix? I'm volunteering to implement it!
:)

Cheerio!
-Ralph

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de,mailto:kontakt@sernet.de


More information about the samba-technical mailing list