Quoting Rishikesh ([EMAIL PROTECTED]):
> Dave Hansen wrote:
> > On Thu, 2007-04-19 at 17:09 +0530, Rishikesh wrote:
> >> +int kernel_version_newenough()
> >> +{
> >> +       int ret;
> >> +       struct utsname buf;
> >> +       char *s;
> >> +       int maj, min, micro;
> >> +
> >> +       ret = uname(&buf);
> >> +       if (ret == -1) {
> >> +               perror("uname");
> >> +               return 0;
> >> +       }
> >> +       s = buf.release;
> >> +       sscanf(s, "%d.%d.%d", &maj, &min, &micro);
> >> +       if (maj < 2)
> >> +               return 0;
> >> +       if (min < 6)
> >> +               return 0;
> >> +       if (micro < 19)
> >> +               return 0;
> >> +       return 1;
> >> +} 
> > 
> > Does LTP usually check for version numbers like this?  I can't imagine
> > this is new territory.
> > 
> > A much better and more flexible function would be:
> > 
> >     kernel_version_after(int major, int minor, int micro)
> > 
> > -- Dave
> >
> 
> Hey dave,
> 
> Ya it's true LTP is having the library for checking kernel 
> version (ltp-full-20070331/lib/tst_kvercmp.c ), but as i think 
> this implementation is because of checking the uts name space 
> kernel version, please correct me serge if i am wrong.Since UTS 
> namespace implementation introduced around 2.6.19, so we are just 
> checking for the version for above than that, and it also assumes 
> that kernel before than that version it is not available.

If there is an LTP function to check for kernel version, clearly that
should be used here.

thanks,
-serge

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to