inline int pthread_rwlock_init(pthread_rwlock_t *lock, const pthread_rwlockattr_t *attr) { __CPROVER_HIDE:; (*(signed char *)lock)=0; if(attr!=0) (void)*attr; #ifdef __CPROVER_CUSTOM_BITVECTOR_ANALYSIS __CPROVER_cleanup(lock, pthread_rwlock_cleanup); #endif return 0; }
inline int pthread_mutex_init( pthread_mutex_t *mutex, const pthread_mutexattr_t *mutexattr) { __CPROVER_HIDE:; *((__CPROVER_mutex_t *)mutex)=0; if(mutexattr!=0) (void)*mutexattr; #ifdef __CPROVER_CUSTOM_BITVECTOR_ANALYSIS __CPROVER_cleanup(mutex, pthread_mutex_cleanup); __CPROVER_set_must(mutex, "mutex-init"); __CPROVER_clear_may(mutex, "mutex-destroyed"); if(__CPROVER_get_must(mutexattr, "mutexattr-recursive")) __CPROVER_set_must(mutex, "mutex-recursive"); #endif return 0; }
inline FILE *fopen(const char *filename, const char *mode) { __CPROVER_HIDE:; (void)*filename; (void)*mode; #ifdef __CPROVER_STRING_ABSTRACTION __CPROVER_assert(__CPROVER_is_zero_string(filename), "fopen zero-termination of 1st argument"); __CPROVER_assert(__CPROVER_is_zero_string(mode), "fopen zero-termination of 2nd argument"); #endif FILE *fopen_result; _Bool fopen_error; fopen_result=fopen_error?NULL:malloc(sizeof(FILE)); #ifdef __CPROVER_CUSTOM_BITVECTOR_ANALYSIS __CPROVER_set_must(fopen_result, "open"); __CPROVER_cleanup(fopen_result, fclose_cleanup); #endif return fopen_result; }