e code is governed by a BSD-style
// license that can be found in the LICENSE file.

#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

int main() {
	char *name;
	int fd;
	char *p;
	int i;

	// embedded file
	name = "data/hello.c";

	// open for readonly
	fd = open(name, 0);
	if(fd < 0) {
		printf("could not open(%s) file\n", name);
		return -1;
	}

	p = malloc(1024);
	i = read(fd, p, 1024-1);
	close(fd);

	if(i <= 0) {
		free(p);
		printf("read() returned %d\n", i); return -1;
