This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libgo patch committed: Correct ENOSYS functions


I foolishly messed up writing the ENOSYS functions for systems which
don't have them.  I had them return ENOSYS, rather than setting errno
and returning an error indicator.  This patch corrects this oversight.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.

Ian

diff -r a79fa0b4c24e libgo/runtime/go-nosys.c
--- a/libgo/runtime/go-nosys.c	Thu Feb 02 14:21:14 2012 -0800
+++ b/libgo/runtime/go-nosys.c	Thu Feb 02 14:57:54 2012 -0800
@@ -31,7 +31,8 @@
 int
 epoll_create1 (int flags __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -42,7 +43,8 @@
 	   int mode __attribute__ ((unused)),
 	   int flags __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -53,7 +55,8 @@
 	  mode_t mode __attribute__ ((unused)),
 	  int flags __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -65,7 +68,8 @@
 	  gid_t group __attribute__ ((unused)),
 	  int flags __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -75,7 +79,8 @@
 	   const char *pathname __attribute__ ((unused)),
 	   const struct timeval times[2] __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -85,7 +90,8 @@
 		   const char* pathname __attribute__ ((unused)),
 		   uint32_t mask __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -93,7 +99,8 @@
 int
 inotify_init (void)
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -102,7 +109,8 @@
 inotify_rm_watch (int fd __attribute__ ((unused)),
 		  uint32_t wd __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -112,7 +120,8 @@
 	 const char *pathname __attribute__ ((unused)),
 	 mode_t mode __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -123,7 +132,8 @@
 	 mode_t mode __attribute__ ((unused)),
 	 dev_t dev __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -134,7 +144,8 @@
 	int oflag __attribute__ ((unused)),
 	...)
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -145,7 +156,8 @@
 	  int newdirfd __attribute__ ((unused)),
 	  const char *newpath __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -158,7 +170,8 @@
 	size_t len __attribute__ ((unused)),
 	unsigned int flags __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -169,7 +182,8 @@
      size_t len __attribute__ ((unused)),
      unsigned int flags __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -179,7 +193,8 @@
 	  const char *pathname __attribute__ ((unused)),
 	  int flags __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -187,6 +202,7 @@
 int
 unshare (int flags __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]