From fae4792e91bfd16b1d15f912dab88a90851ec8e9 Mon Sep 17 00:00:00 2001 From: Chas Williams Date: Sat, 8 May 2004 04:58:27 +0000 Subject: [PATCH] linux26-update-20040507 FIXES 4027 updates for modversions and for symbols which we don't need to grovel out of the kernel --- src/afs/LINUX/osi_misc.c | 20 +++++++++++++++----- src/afs/LINUX/osi_module.c | 15 ++++----------- src/cf/linux-test3.m4 | 5 +++-- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/afs/LINUX/osi_misc.c b/src/afs/LINUX/osi_misc.c index 280f5ee71..f0aca2f0a 100644 --- a/src/afs/LINUX/osi_misc.c +++ b/src/afs/LINUX/osi_misc.c @@ -310,15 +310,25 @@ uiomove(char *dp, int length, uio_flag_t rw, uio_t * uiop) void afs_osi_SetTime(osi_timeval_t * tvp) { - extern int (*sys_settimeofdayp) (struct timeval * tv, - struct timezone * tz); -#ifdef AFS_LINUX_64BIT_KERNEL +#if defined(AFS_LINUX24_ENV) + +#if defined(AFS_LINUX26_ENV) + struct timespec tv; + tv.tv_sec = tvp->tv_sec; + tv.tv_nsec = tvp->tv_usec * NSEC_PER_USEC; +#else struct timeval tv; - AFS_STATCNT(osi_SetTime); tv.tv_sec = tvp->tv_sec; tv.tv_usec = tvp->tv_usec; - (void)(*sys_settimeofdayp) (&tv, NULL); +#endif + + AFS_STATCNT(osi_SetTime); + + do_settimeofday(&tv); #else + extern int (*sys_settimeofdayp) (struct timeval * tv, + struct timezone * tz); + KERNEL_SPACE_DECL; AFS_STATCNT(osi_SetTime); diff --git a/src/afs/LINUX/osi_module.c b/src/afs/LINUX/osi_module.c index adc059988..c174a2a2b 100644 --- a/src/afs/LINUX/osi_module.c +++ b/src/afs/LINUX/osi_module.c @@ -48,8 +48,10 @@ MODULE_INFO(vermagic, VERMAGIC_STRING); #define __NR_setgroups32 82 /* This number is not exported for some bizarre reason. */ #endif +#if !defined(AFS_LINUX24_ENV) asmlinkage int (*sys_settimeofdayp) (struct timeval * tv, struct timezone * tz); +#endif asmlinkage long (*sys_setgroupsp) (int gidsetsize, gid_t * grouplist); #ifdef EXPORTED_SYS_CALL_TABLE @@ -188,7 +190,7 @@ init_module(void) { #if defined(AFS_IA64_LINUX20_ENV) unsigned long kernel_gp = 0; - static struct fptr sys_settimeofday, sys_setgroups; + static struct fptr sys_setgroups; #endif extern int afs_syscall(); extern long afs_xsetgroups(); @@ -400,16 +402,7 @@ init_module(void) #endif /* Initialize pointers to kernel syscalls. */ -#if defined(AFS_IA64_LINUX20_ENV) - kernel_gp = ((struct fptr *)printk)->gp; - - sys_settimeofdayp = (void *)&sys_settimeofday; - - ((struct fptr *)sys_settimeofdayp)->ip = - SYSCALL2POINTER sys_call_table[__NR_settimeofday - 1024]; - ((struct fptr *)sys_settimeofdayp)->gp = kernel_gp; - -#else /* !AFS_IA64_LINUX20_ENV */ +#if !defined(AFS_LINUX24_ENV) sys_settimeofdayp = SYSCALL2POINTER sys_call_table[__NR_settimeofday]; #endif /* AFS_IA64_LINUX20_ENV */ diff --git a/src/cf/linux-test3.m4 b/src/cf/linux-test3.m4 index 929b17d6e..53abcfab1 100644 --- a/src/cf/linux-test3.m4 +++ b/src/cf/linux-test3.m4 @@ -42,9 +42,10 @@ else AC_MSG_CHECKING(if kernel uses MODVERSIONS) AC_CACHE_VAL(ac_cv_linux_config_modversions,[ AC_TRY_COMPILE( -[#include +[#include +#include ], -[#ifndef CONFIG_MODVERSIONS +[#if !defined(CONFIG_MODVERSIONS) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) lose; #endif ], -- 2.39.5