You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@locus.apache.org on 2000/11/17 03:33:01 UTC

cvs commit: apache-2.0/src/lib/apr/threadproc/unix thread.c threadpriv.c

trawick     00/11/16 18:33:01

  Modified:    src/build buildexports.sh
               src/lib/apr/network_io/unix sendrecv.c
               src/lib/apr/threadproc/unix thread.c threadpriv.c
  Log:
  Get exports.c symbols to compile even if the declaration is hidden in
  APR include file.
  
  Implement all exports.c symbols even if the package or function isn't
  available in the current configuration.
  
  Revision  Changes    Path
  1.4       +4 -8      apache-2.0/src/build/buildexports.sh
  
  Index: buildexports.sh
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/build/buildexports.sh,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- buildexports.sh	2000/11/13 16:26:41	1.3
  +++ buildexports.sh	2000/11/17 02:33:00	1.4
  @@ -7,25 +7,21 @@
   echo " * link all of the APR functions into server regardless of whether"
   echo " * the base server uses them."
   echo " */"
  -echo ""
   
  -cd lib/apr/include
  -for file in *.h
  -do
  -    echo "#include \"$file\""
  -done
  -cd ../../../
  -echo ""
   echo ""
   
   while read LINE
   do
       if [ "x`echo $LINE | egrep  '^[:space:]*apr_'`" != "x" ]; then
           newline=`echo "$LINE" |\
  +            sed -e 's%^\(.*\)%extern const void *\1\\(void\);%'`
  +        echo $newline
  +        newline=`echo "$LINE" |\
               sed -e 's%^\(.*\)%const void *ap_hack_\1 = \(const void *\)\1\;%'`
           echo $newline
       fi
   done
   
  +echo ""
   echo "void *ap_ugly_hack;"
   exit 0
  
  
  
  1.50      +13 -0     apache-2.0/src/lib/apr/network_io/unix/sendrecv.c
  
  Index: sendrecv.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/sendrecv.c,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- sendrecv.c	2000/11/14 06:40:06	1.49
  +++ sendrecv.c	2000/11/17 02:33:00	1.50
  @@ -712,3 +712,16 @@
   #error or change APR_HAS_SENDFILE in apr.h to 0. 
   #endif /* __linux__, __FreeBSD__, __HPUX__, _AIX, __MVS__, Tru64/OSF1 */
   #endif /* APR_HAS_SENDFILE */
  +
  +#if !APR_HAS_SENDFILE
  +/* currently, exports.c includes a reference to apr_sendfile() even if 
  + * apr_sendfile() doesn't work on the platform;
  + * this dummy version is just to get exports.c to compile/link
  + */
  +apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file,
  +                          apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len,
  +                          apr_int32_t flags)
  +{
  +    return APR_ENOTIMPL;
  +}
  +#endif
  
  
  
  1.31      +93 -0     apache-2.0/src/lib/apr/threadproc/unix/thread.c
  
  Index: thread.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/unix/thread.c,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- thread.c	2000/11/09 06:47:53	1.30
  +++ thread.c	2000/11/17 02:33:00	1.31
  @@ -233,3 +233,96 @@
   #endif  /* HAVE_PTHREAD_H */
   #endif  /* APR_HAS_THREADS */
   
  +#if !APR_HAS_THREADS
  +
  +apr_status_t apr_create_thread(apr_thread_t **new_thread, apr_threadattr_t *attr, 
  +                               apr_thread_start_t func, void *data, 
  +                               apr_pool_t *cont)
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont)
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +apr_status_t apr_create_thread_private(apr_threadkey_t **key, void (*dest)(void *),
  +                                       apr_pool_t *cont)
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +apr_status_t apr_delete_thread_private(apr_threadkey_t *key)
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +apr_status_t apr_get_os_thread(void); /* avoid warning for no prototype */
  +
  +apr_status_t apr_get_os_thread(void) 
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr)
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread)
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +apr_status_t apr_get_threadkeydata(void **data, const char *key, 
  +                                   apr_threadkey_t *threadkey)
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +apr_status_t apr_get_thread_private(void **new_mem, apr_threadkey_t *key)
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on)
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +apr_status_t apr_set_threaddata(void *data, const char *key,
  +                                apr_status_t (*cleanup)(void *),
  +                                apr_thread_t *thread) 
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +apr_status_t apr_set_threadkeydata(void *data, const char *key,
  +                                   apr_status_t (*cleanup) (void *), 
  +                                   apr_threadkey_t *threadkey)
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key)
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +apr_status_t apr_thread_detach(apr_thread_t *thd)
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval)
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd) 
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +#endif
  
  
  
  1.28      +9 -0      apache-2.0/src/lib/apr/threadproc/unix/threadpriv.c
  
  Index: threadpriv.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/unix/threadpriv.c,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- threadpriv.c	2000/11/09 06:47:53	1.27
  +++ threadpriv.c	2000/11/17 02:33:00	1.28
  @@ -144,3 +144,12 @@
   }           
   #endif /* APR_HAVE_PTHREAD_H */
   #endif /* APR_HAS_THREADS */
  +
  +#if !APR_HAS_THREADS
  +apr_status_t apr_get_os_threadkey(void); /* avoid warning for no prototype */
  +
  +apr_status_t apr_get_os_threadkey(void)
  +{
  +    return APR_ENOTIMPL;
  +}
  +#endif
  
  
  

RE: eek. exports.c (was: Re: cvs commit: ...)

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
I'm dropping ordinals, period.

This is a load time issue, and so insignificant that we shouldn't be
bothered - the man hours wasted given that MS does a reasonable job of
caching the ordinals...

I'm going to strip them without objection from 2.0 in an hour or so.

Bill	

> -----Original Message-----
> From: trawick@bellsouth.net [mailto:trawick@bellsouth.net]On Behalf Of
> Jeff Trawick
> Sent: Friday, November 17, 2000 9:21 AM
> To: new-httpd@apache.org
> Subject: Re: eek. exports.c (was: Re: cvs commit: ...)
> 
> 
> Jeff Trawick <tr...@bellsouth.net> writes:
> 
> > We could replace the manually-maintained support/httpd.exp with a
> > table that has an optional column for feature test macros which must
> > be true, then automatically generate an appropriate httpd.exp and
> > exports.c. 
> > 
> > e.g.,
> > 
> > apr_create_socket
> > apr_send
> > apr_sendfile            APR_HAS_SENDFILE
> > apr_create_thread       APR_HAS_THREADS
> > blah
> > 
> > Heck, we could generate Win32's aprlib.def from this too.
> 
> not really; we'd have to work really hard to maintain the ordinal
> numbers...
> 
> -- 
> Jeff Trawick | trawick@ibm.net | PGP public key at web site:
>      http://www.geocities.com/SiliconValley/Park/9289/
>           Born in Roswell... married an alien...
> 

RE: eek. exports.c (was: Re: cvs commit: ...)

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
I'm dropping ordinals, period.

This is a load time issue, and so insignificant that we shouldn't be
bothered - the man hours wasted given that MS does a reasonable job of
caching the ordinals...

I'm going to strip them without objection from 2.0 in an hour or so.

Bill	

> -----Original Message-----
> From: trawick@bellsouth.net [mailto:trawick@bellsouth.net]On Behalf Of
> Jeff Trawick
> Sent: Friday, November 17, 2000 9:21 AM
> To: new-httpd@apache.org
> Subject: Re: eek. exports.c (was: Re: cvs commit: ...)
> 
> 
> Jeff Trawick <tr...@bellsouth.net> writes:
> 
> > We could replace the manually-maintained support/httpd.exp with a
> > table that has an optional column for feature test macros which must
> > be true, then automatically generate an appropriate httpd.exp and
> > exports.c. 
> > 
> > e.g.,
> > 
> > apr_create_socket
> > apr_send
> > apr_sendfile            APR_HAS_SENDFILE
> > apr_create_thread       APR_HAS_THREADS
> > blah
> > 
> > Heck, we could generate Win32's aprlib.def from this too.
> 
> not really; we'd have to work really hard to maintain the ordinal
> numbers...
> 
> -- 
> Jeff Trawick | trawick@ibm.net | PGP public key at web site:
>      http://www.geocities.com/SiliconValley/Park/9289/
>           Born in Roswell... married an alien...
> 

Re: eek. exports.c (was: Re: cvs commit: ...)

Posted by Jeff Trawick <tr...@bellsouth.net>.
Jeff Trawick <tr...@bellsouth.net> writes:

> We could replace the manually-maintained support/httpd.exp with a
> table that has an optional column for feature test macros which must
> be true, then automatically generate an appropriate httpd.exp and
> exports.c. 
> 
> e.g.,
> 
> apr_create_socket
> apr_send
> apr_sendfile            APR_HAS_SENDFILE
> apr_create_thread       APR_HAS_THREADS
> blah
> 
> Heck, we could generate Win32's aprlib.def from this too.

not really; we'd have to work really hard to maintain the ordinal
numbers...

-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...

Re: eek. exports.c (was: Re: cvs commit: ...)

Posted by Jeff Trawick <tr...@bellsouth.net>.
Greg Stein <gs...@lyra.org> writes:

> Urk.
> 
> This isn't right. Now a user of APR will be able to link when a function
> isn't supposed to be available. Before, we could die with a compile-time
> error (missing prototype) or a link-time error (missing function). But
> now... the user won't know a problem exists until runtime.

If they died before with a compile-time error, they still will.

If they died before with a link-time error, they ignored compile-time
warnings (missing prototype), right?  (yes, we went backwards, but not
terribly far)

> Why don't we just have exports.c define the functions (in the appropriate
> #if stuff) if they don't exist? No reason to put them into APR.

Manual or automatically generated?  How do get the right #if stuff in
there with something which is automatically generated?

We could replace the manually-maintained support/httpd.exp with a
table that has an optional column for feature test macros which must
be true, then automatically generate an appropriate httpd.exp and
exports.c. 

e.g.,

apr_create_socket
apr_send
apr_sendfile            APR_HAS_SENDFILE
apr_create_thread       APR_HAS_THREADS
blah

Heck, we could generate Win32's aprlib.def from this too.

-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...

Re: eek. exports.c (was: Re: cvs commit: ...)

Posted by rb...@covalent.net.
> This isn't right. Now a user of APR will be able to link when a function
> isn't supposed to be available. Before, we could die with a compile-time
> error (missing prototype) or a link-time error (missing function). But
> now... the user won't know a problem exists until runtime.
> 
> Why don't we just have exports.c define the functions (in the appropriate
> #if stuff) if they don't exist? No reason to put them into APR.

Because exports is a generated file, and trying to figure out which APR
functions are optional and which aren't is ugly.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


eek. exports.c (was: Re: cvs commit: ...)

Posted by Greg Stein <gs...@lyra.org>.
On Fri, Nov 17, 2000 at 02:33:01AM -0000, trawick@locus.apache.org wrote:
> trawick     00/11/16 18:33:01
> 
>   Modified:    src/build buildexports.sh
>                src/lib/apr/network_io/unix sendrecv.c
>                src/lib/apr/threadproc/unix thread.c threadpriv.c
>   Log:
>   Get exports.c symbols to compile even if the declaration is hidden in
>   APR include file.
>   
>   Implement all exports.c symbols even if the package or function isn't
>   available in the current configuration.

Urk.

This isn't right. Now a user of APR will be able to link when a function
isn't supposed to be available. Before, we could die with a compile-time
error (missing prototype) or a link-time error (missing function). But
now... the user won't know a problem exists until runtime.

Why don't we just have exports.c define the functions (in the appropriate
#if stuff) if they don't exist? No reason to put them into APR.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/