comp.lang.ada
 help / color / mirror / Atom feed
From: "Frank J. Lhota" <FrankLho.NOSPAM@rcn.com>
Subject: Re: The "black magic" of ioctl
Date: Sun, 24 Oct 2010 20:45:26 -0400
Date: 2010-10-24T20:45:26-04:00	[thread overview]
Message-ID: <ia2jvi$v38$1@news.albasani.net> (raw)
In-Reply-To: <m239rv30b1.fsf@pushface.org>

On 10/24/2010 2:36 PM, Simon Wright wrote:
> Florian Weimer<fw@deneb.enyo.de>  writes:
>
> I hadn't realised this: but a quick scan of the GNAT sources confirms:
> in socket.c,
>
> * Wrapper for ioctl(2), which is a variadic function */
>
> int
> __gnat_socket_ioctl (int fd, int req, int *arg) {
> #if defined (_WIN32)
>    return ioctlsocket (fd, req, arg);
> #else
>    return ioctl (fd, req, arg);
> #endif
> }

This is because of a Microsoft portability problem; in Winsock (the 
windows socket facility), the function for performing ioctl on sockets 
is named ioctlsocket instead of ioctl. This is one of many areas where 
Winsock differs just enough from the standards to require heavy use of 
"#if" preprocessing directives to maintain portability. This is why 
Winsock is by far my least favorite part of the Win32 API. At any rate, 
this problem is not an Ada issue.

-- 
"All things extant in this world,
Gods of Heaven, gods of Earth,
Let everything be as it should be;
Thus shall it be!"
- Magical chant from "Magical Shopping Arcade Abenobashi"

"Drizzle, Drazzle, Drozzle, Drome,
Time for this one to come home!"
- Mr. Wizard from "Tooter Turtle"



  reply	other threads:[~2010-10-25  0:45 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-21  9:13 The "black magic" of ioctl Francesco Piraneo Giuliano
2010-10-21 10:20 ` Ludovic Brenta
2010-10-21 11:31   ` Francesco Piraneo Giuliano
2010-10-21 11:50     ` Mark Lorenzen
2010-10-21 12:04     ` Ludovic Brenta
2010-10-22 16:46       ` Francesco Piraneo Giuliano
2010-10-22 16:47       ` Francesco Piraneo Giuliano
2010-10-21 12:05     ` Simon Wright
2010-10-22 20:16     ` michael bode
2010-10-23 12:13       ` Simon Wright
2010-10-23 13:27         ` michael bode
2010-10-23 16:25           ` Simon Wright
2010-10-23 18:12             ` michael bode
2010-10-23 20:26     ` Florian Weimer
2010-10-24 11:08       ` Simon Wright
2010-10-24 17:58         ` Florian Weimer
2010-10-24 12:41       ` Frank J. Lhota
2010-10-24 17:56         ` Florian Weimer
2010-10-24 18:36           ` Simon Wright
2010-10-25  0:45             ` Frank J. Lhota [this message]
2010-10-25  1:13           ` Frank J. Lhota
2010-10-25 18:56             ` Florian Weimer
2010-10-21 11:46   ` Colin Paul Gloster
2010-10-25  7:08   ` Yannick Duchêne (Hibou57)
2010-10-21 13:40 ` Julian Leyh
2010-10-21 13:58   ` Simon Wright
2010-10-21 20:45 ` Randy Brukardt
2010-10-22 16:40   ` Francesco Piraneo Giuliano
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox