This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] jmpbuf: Add paddings for target specific usage


On 11/14/2017 02:10 PM, H.J. Lu wrote:
+static int
+do_test (void)
+{
+  sigjmp_buf sj;
+  struct support_next_to_fault sigset_t_buf
+    = support_next_to_fault_allocate (SIZEOF_SIGSET_T);
+  sigset_t *m_p = (sigset_t *) sigset_t_buf.buffer;
+  sigset_t m;
+
+  sigemptyset (&m);
+  memcpy (m_p, &m, SIZEOF_SIGSET_T);
+  sigprocmask (SIG_SETMASK, m_p, NULL);
+  memcpy (&m, m_p, SIZEOF_SIGSET_T);
+  if (sigsetjmp (sj, 0) == 0)
+    {
+      sigaddset (&m, SIGUSR1);
+      memcpy (m_p, &m, SIZEOF_SIGSET_T);
+      sigprocmask (SIG_SETMASK, m_p, NULL);
+      memcpy (&m, m_p, SIZEOF_SIGSET_T);
+      siglongjmp (sj, 1);
+      return EXIT_FAILURE;
+    }
+  sigprocmask (SIG_SETMASK, NULL, m_p);
+  memcpy (&m, m_p, SIZEOF_SIGSET_T);
+  return sigismember (&m, SIGUSR1) ? EXIT_SUCCESS : EXIT_FAILURE;
+}

Sorry, I don't understand anymore what this test is supposed to test and how.

To be honest, I don't like how you inject the internal definition of jmp_buf. Is this the way we do it for the nptl types?

I think you should check _JUMP_BUF_SIGSET_NSIG against a kernel constant (_NSIGS?) somewhere.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]