1 2005-04-30 Ben Maurer <bmaurer@ximian.com>
3 * Stdlib.cs: Comment out usage of `UnmanagedFunctionPointer'. It
4 isn't supported in the runtime -- it throws an assert -- so better
5 not to use it at all for now.
7 2005-04-29 Jonathan Pryor <jonpryor@vt.edu>
9 * UnixConvert.cs: Fix time_t -> DateTime conversions. time_t should be
10 assumed to be in the local time zone, so don't mess with UTC shifts.
11 This allows Mono.Unix to produce sane output (e.g. identical to ls(1) or
12 stat(1), instead of several hours different).
14 2005-04-29 Jonathan Pryor <jonpryor@vt.edu>
16 * Stdlib.cs: Make FilePosition slightly more useful by providing a
17 ToString() override which dumps the fpos_t structure contents into a
18 hex string. Add Equals(), GetHashCode(), operator==, and operator!=
19 so FilePosition behaves like a value type.
21 2005-04-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24 * UnixListener.cs: TcpListener/TcpClient clones from Jow Shaw.
26 2005-04-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
28 * Mono.Posix.dll.sources: added UnixListener and UnixClient from Joe
31 2005-04-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
33 * UnixEndPoint.cs: fix from Mono.Posix.
35 2005-04-20 Jonathan Pryor <jonpryor@vt.edu>
37 * Syscall.cs: Make all fork(2) and exec(2) functions `private`. It
38 currently isn't safe to call these under *any* circumstances. See also
39 68141, and this pertinent quote from Butenhof's
40 "Programming with POSIX Threads", p197, s6.1:
42 "When a threaded process calls fork to create a child process,
43 Pthreads specifies that only the thread calling fork exists in the
44 child. ... Pthreads does not 'terminate' the other threads in a forked
45 process...They simply cease to exist. ... This is not a problem if
46 the child process is about to call exec to run a new program, but if
47 you use fork to clone a threaded program, beware that you may lose
48 access to memory, especially heap memory stored only as
49 thread-specific data values."
51 Since P/Invoke currently requires using thread local storage, once you
52 fork(2) you won't be able to invoke exec(2) from managed code (since that
53 would require a P/Invoke transition to call exec(2), which would require
54 TLS, which doesn't exist in the new process).
56 This can only be fixed by removing the TLS dependency on P/Invoke, which
57 isn't a priority (and may not be possible).
59 The workaround is to create a C function which does your fork(2)/exec(2)
60 (and any other functions such as daemon(3)) on your behalf, and P/Invoke
61 to call this C function.
63 2005-04-18 Jonathan Pryor <jonpryor@vt.edu>
65 * Syscall.cs: Update comment specifying which functions belong in Syscall.
66 * UnixConvert.cs: Add XattrFlags conversion functions.
67 * UnixMarshal.cs: Remove warning about self-assignment.
69 2005-04-16 Daniel Drake <dsd@gentoo.org>
71 * Syscall.cs: Add bindings for extended attribute manipulation
73 2005-04-05 Miguel de Icaza <miguel@novell.com>
75 * Syscall.cs: Set entry point for sys_syslog to be syslog.
76 Include the syslog.h header in the generated map so that we
77 actually do the mapping.
79 2005-03-28 Jonathan Pryor <jonpryor@vt.edu>
81 * UnixConvert.cs: Add ToFopenMode() methods, which convert FileMode/FileAccess
82 into an fopen(3) mode string. ToOpenFlags() should throw
83 ArgumentOutOfRangeException for argument violations.
84 * StdioFileStream.cs: Add constructor overloads accepting filename and
85 FileMode/FileAccess overloads; Compatibility fixes with regression tests;
86 remove IDisposable implementation since System.IO.Stream already
87 implements it (which calls Close() for us).
89 2005-03-17 Jonathan Pryor <jonpryor@vt.edu>
91 * Stdlib.cs: Move Errno-related functionality into Stdlib from Syscall,
92 since (1) errno is part of C89, and (2) StdioFileStream will need it, and
93 StdioFileStream shouldn't use Syscall. Add [UnmanagedFunctionPointer]
94 attribute to SignalHandler for .NET 2.0 (since signal handlers use C
95 calling convention, not Stdcall).
96 * Syscall.cs: Move Errno-related functionality into Stdlib.
97 * UnixMarshal.cs: Use ERANGE not EPERM when figuring out appropriate
98 translator, since ERANGE is part of C99 and EPERM isn't. Use Stdlib
99 instead of Syscall for Errno-related functionality.
101 2005-02-02 Jonathan Pryor <jonpryor@vt.edu>
103 * UnixFile.cs: Cope with changes in UnixStream.
104 * UnixStream.cs: Change FileDescriptor property to Handle for consistency.
105 * StdioFileStream.cs: Change FileStream property to Handle for consistency.
107 2005-02-02 Jonathan Pryor <jonpryor@vt.edu>
109 * Syscall.cs: Remove public sys_ methods. Some were public by mistake, and
110 others so that users could manually marshal strings if desired. Manually
111 marshaling strings shouldn't be necessary, though, so remove them too.
113 2005-02-02 Jonathan Pryor <jonpryor@vt.edu>
115 * StdioFileStream.cs: Fix Length property to actually return the size of the
116 file, not the # of bytes from the current position to EOF. Oops.
118 2005-01-31 Jonathan Pryor <jonpryor@vt.edu>
120 * Stdlib.cs: Import "msvcrt", not "libc". These members are part of the
121 ANSI C standard, and thus should be present on Windows via msvcrt.dll
122 (except snprintf, until they catch up to C99). Change the calling
123 convention of all functions to Cdecl, as the .NET default is Stdcall.
124 Changing the calling convention isn't needed in Syscall, as it can only be
125 run on Unix platforms anyway, where the default is Cdecl.
126 * Syscall.cs: Add LIBC member that points to the real "libc"; we can't use
127 the imported definition from Stdlib as "msvcrt" doesn't exist on Unix.
129 2005-01-29 Jonathan Pryor <jonpryor@vt.edu>
131 * Stdlib.cs: sys_* functions shouldn't be public.
133 2005-01-13 Jonathan Pryor <jonpryor@vt.edu>
135 * make-map.cs: libMonoPosixHelper exports Mono_Posix prefixes, not Mono_Unix
136 prefixes, so change the type and namespace to generate compatible code.
137 * Syscall.cs: Change OpenFlags values so they match the Linux values.
139 2005-01-13 Jonathan Pryor <jonpryor@vt.edu>
141 * Stdlib.cs: Use Stdlib.LIBC instead of "libc".
142 * StdioFileStream.cs: Add FilePosition property (not that I expect anyone to
143 use it) and Rewind() method.
145 2005-01-05 Jonathan Pryor <jonpryor@vt.edu>
147 * StdioFileStream.cs: Added; System.IO.Stream wrapper for C FILE struct.
148 * Stdlib.cs: Correct visibility of ftell().
150 2005-01-05 Jonathan Pryor <jonpryor@vt.edu>
152 * Stdlib.cs: Re-order declarations to match the order used in the
153 C99 Standard Annex B; Complete <stdio.h> exports (except for those not
154 worth supporting); Add non-"unsafe" versions of fread(3), fwrite(3) and
155 add some rudimentary buffer-overflow checking; Add <stdlib.h> exports such
156 as getenv(3), exit(3), rand(3), EXIT_SUCCESS, RAND_MAX, etc.
158 2005-01-03 Jonathan Pryor <jonpryor@vt.edu>
160 * Syscall.cs: Update endfsent() and setfsent() declarations, as these must
161 now be implemented in MonoPosixHelper.
163 2005-01-01 Jonathan Pryor <jonpryor@vt.edu>
165 * Stdlib.cs, Syscall.cs: Minimize duplicate declarations of
166 "MonoPosixHelper" for use in DllImport statements.
168 2005-01-01 Jonathan Pryor <jonpryor@vt.edu>
170 * Stdlib.cs: Don't use C# v2 features; fixes build under CSC.EXE.
172 2004-12-30 Jonathan Pryor <jonpryor@vt.edu>
174 * Stdlib.cs: On miguel's suggestion, rename Sighandler_t to SignalHandler.
176 2004-12-30 Jonathan Pryor <jonpryor@vt.edu>
178 * Stdlib.cs: Implement all C89 <stdio.h> functions except for the scanf(3)
179 family. These are too dangerous to expose.
181 2004-12-30 Jonathan Pryor <jonpryor@vt.edu>
183 * CdeclFunctions.cs: Remove warning about unused variable.
184 * Stdlib.cs: Make signal(2) sane and (hopefully) complete.
185 * Syscall.cs: Fix cuserid Obsolete message to reference correct class name.
186 * UnixProcess.cs: Remove warning about unused variable.
187 * UnixMarshal.cs: Remove warnings about unused variables.
189 2004-12-29 Jonathan Pryor <jonpryor@vt.edu>
191 * UnixPath.cs: Add ReadSymbolicLink(), which takes an intelligent approach
192 to reading symlinks (since their contents may be any size, we grow the
193 buffer dynamically to fit them all, instead of assuming a maximum size).
194 * UnixSymbolicLinkInfo.cs: Remove MaxContentsSize.
196 2004-12-29 Jonathan Pryor <jonpryor@vt.edu>
198 * UnixPath.cs: Add check for when symlink points to a full path name.
200 2004-12-29 Jonathan Pryor <jonpryor@vt.edu>
202 * Syscall.cs: Fix Object.Equals implementations.
203 * UnixPath.cs: New & improved, with Testing! GetRealPath() is changed so
204 that it doesn't walk the entire path looking for symlinks, it just reads
205 the leaf. GetCompletRealPath() walks the entire path resolving symlinks.
206 GetCanonicalPath() added, which "cleans up" a path (removing extraneous
207 "." and ".." entries).
208 * UnixSymbolicLinkInfo.cs: Rename ContentsLength -> MaxContentsSize.
210 2004-12-28 Jonathan Pryor <jonpryor@vt.edu>
212 * UnixFileSystemInfo.cs: Add a link(2) wrapper, CreateLink(). Strictly
213 speaking it's only "safe" to do this on files, but an exception will be
214 returned if the user tries to hard link directories (because of EPERM),
215 unless the user is root, in which case it should be allowed anyway...
217 2004-12-28 Jonathan Pryor <jonpryor@vt.edu>
219 * CdeclFunctions.cs: Correct the comments for AMD64
220 * UnixDirectoryInfo.cs: override Name; add Parent & Root properties;
221 Correct Path usage (s/Path/FullPath/g).
222 * UnixDriveInfo.cs: Added. Based on .NET 2.0 System.IO.DriveInfo docs,
223 provides statvfs(2) and getfsfile(3) information about a mounted volume.
224 GetDrives() wraps getfsent(3), thus parsing /etc/fstab.
225 * UnixFile.cs: Use UnixConver.ToOpenFlags, deleting the local version.
226 * UnixFileInfo.cs: Use UnixConver.ToOpenFlags, deleting the local version;
227 override Name; add DirectoryName and Directory properties;
228 * UnixFileSystemInfo.cs: Make more .NET-like, using FullPath and
229 OriginalPath protected members, abstract Name property; Add
230 CreateSymbolicLink; Remove ReadLink (it's now
231 UnixSymbolicLinkInfo.Contents); Use lstat(2) for Create(string), so we
232 properly detect Symbolic Links.
233 * UnixPath.cs: Added; Path manipulation utility functions.
234 * UnixSymbolicLinkInfo.cs:
236 - override new abstract member Name;
237 - rename ReadLink to ContentsPath (and Contents) properties
238 (why "Contents"? Because readlink(2) says "readlink places the
239 contents of the symbolic link in the buffer...")
240 - Add CreateSymbolicLinkTo(), which creates a symlink to the specified
243 2004-12-28 Jonathan Pryor <jonpryor@vt.edu>
245 * Stdlib.cs: Add syslog(3) to XPrintfFunctions; Add additional printf(3)
246 and fprintf(3) overload which properly escape the format string
247 (by using "%s" as the format for the user-supplied message).
248 * Syscall.cs: Add #regions for enummerations, structures, classes; Wrap
249 syslog(3) and related enumerations; fix operator!= on Dirent, Group;
250 wrap {f}statvfs(2); wrap <fstab.h> entries (getfsent(3), etc.).
251 * UnixConvert.cs: Add Syslog-releated enumeration translation functions;
252 Move ToOpenFlags here from UnixFile and UnixFileInfo.
253 * UnixMarshal.cs: Missing P/Invoke methods throw
254 EntryPointNotFoundException, not MissingMethodException; add
255 EscapeFormatString, which escapes printf-style format strings so that they
256 can be safely handed off to native code (avoiding stack overflow, etc);
257 make CreateExceptionForError internal.
259 2004-12-15 Jonathan Pryor <jonpryor@vt.edu>
261 * Stdlib.cs: Add more <stdio.h> wrappers, such as fread(3) and fwrite(3).
262 These will be useful in implementing System.IO.Stream subclass for
263 reading/writing to a FILE*. Fix a typo in the realloc(3) DllImport.
264 * Syscall.cs: Fix the sys_kill and sys_crypt declarations.
265 * CdeclFunction.cs: Document calling convention problems on AMD64.
267 2004-11-18 Jonathan Pryor <jonpryor@vt.edu>
269 * CdeclFunction.cs: Added.
270 * Stdlib.cs: Re-add printf(3) and fprintf(3). They may not be portable (the
271 jury is still out on that; the AMD64 SysV ABI looks like it should be
272 portable to AMD64 to my eyes), but they will work on *some* platforms, so
273 we should permit it. The new implementation takes a page out of
274 cocoa-sharp: use System.Reflection.Emit to generate a P/Invoke method at
275 runtime to invoke printf(3) or fprintf(3). This way, we can export a
276 params signature to C# code, permitting natural usage such as:
277 Stdlib.printf ("Hello, %s world! (%i)\n", "silly", 42);
278 * Syscall.cs: Mark which headers are complete, which functions still need
279 wrapping (for headers which have anything done to them), add #region
280 blocks for each header;
281 export mkfifo(3), fexecve(), getppid(2), setlogin(); fix sleep(3) export.
282 * UnixEnvironment.cs: Export a friendly getppid(2) wrapper.
283 GetParentProcessId isn't in UnixProcess as there's no way (that I know of)
284 to get the Parent's Parent, so it can't be a class member, and exposing it
285 as a static member of UnixProcess doesn't make sense to me, as it isn't
286 general. Added GetUserShells().
287 * UnixProcess.cs: Change constructor to internal, so it can be used from
290 2004-11-16 Jonathan Pryor <jonpryor@vt.edu>
292 * Stdlib.cs: Remove printf(3) and fprintf(3). These are vararg/CDECL
293 functions, and it's not portable to call them in this manner.
294 (It's not portable because some architectures, such as AMD64, use a
295 "cookie" as part of the vararg calling sequence to help reduce buffer
296 overflow exploits. Trying to call vararg functions as if they were an
297 overloaded function will not properly set this hardware cookie, resulting
298 in a hardware exception. Talk to lupus for more information.)
300 2004-11-16 Jonathan Pryor <jonpryor@vt.edu>
302 * Syscall.cs, UnixConvert.cs: Remove mount- and umount-related
303 functionality. Mount/umount is inherently non-portable (see the C code
304 for mount/umount), and trying to provide a consistent interface is
305 impossible. If you need mount/umount support, use the command-line
306 programs mount(1) and umount(1).
308 2004-11-16 Jonathan Pryor <jonpryor@vt.edu>
310 + Lots o' Renames, as the namespace changed.
311 * PosixConvert.cs: Moved to UnixConvert.cs:
312 * PosixDirectory.cs: Moved to UnixDirectory.cs:
313 * PosixEnvironment.cs: Moved to UnixEnvironment.cs:
314 * PosixDirectoryInfo.cs: Moved to UnixDirectoryInfo.cs:
315 * PosixFile.cs: Moved to UnixFile.cs:
316 * PosixFileInfo.cs: Moved to UnixFileInfo.cs:
317 * PosixFileSystemInfo.cs: Moved to UnixFileSystemInfo.cs:
318 * PosixGroup.cs: Moved to UnixGroup.cs:
319 * PosixGroupInfo.cs: Moved to UnixGroupInfo.cs:
320 * PosixIOException.cs: Moved to UnixIOException.cs:
321 * PosixMarshal.cs: Moved to UnixMarshal.cs:
322 * PosixProcess.cs: Moved to UnixProcess.cs:
323 * PosixStream.cs: Moved to UnixStream.cs:
324 * PosixSymbolicLinkInfo.cs: Moved to UnixSymbolicLinkInfo.cs:
325 * PosixUser.cs: Moved to UnixUser.cs:
326 * PosixUserInfo.cs: Moved to UnixUserInfo.cs:
327 * Catalog.cs, IncludeAttribute.cs, MapAttribute.cs, PeerCred.cs, Stdlib.cs,
328 Syscall.cs, UnixConvert.cs, UnixDirectory.cs, UnixDirectoryInfo.cs,
329 UnixEndPoint.cs, UnixEnvironment.cs, UnixFile.cs, UnixFileInfo.cs,
330 UnixFileSystemInfo.cs, UnixGroup.cs, UnixGroupInfo.cs, UnixIOException.cs,
331 UnixMarshal.cs, UnixProcess.cs, UnixStream.cs, UnixSymbolicLinkInfo.cs,
332 UnixUser.cs, UnixUserInfo.cs: Deal with renamed classes/members.
334 2004-11-15 Jonathan Pryor <jonpryor@vt.edu>
336 * PosixUserInfo.cs: Make the PosixUserInfo(Passwd) constructor public;
337 override Object.GetHashCode and Object.Equals.
338 * PosixGroupInfo.cs: Make the PosixGroupInfo(Group) constructor public;
339 override Object.GetHashCode and Object.Equals.
340 * PosixIOException.cs: Use PosixMarshal.GetErrorDescription instead of
341 calling Syscall.strerror_r directly
342 * PosixMarshal.cs: Add GetErrorDescription. Strerror_r() isn't portable, so
343 GetErrorDescription() first tries strerror_r(), and if it fails falls back
346 - Seal the Dirent class. It has no virtual members, so there's no point
347 in it being non-sealed. Override Object.GetHashCode and Object.Equals.
348 - Seal the Group class. It has no virtual members, so there's no point
349 in it being non-sealed. Override Object.GetHashCode and Object.Equals.
350 Provide operator== and operator!=.
351 - Seal the Passwd class. It has no virtual members, so there's no point
352 in it being non-sealed. Override Object.GetHashCode and Object.Equals.
353 Provide operator== and operator!=.
354 - Remove strerror_r() convenience overload. This is now
355 PosixMarshal.GetErrorDescription().
357 2004-11-12 Jonathan Pryor <jonpryor@vt.edu>
359 * Syscall.cs: Export time-related functions (gettimeofday, settimeofday,
360 utime, utimes), mknod.
362 2004-11-07 Atsushi Enomoto <atsushi@ximian.com>
364 * PosixEnvironment.cs : csc build fix. see bug #69195.
365 * PosixStream.cs : csc build fix. see bug #69196.
367 2004-11-05 Jonathan Pryor <jonpryor@vt.edu>
369 * PosixConvert.cs: New file; conversion functions for Mono.Posix types.
370 * PosixDirectory.cs: New file; Friendly wrapper over directory information.
371 * PosixDirectoryInfo.cs: New file; Friendly wrapper over directory information.
372 * PosixEnvironment.cs: New file; Friendly wrapper over environment information.
373 * PosixFile.cs: New file; Friendly wrapper over file information.
374 * PosixFileInfo.cs: New file; Friendly wrapper over file information.
375 * PosixFileSystemInfo.cs: New file; Friendly wrapper over `stat'.
376 * PosixGroup.cs: New file; User Group-related functionality
377 * PosixGroupInfo.cs: New file; User Group-related functionality
378 * PosixIOException.cs: New file; Exception for POSIX-generated exceptions.
379 * PosixMarshal.cs: New file; utility functions for marshaling, etc.
380 * PosixProcess.cs: New file; Friendly wrapper over process information.
381 * PosixStream.cs: New file; Friendly wrapper over file descriptors.
382 * PosixSymbolicLinkInfo.cs: New file; Friendly wrapper over symbolic links.
383 * PosixUser.cs: New file; Friendly wrapper over user information.
384 * PosixUserInfo.cs: New file; Friendly wrapper over user information.
385 * Stdlib.cs: New file; C standard library exports.
386 * Syscall.cs: Effective re-write.
387 - Organize exports by header file
388 - add additional enumerations (Error for the E* error values, etc.)
389 - always explicitly specify enumeration underlying type
390 - Use a new wrapping infrastructure so that ABI-stable types are exported
391 - For example, size_t is exported as ulong, not IntPtr.
392 - Wrap more functions, and wrap them better (such as getpwnam).
393 - This release is NOT backward compatible. Many names are the same, and
394 hopefully they're still compatible, but no effort was made to maintain
395 compatibility. For example, FileMode was removed and replaced with
396 FilePermissions, to avoid a name conflict with System.IO.FileMode.
397 - Change umount() to use MonoPosixHelper: portability fix for Mac OS X.
398 * make-map.cs: Another effective re-write, to clean up the code, produce
399 better output, and produce more output. For example, most of
400 PosixConvert can be auto-generated, so it is (modulo version delays and
401 bootstrap issues). `map.c' is now conditional on all macros, and has
402 error checking for invalid/unsupported values.
404 2004-09-18 Jackson Harper <jackson@ximian.com>
406 * Syscall.cs: Add support for poll ().
408 2004-09-18 Jackson Harper <jackson@ximian.com>
410 * make-map.cs: Use field value not name for #defines.
412 2004-09-14 Loren Bandiera <lorenb@mmgsecurity.com>
414 * Syscall.cs: Added method for getpwnam which uses Passwd
416 * macros.c: Helper function for getpwnam
417 (In committing, Josh Tauberer also added getpwuid.)
419 2004-07-09 Dick Porter <dick@ximian.com>
421 * PeerCred.cs: Get the unix socket peer credentials.
423 2004-05-26 Miguel de Icaza <miguel@ximian.com>
425 * Syscall.cs: Do not let the runtime handle strings, as we do not
426 own those strings, we must transform the char * into a string
429 2004-05-03 Miguel de Icaza <miguel@ximian.com>
431 * Syscall.cs: Add symlink
433 2004-04-19 Miguel de Icaza <miguel@ximian.com>
435 * Syscall.cs: Use hex values for FileMode, since C# does not have
436 an octal integer mode.
438 2004-03-30 Joshua Tauberer <tauberer@for.net>
440 * Added readlink, strerror, opendir, readdir, closedir
441 * Added Mono.Posix.Stat.UnixToDateTime(long unixtime) --> DateTime
443 2004-03-11 Joshua Tauberer <tauberer@for.net>
445 * Syscall.cs: Removed argument to getgid that shouldn't be there.
446 Added getusername, getgroupname which wrap getpwuid, getgrgid
447 without dealing with pointers to structures.
448 Removed duplicate FileMode enum nested in Syscall class.
449 Added stat and lstat, which use StatMode enumeration
450 (like FileMode but nicer and complete) and Stat struct.
451 * macros.c: Helper functions for getpwuid, getgrgid, stat, lstat.
453 2004-01-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
455 * Syscall.cs: moved the assembly attribute to a proper place
457 * make-map.cs: use reflection to invoke the properties, as it
458 fails under MS runtime.
461 2004-01-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
463 * Syscall.cs: moved assembly attribute and added unsafe block to fix
464 the build on windows.
466 2003-11-11 Wojciech Polak <polak@gnu.org
468 * Syscall.cs: Applied patch from Wojciech Polak <polak@gnu.org> to
471 2003-05-16 Dick Porter <dick@ximian.com>
473 * UnixEndPoint.cs: New property to get and set the filename, like
474 the IPEndPoint has for the IP address. Also implement ToString().
476 Tue Apr 29 16:53:56 CEST 2003 Paolo Molaro <lupus@ximian.com>
478 * Syscall.cs: remove the unsafe mess.
480 2003-02-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
483 * UnixEndPoint.cs: first file.