[][src]Function linuxcnc_hal_sys::hal_init

pub unsafe extern "C" fn hal_init(name: *const c_char) -> c_int

'hal_init()' is called by a HAL component before any other hal function is called, to open the HAL shared memory block and do other initialization. 'name' is the name of the component. It must be unique in the system. It must be no longer than HAL_NAME_LEN. On success, hal_init() returns a positive integer component ID, which is used for subsequent calls to hal_xxx_new() and hal_exit(). On failure, returns an error code (see above). 'hal_init()' calls rtapi_init(), so after calling hal_init(), a component can use any rtapi functions. The component ID returned by 'hal_init()' is also the RTAPI module ID for the associated module, and can be used when calling rtapi functions. Call only from within user space or init/cleanup code, not from realtime code.