Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Pryor <jpryor@novell.com>2005-01-13 16:58:33 +0300
committerJonathan Pryor <jpryor@novell.com>2005-01-13 16:58:33 +0300
commit830e86dd5610c2435e0ba7fa881cff75de0f1dcd (patch)
tree0ad83ddaf38a3880e21f70d256179e9f1547dc2a /mcs/class/Mono.Posix
parentcc54e322fab062568a95ef2045506e48535f9aa5 (diff)
* Stdlib.cs: Use Stdlib.LIBC instead of "libc".
* StdioFileStream.cs: Add FilePosition property (not that I expect anyone to use it) and Rewind() method. svn path=/trunk/mcs/; revision=38870
Diffstat (limited to 'mcs/class/Mono.Posix')
-rw-r--r--mcs/class/Mono.Posix/Mono.Unix/ChangeLog6
-rw-r--r--mcs/class/Mono.Posix/Mono.Unix/StdioFileStream.cs20
-rw-r--r--mcs/class/Mono.Posix/Mono.Unix/Stdlib.cs8
3 files changed, 30 insertions, 4 deletions
diff --git a/mcs/class/Mono.Posix/Mono.Unix/ChangeLog b/mcs/class/Mono.Posix/Mono.Unix/ChangeLog
index 538045fe495..c67c572ae38 100644
--- a/mcs/class/Mono.Posix/Mono.Unix/ChangeLog
+++ b/mcs/class/Mono.Posix/Mono.Unix/ChangeLog
@@ -1,3 +1,9 @@
+2005-01-13 Jonathan Pryor <jonpryor@vt.edu>
+
+ * Stdlib.cs: Use Stdlib.LIBC instead of "libc".
+ * StdioFileStream.cs: Add FilePosition property (not that I expect anyone to
+ use it) and Rewind() method.
+
2005-01-05 Jonathan Pryor <jonpryor@vt.edu>
* StdioFileStream.cs: Added; System.IO.Stream wrapper for C FILE struct.
diff --git a/mcs/class/Mono.Posix/Mono.Unix/StdioFileStream.cs b/mcs/class/Mono.Posix/Mono.Unix/StdioFileStream.cs
index 7f2d04ebf5e..23c1f3c53e6 100644
--- a/mcs/class/Mono.Posix/Mono.Unix/StdioFileStream.cs
+++ b/mcs/class/Mono.Posix/Mono.Unix/StdioFileStream.cs
@@ -123,6 +123,21 @@ namespace Mono.Unix {
}
}
+ public FilePosition FilePosition {
+ get {
+ FilePosition pos = new FilePosition ();
+ int r = Stdlib.fgetpos (file, pos);
+ UnixMarshal.ThrowExceptionForLastErrorIf (r);
+ return pos;
+ }
+ set {
+ if (value == null)
+ throw new ArgumentNullException ("value");
+ int r = Stdlib.fsetpos (file, value);
+ UnixMarshal.ThrowExceptionForLastErrorIf (r);
+ }
+ }
+
public override void Flush ()
{
int r = Stdlib.fflush (file);
@@ -164,6 +179,11 @@ namespace Mono.Unix {
throw new ArgumentException ("would overrun buffer");
}
+ public void Rewind ()
+ {
+ Stdlib.rewind (file);
+ }
+
public override long Seek (long offset, SeekOrigin origin)
{
AssertNotDisposed ();
diff --git a/mcs/class/Mono.Posix/Mono.Unix/Stdlib.cs b/mcs/class/Mono.Posix/Mono.Unix/Stdlib.cs
index b57f5b633f3..37d894c4bc7 100644
--- a/mcs/class/Mono.Posix/Mono.Unix/Stdlib.cs
+++ b/mcs/class/Mono.Posix/Mono.Unix/Stdlib.cs
@@ -97,17 +97,17 @@ namespace Mono.Unix {
static XPrintfFunctions ()
{
- CdeclFunction _printf = new CdeclFunction ("libc", "printf", typeof(int));
+ CdeclFunction _printf = new CdeclFunction (Stdlib.LIBC, "printf", typeof(int));
printf = new XPrintf (_printf.Invoke);
- CdeclFunction _fprintf = new CdeclFunction ("libc", "fprintf", typeof(int));
+ CdeclFunction _fprintf = new CdeclFunction (Stdlib.LIBC, "fprintf", typeof(int));
fprintf = new XPrintf (_fprintf.Invoke);
- CdeclFunction _snprintf = new CdeclFunction ("MonoPosixHelper",
+ CdeclFunction _snprintf = new CdeclFunction (Stdlib.MPH,
"Mono_Posix_Stdlib_snprintf", typeof(int));
snprintf = new XPrintf (_snprintf.Invoke);
- CdeclFunction _syslog = new CdeclFunction ("libc", "syslog", typeof(void));
+ CdeclFunction _syslog = new CdeclFunction (Stdlib.LIBC, "syslog", typeof(void));
syslog = new XPrintf (_syslog.Invoke);
}
}