aboutsummaryrefslogtreecommitdiffstats
path: root/init/init.c
diff options
context:
space:
mode:
authorturret <turret@duck.com>2023-11-19 19:13:40 -0600
committerturret <turret@duck.com>2023-11-19 19:13:40 -0600
commit40bff7788865b519b79b1ee7eb9851914010ffb4 (patch)
treeb11af475d4eb933acb2d610c555d6715f76def4e /init/init.c
parenta8b2282eb88f24c3c5f461e1557fa2cf76ebc251 (diff)
downloaddiscord-bot-skeleton-40bff7788865b519b79b1ee7eb9851914010ffb4.tar.gz
discord-bot-skeleton-40bff7788865b519b79b1ee7eb9851914010ffb4.tar.bz2
discord-bot-skeleton-40bff7788865b519b79b1ee7eb9851914010ffb4.zip
misc: minor bugs and comments
sprinkle a little bit of commenting throughout the codebase. hopefully i dont regret what i've written - clone: bottom of stack is passed through - print: write newline at end of message - initcall: functions return void type very basic net startup. hopefully i dont regret implementing the websocket protocol myself in a language as holy as C.
Diffstat (limited to 'init/init.c')
-rw-r--r--init/init.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/init/init.c b/init/init.c
index 5363082..7c2d6a6 100644
--- a/init/init.c
+++ b/init/init.c
@@ -10,6 +10,10 @@
static unsigned long __1bsafebuf
__attribute__((used)) __attribute__((section(".1bsafebuf.init"))) = 0;
+/* We start initcall levels at [1] instead of [0], so we must adjust
+ in code for this minor design choice. Math is done on the level passed
+ through i.e. do_initcall_level so that you can call it with (1) and have
+ the expected initcall (l1_initcall) run. */
extern initcall_entry_t __initcall1_start[];
extern initcall_entry_t __initcall2_start[];
extern initcall_entry_t __initcall3_start[];
@@ -46,6 +50,9 @@ int main(void)
{
do_initcalls();
+ /* Reaper. Much like init. */
+ // BUG: doesnt actually work?? we have defunct processes still
+ // TODO: fix bug
static sigset_t set;
sigaddset(&set, SIGCHLD);
sigprocmask(SIG_BLOCK, &set, NULL);