diff options
Diffstat (limited to 'usr/src/uts/common/krtld/kobj.c')
-rw-r--r-- | usr/src/uts/common/krtld/kobj.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/usr/src/uts/common/krtld/kobj.c b/usr/src/uts/common/krtld/kobj.c index 4b764fd337..6df0916ea0 100644 --- a/usr/src/uts/common/krtld/kobj.c +++ b/usr/src/uts/common/krtld/kobj.c @@ -3195,6 +3195,25 @@ kobj_boot_mod_lookup(const char *modname) } /* + * Determine if the module exists. + */ +int +kobj_path_exists(char *name, int use_path) +{ + struct _buf *file; + + file = kobj_open_path(name, use_path, 1); +#ifdef MODDIR_SUFFIX + if (file == (struct _buf *)-1) + file = kobj_open_path(name, use_path, 0); +#endif /* MODDIR_SUFFIX */ + if (file == (struct _buf *)-1) + return (0); + kobj_close_file(file); + return (1); +} + +/* * fullname is dynamically allocated to be able to hold the * maximum size string that can be constructed from name. * path is exactly like the shell PATH variable. |