tst.dlclose1.ksh (211545) | tst.dlclose1.ksh (277916) |
---|---|
1#!/bin/ksh -p 2# 3# CDDL HEADER START 4# 5# The contents of this file are subject to the terms of the 6# Common Development and Distribution License (the "License"). 7# You may not use this file except in compliance with the License. 8# --- 92 unchanged lines hidden (view full) --- 101} 102EOF 103 104 105cat > main.c <<EOF 106#include <dlfcn.h> 107#include <unistd.h> 108#include <stdio.h> | 1#!/bin/ksh -p 2# 3# CDDL HEADER START 4# 5# The contents of this file are subject to the terms of the 6# Common Development and Distribution License (the "License"). 7# You may not use this file except in compliance with the License. 8# --- 92 unchanged lines hidden (view full) --- 101} 102EOF 103 104 105cat > main.c <<EOF 106#include <dlfcn.h> 107#include <unistd.h> 108#include <stdio.h> |
109#include <signal.h> |
|
109 110int 111main(int argc, char **argv) 112{ 113 void *live; | 110 111int 112main(int argc, char **argv) 113{ 114 void *live; |
115 sigset_t mask; |
|
114 115 if ((live = dlopen("./livelib.so", RTLD_LAZY | RTLD_LOCAL)) == NULL) { 116 printf("dlopen of livelib.so failed: %s\n", dlerror()); 117 return (1); 118 } 119 120 (void) dlclose(live); 121 | 116 117 if ((live = dlopen("./livelib.so", RTLD_LAZY | RTLD_LOCAL)) == NULL) { 118 printf("dlopen of livelib.so failed: %s\n", dlerror()); 119 return (1); 120 } 121 122 (void) dlclose(live); 123 |
122 pause(); | 124 (void) sigemptyset(&mask); 125 (void) sigsuspend(&mask); |
123 124 return (0); 125} 126EOF 127 128/usr/bin/make > /dev/null 129if [ $? -ne 0 ]; then 130 print -u2 "failed to build" 131 exit 1 132fi 133 134script() { 135 $dtrace -w -x bufsize=1k -c ./main -qs /dev/stdin <<EOF | 126 127 return (0); 128} 129EOF 130 131/usr/bin/make > /dev/null 132if [ $? -ne 0 ]; then 133 print -u2 "failed to build" 134 exit 1 135fi 136 137script() { 138 $dtrace -w -x bufsize=1k -c ./main -qs /dev/stdin <<EOF |
136 syscall::pause:entry | 139 syscall::sigsuspend:entry |
137 /pid == \$target/ 138 { 139 system("$dtrace -l -P test_prov*"); 140 system("kill %d", \$target); 141 exit(0); 142 } 143 144 tick-1s --- 15 unchanged lines hidden --- | 140 /pid == \$target/ 141 { 142 system("$dtrace -l -P test_prov*"); 143 system("kill %d", \$target); 144 exit(0); 145 } 146 147 tick-1s --- 15 unchanged lines hidden --- |