I have noticed that if I do not call exit() in the POSIX_Init() function, RTEMS 
executables will hang. Why must I call exit() to exit the POSIX_Init() function 
rather than conclude with a "return" statement?

Take for example, the psx_example3 example application in the examples-v2 
repository. The POSIX_Init() function concludes with a call to exit().
See: examples-v2/posix_api/psx_example_3/test3.c
Cmd: sparc-rtems5-run -a -leon3 psx_example_3.exe

It is less obvious in other examples in the examples-v2 repository. Take for 
example the psx_barrier_report example. The POSIX_Init() function in 
rtems_config.c concludes with "return NULL", however, upon closer inspection, 
control is transferred to the main() function in barrier_attr_report.c which 
concludes with a call to exit() and so control is never returned to the 
POSIX_Init() function (and therefore the "return NULL" statement is never 
executed).
See: examples-v2/posix_api/psx_barrier_report/barrier_attr_report.c
See: examples-v2/posix_api/psx_barrier_report/rtems_config.c
Cmd: sparc-rtems5-run -a -leon3 psx_barrier_report.exe

I am using rtems5 and the leon3 bsp + simulator.

Sincerely,
Keith

--
Keith Shearl Morgan
ISR-3, Space Data Systems
Los Alamos National Laboratory

_______________________________________________
users mailing list
users@rtems.org
http://lists.rtems.org/mailman/listinfo/users

Reply via email to