The Mozilla
Organization
Our Mission
Who We Are
Getting Involved
Community
Editorials
What's New
Development
Roadmap
Module Owners
Blue Sky
Projects
Status
Tools
Products
Source Code
Binaries
Documentation
License Terms
Bug Reports
Search
Feedback


[Contents] [Previous] [Next] [Last] 



Chapter 20
System Information

This chapter describes the NSPR API for obtaining system information This includes the host name, system name and system release. Information about the system page size is also available

Types

PRSysInfo

Syntax
typedef enum {
    PR_SI_HOSTNAME,         /* name of the host */
    PR_SI_SYSNAME,          /* name of the system */
    PR_SI_RELEASE,          /* release number of the system */
    PR_SI_ARCHITECTURE      /* architecture of the system */
} PRSysInfo;
Description
Define the command argument for the PR_GetSystemInfo() function.

Functions

PR_GetSystemInfo
PR_GetPageSize
PR_GetPageShift

PR_GetSystemInfo

Return the information requested about the system.
Syntax
#include <prsystem.h>
PRStatus PR_GetSystemInfo(PRSysInfo cmd, char *buf, PRUint32 buflen);
Parameters
The function has the following parameters:
cmd> Specifies the system information required.
buf A pointer to a buffer to hold the null terminated string containing the system information 
 
buflen The size of buf (in bytes).
Returns
If successful, PR_SUCCESS. The buffer pointed to by buf contains the system information specified by cmd
If unsuccessful, PR_FAILURE. The contents of the buffer pointed to by buf are undefined.
Description
PR_GetSystemInfo returns the system information specified by cmd. The value specified for cmd should be one of the enumerated values in the enumerated type PRSysInfo .

The buffer is allocated by the caller and should be at least SYS_INFO_BUFFER_LENGTH bytes in length. Upon a successful return the system information is contained in a null terminated string in buf.

PR_GetPageSize

Return the number of bytes in a page on the system.
Syntax
#include <prsystem.h>

PRInt32 PR_GetPageSize(void);
Description
PR_GetPageSize returns the number of bytes in a page on the system

PR_GetPageShift

Return the log2 of the size of a page on the system.
Syntax
#include <prsystem.h>

PRInt32 PR_GetPageShift(void);
Description
PR_GetPageShift returns the log2 value of the number of bytes in a page on the system

[Contents] [Previous] [Next] [Last]
Last Updated: Tue Jul 14 17:13:50 PDT 1998 
Copyright © 1998 Netscape Communications Corporation



Copyright © 1998 The Mozilla Organization.