lkml.org 
[lkml]   [2003]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectSame syscall is defined to different numbers on 3 different archs(was Re: Makefile issue)
From
Date

Sorry for the delay in response.....I was very busy with this month's
release. I reviewed the testcase, and you have coded it the correct way
using __syscall. I believe the problem is that we need to define
__NR_timer_create/delete in the test itself. I tried this and the test
compiled and executed correctly. However, I looked at the kernel, and it
seems that there is a BUG in the code....there are different numbers
assigned to the timer system calls for different archs:

# grep -r __NR_timer_create /usr/src/linux-2.5.66/include/*
/usr/src/linux-2.5.66/include/asm-i386/unistd.h:#define __NR_timer_create
259
/usr/src/linux-2.5.66/include/asm-ppc/unistd.h:#define __NR_timer_create
240
/usr/src/linux-2.5.66/include/asm-ppc64/unistd.h:#define __NR_timer_create
240
/usr/src/linux-2.5.66/include/asm-x86_64/unistd.h:#define __NR_timer_create
222

# grep -r __NR_timer_delete /usr/src/linux-2.5.66/include/*
/usr/src/linux-2.5.66/include/asm-i386/unistd.h:#define __NR_timer_delete
(__NR_timer_create+4)
/usr/src/linux-2.5.66/include/asm-ppc/unistd.h:#define __NR_timer_delete
244
/usr/src/linux-2.5.66/include/asm-ppc64/unistd.h:#define __NR_timer_delete
244
/usr/src/linux-2.5.66/include/asm-x86_64/unistd.h:#define __NR_timer_delete
226

Obviously, we could add additional code to check for the running arch and
define the syscall accordingly, however I'm not sure this is the correct
way to go. I'm copying our list, as well as the kernel mailing list about
this, because I "think" the system calls should be defined to the same
numbers across all architectures....but I'm not positive. BTW, I attached
the testcase with my changes....which will only work on i386.

- Robbie

Robert V. Williamson <robbiew@us.ibm.com>
Linux Test Project
Web: http://ltp.sourceforge.net
IRC: #ltp on freenode.irc.net
====================
"Only two things are infinite, the universe and human stupidity, and I'm
not sure about the former." -Albert Einstein

(See attached file: timer_delete01.c)(See attached file: Makefile)




"Aniruddha M
Marathe" To: Robert Williamson/Austin/IBM@IBMUS
<aniruddha.marathe cc:
@wipro.com> Subject: Makefile issue

04/03/2003 05:27
AM





Hi,
I am writing testcases for system calls that were recently added in the 2.5
versions of kernel. Since there are some new header files / added
definitions in other header files in 2.5 versions, I have to give something
like
-I/src/ (kernel that supports new definitions/include in makefile for clean
compilation.

I am attaching a test case for timer_delete(2) and a Makefile to give you
an exact idea of the problem.
Please see the makefile
Now if I remove "-I/usr/src/linux-2.5.64/include" from CFLAGS, the
compilation will fail as:
timer_delete01.c: In function `timer_create':
timer_delete01.c:86: `__NR_timer_create' undeclared (first use in this
function)

Since I can't generalize any such path, these test cases will fail for
others. Note that its not issue of kernel version. I can check kernel
version with uname -r in makefile and then compile it (or do not compile
it). The issue is of path.

Can you suggest any way out?

Thanks,
Aniruddha.







#### Makefile has been removed from this note on April 07, 2003 by Robert
Williamson
#### timer_delete01.c has been removed from this note on April 07, 2003 by
Robert Williamson

[unhandled content-type:application/octet-stream][unhandled content-type:application/octet-stream]
\
 
 \ /
  Last update: 2005-03-22 13:34    [W:0.034 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site