syscalls,x86: implement execveat() system call

Add a new execveat(2) system call. execveat() is to execve() as
openat() is to open(): it takes a file descriptor that refers to a
directory, and resolves the filename relative to that.

In addition, if the filename is empty and AT_EMPTY_PATH is specified,
execveat() executes the file to which the file descriptor refers. This
replicates the functionality of fexecve(), which is a system call in
other UNIXen, but in Linux glibc it depends on opening
"/proc/self/fd/<fd>" (and so relies on /proc being mounted).

The filename fed to the executed program as argv[0] (or the name of the
script fed to a script interpreter) will be of the form "/dev/fd/<fd>"
(for an empty filename) or "/dev/fd/<fd>/<filename>", effectively
reflecting how the executable was found.  This does however mean that
execution of a script in a /proc-less environment won't work; also,
script execution via an O_CLOEXEC file descriptor fails (as the file
will not be accessible after exec).

Only x86-64, i386 and x32 ABIs are supported in this patch.

Based on patches by Meredydd Luff <meredydd@senatehouse.org>

Signed-off-by: David Drysdale <drysdale@google.com>
syscalls,x86: add selftest for execveat(2)

Signed-off-by: David Drysdale <drysdale@google.com>
fs: Add anon_new_inode_getfile

Create a variant of anon_inode_getfile() that gets a new file instance
that is attached to a new anonymous inode.  This allow attributes
associated with the inode (e.g. mode) to be changed specifically for
this file instance.

Signed-off-by: David Drysdale <drysdale@google.com>
kernel/fork.c: add option to return task_struct

Add a new do_fork_task() entry point, equivalent to do_fork but which
also optionally returns a reference to the new struct task_struct,
and implement do_fork() in terms of this.

Signed-off-by: David Drysdale <drysdale@google.com>
procdesc: Add support for process descriptors

Add support for process descriptors, which are special file descriptors
associated with a process.  The termination of a task that has an extant
process descriptor is reported as a POLLHUP event on the file
descriptor, rather than by generating a SIGCHLD to the parent process.

Also, wildcard wait4(2) operations do not reap zombie processes that
have an extant process descriptor (although a wait4(2) operation that
explicitly specifies the pid of such a process will reap it).

When all process descriptors associated with a process are closed, the
process is terminated with SIGKILL unless the PD_DAEMON flag was set at
process creation time.

Signed-off-by: David Drysdale <drysdale@google.com>
procdesc: wire up process descriptor syscalls

Add the hooks for syscalls related to process descriptors.  These are:
 - pdfork: create new process, as per fork(2), with associated
   process descriptor.
 - pdgetpid: get the PID value associated with a process descriptor.
 - pdkill: send signal to process identified by process descriptor.
 - pdwait4: perform a wait4(2) operation on a process identified by
   process descriptor.

Signed-off-by: David Drysdale <drysdale@google.com>