Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/public/minbase/minbase_identify.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@
#elif defined( LINUX ) || defined( __LINUX__ ) || defined(linux) || defined(__linux) || defined(__linux__)
#define IsLinux() true
#define IsPosix() true
#elif defined(__FreeBSD__)
#define IsFreeBSD() true
#define IsPosix() true
#elif defined( _POSIX_VERSION ) || defined( POSIX ) || defined( VALVE_POSIX )
#define IsPosix() true
#else
Expand Down
2 changes: 1 addition & 1 deletion src/public/tier0/platform_sockets.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ typedef char SteamNetworkingErrMsg[ 1024 ];

#define PlatformSupportsRecvMsg() true

#ifdef __APPLE__
#if defined(__APPLE__) || defined(__FreeBSD__)
#define USE_POLL

// I can't get this to work on MacOS. If someboddy believes that
Expand Down
22 changes: 17 additions & 5 deletions src/tier0/dbg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ using namespace SteamNetworkingSocketsLib;
#include <sys/ptrace.h>
#endif

#if IsOSX()
#include <sys/sysctl.h>
#if IsOSX() || IsFreeBSD()
#include <sys/sysctl.h>
#if IsFreeBSD()
#include <sys/proc.h>
#include <sys/user.h>
#endif
#endif

#if IsPlaystation() && defined(_DEBUG)
Expand All @@ -45,7 +49,7 @@ bool Plat_IsInDebugSession()
{
#ifdef _WIN32
return (IsDebuggerPresent() != 0);
#elif IsOSX()
#elif IsOSX() || IsFreeBSD()
int mib[4];
struct kinfo_proc info;
size_t size;
Expand All @@ -54,9 +58,17 @@ bool Plat_IsInDebugSession()
mib[2] = KERN_PROC_PID;
mib[3] = getpid();
size = sizeof(info);
info.kp_proc.p_flag = 0;
#if IsFreeBSD()
info.ki_paddr->p_flag = 0;
#else
info.kp_proc.flag = 0;
#endif
sysctl(mib,4,&info,&size,NULL,0);
return ((info.kp_proc.p_flag & P_TRACED) == P_TRACED);
#if IsFreeBSD()
return ((info.ki_paddr->p_flag & P_TRACED) == P_TRACED);
#else
return ((info.kp_proc.flag & P_TRACED) == P_TRACED);
#endif
#elif IsLinux()
static FILE *fp;
if ( !fp )
Expand Down