1234567891011121314151617181920212223242526 |
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <stdio.h>
- #include <stdlib.h>
- int main(int argc, char ** argv)
- {
- struct stat root, proc_root;
- if (stat("/", &root) == -1) {
- perror("stat");
- exit(1);
- }
- if (stat("/proc/1/root", &proc_root) == -1) {
- perror("stat");
- exit(1);
- }
- if (root.st_dev == proc_root.st_dev &&
- root.st_ino == proc_root.st_ino) {
- printf("proc path test success\n");
- } else {
- printf("proc path test failure\n");
- }
- }
|