From cvs-return-1448-apmail-apr-cvs-archive=apr.apache.org@apr.apache.org Sat Jun 16 01:27:20 2001 Return-Path: Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 68003 invoked by uid 500); 16 Jun 2001 01:27:17 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 67991 invoked by uid 1095); 16 Jun 2001 01:27:16 -0000 Date: 16 Jun 2001 01:27:16 -0000 Message-ID: <20010616012716.67990.qmail@apache.org> From: bjh@apache.org To: apr-cvs@apache.org Subject: cvs commit: apr/threadproc/os2 thread.c 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; }