Skip to content

Commit 62a1ac7

Browse files
Jeff-A-Martingvisor-bot
authored andcommitted
[test] Don't include renameat2 on Fuchsia builds
PiperOrigin-RevId: 829021243
1 parent 5068d92 commit 62a1ac7

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

test/util/fs_util.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,10 +737,12 @@ ::testing::Matcher<mode_t> PermissionIs(mode_t want) {
737737
return MakeMatcher(new ModePermissionMatcher(want));
738738
}
739739

740+
#ifndef __Fuchsia__
740741
int renameat2(int olddirfd, const char* oldpath, int newdirfd,
741742
const char* newpath, unsigned int flags) {
742743
return syscall(SYS_renameat2, olddirfd, oldpath, newdirfd, newpath, flags);
743744
}
745+
#endif // __Fuchsia__
744746

745747
} // namespace testing
746748
} // namespace gvisor

test/util/fs_util.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ constexpr int kOLargeFile = 00400000;
4343
// build environments.
4444
#define OVERLAYFS_SUPER_MAGIC 0x794c7630
4545

46+
// Fuchsia does not support renameat2.
47+
#ifndef __Fuchsia__
4648
#ifndef SYS_renameat2
4749
#if defined(__x86_64__)
4850
#define SYS_renameat2 316
@@ -59,6 +61,7 @@ constexpr int kOLargeFile = 00400000;
5961

6062
int renameat2(int olddirfd, const char* oldpath, int newdirfd,
6163
const char* newpath, unsigned int flags);
64+
#endif // __Fuchsia__
6265

6366
// Returns a status or the current working directory.
6467
PosixErrorOr<std::string> GetCWD();

0 commit comments

Comments
 (0)