opengris-scaler 1.12.7__cp38-cp38-musllinux_1_2_x86_64.whl → 1.12.8__cp38-cp38-musllinux_1_2_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of opengris-scaler might be problematic. Click here for more details.
- {opengris_scaler-1.12.7.dist-info → opengris_scaler-1.12.8.dist-info}/METADATA +1 -1
- {opengris_scaler-1.12.7.dist-info → opengris_scaler-1.12.8.dist-info}/RECORD +15 -16
- scaler/config/loader.py +3 -2
- scaler/config/mixins.py +6 -1
- scaler/config/types/worker.py +6 -1
- scaler/config/types/zmq.py +5 -1
- scaler/io/ymq/CMakeLists.txt +0 -1
- scaler/io/ymq/epoll_context.h +0 -1
- scaler/object_storage/CMakeLists.txt +0 -2
- scaler/version.txt +1 -1
- scaler/io/ymq/file_descriptor.h +0 -203
- {opengris_scaler-1.12.7.dist-info → opengris_scaler-1.12.8.dist-info}/WHEEL +0 -0
- {opengris_scaler-1.12.7.dist-info → opengris_scaler-1.12.8.dist-info}/entry_points.txt +0 -0
- {opengris_scaler-1.12.7.dist-info → opengris_scaler-1.12.8.dist-info}/licenses/LICENSE +0 -0
- {opengris_scaler-1.12.7.dist-info → opengris_scaler-1.12.8.dist-info}/licenses/LICENSE.spdx +0 -0
- {opengris_scaler-1.12.7.dist-info → opengris_scaler-1.12.8.dist-info}/licenses/NOTICE +0 -0
|
@@ -5,7 +5,7 @@ opengris_scaler.libs/libstdc++-08d5c7eb.so.6.0.33,sha256=k0S_imrCh_IE6WpvxrLoVPY
|
|
|
5
5
|
scaler/CMakeLists.txt,sha256=60rkhpiwy0F-DSsRX_6nRrjYQvQ1Jp9mGp8fZsi006k,305
|
|
6
6
|
scaler/__init__.py,sha256=nZU5QZ9oW2YIaGwm3-r-6dfmirTVzZpDPDNtX-ITCV4,513
|
|
7
7
|
scaler/about.py,sha256=OBcfSvHO0P3mWaa2Ci4WEOTbH7is-3uYymScxgZPxyg,161
|
|
8
|
-
scaler/version.txt,sha256=
|
|
8
|
+
scaler/version.txt,sha256=ztdTg8VJxMY0ZJakUwlJTlvyFTAyK5iQgDBH6e22UvU,7
|
|
9
9
|
scaler/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
scaler/client/client.py,sha256=uyYVNYhLaX3H-Aqecf-yHSqvkKnWeDzpTr2atNUUv0E,24373
|
|
11
11
|
scaler/client/future.py,sha256=fOl5g4Is4E5jtvO0kmRk4uUs_eUjSjMmyniYhWMAH4w,10041
|
|
@@ -29,8 +29,8 @@ scaler/cluster/object_storage_server.py,sha256=t7lx1tXAz1Iwc3xARJQqQOcG0s1BlIc-y
|
|
|
29
29
|
scaler/cluster/scheduler.py,sha256=UqrB2ApZ9D_2IhleyGzKgZRUda5PPBiSOHO-Z0hj72k,3267
|
|
30
30
|
scaler/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
31
|
scaler/config/defaults.py,sha256=HhYpemdTj1LQUZx8Fga5zVvCeIld1vvaNhTPjP2sRB4,2865
|
|
32
|
-
scaler/config/loader.py,sha256=
|
|
33
|
-
scaler/config/mixins.py,sha256=
|
|
32
|
+
scaler/config/loader.py,sha256=nQXS7ysT5p-IVTjVTzfC19ZDdsQPBh1lnD-MX7DVHL4,3866
|
|
33
|
+
scaler/config/mixins.py,sha256=o1YivS_8AzejSQ_jfSt5bkaA59DQGbw9P-rO5Z7LFVs,443
|
|
34
34
|
scaler/config/section/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
35
|
scaler/config/section/cluster.py,sha256=JTn3rFM5HaOGyM-r9yd2xgImLgL9YJBkQPsAEDOXCd8,2855
|
|
36
36
|
scaler/config/section/native_worker_adapter.py,sha256=dYPJn3a8CrGlynrlD4NlPRfA8PBkmcERPecRdf_hKWg,2262
|
|
@@ -41,8 +41,8 @@ scaler/config/section/top.py,sha256=4YUCyZTRVfINUhV56j50pg8be5o8nlWxG08fDqofHrA,
|
|
|
41
41
|
scaler/config/section/webui.py,sha256=-9oFn1C64re2xZ_KKJIsHG--6PaVTvCP9vmRZNR_9MA,487
|
|
42
42
|
scaler/config/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
43
43
|
scaler/config/types/object_storage_server.py,sha256=xvuCwiAQ4C_hKgTI4y6XMx9NKE0aX2QC6dlWNyvJyk4,1338
|
|
44
|
-
scaler/config/types/worker.py,sha256=
|
|
45
|
-
scaler/config/types/zmq.py,sha256=
|
|
44
|
+
scaler/config/types/worker.py,sha256=0pt871QcyQ0_PEDVPxxgnnk3l5_syQA-71V1bhUmf0g,1708
|
|
45
|
+
scaler/config/types/zmq.py,sha256=0VODax61H-4PxN6rIeWKlMXOHiW5elVSt1zc-UF0SL8,2593
|
|
46
46
|
scaler/entry_points/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
47
47
|
scaler/entry_points/cluster.py,sha256=5jPO_fFVe8IiSiAkLhLZ0mXJKXiYUWjvpXjEGlcgwW4,5779
|
|
48
48
|
scaler/entry_points/object_storage_server.py,sha256=SEfBC_MdIHdZUxqHhGPb2AHje5dtIEM5uELRdHfFc0o,1316
|
|
@@ -60,7 +60,7 @@ scaler/io/sync_connector.py,sha256=zRDlBuMVbH92LqbdS35EPHXVOnaeWrvjmZZCISqqjPI,1
|
|
|
60
60
|
scaler/io/sync_object_storage_connector.py,sha256=Zeo0aVAQ_bkRnhmqG9Ozst584072uMQfASfTLixQoeQ,7324
|
|
61
61
|
scaler/io/sync_subscriber.py,sha256=rHbnhkfxvWtyswLNEyvr3D76i-sVBnGwWAGjLp2-thk,2523
|
|
62
62
|
scaler/io/utility.py,sha256=yFq8-X47RfWp344HpRfqc_3XF3c6vewKPLi73e248s8,1189
|
|
63
|
-
scaler/io/ymq/CMakeLists.txt,sha256=
|
|
63
|
+
scaler/io/ymq/CMakeLists.txt,sha256=znJS9ru-tjtn7Lv8RN1RJZVPhlHaE5AKS44z1Nnj_vE,1987
|
|
64
64
|
scaler/io/ymq/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
65
65
|
scaler/io/ymq/_ymq.pyi,sha256=HYLhjYhHTOgjffpAnlqyCSdUjEvKVRP7Slv8vIgGdkI,3036
|
|
66
66
|
scaler/io/ymq/_ymq.so,sha256=D9qAin8_34iHION8fCtVKVH-4eRHjSjBJ4lwzy5bhJg,674001
|
|
@@ -68,13 +68,12 @@ scaler/io/ymq/bytes.h,sha256=fxaZ0NMwzJC-agotCZbGizMs-IgPW4VWG4raeWBXC5I,2931
|
|
|
68
68
|
scaler/io/ymq/common.h,sha256=XmYnfVeaIGZU3-gI2slw4uZyRrz807ANJXSQTf1joEY,711
|
|
69
69
|
scaler/io/ymq/configuration.h,sha256=VvtSSGgD5dCOKc-gvtsqSBDoagaRnfnUS7jueDVsn9U,1951
|
|
70
70
|
scaler/io/ymq/epoll_context.cpp,sha256=Sde1QRukul2ecD5EpTu8D-wy3u_tVN-FphvG5QM-3Aw,4937
|
|
71
|
-
scaler/io/ymq/epoll_context.h,sha256=
|
|
71
|
+
scaler/io/ymq/epoll_context.h,sha256=0Cu840Utq6puRHCTVctCWpfdfNpUFcZJqw5D7e7hzSs,2641
|
|
72
72
|
scaler/io/ymq/error.h,sha256=BUb55lcKou20u9e_GHZ0WEmlHJeC3VQWEzW-yTuRCTQ,5552
|
|
73
73
|
scaler/io/ymq/event_loop.h,sha256=CDvcOszqtDSqkFt3t9hsT8n9HStbIchk7UO1u-3CTL0,1652
|
|
74
74
|
scaler/io/ymq/event_loop_thread.cpp,sha256=0aYMmgpg8g6mmC-Ked2F3GCHNGJNXZAZLPobEQqu7g4,1801
|
|
75
75
|
scaler/io/ymq/event_loop_thread.h,sha256=TiB_FZ6s8LE6pIBNeaQv2uuapXkoPG_JRWWywsibKHo,1593
|
|
76
76
|
scaler/io/ymq/event_manager.h,sha256=WTRkNg8j8J_tLNU2ZtilVogC2EoLT5LrLIezeox5i80,2066
|
|
77
|
-
scaler/io/ymq/file_descriptor.h,sha256=trsHS6Xi1vIzBFmYfbyqjT71OQT5y_gopb7OC-0Queo,4948
|
|
78
77
|
scaler/io/ymq/interruptive_concurrent_queue.h,sha256=_hZkdfImpXT0L1fNsb-EfAYbaeTjQNmMGVMyZ6gT2Gg,4750
|
|
79
78
|
scaler/io/ymq/io_context.cpp,sha256=MoIeg3xlSA9Q4S1O4FLXbjJSF7ZV5dRmaKJqUzQl200,3168
|
|
80
79
|
scaler/io/ymq/io_context.h,sha256=eYyXCnHWWfSPVykvvA0sdjjAnKq2y768t3Exg0EU_IA,1248
|
|
@@ -111,7 +110,7 @@ scaler/io/ymq/pymod_ymq/python.h,sha256=wb0-WNF4occ4nDphSoUI47_OrfVPP72eLlGC_B59
|
|
|
111
110
|
scaler/io/ymq/pymod_ymq/ymq.cpp,sha256=LoxL5ViLK0zyWRSYfmZn0QO-0vLw3xVZrRQJ5rWtc4w,526
|
|
112
111
|
scaler/io/ymq/pymod_ymq/ymq.h,sha256=juX5DcDMY8rxp5BixFR0NgSlTrLBPog4JdqyQB9NfVI,11936
|
|
113
112
|
scaler/io/ymq/third_party/concurrentqueue.h,sha256=yN268t8miyojar0bBBPIEjMI3DlHVZci2eufkDDA0FA,152819
|
|
114
|
-
scaler/object_storage/CMakeLists.txt,sha256=
|
|
113
|
+
scaler/object_storage/CMakeLists.txt,sha256=tmkXHBOe1Gho32n4zEqChZBNlxytRTPnIaJ_hAWHBKg,1665
|
|
115
114
|
scaler/object_storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
116
115
|
scaler/object_storage/constants.h,sha256=b5iTCS6lxWjNlanaknIheKJocTofopVxpcRCuMxiDaI,304
|
|
117
116
|
scaler/object_storage/defs.h,sha256=hYFhhYdHgkT6C7iFQuG2d-Rexvkr8VvIy1LLGEh8Mrk,286
|
|
@@ -225,10 +224,10 @@ scaler/worker_adapter/symphony/message.py,sha256=HOonEASua8e-uwpPVxprjyl1rrYmFJa
|
|
|
225
224
|
scaler/worker_adapter/symphony/task_manager.py,sha256=phgx8dtAv-5ynsvsmG4DKcSlENz4b340FE6LDUWyMwo,12139
|
|
226
225
|
scaler/worker_adapter/symphony/worker.py,sha256=VIDOoqVXbwrjHYN3lghbQpEIuCbVJUgiYsBknrI-0oc,7957
|
|
227
226
|
scaler/worker_adapter/symphony/worker_adapter.py,sha256=eAAD1O0Uz1pjEdQPPl2fd8kyaF6q-aqCRrg48k1ocUU,5455
|
|
228
|
-
opengris_scaler-1.12.
|
|
229
|
-
opengris_scaler-1.12.
|
|
230
|
-
opengris_scaler-1.12.
|
|
231
|
-
opengris_scaler-1.12.
|
|
232
|
-
opengris_scaler-1.12.
|
|
233
|
-
opengris_scaler-1.12.
|
|
234
|
-
opengris_scaler-1.12.
|
|
227
|
+
opengris_scaler-1.12.8.dist-info/METADATA,sha256=jeFAZLMo6b4s-xyMC1_YXh5oMdQH8c13gHEPN37jeS8,26987
|
|
228
|
+
opengris_scaler-1.12.8.dist-info/WHEEL,sha256=XKO4RLwor0g5skDMe1ttji76FU-p6-_UPlAU3nSO9s0,115
|
|
229
|
+
opengris_scaler-1.12.8.dist-info/entry_points.txt,sha256=KROw4kj4Z6p8YuOgpOFt5spHskm87A7Z-fOOffT4tVU,446
|
|
230
|
+
opengris_scaler-1.12.8.dist-info/RECORD,,
|
|
231
|
+
opengris_scaler-1.12.8.dist-info/licenses/LICENSE,sha256=xudC0jta6OXJkSHiLzzQQU50HIwSo0G97exO280dtR8,11345
|
|
232
|
+
opengris_scaler-1.12.8.dist-info/licenses/LICENSE.spdx,sha256=i49Qe6AmXxuvocKyExEFduvdh-NQ5YuxdHs515G8VOQ,225
|
|
233
|
+
opengris_scaler-1.12.8.dist-info/licenses/NOTICE,sha256=JUHdG2ssq0nP2QsqPM8X2eJhfJhK_lemIvDBqBRXrMo,286
|
scaler/config/loader.py
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import argparse
|
|
2
2
|
import dataclasses
|
|
3
3
|
import enum
|
|
4
|
+
import sys
|
|
4
5
|
from typing import Any, cast, Dict, Optional, Type, TypeVar, Union, get_args, get_origin
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
if sys.version_info >= (3, 11):
|
|
7
8
|
import tomllib
|
|
8
|
-
|
|
9
|
+
else:
|
|
9
10
|
import tomli as tomllib
|
|
10
11
|
|
|
11
12
|
from scaler.config.mixins import ConfigType
|
scaler/config/mixins.py
CHANGED
scaler/config/types/worker.py
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import dataclasses
|
|
2
|
+
import sys
|
|
2
3
|
from typing import List, Dict
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
if sys.version_info >= (3, 11):
|
|
6
|
+
from typing import Self
|
|
7
|
+
else:
|
|
8
|
+
from typing_extensions import Self
|
|
4
9
|
|
|
5
10
|
from scaler.config.mixins import ConfigType
|
|
6
11
|
|
scaler/config/types/zmq.py
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import dataclasses
|
|
2
2
|
import enum
|
|
3
|
+
import sys
|
|
3
4
|
from typing import Optional
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
if sys.version_info >= (3, 11):
|
|
7
|
+
from typing import Self
|
|
8
|
+
else:
|
|
9
|
+
from typing_extensions import Self
|
|
6
10
|
from scaler.config.mixins import ConfigType
|
|
7
11
|
|
|
8
12
|
|
scaler/io/ymq/CMakeLists.txt
CHANGED
|
@@ -58,7 +58,6 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/scaler/io/ymq)
|
|
|
58
58
|
|
|
59
59
|
if(LINUX)
|
|
60
60
|
# ymq python =======================================================================================================
|
|
61
|
-
find_package(Python3 COMPONENTS Development.Module REQUIRED)
|
|
62
61
|
|
|
63
62
|
add_library(py_ymq SHARED
|
|
64
63
|
pymod_ymq/bytes.h
|
scaler/io/ymq/epoll_context.h
CHANGED
|
@@ -21,8 +21,6 @@ add_library(object_storage_server_objs OBJECT
|
|
|
21
21
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/scaler/object_storage)
|
|
22
22
|
|
|
23
23
|
# object_storage_server python =========================================================================================
|
|
24
|
-
find_package(Python3 REQUIRED COMPONENTS Development.Module)
|
|
25
|
-
|
|
26
24
|
add_library(py_object_storage_server MODULE
|
|
27
25
|
pymod_object_storage_server.cpp
|
|
28
26
|
)
|
scaler/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.12.
|
|
1
|
+
1.12.8
|
scaler/io/ymq/file_descriptor.h
DELETED
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
// System
|
|
4
|
-
#include <sys/epoll.h>
|
|
5
|
-
#include <sys/eventfd.h>
|
|
6
|
-
#include <sys/socket.h>
|
|
7
|
-
#include <sys/timerfd.h>
|
|
8
|
-
#include <unistd.h>
|
|
9
|
-
|
|
10
|
-
// C
|
|
11
|
-
#include <cerrno>
|
|
12
|
-
|
|
13
|
-
// C++
|
|
14
|
-
#include <expected>
|
|
15
|
-
#include <optional>
|
|
16
|
-
|
|
17
|
-
// First-party
|
|
18
|
-
#include "scaler/io/ymq/common.h"
|
|
19
|
-
|
|
20
|
-
class FileDescriptor {
|
|
21
|
-
int fd;
|
|
22
|
-
|
|
23
|
-
FileDescriptor(int fd): fd(fd) {}
|
|
24
|
-
|
|
25
|
-
public:
|
|
26
|
-
~FileDescriptor() noexcept(false)
|
|
27
|
-
{
|
|
28
|
-
if (auto code = close(fd) < 0)
|
|
29
|
-
throw std::system_error(errno, std::system_category(), "Failed to close file descriptor");
|
|
30
|
-
|
|
31
|
-
this->fd = -1;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
FileDescriptor(): fd(-1) {}
|
|
35
|
-
|
|
36
|
-
// move-only
|
|
37
|
-
FileDescriptor(const FileDescriptor&) = delete;
|
|
38
|
-
FileDescriptor& operator=(const FileDescriptor&) = delete;
|
|
39
|
-
FileDescriptor(FileDescriptor&& other) noexcept: fd(other.fd)
|
|
40
|
-
{
|
|
41
|
-
other.fd = -1; // prevent double close
|
|
42
|
-
}
|
|
43
|
-
FileDescriptor& operator=(FileDescriptor&& other) noexcept
|
|
44
|
-
{
|
|
45
|
-
if (this != &other) {
|
|
46
|
-
if (fd >= 0) {
|
|
47
|
-
close(fd); // close current fd
|
|
48
|
-
}
|
|
49
|
-
fd = other.fd;
|
|
50
|
-
other.fd = -1; // prevent double close
|
|
51
|
-
}
|
|
52
|
-
return *this;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
static std::expected<FileDescriptor, Errno> socket(int domain, int type, int protocol)
|
|
56
|
-
{
|
|
57
|
-
if (int fd = ::socket(domain, type, protocol) < 0) {
|
|
58
|
-
return std::unexpected {errno};
|
|
59
|
-
} else {
|
|
60
|
-
return FileDescriptor(fd);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
static std::expected<FileDescriptor, Errno> eventfd(int initval, int flags)
|
|
65
|
-
{
|
|
66
|
-
if (int fd = ::eventfd(initval, flags) < 0) {
|
|
67
|
-
return std::unexpected {errno};
|
|
68
|
-
} else {
|
|
69
|
-
return FileDescriptor(fd);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
static std::expected<FileDescriptor, Errno> timerfd(clockid_t clock, int flags)
|
|
74
|
-
{
|
|
75
|
-
if (int fd = ::timerfd_create(clock, flags) < 0) {
|
|
76
|
-
return std::unexpected {errno};
|
|
77
|
-
} else {
|
|
78
|
-
return FileDescriptor(fd);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
static std::expected<FileDescriptor, Errno> epollfd()
|
|
83
|
-
{
|
|
84
|
-
if (int fd = ::epoll_create1(0) < 0) {
|
|
85
|
-
return std::unexpected {errno};
|
|
86
|
-
} else {
|
|
87
|
-
return FileDescriptor(fd);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
std::optional<Errno> listen(int backlog)
|
|
92
|
-
{
|
|
93
|
-
if (::listen(fd, backlog) < 0) {
|
|
94
|
-
return errno;
|
|
95
|
-
} else {
|
|
96
|
-
return std::nullopt;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
std::expected<FileDescriptor, Errno> accept(sockaddr& addr, socklen_t& addrlen)
|
|
101
|
-
{
|
|
102
|
-
if (auto fd2 = ::accept(fd, &addr, &addrlen) < 0) {
|
|
103
|
-
return std::unexpected {errno};
|
|
104
|
-
} else {
|
|
105
|
-
return FileDescriptor(fd2);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
std::optional<Errno> connect(const sockaddr& addr, socklen_t addrlen)
|
|
110
|
-
{
|
|
111
|
-
if (::connect(fd, &addr, addrlen) < 0) {
|
|
112
|
-
return errno;
|
|
113
|
-
} else {
|
|
114
|
-
return std::nullopt;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
std::optional<Errno> bind(const sockaddr& addr, socklen_t addrlen)
|
|
119
|
-
{
|
|
120
|
-
if (::bind(fd, &addr, addrlen) < 0) {
|
|
121
|
-
return errno;
|
|
122
|
-
} else {
|
|
123
|
-
return std::nullopt;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
std::expected<ssize_t, Errno> read(void* buf, size_t count)
|
|
128
|
-
{
|
|
129
|
-
ssize_t n = ::read(fd, buf, count);
|
|
130
|
-
if (n < 0) {
|
|
131
|
-
return std::unexpected {errno};
|
|
132
|
-
} else {
|
|
133
|
-
return n;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
std::expected<ssize_t, Errno> write(const void* buf, size_t count)
|
|
138
|
-
{
|
|
139
|
-
ssize_t n = ::write(fd, buf, count);
|
|
140
|
-
if (n < 0) {
|
|
141
|
-
return std::unexpected {errno};
|
|
142
|
-
} else {
|
|
143
|
-
return n;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
std::optional<Errno> eventfd_signal()
|
|
148
|
-
{
|
|
149
|
-
uint64_t u = 1;
|
|
150
|
-
if (::eventfd_write(fd, u) < 0) {
|
|
151
|
-
return errno;
|
|
152
|
-
} else {
|
|
153
|
-
return std::nullopt;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
std::optional<Errno> eventfd_wait()
|
|
158
|
-
{
|
|
159
|
-
uint64_t u;
|
|
160
|
-
if (::eventfd_read(fd, &u) < 0) {
|
|
161
|
-
return errno;
|
|
162
|
-
} else {
|
|
163
|
-
return std::nullopt;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
std::optional<Errno> timerfd_settime(const itimerspec& new_value, itimerspec* old_value = nullptr)
|
|
168
|
-
{
|
|
169
|
-
if (::timerfd_settime(fd, 0, &new_value, old_value) < 0) {
|
|
170
|
-
return errno;
|
|
171
|
-
} else {
|
|
172
|
-
return std::nullopt;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
std::optional<Errno> timerfd_wait()
|
|
177
|
-
{
|
|
178
|
-
uint64_t u;
|
|
179
|
-
if (::read(fd, &u, sizeof(u)) < 0) {
|
|
180
|
-
return errno;
|
|
181
|
-
} else {
|
|
182
|
-
return std::nullopt;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
std::optional<Errno> epoll_ctl(int op, FileDescriptor& other, epoll_event* event)
|
|
187
|
-
{
|
|
188
|
-
if (::epoll_ctl(fd, op, other.fd, event) < 0) {
|
|
189
|
-
return errno;
|
|
190
|
-
} else {
|
|
191
|
-
return std::nullopt;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
std::expected<int, Errno> epoll_wait(epoll_event* events, int maxevents, int timeout)
|
|
196
|
-
{
|
|
197
|
-
if (auto n = ::epoll_wait(fd, events, maxevents, timeout) < 0) {
|
|
198
|
-
return errno;
|
|
199
|
-
} else {
|
|
200
|
-
return n;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|