标题: chapter8 进程控制 [打印本页] 作者: 1032120121 时间: 2010-01-23 09:52 标题: chapter8 进程控制 pid_t getpid(void); return:process ID
pid_t getppid(void); return:parent process ID
uid_t getuid(void); ret:real user ID
uid_t geteuid(void); ret:effective user ID
gid_t getgid(void); ret:real group ID
gid_t getegid(void); ret:effective group ID
int waitid(idtype_t idtype, id_t id, siginfo_t* infop, int options);返回:0 or -1
/*Only Solaris supports for waitid, this function is used to simplify waitpid()*/
#include ///
int wait3(int* statloc, int options, struct rusage* rusage);
int wait4(pid_t pid, int* statloc, int options, struct rusage* rusage);
ret:process ID/-1
int execl(const char* pathname, const char* arg0,.../*(char*)0*/);
int execv(const char* pathname, char* const argv[]);
int execle(const char* pathname, const char* arg0,...
/*(char*)0, char* const envp[]*/);
int execve(const char* pathname, char* const argv[], char* const envp[]);
int execlp(const char* filename, const char* arg0,../*(char*)0*/);
int execvp(const char* filename, char* const argv[]);
ret:no return on seccess, -1 on error
int setuid(uid_t uid);
int setgid(gid_t gid);
ret:0/-1
int setreuid(uid_t ruid, uid_t euid);
int setregid(gid_t rgid, gid_t egid);
ret:0/-1
int seteuid(uid_t uid);
int setegid(gid_t gid);
ret:0/-1