Skip to content

Commit

Permalink
Add __sys_shutdown stub library function (#13399)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sbc100 authored Feb 2, 2021
1 parent cc08b2b commit 845ff80
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/library_syscall.js
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,11 @@ var SyscallsLibrary = {
sock.sock_ops.connect(sock, info.addr, info.port);
return 0;
},
__sys_shutdown__deps: ['$getSocketFromFD'],
__sys_shutdown: function(fd, how) {
getSocketFromFD(fd);
return -{{{ cDefine('ENOSYS') }}}; // unsupported feature
},
__sys_accept4__deps: ['$getSocketFromFD', '_write_sockaddr', '$DNS'],
__sys_accept4: function(fd, addr, addrlen, flags) {
var sock = getSocketFromFD(fd);
Expand Down
1 change: 1 addition & 0 deletions tests/sockets/test_sin_zero.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ int main() {
for (int i = 0; i < 8; i++) {
assert(adr_inet4->sin_zero[i] == 0);
}
shutdown(s, SHUT_RDWR);

puts("success");

Expand Down

0 comments on commit 845ff80

Please sign in to comment.