CBMC
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
c
d
e
f
g
j
l
m
r
t
w
Functions
a
c
d
f
g
r
t
w
Typedefs
Enumerations
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
i
k
l
m
o
p
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
h
i
k
l
m
n
o
p
q
r
s
t
u
v
Related Symbols
b
c
d
e
g
i
j
m
n
o
s
t
u
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
w
y
Typedefs
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Enumerations
_
a
b
c
d
f
g
i
l
m
p
r
s
t
u
v
w
Enumerator
_
a
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
Macros
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
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
20
__CPROVER_bool
__VERIFIER_nondet___CPROVER_bool
(
void
);
21
size_t
__VERIFIER_nondet_size_t
(
void
);
22
23
ssize_t
getrandom
(
void
*
buf
,
size_t
buflen
,
unsigned
int
flags)
24
{
25
if
(flags &
GRND_NONBLOCK
&&
__VERIFIER_nondet___CPROVER_bool
())
26
return
-1;
27
28
char
bytes[
buflen
];
29
__CPROVER_array_replace
(
buf
, bytes);
30
31
size_t
actual_bytes
=
__VERIFIER_nondet_size_t
();
32
__CPROVER_assume
(
actual_bytes
<=
buflen
);
33
return
(
ssize_t
)
actual_bytes
;
34
}
35
36
#endif
ait
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition
ai.h:562
__CPROVER_array_replace
void __CPROVER_array_replace(const void *dest, const void *src)
__CPROVER_assume
void __CPROVER_assume(__CPROVER_bool assumption)
__VERIFIER_nondet___CPROVER_bool
__CPROVER_bool __VERIFIER_nondet___CPROVER_bool(void)
__VERIFIER_nondet_size_t
size_t __VERIFIER_nondet_size_t(void)
src
ansi-c
library
random.c
Generated by
1.9.8