2009-04-21 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / support / unistd.c
index 352bdce87d47b41b973084eb6729b12b42958cb9..209c0c1c450c1bae02b7fec90dbdcae168d1d94c 100644 (file)
@@ -4,7 +4,7 @@
  * Authors:
  *   Jonathan Pryor (jonpryor@vt.edu)
  *
- * Copyright (C) 2004-2005 Jonathan Pryor
+ * Copyright (C) 2004-2006 Jonathan Pryor
  */
 
 #ifndef _GNU_SOURCE
@@ -227,36 +227,34 @@ Mono_Posix_Syscall_lockf (int fd, int cmd, mph_off_t len)
        return lockf (fd, cmd, (off_t) len);
 }
 
-void
+int
 Mono_Posix_Syscall_swab (void *from, void *to, mph_ssize_t n)
 {
        if (mph_have_long_overflow (n))
-               return;
+               return -1;
        swab (from, to, (ssize_t) n);
+       return 0;
 }
 
 int
 Mono_Posix_Syscall_setusershell (void)
 {
-       errno = 0;
        setusershell ();
-       return errno == 0 ? 0 : -1;
+       return 0;
 }
 
 int
 Mono_Posix_Syscall_endusershell (void)
 {
-       errno = 0;
        endusershell ();
-       return errno == 0 ? 0 : -1;
+       return 0;
 }
 
 int
 Mono_Posix_Syscall_sync (void)
 {
-       errno = 0;
        sync ();
-       return errno == 0 ? 0 : -1;
+       return 0;
 }