Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Тестовые примеры / ch8 / getproc
.C #include <iostream.h>
#include <sys/types.h>
#include <unistd.h>
int main ( )
{
cout << "Process PID: " << (int)getpid() << endl;
cout << "Process PPID: " << (int)getppid() << endl;
cout << "Process PGID: " << (int)getpgrp() << endl;
cout << "Process real-UID: " << (int)getuid() << endl;
cout << "Process real-GID: " << (int)getgid() << endl;
cout << "Process effective-UID: " << (int)geteuid() << endl;
cout << "Process effective-GID: " << (int)getegid() << endl;
return 0;
}
#include <sys/types.h>
#include <unistd.h>
int main ( )
{
cout << "Process PID: " << (int)getpid() << endl;
cout << "Process PPID: " << (int)getppid() << endl;
cout << "Process PGID: " << (int)getpgrp() << endl;
cout << "Process real-UID: " << (int)getuid() << endl;
cout << "Process real-GID: " << (int)getgid() << endl;
cout << "Process effective-UID: " << (int)geteuid() << endl;
cout << "Process effective-GID: " << (int)getegid() << endl;
return 0;
}