CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
random.c
Go to the documentation of this file.
1/* FUNCTION: getrandom */
2
3#ifndef __CPROVER_ERRNO_H_INCLUDED
4#include <errno.h>
5#define __CPROVER_ERRNO_H_INCLUDED
6#endif
7
8#if defined(__GLIBC__) && \
9 (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 25))
10
11# ifndef __CPROVER_SYS_RANDOM_H_INCLUDED
12# include <sys/random.h>
13# define __CPROVER_SYS_RANDOM_H_INCLUDED
14# endif
15
16# ifndef GRND_NONBLOCK
17# define GRND_NONBLOCK 0
18# endif
19
21size_t __VERIFIER_nondet_size_t(void);
22
23ssize_t getrandom(void *buf, size_t buflen, unsigned int flags)
24{
26 return -1;
27
28 char bytes[buflen];
30
33 return (ssize_t)actual_bytes;
34}
35
36#endif
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
void __CPROVER_array_replace(const void *dest, const void *src)
void __CPROVER_assume(__CPROVER_bool assumption)
__CPROVER_bool __VERIFIER_nondet___CPROVER_bool(void)
size_t __VERIFIER_nondet_size_t(void)