[mrsam@freebsd ~/stasher/stasher]$ cat t.c #include <stdio.h> #include <unistd.h> #include <sys/stat.h>
void dump(int n)
{
char buf[2048];
printf("Line %d, rc=%s\n", n,
(readlink("/proc/curproc/file", buf, 2048) < 0 ? "err":"ok"));
}
int main(int argc, char **argv)
{
dump(__LINE__);
mkdir("conftestdir.tst", 0777);
rmdir("conftestdir.tst");
dump(__LINE__);
}
[mrsam@freebsd ~/stasher/stasher]$ cc -o t t.c
[mrsam@freebsd ~/stasher/stasher]$ ./t
Line 15, rc=ok
Line 18, rc=err
???????
pgp8on2RgFH47.pgp
Description: PGP signature

