diff --git a/components/newlib/pthread.c b/components/newlib/pthread.c index 0440e39e52..60dfe2e362 100644 --- a/components/newlib/pthread.c +++ b/components/newlib/pthread.c @@ -8,12 +8,6 @@ const static char *TAG = "esp32_asio_pthread"; -int pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id) -{ - ESP_LOGW(TAG, "%s: not yet supported!", __func__); - return 0; -} - int pthread_setcancelstate(int state, int *oldstate) { return 0; diff --git a/components/pthread/pthread_cond_var.c b/components/pthread/pthread_cond_var.c index fc6f96e5aa..0395c2cca2 100644 --- a/components/pthread/pthread_cond_var.c +++ b/components/pthread/pthread_cond_var.c @@ -175,12 +175,45 @@ int pthread_cond_timedwait(pthread_cond_t *cv, pthread_mutex_t *mut, const struc return ret; } +// The following pthread_condattr_* function definitions are placed here to enable builds of code +// that references these functions but does not actively use them. + int pthread_condattr_init(pthread_condattr_t *attr) { - ESP_LOGV(TAG, "%s not yet implemented (%p)", __FUNCTION__, attr); + ESP_LOGW(TAG, "%s not yet implemented (%p)", __FUNCTION__, attr); return ENOSYS; } +int pthread_condattr_destroy(pthread_condattr_t *attr) +{ + ESP_LOGW(TAG, "%s not yet implemented (%p)", __FUNCTION__, attr); + return ENOSYS; +} + +int pthread_condattr_getpshared(const pthread_condattr_t *restrict attr, int *restrict pshared) +{ + ESP_LOGW(TAG, "%s not yet implemented (%p)", __FUNCTION__, attr); + return ENOSYS; +} + +int pthread_condattr_setpshared(pthread_condattr_t *attr, int pshared) +{ + ESP_LOGW(TAG, "%s not yet implemented (%p)", __FUNCTION__, attr); + return ENOSYS; +} + +int pthread_condattr_getclock(const pthread_condattr_t *restrict attr, clockid_t *restrict clock_id) +{ + ESP_LOGW(TAG, "%s not yet implemented (%p)", __FUNCTION__, attr); + return ENOSYS; +} + +int pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id) +{ + ESP_LOGW(TAG, "%s: not yet supported!", __func__); + return 0; // moved here from newlib, where it was 0 instead of ENOSYS +} + int pthread_cond_init(pthread_cond_t *cv, const pthread_condattr_t *att) { (void) att; /* Unused argument as of now */