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

FreeBSD Manual Pages

  
 
  

home | help
RTLD_GET_VAR(3)		    Library Functions Manual	       RTLD_GET_VAR(3)

NAME
       rtld_get_var,  rtld_set_var  -- query or	change run-time	linker parame-
       ters after image	activation

LIBRARY
       Standard	C Library (libc, -lc)

SYNOPSIS
       #include	<sys/errno.h>
       #include	<link.h>

       const char *
       rtld_get_var(const char *name);

       int
       rtld_set_var(const char *name, const char *value);

DESCRIPTION
       The dynamic linker rtld(1) can be configured by setting	some  environ-
       ment  variables for the process,	before image activation.  Sometimes it
       is desirable to query the current effective settings or change them af-
       terward.

       Since the process environment variables are maintained by  higher-level
       libraries, the run-time linker cannot access them after the image acti-
       vation.	 The  described	 functions make	it possible to operate on rtld
       settings.

       The rtld_get_var() function returns the current value of	the named  pa-
       rameter.

       The  rtld_set_var() functions changes the value of the parameter	to the
       new value value,	if possible.  The name argument	to both	 functions  is
       the  name of the	parameter, which is same as the	corresponding environ-
       ment variable (see rtld(1)) but without the LD_ (or LD_32_ or any other
       ABI-specific) prefix.

RETURN VALUES
       The rtld_get_var() returns the current value of the named parameter, or
       NULL if the name	is invalid.

       The rtld_set_var() returns 0 on success,	or an integer  indicating  the
       error condition which prevented the operation.

ERRORS
       Possible	errors returned	from rtld_set_var():

       [EPERM]		  The  requested change	cannot be made at runtime, ei-
			  ther because the runtime linker can only  take  this
			  parameter  at	 initialization	 time,	or because the
			  current process is executing	with  elevated	privi-
			  leges.

       [ENOENT]		  The supplied parameter name is unknown.

SEE ALSO
       rtld(1)

HISTORY
       The rtld_get_var	function first appeared	in FreeBSD 14.3.

FreeBSD	15.0		       October 31, 2024		       RTLD_GET_VAR(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=rtld_get_var&sektion=3&manpath=FreeBSD+15.0-RELEASE+and+Ports.quarterly>

home | help