anyone have an idea what i'm doing wrong here? ```...
# general
c
anyone have an idea what i'm doing wrong here?
Copy code
$ cat removes_self.c
#include <stdio.h>
#include <unistd.h>

int main(int argc, char* argv[]) {
    printf("Removing %s\n", argv[0]);

    printf("Result: %d\n", unlink(argv[0]));

    printf("Press ctrl-c to end.\n");

    while (1) {
    }
}

$ ./removes_self
Removing ./removes_self
Result: 0
Press ctrl-c to end.


# other shell
$ osqueryi
osquery - being built, with love, at Facebook
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Using a virtual database. Need help, type '.help'
osquery> select * from processes where on_disk = 0;
osquery>