]> sourceware.org Git - newlib-cygwin.git/commitdiff
Export XSI sigpause
authorYaakov Selkowitz <yselkowi@redhat.com>
Wed, 14 Jun 2017 15:20:05 +0000 (10:20 -0500)
committerYaakov Selkowitz <yselkowi@redhat.com>
Wed, 14 Jun 2017 19:23:52 +0000 (14:23 -0500)
There are two common sigpause variants, both of which take an int argument.
If you request _XOPEN_SOURCE or _GNU_SOURCE, you get the System V version,
which removes the given signal from the process's signal mask; otherwise
you get the BSD version, which sets the process's signal mask to the given
value.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
newlib/libc/include/sys/signal.h
winsup/cygwin/common.din
winsup/cygwin/include/cygwin/version.h
winsup/cygwin/signal.cc
winsup/doc/posix.xml

index a56f18a1b33507c5338b785a3bd45578c2f5d74e..da064cd5f1fde0f53cd834d3677b9abe9f21fa15 100644 (file)
@@ -200,7 +200,19 @@ int _EXFUN(sigwait, (const sigset_t *set, int *sig));
 #endif /* !__CYGWIN__ && !__rtems__ */
 #endif /* __POSIX_VISIBLE */
 
-#if __BSD_VISIBLE
+/* There are two common sigpause variants, both of which take an int argument.
+   If you request _XOPEN_SOURCE or _GNU_SOURCE, you get the System V version,
+   which removes the given signal from the process's signal mask; otherwise
+   you get the BSD version, which sets the process's signal mask to the given
+   value. */
+#if __XSI_VISIBLE && !defined(__INSIDE_CYGWIN__)
+# ifdef __GNUC__
+int _EXFUN(sigpause, (int)) __asm__ (__ASMNAME ("__xpg_sigpause"));
+# else
+int _EXFUN(__xpg_sigpause, (int));
+#  define sigpause __xpg_sigpause
+# endif
+#elif __BSD_VISIBLE
 int _EXFUN(sigpause, (int));
 #endif
 
index 6620700c2cf21a9035959838e6dca2a0d712f9b2..75fe05c1f3a58f88f8c64193175249f7cf258bdd 100644 (file)
@@ -102,6 +102,7 @@ __wrap__ZdlPv NOSIGFE               # void operator delete(void *p) throw()
 __wrap__ZdlPvRKSt9nothrow_t NOSIGFE # void operator delete(void *p, const std::nothrow_t &nt) throw()
 __xdrrec_getrec SIGFE
 __xdrrec_setnonblock SIGFE
+__xpg_sigpause SIGFE
 __xpg_strerror_r SIGFE
 _exit SIGFE
 _feinitialise NOSIGFE
index 7baca61585ecc88c5446d98e1bcbbb8e99d47200..c0254a8e0a40d09a2913169a086067c15ff5d591 100644 (file)
@@ -475,12 +475,13 @@ details. */
   308: Export dladdr.
   309: Export getloadavg.
   310: Export reallocarray.
+  311: Export __xpg_sigpause.
 
   Note that we forgot to bump the api for ualarm, strtoll, strtoull,
   sigaltstack, sethostname. */
 
 #define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 310
+#define CYGWIN_VERSION_API_MINOR 311
 
 /* There is also a compatibity version number associated with the shared memory
    regions.  It is incremented when incompatible changes are made to the shared
index f371a231bbac9a2e367ec8e31cd9b8c8e1c57318..fbd2b241e9f987d8338a0d62ffec6814275fb64d 100644 (file)
@@ -523,6 +523,18 @@ sigpause (int signal_mask)
   return res;
 }
 
+extern "C" int
+__xpg_sigpause (int sig)
+{
+  int res;
+  sigset_t signal_mask;
+  sigprocmask (0, NULL, &signal_mask);
+  sigdelset (&signal_mask, sig);
+  res = handle_sigsuspend (signal_mask);
+  syscall_printf ("%R = __xpg_sigpause(%y)", res, sig);
+  return res;
+}
+
 extern "C" int
 pause (void)
 {
index 5c9f65637bae5ba1ae87846782cc51797fe7c5de..ced7e383db7f27d1b49a17e49c06bc91c54c1a4d 100644 (file)
@@ -877,7 +877,7 @@ also IEEE Std 1003.1-2008 (POSIX.1-2008).</para>
     signal
     signbit                    (see chapter "Implementation Notes")
     signgam
-    sigpause
+    sigpause                   (see chapter "Implementation Notes")
     sigpending
     sigprocmask
     sigqueue
@@ -925,7 +925,7 @@ also IEEE Std 1003.1-2008 (POSIX.1-2008).</para>
     strdup
     strerror
     strerror_l
-    strerror_r
+    strerror_r                 (see chapter "Implementation Notes")
     strfmon
     strfmon_l
     strftime
@@ -1668,6 +1668,12 @@ depending on whether _BSD_SOURCE or _GNU_SOURCE is defined when compiling.</para
 <para><function>basename</function> is available in both POSIX and GNU flavors,
 depending on whether libgen.h is included or not.</para>
 
+<para><function>sigpause</function> is available in both BSD and SysV/XSI
+flavors, depending on whether _XOPEN_SOURCE is defined when compiling.</para>
+
+<para><function>strerror_r</function> is available in both POSIX and GNU
+flavors, depending on whether _GNU_SOURCE is defined when compiling.</para>
+
 <para><function>dladdr</function> always sets the Dl_info members dli_sname and
 dli_saddr to NULL, indicating no symbol matching addr could be found.</para>
 
This page took 0.046506 seconds and 5 git commands to generate.