shithub: riscv

ref: aa0b6bedf4151dffec81e38b3c166aaac51c04c1
dir: /sys/lib/acid/transcript/

View raw version
#!/bin/rc
switch($#*){
case 0 1 2
	echo usage: $0 '''minx miny maxx maxy''' '''minx miny maxx maxy''' cmd args ... >[1=2]
	exit usage
}

rfork ns

if(mount $wsys /mnt/acid N`{{echo $pid $1 }| sed 's/^ //g;s/ +/,/g'}){
	winid=`{cat /dev/winid}
	echo transcript > /mnt/acid/label
	echo transcript > /mnt/acid/cons
	shift
}
if not exit 0

if(mount $wsys /mnt/wsys N`{{echo $pid $1 }| sed 's/^ //g;s/ +/,/g'}){
	shift
	bind -b /mnt/wsys /dev
}
if not exit 0

echo -n `{basename $1} > /dev/label >[2] /dev/null
@{
	echo hang > /proc/^`{cat /dev/ppid}^/ctl
	$* < /dev/wsys/$winid/cons > /dev/wsys/$winid/cons >[2] /dev/wsys/$winid/cons &
	exit $apid
}
ostatus = `{echo $status | sed 's/.*://'}
echo waitstop > /proc/$ostatus/ctl
echo nohang > /proc/$ostatus/ctl
exit $ostatus