| 1 |
#! stap -p2 |
| 2 |
|
| 3 |
function sockaddr_un(ptr) |
| 4 |
{ |
| 5 |
// Make sure multiple conflicting returns don't resolve a type. |
| 6 |
// (These are actually the same, but coming from different cast modules.) |
| 7 |
if (randint(2)) |
| 8 |
return & @cast(ptr, "sockaddr_un", "<sys/un.h>"); |
| 9 |
else |
| 10 |
return & @cast(ptr, "sockaddr_un", "<sys/socket.h><sys/un.h>"); |
| 11 |
} |
| 12 |
|
| 13 |
probe begin |
| 14 |
{ |
| 15 |
// Test DWARF types returned from function calls, |
| 16 |
// even failing properly when the field doesn't exist. |
| 17 |
println( sockaddr_un(0) -> sun_family ) |
| 18 |
} |