shithub: riscv

Download patch

ref: 19a8f66eecda455b56c6c07bd1ce75be8d2cbb82
parent: acd15f13c4572aa2ac360f2c0deb6aa05351873d
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Sep 19 21:37:11 EDT 2014

pc64: syscallfmt for nsec syscall

--- a/sys/src/9/port/syscallfmt.c
+++ b/sys/src/9/port/syscallfmt.c
@@ -298,6 +298,8 @@
 		}
 		break;
 	case _NSEC:
+		if(sizeof(uintptr) == sizeof(vlong))
+			break;
 		v = va_arg(list, vlong*);
 		fmtprint(&fmt, "%#p", v);
 		break;
@@ -324,14 +326,6 @@
 
 	errstr = "\"\"";
 	switch(syscallno){
-	default:
-	case ALARM:
-	case _WRITE:
-	case PWRITE:
-		if((long)ret == -1)
-			errstr = up->syserrstr;
-		fmtprint(&fmt, " = %ld", (long)ret);
-		break;
 	case EXEC:
 	case SEGBRK:
 	case SEGATTACH:
@@ -401,6 +395,20 @@
 			vl = va_arg(list, vlong);
 			fmtprint(&fmt, " %lld", vl);
 		}
+		fmtprint(&fmt, " = %ld", (long)ret);
+		break;
+	case _NSEC:
+		if(sizeof(uintptr) == sizeof(vlong)){
+			fmtprint(&fmt, " = %lld", (vlong)ret);
+			break;
+		}
+		/* wet floor */
+	case ALARM:
+	case _WRITE:
+	case PWRITE:
+	default:
+		if((long)ret == -1)
+			errstr = up->syserrstr;
 		fmtprint(&fmt, " = %ld", (long)ret);
 		break;
 	}