Camera Link PCI Express (PCIe) Gen1 Framegrabbers
Appendix D: VxWorks
EDT, Inc.
2012 March 16
37
#else
int main(int argc, char **argv)
#endif
{
#ifdef NO_MAIN
char **argv = 0 ;
int argc = 0 ;
opt_create_argv("xtest",command_line,&argc,&argv);
#endif
The rest of the code in the
xtest.c
file deals with
argv
and
argc
and works the same on VxWorks as
Note also these other portability issues:
•
Stack size is set by the user; it does not grow automatically as it would in other operating systems.
•
To prevent namespace conflicts, application functions should be declared static.
•
Global variables should not be used; if they are used, declare them static.
Any globals and statics will have correct values only the first time the program is run; after that, the variables
are still present and if nothing resets them, problems will occur when the program runs again.
Example: If global
init_done = 0
and
my_prog()
sets the global
init_done = 1,
then next time the
program is run,
init_done
will be 1. Thus,
my_prog()
should reset
init_done = 0
right before exit.