01-25-2011
Thanks so much Perderabo.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I want to implement my own simple multi tasking shell in Unix which will take care of redirection (<, >, >>) and piping.
I am just unable to get a concrete idea of how exactly I have to start. I have several books...some are..
1. Maurice Bach- Design Of Unix Operating System
2. Richard... (3 Replies)
Discussion started by: clickonline1
3 Replies
2. Programming
I'm having difficulty understanding the purposes of using dup/dup2 when involving forks.
for example, if we call fork() once, that is, we are creating a child process. In what cases would we need to use dup or dup2 to duplicate the file descriptors for standard output and standard error? What... (1 Reply)
Discussion started by: Yifan_Guo
1 Replies
3. Programming
Hi,
i have in one program such a pice of code
................
static int old_stderr_handle = -1;
static int old_stdout_handle = -1;
log_handle = open(log_file_name,O_CREAT|O_RDWR,932);
old_stderr_handle = dup(STDERR_FILENO);
if (dup2(log_handle,STDERR_FILENO) < 0)
{
//... (1 Reply)
Discussion started by: vovan
1 Replies
4. UNIX for Advanced & Expert Users
int redirect()
{
int fd,rc;
fd = open("sample.DAT",O_CREAT | O_RDWR , 00777 );
rc = dup2(fd , 1 ) ;
close (fd );
return 0;
}
I used the above to redirect all the cout statements to sample.DAT. process is redirecting the output and I had two questions
1. All stdout/cout statements... (2 Replies)
Discussion started by: satish@123
2 Replies
5. UNIX for Advanced & Expert Users
Hey Guys
Some of my friends have got together and we are trying to write a basic kernel similar to Linux. I am trying to implement the malloc function in C and I am using a doubly linked list as the primary data structure. I need to allocate memory for this link list (duh...) and I don't feel... (2 Replies)
Discussion started by: rbansal2
2 Replies
6. Linux
Hi
I'm trying to implement CAPWAP protocol for my application.i'm able to configure my server side but i'm getting error at client(WTP) side as IOCTL error.while running the command
#./WTP /mnt/cf/capwap/
: wlan2
Starting WTP...
# WTP Loads... (0 Replies)
Discussion started by: ran789
0 Replies
7. UNIX for Dummies Questions & Answers
Hi everybody,
i've been googling for ages now and gotten kinda desperate... The question, however, might be rather trivial for the experts: What is it exactly, i.e. physically, the POSIX function (for a file) "lseek" does? Does it trigger some kind of synchronization on disk? Is it just for the... (4 Replies)
Discussion started by: Humudituu
4 Replies
8. UNIX for Advanced & Expert Users
is it possible to duplicate file descriptors(opened by a different process) with the help of dup or dup2. the two process do not share parent child relationship as well. (2 Replies)
Discussion started by: replytoshishir
2 Replies
9. Shell Programming and Scripting
I want to execute metasploit by two pipes to communicate with it, but I have troubles with that communication. When I run my program, I get this error: "stty: standard input: Inappropriate ioctl for device" and I don't receive the metasploit promt.
just select an exploit.
This is my code:... (2 Replies)
Discussion started by: dano88
2 Replies
10. Programming
What this code should do is: there are parent.cpp and child.cpp. Parent will send whatever is in the buffer to child and child will send back whatever received to parent. I do not know what I am doing wrong. I am confused what is missing in the parent and what else I should include into the child.... (1 Reply)
Discussion started by: ramono
1 Replies