success on the sun
This commit is contained in:
parent
c345061e8d
commit
005a85f3a2
3 changed files with 24 additions and 1 deletions
|
|
@ -17,13 +17,29 @@ static int rlx[] = {
|
||||||
RLIMIT_CORE,
|
RLIMIT_CORE,
|
||||||
RLIMIT_DATA,
|
RLIMIT_DATA,
|
||||||
RLIMIT_FSIZE,
|
RLIMIT_FSIZE,
|
||||||
|
#ifdef RLIMIT_MEMLOCK
|
||||||
RLIMIT_MEMLOCK,
|
RLIMIT_MEMLOCK,
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
#endif
|
||||||
|
#ifdef RLIMIT_RSS
|
||||||
RLIMIT_RSS,
|
RLIMIT_RSS,
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
#endif
|
||||||
RLIMIT_NOFILE,
|
RLIMIT_NOFILE,
|
||||||
RLIMIT_STACK,
|
RLIMIT_STACK,
|
||||||
RLIMIT_CPU,
|
RLIMIT_CPU,
|
||||||
|
#ifdef RLIMIT_NPROC
|
||||||
RLIMIT_NPROC,
|
RLIMIT_NPROC,
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
#endif
|
||||||
|
#ifdef RLIMIT_RSS
|
||||||
RLIMIT_RSS,
|
RLIMIT_RSS,
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,11 @@ _await(int pid4, char *str, int n, int opt)
|
||||||
ulong u, s;
|
ulong u, s;
|
||||||
|
|
||||||
for(;;){
|
for(;;){
|
||||||
pid = wait4(pid4, &status, opt, &ru);
|
/* On Linux, pid==-1 means anyone; on SunOS, it's pid==0. */
|
||||||
|
if(pid4 == -1)
|
||||||
|
pid = wait3(&status, opt, &ru);
|
||||||
|
else
|
||||||
|
pid = wait4(pid4, &status, opt, &ru);
|
||||||
if(pid <= 0)
|
if(pid <= 0)
|
||||||
return -1;
|
return -1;
|
||||||
u = ru.ru_utime.tv_sec*1000+((ru.ru_utime.tv_usec+500)/1000);
|
u = ru.ru_utime.tv_sec*1000+((ru.ru_utime.tv_usec+500)/1000);
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ post9pservice(int fd, char *name)
|
||||||
|
|
||||||
if((ns = getns()) == nil)
|
if((ns = getns()) == nil)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
s = smprint("unix!%s/%s", ns, name);
|
s = smprint("unix!%s/%s", ns, name);
|
||||||
free(ns);
|
free(ns);
|
||||||
if(s == nil)
|
if(s == nil)
|
||||||
|
|
@ -27,6 +28,8 @@ post9pservice(int fd, char *name)
|
||||||
_exits("exec");
|
_exits("exec");
|
||||||
default:
|
default:
|
||||||
w = wait();
|
w = wait();
|
||||||
|
if(w == nil)
|
||||||
|
return -1;
|
||||||
close(fd);
|
close(fd);
|
||||||
free(s);
|
free(s);
|
||||||
if(w->msg && w->msg[0]){
|
if(w->msg && w->msg[0]){
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue