LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 04-06-2005, 07:46 AM   #1
node047
LQ Newbie
 
Registered: Mar 2005
Location: india
Posts: 12

Rep: Reputation: 0
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
 
Old 04-07-2005, 10:02 PM   #2
Adony
Member
 
Registered: Apr 2004
Location: Portugal
Distribution: Gentoo 2004.2 - working on LFS 6
Posts: 126

Rep: Reputation: 15
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

Last edited by Adony; 04-07-2005 at 10:03 PM.
 
Old 04-08-2005, 03:03 AM   #3
node047
LQ Newbie
 
Registered: Mar 2005
Location: india
Posts: 12

Original Poster
Rep: Reputation: 0
can u pl tell me hoe do i pass the fd to a thread
 
Old 04-08-2005, 03:12 AM   #4
Adony
Member
 
Registered: Apr 2004
Location: Portugal
Distribution: Gentoo 2004.2 - working on LFS 6
Posts: 126

Rep: Reputation: 15
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Increasing File Descriptors Geoffrey_Firmin Slackware 5 04-21-2008 10:48 AM
Socket File Descriptors for a process MadCoder77 Linux - Networking 0 05-26-2005 05:19 PM
file descriptors node047 Linux - Newbie 1 03-29-2005 06:47 AM
unix file descriptors versus c FILE pointers nodger Programming 9 11-25-2004 08:02 AM
Poll with nonblocking file descriptors bstark Programming 1 11-03-2004 09:27 PM


All times are GMT -5. The time now is 12:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration