build.mk: fix parallel build with libtools

In build.mk we have

tools/ifconfig/ifconfig.so: EXTRA_LIBS = -Ltools/ -ltools

This means libtools.so needs to exist before ifconfig.so is built.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
actually implement umask

The umask syscall is "implemented", in the sense that it exchanges a global
mask with a new value passed.

But that mask is not used anywhere, meaning that the system call doesn't have
any effect.

This patch properly implements it.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
cpiod: respect original mode of files

modes are usually not very interesting for us, so we have been able to live
without it just fine. When uploading files to the guest, we only set the type
bits, and left the rest blank.

However, there are some programs (like MySQL), that will conduct tests on the
permission flags of some of their configuration files. The poor guys don't know
they are running on OSv, and will therefore abort when seeing what they believe
to be a insecure setting.

After this patch, all the modes are respected, and if one needs to upload files
with specific modes, it's just a matter of guaranteeing that the host file is
set correctly.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>