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,4f32e5319ea9d646,start X-Google-Attributes: gid103376,public From: Laurent Deniel Subject: Gnat and non thread-safe C libraries Date: 1999/01/22 Message-ID: <36A8F967.F70E3DEF@worldnet.fr>#1/1 X-Deja-AN: 435786895 Content-Transfer-Encoding: 7bit To: Pascal MALAISE X-Accept-Language: en Followup-To: poster Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@isdnet.net X-Trace: news2.isdnet.net 917043526 10851 195.3.19.186 (22 Jan 1999 22:18:46 GMT) Organization: Home Mime-Version: 1.0 NNTP-Posting-Date: 22 Jan 1999 22:18:46 GMT Newsgroups: comp.lang.ada Date: 1999-01-22T22:18:46+00:00 List-Id: Hi all I am trying to migrate an Ada program to the Linux/gnat environment. The program makes use of the X library and of other non thread-safe C libraries. As gnat may internally use threads even if this program does not contain Ada tasks, I encounter some random weird behaviors depending on the thread library: With the default one (FSU), the signal handling in one library is broken since some signals (SIGIO, SIGURG) are received (and the associated handlers are executed) in some runtime thread context while the user thread has blocked that signals (the library expects that such signals are blocked at process level). I tried to use the Block_Interrupt procedure but without success (segmentation violation). With the native one (Linux kernel Threads), the signal handling is compatible with all libraries but the errno value is incorrect in those that were not compiled with the flag _REENTRANT (like X lib). So a little question: is it possible to avoid thread usage in the gnat runtime when a program does not make use of the Ada tasking ? Any other advises would be greatly appreciated ... Laurent. -- Laurent DENIEL | E-mail: deniel@worldnet.fr Paris, FRANCE | deniel@fr.airsysatm.thomson-csf.com | WWW : http://www.worldnet.fr/~deniel All above opinions are personal, unless stated otherwise.