summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibC/unistd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibC/unistd.cpp')
-rw-r--r--Userland/Libraries/LibC/unistd.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Userland/Libraries/LibC/unistd.cpp b/Userland/Libraries/LibC/unistd.cpp
index e3fbca0e9f..8e732f197a 100644
--- a/Userland/Libraries/LibC/unistd.cpp
+++ b/Userland/Libraries/LibC/unistd.cpp
@@ -673,11 +673,17 @@ int unlinkat(int dirfd, char const* pathname, int flags)
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/symlink.html
int symlink(char const* target, char const* linkpath)
{
+ return symlinkat(target, AT_FDCWD, linkpath);
+}
+
+// https://pubs.opengroup.org/onlinepubs/9699919799/functions/symlinkat.html
+int symlinkat(char const* target, int newdirfd, char const* linkpath)
+{
if (!target || !linkpath) {
errno = EFAULT;
return -1;
}
- Syscall::SC_symlink_params params { { target, strlen(target) }, { linkpath, strlen(linkpath) } };
+ Syscall::SC_symlink_params params { { target, strlen(target) }, { linkpath, strlen(linkpath) }, newdirfd };
int rc = syscall(SC_symlink, &params);
__RETURN_WITH_ERRNO(rc, rc, -1);
}