File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- /* $NetBSD: pthread_atfork.c,v 1.20 2025/02/28 23:59:55 kre Exp $ */
1+ /* $NetBSD: pthread_atfork.c,v 1.21 2025/03/01 16:34:03 christos Exp $ */
22
33/*-
44 * Copyright (c) 2002 The NetBSD Foundation, Inc.
3131
3232#include <sys/cdefs.h>
3333#if defined(LIBC_SCCS ) && !defined(lint )
34- __RCSID ("$NetBSD: pthread_atfork.c,v 1.20 2025/02/28 23:59:55 kre Exp $" );
34+ __RCSID ("$NetBSD: pthread_atfork.c,v 1.21 2025/03/01 16:34:03 christos Exp $" );
3535#endif /* LIBC_SCCS and not lint */
3636
3737#include "namespace.h"
3838
39- #include <sys/queue.h>
40- #include <sys/mman.h>
4139#include <errno.h>
4240#include <stdlib.h>
4341#include <unistd.h>
44-
42+ #include <sys/queue.h>
4543#include "extern.h"
4644#include "reentrant.h"
4745
@@ -80,22 +78,19 @@ static struct atfork_callback_q childq = SIMPLEQ_HEAD_INITIALIZER(childq);
8078static struct atfork_callback *
8179af_alloc (void )
8280{
83- void * rv ;
8481
8582 if (atfork_builtin .fn == NULL )
8683 return & atfork_builtin ;
8784
88- rv = mmap (0 , sizeof (atfork_builtin ), PROT_READ |PROT_WRITE ,
89- MAP_PRIVATE | MAP_ANON , -1 , 0 );
90- return rv == MAP_FAILED ? NULL : rv ;
85+ return malloc (sizeof (atfork_builtin ));
9186}
9287
9388static void
9489af_free (struct atfork_callback * af )
9590{
9691
9792 if (af != & atfork_builtin )
98- munmap (af , sizeof ( * af ) );
93+ free (af );
9994}
10095
10196int
You can’t perform that action at this time.
0 commit comments