MCPcopy Create free account
hub / github.com/catboost/catboost / Duplicate

Method Duplicate

util/system/file.cpp:609–624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

607}
608
609FHANDLE TFileHandle::Duplicate() const noexcept {
610 if (!IsOpen()) {
611 return INVALID_FHANDLE;
612 }
613#if defined(_win_)
614 FHANDLE dupHandle;
615 if (!::DuplicateHandle(GetCurrentProcess(), Fd_, GetCurrentProcess(), &dupHandle, 0, TRUE, DUPLICATE_SAME_ACCESS)) {
616 return INVALID_FHANDLE;
617 }
618 return dupHandle;
619#elif defined(_unix_)
620 return ::dup(Fd_);
621#else
622 #error unsupported platform
623#endif
624}
625
626int TFileHandle::Duplicate2Posix(int dstHandle) const noexcept {
627 if (!IsOpen()) {

Callers 2

LinkToMethod · 0.45
DuplicateMethod · 0.45

Calls 3

dupFunction · 0.50
SetNameMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected