This commit is contained in:
Ciro Santilli
2022-03-10 22:37:51 +00:00
parent a5be602793
commit b43b3b45f3
9 changed files with 171 additions and 73 deletions

View File

@@ -459,6 +459,27 @@ pre{ white-space:pre }
<div class="sect3">
<h4 id="seq-file"><a class="anchor" href="#seq-file"></a><a class="link" href="#seq-file">17.8.2. seq_file</a></h4>
<div class="paragraph">
<p>TODO these examples broke in kernel 5.0 and we didn&#8217;t notice because they just added a flimsy warning and nothing else:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://stackoverflow.com/questions/25399112/how-to-use-a-seq-file-in-linux-kernel-modules/45100058" class="bare">https://stackoverflow.com/questions/25399112/how-to-use-a-seq-file-in-linux-kernel-modules/45100058</a></p>
</li>
<li>
<p><a href="https://stackoverflow.com/questions/60570242/seq-file-not-working-properly-after-next-returns-null" class="bare">https://stackoverflow.com/questions/60570242/seq-file-not-working-properly-after-next-returns-null</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Fix with ifdef for kernel 4/5. The error message is:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>seq_file: buggy .next function next [module-name] did not update position index</pre>
</div>
</div>
<div class="paragraph">
<p>Writing trivial read <a href="file-operations.html">File operations</a> is repetitive and error prone. The <code>seq_file</code> API makes the process much easier for those trivial cases:</p>
</div>
<div class="literalblock">