377 char *v; /* tmp var */ 378 379 if (sprops.user_dir) { 380 return &sprops; 381 } 382 383 /* tmp dir */ 384 sprops.tmp_dir = P_tmpdir; 385 #ifdef MACOSX 386 /* darwin has a per-user temp dir */ 387 static char tmp_path[PATH_MAX]; 388 int pathSize = confstr(_CS_DARWIN_USER_TEMP_DIR, tmp_path, PATH_MAX); 389 if (pathSize > 0 && pathSize <= PATH_MAX) { 390 sprops.tmp_dir = tmp_path; 391 } 392 #endif /* MACOSX */ 393 394 /* patches/service packs installed */ 395 sprops.patch_level = NULL; // leave it undefined 396 397 /* Java 2D/AWT properties */ 398 #ifdef MACOSX 399 // Always the same Toolkit on Mac OS X 400 sprops.awt_toolkit = "sun.lwawt.macosx.LWCToolkit"; 401 #else 402 sprops.awt_toolkit = "sun.awt.X11.XToolkit"; 403 #endif 404 405 #ifdef SI_ISALIST 406 /* supported instruction sets */ 407 { 408 char list[258]; 409 sysinfo(SI_ISALIST, list, sizeof(list)); 410 sprops.cpu_isalist = strdup(list); 411 } 412 #else 413 sprops.cpu_isalist = NULL; 414 #endif 415 416 /* endianness of platform */ 417 { 418 unsigned int endianTest = 0xff000000; 419 if (((char*)(&endianTest))[0] != 0) 420 sprops.cpu_endian = "big"; 421 else 422 sprops.cpu_endian = "little"; 423 } 424 | 377 char *v; /* tmp var */ 378 379 if (sprops.user_dir) { 380 return &sprops; 381 } 382 383 /* tmp dir */ 384 sprops.tmp_dir = P_tmpdir; 385 #ifdef MACOSX 386 /* darwin has a per-user temp dir */ 387 static char tmp_path[PATH_MAX]; 388 int pathSize = confstr(_CS_DARWIN_USER_TEMP_DIR, tmp_path, PATH_MAX); 389 if (pathSize > 0 && pathSize <= PATH_MAX) { 390 sprops.tmp_dir = tmp_path; 391 } 392 #endif /* MACOSX */ 393 394 /* patches/service packs installed */ 395 sprops.patch_level = NULL; // leave it undefined 396 397 #ifdef SI_ISALIST 398 /* supported instruction sets */ 399 { 400 char list[258]; 401 sysinfo(SI_ISALIST, list, sizeof(list)); 402 sprops.cpu_isalist = strdup(list); 403 } 404 #else 405 sprops.cpu_isalist = NULL; 406 #endif 407 408 /* endianness of platform */ 409 { 410 unsigned int endianTest = 0xff000000; 411 if (((char*)(&endianTest))[0] != 0) 412 sprops.cpu_endian = "big"; 413 else 414 sprops.cpu_endian = "little"; 415 } 416 |