The main posixpp library and associated tests.
Revision | 1f9d5bc4023b7c8366c8079fc68877fb717e9ff9 (tree) |
---|---|
Time | 2021-05-01 01:32:37 |
Author | Eric Hopper <hopper@omni...> |
Commiter | Eric Hopper |
Add exit system calls, also hard to test for.
@@ -26,7 +26,7 @@ | ||
26 | 26 | pubincludes/pppbase/flagset.h tests/flagset.cpp |
27 | 27 | pubincludes/syscalls/linux/x86_64/fdflags.h tests/fdflags.cpp |
28 | 28 | pubincludes/syscalls/linux/x86_64/modeflags.h |
29 | - pubincludes/posixpp/modeflags.h) | |
29 | + pubincludes/posixpp/modeflags.h pubincludes/syscalls/linux/basic.h pubincludes/posixpp/basic.h) | |
30 | 30 | set_property(TARGET all_tests PROPERTY CXX_EXTENSIONS OFF) |
31 | 31 | target_compile_features(all_tests PUBLIC cxx_std_20) |
32 | 32 | target_link_libraries(all_tests Catch2::Catch2 fmt::fmt posixpp) |
@@ -0,0 +1,15 @@ | ||
1 | +// Copyright 2021 Eric Hopper | |
2 | +// Distributed under the terms of the LGPLv3. | |
3 | + | |
4 | +#pragma once | |
5 | + | |
6 | +#include <syscalls/linux/basic.h> | |
7 | + | |
8 | +namespace posixpp { | |
9 | + | |
10 | +inline void exit [[noreturn]] (int status) | |
11 | +{ | |
12 | + ::syscalls::linux::exit(status); | |
13 | +} | |
14 | + | |
15 | +} |
@@ -0,0 +1,20 @@ | ||
1 | +// Copyright 2021 by Eric Hopper | |
2 | +// Distributed under the terms of the LGPLv3. | |
3 | +#pragma once | |
4 | + | |
5 | +#include <cstdint> | |
6 | +#include <syscalls/linux/syscall.h> | |
7 | + | |
8 | +namespace syscalls { | |
9 | +namespace linux { | |
10 | + | |
11 | +inline void exit [[noreturn]](int status) noexcept { | |
12 | + syscall_expected(call_id::exit, status); | |
13 | +} | |
14 | + | |
15 | +inline void exit_group [[noreturn]](int status) noexcept { | |
16 | + syscall_expected(call_id::exit_group, status); | |
17 | +} | |
18 | + | |
19 | +} // namespace linux | |
20 | +} // namespace syscalls |
@@ -321,6 +321,7 @@ | ||
321 | 321 | epoll_ctl_old, |
322 | 322 | epoll_wait_old, |
323 | 323 | |
324 | + exit_group = 231, | |
324 | 325 | epoll_wait = 232, |
325 | 326 | epoll_ctl, |
326 | 327 |