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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b28f27d5b835c2e X-Google-Attributes: gid103376,public From: smize@news.imagin.net (Samuel Mize) Subject: Re: Pragma Import to C "Accept" function? Date: 1997/02/20 Message-ID: <5ej416$17k1@prime.imagin.net>#1/1 X-Deja-AN: 220304918 References: <5ds893$qgf@bs33n.staffs.ac.uk> <5dv9kc$3sr@ash.ridgecrest.ca.us> Organization: ImagiNet Communications Ltd, Arlington, Texas Newsgroups: comp.lang.ada Date: 1997-02-20T00:00:00+00:00 List-Id: In article <5dv9kc$3sr@ash.ridgecrest.ca.us>, Do-While Jones wrote: >In article <5ds893$qgf@bs33n.staffs.ac.uk> cm3bcawp@bs47c.staffs.ac.uk (Al Priest) writes: >>I'm looking for a "nice" way to interface to the C accept function. Given >>it's clash with the reserved word accept, is there a good way to interface >>to the function? and answered, correctly for Ada 83, with Telesoft Telegen 2 on a Sun: >function accept_connection( > socket : in Socket_numbers; > addr : in SYSTEM.Address; > addrlen : in SYSTEM.Address) > return Socket_numbers; >pragma Interface (C, accept_connection); >pragma Interface_Information > (accept_connection, "_accept"); or on Verdix/SGI: >pragma Interface_Name > (accept_connection, "accept"); These pragmas are vendor-specific. In Ada95, the pragma Export is available, which combines the functions of Interface and Interface_Name (or Interface_Information). >>I'm using latest (Jan'97) version of Gnat compiler for Linux in case it >>matters. It matters. Unless you're using the -gnat83 switch, you have Ada95, so you can use pragma Export. Samuel Mize