mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
8143291: Remove redundant coding around os::exception_name
Reviewed-by: dholmes, coleenp
This commit is contained in:
parent
40f65439e2
commit
9e9eac05ae
14 changed files with 167 additions and 480 deletions
|
@ -6033,3 +6033,36 @@ void TestReserveMemorySpecial_test() {
|
|||
UseNUMAInterleaving = old_use_numa_interleaving;
|
||||
}
|
||||
#endif // PRODUCT
|
||||
|
||||
/*
|
||||
All the defined signal names for Windows.
|
||||
|
||||
NOTE that not all of these names are accepted by FindSignal!
|
||||
|
||||
For various reasons some of these may be rejected at runtime.
|
||||
|
||||
Here are the names currently accepted by a user of sun.misc.Signal with
|
||||
1.4.1 (ignoring potential interaction with use of chaining, etc):
|
||||
|
||||
(LIST TBD)
|
||||
|
||||
*/
|
||||
int os::get_signal_number(const char* name) {
|
||||
static const struct {
|
||||
char* name;
|
||||
int number;
|
||||
} siglabels [] =
|
||||
// derived from version 6.0 VC98/include/signal.h
|
||||
{"ABRT", SIGABRT, // abnormal termination triggered by abort cl
|
||||
"FPE", SIGFPE, // floating point exception
|
||||
"SEGV", SIGSEGV, // segment violation
|
||||
"INT", SIGINT, // interrupt
|
||||
"TERM", SIGTERM, // software term signal from kill
|
||||
"BREAK", SIGBREAK, // Ctrl-Break sequence
|
||||
"ILL", SIGILL}; // illegal instruction
|
||||
for(int i=0;i<sizeof(siglabels)/sizeof(struct siglabel);i++)
|
||||
if(!strcmp(name, siglabels[i].name))
|
||||
return siglabels[i].number;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue