AuroraRuntime/Source/AuProcAddresses.UNIX.hpp

42 lines
1.3 KiB
C++
Executable File

/***
Copyright (C) 2024 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: AuProcAddresses.UNIX.hpp
Date: 2024-3-5
Author: Reece
***/
#pragma once
// PosixOpen platform specific flags!
#include <fcntl.h>
#define UNW_LOCAL_ONLY
#include <libunwind.h>
namespace Aurora
{
void PosixDoForkHooks();
void PosixShutup();
void PosixTerminate();
void PosixFDYeetus();
int PosixOpen(const char *pathname, int flags, mode_t mode = 0);
AuUInt64 PosixGetOffset(int fd);
bool PosixSetOffset(int fd, AuUInt64 offset);
AuUInt64 PosixGetLength(int fd);
bool PosixRead (int fd, void *buf, AuUInt32 count, AuUInt32 *pRead);
bool PosixWrite (int fd, const void *buf, AuUInt32 count, AuUInt32 *pWritten);
void PosixWriteEoS (int fd);
int PosixUnlink (const char *pathname);
void PosixInitAddresses();
inline int (*punw_getcontext)(unw_context_t *ucp) = nullptr;
inline int (*punw_get_reg)(unw_cursor_t *cp, unw_regnum_t reg, unw_word_t *valp) = nullptr;
inline int (*punw_get_proc_name)(unw_cursor_t *cp, char *bufp, size_t len, unw_word_t *offp) = nullptr;
inline int (*punw_step)(unw_cursor_t *cp) = nullptr;
inline int (*punw_init_local)(unw_cursor_t *c, unw_context_t *ctxt) = nullptr;
}