shithub: mc

Download patch

ref: 5ea62bdf0cede30ff66bdeea8a376843947bb20c
parent: e7e2e25385cd8e9dfb688bf9ae3e48728a1ddd72
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Feb 28 13:36:33 EST 2016

Add fisreg implementation for 9front

--- a/lib/std/syswrap+plan9.myr
+++ b/lib/std/syswrap+plan9.myr
@@ -141,6 +141,24 @@
 	-> (getle32(buf[Modeoff:Modeoff + 4]) & sys.Dmdir) != 0
 }
 
+const fisreg = {path
+	var buf	: byte[Stringsoff + 39]	/* enough space for qid type */
+	var ty
+
+	if sys.stat(path, buf[:]) < Stringsoff
+		-> false
+	;;
+
+	ty = getle16(buf[Typeoff:Typeoff + 4])
+	if (getle32(buf[Modeoff:Modeoff + 4]) & sys.Dmdir) != 0
+		-> false
+	elif ty == '|' || ty == 's' || ty == 'M'
+		-> false
+	else
+		-> true
+	;;
+}
+
 const getsysinfo = {si
 	si.system = getenvv("osname", "Plan9")
 	si.release = "4"
--- a/mk/bootstrap/bootstrap+Plan9-amd64.sh
+++ b/mk/bootstrap/bootstrap+Plan9-amd64.sh
@@ -17,6 +17,7 @@
 echo 	$pwd/6/6.out	-I ../sys -I . result.myr ;	$pwd/6/6.out	-I ../sys -I . result.myr 
 echo 	$pwd/6/6.out	-I ../sys -I . cstrconv.myr ;	$pwd/6/6.out	-I ../sys -I . cstrconv.myr 
 echo 	$pwd/6/6.out	-I ../sys -I . strfind.myr ;	$pwd/6/6.out	-I ../sys -I . strfind.myr 
+echo 	$pwd/6/6.out	-I ../sys -I . getint.myr ;	$pwd/6/6.out	-I ../sys -I . getint.myr 
 echo 	$pwd/6/6.out	-I ../sys -I . syswrap+plan9.myr ;	$pwd/6/6.out	-I ../sys -I . syswrap+plan9.myr 
 echo 	$pwd/6/6.out	-I ../sys -I . die.myr ;	$pwd/6/6.out	-I ../sys -I . die.myr 
 echo 	$pwd/6/6.out	-I ../sys -I . sleq.myr ;	$pwd/6/6.out	-I ../sys -I . sleq.myr 
@@ -62,7 +63,6 @@
 echo 	$pwd/6/6.out	-I ../sys -I . execvp.myr ;	$pwd/6/6.out	-I ../sys -I . execvp.myr 
 echo 	$pwd/6/6.out	-I ../sys -I . slput.myr ;	$pwd/6/6.out	-I ../sys -I . slput.myr 
 echo 	$pwd/6/6.out	-I ../sys -I . spork.myr ;	$pwd/6/6.out	-I ../sys -I . spork.myr 
-echo 	$pwd/6/6.out	-I ../sys -I . getint.myr ;	$pwd/6/6.out	-I ../sys -I . getint.myr 
 echo 	$pwd/6/6.out	-I ../sys -I . blat.myr ;	$pwd/6/6.out	-I ../sys -I . blat.myr 
 echo 	$pwd/6/6.out	-I ../sys -I . diriter.myr ;	$pwd/6/6.out	-I ../sys -I . diriter.myr 
 echo 	$pwd/6/6.out	-I ../sys -I . clear.myr ;	$pwd/6/6.out	-I ../sys -I . clear.myr