Print this page
remove support for non-ANSI compilation

Split Close
Expand all
Collapse all
          --- old/usr/src/head/pthread.h
          +++ new/usr/src/head/pthread.h
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
       23 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
       24 + *
  23   25   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  24   26   * Use is subject to license terms.
  25   27   */
  26   28  
  27   29  #ifndef _PTHREAD_H
  28   30  #define _PTHREAD_H
  29   31  
  30   32  #include <sys/feature_tests.h>
  31   33  
  32   34  #ifndef _ASM
↓ open down ↓ 110 lines elided ↑ open up ↑
 143  145  
 144  146  #ifndef _ASM
 145  147  
 146  148  /*
 147  149   * cancellation cleanup structure
 148  150   */
 149  151  typedef struct _cleanup {
 150  152          uintptr_t       pthread_cleanup_pad[4];
 151  153  } _cleanup_t;
 152  154  
 153      -#ifdef  __STDC__
 154      -
 155  155  void    __pthread_cleanup_push(void (*)(void *), void *, caddr_t, _cleanup_t *);
 156  156  void    __pthread_cleanup_pop(int, _cleanup_t *);
 157  157  caddr_t _getfp(void);
 158  158  
 159      -#else   /* __STDC__ */
 160      -
 161      -void    __pthread_cleanup_push();
 162      -void    __pthread_cleanup_pop();
 163      -caddr_t _getfp();
 164      -
 165      -#endif  /* __STDC__ */
 166      -
 167  159  #if __cplusplus
 168  160  extern "C" {
 169  161  #endif
 170  162  
 171  163  typedef void (*_Voidfp)(void*); /* pointer to extern "C" function */
 172  164  
 173  165  #if __cplusplus
 174  166  } /* extern "C" */
 175  167  #endif
 176  168  
 177  169  #define pthread_cleanup_push(routine, args) { \
 178  170          _cleanup_t _cleanup_info; \
 179  171          __pthread_cleanup_push((_Voidfp)(routine), (void *)(args), \
 180  172                                  (caddr_t)_getfp(), &_cleanup_info);
 181  173  
 182  174  #define pthread_cleanup_pop(ex) \
 183  175          __pthread_cleanup_pop(ex, &_cleanup_info); \
 184  176  }
 185  177  
 186      -#ifdef  __STDC__
 187      -
 188  178  /*
 189  179   * function prototypes - thread related calls
 190  180   */
 191  181  
 192  182  /*
 193  183   * pthread_atfork() is also declared in <unistd.h> as per SUSv2. The
 194  184   * declarations are identical. A change to either one may also require
 195  185   * appropriate namespace updates in order to avoid redeclaration
 196  186   * warnings in the case where both prototypes are exposed via inclusion
 197  187   * of both <pthread.h> and <unistd.h>.
↓ open down ↓ 142 lines elided ↑ open up ↑
 340  330          const pthread_barrierattr_t *_RESTRICT_KYWD, uint_t);
 341  331  extern int pthread_barrier_destroy(pthread_barrier_t *);
 342  332  extern int pthread_barrier_wait(pthread_barrier_t *);
 343  333  
 344  334  /* Historical names -- present only for binary compatibility */
 345  335  extern int pthread_mutex_consistent_np(pthread_mutex_t *);
 346  336  extern int pthread_mutexattr_setrobust_np(pthread_mutexattr_t *, int);
 347  337  extern int pthread_mutexattr_getrobust_np(
 348  338          const pthread_mutexattr_t *_RESTRICT_KYWD, int *_RESTRICT_KYWD);
 349  339  
 350      -#else   /* __STDC__ */
 351      -
 352      -/*
 353      - * function prototypes - thread related calls
 354      - */
 355      -extern int pthread_atfork();
 356      -extern int pthread_attr_init();
 357      -extern int pthread_attr_destroy();
 358      -extern int pthread_attr_setstack();
 359      -extern int pthread_attr_getstack();
 360      -extern int pthread_attr_setstacksize();
 361      -extern int pthread_attr_getstacksize();
 362      -extern int pthread_attr_setstackaddr();
 363      -extern int pthread_attr_getstackaddr();
 364      -extern int pthread_attr_setdetachstate();
 365      -extern int pthread_attr_getdetachstate();
 366      -extern int pthread_attr_setscope();
 367      -extern int pthread_attr_getscope();
 368      -extern int pthread_attr_setinheritsched();
 369      -extern int pthread_attr_getinheritsched();
 370      -extern int pthread_attr_setschedpolicy();
 371      -extern int pthread_attr_getschedpolicy();
 372      -extern int pthread_attr_setschedparam();
 373      -extern int pthread_attr_getschedparam();
 374      -extern int pthread_create();
 375      -extern int pthread_once();
 376      -extern int pthread_join();
 377      -extern int pthread_detach();
 378      -extern void pthread_exit();
 379      -extern int pthread_cancel();
 380      -extern int pthread_setschedparam();
 381      -extern int pthread_getschedparam();
 382      -extern int pthread_setschedprio();
 383      -extern int pthread_setcancelstate();
 384      -extern int pthread_setcanceltype();
 385      -extern void pthread_testcancel();
 386      -extern int pthread_equal();
 387      -extern int pthread_key_create();
 388      -extern int pthread_key_create_once_np();
 389      -extern int pthread_key_delete();
 390      -extern int pthread_setspecific();
 391      -extern void *pthread_getspecific();
 392      -extern pthread_t pthread_self();
 393      -/*
 394      - * function prototypes - synchronization related calls
 395      - */
 396      -extern int pthread_mutexattr_init();
 397      -extern int pthread_mutexattr_destroy();
 398      -extern int pthread_mutexattr_setpshared();
 399      -extern int pthread_mutexattr_getpshared();
 400      -extern int pthread_mutexattr_setprotocol();
 401      -extern int pthread_mutexattr_getprotocol();
 402      -extern int pthread_mutexattr_setprioceiling();
 403      -extern int pthread_mutexattr_getprioceiling();
 404      -extern int pthread_mutexattr_setrobust();
 405      -extern int pthread_mutexattr_getrobust();
 406      -extern int pthread_mutex_init();
 407      -extern int pthread_mutex_consistent();
 408      -extern int pthread_mutex_destroy();
 409      -extern int pthread_mutex_lock();
 410      -extern int pthread_mutex_timedlock();
 411      -extern int pthread_mutex_reltimedlock_np();
 412      -extern int pthread_mutex_unlock();
 413      -extern int pthread_mutex_trylock();
 414      -extern int pthread_mutex_setprioceiling();
 415      -extern int pthread_mutex_getprioceiling();
 416      -extern int pthread_condattr_init();
 417      -extern int pthread_condattr_destroy();
 418      -extern int pthread_condattr_setclock();
 419      -extern int pthread_condattr_getclock();
 420      -extern int pthread_condattr_setpshared();
 421      -extern int pthread_condattr_getpshared();
 422      -extern int pthread_cond_init();
 423      -extern int pthread_cond_destroy();
 424      -extern int pthread_cond_broadcast();
 425      -extern int pthread_cond_signal();
 426      -extern int pthread_cond_wait();
 427      -extern int pthread_cond_timedwait();
 428      -extern int pthread_cond_reltimedwait_np();
 429      -extern int pthread_attr_getguardsize();
 430      -extern int pthread_attr_setguardsize();
 431      -extern int pthread_getconcurrency();
 432      -extern int pthread_setconcurrency();
 433      -extern int pthread_mutexattr_settype();
 434      -extern int pthread_mutexattr_gettype();
 435      -extern int pthread_rwlock_init();
 436      -extern int pthread_rwlock_destroy();
 437      -extern int pthread_rwlock_rdlock();
 438      -extern int pthread_rwlock_tryrdlock();
 439      -extern int pthread_rwlock_wrlock();
 440      -extern int pthread_rwlock_trywrlock();
 441      -extern int pthread_rwlock_unlock();
 442      -extern int pthread_rwlockattr_init();
 443      -extern int pthread_rwlockattr_destroy();
 444      -extern int pthread_rwlockattr_getpshared();
 445      -extern int pthread_rwlockattr_setpshared();
 446      -extern int pthread_spin_init();
 447      -extern int pthread_spin_destroy();
 448      -extern int pthread_spin_lock();
 449      -extern int pthread_spin_trylock();
 450      -extern int pthread_spin_unlock();
 451      -extern int pthread_barrierattr_init();
 452      -extern int pthread_barrierattr_destroy();
 453      -extern int pthread_barrierattr_setpshared();
 454      -extern int pthread_barrierattr_getpshared();
 455      -extern int pthread_barrier_init();
 456      -extern int pthread_barrier_destroy();
 457      -extern int pthread_barrier_wait();
 458      -
 459      -/* Historical names -- present only for binary compatibility */
 460      -extern int pthread_mutex_consistent_np();
 461      -extern int pthread_mutexattr_setrobust_np();
 462      -extern int pthread_mutexattr_getrobust_np();
 463      -
 464      -#endif  /* __STDC__ */
 465      -
 466  340  #endif  /* _ASM */
 467  341  
 468  342  #ifdef  __cplusplus
 469  343  }
 470  344  #endif
 471  345  
 472  346  #endif  /* _PTHREAD_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX