aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2021-08-27 22:58:01 -0700
committerGitHub <noreply@github.com>2021-08-27 22:58:01 -0700
commit2f3e6f530384b4ab9f8b39bceb8e86f2ba51a835 (patch)
treec9cfc3d49413a6222be80fd06bec748af607910f /README.md
parent8e29c382bac5412dabc55933e4078ee309df5b8e (diff)
downloadpk-2f3e6f530384b4ab9f8b39bceb8e86f2ba51a835.zip
pk-2f3e6f530384b4ab9f8b39bceb8e86f2ba51a835.tar.gz
pk-2f3e6f530384b4ab9f8b39bceb8e86f2ba51a835.tar.bz2
pk: correct the handling of SYS_getcwd (#250)
`SYS_getcwd` is different from `getcwd` in that the return value is < 0 on failure otherwise it is the length of the string. The proxy kernel was treating 0 as success and all other values as error. As a result, we would never return a valid value for `getcwd`. The following program now executes properly with the Proxy Kernel: ```c #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <linux/limits.h> int main(int argc, char **argv) { unsigned char buffer[PATH_MAX + 1] = {0}; if (getcwd(buffer, PATH_MAX)) printf("cwd: %s\n", buffer); return EXIT_SUCCESS; } ```
Diffstat (limited to 'README.md')
0 files changed, 0 insertions, 0 deletions