mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 06:37:36 +00:00
LibC: Move realpath() to <stdlib.h>
This commit is contained in:
parent
fbcab844de
commit
196b64c0ae
4 changed files with 102 additions and 102 deletions
|
@ -578,20 +578,6 @@ int umount(const char* mountpoint)
|
|||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
char* realpath(const char* pathname, char* buffer)
|
||||
{
|
||||
size_t size = PATH_MAX;
|
||||
if (buffer == nullptr)
|
||||
buffer = (char*)malloc(size);
|
||||
int rc = syscall(SC_realpath, pathname, buffer, size);
|
||||
if (rc < 0) {
|
||||
errno = -rc;
|
||||
return nullptr;
|
||||
}
|
||||
errno = 0;
|
||||
return buffer;
|
||||
}
|
||||
|
||||
void dump_backtrace()
|
||||
{
|
||||
syscall(SC_dump_backtrace);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue