alistair23-linux/tools
Arnaldo Carvalho de Melo 2515e61483 perf tools: Use readdir() instead of deprecated readdir_r()
The readdir() function is thread safe as long as just one thread uses a
DIR, which is the case when synthesizing events for pre-existing threads
by traversing /proc, so, to avoid breaking the build with glibc-2.23.90
(upcoming 2.24), use it instead of readdir_r().

See: http://man7.org/linux/man-pages/man3/readdir.3.html

"However, in modern implementations (including the glibc implementation),
concurrent calls to readdir() that specify different directory streams
are thread-safe.  In cases where multiple threads must read from the
same directory stream, using readdir() with external synchronization is
still preferable to the use of the deprecated readdir_r(3) function."

Noticed while building on a Fedora Rawhide docker container.

   CC       /tmp/build/perf/util/event.o
  util/event.c: In function '__event__synthesize_thread':
  util/event.c:466:2: error: 'readdir_r' is deprecated [-Werror=deprecated-declarations]
    while (!readdir_r(tasks, &dirent, &next) && next) {
    ^~~~~
  In file included from /usr/include/features.h:368:0,
                   from /usr/include/stdint.h:25,
                   from /usr/lib/gcc/x86_64-redhat-linux/6.0.0/include/stdint.h:9,
                   from /git/linux/tools/include/linux/types.h:6,
                   from util/event.c:1:
  /usr/include/dirent.h:189:12: note: declared here

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-i1vj7nyjp2p750rirxgrfd3c@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-05-12 10:22:54 -03:00
..
arch
build tools build: Use .s extension for preprocessed assembler code 2016-03-03 11:10:37 -03:00
cgroup
firewire
gpio gpio: present the consumer of a line to userspace 2016-02-25 21:07:23 +01:00
hv
iio
include Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-03-24 10:02:14 -07:00
laptop/freefall
lguest
lib tools/lib/lockdep: Fix unsupported 'basename -s' in run_tests.sh 2016-03-30 12:45:56 +02:00
net tools: bpf_jit_disasm: check for klogctl failure 2016-05-08 23:32:59 -04:00
nfsd
objtool objtool: Detect falling through to the next function 2016-04-16 11:14:17 +02:00
perf perf tools: Use readdir() instead of deprecated readdir_r() 2016-05-12 10:22:54 -03:00
power Merge branches 'pm-core', 'powercap' and 'pm-tools' 2016-04-08 21:46:56 +02:00
scripts tools: Move utilities.mak from perf to tools/scripts/ 2016-03-18 13:57:20 -03:00
spi
testing soreuseport: test mixed v4/v6 sockets 2016-04-14 21:14:04 -04:00
thermal/tmon
time
usb
virtio virtio_ring: Support DMA APIs 2016-03-02 17:01:57 +02:00
vm tools/vm/page-types.c: avoid memset() in walk_pfn() when count == 1 2016-03-17 15:09:34 -07:00
Makefile Merge branch 'core-objtool-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-03-20 18:23:21 -07:00