mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:57:35 +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;
|
||||
}
|
||||
|
||||
ErrorOr<int> mkstemp(Span<char> pattern)
|
||||
{
|
||||
int fd = ::mkstemp(pattern.data());
|
||||
if (fd < 0)
|
||||
return Error::from_syscall("mkstemp"sv, -errno);
|
||||
return fd;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue