Sun Microsystems Netra 210 Guide D'administration page 90

Masquer les pouces Voir aussi pour Netra 210:
Table des Matières

Publicité

Exemple de programme pour l'obtention et la définition du statut des alarmes
EXEMPLE DE CODE A-1
(get et set) (suite)
static int
parse_alarm(const char *alarm)
{
int altype;
if (strcmp(alarm, "crit") == 0)
else
if (strcmp(alarm, "major") == 0)
else
if (strcmp(alarm, "minor") == 0)
else
if (strcmp(alarm, "user") == 0)
else {
}
return (altype);
}
static int
lom_ioctl(int ioc, char *buf)
{
int fd, ret;
fd = open(LOM_DEVICE, O_RDWR);
if (fd == -1) {
}
ret = ioctl(fd, ioc, (void *)buf);
close (fd);
return (ret);
}
static char *
74
Guide d'administration système du serveur Netra 210 • mars 2006
altype = ALARM_CRITICAL;
altype = ALARM_MAJOR;
altype = ALARM_MINOR;
altype = ALARM_USER;
printf("invalid alarm value: %s\n", alarm);
altype = ALARM_INVALID;
printf("Error opening device: %s\n", LOM_DEVICE);
exit (1);

Publicité

Table des Matières
loading

Table des Matières