OS-3195: rt_sigqueueinfo system call needs emulation in lx brand

Details

Issue Type:Bug
Priority:4 - Normal
Status:Resolved
Created at:2014-07-09T21:12:16.000Z
Updated at:2019-08-29T00:29:34.174Z

People

Created by:Former user
Reported by:Former user
Assigned to:Former user

Resolution

Fixed: A fix for this issue is checked into the tree and tested.
(Resolution Date: 2014-08-25T14:25:48.000Z)

Fix Versions

2014-08-21 Voltron (Release Date: 2014-08-21)

Labels

lxbrand

Description

adding the flag SA_SIGNFO as a flag to sigaction causes signals to not be delivered for the specified signal because rt_sigqueueinfo isn't implemented. Here's an example.

#define _GNU_SOURCE
#include <sched.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <errno.h>

void *handler(int arg, siginfo_t *in, void *a) 
{
  printf("signal receieved %d\n", arg);
  return 0;
}

int main(void)
{
  struct sigaction act;
  memset(&act, 0, sizeof(struct sigaction));
  act.sa_handler = (void (*)(int))handler;
  act.sa_flags = SA_SIGINFO;
  sigaction(SIGTERM, &act, NULL);
  union sigval s2; 
  s2.sival_int = 0;
  sigqueue(getpid(), SIGTERM, s2);
  return 0;

}

Here is a snippet of this program as it ran in an lx zone under strace:

rt_sigaction(SIGTERM, {0x804855c, [], SA_RESTORER|SA_SIGINFO, 0xfece2f30}, NULL, 8) = 0
getuid32()                              = 0
rt_sigqueueinfo(99472, SIGTERM, {si_signo=SIGTERM, si_code=SI_QUEUE, si_pid=99472, si_uid=0, si_value={int=0, ptr=0}}) = -1 ENOSYS (Function not implemented)

As we can see, the rt_sigqueueinfo function needs to be implemented.

This also causes sigqueue to fail as it uses this system call as well.

Comments

Comment by Former user
Created at 2014-07-29T00:48:02.000Z

illumos-joyent commit d4f2394 (branch master, by DJ Hoffman)

OS-3195 rt_sigqueueinfo system call needs emulation in lx brand