aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/cmd/lockstat/sym.c
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2017-08-01 04:49:54 +0000
committerMark Johnston <markj@FreeBSD.org>2017-08-01 04:49:54 +0000
commit90ec6fd4ba705775bea97a744f2ab5bd96e868ae (patch)
treed5c35c48cf454690fbf96b9d8ec64c900dd8b93f /cddl/contrib/opensolaris/cmd/lockstat/sym.c
parent94759a244834d6e45679cedd3066f77eb5b31200 (diff)
downloadsrc-90ec6fd4ba705775bea97a744f2ab5bd96e868ae.tar.gz
src-90ec6fd4ba705775bea97a744f2ab5bd96e868ae.zip
Let lockstat use ksyms(4)'s mmap interface.
The workaround described in the deleted comment is no longer needed. MFC after: 1 week
Notes
Notes: svn path=/head/; revision=321842
Diffstat (limited to 'cddl/contrib/opensolaris/cmd/lockstat/sym.c')
-rw-r--r--cddl/contrib/opensolaris/cmd/lockstat/sym.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/cddl/contrib/opensolaris/cmd/lockstat/sym.c b/cddl/contrib/opensolaris/cmd/lockstat/sym.c
index f3feb549c477..e668b54ee5b3 100644
--- a/cddl/contrib/opensolaris/cmd/lockstat/sym.c
+++ b/cddl/contrib/opensolaris/cmd/lockstat/sym.c
@@ -194,33 +194,9 @@ symtab_init(void)
return (-1);
#endif
-#ifdef illumos
(void) elf_version(EV_CURRENT);
elf = elf_begin(fd, ELF_C_READ, NULL);
-#else
- /*
- * XXX - libelf needs to be fixed so it will work with
- * non 'ordinary' files like /dev/ksyms. The following
- * is a work around for now.
- */
- if (elf_version(EV_CURRENT) == EV_NONE) {
- close(fd);
- return (-1);
- }
- if (ioctl(fd, KIOCGSIZE, &sz) < 0) {
- close(fd);
- return (-1);
- }
- if (ioctl(fd, KIOCGADDR, &ksyms) < 0) {
- close(fd);
- return (-1);
- }
- if ((elf = elf_memory(ksyms, sz)) == NULL) {
- close(fd);
- return (-1);
- }
-#endif
for (cnt = 1; (scn = elf_nextscn(elf, scn)) != NULL; cnt++) {
Shdr *shdr = elf_getshdr(scn);