edf07c4e27c65d265b32d413606c1e942eda421a
[mono.git] / mcs / class / Mono.Posix / Mono.Unix / ChangeLog
1 2005-02-02  Jonathan Pryor <jonpryor@vt.edu>
2
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.
6
7 2005-02-02  Jonathan Pryor <jonpryor@vt.edu>
8
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.
11
12 2005-01-31  Jonathan Pryor <jonpryor@vt.edu>
13
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.
22
23 2005-01-29  Jonathan Pryor <jonpryor@vt.edu>
24
25         * Stdlib.cs: sys_* functions shouldn't be public.
26
27 2005-01-13  Jonathan Pryor <jonpryor@vt.edu>
28
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.
32
33 2005-01-13  Jonathan Pryor <jonpryor@vt.edu>
34
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.
38
39 2005-01-05  Jonathan Pryor <jonpryor@vt.edu>
40
41         * StdioFileStream.cs: Added; System.IO.Stream wrapper for C FILE struct.
42         * Stdlib.cs: Correct visibility of ftell().
43
44 2005-01-05  Jonathan Pryor <jonpryor@vt.edu>
45
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.
51
52 2005-01-03  Jonathan Pryor <jonpryor@vt.edu>
53
54         * Syscall.cs: Update endfsent() and setfsent() declarations, as these must
55           now be implemented in MonoPosixHelper.
56
57 2005-01-01  Jonathan Pryor <jonpryor@vt.edu>
58
59         * Stdlib.cs, Syscall.cs: Minimize duplicate declarations of
60           "MonoPosixHelper" for use in DllImport statements.
61
62 2005-01-01  Jonathan Pryor <jonpryor@vt.edu>
63
64         * Stdlib.cs: Don't use C# v2 features; fixes build under CSC.EXE.
65
66 2004-12-30  Jonathan Pryor <jonpryor@vt.edu>
67
68         * Stdlib.cs: On miguel's suggestion, rename Sighandler_t to SignalHandler.
69
70 2004-12-30  Jonathan Pryor <jonpryor@vt.edu>
71
72         * Stdlib.cs: Implement all C89 <stdio.h> functions except for the scanf(3)
73           family.  These are too dangerous to expose.
74
75 2004-12-30  Jonathan Pryor <jonpryor@vt.edu>
76
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.
82
83 2004-12-29  Jonathan Pryor <jonpryor@vt.edu>
84
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.
89
90 2004-12-29  Jonathan Pryor <jonpryor@vt.edu>
91
92         * UnixPath.cs: Add check for when symlink points to a full path name.
93
94 2004-12-29  Jonathan Pryor <jonpryor@vt.edu>
95
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.
103
104 2004-12-28  Jonathan Pryor <jonpryor@vt.edu>
105
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...
110
111 2004-12-28  Jonathan Pryor <jonpryor@vt.edu>
112
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: 
129           - Seal the class; 
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
135             "normal" file
136
137 2004-12-28  Jonathan Pryor <jonpryor@vt.edu>
138
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.
152
153 2004-12-15  Jonathan Pryor <jonpryor@vt.edu>
154
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.
160
161 2004-11-18  Jonathan Pryor <jonpryor@vt.edu>
162
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
182           UnixEnvironment.
183
184 2004-11-16  Jonathan Pryor <jonpryor@vt.edu>
185
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.)
193
194 2004-11-16  Jonathan Pryor <jonpryor@vt.edu>
195
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).
201
202 2004-11-16  Jonathan Pryor <jonpryor@vt.edu>
203
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.
227
228 2004-11-15  Jonathan Pryor <jonpryor@vt.edu>
229
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
238           to strerror(3).
239         * Syscall.cs: 
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().
250
251 2004-11-12  Jonathan Pryor <jonpryor@vt.edu>
252
253         * Syscall.cs: Export time-related functions (gettimeofday, settimeofday,
254           utime, utimes), mknod.
255
256 2004-11-07  Atsushi Enomoto  <atsushi@ximian.com>
257
258         * PosixEnvironment.cs : csc build fix. see bug #69195.
259         * PosixStream.cs : csc build fix. see bug #69196.
260
261 2004-11-05  Jonathan Pryor  <jonpryor@vt.edu>
262
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.
297
298 2004-09-18  Jackson Harper  <jackson@ximian.com>
299
300         * Syscall.cs: Add support for poll ().
301
302 2004-09-18  Jackson Harper  <jackson@ximian.com>
303
304         * make-map.cs: Use field value not name for #defines.
305                 
306 2004-09-14  Loren Bandiera <lorenb@mmgsecurity.com>
307
308         * Syscall.cs: Added method for getpwnam which uses Passwd
309         struct.
310         * macros.c: Helper function for getpwnam
311         (In committing, Josh Tauberer also added getpwuid.)
312
313 2004-07-09  Dick Porter  <dick@ximian.com>
314
315         * PeerCred.cs: Get the unix socket peer credentials.
316
317 2004-05-26  Miguel de Icaza  <miguel@ximian.com>
318
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
321         ourselves. 
322
323 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
324
325         * Syscall.cs: Add symlink
326
327 2004-04-19  Miguel de Icaza  <miguel@ximian.com>
328
329         * Syscall.cs: Use hex values for FileMode, since C# does not have
330         an octal integer mode.
331
332 2004-03-30  Joshua Tauberer <tauberer@for.net>
333
334         * Added readlink, strerror, opendir, readdir, closedir
335         * Added Mono.Posix.Stat.UnixToDateTime(long unixtime) --> DateTime
336
337 2004-03-11  Joshua Tauberer <tauberer@for.net>
338
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.
346
347 2004-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
348
349         * Syscall.cs: moved the assembly attribute to a proper place
350         and added 'signal.h'
351         * make-map.cs: use reflection to invoke the properties, as it
352         fails under MS runtime.
353         
354
355 2004-01-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
356
357         * Syscall.cs: moved assembly attribute and added unsafe block to fix
358         the build on windows.
359
360 2003-11-11  Wojciech Polak <polak@gnu.org
361
362         * Syscall.cs: Applied patch from Wojciech Polak <polak@gnu.org> to
363         support IsAtty.
364
365 2003-05-16  Dick Porter  <dick@ximian.com>
366
367         * UnixEndPoint.cs: New property to get and set the filename, like
368         the IPEndPoint has for the IP address.  Also implement ToString().
369
370 Tue Apr 29 16:53:56 CEST 2003 Paolo Molaro <lupus@ximian.com>
371
372         * Syscall.cs: remove the unsafe mess.
373
374 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
375
376         * Check in.
377         * UnixEndPoint.cs: first file.
378