Print can't find method and exit.
[cacao.git] / nat / System.c
index 0fd018ce097cba109482648f8cf616a17c18c4e0..0a7e5c0aa7741349df1195ceedee2c40036ba9a4 100644 (file)
@@ -39,6 +39,11 @@ JNIEXPORT void JNICALL Java_java_lang_System_arraycopy (JNIEnv *env, struct java
                return; 
                }
 
+/*          if (s->arraytype != d->arraytype) { */
+/*            exceptionptr = proto_java_lang_ArrayStoreException;  */
+/*            return;  */
+/*          } */
+
        switch (s->arraytype) {
        case ARRAYTYPE_BYTE:
                if (s->objheader.vftbl != d->objheader.vftbl) {
@@ -200,13 +205,14 @@ static char *proplist[MAXPROPS][2] = {
        { "user.name", NULL }, 
        { "user.dir",  NULL }, 
 
+       { "os.arch", NULL },
+       { "os.name", NULL },
+       { "os.version", NULL },
+
        { "java.class.version", "45.3" },
-       { "java.version", "cacao:0.3" },
+       { "java.version", PACKAGE":"VERSION },
        { "java.vendor", "CACAO Team" },
        { "java.vendor.url", "http://www.complang.tuwien.ac.at/java/cacao/" },
-       { "os.arch", "Alpha" },
-       { "os.name", "Linux/Digital Unix" },
-       { "os.version", "4.0/3.2C/V4.0" },
        { "path.separator", ":" },
        { "file.separator", "/" },
        { "line.separator", "\n" }
@@ -232,13 +238,20 @@ JNIEXPORT struct java_util_Properties* JNICALL Java_java_lang_System_initPropert
        methodinfo *m;
        char buffer[BUFFERSIZE];
        java_objectheader *o;
-       
+       struct utsname utsnamebuf;
+
        proplist[0][1] = classpath;
        proplist[1][1] = getenv("JAVA_HOME");
        proplist[2][1] = getenv("HOME");
        proplist[3][1] = getenv("USER");
        proplist[4][1] = getcwd(buffer,BUFFERSIZE);
        
+       /* get properties from system */
+       uname(&utsnamebuf);
+       proplist[5][1] = utsnamebuf.machine;
+       proplist[6][1] = utsnamebuf.sysname;
+       proplist[7][1] = utsnamebuf.release;
+       
        if (!p) panic ("initProperties called with NULL-Argument");
 
        /* search for method to add properties */