Skip to content

Commit 2e2651f

Browse files
authored
add default implementation of _get_entropy() that returns -1 to avoid linker warning (#2578)
1 parent dfc26a0 commit 2e2651f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/rp2_common/pico_clib_interface/newlib_interface.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ int __attribute__((weak)) _isatty(int fd) {
152152
return fd == STDIO_HANDLE_STDIN || fd == STDIO_HANDLE_STDOUT || fd == STDIO_HANDLE_STDERR;
153153
}
154154

155+
int __attribute__((weak)) _getentropy (__unused void *buffer, __unused size_t length) {
156+
// note we don't hook this up as it isn't clear if/where it is used, and we don't particularly
157+
// want to pull in pico_rand. the user can supply their own strong implementation if they need it!
158+
return -1;
159+
}
155160
// exit is not useful... no desire to pull in __call_exitprocs
156161
void exit(int status) {
157162
_exit(status);

0 commit comments

Comments
 (0)