projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove the processing of the Cecil docs
[mono.git]
/
support
/
stdio.c
diff --git
a/support/stdio.c
b/support/stdio.c
index 0ab5a11243c0ec71356f318c7e7c0964dd375ccb..78c900e9d9b2afeb460a3d24d7d0614d7bf7a027 100644
(file)
--- a/
support/stdio.c
+++ b/
support/stdio.c
@@
-16,7
+16,7
@@
G_BEGIN_DECLS
G_BEGIN_DECLS
-#ifndef
PLATFORM
_WIN32
+#ifndef
HOST
_WIN32
gint32
Mono_Posix_Syscall_L_ctermid (void)
{
gint32
Mono_Posix_Syscall_L_ctermid (void)
{
@@
-26,9
+26,13
@@
Mono_Posix_Syscall_L_ctermid (void)
gint32
Mono_Posix_Syscall_L_cuserid (void)
{
gint32
Mono_Posix_Syscall_L_cuserid (void)
{
+#ifdef __APPLE__
+ return -1;
+#else
return L_cuserid;
return L_cuserid;
+#endif
}
}
-#endif /* ndef
PLATFORM
_WIN32 */
+#endif /* ndef
HOST
_WIN32 */
mph_size_t
Mono_Posix_Stdlib_fread (unsigned char *ptr, mph_size_t size, mph_size_t nmemb, void *stream)
mph_size_t
Mono_Posix_Stdlib_fread (unsigned char *ptr, mph_size_t size, mph_size_t nmemb, void *stream)
@@
-148,9
+152,8
@@
Mono_Posix_Stdlib_setvbuf (void* stream, void *buf, int mode, mph_size_t size)
int
Mono_Posix_Stdlib_setbuf (void* stream, void* buf)
{
int
Mono_Posix_Stdlib_setbuf (void* stream, void* buf)
{
- errno = 0;
setbuf (stream, buf);
setbuf (stream, buf);
- return
errno == 0 ? 0 : -1
;
+ return
0
;
}
gint32
}
gint32
@@
-189,25
+192,27
@@
Mono_Posix_Stdlib_fsetpos (void* stream, void *pos)
int
Mono_Posix_Stdlib_rewind (void* stream)
{
int
Mono_Posix_Stdlib_rewind (void* stream)
{
- errno = 0;
- rewind (stream);
- return errno == 0 ? 0 : -1;
+ do {
+ rewind (stream);
+ } while (errno == EINTR);
+ mph_return_if_val_in_list5(errno, EAGAIN, EBADF, EFBIG, EINVAL, EIO);
+ mph_return_if_val_in_list5(errno, ENOSPC, ENXIO, EOVERFLOW, EPIPE, ESPIPE);
+ return 0;
}
int
Mono_Posix_Stdlib_clearerr (void* stream)
{
}
int
Mono_Posix_Stdlib_clearerr (void* stream)
{
- errno = 0;
clearerr (((FILE*) stream));
clearerr (((FILE*) stream));
- return
errno == 0 ? 0 : -1
;
+ return
0
;
}
int
}
int
-Mono_Posix_Stdlib_perror (const char* s)
+Mono_Posix_Stdlib_perror (const char* s
, int err
)
{
{
- errno =
0
;
+ errno =
err
;
perror (s);
perror (s);
- return
errno == 0 ? 0 : -1
;
+ return
0
;
}
#define MPH_FPOS_LENGTH (sizeof(fpos_t)*2)
}
#define MPH_FPOS_LENGTH (sizeof(fpos_t)*2)