How to find the system call number for execve in armv6?

1k Views Asked by At

I am trying to write assembly code on Arch Linux armv6l architecture and i need to call execve. For x86 & x86-64 system call number is 59 (64bit) and 11 (32bit) and can be found using below method

$ grep execve /usr/include/x86_64-linux-gnu/asm/unistd_64.h
#define __NR_execve 59
#define __NR_execveat 322
$ grep execve /usr/include/x86_64-linux-gnu/asm/unistd_32.h
#define __NR_execve 11
#define __NR_execveat 358

similarly is there any method to do the same in arm? How to be sure which one will yield the correct system call number? Below is the results from Arm system

$ find /usr/include -name "unistd.h"
/usr/include/bits/unistd.h
/usr/include/sys/unistd.h
/usr/include/linux/unistd.h
/usr/include/asm/unistd.h
/usr/include/unistd.h
/usr/include/asm-generic/unistd.h

$ grep execve /usr/include/asm/unistd-common.h
#define __NR_execve (__NR_SYSCALL_BASE + 11)
#define __NR_execveat (__NR_SYSCALL_BASE + 387)
$ grep execve /usr/include/asm-generic/unistd.h
#define __NR_execve 221
__SC_COMP(__NR_execve, sys_execve, compat_sys_execve)
#define __NR_execveat 281
__SC_COMP(__NR_execveat, sys_execveat, compat_sys_execveat)

Kindly help me to find the right system call number for execve. Thank You.

Linux alarmpi 4.4.34+ #3 Thu Dec 1 14:44:23 IST 2016 armv6l GNU/Linux

0

There are 0 best solutions below