| 1024 | } |
| 1025 | |
| 1026 | void |
| 1027 | msgbufinit(void *ptr, int size) |
| 1028 | { |
| 1029 | char *cp; |
| 1030 | static struct msgbuf *oldp = NULL; |
| 1031 | bool print_boot_tag; |
| 1032 | |
| 1033 | size -= sizeof(*msgbufp); |
| 1034 | cp = (char *)ptr; |
| 1035 | print_boot_tag = !msgbufmapped; |
| 1036 | /* Attempt to fetch kern.boot_tag tunable on first mapping */ |
| 1037 | if (!msgbufmapped) |
| 1038 | TUNABLE_STR_FETCH("kern.boot_tag", current_boot_tag, |
| 1039 | sizeof(current_boot_tag)); |
| 1040 | msgbufp = (struct msgbuf *)(cp + size); |
| 1041 | msgbuf_reinit(msgbufp, cp, size); |
| 1042 | if (msgbufmapped && oldp != msgbufp) |
| 1043 | msgbuf_copy(oldp, msgbufp); |
| 1044 | msgbufmapped = true; |
| 1045 | if (print_boot_tag && *current_boot_tag != '\0') |
| 1046 | printf("%s\n", current_boot_tag); |
| 1047 | oldp = msgbufp; |
| 1048 | } |
| 1049 | |
| 1050 | /* Sysctls for accessing/clearing the msgbuf */ |
| 1051 | static int |
no test coverage detected