mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-19 00:46:31 +00:00
new: 内核态fork
This commit is contained in:
21
kernel/common/unistd.c
Normal file
21
kernel/common/unistd.c
Normal file
@ -0,0 +1,21 @@
|
||||
#include <common/unistd.h>
|
||||
|
||||
/**
|
||||
* @brief fork当前进程
|
||||
*
|
||||
* @return pid_t
|
||||
*/
|
||||
pid_t fork(void)
|
||||
{
|
||||
return (pid_t)enter_syscall_int(SYS_FORK, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief vfork当前进程
|
||||
*
|
||||
* @return pid_t
|
||||
*/
|
||||
pid_t vfork(void)
|
||||
{
|
||||
return (pid_t)enter_syscall_int(SYS_VFORK, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
}
|
Reference in New Issue
Block a user