From 6e159be16e49498bb75ad2d89a0d52ad9be63aa6 Mon Sep 17 00:00:00 2001
From: Fons Rademakers <Fons.Rademakers@cern.ch>
Date: Mon, 28 Feb 2005 17:28:12 +0000
Subject: [PATCH] From Dmytro Kustov: OpenBSD port.

git-svn-id: http://root.cern.ch/svn/root/trunk@11200 27541ba8-7e3a-0410-8455-c3a389f83636
---
 alien/src/TAlienFile.cxx   |  4 +--
 base/inc/RConfig.h         | 12 ++++++++-
 base/src/TMapFile.cxx      |  6 ++---
 base/src/TTimeStamp.cxx    |  4 +--
 build/unix/makelib.sh      |  5 ++++
 cint/Module.mk             |  3 +++
 cint/include/platform.h    |  4 +++
 cint/lib/ipc/ipcif.h       |  2 +-
 cint/lib/posix/posix.h     |  2 +-
 cint/lib/pthread/setup     |  4 +++
 cint/src/init.c            |  3 +++
 cint/src/v6_init.cxx       |  3 +++
 config/ARCHS               |  1 +
 config/Makefile.openbsd    | 50 ++++++++++++++++++++++++++++++++++++++
 config/root-config.in      |  5 ++++
 configure                  |  8 +++---
 dcache/src/TDCacheFile.cxx |  4 +--
 eg/inc/cfortran.h          |  4 +--
 io/src/TMapFile.cxx        |  6 ++---
 net/src/DaemonUtils.cxx    |  5 ++--
 net/src/TAuthenticate.cxx  | 11 +++++----
 proofd/src/proofd.cxx      |  7 +++---
 rfio/src/TRFIOFile.cxx     |  4 +--
 rootd/src/rootd.cxx        | 13 +++++-----
 rootx/src/rootx.cxx        |  8 +++---
 rpdutils/src/daemon.cxx    | 12 +++++----
 rpdutils/src/net.cxx       |  4 +--
 rpdutils/src/netpar.cxx    |  4 +--
 28 files changed, 148 insertions(+), 50 deletions(-)
 create mode 100644 config/Makefile.openbsd

diff --git a/alien/src/TAlienFile.cxx b/alien/src/TAlienFile.cxx
index bb7d094a184..d960f8c0e53 100644
--- a/alien/src/TAlienFile.cxx
+++ b/alien/src/TAlienFile.cxx
@@ -1,4 +1,4 @@
-// @(#)root/alien:$Name:  $:$Id: TAlienFile.cxx,v 1.6 2004/08/09 17:43:07 rdm Exp $
+// @(#)root/alien:$Name:  $:$Id: TAlienFile.cxx,v 1.7 2004/10/15 16:55:06 rdm Exp $
 // Author: Andreas Peters 11/09/2003
 
 /*************************************************************************
@@ -36,7 +36,7 @@
 #if defined(R__SUN) || defined(R__SGI) || defined(R__HPUX) || \
     defined(R__AIX) || defined(R__LINUX) || defined(R__SOLARIS) || \
     defined(R__ALPHA) || defined(R__HIUX) || defined(R__FBSD) || \
-    defined(R__MACOSX) || defined(R__HURD)
+    defined(R__MACOSX) || defined(R__HURD) || defined(R__OBSD)
 #define HAS_DIRENT
 #endif
 #endif
diff --git a/base/inc/RConfig.h b/base/inc/RConfig.h
index e22bbe3c051..9a78b495baf 100644
--- a/base/inc/RConfig.h
+++ b/base/inc/RConfig.h
@@ -1,4 +1,4 @@
-/* @(#)root/base:$Name:  $:$Id: RConfig.h,v 1.76 2004/08/02 08:52:53 rdm Exp $ */
+/* @(#)root/base:$Name:  $:$Id: RConfig.h,v 1.77 2004/10/29 16:07:32 rdm Exp $ */
 
 /*************************************************************************
  * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers.               *
@@ -268,6 +268,16 @@
 #   define R__THROWNEWDELETE /* new/delete throw exceptions */
 #endif
 
+#if defined(__OpenBSD__)
+#   define R__OBSD
+#   define R__UNIX
+#   define R__BYTESWAP
+#   ifndef __i486__
+#      define __i486__       /* turn off if you really want to run on an i386 */
+#   endif
+#   define R__THROWNEWDELETE /* new/delete throw exceptions */
+#endif
+
 #if defined(__APPLE__)     /* MacOS X support, initially following FreeBSD */
 #   define R__MACOSX
 #   define R__UNIX
diff --git a/base/src/TMapFile.cxx b/base/src/TMapFile.cxx
index 6e515f2ce90..7bc00ceacb1 100644
--- a/base/src/TMapFile.cxx
+++ b/base/src/TMapFile.cxx
@@ -1,4 +1,4 @@
-// @(#)root/base:$Name:  $:$Id: TMapFile.cxx,v 1.12 2005/01/19 20:00:41 brun Exp $
+// @(#)root/base:$Name:  $:$Id: TMapFile.cxx,v 1.13 2005/01/19 20:18:20 brun Exp $
 // Author: Fons Rademakers   08/07/97
 
 /*************************************************************************
@@ -808,7 +808,7 @@ Int_t TMapFile::AcquireSemaphore()
       int intr = 0;
 again:
       if (semop(fSemaphore, &buf, 1) == -1) {
-#if defined(R__FBSD)
+#if defined(R__FBSD) || defined(R__OBSD)
          if (TSystem::GetErrno() == EINVAL)
 #else
          if (TSystem::GetErrno() == EIDRM)
@@ -851,7 +851,7 @@ Int_t TMapFile::ReleaseSemaphore()
    if (fSemaphore != -1) {
       struct sembuf buf = { 0, 1, SEM_UNDO };
       if (semop(fSemaphore, &buf, 1) == -1) {
-#if defined(R__FBSD)
+#if defined(R__FBSD) || defined(R__OBSD)
          if (TSystem::GetErrno() == EINVAL)
 #else
          if (TSystem::GetErrno() == EIDRM)
diff --git a/base/src/TTimeStamp.cxx b/base/src/TTimeStamp.cxx
index a1c274c6f72..26aa0cdf29f 100644
--- a/base/src/TTimeStamp.cxx
+++ b/base/src/TTimeStamp.cxx
@@ -1,4 +1,4 @@
-// @(#)root/base:$Name:  $:$Id: TTimeStamp.cxx,v 1.14 2004/08/27 15:47:24 rdm Exp $
+// @(#)root/base:$Name:  $:$Id: TTimeStamp.cxx,v 1.15 2004/08/31 09:36:49 rdm Exp $
 // Author: R. Hatcher   30/9/2001
 
 /*************************************************************************
@@ -368,7 +368,7 @@ Int_t TTimeStamp::GetZoneOffset()
 #if defined(R__WINGCC)
    return _timezone;
 #else
-#if !defined(R__MACOSX) && !defined(R__FBSD)
+#if !defined(R__MACOSX) && !defined(R__FBSD) && !defined(R__OBSD)
    return  timezone;   // unix has extern long int
 #else
    time_t *tp = 0;
diff --git a/build/unix/makelib.sh b/build/unix/makelib.sh
index 1400ccf1fae..c050d500a1a 100755
--- a/build/unix/makelib.sh
+++ b/build/unix/makelib.sh
@@ -83,6 +83,11 @@ elif [ $PLATFORM = "fbsd" ]; then
          `lorder $OBJS | tsort -q` $EXTRA $EXPLLNKCORE"
     echo $cmd
     $cmd
+elif [ $PLATFORM = "obsd" ]; then
+    cmd="$LD $SOFLAGS$SONAME $LDFLAGS -o $LIB \
+         `lorder $OBJS | tsort -q` $EXTRA $EXPLLNKCORE"
+    echo $cmd
+    $cmd
 elif [ $PLATFORM = "macosx" ]; then
    macosx_minor=`sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2`
    # Look for a fink installation
diff --git a/cint/Module.mk b/cint/Module.mk
index 5c4a3666e9d..7a6df55d274 100644
--- a/cint/Module.mk
+++ b/cint/Module.mk
@@ -63,6 +63,9 @@ endif
 ifeq ($(PLATFORM),fbsd)
 CINTS2       += $(MODDIRS)/libstrm.cxx
 endif
+ifeq ($(PLATFORM),obsd)
+CINTS2       += $(MODDIRS)/libstrm.cxx
+endif
 ifeq ($(PLATFORM),hpux)
 ifeq ($(ARCH),hpuxia64acc)
 CINTS2       += $(MODDIRS)/accstrm.cxx
diff --git a/cint/include/platform.h b/cint/include/platform.h
index b7e5e10fb25..f5b1e2ef886 100644
--- a/cint/include/platform.h
+++ b/cint/include/platform.h
@@ -118,6 +118,10 @@ typedef struct { } PRINTDLG, *LPPRINTDLG;
 #include <time.h>
 #endif
 
+#ifdef G__OBSD
+#include <time.h>
+#endif
+
 #ifndef G__FBSD
 #define __signed__ 
 #define __const
diff --git a/cint/lib/ipc/ipcif.h b/cint/lib/ipc/ipcif.h
index f31d7f3d06d..cedfdbee367 100644
--- a/cint/lib/ipc/ipcif.h
+++ b/cint/lib/ipc/ipcif.h
@@ -39,7 +39,7 @@
 /* union semun is defined by including <sys/sem.h> */
 #else
 /* according to X/OPEN we have to define it ourselves */
-#if !defined(__FreeBSD__) && !defined(__KCC) && !defined(__sgi)
+#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__KCC) && !defined(__sgi)
 union semun {
   int val;                    /* value for SETVAL */
   struct semid_ds *buf;       /* buffer for IPC_STAT, IPC_SET */
diff --git a/cint/lib/posix/posix.h b/cint/lib/posix/posix.h
index 7fd8e30cc94..7e1f5c986a2 100644
--- a/cint/lib/posix/posix.h
+++ b/cint/lib/posix/posix.h
@@ -272,7 +272,7 @@ extern char *getwd(char *buf);
 extern int setpgrp(pid_t _pid,pid_t _pgrp);
 #elif defined(G__SUN) || defined(__sun)
 extern long setpgrp(void);
-#elif defined(G__FBSD)||defined(__FreeBSD__)||((defined(G__alpha)||defined(__alpha))&&defined(G__GNUC))||((defined(G__alpha)||defined(__alpha))&&defined(G__GNUC))
+#elif defined(G__FBSD)||defined(__FreeBSD__)||defined(G__OBSD)||defined(__OpenBSD__)||((defined(G__alpha)||defined(__alpha))&&defined(G__GNUC))||((defined(G__alpha)||defined(__alpha))&&defined(G__GNUC))
 extern int setpgrp(pid_t _pid, pid_t _pgrp);
 #elif defined(G__KCC) || defined(__KCC)
 extern pid_t setpgrp(void);
diff --git a/cint/lib/pthread/setup b/cint/lib/pthread/setup
index 45d51624fe8..e97015402a8 100644
--- a/cint/lib/pthread/setup
+++ b/cint/lib/pthread/setup
@@ -7,6 +7,10 @@ FreeBSD)
   # Use following line for FreeBSD
   makecint -mk Makefile -dl pthread.dll -H pthd.h -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L -l -pthread  -cint -Z0
   ;;
+OpenBSD)
+  # Use following line for OpenBSD
+  makecint -mk Makefile -dl pthread.dll -H pthd.h -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L -l -pthread  -cint -Z0
+  ;;
 QNX)
   # Use following line for QNX
   makecint -mk Makefile -dl pthread.dll -H pthd.h -D_POSIX_C_SOURCE=199506L -l -cint -Z0
diff --git a/cint/src/init.c b/cint/src/init.c
index 8aa0b91db3c..e26c479891d 100644
--- a/cint/src/init.c
+++ b/cint/src/init.c
@@ -2194,6 +2194,9 @@ void G__platformMacro()
 #ifdef __FreeBSD__   /* FreeBSD */
   sprintf(temp,"G__FBSD=%ld",(long)__FreeBSD__); G__add_macro(temp);
 #endif
+#ifdef __OpenBSD__   /* OpenBSD */
+  sprintf(temp,"G__OBSD=%ld",(long)__OpenBSD__); G__add_macro(temp);
+#endif
 #ifdef __hpux        /* HP-UX */
   sprintf(temp,"G__HPUX=%ld",(long)__hpux); G__add_macro(temp);
 #endif
diff --git a/cint/src/v6_init.cxx b/cint/src/v6_init.cxx
index 8aa0b91db3c..e26c479891d 100644
--- a/cint/src/v6_init.cxx
+++ b/cint/src/v6_init.cxx
@@ -2194,6 +2194,9 @@ void G__platformMacro()
 #ifdef __FreeBSD__   /* FreeBSD */
   sprintf(temp,"G__FBSD=%ld",(long)__FreeBSD__); G__add_macro(temp);
 #endif
+#ifdef __OpenBSD__   /* OpenBSD */
+  sprintf(temp,"G__OBSD=%ld",(long)__OpenBSD__); G__add_macro(temp);
+#endif
 #ifdef __hpux        /* HP-UX */
   sprintf(temp,"G__HPUX=%ld",(long)__hpux); G__add_macro(temp);
 #endif
diff --git a/config/ARCHS b/config/ARCHS
index dc5b4c999f9..db0d98fb195 100644
--- a/config/ARCHS
+++ b/config/ARCHS
@@ -33,6 +33,7 @@ lynxos               for LynxOS with gcc
 macosx               for MacOS X with cc
 macosxxlc            for MacOS X with IBM xl compilers
 mklinux              for MkLinux gcc and glibc
+openbsd              for OpenBSD >= 3.7
 sgicc                for SGI IRIX 6.x CC
 sgicc64              for SGI IRIX 6.x CC 64 bits
 sgiegcs              for SGI IRIX 6.x egcs 1.1.x
diff --git a/config/Makefile.openbsd b/config/Makefile.openbsd
new file mode 100644
index 00000000000..f4d146f0b7b
--- /dev/null
+++ b/config/Makefile.openbsd
@@ -0,0 +1,50 @@
+# -*- mode: makefile -*-
+#
+# Makefile of ROOT for OpenBSD >= 3.7
+
+PLATFORM      = obsd
+
+DEBUGFLAGS    = -g
+OPTFLAGS      = -O
+#OPTFLAGS      = -O3 -march=k6
+ifeq (debug,$(findstring debug,$(ROOTBUILD)))
+OPT           = $(DEBUGFLAGS)
+NOOPT         =
+else
+OPT           = $(OPTFLAGS)
+NOOPT         =
+endif
+
+# Compiler:
+CXX           = g++
+CC            = gcc
+CXXFLAGS      = -pipe -W -Wall -fPIC -I/usr/X11R6/include $(EXTRA_CXXFLAGS)
+CFLAGS        = -pipe -W -Wall -fPIC -I/usr/X11R6/include $(EXTRA_CFLAGS)
+CINTCXXFLAGS  = -pipe -W -Wall -fPIC -DG__REGEXP $(EXTRA_CXXFLAGS) \
+                -DG__UNIX -DG__SHAREDLIB -DG__ROOT -DG__REDIRECTIO -DG__OSFDLL
+CINTCFLAGS    = -pipe -W -Wall -fPIC -DG__REGEXP -DG__UNIX -DG__SHAREDLIB \
+                -DG__ROOT -DG__REDIRECTIO -DG__OSFDLL $(EXTRA_CFLAGS)
+COMPILER      = gnu
+
+# Linker:
+LD            = g++
+LDFLAGS       = $(OPT) $(EXTRA_LDFLAGS)
+SOFLAGS       = -shared -Wl,-x -Wl,-soname,
+SOEXT         = so
+
+# System libraries:
+SYSLIBS       = -lstdc++ -lm
+XLIBS         = $(XPMLIBDIR) $(XPMLIB) $(X11LIBDIR) -L/usr/X11R6/lib -lX11 -lstdc++
+CILIBS        = -lm -ltermcap -lstdc++
+
+# Fortran:
+F77           = f77
+F77FLAGS      = $(OPT)
+F77LIBS       = -lg2c
+
+# Extras
+
+# Override default in Makefile.config
+INSTALL        := cp -pR
+INSTALLDATA    := cp -pR
+
diff --git a/config/root-config.in b/config/root-config.in
index 42ec12e4969..0a54b5b7e2f 100755
--- a/config/root-config.in
+++ b/config/root-config.in
@@ -251,6 +251,11 @@ freebsd4)
    auxcflags=
    auxlibs="-lm -lstdc++"
    ;;
+openbsd)
+   # OpenBSD with libc
+   auxcflags=
+   auxlibs="-lm -lstdc++"
+   ;;
 macosx)
    # MacOS X with gcc (GNU cc v3.1) and possible fink (fink.sf.net)
    macosx_minor=`sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2`
diff --git a/configure b/configure
index 26d0431ee65..6b81669598e 100755
--- a/configure
+++ b/configure
@@ -460,6 +460,7 @@ guess_architecture () {
         linux:arm*:*)          arch=linuxarm        ;;
         linux:ppc*:*)          arch=linuxppcegcs    ;;
         linux:i*86:*)          arch=linux           ;;
+        openbsd*:*:*)          arch=openbsd         ;;
         lynx:*:*)              arch=lynxos          ;;
         darwin:power*:*)       arch=macosx          ;;
         irix*:sgi*:*)          arch=sgicc           ;;
@@ -1427,7 +1428,8 @@ if test ! "x$enable_asimage" = "xno" ; then
        /usr/local/include /usr/include /opt/include $finkdir/include
     asjpegincdir=$found_dir
     check_header "png.h" "" $ASIMAGE $ASIMAGE/include \
-       /usr/local/include /usr/include /opt/include $finkdir/include
+       /usr/local/include /usr/include /usr/local/include/libpng \
+       /opt/include $finkdir/include
     aspngincdir=$found_dir
     check_header "tiffio.h" "" $ASIMAGE $ASIMAGE/include \
        /usr/local/include /usr/include /opt/include $finkdir/include
@@ -2282,7 +2284,7 @@ if test ! "x$enable_krb5" = "xno" ; then
     check_header "krb5.h" "$krb5incdir" /usr/athena/include \
 	    /usr/local/athena/include /usr/kerberos/include \
 	    /usr/krb5/include /usr/local/kerberos/include \
-	    /usr/include /usr/local/include
+	    /usr/include /usr/include/kerberosV /usr/local/include
     if test "x$found_dir" = "x" ; then
 	enable_krb5=no
     else
@@ -2553,7 +2555,7 @@ esac
 ### echo %%% Explicitlink - explicitly link with all dependent libraries
 #
 case $arch in
-freebsd*|aix*|win32*)
+freebsd*|openbsd|aix*|win32*)
     enable_explicitlink="yes"
     ;;
 esac
diff --git a/dcache/src/TDCacheFile.cxx b/dcache/src/TDCacheFile.cxx
index 058b7debe2e..3361c9df752 100644
--- a/dcache/src/TDCacheFile.cxx
+++ b/dcache/src/TDCacheFile.cxx
@@ -1,4 +1,4 @@
-// @(#)root/dcache:$Name:  $:$Id: TDCacheFile.cxx,v 1.22 2004/10/15 16:55:06 rdm Exp $
+// @(#)root/dcache:$Name:  $:$Id: TDCacheFile.cxx,v 1.23 2005/01/14 10:21:05 rdm Exp $
 // Author: Grzegorz Mazur   20/01/2002
 // Modified: William Tanenbaum 01/12/2003
 // Modified: Tigran Mkrtchyan 29/06/2004
@@ -39,7 +39,7 @@
 #if defined(R__SUN) || defined(R__SGI) || defined(R__HPUX) || \
     defined(R__AIX) || defined(R__LINUX) || defined(R__SOLARIS) || \
     defined(R__ALPHA) || defined(R__HIUX) || defined(R__FBSD) || \
-    defined(R__MACOSX) || defined(R__HURD)
+    defined(R__MACOSX) || defined(R__HURD) || defined(R__OBSD)
 #define HAS_DIRENT
 #endif
 #endif
diff --git a/eg/inc/cfortran.h b/eg/inc/cfortran.h
index ea1e0ce2ea1..7568aaeb690 100644
--- a/eg/inc/cfortran.h
+++ b/eg/inc/cfortran.h
@@ -1,4 +1,4 @@
-/* @(#)root/eg:$Name:  $:$Id: cfortran.h,v 1.2 2001/04/09 09:02:10 rdm Exp $ */
+/* @(#)root/eg:$Name:  $:$Id: cfortran.h,v 1.3 2001/07/25 09:59:49 rdm Exp $ */
 
 /* Few changes made for ROOT. Search for string "ROOT" to see which. */
 
@@ -89,7 +89,7 @@ only C calling FORTRAN subroutines will work using K&R style.*/
 #if !(defined(mipsFortran)||defined(DECFortran)||defined(vmsFortran)||defined(CONVEXFortran)||defined(PowerStationFortran)||defined(AbsoftUNIXFortran)||defined(AbsoftProFortran)||defined(SXFortran))
 /* If no Fortran compiler is given, we choose one for the machines we know.   */
 #if defined(lynx) || defined(VAXUltrix) || defined(linux) || defined(_HIUX_SOURCE) || \
-    defined(__FreeBSD__) || defined(__APPLE__)
+    defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
 #define f2cFortran    /* Lynx:      Only support f2c at the moment.
                          VAXUltrix: f77 behaves like f2c.
                            Support f2c or f77 with gcc, vcc with f2c.
diff --git a/io/src/TMapFile.cxx b/io/src/TMapFile.cxx
index 6e515f2ce90..7bc00ceacb1 100644
--- a/io/src/TMapFile.cxx
+++ b/io/src/TMapFile.cxx
@@ -1,4 +1,4 @@
-// @(#)root/base:$Name:  $:$Id: TMapFile.cxx,v 1.12 2005/01/19 20:00:41 brun Exp $
+// @(#)root/base:$Name:  $:$Id: TMapFile.cxx,v 1.13 2005/01/19 20:18:20 brun Exp $
 // Author: Fons Rademakers   08/07/97
 
 /*************************************************************************
@@ -808,7 +808,7 @@ Int_t TMapFile::AcquireSemaphore()
       int intr = 0;
 again:
       if (semop(fSemaphore, &buf, 1) == -1) {
-#if defined(R__FBSD)
+#if defined(R__FBSD) || defined(R__OBSD)
          if (TSystem::GetErrno() == EINVAL)
 #else
          if (TSystem::GetErrno() == EIDRM)
@@ -851,7 +851,7 @@ Int_t TMapFile::ReleaseSemaphore()
    if (fSemaphore != -1) {
       struct sembuf buf = { 0, 1, SEM_UNDO };
       if (semop(fSemaphore, &buf, 1) == -1) {
-#if defined(R__FBSD)
+#if defined(R__FBSD) || defined(R__OBSD)
          if (TSystem::GetErrno() == EINVAL)
 #else
          if (TSystem::GetErrno() == EIDRM)
diff --git a/net/src/DaemonUtils.cxx b/net/src/DaemonUtils.cxx
index 34ff540ead9..68e5da21fde 100644
--- a/net/src/DaemonUtils.cxx
+++ b/net/src/DaemonUtils.cxx
@@ -1,4 +1,4 @@
-// @(#)root/net:$Name:  $:$Id: DaemonUtils.cxx,v 1.2 2004/10/11 21:50:06 rdm Exp $
+// @(#)root/net:$Name:  $:$Id: DaemonUtils.cxx,v 1.3 2004/10/12 09:26:09 rdm Exp $
 // Author: Gerri Ganis   19/1/2004
 
 /*************************************************************************
@@ -42,7 +42,8 @@
 #   define R__GLIBC
 #endif
 
-#if defined(_AIX) || (defined(__FreeBSD__) && !defined(__alpha__))
+#if defined(_AIX) || (defined(__FreeBSD__) && !defined(__alpha__)) || \
+    defined(__OpenBSD__)
 #   define USE_SIZE_T
 #elif defined(R__GLIBC) || (defined(__FreeBSD__) && defined(__alpha__))
 #   define USE_SOCKLEN_T
diff --git a/net/src/TAuthenticate.cxx b/net/src/TAuthenticate.cxx
index 975a09f9d1c..c163a798858 100644
--- a/net/src/TAuthenticate.cxx
+++ b/net/src/TAuthenticate.cxx
@@ -1,4 +1,4 @@
-// @(#)root/net:$Name:  $:$Id: TAuthenticate.cxx,v 1.68 2005/02/11 18:40:08 rdm Exp $
+// @(#)root/net:$Name:  $:$Id: TAuthenticate.cxx,v 1.69 2005/02/18 14:44:40 rdm Exp $
 // Author: Fons Rademakers   26/11/2000
 
 /*************************************************************************
@@ -43,13 +43,14 @@
 #include <errno.h>
 #include <sys/types.h>
 #include <time.h>
-#if !defined(R__WIN32) && !defined(R__MACOSX) && !defined(R__FBSD)
+#if !defined(R__WIN32) && !defined(R__MACOSX) && !defined(R__FBSD) && \
+    !defined(R__OBSD)
 #include <crypt.h>
 #endif
 #ifdef WIN32
 #  include <io.h>
 #endif /* WIN32 */
-#if defined(R__FBSD)
+#if defined(R__FBSD) || defined(R__OBSD)
 #  include <unistd.h>
 #endif
 
@@ -2531,7 +2532,7 @@ Int_t TAuthenticate::ClearAuth(TString &User, TString &Passwd, Bool_t &PwHash)
             // AFS: we cannot reuse the token because remotely the
             // daemon token must be re-initialized; for PROOF, we
             // just flag the entry as AFS; this allows to skip reusing
-            // but to keep the session key for password forwarding  
+            // but to keep the session key for password forwarding
             fSecContext->SetDetails("AFS authentication");
          return 1;
       } else {
@@ -4654,7 +4655,7 @@ Int_t StdCheckSecCtx(const char *User, TSecContext *Ctx)
    Int_t rc = 0;
 
    if (Ctx->IsActive()) {
-      if (!strcmp(User,Ctx->GetUser()) && 
+      if (!strcmp(User,Ctx->GetUser()) &&
            strncmp("AFS",Ctx->GetDetails(),3))
          rc = 1;
    }
diff --git a/proofd/src/proofd.cxx b/proofd/src/proofd.cxx
index 242069d50d8..f84edfaec1f 100644
--- a/proofd/src/proofd.cxx
+++ b/proofd/src/proofd.cxx
@@ -1,4 +1,4 @@
-// @(#)root/proofd:$Name:  $:$Id: proofd.cxx,v 1.73 2005/02/11 18:40:08 rdm Exp $
+// @(#)root/proofd:$Name:  $:$Id: proofd.cxx,v 1.74 2005/02/12 02:14:26 rdm Exp $
 // Author: Fons Rademakers   02/02/97
 
 /*************************************************************************
@@ -179,14 +179,15 @@
 #endif
 #if defined(linux) || defined(__sun) || defined(__sgi) || \
     defined(_AIX) || defined(__FreeBSD__) || defined(__APPLE__) || \
-    defined(__MACH__) || defined(cygwingcc)
+    defined(__MACH__) || defined(cygwingcc) || defined(__OpenBSD__)
 #include <grp.h>
 #include <sys/types.h>
 #include <signal.h>
 #define ROOT_SIGNAL_INCLUDED
 #endif
 
-#if defined(__alpha) && !defined(linux) && !defined(__FreeBSD__)
+#if defined(__alpha) && !defined(linux) && !defined(__FreeBSD__) && \
+    !defined(__OpenBSD__)
 extern "C" int initgroups(const char *name, int basegid);
 #ifndef ROOT_SIGNAL_INCLUDED
 #include <signal.h>
diff --git a/rfio/src/TRFIOFile.cxx b/rfio/src/TRFIOFile.cxx
index adffc4fad33..8b8cb82ee11 100644
--- a/rfio/src/TRFIOFile.cxx
+++ b/rfio/src/TRFIOFile.cxx
@@ -1,4 +1,4 @@
-// @(#)root/rfio:$Name:  $:$Id: TRFIOFile.cxx,v 1.30 2004/08/09 17:43:07 rdm Exp $
+// @(#)root/rfio:$Name:  $:$Id: TRFIOFile.cxx,v 1.31 2004/10/15 16:55:07 rdm Exp $
 // Author: Fons Rademakers   20/01/99
 
 /*************************************************************************
@@ -34,7 +34,7 @@
 #if defined(R__SUN) || defined(R__SGI) || defined(R__HPUX) || \
     defined(R__AIX) || defined(R__LINUX) || defined(R__SOLARIS) || \
     defined(R__ALPHA) || defined(R__HIUX) || defined(R__FBSD) || \
-    defined(R__MACOSX) || defined(R__HURD)
+    defined(R__MACOSX) || defined(R__HURD) || defined(R__OBSD)
 #define HAS_DIRENT
 #endif
 #endif
diff --git a/rootd/src/rootd.cxx b/rootd/src/rootd.cxx
index 3104614596a..852d344c620 100644
--- a/rootd/src/rootd.cxx
+++ b/rootd/src/rootd.cxx
@@ -1,4 +1,4 @@
-// @(#)root/rootd:$Name:  $:$Id: rootd.cxx,v 1.99 2005/02/11 18:40:08 rdm Exp $
+// @(#)root/rootd:$Name:  $:$Id: rootd.cxx,v 1.100 2005/02/12 02:14:26 rdm Exp $
 // Author: Fons Rademakers   11/08/97
 
 /*************************************************************************
@@ -238,7 +238,7 @@ extern "C" int fstatfs(int file_descriptor, struct statfs *buffer);
 extern "C" int fstatfs(int file_descriptor, struct statfs *buffer);
 #elif defined(linux) || defined(__hpux) || defined(cygwingcc)
 #include <sys/vfs.h>
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__OpenBSD__)
 #include <sys/param.h>
 #include <sys/mount.h>
 #else
@@ -247,7 +247,7 @@ extern "C" int fstatfs(int file_descriptor, struct statfs *buffer);
 
 #if defined(linux) || defined(__hpux) || defined(_AIX) || defined(__alpha) || \
     defined(__sun) || defined(__sgi) || defined(__FreeBSD__) || \
-    defined(__APPLE__) || defined(cygwingcc)
+    defined(__APPLE__) || defined(cygwingcc) || defined(__OpenBSD__)
 #define HAVE_MMAP
 #endif
 
@@ -261,7 +261,7 @@ extern "C" int fstatfs(int file_descriptor, struct statfs *buffer);
 #ifdef __APPLE__
 #include <AvailabilityMacros.h>
 #endif
-#if (defined(__FreeBSD__) && (__FreeBSD__ < 4)) || \
+#if (defined(__FreeBSD__) && (__FreeBSD__ < 4)) || defined(__OpenBSD__) || \
     (defined(__APPLE__) && (!defined(MAC_OS_X_VERSION_10_3) || \
      (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3)))
 #include <sys/file.h>
@@ -292,14 +292,15 @@ static int fcntl_lockf(int fd, int op, off_t off)
 
 #if defined(linux) || defined(__sun) || defined(__sgi) || \
     defined(_AIX) || defined(__FreeBSD__) || defined(__APPLE__) || \
-    defined(__MACH__) || defined(cygwingcc)
+    defined(__MACH__) || defined(cygwingcc) || defined(__OpenBSD__)
 #include <grp.h>
 #include <sys/types.h>
 #include <signal.h>
 #define ROOT_SIGNAL_INCLUDED
 #endif
 
-#if defined(__alpha) && !defined(linux) && !defined(__FreeBSD__)
+#if defined(__alpha) && !defined(linux) && !defined(__FreeBSD__) && \
+    !defined(__OpenBSD__)
 extern "C" int initgroups(const char *name, int basegid);
 #ifndef ROOT_SIGNAL_INCLUDED
 #include <signal.h>
diff --git a/rootx/src/rootx.cxx b/rootx/src/rootx.cxx
index ed1151c7858..e7796de5758 100644
--- a/rootx/src/rootx.cxx
+++ b/rootx/src/rootx.cxx
@@ -1,4 +1,4 @@
-// @(#)root/rootx:$Name:  $:$Id: rootx.cxx,v 1.14 2004/03/26 17:35:38 rdm Exp $
+// @(#)root/rootx:$Name:  $:$Id: rootx.cxx,v 1.15 2004/12/06 13:38:53 brun Exp $
 // Author: Fons Rademakers   19/02/98
 
 //////////////////////////////////////////////////////////////////////////
@@ -36,7 +36,8 @@
 #define UTMP_NO_ADDR
 #endif
 #if (defined(__alpha) && !defined(__linux)) || defined(_AIX) || \
-    defined(__FreeBSD__) || defined(__Lynx__) || defined(__APPLE__)
+    defined(__FreeBSD__) || defined(__Lynx__) || defined(__APPLE__) || \
+    defined(__OpenBSD__)
 #define UTMP_NO_ADDR
 #endif
 
@@ -198,7 +199,8 @@ static void SetLibraryPath()
    static char msg[4096];
 
 #  if defined(__linux) || defined(__alpha) || defined(__sgi) || \
-      defined(__sun) || defined(__FreeBSD__) || defined(__APPLE__)
+      defined(__sun) || defined(__FreeBSD__) || defined(__APPLE__) || \
+      defined(__OpenBSD__)
    if (getenv("LD_LIBRARY_PATH"))
       sprintf(msg, "LD_LIBRARY_PATH=%s/lib:%s", getenv("ROOTSYS"),
                                                 getenv("LD_LIBRARY_PATH"));
diff --git a/rpdutils/src/daemon.cxx b/rpdutils/src/daemon.cxx
index 58355c07aad..fe5a7ff96a5 100644
--- a/rpdutils/src/daemon.cxx
+++ b/rpdutils/src/daemon.cxx
@@ -1,4 +1,4 @@
-// @(#)root/rpdutils:$Name:  $:$Id: daemon.cxx,v 1.4 2004/04/11 18:18:01 rdm Exp $
+// @(#)root/rpdutils:$Name:  $:$Id: daemon.cxx,v 1.5 2004/04/20 15:21:50 rdm Exp $
 // Author: Fons Rademakers   11/08/97
 // Modifified: Gerardo Ganis 8/04/2003
 
@@ -42,14 +42,15 @@
 #define USE_SIGCHLD
 #endif
 
-#if defined(__FreeBSD__) || defined(__APPLE__)
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
 #define USE_SIGCHLD
 #define	SIGCLD SIGCHLD
 #endif
 
 #if defined(linux) || defined(__hpux) || defined(__sun) || defined(__sgi) || \
-    defined(_AIX) || defined(__FreeBSD__) || defined(__APPLE__) || \
-    defined(__MACH__)  || (defined(__CYGWIN__) && defined(__GNUC__))
+    defined(_AIX) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
+    defined(__APPLE__) || defined(__MACH__) || \
+    (defined(__CYGWIN__) && defined(__GNUC__))
 #define USE_SETSID
 #endif
 
@@ -67,7 +68,8 @@ extern ErrorHandler_t gErrSys;
 static void SigChild(int)
 {
    int         pid;
-#if defined(__hpux) || defined(__FreeBSD__) || defined(__APPLE__)
+#if defined(__hpux) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
+    defined(__APPLE__)
    int status;
 #else
    union wait  status;
diff --git a/rpdutils/src/net.cxx b/rpdutils/src/net.cxx
index a1e70efabf5..903fe75c11e 100644
--- a/rpdutils/src/net.cxx
+++ b/rpdutils/src/net.cxx
@@ -1,4 +1,4 @@
-// @(#)root/rpdutils:$Name:  $:$Id: net.cxx,v 1.6 2005/02/09 21:05:07 brun Exp $
+// @(#)root/rpdutils:$Name:  $:$Id: net.cxx,v 1.7 2005/02/22 16:03:46 rdm Exp $
 // Author: Fons Rademakers   12/08/97
 
 /*************************************************************************
@@ -32,7 +32,7 @@
 #include <errno.h>
 
 #if defined(R__AIX) || (defined(R__FBSD) && !defined(R__ALPHA)) || \
-    (defined(R__SUNGCC3) && !defined(__arch64__))
+    defined(R__OBSD) || (defined(R__SUNGCC3) && !defined(__arch64__))
 #   define USE_SIZE_T
 #elif defined(R__GLIBC) || (defined(R__FBSD) && defined(R__ALPHA)) || \
      (defined(R__SUNGCC3) && defined(__arch64__)) || MACOSX_VERS>=4
diff --git a/rpdutils/src/netpar.cxx b/rpdutils/src/netpar.cxx
index 36d1a135722..c775af37a3f 100644
--- a/rpdutils/src/netpar.cxx
+++ b/rpdutils/src/netpar.cxx
@@ -1,4 +1,4 @@
-// @(#)root/rpdutils:$Name:  $:$Id: netpar.cxx,v 1.5 2004/12/02 11:52:28 rdm Exp $
+// @(#)root/rpdutils:$Name:  $:$Id: netpar.cxx,v 1.6 2005/02/22 16:03:46 rdm Exp $
 // Author: Fons Rademakers   06/02/2001
 
 /*************************************************************************
@@ -45,7 +45,7 @@
 #endif
 
 #if defined(R__AIX) || (defined(R__FBSD) && !defined(R__ALPHA)) || \
-    (defined(R__SUNGCC3) && !defined(__arch64__))
+    defined(R__OBSD) || (defined(R__SUNGCC3) && !defined(__arch64__))
 #   define USE_SIZE_T
 #elif defined(R__GLIBC) || (defined(R__FBSD) && defined(R__ALPHA)) || \
      (defined(R__SUNGCC3) && defined(__arch64__)) || MACOSX_VERS>=4
-- 
GitLab