kindle/kindle/backports/fortify.c
2025-05-21 16:46:39 +02:00

21 lines
433 B
C

#include <stdio.h>
#include <stdlib.h>
#include <sys/select.h>
#include <unistd.h>
void __attribute__((noreturn)) __fortify_fail(const char *msg) {
fprintf(stderr, "*** <unknown> ***: %s terminated\n", msg);
abort();
}
void __attribute__((noreturn)) __chk_fail(void) {
__fortify_fail("buffer overflow detected");
}
long int __fdelt_chk(long int d) {
if (d >= FD_SETSIZE) {
__chk_fail();
}
return d / __NFDBITS;
}