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:
8
userspace/tests/test-fork/CMakeLists.txt
Normal file
8
userspace/tests/test-fork/CMakeLists.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
set(SOURCES
|
||||
main.cpp
|
||||
)
|
||||
|
||||
add_executable(test-fork ${SOURCES})
|
||||
banan_link_library(test-fork libc)
|
||||
|
||||
install(TARGETS test-fork OPTIONAL)
|
||||
22
userspace/tests/test-fork/main.cpp
Normal file
22
userspace/tests/test-fork/main.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define ERROR(msg) { perror(msg); return 1; }
|
||||
#define BUF_SIZE 1024
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("userspace\n");
|
||||
|
||||
if (fork() == 0)
|
||||
{
|
||||
execl("/usr/bin/cat", "/usr/bin/cat", "/usr/include/kernel/kprint.h", NULL);
|
||||
ERROR("execl");
|
||||
return 0;
|
||||
}
|
||||
|
||||
printf("parent\n");
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user