[libc-commits] [PATCH] D157792: [libc] Fix compilation on 32-bit systems

Mikhail Ramalho via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Aug 15 12:15:48 PDT 2023


mikhail.ramalho updated this revision to Diff 550424.
mikhail.ramalho added a comment.

- Removed old SYS_llseek and reuse SYS__llseek
- Rebased


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157792/new/

https://reviews.llvm.org/D157792

Files:
  libc/src/unistd/linux/lseek.cpp


Index: libc/src/unistd/linux/lseek.cpp
===================================================================
--- libc/src/unistd/linux/lseek.cpp
+++ libc/src/unistd/linux/lseek.cpp
@@ -23,12 +23,10 @@
 #ifdef SYS_lseek
   int ret = __llvm_libc::syscall_impl<int>(SYS_lseek, fd, offset, whence);
   result = ret;
-#elif defined(SYS_llseek)
-  long ret = __llvm_libc::syscall_impl(SYS_llseek, fd,
-                                       (long)(((uint64_t)(offset)) >> 32),
-                                       (long)offset, &result, whence);
-  result = ret;
-#elif defined(SYS__llseek)
+#elif defined(SYS_llseek) || defined(SYS__llseek)
+#ifdef SYS_llseek
+#define SYS__llseek SYS_llseek
+#endif
   int ret = __llvm_libc::syscall_impl<int>(SYS__llseek, fd, offset >> 32,
                                            offset, &result, whence);
 #else


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157792.550424.patch
Type: text/x-patch
Size: 848 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230815/0a1f2863/attachment.bin>


More information about the libc-commits mailing list