// This may look like C code, but it is really -*- C++ -*-

// <copyright>
// 
// Copyright (c) 1993-1995
// Institute for Information Processing and Computer Supported New Media (IICM),
// Graz University of Technology, Austria.
// 
// </copyright>

//<file>
//
// Name:       hgunistd.h
//
// Purpose:    Machine independent unistd.h
//
// Created:    24 Jun 94    Gerald Pani
//
// Description:
//
// Includes unistd.h or sysent.h depending on the current platform.
//
// Functions sysread and syswrite behaves like read and write,
// but don't return on interrupts.
//
// Function hg_signal a machine independent signal.
// 
//</file>


#ifndef hg_utils_hgunistd_h
#define hg_utils_hgunistd_h

#ifdef BSD
#  ifdef SUN
#    include <sysent.h>
#    define KERNEL
extern "C" {
#    include <cc/unistd.h>
     
     extern long sysconf( int);
}
#    undef KERNEL
#  endif

#  ifdef ULTRIX
#    include <sysent.h>
#    define KERNEL
extern "C" {
#    include <cc/unistd.h>
     
     extern long sysconf( int);
}
#    undef KERNEL
#  endif

#  ifdef OSF1
#    include <unistd.h>
#  endif

#else
// not BSD
#  include <unistd.h>
#endif


#include <sys/time.h>

#if defined(OSF1) && defined(__DECCXX)
extern "C" {
     extern int select( int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeval *tmout);
}
#endif

// functions of hgunistd.C
extern int syswrite( int fd, const char* buf, int nbyte);
extern int sysread( int fd, char* buf, int nbyte);
typedef void Sigfunc(int);
extern Sigfunc* hg_signal( int sig, Sigfunc* handler);

#endif





