summaryrefslogtreecommitdiff
path: root/usr/src/common/ctf/ctf_hash.c
diff options
context:
space:
mode:
authormws <none@none>2006-01-08 14:39:10 -0800
committermws <none@none>2006-01-08 14:39:10 -0800
commite4586ebf2f01666696316c178da243993b1a0c04 (patch)
tree8b48d38ef0f5c3449bce818de6bc85cbc54e7771 /usr/src/common/ctf/ctf_hash.c
parent0578ac30778226273ab5a411148294e23d339851 (diff)
downloadillumos-joyent-e4586ebf2f01666696316c178da243993b1a0c04.tar.gz
6198296 dtrace's printf() misses a corner case
6235357 dtrace(1M) can't ignore SIGINT and SIGTERM 6282866 D string behaviors need some cleanup 6304467 dtrace -G by itself does nothing and produces no output 6305443 dtrace falls for typedef fake 6312329 qlen.d example won't parse 6312678 D compiler needs to resolve direct_declarator IDENT/TNAME ambiguity 6320980 ctf_enum_value() returns NULL instead of CTF_ERR on failure 6327910 req.flg entry missing for usr/src/common/smbios 6335522 smbios_bufopen() computes intermediate checksum using unpacked header 6335549 prtdiag: can't get smbios tables on toshiba tecra s1 laptop 6335559 smbios utility reports bogus cache size information 6368524 ctf_lookup_by_name() qualifier check can be made more efficient 6368526 fmd -o debug=help core dumps after printing help message 6368529 Psetbkpt() is returning EBUSY instead of setting errno to EBUSY
Diffstat (limited to 'usr/src/common/ctf/ctf_hash.c')
-rw-r--r--usr/src/common/ctf/ctf_hash.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/usr/src/common/ctf/ctf_hash.c b/usr/src/common/ctf/ctf_hash.c
index ff2ba61352..b10a7618f6 100644
--- a/usr/src/common/ctf/ctf_hash.c
+++ b/usr/src/common/ctf/ctf_hash.c
@@ -19,8 +19,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -122,6 +123,24 @@ ctf_hash_insert(ctf_hash_t *hp, ctf_file_t *fp, ushort_t type, uint_t name)
return (0);
}
+/*
+ * Wrapper for ctf_hash_lookup/ctf_hash_insert: if the key is already in the
+ * hash, override the previous definition with this new official definition.
+ * If the key is not present, then call ctf_hash_insert() and hash it in.
+ */
+int
+ctf_hash_define(ctf_hash_t *hp, ctf_file_t *fp, ushort_t type, uint_t name)
+{
+ const char *str = ctf_strptr(fp, name);
+ ctf_helem_t *hep = ctf_hash_lookup(hp, fp, str, strlen(str));
+
+ if (hep == NULL)
+ return (ctf_hash_insert(hp, fp, type, name));
+
+ hep->h_type = type;
+ return (0);
+}
+
ctf_helem_t *
ctf_hash_lookup(ctf_hash_t *hp, ctf_file_t *fp, const char *key, size_t len)
{