lab_Unix/L9/es_queue/01-init.c
//Print queue status with useful informations
Print queue status with useful informations
Print queue status with useful informations
void print_info_stats(int q_id){
  struct msqid_ds stat;
  int ret_val;
  while (ret_val = msgctl(q_id, IPC_STAT, &stat)) {
		TEST_ERROR;
	}
  printf("\n----------------------\n");
  printf("Info about the queue: \n");
  printf("Queue dimension: %ld\n", stat.msg_qbytes); 
  printf("Number of messages in the queue: %ld\n", stat.msg_qnum); 
  printf("Time of the last received message: %ld\n", stat.msg_stime); 
  printf("----------------------\n\n");
}
void print_info_stats ( int q_id ) { struct msqid_ds stat ; int ret_val ; while ( ret_val = msgctl ( q_id , IPC_STAT , & stat ) ) { TEST_ERROR ; } printf ( " \n \n " ) ; printf ( " \n " ) ; printf ( " \n " , stat . msg_qbytes ) ; printf ( " \n " , stat . msg_qnum ) ; printf ( " \n " , stat . msg_stime ) ; printf ( " \n \n " ) ; }
Print queue status with useful informations
Print queue status with useful informations
//Queue dimension //Number of messages //Time of the last message sent