1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 22 /* 23 * Copyright 2010 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27 /* 28 * String conversion routines the system structs found in 29 * Solaris core file note sections. These items are not 30 * ELF constructs. However, elfdump contains code for decoding 31 * them, and therefore requires formatting support. 32 */ 33 #include <stdio.h> 34 #include <procfs.h> 35 #include <sys/corectl.h> 36 #include <string.h> 37 #include <_conv.h> 38 #include <corenote_msg.h> 39 40 const char * 41 conv_cnote_type(Word type, Conv_fmt_flags_t fmt_flags, 42 Conv_inv_buf_t *inv_buf) 43 { 44 static const Msg types[] = { 45 MSG_NT_PRSTATUS, MSG_NT_PRFPREG, 46 MSG_NT_PRPSINFO, MSG_NT_PRXREG, 47 MSG_NT_PLATFORM, MSG_NT_AUXV, 48 MSG_NT_GWINDOWS, MSG_NT_ASRS, 49 MSG_NT_LDT, MSG_NT_PSTATUS, 50 0, 0, 51 MSG_NT_PSINFO, MSG_NT_PRCRED, 52 MSG_NT_UTSNAME, MSG_NT_LWPSTATUS, 53 MSG_NT_LWPSINFO, MSG_NT_PRPRIV, 54 MSG_NT_PRPRIVINFO, MSG_NT_CONTENT, 55 MSG_NT_ZONENAME 56 }; 57 #if NT_NUM != NT_ZONENAME 58 #error "NT_NUM has grown. Update core note types[]" 59 #endif 60 static const conv_ds_msg_t ds_types = { 61 CONV_DS_MSG_INIT(NT_PRSTATUS, types) }; 62 static const conv_ds_t *ds[] = { CONV_DS_ADDR(ds_types), NULL }; 63 64 65 return (conv_map_ds(ELFOSABI_NONE, EM_NONE, type, ds, fmt_flags, 66 inv_buf)); 67 } 68 69 70 const char * 71 conv_cnote_auxv_type(Word type, Conv_fmt_flags_t fmt_flags, 72 Conv_inv_buf_t *inv_buf) 73 { 74 static const Msg types_0_22[] = { 75 MSG_AUXV_AT_NULL, MSG_AUXV_AT_IGNORE, 76 MSG_AUXV_AT_EXECFD, MSG_AUXV_AT_PHDR, 77 MSG_AUXV_AT_PHENT, MSG_AUXV_AT_PHNUM, 78 MSG_AUXV_AT_PAGESZ, MSG_AUXV_AT_BASE, 79 MSG_AUXV_AT_FLAGS, MSG_AUXV_AT_ENTRY, 80 MSG_AUXV_AT_NOTELF, MSG_AUXV_AT_UID, 81 MSG_AUXV_AT_EUID, MSG_AUXV_AT_GID, 82 MSG_AUXV_AT_EGID, MSG_AUXV_AT_PLATFORM, 83 MSG_AUXV_AT_HWCAP, MSG_AUXV_AT_CLKTCK, 84 MSG_AUXV_AT_FPUCW, MSG_AUXV_AT_DCACHEBSIZE, 85 MSG_AUXV_AT_ICACHEBSIZE, MSG_AUXV_AT_UCACHEBSIZE, 86 MSG_AUXV_AT_IGNOREPPC 87 }; 88 static const conv_ds_msg_t ds_types_0_22 = { 89 CONV_DS_MSG_INIT(0, types_0_22) }; 90 91 static const Msg types_2000_2011[] = { 92 MSG_AUXV_AT_SUN_UID, MSG_AUXV_AT_SUN_RUID, 93 MSG_AUXV_AT_SUN_GID, MSG_AUXV_AT_SUN_RGID, 94 MSG_AUXV_AT_SUN_LDELF, MSG_AUXV_AT_SUN_LDSHDR, 95 MSG_AUXV_AT_SUN_LDNAME, MSG_AUXV_AT_SUN_LPAGESZ, 96 MSG_AUXV_AT_SUN_PLATFORM, MSG_AUXV_AT_SUN_HWCAP, 97 MSG_AUXV_AT_SUN_IFLUSH, MSG_AUXV_AT_SUN_CPU 98 }; 99 static const conv_ds_msg_t ds_types_2000_2011 = { 100 CONV_DS_MSG_INIT(2000, types_2000_2011) }; 101 102 static const Msg types_2014_2022[] = { 103 MSG_AUXV_AT_SUN_EXECNAME, MSG_AUXV_AT_SUN_MMU, 104 MSG_AUXV_AT_SUN_LDDATA, MSG_AUXV_AT_SUN_AUXFLAGS, 105 MSG_AUXV_AT_SUN_EMULATOR, MSG_AUXV_AT_SUN_BRANDNAME, 106 MSG_AUXV_AT_SUN_BRAND_AUX1, MSG_AUXV_AT_SUN_BRAND_AUX2, 107 MSG_AUXV_AT_SUN_BRAND_AUX3 108 }; 109 static const conv_ds_msg_t ds_types_2014_2022 = { 110 CONV_DS_MSG_INIT(2014, types_2014_2022) }; 111 112 static const conv_ds_t *ds[] = { 113 CONV_DS_ADDR(ds_types_0_22), CONV_DS_ADDR(ds_types_2000_2011), 114 CONV_DS_ADDR(ds_types_2014_2022), NULL }; 115 116 return (conv_map_ds(ELFOSABI_NONE, EM_NONE, type, ds, fmt_flags, 117 inv_buf)); 118 } 119 120 121 const char * 122 conv_cnote_signal(Word sig, Conv_fmt_flags_t fmt_flags, 123 Conv_inv_buf_t *inv_buf) 124 { 125 static const Msg sigarr[] = { 126 MSG_SIGHUP, MSG_SIGINT, 127 MSG_SIGQUIT, MSG_SIGILL, 128 MSG_SIGTRAP, MSG_SIGABRT, 129 MSG_SIGEMT, MSG_SIGFPE, 130 MSG_SIGKILL, MSG_SIGBUS, 131 MSG_SIGSEGV, MSG_SIGSYS, 132 MSG_SIGPIPE, MSG_SIGALRM, 133 MSG_SIGTERM, MSG_SIGUSR1, 134 MSG_SIGUSR2, MSG_SIGCHLD, 135 MSG_SIGPWR, MSG_SIGWINCH, 136 MSG_SIGURG, MSG_SIGPOLL, 137 MSG_SIGSTOP, MSG_SIGTSTP, 138 MSG_SIGCONT, MSG_SIGTTIN, 139 MSG_SIGTTOU, MSG_SIGVTALRM, 140 MSG_SIGPROF, MSG_SIGXCPU, 141 MSG_SIGXFSZ, MSG_SIGWAITING, 142 MSG_SIGLWP, MSG_SIGFREEZE, 143 MSG_SIGTHAW, MSG_SIGCANCEL, 144 MSG_SIGLOST, MSG_SIGXRES, 145 MSG_SIGJVM1, MSG_SIGJVM2, 146 }; 147 static const conv_ds_msg_t ds_sigarr = { 148 CONV_DS_MSG_INIT(SIGHUP, sigarr) }; 149 150 static const conv_ds_t *ds[] = { CONV_DS_ADDR(ds_sigarr), NULL }; 151 152 return (conv_map_ds(ELFOSABI_NONE, EM_NONE, sig, ds, fmt_flags, 153 inv_buf)); 154 } 155 156 157 const char * 158 conv_cnote_fault(Word flt, Conv_fmt_flags_t fmt_flags, 159 Conv_inv_buf_t *inv_buf) 160 { 161 static const Msg fltarr[] = { 162 MSG_FLTILL, MSG_FLTPRIV, 163 MSG_FLTBPT, MSG_FLTTRACE, 164 MSG_FLTACCESS, MSG_FLTBOUNDS, 165 MSG_FLTIOVF, MSG_FLTIZDIV, 166 MSG_FLTFPE, MSG_FLTSTACK, 167 MSG_FLTPAGE, MSG_FLTWATCH, 168 MSG_FLTCPCOVF 169 170 }; 171 static const conv_ds_msg_t ds_fltarr = { 172 CONV_DS_MSG_INIT(FLTILL, fltarr) }; 173 174 static const conv_ds_t *ds[] = { CONV_DS_ADDR(ds_fltarr), NULL }; 175 176 return (conv_map_ds(ELFOSABI_NONE, EM_NONE, flt, ds, fmt_flags, 177 inv_buf)); 178 } 179 180 181 const char * 182 conv_cnote_syscall(Word sysnum, Conv_fmt_flags_t fmt_flags, 183 Conv_inv_buf_t *inv_buf) 184 { 185 static const Msg sysnumarr[] = { 186 MSG_SYS_EXIT, MSG_SYS_2, 187 MSG_SYS_READ, MSG_SYS_WRITE, 188 MSG_SYS_OPEN, MSG_SYS_CLOSE, 189 MSG_SYS_7, MSG_SYS_8, 190 MSG_SYS_LINK, MSG_SYS_UNLINK, 191 MSG_SYS_11, MSG_SYS_CHDIR, 192 MSG_SYS_TIME, MSG_SYS_MKNOD, 193 MSG_SYS_CHMOD, MSG_SYS_CHOWN, 194 MSG_SYS_BRK, MSG_SYS_STAT, 195 MSG_SYS_LSEEK, MSG_SYS_GETPID, 196 MSG_SYS_MOUNT, MSG_SYS_22, 197 MSG_SYS_SETUID, MSG_SYS_GETUID, 198 MSG_SYS_STIME, MSG_SYS_PCSAMPLE, 199 MSG_SYS_ALARM, MSG_SYS_FSTAT, 200 MSG_SYS_PAUSE, MSG_SYS_30, 201 MSG_SYS_STTY, MSG_SYS_GTTY, 202 MSG_SYS_ACCESS, MSG_SYS_NICE, 203 MSG_SYS_STATFS, MSG_SYS_SYNC, 204 MSG_SYS_KILL, MSG_SYS_FSTATFS, 205 MSG_SYS_PGRPSYS, MSG_SYS_UUCOPYSTR, 206 MSG_SYS_41, MSG_SYS_PIPE, 207 MSG_SYS_TIMES, MSG_SYS_PROFIL, 208 MSG_SYS_FACCESSAT, MSG_SYS_SETGID, 209 MSG_SYS_GETGID, MSG_SYS_48, 210 MSG_SYS_MSGSYS, MSG_SYS_SYSI86, 211 MSG_SYS_ACCT, MSG_SYS_SHMSYS, 212 MSG_SYS_SEMSYS, MSG_SYS_IOCTL, 213 MSG_SYS_UADMIN, MSG_SYS_FCHOWNAT, 214 MSG_SYS_UTSSYS, MSG_SYS_FDSYNC, 215 MSG_SYS_EXECVE, MSG_SYS_UMASK, 216 MSG_SYS_CHROOT, MSG_SYS_FCNTL, 217 MSG_SYS_ULIMIT, MSG_SYS_RENAMEAT, 218 MSG_SYS_UNLINKAT, MSG_SYS_FSTATAT, 219 MSG_SYS_FSTATAT64, MSG_SYS_OPENAT, 220 MSG_SYS_OPENAT64, MSG_SYS_TASKSYS, 221 MSG_SYS_ACCTCTL, MSG_SYS_EXACCTSYS, 222 MSG_SYS_GETPAGESIZES, MSG_SYS_RCTLSYS, 223 MSG_SYS_SIDSYS, MSG_SYS_76, 224 MSG_SYS_LWP_PARK, MSG_SYS_SENDFILEV, 225 MSG_SYS_RMDIR, MSG_SYS_MKDIR, 226 MSG_SYS_GETDENTS, MSG_SYS_PRIVSYS, 227 MSG_SYS_UCREDSYS, MSG_SYS_SYSFS, 228 MSG_SYS_GETMSG, MSG_SYS_PUTMSG, 229 MSG_SYS_87, MSG_SYS_LSTAT, 230 MSG_SYS_SYMLINK, MSG_SYS_READLINK, 231 MSG_SYS_SETGROUPS, MSG_SYS_GETGROUPS, 232 MSG_SYS_FCHMOD, MSG_SYS_FCHOWN, 233 MSG_SYS_SIGPROCMASK, MSG_SYS_SIGSUSPEND, 234 MSG_SYS_SIGALTSTACK, MSG_SYS_SIGACTION, 235 MSG_SYS_SIGPENDING, MSG_SYS_CONTEXT, 236 MSG_SYS_101, MSG_SYS_102, 237 MSG_SYS_STATVFS, MSG_SYS_FSTATVFS, 238 MSG_SYS_GETLOADAVG, MSG_SYS_NFSSYS, 239 MSG_SYS_WAITID, MSG_SYS_SIGSENDSYS, 240 MSG_SYS_HRTSYS, MSG_SYS_UTIMESYS, 241 MSG_SYS_SIGRESEND, MSG_SYS_PRIOCNTLSYS, 242 MSG_SYS_PATHCONF, MSG_SYS_MINCORE, 243 MSG_SYS_MMAP, MSG_SYS_MPROTECT, 244 MSG_SYS_MUNMAP, MSG_SYS_FPATHCONF, 245 MSG_SYS_VFORK, MSG_SYS_FCHDIR, 246 MSG_SYS_READV, MSG_SYS_WRITEV, 247 MSG_SYS_123, MSG_SYS_124, 248 MSG_SYS_125, MSG_SYS_126, 249 MSG_SYS_MMAPOBJ, MSG_SYS_SETRLIMIT, 250 MSG_SYS_GETRLIMIT, MSG_SYS_LCHOWN, 251 MSG_SYS_MEMCNTL, MSG_SYS_GETPMSG, 252 MSG_SYS_PUTPMSG, MSG_SYS_RENAME, 253 MSG_SYS_UNAME, MSG_SYS_SETEGID, 254 MSG_SYS_SYSCONFIG, MSG_SYS_ADJTIME, 255 MSG_SYS_SYSTEMINFO, MSG_SYS_SHAREFS, 256 MSG_SYS_SETEUID, MSG_SYS_FORKSYS, 257 MSG_SYS_143, MSG_SYS_SIGTIMEDWAIT, 258 MSG_SYS_LWP_INFO, MSG_SYS_YIELD, 259 MSG_SYS_147, MSG_SYS_LWP_SEMA_POST, 260 MSG_SYS_LWP_SEMA_TRYWAIT, MSG_SYS_LWP_DETACH, 261 MSG_SYS_CORECTL, MSG_SYS_MODCTL, 262 MSG_SYS_FCHROOT, MSG_SYS_154, 263 MSG_SYS_VHANGUP, MSG_SYS_GETTIMEOFDAY, 264 MSG_SYS_GETITIMER, MSG_SYS_SETITIMER, 265 MSG_SYS_LWP_CREATE, MSG_SYS_LWP_EXIT, 266 MSG_SYS_LWP_SUSPEND, MSG_SYS_LWP_CONTINUE, 267 MSG_SYS_LWP_KILL, MSG_SYS_LWP_SELF, 268 MSG_SYS_LWP_SIGMASK, MSG_SYS_LWP_PRIVATE, 269 MSG_SYS_LWP_WAIT, MSG_SYS_LWP_MUTEX_WAKEUP, 270 MSG_SYS_169, MSG_SYS_LWP_COND_WAIT, 271 MSG_SYS_LWP_COND_SIGNAL, MSG_SYS_LWP_COND_BROADCAST, 272 MSG_SYS_PREAD, MSG_SYS_PWRITE, 273 MSG_SYS_LLSEEK, MSG_SYS_INST_SYNC, 274 MSG_SYS_BRAND, MSG_SYS_KAIO, 275 MSG_SYS_CPC, MSG_SYS_LGRPSYS, 276 MSG_SYS_RUSAGESYS, MSG_SYS_PORT, 277 MSG_SYS_POLLSYS, MSG_SYS_LABELSYS, 278 MSG_SYS_ACL, MSG_SYS_AUDITSYS, 279 MSG_SYS_PROCESSOR_BIND, MSG_SYS_PROCESSOR_INFO, 280 MSG_SYS_P_ONLINE, MSG_SYS_SIGQUEUE, 281 MSG_SYS_CLOCK_GETTIME, MSG_SYS_CLOCK_SETTIME, 282 MSG_SYS_CLOCK_GETRES, MSG_SYS_TIMER_CREATE, 283 MSG_SYS_TIMER_DELETE, MSG_SYS_TIMER_SETTIME, 284 MSG_SYS_TIMER_GETTIME, MSG_SYS_TIMER_GETOVERRUN, 285 MSG_SYS_NANOSLEEP, MSG_SYS_FACL, 286 MSG_SYS_DOOR, MSG_SYS_SETREUID, 287 MSG_SYS_SETREGID, MSG_SYS_INSTALL_UTRAP, 288 MSG_SYS_SIGNOTIFY, MSG_SYS_SCHEDCTL, 289 MSG_SYS_PSET, MSG_SYS_SPARC_UTRAP_INSTALL, 290 MSG_SYS_RESOLVEPATH, MSG_SYS_LWP_MUTEX_TIMEDLOCK, 291 MSG_SYS_LWP_SEMA_TIMEDWAIT, MSG_SYS_LWP_RWLOCK_SYS, 292 MSG_SYS_GETDENTS64, MSG_SYS_MMAP64, 293 MSG_SYS_STAT64, MSG_SYS_LSTAT64, 294 MSG_SYS_FSTAT64, MSG_SYS_STATVFS64, 295 MSG_SYS_FSTATVFS64, MSG_SYS_SETRLIMIT64, 296 MSG_SYS_GETRLIMIT64, MSG_SYS_PREAD64, 297 MSG_SYS_PWRITE64, MSG_SYS_224, 298 MSG_SYS_OPEN64, MSG_SYS_RPCSYS, 299 MSG_SYS_ZONE, MSG_SYS_AUTOFSSYS, 300 MSG_SYS_GETCWD, MSG_SYS_SO_SOCKET, 301 MSG_SYS_SO_SOCKETPAIR, MSG_SYS_BIND, 302 MSG_SYS_LISTEN, MSG_SYS_ACCEPT, 303 MSG_SYS_CONNECT, MSG_SYS_SHUTDOWN, 304 MSG_SYS_RECV, MSG_SYS_RECVFROM, 305 MSG_SYS_RECVMSG, MSG_SYS_SEND, 306 MSG_SYS_SENDMSG, MSG_SYS_SENDTO, 307 MSG_SYS_GETPEERNAME, MSG_SYS_GETSOCKNAME, 308 MSG_SYS_GETSOCKOPT, MSG_SYS_SETSOCKOPT, 309 MSG_SYS_SOCKCONFIG, MSG_SYS_NTP_GETTIME, 310 MSG_SYS_NTP_ADJTIME, MSG_SYS_LWP_MUTEX_UNLOCK, 311 MSG_SYS_LWP_MUTEX_TRYLOCK, MSG_SYS_LWP_MUTEX_REGISTER, 312 MSG_SYS_CLADM, MSG_SYS_UUCOPY, 313 MSG_SYS_UMOUNT2 314 }; 315 static const conv_ds_msg_t ds_sysnumarr = { 316 CONV_DS_MSG_INIT(1, sysnumarr) }; 317 318 static const conv_ds_t *ds[] = { CONV_DS_ADDR(ds_sysnumarr), NULL }; 319 320 int use_num = 0; 321 322 /* 323 * Range check, and handle the unused values in the middle 324 * of the range. Although the missing values have strings, 325 * we still prefer to format them, because those strings are 326 * decimal, and the default behavior, unless the CONV_FMT_DECIMAL 327 * flag is set, is to display such things in hex. 328 */ 329 switch (sysnum) { 330 case 0: 331 case 2: 332 case 7: 333 case 8: 334 case 11: 335 case 22: 336 case 30: 337 case 41: 338 case 48: 339 case 76: 340 case 87: 341 case 101: 342 case 102: 343 case 123: 344 case 124: 345 case 125: 346 case 126: 347 case 143: 348 case 147: 349 case 154: 350 case 169: 351 case 224: 352 use_num = 1; 353 break; 354 default: 355 use_num = (sysnum > SYS_umount2); 356 break; 357 } 358 if (use_num) 359 return (conv_invalid_val(inv_buf, sysnum, fmt_flags)); 360 361 return (conv_map_ds(ELFOSABI_NONE, EM_NONE, sysnum, ds, fmt_flags, 362 inv_buf)); 363 } 364 365 366 const char * 367 conv_cnote_errno(int errno_val, Conv_fmt_flags_t fmt_flags, 368 Conv_inv_buf_t *inv_buf) 369 { 370 static const Msg errarr_1_74[74] = { 371 MSG_ERRNO_EPERM, MSG_ERRNO_ENOENT, 372 MSG_ERRNO_ESRCH, MSG_ERRNO_EINTR, 373 MSG_ERRNO_EIO, MSG_ERRNO_ENXIO, 374 MSG_ERRNO_E2BIG, MSG_ERRNO_ENOEXEC, 375 MSG_ERRNO_EBADF, MSG_ERRNO_ECHILD, 376 MSG_ERRNO_EAGAIN, MSG_ERRNO_ENOMEM, 377 MSG_ERRNO_EACCES, MSG_ERRNO_EFAULT, 378 MSG_ERRNO_ENOTBLK, MSG_ERRNO_EBUSY, 379 MSG_ERRNO_EEXIST, MSG_ERRNO_EXDEV, 380 MSG_ERRNO_ENODEV, MSG_ERRNO_ENOTDIR, 381 MSG_ERRNO_EISDIR, MSG_ERRNO_EINVAL, 382 MSG_ERRNO_ENFILE, MSG_ERRNO_EMFILE, 383 MSG_ERRNO_ENOTTY, MSG_ERRNO_ETXTBSY, 384 MSG_ERRNO_EFBIG, MSG_ERRNO_ENOSPC, 385 MSG_ERRNO_ESPIPE, MSG_ERRNO_EROFS, 386 MSG_ERRNO_EMLINK, MSG_ERRNO_EPIPE, 387 MSG_ERRNO_EDOM, MSG_ERRNO_ERANGE, 388 MSG_ERRNO_ENOMSG, MSG_ERRNO_EIDRM, 389 MSG_ERRNO_ECHRNG, MSG_ERRNO_EL2NSYNC, 390 MSG_ERRNO_EL3HLT, MSG_ERRNO_EL3RST, 391 MSG_ERRNO_ELNRNG, MSG_ERRNO_EUNATCH, 392 MSG_ERRNO_ENOCSI, MSG_ERRNO_EL2HLT, 393 MSG_ERRNO_EDEADLK, MSG_ERRNO_ENOLCK, 394 MSG_ERRNO_ECANCELED, MSG_ERRNO_ENOTSUP, 395 MSG_ERRNO_EDQUOT, MSG_ERRNO_EBADE, 396 MSG_ERRNO_EBADR, MSG_ERRNO_EXFULL, 397 MSG_ERRNO_ENOANO, MSG_ERRNO_EBADRQC, 398 MSG_ERRNO_EBADSLT, MSG_ERRNO_EDEADLOCK, 399 MSG_ERRNO_EBFONT, MSG_ERRNO_EOWNERDEAD, 400 MSG_ERRNO_ENOTRECOVERABLE, MSG_ERRNO_ENOSTR, 401 MSG_ERRNO_ENODATA, MSG_ERRNO_ETIME, 402 MSG_ERRNO_ENOSR, MSG_ERRNO_ENONET, 403 MSG_ERRNO_ENOPKG, MSG_ERRNO_EREMOTE, 404 MSG_ERRNO_ENOLINK, MSG_ERRNO_EADV, 405 MSG_ERRNO_ESRMNT, MSG_ERRNO_ECOMM, 406 MSG_ERRNO_EPROTO, MSG_ERRNO_ELOCKUNMAPPED, 407 MSG_ERRNO_ENOTACTIVE, MSG_ERRNO_EMULTIHOP 408 }; 409 static const conv_ds_msg_t ds_errarr_1_74 = { 410 CONV_DS_MSG_INIT(1, errarr_1_74) }; 411 412 static const Msg errarr_77_99[23] = { 413 MSG_ERRNO_EBADMSG, MSG_ERRNO_ENAMETOOLONG, 414 MSG_ERRNO_EOVERFLOW, MSG_ERRNO_ENOTUNIQ, 415 MSG_ERRNO_EBADFD, MSG_ERRNO_EREMCHG, 416 MSG_ERRNO_ELIBACC, MSG_ERRNO_ELIBBAD, 417 MSG_ERRNO_ELIBSCN, MSG_ERRNO_ELIBMAX, 418 MSG_ERRNO_ELIBEXEC, MSG_ERRNO_EILSEQ, 419 MSG_ERRNO_ENOSYS, MSG_ERRNO_ELOOP, 420 MSG_ERRNO_ERESTART, MSG_ERRNO_ESTRPIPE, 421 MSG_ERRNO_ENOTEMPTY, MSG_ERRNO_EUSERS, 422 MSG_ERRNO_ENOTSOCK, MSG_ERRNO_EDESTADDRREQ, 423 MSG_ERRNO_EMSGSIZE, MSG_ERRNO_EPROTOTYPE, 424 MSG_ERRNO_ENOPROTOOPT 425 }; 426 static const conv_ds_msg_t ds_errarr_77_99 = { 427 CONV_DS_MSG_INIT(77, errarr_77_99) }; 428 429 static const Msg errarr_120_134[15] = { 430 MSG_ERRNO_EPROTONOSUPPORT, MSG_ERRNO_ESOCKTNOSUPPORT, 431 MSG_ERRNO_EOPNOTSUPP, MSG_ERRNO_EPFNOSUPPORT, 432 MSG_ERRNO_EAFNOSUPPORT, MSG_ERRNO_EADDRINUSE, 433 MSG_ERRNO_EADDRNOTAVAIL, MSG_ERRNO_ENETDOWN, 434 MSG_ERRNO_ENETUNREACH, MSG_ERRNO_ENETRESET, 435 MSG_ERRNO_ECONNABORTED, MSG_ERRNO_ECONNRESET, 436 MSG_ERRNO_ENOBUFS, MSG_ERRNO_EISCONN, 437 MSG_ERRNO_ENOTCONN 438 }; 439 static const conv_ds_msg_t ds_errarr_120_134 = { 440 CONV_DS_MSG_INIT(120, errarr_120_134) }; 441 442 static const Msg errarr_143_151[9] = { 443 MSG_ERRNO_ESHUTDOWN, MSG_ERRNO_ETOOMANYREFS, 444 MSG_ERRNO_ETIMEDOUT, MSG_ERRNO_ECONNREFUSED, 445 MSG_ERRNO_EHOSTDOWN, MSG_ERRNO_EHOSTUNREACH, 446 MSG_ERRNO_EALREADY, MSG_ERRNO_EINPROGRESS, 447 MSG_ERRNO_ESTALE 448 }; 449 static const conv_ds_msg_t ds_errarr_143_151 = { 450 CONV_DS_MSG_INIT(143, errarr_143_151) }; 451 452 static const conv_ds_t *ds[] = { CONV_DS_ADDR(ds_errarr_1_74), 453 CONV_DS_ADDR(ds_errarr_77_99), CONV_DS_ADDR(ds_errarr_120_134), 454 CONV_DS_ADDR(ds_errarr_143_151), NULL }; 455 456 457 return (conv_map_ds(ELFOSABI_NONE, EM_NONE, errno_val, ds, fmt_flags, 458 inv_buf)); 459 } 460 461 462 const char * 463 conv_cnote_pr_dmodel(Word dmodel, Conv_fmt_flags_t fmt_flags, 464 Conv_inv_buf_t *inv_buf) 465 { 466 static const Msg models[] = { 467 MSG_PR_MODEL_UNKNOWN, 468 MSG_PR_MODEL_ILP32, 469 MSG_PR_MODEL_LP64 470 }; 471 static const conv_ds_msg_t ds_models = { 472 CONV_DS_MSG_INIT(PR_MODEL_UNKNOWN, models) }; 473 static const conv_ds_t *ds[] = { CONV_DS_ADDR(ds_models), NULL }; 474 475 return (conv_map_ds(ELFOSABI_NONE, EM_NONE, dmodel, ds, fmt_flags, 476 inv_buf)); 477 } 478 479 480 const char * 481 conv_cnote_pr_why(short why, Conv_fmt_flags_t fmt_flags, 482 Conv_inv_buf_t *inv_buf) 483 { 484 static const Msg why_arr[] = { 485 MSG_PR_WHY_REQUESTED, 486 MSG_PR_WHY_SIGNALLED, 487 MSG_PR_WHY_SYSENTRY, 488 MSG_PR_WHY_SYSEXIT, 489 MSG_PR_WHY_JOBCONTROL, 490 MSG_PR_WHY_FAULTED, 491 MSG_PR_WHY_SUSPENDED, 492 MSG_PR_WHY_CHECKPOINT 493 }; 494 static const conv_ds_msg_t ds_why_arr = { 495 CONV_DS_MSG_INIT(1, why_arr) }; 496 static const conv_ds_t *ds[] = { CONV_DS_ADDR(ds_why_arr), NULL }; 497 498 return (conv_map_ds(ELFOSABI_NONE, EM_NONE, why, ds, fmt_flags, 499 inv_buf)); 500 } 501 502 503 const char * 504 conv_cnote_pr_what(short why, short what, Conv_fmt_flags_t fmt_flags, 505 Conv_inv_buf_t *inv_buf) 506 { 507 /* 508 * The meaning of pr_what depends on the corresponding 509 * value of pr_why, as discussed in the proc(4) manpage. 510 */ 511 switch (why) { 512 case PR_SIGNALLED: 513 case PR_JOBCONTROL: 514 return (conv_cnote_signal(what, fmt_flags, inv_buf)); 515 case PR_SYSENTRY: 516 case PR_SYSEXIT: 517 return (conv_cnote_syscall(what, fmt_flags, inv_buf)); 518 case PR_FAULTED: 519 return (conv_cnote_fault(what, fmt_flags, inv_buf)); 520 }; 521 522 return (conv_invalid_val(inv_buf, what, fmt_flags)); 523 } 524 525 526 /* 527 * Return the name of the general purpose register indexed by 528 * regno in the pr_reg array of lwpstatus_t (<sys/procfs.h>). 529 */ 530 const char * 531 conv_cnote_pr_regname(Half mach, int regno, Conv_fmt_flags_t fmt_flags, 532 Conv_inv_buf_t *inv_buf) 533 { 534 static const Msg sparc_gen_reg[32] = { 535 MSG_REG_SPARC_G0, MSG_REG_SPARC_G1, 536 MSG_REG_SPARC_G2, MSG_REG_SPARC_G3, 537 MSG_REG_SPARC_G4, MSG_REG_SPARC_G5, 538 MSG_REG_SPARC_G6, MSG_REG_SPARC_G7, 539 MSG_REG_SPARC_O0, MSG_REG_SPARC_O1, 540 MSG_REG_SPARC_O2, MSG_REG_SPARC_O3, 541 MSG_REG_SPARC_O4, MSG_REG_SPARC_O5, 542 MSG_REG_SPARC_O6, MSG_REG_SPARC_O7, 543 MSG_REG_SPARC_L0, MSG_REG_SPARC_L1, 544 MSG_REG_SPARC_L2, MSG_REG_SPARC_L3, 545 MSG_REG_SPARC_L4, MSG_REG_SPARC_L5, 546 MSG_REG_SPARC_L6, MSG_REG_SPARC_L7, 547 MSG_REG_SPARC_I0, MSG_REG_SPARC_I1, 548 MSG_REG_SPARC_I2, MSG_REG_SPARC_I3, 549 MSG_REG_SPARC_I4, MSG_REG_SPARC_I5, 550 MSG_REG_SPARC_I6, MSG_REG_SPARC_I7 551 }; 552 static const conv_ds_msg_t ds_sparc_gen_reg = { 553 CONV_DS_MSG_INIT(0, sparc_gen_reg) }; 554 555 static const Msg sparc_32_37_reg[6] = { 556 MSG_REG_SPARC_PSR, MSG_REG_SPARC_PC, 557 MSG_REG_SPARC_nPC, MSG_REG_SPARC_Y, 558 MSG_REG_SPARC_WIM, MSG_REG_SPARC_TBR 559 }; 560 static const conv_ds_msg_t ds_sparc_32_37_reg = { 561 CONV_DS_MSG_INIT(32, sparc_32_37_reg) }; 562 563 static const Msg sparcv9_32_37_reg[6] = { 564 MSG_REG_SPARC_CCR, MSG_REG_SPARC_PC, 565 MSG_REG_SPARC_nPC, MSG_REG_SPARC_Y, 566 MSG_REG_SPARC_ASI, MSG_REG_SPARC_FPRS 567 }; 568 static const conv_ds_msg_t ds_sparcv9_32_37_reg = { 569 CONV_DS_MSG_INIT(32, sparcv9_32_37_reg) }; 570 571 static const Msg amd64_reg[28] = { 572 MSG_REG_AMD64_R15, MSG_REG_AMD64_R14, 573 MSG_REG_AMD64_R13, MSG_REG_AMD64_R12, 574 MSG_REG_AMD64_R11, MSG_REG_AMD64_R10, 575 MSG_REG_AMD64_R9, MSG_REG_AMD64_R8, 576 MSG_REG_AMD64_RDI, MSG_REG_AMD64_RSI, 577 MSG_REG_AMD64_RBP, MSG_REG_AMD64_RBX, 578 MSG_REG_AMD64_RDX, MSG_REG_AMD64_RCX, 579 MSG_REG_AMD64_RAX, MSG_REG_AMD64_TRAPNO, 580 MSG_REG_AMD64_ERR, MSG_REG_AMD64_RIP, 581 MSG_REG_AMD64_CS, MSG_REG_AMD64_RFL, 582 MSG_REG_AMD64_RSP, MSG_REG_AMD64_SS, 583 MSG_REG_AMD64_FS, MSG_REG_AMD64_GS, 584 MSG_REG_AMD64_ES, MSG_REG_AMD64_DS, 585 MSG_REG_AMD64_FSBASE, MSG_REG_AMD64_GSBASE 586 }; 587 static const conv_ds_msg_t ds_amd64_reg = { 588 CONV_DS_MSG_INIT(0, amd64_reg) }; 589 590 static const Msg i86_reg[19] = { 591 MSG_REG_I86_GS, MSG_REG_I86_FS, 592 MSG_REG_I86_ES, MSG_REG_I86_DS, 593 MSG_REG_I86_EDI, MSG_REG_I86_ESI, 594 MSG_REG_I86_EBP, MSG_REG_I86_ESP, 595 MSG_REG_I86_EBX, MSG_REG_I86_EDX, 596 MSG_REG_I86_ECX, MSG_REG_I86_EAX, 597 MSG_REG_I86_TRAPNO, MSG_REG_I86_ERR, 598 MSG_REG_I86_EIP, MSG_REG_I86_CS, 599 MSG_REG_I86_EFL, MSG_REG_I86_UESP, 600 MSG_REG_I86_SS 601 }; 602 static const conv_ds_msg_t ds_i86_reg = { 603 CONV_DS_MSG_INIT(0, i86_reg) }; 604 605 606 static const conv_ds_t *ds_sparc[] = { 607 CONV_DS_ADDR(ds_sparc_gen_reg), 608 CONV_DS_ADDR(ds_sparc_32_37_reg), 609 NULL 610 }; 611 static const conv_ds_t *ds_sparcv9[] = { 612 CONV_DS_ADDR(ds_sparc_gen_reg), 613 CONV_DS_ADDR(ds_sparcv9_32_37_reg), 614 NULL 615 }; 616 static const conv_ds_t *ds_amd64[] = { 617 CONV_DS_ADDR(ds_amd64_reg), NULL }; 618 static const conv_ds_t *ds_i86[] = { 619 CONV_DS_ADDR(ds_i86_reg), NULL }; 620 621 const conv_ds_t **ds; 622 623 switch (mach) { 624 case EM_386: 625 ds = ds_i86; 626 break; 627 628 case EM_AMD64: 629 ds = ds_amd64; 630 break; 631 632 case EM_SPARC: 633 case EM_SPARC32PLUS: 634 ds = ds_sparc; 635 break; 636 637 case EM_SPARCV9: 638 ds = ds_sparcv9; 639 break; 640 641 default: 642 return (conv_invalid_val(inv_buf, regno, fmt_flags)); 643 } 644 645 return (conv_map_ds(ELFOSABI_NONE, mach, regno, ds, fmt_flags, 646 inv_buf)); 647 } 648 649 const char * 650 conv_cnote_pr_stype(Word stype, Conv_fmt_flags_t fmt_flags, 651 Conv_inv_buf_t *inv_buf) 652 { 653 static const Msg types[] = { 654 MSG_SOBJ_NONE, MSG_SOBJ_MUTEX, 655 MSG_SOBJ_RWLOCK, MSG_SOBJ_CV, 656 MSG_SOBJ_SEMA, MSG_SOBJ_USER, 657 MSG_SOBJ_USER_PI, MSG_SOBJ_SHUTTLE 658 }; 659 static const conv_ds_msg_t ds_types = { CONV_DS_MSG_INIT(0, types) }; 660 static const conv_ds_t *ds[] = { CONV_DS_ADDR(ds_types), NULL }; 661 662 663 return (conv_map_ds(ELFOSABI_NONE, EM_NONE, stype, ds, fmt_flags, 664 inv_buf)); 665 } 666 667 668 const char * 669 conv_cnote_priv(int priv, Conv_fmt_flags_t fmt_flags, 670 Conv_inv_buf_t *inv_buf) 671 { 672 const char *fmt; 673 674 /* 675 * The PRIV_ constants defined in <sys/priv.h> are unusual 676 * in that they are negative values. The libconv code is all 677 * built around the Word type, which is unsigned. Rather than 678 * modify libconv for this one case, we simply handle 679 * these constants differently that the usual approach, 680 * and stay away from conv_invalid_val() and conv_map_ds(). 681 */ 682 switch (priv) { 683 case PRIV_ALL: 684 return (MSG_ORIG(MSG_PRIV_ALL)); 685 case PRIV_MULTIPLE: 686 return (MSG_ORIG(MSG_PRIV_MULTIPLE)); 687 case PRIV_NONE: 688 return (MSG_ORIG(MSG_PRIV_NONE)); 689 case PRIV_ALLZONE: 690 return (MSG_ORIG(MSG_PRIV_ALLZONE)); 691 case PRIV_GLOBAL: 692 return (MSG_ORIG(MSG_PRIV_GLOBAL)); 693 } 694 695 fmt = (fmt_flags & CONV_FMT_DECIMAL) ? 696 MSG_ORIG(MSG_FMT_INT) : MSG_ORIG(MSG_FMT_HEXINT); 697 (void) snprintf(inv_buf->buf, sizeof (inv_buf->buf), fmt, priv); 698 return (inv_buf->buf); 699 } 700 701 702 const char * 703 conv_cnote_psetid(int id, Conv_fmt_flags_t fmt_flags, 704 Conv_inv_buf_t *inv_buf) 705 { 706 const char *fmt; 707 708 /* 709 * The PS_ constants defined in <sys/pset.h> are unusual 710 * in that they are negative values. The libconv code is all 711 * built around the Word type, which is unsigned. Rather than 712 * modify libconv for this one case, we simply handle 713 * these constants differently that the usual approach, 714 * and stay away from conv_invalid_val() and conv_map_ds(). 715 */ 716 switch (id) { 717 case PS_NONE: 718 return (MSG_ORIG(MSG_PS_NONE)); 719 case PS_QUERY: 720 return (MSG_ORIG(MSG_PS_QUERY)); 721 case PS_MYID: 722 return (MSG_ORIG(MSG_PS_MYID)); 723 case PS_SOFT: 724 return (MSG_ORIG(MSG_PS_SOFT)); 725 case PS_HARD: 726 return (MSG_ORIG(MSG_PS_HARD)); 727 case PS_QUERY_TYPE: 728 return (MSG_ORIG(MSG_PS_QUERY_TYPE)); 729 } 730 731 fmt = (fmt_flags & CONV_FMT_DECIMAL) ? 732 MSG_ORIG(MSG_FMT_INT) : MSG_ORIG(MSG_FMT_HEXINT); 733 (void) snprintf(inv_buf->buf, sizeof (inv_buf->buf), fmt, id); 734 return (inv_buf->buf); 735 } 736 737 738 /* 739 * Return a string describing the si_code field of 740 * the siginfo_t struct. 741 * 742 * The meaning of si_code is dependent on both the target 743 * machine (mach) as well as the signal (sig). 744 */ 745 const char * 746 conv_cnote_si_code(Half mach, int sig, int si_code, 747 Conv_fmt_flags_t fmt_flags, Conv_inv_buf_t *inv_buf) 748 { 749 750 /* Values of si_code for user generated signals */ 751 static const Msg user_arr[6] = { 752 MSG_SI_USER, MSG_SI_LWP, 753 MSG_SI_QUEUE, MSG_SI_TIMER, 754 MSG_SI_ASYNCIO, MSG_SI_MESGQ 755 }; 756 static const conv_ds_msg_t ds_msg_user_arr = { 757 CONV_DS_MSG_INIT(0, user_arr) }; 758 static const conv_ds_t *ds_user_arr[] = { 759 CONV_DS_ADDR(ds_msg_user_arr), NULL }; 760 761 762 /* 763 * Architecture dependent system generated signals. All 764 * versions of Solaris use the same set of these values. 765 */ 766 static const Msg trap_arr[6] = { 767 MSG_SI_TRAP_BRKPT, MSG_SI_TRAP_TRACE, 768 MSG_SI_TRAP_RWATCH, MSG_SI_TRAP_WWATCH, 769 MSG_SI_TRAP_XWATCH, MSG_SI_TRAP_DTRACE 770 }; 771 static const conv_ds_msg_t ds_msg_trap_arr = { 772 CONV_DS_MSG_INIT(1, trap_arr) }; 773 static const conv_ds_t *ds_trap_arr[] = { 774 CONV_DS_ADDR(ds_msg_trap_arr), NULL }; 775 776 static const Msg cld_arr[6] = { 777 MSG_SI_CLD_EXITED, MSG_SI_CLD_KILLED, 778 MSG_SI_CLD_DUMPED, MSG_SI_CLD_TRAPPED, 779 MSG_SI_CLD_STOPPED, MSG_SI_CLD_CONTINUED 780 }; 781 static const conv_ds_msg_t ds_msg_cld_arr = { 782 CONV_DS_MSG_INIT(1, cld_arr) }; 783 static const conv_ds_t *ds_cld_arr[] = { 784 CONV_DS_ADDR(ds_msg_cld_arr), NULL }; 785 786 static const Msg poll_arr[6] = { 787 MSG_SI_POLL_IN, MSG_SI_POLL_OUT, 788 MSG_SI_POLL_MSG, MSG_SI_POLL_ERR, 789 MSG_SI_POLL_PRI, MSG_SI_POLL_HUP 790 }; 791 static const conv_ds_msg_t ds_msg_poll_arr = { 792 CONV_DS_MSG_INIT(1, poll_arr) }; 793 static const conv_ds_t *ds_poll_arr[] = { 794 CONV_DS_ADDR(ds_msg_poll_arr), NULL }; 795 796 /* 797 * Architecture dependent system generated signals. 798 * These items (ILL, EMT, FPE, SEGV, BUS) are platform 799 * dependent. Some architectures have extra codes. 800 * The same name may have a different integer value. 801 * Multiple arrays are used when they differ, and one 802 * array when all the architectures agree. 803 */ 804 805 /* ILL */ 806 static const Msg ill_arr[8] = { 807 MSG_SI_ILL_ILLOPC, MSG_SI_ILL_ILLOPN, 808 MSG_SI_ILL_ILLADR, MSG_SI_ILL_ILLTRP, 809 MSG_SI_ILL_PRVOPC, MSG_SI_ILL_PRVREG, 810 MSG_SI_ILL_COPROC, MSG_SI_ILL_BADSTK 811 }; 812 static const conv_ds_msg_t ds_msg_ill_arr = { 813 CONV_DS_MSG_INIT(1, ill_arr) }; 814 static const conv_ds_t *ds_ill_arr[] = { 815 CONV_DS_ADDR(ds_msg_ill_arr), NULL }; 816 817 /* EMT */ 818 static const Msg emt_arr_sparc[2] = { 819 MSG_SI_EMT_TAGOVF, MSG_SI_EMT_CPCOVF 820 }; 821 static const conv_ds_msg_t ds_msg_emt_arr_sparc = { 822 CONV_DS_MSG_INIT(1, emt_arr_sparc) }; 823 static const conv_ds_t *ds_emt_arr_sparc[] = { 824 CONV_DS_ADDR(ds_msg_emt_arr_sparc), NULL }; 825 826 static const Msg emt_arr_x86[1] = { 827 MSG_SI_EMT_CPCOVF 828 }; 829 static const conv_ds_msg_t ds_msg_emt_arr_x86 = { 830 CONV_DS_MSG_INIT(1, emt_arr_x86) }; 831 static const conv_ds_t *ds_emt_arr_x86[] = { 832 CONV_DS_ADDR(ds_msg_emt_arr_x86), NULL }; 833 834 835 /* FPE */ 836 static const Msg fpe_arr_sparc[8] = { 837 MSG_SI_FPE_INTDIV, MSG_SI_FPE_INTOVF, 838 MSG_SI_FPE_FLTDIV, MSG_SI_FPE_FLTOVF, 839 MSG_SI_FPE_FLTUND, MSG_SI_FPE_FLTRES, 840 MSG_SI_FPE_FLTINV, MSG_SI_FPE_FLTSUB 841 }; 842 static const conv_ds_msg_t ds_msg_fpe_arr_sparc = { 843 CONV_DS_MSG_INIT(1, fpe_arr_sparc) }; 844 static const conv_ds_t *ds_fpe_arr_sparc[] = { 845 CONV_DS_ADDR(ds_msg_fpe_arr_sparc), NULL }; 846 847 static const Msg fpe_arr_x86[9] = { 848 MSG_SI_FPE_INTDIV, MSG_SI_FPE_INTOVF, 849 MSG_SI_FPE_FLTDIV, MSG_SI_FPE_FLTOVF, 850 MSG_SI_FPE_FLTUND, MSG_SI_FPE_FLTRES, 851 MSG_SI_FPE_FLTINV, MSG_SI_FPE_FLTSUB, 852 MSG_SI_FPE_FLTDEN 853 }; 854 static const conv_ds_msg_t ds_msg_fpe_arr_x86 = { 855 CONV_DS_MSG_INIT(1, fpe_arr_x86) }; 856 static const conv_ds_t *ds_fpe_arr_x86[] = { 857 CONV_DS_ADDR(ds_msg_fpe_arr_x86), NULL }; 858 859 /* SEGV */ 860 static const Msg segv_arr[2] = { 861 MSG_SI_SEGV_MAPERR, MSG_SI_SEGV_ACCERR 862 }; 863 static const conv_ds_msg_t ds_msg_segv_arr = { 864 CONV_DS_MSG_INIT(1, segv_arr) }; 865 static const conv_ds_t *ds_segv_arr[] = { 866 CONV_DS_ADDR(ds_msg_segv_arr), NULL }; 867 868 /* BUS */ 869 static const Msg bus_arr[3] = { 870 MSG_SI_BUS_ADRALN, MSG_SI_BUS_ADRERR, 871 MSG_SI_BUS_OBJERR 872 }; 873 static const conv_ds_msg_t ds_msg_bus_arr = { 874 CONV_DS_MSG_INIT(1, bus_arr) }; 875 static const conv_ds_t *ds_bus_arr[] = { 876 CONV_DS_ADDR(ds_msg_bus_arr), NULL }; 877 878 enum { ARCH_NONE, ARCH_X86, ARCH_SPARC } arch; 879 880 881 /* Handle the si_code values that do not depend on the signal */ 882 switch (si_code) { 883 case SI_NOINFO: 884 return (MSG_ORIG(MSG_SI_NOINFO)); 885 case SI_DTRACE: 886 return (MSG_ORIG(MSG_SI_DTRACE)); 887 case SI_RCTL: 888 return (MSG_ORIG(MSG_SI_RCTL)); 889 default: 890 /* User generated signal codes are <= 0 */ 891 if (si_code <= 0) { 892 int ndx = -si_code; 893 894 /* 895 * If no signal was delivered, and si_code is 896 * 0, return "0" rather than "SI_USER". 897 */ 898 if ((si_code == 0) && (sig == 0)) 899 return (MSG_ORIG(MSG_GBL_ZERO)); 900 901 if (ndx >= ARRAY_NELTS(user_arr)) { 902 const char *fmt; 903 904 fmt = (fmt_flags & CONV_FMT_DECIMAL) ? 905 MSG_ORIG(MSG_FMT_INT) : 906 MSG_ORIG(MSG_FMT_HEXINT); 907 908 (void) snprintf(inv_buf->buf, 909 sizeof (inv_buf->buf), fmt, si_code); 910 return (inv_buf->buf); 911 } 912 return (conv_map_ds(ELFOSABI_NONE, EM_NONE, ndx, 913 ds_user_arr, fmt_flags, inv_buf)); 914 } 915 } 916 917 /* 918 * If we didn't return above, then this is a 919 * system generated signal, and the meaning of si_code 920 * depends on the signal that was delivered, and possibly 921 * on the target architecture. 922 */ 923 switch (mach) { 924 case EM_386: 925 case EM_AMD64: 926 arch = ARCH_X86; 927 break; 928 929 case EM_SPARC: 930 case EM_SPARC32PLUS: 931 case EM_SPARCV9: 932 arch = ARCH_X86; 933 break; 934 935 default: 936 arch = ARCH_NONE; 937 break; 938 } 939 940 switch (sig) { 941 case SIGTRAP: 942 return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code, 943 ds_trap_arr, fmt_flags, inv_buf)); 944 945 case SIGCLD: 946 return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code, 947 ds_cld_arr, fmt_flags, inv_buf)); 948 949 case SIGPOLL: 950 return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code, 951 ds_poll_arr, fmt_flags, inv_buf)); 952 953 case SIGILL: 954 return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code, 955 ds_ill_arr, fmt_flags, inv_buf)); 956 957 case SIGEMT: 958 switch (arch) { 959 case ARCH_SPARC: 960 return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code, 961 ds_emt_arr_sparc, fmt_flags, inv_buf)); 962 case ARCH_X86: 963 return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code, 964 ds_emt_arr_x86, fmt_flags, inv_buf)); 965 } 966 break; 967 968 case SIGFPE: 969 switch (arch) { 970 case ARCH_SPARC: 971 return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code, 972 ds_fpe_arr_sparc, fmt_flags, inv_buf)); 973 case ARCH_X86: 974 return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code, 975 ds_fpe_arr_x86, fmt_flags, inv_buf)); 976 } 977 break; 978 979 case SIGSEGV: 980 return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code, 981 ds_segv_arr, fmt_flags, inv_buf)); 982 983 case SIGBUS: 984 return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code, 985 ds_bus_arr, fmt_flags, inv_buf)); 986 } 987 988 /* If not recognized, format as a number */ 989 return (conv_invalid_val(inv_buf, si_code, fmt_flags)); 990 991 } 992 993 994 #define AUXAFFLGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \ 995 MSG_AUXV_AF_SUN_SETUGID_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 996 MSG_AUXV_AF_SUN_HWCAPVERIFY_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 997 MSG_AUXV_AF_SUN_NOPLM_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 998 CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE 999 1000 /* 1001 * Ensure that Conv_cnote_auxv_af_buf_t is large enough: 1002 * 1003 * AUXAFFLGSZ is the real minimum size of the buffer required by 1004 * conv_cnote_auxv_af(). However, Conv_cnote_auxv_af_buf_t 1005 * uses CONV_CNOTE_AUXV_AF_BUFSIZE to set the buffer size. We do 1006 * things this way because the definition of AUXAFFLGSZ uses information 1007 * that is not available in the environment of other programs 1008 * that include the conv.h header file. 1009 */ 1010 #if (CONV_CNOTE_AUXV_AF_BUFSIZE != AUXAFFLGSZ) && !defined(__lint) 1011 #define REPORT_BUFSIZE AUXAFFLGSZ 1012 #include "report_bufsize.h" 1013 #error "CONV_CNOTE_AUXV_AF_BUFSIZE does not match AUXAFFLGSZ" 1014 #endif 1015 1016 const char * 1017 conv_cnote_auxv_af(Word flags, Conv_fmt_flags_t fmt_flags, 1018 Conv_cnote_auxv_af_buf_t *cnote_auxv_af_buf) 1019 { 1020 static const Val_desc vda[] = { 1021 { AF_SUN_SETUGID, MSG_AUXV_AF_SUN_SETUGID }, 1022 { AF_SUN_HWCAPVERIFY, MSG_AUXV_AF_SUN_HWCAPVERIFY }, 1023 { AF_SUN_NOPLM, MSG_AUXV_AF_SUN_NOPLM }, 1024 { 0, 0 } 1025 }; 1026 static CONV_EXPN_FIELD_ARG conv_arg = { 1027 NULL, sizeof (cnote_auxv_af_buf->buf) }; 1028 1029 if (flags == 0) 1030 return (MSG_ORIG(MSG_GBL_ZERO)); 1031 1032 conv_arg.buf = cnote_auxv_af_buf->buf; 1033 conv_arg.oflags = conv_arg.rflags = flags; 1034 (void) conv_expn_field(&conv_arg, vda, fmt_flags); 1035 1036 return ((const char *)cnote_auxv_af_buf->buf); 1037 } 1038 1039 1040 #define CCFLGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \ 1041 MSG_CC_CONTENT_STACK_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1042 MSG_CC_CONTENT_HEAP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1043 MSG_CC_CONTENT_SHFILE_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1044 MSG_CC_CONTENT_SHANON_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1045 MSG_CC_CONTENT_TEXT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1046 MSG_CC_CONTENT_DATA_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1047 MSG_CC_CONTENT_RODATA_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1048 MSG_CC_CONTENT_ANON_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1049 MSG_CC_CONTENT_SHM_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1050 MSG_CC_CONTENT_ISM_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1051 MSG_CC_CONTENT_DISM_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1052 MSG_CC_CONTENT_CTF_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1053 MSG_CC_CONTENT_SYMTAB_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1054 CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE 1055 1056 /* 1057 * Ensure that Conv_cnote_cc_content_buf_t is large enough: 1058 * 1059 * CCFLGSZ is the real minimum size of the buffer required by 1060 * conv_cnote_cc_content(). However, Conv_cnote_cc_content_buf_t 1061 * uses CONV_CNOTE_CC_CONTENT_BUFSIZE to set the buffer size. We do 1062 * things this way because the definition of CCFLGSZ uses information 1063 * that is not available in the environment of other programs 1064 * that include the conv.h header file. 1065 */ 1066 #if (CONV_CNOTE_CC_CONTENT_BUFSIZE != CCFLGSZ) && !defined(__lint) 1067 #define REPORT_BUFSIZE CCFLGSZ 1068 #include "report_bufsize.h" 1069 #error "CONV_CNOTE_CC_CONTENT_BUFSIZE does not match CCFLGSZ" 1070 #endif 1071 1072 const char * 1073 conv_cnote_cc_content(Lword flags, Conv_fmt_flags_t fmt_flags, 1074 Conv_cnote_cc_content_buf_t *cnote_cc_content_buf) 1075 { 1076 /* 1077 * Note: core_content_t is a 64-bit integer value, but our 1078 * conv_expn_field() logic is all built around 32-bit 1079 * Word values. This will probably need changing someday, 1080 * but for now, we make do with the 32-bit engine. This works 1081 * because the number of bits actually assigned in 1082 * the core_content_t data type (<sys/corectl.h>) bits within 1083 * 32-bits. 1084 * 1085 * The downside is that any bits set in the upper half of 1086 * the flags will be ignored. At the time of this writing, 1087 * that can only occur via core file corruption, which presumably 1088 * would be evident in other ways. 1089 */ 1090 static const Val_desc vda[] = { 1091 { (Word) CC_CONTENT_STACK, MSG_CC_CONTENT_STACK }, 1092 { (Word) CC_CONTENT_HEAP, MSG_CC_CONTENT_HEAP }, 1093 { (Word) CC_CONTENT_SHFILE, MSG_CC_CONTENT_SHFILE }, 1094 { (Word) CC_CONTENT_SHANON, MSG_CC_CONTENT_SHANON }, 1095 { (Word) CC_CONTENT_TEXT, MSG_CC_CONTENT_TEXT }, 1096 { (Word) CC_CONTENT_DATA, MSG_CC_CONTENT_DATA }, 1097 { (Word) CC_CONTENT_RODATA, MSG_CC_CONTENT_RODATA }, 1098 { (Word) CC_CONTENT_ANON, MSG_CC_CONTENT_ANON }, 1099 { (Word) CC_CONTENT_SHM, MSG_CC_CONTENT_SHM }, 1100 { (Word) CC_CONTENT_ISM, MSG_CC_CONTENT_ISM }, 1101 { (Word) CC_CONTENT_DISM, MSG_CC_CONTENT_DISM }, 1102 { (Word) CC_CONTENT_CTF, MSG_CC_CONTENT_CTF }, 1103 { (Word) CC_CONTENT_SYMTAB, MSG_CC_CONTENT_SYMTAB }, 1104 { 0, 0 } 1105 }; 1106 static CONV_EXPN_FIELD_ARG conv_arg = { 1107 NULL, sizeof (cnote_cc_content_buf->buf) }; 1108 1109 if (flags == 0) 1110 return (MSG_ORIG(MSG_GBL_ZERO)); 1111 1112 conv_arg.buf = cnote_cc_content_buf->buf; 1113 conv_arg.oflags = conv_arg.rflags = flags; 1114 (void) conv_expn_field(&conv_arg, vda, fmt_flags); 1115 1116 return ((const char *)cnote_cc_content_buf->buf); 1117 } 1118 1119 1120 #define PRFLGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \ 1121 MSG_PR_FLAGS_STOPPED_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1122 MSG_PR_FLAGS_ISTOP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1123 MSG_PR_FLAGS_DSTOP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1124 MSG_PR_FLAGS_STEP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1125 MSG_PR_FLAGS_ASLEEP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1126 MSG_PR_FLAGS_PCINVAL_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1127 MSG_PR_FLAGS_ASLWP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1128 MSG_PR_FLAGS_AGENT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1129 MSG_PR_FLAGS_DETACH_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1130 MSG_PR_FLAGS_DAEMON_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1131 MSG_PR_FLAGS_IDLE_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1132 MSG_PR_FLAGS_ISSYS_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1133 MSG_PR_FLAGS_VFORKP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1134 MSG_PR_FLAGS_ORPHAN_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1135 MSG_PR_FLAGS_NOSIGCHLD_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1136 MSG_PR_FLAGS_WAITPID_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1137 MSG_PR_FLAGS_FORK_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1138 MSG_PR_FLAGS_RLC_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1139 MSG_PR_FLAGS_KLC_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1140 MSG_PR_FLAGS_ASYNC_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1141 MSG_PR_FLAGS_MSACCT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1142 MSG_PR_FLAGS_BPTADJ_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1143 MSG_PR_FLAGS_PTRACE_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1144 MSG_PR_FLAGS_MSFORK_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1145 CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE 1146 1147 /* 1148 * Ensure that Conv_cnote_pr_flags_buf_t is large enough: 1149 * 1150 * PRFLGSZ is the real minimum size of the buffer required by 1151 * conv_cnote_pr_flags(). However, Conv_cnote_pr_flags_buf_t 1152 * uses CONV_CNOTE_PR_FLAGS_BUFSIZE to set the buffer size. We do 1153 * things this way because the definition of PRFLGSZ uses information 1154 * that is not available in the environment of other programs 1155 * that include the conv.h header file. 1156 */ 1157 #if (CONV_CNOTE_PR_FLAGS_BUFSIZE != PRFLGSZ) && !defined(__lint) 1158 #define REPORT_BUFSIZE PRFLGSZ 1159 #include "report_bufsize.h" 1160 #error "CONV_CNOTE_PR_FLAGS_BUFSIZE does not match PRFLGSZ" 1161 #endif 1162 1163 const char * 1164 conv_cnote_pr_flags(int flags, Conv_fmt_flags_t fmt_flags, 1165 Conv_cnote_pr_flags_buf_t *cnote_pr_flags_buf) 1166 { 1167 static const Val_desc vda[] = { 1168 { PR_STOPPED, MSG_PR_FLAGS_STOPPED }, 1169 { PR_ISTOP, MSG_PR_FLAGS_ISTOP }, 1170 { PR_DSTOP, MSG_PR_FLAGS_DSTOP }, 1171 { PR_STEP, MSG_PR_FLAGS_STEP }, 1172 { PR_ASLEEP, MSG_PR_FLAGS_ASLEEP }, 1173 { PR_PCINVAL, MSG_PR_FLAGS_PCINVAL }, 1174 { PR_ASLWP, MSG_PR_FLAGS_ASLWP }, 1175 { PR_AGENT, MSG_PR_FLAGS_AGENT }, 1176 { PR_DETACH, MSG_PR_FLAGS_DETACH }, 1177 { PR_DAEMON, MSG_PR_FLAGS_DAEMON }, 1178 { PR_IDLE, MSG_PR_FLAGS_IDLE }, 1179 { PR_ISSYS, MSG_PR_FLAGS_ISSYS }, 1180 { PR_VFORKP, MSG_PR_FLAGS_VFORKP }, 1181 { PR_ORPHAN, MSG_PR_FLAGS_ORPHAN }, 1182 { PR_NOSIGCHLD, MSG_PR_FLAGS_NOSIGCHLD }, 1183 { PR_WAITPID, MSG_PR_FLAGS_WAITPID }, 1184 { PR_FORK, MSG_PR_FLAGS_FORK }, 1185 { PR_RLC, MSG_PR_FLAGS_RLC }, 1186 { PR_KLC, MSG_PR_FLAGS_KLC }, 1187 { PR_ASYNC, MSG_PR_FLAGS_ASYNC }, 1188 { PR_MSACCT, MSG_PR_FLAGS_MSACCT }, 1189 { PR_BPTADJ, MSG_PR_FLAGS_BPTADJ }, 1190 { PR_PTRACE, MSG_PR_FLAGS_PTRACE }, 1191 { PR_MSFORK, MSG_PR_FLAGS_MSFORK }, 1192 { 0, 0 } 1193 }; 1194 static CONV_EXPN_FIELD_ARG conv_arg = { 1195 NULL, sizeof (cnote_pr_flags_buf->buf) }; 1196 1197 if (flags == 0) 1198 return (MSG_ORIG(MSG_GBL_ZERO)); 1199 1200 conv_arg.buf = cnote_pr_flags_buf->buf; 1201 conv_arg.oflags = conv_arg.rflags = flags; 1202 (void) conv_expn_field(&conv_arg, vda, fmt_flags); 1203 1204 return ((const char *)cnote_pr_flags_buf->buf); 1205 } 1206 1207 1208 #define OLDPRFLGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \ 1209 MSG_PR_FLAGS_STOPPED_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1210 MSG_PR_FLAGS_ISTOP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1211 MSG_PR_FLAGS_DSTOP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1212 MSG_PR_FLAGS_ASLEEP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1213 MSG_PR_FLAGS_FORK_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1214 MSG_PR_FLAGS_RLC_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1215 MSG_PR_FLAGS_PTRACE_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1216 MSG_PR_FLAGS_PCINVAL_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1217 MSG_PR_FLAGS_ISSYS_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1218 MSG_PR_FLAGS_STEP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1219 MSG_PR_FLAGS_KLC_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1220 MSG_PR_FLAGS_ASYNC_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1221 MSG_PR_FLAGS_PCOMPAT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1222 MSG_PR_FLAGS_MSACCT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1223 MSG_PR_FLAGS_BPTADJ_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1224 MSG_PR_FLAGS_ASLWP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1225 CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE 1226 1227 /* 1228 * Ensure that Conv_cnote_old_pr_flags_buf_t is large enough: 1229 * 1230 * OLDPRFLGSZ is the real minimum size of the buffer required by 1231 * conv_cnote_old_pr_flags(). However, Conv_cnote_old_pr_flags_buf_t 1232 * uses CONV_CNOTE_OLD_PR_FLAGS_BUFSIZE to set the buffer size. We do 1233 * things this way because the definition of OLDPRFLGSZ uses information 1234 * that is not available in the environment of other programs 1235 * that include the conv.h header file. 1236 */ 1237 #if (CONV_CNOTE_OLD_PR_FLAGS_BUFSIZE != OLDPRFLGSZ) && !defined(__lint) 1238 #define REPORT_BUFSIZE OLDPRFLGSZ 1239 #include "report_bufsize.h" 1240 #error "CONV_CNOTE_OLD_PR_FLAGS_BUFSIZE does not match OLDPRFLGSZ" 1241 #endif 1242 1243 const char * 1244 conv_cnote_old_pr_flags(int flags, Conv_fmt_flags_t fmt_flags, 1245 Conv_cnote_old_pr_flags_buf_t *cnote_old_pr_flags_buf) 1246 { 1247 /* 1248 * <sys/old_procfs.h> defines names for many of these flags 1249 * that are also defined in <sys/procfs.h>, but with different 1250 * values. To avoid confusion, we don't include <sys/old_procfs.h>, 1251 * and specify the values directly. 1252 */ 1253 static const Val_desc vda[] = { 1254 { 0x0001, MSG_PR_FLAGS_STOPPED }, 1255 { 0x0002, MSG_PR_FLAGS_ISTOP }, 1256 { 0x0004, MSG_PR_FLAGS_DSTOP }, 1257 { 0x0008, MSG_PR_FLAGS_ASLEEP }, 1258 { 0x0010, MSG_PR_FLAGS_FORK }, 1259 { 0x0020, MSG_PR_FLAGS_RLC }, 1260 { 0x0040, MSG_PR_FLAGS_PTRACE }, 1261 { 0x0080, MSG_PR_FLAGS_PCINVAL }, 1262 { 0x0100, MSG_PR_FLAGS_ISSYS }, 1263 { 0x0200, MSG_PR_FLAGS_STEP }, 1264 { 0x0400, MSG_PR_FLAGS_KLC }, 1265 { 0x0800, MSG_PR_FLAGS_ASYNC }, 1266 { 0x1000, MSG_PR_FLAGS_PCOMPAT }, 1267 { 0x2000, MSG_PR_FLAGS_MSACCT }, 1268 { 0x4000, MSG_PR_FLAGS_BPTADJ }, 1269 { 0x8000, MSG_PR_FLAGS_ASLWP }, 1270 { 0, 0 } 1271 }; 1272 static CONV_EXPN_FIELD_ARG conv_arg = { 1273 NULL, sizeof (cnote_old_pr_flags_buf->buf) }; 1274 1275 if (flags == 0) 1276 return (MSG_ORIG(MSG_GBL_ZERO)); 1277 1278 conv_arg.buf = cnote_old_pr_flags_buf->buf; 1279 conv_arg.oflags = conv_arg.rflags = flags; 1280 (void) conv_expn_field(&conv_arg, vda, fmt_flags); 1281 1282 return ((const char *)cnote_old_pr_flags_buf->buf); 1283 } 1284 1285 1286 #define PROCFLGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \ 1287 MSG_PROC_FLAG_SSYS_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1288 MSG_PROC_FLAG_SMSACCT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1289 CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE 1290 1291 /* 1292 * Ensure that Conv_cnote_proc_flag_buf_t is large enough: 1293 * 1294 * PROCFLGSZ is the real minimum size of the buffer required by 1295 * conv_cnote_proc_flag(). However, Conv_cnote_proc_flag_buf_t 1296 * uses CONV_CNOTE_PROC_FLAG_BUFSIZE to set the buffer size. We do 1297 * things this way because the definition of PROCFLGSZ uses information 1298 * that is not available in the environment of other programs 1299 * that include the conv.h header file. 1300 */ 1301 #if (CONV_CNOTE_PROC_FLAG_BUFSIZE != PROCFLGSZ) && !defined(__lint) 1302 #define REPORT_BUFSIZE PROCFLGSZ 1303 #include "report_bufsize.h" 1304 #error "CONV_CNOTE_PROC_FLAG_BUFSIZE does not match PROCFLGSZ" 1305 #endif 1306 1307 const char * 1308 conv_cnote_proc_flag(int flags, Conv_fmt_flags_t fmt_flags, 1309 Conv_cnote_proc_flag_buf_t *cnote_proc_flag_buf) 1310 { 1311 /* 1312 * Most of the proc flags are implementation dependant, and can 1313 * change between releases. As such, we do not attempt to translate 1314 * them to symbolic form, but simply report them in hex form. 1315 * However, SMSACCT and SSYS are special, and their bit values 1316 * are maintained between releases so they can be used in the 1317 * psinfo_t.p_flag field. We therefore translate these items. 1318 * 1319 * See <system/proc.h> 1320 * 1321 * Note: We don't want to include <sys/proc.h> in this file, because 1322 * it redefines 'struct list', which we have defined in sgs.h. As 1323 * SMSACCT and SSYS are stable public values, we simply use 1324 * their numeric value. 1325 */ 1326 static const Val_desc vda[] = { 1327 { 0x00000001, MSG_PROC_FLAG_SSYS }, 1328 { 0x02000000, MSG_PROC_FLAG_SMSACCT }, 1329 { 0, 0 } 1330 }; 1331 static CONV_EXPN_FIELD_ARG conv_arg = { 1332 NULL, sizeof (cnote_proc_flag_buf->buf) }; 1333 1334 if (flags == 0) 1335 return (MSG_ORIG(MSG_GBL_ZERO)); 1336 1337 conv_arg.buf = cnote_proc_flag_buf->buf; 1338 conv_arg.oflags = conv_arg.rflags = flags; 1339 (void) conv_expn_field(&conv_arg, vda, fmt_flags); 1340 1341 return ((const char *)cnote_proc_flag_buf->buf); 1342 } 1343 1344 1345 #define SAFLGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \ 1346 MSG_SA_ONSTACK_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1347 MSG_SA_RESETHAND_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1348 MSG_SA_RESTART_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1349 MSG_SA_SIGINFO_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1350 MSG_SA_NODEFER_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1351 MSG_SA_NOCLDWAIT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1352 MSG_SA_NOCLDSTOP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1353 CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE 1354 1355 /* 1356 * Ensure that Conv_cnote_sa_flags_buf_t is large enough: 1357 * 1358 * SAFLGSZ is the real minimum size of the buffer required by 1359 * conv_cnote_sa_flags(). However, Conv_cnote_sa_flags_buf_t 1360 * uses CONV_CNOTE_SA_FLAGS_BUFSIZE to set the buffer size. We do 1361 * things this way because the definition of SAFLGSZ uses information 1362 * that is not available in the environment of other programs 1363 * that include the conv.h header file. 1364 */ 1365 #if (CONV_CNOTE_SA_FLAGS_BUFSIZE != SAFLGSZ) && !defined(__lint) 1366 #define REPORT_BUFSIZE SAFLGSZ 1367 #include "report_bufsize.h" 1368 #error "CONV_CNOTE_SA_FLAGS_BUFSIZE does not match SAFLGSZ" 1369 #endif 1370 1371 const char * 1372 conv_cnote_sa_flags(int flags, Conv_fmt_flags_t fmt_flags, 1373 Conv_cnote_sa_flags_buf_t *cnote_sa_flags_buf) 1374 { 1375 static const Val_desc vda[] = { 1376 { SA_ONSTACK, MSG_SA_ONSTACK }, 1377 { SA_RESETHAND, MSG_SA_RESETHAND }, 1378 { SA_RESTART, MSG_SA_RESTART }, 1379 { SA_SIGINFO, MSG_SA_SIGINFO }, 1380 { SA_NODEFER, MSG_SA_NODEFER }, 1381 { SA_NOCLDWAIT, MSG_SA_NOCLDWAIT }, 1382 { SA_NOCLDSTOP, MSG_SA_NOCLDSTOP }, 1383 { 0, 0 } 1384 }; 1385 static CONV_EXPN_FIELD_ARG conv_arg = { 1386 NULL, sizeof (cnote_sa_flags_buf->buf) }; 1387 1388 if (flags == 0) 1389 return (MSG_ORIG(MSG_GBL_ZERO)); 1390 1391 conv_arg.buf = cnote_sa_flags_buf->buf; 1392 conv_arg.oflags = conv_arg.rflags = flags; 1393 (void) conv_expn_field(&conv_arg, vda, fmt_flags); 1394 1395 return ((const char *)cnote_sa_flags_buf->buf); 1396 } 1397 1398 1399 #define SSFLGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \ 1400 MSG_SS_ONSTACK_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1401 MSG_SS_DISABLE_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1402 CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE 1403 1404 /* 1405 * Ensure that Conv_cnote_ss_flags_buf_t is large enough: 1406 * 1407 * SSFLGSZ is the real minimum size of the buffer required by 1408 * conv_cnote_ss_flags(). However, Conv_cnote_ss_flags_buf_t 1409 * uses CONV_CNOTE_SS_FLAGS_BUFSIZE to set the buffer size. We do 1410 * things this way because the definition of SSFLGSZ uses information 1411 * that is not available in the environment of other programs 1412 * that include the conv.h header file. 1413 */ 1414 #if (CONV_CNOTE_SS_FLAGS_BUFSIZE != SSFLGSZ) && !defined(__lint) 1415 #define REPORT_BUFSIZE SSFLGSZ 1416 #include "report_bufsize.h" 1417 #error "CONV_CNOTE_SS_FLAGS_BUFSIZE does not match SSFLGSZ" 1418 #endif 1419 1420 const char * 1421 conv_cnote_ss_flags(int flags, Conv_fmt_flags_t fmt_flags, 1422 Conv_cnote_ss_flags_buf_t *cnote_ss_flags_buf) 1423 { 1424 static const Val_desc vda[] = { 1425 { SS_ONSTACK, MSG_SS_ONSTACK }, 1426 { SS_DISABLE, MSG_SS_DISABLE }, 1427 { 0, 0 } 1428 }; 1429 static CONV_EXPN_FIELD_ARG conv_arg = { 1430 NULL, sizeof (cnote_ss_flags_buf->buf) }; 1431 1432 if (flags == 0) 1433 return (MSG_ORIG(MSG_GBL_ZERO)); 1434 1435 conv_arg.buf = cnote_ss_flags_buf->buf; 1436 conv_arg.oflags = conv_arg.rflags = flags; 1437 (void) conv_expn_field(&conv_arg, vda, fmt_flags); 1438 1439 return ((const char *)cnote_ss_flags_buf->buf); 1440 } 1441 1442 1443 /* 1444 * Solaris has a variety of types that use bitmasks to represent 1445 * sets of things like signals (sigset_t), faults (fltset_t), and 1446 * system calls (sysset_t). These types use arrays of unsigned 32-bit 1447 * integers to represent the set. These are public types that 1448 * cannot be changed, so they are generously oversized to allow 1449 * for future growth. Hence, there are usually unused bits. 1450 * 1451 * conv_bitmaskset() generalizes the process of displaying these items. 1452 */ 1453 1454 typedef struct { 1455 const Val_desc *vdp; /* NULL, or bitmask description */ 1456 uint32_t unused_bits; /* Mask of undefined bits */ 1457 } conv_bitmaskset_desc_t; 1458 1459 /* 1460 * entry: 1461 * n_mask - # of 32-bit masks that make up this bitmask type. 1462 * maskarr - Array of n_mask 32-bit mask values 1463 * bitmask_descarr - Array of n_mask bitmask_desc_t descriptors, 1464 * one for each mask, specifying the bitmask names, and 1465 * a mask of the bits that are not defined by the system. 1466 * fmt_flags - CONV_FMT_* values, used to specify formatting details. 1467 * conv_buf - Buffer to receive formatted results 1468 * conv_buf_size - Size of conv_buf, including room for NULL termination 1469 */ 1470 static const char * 1471 conv_bitmaskset(uint32_t *maskarr, int n_mask, 1472 const conv_bitmaskset_desc_t *bitmask_descarr, Conv_fmt_flags_t fmt_flags, 1473 char *conv_buf, size_t conv_buf_size) 1474 { 1475 CONV_EXPN_FIELD_ARG conv_arg; 1476 int i, need_sep = 0; 1477 1478 /* If every bit of every mask is 0, return 0 as the result */ 1479 for (i = 0; i < n_mask; i++) 1480 if (maskarr[i] != 0) 1481 break; 1482 if (i == n_mask) 1483 return (MSG_ORIG(MSG_GBL_ZERO)); 1484 1485 /* 1486 * At least one bit is non-zero. Move through the masks 1487 * and process each one. 1488 */ 1489 (void) memset(&conv_arg, 0, sizeof (conv_arg)); 1490 conv_arg.bufsize = conv_buf_size; 1491 conv_arg.buf = conv_buf; 1492 if ((fmt_flags & CONV_FMT_NOBKT) == 0) { 1493 *conv_arg.buf++ = '['; 1494 *conv_arg.buf++ = ' '; 1495 conv_arg.bufsize -= 2; 1496 } 1497 1498 /* 1499 * conv_expn_field() orders its output with the most significant 1500 * bits on the left. To preserve this ordering across the 1501 * subwords or our "virtual bitmask", we need to process 1502 * the sub-words in the same order, from most significant down 1503 * to least significant. Since unassigned bits tend to be at 1504 * the MSB end of the word, we process the unused bits first. 1505 * 1506 * One implication of this is that the caller should not use 1507 * the unassigned bits for "abandoned" bits in the middle of 1508 * a used range, but should instead define the string for 1509 * that bit as being the string representation of that decimal 1510 * value (i.e. "65"). That will cause the bit to be properly 1511 * sorted among the named bits to either side of it. 1512 */ 1513 for (i = 0; i < n_mask; i++) { 1514 size_t n; 1515 uint32_t mask, unused_bits; 1516 const int bits_per_mask = sizeof (mask) * 8; 1517 1518 mask = maskarr[i]; 1519 unused_bits = mask & bitmask_descarr[i].unused_bits; 1520 mask &= ~unused_bits; 1521 1522 if (mask != 0) { 1523 1524 conv_arg.oflags = conv_arg.rflags = mask; 1525 if (need_sep) { 1526 *conv_arg.buf++ = ' '; 1527 conv_arg.bufsize--; 1528 } 1529 need_sep = 1; 1530 (void) conv_expn_field(&conv_arg, 1531 bitmask_descarr[i].vdp, fmt_flags | CONV_FMT_NOBKT); 1532 n = strlen(conv_arg.buf); 1533 conv_arg.bufsize -= n; 1534 conv_arg.buf += n; 1535 } 1536 1537 if (unused_bits != 0) { 1538 uint32_t bit = 0x00000001; 1539 int j; 1540 1541 for (j = 1; j <= bits_per_mask; j++, bit *= 2) { 1542 if ((unused_bits & bit) == 0) 1543 continue; 1544 1545 if (need_sep) { 1546 *conv_arg.buf++ = ' '; 1547 conv_arg.bufsize--; 1548 } 1549 need_sep = 1; 1550 n = snprintf(conv_arg.buf, conv_arg.bufsize, 1551 MSG_ORIG(MSG_FMT_WORD), 1552 EC_WORD(j + (bits_per_mask * i))); 1553 conv_arg.buf += n; 1554 conv_arg.bufsize -= n; 1555 } 1556 } 1557 } 1558 if ((fmt_flags & CONV_FMT_NOBKT) == 0) { 1559 *conv_arg.buf++ = ' '; 1560 *conv_arg.buf++ = ']'; 1561 } 1562 *conv_arg.buf = '\0'; 1563 1564 return ((const char *) conv_buf); 1565 } 1566 1567 1568 #define SIGSET_FLAGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \ 1569 /* sigset_t [0] - Signals [1 - 32] */ \ 1570 MSG_SIGHUP_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1571 MSG_SIGINT_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1572 MSG_SIGQUIT_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1573 MSG_SIGILL_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1574 MSG_SIGTRAP_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1575 MSG_SIGABRT_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1576 MSG_SIGEMT_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1577 MSG_SIGFPE_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1578 MSG_SIGKILL_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1579 MSG_SIGBUS_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1580 MSG_SIGSEGV_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1581 MSG_SIGSYS_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1582 MSG_SIGPIPE_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1583 MSG_SIGALRM_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1584 MSG_SIGTERM_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1585 MSG_SIGUSR1_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1586 MSG_SIGUSR2_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1587 MSG_SIGCHLD_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1588 MSG_SIGPWR_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1589 MSG_SIGWINCH_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1590 MSG_SIGURG_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1591 MSG_SIGPOLL_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1592 MSG_SIGSTOP_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1593 MSG_SIGTSTP_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1594 MSG_SIGCONT_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1595 MSG_SIGTTIN_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1596 MSG_SIGTTOU_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1597 MSG_SIGVTALRM_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1598 MSG_SIGPROF_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1599 MSG_SIGXCPU_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1600 MSG_SIGXFSZ_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1601 MSG_SIGWAITING_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1602 \ 1603 /* \ 1604 * sigset_t [1] - Signals [33 - 64] \ 1605 * There are 24 unused bits, each of which needs two \ 1606 * characters plus a separator. \ 1607 */ \ 1608 MSG_SIGLWP_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1609 MSG_SIGFREEZE_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1610 MSG_SIGTHAW_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1611 MSG_SIGCANCEL_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1612 MSG_SIGLOST_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1613 MSG_SIGXRES_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1614 MSG_SIGJVM1_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1615 MSG_SIGJVM2_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1616 (24 * (2 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \ 1617 \ 1618 /* \ 1619 * sigset_t [2] - Signals [65 - 96] \ 1620 * There are 32 unused bits, each of which needs two \ 1621 * characters plus a separator. \ 1622 */ \ 1623 (32 * (2 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \ 1624 \ 1625 /* \ 1626 * sigset_t [2] - Signals [97 - 128] \ 1627 * There are 32 unused bits. Three of these need two \ 1628 * characters, and 29 need 3. Each one needs a separator. \ 1629 */ \ 1630 (3 * (2 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \ 1631 (29 * (3 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \ 1632 \ 1633 CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE 1634 1635 /* 1636 * Ensure that Conv_cnote_sigset_buf_t is large enough: 1637 * 1638 * SIGSET_FLAGSZ is the real minimum size of the buffer required by 1639 * conv_cnote_sigset(). However, Conv_cnote_sigset_buf_t 1640 * uses CONV_CNOTE_SIGSET_BUFSIZE to set the buffer size. We do 1641 * things this way because the definition of SIGSET_FLAGSZ uses information 1642 * that is not available in the environment of other programs 1643 * that include the conv.h header file. 1644 */ 1645 #if (CONV_CNOTE_SIGSET_BUFSIZE != SIGSET_FLAGSZ) && !defined(__lint) 1646 #define REPORT_BUFSIZE SIGSET_FLAGSZ 1647 #include "report_bufsize.h" 1648 #error "CONV_CNOTE_SIGSET_BUFSIZE does not match SIGSET_FLAGSZ" 1649 #endif 1650 1651 const char * 1652 conv_cnote_sigset(uint32_t *maskarr, int n_mask, 1653 Conv_fmt_flags_t fmt_flags, Conv_cnote_sigset_buf_t *cnote_sigset_buf) 1654 { 1655 #define N_MASK 4 1656 1657 static const Val_desc vda0[] = { 1658 { 0x00000001, MSG_SIGHUP_ALT }, 1659 { 0x00000002, MSG_SIGINT_ALT }, 1660 { 0x00000004, MSG_SIGQUIT_ALT }, 1661 { 0x00000008, MSG_SIGILL_ALT }, 1662 { 0x00000010, MSG_SIGTRAP_ALT }, 1663 { 0x00000020, MSG_SIGABRT_ALT }, 1664 { 0x00000040, MSG_SIGEMT_ALT }, 1665 { 0x00000080, MSG_SIGFPE_ALT }, 1666 { 0x00000100, MSG_SIGKILL_ALT }, 1667 { 0x00000200, MSG_SIGBUS_ALT }, 1668 { 0x00000400, MSG_SIGSEGV_ALT }, 1669 { 0x00000800, MSG_SIGSYS_ALT }, 1670 { 0x00001000, MSG_SIGPIPE_ALT }, 1671 { 0x00002000, MSG_SIGALRM_ALT }, 1672 { 0x00004000, MSG_SIGTERM_ALT }, 1673 { 0x00008000, MSG_SIGUSR1_ALT }, 1674 { 0x00010000, MSG_SIGUSR2_ALT }, 1675 { 0x00020000, MSG_SIGCHLD_ALT }, 1676 { 0x00040000, MSG_SIGPWR_ALT }, 1677 { 0x00080000, MSG_SIGWINCH_ALT }, 1678 { 0x00100000, MSG_SIGURG_ALT }, 1679 { 0x00200000, MSG_SIGPOLL_ALT }, 1680 { 0x00400000, MSG_SIGSTOP_ALT }, 1681 { 0x00800000, MSG_SIGTSTP_ALT }, 1682 { 0x01000000, MSG_SIGCONT_ALT }, 1683 { 0x02000000, MSG_SIGTTIN_ALT }, 1684 { 0x04000000, MSG_SIGTTOU_ALT }, 1685 { 0x08000000, MSG_SIGVTALRM_ALT }, 1686 { 0x10000000, MSG_SIGPROF_ALT }, 1687 { 0x20000000, MSG_SIGXCPU_ALT }, 1688 { 0x40000000, MSG_SIGXFSZ_ALT }, 1689 { 0x80000000, MSG_SIGWAITING_ALT }, 1690 { 0, 0 } 1691 }; 1692 static const Val_desc vda1[] = { 1693 { 0x00000001, MSG_SIGLWP_ALT }, 1694 { 0x00000002, MSG_SIGFREEZE_ALT }, 1695 { 0x00000004, MSG_SIGTHAW_ALT }, 1696 { 0x00000008, MSG_SIGCANCEL_ALT }, 1697 { 0x00000010, MSG_SIGLOST_ALT }, 1698 { 0x00000020, MSG_SIGXRES_ALT }, 1699 { 0x00000040, MSG_SIGJVM1_ALT }, 1700 { 0x00000080, MSG_SIGJVM2_ALT }, 1701 { 0, 0 } 1702 }; 1703 static const conv_bitmaskset_desc_t bitmask_desc[N_MASK] = { 1704 { vda0, 0 }, 1705 { vda1, 0xffffff00 }, 1706 { NULL, 0xffffffff }, 1707 { NULL, 0xffffffff } 1708 }; 1709 1710 if (n_mask > N_MASK) 1711 n_mask = N_MASK; 1712 return (conv_bitmaskset(maskarr, n_mask, bitmask_desc, fmt_flags, 1713 cnote_sigset_buf->buf, CONV_CNOTE_SIGSET_BUFSIZE)); 1714 1715 #undef N_MASK 1716 } 1717 1718 1719 #define FLTSET_FLAGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \ 1720 /* \ 1721 * fltset_t[0] - Faults [1 - 32] \ 1722 * There are 19 unused bits, each of which needs two \ 1723 * characters plus a separator. \ 1724 */ \ 1725 MSG_FLTILL_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1726 MSG_FLTPRIV_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1727 MSG_FLTBPT_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1728 MSG_FLTTRACE_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1729 MSG_FLTACCESS_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1730 MSG_FLTBOUNDS_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1731 MSG_FLTIOVF_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1732 MSG_FLTIZDIV_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1733 MSG_FLTFPE_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1734 MSG_FLTSTACK_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1735 MSG_FLTPAGE_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1736 MSG_FLTWATCH_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1737 MSG_FLTCPCOVF_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1738 (19 * (2 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \ 1739 /* \ 1740 * fltset_t [1] - Faults [33 - 64] \ 1741 * There are 32 unused bits, each of which needs two \ 1742 * characters plus a separator. \ 1743 */ \ 1744 (32 * (2 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \ 1745 /* \ 1746 * fltset_t [2] - Faults [65 - 96] \ 1747 * There are 32 unused bits, each of which needs two \ 1748 * characters plus a separator. \ 1749 */ \ 1750 (32 * (2 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \ 1751 /* \ 1752 * fltset_t [3] - Faults [97 - 128] \ 1753 * There are 32 unused bits. Three of these need two \ 1754 * characters, and 29 need 3. Each one needs a separator. \ 1755 */ \ 1756 (3 * (2 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \ 1757 (29 * (3 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \ 1758 \ 1759 CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE 1760 1761 /* 1762 * Ensure that Conv_cnote_fltset_buf_t is large enough: 1763 * 1764 * FLTSET_FLAGSZ is the real minimum size of the buffer required by 1765 * conv_cnote_fltset(). However, Conv_cnote_fltset_buf_t 1766 * uses CONV_CNOTE_FLTSET_BUFSIZE to set the buffer size. We do 1767 * things this way because the definition of FLTSET_FLAGSZ uses information 1768 * that is not available in the environment of other programs 1769 * that include the conv.h header file. 1770 */ 1771 #if (CONV_CNOTE_FLTSET_BUFSIZE != FLTSET_FLAGSZ) && !defined(__lint) 1772 #define REPORT_BUFSIZE FLTSET_FLAGSZ 1773 #include "report_bufsize.h" 1774 #error "CONV_CNOTE_FLTSET_BUFSIZE does not match FLTSET_FLAGSZ" 1775 #endif 1776 1777 const char * 1778 conv_cnote_fltset(uint32_t *maskarr, int n_mask, 1779 Conv_fmt_flags_t fmt_flags, Conv_cnote_fltset_buf_t *cnote_fltset_buf) 1780 { 1781 #define N_MASK 4 1782 1783 static const Val_desc vda0[] = { 1784 { 0x00000001, MSG_FLTILL_ALT }, 1785 { 0x00000002, MSG_FLTPRIV_ALT }, 1786 { 0x00000004, MSG_FLTBPT_ALT }, 1787 { 0x00000008, MSG_FLTTRACE_ALT }, 1788 { 0x00000010, MSG_FLTACCESS_ALT }, 1789 { 0x00000020, MSG_FLTBOUNDS_ALT }, 1790 { 0x00000040, MSG_FLTIOVF_ALT }, 1791 { 0x00000080, MSG_FLTIZDIV_ALT }, 1792 { 0x00000100, MSG_FLTFPE_ALT }, 1793 { 0x00000200, MSG_FLTSTACK_ALT }, 1794 { 0x00000400, MSG_FLTPAGE_ALT }, 1795 { 0x00000800, MSG_FLTWATCH_ALT }, 1796 { 0x00001000, MSG_FLTCPCOVF_ALT }, 1797 { 0, 0 } 1798 }; 1799 static const conv_bitmaskset_desc_t bitmask_desc[N_MASK] = { 1800 { vda0, 0xffffe000 }, 1801 { NULL, 0xffffffff }, 1802 { NULL, 0xffffffff }, 1803 { NULL, 0xffffffff } 1804 }; 1805 1806 if (n_mask > N_MASK) 1807 n_mask = N_MASK; 1808 return (conv_bitmaskset(maskarr, n_mask, bitmask_desc, fmt_flags, 1809 cnote_fltset_buf->buf, CONV_CNOTE_FLTSET_BUFSIZE)); 1810 1811 #undef N_MASK 1812 } 1813 1814 1815 1816 #define SYSSET_FLAGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \ 1817 (512 * CONV_EXPN_FIELD_DEF_SEP_SIZE) + \ 1818 \ 1819 /* sysset_t[0] - System Calls [1 - 32] */ \ 1820 MSG_SYS_EXIT_ALT_SIZE /* 1 */ + \ 1821 MSG_SYS_2_SIZE /* 2 (unused) */ + \ 1822 MSG_SYS_READ_ALT_SIZE /* 3 */ + \ 1823 MSG_SYS_WRITE_ALT_SIZE /* 4 */ + \ 1824 MSG_SYS_OPEN_ALT_SIZE /* 5 */ + \ 1825 MSG_SYS_CLOSE_ALT_SIZE /* 6 */ + \ 1826 MSG_SYS_7_SIZE /* 7 (unused) */ + \ 1827 MSG_SYS_8_SIZE /* 8 (unused) */ + \ 1828 MSG_SYS_LINK_ALT_SIZE /* 9 */ + \ 1829 MSG_SYS_UNLINK_ALT_SIZE /* 10 */ + \ 1830 MSG_SYS_11_SIZE /* 11 (unused) */ + \ 1831 MSG_SYS_CHDIR_ALT_SIZE /* 12 */ + \ 1832 MSG_SYS_TIME_ALT_SIZE /* 13 */ + \ 1833 MSG_SYS_MKNOD_ALT_SIZE /* 14 */ + \ 1834 MSG_SYS_CHMOD_ALT_SIZE /* 15 */ + \ 1835 MSG_SYS_CHOWN_ALT_SIZE /* 16 */ + \ 1836 MSG_SYS_BRK_ALT_SIZE /* 17 */ + \ 1837 MSG_SYS_STAT_ALT_SIZE /* 18 */ + \ 1838 MSG_SYS_LSEEK_ALT_SIZE /* 19 */ + \ 1839 MSG_SYS_GETPID_ALT_SIZE /* 20 */ + \ 1840 MSG_SYS_MOUNT_ALT_SIZE /* 21 */ + \ 1841 MSG_SYS_22_SIZE /* 22 (unused) */ + \ 1842 MSG_SYS_SETUID_ALT_SIZE /* 23 */ + \ 1843 MSG_SYS_GETUID_ALT_SIZE /* 24 */ + \ 1844 MSG_SYS_STIME_ALT_SIZE /* 25 */ + \ 1845 MSG_SYS_PCSAMPLE_ALT_SIZE /* 26 */ + \ 1846 MSG_SYS_ALARM_ALT_SIZE /* 27 */ + \ 1847 MSG_SYS_FSTAT_ALT_SIZE /* 28 */ + \ 1848 MSG_SYS_PAUSE_ALT_SIZE /* 29 */ + \ 1849 MSG_SYS_30_SIZE /* 30 (unused) */ + \ 1850 MSG_SYS_STTY_ALT_SIZE /* 31 */ + \ 1851 MSG_SYS_GTTY_ALT_SIZE /* 32 */ + \ 1852 \ 1853 /* sysset_t[1] - System Calls [33 - 64] */ \ 1854 MSG_SYS_ACCESS_ALT_SIZE /* 33 */ + \ 1855 MSG_SYS_NICE_ALT_SIZE /* 34 */ + \ 1856 MSG_SYS_STATFS_ALT_SIZE /* 35 */ + \ 1857 MSG_SYS_SYNC_ALT_SIZE /* 36 */ + \ 1858 MSG_SYS_KILL_ALT_SIZE /* 37 */ + \ 1859 MSG_SYS_FSTATFS_ALT_SIZE /* 38 */ + \ 1860 MSG_SYS_PGRPSYS_ALT_SIZE /* 39 */ + \ 1861 MSG_SYS_UUCOPYSTR_ALT_SIZE /* 40 */ + \ 1862 MSG_SYS_41_SIZE /* 41 (unused) */ + \ 1863 MSG_SYS_PIPE_ALT_SIZE /* 42 */ + \ 1864 MSG_SYS_TIMES_ALT_SIZE /* 43 */ + \ 1865 MSG_SYS_PROFIL_ALT_SIZE /* 44 */ + \ 1866 MSG_SYS_FACCESSAT_ALT_SIZE /* 45 */ + \ 1867 MSG_SYS_SETGID_ALT_SIZE /* 46 */ + \ 1868 MSG_SYS_GETGID_ALT_SIZE /* 47 */ + \ 1869 MSG_SYS_48_SIZE /* 48 (unused) */ + \ 1870 MSG_SYS_MSGSYS_ALT_SIZE /* 49 */ + \ 1871 MSG_SYS_SYSI86_ALT_SIZE /* 50 */ + \ 1872 MSG_SYS_ACCT_ALT_SIZE /* 51 */ + \ 1873 MSG_SYS_SHMSYS_ALT_SIZE /* 52 */ + \ 1874 MSG_SYS_SEMSYS_ALT_SIZE /* 53 */ + \ 1875 MSG_SYS_IOCTL_ALT_SIZE /* 54 */ + \ 1876 MSG_SYS_UADMIN_ALT_SIZE /* 55 */ + \ 1877 MSG_SYS_FCHOWNAT_ALT_SIZE /* 56 */ + \ 1878 MSG_SYS_UTSSYS_ALT_SIZE /* 57 */ + \ 1879 MSG_SYS_FDSYNC_ALT_SIZE /* 58 */ + \ 1880 MSG_SYS_EXECVE_ALT_SIZE /* 59 */ + \ 1881 MSG_SYS_UMASK_ALT_SIZE /* 60 */ + \ 1882 MSG_SYS_CHROOT_ALT_SIZE /* 61 */ + \ 1883 MSG_SYS_FCNTL_ALT_SIZE /* 62 */ + \ 1884 MSG_SYS_ULIMIT_ALT_SIZE /* 63 */ + \ 1885 MSG_SYS_RENAMEAT_ALT_SIZE /* 64 */ + \ 1886 \ 1887 /* sysset_t[2] - System Calls [65 - 96] */ \ 1888 MSG_SYS_UNLINKAT_ALT_SIZE /* 65 */ + \ 1889 MSG_SYS_FSTATAT_ALT_SIZE /* 66 */ + \ 1890 MSG_SYS_FSTATAT64_ALT_SIZE /* 67 */ + \ 1891 MSG_SYS_OPENAT_ALT_SIZE /* 68 */ + \ 1892 MSG_SYS_OPENAT64_ALT_SIZE /* 69 */ + \ 1893 MSG_SYS_TASKSYS_ALT_SIZE /* 70 */ + \ 1894 MSG_SYS_ACCTCTL_ALT_SIZE /* 71 */ + \ 1895 MSG_SYS_EXACCTSYS_ALT_SIZE /* 72 */ + \ 1896 MSG_SYS_GETPAGESIZES_ALT_SIZE /* 73 */ + \ 1897 MSG_SYS_RCTLSYS_ALT_SIZE /* 74 */ + \ 1898 MSG_SYS_SIDSYS_ALT_SIZE /* 75 */ + \ 1899 MSG_SYS_76_SIZE /* 76 (unused) */ + \ 1900 MSG_SYS_LWP_PARK_ALT_SIZE /* 77 */ + \ 1901 MSG_SYS_SENDFILEV_ALT_SIZE /* 78 */ + \ 1902 MSG_SYS_RMDIR_ALT_SIZE /* 79 */ + \ 1903 MSG_SYS_MKDIR_ALT_SIZE /* 80 */ + \ 1904 MSG_SYS_GETDENTS_ALT_SIZE /* 81 */ + \ 1905 MSG_SYS_PRIVSYS_ALT_SIZE /* 82 */ + \ 1906 MSG_SYS_UCREDSYS_ALT_SIZE /* 83 */ + \ 1907 MSG_SYS_SYSFS_ALT_SIZE /* 84 */ + \ 1908 MSG_SYS_GETMSG_ALT_SIZE /* 85 */ + \ 1909 MSG_SYS_PUTMSG_ALT_SIZE /* 86 */ + \ 1910 MSG_SYS_87_SIZE /* 87 (unused) */ + \ 1911 MSG_SYS_LSTAT_ALT_SIZE /* 88 */ + \ 1912 MSG_SYS_SYMLINK_ALT_SIZE /* 89 */ + \ 1913 MSG_SYS_READLINK_ALT_SIZE /* 90 */ + \ 1914 MSG_SYS_SETGROUPS_ALT_SIZE /* 91 */ + \ 1915 MSG_SYS_GETGROUPS_ALT_SIZE /* 92 */ + \ 1916 MSG_SYS_FCHMOD_ALT_SIZE /* 93 */ + \ 1917 MSG_SYS_FCHOWN_ALT_SIZE /* 94 */ + \ 1918 MSG_SYS_SIGPROCMASK_ALT_SIZE /* 95 */ + \ 1919 MSG_SYS_SIGSUSPEND_ALT_SIZE /* 96 */ + \ 1920 \ 1921 /* sysset_t[3] - System Calls [97 - 128] */ \ 1922 MSG_SYS_SIGALTSTACK_ALT_SIZE /* 97 */ + \ 1923 MSG_SYS_SIGACTION_ALT_SIZE /* 98 */ + \ 1924 MSG_SYS_SIGPENDING_ALT_SIZE /* 99 */ + \ 1925 MSG_SYS_CONTEXT_ALT_SIZE /* 100 */ + \ 1926 MSG_SYS_101_SIZE /* 101 (unused) */ + \ 1927 MSG_SYS_102_SIZE /* 102 (unused) */ + \ 1928 MSG_SYS_STATVFS_ALT_SIZE /* 103 */ + \ 1929 MSG_SYS_FSTATVFS_ALT_SIZE /* 104 */ + \ 1930 MSG_SYS_GETLOADAVG_ALT_SIZE /* 105 */ + \ 1931 MSG_SYS_NFSSYS_ALT_SIZE /* 106 */ + \ 1932 MSG_SYS_WAITID_ALT_SIZE /* 107 */ + \ 1933 MSG_SYS_SIGSENDSYS_ALT_SIZE /* 108 */ + \ 1934 MSG_SYS_HRTSYS_ALT_SIZE /* 109 */ + \ 1935 MSG_SYS_UTIMESYS_ALT_SIZE /* 110 */ + \ 1936 MSG_SYS_SIGRESEND_ALT_SIZE /* 111 */ + \ 1937 MSG_SYS_PRIOCNTLSYS_ALT_SIZE /* 112 */ + \ 1938 MSG_SYS_PATHCONF_ALT_SIZE /* 113 */ + \ 1939 MSG_SYS_MINCORE_ALT_SIZE /* 114 */ + \ 1940 MSG_SYS_MMAP_ALT_SIZE /* 115 */ + \ 1941 MSG_SYS_MPROTECT_ALT_SIZE /* 116 */ + \ 1942 MSG_SYS_MUNMAP_ALT_SIZE /* 117 */ + \ 1943 MSG_SYS_FPATHCONF_ALT_SIZE /* 118 */ + \ 1944 MSG_SYS_VFORK_ALT_SIZE /* 119 */ + \ 1945 MSG_SYS_FCHDIR_ALT_SIZE /* 120 */ + \ 1946 MSG_SYS_READV_ALT_SIZE /* 121 */ + \ 1947 MSG_SYS_WRITEV_ALT_SIZE /* 122 */ + \ 1948 MSG_SYS_123_SIZE /* 123 (unused) */ + \ 1949 MSG_SYS_124_SIZE /* 124 (unused) */ + \ 1950 MSG_SYS_125_SIZE /* 125 (unused) */ + \ 1951 MSG_SYS_126_SIZE /* 126 (unused) */ + \ 1952 MSG_SYS_MMAPOBJ_ALT_SIZE /* 127 */ + \ 1953 MSG_SYS_SETRLIMIT_ALT_SIZE /* 128 */ + \ 1954 \ 1955 /* sysset_t[4] - System Calls [129 - 160] */ \ 1956 MSG_SYS_GETRLIMIT_ALT_SIZE /* 129 */ + \ 1957 MSG_SYS_LCHOWN_ALT_SIZE /* 130 */ + \ 1958 MSG_SYS_MEMCNTL_ALT_SIZE /* 131 */ + \ 1959 MSG_SYS_GETPMSG_ALT_SIZE /* 132 */ + \ 1960 MSG_SYS_PUTPMSG_ALT_SIZE /* 133 */ + \ 1961 MSG_SYS_RENAME_ALT_SIZE /* 134 */ + \ 1962 MSG_SYS_UNAME_ALT_SIZE /* 135 */ + \ 1963 MSG_SYS_SETEGID_ALT_SIZE /* 136 */ + \ 1964 MSG_SYS_SYSCONFIG_ALT_SIZE /* 137 */ + \ 1965 MSG_SYS_ADJTIME_ALT_SIZE /* 138 */ + \ 1966 MSG_SYS_SYSTEMINFO_ALT_SIZE /* 139 */ + \ 1967 MSG_SYS_SHAREFS_ALT_SIZE /* 140 */ + \ 1968 MSG_SYS_SETEUID_ALT_SIZE /* 141 */ + \ 1969 MSG_SYS_FORKSYS_ALT_SIZE /* 142 */ + \ 1970 MSG_SYS_143_SIZE /* 143 (unused) */ + \ 1971 MSG_SYS_SIGTIMEDWAIT_ALT_SIZE /* 144 */ + \ 1972 MSG_SYS_LWP_INFO_ALT_SIZE /* 145 */ + \ 1973 MSG_SYS_YIELD_ALT_SIZE /* 146 */ + \ 1974 MSG_SYS_147_SIZE /* 147 (unused) */ + \ 1975 MSG_SYS_LWP_SEMA_POST_ALT_SIZE /* 148 */ + \ 1976 MSG_SYS_LWP_SEMA_TRYWAIT_ALT_SIZE /* 149 */ + \ 1977 MSG_SYS_LWP_DETACH_ALT_SIZE /* 150 */ + \ 1978 MSG_SYS_CORECTL_ALT_SIZE /* 151 */ + \ 1979 MSG_SYS_MODCTL_ALT_SIZE /* 152 */ + \ 1980 MSG_SYS_FCHROOT_ALT_SIZE /* 153 */ + \ 1981 MSG_SYS_154_SIZE /* 154 (unused) */ + \ 1982 MSG_SYS_VHANGUP_ALT_SIZE /* 155 */ + \ 1983 MSG_SYS_GETTIMEOFDAY_ALT_SIZE /* 156 */ + \ 1984 MSG_SYS_GETITIMER_ALT_SIZE /* 157 */ + \ 1985 MSG_SYS_SETITIMER_ALT_SIZE /* 158 */ + \ 1986 MSG_SYS_LWP_CREATE_ALT_SIZE /* 159 */ + \ 1987 MSG_SYS_LWP_EXIT_ALT_SIZE /* 160 */ + \ 1988 \ 1989 /* sysset_t[5] - System Calls [161 - 192] */ \ 1990 MSG_SYS_LWP_SUSPEND_ALT_SIZE /* 161 */ + \ 1991 MSG_SYS_LWP_CONTINUE_ALT_SIZE /* 162 */ + \ 1992 MSG_SYS_LWP_KILL_ALT_SIZE /* 163 */ + \ 1993 MSG_SYS_LWP_SELF_ALT_SIZE /* 164 */ + \ 1994 MSG_SYS_LWP_SIGMASK_ALT_SIZE /* 165 */ + \ 1995 MSG_SYS_LWP_PRIVATE_ALT_SIZE /* 166 */ + \ 1996 MSG_SYS_LWP_WAIT_ALT_SIZE /* 167 */ + \ 1997 MSG_SYS_LWP_MUTEX_WAKEUP_ALT_SIZE /* 168 */ + \ 1998 MSG_SYS_169_SIZE /* 169 (unused) */ + \ 1999 MSG_SYS_LWP_COND_WAIT_ALT_SIZE /* 170 */ + \ 2000 MSG_SYS_LWP_COND_SIGNAL_ALT_SIZE /* 171 */ + \ 2001 MSG_SYS_LWP_COND_BROADCAST_ALT_SIZE /* 172 */ + \ 2002 MSG_SYS_PREAD_ALT_SIZE /* 173 */ + \ 2003 MSG_SYS_PWRITE_ALT_SIZE /* 174 */ + \ 2004 MSG_SYS_LLSEEK_ALT_SIZE /* 175 */ + \ 2005 MSG_SYS_INST_SYNC_ALT_SIZE /* 176 */ + \ 2006 MSG_SYS_BRAND_ALT_SIZE /* 177 */ + \ 2007 MSG_SYS_KAIO_ALT_SIZE /* 178 */ + \ 2008 MSG_SYS_CPC_ALT_SIZE /* 179 */ + \ 2009 MSG_SYS_LGRPSYS_ALT_SIZE /* 180 */ + \ 2010 MSG_SYS_RUSAGESYS_ALT_SIZE /* 181 */ + \ 2011 MSG_SYS_PORT_ALT_SIZE /* 182 */ + \ 2012 MSG_SYS_POLLSYS_ALT_SIZE /* 183 */ + \ 2013 MSG_SYS_LABELSYS_ALT_SIZE /* 184 */ + \ 2014 MSG_SYS_ACL_ALT_SIZE /* 185 */ + \ 2015 MSG_SYS_AUDITSYS_ALT_SIZE /* 186 */ + \ 2016 MSG_SYS_PROCESSOR_BIND_ALT_SIZE /* 187 */ + \ 2017 MSG_SYS_PROCESSOR_INFO_ALT_SIZE /* 188 */ + \ 2018 MSG_SYS_P_ONLINE_ALT_SIZE /* 189 */ + \ 2019 MSG_SYS_SIGQUEUE_ALT_SIZE /* 190 */ + \ 2020 MSG_SYS_CLOCK_GETTIME_ALT_SIZE /* 191 */ + \ 2021 MSG_SYS_CLOCK_SETTIME_ALT_SIZE /* 192 */ + \ 2022 \ 2023 /* sysset_t[6] - System Calls [193 - 224] */ \ 2024 MSG_SYS_CLOCK_GETRES_ALT_SIZE /* 193 */ + \ 2025 MSG_SYS_TIMER_CREATE_ALT_SIZE /* 194 */ + \ 2026 MSG_SYS_TIMER_DELETE_ALT_SIZE /* 195 */ + \ 2027 MSG_SYS_TIMER_SETTIME_ALT_SIZE /* 196 */ + \ 2028 MSG_SYS_TIMER_GETTIME_ALT_SIZE /* 197 */ + \ 2029 MSG_SYS_TIMER_GETOVERRUN_ALT_SIZE /* 198 */ + \ 2030 MSG_SYS_NANOSLEEP_ALT_SIZE /* 199 */ + \ 2031 MSG_SYS_FACL_ALT_SIZE /* 200 */ + \ 2032 MSG_SYS_DOOR_ALT_SIZE /* 201 */ + \ 2033 MSG_SYS_SETREUID_ALT_SIZE /* 202 */ + \ 2034 MSG_SYS_SETREGID_ALT_SIZE /* 203 */ + \ 2035 MSG_SYS_INSTALL_UTRAP_ALT_SIZE /* 204 */ + \ 2036 MSG_SYS_SIGNOTIFY_ALT_SIZE /* 205 */ + \ 2037 MSG_SYS_SCHEDCTL_ALT_SIZE /* 206 */ + \ 2038 MSG_SYS_PSET_ALT_SIZE /* 207 */ + \ 2039 MSG_SYS_SPARC_UTRAP_INSTALL_ALT_SIZE /* 208 */ + \ 2040 MSG_SYS_RESOLVEPATH_ALT_SIZE /* 209 */ + \ 2041 MSG_SYS_LWP_MUTEX_TIMEDLOCK_ALT_SIZE /* 210 */ + \ 2042 MSG_SYS_LWP_SEMA_TIMEDWAIT_ALT_SIZE /* 211 */ + \ 2043 MSG_SYS_LWP_RWLOCK_SYS_ALT_SIZE /* 212 */ + \ 2044 MSG_SYS_GETDENTS64_ALT_SIZE /* 213 */ + \ 2045 MSG_SYS_MMAP64_ALT_SIZE /* 214 */ + \ 2046 MSG_SYS_STAT64_ALT_SIZE /* 215 */ + \ 2047 MSG_SYS_LSTAT64_ALT_SIZE /* 216 */ + \ 2048 MSG_SYS_FSTAT64_ALT_SIZE /* 217 */ + \ 2049 MSG_SYS_STATVFS64_ALT_SIZE /* 218 */ + \ 2050 MSG_SYS_FSTATVFS64_ALT_SIZE /* 219 */ + \ 2051 MSG_SYS_SETRLIMIT64_ALT_SIZE /* 220 */ + \ 2052 MSG_SYS_GETRLIMIT64_ALT_SIZE /* 221 */ + \ 2053 MSG_SYS_PREAD64_ALT_SIZE /* 222 */ + \ 2054 MSG_SYS_PWRITE64_ALT_SIZE /* 223 */ + \ 2055 MSG_SYS_224_SIZE /* 224 (unused) */ + \ 2056 \ 2057 /* sysset_t[7] - System Calls [225 - 256] */ \ 2058 MSG_SYS_OPEN64_ALT_SIZE /* 225 */ + \ 2059 MSG_SYS_RPCSYS_ALT_SIZE /* 226 */ + \ 2060 MSG_SYS_ZONE_ALT_SIZE /* 227 */ + \ 2061 MSG_SYS_AUTOFSSYS_ALT_SIZE /* 228 */ + \ 2062 MSG_SYS_GETCWD_ALT_SIZE /* 229 */ + \ 2063 MSG_SYS_SO_SOCKET_ALT_SIZE /* 230 */ + \ 2064 MSG_SYS_SO_SOCKETPAIR_ALT_SIZE /* 231 */ + \ 2065 MSG_SYS_BIND_ALT_SIZE /* 232 */ + \ 2066 MSG_SYS_LISTEN_ALT_SIZE /* 233 */ + \ 2067 MSG_SYS_ACCEPT_ALT_SIZE /* 234 */ + \ 2068 MSG_SYS_CONNECT_ALT_SIZE /* 235 */ + \ 2069 MSG_SYS_SHUTDOWN_ALT_SIZE /* 236 */ + \ 2070 MSG_SYS_RECV_ALT_SIZE /* 237 */ + \ 2071 MSG_SYS_RECVFROM_ALT_SIZE /* 238 */ + \ 2072 MSG_SYS_RECVMSG_ALT_SIZE /* 239 */ + \ 2073 MSG_SYS_SEND_ALT_SIZE /* 240 */ + \ 2074 MSG_SYS_SENDMSG_ALT_SIZE /* 241 */ + \ 2075 MSG_SYS_SENDTO_ALT_SIZE /* 242 */ + \ 2076 MSG_SYS_GETPEERNAME_ALT_SIZE /* 243 */ + \ 2077 MSG_SYS_GETSOCKNAME_ALT_SIZE /* 244 */ + \ 2078 MSG_SYS_GETSOCKOPT_ALT_SIZE /* 245 */ + \ 2079 MSG_SYS_SETSOCKOPT_ALT_SIZE /* 246 */ + \ 2080 MSG_SYS_SOCKCONFIG_ALT_SIZE /* 247 */ + \ 2081 MSG_SYS_NTP_GETTIME_ALT_SIZE /* 248 */ + \ 2082 MSG_SYS_NTP_ADJTIME_ALT_SIZE /* 249 */ + \ 2083 MSG_SYS_LWP_MUTEX_UNLOCK_ALT_SIZE /* 250 */ + \ 2084 MSG_SYS_LWP_MUTEX_TRYLOCK_ALT_SIZE /* 251 */ + \ 2085 MSG_SYS_LWP_MUTEX_REGISTER_ALT_SIZE /* 252 */ + \ 2086 MSG_SYS_CLADM_ALT_SIZE /* 253 */ + \ 2087 MSG_SYS_UUCOPY_ALT_SIZE /* 254 */ + \ 2088 MSG_SYS_UMOUNT2_ALT_SIZE /* 255 */ + \ 2089 3 /* 256 (unused) */ + \ 2090 \ 2091 /* sysset_t[8] - System Calls [257 - 288] */ \ 2092 (32 * 3) /* 257 - 288 (unused) */ + \ 2093 \ 2094 /* sysset_t[9] - System Calls [289 - 320] */ \ 2095 (32 * 3) /* 289 - 320 (unused) */ + \ 2096 \ 2097 /* sysset_t[10] - System Calls [321 - 352] */ \ 2098 (32 * 3) /* 321 - 352 (unused) */ + \ 2099 \ 2100 /* sysset_t[11] - System Calls [353 - 384] */ \ 2101 (32 * 3) /* 353 - 384 (unused) */ + \ 2102 \ 2103 /* sysset_t[12] - System Calls [385 - 416] */ \ 2104 (32 * 3) /* 385 - 416 (unused) */ + \ 2105 \ 2106 /* sysset_t[13] - System Calls [417 - 448] */ \ 2107 (32 * 3) /* 417 - 448 (unused) */ + \ 2108 \ 2109 /* sysset_t[14] - System Calls [449 - 480] */ \ 2110 (32 * 3) /* 449 - 480 (unused) */ + \ 2111 \ 2112 /* sysset_t[15] - System Calls [481 - 512] */ \ 2113 (32 * 3) /* 481 - 512 (unused) */ + \ 2114 \ 2115 CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE 2116 2117 /* 2118 * Ensure that Conv_cnote_sysset_buf_t is large enough: 2119 * 2120 * SYSSET_FLAGSZ is the real minimum size of the buffer required by 2121 * conv_cnote_sysset(). However, Conv_cnote_sysset_buf_t 2122 * uses CONV_CNOTE_SYSSET_BUFSIZE to set the buffer size. We do 2123 * things this way because the definition of SYSSET_FLAGSZ uses information 2124 * that is not available in the environment of other programs 2125 * that include the conv.h header file. 2126 */ 2127 #if (CONV_CNOTE_SYSSET_BUFSIZE != SYSSET_FLAGSZ) && !defined(__lint) 2128 #define REPORT_BUFSIZE SYSSET_FLAGSZ 2129 #include "report_bufsize.h" 2130 #error "CONV_CNOTE_SYSSET_BUFSIZE does not match SYSSET_FLAGSZ" 2131 #endif 2132 2133 const char * 2134 conv_cnote_sysset(uint32_t *maskarr, int n_mask, 2135 Conv_fmt_flags_t fmt_flags, Conv_cnote_sysset_buf_t *cnote_sysset_buf) 2136 { 2137 #define N_MASK 16 2138 2139 static const Val_desc vda0[] = { /* System Calls [1 - 32] */ 2140 { 0x00000001, MSG_SYS_EXIT_ALT }, 2141 { 0x00000002, MSG_SYS_2 }, 2142 { 0x00000004, MSG_SYS_READ_ALT }, 2143 { 0x00000008, MSG_SYS_WRITE_ALT }, 2144 { 0x00000010, MSG_SYS_OPEN_ALT }, 2145 { 0x00000020, MSG_SYS_CLOSE_ALT }, 2146 { 0x00000040, MSG_SYS_7 }, 2147 { 0x00000080, MSG_SYS_8 }, 2148 { 0x00000100, MSG_SYS_LINK_ALT }, 2149 { 0x00000200, MSG_SYS_UNLINK_ALT }, 2150 { 0x00000400, MSG_SYS_11 }, 2151 { 0x00000800, MSG_SYS_CHDIR_ALT }, 2152 { 0x00001000, MSG_SYS_TIME_ALT }, 2153 { 0x00002000, MSG_SYS_MKNOD_ALT }, 2154 { 0x00004000, MSG_SYS_CHMOD_ALT }, 2155 { 0x00008000, MSG_SYS_CHOWN_ALT }, 2156 { 0x00010000, MSG_SYS_BRK_ALT }, 2157 { 0x00020000, MSG_SYS_STAT_ALT }, 2158 { 0x00040000, MSG_SYS_LSEEK_ALT }, 2159 { 0x00080000, MSG_SYS_GETPID_ALT }, 2160 { 0x00100000, MSG_SYS_MOUNT_ALT }, 2161 { 0x00200000, MSG_SYS_22 }, 2162 { 0x00400000, MSG_SYS_SETUID_ALT }, 2163 { 0x00800000, MSG_SYS_GETUID_ALT }, 2164 { 0x01000000, MSG_SYS_STIME_ALT }, 2165 { 0x02000000, MSG_SYS_PCSAMPLE_ALT }, 2166 { 0x04000000, MSG_SYS_ALARM_ALT }, 2167 { 0x08000000, MSG_SYS_FSTAT_ALT }, 2168 { 0x10000000, MSG_SYS_PAUSE_ALT }, 2169 { 0x20000000, MSG_SYS_30 }, 2170 { 0x40000000, MSG_SYS_STTY_ALT }, 2171 { 0x80000000, MSG_SYS_GTTY_ALT }, 2172 { 0, 0 } 2173 }; 2174 static const Val_desc vda1[] = { /* System Calls [33 - 64] */ 2175 { 0x00000001, MSG_SYS_ACCESS_ALT }, 2176 { 0x00000002, MSG_SYS_NICE_ALT }, 2177 { 0x00000004, MSG_SYS_STATFS_ALT }, 2178 { 0x00000008, MSG_SYS_SYNC_ALT }, 2179 { 0x00000010, MSG_SYS_KILL_ALT }, 2180 { 0x00000020, MSG_SYS_FSTATFS_ALT }, 2181 { 0x00000040, MSG_SYS_PGRPSYS_ALT }, 2182 { 0x00000080, MSG_SYS_UUCOPYSTR_ALT }, 2183 { 0x00000100, MSG_SYS_41 }, 2184 { 0x00000200, MSG_SYS_PIPE_ALT }, 2185 { 0x00000400, MSG_SYS_TIMES_ALT }, 2186 { 0x00000800, MSG_SYS_PROFIL_ALT }, 2187 { 0x00001000, MSG_SYS_FACCESSAT_ALT }, 2188 { 0x00002000, MSG_SYS_SETGID_ALT }, 2189 { 0x00004000, MSG_SYS_GETGID_ALT }, 2190 { 0x00008000, MSG_SYS_48 }, 2191 { 0x00010000, MSG_SYS_MSGSYS_ALT }, 2192 { 0x00020000, MSG_SYS_SYSI86_ALT }, 2193 { 0x00040000, MSG_SYS_ACCT_ALT }, 2194 { 0x00080000, MSG_SYS_SHMSYS_ALT }, 2195 { 0x00100000, MSG_SYS_SEMSYS_ALT }, 2196 { 0x00200000, MSG_SYS_IOCTL_ALT }, 2197 { 0x00400000, MSG_SYS_UADMIN_ALT }, 2198 { 0x00800000, MSG_SYS_FCHOWNAT_ALT }, 2199 { 0x01000000, MSG_SYS_UTSSYS_ALT }, 2200 { 0x0200000, MSG_SYS_FDSYNC_ALT }, 2201 { 0x04000000, MSG_SYS_EXECVE_ALT }, 2202 { 0x08000000, MSG_SYS_UMASK_ALT }, 2203 { 0x10000000, MSG_SYS_CHROOT_ALT }, 2204 { 0x20000000, MSG_SYS_FCNTL_ALT }, 2205 { 0x40000000, MSG_SYS_ULIMIT_ALT }, 2206 { 0x80000000, MSG_SYS_RENAMEAT_ALT }, 2207 { 0, 0 } 2208 }; 2209 static const Val_desc vda2[] = { /* System Calls [65 - 96] */ 2210 { 0x00000001, MSG_SYS_UNLINKAT_ALT }, 2211 { 0x00000002, MSG_SYS_FSTATAT_ALT }, 2212 { 0x00000004, MSG_SYS_FSTATAT64_ALT }, 2213 { 0x00000008, MSG_SYS_OPENAT_ALT }, 2214 { 0x00000010, MSG_SYS_OPENAT64_ALT }, 2215 { 0x00000020, MSG_SYS_TASKSYS_ALT }, 2216 { 0x00000040, MSG_SYS_ACCTCTL_ALT }, 2217 { 0x00000080, MSG_SYS_EXACCTSYS_ALT }, 2218 { 0x00000100, MSG_SYS_GETPAGESIZES_ALT }, 2219 { 0x00000200, MSG_SYS_RCTLSYS_ALT }, 2220 { 0x00000400, MSG_SYS_SIDSYS_ALT }, 2221 { 0x00000800, MSG_SYS_76 }, 2222 { 0x00001000, MSG_SYS_LWP_PARK_ALT }, 2223 { 0x00002000, MSG_SYS_SENDFILEV_ALT }, 2224 { 0x00004000, MSG_SYS_RMDIR_ALT }, 2225 { 0x00008000, MSG_SYS_MKDIR_ALT }, 2226 { 0x00010000, MSG_SYS_GETDENTS_ALT }, 2227 { 0x00020000, MSG_SYS_PRIVSYS_ALT }, 2228 { 0x00040000, MSG_SYS_UCREDSYS_ALT }, 2229 { 0x00080000, MSG_SYS_SYSFS_ALT }, 2230 { 0x00100000, MSG_SYS_GETMSG_ALT }, 2231 { 0x00200000, MSG_SYS_PUTMSG_ALT }, 2232 { 0x00400000, MSG_SYS_87 }, 2233 { 0x00800000, MSG_SYS_LSTAT_ALT }, 2234 { 0x01000000, MSG_SYS_SYMLINK_ALT }, 2235 { 0x02000000, MSG_SYS_READLINK_ALT }, 2236 { 0x04000000, MSG_SYS_SETGROUPS_ALT }, 2237 { 0x08000000, MSG_SYS_GETGROUPS_ALT }, 2238 { 0x10000000, MSG_SYS_FCHMOD_ALT }, 2239 { 0x20000000, MSG_SYS_FCHOWN_ALT }, 2240 { 0x40000000, MSG_SYS_SIGPROCMASK_ALT }, 2241 { 0x80000000, MSG_SYS_SIGSUSPEND_ALT }, 2242 { 0, 0 } 2243 }; 2244 static const Val_desc vda3[] = { /* System Calls [97 - 128] */ 2245 { 0x00000001, MSG_SYS_SIGALTSTACK_ALT }, 2246 { 0x00000002, MSG_SYS_SIGACTION_ALT }, 2247 { 0x00000004, MSG_SYS_SIGPENDING_ALT }, 2248 { 0x00000008, MSG_SYS_CONTEXT_ALT }, 2249 { 0x00000010, MSG_SYS_101 }, 2250 { 0x00000020, MSG_SYS_102 }, 2251 { 0x00000040, MSG_SYS_STATVFS_ALT }, 2252 { 0x00000080, MSG_SYS_FSTATVFS_ALT }, 2253 { 0x00000100, MSG_SYS_GETLOADAVG_ALT }, 2254 { 0x00000200, MSG_SYS_NFSSYS_ALT }, 2255 { 0x00000400, MSG_SYS_WAITID_ALT }, 2256 { 0x00000800, MSG_SYS_SIGSENDSYS_ALT }, 2257 { 0x00001000, MSG_SYS_HRTSYS_ALT }, 2258 { 0x00002000, MSG_SYS_UTIMESYS_ALT }, 2259 { 0x00004000, MSG_SYS_SIGRESEND_ALT }, 2260 { 0x00008000, MSG_SYS_PRIOCNTLSYS_ALT }, 2261 { 0x00010000, MSG_SYS_PATHCONF_ALT }, 2262 { 0x00020000, MSG_SYS_MINCORE_ALT }, 2263 { 0x00040000, MSG_SYS_MMAP_ALT }, 2264 { 0x00080000, MSG_SYS_MPROTECT_ALT }, 2265 { 0x00100000, MSG_SYS_MUNMAP_ALT }, 2266 { 0x00200000, MSG_SYS_FPATHCONF_ALT }, 2267 { 0x00400000, MSG_SYS_VFORK_ALT }, 2268 { 0x00800000, MSG_SYS_FCHDIR_ALT }, 2269 { 0x01000000, MSG_SYS_READV_ALT }, 2270 { 0x02000000, MSG_SYS_WRITEV_ALT }, 2271 { 0x04000000, MSG_SYS_123 }, 2272 { 0x08000000, MSG_SYS_124 }, 2273 { 0x10000000, MSG_SYS_125 }, 2274 { 0x20000000, MSG_SYS_126 }, 2275 { 0x40000000, MSG_SYS_MMAPOBJ_ALT }, 2276 { 0x80000000, MSG_SYS_SETRLIMIT_ALT }, 2277 { 0, 0 } 2278 }; 2279 static const Val_desc vda4[] = { /* System Calls [129 - 160] */ 2280 { 0x00000001, MSG_SYS_GETRLIMIT_ALT }, 2281 { 0x00000002, MSG_SYS_LCHOWN_ALT }, 2282 { 0x00000004, MSG_SYS_MEMCNTL_ALT }, 2283 { 0x00000008, MSG_SYS_GETPMSG_ALT }, 2284 { 0x00000010, MSG_SYS_PUTPMSG_ALT }, 2285 { 0x00000020, MSG_SYS_RENAME_ALT }, 2286 { 0x00000040, MSG_SYS_UNAME_ALT }, 2287 { 0x00000080, MSG_SYS_SETEGID_ALT }, 2288 { 0x00000100, MSG_SYS_SYSCONFIG_ALT }, 2289 { 0x00000200, MSG_SYS_ADJTIME_ALT }, 2290 { 0x00000400, MSG_SYS_SYSTEMINFO_ALT }, 2291 { 0x00000800, MSG_SYS_SHAREFS_ALT }, 2292 { 0x00001000, MSG_SYS_SETEUID_ALT }, 2293 { 0x00002000, MSG_SYS_FORKSYS_ALT }, 2294 { 0x00004000, MSG_SYS_143 }, 2295 { 0x00008000, MSG_SYS_SIGTIMEDWAIT_ALT }, 2296 { 0x00010000, MSG_SYS_LWP_INFO_ALT }, 2297 { 0x00020000, MSG_SYS_YIELD_ALT }, 2298 { 0x00040000, MSG_SYS_147 }, 2299 { 0x00080000, MSG_SYS_LWP_SEMA_POST_ALT }, 2300 { 0x00100000, MSG_SYS_LWP_SEMA_TRYWAIT_ALT }, 2301 { 0x00200000, MSG_SYS_LWP_DETACH_ALT }, 2302 { 0x00400000, MSG_SYS_CORECTL_ALT }, 2303 { 0x00800000, MSG_SYS_MODCTL_ALT }, 2304 { 0x01000000, MSG_SYS_FCHROOT_ALT }, 2305 { 0x02000000, MSG_SYS_154 }, 2306 { 0x04000000, MSG_SYS_VHANGUP_ALT }, 2307 { 0x08000000, MSG_SYS_GETTIMEOFDAY_ALT }, 2308 { 0x10000000, MSG_SYS_GETITIMER_ALT }, 2309 { 0x20000000, MSG_SYS_SETITIMER_ALT }, 2310 { 0x40000000, MSG_SYS_LWP_CREATE_ALT }, 2311 { 0x80000000, MSG_SYS_LWP_EXIT_ALT }, 2312 { 0, 0 } 2313 }; 2314 static const Val_desc vda5[] = { /* System Calls [161 - 192] */ 2315 { 0x00000001, MSG_SYS_LWP_SUSPEND_ALT }, 2316 { 0x00000002, MSG_SYS_LWP_CONTINUE_ALT }, 2317 { 0x00000004, MSG_SYS_LWP_KILL_ALT }, 2318 { 0x00000008, MSG_SYS_LWP_SELF_ALT }, 2319 { 0x00000010, MSG_SYS_LWP_SIGMASK_ALT }, 2320 { 0x00000020, MSG_SYS_LWP_PRIVATE_ALT }, 2321 { 0x00000040, MSG_SYS_LWP_WAIT_ALT }, 2322 { 0x00000080, MSG_SYS_LWP_MUTEX_WAKEUP_ALT }, 2323 { 0x00000100, MSG_SYS_169 }, 2324 { 0x00000200, MSG_SYS_LWP_COND_WAIT_ALT }, 2325 { 0x00000400, MSG_SYS_LWP_COND_SIGNAL_ALT }, 2326 { 0x00000800, MSG_SYS_LWP_COND_BROADCAST_ALT }, 2327 { 0x00001000, MSG_SYS_PREAD_ALT }, 2328 { 0x00002000, MSG_SYS_PWRITE_ALT }, 2329 { 0x00004000, MSG_SYS_LLSEEK_ALT }, 2330 { 0x00008000, MSG_SYS_INST_SYNC_ALT }, 2331 { 0x00010000, MSG_SYS_BRAND_ALT }, 2332 { 0x00020000, MSG_SYS_KAIO_ALT }, 2333 { 0x00040000, MSG_SYS_CPC_ALT }, 2334 { 0x00080000, MSG_SYS_LGRPSYS_ALT }, 2335 { 0x00100000, MSG_SYS_RUSAGESYS_ALT }, 2336 { 0x00200000, MSG_SYS_PORT_ALT }, 2337 { 0x00400000, MSG_SYS_POLLSYS_ALT }, 2338 { 0x00800000, MSG_SYS_LABELSYS_ALT }, 2339 { 0x01000000, MSG_SYS_ACL_ALT }, 2340 { 0x02000000, MSG_SYS_AUDITSYS_ALT }, 2341 { 0x04000000, MSG_SYS_PROCESSOR_BIND_ALT }, 2342 { 0x08000000, MSG_SYS_PROCESSOR_INFO_ALT }, 2343 { 0x10000000, MSG_SYS_P_ONLINE_ALT }, 2344 { 0x20000000, MSG_SYS_SIGQUEUE_ALT }, 2345 { 0x40000000, MSG_SYS_CLOCK_GETTIME_ALT }, 2346 { 0x80000000, MSG_SYS_CLOCK_SETTIME_ALT }, 2347 { 0, 0 } 2348 }; 2349 static const Val_desc vda6[] = { /* System Calls [193 - 224] */ 2350 { 0x00000001, MSG_SYS_CLOCK_GETRES_ALT }, 2351 { 0x00000002, MSG_SYS_TIMER_CREATE_ALT }, 2352 { 0x00000004, MSG_SYS_TIMER_DELETE_ALT }, 2353 { 0x00000008, MSG_SYS_TIMER_SETTIME_ALT }, 2354 { 0x00000010, MSG_SYS_TIMER_GETTIME_ALT }, 2355 { 0x00000020, MSG_SYS_TIMER_GETOVERRUN_ALT }, 2356 { 0x00000040, MSG_SYS_NANOSLEEP_ALT }, 2357 { 0x00000080, MSG_SYS_FACL_ALT }, 2358 { 0x00000100, MSG_SYS_DOOR_ALT }, 2359 { 0x00000200, MSG_SYS_SETREUID_ALT }, 2360 { 0x00000400, MSG_SYS_SETREGID_ALT }, 2361 { 0x00000800, MSG_SYS_INSTALL_UTRAP_ALT }, 2362 { 0x00001000, MSG_SYS_SIGNOTIFY_ALT }, 2363 { 0x00002000, MSG_SYS_SCHEDCTL_ALT }, 2364 { 0x00004000, MSG_SYS_PSET_ALT }, 2365 { 0x00008000, MSG_SYS_SPARC_UTRAP_INSTALL_ALT }, 2366 { 0x00010000, MSG_SYS_RESOLVEPATH_ALT }, 2367 { 0x00020000, MSG_SYS_LWP_MUTEX_TIMEDLOCK_ALT }, 2368 { 0x00040000, MSG_SYS_LWP_SEMA_TIMEDWAIT_ALT }, 2369 { 0x00080000, MSG_SYS_LWP_RWLOCK_SYS_ALT }, 2370 { 0x00100000, MSG_SYS_GETDENTS64_ALT }, 2371 { 0x00200000, MSG_SYS_MMAP64_ALT }, 2372 { 0x00400000, MSG_SYS_STAT64_ALT }, 2373 { 0x00800000, MSG_SYS_LSTAT64_ALT }, 2374 { 0x01000000, MSG_SYS_FSTAT64_ALT }, 2375 { 0x02000000, MSG_SYS_STATVFS64_ALT }, 2376 { 0x04000000, MSG_SYS_FSTATVFS64_ALT }, 2377 { 0x08000000, MSG_SYS_SETRLIMIT64_ALT }, 2378 { 0x10000000, MSG_SYS_GETRLIMIT64_ALT }, 2379 { 0x20000000, MSG_SYS_PREAD64_ALT }, 2380 { 0x40000000, MSG_SYS_PWRITE64_ALT }, 2381 { 0x80000000, MSG_SYS_224 }, 2382 { 0, 0 } 2383 }; 2384 static const Val_desc vda7[] = { /* System Calls [225 - 256] */ 2385 { 0x00000001, MSG_SYS_OPEN64_ALT }, 2386 { 0x00000002, MSG_SYS_RPCSYS_ALT }, 2387 { 0x00000004, MSG_SYS_ZONE_ALT }, 2388 { 0x00000008, MSG_SYS_AUTOFSSYS_ALT }, 2389 { 0x00000010, MSG_SYS_GETCWD_ALT }, 2390 { 0x00000020, MSG_SYS_SO_SOCKET_ALT }, 2391 { 0x00000040, MSG_SYS_SO_SOCKETPAIR_ALT }, 2392 { 0x00000080, MSG_SYS_BIND_ALT }, 2393 { 0x00000100, MSG_SYS_LISTEN_ALT }, 2394 { 0x00000200, MSG_SYS_ACCEPT_ALT }, 2395 { 0x00000400, MSG_SYS_CONNECT_ALT }, 2396 { 0x00000800, MSG_SYS_SHUTDOWN_ALT }, 2397 { 0x00001000, MSG_SYS_RECV_ALT }, 2398 { 0x00002000, MSG_SYS_RECVFROM_ALT }, 2399 { 0x00004000, MSG_SYS_RECVMSG_ALT }, 2400 { 0x00008000, MSG_SYS_SEND_ALT }, 2401 { 0x00010000, MSG_SYS_SENDMSG_ALT }, 2402 { 0x00020000, MSG_SYS_SENDTO_ALT }, 2403 { 0x00040000, MSG_SYS_GETPEERNAME_ALT }, 2404 { 0x00080000, MSG_SYS_GETSOCKNAME_ALT }, 2405 { 0x00100000, MSG_SYS_GETSOCKOPT_ALT }, 2406 { 0x00200000, MSG_SYS_SETSOCKOPT_ALT }, 2407 { 0x00400000, MSG_SYS_SOCKCONFIG_ALT }, 2408 { 0x00800000, MSG_SYS_NTP_GETTIME_ALT }, 2409 { 0x01000000, MSG_SYS_NTP_ADJTIME_ALT }, 2410 { 0x02000000, MSG_SYS_LWP_MUTEX_UNLOCK_ALT }, 2411 { 0x04000000, MSG_SYS_LWP_MUTEX_TRYLOCK_ALT }, 2412 { 0x08000000, MSG_SYS_LWP_MUTEX_REGISTER_ALT }, 2413 { 0x10000000, MSG_SYS_CLADM_ALT }, 2414 { 0x20000000, MSG_SYS_UUCOPY_ALT }, 2415 { 0x40000000, MSG_SYS_UMOUNT2_ALT }, 2416 /* 256 (unused) */ 2417 { 0, 0 } 2418 }; 2419 static const conv_bitmaskset_desc_t bitmask_desc[N_MASK] = { 2420 { vda0, 0x00000000 }, 2421 { vda1, 0x00000000 }, 2422 { vda2, 0x00000000 }, 2423 { vda3, 0x00000000 }, 2424 { vda4, 0x00000000 }, 2425 { vda5, 0x00000000 }, 2426 { vda6, 0x00000000 }, 2427 { vda7, 0x80000000 }, 2428 { NULL, 0xffffffff }, 2429 { NULL, 0xffffffff }, 2430 { NULL, 0xffffffff }, 2431 { NULL, 0xffffffff }, 2432 { NULL, 0xffffffff }, 2433 { NULL, 0xffffffff }, 2434 { NULL, 0xffffffff }, 2435 { NULL, 0xffffffff } 2436 }; 2437 2438 if (n_mask > N_MASK) 2439 n_mask = N_MASK; 2440 return (conv_bitmaskset(maskarr, n_mask, bitmask_desc, fmt_flags, 2441 cnote_sysset_buf->buf, CONV_CNOTE_SYSSET_BUFSIZE)); 2442 2443 #undef N_MASK 2444 } 2445