Updated: 11 December 1998 |
OpenVMS System Services Reference Manual
Previous | Contents | Index |
Because this number is a quadword, the buffer length field in the item descriptor should specify 8 (bytes).
Because this number is a quadword, the buffer length field in the item descriptor should specify 8 (bytes).
Because this number is a quadword, the buffer length field in the item descriptor should specify 8 (bytes).
You can use the process index number as an index into system global sections. Because the process index number is unique for each process, its use as an index into system global sections guarantees no collisions with other system processes accessing those sections.
The process index is intended to serve users who formerly used the low-order word of the PID as an index number.
State | Description |
---|---|
SCH$C_CEF | Common event flag wait |
SCH$C_COM | Computable |
SCH$C_COMO | Computable, out of balance set |
SCH$C_CUR | Current process |
SCH$C_COLPG | Collided page wait |
SCH$C_FPG | Free page wait |
SCH$C_HIB | Hibernate wait |
SCH$C_HIBO | Hibernate wait, out of balance set |
SCH$C_LEF | Local event flag wait |
SCH$C_LEFO | Local event flag wait, out of balance set |
SCH$C_MWAIT | Mutex and miscellaneous resource wait |
SCH$C_PFW | Page fault wait |
SCH$C_SUSP | Suspended |
SCH$C_SUSPO | Suspended, out of balance set |
Symbol | Description |
---|---|
PCB$V_ASTPEN | AST pending |
PCB$V_BATCH | Process is a batch job |
PCB$V_DELPEN | Delete pending |
PCB$V_DISAWS | Disable automatic working set adjustment |
PCB$V_FORCPEN | Force exit pending |
PCB$V_HARDAFF | Process bound to a particular CPU |
PCB$V_HIBER | Hibernate after initial image activate |
PCB$V_INQUAN | Initial quantum in progress |
PCB$V_INTER | Process is an interactive job |
PCB$V_LOGIN | Log in without reading authorization file |
PCB$V_NETWRK | Process is a network connect object |
PCB$V_NOACNT | No accounting for process |
PCB$V_NODELET | No delete |
PCB$V_PHDRES | Process header resident |
PCB$V_PREEMPTED | Kernel mode suspend has overridden supervisor mode suspend |
PCB$V_PSWAPM | Process swap mode (1=noswap) |
PCB$V_PWRAST | Power fail AST |
PCB$V_RECOVER | Process can recover locks |
PCB$V_RES | Resident, in balance set |
PCB$V_RESPEN | Resume pending, skip suspend |
PCB$V_SECAUDIT | Mandatory security auditing |
PCB$V_SOFTSUSP | Process is in supervisor mode suspend |
PCB$V_SSFEXC | System service exception enable (kernel) |
PCB$V_SSFEXCE | System service exception enable (exec) |
PCB$V_SSFEXCS | System service exception enable (super) |
PCB$V_SSFEXCU | System service exception enable (user) |
PCB$V_SSRWAIT | System service resource wait disable |
PCB$V_SUSPEN | Suspend pending |
PCB$V_WAKEPEN | Wake pending, skip hibernate |
PCB$V_WALL | Wait for all events in mask |
Symbol | Description |
---|---|
PCB$V_NOUNSHELVE | Process does not automatically unshelve files. |
On VAX systems, the value returned is a longword integer. On Alpha systems, the value returned requires a quadword of storage. If the buffer size supplied is not equal to 8 bytes, and the virtual peak exceeds the maximum value that can be represented in a longword, $GETJPI returns the largest positive 32-bit integer: 2147483647.
The Get Job/Process Information service returns information about one or more processes on the system or across the cluster. Using $GETJPI with $PROCESS_SCAN, you can perform selective or clusterwide searches.Getting information about another process is an asynchronous operation because the information might be contained in the virtual address space of the target process, and that process might be running at a lower priority, be outswapped, or be suspended in a miscellaneous or resource wait state. To allow your program to overlap other functions with the time needed to access the data in the other process, $GETJPI returns immediately after it has queued its information-gathering request to the other process. You can use the JPI$_GETJPI item code to control the processing of the $GETJPI call and the information-gathering interprocess request itself.
When performing an asynchronous system service call such as $GETJPI, the specifications of the iosb argument and a unique event flag are used in conjunction with mechanisms such as the $SYNCH system service to synchronize the final completion of the asynchronous system service call.
The calling process must have GROUP privilege to obtain information about other processes with the same group UIC number as the calling process. The calling process must have WORLD privilege to obtain information about other processes on the system that are not in the same group as the calling process.
None
$GETJPIW, $HIBER, $PROCESS_SCAN, $RESUME, $SYNCH
SS$_NORMAL The service completed successfully. SS$_ACCVIO The item list cannot be read by the caller, or the buffer length or buffer cannot be written by the caller. SS$_BADPARAM The item list contains an invalid identifier. Or, an item list containing both 32-bit and 64-bit item list entries was found. SS$_INCOMPAT The remote node is running an incompatible version of the operating system. SS$_IVLOGNAM The process name string has a length of 0 or has more than 15 characters. SS$_NOMOREPROC In a wildcard operation, $GETJPI found no more processes. SS$_NONEXPR The specified process does not exist, or an invalid process identification was specified. SS$_NOPRIV The process does not have the privilege to obtain information about the specified process. SS$_NOSUCHNODE The specified node is not currently a member of the cluster. SS$_REMRSRC The remote node has insufficient resources to respond to the request. (Bring this error to the attention of your system manager.) SS$_SUSPENDED The specified process is suspended or in a miscellaneous wait state, and the requested information cannot be obtained. SS$_UNREACHABLE The remote node is a member of the cluster but is not accepting requests. This is normal for a brief period early in the system boot process.
Same as those returned in R0.
*/ /* Defining __NEW_STARLET enables the program to benefit from better type checking for prototypes and structures provided by OpenVMS. */ #define __NEW_STARLET 1 #include <efndef> /* No Event Flag Event Flag */ #include <iledef> /* Item List Entry Definitions */ #include <iosbdef> /* I/O Status Block Structure Definition */ #include <jpidef> /* $GETJPI Item Code Definitions */ #include <ssdef> /* SS Message Codes */ #include <starlet> /* Function Prototypes for System Services */ #include <stdio> /* C Standard I/O Functions */ #include <string> /* MEMSET Prototype */ #include <stsdef> /* Status Block Definitions */ #define NUM_ILE 5 #define NAME_LENGTH 16 #define IMAGE_LENGTH 255 /* Macro to initialize a 32-bit item_list_3. */ #define init_ile32(ile, length, code, bufaddr, retlen_addr) \ { (ile)->ile3$w_length = (length); \ (ile)->ile3$w_code = (code); \ (ile)->ile3$ps_bufaddr = (bufaddr); \ (ile)->ile3$ps_retlen_addr = (retlen_addr); } main () { char imagename [IMAGE_LENGTH], procname [NAME_LENGTH], username [NAME_LENGTH]; int count = 0, retpid, status; unsigned int pid = -1; unsigned short imagename_length, procname_length, username_length; ILE3 jpi_ile [NUM_ILE]; IOSB iosb; /* Zeroing the item list has the effect of creating the terminating entry. */ memset (jpi_ile, 0, ILE3$K_LENGTH*NUM_ILE); /* Initialize the item list entries to fetch the user name, the process name, the image name and the PID. */ init_ile32 ( &jpi_ile [0], NAME_LENGTH, JPI$_USERNAME, username, &username_length); init_ile32 ( &jpi_ile [1], NAME_LENGTH, JPI$_PRCNAM, procname, &procname_length); init_ile32 ( &jpi_ile [2], IMAGE_LENGTH, JPI$_IMAGNAME, imagename, &imagename_length); init_ile32 ( &jpi_ile [3], sizeof (int), JPI$_PID, &retpid, NULL); /* Initial wildcard $GETJPI. */ status = sys$getjpiw ( EFN$C_ENF, &pid, NULL, &jpi_ile, &iosb, NULL, 0); /* Loop for all processes on this node. */ while (status != SS$_NOMOREPROC) { if (status & STS$M_SUCCESS) { /* Zero terminate process and image name strings. */ imagename [imagename_length] = '\0'; username [username_length] = '\0'; procname [procname_length] = '\0'; /* Print header if this is the first. */ if (count == 0) printf (" PID User Name Process Name Image\n"); /* Count process and print process data. */ count++; printf ("%08X %-15s %-15s %s\n", retpid, username, procname, imagename); } /* Skip process if suspended or no privilege to see process. Return any other error. */ else if ((status != SS$_NOPRIV) && (status != SS$_SUSPENDED)) return (status); /* Find next process. */ status = sys$getjpiw ( EFN$C_ENF, &pid, NULL, &jpi_ile, &iosb, NULL, 0); } return (SS$_NORMAL); } |
This example C program demonstrates how to use $GETJPIW to obtain the PID, process name, and current image being executed for every process for which the caller has the privilege to obtain information.
Previous | Next | Contents | Index |
Copyright © Compaq Computer Corporation 1998. All rights reserved. Legal |
4527PRO_044.HTML
|