getrtable(2)
Canonical URL: /getrtable.2/
NAME
getrtable,
setrtable —
get or set the default routing table of
the current process
SYNOPSIS
#include
<sys/types.h>
#include <sys/socket.h>
int
getrtable(void);
int
setrtable(int
rtableid);
DESCRIPTION
getrtable()
and
setrtable()
manipulate the routing table and routing domain associated with the current
process.
Only the superuser is allowed to change the process routing table if it is already set to a non-zero value.
RETURN VALUES
getrtable() returns the routing table of
the current process. Upon successful completion,
setrtable() returns 0 if the call succeeds, -1 if it
fails.
ERRORS
The call succeeds unless:
SEE ALSO
HISTORY
The getrtable() and
setrtable() system calls appeared in
OpenBSD 4.8.
Need conceptual guidance? Continue in the OpenBSD Handbook.