Bug 162765

Summary: [patch] lseek(2) may return successful although no seek operation was actually performed
Product: Documentation Reporter: Alexander Best <arundel>
Component: Manual PagesAssignee: Gordon Bergling <gbe>
Status: Closed FIXED    
Severity: Affects Only Me CC: doc, gbe
Priority: Normal Keywords: patch
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://reviews.freebsd.org/D25646
Attachments:
Description Flags
file.diff
none
lseek.2.diff3 none

Description Alexander Best freebsd_committer freebsd_triage 2011-11-22 20:40:01 UTC
in certain situations lseek() will return successful although no seek was performed. this can happen when operating on devices that don't support seeking (older tape drives) or when operating on changeable media devices (such as DVD or Blu-ray devices) without a medium inserted.

the attached patch fixes the lseek(2) man page by adding several entries to the BUGS section, along with updating the POSIX compliance to the latest specifications.

please note that the real issue doesn't seem fixable atm. lseek() was never designed to confirm a seek operation, but to merely request it.

the issue was extensively discussion in this thread:

http://lists.freebsd.org/pipermail/freebsd-hackers/2011-November/036842.html (alternative link: http://docs.freebsd.org/cgi/mid.cgi?20111115202450.GA73512)

cheers.
alex

Fix: Patch attached with submission follows:
Comment 1 Alexander Best freebsd_committer freebsd_triage 2011-11-22 20:45:29 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-doc

Over to maintainer(s).
Comment 2 Alexander Best freebsd_committer freebsd_triage 2011-11-22 21:52:56 UTC
here's a revised patch (comma removed after "confirm"), as suggested by warren
block. thanks. :)

cheers.
alex
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2012-03-04 04:31:47 UTC
Responsible Changed
From-To: freebsd-doc->eadler

I'll take it.
Comment 4 Eitan Adler freebsd_committer freebsd_triage 2012-09-02 17:52:36 UTC
Responsible Changed
From-To: eadler->freebsd-doc

I won't be looking at this PR for a while and I need to clear some out 
of my queue
Comment 5 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:50 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 6 commit-hook freebsd_committer freebsd_triage 2020-07-13 15:53:53 UTC
A commit references this bug:

Author: gbe
Date: Mon Jul 13 15:52:58 UTC 2020
New revision: 363156
URL: https://svnweb.freebsd.org/changeset/base/363156

Log:
  lseek(2): Document the seek behavior better and update the POSIX compliance

  In certain situations lseek(2) will return successful although if no seek
  was performed. This can happen when operating on devices that don't support
  seeking (older tape drives) or when operating on changeable media devices
  (such as DVD or Blu-ray devices) without a medium inserted.

  Document this within the man page and update the POSIX compliance while here.

  PR:		162765
  Submitted by:	arundel@
  Reported by:	arundel@
  Reviewed by:	bcr (mentor)
  Approved by:	bcr (mentor)
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D25646

Changes:
  head/lib/libc/sys/lseek.2
Comment 7 commit-hook freebsd_committer freebsd_triage 2020-07-20 16:48:54 UTC
A commit references this bug:

Author: gbe
Date: Mon Jul 20 16:48:46 UTC 2020
New revision: 363370
URL: https://svnweb.freebsd.org/changeset/base/363370

Log:
  MFC r363156: lseek(2): Document the seek behavior better and update the POSIX compliance

  PR:		162765
  Submitted by:	arundel@
  Reported by:	arundel@
  Reviewed by:	bcr (mentor)
  Approved by:	bcr (mentor)
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D25646

Changes:
_U  stable/12/
  stable/12/lib/libc/sys/lseek.2