Copyright (c) 2001, 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]
#include <sys/time.h> #include <sys/lwp.h> int _lwp_info(struct lwpinfo *buffer);
The _lwp_info() function fills the lwpinfo structure pointed to by buffer with time-accounting information pertaining to the calling LWP. This call may be extended in the future to return other information to the lwpinfo structure as needed. The lwpinfo structure in <sys/lwp.h> includes the following members:
timestruc_t lwp_utime; timestruc_t lwp_stime;
The lwp_utime member is the CPU time used while executing instructions in the user space of the calling LWP.
The lwp_stime member is the CPU time used by the system on behalf of the calling LWP.
Upon successful completion, _lwp_info() returns 0 and fills in the lwpinfo structure pointed to by buffer.
If the following condition is detected, _lwp_info() returns the corresponding value:
EFAULT
The buffer argument points to an illegal address.
Additionally, the _lwp_info() function will fail for 32-bit interfaces if:
EOVERFLOW
The size of the tv_sec member of the timestruc_t type pointed to by lwp_utime and lwp_stime is too small to contain the correct number of seconds.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
MT-Level | Async-Signal-Safe |
times(2), attributes(5)