summaryrefslogtreecommitdiff
path: root/rt/mq_open.c
diff options
context:
space:
mode:
Diffstat (limited to 'rt/mq_open.c')
-rw-r--r--rt/mq_open.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/rt/mq_open.c b/rt/mq_open.c
index dea5741d5a..77d872ea20 100644
--- a/rt/mq_open.c
+++ b/rt/mq_open.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <errno.h>
#include <mqueue.h>
+#include <stdio.h>
/* Establish connection between a process and a message queue NAME and
return message queue descriptor or (mqd_t) -1 on error. OFLAG determines
@@ -27,10 +28,21 @@
attributes. If the fourth argument is NULL, default attributes are
used. */
mqd_t
-mq_open (const char *name, int oflag, ...)
+__mq_open (const char *name, int oflag, ...)
{
__set_errno (ENOSYS);
return (mqd_t) -1;
}
+strong_alias (__mq_open, mq_open);
stub_warning (mq_open)
+
+mqd_t
+__mq_open_2 (const char *name, int oflag)
+{
+ if (oflag & O_CREAT)
+ __fortify_fail ("invalid mq_open call: O_CREAT without mode and attr");
+
+ return __mq_open (name, oflag);
+}
+stub_warning (__mq_open_2)
#include <stub-tag.h>