RT-Thread / RT-Thread/rt-thread

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

Open
#6,549 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
12.2k
Forks
5.4k
Avg merge
4d 12h
Merged PRs (30d)
40

Description

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 平台上,此功能存在异常

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided realpath test from the RT-Thread/userapps example under QEMU on ARM or RV64 and confirm errno 38 on smart. Trace the smart platform's realpath and filesystem integration, then verify that the call resolves /bin/test.txt and supports the MicroPython mpy tets.py use case without returning Function not implemented.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.