Skip to content

Commit 7ce8b58

Browse files
authored
Remove fake __map_file implementation (#17023)
Fixes: #16985
1 parent 51690b0 commit 7ce8b58

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

src/library.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -607,12 +607,6 @@ mergeInto(LibraryManager.library, {
607607
}
608608
},
609609

610-
__map_file__deps: ['$setErrNo'],
611-
__map_file: function(pathname, size) {
612-
setErrNo({{{ cDefine('EPERM') }}});
613-
return -1;
614-
},
615-
616610
_MONTH_DAYS_REGULAR: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
617611
_MONTH_DAYS_LEAP: [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
618612

system/lib/standalone/standalone.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,6 @@ int clock_getres(clockid_t clk_id, struct timespec *tp) {
6464
// mmap support is nonexistent. TODO: emulate simple mmaps using
6565
// stdio + malloc, which is slow but may help some things?
6666

67-
const unsigned char * __map_file(const char *pathname, size_t *size) {
68-
errno = ENOSYS;
69-
return NULL;
70-
}
71-
7267
intptr_t _mmap_js(size_t length,
7368
int prot,
7469
int flags,
@@ -115,6 +110,10 @@ __attribute__((__weak__)) int __syscall_fcntl64(int fd, int cmd, ...) {
115110
return -ENOSYS;
116111
}
117112

113+
__attribute__((__weak__)) int __syscall_fstat64(int fd, intptr_t buf) {
114+
return -ENOSYS;
115+
}
116+
118117
// There is no good source of entropy without an import. Make this weak so that
119118
// it can be replaced with a pRNG or a proper import.
120119
__attribute__((__weak__))

tools/system_libs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,7 @@ def get_files(self):
940940
'ctime_r.c',
941941
'timespec_get.c',
942942
'utime.c',
943+
'__map_file.c',
943944
])
944945
libc_files += files_in_path(
945946
path='system/lib/libc/musl/src/legacy',

0 commit comments

Comments
 (0)