aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/socket.c')
-rw-r--r--gcc/ada/socket.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c
index e68f435..31e3e58 100644
--- a/gcc/ada/socket.c
+++ b/gcc/ada/socket.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 2003-2009, Free Software Foundation, Inc. *
+ * Copyright (C) 2003-2010, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -529,6 +529,12 @@ int
__gnat_socket_ioctl (int fd, int req, int *arg) {
#if defined (_WIN32)
return ioctlsocket (fd, req, arg);
+#elif defined (__APPLE__)
+ /*
+ * On Darwin, req is an unsigned long, and we want to convert without sign
+ * extension to get the proper bit pattern in the case of a 64 bit kernel.
+ */
+ return ioctl (fd, (unsigned int) req, arg);
#else
return ioctl (fd, req, arg);
#endif