Module: xenomai-forge
Branch: next
Commit: 65f220ebf17c46daa379e1600a4213adc97f13fc
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=65f220ebf17c46daa379e1600a4213adc97f13fc

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue Jun 25 16:37:16 2013 +0200

include/cobalt: drop override of errno.h

We don't need any errno support in kernel space since we dropped the
intra-kernel API there, and we don't extend the userland section of
this file either. Just drop it.

---

 include/cobalt/Makefile.am       |    1 -
 include/cobalt/Makefile.in       |    1 -
 include/cobalt/errno.h           |   43 --------------------------------------
 kernel/cobalt/posix/clock.c      |    2 +-
 kernel/cobalt/posix/internal.h   |    1 -
 kernel/cobalt/posix/mutex_attr.c |    4 +-
 kernel/cobalt/posix/thread.c     |    4 +-
 7 files changed, 5 insertions(+), 51 deletions(-)

diff --git a/include/cobalt/Makefile.am b/include/cobalt/Makefile.am
index f24b617..b8990a4 100644
--- a/include/cobalt/Makefile.am
+++ b/include/cobalt/Makefile.am
@@ -2,7 +2,6 @@ includesubdir = $(includedir)/cobalt
 
 includesub_HEADERS = \
        core.h \
-       errno.h \
        fcntl.h \
        mqueue.h \
        pthread.h \
diff --git a/include/cobalt/Makefile.in b/include/cobalt/Makefile.in
index df6e59a..1e7f9ff 100644
--- a/include/cobalt/Makefile.in
+++ b/include/cobalt/Makefile.in
@@ -313,7 +313,6 @@ top_srcdir = @top_srcdir@
 includesubdir = $(includedir)/cobalt
 includesub_HEADERS = \
        core.h \
-       errno.h \
        fcntl.h \
        mqueue.h \
        pthread.h \
diff --git a/include/cobalt/errno.h b/include/cobalt/errno.h
deleted file mode 100644
index e47ea74..0000000
--- a/include/cobalt/errno.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2006 Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _COBALT_ERRNO_H
-#define _COBALT_ERRNO_H
-
-#ifdef __KERNEL__
-
-#include <linux/errno.h>
-#include <linux/unistd.h>         /* conflicting declaration of errno. */
-
-struct xnthread;
-
-/* errno values pasted from Linux asm/errno.h and bits/errno.h (ENOTSUP). */
-#define ENOTSUP         EOPNOTSUPP
-#define        ETIMEDOUT       110     /* Connection timed out */
-
-#define errno (*xnthread_get_errno_location(xnpod_current_thread()))
-
-int *xnthread_get_errno_location(struct xnthread *thread);
-
-#else /* !__KERNEL__ */
-
-#include_next <errno.h>
-
-#endif /* !__KERNEL__ */
-
-#endif /* !_COBALT_ERRNO_H */
diff --git a/kernel/cobalt/posix/clock.c b/kernel/cobalt/posix/clock.c
index 58418cf..d518068 100644
--- a/kernel/cobalt/posix/clock.c
+++ b/kernel/cobalt/posix/clock.c
@@ -218,7 +218,7 @@ int cobalt_clock_nanosleep(clockid_t clock_id, int flags,
        if (clock_id != CLOCK_MONOTONIC &&
            clock_id != CLOCK_MONOTONIC_RAW &&
            clock_id != CLOCK_REALTIME)
-               return -ENOTSUP;
+               return -EOPNOTSUPP;
 
        if ((unsigned long)rqt.tv_nsec >= ONE_BILLION)
                return -EINVAL;
diff --git a/kernel/cobalt/posix/internal.h b/kernel/cobalt/posix/internal.h
index 82ed400..5362abd 100644
--- a/kernel/cobalt/posix/internal.h
+++ b/kernel/cobalt/posix/internal.h
@@ -19,7 +19,6 @@
 #ifndef _COBALT_INTERNAL_H
 #define _COBALT_INTERNAL_H
 
-#include <errno.h>
 #include <pthread.h>
 #include <sched.h>
 #include <signal.h>
diff --git a/kernel/cobalt/posix/mutex_attr.c b/kernel/cobalt/posix/mutex_attr.c
index ab8f386..18a201b 100644
--- a/kernel/cobalt/posix/mutex_attr.c
+++ b/kernel/cobalt/posix/mutex_attr.c
@@ -274,7 +274,7 @@ pthread_mutexattr_getprotocol(const pthread_mutexattr_t * 
attr, int *proto)
  * @return 0 on success,
  * @return an error number if:
  * - EINVAL, the mutex attributes object @a attr is invalid;
- * - ENOTSUP, the value of @a proto is unsupported;
+ * - EOPNOTSUPP, the value of @a proto is unsupported;
  * - EINVAL, the value of @a proto is invalid.
  *
  * @see
@@ -306,7 +306,7 @@ pthread_mutexattr_setprotocol(pthread_mutexattr_t * attr, 
int proto)
        case PTHREAD_PRIO_PROTECT:
 
                xnlock_put_irqrestore(&nklock, s);
-               return ENOTSUP;
+               return EOPNOTSUPP;
 
        case PTHREAD_PRIO_NONE:
        case PTHREAD_PRIO_INHERIT:
diff --git a/kernel/cobalt/posix/thread.c b/kernel/cobalt/posix/thread.c
index 5c06aca..15fc57f 100644
--- a/kernel/cobalt/posix/thread.c
+++ b/kernel/cobalt/posix/thread.c
@@ -479,7 +479,7 @@ static inline int pthread_create(pthread_t *tid, const 
pthread_attr_t *attr)
  * @return an error number if:
  * - ESRCH, @a thread is invalid;
  * - ETIMEDOUT, the start time has already passed.
- * - ENOTSUP, the specified clock is unsupported;
+ * - EOPNOTSUPP, the specified clock is unsupported;
  *
  * Rescheduling: always, until the @a starttp start time has been reached.
  */
@@ -496,7 +496,7 @@ static inline int pthread_make_periodic_np(pthread_t thread,
        if (clock_id != CLOCK_MONOTONIC &&
            clock_id != CLOCK_MONOTONIC_RAW &&
            clock_id != CLOCK_REALTIME)
-               return ENOTSUP;
+               return EOPNOTSUPP;
 
        xnlock_get_irqsave(&nklock, s);
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to