misc/75995: hcreate documentation(?) bug

Tarc tarc at po.cs.msu.su
Sun Jan 9 08:20:22 PST 2005


>Number:         75995
>Category:       misc
>Synopsis:       hcreate documentation(?) bug
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 09 16:20:21 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Tarc
>Release:        5.3
>Organization:
MSU
>Environment:
FreeBSD tarc.po.cs.msu.su 5.3-STABLE FreeBSD 5.3-STABLE #0: Wed Dec 29 18:08:32 MSK 2004     root at tarc.po.cs.msu.su:/usr/src/sys/i386/compile/Kernel  i386
>Description:
I read the man hcreate(3) and, for better understanding, how hash table addressed, /usr/src/lib/libc/stdlib/hcreate.c
Mam says, that if error occur, hcreate(3) returns 0, but if no memory, it will set errno to ENOMEM.
But I see, that if hachtable is already created, hcreate returns 0 AND SETS errno to EINVAL.
T think, it's true way, but undocumented
>How-To-Repeat:
up to date system sources & read:
cd /usr/src/lib/libc/stdlib
more hcreate.c
man 3 hcreate

>Fix:
Add description about EINVAL to man, or don't set errno.
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list