Page MenuHomeFreeBSD

Make clear the bcopy(3) man page.
ClosedPublic

Authored by araujo on Aug 13 2015, 6:56 AM.

Details

Summary

The IEEE Std 1003.1-2008 (``POSIX.1'') removes the specification of

bcopy() and it is marked as LEGACY in IEEE Std 1003.1-2004 (``POSIX.1'')
New programs should use: memmove() if you can guarantee that the input
and output buffer do not overlap, then memcpy() would be more efficient.
Note that bcopy() takes its src and dst arguments in the opposite order
from memcpy() and memmove().

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 78
Build 78: arc lint + arc unit

Event Timeline

araujo updated this revision to Diff 7918.Aug 13 2015, 6:56 AM
araujo retitled this revision from to Make clear the bcopy(3) man page, it is not obsolete..
araujo updated this object.
araujo edited the test plan for this revision. (Show Details)
araujo updated this revision to Diff 7919.Aug 13 2015, 6:58 AM
araujo edited edge metadata.

Just sort memmove and memcpy.

araujo updated this revision to Diff 7920.Aug 13 2015, 8:08 AM
araujo edited edge metadata.
araujo added a subscriber: theraven.

Add @theraven suggestions.
Discussed on src-committers@.

araujo retitled this revision from Make clear the bcopy(3) man page, it is not obsolete. to Make clear the bcopy(3) man page..Aug 13 2015, 8:09 AM
araujo updated this object.
araujo added reviewers: theraven, bapt, rodrigc.
araujo removed a subscriber: theraven.
theraven accepted this revision.Aug 13 2015, 8:12 AM
theraven edited edge metadata.

LGTM.

araujo updated this revision to Diff 7921.Aug 13 2015, 8:28 AM
araujo edited edge metadata.
araujo updated this object.

Just sort memmove and memcpy again.

bapt accepted this revision.Aug 13 2015, 9:01 AM
bapt edited edge metadata.
wblock added a subscriber: wblock.Aug 13 2015, 12:17 PM
wblock added inline comments.
lib/libc/string/bcopy.3
85

No colon needed here.

87

Please avoid using "you", and this sentence is weird. The original has some trailing whitespace, too (please check with igor -R, which will check for those and other problems). Showing the suggested functions as .Xr references would be more helpful to the reader:

New programs should use
.Xr memmove 3 .
If the input and output buffers do not overlap,
.Xr memcpy 3
is more efficient.

93
takes
.Ar src
and
.Ar dest
in the
araujo updated this revision to Diff 7924.Aug 13 2015, 2:02 PM
araujo edited edge metadata.

Address @wblock sugestions.
Also run:
igor -R
mandoc -Tlint

Thanks again @wblock.

wblock added inline comments.Aug 13 2015, 3:40 PM
lib/libc/string/bcopy.3
85

I meant remove the colon (:). And "New" should be capitalized:

New programs should use
89

"would be" is passive and sounds unsure, I suggest changing it to "is" (active).

is more efficient.
araujo updated this revision to Diff 7938.Aug 14 2015, 12:31 AM
araujo edited edge metadata.

Update with @wblocks suggestions.

Note that: the 'new' is keep in lower case, because
it continues in the sentence.

araujo added inline comments.Aug 14 2015, 12:32 AM
lib/libc/string/bcopy.3
85

Here I kept the 'new' in lower case because the phrase didn't ends.

rodrigc added inline comments.Aug 14 2015, 12:44 AM
lib/libc/string/bcopy.3
85

@wblock is correct. The previous sentence should end with a period.
The next sentence should begin with new capitalized:

New programs should use
araujo updated this revision to Diff 7940.Aug 14 2015, 12:53 AM
araujo edited edge metadata.

Capitalize 'New' and add a period in the end of POSIX sentence.

Thanks @rodrigc.

rodrigc accepted this revision.Aug 14 2015, 12:58 AM
rodrigc edited edge metadata.
wblock accepted this revision.Aug 14 2015, 1:21 AM
wblock added a reviewer: wblock.

One note on line 79, but otherwise looks good. Thank you!

lib/libc/string/bcopy.3
79

Based on the previous sentence, this line should be removed (no "The" needed).

This revision is now accepted and ready to land.Aug 14 2015, 1:21 AM