|
34 | 34 |
|
35 | 35 | #ifdef HAVE_UNISTD_H |
36 | 36 | #include <unistd.h> |
| 37 | +#include <sys/utsname.h> |
37 | 38 | #endif |
38 | 39 | #ifdef HAVE_FCNTL_H |
39 | 40 | #include <fcntl.h> |
@@ -129,8 +130,8 @@ static void panic_continue ( void ); |
129 | 130 | static void abolish_predicate ( const char *, const char *, int ); |
130 | 131 | static void assert_sys_searchdir ( char * ); |
131 | 132 | static void assert_als_system (const char *, const char *, |
132 | | - const char *, const char *, |
133 | | - const char *, const char *, int); |
| 133 | + const char *, const char *, const char *, |
| 134 | + const char *, const char *, const char *, int); |
134 | 135 | static void assert_atom_in_module ( const char*, const char * ); |
135 | 136 |
|
136 | 137 |
|
@@ -426,19 +427,34 @@ static int PI_prolog_init0(const PI_system_setup *setup) |
426 | 427 | /*---------------------------------------* |
427 | 428 | | Set up the als_system fact. |
428 | 429 | *---------------------------------------*/ |
429 | | - |
| 430 | + |
| 431 | + const char *System = "sys", *Machine = "arch", *Release = ""; |
| 432 | + |
| 433 | +#ifdef UNIX |
| 434 | + |
| 435 | + struct utsname name; |
| 436 | + uname(&name); |
| 437 | + System = name.sysname; |
| 438 | + Machine = name.machine; |
| 439 | + Release = name.release; |
| 440 | + |
| 441 | +#endif |
| 442 | + |
430 | 443 | #ifdef MSWin32 |
431 | 444 |
|
432 | 445 |
|
433 | 446 | if (IS_NT) MinorOSStr = "mswinnt"; |
434 | 447 | else if (IS_WIN32S) MinorOSStr = "mswin32s"; |
435 | 448 | else if (IS_WIN95) MinorOSStr = "mswin95"; |
436 | 449 |
|
| 450 | + System = OSStr; |
| 451 | + Machine = MinorOSStr; |
| 452 | + |
437 | 453 | #endif |
438 | 454 |
|
439 | 455 | #ifndef KERNAL |
440 | 456 | assert_als_system(OSStr, MinorOSStr, ProcStr, |
441 | | - SysManufacturer, versionNum, versionYear, heapWordBytes); |
| 457 | + System, Release, Machine, versionNum, versionYear, heapWordBytes); |
442 | 458 |
|
443 | 459 | /*-------------------------------------------* |
444 | 460 | | Set up conditional configuration controls: |
@@ -618,19 +634,19 @@ assert_atom_in_module(const char *mod_name, const char *atom_name) |
618 | 634 | *-----------------------------------------------------------------------------*/ |
619 | 635 | static void |
620 | 636 | assert_als_system(const char *os, const char *os_var, const char *proc, |
621 | | - const char *man, const char *ver, const char *year, int hwb) |
| 637 | + const char *sys, const char *rel, const char *mach, const char *ver, const char *year, int hwb) |
622 | 638 | { |
623 | 639 | char command[2048]; |
624 | 640 |
|
625 | 641 | if (noautoload && !pckgloaded) |
626 | 642 | return; |
627 | 643 |
|
628 | 644 | sprintf(command, |
629 | | - "assertz(builtins,als_system([os='%s',os_variation='%s',processor='%s',manufacturer='%s',prologVersion='%s',prologYear='%s',heapWordBytes=%d]),_,0)", |
| 645 | + "assertz(builtins,als_system([os='%s',os_variation='%s',processor='%s',sysname='%s',release='%s',machine='%s',prologVersion='%s',prologYear='%s',heapWordBytes=%d]),_,0)", |
630 | 646 | os, |
631 | 647 | os_var, |
632 | 648 | proc, |
633 | | - man, |
| 649 | + sys, rel, mach, |
634 | 650 | ver, |
635 | 651 | year, |
636 | 652 | heapWordBytes); |
|
0 commit comments