summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-07-15 15:39:44 -0400
committerJakob Kaivo <jkk@ung.org>2019-07-15 15:39:44 -0400
commit00a3fa7df6fe176a87cc9fcb0ff0889a9e402868 (patch)
tree21438868098820b99185d3f57a864c86546b1ac1
parentd0ce08d19b7e6997417c3fffb31033542a18dfc3 (diff)
add hacking section
-rw-r--r--README.md21
1 files changed, 19 insertions, 2 deletions
diff --git a/README.md b/README.md
index f0d314c..9be165a 100644
--- a/README.md
+++ b/README.md
@@ -9,5 +9,22 @@ describe system errors based on their numeric values
For example:
-```$ ./strerror 1
-1: Operation not permitted [EPERM]```
+```
+$ ./strerror 1
+1: Operation not permitted [EPERM]
+```
+
+# hacking
+The file `errlist` contains a list of symbolic constants (AKA C macros) that
+can be expected to be found in `<errno.h>` on POSIX systems. Constants are
+listed one per line. A one-line AWK command transforms this into the bulk
+of `strerror.h`, along with some `printf` calls in `Makefile`.
+
+To add more errors (for instance, GNU or Linux specific stuff that doesn't
+exist in POSIX), just add them, one per line, to `errlist` and re-run `make`.
+Every constant (and I mean every, even standard C constants like `ERANGE` and
+`EDOM`) is only included in the list if it is defined, so there are no
+portability concerns with adding macros that don't exist.
+
+There is a problem with adding constants that expand to identical values,
+though, so don't do that.