Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

abort2(2) [freebsd man page]

ABORT2(2)						      BSD System Calls Manual							 ABORT2(2)

NAME
abort2 -- abort process with diagnostics LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <stdlib.h> void abort2(const char *why, int nargs, void **args); DESCRIPTION
The 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 why argument points to a NUL-terminated string specifying a reason of the program's termination (maximum 128 characters long). The args array contains pointers which will be logged numerically (with the kernel's '%p' printf(9) format). The nargs argument specifies the number of pointers in args (maximum 16). The 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 abort2() function never returns. The process is killed with SIGABRT unless the arguments to 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); } SEE ALSO
abort(3), exit(3) HISTORY
The abort2() system call first appeared in FreeBSD 7.0. AUTHORS
The abort2() system call was designed by Poul-Henning Kamp <phk@FreeBSD.org>. It was implemented by Wojciech A. Koszek <dunstan@freebsd.czest.pl>. BSD
September 30, 2006 BSD

Check Out this Related Man Page

GETFIELDS(2)							System Calls Manual						      GETFIELDS(2)

NAME
getfields, getmfields, setfields, tokenize - break a string into fields SYNOPSIS
#include <u.h> #include <libc.h> int getfields(char *str, char **ptrs, int nptrs) int getmfields(char *str, char **ptrs, int nptrs) char* setfields(char *fielddelim) int tokenize(char *str, char **args, int max) DESCRIPTION
Getfields breaks the null-terminated string str into at most nptrs null-terminated fields and places pointers to the start of these fields in the array ptrs. It returns the number of fields and terminates the list of pointers with a zero pointer. It overwrites some of the bytes in str. If there are nptr or more fields, the list will not end with zero and the last `field' will extend to the end of the input string and may contain delimiters. A field is defined as a maximal sequence of characters not in a set of field delimiters. Adjacent fields are separated by exactly one delimiter. No field follows a delimiter at the end of string. Thus a string of just two delimiter characters contains two empty fields, and a nonempty string with no delimiters contains one field. Getmfields is the same as getfields except that fields are separated by maximal strings of field delimiters rather than just one. Setfields makes the field delimiters (space and tab by default) be the characters of the string fielddelim and returns a pointer to a string of the previous delimiters. Tokenize breaks null-terminated string str into tokens by replacing every blank or newline with a null byte. Pointers to successive non- empty tokens are placed in args. Processing stops after max tokens are processed. Tokenize returns the number of tokens processed. Tok- enize does not terminate args with a null pointer. Alef Of these routines, only tokenize is in Alef. SOURCE
/sys/src/libc/port/getfields.c /sys/src/libc/port/tokenize.c SEE ALSO
strtok in strcat(2) GETFIELDS(2)
Man Page