summaryrefslogtreecommitdiffstats
path: root/sys/libkern/rindex.c
diff options
context:
space:
mode:
authorwkoszek <wkoszek@FreeBSD.org>2007-04-10 21:42:12 +0000
committerwkoszek <wkoszek@FreeBSD.org>2007-04-10 21:42:12 +0000
commite97a378b02662f173b005847d6cd159a3a31ae58 (patch)
tree5b17f649e3d7fcfdae517ca0e0827bda313ca0d8 /sys/libkern/rindex.c
parentf4e110ebf22bf617f42b602eae033b308e4971fb (diff)
downloadFreeBSD-src-e97a378b02662f173b005847d6cd159a3a31ae58.zip
FreeBSD-src-e97a378b02662f173b005847d6cd159a3a31ae58.tar.gz
strchr() and strrchr() are already present in the kernel, but with less
popular names. Hence: - comment current index() and rindex() functions, as these serve the same functionality as, respectively, strchr() and strrchr() from userland; - add inlined version of strchr() and strrchr(), as we tend to use them more often; - remove str[r]chr() definitions from ZFS code; Reviewed by: pjd Approved by: cognet (mentor)
Diffstat (limited to 'sys/libkern/rindex.c')
-rw-r--r--sys/libkern/rindex.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/libkern/rindex.c b/sys/libkern/rindex.c
index b1669f8..19bed70 100644
--- a/sys/libkern/rindex.c
+++ b/sys/libkern/rindex.c
@@ -33,6 +33,10 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/libkern.h>
+/*
+ * rindex() is also present as the strrchr() in the kernel; it does exactly the
+ * same thing as it's userland equivalent.
+ */
char *
rindex(p, ch)
const char *p;
OpenPOWER on IntegriCloud