options/ansi: implement flockfile(3) and funlockfile(3)
@@ -1118,12 +1118,12 @@ int vasprintf(char **out, const char *format, __gnuc_va_list args) {
// Linux unlocked I/O extensions.
-void flockfile(FILE *) {
- mlibc::infoLogger() << "mlibc: File locking (flockfile) is a no-op" << frg::endlog;
+void flockfile(FILE *file_base) {
+ static_cast<mlibc::abstract_file *>(file_base)->_lock.lock();
}
-void funlockfile(FILE *) {
- mlibc::infoLogger() << "mlibc: File locking (funlockfile) is a no-op" << frg::endlog;
+void funlockfile(FILE *file_base) {
+ static_cast<mlibc::abstract_file *>(file_base)->_lock.unlock();
}
int ftrylockfile(FILE *) {
