[Previous]
[Contents]
[Next]

qnx_getids()

get the user, group and parent process IDs for a process

Synopsis:

#include <sys/psinfo.h>
#include <unistd.h>
int qnx_getids( pid_t pid, struct _psinfo2 *info );

Description:

The qnx_getids() function returns information on the process identified by pid, in the structure pointed to by info. If pid is zero, the current process is used. The information returned includes the user and group IDs, process group number and the parent process ID; it's a subset of the information returned by qnx_psinfo().

Returns:

0
Success
-1
An error occurred. errno is set to indicate the error.

Errors:

ESRCH
The pid is invalid.

Examples:

/*
 * print the parent ID of the process
 */
#include <stdio.h>
#include <sys/types.h>
#include <sys/psinfo.h>
#include <unistd.h>

void main()
  {
    struct _psinfo2 info;

    qnx_getids( 0, &info );
    printf( "My parent is %ld\n", info.ppid );
  }

Classification:

QNX

Safety:
Interrupt handler No
Signal handler Yes, but modifies errno
Thread Yes

See also:

errno, qnx_psinfo(), qnx_setids()


[Previous]
[Contents]
[Next]