Solved

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

Posted on 2009-07-04
4
703 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
Great sound, comfort and fit, excellent build quality, versatility, compatibility. These are just some of the many reasons for choosing a headset from Sennheiser.
The goal of this video is to provide viewers with basic examples to understand opening and reading files 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.

710 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