Print this page
4146 getconf(1) does not support XATTR_ENABLED, XATTR_EXISTS, SATTR_ENABLED, SATTR_EXISTS keys
Reviewed by: Cedric Blancher <cedric.blancher@gmail.com>
Reviewed by: Irek Szczesniak <iszczesniak@gmail.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/getconf/getconf.c
          +++ new/usr/src/cmd/getconf/getconf.c
↓ open down ↓ 213 lines elided ↑ open up ↑
 214  214  
 215  215          /* UNIX 98 additions */
 216  216  
 217  217          _PC_ASYNC_IO,           "_POSIX_ASYNC_IO",      PATHCONF,  NOFLAGS,
 218  218          _PC_PRIO_IO,            "_POSIX_PRIO_IO",       PATHCONF,  NOFLAGS,
 219  219          _PC_SYNC_IO,            "_POSIX_SYNC_IO",       PATHCONF,  NOFLAGS,
 220  220  
 221  221          /* Large File Summit name (UNIX 98) */
 222  222  
 223  223          _PC_FILESIZEBITS,       "FILESIZEBITS",         PATHCONF,  NOFLAGS,
      224 +        _PC_XATTR_ENABLED,      "XATTR_ENABLED",        PATHCONF,  NOFLAGS,
      225 +        _PC_XATTR_EXISTS,       "XATTR_EXISTS",         PATHCONF,  NOFLAGS,
 224  226  
 225  227          /* UNIX 03 Additions */
 226  228  
 227  229          /* Advisory Information (ADV) */
 228  230          _PC_ALLOC_SIZE_MIN,     "POSIX_ALLOC_SIZE_MIN", PATHCONF,  NOFLAGS,
 229  231          _PC_REC_INCR_XFER_SIZE, "POSIX_REC_INCR_XFER_SIZE", PATHCONF,  NOFLAGS,
 230  232          _PC_REC_MAX_XFER_SIZE,  "POSIX_REC_MAX_XFER_SIZE",  PATHCONF,  NOFLAGS,
 231  233          _PC_REC_MIN_XFER_SIZE,  "POSIX_REC_MIN_XFER_SIZE",  PATHCONF,  NOFLAGS,
 232  234          _PC_REC_XFER_ALIGN,     "POSIX_REC_XFER_ALIGN", PATHCONF,  NOFLAGS,
 233  235  
 234  236          _PC_2_SYMLINKS,         "POSIX2_SYMLINKS",      PATHCONF,  NOFLAGS,
 235  237          _PC_SYMLINK_MAX,        "SYMLINK_MAX",          PATHCONF,  NOFLAGS,
 236  238  
      239 +        _PC_ACL_ENABLED,        "ACL_ENABLED",          PATHCONF,  NOFLAGS,
      240 +        _PC_MIN_HOLE_SIZE,      "MIN_HOLE_SIZE",        PATHCONF,  NOFLAGS,
      241 +        _PC_SATTR_ENABLED,      "SATTR_ENABLED",        PATHCONF,  NOFLAGS,
      242 +        _PC_SATTR_EXISTS,       "SATTR_EXISTS",         PATHCONF,  NOFLAGS,
      243 +
 237  244          /* UNIX 08 additions */
 238  245  
 239  246          _PC_TIMESTAMP_RESOLUTION, "_POSIX_TIMESTAMP_RESOLUTION",
 240  247              PATHCONF,   NOFLAGS,
 241  248  
 242  249          /* confstr() variables */
 243  250  
 244  251          /* POSIX.2-1992 description of getconf utility */
 245  252          _CS_PATH,               "PATH",                 CONFSTR,   NOFLAGS,
 246  253  
↓ open down ↓ 572 lines elided ↑ open up ↑
 819  826                          }
 820  827                  } else
 821  828                          (void) printf("%ld\n", value);
 822  829                  break;
 823  830  
 824  831          case CONFSTR:
 825  832                  if (argc > 2)
 826  833                          return (usage());
 827  834                  errno = 0;
 828  835                  len = confstr((int)scp->value, NULL, (size_t)0);
 829      -                if (len == 0)
      836 +                if (len == 0) {
 830  837                          if (errno == EINVAL) {
 831  838                                  (void) fprintf(stderr, gettext(INVAL_ARG),
 832  839                                      name);
 833  840                                  return (1);
 834  841                          } else {
 835  842                                  /* DO NOT TRANSLATE */
 836  843                                  (void) printf("undefined\n");
 837  844                                  return (0);
 838  845                          }
      846 +                }
 839  847                  /*
 840  848                   * allocate space to store result of constr() into
 841  849                   */
 842  850                  if ((buffer = malloc(len)) == NULL) {
 843  851                          (void) fprintf(stderr,
 844  852                              gettext("insufficient memory available"));
 845  853                          return (1);
 846  854                  }
 847  855  
 848  856                  assert(confstr((int)scp->value, buffer, len) != 0);
↓ open down ↓ 143 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX