# Sharing afunction/api btw Apps

**URL:** <https://forum.legato.io/t/sharing-afunction-api-btw-apps/3372>\
**Category:** Legato Application Framework\
**Created:** [June 25, 2018, 2:37pm UTC](https://forum.legato.io/t/sharing-afunction-api-btw-apps/3372 "2018-06-25T14:37:56Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![raf](https://avatars.discourse-cdn.com/v4/letter/r/848f3c/32.png) [@raf](https://forum.legato.io/u/raf)\
**Post date:** [June 26, 2018, 1:05am UTC](https://forum.legato.io/t/sharing-afunction-api-btw-apps/3372/2 "2018-06-26T01:05:33Z")

</div>

Hi @mg_bg.

Unfortunately, according to the [API Files Syntax doc](https://docs.legato.io/latest/apiFilesSyntax.html):

> The returnType is optional, and if specified, can be any type that’s **not** an array, string, or handler.

However, you can specify it as a function parameter with an `OUT` direction in the `.api` file, like so:

```auto
FUNCTION read(string dest [READ_SIZE] OUT);

```

Note that there’s a hard limit of 1100 bytes in an API message payload. This limitation is bidirectional, so both client and server messages are affected. See [IPC Limitation - #2 by kmurphy](https://forum.legato.io/t/ipc-limitation/239/2).

Since you’re already working with files, perhaps you’d be better suited using File Descriptors instead? This also gets around the 1100 byte message size limit. I’ve used it extensively in the past.

```auto
FUNCTION write(file fd_in IN);
FUNCTION read(file fd_out OUT);

```

Cheers,  
Raf

---

_[View the full topic](https://forum.legato.io/t/sharing-afunction-api-btw-apps/3372)._
