From mboxrd@z Thu Jan 1 00:00:00 1970 From: markus.boehme@mailbox.org (=?UTF-8?Q?Markus_B=c3=b6hme?=) Date: Wed, 22 Jun 2016 19:11:14 +0200 Subject: Regarding getrandom syscall In-Reply-To: References: <1466391466257370@web18o.yandex.ru> <1d447ded-6910-cd2f-bf5e-03f64f318f0f@elzevir.fr> Message-ID: <576AC6B2.20605@mailbox.org> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On 06/22/2016 04:58 PM, Avantika Rawat wrote: > Thanks for the link but i am getting "Function not implemented" error. > I have added a custom syscall in kernel for testing, getting similar > error for that also. I am working on 3.10.20 Kernel and MIPS > architecture. Pasting the kernel changes done to spport getrandom > syscall in 3.10.20 kernel. Can someone please help me here that what > needs to be done. If you're on MIPS, x86 code and syscall numbers won't help you. In this case the proper syscall numbers are defined in arch/mips/include/uapi/asm/unistd.h. Additionally, note that your kernel version does not seem to implement the getrandom syscall for MIPS: $ git blame arch/mips/include/uapi/asm/unistd.h | grep getrandom 42944521 (Ralf Baechle 2014-08-26 03:03:40 +0200 376) #define __NR_getrandom (__NR_Linux + 353) 42944521 (Ralf Baechle 2014-08-26 03:03:40 +0200 716) #define __NR_getrandom (__NR_Linux + 313) 42944521 (Ralf Baechle 2014-08-26 03:03:40 +0200 1060) #define __NR_getrandom (__NR_Linux + 317) $ git show 42944521 | head -n 5 commit 42944521af97a3b25516f15f3149aec3779656dc Author: Ralf Baechle Date: Tue Aug 26 03:03:40 2014 +0200 MIPS: Wire up new syscalls getrandom and memfd_create. $ git show v3.10.20 | head -n 3 tag v3.10.20 Tagger: Greg Kroah-Hartman Date: Wed Nov 20 12:28:06 2013 -0800 Regards, Markus