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, µ);
> + 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
-------------------------------------------------------------------------
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