Skip to content

Commit

Permalink
options/posix: Implement swab
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennisbonke committed Oct 8, 2024
1 parent de2400d commit 2edd963
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions options/posix/generic/unistd-stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -666,9 +666,15 @@ int setuid(uid_t uid) {
return 0;
}

void swab(const void *__restrict, void *__restrict, ssize_t) {
__ensure(!"Not implemented");
__builtin_unreachable();
void swab(const void *_src, void *_dest, ssize_t n) {
const char *src = reinterpret_cast<const char *>(_src);
char *dest = reinterpret_cast<char *>(_dest);
for(; n > 1; n -= 2) {
dest[0] = src[1];
dest[1] = src[0];
dest += 2;
src += 2;
}
}

int symlink(const char *target_path, const char *link_path) {
Expand Down

0 comments on commit 2edd963

Please sign in to comment.