LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   thread specific stdin,file descriptors (https://www.linuxquestions.org/questions/linux-general-1/thread-specific-stdin-file-descriptors-310304/)

node047 04-06-2005 06:46 AM

thread specific stdin,file descriptors
 
can anyone pl tell me how to set different file descriptors values for stdin,stdout,stderr (a value other than 0,1,2) ,for a specific specific thread using its thread id.
pl help :-(
thanx

Adony 04-07-2005 09:02 PM

Well I am not sure if that it what you want but you could try duplicating those file descriptors and pass it to the threads you would need .. Take a look at man 2 dup2

node047 04-08-2005 02:03 AM

can u pl tell me hoe do i pass the fd to a thread

Adony 04-08-2005 02:12 AM

The file descriptor fd is a int so you could pass it to te function called by the thread doing simple type casting.
Taking a look at the manpage should make things clearer for you

http://www.die.net/doc/linux/man/man..._create.3.html


All times are GMT -5. The time now is 03:32 PM.