+ clearerr (((FILE*) stream));
+ return 0;
+}
+
+int
+Mono_Posix_Stdlib_perror (const char* s, int err)
+{
+ errno = err;
+ perror (s);
+ return 0;
+}
+
+#define MPH_FPOS_LENGTH (sizeof(fpos_t)*2)
+
+int
+Mono_Posix_Stdlib_DumpFilePosition (char *dest, void *pos, gint32 len)
+{
+ char *destp;
+ unsigned char *posp, *pose;
+
+ if (dest == NULL)
+ return MPH_FPOS_LENGTH;
+
+ if (pos == NULL || len <= 0) {
+ errno = EINVAL;
+ return -1;
+ }
+
+ posp = (unsigned char*) pos;
+ pose = posp + sizeof(fpos_t);
+ destp = dest;
+
+ for ( ; posp < pose && len > 1; destp += 2, ++posp, len -= 2) {
+ sprintf (destp, "%02X", *posp);
+ }
+
+ if (len)
+ dest[MPH_FPOS_LENGTH] = '\0';
+
+ return destp - dest;