summaryrefslogtreecommitdiff
path: root/usr.bin/make/buf.h
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2012-09-21 07:55:21 +0000
committerMarc Espie <espie@cvs.openbsd.org>2012-09-21 07:55:21 +0000
commit10f160f479b38433f4047a2f25d5aa8f07bc60e6 (patch)
tree3c0207b7741e4887482742726e4bc1238f03de6b /usr.bin/make/buf.h
parent844d86d53b6754d7a21150eb94823f41ce76becc (diff)
major overhaul of the way make handle jobs, inspired by dpb:
instead of forking a "job" per target, and having that job further fork separate commands, have make maintain a list of jobs, indexed by pid of currently running commands, and handle process termination continuation-style. This has lots of benefits: - make is responsible for most printing, so we no longer need pipes nor job control: make -j jobs see the tty. - no more special-casing for jobs that don't really execute anything. - unify code for make -jn and make -B, including signal handlers and job waiting. So make -n, make -q, +cmd now run commands in the same way in all cases. - unified more accurate error-reporting, as make knows precisely which command failed. Commands are tagged with their lines, and we display failing commands in silent mode. - fine-grained "expensive" command handling (recursion limiter). Do it per-command instead of per-target. Moreover, signal response is now simpler, as we just block the signals in a small critical sections, test for events, and sigpause (thanks a lot to guenther@ and millert@), so running make is now almost always paused without any busy-waiting. Thanks to everyone who tested and gave input.
Diffstat (limited to 'usr.bin/make/buf.h')
-rw-r--r--usr.bin/make/buf.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/make/buf.h b/usr.bin/make/buf.h
index 980d15a9546..4806b434b51 100644
--- a/usr.bin/make/buf.h
+++ b/usr.bin/make/buf.h
@@ -1,7 +1,7 @@
#ifndef _BUF_H
#define _BUF_H
-/* $OpenBSD: buf.h,v 1.19 2010/07/19 19:46:43 espie Exp $ */
+/* $OpenBSD: buf.h,v 1.20 2012/09/21 07:55:20 espie Exp $ */
/* $NetBSD: buf.h,v 1.7 1996/12/31 17:53:22 christos Exp $ */
/*
@@ -133,4 +133,7 @@ do { \
* Removes non-backslashed spaces at the end of a buffer. */
extern void Buf_KillTrailingSpaces(Buffer);
+extern void Buf_printf(Buffer, const char *, ...);
+#define Buf_puts(b, s) Buf_AddChars((b), strlen(s), (s))
+
#endif /* _BUF_H */