Re: Does Linux has File Stream mapping support...?

From: Dick Streefland
Date: Fri Nov 18 2005 - 09:39:21 EST


Bas Westerbaan <bas.westerbaan@xxxxxxxxx> wrote:
| Or you could - more cleanly - do a replace through all your source
| files (with an editor or a tool) which replaces printf with log (or
| something similar) and implement that function with the code to write
| to the log file and to stdout.

Simpler, but somewhat uglier, is to define a macro in one of your
header files (to be included after <stdio.h>):

#define printf(fmt, ...) { printf(fmt, ## __VA_ARGS__); fprintf(log_fp, fmt, ## __VA_ARGS__); }

--
Dick Streefland //// Altium BV
dick.streefland@xxxxxxxxx (@ @) http://www.altium.com
--------------------------------oOO--(_)--OOo---------------------------

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/