* Use Mono.Unix.Native. This also includes a switch to Mono's extended attribute bindings which I wrote ages ago. Index: configure.in =================================================================== RCS file: /cvs/gnome/beagle/configure.in,v retrieving revision 1.191 diff -u -B -p -r1.191 configure.in --- configure.in 14 Nov 2005 22:19:22 -0000 1.191 +++ configure.in 15 Nov 2005 20:28:41 -0000 @@ -77,13 +77,10 @@ case "$target" in *-*-linux*) os=linux os_has_inotify=yes - AC_CHECK_LIB(attr, lsetxattr, XATTR_LIB="libattr",) - AC_CHECK_FUNC(lsetxattr, XATTR_LIB="libc",) ;; *-*-freebsd*) os=freebsd os_has_inotify=no - AC_CHECK_FUNC(extattr_set_link, XATTR_LIB="libc") ;; *) AC_MSG_ERROR([Unrecognised target OS: $target]) @@ -92,12 +89,6 @@ esac AM_CONDITIONAL(OS_LINUX, test "x$os" = "xlinux") AM_CONDITIONAL(OS_FREEBSD, test "x$os" = "xfreebsd") -# check for xattr implementation -if test "x$XATTR_LIB" = "x"; then - AC_MSG_ERROR([Could not find a support extended attribute implementation (tried libc and libattr)]) -fi -AC_SUBST(XATTR_LIB) - # check for desktop-launch AC_PATH_PROG(DESKTOP_LAUNCH, desktop-launch, no) @@ -755,7 +746,6 @@ po/Makefile.in echo " Beagle Version: ${BEAGLE_VERSION} Target OS: ${os} - Extended Attributes: ${XATTR_LIB} inotify? ${enable_inotify} Prefix: ${prefix} Index: BeagleClient/Indexable.cs =================================================================== RCS file: /cvs/gnome/beagle/BeagleClient/Indexable.cs,v retrieving revision 1.39 diff -u -B -p -r1.39 Indexable.cs --- BeagleClient/Indexable.cs 24 Oct 2005 23:03:32 -0000 1.39 +++ BeagleClient/Indexable.cs 15 Nov 2005 20:28:42 -0000 @@ -500,7 +500,7 @@ namespace Beagle { // Make sure the temporary file is only readable by the owner. // FIXME: There is probably a race here. Could some malicious program // do something to the file between creation and the chmod? - Mono.Unix.Syscall.chmod (filename, (Mono.Unix.FilePermissions) 256); + Mono.Unix.Native.Syscall.chmod (filename, (Mono.Unix.Native.FilePermissions) 256); BufferedStream bufferedStream = new BufferedStream (fileStream); StreamWriter writer = new StreamWriter (bufferedStream); @@ -536,7 +536,7 @@ namespace Beagle { // Make sure the temporary file is only readable by the owner. // FIXME: There is probably a race here. Could some malicious program // do something to the file between creation and the chmod? - Mono.Unix.Syscall.chmod (filename, (Mono.Unix.FilePermissions) 256); + Mono.Unix.Native.Syscall.chmod (filename, (Mono.Unix.Native.FilePermissions) 256); BufferedStream bufferedStream = new BufferedStream (fileStream); Index: BeagleClient/Makefile.am =================================================================== RCS file: /cvs/gnome/beagle/BeagleClient/Makefile.am,v retrieving revision 1.23 diff -u -B -p -r1.23 Makefile.am --- BeagleClient/Makefile.am 3 Nov 2005 19:17:29 -0000 1.23 +++ BeagleClient/Makefile.am 15 Nov 2005 20:28:43 -0000 @@ -1,9 +1,8 @@ # Warnings we don't want to see # 0067 = event defined but not used -# 0618 = Mono.Posix.Syscall is obsolete -CSC = mcs -debug -nowarn:0067,0618 +CSC = mcs -debug -nowarn:0067 TARGET = Beagle.dll Index: Filters/FilterMail.cs =================================================================== RCS file: /cvs/gnome/beagle/Filters/FilterMail.cs,v retrieving revision 1.6 diff -u -B -p -r1.6 FilterMail.cs --- Filters/FilterMail.cs 3 Nov 2005 18:41:01 -0000 1.6 +++ Filters/FilterMail.cs 15 Nov 2005 20:28:43 -0000 @@ -62,7 +62,7 @@ namespace Beagle.Filters { } } - int mail_fd = Mono.Unix.Syscall.open (info.FullName, Mono.Unix.OpenFlags.O_RDONLY); + int mail_fd = Mono.Unix.Native.Syscall.open (info.FullName, Mono.Unix.Native.OpenFlags.O_RDONLY); if (mail_fd == -1) throw new IOException (String.Format ("Unable to read {0} for parsing mail", info.FullName)); Index: Util/ExtendedAttribute.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/ExtendedAttribute.cs,v retrieving revision 1.20 diff -u -B -p -r1.20 ExtendedAttribute.cs --- Util/ExtendedAttribute.cs 24 Oct 2005 23:03:34 -0000 1.20 +++ Util/ExtendedAttribute.cs 15 Nov 2005 20:28:44 -0000 @@ -30,43 +30,15 @@ using System; using System.IO; using System.Text; using System.Runtime.InteropServices; +using Mono.Unix.Native; namespace Beagle.Util { public class ExtendedAttribute { - // FIXME: When Mono 1.1.9 is required, start using the Mono.Unix.Syscall - // xattr bindings. - - // Linux xattrs - [DllImport (ExternalStringsHack.XattrLib, SetLastError=true)] - static extern int lsetxattr (string path, string name, byte[] value, uint size, int flags); - - [DllImport (ExternalStringsHack.XattrLib, SetLastError=true)] - static extern int lgetxattr (string path, string name, byte[] value, uint size); - - [DllImport (ExternalStringsHack.XattrLib, SetLastError=true)] - static extern int lremovexattr (string path, string name); - - // FreeBSD extattrs - // Very similar to Linux xattrs, but the namespace is provided as a - // parameter as opposed to a string prefix to the name. - [DllImport (ExternalStringsHack.XattrLib, SetLastError=true)] - static extern int extattr_set_link (string path, int attrnamespace, string attrname, byte[] value, uint size); - - [DllImport (ExternalStringsHack.XattrLib, SetLastError=true)] - static extern int extattr_get_link (string path, int attrnamespace, string attrname, byte[] value, uint size); - - [DllImport (ExternalStringsHack.XattrLib, SetLastError=true)] - static extern int extattr_delete_link (string path, int attrnamespace, string attrname); - private static string AddPrefix (string name) { -#if OS_LINUX return "user.Beagle." + name; -#elif OS_FREEBSD - return "Beagle." + name; -#endif } static Encoding encoding = new UTF8Encoding (); @@ -79,13 +51,9 @@ namespace Beagle.Util { name = AddPrefix (name); byte[] buffer = encoding.GetBytes (value); -#if OS_LINUX - int retval = lsetxattr (path, name, buffer, (uint) buffer.Length, 0); -#elif OS_FREEBSD - int retval = extattr_set_link (path, 1, name, buffer, (uint) buffer.Length); -#endif + int retval = Syscall.lsetxattr (path, name, buffer); if (retval == -1) - throw new IOException ("Could not set extended attribute on " + path + ": " + Mono.Unix.Stdlib.strerror (Mono.Unix.Syscall.GetLastError ())); + throw new IOException ("Could not set extended attribute on " + path + ": " + Mono.Unix.Native.Stdlib.strerror (Mono.Unix.Native.Stdlib.GetLastError ())); } public static bool Exists (string path, string name) @@ -95,13 +63,7 @@ namespace Beagle.Util { name = AddPrefix (name); - byte[] buffer = null; -#if OS_LINUX - int size = lgetxattr (path, name, buffer, 0); -#elif OS_FREEBSD - int size = extattr_get_link (path, 1, name, buffer, 0); -#endif - + long size = Syscall.lgetxattr (path, name, null, 0); return size >= 0; } @@ -112,23 +74,10 @@ namespace Beagle.Util { name = AddPrefix (name); - byte[] buffer = null; -#if OS_LINUX - int size = lgetxattr (path, name, buffer, 0); -#elif OS_FREEBSD - int size = extattr_get_link (path, 1, name, buffer, 0); -#endif + byte[] buffer; + long size = Syscall.lgetxattr (path, name, out buffer); if (size <= 0) return null; - buffer = new byte [size]; -#if OS_LINUX - int retval = lgetxattr (path, name, buffer, (uint) size); -#elif OS_FREEBSD - int retval = extattr_get_link (path, 1, name, buffer, (uint) size); -#endif - if (retval < 0) - throw new IOException ("Could not get extended attribute on " + path + ": " + Mono.Unix.Stdlib.strerror (Mono.Unix.Syscall.GetLastError ())); - return encoding.GetString (buffer); } @@ -139,13 +88,9 @@ namespace Beagle.Util { name = AddPrefix (name); -#if OS_LINUX - int retval = lremovexattr (path, name); -#elif OS_FREEBSD - int retval = extattr_delete_link (path, 1, name); -#endif + int retval = Syscall.lremovexattr (path, name); if (retval != 0) - throw new IOException ("Could not remove extended attribute on " + path + ": " + Mono.Unix.Stdlib.strerror (Mono.Unix.Syscall.GetLastError ())); + throw new IOException ("Could not remove extended attribute on " + path + ": " + Mono.Unix.Native.Stdlib.strerror (Mono.Unix.Native.Stdlib.GetLastError ())); } // Check to see if it is possible to get and set attributes on a given file. Index: Util/ExternalStringsHack.cs.in =================================================================== RCS file: /cvs/gnome/beagle/Util/ExternalStringsHack.cs.in,v retrieving revision 1.7 diff -u -B -p -r1.7 ExternalStringsHack.cs.in --- Util/ExternalStringsHack.cs.in 20 Aug 2005 22:53:09 -0000 1.7 +++ Util/ExternalStringsHack.cs.in 15 Nov 2005 20:28:44 -0000 @@ -40,7 +40,6 @@ namespace Beagle.Util { get { return "@KDE_PREFIX@"; } } - public const string XattrLib = "@XATTR_LIB@"; public const string SqliteVersion = "@SQLITE_MAJ_VER@"; } } Index: Util/FileAdvise.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/FileAdvise.cs,v retrieving revision 1.7 diff -u -B -p -r1.7 FileAdvise.cs --- Util/FileAdvise.cs 24 Oct 2005 23:03:34 -0000 1.7 +++ Util/FileAdvise.cs 15 Nov 2005 20:28:44 -0000 @@ -94,7 +94,7 @@ namespace Beagle.Util { FileAccess.Read); int ret = GiveAdvice (file, AdviseNormal); if (ret != 0) - Log.Error ("FileAdvise failed: {0}", Mono.Unix.Stdlib.strerror (Mono.Unix.Syscall.GetLastError())); + Log.Error ("FileAdvise failed: {0}", Mono.Unix.Native.Stdlib.strerror (Mono.Unix.Native.Stdlib.GetLastError())); file.Close (); } catch { } } Index: Util/FileSystem.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/FileSystem.cs,v retrieving revision 1.4 diff -u -B -p -r1.4 FileSystem.cs --- Util/FileSystem.cs 4 Nov 2005 16:00:24 -0000 1.4 +++ Util/FileSystem.cs 15 Nov 2005 20:28:44 -0000 @@ -56,9 +56,9 @@ namespace Beagle.Util { // I guess this is as good a place for this as any. static public bool IsSymLink (string path) { - Mono.Unix.Stat stat; - Mono.Unix.Syscall.lstat (path, out stat); - return (stat.st_mode & Mono.Unix.FilePermissions.S_IFLNK) == Mono.Unix.FilePermissions.S_IFLNK; + Mono.Unix.Native.Stat stat; + Mono.Unix.Native.Syscall.lstat (path, out stat); + return (stat.st_mode & Mono.Unix.Native.FilePermissions.S_IFLNK) == Mono.Unix.Native.FilePermissions.S_IFLNK; } } Index: Util/ImLog.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/ImLog.cs,v retrieving revision 1.21 diff -u -B -p -r1.21 ImLog.cs --- Util/ImLog.cs 24 Oct 2005 20:16:59 -0000 1.21 +++ Util/ImLog.cs 15 Nov 2005 20:28:45 -0000 @@ -31,7 +31,7 @@ using System.Globalization; using System.Text; using System.Text.RegularExpressions; using System.Xml; -using Mono.Unix; +using Mono.Unix.Native; namespace Beagle.Util { @@ -61,8 +61,8 @@ namespace Beagle.Util { private long timestamp; public DateTime Timestamp { - get { return UnixConvert.ToDateTime (timestamp); } - set { timestamp = UnixConvert.FromDateTime (value); } + get { return NativeConvert.ToDateTime (timestamp); } + set { timestamp = NativeConvert.FromDateTime (value); } } public String Who; Index: Util/KdeUtils.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/KdeUtils.cs,v retrieving revision 1.4 diff -u -B -p -r1.4 KdeUtils.cs --- Util/KdeUtils.cs 24 Oct 2005 23:03:34 -0000 1.4 +++ Util/KdeUtils.cs 15 Nov 2005 20:28:45 -0000 @@ -65,7 +65,7 @@ namespace Beagle.Util { // if default.kde == hicolor. StringBuilder icon_theme_default_sb = new StringBuilder (); - Mono.Unix.Syscall.readlink (Path.Combine (icon_prefix, "default.kde"), icon_theme_default_sb); + Mono.Unix.Native.Syscall.readlink (Path.Combine (icon_prefix, "default.kde"), icon_theme_default_sb); string icon_theme_default = icon_theme_default_sb.ToString (); if (icon_theme_default != null) { if (! icon_theme_default.StartsWith ("/")) Index: Util/Log.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/Log.cs,v retrieving revision 1.3 diff -u -B -p -r1.3 Log.cs --- Util/Log.cs 27 Oct 2005 20:28:11 -0000 1.3 +++ Util/Log.cs 15 Nov 2005 20:28:45 -0000 @@ -151,7 +151,7 @@ namespace Beagle.Util { string log_link; log_link = Path.Combine (log_directory, "current-" + name); - Mono.Unix.Syscall.symlink (log_path, log_link); + Mono.Unix.Native.Syscall.symlink (log_path, log_link); return writer; } Index: Util/Makefile.am =================================================================== RCS file: /cvs/gnome/beagle/Util/Makefile.am,v retrieving revision 1.76 diff -u -B -p -r1.76 Makefile.am --- Util/Makefile.am 8 Nov 2005 02:05:22 -0000 1.76 +++ Util/Makefile.am 15 Nov 2005 20:28:45 -0000 @@ -1,8 +1,7 @@ # Warnings we don't want to see # 0067 = event defined but not used -# 0618 = Mono.Posix.Syscall is obsolete -CSC = mcs -debug -nowarn:0067,0618 +CSC = mcs -debug -nowarn:0067 TARGET = Util.dll @@ -38,7 +37,6 @@ $(EXTSTR): $(EXTSTR_IN) -e "s|\@VERSION\@|$(VERSION)|g" \ -e "s|\@GNOME_PREFIX\@|$(GNOME_PREFIX)|g" \ -e "s|\@KDE_PREFIX\@|$(KDE_PREFIX)|g" \ - -e "s|\@XATTR_LIB\@|$(XATTR_LIB)|g" \ -e "s|\@SQLITE_MAJ_VER\@|$(SQLITE_MAJ_VER)|g" \ < $(EXTSTR_IN) > $@ Index: Util/PathFinder.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/PathFinder.cs,v retrieving revision 1.11 diff -u -B -p -r1.11 PathFinder.cs --- Util/PathFinder.cs 3 Nov 2005 17:51:58 -0000 1.11 +++ Util/PathFinder.cs 15 Nov 2005 20:28:45 -0000 @@ -110,7 +110,7 @@ namespace Beagle.Util { Directory.CreateDirectory (storage_dir); // Make sure that the directory is only // readable by the owner. - Mono.Unix.Syscall.chmod (storage_dir, (Mono.Unix.FilePermissions) 448); // 448 == 0700 + Mono.Unix.Native.Syscall.chmod (storage_dir, (Mono.Unix.Native.FilePermissions) 448); // 448 == 0700 } } } @@ -156,7 +156,7 @@ namespace Beagle.Util { Directory.CreateDirectory (remote_storage_dir); // Make sure that the directory is only // readable by the owner. - Mono.Unix.Syscall.chmod (remote_storage_dir, (Mono.Unix.FilePermissions) 448); // 448 == 0700 + Mono.Unix.Native.Syscall.chmod (remote_storage_dir, (Mono.Unix.Native.FilePermissions) 448); // 448 == 0700 } } } else @@ -180,7 +180,7 @@ namespace Beagle.Util { // Make sure that the directory is only readable by the owner. // Required when using index synchronization as then it resides in /tmp - Mono.Unix.Syscall.chmod (index_dir, (Mono.Unix.FilePermissions) 448); // 448 == 0700 + Mono.Unix.Native.Syscall.chmod (index_dir, (Mono.Unix.Native.FilePermissions) 448); // 448 == 0700 } } Index: Util/SystemInformation.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/SystemInformation.cs,v retrieving revision 1.17 diff -u -B -p -r1.17 SystemInformation.cs --- Util/SystemInformation.cs 24 Oct 2005 23:03:34 -0000 1.17 +++ Util/SystemInformation.cs 15 Nov 2005 20:28:46 -0000 @@ -55,7 +55,7 @@ namespace Beagle.Util { int retval = getloadavg (loadavg, 3); if (retval == -1) - throw new IOException ("Could not get system load average: " + Mono.Unix.Stdlib.strerror (Mono.Unix.Syscall.GetLastError ())); + throw new IOException ("Could not get system load average: " + Mono.Unix.Native.Stdlib.strerror (Mono.Unix.Native.Stdlib.GetLastError ())); else if (retval != 3) throw new IOException ("Could not get system load average: getloadavg() returned an unexpected number of samples"); @@ -258,8 +258,8 @@ namespace Beagle.Util { // Get the (major,minor) pair for the block device from which the index is mounted. static private void GetIndexDev () { - Mono.Unix.Stat stat; - if (Mono.Unix.Syscall.stat (PathFinder.StorageDir, out stat) != 0) + Mono.Unix.Native.Stat stat; + if (Mono.Unix.Native.Syscall.stat (PathFinder.StorageDir, out stat) != 0) return; major = (uint) stat.st_dev >> 8; @@ -304,8 +304,8 @@ namespace Beagle.Util { static public bool IsPathOnBlockDevice (string path) { - Mono.Unix.Stat stat; - if (Mono.Unix.Syscall.stat (path, out stat) != 0) + Mono.Unix.Native.Stat stat; + if (Mono.Unix.Native.Syscall.stat (path, out stat) != 0) return false; return (stat.st_dev >> 8 != 0); Index: beagled/BeagleDaemon.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/BeagleDaemon.cs,v retrieving revision 1.99 diff -u -B -p -r1.99 BeagleDaemon.cs --- beagled/BeagleDaemon.cs 26 Oct 2005 16:21:05 -0000 1.99 +++ beagled/BeagleDaemon.cs 15 Nov 2005 20:28:47 -0000 @@ -411,10 +411,10 @@ namespace Beagle.Daemon { OurSignalHandler (-1); // Set up our signal handler - Mono.Unix.Stdlib.signal (Mono.Unix.Signum.SIGINT, OurSignalHandler); - Mono.Unix.Stdlib.signal (Mono.Unix.Signum.SIGTERM, OurSignalHandler); + Mono.Unix.Native.Stdlib.signal (Mono.Unix.Native.Signum.SIGINT, OurSignalHandler); + Mono.Unix.Native.Stdlib.signal (Mono.Unix.Native.Signum.SIGTERM, OurSignalHandler); if (Environment.GetEnvironmentVariable("BEAGLE_THERE_BE_NO_QUITTIN") == null) - Mono.Unix.Stdlib.signal (Mono.Unix.Signum.SIGQUIT, OurSignalHandler); + Mono.Unix.Native.Stdlib.signal (Mono.Unix.Native.Signum.SIGQUIT, OurSignalHandler); } // Our handler triggers an orderly shutdown when it receives a signal. Index: beagled/BuildIndex.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/BuildIndex.cs,v retrieving revision 1.23 diff -u -B -p -r1.23 BuildIndex.cs --- beagled/BuildIndex.cs 4 Nov 2005 16:00:25 -0000 1.23 +++ beagled/BuildIndex.cs 15 Nov 2005 20:28:47 -0000 @@ -441,10 +441,10 @@ namespace Beagle.Daemon OurSignalHandler (-1); // Set up our signal handler - Mono.Unix.Stdlib.signal (Mono.Unix.Signum.SIGINT, OurSignalHandler); - Mono.Unix.Stdlib.signal (Mono.Unix.Signum.SIGTERM, OurSignalHandler); + Mono.Unix.Native.Stdlib.signal (Mono.Unix.Native.Signum.SIGINT, OurSignalHandler); + Mono.Unix.Native.Stdlib.signal (Mono.Unix.Native.Signum.SIGTERM, OurSignalHandler); if (Environment.GetEnvironmentVariable("BEAGLE_THERE_BE_NO_QUITTIN") == null) - Mono.Unix.Stdlib.signal (Mono.Unix.Signum.SIGQUIT, OurSignalHandler); + Mono.Unix.Native.Stdlib.signal (Mono.Unix.Native.Signum.SIGQUIT, OurSignalHandler); } static void OurSignalHandler (int signal) Index: beagled/Filter.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/Filter.cs,v retrieving revision 1.35 diff -u -B -p -r1.35 Filter.cs --- beagled/Filter.cs 24 Oct 2005 23:03:35 -0000 1.35 +++ beagled/Filter.cs 15 Nov 2005 20:28:48 -0000 @@ -373,7 +373,7 @@ namespace Beagle.Daemon { // Make sure the temporary file is only readable by the owner. // FIXME: There is probably a race here. Could some malicious program // do something to the file between creation and the chmod? - Mono.Unix.Syscall.chmod (tempFile, (Mono.Unix.FilePermissions) 256); + Mono.Unix.Native.Syscall.chmod (tempFile, (Mono.Unix.Native.FilePermissions) 256); BufferedStream buffered_stream = new BufferedStream (file_stream); StreamWriter writer = new StreamWriter (buffered_stream); @@ -407,7 +407,7 @@ namespace Beagle.Daemon { // Make sure the temporary file is only readable by the owner. // FIXME: There is probably a race here. Could some malicious program // do something to the file between creation and the chmod? - Mono.Unix.Syscall.chmod (tempFile, (Mono.Unix.FilePermissions) 256); + Mono.Unix.Native.Syscall.chmod (tempFile, (Mono.Unix.Native.FilePermissions) 256); BufferedStream buffered_stream = new BufferedStream (file_stream); Index: beagled/Makefile.am =================================================================== RCS file: /cvs/gnome/beagle/beagled/Makefile.am,v retrieving revision 1.139 diff -u -B -p -r1.139 Makefile.am --- beagled/Makefile.am 25 Oct 2005 18:56:49 -0000 1.139 +++ beagled/Makefile.am 15 Nov 2005 20:28:49 -0000 @@ -1,11 +1,10 @@ # Warnings we don't want to see # 0067 = event defined but not used -# 0618 = Mono.Posix.Syscall is obsolete # 0169 = The private method/field 'foo' is never used # 0164 = This label has not been referenced -CSC = mcs -debug -nowarn:0067,0618,0619,0169,0164 +CSC = mcs -debug -nowarn:0067,0619,0169,0164 BACKENDDIR = $(pkglibdir)/Backends Index: beagled/EvolutionMailDriver/EvolutionMailIndexableGenerator.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/EvolutionMailDriver/EvolutionMailIndexableGenerator.cs,v retrieving revision 1.58 diff -u -B -p -r1.58 EvolutionMailIndexableGenerator.cs --- beagled/EvolutionMailDriver/EvolutionMailIndexableGenerator.cs 3 Nov 2005 18:40:20 -0000 1.58 +++ beagled/EvolutionMailDriver/EvolutionMailIndexableGenerator.cs 15 Nov 2005 20:28:51 -0000 @@ -213,7 +213,7 @@ namespace Beagle.Daemon.EvolutionMailDri return false; } - this.mbox_fd = Mono.Unix.Syscall.open (this.mbox_info.FullName, Mono.Unix.OpenFlags.O_RDONLY); + this.mbox_fd = Mono.Unix.Native.Syscall.open (this.mbox_info.FullName, Mono.Unix.Native.OpenFlags.O_RDONLY); this.mbox_stream = new GMime.StreamFs (this.mbox_fd); this.mbox_stream.Seek ((int) this.MboxLastOffset); this.mbox_parser = new GMime.Parser (this.mbox_stream); Index: beagled/FileSystemQueryable/FileSystemQueryable.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/FileSystemQueryable/FileSystemQueryable.cs,v retrieving revision 1.91 diff -u -B -p -r1.91 FileSystemQueryable.cs --- beagled/FileSystemQueryable/FileSystemQueryable.cs 3 Nov 2005 18:11:01 -0000 1.91 +++ beagled/FileSystemQueryable/FileSystemQueryable.cs 15 Nov 2005 20:28:54 -0000 @@ -864,9 +864,9 @@ namespace Beagle.Daemon.FileSystemQuerya } } - Mono.Unix.Stat stat; + Mono.Unix.Native.Stat stat; try { - Mono.Unix.Syscall.stat (path, out stat); + Mono.Unix.Native.Syscall.stat (path, out stat); } catch (Exception ex) { Logger.Log.Debug ("Caught exception stat-ing {0}", path); Logger.Log.Debug (ex); Index: beagled/IndexHelper/IndexHelper.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/IndexHelper/IndexHelper.cs,v retrieving revision 1.21 diff -u -B -p -r1.21 IndexHelper.cs --- beagled/IndexHelper/IndexHelper.cs 26 Oct 2005 16:21:07 -0000 1.21 +++ beagled/IndexHelper/IndexHelper.cs 15 Nov 2005 20:28:54 -0000 @@ -207,10 +207,10 @@ namespace Beagle.IndexHelper { OurSignalHandler (-1); // Set up our signal handler - Mono.Unix.Stdlib.signal (Mono.Unix.Signum.SIGINT, OurSignalHandler); - Mono.Unix.Stdlib.signal (Mono.Unix.Signum.SIGTERM, OurSignalHandler); + Mono.Unix.Native.Stdlib.signal (Mono.Unix.Native.Signum.SIGINT, OurSignalHandler); + Mono.Unix.Native.Stdlib.signal (Mono.Unix.Native.Signum.SIGTERM, OurSignalHandler); if (Environment.GetEnvironmentVariable("BEAGLE_THERE_BE_NO_QUITTIN") == null) - Mono.Unix.Stdlib.signal (Mono.Unix.Signum.SIGQUIT, OurSignalHandler); + Mono.Unix.Native.Stdlib.signal (Mono.Unix.Native.Signum.SIGQUIT, OurSignalHandler); } // Our handler triggers an orderly shutdown when it receives a signal. Index: beagled/KMailQueryable/KMailIndexableGenerator.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/KMailQueryable/KMailIndexableGenerator.cs,v retrieving revision 1.4 diff -u -B -p -r1.4 KMailIndexableGenerator.cs --- beagled/KMailQueryable/KMailIndexableGenerator.cs 4 Nov 2005 00:54:02 -0000 1.4 +++ beagled/KMailQueryable/KMailIndexableGenerator.cs 15 Nov 2005 20:28:54 -0000 @@ -215,7 +215,7 @@ namespace Beagle.Daemon.KMailQueryable { try { - mbox_fd = Mono.Unix.Syscall.open (mbox_file, Mono.Unix.OpenFlags.O_RDONLY); + mbox_fd = Mono.Unix.Native.Syscall.open (mbox_file, Mono.Unix.Native.OpenFlags.O_RDONLY); } catch (System.IO.FileNotFoundException e) { Logger.Log.Warn ("mbox " + mbox_file + " deleted while indexing."); return false; Index: beagled/Mono.Data.SqliteClient/SqliteCommand.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/Mono.Data.SqliteClient/SqliteCommand.cs,v retrieving revision 1.2 diff -u -B -p -r1.2 SqliteCommand.cs --- beagled/Mono.Data.SqliteClient/SqliteCommand.cs 24 Oct 2005 21:56:28 -0000 1.2 +++ beagled/Mono.Data.SqliteClient/SqliteCommand.cs 15 Nov 2005 20:28:55 -0000 @@ -35,7 +35,7 @@ using System; using System.Collections; using System.Text; -using Mono.Unix; +using Mono.Unix.Native; using System.Runtime.InteropServices; using System.Text.RegularExpressions; using System.Data; @@ -47,50 +47,6 @@ namespace Mono.Data.SqliteClient public class SqliteCommand : IDbCommand { - // FIXME: This won't be added to upstream, but Mono.Unix.UnixMarshal.StringToAlloc is not available in any mono releases yet. - public static IntPtr StringToAlloc (string s) - { - return StringToAlloc (s, Encoding.Default); - } - - public static IntPtr StringToAlloc (string s, Encoding encoding) - { - return StringToAlloc (s, 0, s.Length, encoding); - } - - public static IntPtr StringToAlloc (string s, int index, int count) - { - return StringToAlloc (s, index, count, Encoding.Default); - } - - public static IntPtr StringToAlloc (string s, int index, int count, Encoding encoding) - { - int min_byte_count = encoding.GetMaxByteCount(1); - char[] copy = s.ToCharArray (index, count); - byte[] marshal = new byte [encoding.GetByteCount (copy) + min_byte_count]; - - int bytes_copied = encoding.GetBytes (copy, 0, copy.Length, marshal, 0); - - if (bytes_copied != (marshal.Length-min_byte_count)) - throw new NotSupportedException ("encoding.GetBytes() doesn't equal encoding.GetByteCount()!"); - - IntPtr mem = UnixMarshal.Alloc (marshal.Length); - if (mem == IntPtr.Zero) - throw new OutOfMemoryException (); - - bool copied = false; - try { - Marshal.Copy (marshal, 0, mem, marshal.Length); - copied = true; - } - finally { - if (!copied) - UnixMarshal.Free (mem); - } - - return mem; - } - #region Fields private SqliteConnection parent_conn; @@ -277,7 +233,7 @@ namespace Mono.Data.SqliteClient } SqliteError err = SqliteError.OK; - IntPtr psql = StringToAlloc(sqlcmds); + IntPtr psql = Mono.Unix.UnixMarshal.StringToHeap(sqlcmds); IntPtr pzTail = psql; try { do { // sql may contain multiple sql commands, loop until they're all processed @@ -390,7 +346,7 @@ namespace Mono.Data.SqliteClient } } while ((int)pzTail - (int)psql < sql.Length); } finally { - UnixMarshal.Free(psql); + Mono.Unix.UnixMarshal.FreeHeap(psql); } prepared=true; }