Re: too many close calls for non-opened fds

This is a discussion on Re: too many close calls for non-opened fds within the OpenSSH Development forums, part of the Networking and Network Related category; On Wed, Aug 16, 2006 at 02:25:05PM -0700, Carson Gaspar wrote: > --On Wednesday, August 16, 2006 10:...


Go Back   Usenet Forums > Networking and Network Related > OpenSSH Development

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-16-2006
William Ahern
 
Posts: n/a
Default Re: too many close calls for non-opened fds

On Wed, Aug 16, 2006 at 02:25:05PM -0700, Carson Gaspar wrote:
> --On Wednesday, August 16, 2006 10:56 PM +0200 Markus Friedl
> <markus.r.friedl@arcor.de> wrote:
>
> > if a file is opened and the resource limit is decreased,
> > then looping to the resource limit will miss some open files.

>
> Does any UNIX variant have a "close all my open fds except for these"
> syscall? Or an easy way to get back a list of in-use fds? I really wish
> such a beast would be added, as calling close() on all possible fd numbers
> is _such_ a hack...
>


OpenBSD has closefrom(2) and AIX has an fcntl capability using F_CLOSEM. On
Linux you can read the entries in /proc/$$/fd--see
openbsd-compat/closefrom.c in the OpenSSH source--however that wouldn't work
in a chroot environment.

_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
http://lists.mindrot.org/mailman/lis...enssh-unix-dev
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:05 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0