From patchwork Thu Nov 16 12:19:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Seiderer X-Patchwork-Id: 744540 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=ps.report@gmx.net header.b="lkrCV4Nm" Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DE8E1A3 for ; Thu, 16 Nov 2023 04:19:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1700137187; x=1700741987; i=ps.report@gmx.net; bh=nYQwD9PTnIV16rk+6rCYGfdwng+QWXHUl9sOdkX4DZw=; h=X-UI-Sender-Class:From:To:Subject:Date; b=lkrCV4Nmn0fbqYFmdI7uRD0Ao5vaS5q2blcU9yFKGbTMmx0tC29y7C3tKbK2Z9k/ n/4p+hceiE6dlGsYLNToAAibzoNioIyqxaBklEIpBBJWk9rsm9kt/eqnfRxa6WyF+ Zb7RKX6mP1L/snIBNFX5faTuT2Znq3gnavMY4LhZ8HVZD3i7Ro1H02NuBQrPZ2JF3 SOfpR7ewOBuwDaewtbljxnXY/CnEderDkorN1cy7O/4aFxBkhHdhf13nzMHJetbrp 0AxJVc6SJVh+z3D2dUnl9T98crPRzgr+0mbknbZMDcd0FylBkXYH5FYBzoMZr/peK e/PDMMODJfQp86Apsg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from localhost.fritz.box ([62.216.208.247]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N5G9n-1rTQ5W2IJJ-011Av0 for ; Thu, 16 Nov 2023 13:19:47 +0100 From: Peter Seiderer To: linux-media@vger.kernel.org Subject: [PATCH v4l-utils v1 1/2] v4l2-tracer: wrap open64/mmap64 functions only if linux && __GLIBC__ Date: Thu, 16 Nov 2023 13:19:46 +0100 Message-ID: <20231116121947.28147-1-ps.report@gmx.net> X-Mailer: git-send-email 2.42.1 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:9R09iXREjD07VbWje1VuP0d1pO9za26pRIz9dbiSg/IalQtK86c caYJF8UiqpFhpeCIIzd8+g1PSpDPl1IZvpTb1asl3oO6yVpvCWTrsnio0nRgFodwxIrxuAA FOK+1OkC1ceQHkThlQPQ8aYq7fXZtX/pFA3aGNH3vIX6g3uQ2cV6AC0nbHXGohOshpmcKrc 5EXmJ4YiKBsWx+a7EnlCw== UI-OutboundReport: notjunk:1;M01:P0:RRotx3EM32E=;d8Gt5iwd+iNRAAeYPywNSMLCE5H CR3u+46lpzQkm1uWymbxlOZSF+wuke8egrd5kVNRMwH4smZdZ6j3ToHUnkceFrfoPm20xeIK4 nLD79bhQLEMt3h4RZYyU1ueHaAMt42HPvbfKLY9AsjBp9He8LFmkNDjsqPt3ujznBFvlysh1I Q0o2irUHm33MmB+T6GwZEL+ayoBT0xum1mExkUonKoRiueyD5YbVSl8w98at967xxQbZsy1ys RvcOxEbILMUaVZZfS8L+p8fyAh6G7u51gHjEzXZg7mVDYzVDIg80VsLeSKIowf7lxI00shLxZ AtQiti6BG7JxMjGLingFK7npU/lHwcYGVuxHKRcr3WVVGEzwYbu6lc9oiBipw5OZ3REu8M+DU VG+xKDVAiA74u5+QwK/GvMHkbKD3C1c5MvocfkFBKS0Jy3yzurSQGm6EWF/jAWAmlqrLT13HW nYThruxYOb5caBuxN5+ldcdk/vk0W275XmO1O/S9LMu0Oms+un3feKdqet6kJz+ypb0v9mA1e p+Vb3yLFPnfEz8dN+KsYILaIlb/SlpwlgqP50Ki60MGdl/B1KZbUmKYomYZOephbguuhua10p GXlzXQJQYusjm6zpwOjcHlxusqBxYyIG2xC5GokbdpQycuoguN8H2bJ2W+Ds+AHrfplRFMncL ZURCtMSpe1xX5pIeSTYXr41dP8oAeo0Ivizwhq+YdxdKM6KOwr0YONlNu/U+hqA1pp1eF4Pq3 Pii2HmoreGhsdSrlzi2cVgWwQtneMMSLZuOPXwY1eZ6gDMlXfmJ4KD7tAluT6DMPAWwZZWfbs n5VZj8SyUkNGAhlFRYGGoIPeGyAuuiY/8xl6ss8fMwDZwzpAJxnG2noGw/HTZtFFV5KDe2OGz E4VdT3JE7mKssdf5ui1hF5oE5E14Ywee6aQn7YyI87AQXQvkJrmmNwMzuCQG/aoDL1Xm6u7US vtVeNjD5gVqj/AmmDm9K/B1rHAU= Wrap open64/mmap64 functions only if linux && __GLIBC__, as done in lib/libv4l1/v4l1comapt.c and lib/libv4l2/v4l2convert.c since commit 'libv4l: Wrap LFS64 functions only if linux && __GLIBC__' (403a4e2697a1ff96fe2fa16589039595f21cadf0), should fix musl libc compile. Signed-off-by: Peter Seiderer --- utils/v4l2-tracer/libv4l2tracer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/v4l2-tracer/libv4l2tracer.cpp b/utils/v4l2-tracer/libv4l2tracer.cpp index a9f039c7..68f6304a 100644 --- a/utils/v4l2-tracer/libv4l2tracer.cpp +++ b/utils/v4l2-tracer/libv4l2tracer.cpp @@ -89,6 +89,7 @@ int open(const char *path, int oflag, ...) return fd; } +#if defined(linux) && defined(__GLIBC__) int open64(const char *path, int oflag, ...) { errno = 0; @@ -124,6 +125,7 @@ int open64(const char *path, int oflag, ...) return fd; } +#endif int close(int fd) { @@ -177,6 +179,7 @@ void *mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off) return buf_address_pointer; } +#if defined(linux) && defined(__GLIBC__) void *mmap64(void *addr, size_t len, int prot, int flags, int fildes, off_t off) { errno = 0; @@ -191,6 +194,7 @@ void *mmap64(void *addr, size_t len, int prot, int flags, int fildes, off_t off) return buf_address_pointer; } +#endif int munmap(void *start, size_t length) {