浏览代码

do not interpret errors in return value of times() syscall

all return values are valid, and on 32-bit systems, values that look
like errors can and will occur. since the only actual error this
function could return is EFAULT, and it is only returnable when the
application has invoked undefined behavior, simply ignore the
possibility that the return value is actually an error code.
Rich Felker 12 年之前
父节点
当前提交
9293b765c4
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/time/times.c

+ 1 - 1
src/time/times.c

@@ -3,5 +3,5 @@
 
 clock_t times(struct tms *tms)
 {
-	return syscall(SYS_times, tms);
+	return __syscall(SYS_times, tms);
 }