]>
git.proxmox.com Git - ceph.git/blob - ceph/src/pmdk/utils/check-os.sh
2 # SPDX-License-Identifier: BSD-3-Clause
3 # Copyright 2017-2019, Intel Corporation
6 # Used to check if there are no banned functions in .o file
8 # usage: ./check-os.sh [os.h path] [.o file] [.c file]
10 EXCLUDE
="os_posix|os_thread_posix"
11 if [[ $2 =~
$EXCLUDE ]]; then
16 symbols
=$
(nm
--demangle --undefined-only --format=posix
$2 |
sed 's/ U *//g')
17 functions
=$
(cat $1 |
tr '\n' '|')
18 functions
=${functions%?} # remove trailing | character
22 grep -wE $functions <<<"$sym"
23 done |
sed 's/$/\(\)/g')
26 echo -e "`pwd`/$3:1: non wrapped function(s):\n$out\nplease use os wrappers" &&
27 rm -f $2 && # remove .o file as it don't match requirements