Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* dirent.c, errno.c, fcntl.c, fstab.c, grp.c, macros.c, pwd.c, signa…

…l.c,

	  stdio.c, stdlib.c, string.c, sys-mman.c, sys-sendfile.c, sys-stat.c, 
	  sys-statvfs.c, sys-time.c, sys-xattr.c syslog.c, time.c, unistd.c, 
	  utime.c: Remove structure definitions, and use the
	  create-native-map generated definitions within map.h.  Update function
	  prototypes to match current map.h declarations.
	* map.c, map.h: Flush (current create-native-map output).
	* mph.h: Don't include "map-icalls.h"; "icalls" are now in map.h.
	* create-native-map.exe: Added; cached version of create-native-map.exe
	  used to update map.c, map.h.  (create-native-map.exe source within
	  mono-tools/create-native-map.)
	* Makefile.am: Added update-create-native-map target to update 
	  create-native-map.exe using pkg-config & the create-native-map.pc package. 
		Use create-native-map.exe to generate map.* files instead of make-map.exe.
	* sys-statvfs.c: Add Mono_Posix_ToStatvfs, Mono_Posix_FromStatvfs exports.

svn path=/trunk/mono/; revision=66946
  • Loading branch information...
commit 37829d3208d9a2e9823ecd52f8d970bb09e52b10 1 parent f2cb628
Jonathan Pryor authored
View
18 support/ChangeLog
@@ -1,3 +1,21 @@
+2006-10-24 Jonathan Pryor <jonpryor@vt.edu>
+
+ * dirent.c, errno.c, fcntl.c, fstab.c, grp.c, macros.c, pwd.c, signal.c,
+ stdio.c, stdlib.c, string.c, sys-mman.c, sys-sendfile.c, sys-stat.c,
+ sys-statvfs.c, sys-time.c, sys-xattr.c syslog.c, time.c, unistd.c,
+ utime.c: Remove structure definitions, and use the
+ create-native-map generated definitions within map.h. Update function
+ prototypes to match current map.h declarations.
+ * map.c, map.h: Flush (current create-native-map output).
+ * mph.h: Don't include "map-icalls.h"; "icalls" are now in map.h.
+ * create-native-map.exe: Added; cached version of create-native-map.exe
+ used to update map.c, map.h. (create-native-map.exe source within
+ mono-tools/create-native-map.)
+ * Makefile.am: Added update-create-native-map target to update
+ create-native-map.exe using pkg-config & the create-native-map.pc package.
+ Use create-native-map.exe to generate map.* files instead of make-map.exe.
+ * sys-statvfs.c: Add Mono_Posix_ToStatvfs, Mono_Posix_FromStatvfs exports.
+
2006-09-15 Jonathan Pryor <jonpryor@vt.edu>
* Makefile.am: Remove CRYPT_LIBS use; we no longer rely on libcrypt.
View
33 support/Makefile.am
@@ -86,9 +86,40 @@ libMonoSupportW_la_SOURCES = \
libMonoSupportW_la_LIBADD = \
$(GLIB_LIBS)
+update-create-native-map:
+ cp `pkg-config --variable=Programs create-native-map` .
+
#
# Use this target to refresh the values in map.[ch]
#
refresh:
- $(top_builddir)/runtime/mono-wrapper $(mcs_topdir)/class/Mono.Posix/Mono.Unix.Native/make-map.exe $(mcs_topdir)/class/lib/default/Mono.Posix.dll map
+ $(top_builddir)/runtime/mono-wrapper create-native-map.exe \
+ --autoconf-member=d_off \
+ --autoconf-member=d_reclen \
+ --autoconf-member=d_type \
+ --exclude-native-symbol=Mono_Posix_Stdlib_snprintf \
+ --impl-macro=_GNU_SOURCE --impl-macro=_XOPEN_SOURCE \
+ --impl-header="<sys/types.h>" \
+ --impl-header="<sys/stat.h>" \
+ --impl-header="<sys/time.h>" \
+ --autoconf-header="<sys/poll.h>" \
+ --autoconf-header="<sys/wait.h>" \
+ --autoconf-header="<sys/statvfs.h>" \
+ --autoconf-header="<sys/xattr.h>" \
+ --autoconf-header="<sys/mman.h>" \
+ --impl-header="<unistd.h>" \
+ --impl-header="<fcntl.h>" \
+ --impl-header="<signal.h>" \
+ --autoconf-header="<poll.h>" \
+ --autoconf-header="<grp.h>" \
+ --impl-header="<errno.h>" \
+ --autoconf-header="<syslog.h>" \
+ --impl-header="<dirent.h>" \
+ --impl-header="<utime.h>" \
+ --rename-member=st_atime=st_atime_ \
+ --rename-member=st_ctime=st_ctime_ \
+ --rename-member=st_mtime=st_mtime_ \
+ --rename-namespace=Mono.Unix.Native=Mono.Posix \
+ --library=MonoPosixHelper \
+ $(mcs_topdir)/class/lib/net_2_0/Mono.Posix.dll map
View
BIN  support/create-native-map.exe
Binary file not shown
View
9 support/dirent.c
@@ -13,18 +13,11 @@
#include <stdlib.h>
#include <unistd.h>
+#include "map.h"
#include "mph.h"
G_BEGIN_DECLS
-struct Mono_Posix_Syscall__Dirent {
- /* ino_t */ mph_ino_t d_ino;
- /* off_t */ mph_off_t d_off;
- /* ushort */ unsigned short d_reclen;
- /* byte */ unsigned char d_type;
- /* string */ char *d_name;
-};
-
gint32
Mono_Posix_Syscall_seekdir (void *dir, mph_off_t offset)
{
View
1  support/errno.c
@@ -4,6 +4,7 @@
#include <errno.h>
#include <string.h>
+#include "map.h"
#include "mph.h"
#include <stdio.h>
View
10 support/fcntl.c
@@ -4,7 +4,7 @@
* Authors:
* Jonathan Pryor (jonpryor@vt.edu)
*
- * Copyright (C) 2004 Jonathan Pryor
+ * Copyright (C) 2004, 2006 Jonathan Pryor
*/
#ifndef _GNU_SOURCE
@@ -22,14 +22,6 @@
G_BEGIN_DECLS
-struct Mono_Posix_Flock {
- gint16 l_type;
- gint16 l_whence;
- mph_off_t l_start;
- mph_off_t l_len;
- mph_pid_t l_pid;
-};
-
gint32
Mono_Posix_Syscall_fcntl (gint32 fd, gint32 cmd)
{
View
16 support/fstab.c
@@ -13,6 +13,7 @@
#include <stdlib.h>
#include <stddef.h>
+#include "map.h"
#include "mph.h"
#if defined (HAVE_CHECKLIST_H)
@@ -27,18 +28,6 @@
G_BEGIN_DECLS
-struct Mono_Posix_Syscall__Fstab {
- char *fs_spec; /* block device name */
- char *fs_file; /* mount point */
- char *fs_vfstype; /* filesystem type */
- char *fs_mntops; /* mount options */
- char *fs_type; /* rw/rq/ro/sw/xx option */
- int fs_freq; /* dump frequency, in days */
- int fs_passno; /* pass number on parallel dump */
-
- char *_fs_buf_;
-};
-
#ifdef HAVE_CHECKLIST_H
typedef struct checklist mph_fstab;
@@ -245,10 +234,11 @@ getfsspec (const char *special_file)
#if defined (HAVE_FSTAB_H) || defined (HAVE_CHECKPOINT_H) || defined (HAVE_SYS_VFSTAB_H)
-void
+int
Mono_Posix_Syscall_endfsent (void)
{
endfsent ();
+ return 0;
}
gint32
View
18 support/grp.c
@@ -16,19 +16,11 @@
#include <string.h>
#include <unistd.h> /* for setgroups on Mac OS X */
+#include "map.h"
#include "mph.h"
G_BEGIN_DECLS
-struct Mono_Posix_Syscall__Group {
- /* string */ char *gr_name;
- /* string */ char *gr_passwd;
- /* gid_t */ mph_gid_t gr_gid;
- /* int */ int _gr_nmem_;
- /* string */ char **gr_mem;
- /* string */ char *_gr_buf_; /* holds all but gr_mem */
-};
-
static void
count_members (char **gr_mem, int *count, size_t *mem)
{
@@ -56,7 +48,7 @@ copy_group (struct Mono_Posix_Syscall__Group *to, struct group *from)
{
size_t nlen, plen, buflen;
int i, count;
- char *cur;
+ char *cur, **to_mem;
to->gr_gid = from->gr_gid;
@@ -83,7 +75,7 @@ copy_group (struct Mono_Posix_Syscall__Group *to, struct group *from)
to->_gr_nmem_ = count;
cur = to->_gr_buf_ = (char*) malloc (buflen);
- to->gr_mem = (char **) malloc (sizeof(char*)*(count+1));
+ to_mem = to->gr_mem = malloc (sizeof(char*)*(count+1));
if (to->_gr_buf_ == NULL || to->gr_mem == NULL) {
free (to->_gr_buf_);
free (to->gr_mem);
@@ -96,10 +88,10 @@ copy_group (struct Mono_Posix_Syscall__Group *to, struct group *from)
cur += (plen + 1);
for (i = 0; i != count; ++i) {
- to->gr_mem[i] = strcpy (cur, from->gr_mem[i]);
+ to_mem [i] = strcpy (cur, from->gr_mem[i]);
cur += (strlen (from->gr_mem[i])+1);
}
- to->gr_mem[i] = NULL;
+ to_mem [i] = NULL;
return 0;
}
View
6 support/macros.c
@@ -81,18 +81,18 @@ int helper_Mono_Posix_Stat(const char *filename, int dereference,
return 0;
}
-const char *helper_Mono_Posix_GetUserName(int uid) {
+char *helper_Mono_Posix_GetUserName(int uid) {
struct passwd *p = getpwuid(uid);
if (p == NULL) return NULL;
return strdup (p->pw_name);
}
-const char *helper_Mono_Posix_GetGroupName(int gid) {
+char *helper_Mono_Posix_GetGroupName(int gid) {
struct group *p = getgrgid(gid);
if (p == NULL) return NULL;
return strdup (p->gr_name);
}
-const char *helper_Mono_Posix_readdir(void *dir) {
+char *helper_Mono_Posix_readdir(void *dir) {
struct dirent* e = readdir((DIR*) dir);
if (e == NULL) return NULL;
return strdup (e->d_name);
View
269 support/map-icalls.h
@@ -1,269 +0,0 @@
-/*
- * This file was automatically generated by make-map from ../../mcs/class/lib/default/Mono.Posix.dll.
- *
- * DO NOT MODIFY.
- */
-#include <config.h>
-
-#ifndef INC_Mono_Posix_map_ICALLS_H
-#define INC_Mono_Posix_map_ICALLS_H
-
-#include <glib.h>
-
-G_BEGIN_DECLS
-
-/*
- * Structure Declarations
- */
-struct Mono_Posix_Flock;
-struct Mono_Posix_Stat;
-struct Mono_Posix_Statvfs;
-struct Mono_Posix_Syscall__Dirent;
-struct Mono_Posix_Syscall__Fstab;
-struct Mono_Posix_Syscall__Group;
-struct Mono_Posix_Syscall__Passwd;
-struct Mono_Posix_Timeval;
-struct Mono_Posix_Timezone;
-struct Mono_Posix_Utimbuf;
-
-/*
- * Function Declarations
- */
-int Mono_Posix_FromAccessMode (int value, int* rval);
-int Mono_Posix_FromAccessModes (int value, int* rval);
-int Mono_Posix_FromConfStr (int value, int* rval);
-int Mono_Posix_FromConfstrName (int value, int* rval);
-int Mono_Posix_FromDirectoryNotifyFlags (int value, int* rval);
-int Mono_Posix_FromErrno (int value, int* rval);
-int Mono_Posix_FromError (int value, int* rval);
-int Mono_Posix_FromFcntlCommand (int value, int* rval);
-int Mono_Posix_FromFilePermissions (unsigned int value, unsigned int* rval);
-int Mono_Posix_FromLockType (short value, short* rval);
-int Mono_Posix_FromLockfCommand (int value, int* rval);
-int Mono_Posix_FromMlockallFlags (int value, int* rval);
-int Mono_Posix_FromMmapFlags (int value, int* rval);
-int Mono_Posix_FromMmapProt (int value, int* rval);
-int Mono_Posix_FromMmapProts (int value, int* rval);
-int Mono_Posix_FromMountFlags (guint64 value, guint64* rval);
-int Mono_Posix_FromMremapFlags (guint64 value, guint64* rval);
-int Mono_Posix_FromMsyncFlags (int value, int* rval);
-int Mono_Posix_FromOpenFlags (int value, int* rval);
-int Mono_Posix_FromPathConf (int value, int* rval);
-int Mono_Posix_FromPathconfName (int value, int* rval);
-int Mono_Posix_FromPollEvents (short value, short* rval);
-int Mono_Posix_FromPosixFadviseAdvice (int value, int* rval);
-int Mono_Posix_FromPosixMadviseAdvice (int value, int* rval);
-int Mono_Posix_FromSeekFlags (short value, short* rval);
-int Mono_Posix_FromSignum (int value, int* rval);
-int Mono_Posix_FromSysConf (int value, int* rval);
-int Mono_Posix_FromSysconfName (int value, int* rval);
-int Mono_Posix_FromSyslogFacility (int value, int* rval);
-int Mono_Posix_FromSyslogLevel (int value, int* rval);
-int Mono_Posix_FromSyslogOptions (int value, int* rval);
-int Mono_Posix_FromWaitOptions (int value, int* rval);
-int Mono_Posix_FromXattrFlags (int value, int* rval);
-int Mono_Posix_Stdlib_BUFSIZ (void);
-void* Mono_Posix_Stdlib_CreateFilePosition (void);
-int Mono_Posix_Stdlib_DumpFilePosition (char* buf, void* handle, int len);
-int Mono_Posix_Stdlib_EOF (void);
-int Mono_Posix_Stdlib_EXIT_FAILURE (void);
-int Mono_Posix_Stdlib_EXIT_SUCCESS (void);
-int Mono_Posix_Stdlib_FILENAME_MAX (void);
-int Mono_Posix_Stdlib_FOPEN_MAX (void);
-void Mono_Posix_Stdlib_InvokeSignalHandler (int signum, void* handler);
-int Mono_Posix_Stdlib_L_tmpnam (void);
-int Mono_Posix_Stdlib_MB_CUR_MAX (void);
-int Mono_Posix_Stdlib_RAND_MAX (void);
-void* Mono_Posix_Stdlib_SIG_DFL (void);
-void* Mono_Posix_Stdlib_SIG_ERR (void);
-void* Mono_Posix_Stdlib_SIG_IGN (void);
-void Mono_Posix_Stdlib_SetLastError (int error);
-int Mono_Posix_Stdlib_TMP_MAX (void);
-int Mono_Posix_Stdlib__IOFBF (void);
-int Mono_Posix_Stdlib__IOLBF (void);
-int Mono_Posix_Stdlib__IONBF (void);
-void* Mono_Posix_Stdlib_calloc (guint64 nmemb, guint64 size);
-int Mono_Posix_Stdlib_clearerr (void* stream);
-int Mono_Posix_Stdlib_fgetpos (void* stream, void* pos);
-guint64 Mono_Posix_Stdlib_fread (void* ptr, guint64 size, guint64 nmemb, void* stream);
-int Mono_Posix_Stdlib_fseek (void* stream, gint64 offset, int origin);
-int Mono_Posix_Stdlib_fsetpos (void* stream, void* pos);
-gint64 Mono_Posix_Stdlib_ftell (void* stream);
-guint64 Mono_Posix_Stdlib_fwrite (void* ptr, guint64 size, guint64 nmemb, void* stream);
-void* Mono_Posix_Stdlib_malloc (guint64 size);
-int Mono_Posix_Stdlib_perror (const char* s);
-void* Mono_Posix_Stdlib_realloc (void* ptr, guint64 size);
-int Mono_Posix_Stdlib_rewind (void* stream);
-int Mono_Posix_Stdlib_setbuf (void* stream, void* buf);
-int Mono_Posix_Stdlib_setvbuf (void* stream, void* buf, int mode, guint64 size);
-void* Mono_Posix_Stdlib_stderr (void);
-void* Mono_Posix_Stdlib_stdin (void);
-void* Mono_Posix_Stdlib_stdout (void);
-guint64 Mono_Posix_Stdlib_strlen (void* s);
-int Mono_Posix_Syscall_L_ctermid (void);
-int Mono_Posix_Syscall_L_cuserid (void);
-int Mono_Posix_Syscall_WEXITSTATUS (int status);
-int Mono_Posix_Syscall_WIFEXITED (int status);
-int Mono_Posix_Syscall_WIFSIGNALED (int status);
-int Mono_Posix_Syscall_WIFSTOPPED (int status);
-int Mono_Posix_Syscall_WSTOPSIG (int status);
-int Mono_Posix_Syscall_WTERMSIG (int status);
-int Mono_Posix_Syscall_closelog (void);
-guint64 Mono_Posix_Syscall_confstr (int name, char* buf, guint64 len);
-int Mono_Posix_Syscall_creat (const char* pathname, unsigned int mode);
-int Mono_Posix_Syscall_encrypt (void* block, int edflag);
-void Mono_Posix_Syscall_endfsent (void);
-int Mono_Posix_Syscall_endgrent (void);
-int Mono_Posix_Syscall_endpwent (void);
-int Mono_Posix_Syscall_endusershell (void);
-int Mono_Posix_Syscall_fcntl (int fd, int cmd);
-int Mono_Posix_Syscall_fcntl_arg (int fd, int cmd, gint64 arg);
-int Mono_Posix_Syscall_fcntl_lock (int fd, int cmd, struct Mono_Posix_Flock* lock);
-int Mono_Posix_Syscall_fgetgrent (void* stream, struct Mono_Posix_Syscall__Group* grbuf);
-int Mono_Posix_Syscall_fgetpwent (void* stream, struct Mono_Posix_Syscall__Passwd* pwbuf);
-gint64 Mono_Posix_Syscall_fgetxattr (int fd, const char* name, void* value, guint64 size);
-gint64 Mono_Posix_Syscall_flistxattr (int fd, void* list, guint64 size);
-gint64 Mono_Posix_Syscall_fpathconf (int filedes, int name, int defaultError);
-int Mono_Posix_Syscall_fremovexattr (int fd, const char* name);
-int Mono_Posix_Syscall_fsetxattr (int fd, const char* name, void* value, guint64 size, int flags);
-int Mono_Posix_Syscall_fstat (int filedes, struct Mono_Posix_Stat* buf);
-int Mono_Posix_Syscall_fstatvfs (int fd, struct Mono_Posix_Statvfs* buf);
-int Mono_Posix_Syscall_ftruncate (int fd, gint64 length);
-int Mono_Posix_Syscall_futimes (int fd, struct Mono_Posix_Timeval* tvp);
-void* Mono_Posix_Syscall_getcwd (char* buf, guint64 size);
-int Mono_Posix_Syscall_getdomainname (char* name, guint64 len);
-int Mono_Posix_Syscall_getfsent (struct Mono_Posix_Syscall__Fstab* fs);
-int Mono_Posix_Syscall_getfsfile (const char* mount_point, struct Mono_Posix_Syscall__Fstab* fs);
-int Mono_Posix_Syscall_getfsspec (const char* special_file, struct Mono_Posix_Syscall__Fstab* fs);
-int Mono_Posix_Syscall_getgrent (struct Mono_Posix_Syscall__Group* grbuf);
-int Mono_Posix_Syscall_getgrgid (unsigned int uid, struct Mono_Posix_Syscall__Group* group);
-int Mono_Posix_Syscall_getgrgid_r (unsigned int uid, struct Mono_Posix_Syscall__Group* grbuf, void** grbufp);
-int Mono_Posix_Syscall_getgrnam (const char* name, struct Mono_Posix_Syscall__Group* group);
-int Mono_Posix_Syscall_getgrnam_r (const char* name, struct Mono_Posix_Syscall__Group* grbuf, void** grbufp);
-gint64 Mono_Posix_Syscall_gethostid (void);
-int Mono_Posix_Syscall_gethostname (char* name, guint64 len);
-int Mono_Posix_Syscall_getlogin_r (char* name, guint64 bufsize);
-int Mono_Posix_Syscall_getpwent (struct Mono_Posix_Syscall__Passwd* pwbuf);
-int Mono_Posix_Syscall_getpwnam (const char* name, struct Mono_Posix_Syscall__Passwd* passwd);
-int Mono_Posix_Syscall_getpwnam_r (const char* name, struct Mono_Posix_Syscall__Passwd* pwbuf, void** pwbufp);
-int Mono_Posix_Syscall_getpwuid (unsigned int uid, struct Mono_Posix_Syscall__Passwd* passwd);
-int Mono_Posix_Syscall_getpwuid_r (unsigned int uid, struct Mono_Posix_Syscall__Passwd* pwbuf, void** pwbufp);
-int Mono_Posix_Syscall_gettimeofday (struct Mono_Posix_Timeval* tv, void* ignore);
-gint64 Mono_Posix_Syscall_getxattr (const char* path, const char* name, void* value, guint64 size);
-gint64 Mono_Posix_Syscall_lgetxattr (const char* path, const char* name, void* value, guint64 size);
-gint64 Mono_Posix_Syscall_listxattr (const char* path, void* list, guint64 size);
-gint64 Mono_Posix_Syscall_llistxattr (const char* path, void* list, guint64 size);
-int Mono_Posix_Syscall_lockf (int fd, int cmd, gint64 len);
-int Mono_Posix_Syscall_lremovexattr (const char* path, const char* name);
-gint64 Mono_Posix_Syscall_lseek (int fd, gint64 offset, int whence);
-int Mono_Posix_Syscall_lsetxattr (const char* path, const char* name, void* value, guint64 size, int flags);
-int Mono_Posix_Syscall_lstat (const char* file_name, struct Mono_Posix_Stat* buf);
-int Mono_Posix_Syscall_lutimes (const char* filename, struct Mono_Posix_Timeval* tvp);
-int Mono_Posix_Syscall_mincore (void* start, guint64 length, void* vec);
-int Mono_Posix_Syscall_mknod (const char* pathname, unsigned int mode, guint64 dev);
-int Mono_Posix_Syscall_mlock (void* start, guint64 len);
-void* Mono_Posix_Syscall_mmap (void* start, guint64 length, int prot, int flags, int fd, gint64 offset);
-int Mono_Posix_Syscall_mprotect (void* start, guint64 len, int prot);
-void* Mono_Posix_Syscall_mremap (void* old_address, guint64 old_size, guint64 new_size, guint64 flags);
-int Mono_Posix_Syscall_msync (void* start, guint64 len, int flags);
-int Mono_Posix_Syscall_munlock (void* start, guint64 len);
-int Mono_Posix_Syscall_munmap (void* start, guint64 length);
-int Mono_Posix_Syscall_open (const char* pathname, int flags);
-int Mono_Posix_Syscall_open_mode (const char* pathname, int flags, unsigned int mode);
-int Mono_Posix_Syscall_openlog (void* ident, int option, int facility);
-gint64 Mono_Posix_Syscall_pathconf (const char* path, int name, int defaultError);
-int Mono_Posix_Syscall_pipe (int* reading, int* writing);
-int Mono_Posix_Syscall_posix_fadvise (int fd, gint64 offset, gint64 len, int advice);
-int Mono_Posix_Syscall_posix_fallocate (int fd, gint64 offset, guint64 len);
-int Mono_Posix_Syscall_posix_madvise (void* addr, guint64 len, int advice);
-gint64 Mono_Posix_Syscall_pread (int fd, void* buf, guint64 count, gint64 offset);
-int Mono_Posix_Syscall_psignal (int sig, const char* s);
-gint64 Mono_Posix_Syscall_pwrite (int fd, void* buf, guint64 count, gint64 offset);
-gint64 Mono_Posix_Syscall_read (int fd, void* buf, guint64 count);
-int Mono_Posix_Syscall_readdir (void* dir, struct Mono_Posix_Syscall__Dirent* dentry);
-int Mono_Posix_Syscall_readdir_r (void* dirp, struct Mono_Posix_Syscall__Dirent* entry, void** result);
-int Mono_Posix_Syscall_readlink (const char* path, char* buf, guint64 bufsiz);
-int Mono_Posix_Syscall_remap_file_pages (void* start, guint64 size, int prot, gint64 pgoff, int flags);
-int Mono_Posix_Syscall_removexattr (const char* path, const char* name);
-int Mono_Posix_Syscall_rewinddir (void* dir);
-int Mono_Posix_Syscall_seekdir (void* dir, gint64 offset);
-gint64 Mono_Posix_Syscall_sendfile (int out_fd, int in_fd, gint64* offset, guint64 count);
-int Mono_Posix_Syscall_setdomainname (const char* name, guint64 len);
-int Mono_Posix_Syscall_setfsent (void);
-int Mono_Posix_Syscall_setgrent (void);
-int Mono_Posix_Syscall_setgroups (guint64 size, unsigned int* list);
-int Mono_Posix_Syscall_sethostid (gint64 hostid);
-int Mono_Posix_Syscall_sethostname (const char* name, guint64 len);
-int Mono_Posix_Syscall_setkey (const char* key);
-int Mono_Posix_Syscall_setpwent (void);
-int Mono_Posix_Syscall_settimeofday (struct Mono_Posix_Timeval* tv, struct Mono_Posix_Timezone* tz);
-int Mono_Posix_Syscall_setusershell (void);
-int Mono_Posix_Syscall_setxattr (const char* path, const char* name, void* value, guint64 size, int flags);
-int Mono_Posix_Syscall_stat (const char* file_name, struct Mono_Posix_Stat* buf);
-int Mono_Posix_Syscall_statvfs (const char* path, struct Mono_Posix_Statvfs* buf);
-int Mono_Posix_Syscall_stime (gint64* t);
-int Mono_Posix_Syscall_strerror_r (int errnum, char* buf, guint64 n);
-void Mono_Posix_Syscall_swab (void* from, void* to, gint64 n);
-int Mono_Posix_Syscall_sync (void);
-gint64 Mono_Posix_Syscall_sysconf (int name, int defaultError);
-int Mono_Posix_Syscall_syslog (int priority, const char* message);
-gint64 Mono_Posix_Syscall_telldir (void* dir);
-gint64 Mono_Posix_Syscall_time (gint64* t);
-int Mono_Posix_Syscall_truncate (const char* path, gint64 length);
-int Mono_Posix_Syscall_ttyname_r (int fd, char* buf, guint64 buflen);
-int Mono_Posix_Syscall_utime (const char* filename, struct Mono_Posix_Utimbuf* buf, int use_buf);
-int Mono_Posix_Syscall_utimes (const char* filename, struct Mono_Posix_Timeval* tvp);
-int Mono_Posix_Syscall_utimes_bad (const char* filename, struct Mono_Posix_Timeval* tvp);
-gint64 Mono_Posix_Syscall_write (int fd, void* buf, guint64 count);
-int Mono_Posix_ToAccessMode (int value, int* rval);
-int Mono_Posix_ToAccessModes (int value, int* rval);
-int Mono_Posix_ToConfStr (int value, int* rval);
-int Mono_Posix_ToConfstrName (int value, int* rval);
-int Mono_Posix_ToDirectoryNotifyFlags (int value, int* rval);
-int Mono_Posix_ToErrno (int value, int* rval);
-int Mono_Posix_ToError (int value, int* rval);
-int Mono_Posix_ToFcntlCommand (int value, int* rval);
-int Mono_Posix_ToFilePermissions (unsigned int value, unsigned int* rval);
-int Mono_Posix_ToLockType (short value, short* rval);
-int Mono_Posix_ToLockfCommand (int value, int* rval);
-int Mono_Posix_ToMlockallFlags (int value, int* rval);
-int Mono_Posix_ToMmapFlags (int value, int* rval);
-int Mono_Posix_ToMmapProt (int value, int* rval);
-int Mono_Posix_ToMmapProts (int value, int* rval);
-int Mono_Posix_ToMountFlags (guint64 value, guint64* rval);
-int Mono_Posix_ToMremapFlags (guint64 value, guint64* rval);
-int Mono_Posix_ToMsyncFlags (int value, int* rval);
-int Mono_Posix_ToOpenFlags (int value, int* rval);
-int Mono_Posix_ToPathConf (int value, int* rval);
-int Mono_Posix_ToPathconfName (int value, int* rval);
-int Mono_Posix_ToPollEvents (short value, short* rval);
-int Mono_Posix_ToPosixFadviseAdvice (int value, int* rval);
-int Mono_Posix_ToPosixMadviseAdvice (int value, int* rval);
-int Mono_Posix_ToSeekFlags (short value, short* rval);
-int Mono_Posix_ToSignum (int value, int* rval);
-int Mono_Posix_ToSysConf (int value, int* rval);
-int Mono_Posix_ToSysconfName (int value, int* rval);
-int Mono_Posix_ToSyslogFacility (int value, int* rval);
-int Mono_Posix_ToSyslogLevel (int value, int* rval);
-int Mono_Posix_ToSyslogOptions (int value, int* rval);
-int Mono_Posix_ToWaitOptions (int value, int* rval);
-int Mono_Posix_ToXattrFlags (int value, int* rval);
-const char* helper_Mono_Posix_GetGroupName (int gid);
-const char* helper_Mono_Posix_GetUserName (int uid);
-int helper_Mono_Posix_Stat (const char* filename, int dereference, int* device, int* inode, int* mode, int* nlinks, int* uid, int* gid, int* rdev, gint64* size, gint64* blksize, gint64* blocks, gint64* atime, gint64* mtime, gint64* ctime);
-const char* helper_Mono_Posix_readdir (void* dir);
-int map_Mono_Posix_AccessMode (int mode);
-int map_Mono_Posix_FileMode (int mode);
-int map_Mono_Posix_OpenFlags (int flags);
-int map_Mono_Posix_WaitOptions (int wait_options);
-int wexitstatus (int status);
-int wifexited (int status);
-int wifsignaled (int status);
-int wifstopped (int status);
-int wstopsig (int status);
-int wtermsig (int status);
-
-G_END_DECLS
-
-#endif /* ndef INC_Mono_Posix_map_ICALLS_H */
-
View
10,763 support/map.c
3,468 additions, 7,295 deletions not shown
View
2,616 support/map.h
1,596 additions, 1,020 deletions not shown
View
2  support/mph.h
@@ -35,8 +35,6 @@
#include <stdint.h> /* for SIZE_MAX */
#endif
-#include "map-icalls.h"
-
#if __APPLE__ || __BSD__ || __FreeBSD__
#define MPH_ON_BSD
#endif
View
12 support/pwd.c
@@ -13,21 +13,11 @@
#include <stdio.h>
#include <stdlib.h>
+#include "map.h"
#include "mph.h"
G_BEGIN_DECLS
-struct Mono_Posix_Syscall__Passwd {
- /* string */ char *pw_name;
- /* string */ char *pw_passwd;
- /* uid_t */ mph_uid_t pw_uid;
- /* gid_t */ mph_gid_t pw_gid;
- /* string */ char *pw_gecos;
- /* string */ char *pw_dir;
- /* string */ char *pw_shell;
- /* string */ char *_pw_buf_;
-};
-
static const size_t
passwd_offsets[] = {
offsetof (struct passwd, pw_name),
View
1  support/signal.c
@@ -9,6 +9,7 @@
#include <signal.h>
+#include "map.h"
#include "mph.h"
G_BEGIN_DECLS
View
7 support/stdio.c
@@ -4,13 +4,14 @@
* Authors:
* Jonathan Pryor (jonpryor@vt.edu)
*
- * Copyright (C) 2004-2005 Jonathan Pryor
+ * Copyright (C) 2004-2006 Jonathan Pryor
*/
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
+#include "map.h"
#include "mph.h"
G_BEGIN_DECLS
@@ -30,7 +31,7 @@ Mono_Posix_Syscall_L_cuserid (void)
#endif /* ndef PLATFORM_WIN32 */
mph_size_t
-Mono_Posix_Stdlib_fread (void *ptr, mph_size_t size, mph_size_t nmemb, void *stream)
+Mono_Posix_Stdlib_fread (unsigned char *ptr, mph_size_t size, mph_size_t nmemb, void *stream)
{
mph_return_if_size_t_overflow (size);
mph_return_if_size_t_overflow (nmemb);
@@ -39,7 +40,7 @@ Mono_Posix_Stdlib_fread (void *ptr, mph_size_t size, mph_size_t nmemb, void *str
}
mph_size_t
-Mono_Posix_Stdlib_fwrite (void *ptr, mph_size_t size, mph_size_t nmemb, void *stream)
+Mono_Posix_Stdlib_fwrite (unsigned char *ptr, mph_size_t size, mph_size_t nmemb, void *stream)
{
mph_return_if_size_t_overflow (size);
mph_return_if_size_t_overflow (nmemb);
View
1  support/stdlib.c
@@ -9,6 +9,7 @@
#include <stdlib.h>
+#include "map.h"
#include "mph.h"
G_BEGIN_DECLS
View
1  support/string.c
@@ -9,6 +9,7 @@
#include <string.h>
+#include "map.h"
#include "mph.h"
G_BEGIN_DECLS
View
12 support/sys-mman.c
@@ -4,7 +4,7 @@
* Authors:
* Jonathan Pryor (jonpryor@vt.edu)
*
- * Copyright (C) 2004 Jonathan Pryor
+ * Copyright (C) 2004-2006 Jonathan Pryor
*/
#define _XOPEN_SOURCE 600
@@ -27,7 +27,7 @@ Mono_Posix_Syscall_mmap (void *start, mph_size_t length, int prot, int flags,
mph_return_val_if_size_t_overflow (length, MAP_FAILED);
mph_return_val_if_off_t_overflow (offset, MAP_FAILED);
- if (Mono_Posix_FromMmapProt (prot, &_prot) == -1)
+ if (Mono_Posix_FromMmapProts (prot, &_prot) == -1)
return MAP_FAILED;
if (Mono_Posix_FromMmapFlags (flags, &_flags) == -1)
return MAP_FAILED;
@@ -49,7 +49,7 @@ Mono_Posix_Syscall_mprotect (void *start, mph_size_t len, int prot)
int _prot;
mph_return_if_size_t_overflow (len);
- if (Mono_Posix_FromMmapProt (prot, &_prot) == -1)
+ if (Mono_Posix_FromMmapProts (prot, &_prot) == -1)
return -1;
return mprotect (start, (size_t) len, _prot);
@@ -102,11 +102,11 @@ Mono_Posix_Syscall_mremap (void *old_address, mph_size_t old_size,
#endif /* def HAVE_MREMAP */
int
-Mono_Posix_Syscall_mincore (void *start, mph_size_t length, void *vec)
+Mono_Posix_Syscall_mincore (void *start, mph_size_t length, unsigned char *vec)
{
mph_return_if_size_t_overflow (length);
- return mincore (start, (size_t) length, (unsigned char*) vec);
+ return mincore (start, (size_t) length, vec);
}
#ifdef HAVE_POSIX_MADVISE
@@ -132,7 +132,7 @@ Mono_Posix_Syscall_remap_file_pages (void *start, mph_size_t size,
mph_return_if_size_t_overflow (size);
mph_return_if_ssize_t_overflow (pgoff);
- if (Mono_Posix_FromMmapProt (prot, &_prot) == -1)
+ if (Mono_Posix_FromMmapProts (prot, &_prot) == -1)
return -1;
if (Mono_Posix_FromMmapFlags (flags, &_flags) == -1)
return -1;
View
1  support/sys-sendfile.c
@@ -10,6 +10,7 @@
#include <sys/types.h>
#include <errno.h>
+#include "map.h"
#include "mph.h"
#ifdef HAVE_SYS_SENDFILE_H
View
49 support/sys-stat.c
@@ -4,7 +4,7 @@
* Authors:
* Jonathan Pryor (jonpryor@vt.edu)
*
- * Copyright (C) 2004 Jonathan Pryor
+ * Copyright (C) 2004-2006 Jonathan Pryor
*/
#ifndef _GNU_SOURCE
@@ -22,47 +22,6 @@
G_BEGIN_DECLS
-struct Mono_Posix_Stat {
- /* dev_t */ mph_dev_t st_dev; /* device */
- /* ino_t */ mph_ino_t st_ino; /* inode */
- /* mode_t */ guint32 st_mode; /* protection */
- guint32 _padding_; /* structure padding */
- /* nlink_t */ mph_nlink_t st_nlink; /* number of hard links */
- /* uid_t */ mph_uid_t st_uid; /* user ID of owner */
- /* gid_t */ mph_gid_t st_gid; /* group ID of owner */
- /* dev_t */ mph_dev_t st_rdev; /* device type (if inode device) */
- /* off_t */ mph_off_t st_size; /* total size, in bytes */
- /* blksize_t */ mph_blksize_t st_blksize; /* blocksize for filesystem I/O */
- /* blkcnt_t */ mph_blkcnt_t st_blocks; /* number of blocks allocated */
-
- /* st_atime, st_mtime, and st_ctime are macros (!), so use a slightly
- * different name to appease CPP */
-
- /* time_t */ mph_time_t st_atime_; /* time of last access */
- /* time_t */ mph_time_t st_mtime_; /* time of last modification */
- /* time_t */ mph_time_t st_ctime_; /* time of last status change */
-};
-
-static int
-copy_stat (struct Mono_Posix_Stat *to, struct stat *from)
-{
- if (Mono_Posix_ToFilePermissions (from->st_mode, &to->st_mode) == -1)
- return -1;
- to->st_dev = from->st_dev;
- to->st_ino = from->st_ino;
- to->st_nlink = from->st_nlink;
- to->st_uid = from->st_uid;
- to->st_gid = from->st_gid;
- to->st_rdev = from->st_rdev;
- to->st_size = from->st_size;
- to->st_blksize = from->st_blksize;
- to->st_blocks = from->st_blocks;
- to->st_atime_ = from->st_atime;
- to->st_mtime_ = from->st_mtime;
- to->st_ctime_ = from->st_ctime;
- return 0;
-}
-
gint32
Mono_Posix_Syscall_stat (const char *file_name, struct Mono_Posix_Stat *buf)
{
@@ -74,7 +33,7 @@ Mono_Posix_Syscall_stat (const char *file_name, struct Mono_Posix_Stat *buf)
return -1;
}
r = stat (file_name, &_buf);
- if (r != -1 && copy_stat (buf, &_buf) == -1)
+ if (r != -1 && Mono_Posix_ToStat (&_buf, buf) == -1)
r = -1;
return r;
}
@@ -90,7 +49,7 @@ Mono_Posix_Syscall_fstat (int filedes, struct Mono_Posix_Stat *buf)
return -1;
}
r = fstat (filedes, &_buf);
- if (r != -1 && copy_stat (buf, &_buf) == -1)
+ if (r != -1 && Mono_Posix_ToStat (&_buf, buf) == -1)
r = -1;
return r;
}
@@ -106,7 +65,7 @@ Mono_Posix_Syscall_lstat (const char *file_name, struct Mono_Posix_Stat *buf)
return -1;
}
r = lstat (file_name, &_buf);
- if (r != -1 && copy_stat (buf, &_buf) == -1)
+ if (r != -1 && Mono_Posix_ToStat (&_buf, buf) == -1)
r = -1;
return r;
}
View
137 support/sys-statvfs.c
@@ -4,7 +4,7 @@
* Authors:
* Jonathan Pryor (jonpryor@vt.edu)
*
- * Copyright (C) 2004 Jonathan Pryor
+ * Copyright (C) 2004-2006 Jonathan Pryor
*/
#include <errno.h>
@@ -27,35 +27,51 @@
G_BEGIN_DECLS
-struct Mono_Posix_Statvfs {
- guint64 f_bsize; /* file system block size */
- guint64 f_frsize; /* fragment size */
- mph_fsblkcnt_t f_blocks; /* size of fs in f_frsize units */
- mph_fsblkcnt_t f_bfree; /* # free blocks */
- mph_fsblkcnt_t f_bavail; /* # free blocks for non-root */
- mph_fsfilcnt_t f_files; /* # inodes */
- mph_fsfilcnt_t f_ffree; /* # free inodes */
- mph_fsfilcnt_t f_favail; /* # free inodes for non-root */
- guint64 f_fsid; /* file system id */
- guint64 f_flag; /* mount flags */
- guint64 f_namemax; /* maximum filename length */
-};
-
#ifdef HAVE_SYS_STATVFS_H
-static void
-copy_statvfs (struct Mono_Posix_Statvfs *to, struct statvfs *from)
+int
+Mono_Posix_ToStatvfs (void *_from, struct Mono_Posix_Statvfs *to)
{
- to->f_bsize = from->f_bsize;
- to->f_frsize = from->f_frsize;
- to->f_blocks = from->f_blocks;
- to->f_bfree = from->f_bfree;
- to->f_bavail = from->f_bavail;
- to->f_files = from->f_files;
- to->f_ffree = from->f_ffree;
- to->f_favail = from->f_favail;
- to->f_fsid = from->f_fsid;
- Mono_Posix_ToMountFlags (from->f_flag, &to->f_flag);
- to->f_namemax = from->f_namemax;
+ struct statvfs *from = _from;
+
+ to->f_bsize = from->f_bsize;
+ to->f_frsize = from->f_frsize;
+ to->f_blocks = from->f_blocks;
+ to->f_bfree = from->f_bfree;
+ to->f_bavail = from->f_bavail;
+ to->f_files = from->f_files;
+ to->f_ffree = from->f_ffree;
+ to->f_favail = from->f_favail;
+ to->f_fsid = from->f_fsid;
+ to->f_namemax = from->f_namemax;
+
+ if (Mono_Posix_ToMountFlags (from->f_flag, &to->f_flag) != 0)
+ return -1;
+
+ return 0;
+}
+
+int
+Mono_Posix_FromStatvfs (struct Mono_Posix_Statvfs *from, void *_to)
+{
+ struct statvfs *to = _to;
+ guint64 flag;
+
+ to->f_bsize = from->f_bsize;
+ to->f_frsize = from->f_frsize;
+ to->f_blocks = from->f_blocks;
+ to->f_bfree = from->f_bfree;
+ to->f_bavail = from->f_bavail;
+ to->f_files = from->f_files;
+ to->f_ffree = from->f_ffree;
+ to->f_favail = from->f_favail;
+ to->f_fsid = from->f_fsid;
+ to->f_namemax = from->f_namemax;
+
+ if (Mono_Posix_FromMountFlags (from->f_flag, &flag) != 0)
+ return -1;
+ to->f_flag = flag;
+
+ return 0;
}
#endif /* ndef HAVE_SYS_STATVFS_H */
@@ -76,7 +92,7 @@ Mono_Posix_Syscall_statvfs (const char *path, struct Mono_Posix_Statvfs *buf)
}
if ((r = statvfs (path, &s)) == 0)
- copy_statvfs (buf, &s);
+ r = Mono_Posix_ToStatvfs (&s, buf);
return r;
}
@@ -95,7 +111,7 @@ Mono_Posix_Syscall_fstatvfs (gint32 fd, struct Mono_Posix_Statvfs *buf)
}
if ((r = fstatvfs (fd, &s)) == 0)
- copy_statvfs (buf, &s);
+ r = Mono_Posix_ToStatvfs (&s, buf);
return r;
}
@@ -108,21 +124,52 @@ Mono_Posix_Syscall_fstatvfs (gint32 fd, struct Mono_Posix_Statvfs *buf)
*/
#if (defined (HAVE_STATFS) || defined (HAVE_FSTATFS)) && !defined (HAVE_STATVFS)
-static void
-copy_statfs (struct Mono_Posix_Statvfs *to, struct statfs *from)
+int
+Mono_Posix_ToStatvfs (void *_from, struct Mono_Posix_Statvfs *to)
+{
+ struct statfs *from = _from;
+
+ to->f_bsize = from->f_bsize;
+ to->f_frsize = from->f_bsize;
+ to->f_blocks = from->f_blocks;
+ to->f_bfree = from->f_bfree;
+ to->f_bavail = from->f_bavail;
+ to->f_files = from->f_files;
+ to->f_ffree = from->f_ffree;
+ to->f_favail = from->f_ffree; /* OSX doesn't have f_avail */
+
+ // from->f_fsid is an int32[2], to->f_fsid is a uint64,
+ // so this shouldn't lose anything.
+ memcpy (&to->f_fsid, &from->f_fsid, sizeof(to->f_fsid));
+
+ if (Mono_Posix_ToMountFlags (from->f_flags, &to->f_flag) != 0)
+ return -1;
+
+ return 0;
+}
+
+int
+Mono_Posix_FromStatvfs (struct Mono_Posix_Statvfs *from, void *to)
{
- to->f_bsize = from->f_bsize;
- to->f_frsize = from->f_bsize;
- to->f_blocks = from->f_blocks;
- to->f_bfree = from->f_bfree;
- to->f_bavail = from->f_bavail;
- to->f_files = from->f_files;
- to->f_ffree = from->f_ffree;
- to->f_favail = from->f_ffree; /* OSX doesn't have f_avail */
- Mono_Posix_ToMountFlags (from->f_flags, &to->f_flag);
+ struct statfs *to = _to;
+
+ to->f_bsize = from->f_bsize;
+ to->f_frsize = from->f_bsize;
+ to->f_blocks = from->f_blocks;
+ to->f_bfree = from->f_bfree;
+ to->f_bavail = from->f_bavail;
+ to->f_files = from->f_files;
+ to->f_ffree = from->f_ffree;
+ to->f_favail = from->f_ffree; /* OSX doesn't have f_avail */
+
// from->f_fsid is an int32[2], to->f_fsid is a uint64,
// so this shouldn't lose anything.
memcpy (&to->f_fsid, &from->f_fsid, sizeof(to->f_fsid));
+
+ if (Mono_Posix_FromMountFlags (from->f_flags, &to->f_flag) != 0)
+ return -1;
+
+ return 0;
}
static void
@@ -150,8 +197,8 @@ Mono_Posix_Syscall_statvfs (const char *path, struct Mono_Posix_Statvfs *buf)
return -1;
}
- if ((r = statfs (path, &s)) == 0) {
- copy_statfs (buf, &s);
+ if ((r = statfs (path, &s)) == 0 &&
+ (r = Mono_Posix_ToStatvfs (&s, buf)) == 0) {
set_namemax (path, buf);
}
@@ -171,8 +218,8 @@ Mono_Posix_Syscall_fstatvfs (gint32 fd, struct Mono_Posix_Statvfs *buf)
return -1;
}
- if ((r = fstatfs (fd, &s)) == 0) {
- copy_statfs (buf, &s);
+ if ((r = statfs (path, &s)) == 0 &&
+ (r = Mono_Posix_ToStatvfs (&s, buf)) == 0) {
set_fnamemax (fd, buf);
}
View
10 support/sys-time.c
@@ -16,16 +16,6 @@
G_BEGIN_DECLS
-struct Mono_Posix_Timeval {
- /* time_t */ mph_time_t tv_sec; /* seconds */
- /* suseconds_t */ gint64 tv_usec; /* microseconds */
-};
-
-struct Mono_Posix_Timezone {
- int tz_minuteswest; /* minutes W of Greenwich */
- int tz_dsttime; /* ignored */
-};
-
gint32
Mono_Posix_Syscall_gettimeofday (
struct Mono_Posix_Timeval *tv,
View
30 support/sys-xattr.c
@@ -3,8 +3,10 @@
*
* Authors:
* Daniel Drake (dsd@gentoo.org)
+ * Jonathan Pryor (jonpryor@vt.edu)
*
* Copyright (C) 2005 Daniel Drake
+ * Copyright (C) 2006 Jonathan Pryor
*/
#include <config.h>
@@ -327,7 +329,7 @@ bsd_flistxattr (int fd, void *list, mph_size_t size)
//
gint32
-Mono_Posix_Syscall_setxattr (const char *path, const char *name, void *value, mph_size_t size, gint32 flags)
+Mono_Posix_Syscall_setxattr (const char *path, const char *name, unsigned char *value, mph_size_t size, gint32 flags)
{
gint32 ret;
mph_return_if_size_t_overflow (size);
@@ -361,7 +363,7 @@ Mono_Posix_Syscall_setxattr (const char *path, const char *name, void *value, mp
#if !__APPLE__
gint32
-Mono_Posix_Syscall_lsetxattr (const char *path, const char *name, void *value, mph_size_t size, gint32 flags)
+Mono_Posix_Syscall_lsetxattr (const char *path, const char *name, unsigned char *value, mph_size_t size, gint32 flags)
{
gint32 ret;
mph_return_if_size_t_overflow (size);
@@ -391,7 +393,7 @@ Mono_Posix_Syscall_lsetxattr (const char *path, const char *name, void *value, m
#endif /* !__APPLE__ */
gint32
-Mono_Posix_Syscall_fsetxattr (int fd, const char *name, void *value, mph_size_t size, gint32 flags)
+Mono_Posix_Syscall_fsetxattr (int fd, const char *name, unsigned char *value, mph_size_t size, gint32 flags)
{
gint32 ret;
mph_return_if_size_t_overflow (size);
@@ -424,7 +426,7 @@ Mono_Posix_Syscall_fsetxattr (int fd, const char *name, void *value, mph_size_t
}
mph_ssize_t
-Mono_Posix_Syscall_getxattr (const char *path, const char *name, void *value, mph_size_t size)
+Mono_Posix_Syscall_getxattr (const char *path, const char *name, unsigned char *value, mph_size_t size)
{
mph_ssize_t ret;
mph_return_if_size_t_overflow (size);
@@ -451,7 +453,7 @@ Mono_Posix_Syscall_getxattr (const char *path, const char *name, void *value, mp
#if !__APPLE__
mph_ssize_t
-Mono_Posix_Syscall_lgetxattr (const char *path, const char *name, void *value, mph_size_t size)
+Mono_Posix_Syscall_lgetxattr (const char *path, const char *name, unsigned char *value, mph_size_t size)
{
mph_ssize_t ret;
mph_return_if_size_t_overflow (size);
@@ -474,7 +476,7 @@ Mono_Posix_Syscall_lgetxattr (const char *path, const char *name, void *value, m
#endif /* !__APPLE__ */
mph_ssize_t
-Mono_Posix_Syscall_fgetxattr (int fd, const char *name, void *value, mph_size_t size)
+Mono_Posix_Syscall_fgetxattr (int fd, const char *name, unsigned char *value, mph_size_t size)
{
mph_ssize_t ret;
mph_return_if_size_t_overflow (size);
@@ -500,15 +502,15 @@ Mono_Posix_Syscall_fgetxattr (int fd, const char *name, void *value, mph_size_t
}
mph_ssize_t
-Mono_Posix_Syscall_listxattr (const char *path, void *list, mph_size_t size)
+Mono_Posix_Syscall_listxattr (const char *path, unsigned char *list, mph_size_t size)
{
mph_return_if_size_t_overflow (size);
#ifdef EA_UNIX
#if __APPLE__
- return listxattr (path, list, (size_t) size, 0);
+ return listxattr (path, (char*) list, (size_t) size, 0);
#else /* __APPLE__ */
- return listxattr (path, list, (size_t) size);
+ return listxattr (path, (char*) list, (size_t) size);
#endif /* __APPLE__ */
#else /* EA_UNIX */
return bsd_listxattr (path, list, size);
@@ -517,12 +519,12 @@ Mono_Posix_Syscall_listxattr (const char *path, void *list, mph_size_t size)
#if !__APPLE__
mph_ssize_t
-Mono_Posix_Syscall_llistxattr (const char *path, void *list, mph_size_t size)
+Mono_Posix_Syscall_llistxattr (const char *path, unsigned char *list, mph_size_t size)
{
mph_return_if_size_t_overflow (size);
#ifdef EA_UNIX
- return llistxattr (path, list, (size_t) size);
+ return llistxattr (path, (char*) list, (size_t) size);
#else /* EA_UNIX */
return bsd_llistxattr (path, list, size);
#endif /* EA_UNIX */
@@ -530,15 +532,15 @@ Mono_Posix_Syscall_llistxattr (const char *path, void *list, mph_size_t size)
#endif /* !__APPLE__ */
mph_ssize_t
-Mono_Posix_Syscall_flistxattr (int fd, void *list, mph_size_t size)
+Mono_Posix_Syscall_flistxattr (int fd, unsigned char *list, mph_size_t size)
{
mph_return_if_size_t_overflow (size);
#ifdef EA_UNIX
#if __APPLE__
- return flistxattr (fd, list, (size_t) size, 0);
+ return flistxattr (fd, (char*) list, (size_t) size, 0);
#else /* __APPLE__ */
- return flistxattr (fd, list, (size_t) size);
+ return flistxattr (fd, (char*) list, (size_t) size);
#endif /* __APPLE__ */
#else /* EA_UNIX */
return bsd_flistxattr (fd, list, size);
View
1  support/syslog.c
@@ -11,6 +11,7 @@
#include <syslog.h>
#include <errno.h>
+#include "map.h"
#include "mph.h"
#include <glib.h>
View
1  support/time.c
@@ -11,6 +11,7 @@
#include <time.h>
#include <errno.h>
+#include "map.h"
#include "mph.h"
#include <glib.h>
View
7 support/unistd.c
@@ -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,12 +227,13 @@ 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
View
8 support/utime.c
@@ -4,21 +4,17 @@
* Authors:
* Jonathan Pryor (jonpryor@vt.edu)
*
- * Copyright (C) 2004 Jonathan Pryor
+ * Copyright (C) 2004-2006 Jonathan Pryor
*/
#include <sys/types.h>
#include <utime.h>
+#include "map.h"
#include "mph.h"
G_BEGIN_DECLS
-struct Mono_Posix_Utimbuf {
- /* time_t */ mph_time_t actime; /* access time */
- /* time_t */ mph_time_t modtime; /* modification time */
-};
-
gint32
Mono_Posix_Syscall_utime (const char *filename, struct Mono_Posix_Utimbuf *buf,
int use_buf)
Please sign in to comment.
Something went wrong with that request. Please try again.