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