Update gnulib files.
[gsasl.git] / tests / threadsafety
blobfeb4bd863a9815cf5d7fdcdd54756b18dc781e20
1 #!/bin/sh
3 # Copyright (C) 2004, 2005, 2007 Simon Josefsson
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 FILES="$@"
19 FILES=${FILES:-$THREADSAFETY_FILES}
21 if test -z "$FILES"; then
22 echo "Usage: $0 [FILE...]"
23 exit 1
26 # http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_09.html
27 UNSAFE="asctime basename catgets crypt ctime dbm_clearerr dbm_close dbm_delete dbm_error dbm_fetch dbm_firstkey dbm_nextkey dbm_open dbm_store dirname dlerror drand48 ecvt encrypt endgrent endpwent endutxent fcvt ftw gcvt getc_unlocked getchar_unlocked getdate getenv getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getopt getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getutxent getutxid getutxline gmtime hcreate hdestroy hsearch inet_ntoa l64a lgamma lgammaf lgammal localeconv localtime lrand48 mrand48 nftw nl_langinfo ptsname putc_unlocked putchar_unlocked putenv pututxline rand readdir setenv setgrent setkey setpwent setutxent strerror strtok ttyname unsetenv wcstombs wctomb"
29 set -- $UNSAFE
30 cmd="-e [^_0-9a-z]($1"
31 shift
32 while test "$1"; do
33 cmd="${cmd}|$1"
34 shift
35 done
36 cmd="${cmd})[^_0-9a-z]*\("
38 if egrep $cmd $FILES; then
39 exit 1
42 exit 0