Форум программистов, компьютерный форум, киберфорум
C/С++ под Linux
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.92/13: Рейтинг темы: голосов - 13, средняя оценка - 4.92
mari_k

Системный вызов для определения состояния процесса

21.08.2012, 15:42. Показов 2435. Ответов 2
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
Здравствуйте, уважаемые форумчане! Помогите, пожалуйста, советом. Существует ли системный вызов в LINUX для определения состояния процесса? Заранее благодарю за любой отзыв.
Programming
Эксперт
39485 / 9562 / 3019
Регистрация: 12.04.2006
Сообщений: 41,671
Блог
21.08.2012, 15:42
Ответы с готовыми решениями:

Как создать класс для запуска процесса и отслеживания его дальнейшего состояния
Есть задание: Create class to launch and monitor win32 process. Class constructor accepts command line path and arguments. Class instance...

Подскажите системный вызов в linux для работы с клавиатурой
Здравствуйте, форумчане. Хочу написать консольную (консоль в буквенно-цифровом режиме) игру тетрис. Как написать саму игру проблем не...

Вызов формы для отображения процесса копирования
Вопрос такой есть две формы. Из первой я вызываю вторую, на которой происходит копирование с отображением в прогресбаре.Кароче при вызове...

2
0 / 0 / 0
Регистрация: 18.08.2012
Сообщений: 4
23.08.2012, 21:57
На счет системного вызова я не уверен, но мне кажется что такого просто нету, зато есть файл /proc/pid/stat


/proc/[pid]/stat
Status information about the process. This is used by ps(1). It is
defined in /usr/src/linux/fs/proc/array.c.

The fields, in order, with their proper scanf(3) format specifiers,
are:

pid %d The process ID.

comm %s The filename of the executable, in parentheses. This is
visible whether or not the executable is swapped out.

state %c One character from the string "RSDZTW" where R is running,
S is sleeping in an interruptible wait, D is waiting in
uninterruptible disk sleep, Z is zombie, T is traced or
stopped (on a signal), and W is paging.

ppid %d The PID of the parent.

pgrp %d The process group ID of the process.

session %d The session ID of the process.

tty_nr %d The controlling terminal of the process. (The minor device
number is contained in the combination of bits 31 to 20 and
7 to 0; the major device number is in bits 15 to 8.)

tpgid %d The ID of the foreground process group of the controlling
terminal of the process.

flags %u (%lu before Linux 2.6.22)
The kernel flags word of the process. For bit meanings,
see the PF_* defines in <linux/sched.h>. Details depend on
the kernel version.

minflt %lu The number of minor faults the process has made which have
not required loading a memory page from disk.

cminflt %lu The number of minor faults that the process's waited-for
children have made.

majflt %lu The number of major faults the process has made which have
required loading a memory page from disk.

cmajflt %lu The number of major faults that the process's waited-for
children have made.

utime %lu Amount of time that this process has been scheduled in user
mode, measured in clock ticks (divide by
sysconf(_SC_CLK_TCK). This includes guest time, guest_time
(time spent running a virtual CPU, see below), so that
applications that are not aware of the guest time field do
not lose that time from their calculations.

stime %lu Amount of time that this process has been scheduled in
kernel mode, measured in clock ticks (divide by
sysconf(_SC_CLK_TCK).

cutime %ld Amount of time that this process's waited-for children have
been scheduled in user mode, measured in clock ticks
(divide by sysconf(_SC_CLK_TCK). (See also times(2).)
This includes guest time, cguest_time (time spent running a
virtual CPU, see below).

cstime %ld Amount of time that this process's waited-for children have
been scheduled in kernel mode, measured in clock ticks
(divide by sysconf(_SC_CLK_TCK).

priority %ld
(Explanation for Linux 2.6) For processes running a real-
time scheduling policy (policy below; see
sched_setscheduler(2)), this is the negated scheduling
priority, minus one; that is, a number in the range -2 to
-100, corresponding to real-time priorities 1 to 99. For
processes running under a non-real-time scheduling policy,
this is the raw nice value (setpriority(2)) as represented
in the kernel. The kernel stores nice values as numbers in
the range 0 (high) to 39 (low), corresponding to the user-
visible nice range of -20 to 19.

Before Linux 2.6, this was a scaled value based on the
scheduler weighting given to this process.

nice %ld The nice value (see setpriority(2)), a value in the range
19 (low priority) to -20 (high priority).

num_threads %ld
Number of threads in this process (since Linux 2.6).
Before kernel 2.6, this field was hard coded to 0 as a
placeholder for an earlier removed field.

itrealvalue %ld
The time in jiffies before the next SIGALRM is sent to the
process due to an interval timer. Since kernel 2.6.17,
this field is no longer maintained, and is hard coded as 0.

starttime %llu (was %lu before Linux 2.6)
The time in jiffies the process started after system boot.

vsize %lu Virtual memory size in bytes.

rss %ld Resident Set Size: number of pages the process has in real
memory. This is just the pages which count toward text,
data, or stack space. This does not include pages which
have not been demand-loaded in, or which are swapped out.

rsslim %lu Current soft limit in bytes on the rss of the process; see
the description of RLIMIT_RSS in getpriority(2).

startcode %lu
The address above which program text can run.

endcode %lu The address below which program text can run.

startstack %lu
The address of the start (i.e., bottom) of the stack.

kstkesp %lu The current value of ESP (stack pointer), as found in the
kernel stack page for the process.

kstkeip %lu The current EIP (instruction pointer).

signal %lu The bitmap of pending signals, displayed as a decimal
number. Obsolete, because it does not provide information
on real-time signals; use /proc/[pid]/status instead.

blocked %lu The bitmap of blocked signals, displayed as a decimal
number. Obsolete, because it does not provide information
on real-time signals; use /proc/[pid]/status instead.

sigignore %lu
The bitmap of ignored signals, displayed as a decimal
number. Obsolete, because it does not provide information
on real-time signals; use /proc/[pid]/status instead.

sigcatch %lu
The bitmap of caught signals, displayed as a decimal
number. Obsolete, because it does not provide information
on real-time signals; use /proc/[pid]/status instead.

wchan %lu This is the "channel" in which the process is waiting. It
is the address of a system call, and can be looked up in a
namelist if you need a textual name. (If you have an up-
to-date /etc/psdatabase, then try ps -l to see the WCHAN
field in action.)

nswap %lu Number of pages swapped (not maintained).

cnswap %lu Cumulative nswap for child processes (not maintained).

exit_signal %d (since Linux 2.1.22)
Signal to be sent to parent when we die.

processor %d (since Linux 2.2.8)
CPU number last executed on.

rt_priority %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
Real-time scheduling priority, a number in the range 1 to
99 for processes scheduled under a real-time policy, or 0,
for non-real-time processes (see sched_setscheduler(2)).

policy %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
Scheduling policy (see sched_setscheduler(2)). Decode
using the SCHED_* constants in linux/sched.h.

delayacct_blkio_ticks %llu (since Linux 2.6.18)
Aggregated block I/O delays, measured in clock ticks
(centiseconds).

guest_time %lu (since Linux 2.6.24)
Guest time of the process (time spent running a virtual CPU
for a guest operating system), measured in clock ticks
(divide by sysconf(_SC_CLK_TCK).

cguest_time %ld (since Linux 2.6.24)
Guest time of the process's children, measured in clock
ticks (divide by sysconf(_SC_CLK_TCK).
http://www.google.com.ua/url?s... ZH2mzMRM2A
0
Временно недоступен
 Аватар для #pragma
957 / 228 / 14
Регистрация: 12.04.2009
Сообщений: 926
25.08.2012, 02:28
Может, тут что-то есть?
Bash
1
man 2 syscalls
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
inter-admin
Эксперт
29715 / 6470 / 2152
Регистрация: 06.03.2009
Сообщений: 28,500
Блог
25.08.2012, 02:28
Помогаю со студенческими работами здесь

Определения скорости передачи и приема по сети для процесса в Windows
Как определить скорость передачи и приема данный по сети (Ethernet, Wi-Fi) для процесса в WIndows. Как на картинке надо Не...

Установка Microsoft Office - логирование процесса установки для определения причины неполадок
В этой теме описывается,процесс логирования установки Microsof Office. 1. Нужно включить подробное введение журнала,где будет описан...

Вызов функции для определения максимального и мин значения в массиве
Выдает ошибку на строках:r = maxima(a ); и k = minima(a); что делать? #include &quot;iostream&quot; using namespace std; int main()...

Контроль состояния процесса
Доброго времени!!!!! пожалуйста помогите!!! очень нужно. запуская процесс следующим образом: string pathCompiler =...

Проверка состояния процесса.
У меня задача проверять состояние выбранного процесса - работает, приостановлен и т.п. По результату проверки выводить сообщение о его...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
3
Ответ Создать тему
Новые блоги и статьи
Архитектура слоя интернета для сервера-слоя.
Hrethgir 11.04.2026
В продолжение https:/ / www. cyberforum. ru/ blogs/ 223907/ 10860. html Знаешь что я подумал? Раз мы все источники пишем в голове ветки, то ничего не мешает добавить в голову такой источник, который сам. . .
Подстановка значения реквизита справочника в табличную часть документа
Maks 10.04.2026
Алгоритм из решения ниже реализован на примере нетипового документа "ПланированиеПерсонала", разработанного в конфигурации КА2. Задача: при выборе сотрудника (справочник Сотрудники) в ТЧ документа. . .
Очистка реквизитов документа при копировании
Maks 09.04.2026
Алгоритм из решения ниже применим как для типовых, так и для нетиповых документов на самых различных конфигурациях. Задача: при копировании документа очищать определенные реквизиты и табличную. . .
модель ЗдравоСохранения 8. Подготовка к разному выполнению заданий
anaschu 08.04.2026
https:/ / github. com/ shumilovas/ med2. git main ветка * содержимое блока дэлэй из старой модели теперь внутри зайца новой модели 8ATzM_2aurI
Блокировка документа от изменений, если он открыт у другого пользователя
Maks 08.04.2026
Алгоритм из решения ниже реализован на примере нетипового документа, разработанного в конфигурации КА2. Задача: запретить редактирование документа, если он открыт у другого пользователя. / / . . .
Система безопасности+живучести для сервера-слоя интернета (сети). Двойная привязка.
Hrethgir 08.04.2026
Далее были размышления о системе безопасности. Сообщения с наклонным текстом - мои. А как нам будет можно проверить, что ссылка наша, а не подделана хулиганами, которая выбросит на другую ветку и. . .
Модель ЗдрввоСохранения 7: больше работников, больше ресурсов.
anaschu 08.04.2026
работников и заданий может быть сколько угодно, но настроено всё так, что используется пока что только 20% kYBz3eJf3jQ
Дальние перспективы сервера - слоя сети с космологическим дизайном интефейса карты и логики.
Hrethgir 07.04.2026
Дальнейшее ближайшее планирование вывело к размышлениям над дальними перспективами. И вот тут может быть даже будут нужны оценки специалистов, так как в дальних перспективах всё может очень сильно. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru