All the APIs except set_rc_functions were defined in [6]. But we have added the pid argument to get_rc and set_res_binding to make them more useful. pid was required as the argument to control the resources allocated to the processes which do not use the APIs (eg. an already existing application). This also gives the system administrator more control.
This creates a new resource container and associates a file descriptor for the process with it. It returns the descriptor.
This returns a descriptor for the resource container to which the process pid is bound. If pid is zero, the descriptor of the container of the calling process is returned. The permissions for obtaining the resource container descriptor of a process is the same as that of sending a signal to the process (ie. the calling process must either have root privileges, or the real or effective user ID of the sending process must equal the real or saved set-user-ID of the target process). This will return a new descriptor every time this function is called.
Sets the parent of the resource container corresponding to rcd1 to that of rcd2. It also checks whether the resources can be allocated to the child container from the new parent before changing the parent. It changes the scheduling parameters of the old parent, the new parent and the child container to reflect the change. The child container is removed from the binding list of the old parent and added to that of the new parent. This is used to add a newly created container to the resource container hierarchy, or to change the structure of the hierarchy.
Sets the resource binding of the process pid to the resource container corresponding to rcd. If pid is zero, the scheduler binding of the calling process is changed. Any future processing done by the process task will be charged to the new container. The task is removed from the scheduler bindings of the old container and inserted into that of the new container. Scheduling parameters of the containers are changed. The need_resched attribute of the task structure is set so that the task is preempted at the earliest safe point. The permissions to change the scheduler binding is the same as that of sending a signal.
This binds the open file or socket corresponding to fd to the resource container corresponding to rcd. All the future processing for the file will be charged to the new container.
Sets/gets the options of a resource container. Options includes scheduling parameters, statistics flags etc. rcopt is a structure that contains attribute type and attribute value as the fields.
Sets the class specific scheduler functions and update function of a resource container. rcfunc is a structure containing the function names. This allows a privileged user to load a module containing the functions and call this system call to use these functions.