From 0d6ec596b67738f52389f32bd44bd3d28c2cf1fd Mon Sep 17 00:00:00 2001
From: "Eric S. Raymond" <esr@thyrsus.com>
Date: Tue, 21 Dec 2010 05:24:29 -0500
Subject: Be rigorous and list SuS entry points.

---
 deheader         | 251 ++++++++++++++++++++++++++++++++++++++++++++++++++-----
 test/README      |  53 ------------
 test/regress.chk |  46 +++++-----
 3 files changed, 258 insertions(+), 92 deletions(-)

diff --git a/deheader b/deheader
index b1c395c..0999f42 100755
--- a/deheader
+++ b/deheader
@@ -39,50 +39,155 @@ version = "0.4"
 # because they're required in order to satify dependencies on other platforms.
 # Note: This table is not yet complete.
 requirements = (
-    # Headers mandated by SuS that may not be required by a particular compiler,
-    # usually because all the argument types and the return type are composed
-    # from C scalar types.
+    # Headers mandated by SuS Version 2.
+    # a64l, l64a - convert between a 32-bit integer and a radix-64 ASCII string 
     (r"a64l()",          ["<stdlib.h>"]),
     (r"l64a()",          ["<stdlib.h>"]),
+    # abort - generate an abnormal process abort 
     (r"abort()",         ["<stdlib.h>"]),
+    # abs - return an integer absolute value 
+    (r"abs()",           ["<math.h>"]),
+    # access - determine accessibility of a file
     (r"access()",        ["<unistd.h>"]),
+    # acos - arc cosine function 
     (r"acos()",          ["<math.h>"]),
+    # acosh, asinh, atanh - inverse hyperbolic functions 
     (r"acosh()",         ["<math.h>"]),
+    # advance - pattern match given a compiled regular expression
     (r"advance()",       ["<regexp.h>"]),
+    # aio.h - asynchronous input and output
+    (r"aio_cancel()",    ["<aio.h>"]),
+    (r"aio_error()",     ["<aio.h>"]),
+    (r"aio_fsync()",     ["<aio.h>"]),
+    (r"aio_read()",      ["<aio.h>"]),
+    (r"aio_return()",    ["<aio.h>"]),
+    (r"aio_suspend()",   ["<aio.h>"]),
+    (r"aio_write()",     ["<aio.h>"]),
+    (r"lio_listio()",    ["<aio.h>"]),
+    # alarm - schedule an alarm signal
+    (r"alarm()",         ["<unistd.h>"]),
+    # asctime, asctime_r - convert date and time to a string 
+    (r"asctime()",       ["<time.h>"]),
+    (r"asctime_r()",     ["<time.h>"]),
+    # atan - arc tangent function 
     (r"atan()",          ["<math.h>"]),
+    # atan2 - arc tangent function 
     (r"atanh()",         ["<math.h>"]),
+    # atanh - hyperbolic arc tangent
     (r"atan2()",         ["<math.h>"]),
+    # atexit - register a function to run at process termination
+    (r"atexit()",        ["<stdlib.h>"]),
+    # atof - convert a string to double-precision number 
+    (r"atof()",          ["<stdlib.h>"]),
+    # atoi - convert a string to integer 
+    (r"atol()",          ["<stdlib.h>"]),
+    # atol - convert a string to long integer
+    (r"atol()",          ["<stdlib.h>"]),
+    # basename - return the last component of a pathname 
     (r"basename()",      ["<libgen.h>"]),
+    # bcmp - memory operations 
     (r"bcmp()",          ["<string.h>"]),
+    # bcopy - memory operations 
+    (r"bcopy()",         ["<string.h>"]),
+    # brk, sbrk - change space allocation (LEGACY) 
     (r"brk()",           ["<unistd.h>"]),
+    # bsd_signal - simplified signal facilities 
     (r"bsd_signal()",    ["<signal.h>"]),
+    # bsearch - binary search a sorted table 
     (r"bsort()",         ["<stdlib.h>"]),
+    # btowc - single-byte to wide-character conversion 
     (r"btowc()",         ["<stdio.h>", "<wchar.h>"]),
+    # bzero - memory operations 
     (r"bzero()",         ["<string.h>"]),
+    # calloc - a memory allocator
     (r"calloc()",        ["<stdlib.h>"]),
+    # catclose - close a message catalogue descriptor 
     (r"catclose()",      ["<nl_types.h>"]),
+    # catgets - read a program message 
     (r"catgets()",       ["<nl_types.h>"]),
+    # catopen - open a message catalogue 
     (r"catopen()",       ["<nl_types.h>"]),
+    # cbrt - cube root function 
     (r"cbrt()",          ["<math.h>"]),
+    # ceil - ceiling value function
     (r"ceil()",          ["<math.h>"]),
+    # cfgetispeed - get input baud rate 
     (r"cfgetispeed()",   ["<termios.h>"]),
+    # cfgetospeed - get output baud rate 
     (r"cfgetospeed()",   ["<termios.h>"]),
+    # cfsetispeed - set input baud rate 
     (r"cfsetispeed()",   ["<termios.h>"]),
+    # cfsetospeed - set output baud rate 
     (r"cfsetospeed()",   ["<termios.h>"]),
-    #(r"chdir()",         ["<unistd.h>"]),
+    # chdir - change working directory 
+    (r"chdir()",         ["<unistd.h>"]),
+    # chmod - change mode of a file 
     (r"chmod()",         ["<sys/stat.h>", "<sys/types.h>"]),
+    # chown - change owner and group of a file
     (r"chown()",         ["<sys/types.h>", "<unistd.h>"]),
-    #(r"chroot()",        ["<unistd.h>"]),
+    # chroot - change root directory (LEGACY)
+    (r"chroot()",        ["<unistd.h>"]),
+    # clearerr - clear indicators on a stream
+    (r"clearerr()",      ["<stdio.h>"]),
+    # clock - report CPU time used 
     (r"clock()",         ["<time.h>"]),
-    #(r"close()",         ["<unistd.h>"]),
+    # clock_settime, clock_gettime, clock_getres - clock and timer functions
+    (r"clock_settime()", ["<time.h>"]),
+    (r"clock_gettime()", ["<time.h>"]),
+    (r"clock_getres()", ["<time.h>"]),
+    # close - close a file descriptor 
+    (r"close()",         ["<unistd.h>"]),
+    # closedir - close a directory stream
+    (r"closedir()",      ["<sys/types.h>", "<dirent.h>"]),
+    # closelog, openlog, setlogmask, syslog - control system log 
+    (r"closelog()",      ["<syslog.h>"]),
+    (r"openlog()",       ["<syslog.h>"]),
+    (r"setlogmask()",    ["<syslog.h>"]),
+    (r"syslog()",        ["<syslog.h>"]),
+    # compile - produce a compiled regular expression
+    (r"compile()",       ["<regexp.h>"]),
+    # confstr - get configurable variables 
     (r"confstr()",       ["<unistd.h>"]),
+    # cos - cosine function 
     (r"cos()",           ["<math.h>"]),
+    # cosh - hyperbolic cosine function
     (r"cosh()",          ["<math.h>"]),
+    # creat - create a new file or rewrite an existing one 
+    (r"creat()",         ["<sys/types.h>", "<sys/stat.h>", "<fcntl.h>"]),
+    # crypt - string encoding function
     (r"crypt()",         ["<unistd.h>"]),
+    # ctermid - generate a pathname for controlling terminal
     (r"ctermid()",       ["<stdio.h>"]),
+    # ctime, ctime_r - convert a time value to date and time string
+    (r"ctime()",         ["<time.h>"]),
+    (r"ctime_r()",       ["<time.h>"]),
+    # cuserid - character login name of the user
     (r"cuserid()",       ["<stdio.h>"]),
+    # daylight - daylight savings time flag
+    (r"extern\s+int\s+daylight;", ["<time.h>"]),
+    # dbm_clearerr, dbm_close, dbm_delete, dbm_error, dbm_fetch, dbm_firstkey, dbm_nextkey, dbm_open, dbm_store - database functions 
+    (r"dbm_clearerr()",  ["<ndbm.h>"]),
+    (r"dbm_close()",     ["<ndbm.h>"]),
+    (r"dbm_delete()",    ["<ndbm.h>"]),
+    (r"dbm_error()",     ["<ndbm.h>"]),
+    (r"dbm_fetch()",     ["<ndbm.h>"]),
+    (r"dbm_firstkey()",  ["<ndbm.h>"]),
+    (r"dbm_nextkey()",   ["<ndbm.h>"]),
+    (r"dbm_open()",      ["<ndbm.h>"]),
+    (r"dbm_store()",     ["<ndbm.h>"]),
+    # difftime - compute the difference between two calendar time values
+    (r"difftime()",      ["<time.h>"]),
+    # dirname - report the parent directory name of a file pathname
     (r"dirname()",       ["<libgen.h>"]),
-    (r"umask()",         ["<sys/stat.h>", "<sys/types.h>"]),
+    # div - compute the quotient and remainder of an integer division 
+    (r"div()",           ["<stdio.h>"]),
+    # dlclose - close a dlopen() object
+    (r"dlclose()",       ["<dlfcn.h>"]),
+    # dlerror - get diagnostic information
+    (r"dlerror()",       ["<dlfcn.h>"]),
+    # dlsym - obtain the address of a symbol from a dlopen() object 
+    (r"dlsym()",         ["<dlfcn.h>"]),
+    #     drand48, erand48, jrand48, lcong48, lrand48, mrand48, nrand48, seed48, srand48 - generate uniformly distributed pseudo-random numbers
     (r"drand48()",       ["<stdlib.h>"]),
     (r"erand48()",       ["<stdlib.h>"]),
     (r"jrand48()",       ["<stdlib.h>"]),
@@ -92,100 +197,208 @@ requirements = (
     (r"nrand48()",       ["<stdlib.h>"]),
     (r"seed48()",        ["<stdlib.h>"]),
     (r"srand48()",       ["<stdlib.h>"]),
-    #(r"dup()",           ["<unistd.h>"]),
-    #(r"dup2()",          ["<unistd.h>"]),    
-    #(r"exit()",          ["<stdlib.h>"]),    
-    #(r"_exit()",         ["<unistd.h>"]),    
-    #(r"ecvt()",          ["<stdlib.h>"]),    
-    #(r"fcvt()",          ["<stdlib.h>"]),    
-    #(r"gcvt()",          ["<stdlib.h>"]),
-    (r"encrypt()",        ["<unistd.h>"]),    
+    # dup, dup2 - duplicate an open file descriptor
+    (r"dup()",           ["<unistd.h>"]),
+    (r"dup2()",          ["<unistd.h>"]),
+    # exit, _exit - terminate a process 
+    (r"exit()",          ["<stdlib.h>"]),    
+    (r"_exit()",         ["<unistd.h>"]),
+    # ecvt, fcvt, gcvt - convert a floating-point number to a string
+    (r"ecvt()",          ["<stdlib.h>"]),    
+    (r"fcvt()",          ["<stdlib.h>"]),    
+    (r"gcvt()",          ["<stdlib.h>"]),
+    # encrypt - encoding function
+    (r"encrypt()",        ["<unistd.h>"]),
+    # endgrent, getgrent, setgrent - group database entry functions 
+    (r"endgrent()",      ["<grp.h>"]),
+    (r"getgrent()",      ["<grp.h>"]),
+    (r"setgrent()",      ["<grp.h>"]),
+    # endpwent, getpwent, setpwent - user database functions
+    (r"endpwent()",      ["<pwd.h>"]),
+    (r"getpwent()",      ["<pwd.h>"]),
+    (r"setpwent()",      ["<pwd.h>"]),
+    # endutxent, getutxent, getutxid, getutxline, pututxline, setutxent - user accounting database functions 
+    (r"endutxent()",     ["<utmpx.h>"]),
+    (r"getutxent()",     ["<utmpx.h>"]),
+    (r"getutxid()",      ["<utmpx.h>"]),
+    (r"getutxline()",    ["<utmpx.h>"]),
+    (r"pututxline()",    ["<utmpx.h>"]),
+    (r"setutxent()",     ["<utmpx.h>"]),
+    # erf, erfc - error and complementary error functions
     (r"erf()",           ["<math.h>"]),
     (r"erfc()",          ["<math.h>"]),
+    # environ, execl, execv, execle, execve, execlp, execvp - execute a file
+    (r"extern\s+char\s+\*\*environ;",         ["<unistd.h>"]),
     (r"execl()",         ["<unistd.h>"]),
     (r"execv()",         ["<unistd.h>"]),
     (r"execle()",        ["<unistd.h>"]),
     (r"execve()",        ["<unistd.h>"]),
     (r"execlp()",        ["<unistd.h>"]),
     (r"execvp()",        ["<unistd.h>"]),
+    # exp - exponential function
     (r"exp()",           ["<math.h>"]),
+    #     expm1 - compute exponential functions 
     (r"expm1()",         ["<math.h>"]),
+    # FD_CLR - macros for synchronous I/O multiplexing
     (r"FD_CLR()",        ["<time.h>"]),
     (r"FD_ISSET()",      ["<time.h>"]),
     (r"FD_SET()",        ["<time.h>"]),
     (r"FD_ZERO()",       ["<time.h>"]),
+    # fabs - absolute value function
     (r"fabs()",          ["<math.h>"]),
+    # fattach - attach a STREAMS-based file descriptor to a file in the file system name space 
     (r"fattach()",       ["<stropts.h>"]),
+    # fchdir - change working directory 
     (r"fchdir()",        ["<unistd.h>"]),
+    # fchmod - change mode of a file
     (r"fchmod()",        ["<sys/stat,h>"]),
+    # fchown - change owner and group of a file
     (r"fdopen()",        ["<stdio.h>"]),
+    # fclose - close a stream
     (r"fclose()",        ["<stdio.h>"]),
+    # fdatasync - synchronise the data of a file
     (r"fdatasync()",     ["<unistd.h>"]),
+    # fdetach - detach a name from a STREAMS-based file descriptor 
     (r"fdetach()",       ["<stropts.h>"]),
+    # fdopen - associate a stream with a file descriptor 
     (r"fdopen()",        ["<stdio.h>"]),
+    # ferror - test error indicator on a stream
     (r"ferror()",        ["<stdio.h>"]),
+    # feof - test end-of-file indicator on a stream
     (r"feof()",          ["<stdio.h>"]),
+    # fflush - flush a stream 
     (r"fflush()",        ["<stdio.h>"]),
+    # ffs - find first set bit
     (r"ffs()",           ["<strings.h>"]),
+    # fgetc - get a byte from a stream
     (r"fgetc()",         ["<stdio.h>"]),
+    # fgetpos - get current file position information
     (r"fgetpos()",       ["<stdio.h>"]),
+    # fgets - get a string from a stream
     (r"fgets()",         ["<stdio.h>"]),
+    # fgetwc - get a wide-character code from a stream
     (r"fgetwc()",        ["<stdio.h>", "<wchar.h>"]),
+    # fgetws - get a wide-character string from a stream 
     (r"fgetws()",        ["<stdio.h>", "<wchar.h>"]),
+    # fileno - map a stream pointer to a file descriptor
     (r"fileno()",        ["<stdio.h>"]),
+    # flockfile, ftrylockfile, funlockfile - stdio locking functions 
     (r"flockfile()",     ["<stdio.h>"]),
     (r"ftrylockfile()",  ["<stdio.h>"]),
     (r"funlockfile()",   ["<stdio.h>"]),
+    # fmod - floating-point remainder value function 
     (r"fmod()",          ["<math.h>"]),
+    # fmtmsg.h - message display structures
     (r"fmtmsg()",        ["<fmtmsg.h>"]),
+    # fnmatch.h - filename-matching types
     (r"fnmatch()",       ["<fnmatch.h>"]),
+    # fopen - open a stream
     (r"fopen()",         ["<stdio.h>"]),
+    # fork - create a new process
     (r"fork()",          ["<sys/types.h>", "<unistd.h>"]),
+    # fpathconf, pathconf - get configurable pathname variables 
     (r"fpathconf()",     ["<unistd.h>"]),
     (r"pathconf()",      ["<unistd.h>"]),
+    # fputc - put a byte on a stream
     (r"fputc()",         ["<stdio.h>"]),
+    # fputs - put a string on a stream
+    (r"fputs()",         ["<stdio.h>"]),
+    # fputwc - put a wide-character code on a stream
     (r"fputwc()",        ["<stdio.h>"]),
+    # fputws - put a wide-character string on a stream
     (r"fputws()",        ["<stdio.h>"]),
+    # fread - binary input
     (r"fread()",         ["<stdio.h>"]),
+    # free - free allocated memory
     (r"free()",          ["<stdlib.h>"]),
+    # freopen - open a stream
     (r"freopen()",       ["<stdio.h>"]),
+    # frexp - extract mantissa and exponent from a double precision number
     (r"frexp()",         ["<math.h>"]),
+    # fscanf, scanf, sscanf - convert formatted input
     (r"fscanf()",        ["<stdio.h>"]),
     (r"scanf()",         ["<stdio.h>"]),
     (r"sscanf()",        ["<stdio.h>"]),
+    # fseek, fseeko - reposition a file-position indicator in a stream
     (r"fseek()",         ["<stdio.h>"]),
     (r"fseeko()",        ["<stdio.h>"]),
+    # fsetpos - set current file position
     (r"fsetpos()",       ["<stdio.h>"]),
+    # fstat - get file status
     (r"fstat()",         ["<sys/types.h>", "<sys/stat.h>"]),
+    # fstatvfs, statvfs - get file system information
     (r"fstatvfs()",      ["<sys/fstatvfs.h>"]),
     (r"statvfs()",       ["<sys/fstatvfs.h>"]),
+    # fsync - synchronise changes to a file
     (r"fsync()",         ["<unistd.h>"]),
+    # ftell, ftello - return a file offset in a stream
     (r"ftell()",         ["<stdio.h>"]),
     (r"ftello()",        ["<stdio.h>"]),
+    # ftime - get date and time
     (r"ftime()",         ["<sys/timeb.h>"]),
+    # ftok - generate an IPC key 
     (r"ftok()",          ["<sys/ipc.h>"]),
+    # ftruncate, truncate - truncate a file to a specified length 
     (r"truncate()",      ["<unistd.h>"]),
     (r"ftruncate()",     ["<unistd.h>"]),
+    # ftw - traverse (walk) a file tree 
     (r"ftw()",           ["<ftw.h>"]),
     (r"nftw()",          ["<ftw.h>"]),
+    # fwide - set stream orientation
     (r"fwide()",         ["<stdio.h>", "<wchar.h>"]),
+    # fwprintf, wprintf, swprintf - print formatted wide-character output
     (r"fwprintf()",      ["<stdio.h>", "<wchar.h>"]),
     (r"wprintf()",       ["<stdio.h>", "<wchar.h>"]),
     (r"swprintf()",      ["<stdio.h>", "<wchar.h>"]),
+    # fwrite - binary output
     (r"fwrite()",        ["<stdio.h>"]),
+    # fwscanf, wscanf, swscanf - convert formatted wide-character input
     (r"fwscanf()",       ["<stdio.h>", "<wchar.h>"]),
     (r"wscanf()",        ["<stdio.h>", "<wchar.h>"]),
     (r"swscanf()",       ["<stdio.h>", "<wchar.h>"]),
+    # gamma, signgam - log gamma function
     (r"gamma()",         ["<math.h>"]),
+    # getc - get a byte from a stream
     (r"getc()",          ["<stdio.h>"]),
+    # getc_unlocked, getchar_unlocked, putc_unlocked, putchar_unlocked - stdio with explicit client locking 
     (r"getc_unlocked()", ["<stdio.h>"]),
     (r"getchar_unlocked()", ["<stdio.h>"]),
     (r"putc_unlocked()",    ["<stdio.h>"]),
     (r"putchar_unlocked()", ["<stdio.h>"]),
+    # getchar - get a byte from a stdin stream
     (r"getchar()",          ["<stdio.h>"]),
-    # Header dependencies implies by SuS
-    (r"<dirent.h>",      ["<sys/types.h>"]),
-    (r"<fcntl.h>",       ["<sys/stat.h>", "<sys/types.h>"]),
+    # getcontext, setcontext - get and set current user context
+    (r"getcontext()",       ["<ucontext.h>"]),
+    (r"setcontext()",       ["<ucontext.h>"]),
+    # getcwd - get the pathname of the current working directory 
+    (r"getcwd()",        ["<unistd.h>"]),
+    # getdate - convert user format date and time
+    (r"getdate()",       ["<time.h>"]),
+    # getdtablesize - get the file descriptor table size
+    (r"getdtablesize()", ["<unistd.h>"]),
+    # getegid - get the effective group ID
+    (r"getegid()",       ["<unistd.h>", "<sys/types.h>"]),
+    # getenv - get value of an environment variable 
+    (r"getenv()",        ["<stdlib.h>"]),
+    # geteuid - get the effective user ID
+    (r"geteuid()",       ["<unistd.h>", "<sys/types.h>"]),
+    # getgid - get the real group ID
+    (r"getgid()",        ["<unistd.h>", "<sys/types.h>"]),
+    # getgrgid, getgrgid_r - get group database entry for a group ID
+    (r"getgrgid()",      ["<sys/types.h>", "<grp.h"]),
+    (r"getgrgid_r()",    ["<sys/types.h>", "<grp.h"]),
+    # getgrnam, getgrnam_r - search group database for a name 
+    (r"getgrginam()",    ["<sys/types.h>", "<grp.h"]),
+    (r"getgrnam_r()",    ["<sys/types.h>", "<grp.h"]),
+    # getgroups - get supplementary group IDs
+    (r"getgroups()",     ["<unistd.h>", "<sys/types.h>"]),
+    # gethostid - get an identifier for the current host
+    (r"gethostid()",     ["<unistd.h>"]),
+    # getitimer, setitimer - get or set value of interval timer
+    (r"getitimer()",     ["<sys/time.h>"]),
+    (r"setitimer()",     ["<sys/time.h>"]),
+
+    (r"umask()",         ["<sys/stat.h>", "<sys/types.h>"]),
     # Dependencies observed on systems other than the Linux this was
     # developed under.
     (r"<sys/socket.h>",  ["<sys/stat.h>", "<sys/types.h>"]),
@@ -401,7 +614,7 @@ def c_analyze(sourcefile, maker, includes, requires, verbosity):
     stillhere = map(trim, includes)
     for required in requires:
         if not required in stillhere:
-            print "deheader: in %s, %s is required for portability but not present.\n" % (sourcefile, required)
+            print "deheader: in %s, %s is required for portability but not present." % (sourcefile, required)
     return unneeded
 
 def deheader(sourcefile, maker, includes, requires, remove, verbose):
diff --git a/test/README b/test/README
index 21012b8..5eb212e 100644
--- a/test/README
+++ b/test/README
@@ -1,55 +1,2 @@
 This directory contains C sourcfiles intended to test deheader, and
 a check against which to compare the output.
-
-Many of these examples are takem from the Single Unix Standard's list
-of section 2 and 3 entry points.  I don't necessarily test anything in
-SuS with a structure- or pointer-to-structure type argument; that will
-fail as it should on any modern compiler because the struct is neither
-defined nor the derived pointer type forward-declared with a stub.  I
-also ignore any header that declares only macros.
-
-SuS things excluded by these criteria:
-
-aio.h     - aio_* entry points for asynchronous input and output
-time.h    - asctime() and asctime_r()
-assert.h  - assert() macro
-syslog.h  - closelog(), openlog(), setlogmask(), syslog()
-rexgexp.h - advance() is tested, compile() is not.
-unistd.h  - confstr(), exec*(), fchdir(), fdatasync() not tested.
-math.h    - cos(), cosh(): these will need <math.h>.
-stdio.h   - ctermid(), fdopen(), feof(), ferror(), fflush(), fgetc() not tested.
-time.h    - ctime_r(), difftime(), and daylight are not tested, but ctime() is.
-ctype.h   - not tested; all the macro defs would be unresolved. 
-stdio.h   - cuserid() not tested; SuS includes <stdio.h>
-ndbm.h    - all functions rely on the DBM datatype
-dirent.h  - all entry points depend on struct dirent.
-libgen.h  - basename() tested, dirname() not.
-stdio.h   - div() not tested; SuS includes <stdio.h>
-dlfcn.h   - dlclose(), dlerror(), dlopen(), dlsym() not tested
-grp.h     - functions not tested, getgrent() depends on <grp.h>
-pwd.h     - functions not tested, getpwent() depends on <pwd.h>
-utmpx.h   - functions not tested, most depend on <utmpx.h>
-math.h    - erf(), erfc(), exp(), expm1(), fabs(), floor(). fmod() not tested.
-stropts.h - fattach(), fdetach() not tested
-time.h    - FD_* macros are not tested
-strings.h - ffs() not tested.
-stdio.h   - fgetpos(), fgets(), fileno(), f*lockfile(), fopen(), not tested.
-wchar.h   - fgetwc(), fgetws(), fwide() not tested.
-fmtmsg.h  - fmtmsg() not tested.
-fnmatch.h - fnmatch() not tested.
-unistd.h  - fork(), fpathconf(), free(), fsnyc(), *truncate() not tested.
-stdio.h   - *printf*, fputc(), fputwc(), fputws(), fread(), fwrite() not tested.
-stdio.h   - freopen(), fscanf(), sscanf(), feek(), fseeko() not tested.
-stdio.h   - fsetpos(), ftell(), ftello(), getc(), getchar() not tested.
-math.h    - frexp(), gamma() not tested.
-sys/statvfs.h - fstatvfs(), statvfs() untested.
-sys/timeb.h   - ftime() not tested.
-sys/ipc.h     - ftok()
-ftw.h     - ftw(), nftw() not tested.
-wchar.h   - fwprintf(), wprintf(), swprintf() not tested.
-wchar.h   - fwscanf(), wscanf(), swscanf() not tested.
-stdio.h   - getc_unlocked(), getchar_unlocked() not tested.
-stdio.h   - putc_unlocked(), putchar_unlocked() not tested.
-
-For other dependencies not tested, see the commented-out lines in deheader's
-dependency table.
diff --git a/test/regress.chk b/test/regress.chk
index 00fbafc..9519cdf 100644
--- a/test/regress.chk
+++ b/test/regress.chk
@@ -1,3 +1,4 @@
+deheader: ./chdir.c has requires <unistd.h> from chdir()
 deheader: ./chdir.c includes <unistd.h>
 deheader: ./string.c includes <string.h>
 deheader: ./bzero.c has requires <string.h> from bzero()
@@ -9,9 +10,9 @@ deheader: ./duplicate.c includes <stdio.h>
 deheader: ./duplicate.c has more than one inclusion of <stdio.h>
 deheader: ./brk.c has requires <unistd.h> from brk()
 deheader: ./brk.c includes <unistd.h>
+deheader: ./closedir.c has requires <sys/types.h>,<dirent.h> from closedir()
 deheader: ./closedir.c includes <sys/types.h>
 deheader: ./closedir.c includes <dirent.h>
-deheader: ./closedir.c has requires <sys/types.h> from <dirent.h>
 deheader: ./asinh.c includes <math.h>
 deheader: ./fchmod.c has requires <sys/stat,h> from fchmod()
 deheader: ./fchmod.c includes <sys/types.h>
@@ -28,11 +29,14 @@ deheader: ./bcmp.c has requires <string.h> from bcmp()
 deheader: ./bcmp.c includes <string.h>
 deheader: ./ceil.c has requires <math.h> from ceil()
 deheader: ./ceil.c includes <math.h>
+deheader: ./bcopy.c has requires <string.h> from bcopy()
 deheader: ./bcopy.c includes <string.h>
+deheader: ./atexit.c has requires <stdlib.h> from atexit()
 deheader: ./atexit.c includes <stdlib.h>
 deheader: ./btowc.c has requires <stdio.h>,<wchar.h> from btowc()
 deheader: ./btowc.c includes <stdio.h>
 deheader: ./btowc.c includes <wchar.h>
+deheader: ./abs.c has requires <math.h> from abs()
 deheader: ./abs.c includes <stdlib.h>
 deheader: ./calloc.c has requires <stdlib.h> from calloc()
 deheader: ./calloc.c includes <stdlib.h>
@@ -45,17 +49,20 @@ deheader: ./atoi.c includes <stdlib.h>
 deheader: ./cfsetispeed.c has requires <termios.h> from cfsetispeed()
 deheader: ./cfsetispeed.c includes <termios.h>
 deheader: ./sbrk.c includes <unistd.h>
+deheader: ./ctime.c has requires <time.h> from ctime()
 deheader: ./ctime.c includes <time.h>
 deheader: ./fstat.c has requires <sys/types.h>,<sys/stat.h> from fstat()
 deheader: ./fstat.c includes <sys/stat.h>
 deheader: ./fstat.c includes <sys/types.h>
 deheader: ./fclose.c has requires <stdio.h> from fclose()
 deheader: ./fclose.c includes <stdio.h>
+deheader: ./alarm.c has requires <unistd.h> from alarm()
 deheader: ./alarm.c includes <unistd.h>
 deheader: ./cfgetospeed.c has requires <termios.h> from cfgetospeed()
 deheader: ./cfgetospeed.c includes <termios.h>
 deheader: ./acos.c has requires <math.h> from acos()
 deheader: ./acos.c includes <math.h>
+deheader: ./clock_gettime.c has requires <time.h> from clock_gettime()
 deheader: ./clock_gettime.c includes <time.h>
 deheader: ./abort.c has requires <stdlib.h> from abort()
 deheader: ./abort.c includes <stdlib.h>
@@ -74,6 +81,7 @@ deheader: ./clock.c has requires <time.h> from clock()
 deheader: ./clock.c includes <time.h>
 deheader: ./basename.c has requires <libgen.h> from basename()
 deheader: ./basename.c includes <libgen.h>
+deheader: ./clearerr.c has requires <stdio.h> from clearerr()
 deheader: ./clearerr.c includes <stdio.h>
 deheader: ./asin.c includes <math.h>
 deheader: ./bsort.c has requires <stdlib.h> from bsort()
@@ -83,6 +91,7 @@ deheader: ./bsort.c includes <string.h>
 deheader: ignoring <string.h> (conditional inclusion)
 deheader: ./bsort.c includes <stdlib.h>
 deheader: ./bsort.c has requires <stdio.h> from scanf()
+deheader: ./chroot.c has requires <unistd.h> from chroot()
 deheader: ./chroot.c includes <unistd.h>
 deheader: ./catgets.c has requires <nl_types.h> from catgets()
 deheader: ./catgets.c includes <nl_types.h>
@@ -91,9 +100,11 @@ deheader: ./cbrt.c includes <math.h>
 deheader: ./chown.c has requires <sys/types.h>,<unistd.h> from chown()
 deheader: ./chown.c includes <sys/types.h>
 deheader: ./chown.c includes <unistd.h>
+deheader: ./clock_settime.c has requires <time.h> from clock_settime()
 deheader: ./clock_settime.c includes <time.h>
 deheader: ./crypt.c has requires <unistd.h> from crypt()
 deheader: ./crypt.c includes <unistd.h>
+deheader: ./clock_getres.c has requires <time.h> from clock_getres()
 deheader: ./clock_getres.c includes <time.h>
 deheader: ./fchown.c includes <unistd.h>
 deheader: ./advance.c has requires <regexp.h> from advance()
@@ -101,17 +112,18 @@ deheader: ./advance.c has requires <stdio.h> from getc()
 deheader: ./advance.c includes <regexp.h>
 deheader: ./catopen.c has requires <nl_types.h> from catopen()
 deheader: ./catopen.c includes <nl_types.h>
+deheader: ./close.c has requires <unistd.h> from close()
 deheader: ./close.c includes <unistd.h>
 deheader: ./atan2.c has requires <math.h> from atan2()
 deheader: ./atan2.c includes <math.h>
 deheader: ./catclose.c has requires <nl_types.h> from catclose()
 deheader: ./catclose.c includes <nl_types.h>
-deheader: ./clock_getres.c without <time.h> failed (512).
+deheader: in ./clock_getres.c, retaining required '#include <time.h>\n'
 deheader: ./asin.c without <math.h> succeeded.
 deheader: remove <math.h> from ./asin.c
 deheader: in ./cbrt.c, retaining required '#include <math.h>\n'
 deheader: in ./acos.c, retaining required '#include <math.h>\n'
-deheader: ./clock_gettime.c without <time.h> failed (512).
+deheader: in ./clock_gettime.c, retaining required '#include <time.h>\n'
 deheader: in ./catopen.c, retaining required '#include <nl_types.h>\n'
 deheader: in ./brk.c, retaining required '#include <unistd.h>\n'
 deheader: in ./atan2.c, retaining required '#include <math.h>\n'
@@ -119,52 +131,47 @@ deheader: ./string.c without <string.h> succeeded.
 deheader: remove <string.h> from ./string.c
 deheader: in ./bsort.c, retaining required '#include <stdlib.h>\n'
 deheader: in ./bsort.c, <stdio.h> is required for portability but not present.
-
 deheader: in ./cfgetospeed.c, retaining required '#include <termios.h>\n'
 deheader: in ./catclose.c, retaining required '#include <nl_types.h>\n'
 deheader: in ./cfgetispeed.c, retaining required '#include <termios.h>\n'
 deheader: in ./ceil.c, retaining required '#include <math.h>\n'
 deheader: in ./bsd_signal.c, retaining required '#include <signal.h>\n'
 deheader: ./abs.c without <stdlib.h> succeeded.
+deheader: in ./abs.c, <math.h> is required for portability but not present.
 deheader: remove <stdlib.h> from ./abs.c
 deheader: in ./basename.c, retaining required '#include <libgen.h>\n'
-deheader: ./ctime.c without <time.h> failed (512).
+deheader: in ./ctime.c, retaining required '#include <time.h>\n'
 deheader: in ./cfsetospeed.c, retaining required '#include <termios.h>\n'
 deheader: in ./abort.c, retaining required '#include <stdlib.h>\n'
 deheader: in ./atan.c, retaining required '#include <math.h>\n'
-deheader: ./clock_settime.c without <time.h> failed (512).
+deheader: in ./clock_settime.c, retaining required '#include <time.h>\n'
 deheader: ./duplicate.c without <stdio.h> succeeded.
 deheader: ./duplicate.c without <stdio.h> succeeded.
 deheader: remove <stdio.h> from ./duplicate.c
 deheader: remove <stdio.h> from ./duplicate.c
-deheader: ./chdir.c without <unistd.h> succeeded.
-deheader: remove <unistd.h> from ./chdir.c
+deheader: in ./chdir.c, retaining required '#include <unistd.h>\n'
 deheader: in ./atanh.c, retaining required '#include <math.h>\n'
-deheader: ./close.c without <unistd.h> succeeded.
-deheader: remove <unistd.h> from ./close.c
-deheader: ./bcopy.c without <string.h> failed (512).
+deheader: in ./close.c, retaining required '#include <unistd.h>\n'
+deheader: in ./bcopy.c, retaining required '#include <string.h>\n'
 deheader: in ./crypt.c, retaining required '#include <unistd.h>\n'
 deheader: in ./cfsetispeed.c, retaining required '#include <termios.h>\n'
 deheader: ./fchmod.c without <sys/types.h> succeeded.
 deheader: in ./fchmod.c, <sys/stat,h> is required for portability but not present.
-
 deheader: remove <sys/types.h> from ./fchmod.c
 deheader: in ./atof.c, retaining required '#include <stdlib.h>\n'
-deheader: ./chroot.c without <unistd.h> succeeded.
-deheader: remove <unistd.h> from ./chroot.c
+deheader: in ./chroot.c, retaining required '#include <unistd.h>\n'
 deheader: in ./atol.c, retaining required '#include <stdlib.h>\n'
 deheader: in ./atoi.c, retaining required '#include <stdlib.h>\n'
 deheader: ./asinh.c without <math.h> succeeded.
 deheader: remove <math.h> from ./asinh.c
-deheader: ./alarm.c without <unistd.h> succeeded.
-deheader: remove <unistd.h> from ./alarm.c
+deheader: in ./alarm.c, retaining required '#include <unistd.h>\n'
 deheader: ./sbrk.c without <unistd.h> succeeded.
 deheader: remove <unistd.h> from ./sbrk.c
 deheader: in ./fclose.c, retaining required '#include <stdio.h>\n'
 deheader: in ./umask.c, retaining required '#include <sys/types.h>\n'
 deheader: in ./umask.c, retaining required '#include <sys/stat.h>\n'
 deheader: in ./calloc.c, retaining required '#include <stdlib.h>\n'
-deheader: ./atexit.c without <stdlib.h> failed (512).
+deheader: in ./atexit.c, retaining required '#include <stdlib.h>\n'
 deheader: in ./bzero.c, retaining required '#include <string.h>\n'
 deheader: in ./access.c, retaining required '#include <unistd.h>\n'
 deheader: in ./btowc.c, retaining required '#include <wchar.h>\n'
@@ -180,6 +187,5 @@ deheader: in ./chown.c, retaining required '#include <unistd.h>\n'
 deheader: in ./chown.c, retaining required '#include <sys/types.h>\n'
 deheader: in ./advance.c, retaining required '#include <regexp.h>\n'
 deheader: in ./advance.c, <stdio.h> is required for portability but not present.
-
-deheader: ./clearerr.c without <stdio.h> failed (512).
-deheader: saw 57 files, 63 includes, 12 removed
+deheader: in ./clearerr.c, retaining required '#include <stdio.h>\n'
+deheader: saw 57 files, 63 includes, 8 removed
-- 
cgit v1.2.3-70-g09d2