The Linux Programming Interface
POSIX Message Queues 1077 numRead = mq_receive(mqd, buffer, attr.mq_msgsize, &prio); if (numRead == -1) errExit("mq_receive" ...
1078 Chapter 52 or marking the message queue descriptor nonblocking and performing periodic mq_receive() calls (“polls”) on the ...
POSIX Message Queues 1079 struct sigevent { int sigev_notify; /* Notification method */ int sigev_signo; /* Notification signal ...
1080 Chapter 52 notification has occurred. At this point, the process will have been deregis- tered for message notification. b) ...
POSIX Message Queues 1081 sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sa.sa_handler = handler; if (sigaction(NOTIFY_SIG, & ...
1082 Chapter 52 52.6.2 Receiving Notification via a Thread Listing 52-7 provides an example of message notification using thread ...
POSIX Message Queues 1083 e sev.sigev_notify = SIGEV_THREAD; /* Notify via thread */ sev.sigev_notify_function = threadFunc; sev ...
1084 Chapter 52 Displaying and deleting message queue objects via the command line In Chapter 51, we mentioned that POSIX IPC ob ...
POSIX Message Queues 1085 The QSIZE field is a count of the total number of bytes of data in the queue. The remaining fields rel ...
1086 Chapter 52 As well as the above SUSv3-specified limits, Linux provides a number of /proc files for viewing and (with privil ...
POSIX Message Queues 1087 However, POSIX message queues also have some disadvantages compared to Sys- tem V message queues: z PO ...
1088 Chapter 52 52-6. Replace the use of a signal handler in Listing 52-6 (mq_notify_sig.c) with the use of sigwaitinfo(). Upon ...
Chapter 53: POSIX Semaphores This chapter describes POSIX semaphores, which allow processes and threads to synchronize access to ...
1090 Chapter 53 POSIX semaphores operate in a manner similar to System V semaphores; that is, a POSIX semaphore is an integer wh ...
POSIX Semaphores 1091 The name argument identifies the semaphore. It is specified according to the rules given in Section 51.1. ...
1092 Chapter 53 The following shell session log demonstrates the use of this program. We first use the umask command to deny all ...
POSIX Semaphores 1093 if (optind >= argc) usageError(argv[0]); /* Default permissions are rw-------; default semaphore initia ...
1094 Chapter 53 Listing 53-2: Using sem_unlink() to unlink a POSIX named semaphore ––––––––––––––––––––––––––––––––––––––––––––– ...
POSIX Semaphores 1095 If the semaphore currently has a value greater than 0, sem_wait() returns immedi- ately. If the value of t ...
1096 Chapter 53 If a sem_timedwait() call times out without being able to decrement the semaphore, then the call fails with the ...
«
52
53
54
55
56
57
58
59
60
61
»
Free download pdf