1 /* dcookie retrieval vsys entry, required by Chopstix.
2 * The lookup_dcookie system call retrieves a pathname */
4 #define __NR_LOOKUP_DCOOKIE 253
6 #include <sys/syscall.h>
7 /*#include <asm/page.h>*/
14 #define INT64_MAXSZ "18446744073709551615Z"
16 int lookup_dcookie(uint64_t cookie, char * buf, size_t size)
18 return syscall(__NR_LOOKUP_DCOOKIE, cookie, buf, size);
21 int main(int argc,char *argv[]) {
22 /* fs/dcookie.c uses PAGE_SIZE */
23 char path_buf[16384],dcookie_buf[sizeof(INT64_MAXSZ)];
25 /* In case nothing happens */
28 while (fgets(dcookie_buf, sizeof(dcookie_buf),stdin)) {
29 if (lookup_dcookie(atoll(dcookie_buf), path_buf, sizeof(path_buf))>0) {
30 printf("%s\n",path_buf);
33 printf("% Not found\n");