Subject: Re: implementing closeall via a syscall
To: mouss <usebsd@free.fr>
From: Jason Thorpe <thorpej@wasabisystems.com>
List: tech-kern
Date: 01/07/2004 08:21:45
--Apple-Mail-29-696025166
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII; format=flowed
On Jan 7, 2004, at 1:10 AM, mouss wrote:
> for (fd=0; fd <= maxfd; fd++) {
> error = func(arg, fd);
> if (error != 0) {
> return error;
> }
> }
You probably want to do an fcntl(fd, F_GETFL) on the descriptor to
ensure the descriptor is valid before invoking the callback.
-- Jason R. Thorpe <thorpej@wasabisystems.com>
--Apple-Mail-29-696025166
content-type: application/pgp-signature; x-mac-type=70674453;
name=PGP.sig
content-description: This is a digitally signed message part
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)
iD8DBQE//DIaOpVKkaBm8XkRArkdAJ9+fiiYEBsHAUVLBCrOIMVPLL3kMQCgx7de
Gr/g6UtLcjSekoVC8GGSPj4=
=zQzb
-----END PGP SIGNATURE-----
--Apple-Mail-29-696025166--