Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i create a buffer without using malloc() in linux kernel?

How can I create a buffer in linux kernel without malloc() function (or calloc()) and clean buffer without free() function?

like image 503
phuongnd Avatar asked Mar 27 '12 03:03

phuongnd


1 Answers

You cannot use standard c library functions like malloc() or calloc() inside the kernel, The code you write in kernel links to the functionality provided by the kernel itself.

You can use kmalloc() & then free it with kfree().

like image 197
Alok Save Avatar answered Sep 20 '22 08:09

Alok Save