Print this page
    
8158 Want named threads API
9857 proc manpages should have LIBRARY section
    
      
        | Split | Close | 
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/man/man3proc/Plwp_getregs.3proc
          +++ new/usr/src/man/man3proc/Plwp_getregs.3proc
   1    1  .\"
   2    2  .\" This file and its contents are supplied under the terms of the
   3    3  .\" Common Development and Distribution License ("CDDL"), version 1.0.
   4    4  .\" You may only use this file in accordance with the terms of version
   5    5  .\" 1.0 of the CDDL.
   6    6  .\"
   7    7  .\" A full copy of the text of the CDDL should have accompanied this
   8    8  .\" source.  A copy of the CDDL is also available via the Internet at
   9    9  .\" http://www.illumos.org/license/CDDL.
  10   10  .\"
  11   11  .\"
  12   12  .\" Copyright 2015 Joyent, Inc.
  
    | ↓ open down ↓ | 12 lines elided | ↑ open up ↑ | 
  13   13  .\"
  14   14  .Dd May 11, 2016
  15   15  .Dt PLWP_GETREGS 3PROC
  16   16  .Os
  17   17  .Sh NAME
  18   18  .Nm Plwp_getfpregs ,
  19   19  .Nm Plwp_setfpregs ,
  20   20  .Nm Plwp_getregs ,
  21   21  .Nm Plwp_setregs
  22   22  .Nd get and set thread registers
  23      -.Sh SYNOPSIS
       23 +.Sh LIBRARY
  24   24  .Lb libproc
       25 +.Sh SYNOPSIS
  25   26  .In libproc.h
  26   27  .Ft int
  27   28  .Fo Plwp_getfpregs
  28   29  .Fa "struct ps_prochandle *P"
  29   30  .Fa "lwpid_t lwpid"
  30   31  .Fa "prfpregset_t *fpregs"
  31   32  .Fc
  32   33  .Ft int
  33   34  .Fo Plwp_setfpregs
  34   35  .Fa "struct ps_prochandle *P"
  35   36  .Fa "lwpid_t lwpid"
  36   37  .Fa "const prfpregset_t fpregs"
  37   38  .Fc
  38   39  .Ft int
  39   40  .Fo Plwp_getregs
  40   41  .Fa "struct ps_prochandle *P"
  41   42  .Fa "lwpid_t lwpid"
  42   43  .Fa "prpregset_t *gregs"
  43   44  .Fc
  44   45  .Ft int
  45   46  .Fo Plwp_setregs
  46   47  .Fa "struct ps_prochandle *P"
  47   48  .Fa "lwpid_t lwpid"
  48   49  .Fa "const prpregset_t gregs"
  49   50  .Fc
  50   51  .Sh DESCRIPTION
  51   52  The
  52   53  .Fn Plwp_getregs ,
  53   54  .Fn Plwp_setregs ,
  54   55  .Fn Plwp_getfpregs ,
  55   56  and
  56   57  .Fn Plwp_setfpregs
  57   58  functions allow one to get and set the general purpose and floating
  58   59  point registers from the thread
  59   60  .Fa lwpid
  60   61  in the process handle
  61   62  .Fa P .
  62   63  .Pp
  63   64  The
  64   65  .Fn Plwp_getfpregs
  65   66  function updates the structure pointed to by
  66   67  .Fa fpregs
  67   68  with the state and values of the floating point registers of the thread
  68   69  specified by
  69   70  .Fa lwpid .
  70   71  .Pp
  71   72  The
  72   73  .Fn Plwp_setfpregs
  73   74  function updates the floating point registers of the thread specified by
  74   75  .Fa lwpid
  75   76  to the register state contained in
  76   77  .Fa fpregs .
  77   78  .Pp
  78   79  The
  79   80  .Fn Plwp_getregs
  80   81  function updates the structure pointed to by
  81   82  .Fa gregs
  82   83  with the state and values of the general purpose registers of the thread
  83   84  specified by
  84   85  .Fa lwpid.
  85   86  .Pp
  86   87  The
  87   88  .Fn Plwp_setregs
  88   89  function updates the general purpose registers of the thread specified
  89   90  by
  90   91  .Fa lwpid
  91   92  to the register state contained in
  92   93  .Fa gregs .
  93   94  .Pp
  94   95  Processes must be stopped before obtaining the register state of
  95   96  individual threads.
  96   97  Processes may be stopped with
  97   98  .Xr Pstop 3PROC .
  98   99  The structures used for registers are described in
  99  100  .Xr proc 4
 100  101  and their defintions may be found in
 101  102  .In sys/regset.h .
 102  103  The definitions of these structures varies based on the architecture of
 103  104  the system and the running process.
 104  105  .Pp
 105  106  One may not set the register values of a process that is not an active
 106  107  process, e.g. a process handle that refers to a file or a core file.
 107  108  .Sh RETURN VALUES
 108  109  Upon successful completion, the
 109  110  .Fn Plwp_getregs ,
 110  111  .Fn Plwp_setregs ,
 111  112  .Fn Plwp_getfpregs ,
 112  113  and
 113  114  .Fn Plwp_setfpregs
 114  115  functions return
 115  116  .Sy 0
 116  117  and obtain or set the register state.
 117  118  Otherwise,
 118  119  .Sy -1
 119  120  is returned,
 120  121  .Sy errno
 121  122  is set to indicate the error, and the register state is not updated nor
 122  123  are the data pointers changed.
 123  124  .Sh ERRORS
 124  125  For a full list of possible errors also see the
 125  126  .Sy DIAGNOSTICS
 126  127  section in
 127  128  .Xr proc 4 .
 128  129  .Pp
 129  130  The
 130  131  .Fn Plwp_getregs ,
 131  132  .Fn Plwp_setregs ,
 132  133  .Fn Plwp_getfpregs ,
 133  134  and
 134  135  .Fn Plwp_setfpregs
 135  136  will fail if:
 136  137  .Bl -tag -width Er
 137  138  .It Er EBUSY
 138  139  The process handle
 139  140  .Fa P
 140  141  is not currently stopped.
 141  142  .It Er ENOENT
 142  143  There is no thread in
 143  144  .Fa P
 144  145  with id
 145  146  .Fa lwpid .
 146  147  .El
 147  148  .Sh INTERFACE STABILITY
 148  149  .Sy Uncommitted
 149  150  .Sh MT-LEVEL
 150  151  See
 151  152  .Sy LOCKING
 152  153  in
 153  154  .Xr libproc 3LIB .
 154  155  .Sh SEE ALSO
 155  156  .Xr libproc 3LIB ,
 156  157  .Xr proc 4
  
    | ↓ open down ↓ | 122 lines elided | ↑ open up ↑ | 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX