9base

revived minimalist port of Plan 9 userland to Unix
git clone git://git.suckless.org/9base
Log | Files | Refs | README | LICENSE

commit 45d1314a1bd1886c42c1bdaac4a0128f23f50e32
parent 51cdf1141edd627428ecf0b8bd643142dd5c3773
Author: Anselm R Garbe <anselm@garbe.us>
Date:   Sat, 27 Apr 2013 21:07:51 +0200

applied David Galos musl compile patch, thanks

Diffstat:
Mlib9/_p9dir.c | 2+-
Mlib9/dirread.c | 6++++++
Mlib9/libc.h | 1+
Mlib9/readcons.c | 4+++-
4 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/lib9/_p9dir.c b/lib9/_p9dir.c @@ -61,7 +61,7 @@ disksize(int fd, struct stat *st) return (vlong)lab.d_partitions[n].p_size * lab.d_secsize; } -#elif defined(__linux__) +#elif defined(__linux__) && !defined(__MUSL__) #include <linux/hdreg.h> #include <linux/fs.h> #include <sys/ioctl.h> diff --git a/lib9/dirread.c b/lib9/dirread.c @@ -21,6 +21,12 @@ static int mygetdents(int fd, struct dirent *buf, int n) { return syscall (getdents, fd, (void*) buf, n); } +# elif defined(__MUSL__) +static int +mygetdents(int fd, struct dirent *buf, int n) +{ + return getdents(fd, (void*)buf, n); +} # else static int mygetdents(int fd, struct dirent *buf, int n) diff --git a/lib9/libc.h b/lib9/libc.h @@ -438,6 +438,7 @@ extern void (*_unpin)(void); #define decrypt p9decrypt #define getenv p9getenv #define getwd p9getwd +#undef longjmp #define longjmp p9longjmp #undef setjmp #define setjmp p9setjmp diff --git a/lib9/readcons.c b/lib9/readcons.c @@ -2,7 +2,9 @@ #define NOPLAN9DEFINES #include <libc.h> #include <termios.h> -#include <sys/termios.h> +#ifndef __MUSL__ +# include <sys/termios.h> +#endif static int rawx(int fd, int echoing)