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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham 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!news1.google.com!news.glorb.com!feeder.erje.net!news.internetdienste.de!newsfeed.velia.net!news.tu-darmstadt.de!news.belwue.de!LF.net!news.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: The "black magic" of ioctl Date: Sat, 23 Oct 2010 22:26:51 +0200 Message-ID: <877hh8lkok.fsf@mid.deneb.enyo.de> References: <74b46743-fb81-48cc-a478-ffd069db2fc6@k22g2000yqh.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: idssi.enyo.de 1287865611 16368 172.17.135.6 (23 Oct 2010 20:26:51 GMT) X-Complaints-To: news@enyo.de Cancel-Lock: sha1:2/DjxIIswDrOtHsuJ91jmE/mSHk= Xref: g2news1.google.com comp.lang.ada:14702 Date: 2010-10-23T22:26:51+02:00 List-Id: * Francesco Piraneo Giuliano: > But my application still need to be written and has to run under linux > so to collect some data about linux' framebuffer I have to use ioctl; > the only solution is to write all low level interfacing (open the > device, get informations about, map it into memory) in C then write > the upper level in Ada? ioctl is a varargs function. You cannot call C varargs functions directly from Ada. You need to write a small wrapper with a fixed number of arguments. In addition, the ioctl constants are often difficult to extract from the header files. The best way to get them seems to be a small C program which just prints them. So writing some C code is unavoidable here.