From: Michael R. <mre...@vn...> - 2006-10-20 15:17:33
|
Patch Applied. Thanks Michael Reed Yi CDL Yang wrote: > Since 2.6.17, _syscall* isn't exported into the user space any more, so all the test cases > using _syscall* will fail to be compiled. > > This patch remove _syscall5 from llseek.c and convert to syscall provided by libc.It also > includes soem cleanups and makes the build cleaner > > This is a warning which has been fixed by this patch, just FYI: > > scsimain.c:6953: warning: passing argument 2 of print_msg discards qualifiers from pointer target type > > > Signed-off by Yi Yang <yya...@cn...> > > > --- a/testcases/kernel/fs/scsi/ltpscsi/llseek.c.orig 2006-10-17 14:34:26.000000000 +0800 > +++ b/testcases/kernel/fs/scsi/ltpscsi/llseek.c 2006-10-17 15:49:12.000000000 +0800 > @@ -13,6 +13,8 @@ > > #include <errno.h> > #include <unistd.h> > +#include <syscall.h> > +#include <linux/unistd.h> /* for __NR_llseek */ > > #if defined(__GNUC__) || defined(HAS_LONG_LONG) > typedef long long llse_loff_t; > @@ -24,37 +26,44 @@ extern llse_loff_t llse_llseek (unsigned > > #ifdef __linux__ > > -#ifdef HAVE_LLSEEK > -#include <syscall.h> > - > -#else /* HAVE_LLSEEK */ > - > #if defined(__alpha__) || defined(__ia64__) > > -#define my_llseek lseek > +#ifdef __NR_lseek > +static off_t my_lseek(int fd, off_t off, int whence) > +{ > + return syscall(__NR_lseek, fd, off, whence); > +} > +#else /* undefined __NR_lseek */ > +static off_t my_lseek(int fd, off_t off, int whence) > +{ > + errno = ENOSYS; > + return -1; > +} > +#endif /* __NR_lseek */ > > -#else > -#include <linux/unistd.h> /* for __NR__llseek */ > +#define my_llseek my_lseek > + > +#else /* !__alpha__ && !__ia64__ */ > > static int _llseek (unsigned int, unsigned long, > unsigned long, llse_loff_t *, unsigned int); > > -#ifdef __NR__llseek > - > -static _syscall5(int,_llseek,unsigned int,fd,unsigned long,offset_high, > - unsigned long, offset_low,llse_loff_t *,result, > - unsigned int, origin) > - > -#else > > -/* no __NR__llseek on compilation machine - might give it explicitly */ > +#ifndef __NR_llseek > +/* no __NR_llseek on compilation machine - might give it explicitly */ > static int _llseek (unsigned int fd, unsigned long oh, > unsigned long ol, llse_loff_t *result, > unsigned int origin) { > errno = ENOSYS; > return -1; > } > - > +#else > +static int _llseek (unsigned int fd, unsigned long oh, > + unsigned long ol, llse_loff_t *result, > + unsigned int origin) > +{ > + return syscall(__NR_llseek, fd, oh, ol, result, origin); > +} > #endif > > static llse_loff_t my_llseek (unsigned int fd, llse_loff_t offset, > @@ -71,8 +80,6 @@ static llse_loff_t my_llseek (unsigned i > > #endif /* __alpha__ */ > > -#endif /* HAVE_LLSEEK */ > - > llse_loff_t llse_llseek (unsigned int fd, llse_loff_t offset, > unsigned int origin) > { > --- a/testcases/kernel/fs/scsi/ltpscsi/scsimain.c.orig 2006-10-17 15:32:40.000000000 +0800 > +++ b/testcases/kernel/fs/scsi/ltpscsi/scsimain.c 2006-10-17 15:34:05.000000000 +0800 > @@ -428,7 +428,7 @@ int do_scsi_start_stop(char * device, in > int do_scsi_read_write_buffer (char * device); > int do_scsi_test_unit_ready(char * device); > int show_scsi_info(char * device); > -void print_msg(int msg_num, char * msg); > +void print_msg(int msg_num, const char * msg); > static void scan_dev_type(const char * leadin, int max_dev, int do_numeric, > int lin_dev_type, int last_sg_ind); > > @@ -440,7 +440,7 @@ int sg3_inq(int sg_fd, unsigned char * i > static unsigned char inqCmdBlk [INQUIRY_CMDLEN] = > {0x12, 0, 0, 0, INQ_REPLY_LEN, 0}; > > -void print_msg(int msg_num, char * msg) > +void print_msg(int msg_num, const char * msg) > { > switch(msg_num) > { > > > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > ------------------------------------------------------------------------ > > _______________________________________________ > Ltp-list mailing list > Ltp...@li... > https://lists.sourceforge.net/lists/listinfo/ltp-list > |