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,e67f22fb47167a91,start X-Google-Attributes: gid103376,public From: "moelands j.m." Subject: Ada/Linux/select() problem Date: 1997/04/02 Message-ID: <334281E6.2781@nlr.nl>#1/1 X-Deja-AN: 230157137 Organization: National Aerospace Laboratory (NLR) Newsgroups: comp.lang.ada Date: 1997-04-02T00:00:00+00:00 List-Id: I have a problem with the select() system call on linux in combination with Ada. The following short example program, consisting of an Ada main routine main.adb, an interface package sel.ad[sb] providing the interface between Ada and C, and a file dosel.c containing the C routine calling select(), does run on a Unix machine (as it should, imo). However, it does not run under linux - the result is a core dump. The call to select() seems to garble the stack. I use gnat 3.09 and linux 2.0.0. Does anybody have any idea what might cause this problem? ======= dosel.c: ======= #include #include #include #include #include int do_select(void) { int channel_no = 1; fd_set read_mask; struct timeval input_timer; input_timer.tv_sec = 0; input_timer.tv_usec = 0; FD_ZERO (&read_mask); FD_SET (channel_no, &read_mask); return select (32, &read_mask, NULL, NULL, &input_timer); } ======= sel.ads: ======= package Sel is procedure My_Select; end Sel; ======= sel.adb: ======= package body Sel is procedure Do_Select; pragma Interface (C, Do_Select); procedure My_Select is begin Do_Select; end My_Select; end Sel; ======== main.adb: ======== with Sel; procedure Main is begin Sel.My_Select; end Main; ====== Jeroen Moelands (moelands@nlr.nl)