From: Takashi Iwai <tiwai@suse.de>
To: Jaroslav Kysela <perex@suse.cz>
Cc: Sebastian Kapfer <sebastian_kapfer@web.de>,
"alsa-devel@lists.sourceforge.net"
<alsa-devel@lists.sourceforge.net>,
"rankincj@yahoo.com" <rankincj@yahoo.com>
Subject: Re: [BUG] alsa-lib leaves sound device open for child processes
Date: Wed, 12 Feb 2003 12:54:40 +0100 [thread overview]
Message-ID: <s5hptpxn27z.wl@alsa2.suse.de> (raw)
In-Reply-To: <Pine.LNX.4.44.0302082051580.1141-100000@pnote.perex-int.cz>
At Sat, 8 Feb 2003 20:53:14 +0100 (CET),
Jaroslav wrote:
>
> On Sat, 8 Feb 2003, Sebastian Kapfer wrote:
>
> > On Sat, 8 Feb 2003 12:50:01 +0100 (CET)
> > Jaroslav Kysela <perex@suse.cz> wrote:
> >
> > > > All of the remaining applications should be
> > > > considering what will happen to their resources on
> > > > exec(), and I see no reason why careless programmers
> > > > should have a few of their bugs swept under the rug
> > > > for them.
> > >
> > > I fully agree here.
> >
> > Can anyone comment on exactly how an alsa-lib client app should make
> > sure that exec'd processes don't inherit file handles? I can't find a
> > way to know the FD number which alsa-lib uses. snd_pcm_file_descriptor
> > is gone. What replaced it?
>
> The applications should use snd_pcm_close() function (or related one
> snd_*_close()). Note that more complex plugins can use more file
> descriptors so the application is not able to enumerate them.
maybe it's just whipping a dead horse, but let me take this issue back
again.
there might be some situations in which you cannot call *_close()
functions. for example, if you are sharing the handle with several
threads and want to start an external program from one of the
threads.
in such a case, the only correct method is to call fcntl(CLOEXEC).
and the problem is exactly what you wrote above.
it's difficult to get fds if the plugin becomes complex.
hence, i propose to create a new function as analogy to
snd_pcm_nonblock():
int snd_pcm_set_close_at_exec(snd_pcm_t *pcm, int close);
applications need to call only this for every type of pcm.
comments please?
Takashi
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
next prev parent reply other threads:[~2003-02-12 11:54 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20030205205905.7800db0c.sebastian_kapfer@web.de>
2003-02-05 22:39 ` [BUG] alsa-lib leaves sound device open for child processes Chris Rankin
2003-02-06 14:40 ` Sebastian Kapfer
2003-02-06 23:10 ` Chris Rankin
2003-02-07 13:03 ` Paul Davis
2003-02-07 13:58 ` Chris Rankin
2003-02-07 15:22 ` Paul Davis
2003-02-07 16:13 ` Takashi Iwai
2003-02-07 19:54 ` Chris Rankin
2003-02-07 14:37 ` Sebastian Kapfer
2003-02-07 19:46 ` Chris Rankin
2003-02-08 11:50 ` Jaroslav Kysela
2003-02-08 13:55 ` Sebastian Kapfer
2003-02-08 19:45 ` Sebastian Kapfer
2003-02-08 19:53 ` Jaroslav Kysela
2003-02-12 11:54 ` Takashi Iwai [this message]
2003-02-12 12:46 ` Jaroslav Kysela
2003-02-07 19:35 Chris Rankin
-- strict thread matches above, loose matches on Subject: below --
2003-02-05 18:50 Chris Rankin
2003-02-03 22:16 Sebastian Kapfer
2003-02-05 11:20 ` Jaroslav Kysela
2003-02-05 12:42 ` Takashi Iwai
2003-02-05 13:05 ` Jaroslav Kysela
2003-02-05 13:55 ` Takashi Iwai
2003-02-05 14:03 ` Chris Rankin
2003-02-05 14:16 ` Paul Davis
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=s5hptpxn27z.wl@alsa2.suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@lists.sourceforge.net \
--cc=perex@suse.cz \
--cc=rankincj@yahoo.com \
--cc=sebastian_kapfer@web.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.