---
name: "rt_task_ipc_init"
section: "2"
platform: "linux"
package: "rtlinux"
version: "2.0rel-1"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/rt_task_ipc_init"
---

# rt\_task\_ipc\_init(2)

create a real-time task for use with rt\_ipc

## NAME

rt\_task\_ipc\_init - create a real-time task for use with rt\_ipc

## SYNOPSIS

```
#define MODULE
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/errno.h>
#include rt_ipc.h
```

**int rt\_task\_ipc\_init(RT\_TASK\_IPC \*** *task***, void (\****fn***)(int** *data***), int** *data***, int** *stack\_size***, int** *priority***);**

## DESCRIPTION

**rt\_task\_ipc\_init** creates a real-time task.  To make use of the IPC facilities of rt\_ipc, you should use **rt\_task\_ipc\_init** instead of the standard **rt\_task\_init** provided by Real Time Linux. *task* is a structure the space for which must be provided by the application. *task* must be present during the lifetime of the real-time task; thus it cannot be an automatic variable.  This corresponds to the RT\_TASK structure which is passed to  **rt\_task\_init**. *fn* is the entry point of the new task.  The parent task can send a one-integer value *data* to the new task. *stack\_size* is the size of the stack to be used by the new task, and  *priority* is the priority to be given the task.  The highest priority is 1, while the lowest is RT\_LOWEST\_PRIORITY.

The newly created real-time task is initially dormant.  It is normally made active by a call to  **rt\_task\_make\_periodic**.

## RETURN VALUE

On success, 0 is returned.  On failure, a negative value is returned as described below.

## ERRORS

- **-EINVAL**

  *task* is already in use by another task.

- **-ENOMEM**

  space could not be allocated for the real-time task.

## BUGS

The RT\_TASK\_IPC type passed to **rt\_task\_ipc\_init** is not compatible with the RT\_TASK type passed to **rt\_task\_init**. Use the macro MAKE\_RT\_TASK() to convert an RT\_TASK\_IPC to an RT\_TASK when calling a standard Real-Time Linux function.

## AUTHOR

Jerry Epplin \<JerryEpplin@worldnet.att.net\>

## SEE ALSO

[**rt\_mq\_destroy**(2)](/rt_mq_destroy/2.md), [**rt\_mq\_init**(2)](/rt_mq_init/2.md), [**rt\_mq\_receive**(2)](/rt_mq_receive/2.md), [**rt\_mq\_send**(2)](/rt_mq_send/2.md), [**rt\_task\_init**(2)](/rt_task_init/2.md), [**rt\_task\_ipc\_delete**(2)](/rt_task_ipc_delete/2.md), [**rt\_sem\_destroy**(2)](/rt_sem_destroy/2.md), [**rt\_sem\_init**(2)](/rt_sem_init/2.md), [**rt\_sem\_post**(2)](/rt_sem_post/2.md), [**rt\_sem\_trywait**(2)](/rt_sem_trywait/2.md), [**rt\_sem\_wait**(2)](/rt_sem_wait/2.md)
