Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

Location:
vendor/current/lib/replace
Files:
9 added
1 deleted
20 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/lib/replace/README

    r414 r740  
    3434telldir
    3535seekdir
     36clock_gettime
    3637closedir
    3738dlopen
     
    7677bool
    7778socklen_t
    78 uint_t
    7979uint{8,16,32,64}_t
    8080int{8,16,32,64}_t
  • vendor/current/lib/replace/autoconf-2.60.m4

    r414 r740  
    182182m4_ifndef([AC_USE_SYSTEM_EXTENSIONS],[
    183183AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
    184 [
    185   AC_BEFORE([$0], [AC_COMPILE_IFELSE])
    186   AC_BEFORE([$0], [AC_RUN_IFELSE])
    187 
    188   AC_REQUIRE([AC_GNU_SOURCE])
    189   AC_REQUIRE([AC_AIX])
    190   AC_REQUIRE([AC_MINIX])
     184[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
     185AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
     186
     187  AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
     188  if test "$MINIX" = yes; then
     189    AC_DEFINE([_POSIX_SOURCE], [1],
     190      [Define to 1 if you need to in order for `stat' and other
     191       things to work.])
     192    AC_DEFINE([_POSIX_1_SOURCE], [2],
     193      [Define to 2 if the system does not provide POSIX.1 features
     194       except with this defined.])
     195    AC_DEFINE([_MINIX], [1],
     196      [Define to 1 if on MINIX.])
     197  fi
    191198
    192199  AH_VERBATIM([__EXTENSIONS__],
    193 [/* Enable extensions on Solaris.  */
     200[/* Enable extensions on AIX 3, Interix.  */
     201#ifndef _ALL_SOURCE
     202# undef _ALL_SOURCE
     203#endif
     204/* Enable GNU extensions on systems that have them.  */
     205#ifndef _GNU_SOURCE
     206# undef _GNU_SOURCE
     207#endif
     208/* Enable threading extensions on Solaris.  */
     209#ifndef _POSIX_PTHREAD_SEMANTICS
     210# undef _POSIX_PTHREAD_SEMANTICS
     211#endif
     212/* Enable extensions on HP NonStop.  */
     213#ifndef _TANDEM_SOURCE
     214# undef _TANDEM_SOURCE
     215#endif
     216/* Enable general extensions on Solaris.  */
    194217#ifndef __EXTENSIONS__
    195218# undef __EXTENSIONS__
    196219#endif
    197 #ifndef _POSIX_PTHREAD_SEMANTICS
    198 # undef _POSIX_PTHREAD_SEMANTICS
    199 #endif])
     220])
    200221  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
    201222    [ac_cv_safe_to_define___extensions__],
    202223    [AC_COMPILE_IFELSE(
    203        [AC_LANG_PROGRAM([
     224       [AC_LANG_PROGRAM([[
    204225#         define __EXTENSIONS__ 1
    205           AC_INCLUDES_DEFAULT])],
     226          ]AC_INCLUDES_DEFAULT])],
    206227       [ac_cv_safe_to_define___extensions__=yes],
    207228       [ac_cv_safe_to_define___extensions__=no])])
    208229  test $ac_cv_safe_to_define___extensions__ = yes &&
    209230    AC_DEFINE([__EXTENSIONS__])
     231  AC_DEFINE([_ALL_SOURCE])
     232  AC_DEFINE([_GNU_SOURCE])
    210233  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
    211 ])
    212 ])
     234  AC_DEFINE([_TANDEM_SOURCE])
     235])# AC_USE_SYSTEM_EXTENSIONS
     236])
  • vendor/current/lib/replace/crypt.c

    r414 r740  
    4747
    4848#ifndef long32
    49 #define long32 int32
     49#define long32 int32_t
    5050#endif
    5151
    5252#ifndef long64
    53 #define long64 int64
     53#define long64 int64_t
    5454#endif
    5555
     
    666666     */
    667667    clearmem(ktab, sizeof ktab);
    668     StrnCpy(ktab, key, 8);
     668    strncpy(ktab, key, 8);
    669669    ufc_mk_keytab(ktab);
    670670
  • vendor/current/lib/replace/getifaddrs.c

    r414 r740  
    283283
    284284        while (i > 0) {
    285                 uint_t inc;
     285                unsigned int inc;
    286286
    287287                inc = ifr->ifr_addr.sa_len;
  • vendor/current/lib/replace/getpass.c

    r414 r740  
    3535#endif
    3636
    37 #ifndef SIGNAL_CAST
    38 #define SIGNAL_CAST (RETSIGTYPE (*)(int))
    39 #endif
    40 
    4137#ifdef SYSV_TERMIO
    4238
     
    10096#endif /* SYSV_TERMIO */
    10197
    102 static void catch_signal(int signum,void (*handler)(int ))
     98static void catch_signal(int signum, void (*handler)(int ))
    10399{
    104100#ifdef HAVE_SIGACTION
     
    132128****************************************************************/
    133129
    134 static void gotintr_sig(void)
     130static void gotintr_sig(int signum)
    135131{
    136132        gotintr = 1;
     
    149145
    150146        /* Catch problematic signals */
    151         catch_signal(SIGINT, SIGNAL_CAST gotintr_sig);
     147        catch_signal(SIGINT, gotintr_sig);
    152148
    153149        /* Try to write to and read from the terminal if we can.
     
    212208
    213209        /* Catch problematic signals */
    214         catch_signal(SIGINT, SIGNAL_CAST SIG_DFL);
     210        catch_signal(SIGINT, SIG_DFL);
    215211
    216212        if (gotintr) {
    217                 printf("Interupted by signal.\n");
     213                printf("Interrupted by signal.\n");
    218214                fflush(stdout);
    219215                exit(1);
  • vendor/current/lib/replace/libreplace.m4

    r414 r740  
    5252LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/snprintf.o"
    5353
    54 AC_TYPE_SIGNAL
    5554AC_TYPE_UID_T
    5655AC_TYPE_MODE_T
     
    9190)
    9291
     92AC_CHECK_HEADERS(linux/types.h)
     93
    9394AC_CACHE_CHECK([for working mmap],libreplace_cv_HAVE_MMAP,[
    9495AC_TRY_RUN([#include "$libreplacedir/test/shared_mmap.c"],
     
    106107AC_CHECK_HEADERS(unix.h)
    107108
    108 AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror)
     109AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror strerror_r)
    109110AC_CHECK_FUNCS(vsyslog setlinebuf mktime ftruncate chsize rename)
    110111AC_CHECK_FUNCS(waitpid wait4 strlcpy strlcat initgroups memmove strdup)
    111 AC_CHECK_FUNCS(pread pwrite strndup strcasestr strtok_r mkdtemp dup2)
     112AC_CHECK_FUNCS(pread pwrite strndup strcasestr strtok_r mkdtemp dup2 dprintf vdprintf)
    112113AC_CHECK_FUNCS(isatty chown lchown link readlink symlink realpath)
     114AC_CHECK_FUNCS(fdatasync,,[
     115        # if we didn't find it, look in librt (Solaris hides it there...)
     116        AC_CHECK_LIB(rt, fdatasync,
     117                [libreplace_cv_HAVE_FDATASYNC_IN_LIBRT=yes
     118                AC_DEFINE(HAVE_FDATASYNC, 1, Define to 1 if there is support for fdatasync)])
     119])
     120AC_HAVE_DECL(fdatasync, [#include <unistd.h>])
     121AC_CHECK_FUNCS(clock_gettime,libreplace_cv_have_clock_gettime=yes,[
     122        AC_CHECK_LIB(rt, clock_gettime,
     123                [libreplace_cv_HAVE_CLOCK_GETTIME_IN_LIBRT=yes
     124                libreplace_cv_have_clock_gettime=yes
     125                AC_DEFINE(HAVE_CLOCK_GETTIME, 1, Define to 1 if there is support for clock_gettime)])
     126])
     127AC_CHECK_FUNCS(get_current_dir_name)
    113128AC_HAVE_DECL(setresuid, [#include <unistd.h>])
    114129AC_HAVE_DECL(setresgid, [#include <unistd.h>])
     
    229244AC_CHECK_FUNCS(strtoull __strtoull strtouq strtoll __strtoll strtoq)
    230245
     246AC_CHECK_FUNCS(memmem)
     247
    231248# this test disabled as we don't actually need __VA_ARGS__ yet
    232249AC_TRY_CPP([
     
    281298m4_include(crypt.m4)
    282299
     300if test x$libreplace_cv_have_clock_gettime = xyes ; then
     301        SMB_CHECK_CLOCK_ID(CLOCK_MONOTONIC)
     302        SMB_CHECK_CLOCK_ID(CLOCK_PROCESS_CPUTIME_ID)
     303        SMB_CHECK_CLOCK_ID(CLOCK_REALTIME)
     304fi
     305
     306AC_CACHE_CHECK([for struct timespec type],libreplace_cv_struct_timespec, [
     307    AC_TRY_COMPILE([
     308#include <sys/types.h>
     309#if STDC_HEADERS
     310#include <stdlib.h>
     311#include <stddef.h>
     312#endif
     313#if TIME_WITH_SYS_TIME
     314# include <sys/time.h>
     315# include <time.h>
     316#else
     317# if HAVE_SYS_TIME_H
     318#  include <sys/time.h>
     319# else
     320#  include <time.h>
     321# endif
     322#endif
     323],[struct timespec ts;],
     324        libreplace_cv_struct_timespec=yes,libreplace_cv_struct_timespec=no)])
     325if test x"$libreplace_cv_struct_timespec" = x"yes"; then
     326   AC_DEFINE(HAVE_STRUCT_TIMESPEC,1,[Whether we have struct timespec])
     327fi
     328
    283329AC_CHECK_FUNCS([printf memset memcpy],,[AC_MSG_ERROR([Required function not found])])
    284330
     
    309355m4_include(libreplace_macros.m4)
    310356
     357
     358dnl SMB_CHECK_CLOCK_ID(clockid)
     359dnl Test whether the specified clock_gettime clock ID is available. If it
     360dnl is, we define HAVE_clockid
     361AC_DEFUN([SMB_CHECK_CLOCK_ID],
     362[
     363    AC_MSG_CHECKING(for $1)
     364    AC_TRY_LINK([
     365#if TIME_WITH_SYS_TIME
     366# include <sys/time.h>
     367# include <time.h>
     368#else
     369# if HAVE_SYS_TIME_H
     370#  include <sys/time.h>
     371# else
     372#  include <time.h>
     373# endif
     374#endif
     375    ],
     376    [
     377clockid_t clk = $1;
     378    ],
     379    [
     380        AC_MSG_RESULT(yes)
     381        AC_DEFINE(HAVE_$1, 1,
     382            [Whether the clock_gettime clock ID $1 is available])
     383    ],
     384    [
     385        AC_MSG_RESULT(no)
     386    ])
     387])
    311388m4_ifndef([AC_USE_SYSTEM_EXTENSIONS],[m4_include(autoconf-2.60.m4)])
  • vendor/current/lib/replace/libreplace_cc.m4

    r414 r740  
    116116AC_CHECK_SIZEOF(long long)
    117117
    118 AC_CHECK_TYPE(uint_t, unsigned int)
    119118AC_CHECK_TYPE(int8_t, char)
    120119AC_CHECK_TYPE(uint8_t, unsigned char)
  • vendor/current/lib/replace/libreplace_macros.m4

    r414 r740  
    294294                }
    295295        ])],[
    296                 AS_TR_SH([ac_cv_c_prototype_$1])=yes
     296                eval AS_TR_SH([ac_cv_c_prototype_$1])=yes
    297297        ],[
    298                 AS_TR_SH([ac_cv_c_prototype_$1])=no
     298                eval AS_TR_SH([ac_cv_c_prototype_$1])=no
    299299        ])
    300300)
  • vendor/current/lib/replace/libreplace_network.m4

    r478 r740  
    115115fi
    116116
    117 dnl The following test is roughl taken from the cvs sources.
     117dnl The following test is roughly taken from the cvs sources.
    118118dnl
    119119dnl If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
     
    227227],
    228228libreplace_cv_HAVE_GETADDRINFO=yes,libreplace_cv_HAVE_GETADDRINFO=no)])
     229
     230if test x"$libreplace_cv_HAVE_GETADDRINFO" = x"yes"; then
     231        # getaddrinfo is broken on some AIX systems
     232        # see bug 5910, use our replacements if we detect
     233        # a broken system.
     234        AC_TRY_RUN([
     235                #include <stddef.h>
     236                #include <sys/types.h>
     237                #include <sys/socket.h>
     238                #include <netdb.h>
     239                int main(int argc, const char *argv[])
     240                {
     241                        struct addrinfo hints = {0,};
     242                        struct addrinfo *ppres;
     243                        const char hostname1[] = "0.0.0.0";
     244                        const char hostname2[] = "127.0.0.1";
     245                        const char hostname3[] = "::";
     246                        hints.ai_socktype = SOCK_STREAM;
     247                        hints.ai_family = AF_UNSPEC;
     248                        hints.ai_flags =
     249                                AI_NUMERICHOST|AI_PASSIVE|AI_ADDRCONFIG;
     250                        /* Test for broken flag combination on AIX. */
     251                        if (getaddrinfo(hostname1, NULL, &hints, &ppres) == EAI_BADFLAGS) {
     252                                /* This fails on an IPv6-only box, but not with
     253                                   the EAI_BADFLAGS error. */
     254                                return 1;
     255                        }
     256                        if (getaddrinfo(hostname2, NULL, &hints, &ppres) == 0) {
     257                                /* IPv4 lookup works - good enough. */
     258                                return 0;
     259                        }
     260                        /* Uh-oh, no IPv4. Are we IPv6-only ? */
     261                        return getaddrinfo(hostname3, NULL, &hints, &ppres) != 0 ? 1 : 0;
     262                }],
     263                libreplace_cv_HAVE_GETADDRINFO=yes,
     264                libreplace_cv_HAVE_GETADDRINFO=no)
     265fi
     266
    229267if test x"$libreplace_cv_HAVE_GETADDRINFO" = x"yes"; then
    230268        AC_DEFINE(HAVE_GETADDRINFO,1,[Whether the system has getaddrinfo])
  • vendor/current/lib/replace/replace.c

    r414 r740  
    44   Copyright (C) Andrew Tridgell 1992-1998
    55   Copyright (C) Jelmer Vernooij 2005-2008
     6   Copyright (C) Matthieu Patou  2010
    67
    78     ** NOTE! The following LGPL license applies to the replace
     
    410411{
    411412        /* have a reasonable go at emulating it. Hope that
    412            the system mktemp() isn't completly hopeless */
     413           the system mktemp() isn't completely hopeless */
    413414        char *p = mktemp(template);
    414415        if (!p)
     
    503504#endif
    504505
     506
    505507#ifndef HAVE_STRTOLL
    506508long long int rep_strtoll(const char *str, char **endptr, int base)
     
    516518#endif
    517519}
    518 #endif
     520#else
     521#ifdef HAVE_BSD_STRTOLL
     522#ifdef HAVE_STRTOQ
     523long long int rep_strtoll(const char *str, char **endptr, int base)
     524{
     525        long long int nb = strtoq(str, endptr, base);
     526        /* In linux EINVAL is only returned if base is not ok */
     527        if (errno == EINVAL) {
     528                if (base == 0 || (base >1 && base <37)) {
     529                        /* Base was ok so it's because we were not
     530                         * able to make the convertion.
     531                         * Let's reset errno.
     532                         */
     533                        errno = 0;
     534                }
     535        }
     536        return nb;
     537}
     538#else
     539#error "You need the strtoq function"
     540#endif /* HAVE_STRTOQ */
     541#endif /* HAVE_BSD_STRTOLL */
     542#endif /* HAVE_STRTOLL */
    519543
    520544
     
    532556#endif
    533557}
    534 #endif
     558#else
     559#ifdef HAVE_BSD_STRTOLL
     560#ifdef HAVE_STRTOUQ
     561unsigned long long int rep_strtoull(const char *str, char **endptr, int base)
     562{
     563        unsigned long long int nb = strtouq(str, endptr, base);
     564        /* In linux EINVAL is only returned if base is not ok */
     565        if (errno == EINVAL) {
     566                if (base == 0 || (base >1 && base <37)) {
     567                        /* Base was ok so it's because we were not
     568                         * able to make the convertion.
     569                         * Let's reset errno.
     570                         */
     571                        errno = 0;
     572                }
     573        }
     574        return nb;
     575}
     576#else
     577#error "You need the strtouq function"
     578#endif /* HAVE_STRTOUQ */
     579#endif /* HAVE_BSD_STRTOLL */
     580#endif /* HAVE_STRTOULL */
    535581
    536582#ifndef HAVE_SETENV
     
    682728}
    683729#endif
     730
     731
     732#ifndef HAVE_MEMMEM
     733void *rep_memmem(const void *haystack, size_t haystacklen,
     734                 const void *needle, size_t needlelen)
     735{
     736        if (needlelen == 0) {
     737                return discard_const(haystack);
     738        }
     739        while (haystacklen >= needlelen) {
     740                char *p = (char *)memchr(haystack, *(const char *)needle,
     741                                         haystacklen-(needlelen-1));
     742                if (!p) return NULL;
     743                if (memcmp(p, needle, needlelen) == 0) {
     744                        return p;
     745                }
     746                haystack = p+1;
     747                haystacklen -= (p - (const char *)haystack) + 1;
     748        }
     749        return NULL;
     750}
     751#endif
     752
     753#ifndef HAVE_VDPRINTF
     754int rep_vdprintf(int fd, const char *format, va_list ap)
     755{
     756        char *s = NULL;
     757        int ret;
     758
     759        vasprintf(&s, format, ap);
     760        if (s == NULL) {
     761                errno = ENOMEM;
     762                return -1;
     763        }
     764        ret = write(fd, s, strlen(s));
     765        free(s);
     766        return ret;
     767}
     768#endif
     769
     770#ifndef HAVE_DPRINTF
     771int rep_dprintf(int fd, const char *format, ...)
     772{
     773        int ret;
     774        va_list ap;
     775
     776        va_start(ap, format);
     777        ret = vdprintf(fd, format, ap);
     778        va_end(ap);
     779
     780        return ret;
     781}
     782#endif
     783
     784#ifndef HAVE_GET_CURRENT_DIR_NAME
     785char *rep_get_current_dir_name(void)
     786{
     787        char buf[PATH_MAX+1];
     788        char *p;
     789        p = getcwd(buf, sizeof(buf));
     790        if (p == NULL) {
     791                return NULL;
     792        }
     793        return strdup(p);
     794}
     795#endif
     796
     797#if !defined(HAVE_STRERROR_R) || !defined(STRERROR_R_PROTO_COMPATIBLE)
     798int rep_strerror_r(int errnum, char *buf, size_t buflen)
     799{
     800        char *s = strerror(errnum);
     801        if (strlen(s)+1 > buflen) {
     802                errno = ERANGE;
     803                return -1;
     804        }
     805        strncpy(buf, s, buflen);
     806        return 0;
     807}
     808#endif
     809
     810#ifndef HAVE_CLOCK_GETTIME
     811int rep_clock_gettime(clockid_t clk_id, struct timespec *tp)
     812{
     813        struct timeval tval;
     814        switch (clk_id) {
     815                case 0: /* CLOCK_REALTIME :*/
     816#ifdef HAVE_GETTIMEOFDAY_TZ
     817                        gettimeofday(&tval,NULL);
     818#else
     819                        gettimeofday(&tval);
     820#endif
     821                        tp->tv_sec = tval.tv_sec;
     822                        tp->tv_nsec = tval.tv_usec * 1000;
     823                        break;
     824                default:
     825                        errno = EINVAL;
     826                        return -1;
     827        }
     828        return 0;
     829}
     830#endif
  • vendor/current/lib/replace/replace.h

    r414 r740  
    8282# define PRIi8          "i"
    8383#endif
    84 #ifndef PRIi8
     84#ifndef PRIi16
    8585# define PRIi16         "i"
    8686#endif
    87 #ifndef PRIi8
     87#ifndef PRIi32
    8888# define PRIi32         "i"
    8989#endif
    90 #ifndef PRIi8
     90#ifndef PRIi64
    9191# define PRIi64         __PRI64_PREFIX "i"
    9292#endif
     
    122122#endif
    123123
     124#ifdef HAVE_LINUX_TYPES_H
     125/*
     126 * This is needed as some broken header files require this to be included early
     127 */
     128#include <linux/types.h>
     129#endif
     130
    124131#ifndef HAVE_STRERROR
    125132extern char *sys_errlist[];
     
    139146#define memmove rep_memmove
    140147void *rep_memmove(void *dest,const void *src,int size);
     148#endif
     149
     150#ifndef HAVE_MEMMEM
     151#define memmem rep_memmem
     152void *rep_memmem(const void *haystack, size_t haystacklen,
     153                 const void *needle, size_t needlelen);
    141154#endif
    142155
     
    278291#endif
    279292
     293
     294
    280295#ifndef HAVE_STRTOLL
    281296#define strtoll rep_strtoll
    282297long long int rep_strtoll(const char *str, char **endptr, int base);
     298#else
     299#ifdef HAVE_BSD_STRTOLL
     300#define strtoll rep_strtoll
     301long long int rep_strtoll(const char *str, char **endptr, int base);
     302#endif
    283303#endif
    284304
     
    286306#define strtoull rep_strtoull
    287307unsigned long long int rep_strtoull(const char *str, char **endptr, int base);
     308#else
     309#ifdef HAVE_BSD_STRTOLL /* yes, it's not HAVE_BSD_STRTOULL */
     310#define strtoull rep_strtoull
     311unsigned long long int rep_strtoull(const char *str, char **endptr, int base);
     312#endif
    288313#endif
    289314
     
    329354#define socketpair rep_socketpair
    330355/* prototype is in system/network.h */
     356#endif
     357
     358#ifndef HAVE_VDPRINTF
     359#define vdprintf rep_vdprintf
     360int rep_vdprintf(int fd, const char *format, va_list ap);
     361#endif
     362
     363#ifndef HAVE_DPRINTF
     364#define dprintf rep_dprintf
     365int rep_dprintf(int fd, const char *format, ...);
    331366#endif
    332367
     
    490525#define freeifaddrs rep_freeifaddrs
    491526/* prototype is in "system/network.h" */
     527#endif
     528
     529#ifndef HAVE_GET_CURRENT_DIR_NAME
     530#define get_current_dir_name rep_get_current_dir_name
     531char *rep_get_current_dir_name(void);
     532#endif
     533
     534#if !defined(HAVE_STRERROR_R) || !defined(STRERROR_R_PROTO_COMPATIBLE)
     535#undef strerror_r
     536#define strerror_r rep_strerror_r
     537int rep_strerror_r(int errnum, char *buf, size_t buflen);
     538#endif
     539
     540#if !defined(HAVE_CLOCK_GETTIME)
     541#define clock_gettime rep_clock_gettime
    492542#endif
    493543
     
    724774#endif
    725775
     776#ifndef HAVE_FDATASYNC
     777#define fdatasync(fd) fsync(fd)
     778#elif !defined(HAVE_DECL_FDATASYNC)
     779int fdatasync(int );
     780#endif
     781
     782/* these are used to mark symbols as local to a shared lib, or
     783 * publicly available via the shared lib API */
     784#ifndef _PUBLIC_
     785#ifdef HAVE_VISIBILITY_ATTR
     786#define _PUBLIC_ __attribute__((visibility("default")))
     787#else
     788#define _PUBLIC_
     789#endif
     790#endif
     791
     792#ifndef _PRIVATE_
     793#ifdef HAVE_VISIBILITY_ATTR
     794#  define _PRIVATE_ __attribute__((visibility("hidden")))
     795#else
     796#  define _PRIVATE_
     797#endif
     798#endif
     799
     800#ifndef HAVE_POLL
     801#define poll rep_poll
     802/* prototype is in "system/network.h" */
     803#endif
     804
    726805#endif /* _LIBREPLACE_REPLACE_H */
  • vendor/current/lib/replace/system/config.m4

    r618 r740  
    77AC_CHECK_HEADERS(sys/select.h)
    88
     9# poll
     10AC_CHECK_HEADERS(poll.h)
     11AC_CHECK_FUNCS(poll,[],[LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/poll.o"])
     12
    913# time
    1014AC_CHECK_HEADERS(sys/time.h utime.h)
    1115AC_HEADER_TIME
    1216AC_CHECK_FUNCS(utime utimes)
     17
     18AC_CACHE_CHECK([if gettimeofday takes TZ argument],libreplace_cv_HAVE_GETTIMEOFDAY_TZ,[
     19AC_TRY_RUN([
     20#include <sys/time.h>
     21#include <unistd.h>
     22main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
     23           libreplace_cv_HAVE_GETTIMEOFDAY_TZ=yes,libreplace_cv_HAVE_GETTIMEOFDAY_TZ=no,libreplace_cv_HAVE_GETTIMEOFDAY_TZ=yes)])
     24if test x"$libreplace_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
     25    AC_DEFINE(HAVE_GETTIMEOFDAY_TZ,1,[Whether gettimeofday() is available])
     26fi
    1327
    1428# wait
  • vendor/current/lib/replace/system/network.h

    r478 r740  
    308308#define ss_family sin6_family
    309309#define HAVE_SS_FAMILY 1
    310 #else
     310#else /*HAVE_STRUCT_SOCKADDR_IN6*/
    311311#define sockaddr_storage sockaddr_in
    312312#define ss_family sin_family
    313313#define HAVE_SS_FAMILY 1
    314 #endif
    315 #endif
     314#endif /*HAVE_STRUCT_SOCKADDR_IN6*/
     315#endif /*HAVE_STRUCT_SOCKADDR_STORAGE*/
    316316
    317317#ifndef HAVE_SS_FAMILY
     
    332332     */
    333333#   define IOV_MAX 512
    334 #  else
    335 #   error IOV_MAX and UIO_MAXIOV undefined
    336334#  endif
    337335# endif
  • vendor/current/lib/replace/system/passwd.h

    r414 r740  
    102102
    103103#ifdef NSS_WRAPPER
     104#ifndef NSS_WRAPPER_DISABLE
    104105#ifndef NSS_WRAPPER_NOT_REPLACE
    105106#define NSS_WRAPPER_REPLACE
    106 #endif
     107#endif /* NSS_WRAPPER_NOT_REPLACE */
    107108#include "../nss_wrapper/nss_wrapper.h"
    108 #endif
     109#endif /* NSS_WRAPPER_DISABLE */
     110#endif /* NSS_WRAPPER */
    109111
    110112#endif
  • vendor/current/lib/replace/system/readline.h

    r414 r740  
    4444
    4545#ifdef HAVE_NEW_LIBREADLINE
    46 #  define RL_COMPLETION_CAST (rl_completion_func_t *)
     46#ifdef HAVE_CPPFUNCTION
     47#  define RL_COMPLETION_CAST (CPPFunction *)
     48#elif HAVE_RL_COMPLETION_T
     49#  define RL_COMPLETION_CAST (rl_completion_t *)
     50#else
     51#  define RL_COMPLETION_CAST
     52#endif
    4753#else
    4854/* This type is missing from libreadline<4.0  (approximately) */
  • vendor/current/lib/replace/system/select.h

    r414 r740  
    3939#endif
    4040
     41#ifdef HAVE_POLL
     42
     43#include <poll.h>
     44
     45#else
     46
     47/* Type used for the number of file descriptors.  */
     48typedef unsigned long int nfds_t;
     49
     50/* Data structure describing a polling request.  */
     51struct pollfd
     52{
     53        int fd;            /* File descriptor to poll.  */
     54        short int events;  /* Types of events poller cares about.  */
     55        short int revents; /* Types of events that actually occurred.  */
     56};
     57
     58/* Event types that can be polled for.  These bits may be set in `events'
     59   to indicate the interesting event types; they will appear in `revents'
     60   to indicate the status of the file descriptor.  */
     61#define POLLIN          0x001           /* There is data to read.  */
     62#define POLLPRI         0x002           /* There is urgent data to read.  */
     63#define POLLOUT         0x004           /* Writing now will not block.  */
     64#define POLLRDNORM      0x040           /* Normal data may be read.  */
     65#define POLLRDBAND      0x080           /* Priority data may be read.  */
     66#define POLLWRNORM      0x100           /* Writing now will not block.  */
     67#define POLLWRBAND      0x200           /* Priority data may be written.  */
     68#define POLLERR         0x008           /* Error condition.  */
     69#define POLLHUP         0x010           /* Hung up.  */
     70#define POLLNVAL        0x020           /* Invalid polling request.  */
     71
     72/* define is in "replace.h" */
     73int rep_poll(struct pollfd *fds, nfds_t nfds, int timeout);
     74
    4175#endif
     76
     77#endif
  • vendor/current/lib/replace/system/time.h

    r414 r740  
    4747#endif
    4848
     49#ifndef HAVE_STRUCT_TIMESPEC
     50struct timespec {
     51        time_t tv_sec;            /* Seconds.  */
     52        long tv_nsec;           /* Nanoseconds.  */
     53};
     54#endif
     55
    4956#ifndef HAVE_MKTIME
    5057/* define is in "replace.h" */
     
    6774#endif
    6875
     76#ifndef HAVE_CLOCK_GETTIME
     77/* CLOCK_REALTIME is required by POSIX */
     78#define CLOCK_REALTIME 0
     79typedef int clockid_t;
     80int rep_clock_gettime(clockid_t clk_id, struct timespec *tp);
    6981#endif
     82/* make sure we have a best effort CUSTOM_CLOCK_MONOTONIC we can rely on */
     83#if defined(CLOCK_MONOTONIC)
     84#define CUSTOM_CLOCK_MONOTONIC CLOCK_MONOTONIC
     85#elif defined(CLOCK_HIGHRES)
     86#define CUSTOM_CLOCK_MONOTONIC CLOCK_HIGHRES
     87#else
     88#define CUSTOM_CLOCK_MONOTONIC CLOCK_REALTIME
     89#endif
     90
     91#endif
  • vendor/current/lib/replace/system/wait.h

    r618 r740  
    3737#endif
    3838
    39 #ifndef SIGNAL_CAST
    40 #define SIGNAL_CAST (RETSIGTYPE (*)(int))
    41 #endif
    42 
    4339#ifdef HAVE_SETJMP_H
    4440#include <setjmp.h>
  • vendor/current/lib/replace/test/os2_delete.c

    r414 r740  
    4747                char fname[40];
    4848                int fd;
    49                 sprintf(fname, TESTDIR "/test%u.txt", i);
     49                snprintf(fname, sizeof(fname), TESTDIR "/test%u.txt", i);
    5050                fd = open(fname, O_CREAT|O_RDWR, 0600);
    5151                if (fd < 0) {
     
    8080        for (j=0; j<MIN(i, DELETE_SIZE); j++) {
    8181                char fname[40];
    82                 sprintf(fname, TESTDIR "/%s", names[j]);
     82                snprintf(fname, sizeof(fname), TESTDIR "/%s", names[j]);
    8383                unlink(fname) == 0 || FAILED("unlink");
    8484        }
  • vendor/current/lib/replace/test/testsuite.c

    r414 r740  
    752752bool
    753753socklen_t
    754 uint_t
    755754uint{8,16,32,64}_t
    756755int{8,16,32,64}_t
     
    773772        printf("test: FUNCTION\n");
    774773        if (strcmp(__FUNCTION__, "test_FUNCTION") != 0) {
    775                 printf("failure: FAILURE [\nFAILURE invalid\n]\n");
     774                printf("failure: FUNCTION [\nFUNCTION invalid\n]\n");
    776775                return false;
    777776        }
     
    10151014        return true;
    10161015}
     1016
     1017static int test_memmem(void)
     1018{
     1019        char *s;
     1020
     1021        printf("test: memmem\n");
     1022
     1023        s = (char *)memmem("foo", 3, "fo", 2);
     1024        if (strcmp(s, "foo") != 0) {
     1025                printf(__location__ ": Failed memmem\n");
     1026                return false;
     1027        }
     1028
     1029        s = (char *)memmem("foo", 3, "", 0);
     1030        /* it is allowable for this to return NULL (as happens on
     1031           FreeBSD) */
     1032        if (s && strcmp(s, "foo") != 0) {
     1033                printf(__location__ ": Failed memmem\n");
     1034                return false;
     1035        }
     1036
     1037        s = (char *)memmem("foo", 4, "o", 1);
     1038        if (strcmp(s, "oo") != 0) {
     1039                printf(__location__ ": Failed memmem\n");
     1040                return false;
     1041        }
     1042
     1043        s = (char *)memmem("foobarfodx", 11, "fod", 3);
     1044        if (strcmp(s, "fodx") != 0) {
     1045                printf(__location__ ": Failed memmem\n");
     1046                return false;
     1047        }
     1048
     1049        printf("success: memmem\n");
     1050
     1051        return true;
     1052}
     1053
    10171054
    10181055struct torture_context;
     
    10661103        ret &= test_utime();
    10671104        ret &= test_utimes();
     1105        ret &= test_memmem();
    10681106
    10691107        return ret;
Note: See TracChangeset for help on using the changeset viewer.