Bug 171690

Summary: Difference between write(2) and write(3p) pages
Product: Red Hat Enterprise Linux 4 Reporter: Bastien Nocera <bnocera>
Component: man-pagesAssignee: Ivana Varekova <varekova>
Status: CLOSED ERRATA QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: tao
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2006-0321 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-05-10 22:15:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 187538    

Description Bastien Nocera 2005-10-25 10:44:41 UTC
In the man page for write(2), about writing 0 bytes, the page says:
If  count  is zero and the file descriptor refers to a
regular file, 0 will be returned without causing any other effect.

But in the POSIX man page write(3p):
Before  any  action  described below is taken, and if nbyte is zero and
the file is a regular file, the write() function may detect and  return
errors as described below.

In fact, RHEL4 behaves in the way mentioned by the POSIX man page (it will not
check for '0' count, and return an error if, for example, a file has a mandatory
lock on it).

So the write(2) page should say:
If  count  is zero and the file descriptor refers to a
regular file, 0 may be returned, or an error could be detected.

Comment 7 Red Hat Bugzilla 2006-05-10 22:15:17 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2006-0321.html