This file is indexed.

/usr/share/doc/libhwloc-doc/html/a00029_source.html is in libhwloc-doc 1.3.1-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Hardware Locality (hwloc): glibc-sched.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.4 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Hardware Locality (hwloc)&#160;<span id="projectnumber">1.3.1</span></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">glibc-sched.h</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright © 2009 CNRS</span>
<a name="l00003"></a>00003 <span class="comment"> * Copyright © 2009-2010 INRIA.  All rights reserved.</span>
<a name="l00004"></a>00004 <span class="comment"> * Copyright © 2009-2011 Université Bordeaux 1</span>
<a name="l00005"></a>00005 <span class="comment"> * Copyright © 2011 Cisco Systems, Inc.  All rights reserved.</span>
<a name="l00006"></a>00006 <span class="comment"> * See COPYING in top-level directory.</span>
<a name="l00007"></a>00007 <span class="comment"> */</span>
<a name="l00008"></a>00008 
<a name="l00017"></a>00017 <span class="preprocessor">#ifndef HWLOC_GLIBC_SCHED_H</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define HWLOC_GLIBC_SCHED_H</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &lt;hwloc.h&gt;</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &lt;hwloc/helper.h&gt;</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;assert.h&gt;</span>
<a name="l00023"></a>00023 
<a name="l00024"></a>00024 <span class="preprocessor">#if !defined _GNU_SOURCE || !defined _SCHED_H || (!defined CPU_SETSIZE &amp;&amp; !defined sched_priority)</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#error Please make sure to include sched.h before including glibc-sched.h, and define _GNU_SOURCE before any inclusion of sched.h</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span>
<a name="l00028"></a>00028 
<a name="l00029"></a>00029 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {
<a name="l00031"></a>00031 <span class="preprocessor">#endif</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span>
<a name="l00033"></a>00033 
<a name="l00034"></a>00034 <span class="preprocessor">#ifdef HWLOC_HAVE_CPU_SET</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span>
<a name="l00036"></a>00036 
<a name="l00049"></a>00049 <span class="keyword">static</span> inline <span class="keywordtype">int</span>
<a name="l00050"></a><a class="code" href="a00064.html#ga39454e6013441d32e58ef4c4fcba7e4b">00050</a> <a class="code" href="a00064.html#ga39454e6013441d32e58ef4c4fcba7e4b" title="Convert hwloc CPU set toposet into glibc sched affinity CPU set schedset.">hwloc_cpuset_to_glibc_sched_affinity</a>(<a class="code" href="a00038.html#ga9d1e76ee15a7dee158b786c30b6a6e38" title="Topology context.">hwloc_topology_t</a> topology , <a class="code" href="a00039.html#ga1f784433e9b606261f62d1134f6a3b25" title="A non-modifiable hwloc_cpuset_t.">hwloc_const_cpuset_t</a> hwlocset,
<a name="l00051"></a>00051                                     cpu_set_t *schedset, <span class="keywordtype">size_t</span> schedsetsize)
<a name="l00052"></a>00052 {
<a name="l00053"></a>00053 <span class="preprocessor">#ifdef CPU_ZERO_S</span>
<a name="l00054"></a>00054 <span class="preprocessor"></span>  <span class="keywordtype">unsigned</span> cpu;
<a name="l00055"></a>00055   CPU_ZERO_S(schedsetsize, schedset);
<a name="l00056"></a>00056   <a class="code" href="a00063.html#ga3f6861045a8029ade373510ffa727d2a" title="Loop macro iterating on bitmap bitmap.">hwloc_bitmap_foreach_begin</a>(cpu, hwlocset)
<a name="l00057"></a>00057     CPU_SET_S(cpu, schedsetsize, schedset);
<a name="l00058"></a>00058   <a class="code" href="a00063.html#gafcf3246db406218d4e155735b3fa6528" title="End of loop. Needs a terminating &#39;;&#39;.">hwloc_bitmap_foreach_end</a>();
<a name="l00059"></a>00059 <span class="preprocessor">#else </span><span class="comment">/* !CPU_ZERO_S */</span>
<a name="l00060"></a>00060   <span class="keywordtype">unsigned</span> cpu;
<a name="l00061"></a>00061   CPU_ZERO(schedset);
<a name="l00062"></a>00062   assert(schedsetsize == <span class="keyword">sizeof</span>(cpu_set_t));
<a name="l00063"></a>00063   <a class="code" href="a00063.html#ga3f6861045a8029ade373510ffa727d2a" title="Loop macro iterating on bitmap bitmap.">hwloc_bitmap_foreach_begin</a>(cpu, hwlocset)
<a name="l00064"></a>00064     CPU_SET(cpu, schedset);
<a name="l00065"></a>00065   <a class="code" href="a00063.html#gafcf3246db406218d4e155735b3fa6528" title="End of loop. Needs a terminating &#39;;&#39;.">hwloc_bitmap_foreach_end</a>();
<a name="l00066"></a>00066 <span class="preprocessor">#endif </span><span class="comment">/* !CPU_ZERO_S */</span>
<a name="l00067"></a>00067   <span class="keywordflow">return</span> 0;
<a name="l00068"></a>00068 }
<a name="l00069"></a>00069 
<a name="l00077"></a>00077 <span class="keyword">static</span> inline <span class="keywordtype">int</span>
<a name="l00078"></a><a class="code" href="a00064.html#ga6df504b2f5440b527be05cdad6b1655e">00078</a> <a class="code" href="a00064.html#ga6df504b2f5440b527be05cdad6b1655e" title="Convert glibc sched affinity CPU set schedset into hwloc CPU set.">hwloc_cpuset_from_glibc_sched_affinity</a>(<a class="code" href="a00038.html#ga9d1e76ee15a7dee158b786c30b6a6e38" title="Topology context.">hwloc_topology_t</a> topology , <a class="code" href="a00039.html#ga4bbf39b68b6f568fb92739e7c0ea7801" title="A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.">hwloc_cpuset_t</a> hwlocset,
<a name="l00079"></a>00079                                        <span class="keyword">const</span> cpu_set_t *schedset, <span class="keywordtype">size_t</span> schedsetsize)
<a name="l00080"></a>00080 {
<a name="l00081"></a>00081 <span class="preprocessor">#ifdef CPU_ZERO_S</span>
<a name="l00082"></a>00082 <span class="preprocessor"></span>  <span class="keywordtype">int</span> cpu, count;
<a name="l00083"></a>00083 <span class="preprocessor">#endif</span>
<a name="l00084"></a>00084 <span class="preprocessor"></span>  <a class="code" href="a00063.html#ga6c540b9fe63b8223b6aba46d56dd63b8" title="Empty the bitmap bitmap.">hwloc_bitmap_zero</a>(hwlocset);
<a name="l00085"></a>00085 <span class="preprocessor">#ifdef CPU_ZERO_S</span>
<a name="l00086"></a>00086 <span class="preprocessor"></span>  count = CPU_COUNT_S(schedsetsize, schedset);
<a name="l00087"></a>00087   cpu = 0;
<a name="l00088"></a>00088   <span class="keywordflow">while</span> (count) {
<a name="l00089"></a>00089     <span class="keywordflow">if</span> (CPU_ISSET_S(cpu, schedsetsize, schedset)) {
<a name="l00090"></a>00090       <a class="code" href="a00063.html#ga497556af0cc34f109ae0277999c074d3" title="Add index id in bitmap bitmap.">hwloc_bitmap_set</a>(hwlocset, cpu);
<a name="l00091"></a>00091       count--;
<a name="l00092"></a>00092     }
<a name="l00093"></a>00093     cpu++;
<a name="l00094"></a>00094   }
<a name="l00095"></a>00095 <span class="preprocessor">#else </span><span class="comment">/* !CPU_ZERO_S */</span>
<a name="l00096"></a>00096   <span class="comment">/* sched.h does not support dynamic cpu_set_t (introduced in glibc 2.7),</span>
<a name="l00097"></a>00097 <span class="comment">   * assume we have a very old interface without CPU_COUNT (added in 2.6)</span>
<a name="l00098"></a>00098 <span class="comment">   */</span>
<a name="l00099"></a>00099   <span class="keywordtype">int</span> cpu;
<a name="l00100"></a>00100   assert(schedsetsize == <span class="keyword">sizeof</span>(cpu_set_t));
<a name="l00101"></a>00101   <span class="keywordflow">for</span>(cpu=0; cpu&lt;CPU_SETSIZE; cpu++)
<a name="l00102"></a>00102     <span class="keywordflow">if</span> (CPU_ISSET(cpu, schedset))
<a name="l00103"></a>00103       <a class="code" href="a00063.html#ga497556af0cc34f109ae0277999c074d3" title="Add index id in bitmap bitmap.">hwloc_bitmap_set</a>(hwlocset, cpu);
<a name="l00104"></a>00104 <span class="preprocessor">#endif </span><span class="comment">/* !CPU_ZERO_S */</span>
<a name="l00105"></a>00105   <span class="keywordflow">return</span> 0;
<a name="l00106"></a>00106 }
<a name="l00107"></a>00107 
<a name="l00111"></a>00111 <span class="preprocessor">#endif </span><span class="comment">/* CPU_SET */</span>
<a name="l00112"></a>00112 
<a name="l00113"></a>00113 
<a name="l00114"></a>00114 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00115"></a>00115 <span class="preprocessor"></span>} <span class="comment">/* extern &quot;C&quot; */</span>
<a name="l00116"></a>00116 <span class="preprocessor">#endif</span>
<a name="l00117"></a>00117 <span class="preprocessor"></span>
<a name="l00118"></a>00118 
<a name="l00119"></a>00119 <span class="preprocessor">#endif </span><span class="comment">/* HWLOC_GLIBC_SCHED_H */</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Tue Dec 20 2011 10:59:25 for Hardware Locality (hwloc) by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>