feat(newlib): add dummy implementations of pathconf, chmod, dirfd

Closes https://github.com/espressif/esp-idf/issues/14174
This commit is contained in:
Ivan Grokhotkov
2024-09-25 17:35:00 +02:00
parent 5f405375f9
commit 684d3e6d01
2 changed files with 46 additions and 2 deletions
+27 -1
View File
@@ -1,13 +1,18 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <unistd.h>
#include <errno.h>
#include <limits.h>
#include "esp_err.h"
#include "esp_log.h"
#include "sdkconfig.h"
static const char *TAG = "sysconf";
#ifdef CONFIG_FREERTOS_UNICORE
#define CPU_NUM 1
#else
@@ -25,3 +30,24 @@ long sysconf(int arg)
return -1;
}
}
// pathconf
long fpathconf(int fildes, int name)
{
if (name == _PC_PATH_MAX) {
return PATH_MAX;
}
ESP_LOGW(TAG, "fpathconf: unsupported name %d", name);
errno = EINVAL;
return -1;
}
long pathconf(const char *path, int name)
{
if (name == _PC_PATH_MAX) {
return PATH_MAX;
}
ESP_LOGW(TAG, "pathconf: unsupported name %d", name);
errno = EINVAL;
return -1;
}