libgloss/arm: monitor_stderr [PATCH]

Nick Clifton nickc@redhat.com
Fri Aug 5 08:25:00 GMT 2005


Hi Shaun,

> 2005-08-04  Shaun Jackman  <sjackman@gmail.com>
> 
> 	* libgloss/syscalls.c (initialise_monitor_handles): Set
> 	monitor_stdout to the result of SWI_open(":tt", "a")
> 	instead of simply duplicating stdout.

Assuming that nobody from the kernel world has a problem with this, then 
I would have no problem recommending that Jeff accepts it - with one 
proviso however:

> +  block[0] = (int) ":tt";
> +  block[2] = 3;     /* length of filename */
> +  block[1] = 8;     /* mode "a" */
> +  monitor_stderr = do_AngelSWI (AngelSWI_Reason_Open, (void *) block);

I think that you ought to add a comment to the code explaining the 
situation (ie opening the same file name with different modes in order 
to allow the kernel to choose whether to use one or two file 
descriptors).  Otherwise future programmers might come along and think 
that this is a bug.

Cheers
   Nick




More information about the Newlib mailing list