libevl/eshi
Philippe Gerum 9b42b85ed8 lib: introduce element visibility attribute
Since core ABI 21, users can decide whether a new element should be
made public or private depending on the value of clone flags added to
the new long form of all element creation calls, i.e. evl_create_*().
All evl_new_*() calls become a shorthand for their respective long
form with reasonable default arguments, including private visibility.

As a shorthand, libevl also interprets a slash character leading the
name argument passed to these services as an implicit request for
creating a public element. In other words, this is the same as passing
EVL_CLONE_PUBLIC in the clone flags.

A public element appears as a cdev in the /dev/evl hierarchy, which
means that it is visible to other processes, which may share it. On
the contrary, a private element is only known from the process
creating it, although it does appear in the /sysfs hierarchy
regardless.

e.g.:

efd = evl_attach_self("/visible-thread");

total 0
crw-rw----    1 root     root      248,   1 Apr 17 11:59 clone
crw-rw----    1 root     root      246,   0 Apr 17 11:59 visible-thread

or,

efd = evl_attach_self("private-thread");

total 0
crw-rw----    1 root     root      248,   1 Apr 17 11:59 clone

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
2020-04-18 20:43:02 +02:00
..
Makefile build: do apply generated header dependencies 2020-03-26 10:20:16 +01:00
README.md eshi: EVL shim library 2019-08-09 19:07:39 +02:00
clock.c lib: rename evl_udelay() to evl_usleep() 2020-01-21 14:52:21 +01:00
event.c lib: introduce element visibility attribute 2020-04-18 20:43:02 +02:00
flags.c lib: introduce element visibility attribute 2020-04-18 20:43:02 +02:00
heap.c eshi: EVL shim library 2019-08-09 19:07:39 +02:00
init.c lib, eshi: move version string to evl_version 2019-11-13 10:00:39 +01:00
internal.h eshi: EVL shim library 2019-08-09 19:07:39 +02:00
mutex.c lib: introduce element visibility attribute 2020-04-18 20:43:02 +02:00
poll.c eshi: EVL shim library 2019-08-09 19:07:39 +02:00
proxy.c lib/proxy: fix error code propagation 2019-11-13 12:02:32 +01:00
sched.c eshi: EVL shim library 2019-08-09 19:07:39 +02:00
sem.c lib: introduce element visibility attribute 2020-04-18 20:43:02 +02:00
thread.c eshi: fix access race to thread index tree 2020-03-28 16:47:28 +01:00
timer.c eshi: EVL shim library 2019-08-09 19:07:39 +02:00
version.c lib, eshi: move version string to evl_version 2019-11-13 10:00:39 +01:00

README.md

== PURPOSE of libeshi

The EVL shim library mimics the behavior of the original EVL API based on plain POSIX calls from the native *libc, which does not require the EVL core to be enabled in the host kernel. It is useful when the real-time guarantees delivered by the EVL core are not required for quick prototyping or debugging application code.

== USAGE

To build against the EVL shim library, you need to update a couple of settings from the Makefile building your application as follows (*):

CPPFLAGS/CFLAGS:

  • Replace -I$(prefix)/include by -I$(prefix)/include/eshi

LDFLAGS:

  • Replace -levl by -leshi

For instance:

(CC) -o app app.c -I(prefix)/include/eshi -L$(prefix)/lib -leshi -lpthread -lrt

(*) $(prefix) is the installation root of libevl (e.g. /usr/evl).

== LIMITATIONS

This API supports process-local services only. The resources/objects it creates cannot be shared between processes.

The following calls are not supported:

evl_peek_flags evl_peek_sem evl_new_xbuf evl_open_mutex evl_open_event evl_open_flags evl_open_sem

== VARIATION(S)

evl_poll: POLLOUT is always set for evl_flags. Unlike with the native libevl API, this condition cannot be monitored for detecting event consumption by the receiver side, i.e. waiting for the value to be cleared upon a successful call to evl_wait*_flags.