// // LLVM can't inline variadic functions, and we don't want one definition of // this per #include in libc.so, so no `static`. // inline __noreturn __printflike(1, 2) void __fortify_fatal(constchar* fmt, ...) {
va_list args;
va_start(args, fmt);
async_safe_fatal_va_list("FORTIFY", fmt, args);
va_end(args);
// Assume we can save a stack frame in the crash, fall back to abort() if not. #if !defined(BIONIC_RUST_BAREMETAL)
inline_raise(SIGABRT); #endif
abort();
}
// // Common helpers. //
staticinlinevoid __check_fd_set(constchar* fn, int fd, size_t set_size) { if (__predict_false(fd < 0)) {
__fortify_fatal("%s: file descriptor %d < 0", fn, fd);
} if (__predict_false(fd >= FD_SETSIZE)) {
__fortify_fatal("%s: file descriptor %d >= FD_SETSIZE %d", fn, fd, FD_SETSIZE);
} if (__predict_false(set_size < sizeof(fd_set))) {
__fortify_fatal("%s: set size %zu is too small to be an fd_set", fn, set_size);
}
}
staticinlinevoid __check_pollfd_array(constchar* fn, size_t fds_size, nfds_t fd_count) {
size_t pollfd_array_length = fds_size / sizeof(pollfd); if (__predict_false(pollfd_array_length < fd_count)) {
__fortify_fatal("%s: %zu-element pollfd array too small for %u fds",
fn, pollfd_array_length, fd_count);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.