Added support for shm_open(SHM_ANON) extension.

This commit is contained in:
Sergey Kandaurov
2018-03-06 13:55:51 +00:00
parent 30a32c2f09
commit 4f712e3fd0
3 changed files with 47 additions and 0 deletions

View File

@@ -297,6 +297,18 @@ nxt_port_new_port_mmap(nxt_task_t *task, nxt_process_t *process,
nxt_debug(task, "memfd_create(%s): %FD", name, fd);
#elif (NXT_HAVE_SHM_OPEN_ANON)
fd = shm_open(SHM_ANON, O_RDWR, S_IRUSR | S_IWUSR);
nxt_debug(task, "shm_open(SHM_ANON): %FD", fd);
if (nxt_slow_path(fd == -1)) {
nxt_alert(task, "shm_open(SHM_ANON) failed %E", nxt_errno);
goto remove_fail;
}
#elif (NXT_HAVE_SHM_OPEN)
/* Just in case. */