OSDN Git Service

(split) LDP v3.24 -> v3.29 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / draft / man2 / sync.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" Modified by Michael Haardt <michael@moria.de>
26 .\" Modified Sat Jul 24 12:02:47 1993 by Rik Faith <faith@cs.unc.edu>
27 .\" Modified 15 Apr 1995 by Michael Chastain <mec@shell.portal.com>:
28 .\"   Added reference to `bdflush(2)'.
29 .\" Modified 960414 by Andries Brouwer <aeb@cwi.nl>:
30 .\"   Added the fact that since 1.3.20 sync actually waits.
31 .\" Modified Tue Oct 22 22:27:07 1996 by Eric S. Raymond <esr@thyrsus.com>
32 .\" Modified 2001-10-10 by aeb, following Michael Kerrisk.
33 .\"
34 .\" Japanese Version Copyright (c) 1997 Daisuke Sato
35 .\"         all rights reserved.
36 .\" Translated Sat Apr 19 15:22:53 JST 1997
37 .\"         by Daisuke Sato
38 .\" Modified Sun Mar 21 17:23:38 JST 1999
39 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
40 .\" Updated Tue Oct 16 JST 2001 by Kentaro Shirakata <argrath@ub32.org>
41 .\" Updated Mon Sep  8 JST 2003 by Kentaro Shirakata <argrath@ub32.org>
42 .\"
43 .\"WORD:        buffer cache            ¥Ð¥Ã¥Õ¥¡¡¦¥­¥ã¥Ã¥·¥å
44 .\"WORD:        buffers                 ¥Ð¥Ã¥Õ¥¡
45 .\"WORD:        data integrity          ¥Ç¡¼¥¿¤Î´°Á´À­
46 .\"
47 .TH SYNC 2 2010-09-20 "Linux" "Linux Programmer's Manual"
48 .SH Ì¾Á°
49 sync \- ¥Ð¥Ã¥Õ¥¡¥­¥ã¥Ã¥·¥å¤ò¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤à
50 .SH ½ñ¼°
51 .B #include <unistd.h>
52 .sp
53 .B void sync(void);
54 .sp
55 .in -4n
56 .\"O Feature Test Macro Requirements for glibc (see
57 .\"O .BR feature_test_macros (7)):
58 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
59 .RB ( feature_test_macros (7)
60 »²¾È):
61 .in
62 .sp
63 .BR sync ():
64 .ad l
65 .RS 4
66 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
67 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
68 .RE
69 .ad
70 .SH ÀâÌÀ
71 .BR sync ()
72 ¤Ï¤Þ¤º inode ¤ò¥Ð¥Ã¥Õ¥¡¤Ø½ñ¤­¹þ¤ß¡¢
73 ¤½¤ì¤«¤é¥Ð¥Ã¥Õ¥¡(buffer)¤ò¥Ç¥£¥¹¥¯¤Ø½ñ¤­¹þ¤à¡£
74 .\"O .SH ERRORS
75 .SH ¥¨¥é¡¼
76 .\"O This function is always successful.
77 ¤³¤Î´Ø¿ô¤Ï¾ï¤ËÀ®¸ù¤¹¤ë¡£
78 .\"O .SH "CONFORMING TO"
79 .SH ½àµò
80 SVr4, 4.3BSD, POSIX.1-2001.
81 .\"O .SH NOTES
82 .SH Ãí°Õ
83 .\"O Since glibc 2.2.2 the Linux prototype is as listed above,
84 .\"O following the various standards.
85 .\"O In libc4, libc5, and glibc up to 2.2.1
86 .\"O it was "int sync(void)", and
87 .\"O .BR sync ()
88 .\"O always returned 0.
89 ¤µ¤Þ¤¶¤Þ¤Êɸ½àµ¬³Ê¤Ç¤Îµ¬Äê¤Ë¤·¤¿¤¬¤Ã¤Æ¡¢
90 glibc 2.2.2 ¤«¤é Linux ¤Ç¤Î¥×¥í¥È¥¿¥¤¥×¤Ï¾å½Ò¤Î¤è¤¦¤Ë¤Ê¤Ã¤¿¡£
91 libc4, libc5 ¤È¡¢2.2.1 ¤Þ¤Ç¤Î glibc ¤Ç¤Ï "int sync(void)" ¤Ç¡¢
92 .BR sync ()
93 ¤Ï¾ï¤Ë 0 ¤òÊÖ¤·¤Æ¤¤¤¿¡£
94 .\"O .SH BUGS
95 .SH ¥Ð¥°
96 .\"O According to the standard specification (e.g., POSIX.1-2001),
97 .\"O .BR sync ()
98 .\"O schedules the writes, but may return before the actual
99 .\"O writing is done.
100 .\"O However, since version 1.3.20 Linux does actually wait.
101 .\"O (This still does not guarantee data integrity: modern disks have
102 .\"O large caches.)
103 ɸ½àµ¬³Ê (Î㤨¤Ð POSIX.1-2001) ¤Ë¤è¤ë¤È¡¢
104 .BR sync ()
105 ¤Ï½ñ¤­¹þ¤à¤³¤È¤òͽÄê¤Ë
106 ÁȤ߹þ¤à¤Î¤ß¤Ç¼ÂºÝ¤Ë½ñ¤­¹þ¤ß¤¬½ªÎ»¤¹¤ëÁ°¤ËÌá¤Ã¤Æ¤â¤è¤¤¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£
107 °ìÊý¤Ç Linux ¤Ï¥Ð¡¼¥¸¥ç¥ó 1.3.20 ¤«¤é¤Ï½ñ¤­¹þ¤ß¤¬½ªÎ»¤¹¤ë¤Þ¤ÇÂԤġ£
108 (ºÇ¶á¤Î¥Ç¥£¥¹¥¯¤ÏÂ礭¤Ê¥­¥ã¥Ã¥·¥å¤ò»ý¤Ã¤Æ¤¤¤ë¤¿¤á¡¢
109  ¤³¤ì¤Ï¥Ç¡¼¥¿¤Î´°Á´À­ (data integrity) ¤Þ¤Ç¤ÏÊݾڤ·¤Æ¤¤¤Ê¤¤¡£)
110 .SH ´ØÏ¢¹àÌÜ
111 .BR bdflush (2),
112 .BR fdatasync (2),
113 .BR fsync (2),
114 .BR sync (8),
115 .BR update (8)