Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 92963
b: refs/heads/master
c: 22c36d1
h: refs/heads/master
i:
  92961: 40a61e0
  92959: e8b9fc7
v: v3
  • Loading branch information
Jonathan Corbet committed Apr 24, 2008
1 parent 2a876ea commit f610c56
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b69d3987f4360a5e7e9e55465b3cdd0cc204b79e
refs/heads/master: 22c36d18c668db1a8d92a9a47e09857974f6a49b
9 changes: 7 additions & 2 deletions trunk/Documentation/filesystems/seq_file.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ stop() is the place to free it.
}

Finally, the show() function should format the object currently pointed to
by the iterator for output. It should return zero, or an error code if
something goes wrong. The example module's show() function is:
by the iterator for output. The example module's show() function is:

static int ct_seq_show(struct seq_file *s, void *v)
{
Expand All @@ -132,6 +131,12 @@ something goes wrong. The example module's show() function is:
return 0;
}

If all is well, the show() function should return zero. A negative error
code in the usual manner indicates that something went wrong; it will be
passed back to user space. This function can also return SEQ_SKIP, which
causes the current item to be skipped; if the show() function has already
generated output before returning SEQ_SKIP, that output will be dropped.

We will look at seq_printf() in a moment. But first, the definition of the
seq_file iterator is finished by creating a seq_operations structure with
the four functions we have just defined:
Expand Down

0 comments on commit f610c56

Please sign in to comment.