Module Name:    src
Committed By:   jruoho
Date:           Fri Apr 30 10:06:52 UTC 2010

Modified Files:
        src/lib/libc/stdlib: tsearch.3

Log Message:
Add STANDARDS and CAVEATS. The latter notes the ambiguity of tdelete() when
deleting the root node.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/stdlib/tsearch.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/stdlib/tsearch.3
diff -u src/lib/libc/stdlib/tsearch.3:1.10 src/lib/libc/stdlib/tsearch.3:1.11
--- src/lib/libc/stdlib/tsearch.3:1.10	Sat Apr 11 16:17:26 2009
+++ src/lib/libc/stdlib/tsearch.3	Fri Apr 30 10:06:52 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: tsearch.3,v 1.10 2009/04/11 16:17:26 joerg Exp $
+.\" $NetBSD: tsearch.3,v 1.11 2010/04/30 10:06:52 jruoho Exp $
 .\" Copyright (c) 1997 Todd C. Miller <todd.mil...@courtesan.com>
 .\" All rights reserved.
 .\"
@@ -26,7 +26,7 @@
 .\"
 .\"	OpenBSD: tsearch.3,v 1.2 1998/06/21 22:13:49 millert Exp
 .\"
-.Dd November 26, 2006
+.Dd April 30, 2010
 .Dt TSEARCH 3
 .Os
 .Sh NAME
@@ -117,3 +117,25 @@
 .Xr bsearch 3 ,
 .Xr hsearch 3 ,
 .Xr lsearch 3
+.Sh STANDARDS
+These functions conform to
+.St -p1003.1-2001 .
+.Sh CAVEATS
+The
+.St -p1003.1-2001
+standard does not specify what value should be returned when deleting
+the root node.
+Since implementations vary, user of
+.Fn tdelete
+should not rely on any specific behaviour.
+The
+.St -p1003.1-2008
+revision tried to clarify the issue with the following wording:
+.Do
+the
+.Fn tdelete
+function shall return a pointer to the parent of the deleted node,
+or an unspecified non-NULL pointer if the deleted node was the root node, or a
+.Dv NULL
+pointer if the node is not found.
+.Dc

Reply via email to