Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LibOS] Initialize socket handles to be readable and writable #499

Merged
merged 1 commit into from
Apr 8, 2022
Merged
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
4 changes: 1 addition & 3 deletions LibOS/shim/src/sys/shim_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ long shim_do_socket(int family, int type, int protocol) {
hdl->type = TYPE_SOCK;
hdl->fs = &socket_builtin_fs;
hdl->flags = type & SOCK_NONBLOCK ? O_NONBLOCK : 0;
hdl->acc_mode = 0;
hdl->acc_mode = MAY_READ | MAY_WRITE;

struct shim_sock_handle* sock = &hdl->info.sock;
sock->domain = family;
Expand All @@ -93,9 +93,7 @@ long shim_do_socket(int family, int type, int protocol) {

switch (sock->sock_type) {
case SOCK_STREAM: // TCP
break;
case SOCK_DGRAM: // UDP
hdl->acc_mode = MAY_READ | MAY_WRITE;
break;

default:
Expand Down