rename libc to libjehanne; improve libposix

This is to avoid conflicts between standards' assumptions and Jehanne's choices
This commit is contained in:
Giacomo Tesio 2020-01-11 16:28:11 +01:00
parent 3c7dc6eb8b
commit 2f850291d5
242 changed files with 39 additions and 39 deletions

@ -1 +1 @@
Subproject commit 1114e56fb6975e26fecd0466494105cbe42d8b85 Subproject commit 86c03ba7e6b1fab1bbccd6aad1e72e1bf0a94317

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2015-2017 Giacomo Tesio <giacomo@tesio.it> * Copyright (C) 2015-2020 Giacomo Tesio <giacomo@tesio.it>
* *
* This file is part of the UCB release of Plan 9. It is subject to the license * This file is part of the UCB release of Plan 9. It is subject to the license
* terms in the LICENSE file found in the top-level directory of this * terms in the LICENSE file found in the top-level directory of this
@ -9,8 +9,8 @@
* in the LICENSE file. * in the LICENSE file.
*/ */
#pragma lib "libc.a" #pragma lib "libjehanne.a"
#pragma src "/sys/src/lib/c" #pragma src "/sys/src/lib/jehanne"
#define JEHANNE_LIBC /* only for native code */ #define JEHANNE_LIBC /* only for native code */
@ -614,8 +614,8 @@ extern Waitmsg* jehanne_wait(void);
extern int jehanne_waitpid(void); extern int jehanne_waitpid(void);
extern int jehanne_wstat(const char*, uint8_t*, int); extern int jehanne_wstat(const char*, uint8_t*, int);
extern int32_t jehanne_read(int, void*, int32_t); extern long jehanne_read(int, void*, int32_t);
extern int32_t jehanne_write(int, const void*, int32_t); extern long jehanne_write(int, const void*, int32_t);
extern Dir* jehanne_dirstat(const char*); extern Dir* jehanne_dirstat(const char*);
extern Dir* jehanne_dirfstat(int); extern Dir* jehanne_dirfstat(int);

View File

@ -34,7 +34,7 @@
"-lthread", "-lthread",
"-lbio", "-lbio",
"-l9p2000", "-l9p2000",
"-lc" "-ljehanne"
], ],
"Post": [ "Post": [
"rm -f *.o" "rm -f *.o"

View File

@ -83,7 +83,7 @@
"Install": "/arch/$ARCH/cmd/", "Install": "/arch/$ARCH/cmd/",
"Program": "mpc", "Program": "mpc",
"SourceFiles": [ "SourceFiles": [
"/sys/src/lib/c/lib9.c", "/sys/src/lib/jehanne/lib9.c",
"mpc.c" "mpc.c"
] ]
}, },

View File

@ -12,7 +12,7 @@
], ],
"Program": "fdisk", "Program": "fdisk",
"SourceFiles": [ "SourceFiles": [
"/sys/src/lib/c/lib9.c", "/sys/src/lib/jehanne/lib9.c",
"fdisk.c", "fdisk.c",
"edit.c", "edit.c",
"y.tab.c" "y.tab.c"

View File

@ -12,7 +12,7 @@
], ],
"Program": "prep", "Program": "prep",
"SourceFiles": [ "SourceFiles": [
"/sys/src/lib/c/lib9.c", "/sys/src/lib/jehanne/lib9.c",
"prep.c", "prep.c",
"edit.c", "edit.c",
"y.tab.c" "y.tab.c"

View File

@ -133,9 +133,6 @@ void substitute(int);
static Rune la; static Rune la;
static Rune lr; static Rune lr;
#undef read
extern int jehanne_read(int, void*, int);
void void
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {

View File

@ -12,7 +12,7 @@
], ],
"Program": "grep", "Program": "grep",
"SourceFiles": [ "SourceFiles": [
"/sys/src/lib/c/lib9.c", "/sys/src/lib/jehanne/lib9.c",
"comp.c", "comp.c",
"main.c", "main.c",
"sub.c", "sub.c",

View File

@ -7,7 +7,7 @@
"Oflags": [ "Oflags": [
"-static", "-static",
"-l9p2000", "-l9p2000",
"-lc" "-ljehanne"
], ],
"Program": "comconsole", "Program": "comconsole",
"SourceFiles": [ "SourceFiles": [

View File

@ -7,7 +7,7 @@
"Oflags": [ "Oflags": [
"-static", "-static",
"-l9p2000", "-l9p2000",
"-lc" "-ljehanne"
], ],
"Program": "pipeconsole", "Program": "pipeconsole",
"SourceFiles": [ "SourceFiles": [

View File

@ -7,7 +7,7 @@
"Oflags": [ "Oflags": [
"-static", "-static",
"-l9p2000", "-l9p2000",
"-lc" "-ljehanne"
], ],
"Program": "screenconsole", "Program": "screenconsole",
"SourceFiles": [ "SourceFiles": [

View File

@ -12,7 +12,7 @@
], ],
"Program": "hoc", "Program": "hoc",
"SourceFiles": [ "SourceFiles": [
"/sys/src/lib/c/lib9.c", "/sys/src/lib/jehanne/lib9.c",
"code.c", "code.c",
"init.c", "init.c",
"math.c", "math.c",

View File

@ -19,7 +19,7 @@
"/arch/$ARCH/lib/libauth.a", "/arch/$ARCH/lib/libauth.a",
"/arch/$ARCH/lib/libbio.a", "/arch/$ARCH/lib/libbio.a",
"/arch/$ARCH/lib/libip.a", "/arch/$ARCH/lib/libip.a",
"/arch/$ARCH/lib/libc.a" "/arch/$ARCH/lib/libjehanne.a"
], ],
"Oflags": [ "Oflags": [
"-static" "-static"

View File

@ -13,7 +13,7 @@
"Install": "/arch/$ARCH/cmd/", "Install": "/arch/$ARCH/cmd/",
"Program": "rc", "Program": "rc",
"SourceFiles": [ "SourceFiles": [
"/sys/src/lib/c/lib9.c", "/sys/src/lib/jehanne/lib9.c",
"code.c", "code.c",
"exec.c", "exec.c",
"getflags.c", "getflags.c",

View File

@ -6,7 +6,7 @@
"Install": "/arch/$ARCH/cmd/sys/", "Install": "/arch/$ARCH/cmd/sys/",
"Oflags": [ "Oflags": [
"-static", "-static",
"-lc" "-ljehanne"
], ],
"Projects": [ "Projects": [
"call/" "call/"

View File

@ -78,7 +78,7 @@
"Ramfiles": { "Ramfiles": {
"rofs": "/arch/$ARCH/cmd/disk/rofs" "rofs": "/arch/$ARCH/cmd/disk/rofs"
}, },
"Systab": "/sys/src/lib/c/9syscall/sys.h" "Systab": "/sys/src/lib/jehanne/9syscall/sys.h"
}, },
"Program": "jehanne", "Program": "jehanne",
"Install": "/arch/$ARCH/kern/", "Install": "/arch/$ARCH/kern/",

View File

@ -8,7 +8,7 @@
"-DKERNDATE=1433623937", "-DKERNDATE=1433623937",
"-c", "-c",
"-I.", "-I.",
"-I$JEHANNE/sys/src/lib/c", "-I$JEHANNE/sys/src/lib/jehanne",
"-mcmodel=kernel", "-mcmodel=kernel",
"-O0", "-O0",
"-static", "-static",

View File

@ -15,7 +15,7 @@
"-mcmodel=small" "-mcmodel=small"
], ],
"Libs": [ "Libs": [
"/arch/$ARCH/lib/libc.a" "/arch/$ARCH/lib/libjehanne.a"
], ],
"Post": [ "Post": [
"export TOOL=strip && $TOOLPREFIX$TOOL init", "export TOOL=strip && $TOOLPREFIX$TOOL init",

View File

@ -73,7 +73,7 @@
"Ramfiles": { "Ramfiles": {
"rofs": "/arch/$ARCH/cmd/disk/rofs" "rofs": "/arch/$ARCH/cmd/disk/rofs"
}, },
"Systab": "/sys/src/lib/c/9syscall/sys.h" "Systab": "/sys/src/lib/jehanne/9syscall/sys.h"
}, },
"Post": [ "Post": [
"#strip $JEHANNE/arch/$ARCH/kern/jehanne" "#strip $JEHANNE/arch/$ARCH/kern/jehanne"

View File

@ -92,7 +92,7 @@
"comconsole": "/arch/$ARCH/cmd/hmi/comconsole", "comconsole": "/arch/$ARCH/cmd/hmi/comconsole",
"srv": "/arch/$ARCH/cmd/srv" "srv": "/arch/$ARCH/cmd/srv"
}, },
"Systab": "/sys/src/lib/c/9syscall/sys.h" "Systab": "/sys/src/lib/jehanne/9syscall/sys.h"
}, },
"Post": [ "Post": [
"OBJCOPY=objcopy; $TOOLPREFIX$OBJCOPY -I elf64-x86-64 -O elf32-i386 workhorse $JEHANNE/hacking/bin/workhorse.32bit", "OBJCOPY=objcopy; $TOOLPREFIX$OBJCOPY -I elf64-x86-64 -O elf32-i386 workhorse $JEHANNE/hacking/bin/workhorse.32bit",

View File

@ -45,7 +45,7 @@
"./libboot.a", "./libboot.a",
"/arch/$ARCH/lib/libip.a", "/arch/$ARCH/lib/libip.a",
"/arch/$ARCH/lib/libauth.a", "/arch/$ARCH/lib/libauth.a",
"/arch/$ARCH/lib/libc.a" "/arch/$ARCH/lib/libjehanne.a"
], ],
"Oflags": [ "Oflags": [
"-static" "-static"

View File

@ -19,8 +19,8 @@
#include <u.h> #include <u.h>
#include <libc.h> #include <libc.h>
/* osys_create works like the Plan 9 create(2) syscall, but with different races. /* ocreate works like the Plan 9 create(2) syscall, but with different races.
* In Plan 9 tjere os a race due to the different behaviour between the * In Plan 9 there is a race due to the different behaviour between the
* create syscall and the Tcreate message in 9P2000 when the file already exists: * create syscall and the Tcreate message in 9P2000 when the file already exists:
* see https://github.com/brho/plan9/blob/master/sys/src/9/port/chan.c#L1564-L1603 * see https://github.com/brho/plan9/blob/master/sys/src/9/port/chan.c#L1564-L1603
* for details. * for details.

View File

@ -1,7 +1,7 @@
/* /*
* This file is part of Jehanne. * This file is part of Jehanne.
* *
* Copyright (C) 2015-2019 Giacomo Tesio <giacomo@tesio.it> * Copyright (C) 2015-2020 Giacomo Tesio <giacomo@tesio.it>
* *
* Jehanne is free software: you can redistribute it and/or modify * Jehanne is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -18,7 +18,7 @@
#include <u.h> #include <u.h>
#include <libc.h> #include <libc.h>
int long
jehanne_read(int fd, void* buf, int nbytes) jehanne_read(int fd, void* buf, int nbytes)
{ {
return sys_pread(fd, buf, nbytes, ~0LL); return sys_pread(fd, buf, nbytes, ~0LL);

View File

@ -18,7 +18,7 @@
#include <u.h> #include <u.h>
#include <libc.h> #include <libc.h>
int long
jehanne_write(int fd, const void* buf, int nbytes) jehanne_write(int fd, const void* buf, int nbytes)
{ {
return sys_pwrite(fd, buf, nbytes, ~0LL); return sys_pwrite(fd, buf, nbytes, ~0LL);

View File

@ -15,7 +15,7 @@
"$ARCH/crtn.s" "$ARCH/crtn.s"
] ]
}, },
"Libc": { "LibJehanne": {
"Cflags": [ "Cflags": [
"-fasm" "-fasm"
], ],
@ -23,10 +23,10 @@
"../lib.json" "../lib.json"
], ],
"Install": "/arch/$ARCH/lib/", "Install": "/arch/$ARCH/lib/",
"Library": "libc.a", "Library": "libjehanne.a",
"Pre": [ "Pre": [
"usyscalls header $JEHANNE/sys/src/sysconf.json > $JEHANNE/arch/amd64/include/syscalls.h", "usyscalls header $JEHANNE/sys/src/sysconf.json > $JEHANNE/arch/amd64/include/syscalls.h",
"usyscalls code $JEHANNE/sys/src/sysconf.json > $JEHANNE/sys/src/lib/c/amd64/syscalls.c" "usyscalls code $JEHANNE/sys/src/sysconf.json > $JEHANNE/sys/src/lib/jehanne/amd64/syscalls.c"
], ],
"Post": [ "Post": [
"TOOL=ar; $TOOLPREFIX$TOOL rcs $JEHANNE/arch/$ARCH/lib/libssp.a", "TOOL=ar; $TOOLPREFIX$TOOL rcs $JEHANNE/arch/$ARCH/lib/libssp.a",

Some files were not shown because too many files have changed in this diff Show More