summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorFrancois Tigeot <ftigeot@wolfpond.org>2011-02-15 12:15:27 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-02-15 15:55:19 +0000
commitae443f19e6a216c6973d12dcf580b8ba1e532808 (patch)
tree6b1897a4233b77d0999764cb8fc2b314891d9f7d /sal
parent4ee351ecf6fbb479d24c248897a25c02c4d9bd52 (diff)
dragonfly stuff
Diffstat (limited to 'sal')
-rw-r--r--sal/inc/osl/endian.h3
-rw-r--r--sal/inc/rtl/uuid.h2
-rw-r--r--sal/inc/sal/alloca.h2
-rw-r--r--sal/inc/sal/config.h2
-rw-r--r--sal/inc/sal/types.h2
-rw-r--r--sal/osl/unx/backtrace.c2
-rw-r--r--sal/osl/unx/backtrace.h5
-rw-r--r--sal/osl/unx/file.cxx2
-rw-r--r--sal/osl/unx/file_volume.cxx14
-rw-r--r--sal/osl/unx/makefile.mk4
-rw-r--r--sal/osl/unx/nlsupport.c13
-rw-r--r--sal/osl/unx/process.c2
-rw-r--r--sal/osl/unx/socket.c4
-rw-r--r--sal/osl/unx/system.h20
-rw-r--r--sal/osl/unx/time.c2
-rw-r--r--sal/qa/osl/file/osl_File_Const.h2
-rw-r--r--sal/rtl/source/alloc_arena.c2
-rw-r--r--sal/rtl/source/macro.hxx2
18 files changed, 55 insertions, 30 deletions
diff --git a/sal/inc/osl/endian.h b/sal/inc/osl/endian.h
index ffbf08e6a..b99ae34e6 100644
--- a/sal/inc/osl/endian.h
+++ b/sal/inc/osl/endian.h
@@ -159,7 +159,8 @@ extern "C" {
#if !defined(_WIN32) && !defined(_WIN16) && !defined(OS2) && \
!defined(LINUX) && !defined(NETBSD) && !defined(SCO) && \
!defined(AIX) && !defined(HPUX) && !defined(OPENBSD) && \
- !defined(SOLARIS) && !defined(MACOSX) && !defined(FREEBSD)
+ !defined(SOLARIS) && !defined(MACOSX) && !defined(FREEBSD) && \
+ !defined(DRAGONFLY)
# error "Target platform not specified !"
#endif
diff --git a/sal/inc/rtl/uuid.h b/sal/inc/rtl/uuid.h
index 04289703e..7b52924ce 100644
--- a/sal/inc/rtl/uuid.h
+++ b/sal/inc/rtl/uuid.h
@@ -203,6 +203,8 @@ void SAL_CALL rtl_createNamedUuid(
#define UUID_SYSTEM_TIME_RESOLUTION_100NS_TICKS 10
#elif OPENBSD
#define UUID_SYSTEM_TIME_RESOLUTION_100NS_TICKS 10
+#elif DRAGONFLY
+#define UUID_SYSTEM_TIME_RESOLUTION_100NS_TICKS 10
#else
#error "System time resolution must be calculated!"
#endif
diff --git a/sal/inc/sal/alloca.h b/sal/inc/sal/alloca.h
index 83bc5dffe..23282807e 100644
--- a/sal/inc/sal/alloca.h
+++ b/sal/inc/sal/alloca.h
@@ -36,7 +36,7 @@
#define INCLUDED_ALLOCA_H
#endif
-#elif defined (FREEBSD) || defined(NETBSD) || defined(OPENBSD)
+#elif defined (FREEBSD) || defined(NETBSD) || defined(OPENBSD) || defined(DRAGONFLY)
#ifndef INCLUDED_STDLIB_H
#include <stdlib.h>
diff --git a/sal/inc/sal/config.h b/sal/inc/sal/config.h
index 73b66bcbb..a1c5361bc 100644
--- a/sal/inc/sal/config.h
+++ b/sal/inc/sal/config.h
@@ -93,7 +93,7 @@
#endif
#if defined(SOLARIS) || defined(LINUX) || defined(NETBSD) || defined(FREEBSD) || \
- defined(SCO) || defined(AIX) || defined(OPENBSD)
+ defined(SCO) || defined(AIX) || defined(OPENBSD) || defined(DRAGONFLY)
#define SAL_UNX
#define SAL_DLLEXTENSION ".so"
#define SAL_DLLPREFIX "lib"
diff --git a/sal/inc/sal/types.h b/sal/inc/sal/types.h
index 0e197f30a..353bf0f3c 100644
--- a/sal/inc/sal/types.h
+++ b/sal/inc/sal/types.h
@@ -351,7 +351,7 @@ typedef struct _sal_Sequence
#ifdef __cplusplus
#if defined SAL_W32 || defined SOLARIS || defined LINUX || defined MACOSX || \
defined FREEBSD || defined NETBSD || defined AIX || defined OS2 || \
- defined OPENBSD
+ defined OPENBSD || defined DRAGONFLY
#define SAL_CONST_CAST(type, expr) (const_cast< type >(expr))
#define SAL_REINTERPRET_CAST(type, expr) (reinterpret_cast< type >(expr))
#define SAL_STATIC_CAST(type, expr) (static_cast< type >(expr))
diff --git a/sal/osl/unx/backtrace.c b/sal/osl/unx/backtrace.c
index 47cca32ac..ed29a9208 100644
--- a/sal/osl/unx/backtrace.c
+++ b/sal/osl/unx/backtrace.c
@@ -140,7 +140,7 @@ void backtrace_symbols_fd( void **buffer, int size, int fd )
#endif /* defined SOLARIS */
-#if defined FREEBSD || defined NETBSD || defined OPENBSD
+#if defined FREEBSD || defined NETBSD || defined OPENBSD || defined(DRAGONFLY)
#include <dlfcn.h>
#include <pthread.h>
#include <setjmp.h>
diff --git a/sal/osl/unx/backtrace.h b/sal/osl/unx/backtrace.h
index b0898899f..a8465de62 100644
--- a/sal/osl/unx/backtrace.h
+++ b/sal/osl/unx/backtrace.h
@@ -28,7 +28,7 @@
#if defined (SOLARIS) || defined (FREEBSD) || defined (NETBSD) || \
- defined (OPENBSD)
+ defined (OPENBSD) || defined (DRAGONFLY)
#ifdef __cplusplus
extern "C" {
@@ -41,7 +41,8 @@ int backtrace( void **buffer, int max_frames );
void backtrace_symbols_fd( void **buffer, int size, int fd );
/* no frame.h on FreeBSD */
-#if defined (FREEBSD) || defined (NETBSD) || defined (OPENBSD)
+#if defined (FREEBSD) || defined (NETBSD) || defined (OPENBSD) || \
+ defined (DRAGONFLY)
struct frame {
long arg0[8];
long arg1[6];
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 94ef6704b..1528f6da6 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -273,7 +273,7 @@ void FileHandle_Impl::operator delete (void * p, size_t)
size_t FileHandle_Impl::getpagesize()
{
#if defined(FREEBSD) || defined(NETBSD) || defined(MACOSX) || \
- defined(OPENBSD)
+ defined(OPENBSD) || defined(DRAGONFLY)
return sal::static_int_cast< size_t >(::getpagesize());
#else /* POSIX */
return sal::static_int_cast< size_t >(::sysconf(_SC_PAGESIZE));
diff --git a/sal/osl/unx/file_volume.cxx b/sal/osl/unx/file_volume.cxx
index 124f267e1..94e817713 100644
--- a/sal/osl/unx/file_volume.cxx
+++ b/sal/osl/unx/file_volume.cxx
@@ -70,7 +70,7 @@ static const sal_Char* MOUNTTAB="/etc/mnttab";
#include <sys/quota.h>
static const sal_Char* MOUNTTAB="/etc/mtab";
-#elif defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD)
+#elif defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD) || defined(DRAGONFLY)
#include <sys/param.h>
#include <sys/ucred.h>
@@ -180,7 +180,7 @@ oslFileError osl_getVolumeInformation( rtl_uString* ustrDirectoryURL, oslVolumeI
#ifdef HAVE_STATFS_H
-#if defined(FREEBSD) || defined(MACOSX) || defined(OPENBSD)
+#if defined(FREEBSD) || defined(MACOSX) || defined(OPENBSD) || defined(DRAGONFLY)
# define __OSL_STATFS_STRUCT struct statfs
# define __OSL_STATFS(dir, sfs) statfs((dir), (sfs))
# define __OSL_STATFS_BLKSIZ(a) ((sal_uInt64)((a).f_bsize))
@@ -1123,7 +1123,7 @@ osl_isFloppyMounted (oslVolumeDeviceHandleImpl* pDevice)
*****************************************************************************/
#if (defined(MACOSX) || defined(NETBSD) || defined(FREEBSD) || \
- defined(AIX) || defined(OPENBSD))
+ defined(AIX) || defined(OPENBSD) || defined(DRAGONFLY))
static oslVolumeDeviceHandle osl_isFloppyDrive(const sal_Char* pszPath)
{
(void)pszPath;
@@ -1132,7 +1132,7 @@ static oslVolumeDeviceHandle osl_isFloppyDrive(const sal_Char* pszPath)
#endif /* MACOSX */
#if ( defined(MACOSX) || defined(NETBSD) || defined(FREEBSD) || \
- defined(AIX) || defined(OPENBSD))
+ defined(AIX) || defined(OPENBSD) || defined(DRAGONFLY))
static oslFileError osl_mountFloppy(oslVolumeDeviceHandle hFloppy)
{
(void)hFloppy;
@@ -1141,7 +1141,7 @@ static oslFileError osl_mountFloppy(oslVolumeDeviceHandle hFloppy)
#endif /* MACOSX */
#if ( defined(MACOSX) || defined(NETBSD) || defined(FREEBSD) || \
- defined(AIX) || defined(OPENBSD))
+ defined(AIX) || defined(OPENBSD) || defined(DRAGONFLY))
static oslFileError osl_unmountFloppy(oslVolumeDeviceHandle hFloppy)
{
(void)hFloppy;
@@ -1149,14 +1149,14 @@ static oslFileError osl_unmountFloppy(oslVolumeDeviceHandle hFloppy)
}
#endif /* MACOSX */
-#if ( defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD) )
+#if ( defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD) || defined(DRAGONFLY) )
static sal_Bool osl_getFloppyMountEntry(const sal_Char* pszPath, oslVolumeDeviceHandleImpl* pItem)
{
return sal_False;
}
#endif /* NETBSD || FREEBSD || OPENBSD */
-#if ( defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD) )
+#if ( defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD) || defined(DRAGONFLY) )
static sal_Bool osl_isFloppyMounted(oslVolumeDeviceHandleImpl* pDevice)
{
return sal_False;
diff --git a/sal/osl/unx/makefile.mk b/sal/osl/unx/makefile.mk
index 117609a38..31bdf9927 100644
--- a/sal/osl/unx/makefile.mk
+++ b/sal/osl/unx/makefile.mk
@@ -115,8 +115,8 @@ SLOFILES += $(SLO)$/osxlocale.obj
.ENDIF
.IF "$(OS)"=="SOLARIS" || "$(OS)"=="FREEBSD" || "$(OS)"=="NETBSD" || \
- "$(OS)$(CPU)"=="LINUXS" || "$(OS)"=="MACOSX" || \
- "$(OS)"=="AIX" || "$(OS)"=="OPENBSD"
+ "$(OS)$(CPU)"=="LINUXS" || "$(OS)"=="MACOSX" || "$(OS)"=="AIX" || \
+ "$(OS)"=="OPENBSD" || "$(OS)"=="DRAGONFLY"
SLOFILES += $(SLO)$/backtrace.obj
OBJFILES += $(OBJ)$/backtrace.obj
.ENDIF
diff --git a/sal/osl/unx/nlsupport.c b/sal/osl/unx/nlsupport.c
index f7ae5a24e..5b9fd43ce 100644
--- a/sal/osl/unx/nlsupport.c
+++ b/sal/osl/unx/nlsupport.c
@@ -32,7 +32,8 @@
#include <rtl/memory.h>
#if defined(LINUX) || defined(SOLARIS) || defined(NETBSD) || \
- defined(FREEBSD) || defined(MACOSX) || defined(OPENBSD)
+ defined(FREEBSD) || defined(MACOSX) || defined(OPENBSD) || \
+ defined(DRAGONFLY)
#include <pthread.h>
#ifndef MACOSX
#include <locale.h>
@@ -234,7 +235,7 @@ static rtl_Locale * _parse_locale( const char * locale )
}
#if defined(LINUX) || defined(SOLARIS) || defined(NETBSD) || \
- defined(FREEBSD) || defined(OPENBSD)
+ defined(FREEBSD) || defined(OPENBSD) || defined(DRAGONFLY)
/*
* This implementation of osl_getTextEncodingFromLocale maps
@@ -486,7 +487,7 @@ const _pair _nl_language_list[] = {
{ "WIN-SAMI-2", RTL_TEXTENCODING_DONTKNOW } /* WS2 */
};
-#elif defined(FREEBSD)
+#elif defined(FREEBSD) || defined(DRAGONFLY)
const _pair _nl_language_list[] = {
{ "ASCII", RTL_TEXTENCODING_ASCII_US }, /* US-ASCII */
@@ -952,7 +953,7 @@ int _imp_setProcessLocale( rtl_Locale * pLocale )
/* only change env vars that exist already */
if( getenv( "LC_ALL" ) ) {
#if defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) || \
- defined( AIX ) || defined( OPENBSD )
+ defined( AIX ) || defined( OPENBSD ) || defined( DRAGONFLY )
setenv( "LC_ALL", locale_buf, 1);
#else
setenv( "LC_ALL", locale_buf );
@@ -961,7 +962,7 @@ int _imp_setProcessLocale( rtl_Locale * pLocale )
if( getenv( "LC_CTYPE" ) ) {
#if defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) || \
- defined( AIX ) || defined( OPENBSD )
+ defined( AIX ) || defined( OPENBSD ) || defined( DRAGONFLY )
setenv("LC_CTYPE", locale_buf, 1 );
#else
setenv( "LC_CTYPE", locale_buf );
@@ -970,7 +971,7 @@ int _imp_setProcessLocale( rtl_Locale * pLocale )
if( getenv( "LANG" ) ) {
#if defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) || \
- defined( AIX ) || defined( OPENBSD)
+ defined( AIX ) || defined( OPENBSD) || defined( DRAGONFLY )
setenv("LC_CTYPE", locale_buf, 1 );
#else
setenv( "LANG", locale_buf );
diff --git a/sal/osl/unx/process.c b/sal/osl/unx/process.c
index 0c85bf074..e736a2510 100644
--- a/sal/osl/unx/process.c
+++ b/sal/osl/unx/process.c
@@ -476,7 +476,7 @@ static void ChildStatusProc(void *pData)
if (! INIT_GROUPS(data.m_name, data.m_gid) || (setuid(data.m_uid) != 0))
OSL_TRACE("Failed to change uid and guid, errno=%d (%s)\n", errno, strerror(errno));
-#if defined(LINUX) || defined (FREEBSD) || defined(NETBSD) || defined(OPENBSD)
+#if defined(LINUX) || defined (FREEBSD) || defined(NETBSD) || defined(OPENBSD) || defined(DRAGONFLY)
unsetenv("HOME");
#else
putenv("HOME=");
diff --git a/sal/osl/unx/socket.c b/sal/osl/unx/socket.c
index eede0a145..91cf06632 100644
--- a/sal/osl/unx/socket.c
+++ b/sal/osl/unx/socket.c
@@ -47,7 +47,7 @@
#endif
#if defined(LINUX) || defined(NETBSD) || defined ( FREEBSD ) || \
- defined (MACOSX) || defined (OPENBSD)
+ defined (MACOSX) || defined (OPENBSD) || defined(DRAGONFLY)
#include <sys/poll.h>
#define HAVE_POLL_H
#endif /* HAVE_POLL_H */
@@ -785,7 +785,7 @@ static struct hostent* _osl_gethostbyname_r (
const char *name, struct hostent *result,
char *buffer, int buflen, int *h_errnop)
{
-#if defined(LINUX) || (defined(FREEBSD) && (__FreeBSD_version >= 601103))
+#if defined(LINUX) || (defined(FREEBSD) && (__FreeBSD_version >= 601103)) || defined(DRAGONFLY)
struct hostent *__result; /* will be the same as result */
int __error;
__error = gethostbyname_r (name, result, buffer, buflen,
diff --git a/sal/osl/unx/system.h b/sal/osl/unx/system.h
index 4b6b7661d..047a643a9 100644
--- a/sal/osl/unx/system.h
+++ b/sal/osl/unx/system.h
@@ -226,6 +226,24 @@
# define PTHREAD_SIGACTION pthread_sigaction
#endif
+#ifdef DRAGONFLY
+# define ETIME ETIMEDOUT
+# include <pthread.h>
+# include <sys/sem.h>
+# include <semaphore.h>
+# include <dlfcn.h>
+# include <sys/filio.h>
+# include <sys/ioctl.h>
+# include <sys/param.h>
+# include <sys/time.h>
+# include <sys/uio.h>
+# include <sys/exec.h>
+# include <sys/un.h>
+# include <netinet/tcp.h>
+# include <machine/endian.h>
+# define IORESOURCE_TRANSFER_BSD
+#endif
+
#ifdef SCO
# define AF_IPX -1
# include <strings.h>
@@ -376,7 +394,7 @@ int macxp_resolveAlias(char *path, int buflen);
!defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD) && !defined(SCO) && \
!defined(AIX) && !defined(HPUX) && \
!defined(SOLARIS) && !defined(MACOSX) && \
- !defined(OPENBSD)
+ !defined(OPENBSD) && !defined(DRAGONFLY)
# error "Target platform not specified!"
#endif
diff --git a/sal/osl/unx/time.c b/sal/osl/unx/time.c
index db03442e7..59f09d8d9 100644
--- a/sal/osl/unx/time.c
+++ b/sal/osl/unx/time.c
@@ -34,7 +34,7 @@
/* FIXME: detection should be done in configure script */
#if defined(MACOSX) || defined(FREEBSD) || defined(NETBSD) || \
- defined(LINUX) || defined(OPENBSD)
+ defined(LINUX) || defined(OPENBSD) || defined(DRAGONFLY)
#define STRUCT_TM_HAS_GMTOFF 1
#elif defined(SOLARIS)
diff --git a/sal/qa/osl/file/osl_File_Const.h b/sal/qa/osl/file/osl_File_Const.h
index d8ea099f0..581b0595a 100644
--- a/sal/qa/osl/file/osl_File_Const.h
+++ b/sal/qa/osl/file/osl_File_Const.h
@@ -89,7 +89,7 @@ const sal_Char pBuffer_Blank[] = "";
# include <errno.h>
# include <fcntl.h>
# include <sys/stat.h>
-# if !defined(MACOSX) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__NetBSD__)
+# if !defined(MACOSX) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined (DRAGONFLY)
# include <sys/statfs.h>
# else
# include <sys/param.h>
diff --git a/sal/rtl/source/alloc_arena.c b/sal/rtl/source/alloc_arena.c
index ce4faa2ae..6b0a27fa1 100644
--- a/sal/rtl/source/alloc_arena.c
+++ b/sal/rtl/source/alloc_arena.c
@@ -1254,7 +1254,7 @@ static sal_Size
rtl_machdep_pagesize (void)
{
#if defined(SAL_UNX)
-#if defined(FREEBSD) || defined(NETBSD)
+#if defined(FREEBSD) || defined(NETBSD) || defined(DRAGONFLY)
return ((sal_Size)getpagesize());
#else /* POSIX */
return ((sal_Size)sysconf(_SC_PAGESIZE));
diff --git a/sal/rtl/source/macro.hxx b/sal/rtl/source/macro.hxx
index 70288408a..495d586d1 100644
--- a/sal/rtl/source/macro.hxx
+++ b/sal/rtl/source/macro.hxx
@@ -55,6 +55,8 @@
#define THIS_OS "AIX"
#elif defined OPENBSD
#define THIS_OS "OpenBSD"
+#elif defined DRAGONFLY
+#define THIS_OS "DragonFly"
#endif
#if ! defined THIS_OS