Skip to content

Commit 0496eb4

Browse files
author
dsl
committed
I'm fairly sure the libc rules require that arc4random_addrandom,
arc4random_buf, arc4random_stir and arc4random_uniform be weak.
1 parent 1bc0880 commit 0496eb4

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

lib/libc/gen/arc4random.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: arc4random.c,v 1.19 2012/08/20 20:32:09 dsl Exp $ */
1+
/* $NetBSD: arc4random.c,v 1.20 2012/08/20 21:38:09 dsl Exp $ */
22
/* $OpenBSD: arc4random.c,v 1.6 2001/06/05 05:05:38 pvalchev Exp $ */
33

44
/*
@@ -27,7 +27,7 @@
2727

2828
#include <sys/cdefs.h>
2929
#if defined(LIBC_SCCS) && !defined(lint)
30-
__RCSID("$NetBSD: arc4random.c,v 1.19 2012/08/20 20:32:09 dsl Exp $");
30+
__RCSID("$NetBSD: arc4random.c,v 1.20 2012/08/20 21:38:09 dsl Exp $");
3131
#endif /* LIBC_SCCS and not lint */
3232

3333
#include "namespace.h"
@@ -42,6 +42,10 @@ __RCSID("$NetBSD: arc4random.c,v 1.19 2012/08/20 20:32:09 dsl Exp $");
4242

4343
#ifdef __weak_alias
4444
__weak_alias(arc4random,_arc4random)
45+
__weak_alias(arc4random_addrandom,_arc4random_addrandom)
46+
__weak_alias(arc4random_buf,_arc4random_buf)
47+
__weak_alias(arc4random_stir,_arc4random_stir)
48+
__weak_alias(arc4random_uniform,_arc4random_uniform)
4549
#endif
4650

4751
struct arc4_stream {

lib/libc/include/namespace.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: namespace.h,v 1.155 2012/07/09 21:25:46 rmind Exp $ */
1+
/* $NetBSD: namespace.h,v 1.156 2012/08/20 21:38:10 dsl Exp $ */
22

33
/*-
44
* Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
@@ -155,6 +155,10 @@
155155
#define alarm _alarm
156156
#define alphasort _alphasort
157157
#define arc4random _arc4random
158+
#define arc4random_addrandom _arc4random_addrandom
159+
#define arc4random_buf _arc4random_buf
160+
#define arc4random_stir _arc4random_stir
161+
#define arc4random_uniform _arc4random_uniform
158162
#define asctime_r _asctime_r
159163
#define asprintf _asprintf
160164
#define atoll _atoll

0 commit comments

Comments
 (0)