1 2005-11-01 Jonathan Pryor <jonpryor@vt.edu>
3 * UnixDirectoryInfo.cs, UnixDriveInfo.cs, UnixEnvironment.cs,
4 UnixFileSystemInfo.cs, UnixGroupInfo.cs, UnixProcess.cs, UnixUserInfoc.cs:
5 Obsolete statements now specify in what way the return type will change.
6 * IncludeAttribute.cs: Obsoleted. It's an error to use it now.
8 2005-11-01 Jonathan Pryor <jonpryor@vt.edu>
10 * FileAccessPattern.cs: Change enumeration names to match Robert Love's more
11 sensible names from his FileAdvise class used in Beagle
12 (UseSoon --> PreLoad, WillNotUse --> FlushCache).
13 * FileHandleOperations.cs: Added; contains AdviseFileAccessPattern()
14 (moved from UnixFile.cs).
15 * UnixDirectory.cs: Obsolete the class; use UnixDirectoryInfo instead.
16 * UnixDirectoryInfo.cs: Add GetCurrentDirectory(), SetCurrentDirectory().
17 * UnixFile.cs: Obsolete the class; use UnixFileInfo, FileHandleOperations,
19 * UnixFileSystemInfo.cs: Add ToStat() method.
20 * UnixGroup.cs: Obsolete the class; use UnixGroupInfo instead.
21 * UnixGroupInfo.cs: Obsolete & Replace constructor, add GetMemberNames(),
23 * UnixPipes.cs: Added (type moved from UnixFile.cs).
24 * UnixStream.cs: AdviseFileAccessPattern() uses FileHandleOperations now.
25 * UnixSymbolicLinkInfo.cs: Implement TryReadLink() to avoid constant buffer
26 re-sizing. Stevens states that the file size of the symlink is the number
27 of bytes needed to hold the symlink, so this should be faster.
28 * UnixUser.cs: Obsolete the class; use UnixUserInfo instead.
29 * UnixUserInfo.cs: Obsolete & Replace constructor; add useful static members
30 from UnixUser such as GetLoginName(), GetLocalUsers(), etc.
32 2005-10-27 Jonathan Pryor <jonpryor@vt.edu>
34 * UnixEnvironment.cs: Add RealUser, RealGroup, EffectiveUser, EffectiveGroup
35 properties; [Obsolete] necessary methods and provide replacements.
36 * UnixStream.cs: Add OwnerUser(Id), OwnerGroup(Id) properties;
37 improve Stat handling.
39 2005-10-26 Jonathan Pryor <jonpryor@vt.edu>
41 * UnixEncoding.cs: Change EscapeByte to 0x0000, as suggested by Michal
43 * UnixPath.cs: Remove '\0' from InvalidPathChars, since U+0000 is now used
44 as the path escape character for marshaling purposes.
46 2005-10-26 Jonathan Pryor <jonpryor@vt.edu>
48 * UnixMarshal.cs: Obsolete heap-related methods to have a Heap suffix
49 (AllocHeap, FreeHeap, etc.), and change StringToAlloc() to be
50 StringToHeap(). This creates a stronger name association between related
53 2005-10-26 Jonathan Pryor <jonpryor@vt.edu>
55 * UnixIOException.cs: Add (string) and (string, Exception) constructors to
56 silence FxCop; re-work logic so we lookup the error string at construction
57 time and use this as the message for the base class.
59 2005-10-25 Jonathan Pryor <jonpryor@vt.edu>
61 * Stdlib.cs, Syscall.cs: Filenames need to be marshaled through the
62 FileNameMarshaler, which will encode/decode filenames with UnixEncoding.
63 * UnixEncoding.cs: Added (copied from
64 ../../corlib/System.Text/UTF8Encoding.cs); a hack to permit handling of
65 arbitrarily encoded filenames. It attempts to decode a byte[] array as
66 UTF-8, and if the decode fails it prefixes each byte with
67 UnixEncoding.EscapeByte (\uFFFF).
68 * UnixMarshal.cs: Use UnixEncoding as the default encoding, and special-case
69 UnixEncoding to use Stdlib.strlen() for native string lengths.
71 2005-10-21 Jonathan Pryor <jonpryor@vt.edu>
73 * FileAccessPattern.cs: Added
74 * UnixFile.cs, UnixStream.cs: Deprecate all the Advise* methods (lots!)
75 and replace with 6 methods which take a FileAccessPattern enum.
77 2005-10-19 Jonathan Pryor <jonpryor@vt.edu>
79 * FileAccessPermissions.cs, FileSpecialAttributes.cs, FileTypes.cs: Added.
80 * UnixFileSystemInfo.cs, UnixStream.cs: Replace the old Permission property
81 with 4 new properties: Protection (for the Native.FilePermissions value),
82 FileAccessPermissions (for rwxrwxrwx info), FileSpecialAttributes (for
83 set-user-id, set-group-id, sticky), and FileTypes (directory, socket...).
84 The new enumeration types have nicer CLS-compliant names.
86 2005-10-17 Jonathan Pryor <jonpryor@vt.edu>
88 * UnixMarshal.cs: Fix GetIntXxBufferLength to require fewer
89 Marshal.ReadIntXx() calls; Fix PtrToString so that
90 ``"foo" == PtrToString (StringToAlloc("foo",enc),enc)'' is true for
93 2005-10-17 Jonathan Pryor <jonpryor@vt.edu>
95 * UnixFileSystemInfo.cs: Add OwnerUserId and OwnerGroupId properties.
97 2005-10-17 Jonathan Pryor <jonpryor@vt.edu>
99 * UnixDriveInfo.cs, UnixEnvironment.cs, UnixFile.cs, UnixFileSystemInfo.cs,
100 UnixGroup.cs, UnixStream.cs, UnixUser.cs: Don't use SetLastError(), since
101 it's use is (1) incorrect, and (2) will be going away with the move to
102 Mono.Unix.Native.Syscall. Instead use the Native.Syscall.* APIs which
105 2005-10-17 Jonathan Pryor <jonpryor@vt.edu>
107 * UnixGroup.cs, UnixGroupInfo.cs, UnixFile.cs, UnixFileSystemInfo.cs,
108 UnixStream.cs, UnixSymbolicLinkInfo.cs, UnixUser.cs, UnixUserInfo.cs:
109 Start migrating uid/gid to long (from uint) for CLS compliance.
110 (Full migration must wait 'til after the next release as this would
111 require changes to existing members.)
112 * UnixEnvironment.cs: Above, and add RealUserId/RealGroupId and
113 EffectiveUserId/EffectiveGroupId.
115 2005-10-14 Jonathan Pryor <jonpryor@vt.edu>
117 * Catalog.cs: Create a constructor and mark it [Obsolete]. It will be made
118 private after the next release.
119 * UnixFile.cs, UnixStream.cs: Deal with Mono.Unix.Native type name changes.
120 * UnixFileSystemInfo.cs: [Obsolete] more members; Deal with Mono.Unix.Native
122 * Syscall.cs: Create maps for PathConf, SysConf, ConfStr again; fpathconf(),
123 pathconf(), and sysconf() should call Native.Syscall since the
124 MonoPosixHelper.so helpers have changed.
126 2005-10-13 Jonathan Pryor <jonpryor@vt.edu>
128 * UnixMarshal.cs: More/better StringToAlloc/PtrToString which take a
129 System.Text.Encoding instance for proper string marshaling.
130 - PtrToString(string,Encoding) is particularly tricky due to variable
132 - Fix StringToAlloc so that it works properly with UTF-16 encodings
133 (we need a terminating null 16-bit word, not a null byte).
134 - StringToAlloc overload for doing substrings.
136 2005-10-12 Jonathan Pryor <jonpryor@vt.edu>
138 * UnixStream.cs: Check for EROFS and EINVAL in Flush(). Snorp was getting
139 an exception when he created a UnixStream around a socket, because
140 sockets can't be flushed. It should be acceptable to create a UnixStream
141 around a socket, so don't throw an exception in this scenario.
143 2005-10-06 Jonathan Pryor <jonpryor@vt.edu>
145 * UnixDirectory.cs, UnixDirectoryInfo.cs UnixFile.cs, UnixFileSystemInfo.cs,
146 UnixGroupInfo.cs, UnixIOException.cs, UnixStream.cs, UnixUserInfo.cs:
147 API Review: Obsolete appropriate members and add appropriate overloads for
148 pending move to Mono.Unix.Native types.
149 * UnixMarshal.cs: API Review; add StringToAlloc().
151 2005-09-26 Jonathan Pryor <jonpryor@vt.edu>
153 * UnixFileSystemInfo.cs: Exists shouldn't use access(2), as (1) Exists isn't
154 virtual, and (2) access(2) errors if you try to access(2) a symlink which
155 points nowhere. Use (l)stat(2) instead, via GetFileStatus(), as this lets
156 UnixSymbolicLinkInfo behave properly.
157 * UnixSymbolicLinkInfo.cs: The Contents property should return null if the
158 symlink target doesn't exist.
160 2005-09-20 Jonathan Pryor <jonpryor@vt.edu>
162 * Syscall.cs: Add [Map] to AccessMode and MmapProt, as the Mono.Unix.Native
163 replacements go by different names (AccessModes, MmapProts), but we need
164 to continue generating the mapping code for these types (backward compat).
166 2005-09-20 Jonathan Pryor <jonpryor@vt.edu>
168 * CdeclFunction.cs: [Obsolete]d by Mono.Unix.Native.CdeclFunction.
169 * make-map.cs: Remove.
170 * Stdlib.cs: [Obsolete] the types; use the Mono.Unix.Native.* types instead.
171 * StdioFileStream.cs: Add GC.KeepAlive statements to prevent premature GC's
173 * Syscall.cs: Remove [Map] attribute from all types; [CLSCompliant(false)]
174 work; [Obsolete] all types and suggest using the Mono.Unix.Native.*
175 replacements; remove [IncludeAttribute] -- superseded by
176 Mono.Unix.Native/Syscall.cs's [HeaderAttribte] for CLS compliance.
177 * UnixConvert.cs: [Obsolete]d by Mono.Unix.Native.NativeConvert.
178 * UnixDirectory.cs, UnixDriveInfo.cs, UnixEnvironment.cs,
179 UnixGroup.cs, UnixGroupInfo.cs,
180 UnixSymbolicLinkInfo.cs, UnixUser.cs, UnixUserInfo.cs:
181 Add [CLSCompliant(false)] as necessary.
182 * UnixFile.cs, UnixDirectory.cs, UnixFileInfo.cs, UnixFileSystemInfo.cs:
183 [CLSCompliant(false)], addition of method overloads for [Obsolete]d types,
184 warn about changing return types.
185 * UnixProcess.cs, UnixStream.cs: Add [CLSCompliant(false)] as necessary,
186 and warn about changing property types.
188 2005-09-02 Jonathan Pryor <jonpryor@vt.edu>
190 * Stdlib.cs: Cache delegates passed to Stdlib.signal() so that they survive
191 garbage collections. Delegates can be removed by calling Stdlib.signal()
192 again with one of the Stdlib.SIG_* values (or the original return value of
194 * UnixUser.cs, UnixGroup.cs, UnixEnvironment.cs: Clarify "Id" (int) vs.
195 "Name" (string) differences by always using a Id or Name suffix.
197 2005-07-01 Daniel Drake <dsd@gentoo.org>
199 * Syscall.cs: The entire extended attribute API now goes through MPH, to
200 be shared between both Linux's and FreeBSD's similar EA implementations.
202 2005-06-29 Miguel de Icaza <miguel@ximian.com>
204 * StdioFileStream.cs: Only flush if we do not own the handle, as
205 fclose does a flush internally.
207 2005-06-29 Jonathan Pryor <jonpryor@vt.edu>
209 * UnixEnvironment: Add User, Login properties.
210 * Syscall.cs: Add locking around cuserid, crypt, encrypt, getlogin.
212 2005-06-29 Jonathan Pryor <jonpryor@vt.edu>
214 * Syscall.cs: SyslogFacility shouldn't be [Flags] either. Sigh.
215 Thanks to Vorobiev Maksim for pointing this out.
216 * make-map.cs: Don't generate conversion code for [Obsolete] enum members.
217 This assumes that (1) the enum member's value is invalid, or (2) a
218 corrected member with the same value exists. This fix allows us to
219 obsolete invalid members (instead of removing them) without screwing up
220 the generated code -- consider LOG_USRE, the mis-spelling of LOG_USER.
221 Since SyslogFacility was (incorrectly) a [Flags] enum, since both LOG_USER
222 and LOG_USRE had the same value, we'd get a EINVAL error trying to convert
223 a valid value, since LOG_USRE would exist, would be checked for, and the
224 check would succeed (since it had the same value as LOG_USER).
225 This change allows us to be slightly more permissive with versioning.
227 2005-06-28 Jonathan Pryor <jonpryor@vt.edu>
229 * Syscall.cs: correct value of LOG_CRON (it shouldn't be identical to
230 LOG_UUCP). SyslogLevel shouldn't have [Flags]. Move LOG_USER to be
231 before LOG_USRE so that the generated map code doesn't return EINVAL when
232 LOG_USER is specified.
234 2005-06-15 Jonathan Pryor <jonpryor@vt.edu>
236 * Syscall.cs: s/LOG_USRE/LOG_USER/. Fixes #75274.
237 Thanks to Martin Honermeyer.
239 2005-06-09 Jonathan Pryor <jonpryor@vt.edu>
241 * make-map.cs: Look for [Obsolete] members, and mark the UnixConvert
242 conversion functions with the same [Obsolete] message. This should permit
243 more graceful deprecation of enumerations in the future (rather than just
246 2005-06-08 Jonathan Pryor <jonpryor@vt.edu>
248 * Syscall.cs: Add execvp(2). (This should have been added with the other
249 exec(2) additions...).
251 2005-06-08 Jonathan Pryor <jonpryor@vt.edu>
253 * Syscall.cs: Update comment with correct exception type.
254 * UnixConvert.cs: Rename ToFilePermissions(string) to
255 FromOctalPermissionString; Add ToOctalPermissionString,
256 FromUnixPermissionString, ToUnixPermissionString.
257 * UnixMarshal.cs: Remove ErrorMarshal.HaveStrerror_r and
258 UnixMarshal.IsErrorDescriptionThreadSafe. strerror(3) is now thread-safe
259 (from managed code, at least). Update comment.
261 2005-06-07 Jonathan Pryor <jonpryor@vt.edu>
263 * UnixFileSystemInfo.cs: Don't use lstat(2), use stat(2). This fits with
264 expectations better -- if you create a UnixFileInfo() on a symlink, you
265 want to get the target's information, not the symlink's info. Add
266 GetFileStatus so UnixSymbolicLinkInfo can override this behavior.
267 * UnixSymbolicLinkInfo.cs: Implement GetFileStatus() (which calls lstat(2)).
269 2005-06-07 Jonathan Pryor <jonpryor@vt.edu>
271 * Syscall.cs: Document naming conventions.
273 2005-06-05 Jonathan Pryor <jonpryor@vt.edu>
275 * make-map.cs: Change automatic "ifdef HAVE_<header>" support prefix to
276 "ah:" from ">". I hadn't known about ">", and "ah:" is (somewhat) more
278 * Syscall.cs: Change IncludeAttribute to put all headers/defines one/line.
279 It's easier to read this way. Add "ah:sys/xattr.h" to the headers.
281 2005-06-03 Jonathan Pryor <jonpryor@vt.edu>
283 * Stdlib.cs: Add sanity checking to snprintf(3) to avoid buffer overflows.
285 2005-06-02 Jonathan Pryor <jonpryor@vt.edu>
287 * StdioFileStream.cs: Remove FilePosition property & replace with
288 SaveFilePosition/RestoreFilePosition methods. Since FilePosition has a
289 finalizer, it's not right to have implicitly created instances.
291 - FilePosition: GC.SuppressFinalize() should be last in Dispose()
292 (following .NET guidelines).
293 - Syscall: Add locking around functions most likely to be thread unsafe.
294 This should provide some level of thread-safety to managed code.
295 * Syscall.cs: Add locking around functions most likely to be thread unsafe;
296 add mkstemp(3) export.
297 * UnixEnvironment.cs: GetUserShells should be atomic (from managed code).
298 * UnixGroup.cs: GetLocalGroups should be atomic (from managed code).
299 * UnixGroupInfo.cs: Add ToGroup() method to retrieve underlying Group info.
300 * UnixUser.cs: GetLocalUsers should be atomic (from managed code).
301 * UnixUserInfo.cs: Add ToPasswd () method to retrieve underlying Passwd info.
302 * UnixDriveInfo.cs: GetDrives should be atomic (from managed code).
304 2005-05-31 Jonathan Pryor <jonpryor@vt.edu>
306 * Stdlib.cs: Add comment for atexit(3) so I don't try to add it.
307 * Syscall.cs: Add fcntl(2) overload which takes DirectoryNotifyFlags (so
308 that *something* accepts a DirectoryNotifyFlags); Fix IncludeAttribute
309 header files (">sys/poll.h" doesn't exist);
310 Add additional <sys/mman.h> functions mmap, munmap, msync, mlock, munlock,
311 mlockall, munlockall, mremap, mincore, remap_file_pages.
312 * UnixConvert.cs: Add conversion functions for MmapFlags, MmapProt, MsyncFlags,
313 MlockallFlags, MremapFlags.
315 2005-05-31 Jonathan Pryor <jonpryor@vt.edu>
317 * Syscall.cs, UnixConvert.cs: Rename LockFlags to LockfCommand. This is a more
318 consistent naming, and it's more correct (they weren't flags in the first place).
320 2005-05-18 Jonathan Pryor <jonpryor@vt.edu>
322 * Stdlib.cs: Correct Mono_Posix_Stdlib_InvokeSignalHandler export.
324 2005-05-18 Jonathan Pryor <jonpryor@vt.edu>
326 * make-map.cs: Process the Mono.Posix namespace as well as Mono.Unix; add
327 mapping for Boolean => int for native type conversion.
329 2005-05-18 Jonathan Pryor <jonpryor@vt.edu>
331 * make-map.cs: Add a MphPrototypeFileGenerator, which looks for DllImport
332 methods across all types and generates a C header file declaration for
333 those methods. This allows us to ensure consistency between
334 Mono.Posix.dll and MonoPosixHelper.so. Rename WrapperFileGenerator to
335 ConvertFileGenerator (it generates UnixConvert).
336 * MapAttribute.cs, IncludeAttribute.cs: Make these internal -- there's no
337 reason for external users to even know these exist.
338 * StdioFileStream.cs: Move GC.SuppressFinalize call to be last Dispose()
339 call. This follows current design guidelines, and allows an exception to
340 be thrown from Dispose() without un-registering the finalizer.
341 * Syscall.cs: Change method declarations to match MonoPosixHelper, etc.
342 - posix_fallocate(P) takes a size_t
343 - mis-spelled settimeofday(2), sethostname(2)
344 - exec(2) can be public; it's safe to call
345 - change lseek(2) so int's are passed to MonoPosixHelper.so, not shorts
346 - We can't allow two incompatible prototypes to exist (since C allows
347 only one prototype, and we're cross-checking prototypes now). Change
348 utime(2) so only one prototype is needed.
349 * UnixMarshal.cs: ErrorMarshal.ErrorTranslator and ErrorMarshal.Translate
350 shouldn't be public; make them internal.
351 * UnixStream.cs: Remove `unsafe` code block when a "safe" alternative works;
352 Close() should also call GC.SuppressFinalize.
354 2005-05-12 Jonathan Pryor <jonpryor@vt.edu>
356 * Syscall.cs: The Statvfs structure should contain a MountFlags enumeration,
357 not a ulong (we can "safely" do this since POSIX defines some values for
358 f_flag, so we should be kind and expose them).
359 * UnixConvert.cs: Add MountFlags conversion functions.
361 2005-05-02 Joe Shaw <joeshaw@novell.com>
363 * UnixListener.cs (Init): Remove the call to Cleanup() and the
364 method itself, which was not supposed to be here. We try to
365 connect to the socket if it exists instead of deleting it
368 2005-04-30 Ben Maurer <bmaurer@ximian.com>
370 * Stdlib.cs: Comment out usage of `UnmanagedFunctionPointer'. It
371 isn't supported in the runtime -- it throws an assert -- so better
372 not to use it at all for now.
374 2005-04-29 Jonathan Pryor <jonpryor@vt.edu>
376 * UnixConvert.cs: Fix time_t -> DateTime conversions. time_t should be
377 assumed to be in the local time zone, so don't mess with UTC shifts.
378 This allows Mono.Unix to produce sane output (e.g. identical to ls(1) or
379 stat(1), instead of several hours different).
381 2005-04-29 Jonathan Pryor <jonpryor@vt.edu>
383 * Stdlib.cs: Make FilePosition slightly more useful by providing a
384 ToString() override which dumps the fpos_t structure contents into a
385 hex string. Add Equals(), GetHashCode(), operator==, and operator!=
386 so FilePosition behaves like a value type.
388 2005-04-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
391 * UnixListener.cs: TcpListener/TcpClient clones from Jow Shaw.
393 2005-04-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
395 * Mono.Posix.dll.sources: added UnixListener and UnixClient from Joe
398 2005-04-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
400 * UnixEndPoint.cs: fix from Mono.Posix.
402 2005-04-20 Jonathan Pryor <jonpryor@vt.edu>
404 * Syscall.cs: Make all fork(2) and exec(2) functions `private`. It
405 currently isn't safe to call these under *any* circumstances. See also
406 68141, and this pertinent quote from Butenhof's
407 "Programming with POSIX Threads", p197, s6.1:
409 "When a threaded process calls fork to create a child process,
410 Pthreads specifies that only the thread calling fork exists in the
411 child. ... Pthreads does not 'terminate' the other threads in a forked
412 process...They simply cease to exist. ... This is not a problem if
413 the child process is about to call exec to run a new program, but if
414 you use fork to clone a threaded program, beware that you may lose
415 access to memory, especially heap memory stored only as
416 thread-specific data values."
418 Since P/Invoke currently requires using thread local storage, once you
419 fork(2) you won't be able to invoke exec(2) from managed code (since that
420 would require a P/Invoke transition to call exec(2), which would require
421 TLS, which doesn't exist in the new process).
423 This can only be fixed by removing the TLS dependency on P/Invoke, which
424 isn't a priority (and may not be possible).
426 The workaround is to create a C function which does your fork(2)/exec(2)
427 (and any other functions such as daemon(3)) on your behalf, and P/Invoke
428 to call this C function.
430 2005-04-18 Jonathan Pryor <jonpryor@vt.edu>
432 * Syscall.cs: Update comment specifying which functions belong in Syscall.
433 * UnixConvert.cs: Add XattrFlags conversion functions.
434 * UnixMarshal.cs: Remove warning about self-assignment.
436 2005-04-16 Daniel Drake <dsd@gentoo.org>
438 * Syscall.cs: Add bindings for extended attribute manipulation
440 2005-04-05 Miguel de Icaza <miguel@novell.com>
442 * Syscall.cs: Set entry point for sys_syslog to be syslog.
443 Include the syslog.h header in the generated map so that we
444 actually do the mapping.
446 2005-03-28 Jonathan Pryor <jonpryor@vt.edu>
448 * UnixConvert.cs: Add ToFopenMode() methods, which convert FileMode/FileAccess
449 into an fopen(3) mode string. ToOpenFlags() should throw
450 ArgumentOutOfRangeException for argument violations.
451 * StdioFileStream.cs: Add constructor overloads accepting filename and
452 FileMode/FileAccess overloads; Compatibility fixes with regression tests;
453 remove IDisposable implementation since System.IO.Stream already
454 implements it (which calls Close() for us).
456 2005-03-17 Jonathan Pryor <jonpryor@vt.edu>
458 * Stdlib.cs: Move Errno-related functionality into Stdlib from Syscall,
459 since (1) errno is part of C89, and (2) StdioFileStream will need it, and
460 StdioFileStream shouldn't use Syscall. Add [UnmanagedFunctionPointer]
461 attribute to SignalHandler for .NET 2.0 (since signal handlers use C
462 calling convention, not Stdcall).
463 * Syscall.cs: Move Errno-related functionality into Stdlib.
464 * UnixMarshal.cs: Use ERANGE not EPERM when figuring out appropriate
465 translator, since ERANGE is part of C99 and EPERM isn't. Use Stdlib
466 instead of Syscall for Errno-related functionality.
468 2005-02-02 Jonathan Pryor <jonpryor@vt.edu>
470 * UnixFile.cs: Cope with changes in UnixStream.
471 * UnixStream.cs: Change FileDescriptor property to Handle for consistency.
472 * StdioFileStream.cs: Change FileStream property to Handle for consistency.
474 2005-02-02 Jonathan Pryor <jonpryor@vt.edu>
476 * Syscall.cs: Remove public sys_ methods. Some were public by mistake, and
477 others so that users could manually marshal strings if desired. Manually
478 marshaling strings shouldn't be necessary, though, so remove them too.
480 2005-02-02 Jonathan Pryor <jonpryor@vt.edu>
482 * StdioFileStream.cs: Fix Length property to actually return the size of the
483 file, not the # of bytes from the current position to EOF. Oops.
485 2005-01-31 Jonathan Pryor <jonpryor@vt.edu>
487 * Stdlib.cs: Import "msvcrt", not "libc". These members are part of the
488 ANSI C standard, and thus should be present on Windows via msvcrt.dll
489 (except snprintf, until they catch up to C99). Change the calling
490 convention of all functions to Cdecl, as the .NET default is Stdcall.
491 Changing the calling convention isn't needed in Syscall, as it can only be
492 run on Unix platforms anyway, where the default is Cdecl.
493 * Syscall.cs: Add LIBC member that points to the real "libc"; we can't use
494 the imported definition from Stdlib as "msvcrt" doesn't exist on Unix.
496 2005-01-29 Jonathan Pryor <jonpryor@vt.edu>
498 * Stdlib.cs: sys_* functions shouldn't be public.
500 2005-01-13 Jonathan Pryor <jonpryor@vt.edu>
502 * make-map.cs: libMonoPosixHelper exports Mono_Posix prefixes, not Mono_Unix
503 prefixes, so change the type and namespace to generate compatible code.
504 * Syscall.cs: Change OpenFlags values so they match the Linux values.
506 2005-01-13 Jonathan Pryor <jonpryor@vt.edu>
508 * Stdlib.cs: Use Stdlib.LIBC instead of "libc".
509 * StdioFileStream.cs: Add FilePosition property (not that I expect anyone to
510 use it) and Rewind() method.
512 2005-01-05 Jonathan Pryor <jonpryor@vt.edu>
514 * StdioFileStream.cs: Added; System.IO.Stream wrapper for C FILE struct.
515 * Stdlib.cs: Correct visibility of ftell().
517 2005-01-05 Jonathan Pryor <jonpryor@vt.edu>
519 * Stdlib.cs: Re-order declarations to match the order used in the
520 C99 Standard Annex B; Complete <stdio.h> exports (except for those not
521 worth supporting); Add non-"unsafe" versions of fread(3), fwrite(3) and
522 add some rudimentary buffer-overflow checking; Add <stdlib.h> exports such
523 as getenv(3), exit(3), rand(3), EXIT_SUCCESS, RAND_MAX, etc.
525 2005-01-03 Jonathan Pryor <jonpryor@vt.edu>
527 * Syscall.cs: Update endfsent() and setfsent() declarations, as these must
528 now be implemented in MonoPosixHelper.
530 2005-01-01 Jonathan Pryor <jonpryor@vt.edu>
532 * Stdlib.cs, Syscall.cs: Minimize duplicate declarations of
533 "MonoPosixHelper" for use in DllImport statements.
535 2005-01-01 Jonathan Pryor <jonpryor@vt.edu>
537 * Stdlib.cs: Don't use C# v2 features; fixes build under CSC.EXE.
539 2004-12-30 Jonathan Pryor <jonpryor@vt.edu>
541 * Stdlib.cs: On miguel's suggestion, rename Sighandler_t to SignalHandler.
543 2004-12-30 Jonathan Pryor <jonpryor@vt.edu>
545 * Stdlib.cs: Implement all C89 <stdio.h> functions except for the scanf(3)
546 family. These are too dangerous to expose.
548 2004-12-30 Jonathan Pryor <jonpryor@vt.edu>
550 * CdeclFunctions.cs: Remove warning about unused variable.
551 * Stdlib.cs: Make signal(2) sane and (hopefully) complete.
552 * Syscall.cs: Fix cuserid Obsolete message to reference correct class name.
553 * UnixProcess.cs: Remove warning about unused variable.
554 * UnixMarshal.cs: Remove warnings about unused variables.
556 2004-12-29 Jonathan Pryor <jonpryor@vt.edu>
558 * UnixPath.cs: Add ReadSymbolicLink(), which takes an intelligent approach
559 to reading symlinks (since their contents may be any size, we grow the
560 buffer dynamically to fit them all, instead of assuming a maximum size).
561 * UnixSymbolicLinkInfo.cs: Remove MaxContentsSize.
563 2004-12-29 Jonathan Pryor <jonpryor@vt.edu>
565 * UnixPath.cs: Add check for when symlink points to a full path name.
567 2004-12-29 Jonathan Pryor <jonpryor@vt.edu>
569 * Syscall.cs: Fix Object.Equals implementations.
570 * UnixPath.cs: New & improved, with Testing! GetRealPath() is changed so
571 that it doesn't walk the entire path looking for symlinks, it just reads
572 the leaf. GetCompletRealPath() walks the entire path resolving symlinks.
573 GetCanonicalPath() added, which "cleans up" a path (removing extraneous
574 "." and ".." entries).
575 * UnixSymbolicLinkInfo.cs: Rename ContentsLength -> MaxContentsSize.
577 2004-12-28 Jonathan Pryor <jonpryor@vt.edu>
579 * UnixFileSystemInfo.cs: Add a link(2) wrapper, CreateLink(). Strictly
580 speaking it's only "safe" to do this on files, but an exception will be
581 returned if the user tries to hard link directories (because of EPERM),
582 unless the user is root, in which case it should be allowed anyway...
584 2004-12-28 Jonathan Pryor <jonpryor@vt.edu>
586 * CdeclFunctions.cs: Correct the comments for AMD64
587 * UnixDirectoryInfo.cs: override Name; add Parent & Root properties;
588 Correct Path usage (s/Path/FullPath/g).
589 * UnixDriveInfo.cs: Added. Based on .NET 2.0 System.IO.DriveInfo docs,
590 provides statvfs(2) and getfsfile(3) information about a mounted volume.
591 GetDrives() wraps getfsent(3), thus parsing /etc/fstab.
592 * UnixFile.cs: Use UnixConver.ToOpenFlags, deleting the local version.
593 * UnixFileInfo.cs: Use UnixConver.ToOpenFlags, deleting the local version;
594 override Name; add DirectoryName and Directory properties;
595 * UnixFileSystemInfo.cs: Make more .NET-like, using FullPath and
596 OriginalPath protected members, abstract Name property; Add
597 CreateSymbolicLink; Remove ReadLink (it's now
598 UnixSymbolicLinkInfo.Contents); Use lstat(2) for Create(string), so we
599 properly detect Symbolic Links.
600 * UnixPath.cs: Added; Path manipulation utility functions.
601 * UnixSymbolicLinkInfo.cs:
603 - override new abstract member Name;
604 - rename ReadLink to ContentsPath (and Contents) properties
605 (why "Contents"? Because readlink(2) says "readlink places the
606 contents of the symbolic link in the buffer...")
607 - Add CreateSymbolicLinkTo(), which creates a symlink to the specified
610 2004-12-28 Jonathan Pryor <jonpryor@vt.edu>
612 * Stdlib.cs: Add syslog(3) to XPrintfFunctions; Add additional printf(3)
613 and fprintf(3) overload which properly escape the format string
614 (by using "%s" as the format for the user-supplied message).
615 * Syscall.cs: Add #regions for enummerations, structures, classes; Wrap
616 syslog(3) and related enumerations; fix operator!= on Dirent, Group;
617 wrap {f}statvfs(2); wrap <fstab.h> entries (getfsent(3), etc.).
618 * UnixConvert.cs: Add Syslog-releated enumeration translation functions;
619 Move ToOpenFlags here from UnixFile and UnixFileInfo.
620 * UnixMarshal.cs: Missing P/Invoke methods throw
621 EntryPointNotFoundException, not MissingMethodException; add
622 EscapeFormatString, which escapes printf-style format strings so that they
623 can be safely handed off to native code (avoiding stack overflow, etc);
624 make CreateExceptionForError internal.
626 2004-12-15 Jonathan Pryor <jonpryor@vt.edu>
628 * Stdlib.cs: Add more <stdio.h> wrappers, such as fread(3) and fwrite(3).
629 These will be useful in implementing System.IO.Stream subclass for
630 reading/writing to a FILE*. Fix a typo in the realloc(3) DllImport.
631 * Syscall.cs: Fix the sys_kill and sys_crypt declarations.
632 * CdeclFunction.cs: Document calling convention problems on AMD64.
634 2004-11-18 Jonathan Pryor <jonpryor@vt.edu>
636 * CdeclFunction.cs: Added.
637 * Stdlib.cs: Re-add printf(3) and fprintf(3). They may not be portable (the
638 jury is still out on that; the AMD64 SysV ABI looks like it should be
639 portable to AMD64 to my eyes), but they will work on *some* platforms, so
640 we should permit it. The new implementation takes a page out of
641 cocoa-sharp: use System.Reflection.Emit to generate a P/Invoke method at
642 runtime to invoke printf(3) or fprintf(3). This way, we can export a
643 params signature to C# code, permitting natural usage such as:
644 Stdlib.printf ("Hello, %s world! (%i)\n", "silly", 42);
645 * Syscall.cs: Mark which headers are complete, which functions still need
646 wrapping (for headers which have anything done to them), add #region
647 blocks for each header;
648 export mkfifo(3), fexecve(), getppid(2), setlogin(); fix sleep(3) export.
649 * UnixEnvironment.cs: Export a friendly getppid(2) wrapper.
650 GetParentProcessId isn't in UnixProcess as there's no way (that I know of)
651 to get the Parent's Parent, so it can't be a class member, and exposing it
652 as a static member of UnixProcess doesn't make sense to me, as it isn't
653 general. Added GetUserShells().
654 * UnixProcess.cs: Change constructor to internal, so it can be used from
657 2004-11-16 Jonathan Pryor <jonpryor@vt.edu>
659 * Stdlib.cs: Remove printf(3) and fprintf(3). These are vararg/CDECL
660 functions, and it's not portable to call them in this manner.
661 (It's not portable because some architectures, such as AMD64, use a
662 "cookie" as part of the vararg calling sequence to help reduce buffer
663 overflow exploits. Trying to call vararg functions as if they were an
664 overloaded function will not properly set this hardware cookie, resulting
665 in a hardware exception. Talk to lupus for more information.)
667 2004-11-16 Jonathan Pryor <jonpryor@vt.edu>
669 * Syscall.cs, UnixConvert.cs: Remove mount- and umount-related
670 functionality. Mount/umount is inherently non-portable (see the C code
671 for mount/umount), and trying to provide a consistent interface is
672 impossible. If you need mount/umount support, use the command-line
673 programs mount(1) and umount(1).
675 2004-11-16 Jonathan Pryor <jonpryor@vt.edu>
677 + Lots o' Renames, as the namespace changed.
678 * PosixConvert.cs: Moved to UnixConvert.cs:
679 * PosixDirectory.cs: Moved to UnixDirectory.cs:
680 * PosixEnvironment.cs: Moved to UnixEnvironment.cs:
681 * PosixDirectoryInfo.cs: Moved to UnixDirectoryInfo.cs:
682 * PosixFile.cs: Moved to UnixFile.cs:
683 * PosixFileInfo.cs: Moved to UnixFileInfo.cs:
684 * PosixFileSystemInfo.cs: Moved to UnixFileSystemInfo.cs:
685 * PosixGroup.cs: Moved to UnixGroup.cs:
686 * PosixGroupInfo.cs: Moved to UnixGroupInfo.cs:
687 * PosixIOException.cs: Moved to UnixIOException.cs:
688 * PosixMarshal.cs: Moved to UnixMarshal.cs:
689 * PosixProcess.cs: Moved to UnixProcess.cs:
690 * PosixStream.cs: Moved to UnixStream.cs:
691 * PosixSymbolicLinkInfo.cs: Moved to UnixSymbolicLinkInfo.cs:
692 * PosixUser.cs: Moved to UnixUser.cs:
693 * PosixUserInfo.cs: Moved to UnixUserInfo.cs:
694 * Catalog.cs, IncludeAttribute.cs, MapAttribute.cs, PeerCred.cs, Stdlib.cs,
695 Syscall.cs, UnixConvert.cs, UnixDirectory.cs, UnixDirectoryInfo.cs,
696 UnixEndPoint.cs, UnixEnvironment.cs, UnixFile.cs, UnixFileInfo.cs,
697 UnixFileSystemInfo.cs, UnixGroup.cs, UnixGroupInfo.cs, UnixIOException.cs,
698 UnixMarshal.cs, UnixProcess.cs, UnixStream.cs, UnixSymbolicLinkInfo.cs,
699 UnixUser.cs, UnixUserInfo.cs: Deal with renamed classes/members.
701 2004-11-15 Jonathan Pryor <jonpryor@vt.edu>
703 * PosixUserInfo.cs: Make the PosixUserInfo(Passwd) constructor public;
704 override Object.GetHashCode and Object.Equals.
705 * PosixGroupInfo.cs: Make the PosixGroupInfo(Group) constructor public;
706 override Object.GetHashCode and Object.Equals.
707 * PosixIOException.cs: Use PosixMarshal.GetErrorDescription instead of
708 calling Syscall.strerror_r directly
709 * PosixMarshal.cs: Add GetErrorDescription. Strerror_r() isn't portable, so
710 GetErrorDescription() first tries strerror_r(), and if it fails falls back
713 - Seal the Dirent class. It has no virtual members, so there's no point
714 in it being non-sealed. Override Object.GetHashCode and Object.Equals.
715 - Seal the Group class. It has no virtual members, so there's no point
716 in it being non-sealed. Override Object.GetHashCode and Object.Equals.
717 Provide operator== and operator!=.
718 - Seal the Passwd class. It has no virtual members, so there's no point
719 in it being non-sealed. Override Object.GetHashCode and Object.Equals.
720 Provide operator== and operator!=.
721 - Remove strerror_r() convenience overload. This is now
722 PosixMarshal.GetErrorDescription().
724 2004-11-12 Jonathan Pryor <jonpryor@vt.edu>
726 * Syscall.cs: Export time-related functions (gettimeofday, settimeofday,
727 utime, utimes), mknod.
729 2004-11-07 Atsushi Enomoto <atsushi@ximian.com>
731 * PosixEnvironment.cs : csc build fix. see bug #69195.
732 * PosixStream.cs : csc build fix. see bug #69196.
734 2004-11-05 Jonathan Pryor <jonpryor@vt.edu>
736 * PosixConvert.cs: New file; conversion functions for Mono.Posix types.
737 * PosixDirectory.cs: New file; Friendly wrapper over directory information.
738 * PosixDirectoryInfo.cs: New file; Friendly wrapper over directory information.
739 * PosixEnvironment.cs: New file; Friendly wrapper over environment information.
740 * PosixFile.cs: New file; Friendly wrapper over file information.
741 * PosixFileInfo.cs: New file; Friendly wrapper over file information.
742 * PosixFileSystemInfo.cs: New file; Friendly wrapper over `stat'.
743 * PosixGroup.cs: New file; User Group-related functionality
744 * PosixGroupInfo.cs: New file; User Group-related functionality
745 * PosixIOException.cs: New file; Exception for POSIX-generated exceptions.
746 * PosixMarshal.cs: New file; utility functions for marshaling, etc.
747 * PosixProcess.cs: New file; Friendly wrapper over process information.
748 * PosixStream.cs: New file; Friendly wrapper over file descriptors.
749 * PosixSymbolicLinkInfo.cs: New file; Friendly wrapper over symbolic links.
750 * PosixUser.cs: New file; Friendly wrapper over user information.
751 * PosixUserInfo.cs: New file; Friendly wrapper over user information.
752 * Stdlib.cs: New file; C standard library exports.
753 * Syscall.cs: Effective re-write.
754 - Organize exports by header file
755 - add additional enumerations (Error for the E* error values, etc.)
756 - always explicitly specify enumeration underlying type
757 - Use a new wrapping infrastructure so that ABI-stable types are exported
758 - For example, size_t is exported as ulong, not IntPtr.
759 - Wrap more functions, and wrap them better (such as getpwnam).
760 - This release is NOT backward compatible. Many names are the same, and
761 hopefully they're still compatible, but no effort was made to maintain
762 compatibility. For example, FileMode was removed and replaced with
763 FilePermissions, to avoid a name conflict with System.IO.FileMode.
764 - Change umount() to use MonoPosixHelper: portability fix for Mac OS X.
765 * make-map.cs: Another effective re-write, to clean up the code, produce
766 better output, and produce more output. For example, most of
767 PosixConvert can be auto-generated, so it is (modulo version delays and
768 bootstrap issues). `map.c' is now conditional on all macros, and has
769 error checking for invalid/unsupported values.
771 2004-09-18 Jackson Harper <jackson@ximian.com>
773 * Syscall.cs: Add support for poll ().
775 2004-09-18 Jackson Harper <jackson@ximian.com>
777 * make-map.cs: Use field value not name for #defines.
779 2004-09-14 Loren Bandiera <lorenb@mmgsecurity.com>
781 * Syscall.cs: Added method for getpwnam which uses Passwd
783 * macros.c: Helper function for getpwnam
784 (In committing, Josh Tauberer also added getpwuid.)
786 2004-07-09 Dick Porter <dick@ximian.com>
788 * PeerCred.cs: Get the unix socket peer credentials.
790 2004-05-26 Miguel de Icaza <miguel@ximian.com>
792 * Syscall.cs: Do not let the runtime handle strings, as we do not
793 own those strings, we must transform the char * into a string
796 2004-05-03 Miguel de Icaza <miguel@ximian.com>
798 * Syscall.cs: Add symlink
800 2004-04-19 Miguel de Icaza <miguel@ximian.com>
802 * Syscall.cs: Use hex values for FileMode, since C# does not have
803 an octal integer mode.
805 2004-03-30 Joshua Tauberer <tauberer@for.net>
807 * Added readlink, strerror, opendir, readdir, closedir
808 * Added Mono.Posix.Stat.UnixToDateTime(long unixtime) --> DateTime
810 2004-03-11 Joshua Tauberer <tauberer@for.net>
812 * Syscall.cs: Removed argument to getgid that shouldn't be there.
813 Added getusername, getgroupname which wrap getpwuid, getgrgid
814 without dealing with pointers to structures.
815 Removed duplicate FileMode enum nested in Syscall class.
816 Added stat and lstat, which use StatMode enumeration
817 (like FileMode but nicer and complete) and Stat struct.
818 * macros.c: Helper functions for getpwuid, getgrgid, stat, lstat.
820 2004-01-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
822 * Syscall.cs: moved the assembly attribute to a proper place
824 * make-map.cs: use reflection to invoke the properties, as it
825 fails under MS runtime.
828 2004-01-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
830 * Syscall.cs: moved assembly attribute and added unsafe block to fix
831 the build on windows.
833 2003-11-11 Wojciech Polak <polak@gnu.org
835 * Syscall.cs: Applied patch from Wojciech Polak <polak@gnu.org> to
838 2003-05-16 Dick Porter <dick@ximian.com>
840 * UnixEndPoint.cs: New property to get and set the filename, like
841 the IPEndPoint has for the IP address. Also implement ToString().
843 Tue Apr 29 16:53:56 CEST 2003 Paolo Molaro <lupus@ximian.com>
845 * Syscall.cs: remove the unsafe mess.
847 2003-02-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
850 * UnixEndPoint.cs: first file.