From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,5edee74b13d8e50a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!goblin3!goblin1!goblin.stu.neva.ru!news.albasani.net!not-for-mail From: "Frank J. Lhota" Newsgroups: comp.lang.ada Subject: Re: The "black magic" of ioctl Date: Sun, 24 Oct 2010 20:45:26 -0400 Organization: albasani.net Message-ID: References: <74b46743-fb81-48cc-a478-ffd069db2fc6@k22g2000yqh.googlegroups.com> <877hh8lkok.fsf@mid.deneb.enyo.de> <87fwvv4gpg.fsf@mid.deneb.enyo.de> Reply-To: FrankLho.NOSPAM@rcn.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net BbV+mEJ+I+gsSFRvRneQ46yst8i7gle710Dh84UlFH6uvtPgkiu7/vh8SaXRsdxBDU/AeJOD8Ad3MLILsg+DWEyUfjW2i8Dgc3eJY5NKCLl3f7/IAj/DiH+HEtMdreNI NNTP-Posting-Date: Mon, 25 Oct 2010 00:45:39 +0000 (UTC) In-Reply-To: Cancel-Lock: sha1:YrmhIh3d3iLW0SJa3ez2cFNxryU= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.11) Gecko/20101013 Lightning/1.0b2 Thunderbird/3.1.5 Injection-Info: news.albasani.net; logging-data="GmSeLZpLD9+UV3hmaR5N0v/h4QUAxP/t39z7QnyoxkOMD2zAJG3r6fD+Yndh13tpu+EF84hDysFRsDJ0l/q29NAafRwwhoDp4bBQmE4lwzneRhNIJK2QiPy+4+BhLAuC"; mail-complaints-to="abuse@albasani.net" Xref: g2news1.google.com comp.lang.ada:14729 Date: 2010-10-24T20:45:26-04:00 List-Id: On 10/24/2010 2:36 PM, Simon Wright wrote: > Florian Weimer 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"