Establishing a connection

To be able to access a process or thread, you must first use the open() call to get a valid file descriptor. You can then use this file descriptor with the function calls listed below to access the process or thread.

Note: Open the file (/proc/pid/as), not the /proc/pid directory.

In order to read or write data from or to the process, you must have opened the file descriptor in the appropriate mode. You must also have appropriate privileges to open the particular process. By default:

Note: When you start procnto, you can use the -u option to specify the umask to use for entries in /proc/pid. The default is 0066; loosening this up can be a security problem.

Opening /proc/pid/as for read-only access succeeds, even if the file permissions would normally say that it should fail with an EACCES. However, the kernel marks the OCB as allowing only devctl() commands. This prevents unprivileged processes from examining a process's memory, but still allows a non-root pidin to display some useful information.

When you're done accessing the process or thread, you should close() the file descriptor.