Print this page
195 Need replacement for nfs/lockd+klm

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/fs.d/nfs/lib/smfcfg.c
          +++ new/usr/src/cmd/fs.d/nfs/lib/smfcfg.c
↓ open down ↓ 10 lines elided ↑ open up ↑
  11   11   * and limitations under the License.
  12   12   *
  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 (c) 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  23   25   */
  24   26  #include <stdio.h>
  25   27  #include <stdlib.h>
  26   28  #include <syslog.h>
  27   29  #include <stdarg.h>
  28   30  #include "smfcfg.h"
  29   31  
  30   32  fs_smfhandle_t *
  31   33  fs_smf_init(char *fmri, char *instance)
  32   34  {
↓ open down ↓ 318 lines elided ↑ open up ↑
 351  353  
 352  354  
 353  355  int
 354  356  nfs_smf_get_prop(char *prop_name, char *propbuf, char *instance,
 355  357      scf_type_t sctype, char *svc_name, int *bufsz)
 356  358  {
 357  359          return (fs_smf_get_prop(NFS_SMF, prop_name, propbuf,
 358  360              instance, sctype, svc_name, bufsz));
 359  361  }
 360  362  
      363 +/* Get an integer (base 10) property */
      364 +int
      365 +nfs_smf_get_iprop(char *prop_name, int *rvp, char *instance,
      366 +    scf_type_t sctype, char *svc_name)
      367 +{
      368 +        char propbuf[32];
      369 +        int bufsz, rc, val;
      370 +
      371 +        bufsz = sizeof (propbuf);
      372 +        rc = fs_smf_get_prop(NFS_SMF, prop_name, propbuf,
      373 +            instance, sctype, svc_name, &bufsz);
      374 +        if (rc != SA_OK)
      375 +                return (rc);
      376 +        errno = 0;
      377 +        val = strtol(propbuf, NULL, 10);
      378 +        if (errno != 0)
      379 +                return (SA_BAD_VALUE);
      380 +        *rvp = val;
      381 +        return (SA_OK);
      382 +}
      383 +
 361  384  int
 362  385  nfs_smf_set_prop(char *prop_name, char *value, char *instance,
 363  386      scf_type_t type, char *svc_name)
 364  387  {
 365  388          return (fs_smf_set_prop(NFS_SMF, prop_name, value, instance,
 366  389              type, svc_name));
 367  390  }
 368  391  
 369  392  int
 370  393  autofs_smf_set_prop(char *prop_name, char *value, char *instance,
↓ open down ↓ 23 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX