SERVICE_CHECKIN(3) — UNIX Programmer’s Manual
NAME
init_service − inititalize interface to service server
service_checkin − get receive rights to a standard server port
SYNOPSIS
#include <servers/service.h>
void init_service(port_t reply_port);
kern_return_t service_checkin(port_t ServicePort, port_t service_desired, port_t service_granted);
ARGUMENTS
reply_port Port that service_checkin will reply on. If set to PORT_NULL, a new port will be allocated.
ServicePort Port to the Service server. service_port exported by mach_init should be used.
service_desired The port defined by mach_init for the service that this server wishes to provide.
service_granted If service_checkin succeeded, this will be the same port as service_desired but with receive rights.
DESCRIPTION
The Service server is started early in system initialization and allocates service ports for the standard system servers (currently only the Network Name Server). Send rights to these ports are passed to all subsequently spawned tasks via the mach_init_ports array.
When the Network Name Server task is created, it needs to get receive rights to its respective service port in order to provide services. The service_checkin call provides this function. It can only grant receive rights once, so the first task that asks for the rights gets them. Since standard servers are started before any user processes, this should not be a problem.
If one of the standard servers should die, the receive rights will return to the Service server, which will then be able to grant these rights to a new instantiation of a standard server. A user of these servers will be able to continue to use the same port to talk to the new server as it used for the old server. For a stateless server such as the Network Name Server, the user will see nothing but a temporary loss of response.
DIAGNOSTICS
KERN_SUCCESS
The service_desired port is returned with receive rights.
KERN_FAILURE
The Service server didn’t have receive rights to the service_desired port.
FILES
/usr/include/servers/service.h
SEE ALSO
NeXT, Inc. — March 24, 1989