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