File tree 2 files changed +50
-0
lines changed
2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -1749,3 +1749,51 @@ int __stdio_common_vfprintf(
1749
1749
}
1750
1750
1751
1751
#endif
1752
+
1753
+ /* FUNCTION: __srget */
1754
+
1755
+ #ifdef __FreeBSD__
1756
+
1757
+ # ifndef __CPROVER_STDIO_H_INCLUDED
1758
+ # include <stdio.h>
1759
+ # define __CPROVER_STDIO_H_INCLUDED
1760
+ # endif
1761
+
1762
+ int __VERIFIER_nondet_int (void );
1763
+
1764
+ int __srget (FILE * stream )
1765
+ {
1766
+ (void )* stream ;
1767
+
1768
+ // FreeBSD's implementation returns a character or EOF; __VERIFIER_nondet_int
1769
+ // will capture all these options
1770
+ return __VERIFIER_nondet_int ();
1771
+ }
1772
+
1773
+ #endif
1774
+
1775
+ /* FUNCTION: __swbuf */
1776
+
1777
+ #ifdef __FreeBSD__
1778
+
1779
+ # ifndef __CPROVER_STDIO_H_INCLUDED
1780
+ # include <stdio.h>
1781
+ # define __CPROVER_STDIO_H_INCLUDED
1782
+ # endif
1783
+
1784
+ __CPROVER_bool __VERIFIER_nondet___CPROVER_bool (void );
1785
+
1786
+ int __swbuf (int c , FILE * stream )
1787
+ {
1788
+ (void )c ;
1789
+ (void )* stream ;
1790
+
1791
+ // FreeBSD's implementation returns `c` or or EOF in case writing failed; we
1792
+ // just non-deterministically choose between these
1793
+ if (__VERIFIER_nondet___CPROVER_bool ())
1794
+ return EOF ;
1795
+ else
1796
+ return c ;
1797
+ }
1798
+
1799
+ #endif
Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ perl -p -i -e 's/^__isoc99_v?sscanf\n//' __functions # sscanf, Linux
45
45
perl -p -i -e ' s/^__sigsetjmp\n//' __functions # sigsetjmp, Linux
46
46
perl -p -i -e ' s/^__stdio_common_vfscanf\n//' __functions # fscanf, Windows
47
47
perl -p -i -e ' s/^__stdio_common_vsscanf\n//' __functions # sscanf, Windows
48
+ perl -p -i -e ' s/^__srget\n//' __functions # gets, FreeBSD
49
+ perl -p -i -e ' s/^__swbuf\n//' __functions # putc, FreeBSD
48
50
49
51
# Some functions are covered by existing tests:
50
52
perl -p -i -e ' s/^__CPROVER_deallocate\n//' __functions # free-01
You can’t perform that action at this time.
0 commit comments