Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/library_fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,7 @@ FS.staticInit();
FS.registerDevice(FS.makedev(1, 3), {
read: () => 0,
write: (stream, buffer, offset, length, pos) => length,
llseek: () => 0,
});
FS.mkdev('/dev/null', FS.makedev(1, 3));
// setup /dev/tty and /dev/tty1
Expand Down
2 changes: 2 additions & 0 deletions test/test_files.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ void test_tempfiles() {
char data[5] = { 10, 30, 20, 11, 88 };
FILE *n = fopen("/dev/null", "w");
printf("5 bytes to dev/null: %zu\n", fwrite(data, 1, 5, n));
int res = fseek(n, 10, SEEK_CUR);
printf("seek /dev/null: %d\n", res);
fclose(n);

// Test file creation with O_TRUNC (regression test for #16784)
Expand Down
1 change: 1 addition & 0 deletions test/test_files.out
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ seeked=ata.
seeked=ta.
fscanfed: 10 - hello
5 bytes to dev/null: 5
seek /dev/null: 0
ok.
Loading