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