1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:27:46 +00:00

LibCore+Tests: Add SeekableStream::truncate()

This commit is contained in:
Sam Atkins 2022-02-03 19:21:51 +00:00 committed by Tim Flynn
parent d9fb1b8c2e
commit 4d5080388a
4 changed files with 27 additions and 0 deletions

View file

@ -215,6 +215,11 @@ ErrorOr<off_t> File::seek(i64 offset, SeekMode mode)
return seek_result;
}
ErrorOr<void> File::truncate(off_t length)
{
return System::ftruncate(m_fd, length);
}
ErrorOr<int> Socket::create_fd(SocketDomain domain, SocketType type)
{
int socket_domain;