phuongnd
phuongnd

Reputation: 123

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?

Upvotes: 5

Views: 596

Answers (1)

Alok Save
Alok Save

Reputation: 206666

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().

Upvotes: 8

Related Questions