diff options
Diffstat (limited to 'src/lib/libc')
-rw-r--r-- | src/lib/libc/include/thread_private.h | 66 | ||||
-rw-r--r-- | src/lib/libc/net/ether_aton.3 | 6 | ||||
-rw-r--r-- | src/lib/libc/net/ethers.c | 4 | ||||
-rw-r--r-- | src/lib/libc/net/gai_strerror.3 | 6 | ||||
-rw-r--r-- | src/lib/libc/net/if_indextoname.3 | 12 | ||||
-rw-r--r-- | src/lib/libc/net/inet6_opt_init.3 | 18 | ||||
-rw-r--r-- | src/lib/libc/net/inet6_rth_space.3 | 8 | ||||
-rw-r--r-- | src/lib/libc/stdlib/exit.3 | 11 | ||||
-rw-r--r-- | src/lib/libc/stdlib/malloc.3 | 28 | ||||
-rw-r--r-- | src/lib/libc/stdlib/malloc.c | 9 | ||||
-rw-r--r-- | src/lib/libc/stdlib/mkstemp.c | 5 | ||||
-rw-r--r-- | src/lib/libc/stdlib/mktemp.3 | 42 | ||||
-rw-r--r-- | src/lib/libc/stdlib/ptsname.3 | 6 | ||||
-rw-r--r-- | src/lib/libc/stdlib/rand48.3 | 8 | ||||
-rw-r--r-- | src/lib/libc/stdlib/realpath.3 | 6 | ||||
-rw-r--r-- | src/lib/libc/string/memmem.3 | 6 |
16 files changed, 153 insertions, 88 deletions
diff --git a/src/lib/libc/include/thread_private.h b/src/lib/libc/include/thread_private.h index 1ec1071161..3e1dbcdf6e 100644 --- a/src/lib/libc/include/thread_private.h +++ b/src/lib/libc/include/thread_private.h | |||
@@ -1,10 +1,13 @@ | |||
1 | /* $OpenBSD: thread_private.h,v 1.37 2024/08/18 02:25:51 guenther Exp $ */ | 1 | /* $OpenBSD: thread_private.h,v 1.40 2025/08/04 01:44:33 dlg Exp $ */ |
2 | 2 | ||
3 | /* PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman <marc@snafu.org> */ | 3 | /* PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman <marc@snafu.org> */ |
4 | 4 | ||
5 | #ifndef _THREAD_PRIVATE_H_ | 5 | #ifndef _THREAD_PRIVATE_H_ |
6 | #define _THREAD_PRIVATE_H_ | 6 | #define _THREAD_PRIVATE_H_ |
7 | 7 | ||
8 | #include <sys/types.h> | ||
9 | #include <sys/gmon.h> | ||
10 | |||
8 | extern int __isthreaded; | 11 | extern int __isthreaded; |
9 | 12 | ||
10 | #define _MALLOC_MUTEXES 32 | 13 | #define _MALLOC_MUTEXES 32 |
@@ -292,6 +295,12 @@ TAILQ_HEAD(pthread_queue, pthread); | |||
292 | 295 | ||
293 | #ifdef FUTEX | 296 | #ifdef FUTEX |
294 | 297 | ||
298 | /* | ||
299 | * CAS based implementations | ||
300 | */ | ||
301 | |||
302 | #define __CMTX_CAS | ||
303 | |||
295 | struct pthread_mutex { | 304 | struct pthread_mutex { |
296 | volatile unsigned int lock; | 305 | volatile unsigned int lock; |
297 | int type; | 306 | int type; |
@@ -312,6 +321,10 @@ struct pthread_rwlock { | |||
312 | 321 | ||
313 | #else | 322 | #else |
314 | 323 | ||
324 | /* | ||
325 | * spinlock based implementations | ||
326 | */ | ||
327 | |||
315 | struct pthread_mutex { | 328 | struct pthread_mutex { |
316 | _atomic_lock_t lock; | 329 | _atomic_lock_t lock; |
317 | struct pthread_queue lockers; | 330 | struct pthread_queue lockers; |
@@ -336,6 +349,46 @@ struct pthread_rwlock { | |||
336 | }; | 349 | }; |
337 | #endif /* FUTEX */ | 350 | #endif /* FUTEX */ |
338 | 351 | ||
352 | /* libc mutex */ | ||
353 | |||
354 | #define __CMTX_UNLOCKED 0 | ||
355 | #define __CMTX_LOCKED 1 | ||
356 | #define __CMTX_CONTENDED 2 | ||
357 | |||
358 | #ifdef __CMTX_CAS | ||
359 | struct __cmtx { | ||
360 | volatile unsigned int lock; | ||
361 | }; | ||
362 | |||
363 | #define __CMTX_INITIALIZER() { \ | ||
364 | .lock = __CMTX_UNLOCKED, \ | ||
365 | } | ||
366 | #else /* __CMTX_CAS */ | ||
367 | struct __cmtx { | ||
368 | _atomic_lock_t spin; | ||
369 | volatile unsigned int lock; | ||
370 | }; | ||
371 | |||
372 | #define __CMTX_INITIALIZER() { \ | ||
373 | .spin = _SPINLOCK_UNLOCKED, \ | ||
374 | .lock = __CMTX_UNLOCKED, \ | ||
375 | } | ||
376 | #endif /* __CMTX_CAS */ | ||
377 | |||
378 | /* libc recursive mutex */ | ||
379 | |||
380 | struct __rcmtx { | ||
381 | volatile pthread_t owner; | ||
382 | struct __cmtx mtx; | ||
383 | unsigned int depth; | ||
384 | }; | ||
385 | |||
386 | #define __RCMTX_INITIALIZER() { \ | ||
387 | .owner = NULL, \ | ||
388 | .mtx = __CMTX_INITIALIZER(), \ | ||
389 | .depth = 0, \ | ||
390 | } | ||
391 | |||
339 | struct pthread_mutex_attr { | 392 | struct pthread_mutex_attr { |
340 | int ma_type; | 393 | int ma_type; |
341 | int ma_protocol; | 394 | int ma_protocol; |
@@ -390,6 +443,7 @@ struct pthread { | |||
390 | 443 | ||
391 | /* cancel received in a delayed cancel block? */ | 444 | /* cancel received in a delayed cancel block? */ |
392 | int delayed_cancel; | 445 | int delayed_cancel; |
446 | struct gmonparam *gmonparam; | ||
393 | }; | 447 | }; |
394 | /* flags in pthread->flags */ | 448 | /* flags in pthread->flags */ |
395 | #define THREAD_DONE 0x001 | 449 | #define THREAD_DONE 0x001 |
@@ -410,6 +464,16 @@ void _spinlock(volatile _atomic_lock_t *); | |||
410 | int _spinlocktry(volatile _atomic_lock_t *); | 464 | int _spinlocktry(volatile _atomic_lock_t *); |
411 | void _spinunlock(volatile _atomic_lock_t *); | 465 | void _spinunlock(volatile _atomic_lock_t *); |
412 | 466 | ||
467 | void __cmtx_init(struct __cmtx *); | ||
468 | int __cmtx_enter_try(struct __cmtx *); | ||
469 | void __cmtx_enter(struct __cmtx *); | ||
470 | void __cmtx_leave(struct __cmtx *); | ||
471 | |||
472 | void __rcmtx_init(struct __rcmtx *); | ||
473 | int __rcmtx_enter_try(struct __rcmtx *); | ||
474 | void __rcmtx_enter(struct __rcmtx *); | ||
475 | void __rcmtx_leave(struct __rcmtx *); | ||
476 | |||
413 | void _rthread_debug(int, const char *, ...) | 477 | void _rthread_debug(int, const char *, ...) |
414 | __attribute__((__format__ (printf, 2, 3))); | 478 | __attribute__((__format__ (printf, 2, 3))); |
415 | pid_t _thread_dofork(pid_t (*_sys_fork)(void)); | 479 | pid_t _thread_dofork(pid_t (*_sys_fork)(void)); |
diff --git a/src/lib/libc/net/ether_aton.3 b/src/lib/libc/net/ether_aton.3 index 98562dc44c..83fe98880c 100644 --- a/src/lib/libc/net/ether_aton.3 +++ b/src/lib/libc/net/ether_aton.3 | |||
@@ -1,8 +1,8 @@ | |||
1 | .\" $OpenBSD: ether_aton.3,v 1.3 2022/09/11 06:38:10 jmc Exp $ | 1 | .\" $OpenBSD: ether_aton.3,v 1.4 2025/06/29 00:33:46 dlg Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Written by roland@frob.com. Public domain. | 3 | .\" Written by roland@frob.com. Public domain. |
4 | .\" | 4 | .\" |
5 | .Dd $Mdocdate: September 11 2022 $ | 5 | .Dd $Mdocdate: June 29 2025 $ |
6 | .Dt ETHER_ATON 3 | 6 | .Dt ETHER_ATON 3 |
7 | .Os | 7 | .Os |
8 | .Sh NAME | 8 | .Sh NAME |
@@ -19,7 +19,7 @@ | |||
19 | .In netinet/in.h | 19 | .In netinet/in.h |
20 | .In netinet/if_ether.h | 20 | .In netinet/if_ether.h |
21 | .Ft char * | 21 | .Ft char * |
22 | .Fn ether_ntoa "struct ether_addr *e" | 22 | .Fn ether_ntoa "const struct ether_addr *e" |
23 | .Ft struct ether_addr * | 23 | .Ft struct ether_addr * |
24 | .Fn ether_aton "const char *s" | 24 | .Fn ether_aton "const char *s" |
25 | .Ft int | 25 | .Ft int |
diff --git a/src/lib/libc/net/ethers.c b/src/lib/libc/net/ethers.c index d62be1ca71..6edad5c5e5 100644 --- a/src/lib/libc/net/ethers.c +++ b/src/lib/libc/net/ethers.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ethers.c,v 1.27 2019/01/25 00:19:25 millert Exp $ */ | 1 | /* $OpenBSD: ethers.c,v 1.28 2025/06/29 00:33:46 dlg Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1998 Todd C. Miller <millert@openbsd.org> | 4 | * Copyright (c) 1998 Todd C. Miller <millert@openbsd.org> |
@@ -42,7 +42,7 @@ | |||
42 | static char * _ether_aton(const char *, struct ether_addr *); | 42 | static char * _ether_aton(const char *, struct ether_addr *); |
43 | 43 | ||
44 | char * | 44 | char * |
45 | ether_ntoa(struct ether_addr *e) | 45 | ether_ntoa(const struct ether_addr *e) |
46 | { | 46 | { |
47 | static char a[] = "xx:xx:xx:xx:xx:xx"; | 47 | static char a[] = "xx:xx:xx:xx:xx:xx"; |
48 | 48 | ||
diff --git a/src/lib/libc/net/gai_strerror.3 b/src/lib/libc/net/gai_strerror.3 index d271f492c5..93d11aad09 100644 --- a/src/lib/libc/net/gai_strerror.3 +++ b/src/lib/libc/net/gai_strerror.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: gai_strerror.3,v 1.10 2017/05/03 01:58:33 deraadt Exp $ | 1 | .\" $OpenBSD: gai_strerror.3,v 1.11 2025/06/13 18:34:00 schwarze Exp $ |
2 | .\" $KAME: gai_strerror.3,v 1.1 2005/01/05 03:04:47 itojun Exp $ | 2 | .\" $KAME: gai_strerror.3,v 1.1 2005/01/05 03:04:47 itojun Exp $ |
3 | .\" | 3 | .\" |
4 | .\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") | 4 | .\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") |
@@ -16,7 +16,7 @@ | |||
16 | .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | 16 | .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
17 | .\" PERFORMANCE OF THIS SOFTWARE. | 17 | .\" PERFORMANCE OF THIS SOFTWARE. |
18 | .\" | 18 | .\" |
19 | .Dd $Mdocdate: May 3 2017 $ | 19 | .Dd $Mdocdate: June 13 2025 $ |
20 | .Dt GAI_STRERROR 3 | 20 | .Dt GAI_STRERROR 3 |
21 | .Os | 21 | .Os |
22 | .Sh NAME | 22 | .Sh NAME |
@@ -26,7 +26,7 @@ | |||
26 | .In sys/types.h | 26 | .In sys/types.h |
27 | .In sys/socket.h | 27 | .In sys/socket.h |
28 | .In netdb.h | 28 | .In netdb.h |
29 | .Ft "const char *" | 29 | .Ft const char * |
30 | .Fn gai_strerror "int ecode" | 30 | .Fn gai_strerror "int ecode" |
31 | .Sh DESCRIPTION | 31 | .Sh DESCRIPTION |
32 | The | 32 | The |
diff --git a/src/lib/libc/net/if_indextoname.3 b/src/lib/libc/net/if_indextoname.3 index 25d2a2722f..9d00d66bd5 100644 --- a/src/lib/libc/net/if_indextoname.3 +++ b/src/lib/libc/net/if_indextoname.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: if_indextoname.3,v 1.16 2015/11/21 07:48:10 jmc Exp $ | 1 | .\" $OpenBSD: if_indextoname.3,v 1.17 2025/06/13 18:34:00 schwarze Exp $ |
2 | .\" Copyright (c) 1983, 1991, 1993 | 2 | .\" Copyright (c) 1983, 1991, 1993 |
3 | .\" The Regents of the University of California. All rights reserved. | 3 | .\" The Regents of the University of California. All rights reserved. |
4 | .\" | 4 | .\" |
@@ -28,7 +28,7 @@ | |||
28 | .\" | 28 | .\" |
29 | .\" From: @(#)rcmd.3 8.1 (Berkeley) 6/4/93 | 29 | .\" From: @(#)rcmd.3 8.1 (Berkeley) 6/4/93 |
30 | .\" | 30 | .\" |
31 | .Dd $Mdocdate: November 21 2015 $ | 31 | .Dd $Mdocdate: June 13 2025 $ |
32 | .Dt IF_NAMETOINDEX 3 | 32 | .Dt IF_NAMETOINDEX 3 |
33 | .Os | 33 | .Os |
34 | .Sh NAME | 34 | .Sh NAME |
@@ -41,13 +41,13 @@ | |||
41 | .In sys/types.h | 41 | .In sys/types.h |
42 | .In sys/socket.h | 42 | .In sys/socket.h |
43 | .In net/if.h | 43 | .In net/if.h |
44 | .Ft "unsigned int" | 44 | .Ft unsigned int |
45 | .Fn if_nametoindex "const char *ifname" | 45 | .Fn if_nametoindex "const char *ifname" |
46 | .Ft "char *" | 46 | .Ft char * |
47 | .Fn if_indextoname "unsigned int ifindex" "char *ifname" | 47 | .Fn if_indextoname "unsigned int ifindex" "char *ifname" |
48 | .Ft "struct if_nameindex *" | 48 | .Ft struct if_nameindex * |
49 | .Fn if_nameindex "void" | 49 | .Fn if_nameindex "void" |
50 | .Ft "void" | 50 | .Ft void |
51 | .Fn if_freenameindex "struct if_nameindex *ptr" | 51 | .Fn if_freenameindex "struct if_nameindex *ptr" |
52 | .Sh DESCRIPTION | 52 | .Sh DESCRIPTION |
53 | These functions map interface indexes to interface names (such as | 53 | These functions map interface indexes to interface names (such as |
diff --git a/src/lib/libc/net/inet6_opt_init.3 b/src/lib/libc/net/inet6_opt_init.3 index 41ba842166..87244507a9 100644 --- a/src/lib/libc/net/inet6_opt_init.3 +++ b/src/lib/libc/net/inet6_opt_init.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: inet6_opt_init.3,v 1.8 2022/03/31 17:27:16 naddy Exp $ | 1 | .\" $OpenBSD: inet6_opt_init.3,v 1.9 2025/06/13 18:34:00 schwarze Exp $ |
2 | .\" $KAME: inet6_opt_init.3,v 1.7 2004/12/27 05:08:23 itojun Exp $ | 2 | .\" $KAME: inet6_opt_init.3,v 1.7 2004/12/27 05:08:23 itojun Exp $ |
3 | .\" | 3 | .\" |
4 | .\" Copyright (C) 2004 WIDE Project. | 4 | .\" Copyright (C) 2004 WIDE Project. |
@@ -28,7 +28,7 @@ | |||
28 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 28 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
29 | .\" SUCH DAMAGE. | 29 | .\" SUCH DAMAGE. |
30 | .\" | 30 | .\" |
31 | .Dd $Mdocdate: March 31 2022 $ | 31 | .Dd $Mdocdate: June 13 2025 $ |
32 | .Dt INET6_OPT_INIT 3 | 32 | .Dt INET6_OPT_INIT 3 |
33 | .Os | 33 | .Os |
34 | .\" | 34 | .\" |
@@ -44,19 +44,19 @@ | |||
44 | .\" | 44 | .\" |
45 | .Sh SYNOPSIS | 45 | .Sh SYNOPSIS |
46 | .In netinet/in.h | 46 | .In netinet/in.h |
47 | .Ft "int" | 47 | .Ft int |
48 | .Fn inet6_opt_init "void *extbuf" "socklen_t extlen" | 48 | .Fn inet6_opt_init "void *extbuf" "socklen_t extlen" |
49 | .Ft "int" | 49 | .Ft int |
50 | .Fn inet6_opt_append "void *extbuf" "socklen_t extlen" "int offset" "u_int8_t type" "socklen_t len" "u_int8_t align" "void **databufp" | 50 | .Fn inet6_opt_append "void *extbuf" "socklen_t extlen" "int offset" "u_int8_t type" "socklen_t len" "u_int8_t align" "void **databufp" |
51 | .Ft "int" | 51 | .Ft int |
52 | .Fn inet6_opt_finish "void *extbuf" "socklen_t extlen" "int offset" | 52 | .Fn inet6_opt_finish "void *extbuf" "socklen_t extlen" "int offset" |
53 | .Ft "int" | 53 | .Ft int |
54 | .Fn inet6_opt_set_val "void *databuf" "int offset" "void *val" "socklen_t vallen" | 54 | .Fn inet6_opt_set_val "void *databuf" "int offset" "void *val" "socklen_t vallen" |
55 | .Ft "int" | 55 | .Ft int |
56 | .Fn inet6_opt_next "void *extbuf" "socklen_t extlen" "int offset" "u_int8_t *typep" "socklen_t *lenp" "void **databufp" | 56 | .Fn inet6_opt_next "void *extbuf" "socklen_t extlen" "int offset" "u_int8_t *typep" "socklen_t *lenp" "void **databufp" |
57 | .Ft "int" | 57 | .Ft int |
58 | .Fn inet6_opt_find "void *extbuf" "socklen_t extlen" "int offset" "u_int8_t type" "socklen_t *lenp" "void **databufp" | 58 | .Fn inet6_opt_find "void *extbuf" "socklen_t extlen" "int offset" "u_int8_t type" "socklen_t *lenp" "void **databufp" |
59 | .Ft "int" | 59 | .Ft int |
60 | .Fn inet6_opt_get_val "void *databuf" "socklen_t offset" "void *val" "socklen_t vallen" | 60 | .Fn inet6_opt_get_val "void *databuf" "socklen_t offset" "void *val" "socklen_t vallen" |
61 | .\" | 61 | .\" |
62 | .Sh DESCRIPTION | 62 | .Sh DESCRIPTION |
diff --git a/src/lib/libc/net/inet6_rth_space.3 b/src/lib/libc/net/inet6_rth_space.3 index c40b45057e..7304266fe1 100644 --- a/src/lib/libc/net/inet6_rth_space.3 +++ b/src/lib/libc/net/inet6_rth_space.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: inet6_rth_space.3,v 1.8 2022/03/31 17:27:16 naddy Exp $ | 1 | .\" $OpenBSD: inet6_rth_space.3,v 1.9 2025/06/13 18:34:00 schwarze Exp $ |
2 | .\" $KAME: inet6_rth_space.3,v 1.7 2005/01/05 03:00:44 itojun Exp $ | 2 | .\" $KAME: inet6_rth_space.3,v 1.7 2005/01/05 03:00:44 itojun Exp $ |
3 | .\" | 3 | .\" |
4 | .\" Copyright (C) 2004 WIDE Project. | 4 | .\" Copyright (C) 2004 WIDE Project. |
@@ -28,7 +28,7 @@ | |||
28 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 28 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
29 | .\" SUCH DAMAGE. | 29 | .\" SUCH DAMAGE. |
30 | .\" | 30 | .\" |
31 | .Dd $Mdocdate: March 31 2022 $ | 31 | .Dd $Mdocdate: June 13 2025 $ |
32 | .Dt INET6_RTH_SPACE 3 | 32 | .Dt INET6_RTH_SPACE 3 |
33 | .Os | 33 | .Os |
34 | .\" | 34 | .\" |
@@ -45,7 +45,7 @@ | |||
45 | .In netinet/in.h | 45 | .In netinet/in.h |
46 | .Ft socklen_t | 46 | .Ft socklen_t |
47 | .Fn inet6_rth_space "int" "int" | 47 | .Fn inet6_rth_space "int" "int" |
48 | .Ft "void *" | 48 | .Ft void * |
49 | .Fn inet6_rth_init "void *" "socklen_t" "int" "int" | 49 | .Fn inet6_rth_init "void *" "socklen_t" "int" "int" |
50 | .Ft int | 50 | .Ft int |
51 | .Fn inet6_rth_add "void *" "const struct in6_addr *" | 51 | .Fn inet6_rth_add "void *" "const struct in6_addr *" |
@@ -53,7 +53,7 @@ | |||
53 | .Fn inet6_rth_reverse "const void *" "void *" | 53 | .Fn inet6_rth_reverse "const void *" "void *" |
54 | .Ft int | 54 | .Ft int |
55 | .Fn inet6_rth_segments "const void *" | 55 | .Fn inet6_rth_segments "const void *" |
56 | .Ft "struct in6_addr *" | 56 | .Ft struct in6_addr * |
57 | .Fn inet6_rth_getaddr "const void *" "int" | 57 | .Fn inet6_rth_getaddr "const void *" "int" |
58 | .\" | 58 | .\" |
59 | .Sh DESCRIPTION | 59 | .Sh DESCRIPTION |
diff --git a/src/lib/libc/stdlib/exit.3 b/src/lib/libc/stdlib/exit.3 index 22acade86c..ccb416ee82 100644 --- a/src/lib/libc/stdlib/exit.3 +++ b/src/lib/libc/stdlib/exit.3 | |||
@@ -29,9 +29,9 @@ | |||
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
31 | .\" | 31 | .\" |
32 | .\" $OpenBSD: exit.3,v 1.18 2024/08/30 03:44:48 guenther Exp $ | 32 | .\" $OpenBSD: exit.3,v 1.19 2025/06/03 14:15:53 yasuoka Exp $ |
33 | .\" | 33 | .\" |
34 | .Dd $Mdocdate: August 30 2024 $ | 34 | .Dd $Mdocdate: June 3 2025 $ |
35 | .Dt EXIT 3 | 35 | .Dt EXIT 3 |
36 | .Os | 36 | .Os |
37 | .Sh NAME | 37 | .Sh NAME |
@@ -54,9 +54,7 @@ Call the functions registered with the | |||
54 | .Xr atexit 3 | 54 | .Xr atexit 3 |
55 | function, in the reverse order of their registration. | 55 | function, in the reverse order of their registration. |
56 | .It | 56 | .It |
57 | Flush all open output streams. | 57 | Flush and close all open streams. |
58 | .It | ||
59 | Close all open streams. | ||
60 | .It | 58 | .It |
61 | Unlink all files created with the | 59 | Unlink all files created with the |
62 | .Xr tmpfile 3 | 60 | .Xr tmpfile 3 |
@@ -79,6 +77,7 @@ function never returns. | |||
79 | .Sh SEE ALSO | 77 | .Sh SEE ALSO |
80 | .Xr _exit 2 , | 78 | .Xr _exit 2 , |
81 | .Xr atexit 3 , | 79 | .Xr atexit 3 , |
80 | .Xr fflush 3 , | ||
82 | .Xr intro 3 , | 81 | .Xr intro 3 , |
83 | .Xr sysexits 3 , | 82 | .Xr sysexits 3 , |
84 | .Xr tmpfile 3 | 83 | .Xr tmpfile 3 |
@@ -86,7 +85,7 @@ function never returns. | |||
86 | The | 85 | The |
87 | .Fn exit | 86 | .Fn exit |
88 | function conforms to | 87 | function conforms to |
89 | .St -isoC-99 . | 88 | .St -p1003.1-2024 . |
90 | .Sh HISTORY | 89 | .Sh HISTORY |
91 | An | 90 | An |
92 | .Fn exit | 91 | .Fn exit |
diff --git a/src/lib/libc/stdlib/malloc.3 b/src/lib/libc/stdlib/malloc.3 index bea5575bf8..ee13b01bd4 100644 --- a/src/lib/libc/stdlib/malloc.3 +++ b/src/lib/libc/stdlib/malloc.3 | |||
@@ -30,9 +30,9 @@ | |||
30 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 30 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
31 | .\" SUCH DAMAGE. | 31 | .\" SUCH DAMAGE. |
32 | .\" | 32 | .\" |
33 | .\" $OpenBSD: malloc.3,v 1.142 2024/08/03 20:09:24 guenther Exp $ | 33 | .\" $OpenBSD: malloc.3,v 1.147 2025/06/04 00:38:01 yasuoka Exp $ |
34 | .\" | 34 | .\" |
35 | .Dd $Mdocdate: August 3 2024 $ | 35 | .Dd $Mdocdate: June 4 2025 $ |
36 | .Dt MALLOC 3 | 36 | .Dt MALLOC 3 |
37 | .Os | 37 | .Os |
38 | .Sh NAME | 38 | .Sh NAME |
@@ -69,7 +69,8 @@ | |||
69 | .Fn malloc_conceal "size_t size" | 69 | .Fn malloc_conceal "size_t size" |
70 | .Ft void * | 70 | .Ft void * |
71 | .Fn calloc_conceal "size_t nmemb" "size_t size" | 71 | .Fn calloc_conceal "size_t nmemb" "size_t size" |
72 | .Vt char *malloc_options ; | 72 | .Vt const char * const |
73 | .Va malloc_options ; | ||
73 | .Sh DESCRIPTION | 74 | .Sh DESCRIPTION |
74 | The standard functions | 75 | The standard functions |
75 | .Fn malloc , | 76 | .Fn malloc , |
@@ -268,7 +269,15 @@ next checks the environment for a variable called | |||
268 | and finally looks at the global variable | 269 | and finally looks at the global variable |
269 | .Va malloc_options | 270 | .Va malloc_options |
270 | in the program. | 271 | in the program. |
271 | Each is scanned for the flags documented below. | 272 | Since |
273 | .Fn malloc | ||
274 | might already get called before the beginning of | ||
275 | .Fn main , | ||
276 | either initialize | ||
277 | .Va malloc_options | ||
278 | to a string literal at file scope or do not declare it at all. | ||
279 | .Pp | ||
280 | Each of the three strings is scanned for the flags documented below. | ||
272 | Unless otherwise noted uppercase means on, lowercase means off. | 281 | Unless otherwise noted uppercase means on, lowercase means off. |
273 | During initialization, flags occurring later modify the behaviour | 282 | During initialization, flags occurring later modify the behaviour |
274 | that was requested by flags processed earlier. | 283 | that was requested by flags processed earlier. |
@@ -363,18 +372,9 @@ Use with | |||
363 | to get a verbose dump of malloc's internal state. | 372 | to get a verbose dump of malloc's internal state. |
364 | .It Cm X | 373 | .It Cm X |
365 | .Dq xmalloc . | 374 | .Dq xmalloc . |
366 | Rather than return failure, | 375 | Rather than return failure to handle out-of-memory conditions gracefully, |
367 | .Xr abort 3 | 376 | .Xr abort 3 |
368 | the program with a diagnostic message on stderr. | 377 | the program with a diagnostic message on stderr. |
369 | It is the intention that this option be set at compile time by | ||
370 | including in the source: | ||
371 | .Bd -literal -offset indent | ||
372 | extern char *malloc_options; | ||
373 | malloc_options = "X"; | ||
374 | .Ed | ||
375 | .Pp | ||
376 | Note that this will cause code that is supposed to handle | ||
377 | out-of-memory conditions gracefully to abort instead. | ||
378 | .It Cm < | 378 | .It Cm < |
379 | .Dq Halve the cache size . | 379 | .Dq Halve the cache size . |
380 | Decrease the size of the free page cache by a factor of two. | 380 | Decrease the size of the free page cache by a factor of two. |
diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c index cad8e5d6a1..c6261d87c5 100644 --- a/src/lib/libc/stdlib/malloc.c +++ b/src/lib/libc/stdlib/malloc.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: malloc.c,v 1.297 2024/09/20 02:00:46 jsg Exp $ */ | 1 | /* $OpenBSD: malloc.c,v 1.299 2025/06/12 16:07:09 deraadt Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2008, 2010, 2011, 2016, 2023 Otto Moerbeek <otto@drijf.net> | 3 | * Copyright (c) 2008, 2010, 2011, 2016, 2023 Otto Moerbeek <otto@drijf.net> |
4 | * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org> | 4 | * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org> |
@@ -31,7 +31,6 @@ | |||
31 | #include <sys/queue.h> | 31 | #include <sys/queue.h> |
32 | #include <sys/mman.h> | 32 | #include <sys/mman.h> |
33 | #include <sys/sysctl.h> | 33 | #include <sys/sysctl.h> |
34 | #include <uvm/uvmexp.h> | ||
35 | #include <errno.h> | 34 | #include <errno.h> |
36 | #include <stdarg.h> | 35 | #include <stdarg.h> |
37 | #include <stdint.h> | 36 | #include <stdint.h> |
@@ -264,7 +263,8 @@ static union { | |||
264 | __attribute__((section(".openbsd.mutable"))); | 263 | __attribute__((section(".openbsd.mutable"))); |
265 | #define mopts malloc_readonly.mopts | 264 | #define mopts malloc_readonly.mopts |
266 | 265 | ||
267 | char *malloc_options; /* compile-time options */ | 266 | /* compile-time options */ |
267 | const char *const malloc_options __attribute__((weak)); | ||
268 | 268 | ||
269 | static __dead void wrterror(struct dir_info *d, char *msg, ...) | 269 | static __dead void wrterror(struct dir_info *d, char *msg, ...) |
270 | __attribute__((__format__ (printf, 2, 3))); | 270 | __attribute__((__format__ (printf, 2, 3))); |
@@ -501,7 +501,8 @@ omalloc_parseopt(char opt) | |||
501 | static void | 501 | static void |
502 | omalloc_init(void) | 502 | omalloc_init(void) |
503 | { | 503 | { |
504 | char *p, *q, b[16]; | 504 | const char *p; |
505 | char *q, b[16]; | ||
505 | int i, j; | 506 | int i, j; |
506 | const int mib[2] = { CTL_VM, VM_MALLOC_CONF }; | 507 | const int mib[2] = { CTL_VM, VM_MALLOC_CONF }; |
507 | size_t sb; | 508 | size_t sb; |
diff --git a/src/lib/libc/stdlib/mkstemp.c b/src/lib/libc/stdlib/mkstemp.c index 75a9d27d1a..760575005f 100644 --- a/src/lib/libc/stdlib/mkstemp.c +++ b/src/lib/libc/stdlib/mkstemp.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: mkstemp.c,v 1.1 2024/01/19 19:45:02 millert Exp $ */ | 1 | /* $OpenBSD: mkstemp.c,v 1.2 2025/08/04 04:59:31 guenther Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2024 Todd C. Miller | 3 | * Copyright (c) 2024 Todd C. Miller |
4 | * | 4 | * |
@@ -20,7 +20,8 @@ | |||
20 | #include <fcntl.h> | 20 | #include <fcntl.h> |
21 | #include <stdlib.h> | 21 | #include <stdlib.h> |
22 | 22 | ||
23 | #define MKOSTEMP_FLAGS (O_APPEND | O_CLOEXEC | O_DSYNC | O_RSYNC | O_SYNC) | 23 | #define MKOSTEMP_FLAGS \ |
24 | (O_APPEND | O_CLOEXEC | O_CLOFORK | O_DSYNC | O_RSYNC | O_SYNC) | ||
24 | 25 | ||
25 | static int | 26 | static int |
26 | mkstemp_cb(const char *path, int flags) | 27 | mkstemp_cb(const char *path, int flags) |
diff --git a/src/lib/libc/stdlib/mktemp.3 b/src/lib/libc/stdlib/mktemp.3 index 83b7c9eb30..a967358164 100644 --- a/src/lib/libc/stdlib/mktemp.3 +++ b/src/lib/libc/stdlib/mktemp.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: mktemp.3,v 1.2 2024/03/01 21:30:40 millert Exp $ | 1 | .\" $OpenBSD: mktemp.3,v 1.4 2025/08/04 14:11:37 schwarze Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 1989, 1991, 1993 | 3 | .\" Copyright (c) 1989, 1991, 1993 |
4 | .\" The Regents of the University of California. All rights reserved. | 4 | .\" The Regents of the University of California. All rights reserved. |
@@ -27,17 +27,17 @@ | |||
27 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 27 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
28 | .\" SUCH DAMAGE. | 28 | .\" SUCH DAMAGE. |
29 | .\" | 29 | .\" |
30 | .Dd $Mdocdate: March 1 2024 $ | 30 | .Dd $Mdocdate: August 4 2025 $ |
31 | .Dt MKTEMP 3 | 31 | .Dt MKTEMP 3 |
32 | .Os | 32 | .Os |
33 | .Sh NAME | 33 | .Sh NAME |
34 | .Nm mktemp , | 34 | .Nm mktemp , |
35 | .Nm mkstemp , | 35 | .Nm mkstemp , |
36 | .Nm mkostemp , | ||
37 | .Nm mkstemps , | 36 | .Nm mkstemps , |
38 | .Nm mkostemps , | ||
39 | .Nm mkdtemp , | 37 | .Nm mkdtemp , |
40 | .Nm mkdtemps | 38 | .Nm mkdtemps , |
39 | .Nm mkostemp , | ||
40 | .Nm mkostemps | ||
41 | .Nd make temporary file name (unique) | 41 | .Nd make temporary file name (unique) |
42 | .Sh SYNOPSIS | 42 | .Sh SYNOPSIS |
43 | .In stdlib.h | 43 | .In stdlib.h |
@@ -119,6 +119,8 @@ system call: | |||
119 | Append on each write. | 119 | Append on each write. |
120 | .It Dv O_CLOEXEC | 120 | .It Dv O_CLOEXEC |
121 | Set the close-on-exec flag on the new file descriptor. | 121 | Set the close-on-exec flag on the new file descriptor. |
122 | .It Dv O_CLOFORK | ||
123 | Set the close-on-fork flag on the new file descriptor. | ||
122 | .It Dv O_SYNC | 124 | .It Dv O_SYNC |
123 | Perform synchronous I/O operations. | 125 | Perform synchronous I/O operations. |
124 | .El | 126 | .El |
@@ -163,8 +165,8 @@ functions return a pointer to the template on success and | |||
163 | on failure. | 165 | on failure. |
164 | The | 166 | The |
165 | .Fn mkstemp , | 167 | .Fn mkstemp , |
166 | .Fn mkostemp , | ||
167 | .Fn mkstemps , | 168 | .Fn mkstemps , |
169 | .Fn mkostemp , | ||
168 | and | 170 | and |
169 | .Fn mkostemps | 171 | .Fn mkostemps |
170 | functions return \-1 if no suitable file could be created. | 172 | functions return \-1 if no suitable file could be created. |
@@ -253,9 +255,9 @@ of | |||
253 | The | 255 | The |
254 | .Fn mktemp , | 256 | .Fn mktemp , |
255 | .Fn mkstemp , | 257 | .Fn mkstemp , |
256 | .Fn mkostemp , | 258 | .Fn mkdtemp , |
257 | and | 259 | and |
258 | .Fn mkdtemp | 260 | .Fn mkostemp |
259 | functions may set | 261 | functions may set |
260 | .Va errno | 262 | .Va errno |
261 | to one of the following values: | 263 | to one of the following values: |
@@ -318,8 +320,8 @@ function. | |||
318 | .Pp | 320 | .Pp |
319 | The | 321 | The |
320 | .Fn mkstemp , | 322 | .Fn mkstemp , |
321 | .Fn mkostemp , | ||
322 | .Fn mkstemps , | 323 | .Fn mkstemps , |
324 | .Fn mkostemp , | ||
323 | and | 325 | and |
324 | .Fn mkostemps | 326 | .Fn mkostemps |
325 | functions may also set | 327 | functions may also set |
@@ -345,18 +347,16 @@ function. | |||
345 | .Xr tmpnam 3 | 347 | .Xr tmpnam 3 |
346 | .Sh STANDARDS | 348 | .Sh STANDARDS |
347 | The | 349 | The |
348 | .Fn mkdtemp | 350 | .Fn mkstemp , |
351 | .Fn mkdtemp , | ||
349 | and | 352 | and |
350 | .Fn mkstemp | 353 | .Fn mkostemp |
351 | functions conform to the | 354 | functions conform to the |
352 | .St -p1003.1-2008 | 355 | .St -p1003.1-2024 |
353 | specification. | 356 | specification. |
354 | The ability to specify more than six | 357 | The ability to specify more than six |
355 | .Em X Ns s | 358 | .Em X Ns s |
356 | is an extension to that standard. | 359 | is an extension to that standard. |
357 | The | ||
358 | .Fn mkostemp | ||
359 | function is expected to conform to a future revision of that standard. | ||
360 | .Pp | 360 | .Pp |
361 | The | 361 | The |
362 | .Fn mktemp | 362 | .Fn mktemp |
@@ -368,9 +368,9 @@ it is no longer a part of the standard. | |||
368 | .Pp | 368 | .Pp |
369 | The | 369 | The |
370 | .Fn mkstemps , | 370 | .Fn mkstemps , |
371 | .Fn mkostemps , | 371 | .Fn mkdtemps , |
372 | and | 372 | and |
373 | .Fn mkdtemps | 373 | .Fn mkostemps |
374 | functions are non-standard and should not be used if portability is required. | 374 | functions are non-standard and should not be used if portability is required. |
375 | .Sh HISTORY | 375 | .Sh HISTORY |
376 | A | 376 | A |
@@ -378,14 +378,14 @@ A | |||
378 | function appeared in | 378 | function appeared in |
379 | .At v7 . | 379 | .At v7 . |
380 | The | 380 | The |
381 | .Fn mkdtemp | ||
382 | function appeared in | ||
383 | .Ox 2.2 . | ||
384 | The | ||
385 | .Fn mkstemp | 381 | .Fn mkstemp |
386 | function appeared in | 382 | function appeared in |
387 | .Bx 4.3 . | 383 | .Bx 4.3 . |
388 | The | 384 | The |
385 | .Fn mkdtemp | ||
386 | function appeared in | ||
387 | .Ox 2.2 . | ||
388 | The | ||
389 | .Fn mkstemps | 389 | .Fn mkstemps |
390 | function appeared in | 390 | function appeared in |
391 | .Ox 2.3 . | 391 | .Ox 2.3 . |
diff --git a/src/lib/libc/stdlib/ptsname.3 b/src/lib/libc/stdlib/ptsname.3 index 98705528f5..eea36a5a02 100644 --- a/src/lib/libc/stdlib/ptsname.3 +++ b/src/lib/libc/stdlib/ptsname.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: ptsname.3,v 1.2 2012/12/04 18:42:16 millert Exp $ | 1 | .\" $OpenBSD: ptsname.3,v 1.3 2025/06/13 18:34:00 schwarze Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 2002 The FreeBSD Project, Inc. | 3 | .\" Copyright (c) 2002 The FreeBSD Project, Inc. |
4 | .\" All rights reserved. | 4 | .\" All rights reserved. |
@@ -32,7 +32,7 @@ | |||
32 | .\" | 32 | .\" |
33 | .\" $FreeBSD: head/lib/libc/stdlib/ptsname.3 240412 2012-09-12 17:54:09Z emaste $ | 33 | .\" $FreeBSD: head/lib/libc/stdlib/ptsname.3 240412 2012-09-12 17:54:09Z emaste $ |
34 | .\" | 34 | .\" |
35 | .Dd $Mdocdate: December 4 2012 $ | 35 | .Dd $Mdocdate: June 13 2025 $ |
36 | .Dt PTSNAME 3 | 36 | .Dt PTSNAME 3 |
37 | .Os | 37 | .Os |
38 | .Sh NAME | 38 | .Sh NAME |
@@ -44,7 +44,7 @@ | |||
44 | .In stdlib.h | 44 | .In stdlib.h |
45 | .Ft int | 45 | .Ft int |
46 | .Fn grantpt "int fildes" | 46 | .Fn grantpt "int fildes" |
47 | .Ft "char *" | 47 | .Ft char * |
48 | .Fn ptsname "int fildes" | 48 | .Fn ptsname "int fildes" |
49 | .Ft int | 49 | .Ft int |
50 | .Fn unlockpt "int fildes" | 50 | .Fn unlockpt "int fildes" |
diff --git a/src/lib/libc/stdlib/rand48.3 b/src/lib/libc/stdlib/rand48.3 index fa7a7179bc..02e1999db9 100644 --- a/src/lib/libc/stdlib/rand48.3 +++ b/src/lib/libc/stdlib/rand48.3 | |||
@@ -9,9 +9,9 @@ | |||
9 | .\" of any kind. I shall in no event be liable for anything that happens | 9 | .\" of any kind. I shall in no event be liable for anything that happens |
10 | .\" to anyone/anything when using this software. | 10 | .\" to anyone/anything when using this software. |
11 | .\" | 11 | .\" |
12 | .\" $OpenBSD: rand48.3,v 1.21 2019/12/20 19:16:40 tb Exp $ | 12 | .\" $OpenBSD: rand48.3,v 1.22 2025/06/13 18:34:00 schwarze Exp $ |
13 | .\" | 13 | .\" |
14 | .Dd $Mdocdate: December 20 2019 $ | 14 | .Dd $Mdocdate: June 13 2025 $ |
15 | .Dt DRAND48 3 | 15 | .Dt DRAND48 3 |
16 | .Os | 16 | .Os |
17 | .Sh NAME | 17 | .Sh NAME |
@@ -46,9 +46,9 @@ | |||
46 | .Fn srand48 "long seed" | 46 | .Fn srand48 "long seed" |
47 | .Ft void | 47 | .Ft void |
48 | .Fn srand48_deterministic "long seed" | 48 | .Fn srand48_deterministic "long seed" |
49 | .Ft "unsigned short *" | 49 | .Ft unsigned short * |
50 | .Fn seed48 "unsigned short xseed[3]" | 50 | .Fn seed48 "unsigned short xseed[3]" |
51 | .Ft "unsigned short *" | 51 | .Ft unsigned short * |
52 | .Fn seed48_deterministic "unsigned short xseed[3]" | 52 | .Fn seed48_deterministic "unsigned short xseed[3]" |
53 | .Ft void | 53 | .Ft void |
54 | .Fn lcong48 "unsigned short p[7]" | 54 | .Fn lcong48 "unsigned short p[7]" |
diff --git a/src/lib/libc/stdlib/realpath.3 b/src/lib/libc/stdlib/realpath.3 index 1dec10fef4..1f932e3bb5 100644 --- a/src/lib/libc/stdlib/realpath.3 +++ b/src/lib/libc/stdlib/realpath.3 | |||
@@ -28,9 +28,9 @@ | |||
28 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 28 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
29 | .\" SUCH DAMAGE. | 29 | .\" SUCH DAMAGE. |
30 | .\" | 30 | .\" |
31 | .\" $OpenBSD: realpath.3,v 1.26 2021/10/13 15:04:53 kn Exp $ | 31 | .\" $OpenBSD: realpath.3,v 1.27 2025/06/13 18:34:00 schwarze Exp $ |
32 | .\" | 32 | .\" |
33 | .Dd $Mdocdate: October 13 2021 $ | 33 | .Dd $Mdocdate: June 13 2025 $ |
34 | .Dt REALPATH 3 | 34 | .Dt REALPATH 3 |
35 | .Os | 35 | .Os |
36 | .Sh NAME | 36 | .Sh NAME |
@@ -39,7 +39,7 @@ | |||
39 | .Sh SYNOPSIS | 39 | .Sh SYNOPSIS |
40 | .In limits.h | 40 | .In limits.h |
41 | .In stdlib.h | 41 | .In stdlib.h |
42 | .Ft "char *" | 42 | .Ft char * |
43 | .Fn realpath "const char *pathname" "char *resolved" | 43 | .Fn realpath "const char *pathname" "char *resolved" |
44 | .Sh DESCRIPTION | 44 | .Sh DESCRIPTION |
45 | The | 45 | The |
diff --git a/src/lib/libc/string/memmem.3 b/src/lib/libc/string/memmem.3 index de62d738de..eeb621f8f6 100644 --- a/src/lib/libc/string/memmem.3 +++ b/src/lib/libc/string/memmem.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: memmem.3,v 1.4 2024/08/03 20:13:23 guenther Exp $ | 1 | .\" $OpenBSD: memmem.3,v 1.5 2025/06/13 18:34:00 schwarze Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 2005 Pascal Gloor <pascal.gloor@spale.com> | 3 | .\" Copyright (c) 2005 Pascal Gloor <pascal.gloor@spale.com> |
4 | .\" | 4 | .\" |
@@ -26,7 +26,7 @@ | |||
26 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 26 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
27 | .\" SUCH DAMAGE. | 27 | .\" SUCH DAMAGE. |
28 | .\" | 28 | .\" |
29 | .Dd $Mdocdate: August 3 2024 $ | 29 | .Dd $Mdocdate: June 13 2025 $ |
30 | .Dt MEMMEM 3 | 30 | .Dt MEMMEM 3 |
31 | .Os | 31 | .Os |
32 | .Sh NAME | 32 | .Sh NAME |
@@ -34,7 +34,7 @@ | |||
34 | .Nd locate a byte substring in a byte string | 34 | .Nd locate a byte substring in a byte string |
35 | .Sh SYNOPSIS | 35 | .Sh SYNOPSIS |
36 | .In string.h | 36 | .In string.h |
37 | .Ft "void *" | 37 | .Ft void * |
38 | .Fo memmem | 38 | .Fo memmem |
39 | .Fa "const void *big" "size_t big_len" | 39 | .Fa "const void *big" "size_t big_len" |
40 | .Fa "const void *little" "size_t little_len" | 40 | .Fa "const void *little" "size_t little_len" |