kernel: add kern_status_string()

This commit is contained in:
2023-04-09 16:38:31 +01:00
parent 80f5e0483c
commit 981a5f2a0d
2 changed files with 25 additions and 0 deletions

23
kernel/status.c Normal file
View File

@@ -0,0 +1,23 @@
#include <socks/status.h>
const char *kern_status_string(kern_status_t status)
{
switch (status) {
case KERN_OK:
return "KERN_OK";
case KERN_UNIMPLEMENTED:
return "KERN_UNIMPLEMENTED";
case KERN_NAME_EXISTS:
return "KERN_NAME_EXISTS";
case KERN_INVALID_ARGUMENT:
return "KERN_INVALID_ARGUMENT";
case KERN_UNSUPPORTED:
return "KERN_UNSUPPORTED";
case KERN_NO_MEMORY:
return "KERN_NO_MEMORY";
case KERN_NO_ENTRY:
return "KERN_NO_ENTRY";
default:
return "UNKNOWN";
}
}