GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SET_CONSTRAINT_HANDLER_S(3) FreeBSD Library Functions Manual SET_CONSTRAINT_HANDLER_S(3)

set_constraint_handler_s, abort_handler_s, ignore_handler_s
runtime-constraint violation handling

Standard C Library (libc, -lc)

#define __STDC_WANT_LIB_EXT1__ 1

#include <stdlib.h>

constraint_handler_t
set_constraint_handler_s(constraint_handler_t handler);

typedef void
(*constraint_handler_t)(const char * restrict msg, void * restrict ptr, errno_t error);

void
abort_handler_s(const char * restrict msg, void * restrict ptr, errno_t error);

void
ignore_handler_s(const char * restrict msg, void * restrict ptr, errno_t error);

The set_constraint_handler_s() function sets the runtime-constraint violation handler to be handler.

The runtime-constraint handler is the callback function invoked when a library function detects a runtime-constraint violation.

The arguments are as follows:

msg
A pointer to a character string describing the runtime-constraint violation.
ptr
A NULL pointer.
error
If the function calling the handler has a return type declared as errno_t, the return value of the function is passed. Otherwise, a positive value of type errno_t is passed.

Only the most recent handler registered with set_constraint_handler_s() is called when a runtime-constraint violation occurs.

The implementation has a default constraint handler that is used if no calls to the set_constraint_handler_s() function have been made. If the handler argument to set_constraint_handler_s() is a NULL pointer, the default handler becomes the current constraint handler.

The abort_handler_s() and ignore_handler_s() are the standard-defined runtime-constraint handlers provided by the C library.

The abort_handler_s() function writes the error message including the msg to stderr and calls the abort(3) function. The abort_handler_s() is currently the default runtime-constraint handler.

The ignore_handler_s() simply returns to its caller.

The set_constraint_handler_s() function returns a pointer to the previously registered handler, or NULL if none was previously registered.

The abort_handler_s() function does not return to its caller.

The ignore_handler_s() function returns no value.

The set_constraint_handler_s() function conforms to ISO/IEC 9899:2011 (“ISO C11”) K.3.6.1.1.

This manual page was written by Yuri Pankov <yuripv@yuripv.net>.
August 18, 2018 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.