Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
このような関数を作成したいのですが、優先順位があります。そのためにはpidが必要ですが、取得方法がわかりません。何か案が?
私は を使用するsetpriority (0, pid, value)ことですが、pidが必要です。
setpriority (0, pid, value)
void cmd_exec(char * tr[]) { if (execvp(tr[0], tr)== -1) perror("Error"); }
呼び出しプロセスのプロセス ID を取得するには、 を使用しますgetpid()。
getpid()
を見つけてください
Linux のマンページはこちら。
現在の(第 7 号) POSIX ドキュメントはこちら。