From 06b7d9af9f53b12a3eaf856d03835bc930947fd5 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Tue, 31 Oct 1995 16:58:25 +0000 Subject: __fdnlist() is used by libkvm --- lib/libc/gen/nlist.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c index 6e304e6f7ed..347982a3123 100644 --- a/lib/libc/gen/nlist.c +++ b/lib/libc/gen/nlist.c @@ -281,6 +281,21 @@ static struct nlist_handlers { #endif }; +__fdnlist(fd, list) + register int fd; + register struct nlist *list; +{ + int n, i; + + for (i = 0; i < sizeof(nlist_fn)/sizeof(nlist_fn[0]); i++) { + n = (nlist_fn[i].fn)(fd, list); + if (n != -1) + break; + } + return (n); +} + + int nlist(name, list) const char *name; @@ -292,11 +307,7 @@ nlist(name, list) fd = open(name, O_RDONLY, 0); if (fd < 0) return (-1); - for (i = 0; i < sizeof(nlist_fn)/sizeof(nlist_fn[0]); i++) { - n = (nlist_fn[i].fn)(fd, list); - if (n != -1) - break; - } + n = __fdnlist(fd, list); (void)close(fd); return (n); } -- cgit v1.2.3