MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / setup

Function setup

test/fs/test_writev_partial_write.c:19–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17EM_JS_DEPS(main, "$ERRNO_CODES");
18
19void setup(void) {
20 EM_ASM(
21 var device = FS.makedev(80, 0);
22 FS.registerDevice(device, {
23 write: function(stream, buffer, offset, length, pos) {
24 if (length === 0) {
25 return 0;
26 }
27 // Only do a partial write of one byte each time
28 out('TO DEVICE: ' + JSON.stringify(String.fromCharCode(buffer[offset])));
29 return 1;
30 }
31 });
32 FS.mkdev('/device', device);
33 );
34}
35
36// Run the test with writev directly
37void test_writev_direct(void) {

Callers 1

mainFunction · 0.70

Calls 2

functionFunction · 0.50
outFunction · 0.50

Tested by

no test coverage detected