Invoking a system using syscall()
Hi, I want to invoke getpid() system call using syscall. Here's the code snippet below. But, I can't find anything in dmesg|tail output. #include <sys/types.h> int main() { pid_tret = syscall(20); return 0; }
Invoking a syscall won't necessarily print anything to the kernel log. On 7 Jun 2014 07:50, "Dipanjan Das" <mail.dipanjan.das@gmail.com> wrote:
Hi,
I want to invoke getpid() system call using syscall. Here's the code snippet below. But, I can't find anything in dmesg|tail output.
#include <sys/types.h>
int main() { pid_tret = syscall(20); return 0; }
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
On Sat, Jun 7, 2014 at 11:20 AM, Dipanjan Das <mail.dipanjan.das@gmail.com> wrote:
Hi,
I want to invoke getpid() system call using syscall. Here's the code snippet below. But, I can't find anything in dmesg|tail output.
#include <sys/types.h>
int main() { pid_tret = syscall(20); return 0; }
Have you seen the code of the system call sys_getpid ? I dont find anything there which will print in dmesg .. ofcourse you can modify the code and then you will get the output in dmesg .
On Sat, Jun 7, 2014 at 11:20 AM, Dipanjan Das <mail.dipanjan.das@gmail.com> wrote:
Hi,
I want to invoke getpid() system call using syscall. Here's the code snippet below. But, I can't find anything in dmesg|tail output.
What are you trying to see there? Why should any output come over there? Do you need to use strace instead?
#include <sys/types.h>
int main() { pid_tret = syscall(20); return 0; }
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-- ---P.K.S
participants (4)
-
Dipanjan Das -
Kristofer Hallin -
Pranay Srivastava -
Sudip Mukherjee