$NetBSD: patch-aa,v 1.2 2006/05/27 12:38:27 drochner Exp $ --- unix/src/TUnixSystem.cxx.orig 2006-05-26 16:51:20.000000000 +0200 +++ unix/src/TUnixSystem.cxx @@ -62,7 +62,7 @@ #if defined(R__AIX) || defined(R__LINUX) || defined(R__ALPHA) || \ defined(R__SGI) || defined(R__HIUX) || defined(R__FBSD) || \ defined(R__OBSD) || defined(R__LYNXOS) || defined(R__MACOSX) || \ - defined(R__HURD) + defined(R__HURD) || defined(__NetBSD__) # include #endif #if defined(R__AIX) || defined(R__SOLARIS) @@ -87,8 +87,12 @@ # include # include #else +#ifdef __NetBSD__ +#include +#else # include #endif +#endif #include #include @@ -174,7 +178,7 @@ #elif defined(R__GLIBC) || (defined(R__FBSD) && defined(R__ALPHA)) || \ (defined(R__SUNGCC3) && defined(__arch64__)) || \ defined(MAC_OS_X_VERSION_10_4) || \ - (defined(R__AIX) && defined(_AIX43)) + (defined(R__AIX) && defined(_AIX43) || defined(__NetBSD__)) # define USE_SOCKLEN_T #endif @@ -411,6 +415,7 @@ void TUnixSystem::SetProgname(const char //______________________________________________________________________________ void TUnixSystem::SetDisplay() { +#if 0 // Set DISPLAY environment variable based on utmp entry. Only for UNIX. if (!Getenv("DISPLAY")) { @@ -451,6 +456,7 @@ void TUnixSystem::SetDisplay() free(gUtmpContents); } } +#endif } //______________________________________________________________________________ @@ -3446,7 +3452,11 @@ int TUnixSystem::UnixFSstat(const char * // The function returns 0 in case of success and 1 if the file system could // not be stat'ed. +#ifdef __NetBSD__ + struct statvfs statfsbuf; +#else struct statfs statfsbuf; +#endif #if defined(R__SGI) || (defined(R__SOLARIS) && !defined(R__LINUX)) if (statfs(path, &statfsbuf, sizeof(struct statfs), 0) == 0) { *id = statfsbuf.f_fstyp; @@ -3454,6 +3464,9 @@ int TUnixSystem::UnixFSstat(const char * *blocks = statfsbuf.f_blocks; *bfree = statfsbuf.f_bfree; #else +#ifdef __NetBSD__ + if (statvfs((char*)path, &statfsbuf) == 0) { +#else if (statfs((char*)path, &statfsbuf) == 0) { #ifdef R__OBSD // Convert BSD filesystem names to Linux filesystem type numbers @@ -3480,6 +3493,7 @@ int TUnixSystem::UnixFSstat(const char * #else *id = statfsbuf.f_type; #endif +#endif *bsize = statfsbuf.f_bsize; *blocks = statfsbuf.f_blocks; *bfree = statfsbuf.f_bavail;