Skip to content

Commit

Permalink
Add syscall tests and so harness
Browse files Browse the repository at this point in the history
Add two tests performing syscalls, to show the running syscalls
themselves from within a restricted DDC environment works. I think this
is useful to have for future potential work (e.g., could we provide a
compartment-safe printing function, instead of crashing with `printf`,
if making `printf` be compatible proves hard).

Adds a harness to be able to run `so` files natively, without having to
go through the compartment library. Useful for debugging / differential
testing.
  • Loading branch information
0152la committed Feb 26, 2024
1 parent a648fe5 commit 878ce66
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/simple_syscall_write.c
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#include <unistd.h>
#include <string.h>
#include <err.h>
#include <string.h>
#include <unistd.h>

int
main(void)
{
char* buf = "Hello World!\n";
char *buf = "Hello World!\n";
long int sc_write = syscall(4, STDOUT_FILENO, buf, strlen(buf));
if (sc_write == -1)
{
err(1, "Error calling `syscall`:");
}
return 0;
}

0 comments on commit 878ce66

Please sign in to comment.