[Previous]
[Contents]
[Next]

print_usage()

print a usage message for the program

Synopsis:

#include <stdlib.h>
int print_usage( char **argv );

Description:

This function uses the exec command to run the use utility, allowing a program to cause its usage message to be displayed.


Caution: This function uses exec to turn itself into the use program. This may pose a security problem if use has been changed to a program other than the standard utility shipped by QNX Software Systems. It can be especially dangerous if that other program is a setuid program.

Returns:

If successful, the print_usage() function doesn't return, since the exec command is used to run the use utility. If an error occurs, a message is printed, and zero is returned.

Examples:

#ifdef __USAGE
%C    This is the usage message.
#endif

void main( argc, argv )
int    argc;
char    *argv[];
  {
    print_usage( argv );
  }

Classification:

QNX

Safety:
Interrupt handler No
Signal handler No
Thread Yes

[Previous]
[Contents]
[Next]