Print this page
2964 need POSIX 2008 locale object support
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Approved by: TBD

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/sgs/rtld/common/external.c
          +++ new/usr/src/cmd/sgs/rtld/common/external.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  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   23   * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  24   25   */
  25   26  
  26   27  /*
  27   28   * Implementation of all external interfaces between ld.so.1 and libc.
  28   29   *
  29   30   * This file started as a set of routines that provided synchronization and
  30   31   * locking operations using calls to libthread.  libthread has merged with libc
  31   32   * under the Unified Process Model (UPM), and things have gotten a lot simpler.
  32   33   * This file continues to establish and redirect various events within ld.so.1
  33   34   * to interfaces within libc.
↓ open down ↓ 626 lines elided ↑ open up ↑
 660  661  {
 661  662          extern ssize_t __read(int, void *, size_t);
 662  663          return (__read(fd, buf, size));
 663  664  }
 664  665  
 665  666  ssize_t
 666  667  write(int fd, const void *buf, size_t size)
 667  668  {
 668  669          extern ssize_t __write(int, const void *, size_t);
 669  670          return (__write(fd, buf, size));
      671 +}
      672 +
      673 +/*
      674 + * ASCII versions of ctype character classification functions.  This avoids
      675 + * pulling in the entire locale framework that is in libc.
      676 + */
      677 +
      678 +int
      679 +isdigit(int c)
      680 +{
      681 +        return ((c >= '0' && c <= '9') ? 1 : 0);
      682 +}
      683 +
      684 +int
      685 +isupper(int c)
      686 +{
      687 +        return ((c >= 'A' && c <= 'Z') ? 1 : 0);
      688 +}
      689 +
      690 +int
      691 +islower(int c)
      692 +{
      693 +        return ((c >= 'a' && c <= 'z') ? 1 : 0);
      694 +}
      695 +
      696 +int
      697 +isspace(int c)
      698 +{
      699 +        return (((c == ' ') || (c == '\t') || (c == '\r') || (c == '\n') ||
      700 +            (c == '\v') || (c == '\f')) ? 1 : 0);
      701 +}
      702 +
      703 +int
      704 +isxdigit(int c)
      705 +{
      706 +        return ((isdigit(c) || (c >= 'A' && c <= 'F') ||
      707 +            (c >= 'a' && c <= 'f')) ? 1 : 0);
      708 +}
      709 +
      710 +int
      711 +isalpha(int c)
      712 +{
      713 +        return ((isupper(c) || islower(c)) ? 1 : 0);
      714 +}
      715 +
      716 +int
      717 +isalnum(int c)
      718 +{
      719 +        return ((isalpha(c) || isdigit(c)) ? 1 : 0);
 670  720  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX