groff 1.23.0 added .MR to its -man macro package. The NEWS file states
that the inclusion of the macro "was prompted by its introduction to
Plan 9 from User Space's troff in August 2020." From d32deab it seems
that the name for Plan 9 from User Space's implementation was suggested
by groff maintainer G. Brandon Robinson.
Not sure if the intention was to make these definitions compatible, but
it would be nice if they were.
Currently, Plan 9 from User Space's .MR expects its second argument to
be parenthesized. groff's .MR does not. This results in extra
parentheses appearing in manual references when viewing Plan 9 from User
Space's manual pages on a system using groff.
54 lines
800 B
Groff
54 lines
800 B
Groff
.TH SEEK 3
|
|
.SH NAME
|
|
seek \- change file offset
|
|
.SH SYNOPSIS
|
|
.B #include <u.h>
|
|
.br
|
|
.B #include <libc.h>
|
|
.PP
|
|
.B
|
|
vlong seek(int fd, vlong n, int type)
|
|
.SH DESCRIPTION
|
|
.I Seek
|
|
sets the offset for the file
|
|
associated with
|
|
.I fd
|
|
as follows:
|
|
.IP
|
|
If
|
|
.I type
|
|
is 0, the offset is set to
|
|
.I n
|
|
bytes.
|
|
.IP
|
|
If
|
|
.I type
|
|
is 1, the pointer is set to its current location plus
|
|
.IR n .
|
|
.IP
|
|
If
|
|
.I type
|
|
is 2, the pointer is set to the size of the
|
|
file plus
|
|
.IR n .
|
|
.PP
|
|
The new file offset value is returned.
|
|
.PP
|
|
Seeking in a directory is not allowed.
|
|
Seeking in a pipe is a no-op.
|
|
.SH SOURCE
|
|
.B \*9/src/lib9/seek.c
|
|
.SH SEE ALSO
|
|
.MR intro 3 ,
|
|
.MR open 3
|
|
.SH DIAGNOSTICS
|
|
Sets
|
|
.IR errstr .
|
|
.SH BUGS
|
|
To avoid name conflicts with the underlying system,
|
|
.I seek
|
|
is a preprocessor macro defined as
|
|
.IR p9seek ;
|
|
see
|
|
.MR intro 3 .
|