OSDN Git Service

Update releases for LDP v3.76
[linuxjm/LDP_man-pages.git] / release / man3 / cmsg.3
index 85ebfad..9842c7f 100644 (file)
 .\" This file was generated with po4a. Translate the source file.
 .\"
 .\"*******************************************************************
-.TH CMSG 3 2008\-11\-20 Linux "Linux Programmer's Manual"
+.\"
+.\" Japanese Version Copyright (c) 1999 Shouichi Saito
+.\"    all rights reserved.
+.\" Translated Mon Jul 26 21:58:26 JST 1999
+.\"    by Shouichi Saito <ss236rx@ymg.urban.ne.jp>
+.\" Proofed Tue Aug 17 1999 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\"
+.TH CMSG 3 2014\-12\-31 Linux "Linux Programmer's Manual"
 .SH 名前
 CMSG_ALIGN, CMSG_SPACE, CMSG_NXTHDR, CMSG_FIRSTHDR \- 補助データにアクセスする。
 .SH 書式
@@ -122,11 +129,16 @@ if (cmsg == NULL) {
 struct msghdr msg = {0};
 struct cmsghdr *cmsg;
 int myfds[NUM_FD]; /* Contains the file descriptors to pass. */
-char buf[CMSG_SPACE(sizeof myfds)];  /* ancillary data buffer */
+union {
+    /* ancillary data buffer, wrapped in a union in order to ensure it is
+       suitably aligned */
+    char buf[CMSG_SPACE(sizeof myfds)];
+    struct cmsghdr align;
+} u;
 int *fdptr;
 
-msg.msg_control = buf;
-msg.msg_controllen = sizeof buf;
+msg.msg_control = u.buf;
+msg.msg_controllen = sizeof u.buf;
 cmsg = CMSG_FIRSTHDR(&msg);
 cmsg\->cmsg_level = SOL_SOCKET;
 cmsg\->cmsg_type = SCM_RIGHTS;
@@ -143,6 +155,6 @@ msg.msg_controllen = cmsg\->cmsg_len;
 .PP
 RFC\ 2292
 .SH この文書について
-この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.76 の一部
 である。プロジェクトの説明とバグ報告に関する情報は
 http://www.kernel.org/doc/man\-pages/ に書かれている。