diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2021-08-27 22:58:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-27 22:58:01 -0700 |
commit | 2f3e6f530384b4ab9f8b39bceb8e86f2ba51a835 (patch) | |
tree | c9cfc3d49413a6222be80fd06bec748af607910f /softfloat/s_approxRecip32_1.c | |
parent | 8e29c382bac5412dabc55933e4078ee309df5b8e (diff) | |
download | pk-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 'softfloat/s_approxRecip32_1.c')
0 files changed, 0 insertions, 0 deletions