rbb 99/04/30 11:38:59
Modified: apr/file_io/unix Makefile fileio.h open.c apr/network_io/unix Makefile poll.c sendrecv.c sockets.c sockopt.c apr/test Makefile client.c server.c testfile.c testsock.c apr/threadproc/unix proc.c docs fileio.txt networkio.txt include apr_file_io.h apr_network_io.h apr_thread_proc.h Log: Changes to use context's in network functions, and process functions. Also updated the test programs. Revision Changes Path 1.8 +1 -1 apache-apr/apr/file_io/unix/Makefile Index: Makefile =================================================================== RCS file: /home/cvs/apache-apr/apr/file_io/unix/Makefile,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- Makefile 1999/04/20 20:46:40 1.7 +++ Makefile 1999/04/30 18:38:50 1.8 @@ -17,7 +17,7 @@ EXTRA_DEPS= OSDIR= INCDIR=../../../include -INCLUDES0=-I . -I $(INCDIR) +INCLUDES0=-I ../../include -I . -I $(INCDIR) SHELL=/bin/sh CC=gcc CPP=gcc -E 1.3 +1 -1 apache-apr/apr/file_io/unix/fileio.h Index: fileio.h =================================================================== RCS file: /home/cvs/apache-apr/apr/file_io/unix/fileio.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- fileio.h 1999/04/30 15:19:51 1.2 +++ fileio.h 1999/04/30 18:38:50 1.3 @@ -99,7 +99,7 @@ typedef struct dirent dirent_t; typedef struct iovec iovec_t; -apr_status_t file_cleanup(struct file_t *); +apr_status_t file_cleanup(void *); #endif /* ! FILE_IO_H */ 1.15 +3 -1 apache-apr/apr/file_io/unix/open.c Index: open.c =================================================================== RCS file: /home/cvs/apache-apr/apr/file_io/unix/open.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- open.c 1999/04/30 15:19:51 1.14 +++ open.c 1999/04/30 18:38:51 1.15 @@ -55,11 +55,13 @@ #include "apr_file_io.h" #include "apr_general.h" +#include "apr_lib.h" #include <errno.h> #include <string.h> -apr_status_t file_cleanup(apr_file_t *file) +apr_status_t file_cleanup(void *thefile) { + apr_file_t *file = thefile; if (close(file->filedes) == 0) { file->filedes = -1; return APR_SUCCESS; 1.6 +1 -1 apache-apr/apr/network_io/unix/Makefile Index: Makefile =================================================================== RCS file: /home/cvs/apache-apr/apr/network_io/unix/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Makefile 1999/04/28 16:00:05 1.5 +++ Makefile 1999/04/30 18:38:52 1.6 @@ -17,7 +17,7 @@ EXTRA_DEPS= OSDIR= INCDIR=../../../include -INCLUDES0=-I . -I $(INCDIR) +INCLUDES0=-I ../../include -I . -I $(INCDIR) SHELL=/bin/sh CC=gcc CPP=gcc -E 1.2 +8 -5 apache-apr/apr/network_io/unix/poll.c Index: poll.c =================================================================== RCS file: /home/cvs/apache-apr/apr/network_io/unix/poll.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- poll.c 1999/04/28 16:00:06 1.1 +++ poll.c 1999/04/30 18:38:52 1.2 @@ -59,21 +59,24 @@ #include <errno.h> #include <sys/poll.h> -apr_int32_t apr_poll(apr_pollfd_t *aprset, apr_int32_t nsds, apr_int32_t timeout) +apr_int32_t apr_poll(apr_context_t *cont, apr_pollfd_t *aprset, apr_int32_t nsds, apr_int32_t timeout) { int i; struct pollfd *pollset; - pollset = (struct pollfd *)malloc(sizeof(struct pollfd) * nsds); + int rv; + pollset = (struct pollfd *)apr_palloc(cont->pool, sizeof(struct pollfd) * nsds); + for (i = 0; i < nsds; i++) { pollset[i].fd = aprset[i].sock->socketdes; pollset[i].events = aprset[i].events; } - poll(pollset, nsds, timeout); + rv = poll(pollset, nsds, timeout); for (i = 0; i < nsds; i++) { pollset[i].revents = aprset[i].revents; } - -} + return rv; +} + 1.5 +2 -2 apache-apr/apr/network_io/unix/sendrecv.c Index: sendrecv.c =================================================================== RCS file: /home/cvs/apache-apr/apr/network_io/unix/sendrecv.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- sendrecv.c 1999/04/19 13:31:39 1.4 +++ sendrecv.c 1999/04/30 18:38:52 1.5 @@ -60,7 +60,7 @@ #include "apr_network_io.h" #include <sys/time.h> -apr_ssize_t apr_send(apr_socket_t *sock, const char *buf, int len, time_t sec) +apr_ssize_t apr_send(apr_context_t *cont, apr_socket_t *sock, const char *buf, int len, time_t sec) { ssize_t rv; @@ -94,7 +94,7 @@ return (apr_ssize_t) rv; } -apr_ssize_t apr_recv(apr_socket_t *sock, char *buf, int len, time_t sec) +apr_ssize_t apr_recv(apr_context_t *cont, apr_socket_t *sock, char *buf, int len, time_t sec) { ssize_t rv; 1.12 +30 -30 apache-apr/apr/network_io/unix/sockets.c Index: sockets.c =================================================================== RCS file: /home/cvs/apache-apr/apr/network_io/unix/sockets.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- sockets.c 1999/04/28 14:30:23 1.11 +++ sockets.c 1999/04/30 18:38:52 1.12 @@ -55,6 +55,7 @@ #include "apr_network_io.h" #include "apr_general.h" +#include "apr_lib.h" #include <errno.h> #include <string.h> #include <sys/socket.h> @@ -62,29 +63,40 @@ #include <netinet/in.h> #include <netdb.h> -apr_socket_t *apr_create_tcp_socket(void) +apr_status_t socket_cleanup(void *sock) { - apr_socket_t *thesocket = (apr_socket_t *)malloc(sizeof(apr_socket_t)); + apr_socket_t *thesocket = sock; + if (close(thesocket->socketdes) == 0) { + thesocket->socketdes = -1; + return APR_SUCCESS; + } + else { + return APR_FAILURE; + } +} + +apr_socket_t *apr_create_tcp_socket(apr_context_t *cont) +{ + apr_socket_t *thesocket = (apr_socket_t *)apr_palloc(cont->pool, sizeof(apr_socket_t)); thesocket->socketdes = socket(AF_INET ,SOCK_STREAM, IPPROTO_TCP); thesocket->remote_hostname = NULL; - thesocket->addr = (struct sockaddr_in *)malloc(sizeof(struct sockaddr_in)); + thesocket->addr = (struct sockaddr_in *)apr_palloc(cont->pool, sizeof(struct sockaddr_in)); thesocket->addr->sin_family = AF_INET; thesocket->addr_len = sizeof(*thesocket->addr); if (thesocket->socketdes < 0) { - free(thesocket->addr); - free(thesocket); return NULL; } else { + apr_register_cleanup(cont->pool, (void *)thesocket, socket_cleanup, NULL); return thesocket; } } -apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) +apr_status_t apr_shutdown(apr_context_t *cont, apr_socket_t *thesocket, apr_shutdown_how_e how) { if (shutdown(thesocket->socketdes, how) == 0) { return APR_SUCCESS; @@ -94,26 +106,19 @@ } } -apr_status_t apr_close_socket(apr_socket_t *thesocket) +apr_status_t apr_close_socket(apr_context_t *cont, apr_socket_t *thesocket) { - if (close(thesocket->socketdes) == 0) { - free(thesocket->addr); - free(thesocket->remote_hostname); - free(thesocket); - return APR_SUCCESS; - } - else { - return APR_FAILURE; - } + socket_cleanup(thesocket); + apr_kill_cleanup(cont->pool, thesocket, socket_cleanup); } -apr_status_t apr_setport(apr_socket_t *sock, apr_uint32_t port) +apr_status_t apr_setport(apr_context_t *cont, apr_socket_t *sock, apr_uint32_t port) { sock->addr->sin_port = htons((short)port); return APR_SUCCESS; } -apr_status_t apr_bind(apr_socket_t *sock) +apr_status_t apr_bind(apr_context_t *cont, apr_socket_t *sock) { sock->addr->sin_addr.s_addr = INADDR_ANY; if (bind(sock->socketdes, (struct sockaddr *)sock->addr, sock->addr_len) == -1) @@ -122,7 +127,7 @@ return APR_SUCCESS; } -apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) +apr_status_t apr_listen(apr_context_t *cont, apr_socket_t *sock, apr_int32_t backlog) { if (listen(sock->socketdes, backlog) == -1) return APR_FAILURE; @@ -130,39 +135,36 @@ return APR_SUCCESS; } -apr_socket_t *apr_accept(const apr_socket_t *sock) +apr_socket_t *apr_accept(apr_context_t *cont, const apr_socket_t *sock) { - apr_socket_t *new = (apr_socket_t *)malloc(sizeof(apr_socket_t)); + apr_socket_t *new = (apr_socket_t *)apr_palloc(cont->pool, sizeof(apr_socket_t)); struct hostent *hptr; - new->addr = (struct sockaddr_in *)malloc(sizeof(struct sockaddr_in)); + new->addr = (struct sockaddr_in *)apr_palloc(cont->pool, sizeof(struct sockaddr_in)); new->addr_len = sizeof(struct sockaddr_in); new->socketdes = accept(sock->socketdes, (struct sockaddr *)new->addr, &new->addr_len); if (new->socketdes < 0) { - free(new->addr); - free(new); return NULL; } -hptr = gethostbyaddr((char *)&new->addr->sin_addr, sizeof(struct in_addr), AF_INET); + hptr = gethostbyaddr((char *)&new->addr->sin_addr, sizeof(struct in_addr), AF_INET); if (hptr != NULL) { new->remote_hostname = strdup(hptr->h_name); } + apr_register_cleanup(cont->pool, (void *)new, socket_cleanup, NULL); return new; } -apr_status_t apr_connect(apr_socket_t *sock, char *hostname) +apr_status_t apr_connect(apr_context_t *cont, apr_socket_t *sock, char *hostname) { struct hostent *hp; hp = gethostbyname(hostname); if ((sock->socketdes < 0) || (!hp) || (!sock->addr)) { - free(sock->addr); - free(sock); return APR_FAILURE; } @@ -174,8 +176,6 @@ if ((connect(sock->socketdes, sock->addr, sock->addr_len) < 0) && (errno != EINPROGRESS)) { - free(sock->addr); - free(sock); return APR_FAILURE; } else { 1.3 +3 -3 apache-apr/apr/network_io/unix/sockopt.c Index: sockopt.c =================================================================== RCS file: /home/cvs/apache-apr/apr/network_io/unix/sockopt.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- sockopt.c 1999/04/15 20:08:17 1.2 +++ sockopt.c 1999/04/30 18:38:52 1.3 @@ -100,7 +100,7 @@ } -apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) +apr_status_t apr_setsocketopt(apr_context_t *cont, apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) { int one; struct linger li; @@ -145,7 +145,7 @@ return APR_SUCCESS; } -apr_status_t apr_gethostname(char *buf, int len) +apr_status_t apr_gethostname(apr_context_t *cont, char *buf, int len) { if (gethostname(buf, len) == -1) return APR_FAILURE; @@ -153,7 +153,7 @@ return APR_SUCCESS; } -char *apr_get_remote_hostname(apr_socket_t *sock) +char *apr_get_remote_hostname(apr_context_t *cont, apr_socket_t *sock) { return sock->remote_hostname; } 1.9 +1 -1 apache-apr/apr/test/Makefile Index: Makefile =================================================================== RCS file: /home/cvs/apache-apr/apr/test/Makefile,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- Makefile 1999/04/30 15:19:58 1.8 +++ Makefile 1999/04/30 18:38:53 1.9 @@ -12,7 +12,7 @@ SRCDIR=.. EXTRA_CFLAGS=-g EXTRA_LDFLAGS= -EXTRA_LIBS=-L../misc -laprmisc -L../lib -lapr -L../misc -laprmisc -L../threadproc -lthreadproc -L../file_io -lfile -L../network_io -lnetwork +EXTRA_LIBS=-L../misc -laprmisc -L../lib -lapr -L../threadproc -lthreadproc -L../file_io -lfile -L../network_io -lnetwork EXTRA_INCLUDES= EXTRA_DEPS= OSDIR= 1.3 +18 -15 apache-apr/apr/test/client.c Index: client.c =================================================================== RCS file: /home/cvs/apache-apr/apr/test/client.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- client.c 1999/04/28 16:00:08 1.2 +++ client.c 1999/04/30 18:38:54 1.3 @@ -66,74 +66,77 @@ int main(int argc, char *argv[]) { + apr_context_t *context; apr_socket_t *sock; apr_int32_t rv; struct timeval timeout; char datasend[STRLEN] = "Send data test"; char datarecv[STRLEN]; + context = apr_initialize(NULL); + fprintf(stdout, "\tClient: Creating new socket......."); - if ((sock = apr_create_tcp_socket()) == NULL) { + if ((sock = apr_create_tcp_socket(context)) == NULL) { fprintf(stderr, "Couldn't create socket\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tClient: Setting socket option NONBLOCK......."); - if (apr_setsocketopt(sock, APR_SO_NONBLOCK, 1) == APR_FAILURE) { - apr_close_socket(sock); + if (apr_setsocketopt(context, sock, APR_SO_NONBLOCK, 1) == APR_FAILURE) { + apr_close_socket(context, sock); fprintf(stderr, "Couldn't set socket option\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tClient: Setting port for socket......."); - if (apr_setport(sock, 8021) == APR_FAILURE) { - apr_close_socket(sock); + if (apr_setport(context, sock, 8021) == APR_FAILURE) { + apr_close_socket(context, sock); fprintf(stderr, "Couldn't set the port correctly\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tClient: Connecting to socket......."); - if (apr_connect(sock, "localhost") == APR_FAILURE) { - apr_close_socket(sock); + if (apr_connect(context, sock, "localhost") == APR_FAILURE) { + apr_close_socket(context, sock); fprintf(stderr, "Could not connect\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tClient: Trying to send data over socket......."); - if (apr_send(sock, datasend, STRLEN, 5) != STRLEN) { - apr_close_socket(sock); + if (apr_send(context, sock, datasend, STRLEN, 5) != STRLEN) { + apr_close_socket(context, sock); fprintf(stderr, "Problem sending data\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tClient: Trying to receive data over socket......."); - if (apr_recv(sock, datarecv, STRLEN, 5) != STRLEN) { - apr_close_socket(sock); + if (apr_recv(context, sock, datarecv, STRLEN, 5) != STRLEN) { + apr_close_socket(context, sock); fprintf(stderr, "Problem receiving data\n"); exit(-1); } if (strcmp(datarecv, "Recv data test")) { - apr_close_socket(sock); + apr_close_socket(context, sock); fprintf(stderr, "I did not receive the correct data %s\n", datarecv); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tClient: Shutting down socket......."); - if (apr_shutdown(sock, APR_SHUTDOWN_WRITE) == APR_FAILURE) { - apr_close_socket(sock); + if (apr_shutdown(context, sock, APR_SHUTDOWN_WRITE) == APR_FAILURE) { + apr_close_socket(context, sock); fprintf(stderr, "Could not shutdown socket\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tClient: Closing down socket......."); - if (apr_close_socket(sock) == APR_FAILURE) { + if (apr_close_socket(context, sock) == APR_FAILURE) { fprintf(stderr, "Could not shutdown socket\n"); exit(-1); } 1.3 +32 -29 apache-apr/apr/test/server.c Index: server.c =================================================================== RCS file: /home/cvs/apache-apr/apr/test/server.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- server.c 1999/04/28 16:00:08 1.2 +++ server.c 1999/04/30 18:38:54 1.3 @@ -66,6 +66,7 @@ int main(int argc, char *argv[]) { + apr_context_t *context; apr_socket_t *sock; apr_socket_t *sock2; apr_int32_t rv; @@ -73,40 +74,42 @@ char datasend[STRLEN]; char datarecv[STRLEN] = "Recv data test"; + context = apr_initialize(NULL); + fprintf(stdout, "\tServer: Creating new socket......."); - if ((sock = apr_create_tcp_socket()) == NULL) { + if ((sock = apr_create_tcp_socket(context)) == NULL) { fprintf(stderr, "Couldn't create socket\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Setting socket option NONBLOCK......."); - if (apr_setsocketopt(sock, APR_SO_NONBLOCK, 1) == APR_FAILURE) { - apr_close_socket(sock); + if (apr_setsocketopt(context, sock, APR_SO_NONBLOCK, 1) == APR_FAILURE) { + apr_close_socket(context, sock); fprintf(stderr, "Couldn't set socket option\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Setting port for socket......."); - if (apr_setport(sock, 8021) == APR_FAILURE) { - apr_close_socket(sock); + if (apr_setport(context, sock, 8021) == APR_FAILURE) { + apr_close_socket(context, sock); fprintf(stderr, "Couldn't set the port correctly\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Binding socket to port......."); - if (apr_bind(sock) == APR_FAILURE) { - apr_close_socket(sock); + if (apr_bind(context, sock) == APR_FAILURE) { + apr_close_socket(context, sock); fprintf(stderr, "Could not bind %d\n", errno); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Listening to socket......."); - if (apr_listen(sock, 8021) == APR_FAILURE) { - apr_close_socket(sock); + if (apr_listen(context, sock, 8021) == APR_FAILURE) { + apr_close_socket(context, sock); fprintf(stderr, "Could not listen\n"); exit(-1); } @@ -117,71 +120,71 @@ sdset.events = APR_POLLIN; fprintf(stdout, "OK\n"); - fprintf(stdout, "\tServer: Beginning to select on socket......."); - rv = apr_poll(&sdset, 1, 0); + fprintf(stdout, "\tServer: Beginning to poll for socket......."); + rv = apr_poll(context, &sdset, 1, -1); if (rv == -1) { - apr_close_socket(sock); + apr_close_socket(context, sock); fprintf(stderr, "Select caused an error\n"); exit(-1); } else if (rv == 0) { - apr_close_socket(sock); + apr_close_socket(context, sock); fprintf(stderr, "I should not return until rv == 1\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Accepting a connection......."); - if ((sock2 = apr_accept(sock)) == NULL) { - apr_close_socket(sock); + if ((sock2 = apr_accept(context, sock)) == NULL) { + apr_close_socket(context, sock); fprintf(stderr, "Could not accept connection.\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Trying to recv data from socket......."); - if (apr_recv(sock2, datasend, STRLEN, 5) != STRLEN) { - apr_close_socket(sock); - apr_close_socket(sock2); + if (apr_recv(context, sock2, datasend, STRLEN, 5) != STRLEN) { + apr_close_socket(context, sock); + apr_close_socket(context, sock2); fprintf(stderr, "Problem recving data\n"); exit(-1); } if (strcmp(datasend, "Send data test")) { - apr_close_socket(sock); - apr_close_socket(sock2); + apr_close_socket(context, sock); + apr_close_socket(context, sock2); fprintf(stderr, "I did not receive the correct data %s\n", datarecv); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Sending data over socket......."); - if (apr_send(sock2, datarecv, STRLEN, 5) != STRLEN) { - apr_close_socket(sock); - apr_close_socket(sock2); + if (apr_send(context, sock2, datarecv, STRLEN, 5) != STRLEN) { + apr_close_socket(context, sock); + apr_close_socket(context, sock2); fprintf(stderr, "Problem sending data\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Shutting down accepte socket......."); - if (apr_shutdown(sock2, APR_SHUTDOWN_READ) == APR_FAILURE) { - apr_close_socket(sock); - apr_close_socket(sock2); + if (apr_shutdown(context, sock2, APR_SHUTDOWN_READ) == APR_FAILURE) { + apr_close_socket(context, sock); + apr_close_socket(context, sock2); fprintf(stderr, "Problem shutting down\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: closing duplicate socket......."); - if (apr_close_socket(sock2) == APR_FAILURE) { - apr_close_socket(sock); + if (apr_close_socket(context, sock2) == APR_FAILURE) { + apr_close_socket(context, sock); fprintf(stderr, "Problem closing down\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: closing original socket......."); - if (apr_close_socket(sock) == APR_FAILURE) { + if (apr_close_socket(context, sock) == APR_FAILURE) { fprintf(stderr, "Problem closing down\n"); exit(-1); } 1.13 +1 -0 apache-apr/apr/test/testfile.c Index: testfile.c =================================================================== RCS file: /home/cvs/apache-apr/apr/test/testfile.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- testfile.c 1999/04/30 15:19:58 1.12 +++ testfile.c 1999/04/30 18:38:54 1.13 @@ -175,6 +175,7 @@ } testdirs(context); + test_filedel(context); return 1; } 1.3 +12 -8 apache-apr/apr/test/testsock.c Index: testsock.c =================================================================== RCS file: /home/cvs/apache-apr/apr/test/testsock.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- testsock.c 1999/04/28 16:00:08 1.2 +++ testsock.c 1999/04/30 18:38:54 1.3 @@ -64,6 +64,8 @@ int main(int argc, char *argv[]) { + apr_context_t *context; + apr_procattr_t *attr1; apr_procattr_t *attr2; apr_proc_t *proc1; @@ -71,14 +73,16 @@ apr_status_t s1; apr_status_t s2; + context = apr_initialize(NULL); + fprintf(stdout, "This test relies on the process test working. Please\n"); fprintf(stdout, "run that test first, and only run this test when it\n"); fprintf(stdout, "completes successfully. Alternitevly, you could run\n"); fprintf(stdout, "server and client by yourself.\n"); fprintf(stdout, "Creating children to run network tests.......\n"); - attr1 = apr_createprocattr_init(); - attr2 = apr_createprocattr_init(); + attr1 = apr_createprocattr_init(context); + attr2 = apr_createprocattr_init(context); if (attr1 == NULL || attr2 == NULL) { @@ -86,25 +90,25 @@ exit(-1); } - proc1 = apr_create_process("server", NULL, NULL, attr1); - proc2 = apr_create_process("client", NULL, NULL, attr2); + proc1 = apr_create_process(context, "server", NULL, NULL, attr1); + proc2 = apr_create_process(context, "client", NULL, NULL, attr2); if (proc1 == NULL || proc2 == NULL) { fprintf(stderr, "Problem spawning new process\n"); exit(-1); } - while ((s1 = apr_wait_proc(proc1, APR_NOWAIT)) == APR_FAILURE && - (s2 = apr_wait_proc(proc2, APR_NOWAIT)) == APR_FAILURE) + while ((s1 = apr_wait_proc(context, proc1, APR_NOWAIT)) == APR_FAILURE && + (s2 = apr_wait_proc(context, proc2, APR_NOWAIT)) == APR_FAILURE) continue; if (s1 == APR_SUCCESS) { kill(proc2->pid, SIGTERM); - apr_wait_proc(proc2, APR_WAIT); + apr_wait_proc(context, proc2, APR_WAIT); } else { kill(proc1->pid, SIGTERM); - apr_wait_proc(proc1, APR_WAIT); + apr_wait_proc(context, proc1, APR_WAIT); } fprintf(stdout, "Network test completed.\n"); } 1.5 +50 -30 apache-apr/apr/threadproc/unix/proc.c Index: proc.c =================================================================== RCS file: /home/cvs/apache-apr/apr/threadproc/unix/proc.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- proc.c 1999/04/26 18:16:39 1.4 +++ proc.c 1999/04/30 18:38:56 1.5 @@ -62,9 +62,9 @@ #include <string.h> #include <sys/wait.h> -apr_procattr_t *apr_createprocattr_init(void) +apr_procattr_t *apr_createprocattr_init(apr_context_t *cont) { - apr_procattr_t *new = (apr_procattr_t *)malloc(sizeof(apr_procattr_t)); + apr_procattr_t *new = (apr_procattr_t *)apr_palloc(cont->pool, sizeof(apr_procattr_t)); new->parent_in = NULL; new->child_in = NULL; @@ -77,43 +77,54 @@ return new; } -apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, +apr_status_t apr_setprocattr_io(apr_context_t *cont, apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err) { if (in) { - attr->parent_in = (apr_file_t *)malloc(sizeof(apr_file_t)); - attr->child_in = (apr_file_t *)malloc(sizeof(apr_file_t)); - if (apr_create_pipe(attr->child_in, attr->parent_in) == APR_FAILURE) { + attr->parent_in = (apr_file_t *)apr_palloc(cont->pool, + sizeof(apr_file_t)); + attr->child_in = (apr_file_t *)apr_palloc(cont->pool, + sizeof(apr_file_t)); + if (apr_create_pipe(cont, attr->child_in, + attr->parent_in) == APR_FAILURE) { return APR_FAILURE; } } if (out) { - attr->parent_out = (apr_file_t *)malloc(sizeof(apr_file_t)); - attr->child_out = (apr_file_t *)malloc(sizeof(apr_file_t)); - if (apr_create_pipe(attr->parent_out, attr->child_out) == APR_FAILURE) { + attr->parent_out = (apr_file_t *)apr_palloc(cont->pool, + sizeof(apr_file_t)); + attr->child_out = (apr_file_t *)apr_palloc(cont->pool, + sizeof(apr_file_t)); + if (apr_create_pipe(cont, attr->parent_out, + attr->child_out) == APR_FAILURE) { return APR_FAILURE; } } if (err) { - attr->parent_err = (apr_file_t *)malloc(sizeof(apr_file_t)); - attr->child_err = (apr_file_t *)malloc(sizeof(apr_file_t)); - if (apr_create_pipe(attr->parent_err, attr->child_err) == APR_FAILURE) { + attr->parent_err = (apr_file_t *)apr_palloc(cont->pool, + sizeof(apr_file_t)); + attr->child_err = (apr_file_t *)apr_palloc(cont->pool, + sizeof(apr_file_t)); + if (apr_create_pipe(cont, attr->parent_err, + attr->child_err) == APR_FAILURE) { return APR_FAILURE; } } } -apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, char *dir) +apr_status_t apr_setprocattr_dir(apr_context_t *cont, apr_procattr_t *attr, + char *dir) { attr->currdir = strdup(dir); } -apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, apr_cmdtype_e cmd) +apr_status_t apr_setprocattr_cmdtype(apr_context_t *cont, apr_procattr_t *attr, + apr_cmdtype_e cmd) { attr->cmdtype = cmd; } -apr_int32_t apr_fork(apr_proc_t *proc) +apr_int32_t apr_fork(apr_context_t *cont, apr_proc_t *proc) { int pid; @@ -130,9 +141,11 @@ return 1; } -apr_proc_t *apr_create_process(char *progname, char *const args[], char **env, apr_procattr_t *attr) +apr_proc_t *apr_create_process(apr_context_t *cont, char *progname, + char *const args[], char **env, + apr_procattr_t *attr) { - apr_proc_t *new = (apr_proc_t *)malloc(sizeof(apr_proc_t)); + apr_proc_t *new = (apr_proc_t *)apr_palloc(cont->pool, sizeof(apr_proc_t)); int i; char **newargs; @@ -142,19 +155,19 @@ else if (new->pid == 0) { /* child process */ if (attr->child_in) { - apr_close(attr->parent_in); + apr_close(cont, attr->parent_in); dup2(attr->child_in->filedes, STDIN_FILENO); - apr_close(attr->child_in); + apr_close(cont, attr->child_in); } if (attr->child_out) { - apr_close(attr->parent_out); + apr_close(cont, attr->parent_out); dup2(attr->child_out->filedes, STDOUT_FILENO); - apr_close(attr->child_out); + apr_close(cont, attr->child_out); } if (attr->child_err) { - apr_close(attr->parent_err); + apr_close(cont, attr->parent_err); dup2(attr->child_err->filedes, STDERR_FILENO); - apr_close(attr->child_err); + apr_close(cont, attr->child_err); } signal(SIGCHLD, SIG_DFL); /*not sure if this is needed or not */ @@ -189,35 +202,36 @@ } /* Parent process */ if (attr->child_in) { - apr_close(attr->child_in); + apr_close(cont, attr->child_in); } if (attr->child_out) { - apr_close(attr->child_out); + apr_close(cont, attr->child_out); } if (attr->child_err) { - apr_close(attr->child_err); + apr_close(cont, attr->child_err); } new->attr = attr; return new; } -apr_file_t *apr_get_childin(apr_proc_t *proc) +apr_file_t *apr_get_childin(apr_context_t *cont, apr_proc_t *proc) { return proc->attr->parent_in; } -apr_file_t *apr_get_childout(apr_proc_t *proc) +apr_file_t *apr_get_childout(apr_context_t *cont, apr_proc_t *proc) { return proc->attr->parent_out; } -apr_file_t *apr_get_childerr(apr_proc_t *proc) +apr_file_t *apr_get_childerr(apr_context_t *cont, apr_proc_t *proc) { return proc->attr->parent_err; } -apr_status_t apr_wait_proc(apr_proc_t *proc, apr_wait_how_e wait) +apr_status_t apr_wait_proc(apr_context_t *cont, apr_proc_t *proc, + apr_wait_how_e wait) { if (!proc) return APR_FAILURE; @@ -230,4 +244,10 @@ return APR_SUCCESS; return APR_FAILURE; } + +void apr_exit_proc(apr_context_t *cont) +{ + apr_destroy_pool(cont->pool); +} + 1.19 +75 -56 apache-apr/docs/fileio.txt Index: fileio.txt =================================================================== RCS file: /home/cvs/apache-apr/docs/fileio.txt,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- fileio.txt 1999/04/26 13:07:52 1.18 +++ fileio.txt 1999/04/30 18:38:56 1.19 @@ -1,10 +1,11 @@ <h2>File I/O</h2> - apr_file_t *apr_open(char *, apr_int32_t, apr_fileperms_t mode) + apr_file_t *apr_open(apr_context_t *, char *, apr_int32_t, apr_fileperms_t mode) Open the specified file, and return a method for accessing that file. Arguments: - arg 1) full path name to the file to be opened. - arg 2) Note: this may become its own type with accessor methods + arg 1) The context to use. + arg 2) full path name to the file to be opened. + arg 3) Note: this may become its own type with accessor methods flags that determine how to open or create the file. Or'ed value of: APR_READ Open for reading @@ -19,7 +20,7 @@ non-buffered APR_EXCL return error if APR_CREATE and file exists. - arg 3) Access permissions to set for the file if it is created with + arg 4) Access permissions to set for the file if it is created with APR_CREATE. We haven't decided how exactly we want this to work, but it will support the set of Unix permissions at minimum. @@ -32,139 +33,156 @@ is small, and a stat isn't required after opening the file. -apr_status_t apr_close(apr_file_t *); +apr_status_t apr_close(apr_context_t *, apr_file_t *); Close the specified file descriptor Arguments: - arg 1) file descriptor of file to be closed. + arg 1) The context to use. + arg 2) file descriptor of file to be closed. return) APR_SUCCESS or APR_FAILURE Notes: The fields within the APRFile structure will not be changed when a file is closed. The ONLY updated field, will be the file descriptor. - apr_size_t apr_read(apr_file_t *, void *, apr_size_t) + apr_size_t apr_read(apr_context_t *, apr_file_t *, void *, apr_size_t) Read n bytes from file and store in buffer. Arguments: - arg 1) File descriptor to read from - arg 2) buffer to store data in - arg 3) number of bytes to read + arg 1) The context to use. + arg 2) File descriptor to read from + arg 3) buffer to store data in + arg 4) number of bytes to read return) pointer to number of bytes read. - apr_size_t apr_write(apr_file_t *, void *, apr_size_t) + apr_size_t apr_write(apr_context_t *, apr_file_t *, void *, apr_size_t) Write n bytes of data from buffer to file Arguments: - arg 1) File descriptor to write data to - arg 2) buffer to read data from - arg 3) number of bytes to write + arg 1) The context to use. + arg 2) File descriptor to write data to + arg 3) buffer to read data from + arg 4) number of bytes to write return) pointer to number of bytes written. Notes: apr_write tries to update the apr_file_t that is passed in, but it fails silently if it is unable to do so. - apr_file_t apr_dupfile(apr_file_t *) + apr_file_t apr_dupfile(apr_context_t *, apr_file_t *) Copy data from one apr_file_t to a new one. Arguments: - arg 1) the file info to save. + arg 1) The context to use. + arg 2) the file info to save. return) a new file structure. Notes: This does not duplicate the file descriptor, it just saves the data from apr_file_t to a new apr_file_t. This is used so user programs do not need access to the internals of apr_file_t - apr_status apr_getfileinfo(char *, apr_file_t *) + apr_status apr_getfileinfo(apr_context_t *, char *, apr_file_t *) Get information about the file with the given path name. Arguments: - arg 1) path to file to get information about - arg 2) Structure to store file's information in. + arg 1) The context to use. + arg 2) path to file to get information about + arg 3) Structure to store file's information in. return) APR_SUCCESS or APR_FAILURE. - apr_status apr_updatefileinfo(apr_file_t *) + apr_status apr_updatefileinfo(apr_context_t *, apr_file_t *) Get information about the file with the given path name. Arguments: - arg 1) Structure to store file's information in. + arg 1) The context to use. + arg 2) Structure to store file's information in. return) APR_SUCCESS or APR_FAILURE. Notes: apr_updatefileinfo overwrites the old info, so if it is needed, the old info should be saved off to the side, using apr_dupfile. - apr_off_t apr_seek(apr_file_t, apr_off_t, apr_seek_where_t) + apr_off_t apr_seek(apr_context_t *, apr_file_t, apr_off_t, apr_seek_where_t) Moves the read/write file offset pointer Arguments: - arg 1) Pointer to File descriptor - arg 2) offset into file to move pointer to - arg 3) How to move the pointer. See APRSeekWhere def below. + arg 1) The context to use. + arg 2) Pointer to File descriptor + arg 3) offset into file to move pointer to + arg 4) How to move the pointer. See APRSeekWhere def below. APR_SET -- set the offset to offset APR_CUR -- add the offset to the current position APR_END -- add the offset to the current file size. return) Offset into file that the pointer was set to. - apr_status_t apr_remove_file(char *) + apr_status_t apr_remove_file(apr_context_t *, char *) Removes the file pointed to by the character string Arguments: - arg 1) The full path of the file to delete. + arg 1) The context to use. + arg 2) The full path of the file to delete. return) APR_SUCCESS or APR_FAILURE. Notes: If the file is still open, it will not actually be removed until the all references of the file are closed. - apr_dir_t *apr_opendir(const char *) + apr_dir_t *apr_opendir(apr_context_t *, const char *) Opens the specified directory stream. Arguments: - arg 1) path of the directory to be opened. + arg 1) The context to use. + arg 2) path of the directory to be opened. return) abstracted directory descriptor structure. - apr_status_t apr_closedir(apr_dir_t *) + apr_status_t apr_closedir(apr_context_t *, apr_dir_t *) closes the specified directory stream. Arguments: - arg 1) abstracted directory descriptor structure to be closed. + arg 1) The context to use. + arg 2) abstracted directory descriptor structure to be closed. return) APR_SUCCESS or APR_FAILURE - apr_dirent_t *apr_readdir(apr_dir_t *) + apr_dirent_t *apr_readdir(apr_context_t *, apr_dir_t *) Retrieve the next directory entry from the specified directory. Arguments: - arg 1) Abstracted directory descriptor to read from. + arg 1) The context to use. + arg 2) Abstracted directory descriptor to read from. return) the next directory entry. - apr_status_t *apr_rewinddir(apr_dir_t *) + apr_status_t *apr_rewinddir(apr_context_t *, apr_dir_t *) Rewind directory to beginning of stream Arguments: - arg 1) Directory structure to rewind + arg 1) The context to use. + arg 2) Directory structure to rewind return) APR_SUCCESS. (POSIX does not allow this function to fail!) - apr_status_t apr_make_dir(const char *, apr_fileperms_t) + apr_status_t apr_make_dir(apr_context_t *, const char *, apr_fileperms_t) Create a new directory on the disk Arguments: - arg 1) The path of the new directory. - arg 2) The permissions to set for the new directory. + arg 1) The context to use. + arg 2) The path of the new directory. + arg 3) The permissions to set for the new directory. return) APR_SUCCESS or APR_FAILURE - apr_status_t apr_remove_dir(const char *) + apr_status_t apr_remove_dir(apr_context_t *, const char *) Remove a direcotry from the disk Arguments: - arg 1) The path of the directory to remove. + arg 1) The context to use. + arg 2) The path of the directory to remove. return) APR_SUCCESS or APR_FAILURE - apr_ssize_t apr_writev(apr_file_t, apr_iovec_t *, apr_ssize_t) + apr_ssize_t apr_writev(apr_context_t *, apr_file_t, apr_iovec_t *, apr_ssize_t) Same as apr_write, except it gets the data from the APRIOVec array. Arguments: - arg 1) File descriptor to write data to - arg 2) Array from which to get the data to write to the file - arg 3) Number of elements in the APRIOVec array. Must be smaller + arg 1) The context to use. + arg 2) File descriptor to write data to + arg 3) Array from which to get the data to write to the file + arg 4) Number of elements in the APRIOVec array. Must be smaller than apr_MAX_IOVEC_SIZE, if not function will fail with APR_BUFFER_OVERFLOW_ERROR return) number of bytes written. APR_FAILURE on failure. Notes: apr_writev will write a complete entry from APRIOVec array before moving on to the next one. - char * apr_get_filename(apr_file_t *) + char * apr_get_filename(apr_context_t *, apr_file_t *) Get the name of an opened file. Arguments: - arg 1) File to get the name of + arg 1) The context to use. + arg 2) File to get the name of return) filename. NULL on failure - apr_status_t apr_create_pipe(apr_file_t *, apr_file_t *) + apr_status_t apr_create_pipe(apr_context_t *, apr_file_t *, apr_file_t *) create an unnamed pipe Arguments: - arg 1) File for reading from the pipe. - arg 2) File for writing to the pipe. + arg 1) The context to use. + arg 2) File for reading from the pipe. + arg 3) File for writing to the pipe. return) APR_SUCCESS or APR_FAILURE NOTE: Unnamed pipes are ALWAYS inherited by any child process created by the process which created the pipes. If the platform is storing the file @@ -173,13 +191,14 @@ what isn't. All other fields are left to the individual platform to set appropriately. -char *apr_create_namedpipe(char *, apr_fileperms_t) - create a uniquely named pipe in the temp directory. - Arguments: - arg 1) The directory to create the named pipe in. Can BE NULL! - arg 2) The permissions for the named pipe. - return) The name of the newly created pipe. (fully defined path) NULL - on failure. + char *apr_create_namedpipe(apr_context_t *, char *, apr_fileperms_t) + create a uniquely named pipe in the temp directory. + Arguments: + arg 1) The context to use. + arg 2) The directory to create the named pipe in. Can BE NULL! + arg 3) The permissions for the named pipe. + return) The name of the newly created pipe. (fully defined path) NULL + on failure. NOTE: If directory name is NULL, the platform decides where it is best to put the pipe. To get it in the current dir, use "." here :) 1.20 +2 -2 apache-apr/docs/networkio.txt Index: networkio.txt =================================================================== RCS file: /home/cvs/apache-apr/docs/networkio.txt,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- networkio.txt 1999/04/28 16:00:09 1.19 +++ networkio.txt 1999/04/30 18:38:56 1.20 @@ -99,8 +99,8 @@ APR_HUP Hung up APR_NVAL Invalid rquest, socket not open. arg 2) the number of sockets in the array. - arg 3) the amount of time in seconds to monitor. 0 means wait - until a socket is triggered. + arg 3) the amount of time in seconds to monitor. a negative number + means wait until a socket is triggered. return) Number of file desriptors triggered. 0 means call timed out. -1 returned on failure. 1.20 +19 -19 apache-apr/include/apr_file_io.h Index: apr_file_io.h =================================================================== RCS file: /home/cvs/apache-apr/include/apr_file_io.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- apr_file_io.h 1999/04/26 13:07:50 1.19 +++ apr_file_io.h 1999/04/30 18:38:57 1.20 @@ -106,31 +106,31 @@ typedef iovec_t apr_iovec_t; /* Function definitions */ -apr_file_t *apr_open(char *, apr_int32_t, apr_fileperms_t); -apr_status_t apr_close(apr_file_t *); -apr_status_t apr_remove_file(char *); +apr_file_t *apr_open(apr_context_t *, char *, apr_int32_t, apr_fileperms_t); +apr_status_t apr_close(apr_context_t *, apr_file_t *); +apr_status_t apr_remove_file(apr_context_t *, char *); -apr_ssize_t apr_read(apr_file_t *, void *, apr_ssize_t); -apr_ssize_t apr_write(apr_file_t *, void *, apr_ssize_t); -apr_ssize_t apr_writev(apr_file_t *, const apr_iovec_t *, apr_ssize_t); +apr_ssize_t apr_read(apr_context_t *, apr_file_t *, void *, apr_ssize_t); +apr_ssize_t apr_write(apr_context_t *, apr_file_t *, void *, apr_ssize_t); +apr_ssize_t apr_writev(apr_context_t *, apr_file_t *, const apr_iovec_t *, apr_ssize_t); -apr_file_t *apr_dupfile(apr_file_t *); -apr_status_t apr_getfileinfo(char *, apr_file_t *); -apr_status_t apr_updatefileinfo(apr_file_t *); -apr_off_t apr_seek(apr_file_t *, apr_off_t, apr_seek_where_t); +apr_file_t *apr_dupfile(apr_context_t *, apr_file_t *); +apr_status_t apr_getfileinfo(apr_context_t *, char *, apr_file_t *); +apr_status_t apr_updatefileinfo(apr_context_t *, apr_file_t *); +apr_off_t apr_seek(apr_context_t *, apr_file_t *, apr_off_t, apr_seek_where_t); -apr_dir_t *apr_opendir(const char *); -apr_status_t apr_closedir(apr_dir_t *); -apr_dirent_t *apr_readdir(apr_dir_t *); -apr_status_t apr_rewinddir(apr_dir_t *); -apr_status_t apr_make_dir(const char *, apr_fileperms_t); -apr_status_t apr_remove_dir(const char *); +apr_dir_t *apr_opendir(apr_context_t *, const char *); +apr_status_t apr_closedir(apr_context_t *, apr_dir_t *); +apr_dirent_t *apr_readdir(apr_context_t *, apr_dir_t *); +apr_status_t apr_rewinddir(apr_context_t *, apr_dir_t *); +apr_status_t apr_make_dir(apr_context_t *, const char *, apr_fileperms_t); +apr_status_t apr_remove_dir(apr_context_t *, const char *); -apr_status_t apr_create_pipe(apr_file_t *, apr_file_t *); -char *apr_create_namedpipe(char *, apr_fileperms_t); +apr_status_t apr_create_pipe(apr_context_t *, apr_file_t *, apr_file_t *); +char *apr_create_namedpipe(apr_context_t *, char *, apr_fileperms_t); /*accessor and general file_io functions. */ -char *apr_get_filename(apr_file_t *); +char *apr_get_filename(apr_context_t *, apr_file_t *); #endif /* ! APR_FILE_IO_H */ 1.15 +16 -16 apache-apr/include/apr_network_io.h Index: apr_network_io.h =================================================================== RCS file: /home/cvs/apache-apr/include/apr_network_io.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- apr_network_io.h 1999/04/28 16:00:09 1.14 +++ apr_network_io.h 1999/04/30 18:38:58 1.15 @@ -64,8 +64,8 @@ #define MAX_SECS_TO_LINGER 30 #endif -#ifndef MAXHOSTNAMELEN -#define MAXHOSTNAMELEN 256 +#ifndef APRMAXHOSTLEN +#define APRMAXHOSTLEN 256 #endif /* Socket option definitions */ @@ -90,25 +90,25 @@ /* function definitions */ -apr_socket_t *apr_create_tcp_socket(void); -apr_status_t apr_shutdown(apr_socket_t *, apr_shutdown_how_e); -apr_status_t apr_close_socket(apr_socket_t *); +apr_socket_t *apr_create_tcp_socket(apr_context_t *); +apr_status_t apr_shutdown(apr_context_t *, apr_socket_t *, apr_shutdown_how_e); +apr_status_t apr_close_socket(apr_context_t *, apr_socket_t *); -apr_status_t apr_bind(apr_socket_t *); -apr_status_t apr_listen(apr_socket_t *, apr_int32_t); -apr_socket_t *apr_accept(const apr_socket_t *); -apr_status_t apr_connect(apr_socket_t *, char *); +apr_status_t apr_bind(apr_context_t *, apr_socket_t *); +apr_status_t apr_listen(apr_context_t *, apr_socket_t *, apr_int32_t); +apr_socket_t *apr_accept(apr_context_t *, const apr_socket_t *); +apr_status_t apr_connect(apr_context_t *, apr_socket_t *, char *); -char *apr_get_remote_hostname(apr_socket_t *); -apr_status_t apr_gethostname(char *, int); +char *aprget_remote_hostname(apr_context_t *, apr_socket_t *); +apr_status_t apr_gethostname(apr_context_t *, char *, int); -apr_ssize_t apr_send(apr_socket_t *, const char *, int, time_t); -apr_ssize_t apr_recv(apr_socket_t *, char *, int, time_t); +apr_ssize_t apr_send(apr_context_t *, apr_socket_t *, const char *, int, time_t); +apr_ssize_t apr_recv(apr_context_t *, apr_socket_t *, char *, int, time_t); -apr_status_t apr_setsocketopt(apr_socket_t *, apr_int32_t, apr_int32_t); -apr_status_t apr_setport(apr_socket_t *, apr_uint32_t); +apr_status_t apr_setsocketopt(apr_context_t *, apr_socket_t *, apr_int32_t, apr_int32_t); +apr_status_t apr_setport(apr_context_t *, apr_socket_t *, apr_uint32_t); -apr_int32_t apr_poll(apr_pollfd_t *, apr_int32_t, apr_int32_t); +apr_int32_t apr_poll(apr_context_t *, apr_pollfd_t *, apr_int32_t, apr_int32_t); /* accessor functions */ #endif /* ! APR_FILE_IO_H */ 1.6 +10 -10 apache-apr/include/apr_thread_proc.h Index: apr_thread_proc.h =================================================================== RCS file: /home/cvs/apache-apr/include/apr_thread_proc.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- apr_thread_proc.h 1999/04/29 20:20:39 1.5 +++ apr_thread_proc.h 1999/04/30 18:38:58 1.6 @@ -73,18 +73,18 @@ /* Process Function definitions */ -apr_procattr_t *apr_createprocattr_init(void); -apr_status_t apr_setprocattr_io(apr_procattr_t *, apr_int32_t, apr_int32_t, apr_int32_t); -apr_status_t apr_setprocattr_dir(apr_procattr_t *, char *); -apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *, apr_cmdtype_e); +apr_procattr_t *apr_createprocattr_init(apr_context_t *); +apr_status_t apr_setprocattr_io(apr_context_t *, apr_procattr_t *, apr_int32_t, apr_int32_t, apr_int32_t); +apr_status_t apr_setprocattr_dir(apr_context_t *, apr_procattr_t *, char *); +apr_status_t apr_setprocattr_cmdtype(apr_context_t *, apr_procattr_t *, apr_cmdtype_e); -apr_file_t *apr_get_childin(apr_proc_t *); -apr_file_t *apr_get_childout(apr_proc_t *); -apr_file_t *apr_get_childerr(apr_proc_t *); +apr_file_t *apr_get_childin(apr_context_t *, apr_proc_t *); +apr_file_t *apr_get_childout(apr_context_t *, apr_proc_t *); +apr_file_t *apr_get_childerr(apr_context_t *, apr_proc_t *); -apr_int32_t apr_fork(apr_proc_t *); -apr_proc_t *apr_create_process(char *, char *const [], char **, apr_procattr_t *); -apr_status_t apr_wait_proc(apr_proc_t *, apr_wait_how_e); +apr_int32_t apr_fork(apr_context_t *, apr_proc_t *); +apr_proc_t *apr_create_process(apr_context_t *, char *, char *const [], char **, apr_procattr_t *); +apr_status_t apr_wait_proc(apr_context_t *, apr_proc_t *, apr_wait_how_e); #endif /* ! APR_FILE_IO_H */