Solved

How do I redirect the stdout to a memory buffer. Technology C,VxWorks

Posted on 2009-07-04
4
686 Views
Last Modified: 2013-11-10
I am writing a crash debug mechanism which requires me to execute the VxWorks routines like i, taskShow etc in the Exception Handler context. I would have opted to redirect the output to a file in the flash device, but this is time consuming. Is there a way in which I can redirect the output to a memory buffer.

Thanks
Ajish
0
Comment
Question by:AjishJose
  • 2
4 Comments
 
LVL 53

Expert Comment

by:Infinity08
ID: 24776459
You could use sprintf instead of printf ...
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 24776467
If you're ok with having this system dependent, and your OS has a concept of (shared) memory files (like /dev/shm in Linux), you could simply redirect stdout to such a file ...
0
 
LVL 12

Expert Comment

by:Let_Me_Be
ID: 24776545
If you want to redirect, you can use POSIX function dup/dup2. They of course won't work on Windows OS (after adding the POSIX package from Microsoft, they might, but I'm not a Windows expert).
0
 

Accepted Solution

by:
AjishJose earned 0 total points
ID: 24829530
The solution of changing printf to sprintf is ruled out as I am executing the VxWorks routines of which I dont have any contol of.
The other two also did not serve my purpose.
Eventually, pipes came to the rescue.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Line meaning 9 81
HP PC Hardware Diagnostics UEFI 11 116
Windows doesn't download updates 26 91
Problem with Filesystemobject or .NET version 3 32
I have purchased two new systems and both are now Universal Extensible Firmware Interface (UEFI) based. UEFI is replacing BIOS for the desktop PC. It is a Linux based firmware with enough robustness it can communicate with a website without loading …
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now