From: misomosi Date: Tue, 7 May 2024 05:53:18 +0000 (-0400) Subject: Rewrite POSIX samples X-Git-Url: http://git.misomosispi.com/?a=commitdiff_plain;h=07dedf3553d40b264a28534d73db601d45b70827;p=pldh.git Rewrite POSIX samples --- diff --git a/examples/printf.c b/examples/printf.c index 7cdb93d..9d1dfb2 100644 --- a/examples/printf.c +++ b/examples/printf.c @@ -3,6 +3,7 @@ PLD("libc.so.6"); int main(void) { - PFN(printf)("Hello World! %d\n", 2); + PFN(h, printf); + h("Hello World! %d\n", 2); return 0; } diff --git a/examples/write.c b/examples/write.c index 9620caf..2bbb063 100644 --- a/examples/write.c +++ b/examples/write.c @@ -3,9 +3,10 @@ #include "../pld.h" PLD("libc.so.6"); -long write(int fd, void *buf, unsigned long len) +long write(int fd, const void *buf, unsigned long len) { - return PFN(write)(fd, buf, len); + PFN(h, write); + return h(fd, buf, len); } int main(void)