/*
 * multi-read different files in one process
 */

#include <fcntl.h>
#include <unistd.h>

int main(void)
{
	const char *files[] = {
		"/etc/hostname", "/etc/hosts",
		"/etc/resolv.conf", "/etc/passwd",
		"/etc/group", "/etc/nsswitch.conf",
		0
	};
	for (int i = 0; files[i]; i++) {
		int fd = open(files[i], O_RDONLY);
		if (fd >= 0) {
			char b[32];
			read(fd, b, sizeof b);
			close(fd);
		}
	}
	return 0;
}
