Changeset 2446

Show
Ignore:
Timestamp:
01/09/07 14:22:11 (2 years ago)
Author:
dhozac
Message:

Check if dietlibc declares syscall incompatibly, to avoid errors.
Move the syscall declaration to lib/syscall-wrap.h.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/syscall-wrap.h

    r2076 r2446  
    3737#endif 
    3838 
     39#if defined(ENSC_SYSCALL_TRADITIONAL) && defined(__dietlibc__) && !defined(ENSC_DIETLIBC_HAS_SYSCALL) 
     40extern long int syscall(long int __sysno, ...); 
     41#endif 
     42 
    3943#endif  //  H_UTIL_VSERVER_LIB_SYSCALL_WRAP_H 
  • trunk/lib/vserver-internal.h

    r2437 r2446  
    254254int vserver(uint32_t cmd, uint32_t id, void *data) 
    255255{ 
    256 #if defined __dietlibc__ 
    257   extern long int syscall (long int __sysno, ...); 
    258 #endif 
    259   
    260256  return syscall(__NR_vserver, cmd, id, data); 
    261257} 
  • trunk/lib_internal/sys_clone.h

    r2421 r2446  
    4343  int parent = getpid(); 
    4444#endif 
    45 #if defined(__dietlibc__) && defined(ENSC_SYSCALL_TRADITIONAL) 
    46   extern long int syscall (long int __sysno, ...); 
    47 #endif 
    4845 
    4946#if   defined(__s390__) && defined(ENSC_SYSCALL_TRADITIONAL) 
  • trunk/lib_internal/sys_personality.h

    r2062 r2446  
    2929int sys_personality(int pers) 
    3030{ 
    31 #if defined __dietlibc__ 
    32   extern long int syscall (long int __sysno, ...); 
    33 #endif 
    34   
    3531  return syscall(__NR_sys_personality, pers); 
    3632} 
  • trunk/m4/ensc_dietlibc.m4

    r2091 r2446  
    4949        if test x"$ensc_cv_c_dietlibc_c99" = xyes; then 
    5050                AC_DEFINE(ENSC_DIETLIBC_C99,1) 
     51        fi 
     52]) 
     53 
     54AC_DEFUN([_ENSC_DIETLIBC_SYSCALL], 
     55[ 
     56        AH_TEMPLATE([ENSC_DIETLIBC_HAS_SYSCALL], [Define to 1 if dietlibc declares syscall]) 
     57 
     58        AC_CACHE_CHECK([whether dietlibc declares syscall], [ensc_cv_c_dietlibc_syscall], 
     59        [ 
     60                _ensc_dietlibc_syscall_old_CC="$CC" 
     61                CC="${DIET:-diet} $CC" 
     62 
     63                AC_LANG_PUSH(C) 
     64                AC_COMPILE_IFELSE([ 
     65                        #include <sys/syscall.h> 
     66                        long int syscall(long int __sysno, ...); 
     67                ], 
     68                [ensc_cv_c_dietlibc_syscall=no], 
     69                [ensc_cv_c_dietlibc_syscall=yes]) 
     70                AC_LANG_POP 
     71 
     72                CC="$_ensc_dietlibc_syscall_old_CC" 
     73        ]) 
     74 
     75        if test x"$ensc_cv_c_dietlibc_syscall" = xyes; then 
     76                AC_DEFINE(ENSC_DIETLIBC_HAS_SYSCALL,1) 
    5177        fi 
    5278]) 
     
    135161        if test x"$ensc_have_dietlibc" != xno; then 
    136162                _ENSC_DIETLIBC_C99 
     163                _ENSC_DIETLIBC_SYSCALL 
    137164        fi 
    138165])