From 7b4e7ca9db350b53cc88ff3d0bc99279225f5cc7 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Thu, 6 May 2021 15:49:45 -0300 Subject: linux: Move flockfile/_IO_flockfile into libc The nptl version is used as default, since now with symbol always present the single-thread optimization is tricky. Hurd is not change, it is used it own lock scheme (which call _cthreads_flockfile). Checked on x86_64-linux-gnu. --- stdio-common/flockfile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'stdio-common/flockfile.c') diff --git a/stdio-common/flockfile.c b/stdio-common/flockfile.c index 0bc856a465..a66e0a731e 100644 --- a/stdio-common/flockfile.c +++ b/stdio-common/flockfile.c @@ -17,13 +17,13 @@ . */ #include - -#undef _IO_flockfile +#include void __flockfile (FILE *stream) { - /* Do nothing. Using this version does not do any locking. */ + stream->_flags2 |= _IO_FLAGS2_NEED_LOCK; + _IO_lock_lock (*stream->_lock); } weak_alias (__flockfile, flockfile); weak_alias (__flockfile, _IO_flockfile) -- cgit 1.4.1