OSDN Git Service

LDP: Update original to LDP v3.68
[linuxjm/LDP_man-pages.git] / original / man3 / mq_notify.3
index 11a711f..483b570 100644 (file)
@@ -23,7 +23,7 @@
 .\" the source, must acknowledge the copyright and authors of this work.
 .\" %%%LICENSE_END
 .\"
-.TH MQ_NOTIFY 3 2010-10-04 "Linux" "Linux Programmer's Manual"
+.TH MQ_NOTIFY 3 2014-04-06 "Linux" "Linux Programmer's Manual"
 .SH NAME
 mq_notify \- register for notification when a message is available
 .SH SYNOPSIS
@@ -51,7 +51,7 @@ For the definition and general details of this structure, see
 .PP
 If
 .I sevp
-is a non-NULL pointer, then
+is a non-null pointer, then
 .BR mq_notify ()
 registers the calling process to receive message notification.
 The
@@ -179,8 +179,8 @@ message queue named in its command-line argument.
 Notification is performed by creating a thread.
 The thread executes a function which reads one message from the
 queue and then terminates the process.
+.SS Program source
 .nf
-
 #include <pthread.h>
 #include <mqueue.h>
 #include <stdio.h>
@@ -210,7 +210,7 @@ tfunc(union sigval sv)
     if (nr == \-1)
         handle_error("mq_receive");
 
-    printf("Read %ld bytes from MQ\\n", (long) nr);
+    printf("Read %zd bytes from MQ\\n", nr);
     free(buf);
     exit(EXIT_SUCCESS);         /* Terminate the process */
 }
@@ -222,8 +222,8 @@ main(int argc, char *argv[])
     struct sigevent sev;
 
     if (argc != 2) {
-       fprintf(stderr, "Usage: %s <mq\-name>\\n", argv[0]);
-       exit(EXIT_FAILURE);
+        fprintf(stderr, "Usage: %s <mq\-name>\\n", argv[0]);
+        exit(EXIT_FAILURE);
     }
 
     mqdes = mq_open(argv[1], O_RDONLY);
@@ -249,3 +249,12 @@ main(int argc, char *argv[])
 .BR mq_unlink (3),
 .BR mq_overview (7),
 .BR sigevent (7)
+.SH COLOPHON
+This page is part of release 3.68 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.