Rizin
unix-like reverse engineering framework and cli tools
pthread-fixes.c File Reference
#include "uv-common.h"
#include <errno.h>
#include <pthread.h>
#include <signal.h>

Go to the source code of this file.

Functions

int uv__pthread_sigmask (int how, const sigset_t *set, sigset_t *oset)
 

Function Documentation

◆ uv__pthread_sigmask()

int uv__pthread_sigmask ( int  how,
const sigset_t set,
sigset_t oset 
)

Definition at line 39 of file pthread-fixes.c.

39  {
40  static int workaround;
41  int err;
42 
43  if (uv__load_relaxed(&workaround)) {
44  return sigprocmask(how, set, oset);
45  } else {
46  err = pthread_sigmask(how, set, oset);
47  if (err) {
48  if (err == EINVAL && sigprocmask(how, set, oset) == 0) {
49  uv__store_relaxed(&workaround, 1);
50  return 0;
51  } else {
52  return -1;
53  }
54  }
55  }
56 
57  return 0;
58 }
static bool err
Definition: armass.c:435
#define EINVAL
Definition: sftypes.h:132
#define uv__load_relaxed(p)
Definition: uv-common.h:67
#define uv__store_relaxed(p, v)
Definition: uv-common.h:68

References EINVAL, err, uv__load_relaxed, and uv__store_relaxed.