summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_process.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/nxt_process.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nxt_process.c b/src/nxt_process.c
index d24be580..64fd1f19 100644
--- a/src/nxt_process.c
+++ b/src/nxt_process.c
@@ -506,3 +506,22 @@ nxt_user_cred_set(nxt_task_t *task, nxt_user_cred_t *uc)
return NXT_OK;
}
+
+
+nxt_port_t *
+nxt_process_port_new(nxt_process_t *process)
+{
+ nxt_port_t *port;
+
+ port = nxt_mem_cache_zalloc0(process->mem_pool, sizeof(nxt_port_t));
+ if (nxt_fast_path(port != NULL)) {
+ port->id = process->last_port_id++;
+ port->pid = process->pid;
+ port->process = process;
+
+ nxt_process_port_add(process, port);
+ }
+
+ return port;
+}
+