]> git.zerfleddert.de Git - usb-driver/blobdiff - usb-driver.c
Fix 32-bit ISE 10.1 on 64-bit platform.
[usb-driver] / usb-driver.c
index 5d1528e148abfad639963685d3b88b699a17d51d..def52dbf587cf7115f6ed679aab59d5a6cb03280 100644 (file)
@@ -39,6 +39,8 @@
 #include <errno.h>
 #include <inttypes.h>
 #include <sys/ioctl.h>
+#include <sys/utsname.h>
+#include <bits/wordsize.h>
 #include "usb-driver.h"
 #include "config.h"
 
@@ -937,3 +939,21 @@ int access(const char *pathname, int mode) {
                return (*func)(pathname, mode);
        }
 }
+
+#if __WORDSIZE == 32
+int uname (struct utsname *__name) {
+       static int (*func) (struct utsname*);
+       int ret;
+
+       if (!func)
+               func = (int (*) (struct utsname*)) dlsym(RTLD_NEXT, "uname");
+       
+       ret = (*func)(__name);
+
+       if (ret == 0 && (!strcmp(__name->machine, "x86_64"))) {
+               strcpy(__name->machine, "i686");
+       }
+       
+       return ret;
+}
+#endif
Impressum, Datenschutz