You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by dl...@apache.org on 2006/06/30 15:45:33 UTC

svn commit: r418279 - /incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/portable_libc.c

Author: dlydick
Date: Fri Jun 30 06:45:32 2006
New Revision: 418279

URL: http://svn.apache.org/viewvc?rev=418279&view=rev
Log:
Added portable_lseek() function.

Modified:
    incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/portable_libc.c

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/portable_libc.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/portable_libc.c?rev=418279&r1=418278&r2=418279&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/portable_libc.c (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/portable_libc.c Fri Jun 30 06:45:32 2006
@@ -267,14 +267,44 @@
 
 
 /*!
+ * @brief Portable replacement for @c @b lseek(2) system call
+ *
+ *
+ * @param[in]  fildes  Integer file handle of open file.
+ *
+ * @param[in]  offset  Offset in bytes of distance into file.
+ *
+ * @param[in]  whence  Seek mode-- SEEK_SET, SEEK_CUR, SEEK_END.
+ *
+ *
+ * @returns Requested offset into file or -1 with @c @b errno set
+ *          to report the error that occurred.
+ *
+ */
+rlong portable_lseek(rint fildes, rlong offset, rint whence)
+{
+    ARCH_FUNCTION_NAME(portable_lseek);
+
+    int   fildeslocal = (int)   fildes;
+    off_t offsetlocal = (off_t) offset;
+    int   whencelocal = (int)   whence;
+
+    long rc = lseek(fildeslocal, offsetlocal, whencelocal);
+
+    return((rlong) rc);
+
+} /* END of portable_lseek() */
+
+
+/*!
  * @brief Portable replacement for @c @b read(2) system call
  *
  *
- * @param[in] fildes  Integer file handle of open file.
+ * @param[in]  fildes  Integer file handle of open file.
  *
- * @param[out] buf    Location to store data read in.
+ * @param[out] buf     Location to store data read in.
  *
- * @param[in] nbyte   Number of bytes to read.
+ * @param[in]  nbyte   Number of bytes to read.
  *
  *
  * @returns Number of bytes read or -1 with @c @b errno set