Solved

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

Posted on 2009-07-04
4
707 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Windows 7 does not have the best desktop search built in. This is something Windows 7 users have struggled with. You type something in, and your search results don’t always match what you are looking for, or it doesn’t actually work at all. There ar…
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.

630 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