From e874d3d189f355fdf0e9ef9c0d0f493c6cf767be Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Thu, 6 May 2021 16:01:15 -0300 Subject: linux: Move ftrylockfile/_IO_ftrylockfile 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_ftrylockfile). Checked on x86_64-linux-gnu. --- stdio-common/ftrylockfile.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'stdio-common/ftrylockfile.c') diff --git a/stdio-common/ftrylockfile.c b/stdio-common/ftrylockfile.c index 4f7e2dd617..f7e2ef6137 100644 --- a/stdio-common/ftrylockfile.c +++ b/stdio-common/ftrylockfile.c @@ -17,14 +17,13 @@ . */ #include - -#undef _IO_ftrylockfile +#include +#include int __ftrylockfile (FILE *stream) { - /* Do nothing. Using this version does not do any locking. */ - return 1; + return _IO_lock_trylock (*stream->_lock); } weak_alias (__ftrylockfile, ftrylockfile); weak_alias (__ftrylockfile, _IO_ftrylockfile) -- cgit 1.4.1