#ifndef WNT
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <stdlib.h>
#include <stdio.h>
-#include <unistd.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
#include <sys/stat.h>
+#ifdef HAVE_SYS_FILIO_H
+# include <sys/filio.h>
+#endif
+
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
-#ifdef SOLARIS
-#include <sys/filio.h>
-#else
-#include <sys/ioctl.h>
+#if defined(HAVE_SYS_VNODE_H) && defined(__FreeBSD__)
+# include <sys/vnode.h>
#endif
+
#include <fcntl.h>
#include <WOKUnix_FDescr.ixx>
const OSD_WhoAmI Iam = OSD_WFile;
-#ifdef LIN
+#ifdef __GNUC__
static FILE* _wokunix_fdopen ( int );
-#endif // LIN
+#endif // __GNUC__
//=======================================================================
//function : WOKUnix_FDescr
//=======================================================================
WOKUnix_FDescr::WOKUnix_FDescr(const Standard_Integer afd) {
myFileChannel = afd;
-#ifndef LIN
+#ifndef __GNUC__
myFILE = fdopen(afd, "r");
#else
myFILE = _wokunix_fdopen ( afd );
-#endif // LIN
+#endif // __GNUC__
}
//=======================================================================
WOKUnix_FDescr::WOKUnix_FDescr(const Standard_Integer afd, const Handle(TCollection_HAsciiString)& apath)
{
myFileChannel = afd;
-#ifndef LIN
+#ifndef __GNUC__
myFILE = fdopen(afd, "r");
#else
myFILE = _wokunix_fdopen ( afd );
-#endif // LIN
+#endif // __GNUC__
SetPath(apath->String());
}
//=======================================================================
void WOKUnix_FDescr::SetUnBuffered()
{
+#ifdef __FreeBSD__
+ if(fcntl(myFileChannel, F_SETFL, O_ASYNC) < 0)
+#else
if(fcntl(myFileChannel, F_SETFL, O_SYNC) < 0)
+#endif
{
Perror();
return;
return StderrFD;
}
-#ifdef LIN
+#ifdef __GNUC__
static FILE* _wokunix_fdopen ( int fd ) {
char* fdMode = "r";
return retVal;
} // end _wokunix_fdopen
-#endif // LIN
+#endif // __GNUC__
-#endif
+#endif // WNT
#ifndef WNT
-
#include <OSD_Environment.hxx>
#include <OSD_Path.hxx>
//=======================================================================
void WOKUnix_FileBuffer::Acquit(const Standard_Integer astatus, const WOKUnix_FDSet& aset)
{
-#ifndef LIN
+#ifndef __GNUC__
Standard_Integer nbtoread = GetFDescr().GetNbToRead();
-#endif // LIN
-#if defined( WOK_VERBOSE ) && !defined( LIN )
+#endif // __GNUC__
+#if defined( WOK_VERBOSE ) && !defined( __GNUC__ )
VerboseMsg("WOK_PROCESS") << "WOKUnix_FileBuffer::Acquit"
<< "There is " << nbtoread << " bytes to read on process output" << endm;
#endif
-#ifndef LIN
+#ifndef __GNUC__
if(nbtoread >= MAX_PIPE_SIZE)
-#endif // LIN
+#endif // __GNUC__
{
Dump();
}
if( apath.Name().IsEmpty() != Standard_True && mybuffer.FileNo() >= 0) mybuffer.Close();
WOKUnix_Buffer::Close();
}
-#endif
+#endif // WNT
// Created: Tue May 30 09:17:00 1995
// Author: Jean GAUTIER
// <jga@cobrax>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include <sys/types.h>
-#include <unistd.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
-#include <unistd.h>
#include <WOKUnix_Path.ixx>
if(Exists())
{
-#if !defined(DECOSF1) && !defined(HPUX)
+#if !defined(__osf__) && !defined(DECOSF1) && !defined(__hpux) && !defined(HPUX)
char abuffer[PATH_MAX];
#ifndef WNT
-#ifdef IRIX
-#include <unistd.h>
-#include <sys/types.h>
-#include <bstring.h>
-#include <sys/time.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
#endif
-#ifdef HPUX
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/time.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
#endif
-#ifdef AIX
-#include <strings.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+#ifdef HAVE_BSTRING_H
+# include <bstring.h>
+#endif
+
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+
+#ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+
+#ifdef HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
+
+#ifdef HAVE_SIGNAL_H
+# include <signal.h>
#endif
-#include <unistd.h>
-#include <sys/wait.h>
-#include <signal.h>
#include <errno.h>
#include <stdio.h>
// Author: Jean GAUTIER
// <jga@cobrax>
-#ifdef IRIX
-#include <unistd.h>
-#include <sys/types.h>
-#include <bstring.h>
-#include <sys/time.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
#endif
-#ifdef HPUX
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/time.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
#endif
-#ifdef AIX
-#include <strings.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+#ifdef HAVE_BSTRING_H
+# include <bstring.h>
+#endif
+
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+
+#ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
#endif
#include <stdio.h>
return mypassword;
}
-
-
-
-
-
-
-
-
-
#endif
#ifndef WNT
-#ifdef IRIX
-#include <unistd.h>
-#include <sys/types.h>
-#include <bstring.h>
-#include <sys/time.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
#endif
-#ifdef HPUX
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/time.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
#endif
-#ifdef AIX
-#include <strings.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+#ifdef HAVE_BSTRING_H
+# include <bstring.h>
+#endif
+
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+
+#ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
#endif
#include <fstream.h>
return myhost;
}
-
#endif
#ifndef WNT
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include <WOKUnix_Signal.ixx>
#include <signal.h>
#include <stdio.h>
-#ifdef LIN
+#ifdef HAVE_BITS_SIGSET_H
#include <bits/sigset.h>
-#include <signal.h>
-#elif !defined(HPUX) && !defined(AIX)
+#endif
+
+#ifdef HAVE_SIGINFO_H
#include <siginfo.h>
#endif
{
act.sa_handler = (WOKUnix_SigHandler) ahandler;
}
-#ifdef SOLARIS
+#if defined(__sun) || defined(__sgi)
act.sa_mask.__sigbits[0] = 0;
act.sa_mask.__sigbits[1] = 0;
act.sa_mask.__sigbits[2] = 0;
act.sa_mask.__sigbits[3] = 0;
- act.sa_flags = SA_RESTART;
-#elif HPUX
+#elif defined(__hpux)
act.sa_mask.sigset[0] = 0;
act.sa_mask.sigset[1] = 0;
act.sa_mask.sigset[2] = 0;
act.sa_mask.sigset[5] = 0;
act.sa_mask.sigset[6] = 0;
act.sa_mask.sigset[7] = 0;
- act.sa_flags = 0;
-#elif IRIX
- act.sa_mask.__sigbits[0] = 0;
- act.sa_mask.__sigbits[1] = 0;
- act.sa_mask.__sigbits[2] = 0;
- act.sa_mask.__sigbits[3] = 0;
- act.sa_flags = 0;
-#elif defined(LIN)
+#elif defined(__FreeBSD__)
+ act.sa_mask.__bits[0] = 0;
+ act.sa_mask.__bits[1] = 0;
+ act.sa_mask.__bits[2] = 0;
+ act.sa_mask.__bits[3] = 0;
+#elif defined(linux)
sigemptyset(&act.sa_mask) ;
- act.sa_flags = 0;
-#elif defined(AIX)
+#elif defined(_AIX)
act.sa_mask.losigs = 0;
act.sa_mask.hisigs = 0;
- act.sa_flags = 0;
- #else
+#else
act.sa_mask = 0;
- act.sa_flags = 0;
#endif
+ act.sa_flags = 0;
//==== Always detected the signal "SIGFPE" =================================
stat = sigaction(WOKUnix_Signal::GetSig(mysig),&act,&oact); // ...... floating point exception
case WOKUnix_SIGKILL : return SIGKILL;
case WOKUnix_SIGBUS : return SIGBUS;
case WOKUnix_SIGSEGV : return SIGSEGV;
+#if defined(SIGCLD)
case WOKUnix_SIGCHILD : return SIGCLD;
+#elif defined(SIGCHLD)
+ case WOKUnix_SIGCHILD : return SIGCHLD;
+#endif
}
return 0;
}
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
/******************************************************************************/
/* Extended regular expression matching and search. */
/* Copyright (C) 1985 Free Software Foundation, Inc. */
/* JGA : to compile on Solaris */
-#if !defined(HPUX) && !defined (WNT) && !defined (AIX)
+#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#else