summaryrefslogtreecommitdiff
path: root/Libraries/LibC/stdlib.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2020-01-06 11:32:25 +0100
committerAndreas Kling <awesomekling@gmail.com>2020-01-06 11:32:25 +0100
commit7c916b9fe9ce5ac68b8a63e36f1682951e10da9d (patch)
tree2e57a77cdf79c3bafaa4b7d124cbe4fc41a18f94 /Libraries/LibC/stdlib.cpp
parentd6b06fd5a31ef6489895690f5fc4e0df113ea01e (diff)
downloadserenity-7c916b9fe9ce5ac68b8a63e36f1682951e10da9d.zip
Kernel: Make realpath() take path+length, get rid of SmapDisabler
Diffstat (limited to 'Libraries/LibC/stdlib.cpp')
-rw-r--r--Libraries/LibC/stdlib.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Libraries/LibC/stdlib.cpp b/Libraries/LibC/stdlib.cpp
index f8e3477ec4..bfac7194dd 100644
--- a/Libraries/LibC/stdlib.cpp
+++ b/Libraries/LibC/stdlib.cpp
@@ -704,10 +704,15 @@ uint32_t arc4random_uniform(uint32_t max_bounds)
char* realpath(const char* pathname, char* buffer)
{
+ if (!pathname) {
+ errno = EFAULT;
+ return nullptr;
+ }
size_t size = PATH_MAX;
if (buffer == nullptr)
buffer = (char*)malloc(size);
- int rc = syscall(SC_realpath, pathname, buffer, size);
+ Syscall::SC_realpath_params params { pathname, strlen(pathname), buffer, size };
+ int rc = syscall(SC_realpath, &params);
if (rc < 0) {
errno = -rc;
return nullptr;