diff options
Diffstat (limited to 'usr.sbin/init/main.c')
-rw-r--r-- | usr.sbin/init/main.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/usr.sbin/init/main.c b/usr.sbin/init/main.c index 8ef90d3..b5c4fab 100644 --- a/usr.sbin/init/main.c +++ b/usr.sbin/init/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023-2024 Ian Marco Moffett and the Osmora Team. + * Copyright (c) 2023-2025 Ian Marco Moffett and the Osmora Team. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,8 +27,25 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include <sys/spawn.h> +#include <stddef.h> + +#define SHELL_PATH "/usr/bin/osh" +#define LOGIN_PATH "/usr/bin/login" +#define INIT_RC_PATH "/usr/rc/init.rc" + int -main(void) +main(int argc, char **argv) { + char *login_argv[] = { LOGIN_PATH, NULL }; + char *start_argv[] = { SHELL_PATH, INIT_RC_PATH, NULL }; + char *envp[] = { NULL }; + + /* Start the init.rc */ + spawn(SHELL_PATH, start_argv, envp, 0); + start_argv[1] = NULL; + + /* Start the login manager */ + spawn(login_argv[0], login_argv, envp, SPAWN_WAIT); return 0; } |