BEA Logo BEA Tuxedo Release 8.0

  BEA Home  |  Events  |  Solutions  |  Partners  |  Products  |  Services  |  Download  |  Developer Center  |  WebSUPPORT

 

   Tuxedo Documentation   |   C Function Reference   |   Local Topics   |   Previous Topic   |   Next Topic   |   Contents

 


tpgetctxt(3c)

Name

tpgetctxt()—Retrieves a context identifier for the current application association.

Synopsis

#include <atmi.h>
int tpgetctxt(TPCONTEXT_T *context, long flags)

Description

tpgetctxt() retrieves an identifier that represents the current application context and places that identifier in context. This function operates on a per-thread basis in a multithreaded environment, and on a per-process basis in a non-threaded environment.

Typically, a thread:

  1. Calls tpinit()

  2. Calls tpgetctxt()

  3. Handles the value of context as follows:

The second argument, flags, is not currently used and must be set to 0.

tpgetctxt() may be called in single-context applications as well as in multicontext applications.

A thread in a multithreaded application may issue a call to tpgetctxt() while running in any context state, including TPINVALIDCONTEXT.

Return Values

Upon successful completion, tpgetctxt() returns a non-negative value. Context is set to the current context ID, which may be represented by any of the following:

Upon failure, tpgetctxt() returns a value of -1 and sets tperrno to indicate the error condition.

Errors

Upon failure, tpgetctxt() sets tperrno to one of the following values:

[TPEINVAL]

Invalid arguments have been given. For example, the value of context is NULL or the value of flags is not 0.

[TPESYSTEM]

A BEA Tuxedo system error has occurred. The exact nature of the error has been written to a log file.

[TPEOS]

An operating system error has occurred.

See Also

Introduction to the C Language Application-to-Transaction Monitor Interface, tpsetctxt(3c), tpterm(3c)

 

back to top previous page next page