| 1 |
/**************************************************************************/ |
| 2 |
/* */ |
| 3 |
/* This file is part of Frama-C. */ |
| 4 |
/* */ |
| 5 |
/* Copyright (C) 2007-2022 */ |
| 6 |
/* CEA (Commissariat à l'énergie atomique et aux énergies */ |
| 7 |
/* alternatives) */ |
| 8 |
/* */ |
| 9 |
/* you can redistribute it and/or modify it under the terms of the GNU */ |
| 10 |
/* Lesser General Public License as published by the Free Software */ |
| 11 |
/* Foundation, version 2.1. */ |
| 12 |
/* */ |
| 13 |
/* It is distributed in the hope that it will be useful, */ |
| 14 |
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ |
| 15 |
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ |
| 16 |
/* GNU Lesser General Public License for more details. */ |
| 17 |
/* */ |
| 18 |
/* See the GNU Lesser General Public License version 2.1 */ |
| 19 |
/* for more details (enclosed in the file licenses/LGPLv2.1). */ |
| 20 |
/* */ |
| 21 |
/**************************************************************************/ |
| 22 |
|
| 23 |
#ifndef __FC_MQUEUE |
| 24 |
#define __FC_MQUEUE |
| 25 |
#include "features.h" |
| 26 |
__PUSH_FC_STDLIB |
| 27 |
#include "__fc_define_size_t.h" |
| 28 |
#include "__fc_define_ssize_t.h" |
| 29 |
#include "signal.h" |
| 30 |
|
| 31 |
__BEGIN_DECLS |
| 32 |
|
| 33 |
typedef int mqd_t; |
| 34 |
|
| 35 |
struct mq_attr { |
| 36 |
long mq_flags; |
| 37 |
long mq_maxmsg; |
| 38 |
long mq_msgsize; |
| 39 |
long mq_curmsgs; |
| 40 |
}; |
| 41 |
|
| 42 |
extern int mq_close(mqd_t mqdes); |
| 43 |
|
| 44 |
extern int mq_getattr(mqd_t mqdes, struct mq_attr *mqstat); |
| 45 |
|
| 46 |
extern int mq_notify(mqd_t mqdes, const struct sigevent *notification); |
| 47 |
|
| 48 |
extern mqd_t mq_open(const char *name, int oflag, ...); |
| 49 |
|
| 50 |
extern ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, size_t msg_len, |
| 51 |
unsigned *msg_prio); |
| 52 |
|
| 53 |
extern int mq_send(mqd_t mqdes, const char *msg_ptr, size_t msg_len, |
| 54 |
unsigned msg_prio); |
| 55 |
|
| 56 |
extern int mq_setattr(mqd_t mqdes, const struct mq_attr *restrict mqstat, |
| 57 |
struct mq_attr *restrict omqstat); |
| 58 |
|
| 59 |
extern ssize_t mq_timedreceive(mqd_t mqdes, char *restrict msg_ptr, |
| 60 |
size_t msg_len, unsigned *restrict msg_prio, |
| 61 |
const struct timespec *restrict abstime); |
| 62 |
|
| 63 |
extern int mq_timedsend(mqd_t mqdes, const char *msg_ptr, size_t msg_len, |
| 64 |
unsigned msg_prio, const struct timespec *abstime); |
| 65 |
|
| 66 |
extern int mq_unlink(const char *name); |
| 67 |
|
| 68 |
__END_DECLS |
| 69 |
|
| 70 |
__POP_FC_STDLIB |
| 71 |
#endif |