lgrp_home.3lgrp revision c10c16dec587a0662068f6e2991c29ed3a9db943
te
Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
lgrp_home 3LGRP "1 Jun 2003" "SunOS 5.11" "Locality Group Library Functions"
NAME
lgrp_home - get home lgroup
SYNOPSIS

cc [ flag.\|.\|. ] file.\|.\|. -llgrp [ library.\|.\|. ] 
#include <sys/lgrp_user.h>

lgrp_id_t lgrp_home(idtype_t idtype, id_t id);
DESCRIPTION

The lgrp_home() function returns the ID of the home lgroup for the given process or thread. A thread can have an affinity for an lgroup in the system such that the thread will tend to be scheduled to run on that lgroup and allocate memory from there whenever possible. The lgroup with the strongest affinity that the thread can run on is known as the "home lgroup" of the thread. If the thread has no affinity for any lgroup that it can run on, the operating system will choose a home for it.

The idtype argument should be P_PID to specify a process and the id argument should be its process ID. Otherwise, the idtype argument should be P_LWPID to specify a thread and the id argument should be its LWP ID. The value P_MYID can be used for the id argument to specify the current process or thread.

RETURN VALUES

Upon successful completion, lgrp_home() returns the ID of the home lgroup of the specified process or thread. Otherwise, -1 is returned and errno is set to indicate the error.

ERRORS

The lgrp_home() function will fail if:

EINVAL

The ID type is not valid.

EPERM

The effective user of the calling process does not have appropriate privileges, and its real or effective user ID does not match the real or effective user ID of one of the threads.

ESRCH

The specified process or thread was not found.

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
Interface StabilityEvolving
MT-LevelMT-Safe
SEE ALSO

lgrp_affinity_get(3LGRP), lgrp_init(3LGRP), attributes(5)