print a usage message for the program
#include <stdlib.h> int print_usage( char **argv );
This function uses the exec command to run the use utility, allowing a program to cause its usage message to be displayed.
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. |
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.
#ifdef __USAGE %C This is the usage message. #endif void main( argc, argv ) int argc; char *argv[]; { print_usage( argv ); }
QNX
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |