Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the replacement of daemonize() kernal api in 3.x kernel

I am working on a project that is migrating from linux kernel 2.6 to 3.10.

The 2.6 version contained calls to api daemonize() which is not longer available in newer kernel.

So far i have seen kthread_run() as a replacement. However, when i put in kernel_thread() with function to start, null and string name as arguments, i got lots of : "can't fork" errors.

Can any one advice upon the correct replacement?

like image 907
fkl Avatar asked Jul 22 '14 20:07

fkl


People also ask

Is a kernel an API?

Kernels have no APIs as they are not libraries. They do have an ABI, which, beyond other things, define how do applications interact with them through system calls. Unix application developers use the standard C library (eg: libc , glibc ) to build ABI compliant binaries.

Is rust in the Linux kernel?

The first Rust work you'll see in the Linux Next kernels will be, Ojeda said, “Rust abstractions for subsystems and write drivers and other modules” in the LKML. Eventually, Rust will be a fully integrated second language in the Linux kernel.

Which kernel is used in Linux?

Monolithic. The Linux kernel is monolithic, meaning the kernel handles all hardware and driver operations. The entire operating system is virtually working in kernel space.


1 Answers

To manage a kernel thread, you should use the helper functions in <linux/kthread.h> such as kthread_run().

like image 120
CL. Avatar answered Sep 23 '22 16:09

CL.