MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / kconnect

Function kconnect

source/kernel/ksocket.cpp:90–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90U32 kconnect(KThread* thread, U32 socket, U32 address, U32 len) {
91 KFileDescriptorPtr fd = thread->process->getFileDescriptor(socket);
92
93 if (!fd) {
94 return -K_EBADF;
95 }
96 if (IS_NOT_SOCKET(fd)) {
97 return -K_ENOTSOCK;
98 }
99 std::shared_ptr<KSocketObject> s = std::dynamic_pointer_cast<KSocketObject>(fd->kobject);
100 if (s->connected) {
101 return -K_EISCONN;
102 }
103 return s->connect(thread, fd, address, len);
104}
105
106U32 klisten(KThread* thread, U32 socket, U32 backlog) {
107 KFileDescriptorPtr fd = thread->process->getFileDescriptor(socket);

Callers 2

syscall_socketcallFunction · 0.85
syscall_connectFunction · 0.85

Calls 2

getFileDescriptorMethod · 0.80
connectMethod · 0.45

Tested by

no test coverage detected