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!news4.google.com!proxad.net!feeder1-2.proxad.net!news.mixmin.net!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 21:13:58 -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 2nDBwxjcm8WPMhajHZTrOV3IsUC6sVUy/TZQDVjfWY6+Az0+yL2ZA6kge4vLhY4yL+6PRYWKBAsquklsaNaMCsTMLh2BEm00kr98J5f4aB/0h+FReMfLn71KTwBgyYWW NNTP-Posting-Date: Mon, 25 Oct 2010 01:14:14 +0000 (UTC) In-Reply-To: <87fwvv4gpg.fsf@mid.deneb.enyo.de> Cancel-Lock: sha1:Hw3tGukfZbILqutstaZ8cYEBCIA= 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="Y2ns9mmrT6fhd5HByHG8t/8feC3pdLoZxO2nYkE/o3wtg9TJgtT93sjK4bHviC8g72Ob7u9KBWIiMoLCugLApxsuaK4jzTwxtDh7A433FLiEn1EsSSLRCw8qntVV1+Kd"; mail-complaints-to="abuse@albasani.net" Xref: g2news1.google.com comp.lang.ada:14730 Date: 2010-10-24T21:13:58-04:00 List-Id: On 10/24/2010 1:56 PM, Florian Weimer wrote: > Perhaps it seems to work for you, but this is not portable. There are > popular targets where the varargs calling convention is markedly > different from the non-varargs calling convention, such as amd64. > It might still work by accident, but all bets are off, really. The Microsoft documentation seems to say that varargs is _not_ markedly different; see http://msdn.microsoft.com/en-us/library/dd2wa36c%28v=VS.80%29.aspx I will concede, however, that these Import pragmas may not be portable to all platforms, but that is true of Import pragmas in general. After all, the calling convention for ioctl can vary from platform to platform, not to mention which calling conventions are supported by the Ada compiler. I am absolutely sure that my pragmas will not work with MS Windows, for an more elementary reason: Win32 / Win64 does not support the ioctl function at all! Instead, the function DeviceIoControl is used to query configure most devices, and the function ioctlsocket is used to query / configure sockets. See http://msdn.microsoft.com/en-us/library/aa363216.aspx http://msdn.microsoft.com/en-us/library/ms738573%28VS.85%29.aspx -- "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"