Skip site navigation (1)Skip section navigation (2)

FreeBSD Man Pages

Man Page or Keyword Search:
Man Architecture
Apropos Keyword Search (all sections) Output format
home | help
SETFIB(2)		  FreeBSD System Calls Manual		     SETFIB(2)

NAME
     setfib -- set the default FIB (routing table) for the calling process.

LIBRARY
     Standard C	Library	(libc, -lc)

SYNOPSIS
     #include <sys/socket.h>

     int
     setfib(int	fib);

DESCRIPTION
     The setfib() system call sets the associated fib for all sockets opened
     subsequent	to the call, to	be that	of the argument	fib.  The fib argument
     must be greater than or equal to 0	and less than the current system maxi-
     mum which may be retrieved	by the net.fibs	sysctl.	 The system maximum is
     set in the	kernel configuration file with

	   options   ROUTETABLES=N

     or	in /boot/loader.conf with

	   net.fibs="N"

     where N is	an integer.  However, this maximum is capped at	16 due to the
     implementation storing the	fib number in a	4-bit field in mbuf(9) flags.
     The default fib of	the process will be applied to all protocol families
     that support multiple fibs, and ignored by	those that do not.  The
     default fib for a process may be overridden for a socket with the use of
     the SO_SETFIB socket option.

RETURN VALUES
     The setfib() function returns the value 0 if successful; otherwise	the
     value -1 is returned and the global variable errno	is set to indicate the
     error.

ERRORS
     The setfib() system call will fail	and no action will be taken and	return
     EINVAL if the fib argument	is greater than	the current system maximum.

SEE ALSO
     setfib(1),	setsockopt(2)

STANDARDS
     The setfib() system call is a FreeBSD extension however similar exten-
     sions have	been added to many other UNIX style kernels.

HISTORY
     The setfib() function appeared in FreeBSD 7.1.

FreeBSD	10.1			March 19, 2012			  FreeBSD 10.1

NAME | LIBRARY | SYNOPSIS | DESCRIPTION | RETURN VALUES | ERRORS | SEE ALSO | STANDARDS | HISTORY

Want to link to this manual page? Use this URL:
<http://www.freebsd.org/cgi/man.cgi?query=setfib&sektion=2&manpath=FreeBSD+9.3-RELEASE>

home | help