The Linux Programming Interface
Chapter 51: Introduction to POSIX IPC........................................................................ The POSIX.1b realt ...
1058 Chapter 51 z Shared memory enables multiple processes to share the same region of memory. As with System V shared memory, P ...
Introduction to POSIX IPC 1059 On Linux, names for POSIX shared memory and message queue objects are limited to NAME_MAX (255) c ...
1060 Chapter 51 Depending on the type of object, oflag may also include one of the values O_RDONLY, O_WRONLY, or O_RDWR, with me ...
Introduction to POSIX IPC 1061 As with System V IPC, POSIX IPC objects have kernel persistence. Once cre- ated, an object contin ...
1062 Chapter 51 z Despite the SUSv3 specification for POSIX IPC object names, the various implementations follow different conve ...
Chapter 52: POSIX Message Queues This chapter describes POSIX message queues, which allow processes to exchange data in the form ...
1064 Chapter 52 52.1 Overview The main functions in the POSIX message queue API are the following: z The mq_open() function crea ...
POSIX Message Queues 1065 One of the purposes of the oflag argument is to determine whether we are opening an existing queue or ...
1066 Chapter 52 (We explain message queue descriptions in Section 52.3.) The child doesn’t inherit any of its parent’s message n ...
POSIX Message Queues 1067 if (argc != 2 || strcmp(argv[1], "--help") == 0) usageErr("%s mq-name\n", argv[0]); if (mq_unlink(argv ...
1068 Chapter 52 Figure 52-1 helps clarify a number of details of the use of message queue descrip- tors (all of which are analog ...
POSIX Message Queues 1069 z The mq_msgsize field defines the upper limit on the size of each message that may be placed on the q ...
1070 Chapter 52 /* Parse command-line options */ while ((opt = getopt(argc, argv, "cm:s:x")) != -1) { switch (opt) { case 'c': f ...
POSIX Message Queues 1071 In addition to the mq_maxmsg and mq_msgsize fields, which we have already described, the following fie ...
1072 Chapter 52 $ ./pmsg_create -cx /mq $ ./pmsg_getattr /mq Maximum # of messages on queue: 10 Maximum message size: 8192 # of ...
POSIX Message Queues 1073 52.5 Exchanging Messages In this section, we look at the functions that are used to send messages to a ...
1074 Chapter 52 Listing 52-4: Writing a message to a POSIX message queue ––––––––––––––––––––––––––––––––––––––––––––––––––––––– ...
POSIX Message Queues 1075 The msg_len argument is used by the caller to specify the number of bytes of space available in the bu ...
1076 Chapter 52 On the other hand, if we perform a nonblocking receive, the call returns immedi- ately with a failure status: $ ...
«
51
52
53
54
55
56
57
58
59
60
»
Free download pdf