Page MenuHomeFreeBSD

Update bzero(3) manpage to following the Posix standard.
ClosedPublic

Authored by araujo on Aug 14 2015, 5:45 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Mar 4, 10:55 PM
Unknown Object (File)
Thu, Feb 26, 9:00 PM
Unknown Object (File)
Thu, Feb 26, 6:35 AM
Unknown Object (File)
Thu, Feb 26, 12:33 AM
Unknown Object (File)
Jan 31 2026, 9:23 AM
Unknown Object (File)
Dec 31 2025, 2:39 PM
Unknown Object (File)
Nov 20 2025, 9:18 PM
Unknown Object (File)
Nov 20 2025, 9:17 PM
Subscribers

Details

Summary

As bcopy(3) is deprecated, the same happened to bzero(3).

The bzero(3) is a bit faster than memset(3) as it has less internal
checks. However, it is not POSIX standard anymore.
I guess, FreeBSD shall follow the POSIX implementation.

Test Plan

igor -R
mandoc -Tlint

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

araujo retitled this revision from to Update bzero(3) manpage to following the Posix standard..
araujo updated this object.
araujo edited the test plan for this revision. (Show Details)
araujo added reviewers: theraven, rodrigc, bapt.
wblock added inline comments.
lib/libc/string/bzero.3
92 ↗(On Diff #7943)

We do not usually put "The" before a proper name, this line should be removed.

96 ↗(On Diff #7943)

Typo:
s/market/marked/

I was going to suggest a link to explicit_bzero(3) but the explicit_bzero() page already contains the bzero(3) description so perhaps we should unify them and use a symlink.

lib/libc/string/bzero.3
92 ↗(On Diff #7943)

I can't remove this line or the sentence will loose all its meaning. Also bcopy(3) has the same phrase and wrote in the same way.

96 ↗(On Diff #7943)

Fixed!

araujo edited edge metadata.

Address partially @wblock issues.

lib/libc/string/bzero.3
92 ↗(On Diff #7992)

Rendered, it is

IEEE Std 1003.1-2008 (``POSIX.1'') removes the
specification of bzero() and it is marked as LEGACY in...

That is perfectly cromulent English, "the" does not add anything to it. In a shorter form, we would say "POSIX removes" rather than "the POSIX removes".

The previous version of the page did it the same way, using just "IEEE Std", not "the IEEE Std":

Its prototype existed previously
in <string.h> before it was moved to <strings.h> for IEEE Std 1003.1-2001
(``POSIX.1'') compliance.

Adress @wblock suggestion, also fix the bcopy(3) manpage.
Thanks @wblock.

In D3380#68918, @pfg wrote:

I was going to suggest a link to explicit_bzero(3) but the explicit_bzero() page already contains the bzero(3) description so perhaps we should unify them and use a symlink

@pfg with the MLINKS+=bzero.3 explicit_bzero.3, it does cover your suggestion, doesn't it?

pfg removed a reviewer: pfg.

For the record, I would prefer merging the explicit_bzero(3) and the bzero(3) pages together and getting rid of one of them, but this is an issue for the documentation project.

pfg added a subscriber: pfg.
In D3380#69369, @araujo wrote:
In D3380#68918, @pfg wrote:

I was going to suggest a link to explicit_bzero(3) but the explicit_bzero() page already contains the bzero(3) description so perhaps we should unify them and use a symlink

@pfg with the MLINKS+=bzero.3 explicit_bzero.3, it does cover your suggestion, doesn't it?

Wait .. you are right,: for some reason I was looking at the bzero(3) manpage in 10.0.

Still there is an unaddressed comment which I cannot see but I thought I had made. please soften the requirement to use memset.

lib/libc/string/bzero.3
97 ↗(On Diff #7996)

bzero(3) is a BSD classic so it is neither deprecated in FreeBSD nor do we plan to remove it.

Could this something like:

For portability with other systems new programs should use.

In D3380#69374, @pfg wrote:
In D3380#69369, @araujo wrote:
In D3380#68918, @pfg wrote:

I was going to suggest a link to explicit_bzero(3) but the explicit_bzero() page already contains the bzero(3) description so perhaps we should unify them and use a symlink

@pfg with the MLINKS+=bzero.3 explicit_bzero.3, it does cover your suggestion, doesn't it?

Wait .. you are right,: for some reason I was looking at the bzero(3) manpage in 10.0.

Still there is an unaddressed comment which I cannot see but I thought I had made. please soften the requirement to use memset.

OK, I think the word "should" makes the usage not a must.

lib/libc/string/bzero.3
97 ↗(On Diff #7996)

I pretty much like your suggestion, for some cases I do believe bzero(3) is still the best choice than memset(3).

http://fdiv.net/2009/01/14/memset-vs-bzero-ultimate-showdown

Address @pfg suggestion.
Make the usage of memset(3) more soft, bzero(3) is still faster for
network protocols as an example.

wblock added a reviewer: wblock.

Man page looks good to me. Please remember to check with igor -R and mandoc -Tlint, too. Thanks!

This revision is now accepted and ready to land.Aug 18 2015, 2:46 AM
bapt edited edge metadata.