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,14aa27db81ce3b40 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.glorb.com!news2.glorb.com!wn11feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Re: How to exit an Ada program with (unix shell) error code? Reply-To: anon@anon.org (anon) References: <49ba30c9-a1e6-4346-8618-d256f87ac301@s31g2000vbp.googlegroups.com> <356247f9-4a83-44aa-a412-4500e6af19cf@f1g2000prb.googlegroups.com> <2yxMl.30237$941.3661@bgtnsc04-news.ops.worldnet.att.net> <4a02b178$0$31872$9b4e6d93@newsspool3.arcor-online.net> X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Thu, 07 May 2009 11:22:46 GMT NNTP-Posting-Host: 12.65.24.142 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1241695366 12.65.24.142 (Thu, 07 May 2009 11:22:46 GMT) NNTP-Posting-Date: Thu, 07 May 2009 11:22:46 GMT Organization: AT&T Worldnet Xref: g2news2.google.com comp.lang.ada:5726 Date: 2009-05-07T11:22:46+00:00 List-Id: "Initialize_spca_Driver" is the main subprogram for this device module in either Ada or C versions with Linux ; with Linux.Modules ; with Linux.Modules.IO ; use Linux ; use Modules ; use IO ; package body spca is .. -- ------------------------------------------------------------------------ -- -- Initialize_spca_Driver -- -- -- -- Initialize_spca_Driver -- Initializes the loadable module. -- -- 1. Create and extry in the "/proc" -- -- 2. Registers the usb device -- -- -- -- ------------------------------------------------------------------------ -- function Initialize_spca_Driver return Exit_Status is begin Create_Proc_File_System ; if usb_register ( USB_Driver_Table ) then info ( "SPCA USB ERROR: Camera driver not installed" ) ; -- Error tell kernel it can reclaim this memory return Failure ; end if ; -- It up and waiting info ( DRIVER_DESC & " : version " & DRIVER_VERSION ) ; return Success ; end Initialize_spca_Driver ; end spca ; /* C version: from spca.c */ /* Now, where is the void??? */ /* ************************************************************************ */ /* Initialize_spca_Driver */ /* */ /* Initialize_spca_Driver -- Initializes the loadable module. */ /* 1. Create and extry in the "/proc" */ /* 2. Registers the usb device */ /* */ /* ************************************************************************ */ int __init Initialize_spca_Driver ( void ) { #ifdef CONFIG_PROC_FS Create_Proc_File_System ( ) ; #endif if ( usb_register ( &USB_Driver_Table ) ) { info ( "SPCA USB ERROR: Camera driver not installed" ) ; /* notify kernel that memory can be recalmed */ return -1 ; } info ( DRIVER_DESC " : version " DRIVER_VERSION ) ; return 0 ; } In <4a02b178$0$31872$9b4e6d93@newsspool3.arcor-online.net>, Georg Bauhaus writes: >anon schrieb: >> Using a "function" type of module install >> program is the only way a "Module" can be written and have an >> "exit status". > >Uhm, no. > >Actually, the clean up routines of modules (assuming >Linux kernel modules) have "void" return type. > > >> Note: Ada as a computer language should be allowed to create >> these type of programs which means that Ada needs to >> support main subprogram that are functions. > >What seems needed is a way to write programs such that >they follow the conventions of the respective execution >environment; communication; interrupts; special locations; >and maybe return values. > >This will necessarily depend on the execution environment, >I should think, which may or may not require *some* >subprogram to be a function with parameters, say.