init.c

来自「Jazmyn is a 32-bit, protected mode, mult」· C语言 代码 · 共 27 行

C
27
字号
#include <sys\types.h>
#include <null.h>
#include <stdio.h>
#include <jazmyn.h>

int main()
{
        printf("Init process started\n");
        printf("Init is forking a new process for Shell\n");        
        int pid = fork();
        int i,j;
        const char *argv[] ={"hello","world",0};
        if(pid == 0)
        {
                execve("shell.com",argv,NULL);
        }

        printf("[ Init ]: waiting for a child to die\n");
_wait:
        i = wait(&j);
        printf("process died\n");
        goto _wait;

        return 0;
}
        

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?