You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by bj...@apache.org on 2001/03/19 13:35:17 UTC
cvs commit: apr/threadproc/os2 proc.c thread.c threadpriv.c
bjh 01/03/19 04:35:17
Modified: file_io/os2 dir.c
locks/os2 locks.c
network_io/os2 Makefile.in poll.c
threadproc/os2 proc.c thread.c threadpriv.c
Added: network_io/os2 sendrecv_udp.c
Log:
OS/2: add an assortment of misc helper functions that were missing so
exports.c can safely be linked in. There's also a few stub functions returning
APR_ENOTIMPL.
Revision Changes Path
1.27 +20 -0 apr/file_io/os2/dir.c
Index: dir.c
===================================================================
RCS file: /home/cvs/apr/file_io/os2/dir.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- dir.c 2001/02/16 04:15:35 1.26
+++ dir.c 2001/03/19 12:35:12 1.27
@@ -56,6 +56,7 @@
#include "apr_file_io.h"
#include "apr_lib.h"
#include "apr_strings.h"
+#include "apr_portable.h"
#include <string.h>
static apr_status_t dir_cleanup(void *thedir)
@@ -181,5 +182,24 @@
+apr_status_t apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir)
+{
+ if (dir == NULL) {
+ return APR_ENODIR;
+ }
+ *thedir = &dir->handle;
+ return APR_SUCCESS;
+}
+
+apr_status_t apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir,
+ apr_pool_t *cont)
+{
+ if ((*dir) == NULL) {
+ (*dir) = (apr_dir_t *)apr_pcalloc(cont, sizeof(apr_dir_t));
+ (*dir)->cntxt = cont;
+ }
+ (*dir)->handle = *thedir;
+ return APR_SUCCESS;
+}
1.26 +40 -0 apr/locks/os2/locks.c
Index: locks.c
===================================================================
RCS file: /home/cvs/apr/locks/os2/locks.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- locks.c 2001/02/16 04:15:54 1.25
+++ locks.c 2001/03/19 12:35:13 1.26
@@ -55,6 +55,7 @@
#include "apr_general.h"
#include "apr_lib.h"
#include "apr_strings.h"
+#include "apr_portable.h"
#include "locks.h"
#include "fileio.h"
#include <string.h>
@@ -186,4 +187,43 @@
lock->hMutex = 0;
return APR_OS2_STATUS(rc);
+}
+
+
+
+apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock)
+{
+ *oslock = lock->hMutex;
+ return APR_SUCCESS;
+}
+
+
+
+apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock,
+ apr_pool_t *cont)
+{
+ if (cont == NULL) {
+ return APR_ENOPOOL;
+ }
+ if ((*lock) == NULL) {
+ (*lock) = (apr_lock_t *)apr_pcalloc(cont, sizeof(apr_lock_t));
+ (*lock)->cntxt = cont;
+ }
+ (*lock)->hMutex = *thelock;
+ return APR_SUCCESS;
+}
+
+
+
+apr_status_t apr_lock_data_get(apr_lock_t *lock, const char *key, void *data)
+{
+ return apr_pool_userdata_get(data, key, lock->cntxt);
+}
+
+
+
+apr_status_t apr_lock_data_set(apr_lock_t *lock, void *data, const char *key,
+ apr_status_t (*cleanup) (void *))
+{
+ return apr_pool_userdata_set(data, key, cleanup, lock->cntxt);
}
1.16 +1 -0 apr/network_io/os2/Makefile.in
Index: Makefile.in
===================================================================
RCS file: /home/cvs/apr/network_io/os2/Makefile.in,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- Makefile.in 2001/01/09 11:06:07 1.15
+++ Makefile.in 2001/03/19 12:35:14 1.16
@@ -2,6 +2,7 @@
TARGETS = \
poll.lo \
sendrecv.lo \
+ sendrecv_udp.lo \
sockets.lo \
sockopt.lo \
sockaddr.lo \
1.22 +26 -0 apr/network_io/os2/poll.c
Index: poll.c
===================================================================
RCS file: /home/cvs/apr/network_io/os2/poll.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- poll.c 2001/02/16 04:16:01 1.21
+++ poll.c 2001/03/19 12:35:14 1.22
@@ -222,3 +222,29 @@
{
return apr_poll_socket_mask(aprset, sock, APR_POLLIN|APR_POLLOUT|APR_POLLPRI);
}
+
+
+
+apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events)
+{
+ aprset->num_read = 0;
+ aprset->num_write = 0;
+ aprset->num_except = 0;
+ aprset->num_total = 0;
+ return APR_SUCCESS;
+}
+
+
+
+apr_status_t apr_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data)
+{
+ return apr_pool_userdata_get(data, key, pollfd->cntxt);
+}
+
+
+
+apr_status_t apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key,
+ apr_status_t (*cleanup) (void *))
+{
+ return apr_pool_userdata_set(data, key, cleanup, pollfd->cntxt);
+}
1.1 apr/network_io/os2/sendrecv_udp.c
Index: sendrecv_udp.c
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
#include "networkio.h"
#include "apr_errno.h"
#include "apr_general.h"
#include "apr_network_io.h"
#include "apr_lib.h"
#include <sys/time.h>
apr_status_t apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where,
apr_int32_t flags, const char *buf, apr_size_t *len)
{
return APR_ENOTIMPL;
}
apr_status_t apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock,
apr_int32_t flags, char *buf,
apr_size_t *len)
{
return APR_ENOTIMPL;
}
1.41 +7 -0 apr/threadproc/os2/proc.c
Index: proc.c
===================================================================
RCS file: /home/cvs/apr/threadproc/os2/proc.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- proc.c 2001/02/18 12:02:31 1.40
+++ proc.c 2001/03/19 12:35:15 1.41
@@ -554,3 +554,10 @@
*theproc = proc->pid;
return APR_SUCCESS;
}
+
+
+
+apr_status_t apr_proc_detach()
+{
+ return APR_ENOTIMPL;
+}
1.20 +36 -0 apr/threadproc/os2/thread.c
Index: thread.c
===================================================================
RCS file: /home/cvs/apr/threadproc/os2/thread.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- thread.c 2001/02/16 04:16:17 1.19
+++ thread.c 2001/03/19 12:35:15 1.20
@@ -58,6 +58,7 @@
#include "apr_thread_proc.h"
#include "apr_general.h"
#include "apr_lib.h"
+#include "apr_portable.h"
#include "fileio.h"
#include <stdlib.h>
@@ -182,3 +183,38 @@
}
+
+apr_status_t apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd)
+{
+ *thethd = &thd->tid;
+ return APR_SUCCESS;
+}
+
+
+
+apr_status_t apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd,
+ apr_pool_t *cont)
+{
+ if ((*thd) == NULL) {
+ (*thd) = (apr_thread_t *)apr_pcalloc(cont, sizeof(apr_thread_t));
+ (*thd)->cntxt = cont;
+ }
+ (*thd)->tid = *thethd;
+ return APR_SUCCESS;
+}
+
+
+
+apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread)
+{
+ return apr_pool_userdata_get(data, key, thread->cntxt);
+}
+
+
+
+apr_status_t apr_thread_data_set(void *data, const char *key,
+ apr_status_t (*cleanup) (void *),
+ apr_thread_t *thread)
+{
+ return apr_pool_userdata_set(data, key, cleanup, thread->cntxt);
+}
1.15 +33 -0 apr/threadproc/os2/threadpriv.c
Index: threadpriv.c
===================================================================
RCS file: /home/cvs/apr/threadproc/os2/threadpriv.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- threadpriv.c 2001/02/16 04:16:17 1.14
+++ threadpriv.c 2001/03/19 12:35:16 1.15
@@ -54,6 +54,7 @@
#include "threadproc.h"
#include "apr_thread_proc.h"
+#include "apr_portable.h"
#include "apr_general.h"
#include "apr_errno.h"
#include "apr_lib.h"
@@ -89,3 +90,35 @@
return APR_OS2_STATUS(DosFreeThreadLocalMemory(key->key));
}
+apr_status_t apr_threadkey_data_get(void **data, const char *key,
+ apr_threadkey_t *threadkey)
+{
+ return apr_pool_userdata_get(data, key, threadkey->cntxt);
+}
+
+apr_status_t apr_threadkey_data_set(void *data, const char *key,
+ apr_status_t (*cleanup) (void *),
+ apr_threadkey_t *threadkey)
+{
+ return apr_pool_userdata_set(data, key, cleanup, threadkey->cntxt);
+}
+
+apr_status_t apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key)
+{
+ *thekey = key->key;
+ return APR_SUCCESS;
+}
+
+apr_status_t apr_os_threadkey_put(apr_threadkey_t **key,
+ apr_os_threadkey_t *thekey, apr_pool_t *cont)
+{
+ if (cont == NULL) {
+ return APR_ENOPOOL;
+ }
+ if ((*key) == NULL) {
+ (*key) = (apr_threadkey_t *)apr_pcalloc(cont, sizeof(apr_threadkey_t));
+ (*key)->cntxt = cont;
+ }
+ (*key)->key = *thekey;
+ return APR_SUCCESS;
+}