mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: DervishD <raul@pleyades.net>
To: "Richard B. Johnson" <root@chaos.analogic.com>
Cc: "Sparks, Jamie" <JAMIE.SPARKS@cubic.com>,
	Linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: select() stress
Date: Tue, 18 Mar 2003 15:46:32 +0100	[thread overview]
Message-ID: <20030318144632.GB1438@DervishD> (raw)
In-Reply-To: <Pine.LNX.4.53.0303180758380.26753@chaos>

    Hi Richard, again :)

    In my last message I told you that getdtablesize() is not
reliable for closing all file descriptors, that its return value is
not necessarily related to the file descriptor index. Well, I forgot
to say that getdtablehi() effectively returns the index for the
largest file descriptor available to the process plus one, that is,
perfect for using with 'select()' and for closing all open files:

    for(i=0; i<getdtablehi(); i++) close(i);

    Is this implemented under Linux? I have a piece of software that
relies on the above (now it's written using getdtablesize(), which is
non-correct as you noted) for closing all file descriptors...

    Thanks again for noting this, Richard :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.pleyades.net & http://www.pleyades.net/~raulnac

  parent reply	other threads:[~2003-03-18 14:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-17 15:28 Sparks, Jamie
2003-03-17 15:43 ` Matti Aarnio
2003-03-17 16:15 ` Richard B. Johnson
2003-03-17 18:00   ` Miquel van Smoorenburg
2003-03-17 18:24   ` Olaf Titz
2003-03-18 10:28   ` DervishD
2003-03-18 13:06     ` Richard B. Johnson
2003-03-18 14:42       ` DervishD
2003-03-18 14:46       ` DervishD [this message]
2003-03-18 14:49 Sparks, Jamie
2003-03-18 15:05 ` Richard B. Johnson
2003-03-18 15:05   ` Sparks, Jamie
2003-03-19  4:18     ` Chris Friesen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030318144632.GB1438@DervishD \
    --to=raul@pleyades.net \
    --cc=JAMIE.SPARKS@cubic.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=root@chaos.analogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®