Services and Modeling for Embedded Software Development
Embecosm divider strip
Prev  Next

5.3.13.  Open a file, open

For a namespace clean function, implement _open, otherwise implement open. The detailed implementation will depend on the file handling functionality available.

A minimal implementation has no file system, so this function must always fail, with an appropriate error code set in errno.

#include <errno.h>

#undef errno
extern int  errno;

int
_open (const char *name,
       int         flags,
       int         mode)
{
  errno = ENOSYS;
  return -1;                    /* Always fails */

}       /* _open () */
	  
Embecosm divider strip