head: fix bug with head -c-N when stdin is not at start

* src/head.c (elide_tail_bytes_file): Fix typo in lseek invocation.
* tests/misc/head-c.sh: Add test for this bug.
* NEWS: Document this.
head: port to Darwin and use simpler seeks

This removes an unportable assumption that if lseek succeeds, the
file is capable of seeking.  See: http://bugs.gnu.org/17145
* src/head.c (elseek): New function, for consistency in reporting
lseek failures.
(elide_tail_bytes_file, elide_tail_lines_seekable)
(elide_tail_lines_file, head_lines, head): Use it.
(elide_tail_bytes_file, elide_tail_lines_file):
New args CURRENT_POS and SIZE.  All uses changed.  Don't bother
invoking lseek, since we know the file's pos and size now.
(elide_tail_bytes_file): Change a local from uintmax_t to off_t,
since it fits.
(head): Use lseek only on regular files, since its behavior on
unseekable devices is implementation-defined.
* NEWS: Document this.
shred: port to GNU/Linux behavior with tape drives

See: http://bugs.gnu.org/17149
* src/shred.c [__linux__]: Include <sys/mtio.h>.
(dorewind): New function, which works around the lseek problem with
tape drives on GNU/Linux, the same way that dd does.
(dopass): Use it.  New arg ST, needed for dorewind.  All uses changed.
(do_wipefd): Don't rely on undefined behavior on integer overflow
of file sizes.  Use INT_ADD_OVERFLOW instead.
shred: shred one block even for empty files

* src/shred.c (do_wipefd): Shred one block of empty regular files.
This reverts an unintended part of the previous change.
cp: don't reserve a device number

* src/copy.c (copy_internal): Replace dev_t arg DEVICE with struct
stat pointer arg PARENT.  All callers changed.  This removes an
unwarranted assumption that dev_t values of 0 cannot occur in file
systems.  See: http://bugs.gnu.org/17179
shred: avoid a data pass on empty files

* src/shred.c (do_wipefd): Don't increase the size written
for an empty file up to a full block.  Also increase the size
to OFF_T_MAX in the edge case where we do overflow.
* NEWS: Mention the shred improvements from recent changes.
* tests/misc/shred-passes.sh: Adjust as we no longer
write a BLKSIZE of data for empty files.
shred: overwrite inode storage used by some file systems

* doc/coreutils.texi (shred invocation): Mention some reasons
why clearing slack space might be useful.
* src/shred.c (do_wipefd): Add initial writes for each pass
for small regular files in case the storage for those is
in the inode, and thus a larger write up to a block size would
bypass that.  Move the direct I/O control to...
(dopass): ... here so we can avoid enabling it for these small
initial writes.  It's better to retry direct I/O for each pass
anyway to handle the case where direct I/O is disabled for only
the last portion of a file when the size is not a multiple of
the block size.  Note we don't avoid the sync for the initial
write as it will be small but more importantly could be on a
different part of the disk and so worth doing independently
to ensure the write is not discarded.
* tests/misc/shred-exact.sh: Check some more direct I/O cases.
* NEWS: Mention the improvements.
The inode storage issue was mentioned by Paul Eggert.
maint: various cleanups

* tests/misc/numfmt.pl: Fix comment misspelling.
* src/cut.c: Likewise.
* src/tsort.c (detect_loop): Replace an fprintf() with error().