[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
bin/51957: hsearch_r on NetBSD has opposite behavior compared to Linux
>Synopsis: hsearch_r on NetBSD has opposite behavior compared to Linux
>Arrival-Date: Tue Feb 07 02:00:00 +0000 2017
>Originator: Ngie Cooper
The lib/libc/stdlib/t_hsearch.c:nonexistent testcase tests hsearch_r to make sure it fails when creating a hash search table, then checks to make sure that a proper error is returned when looking for a non-ENTER'ed key.
The error code behavior on NetBSD is opposite of Linux. The Linux behavior seems more consistent with standard expectations for lib call return codes, but at the very least I figured it should be documented. From https://linux.die.net/man/3/hsearch_r :
On success, hsearch() returns a pointer to an entry in the hash table. hsearch() returns NULL on error, that is, if action is ENTER and the hash table is full, or action is FIND and item cannot be found in the hash table. hsearch_r() returns nonzero on success, and 0 on error.
Main Index |
Thread Index |