diff options
author | newton <newton@FreeBSD.org> | 1999-02-04 12:42:39 +0000 |
---|---|---|
committer | newton <newton@FreeBSD.org> | 1999-02-04 12:42:39 +0000 |
commit | 6266a87e013823a79533aeaa77655454999cfed8 (patch) | |
tree | 503f5a04fac06233ec379264a24bd16c64e8396e /sys/kern/imgact_elf.c | |
parent | a14ff10255d2dd0da8153e082f6d999b9388970d (diff) | |
download | FreeBSD-src-6266a87e013823a79533aeaa77655454999cfed8.zip FreeBSD-src-6266a87e013823a79533aeaa77655454999cfed8.tar.gz |
Provide elf_brand_inuse() as a method an emulator can use to find out
whether it is currently in use (which is kinda useful when it's about
to unload itself: Lockups are never very much fun, are they?).
Diffstat (limited to 'sys/kern/imgact_elf.c')
-rw-r--r-- | sys/kern/imgact_elf.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 98613d8..4bc0fac 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: imgact_elf.c,v 1.46 1999/01/27 21:49:55 dillon Exp $ + * $Id: imgact_elf.c,v 1.47 1999/01/29 22:59:43 dillon Exp $ */ #include "opt_rlimit.h" @@ -145,6 +145,19 @@ elf_remove_brand_entry(Elf_Brandinfo *entry) return 0; } +int +elf_brand_inuse(Elf_Brandinfo *entry) +{ + struct proc *p; + + for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) { + if (p->p_sysent == entry->sysvec) + return TRUE; + } + + return FALSE; +} + static int elf_check_header(const Elf_Ehdr *hdr, int type) { |