From: Daniel Becker Date: Tue, 5 Apr 2016 07:35:21 +0000 (-0700) Subject: clean up DllImport attributes X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=ac49990f3df05abb9639b0a5a9be2b26572340ad;p=mono.git clean up DllImport attributes Any native function that can modify errno should have the SetLastError attribute set to true. Also, no need to specify EntryPoint if it's the same as the function name. --- diff --git a/mcs/class/System/System.IO/KeventWatcher.cs b/mcs/class/System/System.IO/KeventWatcher.cs index 996e0e9b61f..5cc8a377356 100644 --- a/mcs/class/System/System.IO/KeventWatcher.cs +++ b/mcs/class/System/System.IO/KeventWatcher.cs @@ -665,19 +665,19 @@ namespace System.IO { string fixupPath = null; string fullPathNoLastSlash = null; - [DllImport ("libc", EntryPoint="fcntl", CharSet=CharSet.Auto, SetLastError=true)] + [DllImport ("libc", CharSet=CharSet.Auto, SetLastError=true)] static extern int fcntl (int file_names_by_descriptor, int cmd, StringBuilder sb); - [DllImport ("libc")] + [DllImport ("libc", SetLastError=true)] extern static int open (string path, int flags, int mode_t); [DllImport ("libc")] extern static int close (int fd); - [DllImport ("libc")] + [DllImport ("libc", SetLastError=true)] extern static int kqueue (); - [DllImport ("libc")] + [DllImport ("libc", SetLastError=true)] extern static int kevent (int kq, [In]kevent[] ev, int nchanges, [Out]kevent[] evtlist, int nevents, [In] ref timespec time); [MethodImplAttribute(MethodImplOptions.InternalCall)]