Skip to content

Commit

Permalink
Add missing dependency __sys_fstatfs64 (#14845)
Browse files Browse the repository at this point in the history
Fixes: #14602
  • Loading branch information
sbc100 committed Aug 11, 2021
1 parent 6823c24 commit 2126d3c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/library_syscall.js
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,7 @@ var SyscallsLibrary = {
{{{ makeSetValue('buf', C_STRUCTS.statfs.f_namelen, '255', 'i32') }}};
return 0;
},
__sys_fstatfs64__deps: ['__sys_statfs64'],
__sys_fstatfs64: function(fd, size, buf) {
var stream = SYSCALLS.getStreamFromFD(fd);
return ___sys_statfs64(0, size, buf);
Expand Down
3 changes: 3 additions & 0 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -5471,6 +5471,9 @@ def test_unistd_misc(self):
self.emcc_args += ['-lnodefs.js']
self.do_run_in_out_file_test('unistd/misc.c', js_engines=[config.NODE_JS], interleaved_output=False)

def test_unistd_fstatfs(self):
self.do_run_in_out_file_test('unistd/fstatfs.c')

# i64s in the API, which we'd need to legalize for JS, so in standalone mode
# all we can test is wasm VMs
@also_with_standalone_wasm(wasm2c=True)
Expand Down
12 changes: 12 additions & 0 deletions tests/unistd/fstatfs.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <assert.h>
#include <stdio.h>
#include <sys/vfs.h>
#include <unistd.h>

int main() {
struct statfs buf;
int rtn = fstatfs(STDOUT_FILENO, &buf);
assert(rtn == 0);
printf("f_type: %ld\n", buf.f_type);
return 0;
}
1 change: 1 addition & 0 deletions tests/unistd/fstatfs.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f_type: 0

0 comments on commit 2126d3c

Please sign in to comment.