Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76c0f5ec authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "osi: compat: fix build with glibc >= 2.38" into main

parents 9d60cfab 5b613e0d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -28,7 +28,10 @@
/* Get thread identification. */
pid_t gettid(void) throw();

/* glibc>=2.38 supplies its own strlcpy which conflicts with this declaration */
#if !(__GLIBC_PREREQ(2, 38))
/* Copy src to string dst of size siz. */
size_t strlcpy(char* dst, const char* src, size_t siz);
#endif /* !(__GLIBC_PREREQ(2, 38)) */

#endif
+6 −3
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@

#if __GLIBC__
pid_t gettid(void) throw() { return syscall(SYS_gettid); }
#endif

/* These functions from bionic
 *
@@ -56,7 +55,10 @@ pid_t gettid(void) throw() { return syscall(SYS_gettid); }
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#if __GLIBC__
/*
 * Glibc added strlcpy() starting with 2.38, so skip it if glibc >= 2.38.
 */
#if !(__GLIBC_PREREQ(2, 38))
/*
 * Copy src to string dst of size siz.  At most siz-1 characters
 * will be copied.  Always NUL terminates (unless siz == 0).
@@ -87,4 +89,5 @@ size_t strlcpy(char* dst, const char* src, size_t siz) {

  return s - src - 1; /* count does not include NUL */
}
#endif
#endif /* !(__GLIBC_PREREQ(2, 38)) */
#endif /* __GLIBC__ */