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
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

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

Just sort memmove and memcpy.

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

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 edited edge metadata.Aug 13 2015, 8:12 AM
theraven accepted this revision.

LGTM.

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

Just sort memmove and memcpy again.

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

No colon needed here.

87 ↗(On Diff #7921)

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 ↗(On Diff #7921)
takes
.Ar src
and
.Ar dest
in the
araujo edited edge metadata.Aug 13 2015, 2:02 PM
araujo updated this revision to Diff 7924.

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 ↗(On Diff #7924)

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

New programs should use
89 ↗(On Diff #7924)

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

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

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 ↗(On Diff #7938)

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 ↗(On Diff #7938)

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

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

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

Thanks @rodrigc.

rodrigc edited edge metadata.Aug 14 2015, 12:58 AM
rodrigc accepted this revision.
wblock accepted this revision.

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

lib/libc/string/bcopy.3
79 ↗(On Diff #7940)

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