meta: replace systemd and ldd with herdd and nsd

This commit is contained in:
2026-03-23 18:15:38 +00:00
parent d4d3ab13f4
commit bf5052fd3d
12 changed files with 105 additions and 34 deletions

43
services/herdd/main.c Normal file
View File

@@ -0,0 +1,43 @@
#include <errno.h>
#include <mango/log.h>
#include <pthread.h>
#include <stdio.h>
#include <string.h>
static void *thread_func(void *arg)
{
kern_logf("started thread with arg %p", arg);
errno = 100;
return (void *)0xdeadbeef;
}
int main(int argc, const char *argv[], const char *envp[])
{
kern_logf("herdd");
kern_logf("args:");
for (int i = 0; i < argc; i++) {
kern_logf("[%d]: %s", i, argv[i]);
}
kern_logf("env:");
for (int i = 0; envp[i]; i++) {
kern_logf("[%d]: %s", i, envp[i]);
}
kern_logf("self = %p", pthread_self());
errno = 200;
pthread_t thread;
pthread_create(&thread, NULL, thread_func, (void *)0xdeafcafe);
kern_logf("started thread %p", thread);
void *ret = NULL;
pthread_join(thread, &ret);
kern_logf("thread returned %p", ret);
kern_logf("errno...");
kern_logf("%u", errno);
kern_logf("...errno");
return 0;
}