LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-01-2005, 07:04 AM   #1
marri
Member
 
Registered: May 2004
Posts: 38

Rep: Reputation: 15
Using select and FD_XXX macros


hi
I want to ask one thing about the FD_xxxx (SET,CLR,ZERO) macros when doing select.
After I have defined both FD_ZERO(readfd) and FD_SET(fd, readfd) before I define the select with its appropriate parameters do I need to clear the fd set.

The question is when select is finished do I need to use the FD_CLR() macro to remove the fd from the set or doesn't it matter if I do not.

My real concern is when I repeatedly call select and never remove the fd from the set but always add it to the set (with FD_SET()) do I mess it up or doesn't it matter at all.

Hope you understand the question.
regards
Einar
 
Old 07-01-2005, 08:36 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
From "man select_tut":
Quote:
FD_CLR removes a file descriptor from the set although I can't see the use for it in a clean program.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macros In C drumstick Programming 8 11-21-2005 04:37 PM
vi editor macros sailu_mvn Linux - Software 6 10-12-2005 01:44 AM
Macros Twi7ch Linux - General 2 08-27-2005 09:37 PM
Select() did not select my socket thvo Programming 1 05-08-2005 12:20 AM
Macros in OO vs Excel sikandar Linux - Software 0 09-01-2003 12:47 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:55 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
Open Source Consulting | Domain Registration