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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bas Westerbaan <[email protected]> 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
[email protected]           (@ @)          http://www.altium.com
--------------------------------oOO--(_)--OOo---------------------------

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux