SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG
DONATE


YUM REPOSITORY

 
 

MAN page from CentOS Other libbsd0-0.8.7-1.25.el7.x86_64.rpm

LIBBSD

Section: Environments, Tables, and Troff Macros (7)
Index
BSD mandoc
 

NAME

libbsd - utility functions from BSD systems 

DESCRIPTION

Thelibbsdlibrary provides a set if compatibility macros and functions commonly foundon BSD-based systems.Its purpose is to make those available on non-BSD based systems to easeportability.

The library can be used in an overlay mode, which is the preferred way, sothat the code is portable and requires no modification to the original BSDcode.This can be done easily with thepkg-config3library namedlibbsd-overlay Or by adding the system-specific include directory with thebsd/suffix to the list of system include paths.Withgccthis could be-isystem ${includedir}/bsd In addition theLIBBSD_OVERLAYpre-processor variable needs to be defined.The includes in this case should be the usual system ones, such asIn unistd.h .

The other way to use the library is to use the namespaced headers,this is less portable as it makes usinglibbsdmandatory and it will not work on BSD-based systems, and requiresmodifying original BSD code.This can be done with thepkg-config3library namedlibbsd The includes in this case should be namespaced withbsd/ such asIn bsd/unistd.h .

The package also provides absd-ctorstatic library that can be used to inject automatic constructors into aprogram so that theFn setproctitlefunction gets invoked automatically at startup time.This can be done with thepkg-config3library namedlibbsd-ctor  

HEADERS

The following are the headers provided bylibbsd that extend the standard system headers.They can work in normal or overlay modes, for the former they need tobe prefixed withbsd/

In bitstring.h
In err.h
In getopt.h
In libutil.h
In md5.h
In netinet/ip_icmp.h
In nlist.h
In readpassphrase.h
In stdio.h
In stdlib.h
In string.h
In stringlist.h
In sys/bitstring.h
In sys/cdefs.h
In sys/endian.h
In sys/poll.h
In sys/queue.h
In sys/time.h
In sys/tree.h
In timeconv.h
In unistd.h
In vis.h
In wchar.h

The following is alibbsdspecific convenience header, that includes some of the extended headers.It only works in non-overlay mode.

In bsd/bsd.h

 

DEPRECATED

Some functions have been deprecated, they will emit warnings at compile timeand possibly while being linked at run-time.This might be due to the functions not being portable at all to othersystems, making the package not buildable there; not portable in a corrector non-buggy way; or because there are better more portable replacements now.

This is the list of currently deprecated macros and functions:

Fn fgetln
Unportable, requires assistance from the stdio layer.An implementation has to choose between leaking buffers or being reentrantfor a limited amount of streams (this implementation chose the latter witha limit of 32).UseFn getline 3instead, which is available in many systems and required bySt -p1003.1-2008 .
Fn funopen
Unportable, requires assistance from the stdio layer or some hook framework.On GNU systems theFn fopencookiefunction can be used.Otherwise the code needs to be prepared for neither of these functions beingavailable.

 

SUPERSEDED

Some functions have been superseded by implementations in other systemlibraries, and might disappear on the next SONAME bump, assuming thoseother implementation have widespread deployment, or the implementationsare present in all majorlibcfor example.

Fn MD5Init
Fn MD5Update
Fn MD5Pad
Fn MD5Final
Fn MD5Transform
Fn MD5End
Fn MD5File
Fn MD5FileChunk
Fn MD5Data
The set of MD5 digest functions are now provided by thelibmdcompanion library, so it is advised to use that instead.
Fn explicit_bzero
This function is provided byglibc2.25.
Fn reallocarray
This function is provided byglibc2.26.

 

SEE ALSO

arc4random(3bsd),bitstring(3bsd),byteorder(3bsd),closefrom(3bsd),errc(3bsd),expand_number3bsd,explicit_bzero3bsd,fgetln(3bsd),fgetwln(3bsd),flopen(3bsd),fmtcheck(3bsd),fparseln(3bsd),fpurge(3bsd),funopen(3bsd),getbsize(3bsd),getpeereid(3bsd),getprogname(3bsd),heapsort(3bsd),humanize_number3bsd,md5(3bsd),nlist(3bsd),pidfile(3bsd),queue(3bsd),radixsort(3bsd),readpassphrase(3bsd),reallocarray(3bsd),reallocf(3bsd),setmode(3bsd),setproctitle(3bsd),stringlist(3bsd),strlcpy(3bsd),strmode(3bsd),strnstr(3bsd),strtonum(3bsd),timeradd(3bsd),timeval(3bsd),tree(3bsd),unvis(3bsd),vis(3bsd),wcslcpy(3bsd). 

HISTORY

Thelibbsdproject started in the Debian GNU/kFreeBSD port as a way to ease portingcode from FreeBSD to the GNU-based system.Pretty early on it was generalized and a project created on FreeDesktop.orgfor other distributions and projects to use.

It is now distributed as part of most non-BSD distributions.


 

Index

NAME
DESCRIPTION
HEADERS
DEPRECATED
SUPERSEDED
SEE ALSO
HISTORY

This document was created byman2html,using the manual pages.