Lines Matching +full:suspend +full:- +full:in +full:- +full:wait
7 # Redistribution and use in source and binary forms, with or without
12 # 2. Redistributions in binary form must reproduce the above copyright
13 # notice, this list of conditions and the following disclaimer in the
19 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
23 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 # Fixed in r275744.
40 [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
41 [ -z "$DEBUG" ] && exit 0 # Waiting for fix
48 mycc -o pcatch -Wall -Wextra -O0 -g pcatch.c || exit 1
49 rm -f pcatch.c
52 mount | grep -q "$mntpoint" && umount $mntpoint
53 mdconfig -l | grep -q $mdstart && mdconfig -d -u $mdstart
54 mdconfig -a -t swap -s 1g -u $mdstart
60 while [ $((`date '+%s'` - start)) -lt 120 ]; do
64 while mount | grep -q "on $mntpoint "; do
67 mdconfig -d -u $mdstart
68 rm -f /tmp/pcatch
74 #include <sys/wait.h>
93 suspend(char *path)
121 if (sigaction(SIGUSR1, &sa, NULL) == -1)
125 if ((fd = open(file, O_RDWR | O_CREAT | O_TRUNC, 0640)) == -1)
128 suspend(mp);
131 if (write(fd, buf, sizeof(buf)) == -1)
136 if (kill(pid, SIGUSR1) == -1)
138 wait(NULL);
139 wait(NULL);