Skip to content

Commit

Permalink
ipc: adjusted socket descriptor structure for connection-oriented com…
Browse files Browse the repository at this point in the history
…munication
  • Loading branch information
jewelcodes committed Sep 6, 2024
1 parent cdd2e1a commit aa87cf0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/include/kernel/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ struct sockaddr_un {
};

/* socket-specific I/O descriptor (see io.h) */
typedef struct {
typedef struct SocketDescriptor {
Process *process;
struct sockaddr address;
bool listener;
int type, protocol, backlog;
int inboundCount, outboundCount;
void **inbound, **outbound;
struct SocketDescriptor *peer;
} SocketDescriptor;

void socketInit();
Expand Down
1 change: 1 addition & 0 deletions src/ipc/sockinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ int socket(Thread *t, int domain, int type, int protocol) {

// set up the socket family for now
SocketDescriptor *sock = (SocketDescriptor *)iod->data;
sock->process = p;
sock->address.sa_family = domain;
sock->type = type & 0xFF;
sock->protocol = protocol;
Expand Down

0 comments on commit aa87cf0

Please sign in to comment.