<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/154429>154429</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [libc] implement realpath
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          michaelrj-google
      </td>
    </tr>
</table>

<pre>
    Described in POSIX: https://pubs.opengroup.org/onlinepubs/9799919799/functions/realpath.html#

The realpath function resolves a path so that it doesn't have any `/./` or `/../` in it. It may also allocate a string of none is provided, similar to `strdup`.

Here's a checklist for what you'll need to do for this:
- [ ] Add the implementation of `realpath` in [`/src/stdlib`](https://github.com/llvm/llvm-project/tree/main/libc/src/stdlib)
- [ ] Add tests for `realpath` in [`/test/src/stdlib`](https://github.com/llvm/llvm-project/tree/main/libc/test/src/stdlib)
- [ ] Add `realpath` to [`entrypoints.txt`](https://github.com/llvm/llvm-project/blob/main/libc/config/linux/x86_64/entrypoints.txt) for at least x86_64 and whatever you're building on
- [ ] Add `realpath` to [`include/stdlib.yaml`](https://github.com/llvm/llvm-project/blob/main/libc/include/stdlib.yaml)

(Reserved for specific assignee)
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0lEGv4yYQxz8NvoyeZWMT2wcfso2s7qlV20NvFZiJzRaDBeP05dtX8F521bdPVVt1pYgoDJn5_WfgL2M0i0McmfjAxKWQB60-jJuZV4k2fHpavF8sFsrr-3jBOAejUINx8OMPP3_8lTVnWIn2yJoz4xPj036oWPod3RL8sZc-LIxP3lnjMIUYn4ZuGIY6rYxP18PNZLxLgYDS7pLWcqXNMt6w6syq8y8rwiMCj-MQMHp7wwgSciB6oFUSGALtMTrGO4JV3hCkuwM7VYxPZSI8VeDDY-OxYxwYKuEjwSbvIG30IK31syQECZGCcQv4KzjvEEyEPfib0agZ_w6i2YyVAcinrJGCPnZ2qsoX-u8xIONd4pxXnH-3JhJcfYA_Eu3dH4x31oJD1CmD9jlIq8kdrc5PwMQHYOICZ62BVgSz7RY3dCRzI_w1lX006FVMGmZWGMOcVtLWqLQjLoz3fx3YYmg9VDn7jfHJ2tvj62kP_hPOxPhEAZHxaZPGpaBR89vUfPiaFSPFrOZv-NKhb4v5XoV3aN8wpmFmRnQU7rs3jmJJz_Tf4ZT16iu42burWfJvdzwzPj33p99OLePT27p8yK2UBBZlJHg5CNLpfJPwhuH1NgUEdRir85V1_1iocbM9NH5uUnmXm_2f5b5fI08jfXj_E0YMN9RZa9xxNlczw8OjGB8KPTZ6aAZZ4Fh3QpzaqunqYh3nXkiBbd2qGmfsGlR912iuhLoKVVVtYUZecVH19cBrwUVdik43dacaKfu-17JmbYWbNLZMSpJvFSbGA8datC0fCisV2phtkvMXPTwZZhizcnUskbVVet7xSwYyZLO15j-Iy5fH-9nSiiPY8V-3N6Mlz3ylu438zwAAAP__lnjYWQ">