libc: introduce "jehanne_" namespace

With this commit all functions declared in libc.h have been renamed
with the "jehanne_" prefix. This is done for several reason:

- it removes conflicts during symbol resolution when linking
  standard C libraries like newlib or musl
- it allows programs depending on a standard C library to directly
  link to a library depending on our non standard libc (eg libsec).

To ease transiction two files are provided:

- sys/include/lib9.h that can be included instead of <libc.h> to use
  the old names (via a simple set of macros)
- sys/src/lib/c/lib9.c that can be compiled with a program where the
  macro provided by lib9.h are too dumb (see for example rc or grep).

In the kernel port/lib.h has been modified accordingly and some of
the functions it directly provides has been renamed too (eg malloc
in qmalloc.c and print in devcons.c).
This commit is contained in:
2017-04-19 23:33:14 +02:00
parent d38f7bb488
commit e70feee4a3
1195 changed files with 8385 additions and 7803 deletions

View File

@@ -16,7 +16,7 @@
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
*/
#include <u.h>
#include <libc.h>
#include <lib9.h>
/* Test alarm(2):
* - alarms replace each other (the last one wins)

View File

@@ -1,5 +1,5 @@
#include <u.h>
#include <libc.h>
#include <lib9.h>
/*
* The whole regression test I am after here is to call qa/kern/args with

View File

@@ -16,7 +16,7 @@
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
*/
#include <u.h>
#include <libc.h>
#include <lib9.h>
int verbose = 1;

View File

@@ -16,7 +16,7 @@
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
*/
#include <u.h>
#include <libc.h>
#include <lib9.h>
void
main(void)

View File

@@ -1,5 +1,5 @@
#include <u.h>
#include <libc.h>
#include <lib9.h>
void
main(int argc, char *argv[])

View File

@@ -1,5 +1,5 @@
#include <u.h>
#include <libc.h>
#include <lib9.h>
#define DPRECSTR "0.0000004000000000125"
#define DPREC 0.0000004000000000125

View File

@@ -8,7 +8,7 @@
*/
#include <u.h>
#include <libc.h>
#include <lib9.h>
void
main(void)

View File

@@ -1,5 +1,5 @@
#include <u.h>
#include <libc.h>
#include <lib9.h>
#define DEEPS ".5*2^-1073"
#define DENEPS "-.5*2^-1073"

View File

@@ -16,7 +16,7 @@
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
*/
#include <u.h>
#include <libc.h>
#include <lib9.h>
void
main(void)

View File

@@ -16,7 +16,7 @@
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
*/
#include <u.h>
#include <libc.h>
#include <lib9.h>
void
main(void)

View File

@@ -16,7 +16,7 @@
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
*/
#include <u.h>
#include <libc.h>
#include <lib9.h>
void
main(void)

View File

@@ -8,7 +8,7 @@
*/
#include <u.h>
#include <libc.h>
#include <lib9.h>
#include <ip.h>
/* from the kernel. Sorry. */

View File

@@ -16,7 +16,7 @@
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
*/
#include <u.h>
#include <libc.h>
#include <lib9.h>
#define GiB 1024*1024*1024

View File

@@ -16,7 +16,7 @@
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
*/
#include <u.h>
#include <libc.h>
#include <lib9.h>
#define MSGTPL "Hello from %d!"

View File

@@ -16,7 +16,7 @@
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
*/
#include <u.h>
#include <libc.h>
#include <lib9.h>
#define MSGTPL "Hello from %d!"

View File

@@ -1,5 +1,5 @@
#include <u.h>
#include <libc.h>
#include <lib9.h>
#define INT 2
#define FLOAT 2.5

View File

@@ -1,5 +1,5 @@
#include <u.h>
#include <libc.h>
#include <lib9.h>
#define RET 0xc3
int success;

View File

@@ -1,5 +1,5 @@
#include <u.h>
#include <libc.h>
#include <lib9.h>
#define RET 0xc3
void

View File

@@ -1,5 +1,5 @@
#include <u.h>
#include <libc.h>
#include <lib9.h>
int verbose = 0;
void

View File

@@ -1,5 +1,5 @@
#include <u.h>
#include <libc.h>
#include <lib9.h>
int nring = 32;
int niter = 1024;

View File

@@ -16,7 +16,7 @@
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
*/
#include <u.h>
#include <libc.h>
#include <lib9.h>
int verbose = 0;
int procNoteReceived;

View File

@@ -8,7 +8,7 @@
*/
#include <u.h>
#include <libc.h>
#include <lib9.h>
void
main(int argc, char *argv[])

View File

@@ -16,7 +16,7 @@
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
*/
#include <u.h>
#include <libc.h>
#include <lib9.h>
/* verify that the scheduler give each process a chance to run
* with a single cpu (x86) this test do not pass on plan9/9front

View File

@@ -16,7 +16,7 @@
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
*/
#include <u.h>
#include <libc.h>
#include <lib9.h>
int verbose = 1;

View File

@@ -1,6 +1,6 @@
#include <u.h>
#include <libc.h>
#include <lib9.h>
void
main(void)

View File

@@ -1,5 +1,5 @@
#include <u.h>
#include <libc.h>
#include <lib9.h>
// Change-Id: I1cfd642d29a3955499b3507f56f0449d1710700e
// sys/src/nxm/port/devcons.c:

View File

@@ -1,5 +1,5 @@
#include <u.h>
#include <libc.h>
#include <lib9.h>
int32_t nprocs = 32;
int32_t nloops = 10000;

View File

@@ -3,7 +3,7 @@
// -- complete
// Since we're going to improve waserror
#include <u.h>
#include <libc.h>
#include <lib9.h>
void
main(void)