musl cleanup: remove two header files

remove two header files from libc/math, which are found in musl/src/math.
The files were identical except using double_t instead of double.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
vfs: remove unnecessary while loop

Reviewed-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Prasad Joshi <prasadjoshi.linux@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
cli: Remove code reference from error messages

We use Lua's error/assert to raise errors from commands. Lua makes it a bit
more informative and prefixes with filename and line number. We don't need
this, but we still want to use error/assert.

This detail (file and line number) is added internally by Lua (using the method
luaL_where()), so this patch does a string lookup to remove it. It does not do
it for internal CLI errors (in the C implementation) because we need these
details for these types of errors.

Fixes #414.

Signed-off-by: Or Cohen <orc@fewbytes.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc/locale: Use iconv from upstream musl

Use iconv.c from upstream musl to clean up the include path hack added in
commit 480ce64 ("libc: add include path for locale").

The diff between our version and the musl version looks like this:

[penberg@localhost osv]$ diff -u libc/locale/iconv.c musl/src/locale/iconv.c
--- libc/locale/iconv.c	2013-10-25 12:11:24.042750927 +0300
+++ musl/src/locale/iconv.c	2014-08-04 17:07:25.446850394 +0300
@@ -316,8 +316,8 @@
 			}
 			d = c;
 			for (c=0; c<128-totype; c++) {
-				if (d == legacy_chars[ map[c*5/4]>>2*c%8 |
-					map[c*5/4+1]<<8-2*c%8 & 1023 ]) {
+				if (d == legacy_chars[ tomap[c*5/4]>>2*c%8 |
+					tomap[c*5/4+1]<<8-2*c%8 & 1023 ]) {
 					c += 128;
 					goto revout;
 				}

but this is because the imported copy is from January 2013 or earlier:

  [penberg@localhost osv]$ git log libc/locale/iconv.c
  commit 79d5ad7d6f7bbcc20edf2ce2bbf3cc08f04b08dd
  Author: Christoph Hellwig <hch@lst.de>
  Date:   Thu Jan 17 09:33:18 2013 +0100

      import locale support and all dependencies from musl

but our musl version in the git submodule is from February 2013.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
net: drop custom net_channel allocators

Once upon a time, allocating a page was much faster than allocating half
a page, so we used a custom allocator.

These days, it's just as fast, and the custom allocator interferes with
memory debugging.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libedit: Reference ncurses libraries properly

Fixes #410

Signed-off-by: Or Cohen <orc@fewbytes.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
upload_manifest: be more forgiving with encoding errors

There are situations in which OSv may print garbage to the console. In particular,
I am printing the contents of a stream for debugging purposes, and while it is sane
in the case I am handling, the build process ends up hitting the same trigger - and at
that point, it contains garbage. We fail, because we can't decode the characters to the
default encoding (ascii).

This patch changes the error mode of python's decode method from 'strict' (default) to
'replace', which means "print something". Since we're touching the parameters anyway,
the encoding is also changed to UTF-8.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>