mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 16:16:43 +00:00
LibCore: Add syscall wrapper for mkstemp()
This commit is contained in:
parent
87b1ad2356
commit
aa7e8b5797
Notes:
sideshowbarker
2024-07-17 22:41:29 +09:00
Author: https://github.com/awesomekling
Commit: aa7e8b5797
2 changed files with 9 additions and 0 deletions
|
@ -488,4 +488,12 @@ ErrorOr<pid_t> fork()
|
|||
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> mkdir(StringView path, mode_t);
|
||||
ErrorOr<pid_t> fork();
|
||||
ErrorOr<int> mkstemp(Span<char> pattern);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue