Commit Briefs

Russ Cox

INSTALL: build mk all the time

If mk gets into a bad state, it's not obvious that you can remove the binary to force the rebuild. Also, not rebuilding means that bugs in mkmk.sh are not noticed. Just rebuild from scratch every time. It doesn't take too long compared to the rest of INSTALL.


Russ Cox

9c, 9l: accept CC9FLAGS from config

Also, if CC9FLAGS includes -fsanitize=address (ASAN), predefine PLAN9PORT_ASAN for use by programs that need to know (mainly libthread). The 9c script used to have a variable called ngflags, which was ccflags except -g (ng stood for "no g"), but nothing needs it split out anymore, so simplify to just ccflags.


Russ Cox

mk: replace overlapping strcpy with memmove

Found by ASAN.


Russ Cox

lib9: use opendir/readdir to read directories

getdirentries(2) has been deprecated on macOS since 10.5 (ten releases ago). Using it requires disabling 64-bit inodes, but that in turn makes binaries incompatible with some dynamic libraries, most notably ASAN. At some point getdirentries(2) will actually be removed. For both these reasons, switch to opendir/readdir. A little clunky since we have to keep the DIR* hidden away to preserve the int fd interfaces, but it lets us remove a bunch of OS-specific code too.


Russ Cox

lib9: move seek into open.c

More preparation for opendir.


Russ Cox

lib9: add close

More preparation for opendir.


Russ Cox

lib9: merge create, open, dirread into open.c

Preparation for using opendir.


Dan Cross

fmt: adjust GCC version check

atomics were added in GCC 4.9: https://gcc.gnu.org/gcc-4.9/changes.html





Russ Cox

fmt: disable use of stdatomic on AIX XL C and old GCC

C11 is apparently too new for these systems. Fixes #55.