2015-10-05 21:20:25 +01:00
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
|
|
|
|
namespace DiscImageChef.Devices.Linux
|
|
|
|
|
|
{
|
|
|
|
|
|
static class Extern
|
|
|
|
|
|
{
|
|
|
|
|
|
[DllImport("libc", CharSet = CharSet.Ansi, SetLastError = true)]
|
2015-10-06 21:18:02 +01:00
|
|
|
|
internal static extern int open(
|
|
|
|
|
|
string pathname,
|
|
|
|
|
|
[MarshalAs(UnmanagedType.U4)]
|
|
|
|
|
|
FileFlags flags);
|
2015-10-05 21:20:25 +01:00
|
|
|
|
|
|
|
|
|
|
[DllImport("libc")]
|
|
|
|
|
|
internal static extern int close(int fd);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport("libc", EntryPoint="ioctl", SetLastError = true)]
|
2015-10-12 06:25:49 +01:00
|
|
|
|
internal static extern int ioctlInt(int fd, LinuxIoctl request, out int value);
|
2015-10-05 21:20:25 +01:00
|
|
|
|
|
|
|
|
|
|
[DllImport("libc", EntryPoint="ioctl", SetLastError = true)]
|
2015-10-12 06:25:49 +01:00
|
|
|
|
internal static extern int ioctlSg(int fd, LinuxIoctl request, ref sg_io_hdr_t value);
|
2015-10-07 02:15:31 +01:00
|
|
|
|
|
|
|
|
|
|
[DllImport("libc", EntryPoint="ioctl", SetLastError = true)]
|
2015-10-12 06:25:49 +01:00
|
|
|
|
internal static extern int ioctlHdTaskfile(int fd, LinuxIoctl request, ref hd_drive_task_hdr value);
|
2015-10-07 02:15:31 +01:00
|
|
|
|
|
|
|
|
|
|
[DllImport("libc", EntryPoint="ioctl", SetLastError = true)]
|
2015-10-12 06:25:49 +01:00
|
|
|
|
internal static extern int ioctlHdTask(int fd, LinuxIoctl request, ref byte[] value);
|
2015-10-05 21:20:25 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|