Files
mono/support/old-map.c
T
Jonathan Pryor a3e3afa3b6 * map-icalls.h: Added; auto-generated file which contains Mono_Posix_*
declarations for DllImport functions in Mono.Posix.dll.  This ensure
    consistency between Mono.Posix.dll and MonoPosixHelper.so.
  * mph.h: Add include for map-icalls.h, to ensure that all MonoPosixHelper
    exports have correct prototypes.
  * dirent.c, grp.c, macros.c, pwd.c, signal.c, stdio.c, sys-stat.c,
    sys-time.c, utime.c: Correct prototypes to match map-icalls.h.  Alas, this
    "loses" information -- FILE* becomes void*, etc. -- but no semantics or
    ABI should be changed (except for Mono_Posix_Syscall_utime).  Some
    structure names also changed to match the generated names; since the
    structures are private, this shouldn't break anything.
  * errno.c: Remove Mono_Posix_Syscall_SetLastError so we don't get a warning
    about a missing prototype.  This was never in a stable release.
  * old-map.c: Include mph.h for prototype checking.
  * unistd.c: SeekFlags conversion is now done in managed code so that a short
    isn't passed as a parameter; Correct prototypes to match map-icalls.h.
  * sys-xattr.c: fix lsetxattr/fsetxattr confusion; Correct prototypes to
    match map-icalls.h.
  * sys-sendfile.c: Move mph.h include so that HAVE_SYS_SENDFILE_H is used.
  * sys-wait.c: Include mph.h so that prototypes are checked.

svn path=/trunk/mono/; revision=44702
2005-05-18 18:04:49 +00:00

179 lines
4.3 KiB
C

/* This file was automatically generated by make-map from Mono.Posix.dll */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
#include <poll.h>
#include "mph.h"
#include "old-map.h"
int map_Mono_Posix_OpenFlags (int x)
{
int r = 0;
if ((x & Mono_Posix_OpenFlags_O_RDONLY) != 0)
r |= O_RDONLY;
if ((x & Mono_Posix_OpenFlags_O_WRONLY) != 0)
r |= O_WRONLY;
if ((x & Mono_Posix_OpenFlags_O_RDWR) != 0)
r |= O_RDWR;
if ((x & Mono_Posix_OpenFlags_O_CREAT) != 0)
r |= O_CREAT;
if ((x & Mono_Posix_OpenFlags_O_EXCL) != 0)
r |= O_EXCL;
if ((x & Mono_Posix_OpenFlags_O_NOCTTY) != 0)
r |= O_NOCTTY;
if ((x & Mono_Posix_OpenFlags_O_TRUNC) != 0)
r |= O_TRUNC;
if ((x & Mono_Posix_OpenFlags_O_APPEND) != 0)
r |= O_APPEND;
if ((x & Mono_Posix_OpenFlags_O_NONBLOCK) != 0)
r |= O_NONBLOCK;
#ifdef O_SYNC
if ((x & Mono_Posix_OpenFlags_O_SYNC) != 0)
r |= O_SYNC;
#endif
return r;
}
int map_Mono_Posix_FileMode (int x)
{
int r = 0;
if ((x & Mono_Posix_FileMode_S_ISUID) != 0)
r |= S_ISUID;
if ((x & Mono_Posix_FileMode_S_ISGID) != 0)
r |= S_ISGID;
if ((x & Mono_Posix_FileMode_S_ISVTX) != 0)
r |= S_ISVTX;
if ((x & Mono_Posix_FileMode_S_IRUSR) != 0)
r |= S_IRUSR;
if ((x & Mono_Posix_FileMode_S_IWUSR) != 0)
r |= S_IWUSR;
if ((x & Mono_Posix_FileMode_S_IXUSR) != 0)
r |= S_IXUSR;
if ((x & Mono_Posix_FileMode_S_IRGRP) != 0)
r |= S_IRGRP;
if ((x & Mono_Posix_FileMode_S_IWGRP) != 0)
r |= S_IWGRP;
if ((x & Mono_Posix_FileMode_S_IXGRP) != 0)
r |= S_IXGRP;
if ((x & Mono_Posix_FileMode_S_IROTH) != 0)
r |= S_IROTH;
if ((x & Mono_Posix_FileMode_S_IWOTH) != 0)
r |= S_IWOTH;
if ((x & Mono_Posix_FileMode_S_IXOTH) != 0)
r |= S_IXOTH;
return r;
}
int map_Mono_Posix_WaitOptions (int x)
{
int r = 0;
if ((x & Mono_Posix_WaitOptions_WNOHANG) != 0)
r |= WNOHANG;
if ((x & Mono_Posix_WaitOptions_WUNTRACED) != 0)
r |= WUNTRACED;
return r;
}
int map_Mono_Posix_AccessMode (int x)
{
int r = 0;
if ((x & Mono_Posix_AccessMode_R_OK) != 0)
r |= R_OK;
if ((x & Mono_Posix_AccessMode_W_OK) != 0)
r |= W_OK;
if ((x & Mono_Posix_AccessMode_X_OK) != 0)
r |= X_OK;
if ((x & Mono_Posix_AccessMode_F_OK) != 0)
r |= F_OK;
return r;
}
int map_Mono_Posix_Signals (int x)
{
if (x == Mono_Posix_Signals_SIGHUP)
return SIGHUP;
if (x == Mono_Posix_Signals_SIGINT)
return SIGINT;
if (x == Mono_Posix_Signals_SIGQUIT)
return SIGQUIT;
if (x == Mono_Posix_Signals_SIGILL)
return SIGILL;
if (x == Mono_Posix_Signals_SIGTRAP)
return SIGTRAP;
if (x == Mono_Posix_Signals_SIGABRT)
return SIGABRT;
if (x == Mono_Posix_Signals_SIGBUS)
return SIGBUS;
if (x == Mono_Posix_Signals_SIGFPE)
return SIGFPE;
if (x == Mono_Posix_Signals_SIGKILL)
return SIGKILL;
if (x == Mono_Posix_Signals_SIGUSR1)
return SIGUSR1;
if (x == Mono_Posix_Signals_SIGSEGV)
return SIGSEGV;
if (x == Mono_Posix_Signals_SIGUSR2)
return SIGUSR2;
if (x == Mono_Posix_Signals_SIGPIPE)
return SIGPIPE;
if (x == Mono_Posix_Signals_SIGALRM)
return SIGALRM;
if (x == Mono_Posix_Signals_SIGTERM)
return SIGTERM;
if (x == Mono_Posix_Signals_SIGCHLD)
return SIGCHLD;
if (x == Mono_Posix_Signals_SIGCONT)
return SIGCONT;
if (x == Mono_Posix_Signals_SIGSTOP)
return SIGSTOP;
if (x == Mono_Posix_Signals_SIGTSTP)
return SIGTSTP;
if (x == Mono_Posix_Signals_SIGTTIN)
return SIGTTIN;
if (x == Mono_Posix_Signals_SIGTTOU)
return SIGTTOU;
if (x == Mono_Posix_Signals_SIGURG)
return SIGURG;
if (x == Mono_Posix_Signals_SIGXCPU)
return SIGXCPU;
if (x == Mono_Posix_Signals_SIGXFSZ)
return SIGXFSZ;
if (x == Mono_Posix_Signals_SIGVTALRM)
return SIGVTALRM;
if (x == Mono_Posix_Signals_SIGPROF)
return SIGPROF;
if (x == Mono_Posix_Signals_SIGWINCH)
return SIGWINCH;
if (x == Mono_Posix_Signals_SIGIO)
return SIGIO;
if (x == Mono_Posix_Signals_SIGSYS)
return SIGSYS;
return -1;
}
int map_Mono_Posix_PollEvents (int x)
{
int r = 0;
if ((x & Mono_Posix_PollEvents_POLLIN) != 0)
r |= POLLIN;
if ((x & Mono_Posix_PollEvents_POLLPRI) != 0)
r |= POLLPRI;
if ((x & Mono_Posix_PollEvents_POLLOUT) != 0)
r |= POLLOUT;
if ((x & Mono_Posix_PollEvents_POLLERR) != 0)
r |= POLLERR;
if ((x & Mono_Posix_PollEvents_POLLHUP) != 0)
r |= POLLHUP;
if ((x & Mono_Posix_PollEvents_POLLNVAL) != 0)
r |= POLLNVAL;
return r;
}