newlib: Add missing prototype for _getentropy

Message ID 20230925183744.848448-1-torbjorn.svensson@foss.st.com
State New
Headers
Series newlib: Add missing prototype for _getentropy |

Commit Message

Torbjörn SVENSSON Sept. 25, 2023, 6:37 p.m. UTC
  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(+)
  

Comments

Jeff Johnston Sept. 25, 2023, 10:21 p.m. UTC | #1
Pushed to master.  Thanks.

-- Jeff J.

On Mon, Sep 25, 2023 at 2:40 PM Torbjörn SVENSSON <
torbjorn.svensson@foss.st.com> wrote:

> 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
>
>
  

Patch

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__)