diff options
author | arkady-e1ppa <[email protected]> | 2024-12-17 09:13:58 +0300 |
---|---|---|
committer | arkady-e1ppa <[email protected]> | 2024-12-17 09:28:01 +0300 |
commit | 3e05dc5f5c47aa8d220db7b5508cfbd4a0d8919f (patch) | |
tree | 0f1f95ed8924916c928ddfa0d07dbe6a80767247 | |
parent | 42ddc5e2bcc668464583e1e88fadfcc5f215247e (diff) |
Fix use of F_SET_PIPE_WAKE_WRITER
commit_hash:41ca9d4873a01b242608efffc3fd03fd8dacbbdf
-rw-r--r-- | yt/yt/core/misc/proc.cpp | 7 | ||||
-rw-r--r-- | yt/yt/library/process/unittests/pipes_ut.cpp | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/yt/yt/core/misc/proc.cpp b/yt/yt/core/misc/proc.cpp index e25dd22cc08..03185c40ace 100644 --- a/yt/yt/core/misc/proc.cpp +++ b/yt/yt/core/misc/proc.cpp @@ -59,6 +59,11 @@ #ifdef _linux_ extern "C" int memfd_create(const char *name, unsigned flags); + +#if !defined(F_SET_PIPE_WAKE_WRITER) + #define F_SET_PIPE_WAKE_WRITER 0x59410005 +#endif + #endif namespace NYT { @@ -958,7 +963,7 @@ bool TryEnableEmptyPipeEpollEvent(TFileDescriptor fd) // resulting in a potentially broken behavior. // if F_SET_PIPE_WAKE_WRITER is not defined and/or properly // implemented we should return false. -#if defined(_linux_) && defined(F_SET_PIPE_WAKE_WRITER) +#if defined(_linux_) int res = ::fcntl(fd, F_SET_PIPE_WAKE_WRITER, 1); // TODO(arkady-e1ppa): Once kernel version is fresh enough diff --git a/yt/yt/library/process/unittests/pipes_ut.cpp b/yt/yt/library/process/unittests/pipes_ut.cpp index 6d088d3e3ad..f0c371dd307 100644 --- a/yt/yt/library/process/unittests/pipes_ut.cpp +++ b/yt/yt/library/process/unittests/pipes_ut.cpp @@ -350,7 +350,7 @@ TEST_F(TNamedPipeReadWriteTest, CapacityDontDiscardSurplus) EXPECT_TRUE(writeFuture.Get().IsOK()); } -#if defined(_linux_) && defined(F_SET_PIPE_WAKE_WRITER) +#if defined(_linux_) TEST_F(TNamedPipeReadWriteTest, DeliveryFencedWriteJustWorks) { |