1
6
7
13
14
15
16
17
18
19
20
21
22
33
34
35
44
45
/* ... */
#include <unistd.h>
#include <errno.h>
#include <limits.h>
#include "esp_err.h"
#include "esp_log.h"
#include "sdkconfig.h"6 includes
static const char *TAG = "sysconf";
#ifdef CONFIG_FREERTOS_UNICORE
#define CPU_NUM 1
#else
#define CPU_NUM CONFIG_SOC_CPU_CORES_NUM
#endif
long sysconf(int arg)
{
switch (arg) {
case _SC_NPROCESSORS_CONF:
case _SC_NPROCESSORS_ONLN:
return CPU_NUM;...
default:
errno = EINVAL;
return -1;...
}{...}
}{ ... }
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;
}{ ... }