mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bernd Petrovitsch <bernd@firmix.at>
To: Ram Gupta <ram.gupta5@gmail.com>
Cc: linux mailing-list <linux-kernel@vger.kernel.org>
Subject: Re: support for limit of open file descriptors for a child process
Date: Thu, 14 Sep 2006 17:28:48 +0200	[thread overview]
Message-ID: <1158247728.24835.20.camel@tara.firmix.at> (raw)
In-Reply-To: <728201270609140821l7cf30578y2f45479b03e77f64@mail.gmail.com>

On Thu, 2006-09-14 at 10:21 -0500, Ram Gupta wrote:
> Hi,
>     I came across a problem regarding the issue of number of open
> file descriptors.The scenario is as below.
>  I have a controlling process which launches other different
> apllication including third party ones. It also enforces various
> resource limits including number of open file descriptors. This
> process forks & reads the resource limits from a configuration files,
> applies the resource limits & then execs for the corresponding
> application. The process has its own various number of open file
> descriptors. If the limit of open file descriptor for the child
> application is less than the number of file descriptors  of the parent
> process, then the child application file can not be opened & exec
> fails in this case.
> 
> I searched solution for this problem but could not find an existing
> way to solve it. I thought of couple of ways to do it. One idea is to

-) simply close(2) the superfluous file descriptors unconditionally
   before exec(2)ing the child process 
-) set the close-on-exec flag via fcntl(2) on these file descriptors
   after opening them

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services


      reply	other threads:[~2006-09-14 15:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-14 15:21 Ram Gupta
2006-09-14 15:28 ` Bernd Petrovitsch [this message]

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=1158247728.24835.20.camel@tara.firmix.at \
    --to=bernd@firmix.at \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ram.gupta5@gmail.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®