toaruos/linker/libdemo.c
2016-12-03 15:36:25 +09:00

16 lines
286 B
C

#include <stdio.h>
#include <string.h>
__attribute__((constructor))
static void butts(void) {
fprintf(stderr, "I'm a constructor!\n");
}
extern char * _username;
int return_42(void) {
fprintf(stderr, "I am a dynamically loaded shared object. pid = %d\n", getpid());
return 42;
}