kernel: add kern_status_string()
This commit is contained in:
@@ -11,4 +11,6 @@ typedef unsigned int kern_status_t;
|
|||||||
#define KERN_NO_MEMORY (5)
|
#define KERN_NO_MEMORY (5)
|
||||||
#define KERN_NO_ENTRY (6)
|
#define KERN_NO_ENTRY (6)
|
||||||
|
|
||||||
|
extern const char *kern_status_string(kern_status_t status);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
23
kernel/status.c
Normal file
23
kernel/status.c
Normal 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";
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user