[PATCH] newlib: Add missing prototype for _getentropy

Torbjörn SVENSSON torbjorn.svensson@foss.st.com
Mon Sep 25 18:37:45 GMT 2023


Ok for master?

---

Fixes compile warnings like:

.../newlib/libc/reent/getentropyr.c: In function '_getentropy_r':
.../newlib/libc/reent/getentropyr.c:48:14: warning: implicit declaration of function '_getentropy'; did you mean 'getentropy'? [-Wimplicit-function-declaration]
   48 |   if ((ret = _getentropy (buf, buflen)) == -1 && errno != 0)
      |              ^~~~~~~~~~~
      |              getentropy

Contributed by STMicroelectronics

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
---
 newlib/libc/include/sys/unistd.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h
index 807407700..25532251c 100644
--- a/newlib/libc/include/sys/unistd.h
+++ b/newlib/libc/include/sys/unistd.h
@@ -262,6 +262,7 @@ void *  _sbrk (ptrdiff_t __incr);
 int     _unlink (const char *__path);
 _READ_WRITE_RETURN_TYPE _write (int __fd, const void *__buf, size_t __nbyte);
 int     _execve (const char *__path, char * const __argv[], char * const __envp[]);
+int     _getentropy (void *, size_t);
 #endif
 
 #if !defined(__INSIDE_CYGWIN__)
-- 
2.25.1



More information about the Newlib mailing list