mirror of
https://github.com/ksherlock/marignotti.git
synced 2025-03-03 01:29:40 +00:00
shutdown(2)
This commit is contained in:
parent
e5d79067bb
commit
20095e12d2
29
mshutdown.c
Normal file
29
mshutdown.c
Normal file
@ -0,0 +1,29 @@
|
||||
#include "marignotti.h"
|
||||
#include <gno/kerntool.h>
|
||||
#include <errno.h>
|
||||
|
||||
#pragma noroot
|
||||
#pragma optimize 79
|
||||
|
||||
|
||||
int mshutdown(Entry *e, void *p1, void *p2, void *p3, void *p4, void *p5)
|
||||
{
|
||||
int how = *(int *)p1;
|
||||
|
||||
switch(how)
|
||||
{
|
||||
case 0: // shutrd
|
||||
e->_SHUT_RD = 1;
|
||||
break;
|
||||
case 1:
|
||||
e->_SHUT_WR = 1;
|
||||
break;
|
||||
case 2:
|
||||
e->_SHUT_RD = 1;
|
||||
e->_SHUT_WR = 1;
|
||||
break;
|
||||
default:
|
||||
return EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user