Skip to contentSkip to conversation

strange new system call problems

DISCUSSION kwl02r 1 participant 1 message Aug 6, 2004

lore
Share & tools
lore

kwl02r

author
#0 lore raw

Hiya,

I am running the Redhat9 with kernel-2.4.20-8. I added four new
system calls for my application program.
At file /asm/unistd.h, I added my system calls definition as following.

#define __NR_set_tid_address 258 /* last system call defined by
system*/

  #define __NR_mysystemcall1  259  /* my first system call*/
  #define __NR_mysystemcall2  260  /* my second system call*/
  #define __NR_mysystemcall3  261  /* my third system call*/
  #define __NR_mysystemcall4  262  /* my forth system call*/

After this , I changed the linux/arch/i386/entry.S as following.

 . long SYMBOL_NAME(sys_mysystemcall1)             /* 259 system call */
 .long SYMBOL_NAME(sys_mysystemcall2)              /* 260 system call */
 .long SYMBOL_NAME(sys_mysystemcall3)              /* 261 system call */
 .long SYMBOL_NAME(sys_mysystemcall4)              /* 262 system call */

When I compilered a new kernel, there was no any error messages. But only the new system call 259 was working. The rest of three
(260-262) did not response
anything. If I changed the position of system calls (259->260 and
260->259), still the 259 had
response. Anyway, only the new system call at the 259 position was
working. What is wrong?
Other questions are:
(1) Is it correct that I add my new definitions at
/linux/asm/unistd.h? There is another file under

        /linux/asm-i386/unistd.h

(2) At entry.S, do I need to change codes following for my new system
calls? How to change ?

      .rept NR_syscalls-(.-sys_call_table)/4
              .long SYMBOL_NAME(sys_ni_syscall)
       .endr

Thanks