OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / 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 2007-07-26 "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 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500
65 .SH ÀâÌÀ
66 .BR sync ()
67 ¤Ï¤Þ¤º inode ¤ò¥Ð¥Ã¥Õ¥¡¤Ø½ñ¤­¹þ¤ß¡¢
68 ¤½¤ì¤«¤é¥Ð¥Ã¥Õ¥¡(buffer)¤ò¥Ç¥£¥¹¥¯¤Ø½ñ¤­¹þ¤à¡£
69 .\"O .SH ERRORS
70 .SH ¥¨¥é¡¼
71 .\"O This function is always successful.
72 ¤³¤Î´Ø¿ô¤Ï¾ï¤ËÀ®¸ù¤¹¤ë¡£
73 .\"O .SH "CONFORMING TO"
74 .SH ½àµò
75 SVr4, 4.3BSD, POSIX.1-2001.
76 .\"O .SH NOTES
77 .SH Ãí°Õ
78 .\"O Since glibc 2.2.2 the Linux prototype is as listed above,
79 .\"O following the various standards.
80 .\"O In libc4, libc5, and glibc up to 2.2.1
81 .\"O it was "int sync(void)", and
82 .\"O .BR sync ()
83 .\"O always returned 0.
84 ¤µ¤Þ¤¶¤Þ¤Êɸ½àµ¬³Ê¤Ç¤Îµ¬Äê¤Ë¤·¤¿¤¬¤Ã¤Æ¡¢
85 glibc 2.2.2 ¤«¤é Linux ¤Ç¤Î¥×¥í¥È¥¿¥¤¥×¤Ï¾å½Ò¤Î¤è¤¦¤Ë¤Ê¤Ã¤¿¡£
86 libc4, libc5 ¤È¡¢2.2.1 ¤Þ¤Ç¤Î glibc ¤Ç¤Ï "int sync(void)" ¤Ç¡¢
87 .BR sync ()
88 ¤Ï¾ï¤Ë 0 ¤òÊÖ¤·¤Æ¤¤¤¿¡£
89 .\"O .SH BUGS
90 .SH ¥Ð¥°
91 .\"O According to the standard specification (e.g., POSIX.1-2001),
92 .\"O .BR sync ()
93 .\"O schedules the writes, but may return before the actual
94 .\"O writing is done.
95 .\"O However, since version 1.3.20 Linux does actually wait.
96 .\"O (This still does not guarantee data integrity: modern disks have
97 .\"O large caches.)
98 ɸ½àµ¬³Ê (Î㤨¤Ð POSIX.1-2001) ¤Ë¤è¤ë¤È¡¢
99 .BR sync ()
100 ¤Ï½ñ¤­¹þ¤à¤³¤È¤òͽÄê¤Ë
101 ÁȤ߹þ¤à¤Î¤ß¤Ç¼ÂºÝ¤Ë½ñ¤­¹þ¤ß¤¬½ªÎ»¤¹¤ëÁ°¤ËÌá¤Ã¤Æ¤â¤è¤¤¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£
102 °ìÊý¤Ç Linux ¤Ï¥Ð¡¼¥¸¥ç¥ó 1.3.20 ¤«¤é¤Ï½ñ¤­¹þ¤ß¤¬½ªÎ»¤¹¤ë¤Þ¤ÇÂԤġ£
103 (ºÇ¶á¤Î¥Ç¥£¥¹¥¯¤ÏÂ礭¤Ê¥­¥ã¥Ã¥·¥å¤ò»ý¤Ã¤Æ¤¤¤ë¤¿¤á¡¢
104  ¤³¤ì¤Ï¥Ç¡¼¥¿¤Î´°Á´À­ (data integrity) ¤Þ¤Ç¤ÏÊݾڤ·¤Æ¤¤¤Ê¤¤¡£)
105 .SH ´ØÏ¢¹àÌÜ
106 .BR bdflush (2),
107 .BR fdatasync (2),
108 .BR fsync (2),
109 .BR sync (8),
110 .BR update (8)