1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-29 17:25:10 +00:00

Demos: Add "DynamicObjectDemo" to demo the dynamic loader

This commit is contained in:
Itamar 2020-10-10 18:26:16 +03:00 committed by Andreas Kling
parent 79769ee74e
commit 09ccdc697b
7 changed files with 101 additions and 1 deletions

View file

@ -0,0 +1,24 @@
#include "lib.h"
#include <fcntl.h>
#include <stdio.h>
#include <sys/internals.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
int main(int argc, char** argv, char** env)
{
(void)argc;
(void)argv;
(void)env;
printf("Well Hello Friends!\n");
printf("trying to open /etc/fstab for writing..\n");
int rc = open("/etc/fstab", O_RDWR);
if (rc == -1) {
int _errno = errno;
perror("open failed");
printf("rc: %d, errno: %d\n", rc, _errno);
return func() + g_tls1 + g_tls2;
}
}