]> localhost Git - pldh.git/commitdiff
Load a non-function
authormisomosi <[email protected]>
Tue, 7 May 2024 06:03:29 +0000 (02:03 -0400)
committermisomosi <[email protected]>
Tue, 7 May 2024 06:03:29 +0000 (02:03 -0400)
examples/stderr.c [new file with mode: 0644]
pld.h

diff --git a/examples/stderr.c b/examples/stderr.c
new file mode 100644 (file)
index 0000000..9af4a9b
--- /dev/null
@@ -0,0 +1,9 @@
+#include "../pld.h"
+#include <stdio.h>
+PLD("libc.so.6")
+int main()
+{
+       PFN(o, stderr);
+       fprintf(*o, "Hello World!\n");
+       return 0;
+}
diff --git a/pld.h b/pld.h
index d0d1db927c0d5d032fd7a22713f2d6937047bdb6..a0eff069e57848cb17ce966558010b7abcfd1d29 100644 (file)
--- a/pld.h
+++ b/pld.h
@@ -47,6 +47,8 @@ static void PLD_Private_FormatError(void *code, char *s, int len, const char *na
 }\r
 #else // _WIN32\r
 #include <dlfcn.h>\r
+#include <unistd.h>\r
+#include <stddef.h>\r
 static void PLD_Private_WriteString(const char *s)\r
 {\r
        write(2, s, PLD_Private_strlen(s));\r