Open a configuration file
Synopsis:
#include <cfgopen.h>
FILE * fcfgopen( const char * path,
const char * mode,
int location,
const char * historical,
char * namebuf,
int nblen );
Arguments:
- path
- The name of the configuration file that you want to open.
- mode
- A string that describes the mode to open in; see
fopen().
- location
- Flags that describe how the path is constructed.
See
Search condition flags
in the documentation for cfgopen().
- historical
- A optional file to open as a last resort if none of the criteria for finding the path is met.
This string works like a path search order, and lets you search more than one location.
You can also specify %H to substitute the hostname value into the string.
Specify NULL to ignore this option.
- namebuf
- A buffer to save the pathname in.
Specify NULL to ignore this option.
- nblen
- The length of the buffer pointed to by namebuf.
Specify 0 to ignore this option.
Library:
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
Note:
This function is in libc.a, but not in libc.so
(in order to save space).
Description:
The fcfgopen() function is similar to
cfgopen()
with these exceptions:
- The CFGFILE_NOFD flag isn't valid.
- The values for flags described in
open()
aren't valid.
Returns:
A valid fd if CFGFILE_NOFD isn't specified,
a nonnegative value if CFGFILE_NOFD is specified,
or -1 if an error occurs.
Classification:
QNX Neutrino
Safety: |
|
Cancellation point |
Yes |
Interrupt handler |
No |
Signal handler |
Yes |
Thread |
Yes |