mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
Return chunk & bytes read for posix.readSync()
This commit is contained in:
1 parent
b02b54e003
commit
cd41e30bcc
1 file changed
+4
-1
+4
-1
@@ -421,7 +421,10 @@ static Handle<Value> Read(const Arguments& args) {
|
||||
ret = pread(fd, buf, MIN(len, READ_BUF_LEN), offset);
|
||||
}
|
||||
if (ret < 0) return ThrowException(errno_exception(errno));
|
||||
return scope.Close(Integer::New(ret));
|
||||
Local<Array> a = Array::New(2);
|
||||
a->Set(Integer::New(0), Encode(buf, ret, encoding));
|
||||
a->Set(Integer::New(1), Integer::New(ret));
|
||||
return scope.Close(a);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user