BuildSystem: Cleanup userspace directory layout

userspace programs are now in userspace/programs
userspace tests are now in userspace/tests

This makes listing userspace projects much cleaner. Libraries were
already separated to their own directory, so other programs should also.
This commit is contained in:
2024-07-03 09:15:22 +03:00
parent 5dc441c4af
commit 8ddab05ed3
107 changed files with 78 additions and 67 deletions

View File

@@ -0,0 +1,9 @@
set(SOURCES
main.cpp
)
add_executable(whoami ${SOURCES})
banan_include_headers(whoami ban)
banan_link_library(whoami libc)
install(TARGETS whoami OPTIONAL)

View File

@@ -0,0 +1,14 @@
#include <stdio.h>
#include <unistd.h>
int main()
{
char* login = getlogin();
if (login == nullptr)
{
printf("unknown user %d\n", geteuid());
return 1;
}
printf("%s\n", login);
return 0;
}