logo

Crowdly

[BasicOS] Fundamentals in Operating Systems (APVRILLE, Ludovic)

Шукаєте відповіді та рішення тестів для [BasicOS] Fundamentals in Operating Systems (APVRILLE, Ludovic)? Перегляньте нашу велику колекцію перевірених відповідей для [BasicOS] Fundamentals in Operating Systems (APVRILLE, Ludovic) в moodle.eurecom.fr.

Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!

Which following claims are correct? Thee claims are related to the differences between system calls and functions of libraries.

Переглянути це питання

Check all the correct claims which concern the code below.

The following code makes it

possible to exchange signals between a sender and a receiver. We assume

that the receiver is started a few seconds before the sender. Also, the

command line to start the sender provides the process id of receiver.

Last but not least, we assume that all works as

expected (no process is killed during execution, etc.)

Receiver code:

void getSignal(int signo) {

  if (signo == SIGUSR1) {

    printf("Received SIGUSR1\n");

  } else {

    printf("Received%d\n", signo);

  }

}

int main(void)

{

  printf("Registering SIGUSR1 signal / #SIGUSR1=%d\n", SIGUSR1);

  signal(SIGUSR1, getSignal);

  sleep(30);

}

Sender code:

int main(int argc, char**argv) {

  int pid;

  if (argc <2) {

    printf("Usage: sender <destination process pid>\n");

    exit(-1);

 

}

  pid = atoi(argv[1]);

  printf("Sending SIGURG to %d\n", pid);

  kill(pid, SIGURG);

  printf("Sending SIGUSR1 to %d\n", pid);

  kill(pid, SIGUSR1);

  printf("Sending SIGUSR1 to %d\n", pid);

  kill(pid, SIGUSR1);

 }

0%
0%
Переглянути це питання

Хочете миттєвий доступ до всіх перевірених відповідей на moodle.eurecom.fr?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!