On 03/25/2010 08:39 AM, Siddhesh Poyarekar wrote:
> On Thu, Mar 25, 2010 at 7:19 PM, Eric Blake <ebl...@redhat.com> wrote:
>> Technically, this is only a POSIX requirement on non-interactive shells.
>>  Interactive shells may reset ignored signals on entry, effectively
>> starting life as if nothing had been inherited ignored.  But I don't
>> know (without looking at the sources) whether bash explicitly modifies
>> inherited ignored signals in interactive shells.
> 
> Bash does not do it; ignored signals remain ignored in the subshell. I
> wanted to know if it would be possible to explicitly document it in
> the manpage or provide a non-standard extension to display signals
> that are 'not available to play with'.

Subshells are different than new shells on what POSIX requires for
signal manipulations.  Again, quoting POSIX:

"When a subshell is entered, traps that are not being ignored are set to
the default actions. This does not imply that the trap command cannot be
used within the subshell to set new traps."

That is, if a non-interactive parent inherited a signal ignored, then
neither the parent nor the subshell can change it.  But if a
non-interactive parent inherits a default signal, then explicitly
ignores it, then subshells will inherit it ignored but can still reset
it back to default.

-- 
Eric Blake   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to