Stdio.h printf fprintf


Does anyone know how the stdio print fprinf could be used with OAT?

Many thanks in advance



I would just sprintf() to a buffer, and then output the buffer in whatever way is required…


Thanks - but my aim is to reuse code which uses printf , fprintf a lot

I don’t want to change the original code as it would mean creating an unnecessary fork

The code builds and runs fine

But I would like to be able get output from OAT from calls to these (stdio) functions - my ideas are either replace the standard code with something else or add some code to the existing library. Any ideas how to do this?

Kind regards



The answer is to :
#define _SYS_UNISTD_H // remove unistd.h
#define _SYS_TYPES_H
#define STDIO_H // remove stdio.h
#define _SYS_STAT_H // remove stat.h
#define SYS__DEFAULT_FCNTL_H // remove default_fcntl.h

and then create a new printf and fprintf as required

Thanks for all the help :laughing: