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

Method allocFileDescriptor

source/kernel/kprocess.cpp:445–457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

443}
444
445KFileDescriptorPtr KProcess::allocFileDescriptor(const std::shared_ptr<KObject>& kobject, U32 accessFlags, U32 descriptorFlags, S32 handle, U32 afterHandle) {
446 if (handle<0) {
447 handle = this->getNextFileDescriptorHandle(afterHandle);
448 }
449 KFileDescriptorPtr result = std::make_shared<KFileDescriptor>(shared_from_this(), kobject, accessFlags, descriptorFlags, handle);
450
451 BOXEDWINE_CRITICAL_SECTION_WITH_MUTEX(fdsMutex);
452 this->fds.set(handle, result);
453 Fs::addDynamicLinkFile(fdNode->path+"/"+BString::valueOf(handle), k_mdev(0, 0), fdNode, false, [kobject] {
454 return kobject->selfFd();
455 });
456 return result;
457}
458
459U32 translateOpenError() {
460 switch (errno) {

Callers 13

cloneMethod · 0.95
openFileDescriptorMethod · 0.95
dupMethod · 0.95
dup2Method · 0.95
memfd_createMethod · 0.95
fcntrlMethod · 0.95
epollcreateMethod · 0.95
acceptMethod · 0.80
recvmsgMethod · 0.80
syscall_signalfd4Function · 0.80
acceptMethod · 0.80
ksocketFunction · 0.80

Calls 3

setMethod · 0.45
selfFdMethod · 0.45

Tested by

no test coverage detected