• R/O
  • SSH

posixpp: Commit

The main posixpp library and associated tests.


Commit MetaInfo

Revision1f9d5bc4023b7c8366c8079fc68877fb717e9ff9 (tree)
Time2021-05-01 01:32:37
AuthorEric Hopper <hopper@omni...>
CommiterEric Hopper

Log Message

Add exit system calls, also hard to test for.

Change Summary

Incremental Difference

diff -r d30c74a036b5 -r 1f9d5bc4023b CMakeLists.txt
--- a/CMakeLists.txt Thu Apr 29 09:31:19 2021 -0700
+++ b/CMakeLists.txt Fri Apr 30 09:32:37 2021 -0700
@@ -26,7 +26,7 @@
2626 pubincludes/pppbase/flagset.h tests/flagset.cpp
2727 pubincludes/syscalls/linux/x86_64/fdflags.h tests/fdflags.cpp
2828 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)
3030 set_property(TARGET all_tests PROPERTY CXX_EXTENSIONS OFF)
3131 target_compile_features(all_tests PUBLIC cxx_std_20)
3232 target_link_libraries(all_tests Catch2::Catch2 fmt::fmt posixpp)
diff -r d30c74a036b5 -r 1f9d5bc4023b pubincludes/posixpp/basic.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pubincludes/posixpp/basic.h Fri Apr 30 09:32:37 2021 -0700
@@ -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+}
diff -r d30c74a036b5 -r 1f9d5bc4023b pubincludes/syscalls/linux/basic.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pubincludes/syscalls/linux/basic.h Fri Apr 30 09:32:37 2021 -0700
@@ -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
diff -r d30c74a036b5 -r 1f9d5bc4023b pubincludes/syscalls/linux/x86_64/syscall.h
--- a/pubincludes/syscalls/linux/x86_64/syscall.h Thu Apr 29 09:31:19 2021 -0700
+++ b/pubincludes/syscalls/linux/x86_64/syscall.h Fri Apr 30 09:32:37 2021 -0700
@@ -321,6 +321,7 @@
321321 epoll_ctl_old,
322322 epoll_wait_old,
323323
324+ exit_group = 231,
324325 epoll_wait = 232,
325326 epoll_ctl,
326327
Show on old repository browser