* [PATCH] v4l-utils: use openat when available
@ 2013-01-22 16:37 Riku Voipio
2013-02-02 14:08 ` Gregor Jasny
0 siblings, 1 reply; 2+ messages in thread
From: Riku Voipio @ 2013-01-22 16:37 UTC (permalink / raw)
To: linux-media; +Cc: Riku Voipio
New architectures such as 64-Bit arm build kernels without legacy
system calls - Such as the the no-at system calls. Thus, use
SYS_openat whenever it is available.
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
lib/libv4lconvert/libv4lsyscall-priv.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/libv4lconvert/libv4lsyscall-priv.h b/lib/libv4lconvert/libv4lsyscall-priv.h
index 2dac49a..cdd38bc 100644
--- a/lib/libv4lconvert/libv4lsyscall-priv.h
+++ b/lib/libv4lconvert/libv4lsyscall-priv.h
@@ -72,8 +72,13 @@ typedef off_t __off_t;
#ifndef CONFIG_SYS_WRAPPER
+#ifdef SYS_openat
+#define SYS_OPEN(file, oflag, mode) \
+ syscall(SYS_openat, AT_FDCWD, (const char *)(file), (int)(oflag), (mode_t)(mode))
+#else
#define SYS_OPEN(file, oflag, mode) \
syscall(SYS_open, (const char *)(file), (int)(oflag), (mode_t)(mode))
+#endif
#define SYS_CLOSE(fd) \
syscall(SYS_close, (int)(fd))
#define SYS_IOCTL(fd, cmd, arg) \
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] v4l-utils: use openat when available
2013-01-22 16:37 [PATCH] v4l-utils: use openat when available Riku Voipio
@ 2013-02-02 14:08 ` Gregor Jasny
0 siblings, 0 replies; 2+ messages in thread
From: Gregor Jasny @ 2013-02-02 14:08 UTC (permalink / raw)
To: Riku Voipio; +Cc: linux-media, Hans de Goede
Hello,
On 1/22/13 5:37 PM, Riku Voipio wrote:
> New architectures such as 64-Bit arm build kernels without legacy
> system calls - Such as the the no-at system calls. Thus, use
> SYS_openat whenever it is available.
> +#ifdef SYS_openat
> +#define SYS_OPEN(file, oflag, mode) \
> + syscall(SYS_openat, AT_FDCWD, (const char *)(file), (int)(oflag), (mode_t)(mode))
> +#else
> #define SYS_OPEN(file, oflag, mode) \
> syscall(SYS_open, (const char *)(file), (int)(oflag), (mode_t)(mode))
> +#endif
This would reduce compatibility to Linux >= 2.6.16 where openat was
introduced. How about testing for absence of SYS_open instead? Or fall
back to SYS_open if SYS_openat is not implemented?
Thanks,
Gregor
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-02-02 14:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-22 16:37 [PATCH] v4l-utils: use openat when available Riku Voipio
2013-02-02 14:08 ` Gregor Jasny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).