Add mmap.slice and allow for 0-sized fd-only mappings

This commit is contained in:
Michal Moskal
2017-07-09 17:51:16 +01:00
parent 0de116c9cc
commit fd67bb8845
2 changed files with 26 additions and 5 deletions

View File

@ -20,6 +20,12 @@ declare interface MMap {
//% shim=MMapMethods::getNumber
getNumber(format: NumberFormat, offset: int32): number;
/**
* Read a range of bytes into a buffer.
*/
//% offset.defl=0 length.defl=-1 shim=MMapMethods::slice
slice(offset?: int32, length?: int32): Buffer;
/** Returns the length of a Buffer object. */
//% property shim=MMapMethods::length
length: int32;