abort2 (2)
Leading comments
Copyright (c) 2005 Wojciech A. Koszek <dunstan@FreeBSD.czest.pl> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in ...
NAME
abort2 - abort process with diagnosticsLIBRARY
Lb libcSYNOPSIS
In stdlib.h Ft void Fn abort2 const char *why int nargs void **argsDESCRIPTION
The Fn abort2 system call causes the process to be killed and the specified diagnostic message (with arguments) to be delivered by the kernel to the syslogd(8) daemon.The Fa why argument points to a NUL- terminated string specifying a reason of the program's termination (maximum 128 characters long). The Fa args array contains pointers which will be logged numerically (with the kernel's `%p' printf(9) format). The Fa nargs argument specifies the number of pointers in Fa args (maximum 16).
The Fn abort2 system call is intended for use in situations where continuation of a process is impossible or for other definitive reasons is unwanted, and normal diagnostic channels cannot be trusted to deliver the message.
RETURN VALUES
The Fn abort2 function never returns.The process is killed with SIGABRT unless the arguments to Fn abort2 are invalid, in which case SIGKILL is used.
EXAMPLES
#include <stdlib.h> if (weight_kg > max_load) { void *ptrs[3]; ptrs[0] = (void *)(intptr_t)weight_kg; ptrs[1] = (void *)(intptr_t)max_load; ptrs[2] = haystack; abort2("Camel overloaded", 3, ptrs); }