Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)

Guardian Native C Library Calls (f) fopen_oss(3)
the end of the le.
When you open a le for append (that is, when the mode parameter is a or a+), it is impossible to
overwrite information already in the le. You can use the fseek() function to reposition the le
pointer to any position in the le, but when output is written to the le, the current le pointer is
ignored. All output is written at the end of the le and the le pointer is repositioned to the end
of the output.
If two separate processes open the same le for append, each process can write freely to the le
without destroying the output being written by the other. The output from the two processes is
intermixed in the order in which it is written to the le. Note that if the data is buffered, it is not
actually written until it is ushed.
When opened, a stream is fully buffered if and only if it can be determined that it does not refer
to an interactive device. The error and End-of-File indicators for the stream are cleared.
If the mode parameter is w, a, w+,ora+ and the le did not previously exist, upon successful
completion the fopen( ) function marks the st_atime, st_ctime and st_mtime elds of the le
and the st_ctime and st_mtime elds of the parent directory for update. If the mode parameter is
w or w+ and the le did previously exist, upon successful completion the fopen() function marks
the st_ctime and st_mtime elds of the le for update.
Interoperability Variants
The C run-time library supports two variants of the fopen() function: fopen_oss() and
fopen_guardian(). The variants support the unique le naming conventions and structures of the
OSS and Guardian le systems, respectively.
The header le maps calls to fopen( ) to the variant that matches the target compilation environ-
ment. The target environment is set with the systype pragma.
Explicit calls to the fopen_oss() and fopen_guardian() variants in source code are only made
when the behavior of one environment is desired from the other environment.
fopen_oss( ) is functionally identical to the fopen( ) function of the OSS environment. It is the
same as setting systype oss at compile-time. systype oss is the default setting for c89 in
the OSS environment and on UNIX workstations.
fopen_guardian() is functionally identical to the fopen( ) function of the Guardian environment.
It is the same as setting systype guardian at compile-time. systype guardian is the
default setting for the C and C++ compilers in the Guardian environment.
To use the fopen_oss() or fopen_guardian() functions, specify the _TANDEM_SOURCE
feature test macro.
RETURN VALUES
If the fopen() function succeeds, a pointer to the stream is returned.
If the fopen() function fails, a null pointer is returned, and errno is set to indicate the error.
ERRORS
If any of the following conditions occurs, the fopen() function sets errno to the value that
corresponds to the condition.
[EACCES] Search permission is denied on a component of the pathname prex; or the le
exists and the permissions specied by the mode parameter are denied; or the le
does not exist and write permission is denied for the parent directory of the le to
be created.
527192-005 Hewlett-Packard Company 231