Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getcontext(2) — HP-UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

context(5)

cdf(4)

getcontext(1)

GETCONTEXT(2)  —  HP-UX

Series 300 Diskless Only

NAME

getcontext − return the process context for context dependent file search

SYNOPSIS

int getcontext(contextbuf,length)
char *contextbuf;
int length;

DESCRIPTION

Getcontext reads the per-process context (see context(5)) into the buffer pointed to by contextbuf. The context is returned as a null-terminated string containing a blank-separated list of names. The function value returned by getcontext is the length of this string, including the null terminator.  If this string, including the null terminator, is less than length bytes, a truncated, null-terminated string of length bytes is returned.  In particular, if length is zero, only the function value is returned. 

RETURN VALUE

Upon successful completion, the length of the context string including the null terminator is returned.  Otherwise, a value of −1 is returned and errno is set to indicate the error. 

ERRORS

Getcontext may fail if the following is true:

[EFAULT]
Contextbuf points to an illegal address.  Reliable detection of this error is not guaranteed. 

EXAMPLES

In the following example getcontext is called once with a length parameter of zero to determine the size of a buffer to allocate for the context. 

int length;
char *contextbuf;

length = getcontext ((char *)0, 0);
contextbuf = malloc (length);
(void) getcontext (contextbuf, length);

AUTHOR

Getcontext was developed by HP. 

SEE ALSO

context(5), cdf(4), getcontext(1). 

Hewlett-Packard Company  —  May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026