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

Function kaccept

source/kernel/ksocket.cpp:119–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119U32 kaccept(KThread* thread, U32 socket, U32 address, U32 len, U32 flags) {
120 KFileDescriptorPtr fd = thread->process->getFileDescriptor(socket);
121
122 if (!fd) {
123 return -K_EBADF;
124 }
125 if (IS_NOT_SOCKET(fd)) {
126 return -K_ENOTSOCK;
127 }
128 std::shared_ptr<KSocketObject> s = std::dynamic_pointer_cast<KSocketObject>(fd->kobject);
129 if (!s->listening) {
130 return -K_EINVAL;
131 }
132 return s->accept(thread, fd, address, len, flags);
133}
134
135U32 kgetsockname(KThread* thread, U32 socket, U32 address, U32 plen) {
136 KFileDescriptorPtr fd = thread->process->getFileDescriptor(socket);

Callers 2

syscall_socketcallFunction · 0.85
syscall_accept4Function · 0.85

Calls 2

getFileDescriptorMethod · 0.80
acceptMethod · 0.45

Tested by

no test coverage detected