Skip to content

Commit 845ff80

Browse files
authored
Add __sys_shutdown stub library function (#13399)
We never really supported this syscall but prior to #13272 this fact was not evident since the generic socketcall handler had a catchall the returned ENOSYS. Fixes: #13393
1 parent cc08b2b commit 845ff80

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/library_syscall.js

+5
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,11 @@ var SyscallsLibrary = {
602602
sock.sock_ops.connect(sock, info.addr, info.port);
603603
return 0;
604604
},
605+
__sys_shutdown__deps: ['$getSocketFromFD'],
606+
__sys_shutdown: function(fd, how) {
607+
getSocketFromFD(fd);
608+
return -{{{ cDefine('ENOSYS') }}}; // unsupported feature
609+
},
605610
__sys_accept4__deps: ['$getSocketFromFD', '_write_sockaddr', '$DNS'],
606611
__sys_accept4: function(fd, addr, addrlen, flags) {
607612
var sock = getSocketFromFD(fd);

tests/sockets/test_sin_zero.c

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ int main() {
3434
for (int i = 0; i < 8; i++) {
3535
assert(adr_inet4->sin_zero[i] == 0);
3636
}
37+
shutdown(s, SHUT_RDWR);
3738

3839
puts("success");
3940

0 commit comments

Comments
 (0)