Merge pull request #166 from jterrace/pthread_pagesize_pr

Allow stream to be -1 in mmap
This commit is contained in:
Alon Zakai 2012-01-06 18:35:57 -08:00
Родитель fae9975ecb f843a37aad
Коммит 40665e645f
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -3177,7 +3177,10 @@ LibraryManager.library = {
mmap__deps: ['$FS'], mmap__deps: ['$FS'],
mmap: function(start, num, prot, flags, stream, offset) { mmap: function(start, num, prot, flags, stream, offset) {
// FIXME: Leaky and non-shared. // FIXME: Leaky and non-share
if( stream == -1) {
return allocate(num,'i8', ALLOC_NORMAL);
}
var info = FS.streams[stream]; var info = FS.streams[stream];
if (!info) return -1; if (!info) return -1;
return allocate(info.object.contents.slice(offset, offset+num), return allocate(info.object.contents.slice(offset, offset+num),