iTP Secure WebServer System Administrator's Guide (iTPWebSvr 6.0+)
Using Common Gateway Interface (CGI) Programs
iTP Secure WebServer System Administrator’s Guide—523346-002
8-32
CGI Library
CGI_fwrite() This procedure is analogous to the write() procedure with the 
following exceptions: stdout is the only file descriptor that works 
with this procedure, and data is written to the Pathway CGI 
interface rather than to stdout.
CGI_fflush() This procedure immediately writes buffered data from a CGI 
program to a specified stream. If the stream specified is stdout or 
stderr, this procedure immediately writes any buffered data to the 
httpd process and restarts the fflush timer.
CGI_set_fflush_timer() This procedure specifies the interval at which stdout (really 
$RECEIVE simulating stdout) is flushed. To change a flush interval 
set by a call to CGI_set_fflush_timer(), the program must call 
CGI_set_fflush_timer() with seconds set to 0 (zero), and then call 
CGI_set_fflush_timer() with a nonzero value to set the new flush 
interval.
A call to this procedure supersedes the value of the 
TANDEM_CGI_SET_FFLUSH_TIMER in the server configuration.
The flush timer uses an signal handling routine that catches a 
SIGALARM signal. When the alarm signal is delivered to a 
process, it may interrupt long I/O operations, and cause an error. 
In this case, the errno variable is set to 4004 (interrupted system 
call). If you want your server to perform its own SIGALARM 
processing, set this value to 0.
Only a single alarm signal can be in effect for a process. If you 
need to implement a customized alarm function and still use the 
fflush timer, write an alarm signal handler that calls CGI_fflush() 
when appropriate.
CGI_getc() This procedure gets a character from the CGI input stream. It is 
the same as the Posix function getc(), but returns the next byte 
from the CGI input stream specified and moves the file pointer, if 
defined, ahead 1 byte in the stream.
CGI_puts() This procedure writes a string to the CGI output stream. It 
operates in the same way as its Posix equivalent.
CGI_connection_abort This stub procedure is called whenever the connection between 
the CGI server and the httpd program is broken; usually, when the 
end user at the web client stops an active data transfer prior to 
receiving all the data being sent, or when there is an internal 
timeout within the httpd server itself, in the case where a single 
connection has existed longer than its configured lifetime.
The intent of a user-coded connection abort routine is to allow for 
graceful cleanup of transactions in progress.
Table 8-6. CGI Procedures (page 2 of 3)
Procedure Description










