Translate /proc/pid/maps entries to Parrot files.

Previously, Parrot would allow the real /proc/pid/maps to be read by the
tracee:

    $ ./parrot/src/parrot_run -- /bin/sh -c 'cat /proc/self/maps'
    2014/11/07 13:43:40.97 parrot_run[17941] notice: parrot_run 4.3.0 has not been tested on Linux 3.17.2-1-ARCH yet, this may not work
    00400000-0040c000 r-xp 00000000 08:05 138107                             /usr/bin/cat
    0060b000-0060c000 r--p 0000b000 08:05 138107                             /usr/bin/cat
    0060c000-0060d000 rw-p 0000c000 08:05 138107                             /usr/bin/cat
    00640000-00661000 rw-p 00000000 00:00 0                                  [heap]
    7f9dee799000-7f9deeb98000 r--p 00212000 00:11 377681                     /dev/shm/parrot-channel.hBPJ43 (deleted)
    7f9deeb98000-7f9deed31000 r-xp 0002d000 00:11 377681                     /dev/shm/parrot-channel.hBPJ43 (deleted)
    7f9deed31000-7f9deef31000 ---p 001c6000 00:11 377681                     /dev/shm/parrot-channel.hBPJ43 (deleted)
    7f9deef31000-7f9deef35000 r--p 001c6000 00:11 377681                     /dev/shm/parrot-channel.hBPJ43 (deleted)
    7f9deef35000-7f9deef37000 rw-p 001ca000 00:11 377681                     /dev/shm/parrot-channel.hBPJ43 (deleted)
    7f9deef37000-7f9deef3b000 rw-p 00000000 00:00 0
    7f9deef3b000-7f9deef5d000 r-xp 00000000 08:05 140227                     /usr/lib/ld-2.20.so
    7f9def11a000-7f9def13f000 rw-p 00000000 00:00 0
    7f9def15c000-7f9def15d000 r--p 00021000 08:05 140227                     /usr/lib/ld-2.20.so
    7f9def15d000-7f9def15e000 rw-p 00022000 08:05 140227                     /usr/lib/ld-2.20.so
    7f9def15e000-7f9def15f000 rw-p 00000000 00:00 0
    7fffbea3a000-7fffbea5b000 rw-p 00000000 00:00 0                          [stack]
    7fffbeaa6000-7fffbeaa8000 r--p 00000000 00:00 0                          [vvar]
    7fffbeaa8000-7fffbeaaa000 r-xp 00000000 00:00 0                          [vdso]
    ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

Which is leaking the presence of the channel to the tracee. That by itself is
not a big deal but OpenCL uses paths in the memory mappings to locate
configuration files. So, Parrot needs to give the "real" path back to the
application when reading this file.

Fixes #596.
Lookup the pfs_process to get the right table.
Include full dirent information for getdents.

Also fixes the kernel structure definition and d_reclen.

From #593:

    Parrot currently discards information returned in the dirent structure by readdir, for the local service. Right now, it only cares about dirent.d_name.

    This causes a problem for glibc's implementation of
    sysconf(_SC_NPROCESSORS_CONF) in __get_nprocs_conf. __get_nprocs_conf relies on
    the sysfs file system returning the file type in dirent.d_type, specifically
    looking for CPU directories like cpu0. Because all entries returned by Parrot
    look like regular files, glibc thinks there are 0 cpus and returns 0.

    This causes OpenCL to fail to run because it depends on this value for scheduling. This has caused problems for Dan Bradley, reported in [1].

    The fix for this will be to save all of the dirent information we can and pass that on to applications.

    [1] https://listserv.nd.edu/cgi-bin/wa?A2=ind1410&L=CCTOOLS&F=&S=&P=5902

Fixes #593.
Optimize dirent size and batch copy out.

On Linux, the kernel dirent structure looks like:

struct {
    uint64_t d_ino; /* uint32_t for getdents on i386 */
    uint64_t d_off; /* uint32_t for getdents on i386 */
    uint16_t d_reclen;
    char d_name[]; /* variable size */
    char padding[]; /* to ensure 8-byte alignment */
    uint8_t d_type; /* useful on supported file systems... */
};

The structure must be 8-byte aligned. [For i386, it may be 32-bit aligned but
expanding the padding to 64-bit alignment is harmless and keeps things
consistent.]

Because of d_type being at the end, it's not very useful to define these fields
in a structure (since the structure size changes depending on d_name). So
pfs_dispatch*.cc now just explicitly writes out the fields into a buffer.

All of the dirents are batched into one large write for the copy out. This is a
performance optimization (as is this whole commit).

Lastly, the maximum size of the getdents buffer is 64K. glibc only ever uses
32K so this seems like a safe limit.
Merge remote-tracking branch 'ccl/pull/595/head'

* ccl/pull/595/head:
  Optimize dirent size and batch copy out.
  Include full dirent information for getdents.
Merge remote-tracking branch 'ccl/pull/597/head'

* ccl/pull/597/head:
  Lookup the pfs_process to get the right table.
  Translate /proc/pid/maps entries to Parrot files.
Fix chirp exe paths in chirp-common.sh

Since Parrot tests also use this...

Fixes #603.
Success for ticket_get is >= 0.
Use common I/O and output buffers for all RPCs.

The common I/O buffer:

+       void *buffer = xxmalloc(MAX_BUFFER_SIZE); /* general purpose temporary buffer */

is allocated once and used for all I/O RPC. We no longer repeatedly reallocate
a buffer for pwrite/pread/etc.

The output buffer for RPCs is now in a buffer_t. Most RPC now use this for
"extra" output (e.g. pread) instead of allocating memory on the heap each time.

There is also other smaller cleanup such as using fewer variables on the stack,
better variable scoping, and consistent error handling. Also a few minor bugs
have been fixed, like the stat update for unlink.
Merge pull request #601 from dthain/master

Makeflow Wrapper: $RULE -> %%
Merge remote-tracking branch 'ccl/pull/609/head'

* ccl/pull/609/head:
  Use common I/O and output buffers for all RPCs.
  Success for ticket_get is >= 0.
Use cheaper static array.
Use simpler stack buffer.
Remove redundant free.
Use exit/fatal.
Fixed caching behavior in work queue: all files are cached upon request.
Previously, renamed files were not cached, due to deficiencies in the
worker cache structure, but this was fixed in the most recent worker cleanup.
Handle /proc/self/fd and /dev/fd.

Parrot was trying to open these file descriptors as normal files. However,
these descriptors might actually refer to a native file, like a socket, so
Parrot should pass the open on to the kernel unmodified. In the case of a
Parrot file descriptor, we want to create a new file description (pfs_pointer).

readdir on /proc/self/fd also now omits special file descriptors (like the
channel). This might not be the best solution. In an ideal scenario, the tracee
can't see the channel at all. However, the channel does use up one of its file
descriptors and that has side-effects (e.g. dup2 to the channel file descriptor
will inexplicably fail, from the application's perspective). Any fix for this
is probably involved and I'm not aware of any application negatively affected
by this.  The best solution for now seem to be to hide the channel in
/proc/self/fd results. [I *have* seen applications try to close the channel fd
before, because they found it via readdir on /prof/self/fd.]

Fixes #598.
Fixed missing case: caching flag must also be set in submit_simple.
Use absolute path for --prefix

This makes our recursive Make install work with relative paths.
Remove necessary but troublesome -n echo option

Darwin doesn't support the echo -n option. For this use-case, we don't need it
though.