/ docs / man / man3 / rtapi_app_main.3rtapi
rtapi_app_main.3rtapi
 1  .TH rtapi_app_main "3rtapi" "2008-05-26" "LinuxCNC Documentation" "HAL"
 2  .SH NAME
 3  
 4  rtapi_app_main \- User-provided function to initialize a component
 5  
 6  .SH SYNTAX
 7  .nf
 8  .B #include <rtapi_app.h>
 9  .HP
10  .BI "int rtapi_app_main(void) {" ... "}"
11  .fi
12  .SH ARGUMENTS
13  None
14  
15  .SH DESCRIPTION
16  The body of \fBrtapi_app_main\fR, which is provided by the component author,
17  generally consists of a call to rtapi_init or hal_init, followed by other
18  component-specific initialization code.
19  
20  .SH RETURN VALUE
21  Return 0 for success.  Return a negative errno value (e.g., \-EINVAL) on
22  error.  Existing code also returns RTAPI or HAL error values, but using
23  negative errno values gives better diagnostics from insmod.
24  
25  .SH REALTIME CONSIDERATIONS
26  Called automatically by the rtapi infrastructure in an initialization (not
27  realtime) context.
28  
29  .SH SEE ALSO
30  \fBrtapi_app_exit(3rtapi)\fR,
31  \fBrtapi_init(3rtapi)\fR,
32  \fBhal_init(3hal)\fR