NAME
init_env_mgr-initializes the environment manager interface
env_new_conn-make a new default environment
env_copy_conn-makes a copy of an environment
env_restrict_conn-creates a read-only copy of an environment
env_disconnect-delete an environment and its port

SYNOPSIS
#include <servers/env_mgr.h>

void init_env_mgr(reply_port);
port_t reply_port;

kern_return_t env_new_conn(env_port,new_env_port)
port_t env_port;
port_t *new_env_port)

kern_return_t env_copy_conn(env_port,new_env_port)
port_t env_port;
port_t *new_env_port)

kern_return_t env_restrict_conn(env_port,new_env_port)
port_t env_port;
port_t *new_env_port)

kern_return-t env_disconnect(env_port)
port_t env_port;

ARGUMENTS
reply_port if equal PORT_NULL , a reply port will be allocated,
otherwise reply_port will be used by the interface
to receive the message replies.

env_port port identifying environment

new_env_port returned pointing to value of new port

DESCRIPTION
init_env_mgr initializes the user interface to the Environment
Manager. Must be called before any of the other primitives are
used. However, it is called by the library initialization program
mach_init , so the user does not need to make this call unless a
different value of Reply_port is desired.

env_new_conn create a new, default environment to be handed to a
new process. This could be initialized with public values such as
host_name and Network nameserver port.

env_copy_conn makes a complete copy of the environment specified by
env_port , allocates the new_env_port and returns it to the caller.
Subsequently, all requests on new_env_port will use the new copy,
and requests on env_port will continue to refer to the original
version. Used by parent to pass a copy of its environment to a
child process.

env_restrict_conn makes a new port to the environment specified by
env_port , through which only reading will be allowed.

env_disconnect informs the environment manager that this
environment is no longer needed. EnvMgr will deallocate env_port ;

Ownership rights to all the new environment ports are returned to
the user. Thus when a process that has created and environment
dies, these rights are returned to the environment manager who will
disconnect (and destroy) the environment. If a creator process
wishes its environment to live on after its death, it must pass the
ownership rights a process that will continue to exist as long as
the environment should exist.

DIAGNOSTICS
KERN_SUCCESS new_env_port references a new default
environment

ENV_NO_MORE_CONN implementation restriction, no more
connections to the Environment Manager are
available.

ENV_UNKNOWN_PORT env_port does not reference a known
environment

FILES
/usr/include/servers/env_mgr.h, /usr/include/servers/emdefs.h

SEE ALSO
env_string(3), env_port(3), env_list(3), mach_init(3)