bjh 01/06/15 18:27:16
Modified: file_io/os2 seek.c
threadproc/os2 thread.c
Log:
OS/2: Add implementations of apr_file_trunc(), apr_os_thread_current() &
apr_os_thread_equal().
Revision Changes Path
1.16 +17 -0 apr/file_io/os2/seek.c
Index: seek.c
===================================================================
RCS file: /home/cvs/apr/file_io/os2/seek.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- seek.c 2001/02/16 04:15:35 1.15
+++ seek.c 2001/06/16 01:27:14 1.16
@@ -131,3 +131,20 @@
return APR_OS2_STATUS(DosSetFilePtr(thefile->filedes, *offset,
where, (ULONG *)&offset));
}
}
+
+
+
+apr_status_t apr_file_trunc(apr_file_t *fp, apr_off_t offset)
+{
+ int rc = DosSetFileSize(fp->filedes, offset);
+
+ if (rc != 0) {
+ return APR_OS2_STATUS(rc);
+ }
+
+ if (fp->buffered) {
+ return setptr(fp, offset);
+ }
+
+ return APR_SUCCESS;
+}
1.22 +17 -0 apr/threadproc/os2/thread.c
Index: thread.c
===================================================================
RCS file: /home/cvs/apr/threadproc/os2/thread.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- thread.c 2001/04/11 02:01:21 1.21
+++ thread.c 2001/06/16 01:27:15 1.22
@@ -148,6 +148,16 @@
+apr_os_thread_t apr_os_thread_current()
+{
+ PIB *ppib;
+ TIB *ptib;
+ DosGetInfoBlocks(&ptib, &ppib);
+ return ptib->tib_ptib2->tib2_ultid;
+}
+
+
+
apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval)
{
thd->rv = retval;
@@ -201,6 +211,13 @@
}
(*thd)->tid = *thethd;
return APR_SUCCESS;
+}
+
+
+
+int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2)
+{
+ return tid1 == tid2;
}