Blame motd.c

16ae2b
#include <unistd.h>
16ae2b
#include <fcntl.h>
16ae2b
16ae2b
void motd(void)
16ae2b
{
16ae2b
	int fd, size;
16ae2b
	char buf[8192];
16ae2b
16ae2b
	if((fd = open("/etc/motd", O_RDONLY, 0)) == -1)
16ae2b
		return;
16ae2b
16ae2b
	while((size = read(fd, buf, sizeof(buf))) > 0)
16ae2b
		write(STDOUT_FILENO, buf, size);
16ae2b
16ae2b
	close(fd);
16ae2b
}