1 2005-04-05 Miguel de Icaza <miguel@novell.com>
3 * Syscall.cs: Set entry point for sys_syslog to be syslog.
4 Include the syslog.h header in the generated map so that we
5 actually do the mapping.
7 2005-03-28 Jonathan Pryor <jonpryor@vt.edu>
9 * UnixConvert.cs: Add ToFopenMode() methods, which convert FileMode/FileAccess
10 into an fopen(3) mode string. ToOpenFlags() should throw
11 ArgumentOutOfRangeException for argument violations.
12 * StdioFileStream.cs: Add constructor overloads accepting filename and
13 FileMode/FileAccess overloads; Compatibility fixes with regression tests;
14 remove IDisposable implementation since System.IO.Stream already
15 implements it (which calls Close() for us).
17 2005-03-17 Jonathan Pryor <jonpryor@vt.edu>
19 * Stdlib.cs: Move Errno-related functionality into Stdlib from Syscall,
20 since (1) errno is part of C89, and (2) StdioFileStream will need it, and
21 StdioFileStream shouldn't use Syscall. Add [UnmanagedFunctionPointer]
22 attribute to SignalHandler for .NET 2.0 (since signal handlers use C
23 calling convention, not Stdcall).
24 * Syscall.cs: Move Errno-related functionality into Stdlib.
25 * UnixMarshal.cs: Use ERANGE not EPERM when figuring out appropriate
26 translator, since ERANGE is part of C99 and EPERM isn't. Use Stdlib
27 instead of Syscall for Errno-related functionality.
29 2005-02-02 Jonathan Pryor <jonpryor@vt.edu>
31 * UnixFile.cs: Cope with changes in UnixStream.
32 * UnixStream.cs: Change FileDescriptor property to Handle for consistency.
33 * StdioFileStream.cs: Change FileStream property to Handle for consistency.
35 2005-02-02 Jonathan Pryor <jonpryor@vt.edu>
37 * Syscall.cs: Remove public sys_ methods. Some were public by mistake, and
38 others so that users could manually marshal strings if desired. Manually
39 marshaling strings shouldn't be necessary, though, so remove them too.
41 2005-02-02 Jonathan Pryor <jonpryor@vt.edu>
43 * StdioFileStream.cs: Fix Length property to actually return the size of the
44 file, not the # of bytes from the current position to EOF. Oops.
46 2005-01-31 Jonathan Pryor <jonpryor@vt.edu>
48 * Stdlib.cs: Import "msvcrt", not "libc". These members are part of the
49 ANSI C standard, and thus should be present on Windows via msvcrt.dll
50 (except snprintf, until they catch up to C99). Change the calling
51 convention of all functions to Cdecl, as the .NET default is Stdcall.
52 Changing the calling convention isn't needed in Syscall, as it can only be
53 run on Unix platforms anyway, where the default is Cdecl.
54 * Syscall.cs: Add LIBC member that points to the real "libc"; we can't use
55 the imported definition from Stdlib as "msvcrt" doesn't exist on Unix.
57 2005-01-29 Jonathan Pryor <jonpryor@vt.edu>
59 * Stdlib.cs: sys_* functions shouldn't be public.
61 2005-01-13 Jonathan Pryor <jonpryor@vt.edu>
63 * make-map.cs: libMonoPosixHelper exports Mono_Posix prefixes, not Mono_Unix
64 prefixes, so change the type and namespace to generate compatible code.
65 * Syscall.cs: Change OpenFlags values so they match the Linux values.
67 2005-01-13 Jonathan Pryor <jonpryor@vt.edu>
69 * Stdlib.cs: Use Stdlib.LIBC instead of "libc".
70 * StdioFileStream.cs: Add FilePosition property (not that I expect anyone to
71 use it) and Rewind() method.
73 2005-01-05 Jonathan Pryor <jonpryor@vt.edu>
75 * StdioFileStream.cs: Added; System.IO.Stream wrapper for C FILE struct.
76 * Stdlib.cs: Correct visibility of ftell().
78 2005-01-05 Jonathan Pryor <jonpryor@vt.edu>
80 * Stdlib.cs: Re-order declarations to match the order used in the
81 C99 Standard Annex B; Complete <stdio.h> exports (except for those not
82 worth supporting); Add non-"unsafe" versions of fread(3), fwrite(3) and
83 add some rudimentary buffer-overflow checking; Add <stdlib.h> exports such
84 as getenv(3), exit(3), rand(3), EXIT_SUCCESS, RAND_MAX, etc.
86 2005-01-03 Jonathan Pryor <jonpryor@vt.edu>
88 * Syscall.cs: Update endfsent() and setfsent() declarations, as these must
89 now be implemented in MonoPosixHelper.
91 2005-01-01 Jonathan Pryor <jonpryor@vt.edu>
93 * Stdlib.cs, Syscall.cs: Minimize duplicate declarations of
94 "MonoPosixHelper" for use in DllImport statements.
96 2005-01-01 Jonathan Pryor <jonpryor@vt.edu>
98 * Stdlib.cs: Don't use C# v2 features; fixes build under CSC.EXE.
100 2004-12-30 Jonathan Pryor <jonpryor@vt.edu>
102 * Stdlib.cs: On miguel's suggestion, rename Sighandler_t to SignalHandler.
104 2004-12-30 Jonathan Pryor <jonpryor@vt.edu>
106 * Stdlib.cs: Implement all C89 <stdio.h> functions except for the scanf(3)
107 family. These are too dangerous to expose.
109 2004-12-30 Jonathan Pryor <jonpryor@vt.edu>
111 * CdeclFunctions.cs: Remove warning about unused variable.
112 * Stdlib.cs: Make signal(2) sane and (hopefully) complete.
113 * Syscall.cs: Fix cuserid Obsolete message to reference correct class name.
114 * UnixProcess.cs: Remove warning about unused variable.
115 * UnixMarshal.cs: Remove warnings about unused variables.
117 2004-12-29 Jonathan Pryor <jonpryor@vt.edu>
119 * UnixPath.cs: Add ReadSymbolicLink(), which takes an intelligent approach
120 to reading symlinks (since their contents may be any size, we grow the
121 buffer dynamically to fit them all, instead of assuming a maximum size).
122 * UnixSymbolicLinkInfo.cs: Remove MaxContentsSize.
124 2004-12-29 Jonathan Pryor <jonpryor@vt.edu>
126 * UnixPath.cs: Add check for when symlink points to a full path name.
128 2004-12-29 Jonathan Pryor <jonpryor@vt.edu>
130 * Syscall.cs: Fix Object.Equals implementations.
131 * UnixPath.cs: New & improved, with Testing! GetRealPath() is changed so
132 that it doesn't walk the entire path looking for symlinks, it just reads
133 the leaf. GetCompletRealPath() walks the entire path resolving symlinks.
134 GetCanonicalPath() added, which "cleans up" a path (removing extraneous
135 "." and ".." entries).
136 * UnixSymbolicLinkInfo.cs: Rename ContentsLength -> MaxContentsSize.
138 2004-12-28 Jonathan Pryor <jonpryor@vt.edu>
140 * UnixFileSystemInfo.cs: Add a link(2) wrapper, CreateLink(). Strictly
141 speaking it's only "safe" to do this on files, but an exception will be
142 returned if the user tries to hard link directories (because of EPERM),
143 unless the user is root, in which case it should be allowed anyway...
145 2004-12-28 Jonathan Pryor <jonpryor@vt.edu>
147 * CdeclFunctions.cs: Correct the comments for AMD64
148 * UnixDirectoryInfo.cs: override Name; add Parent & Root properties;
149 Correct Path usage (s/Path/FullPath/g).
150 * UnixDriveInfo.cs: Added. Based on .NET 2.0 System.IO.DriveInfo docs,
151 provides statvfs(2) and getfsfile(3) information about a mounted volume.
152 GetDrives() wraps getfsent(3), thus parsing /etc/fstab.
153 * UnixFile.cs: Use UnixConver.ToOpenFlags, deleting the local version.
154 * UnixFileInfo.cs: Use UnixConver.ToOpenFlags, deleting the local version;
155 override Name; add DirectoryName and Directory properties;
156 * UnixFileSystemInfo.cs: Make more .NET-like, using FullPath and
157 OriginalPath protected members, abstract Name property; Add
158 CreateSymbolicLink; Remove ReadLink (it's now
159 UnixSymbolicLinkInfo.Contents); Use lstat(2) for Create(string), so we
160 properly detect Symbolic Links.
161 * UnixPath.cs: Added; Path manipulation utility functions.
162 * UnixSymbolicLinkInfo.cs:
164 - override new abstract member Name;
165 - rename ReadLink to ContentsPath (and Contents) properties
166 (why "Contents"? Because readlink(2) says "readlink places the
167 contents of the symbolic link in the buffer...")
168 - Add CreateSymbolicLinkTo(), which creates a symlink to the specified
171 2004-12-28 Jonathan Pryor <jonpryor@vt.edu>
173 * Stdlib.cs: Add syslog(3) to XPrintfFunctions; Add additional printf(3)
174 and fprintf(3) overload which properly escape the format string
175 (by using "%s" as the format for the user-supplied message).
176 * Syscall.cs: Add #regions for enummerations, structures, classes; Wrap
177 syslog(3) and related enumerations; fix operator!= on Dirent, Group;
178 wrap {f}statvfs(2); wrap <fstab.h> entries (getfsent(3), etc.).
179 * UnixConvert.cs: Add Syslog-releated enumeration translation functions;
180 Move ToOpenFlags here from UnixFile and UnixFileInfo.
181 * UnixMarshal.cs: Missing P/Invoke methods throw
182 EntryPointNotFoundException, not MissingMethodException; add
183 EscapeFormatString, which escapes printf-style format strings so that they
184 can be safely handed off to native code (avoiding stack overflow, etc);
185 make CreateExceptionForError internal.
187 2004-12-15 Jonathan Pryor <jonpryor@vt.edu>
189 * Stdlib.cs: Add more <stdio.h> wrappers, such as fread(3) and fwrite(3).
190 These will be useful in implementing System.IO.Stream subclass for
191 reading/writing to a FILE*. Fix a typo in the realloc(3) DllImport.
192 * Syscall.cs: Fix the sys_kill and sys_crypt declarations.
193 * CdeclFunction.cs: Document calling convention problems on AMD64.
195 2004-11-18 Jonathan Pryor <jonpryor@vt.edu>
197 * CdeclFunction.cs: Added.
198 * Stdlib.cs: Re-add printf(3) and fprintf(3). They may not be portable (the
199 jury is still out on that; the AMD64 SysV ABI looks like it should be
200 portable to AMD64 to my eyes), but they will work on *some* platforms, so
201 we should permit it. The new implementation takes a page out of
202 cocoa-sharp: use System.Reflection.Emit to generate a P/Invoke method at
203 runtime to invoke printf(3) or fprintf(3). This way, we can export a
204 params signature to C# code, permitting natural usage such as:
205 Stdlib.printf ("Hello, %s world! (%i)\n", "silly", 42);
206 * Syscall.cs: Mark which headers are complete, which functions still need
207 wrapping (for headers which have anything done to them), add #region
208 blocks for each header;
209 export mkfifo(3), fexecve(), getppid(2), setlogin(); fix sleep(3) export.
210 * UnixEnvironment.cs: Export a friendly getppid(2) wrapper.
211 GetParentProcessId isn't in UnixProcess as there's no way (that I know of)
212 to get the Parent's Parent, so it can't be a class member, and exposing it
213 as a static member of UnixProcess doesn't make sense to me, as it isn't
214 general. Added GetUserShells().
215 * UnixProcess.cs: Change constructor to internal, so it can be used from
218 2004-11-16 Jonathan Pryor <jonpryor@vt.edu>
220 * Stdlib.cs: Remove printf(3) and fprintf(3). These are vararg/CDECL
221 functions, and it's not portable to call them in this manner.
222 (It's not portable because some architectures, such as AMD64, use a
223 "cookie" as part of the vararg calling sequence to help reduce buffer
224 overflow exploits. Trying to call vararg functions as if they were an
225 overloaded function will not properly set this hardware cookie, resulting
226 in a hardware exception. Talk to lupus for more information.)
228 2004-11-16 Jonathan Pryor <jonpryor@vt.edu>
230 * Syscall.cs, UnixConvert.cs: Remove mount- and umount-related
231 functionality. Mount/umount is inherently non-portable (see the C code
232 for mount/umount), and trying to provide a consistent interface is
233 impossible. If you need mount/umount support, use the command-line
234 programs mount(1) and umount(1).
236 2004-11-16 Jonathan Pryor <jonpryor@vt.edu>
238 + Lots o' Renames, as the namespace changed.
239 * PosixConvert.cs: Moved to UnixConvert.cs:
240 * PosixDirectory.cs: Moved to UnixDirectory.cs:
241 * PosixEnvironment.cs: Moved to UnixEnvironment.cs:
242 * PosixDirectoryInfo.cs: Moved to UnixDirectoryInfo.cs:
243 * PosixFile.cs: Moved to UnixFile.cs:
244 * PosixFileInfo.cs: Moved to UnixFileInfo.cs:
245 * PosixFileSystemInfo.cs: Moved to UnixFileSystemInfo.cs:
246 * PosixGroup.cs: Moved to UnixGroup.cs:
247 * PosixGroupInfo.cs: Moved to UnixGroupInfo.cs:
248 * PosixIOException.cs: Moved to UnixIOException.cs:
249 * PosixMarshal.cs: Moved to UnixMarshal.cs:
250 * PosixProcess.cs: Moved to UnixProcess.cs:
251 * PosixStream.cs: Moved to UnixStream.cs:
252 * PosixSymbolicLinkInfo.cs: Moved to UnixSymbolicLinkInfo.cs:
253 * PosixUser.cs: Moved to UnixUser.cs:
254 * PosixUserInfo.cs: Moved to UnixUserInfo.cs:
255 * Catalog.cs, IncludeAttribute.cs, MapAttribute.cs, PeerCred.cs, Stdlib.cs,
256 Syscall.cs, UnixConvert.cs, UnixDirectory.cs, UnixDirectoryInfo.cs,
257 UnixEndPoint.cs, UnixEnvironment.cs, UnixFile.cs, UnixFileInfo.cs,
258 UnixFileSystemInfo.cs, UnixGroup.cs, UnixGroupInfo.cs, UnixIOException.cs,
259 UnixMarshal.cs, UnixProcess.cs, UnixStream.cs, UnixSymbolicLinkInfo.cs,
260 UnixUser.cs, UnixUserInfo.cs: Deal with renamed classes/members.
262 2004-11-15 Jonathan Pryor <jonpryor@vt.edu>
264 * PosixUserInfo.cs: Make the PosixUserInfo(Passwd) constructor public;
265 override Object.GetHashCode and Object.Equals.
266 * PosixGroupInfo.cs: Make the PosixGroupInfo(Group) constructor public;
267 override Object.GetHashCode and Object.Equals.
268 * PosixIOException.cs: Use PosixMarshal.GetErrorDescription instead of
269 calling Syscall.strerror_r directly
270 * PosixMarshal.cs: Add GetErrorDescription. Strerror_r() isn't portable, so
271 GetErrorDescription() first tries strerror_r(), and if it fails falls back
274 - Seal the Dirent class. It has no virtual members, so there's no point
275 in it being non-sealed. Override Object.GetHashCode and Object.Equals.
276 - Seal the Group class. It has no virtual members, so there's no point
277 in it being non-sealed. Override Object.GetHashCode and Object.Equals.
278 Provide operator== and operator!=.
279 - Seal the Passwd class. It has no virtual members, so there's no point
280 in it being non-sealed. Override Object.GetHashCode and Object.Equals.
281 Provide operator== and operator!=.
282 - Remove strerror_r() convenience overload. This is now
283 PosixMarshal.GetErrorDescription().
285 2004-11-12 Jonathan Pryor <jonpryor@vt.edu>
287 * Syscall.cs: Export time-related functions (gettimeofday, settimeofday,
288 utime, utimes), mknod.
290 2004-11-07 Atsushi Enomoto <atsushi@ximian.com>
292 * PosixEnvironment.cs : csc build fix. see bug #69195.
293 * PosixStream.cs : csc build fix. see bug #69196.
295 2004-11-05 Jonathan Pryor <jonpryor@vt.edu>
297 * PosixConvert.cs: New file; conversion functions for Mono.Posix types.
298 * PosixDirectory.cs: New file; Friendly wrapper over directory information.
299 * PosixDirectoryInfo.cs: New file; Friendly wrapper over directory information.
300 * PosixEnvironment.cs: New file; Friendly wrapper over environment information.
301 * PosixFile.cs: New file; Friendly wrapper over file information.
302 * PosixFileInfo.cs: New file; Friendly wrapper over file information.
303 * PosixFileSystemInfo.cs: New file; Friendly wrapper over `stat'.
304 * PosixGroup.cs: New file; User Group-related functionality
305 * PosixGroupInfo.cs: New file; User Group-related functionality
306 * PosixIOException.cs: New file; Exception for POSIX-generated exceptions.
307 * PosixMarshal.cs: New file; utility functions for marshaling, etc.
308 * PosixProcess.cs: New file; Friendly wrapper over process information.
309 * PosixStream.cs: New file; Friendly wrapper over file descriptors.
310 * PosixSymbolicLinkInfo.cs: New file; Friendly wrapper over symbolic links.
311 * PosixUser.cs: New file; Friendly wrapper over user information.
312 * PosixUserInfo.cs: New file; Friendly wrapper over user information.
313 * Stdlib.cs: New file; C standard library exports.
314 * Syscall.cs: Effective re-write.
315 - Organize exports by header file
316 - add additional enumerations (Error for the E* error values, etc.)
317 - always explicitly specify enumeration underlying type
318 - Use a new wrapping infrastructure so that ABI-stable types are exported
319 - For example, size_t is exported as ulong, not IntPtr.
320 - Wrap more functions, and wrap them better (such as getpwnam).
321 - This release is NOT backward compatible. Many names are the same, and
322 hopefully they're still compatible, but no effort was made to maintain
323 compatibility. For example, FileMode was removed and replaced with
324 FilePermissions, to avoid a name conflict with System.IO.FileMode.
325 - Change umount() to use MonoPosixHelper: portability fix for Mac OS X.
326 * make-map.cs: Another effective re-write, to clean up the code, produce
327 better output, and produce more output. For example, most of
328 PosixConvert can be auto-generated, so it is (modulo version delays and
329 bootstrap issues). `map.c' is now conditional on all macros, and has
330 error checking for invalid/unsupported values.
332 2004-09-18 Jackson Harper <jackson@ximian.com>
334 * Syscall.cs: Add support for poll ().
336 2004-09-18 Jackson Harper <jackson@ximian.com>
338 * make-map.cs: Use field value not name for #defines.
340 2004-09-14 Loren Bandiera <lorenb@mmgsecurity.com>
342 * Syscall.cs: Added method for getpwnam which uses Passwd
344 * macros.c: Helper function for getpwnam
345 (In committing, Josh Tauberer also added getpwuid.)
347 2004-07-09 Dick Porter <dick@ximian.com>
349 * PeerCred.cs: Get the unix socket peer credentials.
351 2004-05-26 Miguel de Icaza <miguel@ximian.com>
353 * Syscall.cs: Do not let the runtime handle strings, as we do not
354 own those strings, we must transform the char * into a string
357 2004-05-03 Miguel de Icaza <miguel@ximian.com>
359 * Syscall.cs: Add symlink
361 2004-04-19 Miguel de Icaza <miguel@ximian.com>
363 * Syscall.cs: Use hex values for FileMode, since C# does not have
364 an octal integer mode.
366 2004-03-30 Joshua Tauberer <tauberer@for.net>
368 * Added readlink, strerror, opendir, readdir, closedir
369 * Added Mono.Posix.Stat.UnixToDateTime(long unixtime) --> DateTime
371 2004-03-11 Joshua Tauberer <tauberer@for.net>
373 * Syscall.cs: Removed argument to getgid that shouldn't be there.
374 Added getusername, getgroupname which wrap getpwuid, getgrgid
375 without dealing with pointers to structures.
376 Removed duplicate FileMode enum nested in Syscall class.
377 Added stat and lstat, which use StatMode enumeration
378 (like FileMode but nicer and complete) and Stat struct.
379 * macros.c: Helper functions for getpwuid, getgrgid, stat, lstat.
381 2004-01-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
383 * Syscall.cs: moved the assembly attribute to a proper place
385 * make-map.cs: use reflection to invoke the properties, as it
386 fails under MS runtime.
389 2004-01-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
391 * Syscall.cs: moved assembly attribute and added unsafe block to fix
392 the build on windows.
394 2003-11-11 Wojciech Polak <polak@gnu.org
396 * Syscall.cs: Applied patch from Wojciech Polak <polak@gnu.org> to
399 2003-05-16 Dick Porter <dick@ximian.com>
401 * UnixEndPoint.cs: New property to get and set the filename, like
402 the IPEndPoint has for the IP address. Also implement ToString().
404 Tue Apr 29 16:53:56 CEST 2003 Paolo Molaro <lupus@ximian.com>
406 * Syscall.cs: remove the unsafe mess.
408 2003-02-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
411 * UnixEndPoint.cs: first file.