Print this page
code review feeback, close open comment
first round of POSIX 2008 stuff

Split Close
Expand all
Collapse all
          --- old/usr/src/head/ucontext.h
          +++ new/usr/src/head/ucontext.h
↓ open down ↓ 18 lines elided ↑ open up ↑
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*      Copyright (c) 1988 AT&T */
  22   22  /*        All Rights Reserved   */
  23   23  
  24   24  
  25   25  /*
  26   26   * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  27   27   * Use is subject to license terms.
  28   28   */
       29 +/*
       30 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
       31 + */
  29   32  
  30   33  #ifndef _UCONTEXT_H
  31   34  #define _UCONTEXT_H
  32   35  
  33   36  #include <sys/ucontext.h>
  34   37  
  35   38  #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
  36   39  #include <sys/siginfo.h>
  37   40  #endif
  38   41  
  39   42  #ifdef  __cplusplus
  40   43  extern "C" {
  41   44  #endif
  42   45  
       46 +/*
       47 + * Arguably, under _XPG7, applications should not even include this
       48 + * header, since it isn't part of Issue 7.  We apply some paranoia for
       49 + * the functions that were explicity removed, although we could likely
       50 + * just ignore the darn thing altogether.
       51 + */
       52 +#if (!defined(_STRICT_SYMBOLS)) || (defined(_XPG4_2) && !defined(_XPG7))
       53 +
  43   54  #ifdef __sparc
  44   55  #ifdef __PRAGMA_REDEFINE_EXTNAME
  45   56  #pragma redefine_extname        makecontext     __makecontext_v2
  46   57  #else
  47   58  #define makecontext     __makecontext_v2
  48   59  #endif
  49   60  #endif
  50   61  
  51      -#if defined(__STDC__)
  52      -
  53   62  extern int getcontext(ucontext_t *) __RETURNS_TWICE;
  54   63  #pragma unknown_control_flow(getcontext)
  55   64  extern int setcontext(const ucontext_t *) __NORETURN;
  56   65  extern int swapcontext(ucontext_t *_RESTRICT_KYWD,
  57   66                  const ucontext_t *_RESTRICT_KYWD);
  58   67  extern void makecontext(ucontext_t *, void(*)(), int, ...);
       68 +#endif /* !_STRICT_SYMBOLS || _XGP4_2 && ! _XPG7 */
       69 +
  59   70  #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
  60   71  extern int walkcontext(const ucontext_t *, int (*)(uintptr_t, int, void *),
  61   72      void *);
  62   73  extern int printstack(int);
  63   74  extern int addrtosymstr(void *, char *, int);
  64   75  extern int getustack(stack_t **);
  65   76  extern int setustack(stack_t *);
  66   77  
  67   78  extern int stack_getbounds(stack_t *);
  68   79  extern int stack_setbounds(const stack_t *);
  69   80  extern int stack_inbounds(void *);
  70   81  extern int stack_violation(int, const siginfo_t *, const ucontext_t *);
  71   82  
  72   83  extern void *_stack_grow(void *);
  73   84  #endif
  74      -#else
  75   85  
  76      -extern int getcontext() __RETURNS_TWICE;
  77      -#pragma unknown_control_flow(getcontext)
  78      -extern int setcontext();
  79      -extern int swapcontext();
  80      -extern void makecontext();
  81      -#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
  82      -extern int walkcontext();
  83      -extern int printstack();
  84      -extern int addrtosymstr();
  85      -extern int getustack();
  86      -extern int setustack();
  87      -
  88      -extern int stack_getbounds();
  89      -extern int stack_setbounds();
  90      -extern int stack_inbounds();
  91      -extern int stack_violation();
  92      -
  93      -extern void *_stack_grow();
  94      -#endif
  95      -#endif
  96      -
  97   86  #ifdef  __cplusplus
  98   87  }
  99   88  #endif
 100   89  
 101   90  #endif  /* _UCONTEXT_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX