[PATCH] newlib: Add missing prototype for _getentropy

Torbjörn SVENSSON <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
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 <[email protected]>
---
 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.