File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
regression/cbmc-library/pipe-01 Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 6
6
#endif
7
7
8
8
#include <assert.h>
9
+ #include <errno.h>
9
10
10
11
int main ()
11
12
{
12
13
int filedesc [2 ];
13
14
15
+ errno = 0 ;
14
16
#ifdef _WIN32
15
17
int ret = _pipe (filedesc , 1000 , O_BINARY );
16
18
#else
17
19
int ret = pipe (filedesc );
18
20
#endif
19
21
22
+ __CPROVER_assert (errno != EMFILE , "EMFILE" );
23
+ __CPROVER_assert (errno != ENFILE , "ENFILE" );
24
+
20
25
__CPROVER_assume (ret == 0 );
21
26
22
27
char data [2 ] = {7 , 42 };
Original file line number Diff line number Diff line change 3
3
4
4
^EXIT=10$
5
5
^SIGNAL=0$
6
- ^\[main\.assertion\.4\] .* assertion data\[1\] == 31: FAILURE$
7
- ^\*\* 1 of 5 failed
6
+ ^\[main\.assertion\.1\] line 22 EMFILE: FAILURE$
7
+ ^\[main\.assertion\.2\] line 23 ENFILE: FAILURE$
8
+ ^\[main\.assertion\.6\] .* assertion data\[1\] == 31: FAILURE$
9
+ ^\*\* 3 of 7 failed
8
10
--
9
11
^warning: ignoring
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ int pipe(int fildes[2])
59
59
__CPROVER_bool error = __VERIFIER_nondet___CPROVER_bool ();
60
60
if (error )
61
61
{
62
- errno = error == 1 ? EMFILE : ENFILE ;
62
+ errno = __VERIFIER_nondet___CPROVER_bool () ? EMFILE : ENFILE ;
63
63
return -1 ;
64
64
}
65
65
You can’t perform that action at this time.
0 commit comments