diff --git a/lib/libio.c b/lib/libio.c index dfac121..295c9b3 100644 --- a/lib/libio.c +++ b/lib/libio.c @@ -10,6 +10,11 @@ _strlen(char *s){ return i; } +int +fdprint(int fd, char *s){ + write(fd, s, _strlen(s)); +} + /* SLOW. DO NOT USE. */ static int write1(int fd, int c){ while(write(fd, &c, 1) != 1); diff --git a/lib/libio.h b/lib/libio.h index 02bec95..0dedf40 100644 --- a/lib/libio.h +++ b/lib/libio.h @@ -1,5 +1,6 @@ #ifndef _LIBIO_H # define _LIBIO_H +int fdprint(int fd, char *s); int fdputd(int fd, int d); int fdputs(int fd, char *s); int parse_uint(char *s);