lkml.org 
[lkml]   [2005]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Does Linux has File Stream mapping support...?
Date
Bas Westerbaan <bas.westerbaan@gmail.com> 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@altium.nl (@ @) 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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-11-18 15:36    [W:0.035 / U:0.636 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site