// Methods that require tuning are bound as `private sys_NAME' methods
// and then a `NAME' method is exposed.
//
+// Deprecated Warning:
+//
+// This class is deprecated, and exists only for backward compatibility
+// with development versions of Mono 1.1.x. It will be removed with
+// Mono 1.2. Migrate to the Mono.Unix.Native types, or use the Unix*
+// wrapper classes instead.
+//
+// The [Map] attributes have been removed. However, since the type names
+// are identical to those in Mono.Unix.Native, the MonoPosixHelper methods
+// will continue to exist and function correctly.
+//
//
// Permission is hereby granted, free of charge, to any person obtaining
using System.Text;
using Mono.Unix;
-[assembly:Mono.Unix.IncludeAttribute (
- new string [] {
- "sys/types.h",
- "sys/stat.h",
- "ah:sys/poll.h",
- "ah:sys/wait.h",
- "ah:sys/statvfs.h",
- "ah:sys/xattr.h",
- "unistd.h",
- "fcntl.h",
- "signal.h",
- "ah:poll.h",
- "ah:grp.h",
- "errno.h",
- "ah:syslog.h",
- },
- new string [] {
- "_GNU_SOURCE",
- "_XOPEN_SOURCE",
- })]
-
namespace Mono.Unix {
#region Enumerations
- [Flags][Map]
+ [Flags]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.SyslogOptions")]
public enum SyslogOptions {
LOG_PID = 0x01, // log the pid with each message
LOG_CONS = 0x02, // log on the console if errors in sending
LOG_PERROR = 0x20 // log to stderr as well
}
- [Map]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.SyslogFacility")]
public enum SyslogFacility {
LOG_KERN = 0 << 3,
LOG_USER = 1 << 3,
LOG_LOCAL7 = 23 << 3,
}
- [Map]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.SyslogLevel")]
public enum SyslogLevel {
LOG_EMERG = 0, // system is unusable
LOG_ALERT = 1, // action must be taken immediately
LOG_DEBUG = 7 // debug-level messages
}
- [Map][Flags]
+ [Flags]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.OpenFlags")]
public enum OpenFlags : int {
//
// One of these
}
// mode_t
- [Flags][Map]
+ [Flags]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.FilePermissions")]
public enum FilePermissions : uint {
S_ISUID = 0x0800, // Set user ID on execution
S_ISGID = 0x0400, // Set gorup ID on execution
S_IFSOCK = 0xC000, // Socket
}
- [Map]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.FcntlCommand")]
public enum FcntlCommand : int {
// Form /usr/include/bits/fcntl.h
F_DUPFD = 0, // Duplicate file descriptor.
F_NOTIFY = 1026, // Required notifications on a directory
}
- [Map]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.LockType")]
public enum LockType : short {
F_RDLCK = 0, // Read lock.
F_WRLCK = 1, // Write lock.
F_UNLCK = 2, // Remove lock.
}
- [Map]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.SeekFlags")]
public enum SeekFlags : short {
// values liberally copied from /usr/include/unistd.h
SEEK_SET = 0, // Seek from beginning of file.
L_XTND = SEEK_END, // BSD alias for SEEK_END
}
- [Map, Flags]
+ [Flags]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.DirectoryNotifyFlags")]
public enum DirectoryNotifyFlags : int {
// from /usr/include/bits/fcntl.h
DN_ACCESS = 0x00000001, // File accessed.
DN_MULTISHOT = unchecked ((int)0x80000000), // Don't remove notifier
}
- [Map]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.PosixFadviseAdvice")]
public enum PosixFadviseAdvice : int {
POSIX_FADV_NORMAL = 0, // No further special treatment.
POSIX_FADV_RANDOM = 1, // Expect random page references.
POSIX_FADV_NOREUSE = 5, // Data will be accessed once.
}
- [Map]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.PosixMadviseAdvice")]
public enum PosixMadviseAdvice : int {
POSIX_MADV_NORMAL = 0, // No further special treatment.
POSIX_MADV_RANDOM = 1, // Expect random page references.
POSIX_MADV_DONTNEED = 4, // Don't need these pages.
}
- [Map]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.Signum")]
public enum Signum : int {
SIGHUP = 1, // Hangup (POSIX).
SIGINT = 2, // Interrupt (ANSI).
SIGUNUSED = 31
}
- [Flags][Map]
+ [Flags]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.WaitOptions")]
public enum WaitOptions : int {
WNOHANG = 1, // Don't block waiting
WUNTRACED = 2, // Report status of stopped children
}
- [Flags][Map]
+ [Flags]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.AccessModes")]
public enum AccessMode : int {
R_OK = 1,
W_OK = 2,
F_OK = 8,
}
- [Map]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.PathConf")]
public enum PathConf : int {
_PC_LINK_MAX,
_PC_MAX_CANON,
_PC_2_SYMLINKS
}
- [Map]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.SysConf")]
public enum SysConf : int {
_SC_ARG_MAX,
_SC_CHILD_MAX,
_SC_LEVEL4_CACHE_LINESIZE
}
- [Map]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.ConfStr")]
public enum ConfStr : int {
_CS_PATH, /* The default search path. */
_CS_V6_WIDTH_RESTRICTED_ENVS,
_CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
}
- [Map]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.LockfCommand")]
public enum LockfCommand : int {
F_ULOCK = 0, // Unlock a previously locked region.
F_LOCK = 1, // Lock a region for exclusive use.
F_TEST = 3, // Test a region for other process locks.
}
- [Map][Flags]
+ [Flags]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.PollEvents")]
public enum PollEvents : short {
POLLIN = 0x0001, // There is data to read
POLLPRI = 0x0002, // There is urgent data to read
POLLWRBAND = 0x0200, // Priority data may be written
}
- [Map][Flags]
+ [Flags]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.XattrFlags")]
public enum XattrFlags : int {
XATTR_AUTO = 0,
XATTR_CREATE = 1,
XATTR_REPLACE = 2,
}
- [Map][Flags]
+ [Flags]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.MountFlags")]
public enum MountFlags : ulong {
ST_RDONLY = 1, // Mount read-only
ST_NOSUID = 2, // Ignore suid and sgid bits
ST_NODIRATIME = 2048, // Do not update directory access times
}
- [Map][Flags]
+ [Flags]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.MmapFlags")]
public enum MmapFlags : int {
MAP_SHARED = 0x01, // Share changes.
MAP_PRIVATE = 0x02, // Changes are private.
MAP_NONBLOCK = 0x10000, // Do not block on IO.
}
- [Map][Flags]
+ [Flags]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.MmapProts")]
public enum MmapProt : int {
PROT_READ = 0x1, // Page can be read.
PROT_WRITE = 0x2, // Page can be written.
// growsup vma (mprotect only).
}
- [Map][Flags]
+ [Flags]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.MsyncFlags")]
public enum MsyncFlags : int {
MS_ASYNC = 0x1, // Sync memory asynchronously.
MS_SYNC = 0x4, // Synchronous memory sync.
MS_INVALIDATE = 0x2, // Invalidate the caches.
}
- [Map][Flags]
+ [Flags]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.MlockallFlags")]
public enum MlockallFlags : int {
MCL_CURRENT = 0x1, // Lock all currently mapped pages.
MCL_FUTURE = 0x2, // Lock all additions to address
}
- [Map][Flags]
+ [Flags]
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.MremapFlags")]
public enum MremapFlags : ulong {
MREMAP_MAYMOVE = 0x1,
}
#region Structures
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.Flock")]
public struct Flock {
public LockType l_type; // Type of lock: F_RDLCK, F_WRLCK, F_UNLCK
public SeekFlags l_whence; // How to interpret l_start
public /* pid_t */ int l_pid; // PID of process blocking our lock (F_GETLK only)
}
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.Pollfd")]
[StructLayout(LayoutKind.Sequential)]
public struct Pollfd {
public int fd;
public PollEvents revents;
}
+ [Obsolete ("Use Mono.Unix.Native.Stat")]
public struct Stat {
+ [CLSCompliant (false)]
public /* dev_t */ ulong st_dev; // device
+ [CLSCompliant (false)]
public /* ino_t */ ulong st_ino; // inode
+ [CLSCompliant (false)]
public FilePermissions st_mode; // protection
private uint _padding_; // padding for structure alignment
+ [CLSCompliant (false)]
public /* nlink_t */ ulong st_nlink; // number of hard links
+ [CLSCompliant (false)]
public /* uid_t */ uint st_uid; // user ID of owner
+ [CLSCompliant (false)]
public /* gid_t */ uint st_gid; // group ID of owner
+ [CLSCompliant (false)]
public /* dev_t */ ulong st_rdev; // device type (if inode device)
public /* off_t */ long st_size; // total size, in bytes
public /* blksize_t */ long st_blksize; // blocksize for filesystem I/O
public /* time_t */ long st_ctime; // time of last status change
}
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.Statvfs")]
public struct Statvfs {
public ulong f_bsize; // file system block size
public ulong f_frsize; // fragment size
public ulong f_namemax; // maximum filename length
}
+ [Obsolete ("Use Mono.Unix.Native.Timeval")]
public struct Timeval {
public /* time_t */ long tv_sec; // seconds
public /* suseconds_t */ long tv_usec; // microseconds
}
+ [Obsolete ("Use Mono.Unix.Native.Timezone")]
public struct Timezone {
public int tz_minuteswest; // minutes W of Greenwich
private int tz_dsttime; // type of dst correction (OBSOLETE)
}
+ [Obsolete ("Use Mono.Unix.Native.Utimbuf")]
public struct Utimbuf {
public /* time_t */ long actime; // access time
public /* time_t */ long modtime; // modification time
#region Classes
+ [Obsolete ("Use Mono.Unix.Native.Dirent")]
public sealed class Dirent
{
+ [CLSCompliant (false)]
public /* ino_t */ ulong d_ino;
public /* off_t */ long d_off;
+ [CLSCompliant (false)]
public ushort d_reclen;
public byte d_type;
public string d_name;
}
}
+ [Obsolete ("Use Mono.Unix.Native.Fstab")]
public sealed class Fstab
{
public string fs_spec;
}
}
+ [Obsolete ("Use Mono.Unix.Native.Group")]
public sealed class Group
{
public string gr_name;
public string gr_passwd;
+ [CLSCompliant (false)]
public /* gid_t */ uint gr_gid;
public string[] gr_mem;
}
}
+ [Obsolete ("Use Mono.Unix.Native.Passwd")]
public sealed class Passwd
{
public string pw_name;
public string pw_passwd;
+ [CLSCompliant (false)]
public /* uid_t */ uint pw_uid;
+ [CLSCompliant (false)]
public /* gid_t */ uint pw_gid;
public string pw_gecos;
public string pw_dir;
// EntryPointNotFoundException. This is also consistent with a missing
// P/Invoke into libc.so.
//
+ [CLSCompliant (false)]
+ [Obsolete ("Use Mono.Unix.Native.Syscall")]
public sealed class Syscall : Stdlib
{
new internal const string LIBC = "libc";
// TODO: times(2)
+ //
+ // <sys/utsname.h>
+ //
+
+ // TODO: uname(2)
+
#region <sys/wait.h> Declarations
//
// <sys/wait.h>