MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sem_modload

Function sem_modload

freebsd/kern/uipc_sem.c:1071–1102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1069}
1070
1071static int
1072sem_modload(struct module *module, int cmd, void *arg)
1073{
1074 int error = 0;
1075
1076 switch (cmd) {
1077 case MOD_LOAD:
1078 error = ksem_module_init();
1079 if (error)
1080 ksem_module_destroy();
1081 break;
1082
1083 case MOD_UNLOAD:
1084 mtx_lock(&ksem_count_lock);
1085 if (nsems != 0) {
1086 error = EOPNOTSUPP;
1087 mtx_unlock(&ksem_count_lock);
1088 break;
1089 }
1090 ksem_dead = 1;
1091 mtx_unlock(&ksem_count_lock);
1092 ksem_module_destroy();
1093 break;
1094
1095 case MOD_SHUTDOWN:
1096 break;
1097 default:
1098 error = EINVAL;
1099 break;
1100 }
1101 return (error);
1102}
1103
1104static moduledata_t sem_mod = {
1105 "sem",

Callers

nothing calls this directly

Calls 4

ksem_module_initFunction · 0.85
ksem_module_destroyFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected