mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-21 10:19:03 +03:00
LibCore: Add syscall wrapper for ftruncate()
This commit is contained in:
parent
4bf08e4d52
commit
4a213869f2
Notes:
sideshowbarker
2024-07-18 00:48:47 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/4a213869f2f
@ -123,4 +123,11 @@ ErrorOr<void> close(int fd)
|
||||
return {};
|
||||
}
|
||||
|
||||
ErrorOr<void> ftruncate(int fd, off_t length)
|
||||
{
|
||||
if (::ftruncate(fd, length) < 0)
|
||||
return Error::from_syscall("ftruncate"sv, -errno);
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -24,5 +24,6 @@ ErrorOr<void*> mmap(void* address, size_t, int protection, int flags, int fd, of
|
||||
ErrorOr<void> munmap(void* address, size_t);
|
||||
ErrorOr<int> open(StringView path, int options, ...);
|
||||
ErrorOr<void> close(int fd);
|
||||
ErrorOr<void> ftruncate(int fd, off_t length);
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user