diff options
author | Ludovic Courtès <ludo@gnu.org> | 2009-04-23 22:24:32 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2009-05-21 00:09:41 +0200 |
commit | 5f380d71c3b1080d8f0e52610fa0b5efe09232c6 (patch) | |
tree | 417de984b7729cd54704eab2a1feb48eee4daff9 | |
parent | ca329120627a0905c1aac805a52a59439f6c5482 (diff) | |
download | guile-5f380d71c3b1080d8f0e52610fa0b5efe09232c6.tar.gz |
Work around lack of cuserid(3) declaration on Tru64 5.1b.
* configure.in: Check for a cuserid(3) declaration.
* libguile/posix.c [HAVE_CUSERID][!HAVE_DECL_CUSERID]: Provide a
declaration.
-rw-r--r-- | configure.in | 4 | ||||
-rw-r--r-- | libguile/posix.c | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/configure.in b/configure.in index 466e4d875..f06dab8bb 100644 --- a/configure.in +++ b/configure.in @@ -736,10 +736,12 @@ AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid fesetround ftime # xlocale.h - needed on Darwin for the `locale_t' API # hstrerror - on Tru64 5.1b the symbol is available in libc but the # declaration isn't anywhere. +# cuserid - on Tru64 5.1b the declaration is documented to be available +# only with `_XOPEN_SOURCE' or some such. # AC_CHECK_HEADERS(crypt.h netdb.h pthread.h sys/param.h sys/resource.h sys/file.h xlocale.h) AC_CHECK_FUNCS(chroot flock getlogin cuserid getpriority setpriority getpass sethostname gethostname) -AC_CHECK_DECLS([sethostname, hstrerror]) +AC_CHECK_DECLS([sethostname, hstrerror, cuserid]) # crypt() may or may not be available, for instance in some countries there # are restrictions on cryptography. diff --git a/libguile/posix.c b/libguile/posix.c index 78fd295b5..ddbaeaacb 100644 --- a/libguile/posix.c +++ b/libguile/posix.c @@ -1869,6 +1869,11 @@ SCM_DEFINE (scm_getlogin, "getlogin", 0, 0, 0, #endif /* HAVE_GETLOGIN */ #if HAVE_CUSERID + +# if !HAVE_DECL_CUSERID +extern char *cuserid (char *); +# endif + SCM_DEFINE (scm_cuserid, "cuserid", 0, 0, 0, (void), "Return a string containing a user name associated with the\n" |