Passing a File Descriptor Using send_exit_file() or send_exit_file_c()

Use the send_exit_file() or send_exit_file_c() function to pass a file descriptor from one Process to another Process. Following is the format of send_exit_file():

int send_exit_file int  exit_flag
	int fd

Following are the parameters for send_exit_file() or send_exit_file_c():

Parameter Description Value
exit_flag A flag to specify the sender ID. The only valid value a user exit program can use is EXIT_PROGRAM. EXIT_PROGRAM
fd The file descriptor of a file that the user exit program opened in the place of IBM® Connect:Direct®, similar to one returned by the open(2) function. File descriptor

The send_exit_file() or send_exit_file_c() function calls have the following return codes. Return codes for the function are defined in ndmapi.h.

Header Header
GOOD_RC

The file descriptor was received successfully.

ERROR_RC

An error occurred and the file descriptor was not sent successfully. Possible causes include: IBM Connect:Direct terminated, an invalid value used for the exit_flag or fd parameters, or the last message sent was not send_exit_msg.