CPU usage and memory usage

Please tell me solaris functions/api for getting following information

1- Function that tells how much memory used by current process
2- Function that tells how much memory used by all running processes
3- Function that tells how much CPU is used by current process
4- Function that tells how much CPU is used by all running process.

Please tell me as soon as possible..

getrusage() for the current process.