#include <unistd.h>
#include <string.h>
#include <limits.h>
+#include <pthread.h>
char *__strchrnul(const char *, int);
int shm_open(const char *name, int flag, mode_t mode)
{
+ int cs;
char buf[NAME_MAX+10];
if (!(name = __shm_mapname(name, buf))) return -1;
- return open(name, flag|O_NOFOLLOW|O_CLOEXEC|O_NONBLOCK, mode);
+ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs);
+ int fd = open(name, flag|O_NOFOLLOW|O_CLOEXEC|O_NONBLOCK, mode);
+ pthread_setcancelstate(cs, 0);
+ return fd;
}
int shm_unlink(const char *name)