Article: Exceptions on macOS

This commit is contained in:
Karmaz95
2024-11-22 19:20:41 +01:00
parent c956294ec7
commit 1bc13f6fbe
3 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
#include <mach/mach.h>
int main() {
mach_port_t port;
mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &port);
return 0; // Port allocation directly interacts with kernelspace
}

View File

@@ -0,0 +1,8 @@
#include <unistd.h>
int main() {
const char *message = "Hello, Kernelspace!\n";
write(1, message, 20); // Direct system call to write to stdout
return 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 KiB