From: anon@anon.org (anon)
Subject: Re: How to exit an Ada program with (unix shell) error code?
Date: Thu, 07 May 2009 11:22:46 GMT
Date: 2009-05-07T11:22:46+00:00 [thread overview]
Message-ID: <awzMl.204755$4m1.26042@bgtnsc05-news.ops.worldnet.att.net> (raw)
In-Reply-To: 4a02b178$0$31872$9b4e6d93@newsspool3.arcor-online.net
"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 <rm.dash-bauhaus@futureapps.de> 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.
next prev parent reply other threads:[~2009-05-07 11:22 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-04 9:08 How to exit an Ada program with (unix shell) error code? reinkor
2009-05-04 9:17 ` Samuel Tardieu
2009-05-04 9:26 ` reinkor
2009-05-04 9:31 ` Ludovic Brenta
2009-05-04 9:47 ` reinkor
2009-05-04 9:54 ` Martin
2009-05-04 11:38 ` sjw
2009-05-04 10:07 ` stefan-lucks
2009-05-04 13:42 ` Robert A Duff
2009-05-04 16:19 ` Martin
2009-05-07 9:48 ` anon
2009-05-04 16:09 ` anon
2009-05-05 10:49 ` Rob Norris
2009-05-05 11:15 ` Georg Bauhaus
2009-05-05 11:43 ` Martin
2009-05-05 14:57 ` Adam Beneschan
2009-05-05 15:34 ` Jean-Pierre Rosen
2009-05-06 15:28 ` Adam Beneschan
2009-05-06 22:10 ` Randy Brukardt
2009-05-07 9:08 ` anon
2009-05-07 10:01 ` Georg Bauhaus
2009-05-07 11:22 ` anon [this message]
2009-05-07 12:08 ` Martin
2009-05-07 13:34 ` Georg Bauhaus
2009-05-07 16:26 ` Adam Beneschan
2009-05-08 10:17 ` anon
2009-05-12 22:55 ` Adam Beneschan
2009-05-14 2:55 ` anon
2009-05-14 8:04 ` Martin
2009-05-14 8:39 ` Martin
2009-05-14 8:45 ` Martin
2009-05-14 9:34 ` Ludovic Brenta
2009-05-14 10:05 ` Martin
2009-05-14 12:38 ` Georg Bauhaus
2009-05-14 15:34 ` Adam Beneschan
2009-05-15 10:20 ` anon
2009-05-15 11:19 ` Martin
2009-05-05 20:48 ` anon
2009-05-05 21:01 ` Adam Beneschan
2009-05-06 11:30 ` Hibou57 (Yannick Duchêne)
2009-05-05 20:31 ` anon
2009-05-05 21:27 ` Martin
2009-05-06 8:41 ` anon
2009-05-06 9:14 ` Martin
2009-05-06 11:41 ` Georg Bauhaus
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox