regtest: broaden none/tests/linux/bug498317 suppression for PPC
[valgrind.git] / none / tests / freebsd / proc_pid_file.cpp
blob89c8428d13249b79753a73d414369bed390dbef9
1 #include <iostream>
2 //#include <fstream>
3 #include <string>
4 #include <limits.h>
5 #include <unistd.h>
6 #include <fcntl.h>
7 #include <cassert>
9 int main()
11 char resolvedPath[PATH_MAX];
12 auto count = readlink("/proc/curproc/file", resolvedPath, PATH_MAX);
13 resolvedPath[count] = '\0';
14 //std::cout << "resolvedPath: " << resolvedPath << '\n';
15 char resolvedPath2[PATH_MAX];
16 auto count2 = readlinkat(AT_FDCWD, "/proc/curproc/file", resolvedPath2, PATH_MAX);
17 resolvedPath2[count2] = '\0';
18 //std::cout << "resolvedPath2: " << resolvedPath2 << '\n';
19 std::string rp(resolvedPath);
20 assert(rp == resolvedPath2);
22 auto n = rp.rfind("proc_pid_file");
24 std::string filename(rp.substr(n));
25 //std::cout << "filename: " << filename << '\n';
26 assert(filename == "proc_pid_file");