| 
|  | cpu_get_current(3)Contents |  
        cpu_get_current - Return the caller's current CPU ID (libc
       library)
       #include <cpuset.h>
       cpuid_t cpu_get_current(
               void );
       The cpu_get_current() function has no parameters.
        The cpu_get_current() function fetches the ID of  the  CPU
       on which the caller is executing.
       This function is similar to the following call:
       getsysinfo(GSI_CPU_CURRENT, &cpuid, ...);
       However,  cpu_get_current()  returns  the  CPU  identifier
       directly (as type cpuid_t), whereas the getsysinfo()  call
       stores  the  identifier into a buffer (as type long) whose
       address is passed to the function.
       As is true for many system information queries,  the  data
       returned  by cpu_get_current() may be stale by the time it
       is returned to or used by the caller. In  other  words,  a
       context  switch  to  a  different  CPU can occur after the
       "current CPU" has been fetched by the application.
       The cpu_get_current() function returns the CPU ID  of  the
       processor  where  the  caller  is executing. This function
       always completes successfully.
       None.
 
       Functions: getsysinfo(2), numa_intro(3)
       Files: numa_types(4)
                                               cpu_get_current(3)
[ Back ] |