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