From 760dac960451db86de72fdec07ac89e85068f76c Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Mon, 21 Feb 2005 02:02:45 +0000 Subject: [PATCH] nfs ping binding --- bindings/java/src/jni/javasigar.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/bindings/java/src/jni/javasigar.c b/bindings/java/src/jni/javasigar.c index 11b7d982..2fa082a7 100644 --- a/bindings/java/src/jni/javasigar.c +++ b/bindings/java/src/jni/javasigar.c @@ -333,6 +333,32 @@ JNIEXPORT jobjectArray SIGAR_JNI(Sigar_getFileSystemList) return fsarray; } +JNIEXPORT jboolean SIGAR_JNI(NfsFileSystem_ping) +(JNIEnv *env, jclass cls_obj, jstring jhostname) +{ +#ifdef WIN32 + return JNI_FALSE; /*XXX*/ +#else + jboolean is_copy; + const char *hostname; + jboolean retval; + + if (!jhostname) { + return JNI_FALSE; + } + + hostname = JENV->GetStringUTFChars(env, jhostname, &is_copy); + + retval = (sigar_nfs_ping((char *)hostname) == SIGAR_OK); + + if (is_copy) { + JENV->ReleaseStringUTFChars(env, jhostname, hostname); + } + + return retval; +#endif +} + JNIEXPORT jobjectArray SIGAR_JNI(Sigar_getCpuInfoList) (JNIEnv *env, jobject sigar_obj) {