Commit c20ed9f1 authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka

cobalt/posix: fcntl: turn the generic argument into a long value

In order to prevent unexpected truncation of pointer args in userland
with the LP64 data model, libcobalt's fcntl() wrapper should accept a
long (3rd) argument.

Anticipate this change in the corresponding syscall implementation in
the Cobalt core.  The updated ABI remains backward-compatible for
current users.
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent ca7dcefb
......@@ -53,7 +53,7 @@ COBALT_SYSCALL(close, lostage, (int fd))
return rtdm_fd_close(fd, 0);
}
COBALT_SYSCALL(fcntl, current, (int fd, int cmd, int arg))
COBALT_SYSCALL(fcntl, current, (int fd, int cmd, long arg))
{
return rtdm_fd_fcntl(fd, cmd, arg);
}
......
......@@ -37,7 +37,7 @@ COBALT_SYSCALL_DECL(socket,
COBALT_SYSCALL_DECL(close, (int fd));
COBALT_SYSCALL_DECL(fcntl, (int fd, int cmd, int arg));
COBALT_SYSCALL_DECL(fcntl, (int fd, int cmd, long arg));
COBALT_SYSCALL_DECL(ioctl,
(int fd, unsigned int request, void __user *arg));
......
......@@ -371,7 +371,7 @@ int rtdm_fd_fcntl(int ufd, int cmd, ...)
{
struct rtdm_fd *fd;
va_list ap;
int arg;
long arg;
int ret;
fd = rtdm_fd_get(ufd, 0);
......@@ -379,7 +379,7 @@ int rtdm_fd_fcntl(int ufd, int cmd, ...)
return PTR_ERR(fd);
va_start(ap, cmd);
arg = va_arg(ap, int);
arg = va_arg(ap, long);
va_end(ap);
switch (cmd) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment