Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
User Commandsprctl(1)


NAME

 prctl - get or set the resource controls of running processes, tasks, and projects

SYNOPSIS

 prctl [-t [ basic | privileged | system]] [ -e | -d action] [-rx] [ -n name [-v value] ] [-i idtype] [id ...]

DESCRIPTION

 

The prctl utility allows the examination and modification of the resource controls associated with an active process, task, or project on the system. It allows access to the basic and privileged limits on the specified entity.

OPTIONS

 

The following options are supported:

-d | -e action
Disables (-d) or enables (-e) the specified action on the specified resource control. The special token all is valid with the disable option to deactivate all actions on the given resource control value.

The other defined actions for a resource are deny and signal=signum. The deny action indicates that the resource control encountered will attempt to deny granting the resource to the process, task, or project on a request for resources in excess of the value provided by the -v option for the new resource control. In the signal=signum action, signum is a signal number (or string representation of a signal). deny actions may not be activated or deactivated if global flags indicate that the deny action is unchangeable.

-i idtype
Specifies the type of the id operands. Valid idtypes are process, task, or project. The default id type, if the -i option is omitted, is process.
-n name
Specifies the name of the resource control to get or set. If the name is unspecified, all resource controls are retrieved.
-r
Replaces the first resource control value (matching with the -t privilege) with the new value specified through the -v option.
-t [ basic | privileged | system ]
Specifies which resource control type to set. Unless the "lowerable" flag is set for a resource control, only invocations by users (or setuid programs) who have privileges equivalent to those of root can modify privileged resource controls. See rctlblk_set_value(3C) for a description of the RCTL_GLOBAL_LOWERABLE flag. If the type is not specified, basic is assumed. For a get operation, the values of all resource control types, including system, are displayed if no type is specified.
-v value
Specifies the value for the resource control for a set operation. If no value is specified, then the modification (deletion, action enabling or disabling) will be carried out on the lowest-valued resource control with the given type.
-x
Deletes the specified resource control value. If the delete option is not provided, the default operation of prctl is to modify a resource control value of matching value and privilege, or insert a new value with the given privilege. The matching criteria are discussed more fully in setrctl(2).

If none of the -d, -e, -v, or -x options is specified, the invocation is considered a get operation.

OPERANDS

 

The following operand is supported:

id
The ID of the entity (process, task, or project) to interrogate. If the invoking user's credentials are unprivileged and the entity being interrogated possesses different credentials, the operation will fail. If no id is specified, an error message is returned.

EXAMPLES

 Example 1. Displaying current resource control settings for a specific process
 
 
example$ pgrep sort
     111759
     example$ prctl 111759
     111759: /usr/bin/sort
     process.max-address-space         [ lowerable deny no-local-action ]
         18446744073709551615 privileged deny           
         18446744073709551615 system     deny           
     process.max-file-descriptor       [ lowerable deny ]
                          256 basic      deny           
                        65536 privileged deny           
                   2147483647 system     deny           
     process.max-core-size             [ lowerable deny no-local-action ]
              18446744073709551615 privileged deny           
         18446744073709551615 system     deny           
     process.max-stack-size            [ lowerable deny no-local-action ]
                      8388608 basic      deny           
          9223372036854775807 privileged deny           
          9223372036854775807 system     deny           
     process.max-data-size             [ lowerable deny no-local-action ]
         18446744073709551615 privileged deny           
         18446744073709551615 system     deny           
     process.max-file-size             [ lowerable deny file-size ]
          9223372036854775807 privileged signal=XFSZ deny  
          9223372036854775807 system     deny           
     process.max-cpu-time              [ lowerable no-deny cpu-time ]
         18446744073709551615 privileged signal=XCPU    
         18446744073709551615 system     deny           [ infinite ]
     task.max-cpu-time                 [ no-deny cpu-time ]
         18446744073709551615 system     deny           [ infinite ]
     task.max-lwps                    
                   2147483647 system     deny           
     project.cpu-shares                [ no-basic no-local-action ]
                           10 privileged none           
                        65535 system     deny
Example 2. Displaying, replacing, and verifying the value of a specific control on an existing project
 
 
example# prctl -n project.cpu-shares -i project group.staff
     111788: ksh
     project.cpu-shares                [ no-basic no-local-action ]
                            1 privileged none           
                        65535 system     deny           
     # prctl -n project.cpu-shares -v 10 -r -i project group.staff
     # prctl -n project.cpu-shares -i project group.staff
     111788: ksh
     project.cpu-shares                [ no-basic no-local-action ]
                           10 privileged none           
                        65535 system     deny

EXIT STATUS

 

The following exit values are returned:

0
Success.
1
Fatal error encountered.
2
Invalid command line options were specified.

FILES

 
/proc/pid/*
process information and control files

ATTRIBUTES

 

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
AvailabilitySUNWesu

SEE ALSO

 

rctladm(1M), setrctl(2), rctlblk_get_local_action(3C), attributes(5)


SunOS 5.9Go To TopLast Changed 28 Aug 2001

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.