diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2021-05-06 15:49:45 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2021-05-10 23:35:44 -0300 |
commit | 7b4e7ca9db350b53cc88ff3d0bc99279225f5cc7 (patch) | |
tree | 377ad643b275aa65c218e8c1336e3fd85f7a398d /stdio-common/flockfile.c | |
parent | 30685597a4f81c8dcd4dd7335debdb72ae450924 (diff) | |
download | glibc-7b4e7ca9db350b53cc88ff3d0bc99279225f5cc7.tar.gz glibc-7b4e7ca9db350b53cc88ff3d0bc99279225f5cc7.tar.xz glibc-7b4e7ca9db350b53cc88ff3d0bc99279225f5cc7.zip |
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.
Diffstat (limited to 'stdio-common/flockfile.c')
-rw-r--r-- | stdio-common/flockfile.c | 6 |
1 files changed, 3 insertions, 3 deletions
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 @@ <https://www.gnu.org/licenses/>. */ #include <stdio.h> - -#undef _IO_flockfile +#include <stdio-lock.h> 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) |