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
KSQL_ALLOC_CHILD(3) FreeBSD Library Functions Manual KSQL_ALLOC_CHILD(3)

ksql_alloc_child
allocate a ksql database handle in split-process mode

library “ksql”

#include <sys/types.h>
#include <stdint.h>
#include <ksql.h>

struct ksql *
ksql_alloc_child(const struct ksqlcfg *cfg, void (*onfork)(void *arg), void *arg);

The ksql_alloc_child function creates a SQLite database handle. It must be matched by a call to ksql_free(3) unless KSQL_SAFE_EXIT is specified, in which case it will be freed on exit. (It is still good practice to manually free.) It is usually followed by ksql_open(3).

The ksql_alloc_child function differs from ksql_alloc(3) in that the database is opened in a child process instead of within the current process, with all database queries running over a communication socket. This way, the caller can safely sandbox after the function returns.

If cfg is NULL, a configuration from ksql_cfg_defaults(3) is used.

The onfork function, if specified, is invoked by the child after a successful fork(2) with the arg variable. The process environment within which onfork is invoked is prior to its being sandboxed.

This returns the allocated database handle or NULL if an error occurs.

ksql_cfg_defaults(3), ksql_free(3)
May 7, 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.