mirror of
https://github.com/Karmaz95/Snake_Apple.git
synced 2026-03-30 14:00:16 +02:00
Article: Exceptions on macOS
This commit is contained in:
8
X. NU/custom/mach_call_demo.c
Normal file
8
X. NU/custom/mach_call_demo.c
Normal 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
|
||||
}
|
||||
|
||||
8
X. NU/custom/system_call_demo.c
Normal file
8
X. NU/custom/system_call_demo.c
Normal 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;
|
||||
}
|
||||
|
||||
BIN
X. NU/mac/XNU_exception_handling_map.png
Normal file
BIN
X. NU/mac/XNU_exception_handling_map.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 404 KiB |
Reference in New Issue
Block a user