mq_notify.c 694 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * mq_notify.c - notify process that a message is available.
  3. */
  4. #include <errno.h>
  5. #include <stddef.h>
  6. #include <sys/syscall.h>
  7. #include <mqueue.h>
  8. #ifdef __NR_mq_notify
  9. #define __NR___syscall_mq_notify __NR_mq_notify
  10. static __inline__ _syscall2(int, __syscall_mq_notify, int, mqdes,
  11. const void *, notification);
  12. /* Register notification upon message arrival to an empty message queue */
  13. int mq_notify(mqd_t mqdes, const struct sigevent *notification)
  14. {
  15. /* We don't support SIGEV_THREAD notification yet */
  16. if (notification != NULL && notification->sigev_notify == SIGEV_THREAD) {
  17. __set_errno(ENOSYS);
  18. return -1;
  19. }
  20. return __syscall_mq_notify(mqdes, notification);
  21. }
  22. #endif