From 1f6fabc9c1563e154dd42b5963c0c7274acbfb12 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 21 Jul 2005 04:36:53 +0000 Subject: [PATCH] add isatty method --- bindings/java/src/jni/javasigar.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bindings/java/src/jni/javasigar.c b/bindings/java/src/jni/javasigar.c index dbed606c..d986812d 100644 --- a/bindings/java/src/jni/javasigar.c +++ b/bindings/java/src/jni/javasigar.c @@ -939,6 +939,12 @@ JNIEXPORT jstring SIGAR_JNI(Sigar_getFQDN) #include "sigar_getline.h" +JNIEXPORT jboolean SIGAR_JNI(util_Getline_isatty) +(JNIEnv *env, jclass cls) +{ + return isatty(fileno(stdin)) ? JNI_TRUE : JNI_FALSE; +} + JNIEXPORT jstring SIGAR_JNI(util_Getline_getline) (JNIEnv *env, jobject sigar_obj, jstring prompt) {