Deleted Added
1
2/*
3 * Copyright (C) NGINX, Inc.
4 */
5
6#include "nxt_main.h"
7#include "nxt_port_memory_int.h"
8#include "nxt_socket_msg.h"

--- 3799 unchanged lines hidden (view full) ---

3808 return NULL;
3809}
3810
3811
3812static int
3813nxt_unit_shm_open(nxt_unit_ctx_t *ctx, size_t size)
3814{
3815 int fd;
3816 nxt_unit_impl_t *lib;
3817
3818 lib = nxt_container_of(ctx->unit, nxt_unit_impl_t, unit);
3819
3820#if (NXT_HAVE_MEMFD_CREATE || NXT_HAVE_SHM_OPEN)
3821 char name[64];
3822
3823 snprintf(name, sizeof(name), NXT_SHM_PREFIX "unit.%d.%p",
3824 lib->pid, (void *) (uintptr_t) pthread_self());
3825#endif
3826
3827#if (NXT_HAVE_MEMFD_CREATE)
3828
3829 fd = syscall(SYS_memfd_create, name, MFD_CLOEXEC);
3830 if (nxt_slow_path(fd == -1)) {

--- 2959 unchanged lines hidden ---