Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Feb 2011 14:11:12 +0000
From:      Alexander Best <arundel@freebsd.org>
To:        freebsd-hackers@freebsd.org
Subject:   seeking into /dev/{null,zero}
Message-ID:  <20110222141112.GA98964@freebsd.org>

next in thread | raw e-mail | index | archive | help
hi there,

there's a PR [1] regarding seeking into /dev/null and /dev/zero. i just wanted
to ask what the overall opinion is on this matter. technically it's quite easy
to seek into those files upon fwrite(3) and fread(3). the point is, if the file
position should be repositioned according the the amount of bytes read or
written.

the zero(4) and null(4) manual pages claim that both devices act as "ordinary"
files. right now only reading from /dev/zero will seek into the file. writing
to /dev/zero and reading/writing to /dev/null will *not* adjust the file
position.

cheers.
alex

[1] http://www.freebsd.org/cgi/query-pr.cgi?pr=misc/152485

ps: i might also be worth thinking about turning null(4) and zero(4) into a
single manual page, since their contents seem quite similar.

-- 
a13x



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110222141112.GA98964>