Print this page
5261 libm should stop using synonyms.h
5298 fabs is 0-sized, confuses dis(1) and others
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Approved by: Gordon Ross <gwr@nexenta.com>


  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  24  */
  25 /*
  26  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  27  * Use is subject to license terms.
  28  */
  29 
  30 #pragma weak fex_get_handling = __fex_get_handling
  31 #pragma weak fex_set_handling = __fex_set_handling
  32 #pragma weak fex_getexcepthandler = __fex_getexcepthandler
  33 #pragma weak fex_setexcepthandler = __fex_setexcepthandler
  34 
  35 #include "fenv_synonyms.h"
  36 #include <fenv.h>
  37 #include <ucontext.h>
  38 #include <thread.h>
  39 #include "fex_handler.h"
  40 
  41 int fex_get_handling(int e)
  42 {
  43         struct fex_handler_data *thr_handlers;
  44         int                                             i;
  45 
  46         thr_handlers = __fex_get_thr_handlers();
  47         for (i = 0; i < FEX_NUM_EXC; i++)
  48                 if (e & (1 << i))
  49                         return thr_handlers[i].__mode;
  50         return FEX_NOHANDLER;
  51 }
  52 
  53 int fex_set_handling(int e, int mode, void (*handler)())
  54 {
  55         struct fex_handler_data *thr_handlers;




  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  24  */
  25 /*
  26  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  27  * Use is subject to license terms.
  28  */
  29 
  30 #pragma weak __fex_get_handling = fex_get_handling
  31 #pragma weak __fex_set_handling = fex_set_handling
  32 #pragma weak __fex_getexcepthandler = fex_getexcepthandler
  33 #pragma weak __fex_setexcepthandler = fex_setexcepthandler
  34 

  35 #include <fenv.h>
  36 #include <ucontext.h>
  37 #include <thread.h>
  38 #include "fex_handler.h"
  39 
  40 int fex_get_handling(int e)
  41 {
  42         struct fex_handler_data *thr_handlers;
  43         int                                             i;
  44 
  45         thr_handlers = __fex_get_thr_handlers();
  46         for (i = 0; i < FEX_NUM_EXC; i++)
  47                 if (e & (1 << i))
  48                         return thr_handlers[i].__mode;
  49         return FEX_NOHANDLER;
  50 }
  51 
  52 int fex_set_handling(int e, int mode, void (*handler)())
  53 {
  54         struct fex_handler_data *thr_handlers;