Revert "readdir*: use helper functions for unaligned access"

This reverts commit 450a6c5dce2b031ebd85b1d3359357875c2ffb7f.

Linux kernel ensures that contained records are aligned suitable.
stpcpy: moved from compat into common lib

stpcpy(3) is defined by posix and gcc-4.8 autogenerates calls to it in
statements like

| strcpy(buf, a);
| strcat(buf, b);

which becomes

| strcpy(stpcpy(buf, a), b)

Signed-off-by: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
seekdir/telldir: fixed prototypes

The position used by seekdir(3) and telldir(3) is of type 'long', not of
type 'off_t'.

Signed-off-by: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
readdir: major fixes and improvements

Depending whether getdents(2) or getdents64(2) were called, the
internal __dirstream buffer contains objects of different types:

--- fs/readdir.c ---
struct linux_dirent {
        unsigned long   d_ino;
        unsigned long   d_off;
        unsigned short  d_reclen;
        char            d_name[1];
};

SYSCALL_DEFINE3(getdents, unsigned int, fd,
                struct linux_dirent __user *, dirent, unsigned int, count)

--- include/linux/dirent.h ---
struct linux_dirent64 {
        u64             d_ino;
        s64             d_off;
        unsigned short  d_reclen;
        unsigned char   d_type;
        char            d_name[0];
};

SYSCALL_DEFINE3(getdents64, unsigned int, fd,
                struct linux_dirent64 __user *, dirent, unsigned int, count)

Existing code mixed casts between these types and even with userspace
types which causes problems when 'long' is not a 64 bit type.

The patch:

* uses correct datatypes in readdir*(3), telldir() and seekdir()

* adds a flag telling whether getdents(2) or getdents64(2) were used
  to fill dir ents buffer

* fixes prototypes of getdents64(2) and getdents(2)

* adds testsuite programs

Signed-off-by: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>