diff options
author | Samuel Holland <samuel@sholland.org> | 2018-01-14 23:27:19 -0600 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2018-01-15 00:02:54 -0600 |
commit | 509d6ec7c860e9c327cc9e2860a276787b4bb23f (patch) | |
tree | faec394aa813142ce85383e80ab556322f54fdb9 | |
parent | b087b07c9649b7e4398093720ebcf96f205c2c49 (diff) | |
download | gcompat-509d6ec7c860e9c327cc9e2860a276787b4bb23f.tar.gz gcompat-509d6ec7c860e9c327cc9e2860a276787b4bb23f.tar.bz2 gcompat-509d6ec7c860e9c327cc9e2860a276787b4bb23f.tar.xz gcompat-509d6ec7c860e9c327cc9e2860a276787b4bb23f.zip |
misc: Implement some miscellaneous functions
Signed-off-by: Samuel Holland <samuel@sholland.org>
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | libgcompat/misc.c | 33 |
2 files changed, 34 insertions, 0 deletions
@@ -8,6 +8,7 @@ LIBGCOMPAT_SRC = \ libgcompat/grp.c \ libgcompat/malloc.c \ libgcompat/math.c \ + libgcompat/misc.c \ libgcompat/pthread.c \ libgcompat/pwd.c \ libgcompat/resolv.c \ diff --git a/libgcompat/misc.c b/libgcompat/misc.c new file mode 100644 index 0000000..aee490f --- /dev/null +++ b/libgcompat/misc.c @@ -0,0 +1,33 @@ +#include <stdlib.h> /* abort, at_quick_exit */ +#include <sys/stat.h> /* dev_t */ +#include <sys/sysmacros.h> /* major, makedev, minor */ + +/** + * Terminate a function in case of buffer overflow. + * + * LSB 5.0: LSB-Core-generic/baselib---chk-fail-1.html + */ +void __chk_fail(void) +{ + abort(); +} + +int __cxa_at_quick_exit(void (*func)(void), void *__dso_handle) +{ + return at_quick_exit(func); +} + +unsigned int gnu_dev_major(dev_t dev) +{ + return major(dev); +} + +dev_t gnu_dev_makedev(unsigned int maj, unsigned int min) +{ + return makedev(maj, min); +} + +unsigned int gnu_dev_minor(dev_t dev) +{ + return minor(dev); +} |