Skip to contentSkip to conversation

sync_file_range: add little endian support for mips

PATCH New Dejan Jovicevic 2 participants 2 messages Oct 5, 2017 – Oct 11, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sync_file_range: add little endian support for mips

---
 testcases/kernel/syscalls/sync_file_range/sync_file_range01.c | 5 +++++
 1 file changed, 5 insertions(+)
testcases/kernel/syscalls/sync_file_range/sync_file_range01.c +5 -0
index 0a9fb8e..cebb919 100644
@@ -218,8 +218,13 @@ static inline long syncfilerange(int fd, off64_t offset, off64_t nbytes,
 
 /* mips */
 #elif defined(__mips__) && __WORDSIZE == 32
+#if __BYTE_ORDER == __BIG_ENDIAN
 	return ltp_syscall(__NR_sync_file_range, fd, 0, (int)(offset >> 32),
 		(int)offset, (int)(nbytes >> 32), (int)nbytes, flags);
+#elif __BYTE_ORDER == __LITTLE_ENDIAN
+	return ltp_syscall(__NR_sync_file_range, fd, 0, (int)offset,
+		(int)(offset >> 32), (int)nbytes, (int)(nbytes >> 32), flags);
+#endif
 
 /* other */
 #else
Signature · 1 line
1.9.1