'\" te .\" Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. .TH lgrp_device_lgrps 3LGRP "13 Mar 2012" "SunOS 5.11" "Locality Group Library Functions" .SH NAME lgrp_device_lgrps \- get IDs of lgroups closest to the specified I/O device .SH SYNOPSIS .LP .nf cc [ \fIflag \&.\|.\|.\fR ] \fIfile\fR\&.\|.\|. \fB-llgrp\fR [ \fIlibrary \&.\|.\|.\fR ] #include \fBint\fR \fBlgrp_device_lgrps\fR(\fBchar *\fR\fIdevice_path\fR, \fBlgrp_id_t *\fR \fIlgrpids\fR, \fBuint_t\fR \fIcount\fR); .fi .SH DESCRIPTION .sp .LP The \fBlgrp_device_lgrps()\fR returns the number of lgroups closest to the specified I/O device. If both \fIlgrpids\fR[] is non-null and \fIcount\fR is not 0, \fIlgrpids\fR[] is also filled up to the specified \fIcount\fR of lgroup IDs closest to the device. .sp .LP Each I/O device on the system can be connected to one or more NUMA nodes. In order to optimize I/O performance for a given device through locality, an application needs to know which lgroups are closest to the I/O device and place its threads and/or memory needed for performing I/O near the device. It is therefore important for applications to know the NUMA I/O topology of the system. .sp .LP The \fIdevice_path\fR parameter is the path to an I/O device specified by the caller. .SH RETURN VALUES .sp .LP Upon successful completion, \fBlgrp_device_lgrps()\fR returns the number of lgroups closest to the specified I/O device. Otherwise, it returns -1 and \fIerrno\fR is set to indicate the error. .SH ERRORS .sp .LP The \fBlgrp_device_lgrps()\fR function will fail if: .sp .ne 2 .mk .na \fB\fBEACCES\fR\fR .ad .RS 10n .rt Operation permission is denied to the calling process (see \fBIntro\fR(2). .RE .sp .ne 2 .mk .na \fB\fBEFAULT\fR\fR .ad .RS 10n .rt The \fIlgrpids\fR parameter points to an invalid memory address. .RE .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 10n .rt An invalid device path is specified. .RE .sp .ne 2 .mk .na \fB\fBENOENT\fR\fR .ad .RS 10n .rt The specified lgroup path does not name an existing device node. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelMT-Safe .TE .SH SEE ALSO .sp .LP \fBIntro\fR(2), \fBlgrp_affinity_get\fR(3LGRP), \fBlgrp_cpus\fR(3LGRP), \fBlgrp_nlgrps\fR(3LGRP), \fBlgrp_resources\fR(3LGRP), \fBliblgrp\fR(3LIB), \fBattributes\fR(5)