* Mattia Rizzolo <[email protected]>, 2014-10-28, 11:44:
I guess it'd be better to write something equivalent directly in c.
If anyone want to write it, just do.
Here's a minimal reproducer:
$ gcc -O2 -Wall $(getconf LFS_CFLAGS) -fPIC -shared libopen.c -o libopen.so
$ gcc -O2 -Wall testopen.c ./libopen.so -o testopen
$ ./testopen && echo ok
ok
$ eatmydata ./testopen
Aborted
If anyone else could test the resulting deb and confirm it works, wuold
be great.
It works for me, thanks!
--
Jakub Wilk
int main(int argc, char **argv)
{
return 0;
}
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
void __attribute__((constructor)) init(void)
{
int fd = open("/dev/null", O_RDONLY);
if (fd < 0)
abort();
close(fd);
}