proc_mobility_base_set Subroutine
Purpose
Sets or unsets attributes used by AIX® Live Update to indicate that the current process is a base process.
Library
Standard C library (libc.a)
Syntax
#include <sys/mobility.h>
Description
The proc_mobility_base_set subroutine can be used to register the calling process as a base process for a Live Update operation.
Base processes are those that are not saved and migrated during a Live Update operation. The base processes are left behind on the original logical partition (LPAR), rather than being migrated to the surrogate LPAR.
Only a process that is a child of the init process can be registered as a base process. Otherwise, error code EINVAL is returned.
proc_mobility_base_set subroutine can be used to register a base process only while a Live Kernel Update (LKU), is in progress. If there is no LKU in progress, error code EAGAIN is returned
Parameters
Item | Description |
---|---|
pid | Process ID to act upon. The value 0 indicates the current process. If a non-zero value is specified, it must match the PID of the calling process. |
flag | MOBILITY_BASE_PROCESS flag sets the base attribute. The value 0 is used to unset the base attribute. |
Return Values
Item | Description |
---|---|
0 | Success |
1 | Error |
Error Codes
Error Code | Description |
---|---|
ENOSYS | No mobility system in place. |
ESRCH | No such process. |
EINVAL | Input arguments not valid. |
EAGAIN | No LKU, is under progress |
Example
#include <stdio.h>
#include <sys/mobility.h>
int main(int argc, char *argv[])
{
int rc = 0;
pid_t pid = getpid();
/* Mark this process as a base process */
rc = proc_mobility_base_set(0, MOBILITY_BASE_PROCESS);
if (rc) {
printf(“proc_mobility_base_set failed, errno %d\n”, errno);
exit(-1);
}
printf(“Process %d is now marked as a base process.\n”, pid);
}