Skip to content

Commit 9d37c08

Browse files
krekre
authored andcommitted
Specify MAP_ANON, the default (MAP_FILE) with a fd == -1 makes no sense.
1 parent cedd664 commit 9d37c08

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/libc/gen/pthread_atfork.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: pthread_atfork.c,v 1.19 2025/02/28 16:00:26 christos Exp $ */
1+
/* $NetBSD: pthread_atfork.c,v 1.20 2025/02/28 23:59:55 kre Exp $ */
22

33
/*-
44
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
3131

3232
#include <sys/cdefs.h>
3333
#if defined(LIBC_SCCS) && !defined(lint)
34-
__RCSID("$NetBSD: pthread_atfork.c,v 1.19 2025/02/28 16:00:26 christos Exp $");
34+
__RCSID("$NetBSD: pthread_atfork.c,v 1.20 2025/02/28 23:59:55 kre Exp $");
3535
#endif /* LIBC_SCCS and not lint */
3636

3737
#include "namespace.h"
@@ -85,8 +85,8 @@ af_alloc(void)
8585
if (atfork_builtin.fn == NULL)
8686
return &atfork_builtin;
8787

88-
rv = mmap(0, sizeof(atfork_builtin), PROT_READ|PROT_WRITE, MAP_PRIVATE,
89-
-1, 0);
88+
rv = mmap(0, sizeof(atfork_builtin), PROT_READ|PROT_WRITE,
89+
MAP_PRIVATE | MAP_ANON, -1, 0);
9090
return rv == MAP_FAILED ? NULL : rv;
9191
}
9292

0 commit comments

Comments
 (0)