Hi

I was porting some code from Linux to RTEMS. It doesn't use stdin/out,
error directly but does all debug IO to a configured file. Most of the time
when running on Linux, the device is /dev/stderr. For the RTEMS port,
I added link(/dev/console, /dev/stderr) to the init task and that worked.
But the application uses fopen(name, "w") to open the logging file.
This works on Linux. On RTEMS, this failed because "w" implies
ftruncate() and that returned -1.

I got around this by changing the logging helper to use fopen(name, "a").

I haven't done a POSIX deep dive and consulted with my POSIX contacts
yet for a strict POSIX ruling but I think we probably want the "w" to work
on RTEMS if it works on Lnux.

I can put together a test case but I would like to settle on the accepted
behavior first.

--joel
_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to