Browse Source

Fixing read/write a la NIX (#761)

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>
Álvaro Jurado 6 years ago
parent
commit
4972d2f6d9
2 changed files with 2 additions and 2 deletions
  1. 1 1
      sys/src/libc/9sys/read.c
  2. 1 1
      sys/src/libc/9sys/write.c

+ 1 - 1
sys/src/libc/9sys/read.c

@@ -18,6 +18,6 @@ read(int d, void *buf, int32_t nbytes)
 	if(nbytes <= 0)
 		return 0;
 
-	n = pread(d, buf, nbytes, ~0LL);
+	n = pread(d, buf, nbytes, -1LL);
 	return n;
 }

+ 1 - 1
sys/src/libc/9sys/write.c

@@ -15,6 +15,6 @@ write(int d, const void *buf, int32_t nbytes)
 {
 	int n;
 
-	n = pwrite(d, buf, nbytes, ~0LL);
+	n = pwrite(d, buf, nbytes, -1LL);
 	return n;
 }