core: implement pselect()

Add implementation for pselect().

Signed-off-by: Jaspal Singh Dhillon <jaspal.iiith@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
provide a shared library containing most of OSv symbols

This patch introduces a script that will autogenerate a library, libosv.so. Besides
future uses, such as allowing linking agains special symbols for external applications
outside the OSv build system, the immediate use is to allow OSv internals to be exposed
through mechanisms such as Java's JNA and JNI.

It only relies on the "readelf" command to work, that is shipped with binutils
- therefore no extra dependencies are required. All symbols who are either
OBJECT or FUNC. TLS are explicitly left behind because it would complicate the
implementation.  We can revisit this in the future if we really need them.

The script works by scanning all global symbols in the final OSv ELF, and
generating a corresponding symbol in libosv.so. A linker script guarantees that
the addresses match the ones of the kernel. That means the versions of
libosv.so and the kernel MUST match. There is no whitelist or blacklist. I will
make the case here that everything that is normally visible in the OSv ELF should
be visible in this shared library. Making a symbol invisible should then be done
in an earlier and unrelated step.

I have tested this with a JNA wrapper that calls getpid and gettid (due to their
simplicity), and they are working perfectly.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
CC: Lyor Goldstein <lgoldstein@vmware.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libosv: warn against version mismatch

It is cumbersome to fail loading an ELF because of a version mismatch. My proposed
solution is for us to just warn very loudly if this is the case.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>