rt-thread icon indicating copy to clipboard operation
rt-thread copied to clipboard

【BUG】:在smart中,realpath函数未实现

Open xqyjlj opened this issue 3 years ago • 1 comments

在 https://github.com/RT-Thread/userapps 中,编写以下代码:

#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char **argv)
{
    char *pathbuf = malloc(PATH_MAX);
    char *basedir = realpath(argv[1], pathbuf);
    if (basedir == NULL) {
        printf("%s: can't open file '%s': [Errno %d] %s\n", argv[0], argv[1], errno, strerror(errno));
    }
    free(pathbuf);
    return 0;
}

在qemu中执行 bin/realpath.elf /bin/test.txt arm 以及 rv64 均会发生此错误:

bin/realpath.elf: can't open file '/bin/test.txt': [Errno 38] Function not implemented

不清楚是因为编译器的问题,还是因为是smart底层没有对接此函数?

这是我在移植 micropython 时发现的,micropython中使用此函数实现 mpy tets.py 的效果,因此在 smart 平台上,此功能存在异常

xqyjlj avatar Oct 22 '22 03:10 xqyjlj

smart相关,请提交到gitee/rt-smart分支去吧

BernardXiong avatar Oct 24 '22 12:10 BernardXiong