Skip to content

Commit 2c36bf0

Browse files
Move O_LARGEFILE as default back to libc
1 parent 885e137 commit 2c36bf0

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/library_syscall.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ var SyscallsLibrary = {
227227
},
228228
__syscall5: function(which, varargs) { // open
229229
var pathname = SYSCALLS.getStr(), flags = SYSCALLS.get(), mode = SYSCALLS.get() // optional TODO
230-
var stream = FS.open(pathname, flags | {{{ cDefine('O_LARGEFILE') }}}, mode);
230+
var stream = FS.open(pathname, flags, mode);
231231
return stream.fd;
232232
},
233233
__syscall6: function(which, varargs) { // close

system/lib/libc/musl/src/internal/syscall.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -257,17 +257,16 @@ long __syscall_ret(unsigned long), __syscall(syscall_arg_t, ...),
257257
#define __sys_open_cp2(x,pn,fl) __syscall_cp3(SYS_openat, AT_FDCWD, pn, (fl)|O_LARGEFILE)
258258
#define __sys_open_cp3(x,pn,fl,mo) __syscall_cp4(SYS_openat, AT_FDCWD, pn, (fl)|O_LARGEFILE, mo)
259259
#endif
260+
#else // __EMSCRIPTEN__
261+
#define __sys_open2(x,pn,fl) __SYSCALL_CONCAT(__syscall, SYS_open)(SYS_open, __scc(pn), __scc((fl)|O_LARGEFILE))
262+
#define __sys_open3(x,pn,fl,mo) __SYSCALL_CONCAT(__syscall, SYS_open)(SYS_open, __scc(pn), __scc((fl)|O_LARGEFILE), __scc(mo))
263+
#define __sys_open_cp2(x,pn,fl) __SYSCALL_CONCAT(__syscall, SYS_open)(SYS_open, __scc(pn), __scc((fl)|O_LARGEFILE))
264+
#define __sys_open_cp3(x,pn,fl,mo) __SYSCALL_CONCAT(__syscall, SYS_open)(SYS_open, __scc(pn), __scc((fl)|O_LARGEFILE), __scc(mo))
265+
#endif
260266
#define __sys_open(...) __SYSCALL_DISP(__sys_open,,__VA_ARGS__)
261267
#define sys_open(...) __syscall_ret(__sys_open(__VA_ARGS__))
262268

263269
#define __sys_open_cp(...) __SYSCALL_DISP(__sys_open_cp,,__VA_ARGS__)
264270
#define sys_open_cp(...) __syscall_ret(__sys_open_cp(__VA_ARGS__))
265-
#else // __EMSCRIPTEN__
266-
#define __sys_open(...) __syscall(SYS_open, __VA_ARGS__)
267-
#define sys_open(...) syscall(SYS_open, __VA_ARGS__)
268-
269-
#define __sys_open_cp(...) __syscall_cp(SYS_open, __VA_ARGS__)
270-
#define sys_open_cp(...) syscall_cp(SYS_open, __VA_ARGS__)
271-
#endif // __EMSCRIPTEN__
272271

273272
#endif

0 commit comments

Comments
 (0)