1
Fork 0
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:
Andreas Kling 2021-12-16 21:10:59 +01:00
parent 87b1ad2356
commit aa7e8b5797
2 changed files with 9 additions and 0 deletions

View file

@ -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;
}
}