Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2009-07-04
4
Medium Priority
?
713 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Many people tend to confuse the function of a virus with the one of adware, this misunderstanding of the basic of what each software is and how it operates causes users and organizations to take the wrong security measures that would protect them ag…
In a recent article here at Experts Exchange (http://www.experts-exchange.com/articles/18880/PaperPort-14-in-Windows-10-A-First-Look.html), I discussed my nine-month sandbox testing of the Windows 10 Technical Preview, specifically with respect to r…
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

705 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