Читаем Programming with POSIX® Threads полностью

Locate an entry from the group database with a group name matching the name argument. The group entry is stored in the memory pointed to by buffer, which contains bufsize bytes, and a pointer to the entry is stored at the address pointed to by result. The maximum buffer size required can be determined by calling sysconf with the _SC_GETGR_R_SIZE_MAX parameter.

References: 6.5.6 Headers: ,

Errors: [ERANGE] the specified buffer is too small.

getpwuid_r

int getpwuid_r (

uid_t uid,

struct passwd *pwd,

char *buffer,

size_t bufsize,

struct passwd **result);

Locate an entry from the user database with a user id matching the uid argument. The user entry is stored in the memory pointed to by buffer, which contains bufsize bytes, and a pointer to the entry is stored at the address pointed to by result. The maximum buffer size required can be determined by calling sysconf with the _SC_GETPW_R_SIZE_MAX parameter.

References: 6.5.6

Headers: ,

Errors: [ERANGE ] the specified buffer is too small.

getpwnam_r

int getpwnam_r (

const char *name,

struct passwd *pwd,

char *buffer,

size_t bufsize,

struct passwd **result);

Locate an entry from the user database with a user name matching the name argument. The user entry is stored in the memory pointed to by buffer, which contains bufsize bytes, and a pointer to the entry is stored at the address pointed to by result. The maximum buffer size required can be determined by calling sysconf with the _SC_GETPW_R_SIZE_MAX parameter.

References: 6.5.6

Headers: ,

Errors: [ERANGE] the specified buffer is too small.

<p>9.3.12 Signals</p>

Pthreads provides functions that extend the POSIX signal model to support multithreaded processes. All threads in a process share the same signal actions. Each thread has its own pending and blocked signal masks. The process also has a pending signal mask so that asynchronous signals can pend against the process when all threads have the signal blocked. In a multithreaded process, the behavior of sigprocmask is undefined.

pthread_kill

int pthread_kill (

pthread_t thread,

int sig) ;

Request that the signal sig be delivered to thread. If sig is 0, no signal is sent, but error checking is performed. If the action of the signal is to terminate, stop, or continue, then the entire process is affected.

References: 6.6.3 Headers: 

Errors: [ESRCH] no thread corresponding to thread.

[EINVAL] sig is an invalid signal number. Hint: To terminate a thread, use cancellation.

pthread_sigmask

int pthread_sigmask (

int how,

const sigset_t *set,

sigset_t *oset);

Control the masking of signals within the calling thread.

how

References: 6.6.2 Headers: 

Errors: [EINVAL] how is not one of the defined values.

Hint: You cannot prevent delivery of asynchronous signals to the process

unless the signal is blocked in all threads.

sigtimedwait

int sigtimedwait (

const sigset_t *set,

siginfo_t *info,

const struct timespec *timeout);

If a signal in set is pending, atomically clear it from the set of pending signals and return the signal number in the si_signo member of info. The cause of the signal

how
SIG_BLOCKResulting set is the union of the
current set and the argument set.
SIG_UNBLOCKResulting set is the intersection of
the current set and the argument
set.
SIG__SETMASKResulting set is the set pointed to
by the argument set.

shall be stored in the si_code member. If any value is queued to the selected signal, return the first queued value in the si_value member. If no signal in set is pending, suspend the calling thread until one or more become pending. If the time interval specified by timeout passes, sigtimedwait will return with the error EAGAIN. This function returns the signal number—on error, it returns -1 and sets errno to the appropriate error code.

References: 6.6.4 Headers: 

Errors: [EINVAL] set contains an invalid signal number.

[EAGAIN] the timeout interval passed.

[ENOSYS] realtime signals are not supported. Hint: Use only for asynchronous signal delivery. All signals in set must

be masked in the calling thread, and should usually be masked in

all threads.

sigwait

int sigwait (

const sigset_t *set, int *sig);

If a signal in set is pending, atomically clear it from the set of pending signals and return the signal number in the location referenced by sig. If no signal in set is pending, suspend the calling thread until one or more become pending.

References: 6.6.4 Headers: 

Errors: [EINVAL] set contains an invalid signal number.

Hint: Use only for asynchronous signal delivery. All signals in set must

be masked in the calling thread, and should usually be masked in

all threads.

sigwaitinfo

int sigwaitinfo (

const sigset_t *set, siginfo_t *info);

Перейти на страницу:

Похожие книги

1С: Бухгалтерия 8 с нуля
1С: Бухгалтерия 8 с нуля

Книга содержит полное описание приемов и методов работы с программой 1С:Бухгалтерия 8. Рассматривается автоматизация всех основных участков бухгалтерии: учет наличных и безналичных денежных средств, основных средств и НМА, прихода и расхода товарно-материальных ценностей, зарплаты, производства. Описано, как вводить исходные данные, заполнять справочники и каталоги, работать с первичными документами, проводить их по учету, формировать разнообразные отчеты, выводить данные на печать, настраивать программу и использовать ее сервисные функции. Каждый урок содержит подробное описание рассматриваемой темы с детальным разбором и иллюстрированием всех этапов.Для широкого круга пользователей.

Алексей Анатольевич Гладкий

Программирование, программы, базы данных / Программное обеспечение / Бухучет и аудит / Финансы и бизнес / Книги по IT / Словари и Энциклопедии
1С: Управление торговлей 8.2
1С: Управление торговлей 8.2

Современные торговые предприятия предлагают своим клиентам широчайший ассортимент товаров, который исчисляется тысячами и десятками тысяч наименований. Причем многие позиции могут реализовываться на разных условиях: предоплата, отсрочка платежи, скидка, наценка, объем партии, и т.д. Клиенты зачастую делятся на категории – VIP-клиент, обычный клиент, постоянный клиент, мелкооптовый клиент, и т.д. Товарные позиции могут комплектоваться и разукомплектовываться, многие товары подлежат обязательной сертификации и гигиеническим исследованиям, некондиционные позиции необходимо списывать, на складах периодически должна проводиться инвентаризация, каждая компания должна иметь свою маркетинговую политику и т.д., вообщем – современное торговое предприятие представляет живой организм, находящийся в постоянном движении.Очевидно, что вся эта кипучая деятельность требует автоматизации. Для решения этой задачи существуют специальные программные средства, и в этой книге мы познакомим вам с самым популярным продуктом, предназначенным для автоматизации деятельности торгового предприятия – «1С Управление торговлей», которое реализовано на новейшей технологической платформе версии 1С 8.2.

Алексей Анатольевич Гладкий

Финансы / Программирование, программы, базы данных