]>
wirehaze git hosting - ppos.git/blob - ppos/kernel/mqueue.h
1 // PingPongOS - PingPong Operating System
2 // Prof. Carlos A. Maziero, DINF UFPR
3 // Versão 2.0 -- Junho de 2025
5 // ATENÇÃO: ESTE ARQUIVO NÃO DEVE SER ALTERADO;
6 // ALTERAÇÕES SERÃO DESCARTADAS NA CORREÇÃO.
8 #ifndef __PPOS_MQUEUE__
9 #define __PPOS_MQUEUE__
11 // Estrutura que define uma fila de mensagens (struct opaco).
12 // Este struct deve ser redefinido em mqueue.c
15 // inicia o subsistema de filas de mensagens
18 // cria uma fila de mensagens.
19 // Retorno: ptr para a nova fila ou NULL
20 struct mqueue_t
*mqueue_create(int max_msgs
, int msg_size
);
22 // destroi uma fila de mensagens, liberando recursos e tarefas
23 // Retorno: NOERROR ou ERROR
24 int mqueue_destroy(struct mqueue_t
*queue
);
27 // Retorno: NOERROR ou ERROR
28 int mqueue_send(struct mqueue_t
*queue
, void *msg
);
30 // recebe uma mensagem
31 // Retorno: NOERROR ou ERROR
32 int mqueue_recv(struct mqueue_t
*queue
, void *msg
);
34 // retorna o numero de mensagens em uma fila
35 // Retorno: número >= 0 ou ERROR
36 int mqueue_msgs(struct mqueue_t
*queue
);