---
name: "seq_open"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/seq_open"
---

# seq\_open(9)

initialize sequential file

## NAME

seq\_open - initialize sequential file

## SYNOPSIS

**int seq\_open(struct file \*** *file***, const struct seq\_operations \*** *op***);**

## ARGUMENTS

*file*

file we initialize

*op*

method table describing the sequence

## DESCRIPTION

**seq\_open** sets *file*, associating it with a sequence described by *op*. *op*-\>**start** sets the iterator up and returns the first element of sequence. *op*-\>**stop** shuts it down. *op*-\>**next** returns the next element of sequence. *op*-\>**show** prints element into the buffer. In case of error -\>**start** and -\>**next** return ERR\_PTR(error). In the end of sequence they return **NULL**. -\>**show** returns 0 in case of success and negative number in case of error. Returning SEQ\_SKIP means “discard this element and move on”.

## NOTE

**seq\_open** will allocate a struct seq\_file and store its pointer in *file*-\>private\_data. This pointer should not be modified.

## COPYRIGHT
