diff options
author | John Levon <john.levon@joyent.com> | 2020-08-13 15:27:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-13 15:27:11 +0100 |
commit | e63d036fd36b5642d5e199f7d9895d8d4eda6072 (patch) | |
tree | 0c177a62e8bd3796a7b530b7520fb0a4e7d0cd56 /usr/src/uts/common | |
parent | a8ff5009e5f7ea544c79b60ea65577f19304ff0b (diff) | |
parent | 09f210323354e07890b312da9b4f5e33ae6b6df5 (diff) | |
download | illumos-joyent-sasinfo.tar.gz |
Merge branch 'master' into sasinfosasinfo
Diffstat (limited to 'usr/src/uts/common')
-rw-r--r-- | usr/src/uts/common/brand/lx/os/lx_brand.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/usr/src/uts/common/brand/lx/os/lx_brand.c b/usr/src/uts/common/brand/lx/os/lx_brand.c index c7e5351778..31bb86cce1 100644 --- a/usr/src/uts/common/brand/lx/os/lx_brand.c +++ b/usr/src/uts/common/brand/lx/os/lx_brand.c @@ -26,6 +26,7 @@ /* * Copyright 2020 Joyent, Inc. + * Copyright 2020 OmniOS Community Edition (OmniOSce) Association. */ /* @@ -1876,23 +1877,35 @@ lx_brandsys(int cmd, int64_t *rval, uintptr_t arg1, uintptr_t arg2, (void) lx_start_nfs_lockd(); return (0); - case B_BLOCK_ALL_SIGS: + case B_BLOCK_ALL_SIGS: { + uint_t result = 0; + mutex_enter(&p->p_lock); pd = ptolxproc(p); - pd->l_block_all_signals++; + /* + * This is used to block handling of all signals during vfork() + * or clone(LX_CLONE_VFORK) emulation to match Linux semantics + * and prevent the parent's signal handlers being called before + * they are properly reset. + */ + if (pd->l_block_all_signals != 0) { + result = set_errno(EAGAIN); + } else { + pd->l_block_all_signals = 1; + } mutex_exit(&p->p_lock); - return (0); + return (result); + } case B_UNBLOCK_ALL_SIGS: { - uint_t result; + uint_t result = 0; mutex_enter(&p->p_lock); pd = ptolxproc(p); if (pd->l_block_all_signals == 0) { result = set_errno(EINVAL); } else { - pd->l_block_all_signals--; - result = 0; + pd->l_block_all_signals = 0; } mutex_exit(&p->p_lock); return (result); |