From ddc339c51fa436e91eba083029bec3849997899e Mon Sep 17 00:00:00 2001 From: Christian Mauderer Date: Mon, 13 Nov 2017 09:21:28 +0100 Subject: cpukit: Add _arc4random_getentropy_fail. Add a default implementation of _arc4random_getentropy_fail with an internal error. Update #3239. --- cpukit/libcsupport/Makefile.am | 3 ++- cpukit/libcsupport/src/arc4random_getentropy_fail.c | 21 +++++++++++++++++++++ cpukit/sapi/src/interrtext.c | 3 ++- cpukit/score/include/rtems/score/interr.h | 3 ++- 4 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 cpukit/libcsupport/src/arc4random_getentropy_fail.c (limited to 'cpukit') diff --git a/cpukit/libcsupport/Makefile.am b/cpukit/libcsupport/Makefile.am index 756526ae8e..038ac93548 100644 --- a/cpukit/libcsupport/Makefile.am +++ b/cpukit/libcsupport/Makefile.am @@ -116,7 +116,8 @@ TERMINAL_IDENTIFICATION_C_FILES += src/ttyname.c LIBC_GLUE_C_FILES = src/__getpid.c src/__gettod.c src/__times.c \ src/truncate.c src/access.c src/stat.c src/lstat.c src/pathconf.c \ src/newlibc_reent.c src/newlibc_exit.c \ - src/kill_noposix.c src/utsname.c src/realpath.c + src/kill_noposix.c src/utsname.c src/realpath.c \ + src/arc4random_getentropy_fail.c BSD_LIBC_C_FILES = src/strlcpy.c src/strlcat.c src/issetugid.c diff --git a/cpukit/libcsupport/src/arc4random_getentropy_fail.c b/cpukit/libcsupport/src/arc4random_getentropy_fail.c new file mode 100644 index 0000000000..88aa1ca328 --- /dev/null +++ b/cpukit/libcsupport/src/arc4random_getentropy_fail.c @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2017 embedded brains GmbH. All rights reserved. + * + * embedded brains GmbH + * Dornierstr. 4 + * 82178 Puchheim + * Germany + * + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include +#include + +void _arc4random_getentropy_fail( void ) +{ + _Internal_error( INTERNAL_ERROR_ARC4RANDOM_GETENTROPY_FAIL ); +} diff --git a/cpukit/sapi/src/interrtext.c b/cpukit/sapi/src/interrtext.c index 6fada4be26..79ba7948ef 100644 --- a/cpukit/sapi/src/interrtext.c +++ b/cpukit/sapi/src/interrtext.c @@ -65,7 +65,8 @@ static const char *const internal_error_text[] = { "INTERNAL_ERROR_LIBIO_SEM_CREATE_FAILED", "INTERNAL_ERROR_LIBIO_STDOUT_FD_OPEN_FAILED", "INTERNAL_ERROR_LIBIO_STDERR_FD_OPEN_FAILED", - "INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT" + "INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT", + "INTERNAL_ERROR_ARC4RANDOM_GETENTROPY_FAIL" }; const char *rtems_internal_error_text( rtems_fatal_code error ) diff --git a/cpukit/score/include/rtems/score/interr.h b/cpukit/score/include/rtems/score/interr.h index ca64341948..0c02c21348 100644 --- a/cpukit/score/include/rtems/score/interr.h +++ b/cpukit/score/include/rtems/score/interr.h @@ -178,7 +178,8 @@ typedef enum { INTERNAL_ERROR_LIBIO_SEM_CREATE_FAILED = 35, INTERNAL_ERROR_LIBIO_STDOUT_FD_OPEN_FAILED = 36, INTERNAL_ERROR_LIBIO_STDERR_FD_OPEN_FAILED = 37, - INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT = 38 + INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT = 38, + INTERNAL_ERROR_ARC4RANDOM_GETENTROPY_FAIL = 39 } Internal_errors_Core_list; typedef CPU_Uint32ptr Internal_errors_t; -- cgit v1.2.3