Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/librumphijack Support Linuxen where libc ioctl has cmd a...



details:   https://anonhg.NetBSD.org/src/rev/bf171da73f0d
branches:  trunk
changeset: 788823:bf171da73f0d
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Jul 22 12:11:03 2013 +0000

description:
Support Linuxen where libc ioctl has cmd as int unstead of unsigned long.

diffstat:

 lib/librumphijack/hijack.c |  18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diffs (44 lines):

diff -r 01a3225d4b58 -r bf171da73f0d lib/librumphijack/hijack.c
--- a/lib/librumphijack/hijack.c        Mon Jul 22 08:58:31 2013 +0000
+++ b/lib/librumphijack/hijack.c        Mon Jul 22 12:11:03 2013 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: hijack.c,v 1.102 2013/07/20 18:46:15 pooka Exp $      */
+/*      $NetBSD: hijack.c,v 1.103 2013/07/22 12:11:03 pooka Exp $      */
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -31,7 +31,7 @@
 #include "rumpuser_port.h"
 
 #if !defined(lint)
-__RCSID("$NetBSD: hijack.c,v 1.102 2013/07/20 18:46:15 pooka Exp $");
+__RCSID("$NetBSD: hijack.c,v 1.103 2013/07/22 12:11:03 pooka Exp $");
 #endif
 
 #include <sys/param.h>
@@ -1305,12 +1305,24 @@
 }
 
 /*
- * ioctl and fcntl are varargs calls and need special treatment
+ * ioctl() and fcntl() are varargs calls and need special treatment.
+ */
+
+/*
+ * Various [Linux] libc's have various signatures for ioctl so we
+ * need to handle the discrepancies.  On NetBSD, we use the
+ * one with unsigned long cmd.
  */
 int
+#ifdef HAVE_IOCTL_CMD_INT
+ioctl(int fd, int cmd, ...)
+{
+       int (*op_ioctl)(int, int cmd, ...);
+#else
 ioctl(int fd, unsigned long cmd, ...)
 {
        int (*op_ioctl)(int, unsigned long cmd, ...);
+#endif
        va_list ap;
        int rv;
 



Home | Main Index | Thread Index | Old Index