Comtrol eCos User Manual

Page 768

Advertising
background image

System Calls

eCos packages and applications should never

#include

Linux header files directly. For example, doing a

#include

<

/usr/include/fcntl.h

>

to access additional macros or structure definitions, or alternatively

manipulating the header file search path, will lead to problems because the Linux header files are likely to
duplicate and clash with definitions in the eCos headers. Instead the appropriate functionality should be extracted
from the Linux headers and moved into either

cyg/hal/hal_io.h

or into application code, with suitable

renaming to avoid clashes with eCos names. Users should be aware that large-scale copying may involve licensing
complications.

Adding more system calls is usually straightforward and involves adding one or more lines to the platform-specific
file in the appropriate platform HAL, for example

syscall-i386-linux-1.0.S

. However it is necessary to do

some research first about the exact interface implemented by the system call, because of issues such as old system
calls that have been superseded. The required information can usually be found fairly easily by searching through
the Linux kernel sources and possibly the GNU C library sources.

664

Advertising