1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
21 static PRSysInfo
Incr(PRSysInfo
*cmd
)
23 PRIntn tmp
= (PRIntn
)*cmd
+ 1;
24 *cmd
= (PRSysInfo
)tmp
;
25 return (PRSysInfo
)tmp
;
28 int main(int argc
, char **argv
)
32 PRFileDesc
*output
= PR_GetSpecialFD(PR_StandardOutput
);
34 char *info
= (char*)PR_Calloc(SYS_INFO_BUFFER_LENGTH
, 1);
35 for (cmd
= PR_SI_HOSTNAME
; cmd
<= PR_SI_ARCHITECTURE
; Incr(&cmd
))
37 rv
= PR_GetSystemInfo(cmd
, info
, SYS_INFO_BUFFER_LENGTH
);
38 if (PR_SUCCESS
== rv
) {
39 PR_fprintf(output
, "%s: %s\n", tag
[cmd
], info
);
42 PL_FPrintError(output
, tag
[cmd
]);
47 PR_fprintf(output
, "Host page size is %d\n", PR_GetPageSize());
48 PR_fprintf(output
, "Page shift is %d\n", PR_GetPageShift());
49 PR_fprintf(output
, "Memory map alignment is %ld\n", PR_GetMemMapAlignment());
50 PR_fprintf(output
, "Number of processors is: %d\n", PR_GetNumberOfProcessors());
51 PR_fprintf(output
, "Physical memory size is: %llu\n", PR_GetPhysicalMemorySize());