OS-3195

rt_sigqueueinfo system call needs emulation in lx brand

Status:
Resolved
Resolution:
Fixed
Created:
2014-07-09T17:12:16.000-0400
Updated:
2019-08-28T20:29:34.174-0400

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 (1)

Former user commented on 2014-07-28T20:48:02.000-0400:

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

OS-3195#icft=OS-3195 rt_sigqueueinfo system call needs emulation in lx brand