1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:28:12 +00:00

Kernel: Support F_SETLKW in fcntl

This commit is contained in:
Idan Horowitz 2022-07-14 02:17:01 +03:00 committed by Andreas Kling
parent 9db10887a1
commit 3a80b25ed6
7 changed files with 133 additions and 29 deletions

View file

@ -45,7 +45,10 @@ ErrorOr<FlatPtr> Process::sys$fcntl(int fd, int cmd, uintptr_t arg)
TRY(description->get_flock(Userspace<flock*>(arg)));
return 0;
case F_SETLK:
TRY(description->apply_flock(Process::current(), Userspace<flock const*>(arg)));
TRY(description->apply_flock(Process::current(), Userspace<flock const*>(arg), ShouldBlock::No));
return 0;
case F_SETLKW:
TRY(description->apply_flock(Process::current(), Userspace<flock const*>(arg), ShouldBlock::Yes));
return 0;
default:
return EINVAL;