Restore (sort of) the Mono.Posix.dll

The assembly contains type forwarders to point to the new Mono.Unix.dll
and also a handful of obsolete types in the `Mono.Posix` namespace which
were removed from Mono.Unix.dll. The obsolete types will now cause a
build error if used.
This commit is contained in:
Marek Habersack 2021-03-29 16:10:34 +02:00
Родитель d8cca2f0fc
Коммит 8c09b4b6a8
17 изменённых файлов: 833 добавлений и 2 удалений

Просмотреть файл

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<PackageId>Mono.Posix</PackageId>
<NugetPackageId>Mono.Posix</NugetPackageId>
<VersionPrefix>$(ProductVersion)</VersionPrefix>
<VersionSuffix>$(ProductSuffix)</VersionSuffix>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
@ -20,6 +20,7 @@
<DelaySign>true</DelaySign>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)Open.snk</AssemblyOriginatorKeyFile>
<OutputPath>$(MSBuildThisFileDirectory)build/managed/$(Configuration)</OutputPath>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$([MSBuild]::IsOSPlatform(Windows))' == 'false' ">

Просмотреть файл

@ -7,6 +7,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{1E84CF29-7AB
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Unix", "src\Mono.Unix\Mono.Unix.csproj", "{ECFA7B06-6453-4F7A-9308-394B0212BDEE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Posix", "src\Mono.Posix\Mono.Posix.csproj", "{76BA4DE5-DCA6-4FCF-886A-336B12673FBA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -32,8 +34,21 @@ Global
{ECFA7B06-6453-4F7A-9308-394B0212BDEE}.Release|x64.Build.0 = Release|Any CPU
{ECFA7B06-6453-4F7A-9308-394B0212BDEE}.Release|x86.ActiveCfg = Release|Any CPU
{ECFA7B06-6453-4F7A-9308-394B0212BDEE}.Release|x86.Build.0 = Release|Any CPU
{76BA4DE5-DCA6-4FCF-886A-336B12673FBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{76BA4DE5-DCA6-4FCF-886A-336B12673FBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{76BA4DE5-DCA6-4FCF-886A-336B12673FBA}.Debug|x64.ActiveCfg = Debug|Any CPU
{76BA4DE5-DCA6-4FCF-886A-336B12673FBA}.Debug|x64.Build.0 = Debug|Any CPU
{76BA4DE5-DCA6-4FCF-886A-336B12673FBA}.Debug|x86.ActiveCfg = Debug|Any CPU
{76BA4DE5-DCA6-4FCF-886A-336B12673FBA}.Debug|x86.Build.0 = Debug|Any CPU
{76BA4DE5-DCA6-4FCF-886A-336B12673FBA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{76BA4DE5-DCA6-4FCF-886A-336B12673FBA}.Release|Any CPU.Build.0 = Release|Any CPU
{76BA4DE5-DCA6-4FCF-886A-336B12673FBA}.Release|x64.ActiveCfg = Release|Any CPU
{76BA4DE5-DCA6-4FCF-886A-336B12673FBA}.Release|x64.Build.0 = Release|Any CPU
{76BA4DE5-DCA6-4FCF-886A-336B12673FBA}.Release|x86.ActiveCfg = Release|Any CPU
{76BA4DE5-DCA6-4FCF-886A-336B12673FBA}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{ECFA7B06-6453-4F7A-9308-394B0212BDEE} = {1E84CF29-7ABE-4B07-A378-5F4B996EDC01}
{76BA4DE5-DCA6-4FCF-886A-336B12673FBA} = {1E84CF29-7ABE-4B07-A378-5F4B996EDC01}
EndGlobalSection
EndGlobal

104
src/Mono.Posix/Forwards.cs Normal file
Просмотреть файл

@ -0,0 +1,104 @@
using System.Runtime.CompilerServices;
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.AbstractUnixEndPoint))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Catalog))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.FileAccessPattern))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.FileAccessPermissions))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.FileHandleOperations))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.FileSpecialAttributes))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.FileTypes))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.PeerCred))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.StdioFileStream))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.UnixClient))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.UnixDirectoryInfo))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.UnixDriveType))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.UnixDriveInfo))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.UnixEncoding))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.UnixEndPoint))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.UnixEnvironment))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.UnixFileInfo))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.UnixFileSystemInfo))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.UnixGroupInfo))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.UnixIOException))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.UnixListener))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.UnixMarshal))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.UnixPath))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.UnixPipes))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.UnixProcess))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.UnixSignal))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.UnixStream))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.UnixSymbolicLinkInfo))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.UnixUserInfo))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.NativeConvert))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.RealTimeSignum))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.Errno))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.FilePosition))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.SignalAction))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.SignalHandler))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.Stdlib))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.SyslogOptions))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.SyslogFacility))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.SyslogLevel))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.OpenFlags))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.AtFlags))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.FilePermissions))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.FcntlCommand))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.LockType))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.SealType))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.SeekFlags))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.DirectoryNotifyFlags))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.PosixFadviseAdvice))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.PosixMadviseAdvice))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.Signum))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.WaitOptions))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.AccessModes))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.PathconfName))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.SysconfName))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.ConfstrName))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.LockfCommand))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.PollEvents))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.XattrFlags))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.MountFlags))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.MmapFlags))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.MmapProts))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.MsyncFlags))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.MlockallFlags))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.MremapFlags))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.MemfdFlags))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.UnixSocketType))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.UnixSocketFlags))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.UnixSocketProtocol))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.UnixAddressFamily))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.UnixSocketOptionName))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.MessageFlags))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.ShutdownOption))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.UnixSocketControlMessage))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.Flock))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.Pollfd))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.Stat))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.Statvfs))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.Timeval))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.Timezone))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.Utimbuf))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.Timespec))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.Iovec))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.EpollFlags))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.EpollEvents))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.EpollOp))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.EpollEvent))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.Linger))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.InAddr))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.In6Addr))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.Cmsghdr))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.Dirent))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.Fstab))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.Group))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.Passwd))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.Utsname))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.Sockaddr))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.SockaddrStorage))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.SockaddrUn))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.SockaddrIn))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.SockaddrIn6))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.Msghdr))]
[assembly: TypeForwardedTo(typeof (global::Mono.Unix.Native.Syscall))]

Просмотреть файл

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.1;netcoreapp3.1;net6.0;</TargetFrameworks>
<AssemblyName>Mono.Posix</AssemblyName>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
</PropertyGroup>
<Import Project="../../Mono.Unix.Common.props" />
<ItemGroup>
<Compile Include="*.cs" />
<Compile Include="Obsolete/*.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../Mono.Unix/Mono.Unix.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,21 @@
using System;
namespace Mono.Posix
{
[Flags]
[Obsolete ("Use Mono.Unix.Native.AccessModes", true)]
public enum AccessMode
{
[Obsolete ("Use Mono.Unix.Native.AccessModes.R_OK", true)]
R_OK = 1,
[Obsolete ("Use Mono.Unix.Native.AccessModes.W_OK", true)]
W_OK = 2,
[Obsolete ("Use Mono.Unix.Native.AccessModes.X_OK", true)]
X_OK = 4,
[Obsolete ("Use Mono.Unix.Native.AccessModes.F_OK", true)]
F_OK = 8
}
}

Просмотреть файл

@ -0,0 +1,23 @@
using System;
namespace Mono.Posix
{
[Obsolete ("Use Mono.Unix.Catalog", true)]
public class Catalog
{
public static void Init (String package, String localedir)
{
throw new NotImplementedException ();
}
public static string GetString (String s)
{
throw new NotImplementedException ();
}
public static string GetPluralString (String s, String p, Int32 n)
{
throw new NotImplementedException ();
}
}
}

Просмотреть файл

@ -0,0 +1,45 @@
using System;
namespace Mono.Posix
{
[Flags]
[Obsolete ("Use Mono.Unix.Native.FilePermissions", true)]
public enum FileMode
{
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_ISUID", true)]
S_ISUID = 2048,
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_ISGID", true)]
S_ISGID = 1024,
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_ISVTX", true)]
S_ISVTX = 512,
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IRUSR", true)]
S_IRUSR = 256,
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IWUSR", true)]
S_IWUSR = 128,
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_XUSR", true)]
S_IXUSR = 64,
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IRGRP", true)]
S_IRGRP = 32,
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IWGRP", true)]
S_IWGRP = 16,
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IXGRP", true)]
S_IXGRP = 8,
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IROTH", true)]
S_IROTH = 4,
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IWOTH", true)]
S_IWOTH = 2,
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IXOTH", true)]
S_IXOTH = 1
}
}

Просмотреть файл

@ -0,0 +1,39 @@
using System;
namespace Mono.Posix
{
[Flags]
[Obsolete ("Use Mono.Unix.Native.OpenFlags", true)]
public enum OpenFlags
{
[Obsolete ("Use Mono.Unix.Native.OpenFlags.O_RDONLY", true)]
O_RDONLY = 0,
[Obsolete ("Use Mono.Unix.Native.OpenFlags.O_WDONLY", true)]
O_WRONLY = 1,
[Obsolete ("Use Mono.Unix.Native.OpenFlags.O_RDWR", true)]
O_RDWR = 2,
[Obsolete ("Use Mono.Unix.Native.OpenFlags.O_CREAT", true)]
O_CREAT = 4,
[Obsolete ("Use Mono.Unix.Native.OpenFlags.O_EXCL", true)]
O_EXCL = 8,
[Obsolete ("Use Mono.Unix.Native.OpenFlags.O_NOCTTY", true)]
O_NOCTTY = 16,
[Obsolete ("Use Mono.Unix.Native.OpenFlags.O_TRUNC", true)]
O_TRUNC = 32,
[Obsolete ("Use Mono.Unix.Native.OpenFlags.O_APPEND", true)]
O_APPEND = 64,
[Obsolete ("Use Mono.Unix.Native.OpenFlags.O_NONBLOCK", true)]
O_NONBLOCK = 128,
[Obsolete ("Use Mono.Unix.Native.OpenFlags.O_SYNC", true)]
O_SYNC = 256,
}
}

Просмотреть файл

@ -0,0 +1,18 @@
using System;
using System.Net.Sockets;
namespace Mono.Posix
{
[Obsolete ("Use Mono.Unix.PeerCred", true)]
public class PeerCred
{
public int ProcessID => throw new NotImplementedException ();
public int UserID => throw new NotImplementedException ();
public int GroupID => throw new NotImplementedException ();
public PeerCred (Socket sock)
{
throw new NotImplementedException ();
}
}
}

Просмотреть файл

@ -0,0 +1,95 @@
using System;
namespace Mono.Posix
{
[Obsolete ("Use Mono.Unix.Native.Signum", true)]
public enum Signals
{
[Obsolete ("Use Mono.Unix.Native.Signum.SIGHUP", true)]
SIGHUP,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGINT", true)]
SIGINT,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGQUIT", true)]
SIGQUIT,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGILL", true)]
SIGILL,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGTRAP", true)]
SIGTRAP,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGABRT", true)]
SIGABRT,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGBUS", true)]
SIGBUS,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGFPE", true)]
SIGFPE,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGKILL", true)]
SIGKILL,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGUSR1", true)]
SIGUSR1,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGSEGV", true)]
SIGSEGV,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGUSR2", true)]
SIGUSR2,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGPIPE", true)]
SIGPIPE,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGALRM", true)]
SIGALRM,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGTERM", true)]
SIGTERM,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGCHLD", true)]
SIGCHLD,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGCONT", true)]
SIGCONT,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGSTOP", true)]
SIGSTOP,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGTSTP", true)]
SIGTSTP,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGTTIN", true)]
SIGTTIN,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGTTOU", true)]
SIGTTOU,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGURG", true)]
SIGURG,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGXCPU", true)]
SIGXCPU,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGXFSZ", true)]
SIGXFSZ,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGVTALRM", true)]
SIGVTALRM,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGPROF", true)]
SIGPROF,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGWINCH", true)]
SIGWINCH,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGIO", true)]
SIGIO,
[Obsolete ("Use Mono.Unix.Native.Signum.SIGSYS", true)]
SIGSYS,
}
}

Просмотреть файл

@ -0,0 +1,56 @@
using System;
namespace Mono.Posix
{
[Obsolete ("Use Mono.Unix.Native.Stat", true)]
public struct Stat
{
[Obsolete ("Use Mono.Unix.Native.Stat.st_dev", true)]
public readonly int Device;
[Obsolete ("Use Mono.Unix.Native.Stat.st_ino", true)]
public readonly int INode;
[Obsolete ("Use Mono.Unix.Native.Stat.st_mode", true)]
public readonly StatMode Mode;
[Obsolete ("Use Mono.Unix.Native.Stat.st_nlink", true)]
public readonly int NLinks;
[Obsolete ("Use Mono.Unix.Native.Stat.st_uid", true)]
public readonly int Uid;
[Obsolete ("Use Mono.Unix.Native.Stat.st_gid", true)]
public readonly int Gid;
[Obsolete ("Use Mono.Unix.Native.Stat.st_rdev", true)]
public readonly long DeviceType;
[Obsolete ("Use Mono.Unix.Native.Stat.st_size", true)]
public readonly long Size;
[Obsolete ("Use Mono.Unix.Native.Stat.st_blksize", true)]
public readonly long BlockSize;
[Obsolete ("Use Mono.Unix.Native.Stat.st_blocks", true)]
public readonly long Blocks;
[Obsolete ("Use Mono.Unix.Native.Stat.st_atime", true)]
public readonly DateTime ATime;
[Obsolete ("Use Mono.Unix.Native.Stat.st_mtime", true)]
public readonly DateTime MTime;
[Obsolete ("Use Mono.Unix.Native.Stat.st_ctime", true)]
public readonly DateTime CTime;
[Obsolete ("Use Mono.Unix.Native.NativeConvert.LocalUnixEpoch", true)]
public static readonly DateTime UnixEpoch = new DateTime (1970, 1, 1);
[Obsolete ("Use Mono.Unix.Native.NativeConvert.ToDateTime", true)]
public static DateTime UnixToDateTime (long unix)
{
throw new NotImplementedException ();
}
}
}

Просмотреть файл

@ -0,0 +1,66 @@
using System;
namespace Mono.Posix
{
[Flags]
[Obsolete ("Use Mono.Unix.Native.FilePermissions", true)]
public enum StatMode
{
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IFSOCK", true)]
Socket = 0xC000, // socket
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IFLNK", true)]
SymLink = 0xA000, // symbolic link
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IFREG", true)]
Regular = 0x8000, // regular file
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IFBLK", true)]
BlockDevice = 0x6000, // block device
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IFDIR", true)]
Directory = 0x4000, // directory
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IFCHR", true)]
CharDevice = 0x2000, // character device
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IFIFO", true)]
FIFO = 0x1000, // fifo
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_ISUID", true)]
SUid = 0x800, // set UID bit
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_ISGID", true)]
SGid = 0x400, // set GID bit
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_ISVTX", true)]
Sticky = 0x200, // sticky bit
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IRUSR", true)]
OwnerRead = 0x100, // owner has read permission
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IWUSR", true)]
OwnerWrite = 0x80, // owner has write permission
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IXUSR", true)]
OwnerExecute = 0x40, // owner has execute permission
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IRGRP", true)]
GroupRead = 0x20, // group has read permission
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IWGRP", true)]
GroupWrite = 0x10, // group has write permission
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IXGRP", true)]
GroupExecute = 0x8, // group has execute permission
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IROTH", true)]
OthersRead = 0x4, // others have read permission
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IWOTH", true)]
OthersWrite = 0x2, // others have write permisson
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IXOTH", true)]
OthersExecute = 0x1, // others have execute permission
}
}

Просмотреть файл

@ -0,0 +1,20 @@
using System;
namespace Mono.Posix
{
[Obsolete ("Use Mono.Unix.Native.FilePermissions", true)]
public enum StatModeMasks
{
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_IFMT", true)]
TypeMask = 0xF000, // bitmask for the file type bitfields
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_RWXU", true)]
OwnerMask = 0x1C0, // mask for file owner permissions
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_RWXG", true)]
GroupMask = 0x38, // mask for group permissions
[Obsolete ("Use Mono.Unix.Native.FilePermissions.S_RWXO", true)]
OthersMask = 0x7, // mask for permissions for others (not in group)
}
}

Просмотреть файл

@ -0,0 +1,244 @@
using System;
namespace Mono.Posix
{
[Obsolete ("Use Mono.Unix.Native.Syscall", true)]
public class Syscall
{
[Obsolete ("Use Mono.Unix.Native.Syscall.exit", true)]
public static extern int exit (int status);
[Obsolete ("Use Mono.Unix.Native.Syscall.fork", true)]
public static extern int fork ();
[Obsolete ("Use Mono.Unix.Native.Syscall.read", true)]
public unsafe static extern IntPtr read (int fileDescriptor, void *buf, IntPtr count);
[Obsolete ("Use Mono.Unix.Native.Syscall.write", true)]
public unsafe static extern IntPtr write (int fileDescriptor, void *buf, IntPtr count);
[Obsolete ("Use Mono.Unix.Native.Syscall.open", true)]
public static int open (string pathname, OpenFlags flags)
{
throw new NotImplementedException ();
}
[Obsolete ("Use Mono.Unix.Native.Syscall.open", true)]
public static int open (string pathname, OpenFlags flags, FileMode mode)
{
throw new NotImplementedException ();
}
[Obsolete ("Use Mono.Unix.Native.Syscall.close", true)]
public static extern int close (int fileDescriptor);
[Obsolete ("Use Mono.Unix.Native.Syscall.waitpid", true)]
public static int waitpid (int pid, out int status, WaitOptions options)
{
throw new NotImplementedException ();
}
[Obsolete ("Use Mono.Unix.Native.Syscall.waitpid", true)]
public static int waitpid (int pid, WaitOptions options)
{
throw new NotImplementedException ();
}
[Obsolete ("Use Mono.Unix.Native.Syscall.WIFEXITED", true)]
public static extern int WIFEXITED (int status);
[Obsolete ("Use Mono.Unix.Native.Syscall.WEXITSTATUS", true)]
public static extern int WEXITSTATUS (int status);
[Obsolete ("Use Mono.Unix.Native.Syscall.WIFSIGNALED", true)]
public static extern int WIFSIGNALED (int status);
[Obsolete ("Use Mono.Unix.Native.Syscall.WTERMSIG", true)]
public static extern int WTERMSIG (int status);
[Obsolete ("Use Mono.Unix.Native.Syscall.WIFSTOPPED", true)]
public static extern int WIFSTOPPED (int status);
[Obsolete ("Use Mono.Unix.Native.Syscall.WSTOPSIG", true)]
public static extern int WSTOPSIG (int status);
[Obsolete ("Use Mono.Unix.Native.Syscall.creat", true)]
public static int creat (string pathname, FileMode flags)
{
throw new NotImplementedException ();
}
[Obsolete ("Use Mono.Unix.Native.Syscall.link", true)]
public static extern int link (string oldPath, string newPath);
[Obsolete ("Use Mono.Unix.Native.Syscall.unlink", true)]
public static extern int unlink (string path);
[Obsolete ("Use Mono.Unix.Native.Syscall.symlink", true)]
public static extern int symlink (string oldpath, string newpath);
[Obsolete ("Use Mono.Unix.Native.Syscall.chdir", true)]
public static extern int chdir (string path);
[Obsolete ("Use Mono.Unix.Native.Syscall.chmod", true)]
public static int chmod (string path, FileMode mode)
{
throw new NotImplementedException ();
}
[Obsolete ("Use Mono.Unix.Native.Syscall.chown", true)]
public static extern int chown (string path, int owner, int group);
[Obsolete ("Use Mono.Unix.Native.Syscall.lchown", true)]
public static extern int lchown (string path, int owner, int group);
[Obsolete ("Use Mono.Unix.Native.Syscall.lseek", true)]
public static extern int lseek (int fileDescriptor, int offset, int whence);
[Obsolete ("Use Mono.Unix.Native.Syscall.getpid", true)]
public static extern int getpid ();
[Obsolete ("Use Mono.Unix.Native.Syscall.setuid", true)]
public static extern int setuid (int uid);
[Obsolete ("Use Mono.Unix.Native.Syscall.getuid", true)]
public static extern int getuid ();
[Obsolete ("Use Mono.Unix.Native.Syscall.alarm", true)]
public static extern uint alarm (uint seconds);
[Obsolete ("Use Mono.Unix.Native.Syscall.pause", true)]
public static extern int pause ();
[Obsolete ("Use Mono.Unix.Native.Syscall.access", true)]
public static int access (string pathname, AccessMode mode)
{
throw new NotImplementedException ();
}
[Obsolete ("Use Mono.Unix.Native.Syscall.nice", true)]
public static extern int nice (int increment);
[Obsolete ("Use Mono.Unix.Native.Syscall.mkdir", true)]
public static int mkdir (string pathname, FileMode mode)
{
throw new NotImplementedException ();
}
[Obsolete ("Use Mono.Unix.Native.Syscall.rmdir", true)]
public static extern int rmdir (string path);
[Obsolete ("Use Mono.Unix.Native.Syscall.dup", true)]
public static extern int dup (int fileDescriptor);
[Obsolete ("Use Mono.Unix.Native.Syscall.setgid", true)]
public static extern int setgid (int gid);
[Obsolete ("Use Mono.Unix.Native.Syscall.getgid", true)]
public static extern int getgid ();
[Obsolete ("Use Mono.Unix.Native.Syscall.sighandler_t", true)]
public delegate void sighandler_t (int v);
[Obsolete ("Use Mono.Unix.Native.Syscall.signal", true)]
public static extern int signal (int signum, sighandler_t handler);
[Obsolete ("Use Mono.Unix.Native.Syscall.geteuid", true)]
public static extern int geteuid ();
[Obsolete ("Use Mono.Unix.Native.Syscall.getegid", true)]
public static extern int getegid ();
[Obsolete ("Use Mono.Unix.Native.Syscall.setpgid", true)]
public static extern int setpgid (int pid, int pgid);
[Obsolete ("Use Mono.Unix.Native.Syscall.umask", true)]
public static extern int umask (int umask);
[Obsolete ("Use Mono.Unix.Native.Syscall.chroot", true)]
public static extern int chroot (string path);
[Obsolete ("Use Mono.Unix.Native.Syscall.dup2", true)]
public static extern int dup2 (int oldFileDescriptor, int newFileDescriptor);
[Obsolete ("Use Mono.Unix.Native.Syscall.getppid", true)]
public static extern int getppid ();
[Obsolete ("Use Mono.Unix.Native.Syscall.getpgrp", true)]
public static extern int getpgrp ();
[Obsolete ("Use Mono.Unix.Native.Syscall.setsid", true)]
public static extern int setsid ();
[Obsolete ("Use Mono.Unix.Native.Syscall.setreuid", true)]
public static extern int setreuid (int ruid, int euid);
[Obsolete ("Use Mono.Unix.Native.Syscall.setregid", true)]
public static extern int setregid (int rgid, int egid);
[Obsolete ("Use Mono.Unix.Native.Syscall.getusername", true)]
public static string getusername (int uid)
{
throw new NotImplementedException ();
}
[Obsolete ("Use Mono.Unix.Native.Syscall.getgroupname", true)]
public static string getgroupname (int gid)
{
throw new NotImplementedException ();
}
[Obsolete ("Use Mono.Unix.Native.Syscall.GetHostName", true)]
public static string GetHostName ()
{
throw new NotImplementedException ();
}
[Obsolete ("Use Mono.Unix.Native.Syscall.gethostname", true)]
public static string gethostname ()
{
throw new NotImplementedException ();
}
[Obsolete ("Use Mono.Unix.Native.Syscall.isatty", true)]
public static bool isatty (int desc)
{
throw new NotImplementedException ();
}
[Obsolete ("Use Mono.Unix.Native.Syscall.stat", true)]
public static int stat (string filename, out Stat stat)
{
throw new NotImplementedException ();
}
[Obsolete ("Use Mono.Unix.Native.Syscall.lstat", true)]
public static int lstat (string filename, out Stat stat)
{
throw new NotImplementedException ();
}
[Obsolete ("Use Mono.Unix.Native.Syscall.readlink", true)]
public static string readlink (string path)
{
throw new NotImplementedException ();
}
[Obsolete ("Use Mono.Unix.Native.Syscall.strerror", true)]
public static string strerror (int errnum)
{
throw new NotImplementedException ();
}
[Obsolete ("Use Mono.Unix.Native.Syscall.opendir", true)]
public static extern IntPtr opendir (string path);
[Obsolete ("Use Mono.Unix.Native.Syscall.closedir", true)]
public static extern int closedir (IntPtr dir);
[Obsolete ("Use Mono.Unix.Native.Syscall.readdir", true)]
public static extern string readdir (IntPtr dir);
}
}

Просмотреть файл

@ -0,0 +1,50 @@
using System;
using System.Net;
using System.Net.Sockets;
namespace Mono.Posix
{
[Serializable]
[Obsolete ("Use Mono.Unix.UnixEndPoint", true)]
public class UnixEndPoint : EndPoint
{
[Obsolete ("Use Mono.Unix.UnixEndPoint.Filename", true)]
public string Filename {
get => throw new NotImplementedException ();
set => throw new NotImplementedException ();
}
public override AddressFamily AddressFamily => throw new NotImplementedException ();
[Obsolete ("Use Mono.Unix.UnixEndPoint.ctor", true)]
public UnixEndPoint (string filename)
{
throw new NotImplementedException ();
}
public override EndPoint Create (SocketAddress socketAddress)
{
throw new NotImplementedException ();
}
public override SocketAddress Serialize ()
{
throw new NotImplementedException ();
}
public override string ToString ()
{
throw new NotImplementedException ();
}
public override int GetHashCode ()
{
throw new NotImplementedException ();
}
public override bool Equals (object o)
{
throw new NotImplementedException ();
}
}
}

Просмотреть файл

@ -0,0 +1,15 @@
using System;
namespace Mono.Posix
{
[Flags]
[Obsolete ("Use Mono.Unix.Native.WaitOptions", true)]
public enum WaitOptions
{
[Obsolete ("Use Mono.Unix.Native.WaitOptions.WNOHANG", true)]
WNOHANG,
[Obsolete ("Use Mono.Unix.Native.WaitOptions.WUNTRACED", true)]
WUNTRACED
}
}

Просмотреть файл

@ -3,8 +3,8 @@
<TargetFrameworks>netstandard2.1;netcoreapp3.1;net6.0;</TargetFrameworks>
<AssemblyName>Mono.Unix</AssemblyName>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<PackageId>$(NugetPackageId)</PackageId>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<Import Project="../../Mono.Unix.Common.props" />