extensions-api.c File Reference


Functions

int pthread_attr_setcpuaffinity_np (pthread_attr_t *attr, int cpu_num)
 Sets the CPU number attribute in the thread attributes object.
int pthread_attr_getcpuaffinity_np (pthread_attr_t *attr, int *cpu_num)
 Gets the CPU number attribute from the thread attributes object.
int lw_getsystimes (struct timeval *uptime, struct timeval *boottime)
 Provides a quick way to return the kernel timestamp.

Detailed Description


Function Documentation

int lw_getsystimes struct timeval *  uptime,
struct timeval *  boottime
 

Provides a quick way to return the kernel timestamp.

This function provides special handling to retrieve timestamps from the kernel without using system calls.

Parameters:
[out] uptime Time since boot. (struct timeval is a standard FreeBSD structure.)
[out] boottime Wall clock boot time.(struct timeval is a standard FreeBSD structure.)
Returns:
0 on success; otherwise, return the following error codes. EINVAL - Invalid input.

int pthread_attr_getcpuaffinity_np pthread_attr_t *  attr,
int *  cpu_num
 

Gets the CPU number attribute from the thread attributes object.

This function can be used to retrieve the CPU number attribute from the thread attributes object.

Parameters:
[in] attr Thread attribute object.
[out] cpu_num The CPU number attribute derived from the attr argument.
Returns:
0 on success; otherwise, returns the following error code:
  • EINVAL - Invalid input.

int pthread_attr_setcpuaffinity_np pthread_attr_t *  attr,
int  cpu_num
 

Sets the CPU number attribute in the thread attributes object.

This function can be used prior to creating a pthread to bind the pthread to the given cpu_id. The system scope attribute on the thread attribute object should be set, prior to calling this function.

Parameters:
[in] attr The thread attribute object.
[in] cpu_num The CPU number to which to bind the thread.
Returns:
Returns 0 on success; otherwise, returns the following error codes:
  • ENOTSUP - PTHREAD_SCOPE_SYSTEM is not set on the attribute object.
  • EINVAL - attr is null or cpu_num is out of range.


2007-2009 Juniper Networks, Inc. All rights reserved. The information contained herein is confidential information of Juniper Networks, Inc., and may not be used, disclosed, distributed, modified, or copied without the prior written consent of Juniper Networks, Inc. in an express license. This information is subject to change by Juniper Networks, Inc. Juniper Networks, the Juniper Networks logo, and JUNOS are registered trademarks of Juniper Networks, Inc. in the United States and other countries. All other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Generated on Sun May 30 20:26:46 2010 for Juniper Networks Partner Solution Development Platform JUNOS SDK 10.2R1 by Doxygen 1.4.5