HP-UX SNAplus2 R7 APPC Programmer's Guide
Writing Transaction Programs
HP-UX Considerations
The address of the buffer supplied by the application to hold the returned data string.
Returned Values
The return value from the function is one of the following:
0
(zero)
The function completed successfully. The returned character string is in the buffer identified by the buffer_addr
parameter. This string is terminated by a null character (binary zero), but does not include a trailing new-line
(
\n) character.
0x20000001
APPC could not read from the supplied VCB, or could not write to the supplied data buffer.
0x20000002
The supplied data buffer is too small to hold the returned character string.
0x20000003
The dynamic link library APPCST32.DLL(on Win32 systems) or APPCSTR.DLL (on Win16 systems), which
generates the returned character strings for this function, could not be loaded.
2.5 HP-UX Considerations
UNIX
This section summarizes the information you need to consider when developing TPs for use in the HP-UX envi-
ronment.
2.5.1 Multiple Processes
If the process that issued TP_STARTED or RECEIVE_ALLOCATE then forks to create a child process, the child
process cannot use the tp_id that was returned to the parent process. It can, however, issue its own TP_STARTED
or RECEIVE_ALLOCATE to obtain its own tp_id.
Two or more instances of the same TP can run as different processes, but each instance is assigned its own tp_id.
You can write an application in which one process contains many TPs, each with its own tp_id. However, you need
to design the application carefully to avoid “deadlock” situations, in which an APPC verb cannot complete because
of the state of other conversations and TPs in the same process. This might happen if the program is waiting on one
conversation for information to be sent to it before returning some other data, and another conversation from the
same process is waiting for this data before it can send the information originally required by the first conversation.
To some extent this can be avoided by using a separate process for each TP.
2.5.2 Compiling and Linking the APPC Application
To compile and link 32–bit applications, use the following options:
+DA1.0 -I /usr/include/sna -L /opt/sna/lib -lappc -lsna -lpthread
To compile and link 64–bit applications, use the following options:
+DA2.0w -I /usr/include/sna -L /opt/sna/lib/pa20_64 -lappc -lsna -lpthread
67