1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-14 15:23:39 +00:00

Initial modifications to support FreeBSD

This commit is contained in:
Bryan Roe
2019-06-17 15:45:46 -07:00
parent cefab43b99
commit 124c0d386f
16 changed files with 74 additions and 38 deletions

View File

@@ -66,7 +66,7 @@
# make linux ARCHID=25 # Linux ARM 32 bit HardFloat (Raspberry Pi, etc) # make linux ARCHID=25 # Linux ARM 32 bit HardFloat (Raspberry Pi, etc)
# make linux ARCHID=26 # Linux ARM 64 bit # make linux ARCHID=26 # Linux ARM 64 bit
# make pi KVM=1 ARCHID=25 # Linux ARM 32 bit HardFloat, compiled on the Pi. # make pi KVM=1 ARCHID=25 # Linux ARM 32 bit HardFloat, compiled on the Pi.
# # gmake freebsd ARCHID=30 # FreeBSD x86 64 bit
# Microstack & Microscript # Microstack & Microscript
SOURCES = microstack/ILibAsyncServerSocket.c microstack/ILibAsyncSocket.c microstack/ILibAsyncUDPSocket.c microstack/ILibParsers.c microstack/ILibMulticastSocket.c SOURCES = microstack/ILibAsyncServerSocket.c microstack/ILibAsyncSocket.c microstack/ILibAsyncUDPSocket.c microstack/ILibParsers.c microstack/ILibMulticastSocket.c
@@ -257,6 +257,15 @@ CFLAGS += -D_NOFSWATCHER
CEXTRA = -fno-strict-aliasing CEXTRA = -fno-strict-aliasing
endif endif
# Official FreeBSD x86-64
ifeq ($(ARCHID),30)
ARCHNAME = freebsd_x86-64
CC = clang
KVM = 0
LMS = 0
endif
ifeq ($(WEBLOG),1) ifeq ($(WEBLOG),1)
CFLAGS += -D_REMOTELOGGINGSERVER -D_REMOTELOGGING CFLAGS += -D_REMOTELOGGINGSERVER -D_REMOTELOGGING
endif endif
@@ -293,9 +302,11 @@ SOURCES += microstack/nossl/sha384-512.c microstack/nossl/sha224-256.c microstac
CFLAGS += -DMICROSTACK_NOTLS CFLAGS += -DMICROSTACK_NOTLS
LINUXSSL = LINUXSSL =
MACSSL = MACSSL =
BSDSSL =
else else
LINUXSSL = -Lopenssl/libstatic/linux/$(ARCHNAME) LINUXSSL = -Lopenssl/libstatic/linux/$(ARCHNAME)
MACSSL = -Lopenssl/libstatic/macos/$(ARCHNAME) MACSSL = -Lopenssl/libstatic/macos/$(ARCHNAME)
BSDSSL = -Lopenssl/libstatic/bsd/$(ARCHNAME)
CFLAGS += -DMICROSTACK_TLS_DETECT CFLAGS += -DMICROSTACK_TLS_DETECT
LDEXTRA += -lssl -lcrypto LDEXTRA += -lssl -lcrypto
endif endif
@@ -412,4 +423,6 @@ macos:
$(MAKE) $(MAKEFILE) EXENAME="$(EXENAME)_$(ARCHNAME)" ADDITIONALSOURCES="$(MACOSKVMSOURCES)" CFLAGS="-arch x86_64 -mmacosx-version-min=10.5 -std=gnu99 -Wall -DMESH_AGENTID=$(ARCHID) -D_POSIX -D_NOILIBSTACKDEBUG -D_NOHECI -DMICROSTACK_PROXY -D__APPLE__ $(CWEBLOG) -fno-strict-aliasing $(INCDIRS) $(CFLAGS) $(CEXTRA)" LDFLAGS="$(MACSSL) $(MACOSFLAGS) -L. -lpthread -ldl -lz -lutil -framework IOKit -framework ApplicationServices -framework SystemConfiguration -framework CoreFoundation -fconstant-cfstrings $(LDFLAGS) $(LDEXTRA)" $(MAKE) $(MAKEFILE) EXENAME="$(EXENAME)_$(ARCHNAME)" ADDITIONALSOURCES="$(MACOSKVMSOURCES)" CFLAGS="-arch x86_64 -mmacosx-version-min=10.5 -std=gnu99 -Wall -DMESH_AGENTID=$(ARCHID) -D_POSIX -D_NOILIBSTACKDEBUG -D_NOHECI -DMICROSTACK_PROXY -D__APPLE__ $(CWEBLOG) -fno-strict-aliasing $(INCDIRS) $(CFLAGS) $(CEXTRA)" LDFLAGS="$(MACSSL) $(MACOSFLAGS) -L. -lpthread -ldl -lz -lutil -framework IOKit -framework ApplicationServices -framework SystemConfiguration -framework CoreFoundation -fconstant-cfstrings $(LDFLAGS) $(LDEXTRA)"
$(STRIP) $(STRIP)
freebsd:
$(MAKE) EXENAME="$(EXENAME)_$(ARCHNAME)$(EXENAME2)" AID="$(ARCHID)" CFLAGS="-std=gnu99 -Wall -DMESH_AGENTID=$(ARCHID) -D_POSIX -D_FREEBSD -D_NOHECI -D_NOILIBSTACKDEBUG -DMICROSTACK_PROXY -fno-strict-aliasing $(INCDIRS) $(CFLAGS) $(CEXTRA)" LDFLAGS="$(BSDSSL) -L. -lpthread -ldl -lz -lutil $(LDFLAGS) $(LDEXTRA)"

View File

@@ -4487,8 +4487,12 @@ int MeshAgent_Start(MeshAgentHostContainer *agentHost, int paramLen, char **para
exePath[(int)len] = 0; exePath[(int)len] = 0;
agentHost->exePath = exePath; agentHost->exePath = exePath;
#elif defined(NACL) #elif defined(NACL)
#else
#ifdef _FREEBSD
x = readlink("/proc/curproc/file", exePath, 1024);
#else #else
x = readlink("/proc/self/exe", exePath, 1024); x = readlink("/proc/self/exe", exePath, 1024);
#endif
if (x < 0 || x >= 1024) ILIBCRITICALEXIT(246); if (x < 0 || x >= 1024) ILIBCRITICALEXIT(246);
exePath[x] = 0; exePath[x] = 0;
#endif #endif

View File

@@ -42,8 +42,9 @@ limitations under the License.
#include <net/if_arp.h> #include <net/if_arp.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <sys/syscall.h> #include <sys/syscall.h>
#ifndef _FREEBSD
#include <linux/reboot.h> #include <linux/reboot.h>
#endif
#define inaddrr(x) (*(struct in_addr *) &ifr->x[sizeof sa.sin_port]) #define inaddrr(x) (*(struct in_addr *) &ifr->x[sizeof sa.sin_port])
#define IFRSIZE ((int)(size * sizeof (struct ifreq))) #define IFRSIZE ((int)(size * sizeof (struct ifreq)))
@@ -333,7 +334,7 @@ int info_GetDefaultGateway(char* ifname, char** gateway)
// This is the POSIX implementation of a method that gets information about local interfaces // This is the POSIX implementation of a method that gets information about local interfaces
int info_GetLocalInterfaces(char* data, int maxdata) int info_GetLocalInterfaces(char* data, int maxdata)
{ {
#ifdef NACL #if defined NACL || defined(_FREEBSD)
return 0; return 0;
#else #else
@@ -510,7 +511,7 @@ int MeshInfo_PowerState(enum AgentPowerStateActions flg, int force)
#endif #endif
} }
#elif _VX_CPU // If VxWorks, we still need to implement this. #elif defined(_VX_CPU) || defined(_FREEBSD) // If VxWorks, we still need to implement this.
int MeshInfo_PowerState(enum AgentPowerStateActions flg, int force) int MeshInfo_PowerState(enum AgentPowerStateActions flg, int force)
{ {

View File

@@ -24,6 +24,7 @@ limitations under the License.
#include "../microstack/ILibProcessPipe.h" #include "../microstack/ILibProcessPipe.h"
#include "../microstack/ILibRemoteLogging.h" #include "../microstack/ILibRemoteLogging.h"
#ifndef _NOHECI
#ifdef WIN32 #ifdef WIN32
#include <windows.h> #include <windows.h>
@@ -1143,3 +1144,6 @@ void ILibDuktape_HECI_Init(duk_context *ctx)
{ {
ILibDuktape_ModSearch_AddHandler(ctx, "heci", ILibDuktape_HECI_Push); ILibDuktape_ModSearch_AddHandler(ctx, "heci", ILibDuktape_HECI_Push);
} }
#endif

View File

@@ -27,10 +27,10 @@ limitations under the License.
#ifndef NO_IFADDR #ifndef NO_IFADDR
#include <ifaddrs.h> #include <ifaddrs.h>
#endif #endif
#ifndef __APPLE__ #ifdef __APPLE__
#include <netpacket/packet.h>
#else
#include <mach-o/dyld.h> #include <mach-o/dyld.h>
#elif !defined(_FREEBSD)
#include <netpacket/packet.h>
#endif #endif
#include <sys/utsname.h> #include <sys/utsname.h>
#endif #endif
@@ -467,7 +467,11 @@ void ILibDuktape_ScriptContainer_CheckEmbedded(char **script, int *scriptLen)
if (_NSGetExecutablePath(exePath, &len) != 0) ILIBCRITICALEXIT(247); if (_NSGetExecutablePath(exePath, &len) != 0) ILIBCRITICALEXIT(247);
exePath[len] = 0; exePath[len] = 0;
#elif defined(NACL) #elif defined(NACL)
#else #elif defined(_FREEBSD)
int x = readlink("/proc/curproc/file", exePath, sizeof(exePath));
if (x < 0 || x >= sizeof(exePath)) ILIBCRITICALEXIT(246);
exePath[x] = 0;
#elif
int x = readlink("/proc/self/exe", exePath, sizeof(exePath)); int x = readlink("/proc/self/exe", exePath, sizeof(exePath));
if (x < 0 || x >= sizeof(exePath)) ILIBCRITICALEXIT(246); if (x < 0 || x >= sizeof(exePath)) ILIBCRITICALEXIT(246);
exePath[x] = 0; exePath[x] = 0;
@@ -1015,6 +1019,8 @@ void ILibDuktape_ScriptContainer_Process_Init(duk_context *ctx, char **argList)
duk_push_string(ctx, "win32"); duk_push_string(ctx, "win32");
#elif defined(__APPLE__) #elif defined(__APPLE__)
duk_push_string(ctx, "darwin"); duk_push_string(ctx, "darwin");
#elif defined(_FREEBSD)
duk_push_string(ctx, "freebsd");
#else #else
duk_push_string(ctx, "linux"); duk_push_string(ctx, "linux");
#endif #endif
@@ -1346,7 +1352,7 @@ int ILibDuktape_ScriptContainer_os_isWirelessInterface(char *interfaceName)
return(retVal); return(retVal);
} }
#endif #endif
#ifndef __APPLE__ #if !defined(__APPLE__) && !defined(_FREEBSD)
duk_ret_t ILibDuktape_ScriptContainer_OS_networkInterfaces(duk_context *ctx) duk_ret_t ILibDuktape_ScriptContainer_OS_networkInterfaces(duk_context *ctx)
{ {
#if !defined(WIN32) #if !defined(WIN32)
@@ -1607,7 +1613,7 @@ void ILibDuktape_ScriptContainer_OS_Push(duk_context *ctx, void *chain)
ILibDuktape_CreateInstanceMethod(ctx, "arch", ILibDuktape_ScriptContainer_OS_arch, 0); ILibDuktape_CreateInstanceMethod(ctx, "arch", ILibDuktape_ScriptContainer_OS_arch, 0);
ILibDuktape_CreateInstanceMethod(ctx, "platform", ILibDuktape_ScriptContainer_OS_platform, 0); ILibDuktape_CreateInstanceMethod(ctx, "platform", ILibDuktape_ScriptContainer_OS_platform, 0);
#ifndef __APPLE__ #if !defined(__APPLE__) && !defined(_FREEBSD)
ILibDuktape_CreateInstanceMethod(ctx, "networkInterfaces", ILibDuktape_ScriptContainer_OS_networkInterfaces, 0); ILibDuktape_CreateInstanceMethod(ctx, "networkInterfaces", ILibDuktape_ScriptContainer_OS_networkInterfaces, 0);
#endif #endif
ILibDuktape_CreateInstanceMethod(ctx, "hostname", ILibDuktape_ScriptContainer_OS_hostname, 0); ILibDuktape_CreateInstanceMethod(ctx, "hostname", ILibDuktape_ScriptContainer_OS_hostname, 0);

View File

@@ -39,7 +39,7 @@ limitations under the License.
#ifdef _POSIX #ifdef _POSIX
#include <sys/stat.h> #include <sys/stat.h>
#if !defined(_NOFSWATCHER) && !defined(__APPLE__) #if !defined(_NOFSWATCHER) && !defined(__APPLE__) && !defined(_FREEBSD)
#include <sys/inotify.h> #include <sys/inotify.h>
#endif #endif
#endif #endif
@@ -905,7 +905,7 @@ duk_ret_t ILibDuktape_fs_watcher_close(duk_context *ctx)
ILibProcessPipe_WaitHandle_Remove(data->pipeManager, data->overlapped.hEvent); ILibProcessPipe_WaitHandle_Remove(data->pipeManager, data->overlapped.hEvent);
CloseHandle(data->h); CloseHandle(data->h);
data->h = NULL; data->h = NULL;
#elif defined(_POSIX) && !defined(__APPLE__) #elif defined(_POSIX) && !defined(__APPLE__) && !defined(_FREEBSD)
ILibHashtable_Remove(data->linuxWatcher->watchTable, data->wd.p, NULL, 0); ILibHashtable_Remove(data->linuxWatcher->watchTable, data->wd.p, NULL, 0);
if (inotify_rm_watch(data->linuxWatcher->fd, data->wd.i) != 0) { ILibRemoteLogging_printf(ILibChainGetLogger(Duktape_GetChain(ctx)), ILibRemoteLogging_Modules_Agent_GuardPost | ILibRemoteLogging_Modules_ConsolePrint, ILibRemoteLogging_Flags_VerbosityLevel_1, "FSWatcher.close(): Error removing wd[%d] from fd[%d]", data->wd.i, data->linuxWatcher->fd); } if (inotify_rm_watch(data->linuxWatcher->fd, data->wd.i) != 0) { ILibRemoteLogging_printf(ILibChainGetLogger(Duktape_GetChain(ctx)), ILibRemoteLogging_Modules_Agent_GuardPost | ILibRemoteLogging_Modules_ConsolePrint, ILibRemoteLogging_Flags_VerbosityLevel_1, "FSWatcher.close(): Error removing wd[%d] from fd[%d]", data->wd.i, data->linuxWatcher->fd); }
else else
@@ -1046,7 +1046,7 @@ duk_ret_t ILibDuktape_fs_watcher_finalizer(duk_context *ctx)
return 0; return 0;
} }
#if defined(_POSIX) && !defined(__APPLE__) #if defined(_POSIX) && !defined(__APPLE__) && !defined(_FREEBSD)
void ILibDuktape_fs_notifyDispatcher_PreSelect(void* object, fd_set *readset, fd_set *writeset, fd_set *errorset, int* blocktime) void ILibDuktape_fs_notifyDispatcher_PreSelect(void* object, fd_set *readset, fd_set *writeset, fd_set *errorset, int* blocktime)
{ {
ILibDuktape_fs_linuxWatcher *data = (ILibDuktape_fs_linuxWatcher*)object; ILibDuktape_fs_linuxWatcher *data = (ILibDuktape_fs_linuxWatcher*)object;
@@ -1296,7 +1296,7 @@ duk_ret_t ILibDuktape_fs_watch(duk_context *ctx)
duk_pop(ctx); // ... duk_pop(ctx); // ...
} }
#elif defined(_POSIX) #elif defined(_POSIX)
#ifndef __APPLE__ #if !defined(__APPLE__) && !defined(_FREEBSD)
// Linux // Linux
ILibDuktape_fs_linuxWatcher *notifyDispatcher = NULL; ILibDuktape_fs_linuxWatcher *notifyDispatcher = NULL;
duk_push_this(ctx); // [fs] duk_push_this(ctx); // [fs]
@@ -1320,7 +1320,7 @@ duk_ret_t ILibDuktape_fs_watch(duk_context *ctx)
duk_put_prop_string(ctx, -2, FS_NOTIFY_DISPATCH_PTR); // [fs] duk_put_prop_string(ctx, -2, FS_NOTIFY_DISPATCH_PTR); // [fs]
duk_pop(ctx); // ... duk_pop(ctx); // ...
} }
#else #elif defined(__APPLE__)
// MacOS // MacOS
ILibDuktape_fs_appleWatcher *watcher = NULL; ILibDuktape_fs_appleWatcher *watcher = NULL;
duk_push_this(ctx); // [fs] duk_push_this(ctx); // [fs]
@@ -1363,7 +1363,7 @@ duk_ret_t ILibDuktape_fs_watch(duk_context *ctx)
data->chain = chain; data->chain = chain;
data->pipeManager = pipeMgr; data->pipeManager = pipeMgr;
data->recursive = recursive; data->recursive = recursive;
#elif defined(_POSIX) && !defined(__APPLE__) #elif defined(_POSIX) && !defined(__APPLE__) && !defined(_FREEBSD)
data->linuxWatcher = notifyDispatcher; data->linuxWatcher = notifyDispatcher;
#endif #endif
#ifdef __APPLE__ #ifdef __APPLE__
@@ -1396,7 +1396,7 @@ duk_ret_t ILibDuktape_fs_watch(duk_context *ctx)
return(ILibDuktape_Error(ctx, "fs.watch(): Error creating watcher")); return(ILibDuktape_Error(ctx, "fs.watch(): Error creating watcher"));
} }
ILibProcessPipe_WaitHandle_Add(pipeMgr, data->overlapped.hEvent, data, ILibDuktape_fs_watch_iocompletion); ILibProcessPipe_WaitHandle_Add(pipeMgr, data->overlapped.hEvent, data, ILibDuktape_fs_watch_iocompletion);
#elif defined(_POSIX) && !defined(__APPLE__) #elif defined(_POSIX) && !defined(__APPLE__) && !defined(_FREEBSD)
data->wd.i = inotify_add_watch(data->linuxWatcher->fd, path, IN_CREATE | IN_DELETE | IN_MODIFY | IN_MOVED_FROM | IN_MOVED_TO); data->wd.i = inotify_add_watch(data->linuxWatcher->fd, path, IN_CREATE | IN_DELETE | IN_MODIFY | IN_MOVED_FROM | IN_MOVED_TO);
if (data->wd.i < 0) if (data->wd.i < 0)
{ {

View File

@@ -28,7 +28,7 @@ limitations under the License.
#if defined(WIN32) || defined(_WIN32_WCE) #if defined(WIN32) || defined(_WIN32_WCE)
#include <STDDEF.H> #include <STDDEF.H>
#elif defined(_POSIX) #elif defined(_POSIX)
#if !defined(__APPLE__) && !defined(_VX_CPU) #if !defined(__APPLE__) && !defined(_VX_CPU) && !defined(_FREEBSD)
#include <malloc.h> #include <malloc.h>
#endif #endif
#endif #endif

View File

@@ -28,7 +28,7 @@ limitations under the License.
#if defined(WIN32) || defined(_WIN32_WCE) #if defined(WIN32) || defined(_WIN32_WCE)
#include <STDDEF.H> #include <STDDEF.H>
#elif defined(_POSIX) #elif defined(_POSIX)
#if !defined(__APPLE__) && !defined(_VX_CPU) #if !defined(__APPLE__) && !defined(_VX_CPU) && !defined(_FREEBSD)
#include <malloc.h> #include <malloc.h>
#endif #endif
#endif #endif

View File

@@ -28,7 +28,7 @@ limitations under the License.
#if defined(WIN32) || defined(_WIN32_WCE) #if defined(WIN32) || defined(_WIN32_WCE)
#include <STDDEF.H> #include <STDDEF.H>
#elif defined(_POSIX) #elif defined(_POSIX)
#if !defined(__APPLE__) && !defined(_VX_CPU) #if !defined(__APPLE__) && !defined(_VX_CPU) && !defined(_FREEBSD)
#include <malloc.h> #include <malloc.h>
#endif #endif
#endif #endif

View File

@@ -28,7 +28,7 @@ limitations under the License.
#include "ILibParsers.h" #include "ILibParsers.h"
#if defined(_POSIX) && !defined(__APPLE__) && !defined(NO_IPADDR_MONITOR) #if defined(_POSIX) && !defined(__APPLE__) && !defined(NO_IPADDR_MONITOR) && !defined(_FREEBSD)
#include <netinet/in.h> #include <netinet/in.h>
#include <linux/netlink.h> #include <linux/netlink.h>
#include <linux/rtnetlink.h> #include <linux/rtnetlink.h>
@@ -47,7 +47,7 @@ typedef struct _ILibIPAddressMonitor
SOCKET mSocket; SOCKET mSocket;
DWORD bytesReturned; DWORD bytesReturned;
OVERLAPPED *reserved; OVERLAPPED *reserved;
#elif defined (_POSIX) && !defined(__APPLE__) #elif defined (_POSIX) && !defined(__APPLE__) && !defined(_FREEBSD)
int mSocket; int mSocket;
struct sockaddr_nl addr; struct sockaddr_nl addr;
#endif #endif
@@ -96,13 +96,13 @@ void ILibIPAddressMonitor_Destroy(void *object)
obj->reserved->hEvent = NULL; obj->reserved->hEvent = NULL;
closesocket(obj->mSocket); closesocket(obj->mSocket);
obj->mSocket = INVALID_SOCKET; obj->mSocket = INVALID_SOCKET;
#elif defined(_POSIX) && !defined(__APPLE__) #elif defined(_POSIX) && !defined(__APPLE__) && !defined(_FREEBSD)
close(obj->mSocket); close(obj->mSocket);
obj->mSocket = -1; obj->mSocket = -1;
#endif #endif
} }
#if defined(_POSIX) && !defined(__APPLE__) #if defined(_POSIX) && !defined(__APPLE__) && !defined(_FREEBSD)
void ILibIPAddressMonitor_PreSelect(void* object, fd_set *readset, fd_set *writeset, fd_set *errorset, int* blocktime) void ILibIPAddressMonitor_PreSelect(void* object, fd_set *readset, fd_set *writeset, fd_set *errorset, int* blocktime)
{ {
_ILibIPAddressMonitor *obj = (_ILibIPAddressMonitor*)object; _ILibIPAddressMonitor *obj = (_ILibIPAddressMonitor*)object;
@@ -148,7 +148,7 @@ ILibIPAddressMonitor ILibIPAddressMonitor_Create(void *chain, ILibIPAddressMonit
obj->reserved->hEvent = (HANDLE)obj; obj->reserved->hEvent = (HANDLE)obj;
obj->mSocket = socket(AF_INET, SOCK_DGRAM, 0); obj->mSocket = socket(AF_INET, SOCK_DGRAM, 0);
WSAIoctl(obj->mSocket, SIO_ADDRESS_LIST_CHANGE, NULL, 0, NULL, 0, &(obj->bytesReturned), obj->reserved, ILibIPAddressMonitor_dispatch); WSAIoctl(obj->mSocket, SIO_ADDRESS_LIST_CHANGE, NULL, 0, NULL, 0, &(obj->bytesReturned), obj->reserved, ILibIPAddressMonitor_dispatch);
#elif defined (_POSIX) && !defined(__APPLE__) #elif defined (_POSIX) && !defined(__APPLE__) && !defined(_FREEBSD)
obj->mSocket = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE); obj->mSocket = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE);
int flags = fcntl(obj->mSocket, F_GETFL, 0); int flags = fcntl(obj->mSocket, F_GETFL, 0);
fcntl(obj->mSocket, F_SETFL, O_NONBLOCK | flags); fcntl(obj->mSocket, F_SETFL, O_NONBLOCK | flags);

View File

@@ -25,9 +25,13 @@ limitations under the License.
#include "chrome/nacl.h" #include "chrome/nacl.h"
#endif #endif
#if defined(_POSIX) #if defined(_POSIX)
#ifndef _VX_CPU #if !defined(_VX_CPU) && !defined(_FREEBSD)
#include <sys/statfs.h> #include <sys/statfs.h>
#endif #endif
#ifdef _FREEBSD
#include <sys/param.h>
#include <sys/mount.h>
#endif
#include <pthread.h> #include <pthread.h>
#ifndef _NOILIBSTACKDEBUG #ifndef _NOILIBSTACKDEBUG
#include <execinfo.h> #include <execinfo.h>
@@ -8117,7 +8121,7 @@ int ILibGetCurrentTimezoneOffset_Minutes()
{ {
return(-1*(int)((u.QuadPart - l.QuadPart ) / 10000000 / 60)); return(-1*(int)((u.QuadPart - l.QuadPart ) / 10000000 / 60));
} }
#elif defined(_ANDROID) #elif defined(_ANDROID) || defined(_FREEBSD)
return 0; // TODO return 0; // TODO
#else #else
int offset; int offset;
@@ -8143,10 +8147,14 @@ int ILibIsDaylightSavingsTime()
return 0; return 0;
#elif defined(_ANDROID) #elif defined(_ANDROID)
return 0; // TODO return 0; // TODO
#else
#ifdef _FREEBSD
return(0);
#else #else
tzset(); tzset();
return daylight; return daylight;
#endif #endif
#endif
} }

View File

@@ -87,7 +87,7 @@ struct sockaddr_in6;
#ifndef __APPLE__ #ifndef __APPLE__
#include <semaphore.h> #include <semaphore.h>
#endif #endif
#if !defined(__APPLE__) && !defined(_VX_CPU) #if !defined(__APPLE__) && !defined(_VX_CPU) && !defined(_FREEBSD)
#include <malloc.h> #include <malloc.h>
#endif #endif
#include <fcntl.h> #include <fcntl.h>
@@ -95,7 +95,7 @@ struct sockaddr_in6;
#define UNREFERENCED_PARAMETER(P) #define UNREFERENCED_PARAMETER(P)
#endif #endif
#if defined(_POSIX) && !defined(__APPLE__) #if defined(_POSIX) && !defined(__APPLE__) && !defined(_FREEBSD)
#include <linux/limits.h> #include <linux/limits.h>
#endif #endif

View File

@@ -35,7 +35,7 @@ limitations under the License.
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
#ifndef __APPLE__ #if !defined( __APPLE__) && !defined(_FREEBSD)
#include <pty.h> #include <pty.h>
#endif #endif
#endif #endif

View File

@@ -47,7 +47,7 @@ extern "C" {
#if defined(WIN32) || defined(_WIN32_WCE) #if defined(WIN32) || defined(_WIN32_WCE)
#include <STDDEF.h> #include <STDDEF.h>
#elif defined(_POSIX) #elif defined(_POSIX)
#if !defined(__APPLE__) && !defined(_VX_CPU) #if !defined(__APPLE__) && !defined(_VX_CPU) && !defined(_FREEBSD)
#include <malloc.h> #include <malloc.h>
#endif #endif
#endif #endif

Binary file not shown.

Binary file not shown.