ppos

Usermode educational operating system.
Log | Files | Refs

mqueue.h (1081B)


      1 // PingPongOS - PingPong Operating System
      2 // © Prof. Carlos A. Maziero, DINF UFPR
      3 // Versão 2.1 -- 06/2026
      4 
      5 // ATENÇÃO: ESTE ARQUIVO NÃO DEVE SER ALTERADO;
      6 // ALTERAÇÕES SERÃO DESCARTADAS NA CORREÇÃO.
      7 
      8 // Gerência de filas de mensagens
      9 
     10 #ifndef __PPOS_MQUEUE__
     11 #define __PPOS_MQUEUE__
     12 
     13 // inicia o subsistema de filas de mensagens
     14 // (chamada pelo núcleo na inicialização).
     15 void mqueue_init();
     16 
     17 // encerra o subsistema de filas de mensagens
     18 // (chamada pelo núcleo no encerramento).
     19 void mqueue_term();
     20 
     21 // cria uma fila de mensagens.
     22 // Retorno: descritor da nova fila ou ERROR
     23 int mqueue_create(int max_msgs, int msg_size);
     24 
     25 // destrói uma fila de mensagens, liberando recursos e tarefas
     26 // Retorno: NOERROR ou ERROR
     27 int mqueue_destroy(int mqueue_id);
     28 
     29 // envia uma mensagem
     30 // Retorno: NOERROR ou ERROR
     31 int mqueue_send(int mqueue_id, void *msg);
     32 
     33 // recebe uma mensagem
     34 // Retorno: NOERROR ou ERROR
     35 int mqueue_recv(int mqueue_id, void *msg);
     36 
     37 // retorna o numero de mensagens em uma fila
     38 // Retorno: número >= 0 ou ERROR
     39 int mqueue_msgs(int mqueue_id);
     40 
     41 #endif