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

LibC: Implement `flockfile and funlockfile`

To do this, we must set the type attribute when initializing a FILE to
``__PTHREAD_MUTEX_RECURSIVE``.
This commit is contained in:
Conor Byrne 2022-01-01 00:18:21 +00:00 committed by Brian Gianforcaro
parent aa0db4e4b0
commit 8515d7d5ab
2 changed files with 11 additions and 10 deletions

View file

@ -1228,15 +1228,17 @@ int vscanf(const char* fmt, va_list ap)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/flockfile.html
void flockfile([[maybe_unused]] FILE* filehandle)
void flockfile(FILE* filehandle)
{
dbgln("FIXME: Implement flockfile()");
VERIFY(filehandle);
filehandle->lock();
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/funlockfile.html
void funlockfile([[maybe_unused]] FILE* filehandle)
void funlockfile(FILE* filehandle)
{
dbgln("FIXME: Implement funlockfile()");
VERIFY(filehandle);
filehandle->unlock();
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/tmpfile.html