BarryServer : Git

All the code for all my projects
// BarryServer : Git / OrionLibC / blob / ad9b6af63f1fdfcf3556c9b2fc670f72cdc60ab4 / stdio / puts.c

// Related

OrionLibC

Barry Importing existing Orion LibC 03048a9 (2 years, 2 months ago)
#include <unistd.h>
#include <string.h>

/* Write a string to stdout */
int
puts(const char *str)
{
	char end[] = "\n";
	int len = strlen(str);
	len = write(STDOUT_FILENO, (void *) str, len);
	return len + write(STDOUT_FILENO, end, 1);
}

/* Write a character to stdout */
int
putchar(int c)
{
	char str[] = {(char) c, 0};
	write(STDOUT_FILENO, str, 1);
	return c;
}