mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 18:57:34 +00:00
LibCore: Add syscall wrapper for mkstemp()
This commit is contained in:
parent
87b1ad2356
commit
aa7e8b5797
2 changed files with 9 additions and 0 deletions
|
@ -488,4 +488,12 @@ ErrorOr<pid_t> fork()
|
||||||
return pid;
|
return pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ErrorOr<int> mkstemp(Span<char> pattern)
|
||||||
|
{
|
||||||
|
int fd = ::mkstemp(pattern.data());
|
||||||
|
if (fd < 0)
|
||||||
|
return Error::from_syscall("mkstemp"sv, -errno);
|
||||||
|
return fd;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,5 +65,6 @@ ErrorOr<bool> isatty(int fd);
|
||||||
ErrorOr<void> symlink(StringView target, StringView link_path);
|
ErrorOr<void> symlink(StringView target, StringView link_path);
|
||||||
ErrorOr<void> mkdir(StringView path, mode_t);
|
ErrorOr<void> mkdir(StringView path, mode_t);
|
||||||
ErrorOr<pid_t> fork();
|
ErrorOr<pid_t> fork();
|
||||||
|
ErrorOr<int> mkstemp(Span<char> pattern);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue