From 290b815f40e5a2160352a8d244499dd4a2a8c16b Mon Sep 17 00:00:00 2001 From: Akihiro MOTOKI Date: Fri, 27 Apr 2012 07:54:03 +0900 Subject: [PATCH] (split) LDP: draft snapshot generated from latest ja.po files. --- draft/man1/intro.1 | 495 +--- draft/man1/ldd.1 | 134 +- draft/man1/time.1 | 555 ++--- draft/man2/_exit.2 | 192 +- draft/man2/_syscall.2 | 128 +- draft/man2/accept.2 | 742 ++---- draft/man2/access.2 | 423 ---- draft/man2/adjtimex.2 | 180 +- draft/man2/alarm.2 | 113 +- draft/man2/alloc_hugepages.2 | 247 +- draft/man2/bind.2 | 403 +--- draft/man2/brk.2 | 269 +-- draft/man2/cacheflush.2 | 122 +- draft/man2/chdir.2 | 205 +- draft/man2/chmod.2 | 373 +-- draft/man2/chown.2 | 512 ----- draft/man2/chroot.2 | 217 +- draft/man2/clock_getres.2 | 375 +-- draft/man2/clock_nanosleep.2 | 407 +--- draft/man2/clone.2 | 1831 --------------- draft/man2/close.2 | 194 +- draft/man2/connect.2 | 429 +--- draft/man2/dup.2 | 352 +-- draft/man2/epoll_create.2 | 217 -- draft/man2/epoll_ctl.2 | 490 +--- draft/man2/epoll_wait.2 | 308 --- draft/man2/execve.2 | 1013 ++------ draft/man2/exit_group.2 | 47 +- draft/man2/faccessat.2 | 259 --- draft/man2/fallocate.2 | 234 -- draft/man2/fchmodat.2 | 232 -- draft/man2/fchownat.2 | 220 +- draft/man2/fcntl.2 | 2222 ------------------ draft/man2/flock.2 | 362 +-- draft/man2/fork.2 | 392 +--- draft/man2/fstatat.2 | 232 -- draft/man2/fsync.2 | 314 --- draft/man2/futimesat.2 | 207 +- draft/man2/get_thread_area.2 | 93 +- draft/man2/getcontext.2 | 268 +-- draft/man2/getcpu.2 | 96 + draft/man2/getdents.2 | 376 --- draft/man2/getdomainname.2 | 194 +- draft/man2/getdtablesize.2 | 110 +- draft/man2/gethostname.2 | 300 +-- draft/man2/getpagesize.2 | 180 -- draft/man2/getsockname.2 | 157 +- draft/man2/getsockopt.2 | 332 +-- draft/man2/gettid.2 | 85 +- draft/man2/gettimeofday.2 | 386 ---- draft/man2/idle.2 | 75 +- draft/man2/inotify_add_watch.2 | 182 +- draft/man2/inotify_init.2 | 144 +- draft/man2/inotify_rm_watch.2 | 91 +- draft/man2/intro.2 | 158 +- draft/man2/io_cancel.2 | 142 +- draft/man2/io_destroy.2 | 128 +- draft/man2/io_getevents.2 | 165 +- draft/man2/io_setup.2 | 149 +- draft/man2/io_submit.2 | 147 +- draft/man2/ioctl.2 | 230 +- draft/man2/ioctl_list.2 | 654 ++---- draft/man2/ioperm.2 | 138 +- draft/man2/kexec_load.2 | 117 + draft/man2/linkat.2 | 245 +- draft/man2/listen.2 | 261 +-- draft/man2/madvise.2 | 373 --- draft/man2/migrate_pages.2 | 96 + draft/man2/mincore.2 | 277 +-- draft/man2/mkdir.2 | 235 -- draft/man2/mkdirat.2 | 174 +- draft/man2/mknodat.2 | 180 +- draft/man2/mlock.2 | 577 ----- draft/man2/mmap.2 | 1118 --------- draft/man2/mmap2.2 | 150 -- draft/man2/mprotect.2 | 248 +- draft/man2/mremap.2 | 380 --- draft/man2/msync.2 | 204 +- draft/man2/nanosleep.2 | 354 +-- draft/man2/nice.2 | 169 +- draft/man2/openat.2 | 246 +- draft/man2/poll.2 | 552 ----- draft/man2/posix_fadvise.2 | 241 -- draft/man2/pread.2 | 193 -- draft/man2/readahead.2 | 137 +- draft/man2/readdir.2 | 167 +- draft/man2/readlinkat.2 | 177 +- draft/man2/recv.2 | 865 ++----- draft/man2/recvmmsg.2 | 110 + draft/man2/remap_file_pages.2 | 259 +-- draft/man2/renameat.2 | 201 +- draft/man2/sched_get_priority_max.2 | 169 +- draft/man2/sched_rr_get_interval.2 | 191 -- draft/man2/sched_setaffinity.2 | 427 +--- draft/man2/sched_setparam.2 | 183 +- draft/man2/sched_setscheduler.2 | 825 ------- draft/man2/sched_yield.2 | 118 +- draft/man2/select.2 | 918 ++------ draft/man2/select_tut.2 | 932 ++------ draft/man2/send.2 | 761 ++---- draft/man2/set_thread_area.2 | 131 +- draft/man2/setns.2 | 82 + draft/man2/setup.2 | 92 +- draft/man2/shmctl.2 | 676 +----- draft/man2/shmget.2 | 549 +---- draft/man2/shmop.2 | 503 +--- draft/man2/socket.2 | 706 ++---- draft/man2/socketcall.2 | 91 +- draft/man2/socketpair.2 | 182 +- draft/man2/stime.2 | 72 +- draft/man2/subpage_prot.2 | 105 + draft/man2/swapon.2 | 302 --- draft/man2/symlinkat.2 | 173 +- draft/man2/sync_file_range.2 | 302 --- draft/man2/syscall.2 | 64 +- draft/man2/syscalls.2 | 1077 --------- draft/man2/sysctl.2 | 181 +- draft/man2/sysinfo.2 | 86 +- draft/man2/time.2 | 106 +- draft/man2/timer_create.2 | 326 +++ draft/man2/timer_delete.2 | 63 + draft/man2/timer_getoverrun.2 | 107 + draft/man2/timer_settime.2 | 144 ++ draft/man2/times.2 | 321 +-- draft/man2/truncate.2 | 379 --- draft/man2/umask.2 | 160 +- draft/man2/uname.2 | 259 +-- draft/man2/unimplemented.2 | 79 +- draft/man2/unlinkat.2 | 250 +- draft/man2/unshare.2 | 286 --- draft/man2/uselib.2 | 149 +- draft/man2/utime.2 | 263 +-- draft/man2/vfork.2 | 390 ---- draft/man2/vhangup.2 | 77 +- draft/man3/INFINITY.3 | 129 +- draft/man3/MB_CUR_MAX.3 | 50 +- draft/man3/MB_LEN_MAX.3 | 53 +- draft/man3/a64l.3 | 124 +- draft/man3/abs.3 | 147 +- draft/man3/acos.3 | 138 +- draft/man3/acosh.3 | 141 +- draft/man3/adjtime.3 | 204 +- draft/man3/aio_cancel.3 | 148 -- draft/man3/aio_error.3 | 111 - draft/man3/aio_fsync.3 | 152 -- draft/man3/aio_read.3 | 202 -- draft/man3/aio_return.3 | 101 - draft/man3/aio_suspend.3 | 136 -- draft/man3/aio_write.3 | 208 -- draft/man3/alloca.3 | 222 +- draft/man3/asin.3 | 131 +- draft/man3/asinh.3 | 107 +- draft/man3/atan.3 | 103 +- draft/man3/atan2.3 | 207 +- draft/man3/atanh.3 | 194 +- draft/man3/atexit.3 | 182 +- draft/man3/atof.3 | 52 +- draft/man3/atoi.3 | 115 +- draft/man3/bcmp.3 | 74 +- draft/man3/bcopy.3 | 72 +- draft/man3/bindresvport.3 | 149 +- draft/man3/bstring.3 | 83 +- draft/man3/bzero.3 | 58 +- draft/man3/canonicalize_file_name.3 | 33 +- draft/man3/cbrt.3 | 97 +- draft/man3/ceil.3 | 146 +- draft/man3/cfree.3 | 164 +- draft/man3/clearenv.3 | 131 +- draft/man3/clock.3 | 115 +- draft/man3/clock_getcpuclockid.3 | 130 ++ draft/man3/closedir.3 | 80 +- draft/man3/confstr.3 | 198 +- draft/man3/copysign.3 | 90 +- draft/man3/cos.3 | 135 +- draft/man3/cosh.3 | 149 +- draft/man3/crypt.3 | 361 +-- draft/man3/ctime.3 | 608 +---- draft/man3/daemon.3 | 148 +- draft/man3/des_crypt.3 | 240 +- draft/man3/difftime.3 | 67 +- draft/man3/dirfd.3 | 127 +- draft/man3/div.3 | 109 +- draft/man3/dl_iterate_phdr.3 | 236 +- draft/man3/dlopen.3 | 856 ++----- draft/man3/drand48.3 | 291 +-- draft/man3/drand48_r.3 | 96 +- draft/man3/dysize.3 | 50 +- draft/man3/ecvt.3 | 169 +- draft/man3/ecvt_r.3 | 104 +- draft/man3/encrypt.3 | 188 +- draft/man3/end.3 | 121 +- draft/man3/endian.3 | 137 ++ draft/man3/erf.3 | 135 +- draft/man3/erfc.3 | 163 +- draft/man3/euidaccess.3 | 141 -- draft/man3/exec.3 | 385 +--- draft/man3/exit.3 | 290 +-- draft/man3/exp.3 | 160 +- draft/man3/exp10.3 | 73 +- draft/man3/exp2.3 | 93 +- draft/man3/expm1.3 | 187 +- draft/man3/fabs.3 | 97 +- draft/man3/fdim.3 | 110 +- draft/man3/fenv.3 | 550 +---- draft/man3/fexecve.3 | 139 +- draft/man3/ffs.3 | 97 +- draft/man3/finite.3 | 138 +- draft/man3/floor.3 | 133 +- draft/man3/fma.3 | 215 +- draft/man3/fmax.3 | 74 +- draft/man3/fmin.3 | 74 +- draft/man3/fmod.3 | 180 +- draft/man3/fopencookie.3 | 362 +++ draft/man3/fpathconf.3 | 291 +-- draft/man3/fpclassify.3 | 197 +- draft/man3/frexp.3 | 116 +- draft/man3/ftime.3 | 120 +- draft/man3/futimes.3 | 132 +- draft/man3/gamma.3 | 156 +- draft/man3/gcvt.3 | 92 +- draft/man3/getcwd.3 | 419 +--- draft/man3/getdate.3 | 401 +--- draft/man3/getdirentries.3 | 89 +- draft/man3/getenv.3 | 94 +- draft/man3/gethostid.3 | 176 +- draft/man3/getifaddrs.3 | 219 ++ draft/man3/getloadavg.3 | 74 +- draft/man3/getlogin.3 | 303 +-- draft/man3/getnetent_r.3 | 108 + draft/man3/getopt.3 | 716 ++---- draft/man3/getprotoent_r.3 | 196 ++ draft/man3/getrpcent_r.3 | 99 + draft/man3/getservent_r.3 | 200 ++ draft/man3/getsubopt.3 | 227 +- draft/man3/getumask.3 | 49 +- draft/man3/getusershell.3 | 82 +- draft/man3/getutmp.3 | 59 + draft/man3/hypot.3 | 201 +- draft/man3/ilogb.3 | 147 +- draft/man3/index.3 | 88 +- draft/man3/infnan.3 | 75 +- draft/man3/intro.3 | 159 +- draft/man3/isgreater.3 | 157 +- draft/man3/j0.3 | 174 +- draft/man3/ldexp.3 | 175 +- draft/man3/lgamma.3 | 257 +-- draft/man3/lockf.3 | 309 +-- draft/man3/log.3 | 174 +- draft/man3/log10.3 | 96 +- draft/man3/log1p.3 | 150 +- draft/man3/log2.3 | 93 +- draft/man3/logb.3 | 184 +- draft/man3/lrint.3 | 124 +- draft/man3/lround.3 | 136 +- draft/man3/makecontext.3 | 270 +-- draft/man3/makedev.3 | 66 + draft/man3/malloc.3 | 484 ---- draft/man3/malloc_hook.3 | 195 -- draft/man3/matherr.3 | 346 +++ draft/man3/mblen.3 | 117 +- draft/man3/mbstowcs.3 | 118 +- draft/man3/mbtowc.3 | 137 +- draft/man3/memccpy.3 | 54 +- draft/man3/memchr.3 | 184 +- draft/man3/memcmp.3 | 61 +- draft/man3/memcpy.3 | 53 +- draft/man3/memfrob.3 | 60 +- draft/man3/memmem.3 | 73 +- draft/man3/memmove.3 | 66 +- draft/man3/mempcpy.3 | 97 +- draft/man3/memset.3 | 26 +- draft/man3/mkdtemp.3 | 105 +- draft/man3/mkfifoat.3 | 178 +- draft/man3/mkstemp.3 | 243 -- draft/man3/mktemp.3 | 141 +- draft/man3/modf.3 | 95 +- draft/man3/mtrace.3 | 81 - draft/man3/nan.3 | 114 +- draft/man3/netlink.3 | 153 +- draft/man3/nextafter.3 | 238 +- draft/man3/on_exit.3 | 97 +- draft/man3/opendir.3 | 207 +- draft/man3/posix_fallocate.3 | 193 +- draft/man3/posix_memalign.3 | 412 ---- draft/man3/pow.3 | 497 +--- draft/man3/pow10.3 | 48 +- draft/man3/putenv.3 | 141 +- draft/man3/qecvt.3 | 97 +- draft/man3/rand.3 | 260 --- draft/man3/random.3 | 252 +- draft/man3/random_r.3 | 180 +- draft/man3/readdir.3 | 384 +--- draft/man3/remainder.3 | 275 +-- draft/man3/remquo.3 | 180 +- draft/man3/rewinddir.3 | 46 +- draft/man3/rint.3 | 173 +- draft/man3/round.3 | 138 +- draft/man3/rpmatch.3 | 171 +- draft/man3/rtnetlink.3 | 137 +- draft/man3/scalb.3 | 264 +-- draft/man3/scalbln.3 | 127 + draft/man3/scandir.3 | 228 +- draft/man3/sched_getcpu.3 | 72 +- draft/man3/seekdir.3 | 97 +- draft/man3/setenv.3 | 172 +- draft/man3/shm_open.3 | 502 +--- draft/man3/signbit.3 | 86 +- draft/man3/significand.3 | 65 +- draft/man3/sin.3 | 138 +- draft/man3/sincos.3 | 120 +- draft/man3/sinh.3 | 142 +- draft/man3/sleep.3 | 67 +- draft/man3/sockatmark.3 | 146 +- draft/man3/sqrt.3 | 120 +- draft/man3/stpcpy.3 | 102 +- draft/man3/stpncpy.3 | 80 +- draft/man3/strcasecmp.3 | 72 +- draft/man3/strcat.3 | 110 +- draft/man3/strchr.3 | 123 +- draft/man3/strcmp.3 | 73 +- draft/man3/strcoll.3 | 71 +- draft/man3/strcpy.3 | 168 +- draft/man3/strdup.3 | 124 +- draft/man3/strerror.3 | 285 +-- draft/man3/strfry.3 | 53 +- draft/man3/strftime.3 | 889 ++----- draft/man3/string.3 | 105 +- draft/man3/strlen.3 | 29 +- draft/man3/strnlen.3 | 71 +- draft/man3/strpbrk.3 | 54 +- draft/man3/strptime.3 | 724 ++---- draft/man3/strsep.3 | 108 +- draft/man3/strsignal.3 | 76 +- draft/man3/strspn.3 | 45 +- draft/man3/strstr.3 | 94 +- draft/man3/strtod.3 | 246 +- draft/man3/strtoimax.3 | 79 +- draft/man3/strtok.3 | 233 +- draft/man3/strtol.3 | 332 +-- draft/man3/strtoul.3 | 288 +-- draft/man3/strverscmp.3 | 147 +- draft/man3/strxfrm.3 | 88 +- draft/man3/swab.3 | 58 +- draft/man3/sysconf.3 | 629 ++--- draft/man3/system.3 | 245 +- draft/man3/tan.3 | 151 +- draft/man3/tanh.3 | 95 +- draft/man3/tcgetpgrp.3 | 205 +- draft/man3/telldir.3 | 88 +- draft/man3/tgamma.3 | 271 +-- draft/man3/timegm.3 | 93 +- draft/man3/timeradd.3 | 212 +- draft/man3/trunc.3 | 84 +- draft/man3/tzset.3 | 349 +-- draft/man3/ualarm.3 | 188 +- draft/man3/undocumented.3 | 219 +- draft/man3/usleep.3 | 173 +- draft/man3/wcstombs.3 | 119 +- draft/man3/wctomb.3 | 114 +- draft/man3/y0.3 | 310 +-- draft/man4/cpuid.4 | 73 + draft/man4/intro.4 | 33 +- draft/man4/msr.4 | 51 + draft/man4/rtc.4 | 578 +---- draft/man5/dir_colors.5 | 666 ++---- draft/man5/elf.5 | 2879 ----------------------- draft/man5/intro.5 | 28 +- draft/man5/issue.5 | 35 +- draft/man5/motd.5 | 33 +- draft/man5/networks.5 | 71 + draft/man5/nologin.5 | 29 +- draft/man5/proc.5 | 4337 ----------------------------------- draft/man5/shells.5 | 55 +- draft/man5/slabinfo.5 | 167 +- draft/man5/tzfile.5 | 234 -- draft/man6/intro.6 | 27 +- draft/man7/armscii-8.7 | 142 ++ draft/man7/ascii.7 | 115 +- draft/man7/charsets.7 | 546 +---- draft/man7/cpuset.7 | 1029 +++++++++ draft/man7/epoll.7 | 970 ++------ draft/man7/feature_test_macros.7 | 917 -------- draft/man7/hostname.7 | 82 + draft/man7/inotify.7 | 698 ------ draft/man7/intro.7 | 30 +- draft/man7/iso_8859-1.7 | 247 +- draft/man7/iso_8859-10.7 | 166 ++ draft/man7/iso_8859-11.7 | 161 ++ draft/man7/iso_8859-13.7 | 165 ++ draft/man7/iso_8859-14.7 | 163 ++ draft/man7/iso_8859-15.7 | 303 +-- draft/man7/iso_8859-16.7 | 313 ++- draft/man7/iso_8859-2.7 | 302 +-- draft/man7/iso_8859-3.7 | 159 ++ draft/man7/iso_8859-4.7 | 161 ++ draft/man7/iso_8859-5.7 | 161 ++ draft/man7/iso_8859-6.7 | 119 + draft/man7/iso_8859-7.7 | 183 +- draft/man7/iso_8859-8.7 | 132 ++ draft/man7/iso_8859-9.7 | 278 +-- draft/man7/koi8-r.7 | 232 -- draft/man7/mailaddr.7 | 155 +- draft/man7/man-pages.7 | 1034 ++------- draft/man7/man.7 | 903 -------- draft/man7/mdoc.7 | 530 +---- draft/man7/numa.7 | 145 ++ draft/man7/operator.7 | 87 - draft/man7/posixoptions.7 | 1084 --------- draft/man7/sigevent.7 | 117 + draft/man7/standards.7 | 533 ++--- draft/man7/suffixes.7 | 526 ----- draft/man7/symlink.7 | 279 +++ draft/man7/unicode.7 | 456 +--- draft/man7/units.7 | 172 +- draft/man7/utf-8.7 | 475 +--- draft/man8/intro.8 | 43 +- draft/man8/ld.so.8 | 671 ------ draft/man8/ldconfig.8 | 295 +-- draft/man8/tzselect.8 | 81 +- draft/man8/zdump.8 | 75 +- draft/man8/zic.8 | 627 +---- 421 files changed, 20270 insertions(+), 86018 deletions(-) delete mode 100644 draft/man2/access.2 delete mode 100644 draft/man2/chown.2 delete mode 100644 draft/man2/clone.2 delete mode 100644 draft/man2/epoll_create.2 delete mode 100644 draft/man2/epoll_wait.2 delete mode 100644 draft/man2/faccessat.2 delete mode 100644 draft/man2/fallocate.2 delete mode 100644 draft/man2/fchmodat.2 delete mode 100644 draft/man2/fcntl.2 delete mode 100644 draft/man2/fstatat.2 delete mode 100644 draft/man2/fsync.2 create mode 100644 draft/man2/getcpu.2 delete mode 100644 draft/man2/getdents.2 delete mode 100644 draft/man2/getpagesize.2 delete mode 100644 draft/man2/gettimeofday.2 create mode 100644 draft/man2/kexec_load.2 delete mode 100644 draft/man2/madvise.2 create mode 100644 draft/man2/migrate_pages.2 delete mode 100644 draft/man2/mkdir.2 delete mode 100644 draft/man2/mlock.2 delete mode 100644 draft/man2/mmap.2 delete mode 100644 draft/man2/mmap2.2 delete mode 100644 draft/man2/mremap.2 delete mode 100644 draft/man2/poll.2 delete mode 100644 draft/man2/posix_fadvise.2 delete mode 100644 draft/man2/pread.2 create mode 100644 draft/man2/recvmmsg.2 delete mode 100644 draft/man2/sched_rr_get_interval.2 delete mode 100644 draft/man2/sched_setscheduler.2 create mode 100644 draft/man2/setns.2 create mode 100644 draft/man2/subpage_prot.2 delete mode 100644 draft/man2/swapon.2 delete mode 100644 draft/man2/sync_file_range.2 delete mode 100644 draft/man2/syscalls.2 create mode 100644 draft/man2/timer_create.2 create mode 100644 draft/man2/timer_delete.2 create mode 100644 draft/man2/timer_getoverrun.2 create mode 100644 draft/man2/timer_settime.2 delete mode 100644 draft/man2/truncate.2 delete mode 100644 draft/man2/unshare.2 delete mode 100644 draft/man2/vfork.2 delete mode 100644 draft/man3/aio_cancel.3 delete mode 100644 draft/man3/aio_error.3 delete mode 100644 draft/man3/aio_fsync.3 delete mode 100644 draft/man3/aio_read.3 delete mode 100644 draft/man3/aio_return.3 delete mode 100644 draft/man3/aio_suspend.3 delete mode 100644 draft/man3/aio_write.3 create mode 100644 draft/man3/clock_getcpuclockid.3 create mode 100644 draft/man3/endian.3 delete mode 100644 draft/man3/euidaccess.3 create mode 100644 draft/man3/fopencookie.3 create mode 100644 draft/man3/getifaddrs.3 create mode 100644 draft/man3/getnetent_r.3 create mode 100644 draft/man3/getprotoent_r.3 create mode 100644 draft/man3/getrpcent_r.3 create mode 100644 draft/man3/getservent_r.3 create mode 100644 draft/man3/getutmp.3 create mode 100644 draft/man3/makedev.3 delete mode 100644 draft/man3/malloc.3 delete mode 100644 draft/man3/malloc_hook.3 create mode 100644 draft/man3/matherr.3 delete mode 100644 draft/man3/mkstemp.3 delete mode 100644 draft/man3/mtrace.3 delete mode 100644 draft/man3/posix_memalign.3 delete mode 100644 draft/man3/rand.3 create mode 100644 draft/man3/scalbln.3 create mode 100644 draft/man4/cpuid.4 create mode 100644 draft/man4/msr.4 delete mode 100644 draft/man5/elf.5 create mode 100644 draft/man5/networks.5 delete mode 100644 draft/man5/proc.5 delete mode 100644 draft/man5/tzfile.5 create mode 100644 draft/man7/armscii-8.7 create mode 100644 draft/man7/cpuset.7 delete mode 100644 draft/man7/feature_test_macros.7 create mode 100644 draft/man7/hostname.7 delete mode 100644 draft/man7/inotify.7 create mode 100644 draft/man7/iso_8859-10.7 create mode 100644 draft/man7/iso_8859-11.7 create mode 100644 draft/man7/iso_8859-13.7 create mode 100644 draft/man7/iso_8859-14.7 create mode 100644 draft/man7/iso_8859-3.7 create mode 100644 draft/man7/iso_8859-4.7 create mode 100644 draft/man7/iso_8859-5.7 create mode 100644 draft/man7/iso_8859-6.7 create mode 100644 draft/man7/iso_8859-8.7 delete mode 100644 draft/man7/koi8-r.7 delete mode 100644 draft/man7/man.7 create mode 100644 draft/man7/numa.7 delete mode 100644 draft/man7/operator.7 delete mode 100644 draft/man7/posixoptions.7 create mode 100644 draft/man7/sigevent.7 delete mode 100644 draft/man7/suffixes.7 create mode 100644 draft/man7/symlink.7 delete mode 100644 draft/man8/ld.so.8 diff --git a/draft/man1/intro.1 b/draft/man1/intro.1 index b9b6ba2e..99a1306b 100644 --- a/draft/man1/intro.1 +++ b/draft/man1/intro.1 @@ -23,144 +23,50 @@ .\" 2007-10-23 mtk Added intro paragraph about section, plus a paragraph .\" about exit status values. .\" -.\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI, all rights reserved. -.\" Translated Mon Mar 5 2003 by Akihiro MOTOKI +.\"******************************************************************* .\" -.\"WORD introduction 紹介 -.\"WORD tree 木 +.\" This file was generated with po4a. Translate the source file. .\" -.TH INTRO 1 2007-11-15 "Linux" "Linux User's Manual" -.\"O .SH NAME -.\"O intro \- Introduction to user commands +.\"******************************************************************* +.TH INTRO 1 2007\-11\-15 Linux "Linux User's Manual" .SH 名前 intro \- ユーザーコマンドの紹介 -.\"O .SH DESCRIPTION .SH 説明 -.\"O Section 1 of the manual describes user commands and tools, -.\"O for example, file manipulation tools, shells, compilers, -.\"O web browsers, file and image viewers and editors, and so on. -マニュアルの 1 章は、ユーザーコマンドやツールの説明について説明している。 -例えば、ファイル操作ツール、シェル、コンパイラ、ウェブブラウザ、 +マニュアルの 1 章は、ユーザーコマンドやツールの説明について説明している。 例えば、ファイル操作ツール、シェル、コンパイラ、ウェブブラウザ、 ファイルやイメージのビューアやエディタ、などである。 -.\"O All commands yield a status value on termination. -.\"O This value can be tested (e.g., in most shells the variable -.\"O .I $? -.\"O contains the status of the last executed command) -.\"O to see whether the command completed successfully. -.\"O A zero exit status is conventionally used to indicate success, -.\"O and a nonzero status means that the command was unsuccessful. -.\"O (Details of the exit status can be found in -.\"O .BR wait (2).) -.\"O A nonzero exit status can be in the range 1 to 255, and some commands -.\"O use different nonzero status values to indicate the reason why the -.\"O command failed. -すべてのコマンドは終了時にステータス値を返す。 -この値を検査することで (例えば、ほとんどのシェルでは変数 -.I $? -に最後に実行したコマンドのステータスが保持される)、 -そのコマンドが成功して完了したかどうかを知ることができる。 -伝統的に、終了ステータス 0 は成功を示すのに使われ、非 0 の値は -そのコマンドが成功しなかったことを示す -(終了ステータスの詳細は -.BR wait (2) -に書かれている)。 -非 0 の終了ステータスは 1 から 255 の範囲の値をとることができ、 -いくつかのコマンドではコマンドが失敗した理由を示すために -複数の非 0 のステータス値が使用されている。 -.\"O .SH NOTES -.SH 備考 -.\"O Linux is a flavor of UNIX, and as a first approximation -.\"O all user commands under UNIX work precisely the same under -.\"O Linux (and FreeBSD and lots of other UNIX-like systems). -Linux は UNIX の一種であり、大雑把にいえば、 -UNIX 上のユーザコマンドはすべて Linux 上でも全く同じ動作をする -(FreeBSD や他のの多くの UNIX 風のシステムでも同様である)。 +すべてのコマンドは終了時にステータス値を返す。 この値を検査することで (例えば、ほとんどのシェルでは変数 \fI$?\fP +に最後に実行したコマンドのステータスが保持される)、 そのコマンドが成功して完了したかどうかを知ることができる。 伝統的に、終了ステータス 0 +は成功を示すのに使われ、非 0 の値は そのコマンドが成功しなかったことを示す (終了ステータスの詳細は \fBwait\fP(2) に書かれている)。 非 +0 の終了ステータスは 1 から 255 の範囲の値をとることができ、 いくつかのコマンドではコマンドが失敗した理由を示すために 複数の非 0 +のステータス値が使用されている。 +.SH 注意 +Linux は UNIX の一種であり、大雑把にいえば、 UNIX 上のユーザコマンドはすべて Linux 上でも全く同じ動作をする (FreeBSD +や他のの多くの UNIX 風のシステムでも同様である)。 .LP -.\"O Under Linux there are GUIs (graphical user interfaces), where you -.\"O can point and click and drag, and hopefully get work done without -.\"O first reading lots of documentation. -.\"O The traditional UNIX environment -.\"O is a CLI (command line interface), where you type commands to -.\"O tell the computer what to do. -.\"O That is faster and more powerful, -.\"O but requires finding out what the commands are. -.\"O Below a bare minimum, to get started. Linux には GUI (グラフィカル・ユーザ・インタフェース) が用意されており、 -何かをポイントしたり、クリックしたり、ドラッグしたりでき、うまくいけば -最初にたくさんの文書を読まなくても目的の作業ができてしまうこともある。 -伝統的な UNIX 環境は CLI (コマンド・ライン・インタフェース) であり、 -コマンドを打ち込んで、コンピュータに何をすべきか教えてやる。 -CLI は GUI よりも速く強力だが、どのコマンドが何をするのか知っている必要 -がある。CLI を使い始めるために必要最小限のコマンドを以下に述べる。 -.\"O .SS "Login" +何かをポイントしたり、クリックしたり、ドラッグしたりでき、うまくいけば 最初にたくさんの文書を読まなくても目的の作業ができてしまうこともある。 伝統的な +UNIX 環境は CLI (コマンド・ライン・インタフェース) であり、 コマンドを打ち込んで、コンピュータに何をすべきか教えてやる。 CLI は +GUI よりも速く強力だが、どのコマンドが何をするのか知っている必要 がある。CLI を使い始めるために必要最小限のコマンドを以下に述べる。 .SS ログイン -.\"O In order to start working, you probably first have to login, -.\"O that is, give your username and password. -.\"O See also -.\"O .BR login (1). -.\"O The program -.\"O .I login -.\"O now starts a -.\"O .I shell -.\"O (command interpreter) for you. -.\"O In case of a graphical login, you get a screen with menus or icons -.\"O and a mouse click will start a shell in a window. -.\"O See also -.\"O .BR xterm (1). -作業を開始するためには、ます最初にログインしなければならないだろう。 -すなわち、ユーザ名とパスワードを入力しなければならない。詳しくは -.BR login (1) -を参照のこと。 -.I login -プログラムは (コマンド・インタープリタである) -.I "シェル (shell)" -を起動する。グラフィカル・ログインの場合は、メニューやアイコンがある -スクリーンが表示され、マウスをクリックするとウィンドウが開いて -シェルが起動されることだろう。詳しくは -.BR xterm (1) -を参照のこと。 -.\"O .SS "The shell" +作業を開始するためには、ます最初にログインしなければならないだろう。 すなわち、ユーザ名とパスワードを入力しなければならない。詳しくは +\fBlogin\fP(1) を参照のこと。 \fIlogin\fP プログラムは (コマンド・インタープリタである) \fIシェル (shell)\fP +を起動する。グラフィカル・ログインの場合は、メニューやアイコンがある スクリーンが表示され、マウスをクリックするとウィンドウが開いて +シェルが起動されることだろう。詳しくは \fBxterm\fP(1) を参照のこと。 .SS シェル -.\"O One types commands to the -.\"O .IR shell , -.\"O the command interpreter. -.\"O It is not built-in, but is just a program -.\"O and you can change your shell. -.\"O Everybody has her own favorite one. -.\"O The standard one is called -.\"O .IR sh . -コマンドは、コマンド・インタープリタである -.I シェル -に対して入力する。 -.I シェル -は、組み込みコマンドではなく普通のプログラムであり、好みのものに変更する -ことができる。各人にはそれぞれ好みのシェルがある。標準のシェルは -.I sh -と呼ばれる。 -.\"O See also -.\"O .BR ash (1), -.\"O .BR bash (1), -.\"O .BR csh (1), -.\"O .BR zsh (1), -.\"O .BR chsh (1). -.BR ash (1), -.BR bash (1), -.BR csh (1), -.BR zsh (1), -.BR chsh (1) -を参照のこと。 +コマンドは、コマンド・インタープリタである \fIシェル\fP に対して入力する。 \fIシェル\fP +は、組み込みコマンドではなく普通のプログラムであり、好みのものに変更する ことができる。各人にはそれぞれ好みのシェルがある。標準のシェルは \fIsh\fP +と呼ばれる。 \fBash\fP(1), \fBbash\fP(1), \fBcsh\fP(1), \fBzsh\fP(1), \fBchsh\fP(1) を参照のこと。 .LP -.\"O A session might go like セッションの例を以下に示す。 .RS .nf -.BI "knuth login: " aeb -.BI "Password: " ******** -.BI "% " date +\fBknuth login: \fP\fIaeb\fP +\fBPassword: \fP\fI********\fP +\fB% \fP\fIdate\fP Tue Aug 6 23:50:44 CEST 2002 -.BI "% " cal +\fB% \fP\fIcal\fP August 2002 Su Mo Tu We Th Fr Sa 1 2 3 @@ -169,336 +75,105 @@ Su Mo Tu We Th Fr Sa 18 19 20 21 22 23 24 25 26 27 28 29 30 31 -.BI "% " ls +\fB% \fP\fIls\fP bin tel -.BI "% " "ls \-l" +\fB% \fP\fIls \-l\fP total 2 drwxrwxr\-x 2 aeb 1024 Aug 6 23:51 bin \-rw\-rw\-r\-\- 1 aeb 37 Aug 6 23:52 tel -.BI "% " "cat tel" +\fB% \fP\fIcat tel\fP maja 0501\-1136285 peter 0136\-7399214 -.BI "% " "cp tel tel2" -.BI "% " "ls \-l" +\fB% \fP\fIcp tel tel2\fP +\fB% \fP\fIls \-l\fP total 3 drwxr\-xr\-x 2 aeb 1024 Aug 6 23:51 bin \-rw\-r\-\-r\-\- 1 aeb 37 Aug 6 23:52 tel \-rw\-r\-\-r\-\- 1 aeb 37 Aug 6 23:53 tel2 -.BI "% " "mv tel tel1" -.BI "% " "ls \-l" +\fB% \fP\fImv tel tel1\fP +\fB% \fP\fIls \-l\fP total 3 drwxr\-xr\-x 2 aeb 1024 Aug 6 23:51 bin \-rw\-r\-\-r\-\- 1 aeb 37 Aug 6 23:52 tel1 \-rw\-r\-\-r\-\- 1 aeb 37 Aug 6 23:53 tel2 -.BI "% " "diff tel1 tel2" -.BI "% " "rm tel1" -.BI "% " "grep maja tel2" +\fB% \fP\fIdiff tel1 tel2\fP +\fB% \fP\fIrm tel1\fP +\fB% \fP\fIgrep maja tel2\fP maja 0501\-1136285 -.BI "% " +\fB% \fP .fi .RE - -.\"O and here typing Control-D ended the session. -ここで Control-D を打つとセッションが終了する。 -.\"O The -.\"O .B "% " -.\"O here was the command prompt\(emit is the shell's way of indicating -.\"O that it is ready for the next command. -.\"O The prompt can be customized -.\"O in lots of ways, and one might include stuff like username, -.\"O machine name, current directory, time, etc. -.\"O An assignment PS1="What next, master? " -.\"O would change the prompt as indicated. -ここで、 -.B "% " -はコマンド・プロンプトである。コマンド・プロンプトはシェル独特のやり方で、 -シェルが次のコマンドを受け付けられる状態になっていることを示している。 -プロンプトは、柔軟にカスタマイズ -することができ、ユーザ名、マシン名、カレント・ディレクトリ、時刻などを -プロンプトに含めることができる。 -PS1="What next, master? " と設定すると、 -プロンプトはそのように変更されるだろう。 +ここで Control\-D を打つとセッションが終了する。 ここで、 \fB% \fP +はコマンド・プロンプトである。コマンド・プロンプトはシェル独特のやり方で、 シェルが次のコマンドを受け付けられる状態になっていることを示している。 +プロンプトは、柔軟にカスタマイズ することができ、ユーザ名、マシン名、カレント・ディレクトリ、時刻などを プロンプトに含めることができる。 +PS1="What next, master? " と設定すると、 プロンプトはそのように変更されるだろう。 .LP -.\"O We see that there are commands -.\"O .I date -.\"O (that gives date and time), and -.\"O .I cal -.\"O (that gives a calendar). -例にあるように、 -.I date -という日付と時刻を表示するコマンドや、 -.I cal -というカレンダを表示するコマンドもある。 +例にあるように、 \fIdate\fP という日付と時刻を表示するコマンドや、 \fIcal\fP というカレンダを表示するコマンドもある。 .LP -.\"O The command -.\"O .I ls -.\"O lists the contents of the current directory\(emit tells you what -.\"O files you have. -.\"O With a -.\"O .I \-l -.\"O option it gives a long listing, -.\"O that includes the owner and size and date of the file, and the -.\"O permissions people have for reading and/or changing the file. -.\"O For example, the file "tel" here is 37 bytes long, owned by aeb -.\"O and the owner can read and write it, others can only read it. -.\"O Owner and permissions can be changed by the commands -.\"O .I chown -.\"O and -.\"O .IR chmod . -.I ls -コマンドはカレント・ディレクトリの内容をリスト表示する、つまり -ディレクトリ内にどんなファイルがあるかを教えてくれる。 -.I \-l -オプションをつけて実行すると、詳細表示が行われ、 -ファイルの所有者、サイズ、日付などが表示される。 -上の例では、"tel" ファイルは、サイズが 37 バイトで、所有者は aeb で、 -所有者は読み書きができ、他の人は読み出しだけができることが分かる。 -ファイルの所有者と権限 (permission) は、それぞれ -.I chown -コマンドと -.I chmod -コマンドで変更できる。 +\fIls\fP コマンドはカレント・ディレクトリの内容をリスト表示する、つまり ディレクトリ内にどんなファイルがあるかを教えてくれる。 \fI\-l\fP +オプションをつけて実行すると、詳細表示が行われ、 ファイルの所有者、サイズ、日付などが表示される。 上の例では、"tel" ファイルは、サイズが 37 +バイトで、所有者は aeb で、 所有者は読み書きができ、他の人は読み出しだけができることが分かる。 ファイルの所有者と権限 (permission) +は、それぞれ \fIchown\fP コマンドと \fIchmod\fP コマンドで変更できる。 .LP -.\"O The command -.\"O .I cat -.\"O will show the contents of a file. -.\"O (The name is from "concatenate and print": all files given as -.\"O parameters are concatenated and sent to "standard output", here -.\"O the terminal screen.) -.I cat -コマンドはファイルの内容を表示する。 -(コマンド名は "concatenate and print" (連結して印字する) に由来している。 -引数として与えられた全てのファイルの内容が連結され、「標準出力」 -に送られる。上の例では、標準出力は端末のスクリーンである。) +\fIcat\fP コマンドはファイルの内容を表示する。 (コマンド名は "concatenate and print" (連結して印字する) +に由来している。 引数として与えられた全てのファイルの内容が連結され、「標準出力」 に送られる。上の例では、標準出力は端末のスクリーンである。) .LP -.\"O The command -.\"O .I cp -.\"O (from "copy") will copy a file. -.\"O On the other hand, the command -.\"O .I mv -.\"O (from "move") only renames it. -.I cp -コマンドはファイルのコピーを行う (その名前は "copy" に由来する)。 -一方、 -.I mv -コマンドは単純にファイル名の変更を行う +\fIcp\fP コマンドはファイルのコピーを行う (その名前は "copy" に由来する)。 一方、 \fImv\fP コマンドは単純にファイル名の変更を行う (その名前は "move" に由来する)。 .LP -.\"O The command -.\"O .I diff -.\"O lists the differences between two files. -.\"O Here there was no output because there were no differences. -.I diff -コマンドは 2 つのファイルの違いを表示する。 -上の例では、二つのファイルに違いがないので、何も出力されていない。 +\fIdiff\fP コマンドは 2 つのファイルの違いを表示する。 上の例では、二つのファイルに違いがないので、何も出力されていない。 .LP -.\"O The command -.\"O .I rm -.\"O (from "remove") deletes the file, and be careful! it is gone. -.\"O No wastepaper basket or anything. -.\"O Deleted means lost. -.I rm -コマンドはファイルを削除する。ファイルはなくなってしまうので -注意して使用すること! ゴミ箱に相当するものはなく、 +\fIrm\fP コマンドはファイルを削除する。ファイルはなくなってしまうので 注意して使用すること! ゴミ箱に相当するものはなく、 削除はそのファイルが完全に失われることを意味する。 .LP -.\"O The command -.\"O .I grep -.\"O (from "g/re/p") finds occurrences of a string in one or more files. -.\"O Here it finds Maja's telephone number. -.I grep -コマンドは、指定された文字列を一つ以上のファイルから探す -(コマンド名は "g/re/p" に由来している)。 -上の例では、Maja の電話番号が見つかっている。 -.\"O .SS "Pathnames and the current directory" +\fIgrep\fP コマンドは、指定された文字列を一つ以上のファイルから探す (コマンド名は "g/re/p" に由来している)。 上の例では、Maja +の電話番号が見つかっている。 .SS パス名とカレント・ディレクトリ -.\"O Files live in a large tree, the file hierarchy. -.\"O Each has a -.\"O .I "pathname" -.\"O describing the path from the root of the tree (which is called /) -.\"O to the file. -.\"O For example, such a full pathname might be /home/aeb/tel. -.\"O Always using full pathnames would be inconvenient, and the name -.\"O of a file in the current directory may be abbreviated by only giving -.\"O the last component. -.\"O That is why "/home/aeb/tel" can be abbreviated -.\"O to "tel" when the current directory is "/home/aeb". -ファイルはファイル階層という大きな木の中にある。それぞれのファイルには -.I "パス名 (pathname)" -があり、パス名は (/ と呼ばれる) 木の根からの経路を示すものである。 -上の例では、完全なパス名は /home/aeb/tel のようになる。 -いつも完全なパス名を使うのは不便なので、カレント・ディレクトリにある -ファイル名は、ファイル名の最後の部分だけに省略することができる。 -したがって、カレント・ディレクトリが "/home/aeb" の時は、 "/home/aeb/tel" -を "tel" に省略して書くことができる。 +ファイルはファイル階層という大きな木の中にある。それぞれのファイルには \fIパス名 (pathname)\fP があり、パス名は (/ と呼ばれる) +木の根からの経路を示すものである。 上の例では、完全なパス名は /home/aeb/tel のようになる。 +いつも完全なパス名を使うのは不便なので、カレント・ディレクトリにある ファイル名は、ファイル名の最後の部分だけに省略することができる。 +したがって、カレント・ディレクトリが "/home/aeb" の時は、 "/home/aeb/tel" を "tel" に省略して書くことができる。 .LP -.\"O The command -.\"O .I pwd -.\"O prints the current directory. -.I pwd -コマンドはカレント・ディレクトリを表示する。 +\fIpwd\fP コマンドはカレント・ディレクトリを表示する。 .LP -.\"O The command -.\"O .I cd -.\"O changes the current directory. -.\"O Try "cd /" and "pwd" and "cd" and "pwd". -.I cd -コマンドはカレント・ディレクトリを変更する。 -"cd /"、"pwd"、"cd"、"pwd" と順に実行してみるとよい。 -.\"O .SS "Directories" +\fIcd\fP コマンドはカレント・ディレクトリを変更する。 "cd /"、"pwd"、"cd"、"pwd" と順に実行してみるとよい。 .SS ディレクトリ -.\"O The command -.\"O .I mkdir -.\"O makes a new directory. -.I mkdir -コマンドはディレクトリを新規に作成する。 +\fImkdir\fP コマンドはディレクトリを新規に作成する。 .LP -.\"O The command -.\"O .I rmdir -.\"O removes a directory if it is empty, and complains otherwise. -.I rmdir -コマンドは空であればディレクトリを削除し、 -空でなければエラーメッセージを表示する。 +\fIrmdir\fP コマンドは空であればディレクトリを削除し、 空でなければエラーメッセージを表示する。 .LP -.\"O The command -.\"O .I find -.\"O (with a rather baroque syntax) will find files with given name -.\"O or other properties. -.\"O For example, "find . \-name tel" would find -.\"O the file "tel" starting in the present directory (which is called "."). -.\"O And "find / \-name tel" would do the same, but starting at the root -.\"O of the tree. -.\"O Large searches on a multi-GB disk will be time-consuming, -.\"O and it may be better to use -.\"O .BR locate (1). -.I find -コマンドは、指定された名前やその他の属性を持つファイルを探す -(書式はかなり変わっている)。例えば、"find . \-name tel" を実行すると、 -"tel" という名前のファイルの検索をカレント・ディレクトリから開始する。 -(カレント・ディレクトリは "." で表す)。"find / \-name tel" としても -同じことを行うが、検索は木の根 (/) から開始される。 -数 GB のディスクに対して検索をかけると時間がかかるので、 -そのようなときは -.BR locate (1) -を使った方がいいかもしれない。 -.\"O .SS "Disks and Filesystems" +\fIfind\fP コマンドは、指定された名前やその他の属性を持つファイルを探す (書式はかなり変わっている)。例えば、"find . \-name tel" +を実行すると、 "tel" という名前のファイルの検索をカレント・ディレクトリから開始する。 (カレント・ディレクトリは "." で表す)。"find +/ \-name tel" としても 同じことを行うが、検索は木の根 (/) から開始される。 数 GB +のディスクに対して検索をかけると時間がかかるので、 そのようなときは \fBlocate\fP(1) を使った方がいいかもしれない。 .SS ディスクとファイルシステム -.\"O The command -.\"O .I mount -.\"O will attach the file system found on some disk (or floppy, or CDROM or so) -.\"O to the big file system hierarchy. -.\"O And -.\"O .I umount -.\"O detaches it again. -.\"O The command -.\"O .I df -.\"O will tell you how much of your disk is still free. -.I mount -コマンドは、(フロッピーや CDROM などの) ディスク上のファイルシステムを -大きなファイルシステム階層に接続する。逆に -.I umount -コマンドは切り離しを行う。 -.I df -コマンドを実行すると、ディスクの未使用量がどの程度かを表示する。 -.\"O .SS "Processes" +\fImount\fP コマンドは、(フロッピーや CDROM などの) ディスク上のファイルシステムを 大きなファイルシステム階層に接続する。逆に +\fIumount\fP コマンドは切り離しを行う。 \fIdf\fP コマンドを実行すると、ディスクの未使用量がどの程度かを表示する。 .SS プロセス -.\"O On a UNIX system many user and system processes run simultaneously. -.\"O The one you are talking to runs in the -.\"O .IR foreground , -.\"O the others in the -.\"O .IR background . -UNIX システムでは、多くのユーザプロセスとシステムプロセスが同時に実行される。 -対話的に実行できるプロセスは -.I foreground -で実行されており、そうでないものは -.I background -で実行されている。 -.\"O The command -.\"O .I ps -.\"O will show you which processes are active and what numbers these -.\"O processes have. -コマンド -.I ps -により、どのプロセスが実行されているかやプロセスが持っている番号 -(プロセス番号) を表示できる。 -.\"O The command -.\"O .I kill -.\"O allows you to get rid of them. -.\"O Without option this is a friendly -.\"O request: please go away. -.\"O And "kill \-9" followed by the number -.\"O of the process is an immediate kill. -コマンド -.I kill -を使うことで、プロセスを取り除くことができる。 -オプションなしで実行されると、「いなくなって下さい」というやさしい要求 -を行う。"kill \-9" に続けてプロセス番号を指定すると、指定したプロセスを -直ちに削除する。 -.\"O Foreground processes can often be killed by typing Control-C. -foreground プロセスは多くの場合 Control-C をタイプすることで -殺すことができる。 -.\"O .SS "Getting information" +UNIX システムでは、多くのユーザプロセスとシステムプロセスが同時に実行される。 対話的に実行できるプロセスは \fIforeground\fP +で実行されており、そうでないものは \fIbackground\fP で実行されている。 コマンド \fIps\fP +により、どのプロセスが実行されているかやプロセスが持っている番号 (プロセス番号) を表示できる。 コマンド \fIkill\fP +を使うことで、プロセスを取り除くことができる。 オプションなしで実行されると、「いなくなって下さい」というやさしい要求 を行う。"kill \-9" +に続けてプロセス番号を指定すると、指定したプロセスを 直ちに削除する。 foreground プロセスは多くの場合 Control\-C +をタイプすることで 殺すことができる。 .SS 情報の探し方 -.\"O There are thousands of commands, each with many options. -非常にたくさんのコマンドがあり、 -それぞれのコマンドにはたくさんのオプションがある。 -.\"O Traditionally commands are documented on -.\"O .IR "man pages" , -.\"O (like this one), so that the command "man kill" will document -.\"O the use of the command "kill" (and "man man" document the command "man"). -.\"O The program -.\"O .I man -.\"O sends the text through some -.\"O .IR pager , -.\"O usually -.\"O .IR less . -.\"O Hit the space bar to get the next page, hit q to quit. -伝統的には、コマンドの説明は (このドキュメントもそうだが) -.I "man ページ" -に書かれている。例えば "man kill" コマンドを実行すると、"kill" コマンドの -使い方に関する説明が表示される。(同様に "man man" は "man" コマンドに -ついての説明を表示する。) -.I man -プログラムはテキストを -.I pager -に渡して表示を行う。 -.I pager -として -.I less -が使われることが多い。 +非常にたくさんのコマンドがあり、 それぞれのコマンドにはたくさんのオプションがある。 伝統的には、コマンドの説明は (このドキュメントもそうだが) +\fIman ページ\fP に書かれている。例えば "man kill" コマンドを実行すると、"kill" コマンドの +使い方に関する説明が表示される。(同様に "man man" は "man" コマンドに ついての説明を表示する。) \fIman\fP +プログラムはテキストを \fIpager\fP に渡して表示を行う。 \fIpager\fP として \fIless\fP が使われることが多い。 次のページに進むにはスペース・キーを、終了するには q を押す。 .LP -.\"O In documentation it is customary to refer to man pages -.\"O by giving the name and section number, as in -.\"O .BR man (1). -.\"O Man pages are terse, and allow you to find quickly some forgotten -.\"O detail. -.\"O For newcomers an introductory text with more examples -.\"O and explanations is useful. -ドキュメントでは、他の man ページへの参照は -.BR man (1) -のように名前とセクション番号で示すのが一般的である。 -man ページは簡潔に書かれており、詳細を忘れたときに素早く情報を見つける -ことができる。例や説明とともに入門向けの記載もあるので、初めての人にとっても +ドキュメントでは、他の man ページへの参照は \fBman\fP(1) のように名前とセクション番号で示すのが一般的である。 man +ページは簡潔に書かれており、詳細を忘れたときに素早く情報を見つける ことができる。例や説明とともに入門向けの記載もあるので、初めての人にとっても 役に立つものである。 .LP -.\"O A lot of GNU/FSF software is provided with info files. -.\"O Type "info info" -.\"O for an introduction on the use of the program "info". -多くの GNU/FSF ソフトウェアには info ファイルが付属している。 -"info info" とタイプすると、"info" プログラムの使い方の紹介が表示される。 +多くの GNU/FSF ソフトウェアには info ファイルが付属している。 "info info" とタイプすると、"info" +プログラムの使い方の紹介が表示される。 .LP -.\"O Special topics are often treated in HOWTOs. -.\"O Look in -.\"O .I /usr/share/doc/howto/en -.\"O and use a browser if you find HTML files there. -特集記事については HOWTO で扱われることが多い。 -.I /usr/share/doc/howto/en -を見るといいだろう。 -HTML ファイルがあった場合はブラウザを使って表示すればよい。 .\" .\" Actual examples? Separate section for each of cat, cp, ...? .\" gzip, bzip2, tar, rpm -.\"O .SH "SEE ALSO" +特集記事については HOWTO で扱われることが多い。 \fI/usr/share/doc/howto/en\fP を見るといいだろう。 HTML +ファイルがあった場合はブラウザを使って表示すればよい。 .SH 関連項目 -.BR standards (7) +\fBstandards\fP(7) diff --git a/draft/man1/ldd.1 b/draft/man1/ldd.1 index 74104953..f867ad2e 100644 --- a/draft/man1/ldd.1 +++ b/draft/man1/ldd.1 @@ -7,124 +7,52 @@ .\" Most of this was copied from the README file. .\" Do not restrict distribution. .\" May be distributed under the GNU General Public License +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. -.\" Translated Sat May 23 1998 by NAKANO Takeo -.\" Updated & Modified Wed Jan 6 1999 by NAKANO Takeo -.\" Updated & Modified Wed Jan 16 21:05:41 JST 2002 -.\" by Yuichi SATO +.\" This file was generated with po4a. Translate the source file. .\" -.TH LDD 1 2000-10-30 "" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O ldd \- print shared library dependencies +.\"******************************************************************* +.TH LDD 1 2000\-10\-30 "" "Linux Programmer's Manual" .SH 名前 ldd \- 共有ライブラリへの依存関係を表示する -.\"O .SH SYNOPSIS .SH 書式 -.BR ldd " [OPTION]... FILE..." -.\"O .SH DESCRIPTION +\fBldd\fP [OPTION]... FILE... .SH 説明 -.\"O .B ldd -.\"O prints the shared libraries required by each program or shared library -.\"O specified on the command line. -.B ldd -はコマンドラインで指定したプログラムや共有ライブラリについて、 -それぞれで必要とされる共有ライブラリを表示する。 -.\"O .SH OPTIONS +\fBldd\fP はコマンドラインで指定したプログラムや共有ライブラリについて、 それぞれで必要とされる共有ライブラリを表示する。 .SH オプション -.TP -.B \-\-version -.\"O Print the version number of -.\"O .BR ldd . -.B ldd -のバージョン番号を表示する。 -.TP -.B \-v\ \-\-verbose -.\"O Print all information, including, for example, -.\"O symbol versioning information. +.TP +\fB\-\-version\fP +\fBldd\fP のバージョン番号を表示する。 +.TP +\fB\-v\ \-\-verbose\fP シンボルのバージョン情報などを含めた全ての情報を表示する。 -.TP -.B \-u\ \-\-unused -.\"O Print unused direct dependencies. -.\"O (Since glibc 2.3.4.) -使用されていない直接の依存関係を表示する -(glibc 2.3.4 以降)。 -.TP -.B \-d\ \-\-data\-relocs -.\"O Perform relocations and report any missing objects (ELF only). +.TP +\fB\-u\ \-\-unused\fP +使用されていない直接の依存関係を表示する (glibc 2.3.4 以降)。 +.TP +\fB\-d\ \-\-data\-relocs\fP リロケーションを実行し、足りないオブジェクトについてレポートする (ELF のみ)。 -.TP -.B \-r\ \-\-function\-relocs -.\"O report any missing objects or functions (ELF only). +.TP +\fB\-r\ \-\-function\-relocs\fP 足りないオブジェクトや関数についてレポートする (ELF のみ)。 -.TP -.B \-\-help -.\"O Usage information. +.TP +\fB\-\-help\fP 使用法を表示する。 -.\"O .SH NOTES .SH 注意 -.\"O The standard version of -.\"O .B ldd -.\"O comes with glibc2. -.\"O Libc5 came with an older version, still present -.\"O on some systems. -.\"O The long options are not supported by the libc5 version. -標準的なバージョンの -.B ldd -は glibc2 に付属している。 -libc5 には古いバージョンのものが付属しており、 -これが入っているシステムもまだ存在する。 -libc5 バージョンではロングオプションがサポートされていない。 -.\"O On the other hand, the glibc2 version does not support -.\"O .B \-V -.\"O and only has the equivalent -.\"O .BR \-\-version . -一方、glibc2 バージョンでは -.B \-V -をサポートしておらず、これと同じ意味の -.B \-\-version -しかサポートしていない。 +標準的なバージョンの \fBldd\fP は glibc2 に付属している。 libc5 には古いバージョンのものが付属しており、 +これが入っているシステムもまだ存在する。 libc5 バージョンではロングオプションがサポートされていない。 一方、glibc2 バージョンでは +\fB\-V\fP をサポートしておらず、これと同じ意味の \fB\-\-version\fP しかサポートしていない。 .LP -.\"O The libc5 version of this program will use the name of a library given -.\"O on the command line as-is when it contains a \(aq/\(aq; otherwise it -.\"O searches for the library in the standard locations. -.\"O To run it -.\"O on a shared library in the current directory, prefix the name with "./". -libc5 バージョンのプログラムでは、 -コマンドラインで与えられたライブラリ名に -\(aq/\(aq が含まれている場合は、ライブラリ名をそのまま用いる。 -\(aq/\(aq が含まれていない場合は、標準的なパスからライブラリを検索する。 -カレントディレクトリにある共有ライブラリに対して実行するには、 -名前にプレフィックス "./" を付けること。 -.\"O .SH BUGS +libc5 バージョンのプログラムでは、 コマンドラインで与えられたライブラリ名に \(aq/\(aq +が含まれている場合は、ライブラリ名をそのまま用いる。 \(aq/\(aq が含まれていない場合は、標準的なパスからライブラリを検索する。 +カレントディレクトリにある共有ライブラリに対して実行するには、 名前にプレフィックス "./" を付けること。 .SH バグ -.\"O .B ldd -.\"O does not work on a.out shared libraries. -.B ldd -は a.out 共有ライブラリでは動作しない。 +\fBldd\fP は a.out 共有ライブラリでは動作しない。 .PP -.\"O .B ldd -.\"O does not work with some extremely old a.out programs which were -.\"O built before -.\"O .B ldd -.\"O support was added to the compiler releases. -.B ldd -は非常に古い a.out プログラム -.RB ( ldd -のサポートがコンパイラに追加される以前にビルドされたようなプログラム) -では動作しない。 -.\"O If you use -.\"O .B ldd -.\"O on one of these programs, the program will attempt to run with -.\"O \fIargc\fP = 0 and the results will be unpredictable. -このようなプログラムに対して -.B ldd -を用いると、プログラムは \fIargc\fP = 0 で実行される。結果は予想不可能である。 -.\"O .\" .SH AUTHOR -.\" .SH 著者 +.\" .SH AUTHOR .\" David Engel. .\" Roland McGrath and Ulrich Drepper. -.\"O .SH SEE ALSO +\fBldd\fP は非常に古い a.out プログラム (\fBldd\fP のサポートがコンパイラに追加される以前にビルドされたようなプログラム) +では動作しない。 このようなプログラムに対して \fBldd\fP を用いると、プログラムは \fIargc\fP = 0 で実行される。結果は予想不可能である。 .SH 関連項目 -.BR ld.so (8), -.BR ldconfig (8) +\fBld.so\fP(8), \fBldconfig\fP(8) diff --git a/draft/man1/time.1 b/draft/man1/time.1 index b874de9f..b81e107a 100644 --- a/draft/man1/time.1 +++ b/draft/man1/time.1 @@ -4,472 +4,199 @@ .\" Some fragments of text came from the time-1.7 info file. .\" Inspired by kromJx@crosswinds.net. .\" -.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2008-11-20, Akihiro MOTOKI , LDP v3.13 -.\" -.TH TIME 1 2008-11-14 "" "Linux User's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH TIME 1 2008\-11\-14 "" "Linux User's Manual" .SH 名前 -.\"O time \- time a simple command or give resource usage time \- コマンドの時間計測やリソース使用量を表示する -.\"O .SH SYNOPSIS .SH 書式 -.BI "time [" options "] " command " [" arguments... "] " -.\"O .SH DESCRIPTION +\fBtime [\fP\fIoptions\fP\fB] \fP\fIcommand\fP\fB [\fP\fIarguments...\fP\fB] \fP .SH 説明 -.\"O The -.\"O .B time -.\"O command runs the specified program -.\"O .I command -.\"O with the given arguments. -.B time -コマンドは、指定されたプログラム -.I command -を渡された引き数で実行する。 -.\"O When -.\"O .I command -.\"O finishes, -.\"O .B time -.\"O writes a message to standard error giving timing statistics -.\"O about this program run. -.I command -が終了すると、 -.B time -はこのプログラムの実行時間の統計情報についてのメッセージを -標準エラー出力に出力する。 -.\"O These statistics consist of (i) the elapsed real time -.\"O between invocation and termination, (ii) the user CPU time -.\"O (the sum of the -.\"O .I tms_utime -.\"O and -.\"O .I tms_cutime -.\"O values in a -.\"O .I "struct tms" -.\"O as returned by -.\"O .BR times (2)), -.\"O and (iii) the system CPU time (the sum of the -.\"O .I tms_stime -.\"O and -.\"O .I tms_cstime -.\"O values in a -.\"O .I "struct tms" -.\"O as returned by -.\"O .BR times (2)). -表示される統計情報は以下の三つから構成される: -(i) 起動から終了までに経過した実時間 (real time)、 -(ii) ユーザ CPU 時間 -.RB ( times (2) -が返す -.I "struct tms" -の -.I tms_utime -と -.I tms_cutime -の値の合計)、 -(iii) システム CPU 時間 -.RB ( times (2) -が返す -.I "struct tms" -の -.I tms_stime -と -.I tms_cstime -の値の合計)。 +\fBtime\fP コマンドは、指定されたプログラム \fIcommand\fP を渡された引き数で実行する。 \fIcommand\fP が終了すると、 +\fBtime\fP はこのプログラムの実行時間の統計情報についてのメッセージを 標準エラー出力に出力する。 表示される統計情報は以下の三つから構成される: +(i) 起動から終了までに経過した実時間 (real time)、 (ii) ユーザ CPU 時間 (\fBtimes\fP(2) が返す \fIstruct +tms\fP の \fItms_utime\fP と \fItms_cutime\fP の値の合計)、 (iii) システム CPU 時間 (\fBtimes\fP(2) +が返す \fIstruct tms\fP の \fItms_stime\fP と \fItms_cstime\fP の値の合計)。 -.\"O Note: some shells (e.g., -.\"O .BR bash (1)) -.\"O have a built-in -.\"O .B time -.\"O command that provides less functionality than the command described here. -.\"O To access the real command, you may need to specify its pathname -.\"O (something like -.\"O .IR /usr/bin/time ). -.RB ( bash (1) -などの) いくつかのシェルには、ここで説明するコマンドよりも -機能が少ない、組み込みの -.B time -コマンドが存在する。 -組み込みではない実際のコマンドを使用するためには、 -.RI ( /usr/bin/time -のような) コマンドのパス名を指定する必要があるかもしれない。 -.\"O .SH OPTIONS +(\fBbash\fP(1) などの) いくつかのシェルには、ここで説明するコマンドよりも 機能が少ない、組み込みの \fBtime\fP コマンドが存在する。 +組み込みではない実際のコマンドを使用するためには、 (\fI/usr/bin/time\fP のような) コマンドのパス名を指定する必要があるかもしれない。 .SH オプション -.TP -.B \-p -.\"O When in the POSIX locale, use the precise traditional format -.\"O .br -.\"O .in +5 -.\"O "real %f\enuser %f\ensys %f\en" -.\"O .in -5 -.\"O .br -.\"O (with numbers in seconds) -.\"O where the number of decimals in the output for %f is unspecified -.\"O but is sufficient to express the clock tick accuracy, and at least one. +.TP +\fB\-p\fP POSIX ロケールの場合、伝統的なフォーマットである -.in +5 +.IP +.in +4n "real %f\enuser %f\ensys %f\en" -.in -5 -が使用される (各数字は秒単位)。 -%f の出力での小数点以下の桁数は規定されていないが、 -クロック・ティック (clock tick) の精度を表すのに十分な桁数となり、 -少なくとも一桁は存在する。 -.\"O .SH "EXIT STATUS" +.in +.IP +が使用される (各数字は秒単位)。 %f の出力での小数点以下の桁数は規定されていないが、 クロック・ティック (clock tick) +の精度を表すのに十分な桁数となり、 少なくとも一桁は存在する。 .SH 終了ステータス -.\"O If -.\"O .I command -.\"O was invoked, the exit status is that of -.\"O .IR command . -.\"O Otherwise it is 127 if -.\"O .I command -.\"O could not be found, 126 if it could be found but could not be invoked, -.\"O and some other nonzero value (1-125) if something else went wrong. -.I command -が起動された場合は、 -.I command -の終了ステータスが終了ステータスとなる。 -.I command -が見つからなかった場合は終了ステータスは 127 で、 -.I command -が見つかったが起動できなかった場合は 126 となる。 -これ以外で何かエラーがあった場合は、終了ステータスは -0 以外の前記以外の値 (1-125) の何かになる。 -.\"O .SH ENVIRONMENT +\fIcommand\fP が起動された場合は、 \fIcommand\fP の終了ステータスが終了ステータスとなる。 \fIcommand\fP +が見つからなかった場合は終了ステータスは 127 で、 \fIcommand\fP が見つかったが起動できなかった場合は 126 となる。 +これ以外で何かエラーがあった場合は、終了ステータスは 0 以外の前記以外の値 (1\-125) の何かになる。 .SH 環境変数 -.\"O The variables -.\"O .BR LANG , -.\"O .BR LC_ALL , -.\"O .BR LC_CTYPE , -.\"O .BR LC_MESSAGES , -.\"O .BR LC_NUMERIC , -.\"O .BR NLSPATH , -.\"O and -.\"O .B PATH -.\"O are used. -環境変数 -.BR LANG , -.BR LC_ALL , -.BR LC_CTYPE , -.BR LC_MESSAGES , -.BR LC_NUMERIC , -.BR NLSPATH , -.B PATH -が使用される。 -.\"O The last one to search for -.\"O .IR command . -.\"O The remaining ones for the text and formatting of the output. -.B PATH -は -.I command +環境変数 \fBLANG\fP, \fBLC_ALL\fP, \fBLC_CTYPE\fP, \fBLC_MESSAGES\fP, \fBLC_NUMERIC\fP, +\fBNLSPATH\fP, \fBPATH\fP が使用される。 \fBPATH\fP は \fIcommand\fP を探すのに使われる。それ以外は出力文字や書式に使用される。 -.\"O .SH "GNU VERSION" -.SH GNU バージョン -.\"O Below a description of the GNU 1.7 version of -.\"O .BR time . -.\"O Disregarding the name of the utility, GNU makes it output lots of -.\"O useful information, not only about time used, but also on other -.\"O resources like memory, I/O and IPC calls (where available). -.\"O The output is formatted using a format string that can be specified -.\"O using the \-f option or the -.\"O .B TIME -.\"O environment variable. -以下は GNU 1.7 バージョンの -.BR time -の説明である。コマンド名とは裏腹に、GNU バージョンでは -有益な情報がたくさん出力される。使用時間だけでなく、 -(取得できる場合には) メモリや I/O、IPC 呼び出しなどの他のリソース -に関する情報も出力される。 -出力はフォーマット文字列を使って整形され、 -フォーマット文字列は \-f オプションか環境変数 -.B TIME -で指定できる。 +.SH "GNU バージョン" +以下は GNU 1.7 バージョンの \fBtime\fP の説明である。コマンド名とは裏腹に、GNU バージョンでは +有益な情報がたくさん出力される。使用時間だけでなく、 (取得できる場合には) メモリや I/O、IPC 呼び出しなどの他のリソース +に関する情報も出力される。 出力はフォーマット文字列を使って整形され、 フォーマット文字列は \-f オプションか環境変数 \fBTIME\fP で指定できる。 .LP -.\"O The default format string is デフォルトのフォーマット文字列は以下の通り。 -.br -.in +3 +.PP +.in +4n %Uuser %Ssystem %Eelapsed %PCPU (%Xtext+%Ddata %Mmax)k .br %Iinputs+%Ooutputs (%Fmajor+%Rminor)pagefaults %Wswaps .br -.in -3 +.in .LP -.\"O When the \-p option is given the (portable) output format -\-p オプションが指定された場合には、(他と互換性のある) 出力 -フォーマットが使用される。 -.br -.in +3 +\-p オプションが指定された場合には、 +.PP +.in +4n real %e .br user %U .br sys %S .br -.in -3 -.\"O is used. -.\"O .SS "The format string" -.SS "フォーマット文字列" -.\"O The format is interpreted in the usual printf-like way. -.\"O Ordinary characters are directly copied, tab, newline -.\"O and backslash are escaped using \et, \en and \e\e, -.\"O a percent sign is represented by %%, and otherwise % -.\"O indicates a conversion. -.\"O The program -.\"O .B time -.\"O will always add a trailing newline itself. -.\"O The conversions follow. -.\"O All of those used by -.\"O .BR tcsh (1) -.\"O are supported. -フォーマットはよくある printf 形式で解釈される。 -通常の文字はそのままコピーされ、 -タブ、改行 (newline)、バックスラッシュはそれぞれ \et, \en, \e\e で -エスケープされる。 -パーセント記号は %% で表現され、それ以外の % は変換を示す。 -末尾には必ず改行文字 (newline) が追加される。 -変換は以下の通りである。 -.BR tcsh (1) -で使用される変換は全てサポートされている。 +.in +.PP +という (他と互換性のある) 出力フォーマットが使用される。 +.SS フォーマット文字列 +フォーマットはよくある printf 形式で解釈される。 通常の文字はそのままコピーされ、 タブ、改行 (newline)、バックスラッシュはそれぞれ +\et, \en, \e\e で エスケープされる。 パーセント記号は %% で表現され、それ以外の % は変換を示す。 末尾には必ず改行文字 +(newline) が追加される。 変換は以下の通りである。 \fBtcsh\fP(1) で使用される変換は全てサポートされている。 .LP -.B "Time" -.TP -.B %E -.\"O Elapsed real time (in [hours:]minutes:seconds). +\fBTime\fP +.TP +\fB%E\fP 経過した実時間 ([hours:]minutes:seconds の形式)。 -.TP -.B %e -.\"O (Not in tcsh.) Elapsed real time (in seconds). +.TP +\fB%e\fP (tcsh にはない) 経過した実時間 (秒単位)。 -.TP -.B %S -.\"O Total number of CPU-seconds that the process spent in kernel mode. +.TP +\fB%S\fP そのプロセスがカーネルモードで消費した CPU 時間の合計 (秒単位)。 -.TP -.B %U -.\"O Total number of CPU-seconds that the process spent in user mode. +.TP +\fB%U\fP そのプロセスがユーザモードで消費した CPU 時間の合計 (秒単位)。 -.TP -.B %P -.\"O Percentage of the CPU that this job got, computed as (%U + %S) / %E. -このジョブが獲得した CPU の割り合い (パーセンテージ)。 -(%U + %S) / %E で計算される。 +.TP +\fB%P\fP +このジョブが獲得した CPU の割り合い (パーセンテージ)。 (%U + %S) / %E で計算される。 .LP -.B "Memory" -.TP -.B %M -.\"O Maximum resident set size of the process during its lifetime, in Kbytes. -プロセス生存中のそのプロセスの resident set size の最大値。 -キロバイト単位。 -.TP -.B %t -.\"O (Not in tcsh.) Average resident set size of the process, in Kbytes. -(tcsh にはない) -そのプロセスの resident set size の平均値。 -キロバイト単位。 -.TP -.B %K -.\"O Average total (data+stack+text) memory use of the process, -.\"O in Kbytes. -そのプロセスのメモリ使用量の合計 (データ+スタック+テキスト) の平均値。 -キロバイト単位。 -.TP -.B %D -.\"O Average size of the process's unshared data area, in Kbytes. -そのプロセスの非共有データ領域の平均サイズ。 -キロバイト単位。 -.TP -.B %p -.\"O (Not in tcsh.) Average size of the process's unshared stack space, in Kbytes. -(tcsh にはない) -そのプロセスの非共有スタック空間の平均サイズ。 -キロバイト単位。 -.TP -.B %X -.\"O Average size of the process's shared text space, in Kbytes. -そのプロセスの共有テキスト空間の平均サイズ。 -キロバイト単位。 -.TP -.B %Z -.\"O (Not in tcsh.) System's page size, in bytes. -.\"O This is a per-system constant, but varies between systems. -(tcsh にはない) システムのページサイズ (バイト単位)。 -この値はシステム毎に決まる定数だが、システムにより異なる。 -.TP -.B %F -.\"O Number of major page faults that occurred while the process was running. -.\"O These are faults where the page has to be read in from disk. -プロセスの動作中に発生したメジャーページフォルトの回数。 -これは、ディスクからページを読み込む必要があったページフォルトに -関するものである。 -.TP -.B %R -.\"O Number of minor, or recoverable, page faults. -.\"O These are faults for pages that are not valid but which have -.\"O not yet been claimed by other virtual pages. Thus the data -.\"O in the page is still valid but the system tables must be updated. -マイナーページフォールト、つまり回復可能なページフォルトの回数。 -これは、そのページは有効でないが、まだ他の仮想ページに奪われて +\fBMemory\fP +.TP +\fB%M\fP +プロセス生存中のそのプロセスの resident set size の最大値。 キロバイト単位。 +.TP +\fB%t\fP +(tcsh にはない) そのプロセスの resident set size の平均値。 キロバイト単位。 +.TP +\fB%K\fP +そのプロセスのメモリ使用量の合計 (データ+スタック+テキスト) の平均値。 キロバイト単位。 +.TP +\fB%D\fP +そのプロセスの非共有データ領域の平均サイズ。 キロバイト単位。 +.TP +\fB%p\fP +(tcsh にはない) そのプロセスの非共有スタック空間の平均サイズ。 キロバイト単位。 +.TP +\fB%X\fP +そのプロセスの共有テキスト空間の平均サイズ。 キロバイト単位。 +.TP +\fB%Z\fP +(tcsh にはない) システムのページサイズ (バイト単位)。 この値はシステム毎に決まる定数だが、システムにより異なる。 +.TP +\fB%F\fP +プロセスの動作中に発生したメジャーページフォルトの回数。 これは、ディスクからページを読み込む必要があったページフォルトに 関するものである。 +.TP +\fB%R\fP +マイナーページフォールト、つまり回復可能なページフォルトの回数。 これは、そのページは有効でないが、まだ他の仮想ページに奪われて いなかったページに対するページフォルトに関するものである。 -.TP -.B %W -.\"O Number of times the process was swapped out of main memory. +.TP +\fB%W\fP そのプロセスが主記憶からスワップアウトされた回数。 -.TP -.B %c -.\"O Number of times the process was context-switched involuntarily -.\"O (because the time slice expired). -そのプロセスが (タイムスライスの経過により) 強制的にコンテキストスイッチ -された回数。 -.TP -.B %w -.\"O Number of waits: times that the program was context-switched voluntarily, -.\"O for instance while waiting for an I/O operation to complete. -wait の回数、つまりそのプログラムが自発的にコンテキストスイッチされた回数。 -例えば、I/O 操作の完了を待っている間などが該当する。 +.TP +\fB%c\fP +そのプロセスが (タイムスライスの経過により) 強制的にコンテキストスイッチ された回数。 +.TP +\fB%w\fP +wait の回数、つまりそのプログラムが自発的にコンテキストスイッチされた回数。 例えば、I/O 操作の完了を待っている間などが該当する。 .LP -.B "I/O" -.TP -.B %I -.\"O Number of file system inputs by the process. +\fBI/O\fP +.TP +\fB%I\fP そのプロセスによるファイルシステムからの入力の回数。 -.TP -.B %O -.\"O Number of file system outputs by the process. +.TP +\fB%O\fP そのプロセスによるファイルシステムへの出力の回数。 -.TP -.B %r -.\"O Number of socket messages received by the process. +.TP +\fB%r\fP そのプロセスが受信したソケットメッセージ数。 -.TP -.B %s -.\"O Number of socket messages sent by the process. +.TP +\fB%s\fP そのプロセスが送信したソケットメッセージ数。 -.TP -.B %k -.\"O Number of signals delivered to the process. +.TP +\fB%k\fP そのプロセスに配送されたシグナル数。 -.TP -.B %C -.\"O (Not in tcsh.) Name and command line arguments of the command being timed. +.TP +\fB%C\fP (tcsh にはない) time の対象となったコマンド名とコマンドライン引き数。 -.TP -.B %x -.\"O (Not in tcsh.) Exit status of the command. +.TP +\fB%x\fP (tcsh にはない) コマンドの終了ステータス。 -.\"O .SS "GNU Options" .SS "GNU オプション" -.TP -.BI "\-f " FORMAT ", \-\-format=" FORMAT -.\"O Specify output format, possibly overriding the format specified -.\"O in the environment variable TIME. -出力フォーマットを指定する。 -環境変数 -.B TIME -で指定されたフォーマットよりも優先される。 -.TP -.B "\-p, \-\-portability" -.\"O Use the portable output format. +.TP +\fB\-f \fP\fIFORMAT\fP\fB, \-\-format=\fP\fIFORMAT\fP +出力フォーマットを指定する。 環境変数 \fBTIME\fP で指定されたフォーマットよりも優先される。 +.TP +\fB\-p, \-\-portability\fP 他の time と互換性のある出力フォーマットを使用する。 -.TP -.BI "\-o " FILE ", \-\-output=" FILE -.\"O Do not send the results to \fIstderr\fp, but overwrite the specified file. -結果を \fIstderr\fP に送らず、指定されたファイルに書き込む。 -ファイルは上書きされる。 -.TP -.B "\-a, \-\-append" -.\"O (Used together with \-o.) Do not overwrite but append. -(\-o と一緒に使用する。) -ファイルを上書きせずに、結果をファイル末尾に追加する。 -.TP -.B "\-v, \-\-verbose" -.\"O Give very verbose output about all the program knows about. +.TP +\fB\-o \fP\fIFILE\fP\fB, \-\-output=\fP\fIFILE\fP +結果を \fIstderr\fP に送らず、指定されたファイルに書き込む。 ファイルは上書きされる。 +.TP +\fB\-a, \-\-append\fP +(\-o と一緒に使用する。) ファイルを上書きせずに、結果をファイル末尾に追加する。 +.TP +\fB\-v, \-\-verbose\fP 非常に詳しい出力で、入手できる全ての情報を出力する。 -.\"O .SS "GNU Standard Options" .SS "GNU 標準オプション" -.TP -.B "\-\-help" -.\"O Print a usage message on standard output and exit successfully. +.TP +\fB\-\-help\fP 使用方法に関するメッセージを標準出力に表示し、正常終了する。 -.TP -.B "\-V, \-\-version" -.\"O Print version information on standard output, then exit successfully. +.TP +\fB\-V, \-\-version\fP バージョン情報を標準出力に表示し、正常終了する。 -.TP -.B "\-\-" -.\"O Terminate option list. +.TP +\fB\-\-\fP オプションリストの末尾を示す。 -.\"O .SH BUGS .SH バグ -.\"O Not all resources are measured by all versions of UNIX, -.\"O so some of the values might be reported as zero. -.\"O The present selection was mostly inspired by the data -.\"O provided by 4.2 or 4.3BSD. -全てのリソースが UNIX の全てのバージョンで計測されているわけではないので、 -いくつかの値が 0 と報告される可能性がある。 -現在の出力項目のほとんどは 4.2BSD や 4.3BSD で取得可能なデータに -基づいて選択されている。 +全てのリソースが UNIX の全てのバージョンで計測されているわけではないので、 いくつかの値が 0 と報告される可能性がある。 +現在の出力項目のほとんどは 4.2BSD や 4.3BSD で取得可能なデータに 基づいて選択されている。 .LP -.\"O GNU time version 1.7 is not yet localized. -.\"O Thus, it does not implement the POSIX requirements. -GNU time バージョン 1.7 はまだローカライズされていない。 -そのため、POSIX の要件を実装していないことになる。 +GNU time バージョン 1.7 はまだローカライズされていない。 そのため、POSIX の要件を実装していないことになる。 .LP -.\"O The environment variable -.\"O .B TIME -.\"O was badly chosen. -.\"O It is not unusual for systems like -.\"O .BR autoconf (1) -.\"O or -.\"O .BR make (1) -.\"O to use environment variables with the name of a utility to override -.\"O the utility to be used. -.\"O Uses like MORE or TIME for options to programs -.\"O (instead of program pathnames) tend to lead to difficulties. -.B TIME -という環境変数は名前の選択がまずい。 -.BR autoconf (1) -や -.BR make (1) -のようなシステムでは、使用するコマンドを上書きするのにそのコマンドの -名前の環境変数を使うのが珍しくない。 -MORE や TIME のような名前を (プログラムのパス名の指定ではなく) -プログラムへのオプションを指定するのに使うと、 -面倒なことを引き起こす可能性が高い。 +\fBTIME\fP という環境変数は名前の選択がまずい。 \fBautoconf\fP(1) や \fBmake\fP(1) +のようなシステムでは、使用するコマンドを上書きするのにそのコマンドの 名前の環境変数を使うのが珍しくない。 MORE や TIME のような名前を +(プログラムのパス名の指定ではなく) プログラムへのオプションを指定するのに使うと、 面倒なことを引き起こす可能性が高い。 .LP -.\"O It seems unfortunate that \-o overwrites instead of appends. -.\"O (That is, the \-a option should be the default.) -\-o が追記ではなく上書きになっているのは残念なことだ -(つまり \-a オプションがデフォルトになっているべきだろうということだ)。 +\-o が追記ではなく上書きになっているのは残念なことだ (つまり \-a オプションがデフォルトになっているべきだろうということだ)。 .LP -.\"O Mail suggestions and bug reports for GNU -.\"O .B time -.\"O to -.\"O .br -.\"O .I bug\-utils@prep.ai.mit.edu -.\"O .br -.\"O Please include the version of -.\"O .BR time , -.\"O which you can get by running -.\"O .br -.\"O .I time \-\-version -.\"O .br -.\"O and the operating system -.\"O and C compiler you used. -GNU -.B time -に対する提案やバグレポートは +GNU \fBtime\fP に対する提案やバグレポートは .br -.I bug\-utils@prep.ai.mit.edu +\fIbug\-utils@prep.ai.mit.edu\fP .br -までメールを送ってほしい。 -その場合には -.B time -や OS、使用している C コンパイラの -バージョンを記載してほしい。 -.B time -のバージョンは以下のコマンドで取得できる。 +までメールを送ってほしい。 その場合には \fBtime\fP や OS、使用している C コンパイラの バージョンを記載してほしい。 \fBtime\fP +のバージョンは .br -.I time \-\-version +\fItime \-\-version\fP .br .\" .SH AUTHORS .\" .TP @@ -482,8 +209,6 @@ GNU .\" Helped with portability .\" .IP "Francois Pinard" .\" Helped with portability -.\"O .SH "SEE ALSO" +で取得できる。 .SH 関連項目 -.BR tcsh (1), -.BR times (2), -.BR wait3 (2) +\fBtcsh\fP(1), \fBtimes\fP(2), \fBwait3\fP(2) diff --git a/draft/man2/_exit.2 b/draft/man2/_exit.2 index 92074988..623a6004 100644 --- a/draft/man2/_exit.2 +++ b/draft/man2/_exit.2 @@ -26,191 +26,61 @@ .\" Modified Wed Jul 21 23:02:38 1993 by Rik Faith .\" Modified 2001-11-17, aeb .\" -.\" Japanese Version Copyright (c) 1997 KUNIMOTO Yasuhiro, all rights reserved. -.\" Translated Jun 27, 1997 by KUNIMOTO Yasuhiro (hiro@kthree.co.jp) -.\" Modified Jun 28, 1997 by Yoshiki Sugiura (yox@in.aix.or.jp) -.\" Modified Jul 6, 1997 by Yoshiki Sugiura (yox@in.aix.or.jp) -.\" Updated & Modified Sun Dec 9 20:02:10 JST 2001 -.\" by Yuichi SATO -.\" Updated Sat Sep 3 04:26:00 JST 2005 -.\" by Akihiro MOTOKI +.\"******************************************************************* .\" -.\"WORD descriptors ディスクリプタ +.\" This file was generated with po4a. Translate the source file. .\" -.TH _EXIT 2 2010-09-20 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH _EXIT 2 2010\-09\-20 Linux "Linux Programmer's Manual" .SH 名前 -.\"O _exit, _Exit \- terminate the calling process _exit, _Exit \- 呼び出し元のプロセスを終了させる -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "void _exit(int " status ); +\fBvoid _exit(int \fP\fIstatus\fP\fB);\fP .sp -.B #include +\fB#include \fP .sp -.BI "void _Exit(int " status ); +\fBvoid _Exit(int \fP\fIstatus\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR _Exit (): +\fB_Exit\fP(): .RS 4 -_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -.\"O or -または -.I cc\ -std=c99 +または \fIcc\ \-std=c99\fP +.RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The function -.\"O .BR _exit () -.\"O terminates the calling process "immediately". -.\"O Any open file descriptors -.\"O belonging to the process are closed; any children of the process are -.\"O inherited by process 1, -.\"O .IR init , -.\"O and the process's parent is sent a -.\"O .B SIGCHLD -.\"O signal. -.BR _exit () -は、それを呼んだプロセスを「直ちに」終了させる。 -その際、このプロセスが所有しているディスクリプタ (descriptor) で、 -オープンされているものは全てクローズされる。 -また、このプロセスが所有する子プロセスは全て、プロセス番号 1、 -つまり -.I init -プロセスによって継承され、このプロセスの親プロセスに対して -.B SIGCHLD -シグナルが送出される。 +\fB_exit\fP() は、それを呼んだプロセスを「直ちに」終了させる。 その際、このプロセスが所有しているディスクリプタ (descriptor) +で、 オープンされているものは全てクローズされる。 また、このプロセスが所有する子プロセスは全て、プロセス番号 1、 つまり \fIinit\fP +プロセスによって継承され、このプロセスの親プロセスに対して \fBSIGCHLD\fP シグナルが送出される。 .LP -.\"O The value -.\"O .I status -.\"O is returned to the parent process as the process's exit status, and -.\"O can be collected using one of the -.\"O .BR wait 2() -.\"O family of calls. -.I status -の値は、このプロセスの終了状態としてその親プロセスに対して返され、 -.BR wait (2) +\fIstatus\fP の値は、このプロセスの終了状態としてその親プロセスに対して返され、 \fBwait\fP(2) 系関数を利用することによって取得することができる。 .LP -.\"O The function -.\"O .BR _Exit () -.\"O is equivalent to -.\"O .BR _exit (). -関数 -.BR _Exit () -は -.BR _exit () -と等価である。 -.\"O .SH "RETURN VALUE" +関数 \fB_Exit\fP() は \fB_exit\fP() と等価である。 .SH 返り値 -.\"O These functions do not return. これらの関数は値を返さない。 -.\"O .SH "CONFORMING TO" .SH 準拠 -SVr4, POSIX.1-2001, 4.3BSD. -.\"O The function -.\"O .BR _Exit () -.\"O was introduced by C99. -関数 -.BR _Exit () -は C99 で導入された。 -.\"O .SH NOTES +SVr4, POSIX.1\-2001, 4.3BSD. 関数 \fB_Exit\fP() は C99 で導入された。 .SH 注意 -.\"O For a discussion on the effects of an exit, the transmission of -.\"O exit status, zombie processes, signals sent, etc., see -.\"O .BR exit (3). -exit の役割・終了状態の受渡し・ -ゾンビプロセス・シグナル送出などについての議論は、 -.BR exit (3) -を参照すること。 +exit の役割・終了状態の受渡し・ ゾンビプロセス・シグナル送出などについての議論は、 \fBexit\fP(3) を参照すること。 .LP -.\"O The function -.\"O .BR _exit () -.\"O is like -.\"O .BR exit (3), -.\"O but does not call any -.\"O functions registered with -.\"O .BR atexit (3) -.\"O or -.\"O .BR on_exit (3). -.\"O Whether it flushes -.\"O standard I/O buffers and removes temporary files created with -.\"O .BR tmpfile (3) -.\"O is implementation-dependent. -関数 -.BR _exit () -は -.BR exit (3) -に似ているが、ANSI C の -.BR atexit (3) -や -.BR on_exit (3) -によって登録されたいかなる関数も呼び出さない。 -標準 I/O バッファのフラッシュや、 -.BR tmpfile (3) -で作成されたテンポラリファイルの削除を行うかどうかは、実装に依存する。 -.\"O On the other hand, -.\"O .BR _exit () -.\"O does close open file descriptors, and this may cause an unknown delay, -.\"O waiting for pending output to finish. -.\"O If the delay is undesired, -.\"O it may be useful to call functions like -.\"O .BR tcflush (3) -.\"O before calling -.\"O .BR _exit (). -.\"O Whether any pending I/O is canceled, and which pending I/O may be -.\"O canceled upon -.\"O .BR _exit (), -.\"O is implementation-dependent. -一方で、 -.BR _exit () -はオープンされているファイルディスクリプタをクローズしないため、 -未決定になっている出力がフラッシュされるのを待つのに不確定な遅れが発生する。 -この遅れを発生させたくなければ、 -.BR _exit () -の前に -.BR tcflush (3) -のような関数を呼び出せばよい。 -.BR _exit () -が呼び出されたときに、 -未決定になっている全ての I/O がキャンセルされるのか、 -またどの I/O がキャンセルされるのかは実装に依存する。 +関数 \fB_exit\fP() は \fBexit\fP(3) に似ているが、ANSI C の \fBatexit\fP(3) や \fBon_exit\fP(3) +によって登録されたいかなる関数も呼び出さない。 標準 I/O バッファのフラッシュや、 \fBtmpfile\fP(3) +で作成されたテンポラリファイルの削除を行うかどうかは、実装に依存する。 一方で、 \fB_exit\fP() +はオープンされているファイルディスクリプタをクローズしないため、 未決定になっている出力がフラッシュされるのを待つのに不確定な遅れが発生する。 +この遅れを発生させたくなければ、 \fB_exit\fP() の前に \fBtcflush\fP(3) のような関数を呼び出せばよい。 \fB_exit\fP() +が呼び出されたときに、 未決定になっている全ての I/O がキャンセルされるのか、 またどの I/O がキャンセルされるのかは実装に依存する。 -.\"O In glibc up to version 2.3, the -.\"O .BR _exit () -.\"O wrapper function invoked the kernel system call of the same name. -.\"O Since glibc 2.3, the wrapper function invokes -.\"O .BR exit_group (2), -.\"O in order to terminate all of the threads in a process. -バージョン 2.3 より前の glibc では、 -.BR _exit () -のラッパー関数は同じ名前のカーネル・システムコールを起動していた。 -glibc 2.3 以降では、プロセス内の全てのスレッドを終了するために、 -ラッパー関数は -.BR exit_group (2) -を起動する。 -.\"O .SH "SEE ALSO" +バージョン 2.3 より前の glibc では、 \fB_exit\fP() のラッパー関数は同じ名前のカーネル・システムコールを起動していた。 glibc +2.3 以降では、プロセス内の全てのスレッドを終了するために、 ラッパー関数は \fBexit_group\fP(2) を起動する。 .SH 関連項目 -.BR execve (2), -.BR exit_group (2), -.BR fork (2), -.BR kill (2), -.BR wait (2), -.BR wait4 (2), -.BR waitpid (2), -.BR atexit (3), -.BR exit (3), -.BR on_exit (3), -.BR termios (3) +\fBexecve\fP(2), \fBexit_group\fP(2), \fBfork\fP(2), \fBkill\fP(2), \fBwait\fP(2), +\fBwait4\fP(2), \fBwaitpid\fP(2), \fBatexit\fP(3), \fBexit\fP(3), \fBon_exit\fP(3), +\fBtermios\fP(3) diff --git a/draft/man2/_syscall.2 b/draft/man2/_syscall.2 index 2efca8b3..53a1b927 100644 --- a/draft/man2/_syscall.2 +++ b/draft/man2/_syscall.2 @@ -35,126 +35,60 @@ .\" 2007-10-23 mtk: created as a new page, by taking the content .\" specific to the _syscall() macros from intro(2). .\" -.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2008-02-11, Akihiro MOTOKI -.\" -.TH _SYSCALL 2 2007-12-19 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH _SYSCALL 2 2007\-12\-19 Linux "Linux Programmer's Manual" .SH 名前 -.\"O _syscall \- invoking a system call without library support (OBSOLETE) _syscall \- ライブラリのサポートなしでシステムコールを起動する (昔の方法) -.\"O .SH "SYNOPSIS" .SH 書式 -.B #include +\fB#include \fP A _syscall macro desired system call -.\"O .SH DESCRIPTION .SH 説明 -.\"O The important thing to know about a system call is its prototype. -.\"O You need to know how many arguments, their types, -.\"O and the function return type. -.\"O There are seven macros that make the actual call into the system easier. -.\"O They have the form: -システムコールに関してそのプロトタイプを知ることが重要である。 -引き数の個数、それらの型、返り値の型を知る必要がある。 -実際の使用にあたっては、システムコールをシステムに呼び出しやすくするために、 -7 個のマクロが用意されている。これらのマクロは以下の形である。 +システムコールに関してそのプロトタイプを知ることが重要である。 引き数の個数、それらの型、返り値の型を知る必要がある。 +実際の使用にあたっては、システムコールをシステムに呼び出しやすくするために、 7 個のマクロが用意されている。これらのマクロは以下の形である。 .sp .RS -.RI _syscall X ( type , name , type1 , arg1 , type2 , arg2 ,...) +_syscall\fIX\fP(\fItype\fP,\fIname\fP,\fItype1\fP,\fIarg1\fP,\fItype2\fP,\fIarg2\fP,...) .RE .PP -.\"O where ここで .IP -.\"O \fIX\fP is 0\(en6, which are the number of arguments taken by the -.\"O system call \fIX\fP は 0〜6 で、システムコールが取る引き数の個数である。 .IP -.\"O \fItype\fP is the return type of the system call \fItype\fP はシステムコールの返り値の型である。 .IP -.\"O \fIname\fP is the name of the system call \fIname\fP はシステムコールの名前である。 .IP -.\"O \fItypeN\fP is the Nth argument's type \fItypeN\fP は N 番目の引き数の型である。 .IP -.\"O \fIargN\fP is the name of the Nth argument \fIargN\fP は N 番目の引き数の名前である。 .PP -.\"O These macros create a function called \fIname\fP with the arguments you -.\"O specify. -.\"O Once you include the _syscall() in your source file, -.\"O you call the system call by \fIname\fP. -これらのマクロは、指定した引き数を持つ \fIname\fP という名前の関数を生成する。 -一度ソースファイルの中で _syscall() をインクルードしておくと、 -そのシステムコールを \fIname\fP という名前で呼ぶことができる。 -.\"O .SH FILES +これらのマクロは、指定した引き数を持つ \fIname\fP という名前の関数を生成する。 一度ソースファイルの中で _syscall() +をインクルードしておくと、 そのシステムコールを \fIname\fP という名前で呼ぶことができる。 .SH ファイル -.I /usr/include/linux/unistd.h -.\"O .SH "CONFORMING TO" +\fI/usr/include/linux/unistd.h\fP .SH 準拠 -.\"O The use of these macros is Linux-specific, and deprecated. これらのマクロは Linux 固有であり、その使用は非推奨である。 -.\"O .SH NOTES .SH 注意 -.\"O Starting around kernel 2.6.18, the _syscall macros were removed -.\"O from header files supplied to user space. -.\"O Use -.\"O .BR syscall (2) -.\"O instead. -.\"O (Some architectures, notably ia64, never provided the _syscall macros; -.\"O on those architectures, -.\"O .BR syscall (2) -.\"O was always required.) -カーネル 2.6.18 あたりから、_syscall マクロ群はユーザ空間に対して提供される -ヘッダファイルから削除された。代わりに -.BR syscall (2) -を使用すること。 -(いくつかのアーキテクチャ、特に ia64、では、これまで _syscall マクロが -提供されたことはない。このようなアーキテクチャでは、常に -.BR syscall (2) -が必要であった。) +カーネル 2.6.18 あたりから、_syscall マクロ群はユーザ空間に対して提供される ヘッダファイルから削除された。代わりに +\fBsyscall\fP(2) を使用すること。 (いくつかのアーキテクチャ、特に ia64、では、これまで _syscall マクロが +提供されたことはない。このようなアーキテクチャでは、常に \fBsyscall\fP(2) が必要であった。) -.\"O The _syscall() macros \fIdo not\fP produce a prototype. -.\"O You may have to -.\"O create one, especially for C++ users. -_syscall() マクロはプロトタイプを「生成しない」。 -ユーザはプロトタイプを自分で書かなければならないかもしれない。 -とりわけ C++ ユーザの場合はそうであろう。 +_syscall() マクロはプロトタイプを「生成しない」。 ユーザはプロトタイプを自分で書かなければならないかもしれない。 とりわけ C++ +ユーザの場合はそうであろう。 -.\"O System calls are not required to return only positive or negative error -.\"O codes. -.\"O You need to read the source to be sure how it will return errors. -.\"O Usually, it is the negative of a standard error code, -.\"O for example, \-\fBEPERM\fP. -.\"O The _syscall() macros will return the result \fIr\fP of the system call -.\"O when \fIr\fP is nonnegative, but will return \-1 and set the variable -.\"O .I errno -.\"O to \-\fIr\fP when \fIr\fP is negative. -.\"O For the error codes, see -.\"O .BR errno (3). システムコールは、正のエラーコードのみ、または負のエラーコードのみを返すように 定められている訳ではない。そのシステムコールがどのようなエラーコードを返すかを -確認するには、そのソースコードを読む必要がある。たいていの場合は、標準のエラー -コードを負にしたものである (例えば \-\fBEPERM\fP)。 -_syscall() マクロは、そのシステムコールの返り値 \fIr\fP が負でない場合、その値 -をそのまま返す。一方、\fIr\fP が負の場合には、変数 -.I errno -に \-\fIr\fP を設定し、\-1 を返す。 -エラーコードについては -.BR errno (3) -を参照。 +確認するには、そのソースコードを読む必要がある。たいていの場合は、標準のエラー コードを負にしたものである (例えば \-\fBEPERM\fP)。 +_syscall() マクロは、そのシステムコールの返り値 \fIr\fP が負でない場合、その値 をそのまま返す。一方、\fIr\fP が負の場合には、変数 +\fIerrno\fP に \-\fIr\fP を設定し、\-1 を返す。 エラーコードについては \fBerrno\fP(3) を参照。 -.\"O When defining a system call, the argument types \fImust\fP be -.\"O passed by-value or by-pointer (for aggregates like structs). -システムコールを定義する際、引き数の型は値渡し (by-value) か、 -(構造体のように集合的なデータの場合は) ポインタ渡し (by-pointer) -でなければならない。 .\" The preferred way to invoke system calls that glibc does not know .\" about yet is via .\" .BR syscall (2). @@ -166,7 +100,8 @@ _syscall() マクロは、そのシステムコールの返り値 \fIr\fP が負 .\" header file contains the required SYS_foo definition. .\" Otherwise, the use of a _syscall macro is required. .\" -.\"O .SH EXAMPLE +システムコールを定義する際、引き数の型は値渡し (by\-value) か、 (構造体のように集合的なデータの場合は) ポインタ渡し +(by\-pointer) でなければならない。 .SH 例 .nf #include @@ -177,8 +112,6 @@ _syscall() マクロは、そのシステムコールの返り値 \fIr\fP が負 _syscall1(int, sysinfo, struct sysinfo *, info); -.\"O /* Note: if you copy directly from the nroff source, remember to -.\"O REMOVE the extra backslashes in the printf statement. */ /* Note: nroff のソースファイルから直接コピーする際には、 printf 文内の余分なバックスラッシュを忘れずに削除するように。 */ @@ -189,11 +122,11 @@ main(void) int error; error = sysinfo(&s_info); - printf("code error = %d\\n", error); - printf("Uptime = %lds\\nLoad: 1 min %lu / 5 min %lu / 15 min %lu\\n" - "RAM: total %lu / free %lu / shared %lu\\n" - "Memory in buffers = %lu\\nSwap: total %lu / free %lu\\n" - "Number of processes = %d\\n", + printf("code error = %d\en", error); + printf("Uptime = %lds\enLoad: 1 min %lu / 5 min %lu / 15 min %lu\en" + "RAM: total %lu / free %lu / shared %lu\en" + "Memory in buffers = %lu\enSwap: total %lu / free %lu\en" + "Number of processes = %d\en", s_info.uptime, s_info.loads[0], s_info.loads[1], s_info.loads[2], s_info.totalram, s_info.freeram, @@ -213,8 +146,5 @@ Memory in buffers = 5066752 Swap: total 27881472 / free 24698880 Number of processes = 40 .fi -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR intro (2), -.BR syscall (2), -.BR errno (3) +\fBintro\fP(2), \fBsyscall\fP(2), \fBerrno\fP(3) diff --git a/draft/man2/accept.2 b/draft/man2/accept.2 index d1e1001d..050d8fac 100644 --- a/draft/man2/accept.2 +++ b/draft/man2/accept.2 @@ -36,659 +36,181 @@ .\" Modified 2004-06-17 by Michael Kerrisk .\" 2008-12-04, mtk, Add documentation of accept4() .\" -.\" Japanese Version Copyright (c) 1998-2000 Shinya HANATAKA, -.\" Takeshi Hakamada and NAKANO Takeo -.\" all rights reserved. -.\" Translated 1998-04-06, Shinya HANATAKA -.\" Takeshi Hakamada -.\" Updated & Modified 2000-10-12, NAKANO Takeo -.\" Updated & Modified 2005-02-23, Akihiro MOTOKI -.\" Updated & Modified 2006-04-14, Akihiro MOTOKI, LDP v2.29 -.\" Updated & Modified 2008-12-24, Akihiro MOTOKI, LDP v3.15 -.\" Updated 2008-04-13, Akihiro MOTOKI, LDP v3.20 +.\"******************************************************************* .\" -.\"WORD: pending 保留中の -.\"WORD: queue キュー -.\"WORD: file descriptor ファイル・ディスクリプタ -.\"WORD: nonblocking 非停止 -.\"WORD: async 非同期 -.\"WORD: communication layer 通信層 -.\"WORD: value-result argument 入出力両用の引き数 -.\"WORD: confirmation 接続確認 -.\"WORD: dequeue キューから取り出す -.\"WORD: rejection 接続拒否 +.\" This file was generated with po4a. Translate the source file. .\" -.TH ACCEPT 2 2010-09-10 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O accept \- accept a connection on a socket +.\"******************************************************************* +.TH ACCEPT 2 2010\-09\-10 Linux "Linux Programmer's Manual" .SH 名前 accept \- ソケットへの接続を受ける -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .BR "#include " " /* See NOTES */" -.BR "#include " " /* 「注意」参照 */" -.B #include +\fB#include \fP /* 「注意」参照 */ +\fB#include \fP -.BI "int accept(int " sockfd ", struct sockaddr *" addr ", socklen_t *" addrlen ); +\fBint accept(int \fP\fIsockfd\fP\fB, struct sockaddr *\fP\fIaddr\fP\fB, socklen_t *\fP\fIaddrlen\fP\fB);\fP -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" -.B #include +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP -.BI "int accept4(int " sockfd ", struct sockaddr *" addr , -.BI " socklen_t *" addrlen ", int " flags ); +\fBint accept4(int \fP\fIsockfd\fP\fB, struct sockaddr *\fP\fIaddr\fP\fB,\fP +\fB socklen_t *\fP\fIaddrlen\fP\fB, int \fP\fIflags\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR accept () -.\"O system call is used with connection-based socket types -.\"O .RB ( SOCK_STREAM , -.\"O .BR SOCK_SEQPACKET ). -.BR accept () -システムコールは、接続指向のソケット型 -.RB ( SOCK_STREAM ", " SOCK_SEQPACKET ) -で用いられる。 -.\"O It extracts the first connection request on the queue of pending -.\"O connections for the listening socket, -.\"O .IR sockfd , -.\"O creates a new connected socket, and returns a new file -.\"O descriptor referring to that socket. -この関数は、接続待ちソケット -.I socket -宛ての保留状態の接続要求が入っているキューから -先頭の接続要求を取り出し、接続済みソケットを新規に生成し、 -そのソケットを参照する新しいファイル・ディスクリプタを返す。 -.\"O The newly created socket is not in the listening state. -新規に生成されたソケットは、接続待ち (listen) 状態ではない。 -.\"O The original socket -.\"O .I sockfd -.\"O is unaffected by this call. -もともとのソケット -.I sockfd -はこの呼び出しによって影響を受けない。 +\fBaccept\fP() システムコールは、接続指向のソケット型 (\fBSOCK_STREAM\fP, \fBSOCK_SEQPACKET\fP) +で用いられる。 この関数は、接続待ちソケット \fIsocket\fP 宛ての保留状態の接続要求が入っているキューから +先頭の接続要求を取り出し、接続済みソケットを新規に生成し、 そのソケットを参照する新しいファイル・ディスクリプタを返す。 +新規に生成されたソケットは、接続待ち (listen) 状態ではない。 もともとのソケット \fIsockfd\fP はこの呼び出しによって影響を受けない。 .PP -.\"O The argument -.\"O .I sockfd -.\"O is a socket that has been created with -.\"O .BR socket (2), -.\"O bound to a local address with -.\"O .BR bind (2), -.\"O and is listening for connections after a -.\"O .BR listen (2). -引き数 -.I sockfd -は、 -.BR socket (2) -によって生成され、 -.BR bind (2) -によってローカルアドレスにバインドされ、 -.BR listen (2) -を経て接続を待っているソケットである。 +引き数 \fIsockfd\fP は、 \fBsocket\fP(2) によって生成され、 \fBbind\fP(2) によってローカルアドレスにバインドされ、 +\fBlisten\fP(2) を経て接続を待っているソケットである。 -.\"O The argument -.\"O .I addr -.\"O is a pointer to a -.\"O .I sockaddr -.\"O structure. -.\"O This structure is filled in with the address of the peer socket, -.\"O as known to the communications layer. -.\"O The exact format of the address returned -.\"O .I addr -.\"O is determined by the socket's address family (see -.\"O .BR socket (2) -.\"O and the respective protocol man pages). -.I addr -引き数は -.I sockaddr -構造体へのポインタである。 -この構造体には接続相手のソケットのアドレスが入っている。 -.I addr -引き数で返されるアドレスの正確なフォーマットは、 -ソケットのアドレス種別によって変わる -.RB ( socket (2) -およびそれぞれのプロトコルの man ページを参照)。 -.\"O When -.\"O .I addr -.\"O is NULL, nothing is filled in; in this case, -.\"O .I addrlen -.\"O is not used, and should also be NULL. -.I addr -が NULL の場合、 -.I addr -には何も入らない。この場合、 -.I addrlen +\fIaddr\fP 引き数は \fIsockaddr\fP 構造体へのポインタである。 この構造体には接続相手のソケットのアドレスが入っている。 \fIaddr\fP +引き数で返されるアドレスの正確なフォーマットは、 ソケットのアドレス種別によって変わる (\fBsocket\fP(2) およびそれぞれのプロトコルの +man ページを参照)。 \fIaddr\fP が NULL の場合、 \fIaddr\fP には何も入らない。この場合、 \fIaddrlen\fP は使用されず、この引き数は NULL にしておくべきである。 -.\"O The -.\"O .I addrlen -.\"O argument is a value-result argument: -.\"O the caller must initialize it to contain the -.\"O size (in bytes) of the structure pointed to by -.\"O .IR addr ; -.\"O on return it will contain the actual size of the peer address. -.I addrlen -引き数は入出力両用の引き数である。呼び出し時には、呼び出し元が -.I addr -が指す構造体のサイズ (バイト単位) で初期化しておかなければならない。 -返ってくる時には、接続相手のアドレスの実際の大きさが格納される。 +\fIaddrlen\fP 引き数は入出力両用の引き数である。呼び出し時には、呼び出し元が \fIaddr\fP が指す構造体のサイズ (バイト単位) +で初期化しておかなければならない。 返ってくる時には、接続相手のアドレスの実際の大きさが格納される。 -.\"O The returned address is truncated if the buffer provided is too small; -.\"O in this case, -.\"O .I addrlen -.\"O will return a value greater than was supplied to the call. -渡されたバッファが小さ過ぎる場合には、返されるアドレスの末尾は -切り詰められる。この場合には、 -.I addrlen -では、呼び出し時に渡された値よりも大きな値が返される。 +渡されたバッファが小さ過ぎた場合は、返されるアドレスの末尾が切り詰められる。 +この場合には、 \fIaddrlen\fP には、呼び出し時に指定された値よりも大きな値が格納される。 .PP -.\"O If no pending -.\"O connections are present on the queue, and the socket is not marked as -.\"O nonblocking, -.\"O .BR accept () -.\"O blocks the caller until a connection is present. -.\"O If the socket is marked -.\"O nonblocking and no pending connections are present on the queue, -.\"O .BR accept () -.\"O fails with the error -.\"O .BR EAGAIN -.\"O or -.\"O .BR EWOULDBLOCK . -キューに保留となっている接続要求がなく、 -かつソケットが非停止になっていないときは、 -.BR accept () -は接続が発生するまで呼び出し元を停止 (block) する。 -ソケットが非停止になっていて、 -待ち状態の接続要求がキューに無いときは、 -.BR accept () -はエラー -.B EAGAIN -か -.B EWOULDBLOCK -で失敗する。 +キューに保留となっている接続要求がなく、 かつソケットが非停止になっていないときは、 \fBaccept\fP() は接続が発生するまで呼び出し元を停止 +(block) する。 ソケットが非停止になっていて、 待ち状態の接続要求がキューに無いときは、 \fBaccept\fP() はエラー \fBEAGAIN\fP +か \fBEWOULDBLOCK\fP で失敗する。 .PP -.\"O In order to be notified of incoming connections on a socket, you can use -.\"O .BR select (2) -.\"O or -.\"O .BR poll (2). -.\"O A readable event will be delivered when a new connection is attempted and you -.\"O may then call -.\"O .BR accept () -.\"O to get a socket for that connection. -.\"O Alternatively, you can set the socket to deliver -.\"O .B SIGIO -.\"O when activity occurs on a socket; see -.\"O .BR socket (7) -.\"O for details. -ソケットへの接続到着を知るには、 -.BR select (2) -または -.BR poll (2) -を用いればよい。 -新しい接続要求が来るとソケットは読み込み可能になるので、 -そうしたら -.BR accept () -を呼んでその接続に対するソケットを取得すればよい。 -あるいはソケットに設定を行い、何らかのアクションがあったときに -.B SIGIO -を配送 (deliver) させるようにすることもできる。詳細は -.BR socket (7) -を参照のこと。 +ソケットへの接続到着を知るには、 \fBselect\fP(2) または \fBpoll\fP(2) を用いればよい。 +新しい接続要求が来るとソケットは読み込み可能になるので、 そうしたら \fBaccept\fP() を呼んでその接続に対するソケットを取得すればよい。 +あるいはソケットに設定を行い、何らかのアクションがあったときに \fBSIGIO\fP を配送 (deliver) させるようにすることもできる。詳細は +\fBsocket\fP(7) を参照のこと。 .PP -.\"O For certain protocols which require an explicit confirmation, -.\"O such as -.\"O DECNet, -.\"O .BR accept () -.\"O can be thought of as merely dequeuing the next connection request and not -.\"O implying confirmation. -.\"O Confirmation can be implied by -.\"O a normal read or write on the new file descriptor, and rejection can be -.\"O implied by closing the new socket. -.\"O Currently only -.\"O DECNet -.\"O has these semantics on Linux. -明示的な接続確認 (confirmation) を必要とするようなプロトコル -(DECNet など) では、 -.BR accept () -は単に次の接続要求をキューから取り出すだけであり、 -接続確認は行わないことに注意せよ。接続確認は、 -新しいファイル・ディスクリプタに対する -通常の読み取り/書き込みによってなされ、接続拒否 (rejection) -は新しいソケットをクローズすることによってなされる。 -現在のところ、 +明示的な接続確認 (confirmation) を必要とするようなプロトコル (DECNet など) では、 \fBaccept\fP() +は単に次の接続要求をキューから取り出すだけであり、 接続確認は行わないことに注意せよ。接続確認は、 新しいファイル・ディスクリプタに対する +通常の読み取り/書き込みによってなされ、接続拒否 (rejection) は新しいソケットをクローズすることによってなされる。 現在のところ、 Linux 上でこれらのセマンティクスを持つのは DECNet だけである。 -.\"O If -.\"O .IR flags -.\"O is 0, then -.\"O .BR accept4 () -.\"O is the same as -.\"O .BR accept (). -.\"O The following values can be bitwise ORed in -.\"O .IR flags -.\"O to obtain different behavior: -.I flags -が 0 の場合、 -.BR accept4 () -は -.BR accept () -と同じである。 -.I flags -に以下の値をビット毎の論理和 (OR) で指定することで、 -異なる動作をさせることができる。 -.TP 16 -.B SOCK_NONBLOCK -.\"O Set the -.\"O .BR O_NONBLOCK -.\"O file status flag on the new open file description. -.\"O Using this flag saves extra calls to -.\"O .BR fcntl (2) -.\"O to achieve the same result. -新しく生成されるオープンファイル記述 (open file description) の -.B O_NONBLOCK -ファイルステータスフラグをセットする。 -このフラグを使うことで、 -.B O_NONBLOCK -をセットするために -.BR fcntl (2) +\fIflags\fP が 0 の場合、 \fBaccept4\fP() は \fBaccept\fP() と同じである。 \fIflags\fP +に以下の値をビット毎の論理和 (OR) で指定することで、 異なる動作をさせることができる。 +.TP 16 +\fBSOCK_NONBLOCK\fP +新しく生成されるオープンファイル記述 (open file description) の \fBO_NONBLOCK\fP +ファイルステータスフラグをセットする。 このフラグを使うことで、 \fBO_NONBLOCK\fP をセットするために \fBfcntl\fP(2) を追加で呼び出す必要がなくなる。 -.TP -.B SOCK_CLOEXEC -.\"O Set the close-on-exec -.\"O .RB ( FD_CLOEXEC ) -.\"O flag on the new file descriptor. -.\"O See the description of the -.\"O .B O_CLOEXEC -.\"O flag in -.\"O .BR open (2) -.\"O for reasons why this may be useful. -新しいファイルディスクリプタに対して -close-on-exec -.RB ( FD_CLOEXEC ) -フラグをセットする。 -このフラグが役に立つ理由については、 -.BR open (2) -の -.B O_CLOEXEC -フラグの説明を参照のこと。 -.\"O .SH "RETURN VALUE" +.TP +\fBSOCK_CLOEXEC\fP +新しいファイルディスクリプタに対して close\-on\-exec (\fBFD_CLOEXEC\fP) フラグをセットする。 +このフラグが役に立つ理由については、 \fBopen\fP(2) の \fBO_CLOEXEC\fP フラグの説明を参照のこと。 .SH 返り値 -.\"O On success, -.\"O these system calls return a nonnegative integer that is a descriptor -.\"O for the accepted socket. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合、これらのシステムコールは -受け付けたソケットのディスクリプタである非負の整数値を返す。 -エラーが発生した場合は \-1 を返し、 -.I errno -を適切に設定する。 -.\"O .SS "Error Handling" +成功した場合、これらのシステムコールは 受け付けたソケットのディスクリプタである非負の整数値を返す。 エラーが発生した場合は \-1 を返し、 +\fIerrno\fP を適切に設定する。 .SS エラー処理 -.\"O Linux -.\"O .BR accept () -.\"O (and -.\"O .BR accept4 ()) -.\"O passes already-pending network errors on the new socket -.\"O as an error code from -.\"O .BR accept (). -Linux の -.BR accept () -(と -.BR accept4 ()) -は、新しいソケットにおける、発生済みのネットワークエラーを -.BR accept () -からのエラーコードとして渡す。 -.\"O This behavior differs from other BSD socket -.\"O implementations. -.\"O For reliable operation the application should detect -.\"O the network errors defined for the protocol after -.\"O .BR accept () -.\"O and treat -.\"O them like -.\"O .B EAGAIN -.\"O by retrying. -.\"O In case of TCP/IP these are -この振舞いは BSD ソケットの実装とは異なる。 -信頼性の高い動作を行うためには、 -アプリケーションはプロトコルで定義されているネットワークエラーの検知を -.BR accept () -のあとに行い、それらのエラーを -.B EAGAIN -と同じように扱い、再試行 (retry) を行うべきである。 -.\"O .BR ENETDOWN , -.\"O .BR EPROTO , -.\"O .BR ENOPROTOOPT , -.\"O .BR EHOSTDOWN , -.\"O .BR ENONET , -.\"O .BR EHOSTUNREACH , -.\"O .BR EOPNOTSUPP , -.\"O and -.\"O .BR ENETUNREACH . -TCP/IP では、以下のエラーが該当する: -.BR ENETDOWN , -.BR EPROTO , -.BR ENOPROTOOPT , -.BR EHOSTDOWN , -.BR ENONET , -.BR EHOSTUNREACH , -.BR EOPNOTSUPP , -.B ENETUNREACH -.\"O .SH ERRORS +Linux の \fBaccept\fP() (と \fBaccept4\fP()) は、新しいソケットにおける、発生済みのネットワークエラーを +\fBaccept\fP() からのエラーコードとして渡す。 この振舞いは BSD ソケットの実装とは異なる。 信頼性の高い動作を行うためには、 +アプリケーションはプロトコルで定義されているネットワークエラーの検知を \fBaccept\fP() のあとに行い、それらのエラーを \fBEAGAIN\fP +と同じように扱い、再試行 (retry) を行うべきである。 TCP/IP では、以下のエラーが該当する: \fBENETDOWN\fP, +\fBEPROTO\fP, \fBENOPROTOOPT\fP, \fBEHOSTDOWN\fP, \fBENONET\fP, \fBEHOSTUNREACH\fP, +\fBEOPNOTSUPP\fP, \fBENETUNREACH\fP .SH エラー -.TP -.\"O .BR EAGAIN " or " EWOULDBLOCK -.BR EAGAIN " または " EWOULDBLOCK +.TP +\fBEAGAIN\fP または \fBEWOULDBLOCK\fP .\" Actually EAGAIN on Linux -.\"O The socket is marked nonblocking and no connections are -.\"O present to be accepted. -.\"O POSIX.1-2001 allows either error to be returned for this case, -.\"O and does not require these constants to have the same value, -.\"O so a portable application should check for both possibilities. -ソケットが非停止になっていて、 -かつ受付け対象の接続が存在しない。 -POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めており、 -これら 2 つの定数が同じ値を持つことも求めていない。 -したがって、移植性が必要なアプリケーションでは、両方の可能性を -確認すべきである。 -.TP -.B EBADF -.\"O The descriptor is invalid. +ソケットが非停止になっていて、 かつ受付け対象の接続が存在しない。 POSIX.1\-2001 は、この場合にどちらのエラーを返すことも認めており、 +これら 2 つの定数が同じ値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、両方の可能性を 確認すべきである。 +.TP +\fBEBADF\fP ディスクリプタが不正。 -.TP -.B ECONNABORTED -.\"O A connection has been aborted. +.TP +\fBECONNABORTED\fP 接続が中止された。 -.TP -.B EFAULT -.\"O The -.\"O .I addr -.\"O argument is not in a writable part of the user address space. -.I addr -引き数がユーザアドレス空間の書き込み可能領域にない。 -.TP -.B EINTR -.\"O The system call was interrupted by a signal that was caught -.\"O before a valid connection arrived; see -.\"O .BR signal (7). -有効な接続が到着する前に捕捉されたシグナルによって -システムコールが中断された。 -.BR signal (7) -参照。 -.TP -.B EINVAL -.\"O Socket is not listening for connections, or -.\"O .I addrlen -.\"O is invalid (e.g., is negative). -ソケットが接続待ち状態ではない。もしくは、 -.I addrlen -が不正である (例えば、負の場合など)。 -.TP -.B EINVAL -.\"O .RB ( accept4 ()) -.\"O invalid value in -.\"O .IR flags . -.RB ( accept4 ()) -.I flags -に不正な値が指定されている。 -.TP -.B EMFILE -.\"O The per-process limit of open file descriptors has been reached. +.TP +\fBEFAULT\fP +\fIaddr\fP 引き数がユーザアドレス空間の書き込み可能領域にない。 +.TP +\fBEINTR\fP +有効な接続が到着する前に捕捉されたシグナルによって システムコールが中断された。 \fBsignal\fP(7) 参照。 +.TP +\fBEINVAL\fP +ソケットが接続待ち状態ではない。もしくは、 \fIaddrlen\fP が不正である (例えば、負の場合など)。 +.TP +\fBEINVAL\fP +(\fBaccept4\fP()) \fIflags\fP に不正な値が指定されている。 +.TP +\fBEMFILE\fP 1プロセスがオープンできるファイル・ディスクリプタ数の上限に達した。 -.TP -.B ENFILE -.\"O The system limit on the total number of open files has been reached. -オープンされたファイルの総数がシステム全体の上限に達した。 -.TP -.BR ENOBUFS ", " ENOMEM -.\"O Not enough free memory. -.\"O This often means that the memory allocation is limited by the socket buffer -.\"O limits, not by the system memory. -メモリが足りない。 -多くの場合は、システムメモリが足りないわけではなく、 -ソケットバッファの大きさによるメモリ割り当ての制限である。 -.TP -.B ENOTSOCK -.\"O The descriptor references a file, not a socket. +.TP +\fBENFILE\fP +オープンされたファイルの総数がシステム全体の上限に達していた。 +.TP +\fBENOBUFS\fP, \fBENOMEM\fP +メモリが足りない。 多くの場合は、システムメモリが足りないわけではなく、 ソケットバッファの大きさによるメモリ割り当ての制限である。 +.TP +\fBENOTSOCK\fP ディスクリプタはソケットではなくファイルを参照している。 -.TP -.B EOPNOTSUPP -.\"O The referenced socket is not of type -.\"O .BR SOCK_STREAM . -参照しているソケットの型が -.B SOCK_STREAM -でない。 -.TP -.B EPROTO -.\"O Protocol error. +.TP +\fBEOPNOTSUPP\fP +参照しているソケットの型が \fBSOCK_STREAM\fP でない。 +.TP +\fBEPROTO\fP プロトコル・エラー。 .PP -.\"O In addition, Linux -.\"O .BR accept () -.\"O may fail if: -上記に加えて、Linux の -.BR accept () -は以下のエラーで失敗する: -.TP -.B EPERM -.\"O Firewall rules forbid connection. +上記に加えて、Linux の \fBaccept\fP() は以下のエラーで失敗する: +.TP +\fBEPERM\fP ファイアウォールのルールにより接続が禁止された。 .PP -.\"O In addition, network errors for the new socket and as defined -.\"O for the protocol may be returned. -.\"O Various Linux kernels can -.\"O return other errors such as -この他に、新しいソケットに対するネットワークエラーが返されることもある。 -これらはそれぞれのプロトコルで定義されている。 -いろいろな Linux カーネルでは、 -以下に示すようなエラーを返すこともある。 -.BR ENOSR , -.BR ESOCKTNOSUPPORT , -.BR EPROTONOSUPPORT , -.BR ETIMEDOUT . -.\"O The value -.\"O .B ERESTARTSYS -.\"O may be seen during a trace. -.B ERESTARTSYS -がトレースの最中に現れることもある。 -.\"O .SH VERSIONS +この他に、新しいソケットに対するネットワークエラーが返されることもある。 これらはそれぞれのプロトコルで定義されている。 いろいろな Linux +カーネルでは、 以下に示すようなエラーを返すこともある。 \fBENOSR\fP, \fBESOCKTNOSUPPORT\fP, +\fBEPROTONOSUPPORT\fP, \fBETIMEDOUT\fP. \fBERESTARTSYS\fP がトレースの最中に現れることもある。 .SH バージョン -.\"O The -.\"O .BR accept4 () -.\"O system call is available starting with Linux 2.6.28; -.\"O support in glibc is available starting with version 2.10. -.BR accept4 () -システムコールは Linux 2.6.28 以降で利用可能である。 -glibc でのサポートはバージョン 2.10 以降で利用可能である。 -.\"O .SH CONFORMING TO +\fBaccept4\fP() システムコールは Linux 2.6.28 以降で利用可能である。 glibc でのサポートはバージョン 2.10 +以降で利用可能である。 .SH 準拠 -.\"O .BR accept (): -.\"O POSIX.1-2001, -.\"O SVr4, 4.4BSD, -.\"O .RB ( accept () -.\"O first appeared in 4.2BSD). -.\"O .\" The BSD man page documents five possible error returns -.\"O .\" (EBADF, ENOTSOCK, EOPNOTSUPP, EWOULDBLOCK, EFAULT). -.\"O .\" POSIX.1-2001 documents errors -.\"O .\" EAGAIN, EBADF, ECONNABORTED, EINTR, EINVAL, EMFILE, -.\"O .\" ENFILE, ENOBUFS, ENOMEM, ENOTSOCK, EOPNOTSUPP, EPROTO, EWOULDBLOCK. -.\"O .\" In addition, SUSv2 documents EFAULT and ENOSR. -.BR accept (): -POSIX.1-2001, -SVr4, 4.4BSD, -.RB ( accept () -は 4.2BSD で初めて実装された). -.\" BSD の man ページには、 5 つのエラーが返されうると書かれている -.\" (EBADF, ENOTSOCK, EOPNOTSUPP, EWOULDBLOCK, EFAULT)。 -.\" POSIX.1-2001 では、 +.\" The BSD man page documents five possible error returns +.\" (EBADF, ENOTSOCK, EOPNOTSUPP, EWOULDBLOCK, EFAULT). +.\" POSIX.1-2001 documents errors .\" EAGAIN, EBADF, ECONNABORTED, EINTR, EINVAL, EMFILE, -.\" ENFILE, ENOBUFS, ENOMEM, ENOTSOCK, EOPNOTSUPP, EPROTO, EWOULDBLOCK -.\" がエラーとして記述されている。 -.\" さらに、SUSv2 には EFAULT, ENOSR も記述されている。 +.\" ENFILE, ENOBUFS, ENOMEM, ENOTSOCK, EOPNOTSUPP, EPROTO, EWOULDBLOCK. +.\" In addition, SUSv2 documents EFAULT and ENOSR. +\fBaccept\fP(): POSIX.1\-2001, SVr4, 4.4BSD, (\fBaccept\fP() は 4.2BSD で初めて実装された). -.\"O .BR accept4 () -.\"O is a nonstandard Linux extension. -.BR accept4 () -は非標準の Linux による拡張である。 +\fBaccept4\fP() は非標準の Linux による拡張である。 .LP -.\"O On Linux, the new socket returned by -.\"O .BR accept () -.\"O does \fInot\fP inherit file status flags such as -.\"O .B O_NONBLOCK -.\"O and -.\"O .B O_ASYNC -.\"O from the listening socket. -.\"O This behavior differs from the canonical BSD sockets implementation. -.\"O .\" Some testing seems to show that Tru64 5.1 and HP-UX 11 also -.\"O .\" do not inherit file status flags -- MTK Jun 05 -.\"O Portable programs should not rely on inheritance or noninheritance -.\"O of file status flags and always explicitly set all required flags on -.\"O the socket returned from -.\"O .BR accept (). -Linux では、 -.BR accept () -が返す新しいソケットは listen を行っているソケットの -ファイル状態フラグ -.RB ( O_NONBLOCK -や -.B O_ASYNC -など) を継承「しない」。 -この動作は標準的な BSD ソケットの実装とは異なっている。 -.\" いくつか実験したところでは Tru64 5.1 と HP-UX 11 も -.\" ファイル状態フラグを継承しないようである。 -- MTK Jun 05 -移植性を考慮したプログラムではファイル状態フラグが継承されるかどうかは -前提にせず、常に -.BR accept () -が返したソケットに対して全ての必要なフラグを明示的に設定するように -すべきである。 - -.\"O .SH NOTES +.\" Some testing seems to show that Tru64 5.1 and HP-UX 11 also +.\" do not inherit file status flags -- MTK Jun 05 +Linux では、 \fBaccept\fP() が返す新しいソケットは listen を行っているソケットの ファイル状態フラグ +(\fBO_NONBLOCK\fP や \fBO_ASYNC\fP など) を継承「しない」。 この動作は標準的な BSD ソケットの実装とは異なっている。 +移植性を考慮したプログラムではファイル状態フラグが継承されるかどうかは 前提にせず、常に \fBaccept\fP() +が返したソケットに対して全ての必要なフラグを明示的に設定するように すべきである。 .SH 注意 -.\"O POSIX.1-2001 does not require the inclusion of -.\"O .IR , -.\"O and this header file is not required on Linux. -.\"O However, some historical (BSD) implementations required this header -.\"O file, and portable applications are probably wise to include it. -POSIX.1-2001 では -.I -のインクルードは必須とされておらず、 -Linux ではこのヘッダファイルは必要ではない。 -しかし、歴史的には、いくつかの実装 (BSD 系) でこのヘッダファイルが -必要であり、移植性が必要なアプリケーションではこのファイルを -インクルードするのが賢明であろう。 +POSIX.1\-2001 では \fI\fP のインクルードは必須とされておらず、 Linux +ではこのヘッダファイルは必要ではない。 しかし、歴史的には、いくつかの実装 (BSD 系) でこのヘッダファイルが +必要であり、移植性が必要なアプリケーションではこのファイルを インクルードするのが賢明であろう。 -.\"O There may not always be a connection waiting after a -.\"O .B SIGIO -.\"O is delivered or -.\"O .BR select (2) -.\"O or -.\"O .BR poll (2) -.\"O return a readability event because the connection might have been -.\"O removed by an asynchronous network error or another thread before -.\"O .BR accept () -.\"O is called. -.B SIGIO -が届けられた後や、 -.BR select (2) -または -.BR poll (2) -が読み込み可能イベントを返した後に、 -必ずしも待機中の接続があるとは限らない。 -なぜならその接続は、 -.BR accept () -が呼ばれる前に、非同期的なネットワークエラーや -他のスレッドから呼ばれた (別の) accept によって -削除されているかもしれないからである。 -.\"O If this happens then the call will block waiting for the next -.\"O connection to arrive. -.\"O To ensure that -.\"O .BR accept () -.\"O never blocks, the passed socket -.\"O .I sockfd -.\"O needs to have the -.\"O .B O_NONBLOCK -.\"O flag set (see -.\"O .BR socket (7)). -この場合、その -.BR accept () -呼び出しは停止 (block) し、次の接続の到着を待ちつづける。 -.BR accept () -に停止を行わせないようにするには、引き数に渡すソケット -.I sockfd -に -.B O_NONBLOCK -フラグをセットしておく必要がある -.RB ( socket (7) -を見よ)。 -.\"O .SS The socklen_t type -.SS socklen_t 型 -.\"O The third argument of -.\"O .BR accept () -.\"O was originally declared as an \fIint *\fP (and is that under libc4 and libc5 -.\"O and on many other systems like 4.x BSD, SunOS 4, SGI); a POSIX.1g draft -.\"O standard wanted to change it into a \fIsize_t *\fP, and that is what it is -.\"O for SunOS 5. -.BR accept () -の第 3 引き数は、もともと \fIint *\fP と宣言されていた -(libc4 や libc5, 4.x BSD, SunOS 4, SGI など多くのシステムではそうなっている)。 -POSIX.1g draft 標準は、 -これを \fIsize_t *\fP に変更しようとし、SunOS 5 ではそう宣言されている。 -.\"O Later POSIX drafts have \fIsocklen_t *\fP, -.\"O and so do the Single UNIX Specification and glibc2. -後に POSIX drafts には \fIsocklen_t *\fP が含まれるようになり、 -Single UNIX Specification や glibc2 ではこのように宣言されるようになった。 -.\"O Quoting Linus Torvalds: -Linus Torvald の発言を引用する: +\fBSIGIO\fP が届けられた後や、 \fBselect\fP(2) または \fBpoll\fP(2) が読み込み可能イベントを返した後に、 +必ずしも待機中の接続があるとは限らない。 なぜならその接続は、 \fBaccept\fP() が呼ばれる前に、非同期的なネットワークエラーや +他のスレッドから呼ばれた (別の) accept によって 削除されているかもしれないからである。 この場合、その \fBaccept\fP() +呼び出しは停止 (block) し、次の接続の到着を待ちつづける。 \fBaccept\fP() に停止を行わせないようにするには、引き数に渡すソケット +\fIsockfd\fP に \fBO_NONBLOCK\fP フラグをセットしておく必要がある (\fBsocket\fP(7) を見よ)。 +.SS "socklen_t 型" +\fBaccept\fP() の第 3 引き数は、もともと \fIint *\fP と宣言されていた (libc4 や libc5, 4.x BSD, SunOS +4, SGI など多くのシステムではそうなっている)。 POSIX.1g draft 標準は、 これを \fIsize_t *\fP +に変更しようとし、SunOS 5 ではそう宣言されている。 後に POSIX drafts には \fIsocklen_t *\fP が含まれるようになり、 +Single UNIX Specification や glibc2 ではこのように宣言されるようになった。 Linus Torvald +の発言を引用する: .\" .I fails: only italicizes a single line -.\"O "_Any_ sane library _must_ have "socklen_t" be the same size -.\"O as int. -.\"O Anything else breaks any BSD socket layer stuff. -.\"O POSIX initially \fIdid\fP make it a size_t, and I (and hopefully others, but -.\"O obviously not too many) complained to them very loudly indeed. -.\"O Making it a size_t is completely broken, exactly because size_t very -.\"O seldom is the same size as "int" on 64-bit architectures, for example. -.\"O And it -.\"O \fIhas\fP to be the same size as "int" because that's what the BSD socket -.\"O interface is. -.\"O Anyway, the POSIX people eventually got a clue, and created "socklen_t". -.\"O They shouldn't have touched it in the first place, but once they did -.\"O they felt it had to have a named type for some unfathomable reason -.\"O (probably somebody didn't like losing face over having done the original -.\"O stupid thing, so they silently just renamed their blunder)." -「まともなライブラリを作りたければ、 "socklen_t" -のサイズは int と同じにしなきゃならない。 -さもないと BSD ソケット層を破壊することになっちゃう。 -POSIX は最初こいつを size_t にしたんで、 -ぼくは彼らに文句をがなりたてた -(多分そういう人は他にもいたと思う。多くはなかったようだけど)。 -こいつを size_t にするのは完全にいかれてる。 -例えば 64 ビットアーキテクチャでは、 -size_t が "int" と同じサイズだなんてことはほとんどないからね。 -このサイズは "int" と 同じでなきゃ『ダメ』なんだ。 -BSD ソケットインターフェースっていうのはそういうものなんだから。 -まあともかく POSIX の人たちも、 -"socklen_t" を作るという解決策をなんとかひねり出した。 -そもそも最初から放っておけば良かったんだが、 -いじっちゃった以上、 -名前付きの型を持たせなきゃならない、と思ったみたいだね。 -なんでかはわかんないけど -(きっと最初にやっちまった馬鹿な間違いで顔をつぶしたくなかったから、 +「まともなライブラリを作りたければ、 "socklen_t" のサイズは int と同じにしなきゃならない。 さもないと BSD +ソケット層を破壊することになっちゃう。 POSIX は最初こいつを size_t にしたんで、 ぼくは彼らに文句をがなりたてた +(多分そういう人は他にもいたと思う。多くはなかったようだけど)。 こいつを size_t にするのは完全にいかれてる。 例えば 64 +ビットアーキテクチャでは、 size_t が "int" と同じサイズだなんてことはほとんどないからね。 このサイズは "int" と +同じでなきゃ『ダメ』なんだ。 BSD ソケットインターフェースっていうのはそういうものなんだから。 まあともかく POSIX の人たちも、 +"socklen_t" を作るという解決策をなんとかひねり出した。 そもそも最初から放っておけば良かったんだが、 いじっちゃった以上、 +名前付きの型を持たせなきゃならない、と思ったみたいだね。 なんでかはわかんないけど (きっと最初にやっちまった馬鹿な間違いで顔をつぶしたくなかったから、 こっそり名前を付け替えて自分たちの大失敗をごまかそうとしたんだろう)。」 -.\"O .SH EXAMPLE .SH 例 -.\"O See -.\"O .BR bind (2). -.BR bind (2) -参照。 -.\"O .SH "SEE ALSO" +\fBbind\fP(2) 参照。 .SH 関連項目 -.BR bind (2), -.BR connect (2), -.BR listen (2), -.BR select (2), -.BR socket (2), -.BR socket (7) +\fBbind\fP(2), \fBconnect\fP(2), \fBlisten\fP(2), \fBselect\fP(2), \fBsocket\fP(2), +\fBsocket\fP(7) diff --git a/draft/man2/access.2 b/draft/man2/access.2 deleted file mode 100644 index db59e8dd..00000000 --- a/draft/man2/access.2 +++ /dev/null @@ -1,423 +0,0 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" This manpage is Copyright (C) 1992 Drew Eckhardt; -.\" 1993 Michael Haardt, Ian Jackson. -.\" and Copyright (C) 2007 Michael Kerrisk -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" Modified 1993-07-21 Rik Faith (faith@cs.unc.edu) -.\" Modified 1994-08-21 by Michael Chastain (mec@shell.portal.com): -.\" Removed note about old kernel (pre-1.1.44) using wrong id on path. -.\" Modified 1996-03-18 by Martin Schulze (joey@infodrom.north.de): -.\" Stated more clearly how it behaves with symbolic links. -.\" Added correction due to Nick Duffek (nsd@bbc.com), aeb, 960426 -.\" Modified 1996-09-07 by Michael Haardt: -.\" Restrictions for NFS -.\" Modified 1997-09-09 by Joseph S. Myers -.\" Modified 1998-01-13 by Michael Haardt: -.\" Using access is often insecure -.\" Modified 2001-10-16 by aeb -.\" Modified 2002-04-23 by Roger Luethi -.\" Modified 2004-06-23 by Michael Kerrisk -.\" 2007-06-10, mtk, various parts rewritten, and added BUGS section. -.\" -.\" Japanese Version Copyright (c) 1997-1998 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1997-12-17, HANATAKA Shinya -.\" Modified 1998-05-11, HANATAKA Shinya -.\" Updated 2001-12-14, Kentaro Shirakata -.\" Updated 2002-06-17, Kentaro Shirakata -.\" Updated 2005-02-23, Akihiro MOTOKI -.\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46 -.\" Updated 2007-09-04, Akihiro MOTOKI, LDP v2.64 -.\" -.\"WORD: permission アクセス権 -.\"WORD: privileges 権限 -.\"WORD: user ユーザー -.\"WORD: file system ファイル・システム -.\"WORD: object オブジェクト -.\"WORD: symbolic link シンボリック・リンク -.\"WORD: refer 参照する -.\"WORD: mask マスク -.\"WORD: path パス -.\"WORD: effective user-ID 実効ユーザーID -.\"WORD: real user-ID 実ユーザーID -.\"WORD: uid ユーザー ID -.\"WORD: gid グループ ID -.\"WORD: directory ディレクトリ -.\"WORD: call コール -.\"WORD: kernel カーネル -.\"WORD: memory メモリ -.\"WORD: dangling 参照先のない -.\" -.TH ACCESS 2 2007-07-10 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O access \- check real user's permissions for a file -access \- ファイルに対する実ユーザーでのアクセス権をチェックする -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.B #include -.sp -.BI "int access(const char *" pathname ", int " mode ); -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O .BR access () -.\"O checks whether the calling process can access the file -.\"O .IR pathname . -.\"O If -.\"O .I pathname -.\"O is a symbolic link, it is dereferenced. -.BR access () -は、呼び出し元プロセスがファイル -.I pathname -にアクセスできるかどうかをチェックする。 -.I pathname -がシンボリック・リンクの場合、シンボリック・リンクは展開される。 - -.\"O The -.\"O .I mode -.\"O specifies the accessibility check(s) to be performed, -.\"O and is either the value -.\"O .BR F_OK , -.\" F_OK is defined as 0 on every system that I know of. -.\"O or a mask consisting of the bitwise OR of one or more of -.\"O .BR R_OK ", " W_OK ", and " X_OK . -.I mode -はチェックを行うアクセス権を指定するもので、その値は -.BR F_OK 、 -.\" 私が知っているすべてのシステムで F_OK は 0 に定義されている。 -もしくは -.BR R_OK ", " W_OK ", " X_OK -の 1個以上のビット単位の論理和から構成されるマスクである。 -.\"O .B F_OK -.\"O tests for the existence of the file. -.\"O .BR R_OK ", " W_OK ", and " X_OK -.\"O test whether the file exists and grants read, write, and -.\"O execute permissions, respectively. -.B F_OK -はファイルが存在するかどうかのみを検査する。 -.BR R_OK ", " W_OK ", " X_OK -は、ファイルが存在して、それぞれ読み込み、書き込み、実行の許可があるか -を検査する。 - -.\"O The check is done using the calling process's -.\"O .I real -.\"O UID and GID, rather than the effective IDs as is done when -.\"O actually attempting an operation (e.g., -.\"O .BR open (2)) -.\"O on the file. -.\"O This allows set-user-ID programs to -.\"O easily determine the invoking user's authority. -チェックは、実際に操作が行われる際に使用される実効 (effective) ID でなく、 -呼び出し元プロセスの -.I "実 (real)" -UID と -.I "実 (real)" -GID を使って行われる。 -これにより、set-user-ID プログラムで、プログラムを起動するユーザの権限を -簡単に決定することができる。 - -.\"O If the calling process is privileged (i.e., its real UID is zero), -.\"O then an -.\"O .B X_OK -.\"O check is successful for a regular file if execute permission -.\"O is enabled for any of the file owner, group, or other. -呼び出し元プロセスが特権プロセス (つまり、プロセスの実 UID が 0) の場合、 -通常のファイルに対する -.B X_OK -のチェックは、そのファイルの所有者、グループ、他人のいずれかの -実行許可が有効になっていれば成功する。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success (all requested permissions granted), zero is returned. -.\"O On error (at least one bit in -.\"O .I mode -.\"O asked for a permission that is denied, or some other error occurred), -.\"O \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合(全ての要求された許可が得られたら)、ゼロが返される。 -エラーの場合 (少なくとも一つの -.I mode -で要求された許可がなかった場合や、他のエラーが起きた場合)、 -\-1 が返され、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS -.SH エラー -.\"O .BR access () -.\"O shall fail if: -.BR access () -は以下の場合に失敗する。 -.TP -.B EACCES -.\"O The requested access would be denied to the file, or search permission -.\"O is denied for one of the directories in the path prefix of -.\"O .IR pathname . -.\"O (See also -.\"O .BR path_resolution (7).) -要求されたアクセスは -そのファイル自身に拒否されたか -.I pathname -へ至るまでディレクトリのいずれかに対する検索許可 -(search permission) が得られなかった。 -.RB ( path_resolution (7) -も参照のこと) -.TP -.B ELOOP -.\"O Too many symbolic links were encountered in resolving -.\"O .IR pathname . -.I pathname -を解決する際に遭遇したシンボリック・リンクが多過ぎる。 -.TP -.B ENAMETOOLONG -.\"O .I pathname -.\"O is too long. -.I pathname -が長過ぎる。 -.TP -.B ENOENT -.\"O A component of -.\"O .I pathname -.\"O does not exist or is a dangling symbolic link. -.I pathname -を構成するパスのいずれかが、存在しないか、 -参照先のない (dangling) シンボリックリンクになっている。 -.TP -.B ENOTDIR -.\"O A component used as a directory in -.\"O .I pathname -.\"O is not, in fact, a directory. -.I pathname -のディレクトリ部分が、実際にはディレクトリでない。 -.TP -.B EROFS -.\"O Write permission was requested for a file on a read-only file system. -読み込み専用 (read-only) のファイル・システムに対して書き込み許可を -要求した。 -.PP -.\"O .BR access () -.\"O may fail if: -.BR access () -は以下の理由により失敗することがある。 -.TP -.B EFAULT -.\"O .I pathname -.\"O points outside your accessible address space. -.I pathname -がアクセス可能なアドレス空間の外を指している。 -.TP -.B EINVAL -.\"O .I mode -.\"O was incorrectly specified. -.I mode -に不正な値が指定された。 -.TP -.B EIO -.\"O An I/O error occurred. -I/O エラーが発生した。 -.TP -.B ENOMEM -.\"O Insufficient kernel memory was available. -カーネルに十分なメモリがない。 -.TP -.B ETXTBSY -.\"O Write access was requested to an executable which is being -.\"O executed. -実行中のファイルに対して書き込みを要求した。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -SVr4, 4.3BSD, POSIX.1-2001. -.\"O .SH NOTES -.SH 注意 -.PP -.\"O .BR Warning : -.\"O Using -.\"O .BR access () -.\"O to check if a user is authorized to, for example, -.\"O open a file before actually doing so using -.\"O .BR open (2) -.\"O creates a security hole, because the user might exploit the short time -.\"O interval between checking and opening the file to manipulate it. -.BR 警告 : -あるユーザが、例えば -.BR open (2) -によるアクセスが可能かどうかを、(実際に行う前に) -.BR access () -を使ってチェックするのは、セキュリティホールの原因になる。 -なぜならチェックをしてから -実際にファイルのオープン操作をする間の短い間隔を悪用できるからである。 -.\"O .BR "For this reason, the use of this system call should be avoided" . -.BR この理由があるので、このシステムコールを使うのは避けるべきである。 -.PP -.\"O .BR access () -.\"O returns an error if any of the access types in -.\"O .I mode -.\"O is denied, even if some of the other access types in -.\"O .I mode -.\"O are permitted. -.I mode -で指定されたアクセス種別のいずれか一つでも拒否されると、 -たとえ -.I mode -で指定された他のアクセス種別が許可されたとしても、 -.BR access () -はエラーを返す。 -.PP -.\"O If the calling process has appropriate privileges (i.e., is superuser), -.\"O POSIX.1-2001 permits implementation to indicate success for an -.\"O .B X_OK -.\"O check even if none of the execute file permission bits are set. -.\"O .\" HPU-UX 11 and Tru64 5.1 do this. -.\"O Linux does not do this. -POSIX.1-2001 では、 -呼び出し元プロセスが適切な特権を持っている場合 -(つまり、スーパーユーザの場合)、 -たとえファイルの実行許可ビットが全くセットされていなくても -.B X_OK -のチェックとして成功を返す実装が認められている。 -.\" HPU-UX 11 と Tru64 5.1 はこのようになっている。 -Linux はこのようにはなっていない。 -.PP -.\"O A file is only accessible if the permissions on each of the -.\"O directories in the path prefix of -.\"O .I pathname -.\"O grant search (i.e., execute) access. -.\"O If any directory is inaccessible, then the -.\"O .BR access () -.\"O call will fail, regardless of the permissions on the file itself. -.I pathname -のプレフィックスを構成するディレクトリの全てに対して -検索アクセス (すなわち、実行アクセス) が許可された場合にのみ、 -ファイルはアクセス可能となる。 -いずれかのディレクトリがアクセス不可の場合、 -ファイル自身のアクセス許可に関わらず、 -.BR access () -は失敗する。 -.PP -.\"O Only access bits are checked, not the file type or contents. -.\"O Therefore, if a directory is found to be writable, -.\"O it probably means that files can be created in the directory, -.\"O and not that the directory can be written as a file. -.\"O Similarly, a DOS file may be found to be "executable," but the -.\"O .BR execve (2) -.\"O call will still fail. -アクセス・ビットのみがチェックされ、ファイルの種類や内容はチェックされない。 -従って、ディレクトリが書き込み可能となった場合は、ディレクトリに -ファイルを作成することが可能なことを意味するのであり、ディレクトリに -ファイルとして書き込むことができるわけではない。 -同様に DOS のファイルは「実行可能」と判断されるが、 -.BR execve (2) -コールは失敗するだろう。 -.PP -.\"O .BR access () -.\"O may not work correctly on NFS file systems with UID mapping enabled, -.\"O because UID mapping is done on the server and hidden from the client, -.\"O which checks permissions. -.BR access () -は、 UID マッピングを使用した NFS ファイル・システムでは正常に -機能しないかもしれない。なぜならば UID のマッピングはサーバーで -行なわれ、権利のチェックをするクライアントには見えないからである。 -.\"O .SH BUGS -.SH バグ -.\"O In kernel 2.4 (and earlier) there is some strangeness in the handling of -.\"O .B X_OK -.\"O tests for superuser. -.\"O If all categories of execute permission are disabled -.\"O for a nondirectory file, then the only -.\"O .BR access () -.\"O test that returns \-1 is when -.\"O .I mode -.\"O is specified as just -.\"O .BR X_OK ; -.\"O if -.\"O .B R_OK -.\"O or -.\"O .B W_OK -.\"O is also specified in -.\"O .IR mode , -.\"O then -.\"O .BR access () -.\"O returns 0 for such files. -.\"O .\" This behavior appears to have been an implementation accident. -.\"O Early 2.6 kernels (up to and including 2.6.3) -.\"O also behaved in the same way as kernel 2.4. -バージョン 2.4 (とそれ以前) のカーネルには、スーパーユーザでの -.B X_OK -のチェックの扱いに奇妙な点がある。 -ディレクトリ以外のファイルで -(ユーザ、グループ、他人の) 全てのカテゴリについて -実行許可がない場合、 -.BR access () -のチェックで \-1 が返るのは -.I mode -に -.B X_OK -だけが指定されたときだけであり -.I mode -に -.B R_OK -や -.B W_OK -が一緒に指定された場合には -.BR access () -は 0 を返す。 -.\" この挙動は実装時の事故だったようである。 -(バージョン 2.6.3 以前の) 初期の 2.6 系のカーネルも -2.4 系のカーネルと同様の動作をする。 - -.\"O In kernels before 2.6.20, -.\"O .BR access () -.\"O ignored the effect of the -.\"O .B MS_NOEXEC -.\"O flag if it was used to -.\"O .BR mount (2) -.\"O the underlying file system. -.\"O Since kernel 2.6.20, -.\"O .BR access () -.\"O honors this flag. -2.6.20 より前のカーネルでは、 -ファイルが存在するファイルシステムを -.BR mount (2) -する際に指定された -.B MS_NOEXEC -フラグの効果を、 -.BR access () -は無視していた。 -カーネル 2.6.20 以降では、 -.BR access () -はこのフラグを考慮するようになっている。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR chmod (2), -.BR chown (2), -.BR faccessat (2), -.BR open (2), -.BR setgid (2), -.BR setuid (2), -.BR stat (2), -.BR eauidaccess (3), -.BR credentials (7), -.BR path_resolution (7) diff --git a/draft/man2/adjtimex.2 b/draft/man2/adjtimex.2 index 640d5ea4..f3c3d4de 100644 --- a/draft/man2/adjtimex.2 +++ b/draft/man2/adjtimex.2 @@ -26,85 +26,44 @@ .\" Modified 1997-07-30 by Paul Slootman .\" Modified 2004-05-27 by Michael Kerrisk .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1997-12-17, HANATAKA Shinya -.\" Updated and Modified 2001-06-12,Yuichi SATO -.\" Updated and Modified 2004-12-28, Yuichi SATO -.\" Updated 2006-07-16, Akihiro MOTOKI , LDP v2.34 +.\"******************************************************************* .\" -.\"WORD: kernel カーネル -.\"WORD: algorithm アルゴリズム -.\"WORD: update 更新 -.\"WORD: parameter パラメーター -.\"WORD: field フィールド -.\"WORD: super user スーパー・ユーザー -.\"WORD: timer タイマー -.\"WORD: interrupt 割り込み -.\"WORD: memory メモリ +.\" This file was generated with po4a. Translate the source file. .\" -.TH ADJTIMEX 2 2004-05-27 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH ADJTIMEX 2 2004\-05\-27 Linux "Linux Programmer's Manual" .SH 名前 -.\"O adjtimex \- tune kernel clock adjtimex \- カーネルの時計を調整する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int adjtimex(struct timex *" "buf" ); -.\"O .SH DESCRIPTION +\fBint adjtimex(struct timex *\fP\fIbuf\fP\fB);\fP .SH 説明 -.\"O Linux uses David L. Mills' clock adjustment algorithm (see RFC\ 1305). -.\"O The system call -.\"O .BR adjtimex () -.\"O reads and optionally sets adjustment parameters for this algorithm. -Linux は David L. Mill の時計調節アルゴリズムを使用している -(RFC\ 1305 を参照)。 -システムコール -.BR adjtimex () -はこのアルゴリズムの調節のパラメーターを読み取ったり、設定したりする。 -.\"O It takes a pointer to a -.\"O .I timex -.\"O structure, updates kernel parameters from field values, -.\"O and returns the same structure with current kernel values. -.\"O This structure is declared as follows: -この関数は -.I timex -構造体へのポインターを受け取り、その値でカーネルのパラメーターを更新して、 -同じ構造体に現在のカーネルの値を返す。 -この構造体は以下のように宣言される: +Linux は David L. Mill の時計調節アルゴリズムを使用している (RFC\ 1305 を参照)。 システムコール +\fBadjtimex\fP() はこのアルゴリズムの調節のパラメーターを読み取ったり、設定したりする。 この関数は \fItimex\fP +構造体へのポインターを受け取り、その値でカーネルのパラメーターを更新して、 同じ構造体に現在のカーネルの値を返す。 この構造体は以下のように宣言される: .PP .in +4n .nf +.\" FIXME -- what is the scaling unit? 2^16 ? struct timex { int modes; /* mode selector */ long offset; /* time offset (usec) */ long freq; /* frequency offset (scaled ppm) */ -.\" FIXME -- what is the scaling unit? 2^16 ? long maxerror; /* maximum error (usec) */ long esterror; /* estimated error (usec) */ int status; /* clock command/status */ long constant; /* pll time constant */ - long precision; /* clock precision (usec) (read-only) */ + long precision; /* clock precision (usec) (read\-only) */ long tolerance; /* clock frequency tolerance (ppm) - (read-only) */ - struct timeval time; /* current time (read-only) */ + (read\-only) */ + struct timeval time; /* current time (read\-only) */ long tick; /* usecs between clock ticks */ }; .fi .in .PP -.\"O The -.\"O .I modes -.\"O field determines which parameters, if any, to set. -.\"O It may contain a -.\"O .RI bitwise- or -.\"O combination of zero or more of the following bits: -.I modes -フィールドは (必要に応じて) どのパラメーターを設定するか決定する。 -それは以下のビット値の 0 個以上の -.RI "ビット " OR +\fImodes\fP フィールドは (必要に応じて) どのパラメーターを設定するか決定する。 それは以下のビット値の 0 個以上の ビット \fIOR\fP からなる: .PP .in +4n @@ -116,28 +75,15 @@ struct timex { #define ADJ_STATUS 0x0010 /* clock status */ #define ADJ_TIMECONST 0x0020 /* pll time constant */ #define ADJ_TICK 0x4000 /* tick value */ -#define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime() */ +#define ADJ_OFFSET_SINGLESHOT 0x8001 /* old\-fashioned adjtime() */ .fi .in .PP -.\"O Ordinary users are restricted to a zero value for -.\"O .IR mode . -.\"O Only the superuser may set any parameters. -通常のユーザーは -.I mode -の値は 0 に制限されている。 -スーパー・ユーザーのみが全てのパラメーターを設定できる。 +通常のユーザーは \fImode\fP の値は 0 に制限されている。 スーパー・ユーザーのみが全てのパラメーターを設定できる。 .br .ne 12v -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O On success, -.\"O .BR adjtimex () -.\"O returns the clock state: -成功した場合、 -.BR adjtimex () -は -クロックの状態を返す: +成功した場合、 \fBadjtimex\fP() は クロックの状態を返す: .PP .in +4n .nf @@ -149,84 +95,22 @@ struct timex { .fi .in .PP -.\"O On failure, -.\"O .BR adjtimex () -.\"O returns \-1 and sets -.\"O .IR errno . -失敗した場合は -.BR adjtimex () -は \-1 を返し、 -.I errno -が設定される。 -.\"O .SH ERRORS +失敗した場合は \fBadjtimex\fP() は \-1 を返し、 \fIerrno\fP が設定される。 .SH エラー -.TP -.B EFAULT -.\"O .I buf -.\"O does not point to writable memory. -.I buf -が書き込み可能なメモリを指していない。 -.TP -.B EINVAL -.\"O An attempt is made to set -.\"O .I buf.offset -.\"O to a value outside the range \-131071 to +131071, -.\"O or to set -.\"O .I buf.status -.\"O to a value other than those listed above, -.\"O or to set -.\"O .I buf.tick -.\"O to a value outside the range -.\"O .RB 900000/ HZ -.\"O to -.\"O .RB 1100000/ HZ , -.\"O where -.\"O .B HZ -.\"O is the system timer interrupt frequency. -.I buf.offset -へ \-131071 〜 +131071 の範囲以外の値を設定しようとしたか、 -.I buf.status -に上記以外の値を設定しようとしたか、 -.I buf.tick -に -.RB 900000/ HZ -〜 -.RB 1100000/ HZ -の範囲以外の値を設定しようとした。 -ここで -.B HZ -はシステムのタイマー割り込みの周期である。 -.TP -.B EPERM -.\"O .I buf.mode -.\"O is nonzero and the caller does not have sufficient privilege. -.I buf.mode -が 0 でなく、かつ呼び出し元が十分な特権を持っていない。 -.\"O Under Linux the -.\"O .B CAP_SYS_TIME -.\"O capability is required. -Linux では -.B CAP_SYS_TIME +.TP +\fBEFAULT\fP +\fIbuf\fP が書き込み可能なメモリを指していない。 +.TP +\fBEINVAL\fP +\fIbuf.offset\fP へ \-131071 〜 +131071 の範囲以外の値を設定しようとしたか、 \fIbuf.status\fP +に上記以外の値を設定しようとしたか、 \fIbuf.tick\fP に 900000/\fBHZ\fP 〜 1100000/\fBHZ\fP +の範囲以外の値を設定しようとした。 ここで \fBHZ\fP はシステムのタイマー割り込みの周期である。 +.TP +\fBEPERM\fP +\fIbuf.mode\fP が 0 でなく、かつ呼び出し元が十分な特権を持っていない。 Linux では \fBCAP_SYS_TIME\fP ケーパビリティが必要である。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O .BR adjtimex () -.\"O is Linux-specific and should not be used in programs -.\"O intended to be portable. -.\"O See -.\"O .BR adjtime (3) -.\"O for a more portable, but less flexible, -.\"O method of adjusting the system clock. -.BR adjtimex () -は Linux 特有であり、 -移植を意図したプログラムで使用すべきではない。 -システムクロックを調整する方法で、 -移植性があるが自由度は劣る方法については -.BR adjtime (3) -を参照のこと。 -.\"O .SH "SEE ALSO" +\fBadjtimex\fP() は Linux 特有であり、 移植を意図したプログラムで使用すべきではない。 システムクロックを調整する方法で、 +移植性があるが自由度は劣る方法については \fBadjtime\fP(3) を参照のこと。 .SH 関連項目 -.BR settimeofday (2), -.BR adjtime (3), -.BR capabilities (7), -.BR time (7) +\fBsettimeofday\fP(2), \fBadjtime\fP(3), \fBcapabilities\fP(7), \fBtime\fP(7) diff --git a/draft/man2/alarm.2 b/draft/man2/alarm.2 index c8faaa38..897da55a 100644 --- a/draft/man2/alarm.2 +++ b/draft/man2/alarm.2 @@ -23,118 +23,41 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Modified Wed Jul 21 19:42:57 1993, Rik Faith -.\" Modified Sun Jul 21 21:25:26 1996, Andries Brouwer +.\" Modified Wed Jul 21 19:42:57 1993 by Rik Faith +.\" Modified Sun Jul 21 21:25:26 1996 by Andries Brouwer .\" Modified Wed Nov 6 03:46:05 1996 by Eric S. Raymond .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Wed Feb 22 20:02:18 JST 1997 -.\" by HANATAKA Shinya +.\"******************************************************************* .\" -.\"WORD: alarm アラーム -.\"WORD: signal シグナル -.\"WORD: clock クロック -.\"WORD: process プロセス -.\"WORD: timer タイマー -.\"WORD: scheduling スケジューリング +.\" This file was generated with po4a. Translate the source file. .\" -.TH ALARM 2 2008-06-12 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH ALARM 2 2008\-06\-12 Linux "Linux Programmer's Manual" .SH 名前 -.\"O alarm \- set an alarm clock for delivery of a signal alarm \- シグナル配送のためのアラーム・クロックを設定する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "unsigned int alarm(unsigned int " seconds ); +\fBunsigned int alarm(unsigned int \fP\fIseconds\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR alarm () -.\"O arranges for a -.\"O .B SIGALRM -.\"O signal to be delivered to the calling process in -.\"O .I seconds -.\"O seconds. -.BR alarm () -は -.B SIGALRM -シグナルを -.I seconds -秒後に呼び出したプロセスに配送するように手配する。 +\fBalarm\fP() は \fBSIGALRM\fP シグナルを \fIseconds\fP 秒後に呼び出したプロセスに配送するように手配する。 -.\"O If -.\"O .I seconds -.\"O is zero, no new -.\"O .BR alarm () -.\"O is scheduled. -.I seconds -がゼロならば、新たな -.BR alarm () -は手配されない。 +\fIseconds\fP がゼロならば、新たな \fBalarm\fP() は手配されない。 -.\"O In any event any previously set -.\"O .BR alarm () -.\"O is canceled. -今までに設定されていた -.BR alarm () -は中断される。 -.\"O .SH "RETURN VALUE" +今までに設定されていた \fBalarm\fP() は中断される。 .SH 返り値 -.\"O .BR alarm () -.\"O returns the number of seconds remaining until any previously scheduled -.\"O alarm was due to be delivered, or zero if there was no previously -.\"O scheduled alarm. -.BR alarm () -は以前に予定されていたアラームの配送までの残り時間を返す。以前に -アラームが予定されていなければゼロを返す。 -.\"O .SH "CONFORMING TO" +\fBalarm\fP() は以前に予定されていたアラームの配送までの残り時間を返す。以前に アラームが予定されていなければゼロを返す。 .SH 準拠 -SVr4, POSIX.1-2001, 4.3BSD. -.\"O .SH NOTES +SVr4, POSIX.1\-2001, 4.3BSD. .SH 注意 -.\"O .BR alarm () -.\"O and -.\"O .BR setitimer (2) -.\"O share the same timer; calls to one will interfere with use of the -.\"O other. -.BR alarm () -と -.BR setitimer (2) -は同じタイマーを共有している; 片方を呼び出すことはもう一方の -使用に影響を与える。 +\fBalarm\fP() と \fBsetitimer\fP(2) は同じタイマーを共有している; 片方を呼び出すことはもう一方の 使用に影響を与える。 .PP -.\"O .BR sleep (3) -.\"O may be implemented using -.\"O .BR SIGALRM ; -.\"O mixing calls to -.\"O .BR alarm () -.\"O and -.\"O .BR sleep (3) -.\"O is a bad idea. -.BR sleep (3) -は -.B SIGALRM -を利用して実装されているかもしれない。 -.BR alarm () -と -.BR sleep (3) +\fBsleep\fP(3) は \fBSIGALRM\fP を利用して実装されているかもしれない。 \fBalarm\fP() と \fBsleep\fP(3) を混ぜて使用してはならない。 -.\"O Scheduling delays can, as ever, cause the execution of the process to -.\"O be delayed by an arbitrary amount of time. -スケジューリング(scheduling)の遅延により、プロセスの実行に不定量の -遅延が起きる可能性がある。 -.\"O .SH "SEE ALSO" +スケジューリング(scheduling)の遅延により、プロセスの実行に不定量の 遅延が起きる可能性がある。 .SH 関連項目 -.BR gettimeofday (2), -.BR pause (2), -.BR select (2), -.BR setitimer (2), -.BR sigaction (2), -.BR signal (2), -.BR sleep (3), -.BR time (7) +\fBgettimeofday\fP(2), \fBpause\fP(2), \fBselect\fP(2), \fBsetitimer\fP(2), +\fBsigaction\fP(2), \fBsignal\fP(2), \fBsleep\fP(3), \fBtime\fP(7) diff --git a/draft/man2/alloc_hugepages.2 b/draft/man2/alloc_hugepages.2 index 99a94f18..75339230 100644 --- a/draft/man2/alloc_hugepages.2 +++ b/draft/man2/alloc_hugepages.2 @@ -22,244 +22,73 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 2004 Yuichi SATO -.\" all rights reserved. -.\" Translated 2004-06-06, Yuichi SATO -.\" Updated 2007-06-11, Akihiro MOTOKI , LDP v2.54 +.\" This file was generated with po4a. Translate the source file. .\" -.\"WORD: huge page ヒュージページ -.\" -.TH ALLOC_HUGEPAGES 2 2007-05-31 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH ALLOC_HUGEPAGES 2 2007\-05\-31 Linux "Linux Programmer's Manual" .SH 名前 -.\"O alloc_hugepages, free_hugepages \- allocate or free huge pages alloc_hugepages, free_hugepages \- 大きなサイズのページの割り当てと解放を行う -.\"O .SH SYNOPSIS .SH 書式 .nf -.BI "void *alloc_hugepages(int " key ", void *" addr ", size_t " len , -.BI " int " prot ", int " flag ); .\" asmlinkage unsigned long sys_alloc_hugepages(int key, unsigned long addr, .\" unsigned long len, int prot, int flag); +\fBvoid *alloc_hugepages(int \fP\fIkey\fP\fB, void *\fP\fIaddr\fP\fB, size_t \fP\fIlen\fP\fB,\fP +\fB int \fP\fIprot\fP\fB, int \fP\fIflag\fP\fB);\fP .sp -.BI "int free_hugepages(void *" addr ); .\" asmlinkage int sys_free_hugepages(unsigned long addr); +\fBint free_hugepages(void *\fP\fIaddr\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The system calls -.\"O .BR alloc_hugepages () -.\"O and -.\"O .BR free_hugepages () -.\"O were introduced in Linux 2.5.36 and removed again in 2.5.54. -システムコール -.BR alloc_hugepages () -と -.BR free_hugepages () -は Linux 2.5.36 で導入され、2.5.54 で再び削除された。 -.\"O They existed only on i386 and ia64 (when built with -.\"O .BR CONFIG_HUGETLB_PAGE ). -これらのシステムコールは i386 と ia64 のみで -(かつ -.B CONFIG_HUGETLB_PAGE -を指定してビルドされた場合に) 存在する。 -.\"O In Linux 2.4.20 the syscall numbers exist, -.\"O but the calls fail with the error -.\"O .BR ENOSYS . -Linux 2.4.20 では syscall 番号が存在するが、 -呼び出すとエラー -.B ENOSYS -で失敗する。 +システムコール \fBalloc_hugepages\fP() と \fBfree_hugepages\fP() は Linux 2.5.36 +で導入され、2.5.54 で再び削除された。 これらのシステムコールは i386 と ia64 のみで (かつ +\fBCONFIG_HUGETLB_PAGE\fP を指定してビルドされた場合に) 存在する。 Linux 2.4.20 では syscall +番号が存在するが、 呼び出すとエラー \fBENOSYS\fP で失敗する。 .LP -.\"O On i386 the memory management hardware knows about ordinary pages (4 KiB) -.\"O and huge pages (2 or 4 MiB). -.\"O Similarly ia64 knows about huge pages of -.\"O several sizes. -.\"O These system calls serve to map huge pages into the -.\"O process's memory or to free them again. -i386 では、メモリ管理ハードウェアは通常のページ (4 KiB) と -大きなサイズのページ (以下、ヒュージページ; 2MiB または 4 MiB) を -扱うことができる。 -同様に、ia64 もいくつかのサイズのヒュージページを扱うことができる。 -これらのシステムコールは、ヒュージページをプロセスのメモリにマップしたり、 -再び解放したりする。 -.\"O Huge pages are locked into memory, and are not swapped. +i386 では、メモリ管理ハードウェアは通常のページ (4 KiB) と 大きなサイズのページ (以下、ヒュージページ; 2MiB または 4 MiB) +を 扱うことができる。 同様に、ia64 もいくつかのサイズのヒュージページを扱うことができる。 +これらのシステムコールは、ヒュージページをプロセスのメモリにマップしたり、 再び解放したりする。 ヒュージページはメモリ内にロックされ、スワップされない。 .LP -.\"O The -.\"O .I key -.\"O argument is an identifier. -.\"O When zero the pages are private, and -.\"O not inherited by children. -.I key -引き数は識別子である。 -0 の場合、ページは非公開になり、子プロセスに継承されない。 -.\"O When positive the pages are shared with other applications using the same -.\"O .IR key , -.\"O and inherited by child processes. -正の場合、ページは同じ -.I key +\fIkey\fP 引き数は識別子である。 0 の場合、ページは非公開になり、子プロセスに継承されない。 正の場合、ページは同じ \fIkey\fP を使う他のアプリケーションと共有され、子プロセスに継承される。 .LP -.\"O The -.\"O .I addr -.\"O argument of -.\"O .BR free_hugepages () -.\"O tells which page is being freed: it was the return value of a -.\"O call to -.\"O .BR alloc_hugepages (). -.\"O (The memory is first actually freed when all users have released it.) -.BR free_hugepages () -の -.I addr -引き数は、どのページを解放するかを指定する: -.I addr -は -.BR alloc_hugepages () -の呼び出しの返り値である -(全てのユーザがメモリを解放したときに、 -そのメモリは初めて実際に解放される)。 -.\"O The -.\"O .I addr -.\"O argument of -.\"O .BR alloc_hugepages () -.\"O is a hint, that the kernel may or may not follow. -.BR alloc_hugepages () -の -.I addr -引き数はヒントであり、カーネルはそれに従うかもしれないし、 -従わないかもしれない。 -.\"O Addresses must be properly aligned. +\fBfree_hugepages\fP() の \fIaddr\fP 引き数は、どのページを解放するかを指定する: \fIaddr\fP は +\fBalloc_hugepages\fP() の呼び出しの返り値である (全てのユーザがメモリを解放したときに、 そのメモリは初めて実際に解放される)。 +\fBalloc_hugepages\fP() の \fIaddr\fP 引き数はヒントであり、カーネルはそれに従うかもしれないし、 従わないかもしれない。 アドレスは正しく配置されなければならない。 .LP -.\"O The -.\"O .I len -.\"O argument is the length of the required segment. -.\"O It must be a multiple of the huge page size. -.I len -引き数は要求されたセグメントの長さである。 -これはヒュージページのサイズの倍数にしなければならない。 +\fIlen\fP 引き数は要求されたセグメントの長さである。 これはヒュージページのサイズの倍数にしなければならない。 .LP -.\"O The -.\"O .I prot -.\"O argument specifies the memory protection of the segment. -.\"O It is one of -.\"O .BR PROT_READ , -.\"O .BR PROT_WRITE , -.\"O .BR PROT_EXEC . -.I prot -引き数はセグメントのメモリ保護を指定する。 -これは -.BR PROT_READ , -.BR PROT_WRITE , -.B PROT_EXEC +\fIprot\fP 引き数はセグメントのメモリ保護を指定する。 これは \fBPROT_READ\fP, \fBPROT_WRITE\fP, \fBPROT_EXEC\fP のいずれかである。 .LP -.\"O The -.\"O .I flag -.\"O argument is ignored, unless -.\"O .I key -.\"O is positive. -.\"O In that case, if -.\"O .I flag -.\"O is -.\"O .BR IPC_CREAT , -.\"O then a new huge page segment is created when none -.\"O with the given key existed. -.\"O If this flag is not set, then -.\"O .B ENOENT -.\"O is returned when no segment with the given key exists. -.I key -が正でない限り、 -.I flag -引き数は無視される。 -.I key -が正で、かつ -.I flag -が -.B IPC_CREAT -であり、かつ指定された -.I key -で (セグメントが) 何も存在しない場合、 -新しいヒュージページセグメントが作成される。 -.I flag -が設定されておらず、かつ指定された -.I key -のセグメントが存在しない場合、 -.B ENOENT -が返される。 -.\"O .SH "RETURN VALUE" +\fIkey\fP が正でない限り、 \fIflag\fP 引き数は無視される。 \fIkey\fP が正で、かつ \fIflag\fP が \fBIPC_CREAT\fP +であり、かつ指定された \fIkey\fP で (セグメントが) 何も存在しない場合、 新しいヒュージページセグメントが作成される。 \fIflag\fP +が設定されておらず、かつ指定された \fIkey\fP のセグメントが存在しない場合、 \fBENOENT\fP が返される。 .SH 返り値 -.\"O On success, -.\"O .BR alloc_hugepages () -.\"O returns the allocated virtual address, and -.\"O .BR free_hugepages () -.\"O returns zero. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合、 -.BR alloc_hugepages () -は割り当てられた仮想アドレスを返し、 -.BR free_hugepages () -は 0 を返す。 -失敗した場合、\-1 を返し、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS +成功した場合、 \fBalloc_hugepages\fP() は割り当てられた仮想アドレスを返し、 \fBfree_hugepages\fP() は 0 +を返す。 失敗した場合、\-1 を返し、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP -.B ENOSYS -.\"O The system call is not supported on this kernel. +.TP +\fBENOSYS\fP このシステムコールはカーネルでサポートされていない。 -.\"O .SH FILES .SH ファイル -.TP -.I /proc/sys/vm/nr_hugepages -.\"O Number of configured hugetlb pages. -.\"O This can be read and written. -設定された hugetlb ページの数。 -このファイルは読み書きできる。 -.TP -.I /proc/meminfo -.\"O Gives info on the number of configured hugetlb pages and on their size -.\"O in the three variables HugePages_Total, HugePages_Free, Hugepagesize. -設定された hugetlb ページの数と、 -3 つの変数 HugePages_Total, HugePages_Free, Hugepagesize の -サイズについての情報を提供する。 -.\"O .SH "CONFORMING TO" +\fI/proc/sys/vm/nr_hugepages\fP 設定された hugetlb ページの数。 このファイルは読み書きできる。 +.LP +\fI/proc/meminfo\fP 設定された hugetlb ページの数と、 3 つの変数 HugePages_Total, +HugePages_Free, Hugepagesize の サイズについての情報を提供する。 .SH 準拠 -.\"O These calls are specific to Linux on Intel processors, and should not be -.\"O used in programs intended to be portable. -このシステムコールは Intel プロセッサ上の Linux に固有のものであり、 -移植性が必要なプログラムで使うべきでない。 -.\"O .SH NOTES +このシステムコールは Intel プロセッサ上の Linux に固有のものであり、 移植性が必要なプログラムで使うべきでない。 .SH 注意 -.\"O These system calls are gone; -.\"O they existed only in Linux 2.5.36 through to 2.5.54. -.\"O Now the hugetlbfs file system can be used instead. -.\"O Memory backed by huge pages (if the CPU supports them) is obtained by -.\"O using -.\"O .BR mmap (2) -.\"O to map files in this virtual file system. -これらのシステムコールはなくなった。 -これらは Linux 2.5.36 から 2.5.54 にのみ存在する。 -代わりに今は hugetlbfs ファイルシステムを使うことができる。 -(CPU がサポートしている場合) ヒュージページを持つメモリは、 -.BR mmap (2) +これらのシステムコールはなくなった。 これらは Linux 2.5.36 から 2.5.54 にのみ存在する。 代わりに今は hugetlbfs +ファイルシステムを使うことができる。 (CPU がサポートしている場合) ヒュージページを持つメモリは、 \fBmmap\fP(2) を使ってこの仮想ファイルシステムでファイルをマップすることで取得できる。 .LP -.\"O The maximal number of huge pages can be specified using the -.\"O .B hugepages= -.\"O boot parameter. -ヒュージページの最大数は、 -.B hugepages= -起動パラメータを使って指定できる。 -.\"O -.\"O .\" requires CONFIG_HUGETLB_PAGE (under "Processor type and features") -.\"O .\" and CONFIG_HUGETLBFS (under "Filesystems"). -.\" ("Processor type and features" 以下の) CONFIG_HUGETLB_PAGE -.\" ("Filesystems" 以下の).CONFIG_HUGETLBFS が必要である。 +ヒュージページの最大数は、 \fBhugepages=\fP 起動パラメータを使って指定できる。 + +.\" requires CONFIG_HUGETLB_PAGE (under "Processor type and features") +.\" and CONFIG_HUGETLBFS (under "Filesystems"). .\" mount -t hugetlbfs hugetlbfs /huge .\" SHM_HUGETLB diff --git a/draft/man2/bind.2 b/draft/man2/bind.2 index 56ececd9..a689001f 100644 --- a/draft/man2/bind.2 +++ b/draft/man2/bind.2 @@ -63,147 +63,37 @@ .\" $Id: bind.2,v 1.3 1999/04/23 19:56:07 freitag Exp $ .\" Modified 2004-06-23 by Michael Kerrisk .\" -.\" Japanese Version Copyright (c) 1996 Yosiaki Yanagihara -.\" all rights reserved. -.\" Translated 1996-06-25, Yosiaki Yanagihara -.\" Modified 1997-11-06, HANATAKA Shinya -.\" Modified 1999-08-02, HANATAKA Shinya -.\" Updated 2005-02-03, Yuichi SATO -.\" Updated 2005-12-26, Akihiro MOTOKI -.\" Updated 2006-07-19, Akihiro MOTOKI , LDP v2.36 -.\" Updated 2007-06-13, Akihiro MOTOKI , LDP v2.55 -.\" Updated 2008-02-10, Akihiro MOTOKI , LDP v2.77 +.\"******************************************************************* .\" -.TH BIND 2 2007-12-28 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH BIND 2 2007\-12\-28 Linux "Linux Programmer's Manual" .SH 名前 -.\"O bind \- bind a name to a socket bind \- ソケットに名前をつける -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .BR "#include " " /* See NOTES */" -.BR "#include " " /* 「注意」参照 */" -.B #include +\fB#include \fP /* 「注意」参照 */ +\fB#include \fP .sp -.BI "int bind(int " sockfd ", const struct sockaddr *" addr , -.BI " socklen_t " addrlen ); +\fBint bind(int \fP\fIsockfd\fP\fB, const struct sockaddr *\fP\fIaddr\fP\fB,\fP +\fB socklen_t \fP\fIaddrlen\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O When a socket is created with -.\"O .BR socket (2), -.\"O it exists in a name space (address family) but has no address assigned to it. -.\"O .BR bind () -.\"O assigns the address specified to by -.\"O .I addr -.\"O to the socket referred to by the file descriptor -.\"O .IR sockfd . -.\"O .I addrlen -.\"O specifies the size, in bytes, of the address structure pointed to by -.\"O .IR addr . -.\"O Traditionally, this operation is called \(lqassigning a name to a socket\(rq. -.BR socket (2) -でソケットが作成されたとき、そのソケットは名前空間 (アドレス・ファミリー) に -存在するが、アドレスは割り当てられていない。 -.BR bind () -は、ファイルディスクリプタ -.I sockfd -で参照されるソケットに -.I addr -で指定されたアドレスを割り当てる。 -.I addrlen -には -.I addr -が指すアドレス構造体のサイズをバイト単位で指定する。 -伝統的にこの操作は -「ソケットに名前をつける」 -と呼ばれる。 +\fBsocket\fP(2) でソケットが作成されたとき、そのソケットは名前空間 (アドレス・ファミリー) に +存在するが、アドレスは割り当てられていない。 \fBbind\fP() は、ファイルディスクリプタ \fIsockfd\fP で参照されるソケットに +\fIaddr\fP で指定されたアドレスを割り当てる。 \fIaddrlen\fP には \fIaddr\fP が指すアドレス構造体のサイズをバイト単位で指定する。 +伝統的にこの操作は 「ソケットに名前をつける」 と呼ばれる。 .PP -.\"O It is normally necessary to assign a local address using -.\"O .BR bind () -.\"O before a -.\"O .B SOCK_STREAM -.\"O socket may receive connections (see -.\"O .BR accept (2)). -.B SOCK_STREAM -ソケットが接続を受け付けられるようにするには -.RB ( accept (2) -を参照)、通常その前に -.BR bind () +\fBSOCK_STREAM\fP ソケットが接続を受け付けられるようにするには (\fBaccept\fP(2) を参照)、通常その前に \fBbind\fP() を使用してローカルアドレスを割り当てる必要がある。 -.\"O The rules used in name binding vary between address families. -.\"O Consult the manual entries in Section 7 for detailed information. -.\"O For -.\"O .B AF_INET -.\"O see -.\"O .BR ip (7), -名前付けのルールはアドレス・ファミリーごとに異なっている。詳細な情報は -第 7 章の各マニュアルを参照すること。 -.B AF_INET -は -.BR ip (7) -を、 -.\"O for -.\"O .B AF_INET6 -.\"O see -.\"O .BR ipv6 (7), -.B AF_INET6 -は -.BR ipv6 (7) -を、 -.\"O for -.\"O .B AF_UNIX -.\"O see -.\"O .BR unix (7), -.B AF_UNIX -は -.BR unix (7) -を、 -.\"O for -.\"O .B AF_APPLETALK -.\"O see -.\"O .BR ddp (7), -.B AF_APPLETALK -は -.BR ddp (7) -を、 -.\"O for -.\"O .B AF_PACKET -.\"O see -.\"O .BR packet (7), -.B AF_PACKET -は -.BR packet (7) -を、 -.\"O for -.\"O .B AF_X25 -.\"O see -.\"O .BR x25 (7) -.B AF_X25 -は -.BR x25 (7) -を、 -.\"O and for -.\"O .B AF_NETLINK -.\"O see -.\"O .BR netlink (7). -.B AF_NETLINK -は -.BR netlink (7) -を参照。 +名前付けのルールはアドレス・ファミリーごとに異なっている。詳細な情報は 第 7 章の各マニュアルを参照すること。 \fBAF_INET\fP は +\fBip\fP(7) を、 \fBAF_INET6\fP は \fBipv6\fP(7) を、 \fBAF_UNIX\fP は \fBunix\fP(7) を、 +\fBAF_APPLETALK\fP は \fBddp\fP(7) を、 \fBAF_PACKET\fP は \fBpacket\fP(7) を、 \fBAF_X25\fP は +\fBx25\fP(7) を、 \fBAF_NETLINK\fP は \fBnetlink\fP(7) を参照。 -.\"O The actual structure passed for the -.\"O .I addr -.\"O argument will depend on the address family. -.\"O The -.\"O .I sockaddr -.\"O structure is defined as something like: -.I addr -引き数に実際にどのような構造体が渡されるかは、 -アドレス・ファミリーに依存する。 -.I sockaddr +\fIaddr\fP 引き数に実際にどのような構造体が渡されるかは、 アドレス・ファミリーに依存する。 \fIsockaddr\fP 構造体は以下のような感じで定義されている: .in +4n .nf @@ -215,206 +105,87 @@ struct sockaddr { .fi .in -.\"O The only purpose of this structure is to cast the structure -.\"O pointer passed in -.\"O .I addr -.\"O in order to avoid compiler warnings. -.\"O See EXAMPLE below. -この構造体は、 -.I addr -に渡される構造体へのポインタをキャストし、 -コンパイラの警告メッセージを抑えるためだけに存在する。 -下記の「例」を参照。 -.\"O .SH "RETURN VALUE" +この構造体は、 \fIaddr\fP に渡される構造体へのポインタをキャストし、 コンパイラの警告メッセージを抑えるためだけに存在する。 下記の「例」を参照。 .SH 返り値 -.\"O On success, zero is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功すると 0 を返す。 -失敗すると \-1 を返し、 -.I errno -を適切に設定する。 -.\"O .SH ERRORS +成功した場合にはゼロが返される。エラー時には \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP -.B EACCES +.TP +\fBEACCES\fP .\" e.g., privileged port in AF_INET domain -.\"O The address is protected, and the user is not the superuser. そのアドレスは保護されていて、かつユーザがスーパーユーザではない。 -.TP -.B EADDRINUSE -.\"O The given address is already in use. +.TP +\fBEADDRINUSE\fP 指定されたアドレスが既に使用中である。 -.TP -.B EBADF -.\"O .I sockfd -.\"O is not a valid descriptor. -.I sockfd -が不正なディスクリプタである。 -.TP -.B EINVAL -.\"O The socket is already bound to an address. -.\"O .\" This may change in the future: see -.\"O .\" .I linux/unix/sock.c for details. +.TP +\fBEBADF\fP +\fIsockfd\fP が不正なディスクリプタである。 +.TP +\fBEINVAL\fP +.\" This may change in the future: see +.\" .I linux/unix/sock.c for details. ソケットがすでにアドレスに結びつけ (bind) られている。 -.\" これは将来変更されるかもしれない。 -.\" 詳しくは -.\" .I linux/unix/sock.c -.\" を参照すること。 -.B ENOTSOCK -.\"O .I sockfd -.\"O is a descriptor for a file, not a socket. -.I sockfd -がファイルに対するディスクリプタで、ソケットに対するものではない。 +.TP +\fBENOTSOCK\fP +\fIsockfd\fP がファイルに対するディスクリプタで、ソケットに対するものではない。 .PP -.\"O The following errors are specific to UNIX domain -.\"O .RB ( AF_UNIX ) -.\"O sockets: -以下のエラーは UNIXドメイン -.RB ( AF_UNIX ) -のソケット特有である: -.TP -.B EACCES -.\"O Search permission is denied on a component of the path prefix. -.\"O (See also -.\"O .BR path_resolution (7).) -パス名の構成要素に検索許可 (search permission) がない -.RB ( path_resolution (7) -も参照すること)。 -.TP -.B EADDRNOTAVAIL -.\"O A nonexistent interface was requested or the requested -.\"O address was not local. -存在しないインタフェースが要求されたか、要求されたアドレスが -ローカルではなかった。 -.TP -.B EFAULT -.\"O .I addr -.\"O points outside the user's accessible address space. -.I addr -がユーザのアクセス可能なアドレス空間の外を指している。 -.TP -.B EINVAL -.\"O The -.\"O .I addrlen -.\"O is wrong, or the socket was not in the -.\"O .B AF_UNIX -.\"O family. -.I addrlen -が不正であるか、ソケットが -.B AF_UNIX -ファミリーではない。 -.TP -.B ELOOP -.\"O Too many symbolic links were encountered in resolving -.\"O .IR addr . -.I addr -を解決する際に遭遇したシンボリック・リンクが多過ぎる。 -.TP -.B ENAMETOOLONG -.\"O .I addr -.\"O is too long. -.I addr -が長過ぎる。 -.TP -.B ENOENT -.\"O The file does not exist. +以下のエラーは UNIXドメイン (\fBAF_UNIX\fP) のソケット特有である: +.TP +\fBEACCES\fP +パス名の構成要素に検索許可 (search permission) がない (\fBpath_resolution\fP(7) も参照すること)。 +.TP +\fBEADDRNOTAVAIL\fP +存在しないインタフェースが要求されたか、要求されたアドレスが ローカルではなかった。 +.TP +\fBEFAULT\fP +\fIaddr\fP がユーザのアクセス可能なアドレス空間の外を指している。 +.TP +\fBEINVAL\fP +\fIaddrlen\fP が不正であるか、ソケットが \fBAF_UNIX\fP ファミリーではない。 +.TP +\fBELOOP\fP +\fIaddr\fP を解決する際に遭遇したシンボリック・リンクが多過ぎる。 +.TP +\fBENAMETOOLONG\fP +\fIaddr\fP が長過ぎる。 +.TP +\fBENOENT\fP ファイルが存在しない。 -.TP -.B ENOMEM -.\"O Insufficient kernel memory was available. +.TP +\fBENOMEM\fP カーネルに、利用可能なメモリーが十分にない。 -.TP -.B ENOTDIR -.\"O A component of the path prefix is not a directory. +.TP +\fBENOTDIR\fP パス名の構成要素がディレクトリではない。 -.TP -.B EROFS -.\"O The socket inode would reside on a read-only file system. +.TP +\fBEROFS\fP ソケット inode が読み込み専用のファイルシステム上にある。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O SVr4, 4.4BSD, POSIX.1-2001 -.\"O .RB ( bind () -.\"O first appeared in 4.2BSD). -.\"O .\" SVr4 documents an additional -.\"O .\" .B ENOSR -.\"O .\" general error condition, and -.\"O .\" additional -.\"O .\" .B EIO -.\"O .\" and -.\"O .\" .B EISDIR -.\"O .\" UNIX-domain error conditions. -SVr4, 4.4BSD, POSIX.1-2001 -.RB ( bind () -は 4.2BSD で最初に現われた)。 -.\" SVr4 には他に、一般のエラー状態 +.\" SVr4 documents an additional .\" .B ENOSR -.\" 及び UNIX ドメインのエラー状態 -.\" .BR EIO , +.\" general error condition, and +.\" additional +.\" .B EIO +.\" and .\" .B EISDIR -.\" についての記述がある。 -.\"O .SH NOTES +.\" UNIX-domain error conditions. +SVr4, 4.4BSD, POSIX.1\-2001 (\fBbind\fP() は 4.2BSD で最初に現われた)。 .SH 注意 -.\"O POSIX.1-2001 does not require the inclusion of -.\"O .IR , -.\"O and this header file is not required on Linux. -.\"O However, some historical (BSD) implementations required this header -.\"O file, and portable applications are probably wise to include it. -POSIX.1-2001 では -.I -のインクルードは必須とされておらず、 -Linux ではこのヘッダファイルは必要ではない。 -しかし、歴史的には、いくつかの実装 (BSD 系) でこのヘッダファイルが -必要であり、移植性が必要なアプリケーションではこのファイルを -インクルードするのが賢明であろう。 +POSIX.1\-2001 では \fI\fP のインクルードは必須とされておらず、 Linux +ではこのヘッダファイルは必要ではない。 しかし、歴史的には、いくつかの実装 (BSD 系) でこのヘッダファイルが +必要であり、移植性が必要なアプリケーションではこのファイルを インクルードするのが賢明であろう。 -.\"O The third argument of -.\"O .BR bind () -.\"O is in reality an -.\"O .I int -.\"O (and this is what 4.x BSD and libc4 and libc5 have). -.\"O Some POSIX confusion resulted in the present -.\"O .IR socklen_t , -.\"O also used by glibc. -.\"O See also -.\"O .BR accept (2). -.BR bind () -の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際には -.I int -である。glibc でも使われている現在の -.I socklen_t -に関して、POSIX には少し混乱がある。 -詳しくは -.BR accept (2) -を参照のこと。 -.\"O .SH BUGS +\fBbind\fP() の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際には \fIint\fP である。glibc +でも使われている現在の \fIsocklen_t\fP に関して、POSIX には少し混乱がある。 詳しくは \fBaccept\fP(2) を参照のこと。 .SH バグ -.\"O The transparent proxy options are not described. -透過的プロキシ (transparent proxy) オプションについて記述していない。 .\" FIXME What *are* transparent proxy options? -.\"O .SH EXAMPLE +透過的プロキシ (transparent proxy) オプションについて記述していない。 .SH 例 -.\"O An example of the use of -.\"O .BR bind () -.\"O with Internet domain sockets can be found in -.\"O .BR getaddrinfo (3). -インターネット・ドメイン・ソケットでの -.BR bind () -の利用例が -.BR getaddrinfo (3) -に記載されている。 +インターネット・ドメイン・ソケットでの \fBbind\fP() の利用例が \fBgetaddrinfo\fP(3) に記載されている。 -.\"O The following example shows how to bind a stream socket in the UNIX -.\"O .RB ( AF_UNIX ) -.\"O domain, and accept connections: -以下の例は、UNIX ドメイン -.RB ( AF_UNIX ) -でストリームソケットを bind する方法を示したものである。 .\" listen.7 refers to this example. .\" accept.7 refers to this example. .\" unix.7 refers to this example. +以下の例は、UNIX ドメイン (\fBAF_UNIX\fP) でストリームソケットを bind する方法を示したものである。 .nf #include @@ -426,7 +197,7 @@ Linux ではこのヘッダファイルは必要ではない。 #define MY_SOCK_PATH "/somepath" #define LISTEN_BACKLOG 50 -#define handle_error(msg) \\ +#define handle_error(msg) \e do { perror(msg); exit(EXIT_FAILURE); } while (0) int @@ -449,7 +220,7 @@ main(int argc, char *argv[]) if (bind(sfd, (struct sockaddr *) &my_addr, sizeof(struct sockaddr_un)) == \-1) handle_error("bind"); - + if (listen(sfd, LISTEN_BACKLOG) == \-1) handle_error("listen"); @@ -468,17 +239,7 @@ main(int argc, char *argv[]) should be deleted using unlink(2) or remove(3) */ } .fi -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR accept (2), -.BR connect (2), -.BR getsockname (2), -.BR listen (2), -.BR socket (2), -.BR getaddrinfo (3), -.BR getifaddrs (3), -.BR ip (7), -.BR ipv6 (7), -.BR path_resolution (7), -.BR socket (7), -.BR unix (7) +\fBaccept\fP(2), \fBconnect\fP(2), \fBgetsockname\fP(2), \fBlisten\fP(2), \fBsocket\fP(2), +\fBgetaddrinfo\fP(3), \fBgetifaddrs\fP(3), \fBip\fP(7), \fBipv6\fP(7), +\fBpath_resolution\fP(7), \fBsocket\fP(7), \fBunix\fP(7) diff --git a/draft/man2/brk.2 b/draft/man2/brk.2 index c69bf4b5..63e7a91f 100644 --- a/draft/man2/brk.2 +++ b/draft/man2/brk.2 @@ -27,268 +27,89 @@ .\" Modified Wed Jul 21 19:52:58 1993 by Rik Faith .\" Modified Sun Aug 21 17:40:38 1994 by Rik Faith .\" -.\" Japanese Version Copyright (c) 1996 TABATA Tomohira -.\" all rights reserved. -.\" Translated Wed Jun 26 19:12:54 JST 1996 -.\" by TABATA Tomohira -.\" Modified Sat Dec 13 23:43:56 JST 1997 -.\" by HANATAKA Shinya -.\" Updated & Modified Wed May 19 01:55:29 JST 2004 -.\" by Yuichi SATO , LDP v1.66 -.\" Updated & Modified Tue Jan 2 09:09:47 JST 2007 by Yuichi SATO, LDP v2.43 -.\" Updated 2008-08-04, Akihiro MOTOKI , LDP v3.05 +.\"******************************************************************* .\" -.TH BRK 2 2010-09-20 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH BRK 2 2010\-09\-20 Linux "Linux Programmer's Manual" .SH 名前 -.\"O brk, sbrk \- change data segment size brk, sbrk \- データ・セグメントのサイズの変更する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int brk(void *" addr ); +\fBint brk(void *\fP\fIaddr\fP\fB);\fP .sp -.BI "void *sbrk(intptr_t " increment ); +\fBvoid *sbrk(intptr_t \fP\fIincrement\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR brk (), -.BR sbrk (): +\fBbrk\fP(), \fBsbrk\fP(): .ad l .RS 4 .PD 0 -.TP 4 -.\"O Since glibc 2.12: +.TP 4 glibc 2.12 以降: .nf _BSD_SOURCE || _SVID_SOURCE || (_XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) && !(_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600) +.TP 4 .fi -.TP 4 -.\"O Before glibc 2.12: -glibc 2.12 より前: -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || +glibc 2.12 より前: _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .PD .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR brk () -.\"O and -.\"O .BR sbrk () -.\"O change the location of the -.\"O .IR "program break" , -.\"O which defines the end of the process's data segment -.\"O (i.e., the program break is the first location after the end of the -.\"O uninitialized data segment). -.\"O Increasing the program break has the effect of -.\"O allocating memory to the process; -.\"O decreasing the break deallocates memory. -.BR brk () -と -.BR sbrk () -は -.I "プログラム・ブレーク (program break)" -の場所を変更する。 -プログラム・ブレークはプロセスのデータ・セグメント (data segment) の -末尾を示す (プログラム・ブレークは、初期化されていない -データ・セグメントの末尾の直後の場所となる)。 -プログラム・ブレークを増やすということは、そのプロセスへの -メモリを割り当てる効果があり、 -プログラム・ブレークを減らすということは、メモリを解放する -ということである。 +\fBbrk\fP() と \fBsbrk\fP() は \fIプログラム・ブレーク (program break)\fP の場所を変更する。 +プログラム・ブレークはプロセスのデータ・セグメント (data segment) の 末尾を示す (プログラム・ブレークは、初期化されていない +データ・セグメントの末尾の直後の場所となる)。 プログラム・ブレークを増やすということは、そのプロセスへの メモリを割り当てる効果があり、 +プログラム・ブレークを減らすということは、メモリを解放する ということである。 -.\"O .BR brk () -.\"O sets the end of the data segment to the value specified by -.\"O .IR addr , -.\"O when that value is reasonable, the system has enough memory, -.\"O and the process does not exceed its maximum data size (see -.\"O .BR setrlimit (2)). -.BR brk () -は、データ・セグメントの末尾を -.I addr -で指定した値に設定する。 -設定が行われるのは、指定した値が有効で、 -システムに十分なメモリがあり、 -プロセスのデータサイズの最大値を超えていない場合である -.RB ( setrlimit (2) -を参照)。 +\fBbrk\fP() は、データ・セグメントの末尾を \fIaddr\fP で指定した値に設定する。 設定が行われるのは、指定した値が有効で、 +システムに十分なメモリがあり、 プロセスのデータサイズの最大値を超えていない場合である (\fBsetrlimit\fP(2) を参照)。 -.\"O .BR sbrk () -.\"O increments the program's data space by -.\"O .I increment -.\"O bytes. -.BR sbrk () -は、プログラムのデータ空間を -.I increment -バイトだけ増やす。 -.\"O Calling -.\"O .BR sbrk () -.\"O with an -.\"O .I increment -.\"O of 0 can be used to find the current location of the program break. -.I increment -を 0 にして -.BR sbrk () -を呼び出すことで、プログラムの現在のブレーク (break) 場所を知ることができる。 -.\"O .SH "RETURN VALUE" +\fBsbrk\fP() は、プログラムのデータ空間を \fIincrement\fP バイトだけ増やす。 \fIincrement\fP を 0 にして +\fBsbrk\fP() を呼び出すことで、プログラムの現在のブレーク (break) 場所を知ることができる。 .SH 返り値 -.\"O On success, -.\"O .BR brk () -.\"O returns zero. -成功した場合、 -.BR brk () -は 0 を返す。 -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set to -.\"O .BR ENOMEM . -.\"O (But see \fILINUX NOTES\fP below.) -エラーの場合には、\-1 を返し、 -.I errno -に -.B ENOMEM -を設定する +成功した場合、 \fBbrk\fP() は 0 を返す。 エラーの場合には、\-1 を返し、 \fIerrno\fP に \fBENOMEM\fP を設定する (ただし「LINUX での注意」を参照すること)。 -.\"O On success, -.\"O .BR sbrk () -.\"O returns the previous program break. -.\"O (If the break was increased, -.\"O then this value is a pointer to the start of the newly allocated memory). -.\"O On error, -.\"O .I "(void\ *)\ \-1" -.\"O is returned, and -.\"O .I errno -.\"O is set to -.\"O .BR ENOMEM . -成功した場合、 -.BR sbrk () -は変更前のプログラム・ブレークを返す -(プログラム・ブレークが増やされた場合、この値は -新しく割り当てられたメモリの先頭を指すポインタとなる)。 -エラーの場合には、 -.I "(void\ *)\ \-1" -を返し、 -.I errno -に -.B ENOMEM -を設定する。 -.\"O .SH "CONFORMING TO" +成功した場合、 \fBsbrk\fP() は変更前のプログラム・ブレークを返す (プログラム・ブレークが増やされた場合、この値は +新しく割り当てられたメモリの先頭を指すポインタとなる)。 エラーの場合には、 \fI(void\ *)\ \-1\fP を返し、 \fIerrno\fP に +\fBENOMEM\fP を設定する。 .SH 準拠 -.\"O 4.3BSD; SUSv1, marked LEGACY in SUSv2, removed in POSIX.1-2001. -4.3BSD, SUSv1. -SUSv2 では「過去の名残 (LEGACY)」と位置付けられており、 -POSIX.1-2001 で削除された。 -.\"O .\" -.\"O .\" .BR brk () -.\"O .\" and -.\"O .\" .BR sbrk () -.\"O .\" are not defined in the C Standard and are deliberately excluded from the -.\"O .\" POSIX.1-1990 standard (see paragraphs B.1.1.1.3 and B.8.3.3). +.\" .\" .BR brk () -.\" と +.\" and .\" .BR sbrk () -.\" は C 規格 (C Standard) には定義されていない。 -.\" また POSIX.1 規格からは意図的に除外されている (段落 B.1.1.1.3, B.8.3.3 参照)。 -.\"O .SH NOTES +.\" are not defined in the C Standard and are deliberately excluded from the +.\" POSIX.1-1990 standard (see paragraphs B.1.1.1.3 and B.8.3.3). +4.3BSD, SUSv1. SUSv2 では「過去の名残 (LEGACY)」と位置付けられており、 POSIX.1\-2001 で削除された。 .SH 注意 -.\"O Avoid using -.\"O .BR brk () -.\"O and -.\"O .BR sbrk (): -.\"O the -.\"O .BR malloc (3) -.\"O memory allocation package is the -.\"O portable and comfortable way of allocating memory. -.BR brk () -や -.BR sbrk () -を使用するのは避けること。 -.BR malloc (3) -メモリ割り当てパッケージの方が、移植性が高く、 +\fBbrk\fP() や \fBsbrk\fP() を使用するのは避けること。 \fBmalloc\fP(3) メモリ割り当てパッケージの方が、移植性が高く、 使いやすいメモリ割り当て方法を提供している。 -.\"O Various systems use various types for the argument of -.\"O .BR sbrk (). -いろいろなシステムにおいて、 -.BR sbrk () -の引き数に様々な型が使われている。 -.\"O Common are \fIint\fP, \fIssize_t\fP, \fIptrdiff_t\fP, \fIintptr_t\fP. -一般的なのは \fIint\fP, \fIssize_t\fP, \fIptrdiff_t\fP, \fIintptr_t\fP である。 -.\"O .\" One sees -.\"O .\" \fIint\fP (e.g., XPGv4, DU 4.0, HP-UX 11, FreeBSD 4.0, OpenBSD 3.2), -.\"O .\" \fIssize_t\fP (OSF1 2.0, Irix 5.3, 6.5), -.\"O .\" \fIptrdiff_t\fP (libc4, libc5, ulibc, glibc 2.0, 2.1), -.\"O .\" \fIintptr_t\fP (e.g., XPGv5, AIX, SunOS 5.8, 5.9, FreeBSD 4.7, NetBSD 1.6, -.\"O .\" Tru64 5.1, glibc2.2). -.\" \fIint\fP (たとえば XPGv4, DU 4.0, HP-UX 11, FreeBSD 4.0, OpenBSD 3.2), +.\" One sees +.\" \fIint\fP (e.g., XPGv4, DU 4.0, HP-UX 11, FreeBSD 4.0, OpenBSD 3.2), .\" \fIssize_t\fP (OSF1 2.0, Irix 5.3, 6.5), .\" \fIptrdiff_t\fP (libc4, libc5, ulibc, glibc 2.0, 2.1), -.\" \fIintptr_t\fP (たとえば XPGv5, AIX, SunOS 5.8, 5.9, FreeBSD 4.7, -.\" NetBSD 1.6, Tru64 5.1, glibc2.2). -.\" というのが分かるだろう。 -.\"O .SS Linux Notes -.SS Linux での注意 -.\"O The return value described above for -.\"O .BR brk () -.\"O is the behavior provided by the glibc wrapper function for the Linux -.\"O .BR brk () -.\"O system call. -上で説明した -.BR brk () -の返り値についての動作は、 -Linux の -.BR brk () -システムコールをラップする glibc の関数によるものである。 -.\"O (On most other implementations, the return value from -.\"O .BR brk () -.\"O is the same; this return value was also specified in SUSv2.) -(その他の多くの実装でも、 -.BR brk () -の返り値はこれと同じである。 -この返り値は SUSv2 でも規定されている。) -.\"O However, -.\"O the actual Linux system call returns the new program break on success. -しかし、実際の Linux システムコールは、成功した場合、 -プログラムの新しいブレークを返す。 -.\"O On failure, the system call returns the current break. -失敗した場合、このシステムコールは現在のブレークを返す。 -.\"O The glibc wrapper function does some work -.\"O (i.e., checks whether the new break is less than -.\"O .IR addr ) -.\"O to provide the 0 and \-1 return values described above. -glibc ラッパー関数は同様の働きをし -(すなわち、新しいブレークが -.I addr -より小さいかどうかをチェックし)、 -上で説明した 0 と \-1 という返り値を返す。 +.\" \fIintptr_t\fP (e.g., XPGv5, AIX, SunOS 5.8, 5.9, FreeBSD 4.7, NetBSD 1.6, +.\" Tru64 5.1, glibc2.2). +いろいろなシステムにおいて、 \fBsbrk\fP() の引き数に様々な型が使われている。 一般的なのは \fIint\fP, \fIssize_t\fP, +\fIptrdiff_t\fP, \fIintptr_t\fP である。 +.SS "Linux での注意" +上で説明した \fBbrk\fP() の返り値についての動作は、 Linux の \fBbrk\fP() システムコールをラップする glibc +の関数によるものである。 (その他の多くの実装でも、 \fBbrk\fP() の返り値はこれと同じである。 この返り値は SUSv2 でも規定されている。) +しかし、実際の Linux システムコールは、成功した場合、 プログラムの新しいブレークを返す。 +失敗した場合、このシステムコールは現在のブレークを返す。 glibc ラッパー関数は同様の働きをし (すなわち、新しいブレークが \fIaddr\fP +より小さいかどうかをチェックし)、 上で説明した 0 と \-1 という返り値を返す。 -.\"O On Linux, -.\"O .BR sbrk () -.\"O is implemented as a library function that uses the -.\"O .BR brk () -.\"O system call, and does some internal bookkeeping so that it can -.\"O return the old break value. -Linux では -.BR sbrk () -は -.BR brk () -システムコールを使うライブラリ関数として実装されており、 +Linux では \fBsbrk\fP() は \fBbrk\fP() システムコールを使うライブラリ関数として実装されており、 以前のブレークの値を返すことができるように内部で調整が行われている。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR execve (2), -.BR getrlimit (2), -.BR end (3), -.BR malloc (3) +\fBexecve\fP(2), \fBgetrlimit\fP(2), \fBend\fP(3), \fBmalloc\fP(3) diff --git a/draft/man2/cacheflush.2 b/draft/man2/cacheflush.2 index d3f2bcda..86b2ea26 100644 --- a/draft/man2/cacheflush.2 +++ b/draft/man2/cacheflush.2 @@ -21,121 +21,47 @@ .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, .\" USA. .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Sat Feb 22 20:07:45 JST 1997 -.\" by HANATAKA Shinya -.\" Updated 2007-06-13, Akihiro MOTOKI , LDP v2.55 +.\"******************************************************************* .\" -.\"WORD: instruction cache 命令キャッシュ -.\"WORD: data cache データキャッシュ -.\"WORD: flush フラッシュ +.\" This file was generated with po4a. Translate the source file. .\" -.TH CACHEFLUSH 2 2007-05-26 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH CACHEFLUSH 2 2007\-05\-26 Linux "Linux Programmer's Manual" .SH 名前 -.\"O cacheflush \- flush contents of instruction and/or data cache cacheflush \- 命令キャッシュやデータキャッシュの内容をフラッシュする -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int cacheflush(char *" addr ", int "nbytes ", int "cache ); +\fBint cacheflush(char *\fP\fIaddr\fP\fB, int \fP\fInbytes\fP\fB, int \fP\fIcache\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR cacheflush () -.\"O flushes the contents of the indicated cache(s) for the -.\"O user addresses in the range -.\"O .I addr -.\"O to -.\"O .IR (addr+nbytes-1) . -.\"O .I cache -.\"O may be one of: -.BR cacheflush () -は -.I addr -から -.I (addr+nbytes-1) -の範囲のユーザアドレスに対応する -指定されたキャッシュをフラッシュする。 -.I cache -には以下のいずれかを指定する: -.TP -.B ICACHE -.\"O Flush the instruction cache. +\fBcacheflush\fP() は \fIaddr\fP から \fI(addr+nbytes\-1)\fP の範囲のユーザアドレスに対応する +指定されたキャッシュをフラッシュする。 \fIcache\fP には以下のいずれかを指定する: +.TP +\fBICACHE\fP 命令 (instruction) キャッシュをフラッシュする。 -.TP -.B DCACHE -.\"O Write back to memory and invalidate the affected valid cache lines. +.TP +\fBDCACHE\fP 変更があったキャッシュラインをメモリに書き戻し、無効にする。 -.TP -.B BCACHE -.\"O Same as -.\"O .BR (ICACHE|DCACHE) . -.B (ICACHE|DCACHE) -と同じ。 -.\"O .SH "RETURN VALUE" +.TP +\fBBCACHE\fP +\fB(ICACHE|DCACHE)\fP と同じ。 .SH 返り値 -.\"O .BR cacheflush () -.\"O returns 0 on success or \-1 on error. -.\"O If errors are detected, -.\"O .I errno -.\"O will indicate the error. -.BR cacheflush () -は成功した場合は 0 を、失敗した場合は \-1 を返す。エラーが検出された場合は -.I errno +\fBcacheflush\fP() は成功した場合は 0 を、失敗した場合は \-1 を返す。エラーが検出された場合は \fIerrno\fP にエラーが指示される。 -.\"O .SH ERRORS .SH エラー -.TP -.B EFAULT -.\"O Some or all of the address range -.\"O .I addr -.\"O to -.\"O .I (addr+nbytes-1) -.\"O is not accessible. -.I addr -から -.I (addr+nbytes-1) -の範囲のアドレスの全てまたは一部が -アクセス可能ではない。 -.TP -.B EINVAL -.\"O .I cache -.\"O is not one of -.\"O .BR ICACHE , -.\"O .BR DCACHE , -.\"O or -.\"O .BR BCACHE . -.I cache -パラメータが -.BR ICACHE , -.BR DCACHE , -.B BCACHE -のどれでもない。 -.\"O .SH CONFORMING TO +.TP +\fBEFAULT\fP +\fIaddr\fP から \fI(addr+nbytes\-1)\fP の範囲のアドレスの全てまたは一部が アクセス可能ではない。 +.TP +\fBEINVAL\fP +\fIcache\fP パラメータが \fBICACHE\fP, \fBDCACHE\fP, \fBBCACHE\fP のどれでもない。 .SH 準拠 -.\"O This Linux-specific system call is only available on MIPS-based systems. -この Linux 特有のシステムコールは MIPS ベースのシステムでのみ有効である。 .\" FIXME This system call was only on MIPS back in 1.2 days, but .\" by now it is on a number of other architectures (but not i386). .\" Investigate the details and update this page. -.\"O It should not be used in programs intended to be portable. -移植を意図したプログラムで使用すべきではない。 .\" Irix 6.5 appears to have a cacheflush() syscall -- mtk -.\"O .SH BUGS +この Linux 特有のシステムコールは MIPS ベースのシステムでのみ有効である。 移植を意図したプログラムで使用すべきではない。 .SH バグ -.\"O The current implementation ignores the -.\"O .I addr -.\"O and -.\"O .I nbytes -.\"O arguments. -.\"O Therefore, the whole cache is always flushed. -現在の実装では、引き数 -.I addr -と -.I nbytes -は無視される。そのため、 -常に全てのキャッシュがフラッシュされる。 +現在の実装では、引き数 \fIaddr\fP と \fInbytes\fP は無視される。そのため、 常に全てのキャッシュがフラッシュされる。 diff --git a/draft/man2/chdir.2 b/draft/man2/chdir.2 index 010ded2d..08e53927 100644 --- a/draft/man2/chdir.2 +++ b/draft/man2/chdir.2 @@ -30,192 +30,83 @@ .\" Modified 1997-08-21 by Joseph S. Myers .\" Modified 2004-06-23 by Michael Kerrisk .\" -.\" Japanese Version Copyright (c) 1996 Yosiaki Yanagihara -.\" all rights reserved. -.\" Translated 1996-06-24, Yosiaki Yanagihara -.\" Modified 1997-12-13, HANATAKA Shinya -.\" Updated & Modified 2005-02-05, Yuichi SATO -.\" Updated 2006-08-12, Akihiro MOTOKI , LDP v2.39 -.\" Updated 2007-09-04, Akihiro MOTOKI , LDP v2.64 +.\"******************************************************************* .\" -.TH CHDIR 2 2010-09-26 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH CHDIR 2 2010\-11\-25 Linux "Linux Programmer's Manual" .SH 名前 -.\"O chdir, fchdir \- change working directory chdir, fchdir \- 作業ディレクトリの変更 -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int chdir(const char *" path ); +\fBint chdir(const char *\fP\fIpath\fP\fB);\fP .br -.BI "int fchdir(int " fd ); +\fBint fchdir(int \fP\fIfd\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR fchdir (): +\fBfchdir\fP(): .PD 0 .ad l .RS 4 -_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .br -.\"O || /* Since glibc 2.12: */ _POSIX_C_SOURCE\ >=\ 200809L || /* glibc 2.12 以降: */ _POSIX_C_SOURCE\ >=\ 200809L .RE .ad .PD -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR chdir () -.\"O changes the current working directory of the calling process to the -.\"O directory specified in -.\"O .IR path . -.BR chdir () -は、呼び出し元プロセスの現在の作業ディレクトリ (current working directory) を、 -.I path +\fBchdir\fP() は、呼び出し元プロセスの現在の作業ディレクトリ (current working directory) を、 \fIpath\fP に指定されたディレクトリに変更する。 .PP -.\"O .BR fchdir () -.\"O is identical to -.\"O .BR chdir (); -.\"O the only difference is that the directory is given as an -.\"O open file descriptor. -.BR fchdir () -は、ディレクトリがオープンされたファイル・ディスクリプターとして -指定される以外は、 -.BR chdir () -と同じである。 -.\"O .SH "RETURN VALUE" +\fBfchdir\fP() は、ディレクトリがオープンされたファイル・ディスクリプターとして 指定される以外は、 \fBchdir\fP() と同じである。 .SH 返り値 -.\"O On success, zero is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功すると、0 を返す。失敗すると、\-1 を返し、 -.I errno -に適切な値をセットする。 -.\"O .SH ERRORS +成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.\"O Depending on the file system, other errors can be returned. -.\"O The more -.\"O general errors for -.\"O .BR chdir () -.\"O are listed below: -ファイルシステムによっては他のエラーが返される事がある。 -.BR chdir () -で一般的なエラーを以下に挙げる: -.TP -.B EACCES -.\"O Search permission is denied for one of the components of -.\"O .IR path . -.\"O (See also -.\"O .BR path_resolution (7).) -.I path -の構成要素のいずれかに検索許可 (search permission) がない -.RB ( path_resolution (7) +ファイルシステムによっては他のエラーが返される事がある。 \fBchdir\fP() で一般的なエラーを以下に挙げる: +.TP +\fBEACCES\fP +\fIpath\fP の構成要素のいずれかに検索許可 (search permission) がない (\fBpath_resolution\fP(7) も参照すること)。 -.TP -.B EFAULT -.\"O .I path -.\"O points outside your accessible address space. -割り当てられたアドレス空間外を -.I path -が指している。 -.TP -.B EIO -.\"O An I/O error occurred. +.TP +\fBEFAULT\fP +\fIpath\fP がアクセスできるアドレス空間外を指している。 +.TP +\fBEIO\fP I/O エラーが発生した。 -.TP -.B ELOOP -.\"O Too many symbolic links were encountered in resolving -.\"O .IR path . -.I path -を解決する際に遭遇したシンボリック・リンクが多過ぎる。 -.TP -.B ENAMETOOLONG -.\"O .I path -.\"O is too long. -.I path -が長過ぎる。 -.TP -.B ENOENT -.\"O The file does not exist. -.\"Osato: -.\"Osato: file ではなく directory の間違いか? -.\"Osato: -そのディレクトリは存在しない。 -.TP -.B ENOMEM -.\"O Insufficient kernel memory was available. +.TP +\fBELOOP\fP +\fIpath\fP を解決する際に遭遇したシンボリック・リンクが多過ぎる。 +.TP +\fBENAMETOOLONG\fP +\fIpath\fP が長過ぎる。 +.TP +\fBENOENT\fP +ファイルが存在しない。 +.TP +\fBENOMEM\fP カーネルに十分なメモリがない。 -.TP -.B ENOTDIR -.\"O A component of -.\"O .I path -.\"O is not a directory. -.I path -の構成要素がディレクトリではない。 +.TP +\fBENOTDIR\fP +\fIpath\fP の構成要素がディレクトリではない。 .PP -.\"O The general errors for -.\"O .BR fchdir () -.\"O are listed below: -.BR fchdir () -で一般的なエラーを以下に挙げる: -.TP -.B EACCES -.\"O Search permission was denied on the directory open on -.\"O .IR fd . -.I fd -をディレクトリとしてオープンするための検索許可がない。 -.TP -.B EBADF -.\"O .I fd -.\"O is not a valid file descriptor. -.I fd -が適切なファイル・ディスクリプターでない。 -.\"O .SH "CONFORMING TO" +\fBfchdir\fP() で一般的なエラーを以下に挙げる: +.TP +\fBEACCES\fP +\fIfd\fP をディレクトリとしてオープンするための検索許可がない。 +.TP +\fBEBADF\fP +\fIfd\fP が適切なファイル・ディスクリプターでない。 .SH 準拠 -SVr4, 4.4BSD, POSIX.1-2001. -.\"O .SH NOTES +SVr4, 4.4BSD, POSIX.1\-2001. .SH 注意 -.\"O The current working directory is the starting point for interpreting -.\"O relative pathnames (those not starting with \(aq/\(aq)). -現在の作業ディレクトリは、相対パス名 (\(aq/\(aq) で始まっていないパス名) を -解釈する際の開始点である。 +現在の作業ディレクトリは、相対パス名 (\(aq/\(aq) で始まっていないパス名) を 解釈する際の開始点である。 -.\"O A child process created via -.\"O .BR fork (2) -.\"O inherits its parent's current working directory. -.\"O The current working directory is left unchanged by -.\"O .BR execve (2). -.BR fork (2) -で作成された子プロセスは、親プロセスの現在の作業ディレクトリを -継承する。 -.BR execve (2) +\fBfork\fP(2) で作成された子プロセスは、親プロセスの現在の作業ディレクトリを 継承する。 \fBexecve\fP(2) の前後で、現在の作業ディレクトリは変更されない。 - -.\"O The prototype for -.\"O .BR fchdir () -.\"O is only available if -.\"O .B _BSD_SOURCE -.\"O is defined, or -.\"O .B _XOPEN_SOURCE -.\"O is defined with the value 500. -.BR fchdir () -のプロトタイプが有効になるのは、 -.B _BSD_SOURCE -を定義した場合か、 -.B _XOPEN_SOURCE -を値 500 で定義した場合のみである。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR chroot (2), -.BR getcwd (3), -.BR path_resolution (7) +\fBchroot\fP(2), \fBgetcwd\fP(3), \fBpath_resolution\fP(7) diff --git a/draft/man2/chmod.2 b/draft/man2/chmod.2 index fc9a2b40..826d33b5 100644 --- a/draft/man2/chmod.2 +++ b/draft/man2/chmod.2 @@ -28,329 +28,152 @@ .\" : NFS details .\" Modified 2004-06-23 by Michael Kerrisk .\" -.\" Japanese Version Copyright (c) 1996 Yosiaki Yanagihara -.\" all rights reserved. -.\" Translated 1996-06-24, Yosiaki Yanagihara -.\" Modified 1998-05-11, HANATAKA Shinya -.\" Updated & Modified 2001-06-25, Yuichi SATO -.\" Updated & Modified 2004-12-29, Yuichi SATO -.\" Updated 2008-08-09, Akihiro MOTOKI , LDP v3.05 +.\"******************************************************************* .\" -.TH CHMOD 2 2010-09-26 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH CHMOD 2 2010\-09\-26 Linux "Linux Programmer's Manual" .SH 名前 -.\"O chmod, fchmod \- change permissions of a file chmod, fchmod \- ファイルのモードを変更する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int chmod(const char *" path ", mode_t " mode ); +\fBint chmod(const char *\fP\fIpath\fP\fB, mode_t \fP\fImode\fP\fB);\fP .br -.BI "int fchmod(int " fd ", mode_t " mode ); +\fBint fchmod(int \fP\fIfd\fP\fB, mode_t \fP\fImode\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l .PD 0 -.BR fchmod (): +\fBfchmod\fP(): .RS 4 -_BSD_SOURCE || -_XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .br -.\"O || /* Since glibc 2.12: */ _POSIX_C_SOURCE\ >=\ 200809L || /* glibc 2.12 以降: */ _POSIX_C_SOURCE\ >=\ 200809L +.RE .PD .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O These system calls change the permissions of a file. -.\"O They differ only in how the file is specified: -これらのシステムコールはファイルのアクセス許可 (permission) を変更する。 -システムコール間の違いは、ファイルの指定の仕方だけである。 +これらのシステムコールはファイルのアクセス許可 (permission) を変更する。 システムコール間の違いは、ファイルの指定の仕方だけである。 .IP * 2 -.\"O .BR chmod () -.\"O changes the permissions of the file specified whose pathname is given in -.\"O .IR path , -.\"O which is dereferenced if it is a symbolic link. -.BR chmod () -は、 -.I path -で指定されたパス名を持つファイルの許可を変更する。 -.I path +\fBchmod\fP() は、 \fIpath\fP で指定されたパス名を持つファイルの許可を変更する。 \fIpath\fP がシンボリック・リンクの場合は、リンクの展開が行われる。 .IP * -.\"O .BR fchmod () -.\"O changes the permissions of the file referred to by the open file descriptor -.\"O .IR fd . -.BR fchmod () -は、オープンされたファイルディスクリプタ -.I fd -により参照されるファイルの許可を変更する。 +\fBfchmod\fP() は、オープンされたファイルディスクリプタ \fIfd\fP により参照されるファイルの許可を変更する。 .PP -.\"O The new file permissions are specified in -.\"O .IR mode , -.\"O which is a bit mask created by ORing together zero or -.\"O more of the following: -新しいファイル許可は -.I mode -で指定される。 -.I mode -は、以下に示す値の 0 個以上の OR (論理和) をとって作成される +新しいファイル許可は \fImode\fP で指定される。 \fImode\fP は、以下に示す値の 0 個以上の OR (論理和) をとって作成される ビットマスクである。 -.TP 18 -.BR S_ISUID " (04000)" -.\"O set-user-ID (set process effective user ID on -.\"O .BR execve (2)) -set-user-ID -.RB ( execve (2) -時にプロセスの実効ユーザ ID にセットされる) -.TP -.BR S_ISGID " (02000)" -.\"O set-group-ID (set process effective group ID on -.\"O .BR execve (2); -.\"O mandatory locking, as described in -.\"O .BR fcntl (2); -.\"O take a new file's group from parent directory, as described in -.\"O .BR chown (2) -.\"O and -.\"O .BR mkdir (2)) -set-group-ID -(以下の場合に -.RB ( execve (2) -実行時にプロセスの実効グループ ID にセットされる、 -強制ロック (mandatory locking) を行う -.RB ( fcntl (2) -の説明を参照)、 -新しいファイルのグループとして親ディレクトリと同じものを使う -.RB ( chown (2) -と -.BR ( mkdir (2) -の説明を参照) -.TP -.BR S_ISVTX " (01000)" -.\"O sticky bit (restricted deletion flag, as described in -.\"O .BR unlink (2)) -スティッキー・ビット (sticky bit) (削除制限フラグ、 -.BR unlink (2) -の説明を参照) -.TP -.BR S_IRUSR " (00400)" -.\"O read by owner +.TP 18 +\fBS_ISUID\fP (04000) +set\-user\-ID (\fBexecve\fP(2) 時にプロセスの実効ユーザ ID にセットされる) +.TP +\fBS_ISGID\fP (02000) +set\-group\-ID (以下の場合に (\fBexecve\fP(2) 実行時にプロセスの実効グループ ID にセットされる、 強制ロック +(mandatory locking) を行う (\fBfcntl\fP(2) の説明を参照)、 +新しいファイルのグループとして親ディレクトリと同じものを使う (\fBchown\fP(2) と \fB(\fPmkdir\fB(2)\fP の説明を参照) +.TP +\fBS_ISVTX\fP (01000) +スティッキー・ビット (sticky bit) (削除制限フラグ、 \fBunlink\fP(2) の説明を参照) +.TP +\fBS_IRUSR\fP (00400) 所有者による読み取り -.TP -.BR S_IWUSR " (00200)" -.\"O write by owner +.TP +\fBS_IWUSR\fP (00200) 所有者による書き込み -.TP -.BR S_IXUSR " (00100)" -.\"O execute/search by owner ("search" applies for directories, -.\"O and means that entries within the directory can be accessed) -所有者による実行 (execute) / 検索 (search) -(「検索」はディレクトリに対して適用されるもので、 +.TP +\fBS_IXUSR\fP (00100) +所有者による実行 (execute) / 検索 (search) (「検索」はディレクトリに対して適用されるもので、 そのディレクトリ内のエントリーへアクセスできるかを意味する) -.TP -.BR S_IRGRP " (00040)" -.\"O read by group +.TP +\fBS_IRGRP\fP (00040) グループによる読み取り -.TP -.BR S_IWGRP " (00020)" -.\"O write by group +.TP +\fBS_IWGRP\fP (00020) グループによる書き込み -.TP -.BR S_IXGRP " (00010)" -.\"O execute/search by group +.TP +\fBS_IXGRP\fP (00010) グループによる実行 / 検索 -.TP -.BR S_IROTH " (00004)" -.\"O read by others +.TP +\fBS_IROTH\fP (00004) 他人 (others) による読み取り -.TP -.BR S_IWOTH " (00002)" -.\"O write by others +.TP +\fBS_IWOTH\fP (00002) 他人による書き込み -.TP -.BR S_IXOTH " (00001)" -.\"O execute/search by others +.TP +\fBS_IXOTH\fP (00001) 他人による実行 / 検索 .PP -.\"O The effective UID of the calling process must match the owner of the file, -.\"O or the process must be privileged (Linux: it must have the -.\"O .B CAP_FOWNER -.\"O capability). -呼び出したプロセスの実効 (effective) UID がファイルの所有者と一致するか、 -そのプロセスが特権を持たなければならない -(Linux では -.B CAP_FOWNER -ケーパビリティ (capability) を持たなければならない)。 +呼び出したプロセスの実効 (effective) UID がファイルの所有者と一致するか、 そのプロセスが特権を持たなければならない (Linux では +\fBCAP_FOWNER\fP ケーパビリティ (capability) を持たなければならない)。 -.\"O If the calling process is not privileged (Linux: does not have the -.\"O .B CAP_FSETID -.\"O capability), and the group of the file does not match -.\"O the effective group ID of the process or one of its -.\"O supplementary group IDs, the -.\"O .B S_ISGID -.\"O bit will be turned off, -.\"O but this will not cause an error to be returned. -呼び出したプロセスに特権がなく (Linux では -.B CAP_FSETID -ケーパビリティがなく)、かつファイルのグループ ID が -プロセスの実効グループ ID または補助的なグループ ID にマッチしない場合、 -.B S_ISGID +呼び出したプロセスに特権がなく (Linux では \fBCAP_FSETID\fP ケーパビリティがなく)、かつファイルのグループ ID が +プロセスの実効グループ ID または補助的なグループ ID にマッチしない場合、 \fBS_ISGID\fP ビットはオフにされるが、これによってエラーが返されることはない。 -.\"O As a security measure, depending on the file system, -.\"O the set-user-ID and set-group-ID execution bits -.\"O may be turned off if a file is written. -安全のための処置として、 -ファイル・システムによっては、ファイルの書き込みを行う時に -セット・ユーザー ID とセット・グループ ID ビットと実行ビットが -オフにされることがある。 -.\"O (On Linux this occurs if the writing process does not have the -.\"O .B CAP_FSETID -.\"O capability.) -(Linux では、書き込みプロセスが -.B CAP_FSETID -ケーパビリティを持っていない場合に、これが起こる。) -.\"O On some file systems, only the superuser can set the sticky bit, -.\"O which may have a special meaning. -.\"O For the sticky bit, and for set-user-ID and set-group-ID bits on -.\"O directories, see -.\"O .BR stat (2). -ファイル・システムの中には、スーパー・ユーザーだけが -特別の意味を持つスティッキー・ビットを設定できるものがある。 -スティッキー・ビットとディレクトリに対する -セット・ユーザー (グループ)・ID ビットについては、 -.BR stat (2) -を見よ。 +安全のための処置として、 ファイル・システムによっては、ファイルの書き込みを行う時に セット・ユーザー ID とセット・グループ ID +ビットと実行ビットが オフにされることがある。 (Linux では、書き込みプロセスが \fBCAP_FSETID\fP +ケーパビリティを持っていない場合に、これが起こる。) ファイル・システムの中には、スーパー・ユーザーだけが +特別の意味を持つスティッキー・ビットを設定できるものがある。 スティッキー・ビットとディレクトリに対する セット・ユーザー (グループ)・ID +ビットについては、 \fBstat\fP(2) を見よ。 -.\"O On NFS file systems, restricting the permissions will immediately influence -.\"O already open files, because the access control is done on the server, but -.\"O open files are maintained by the client. -.\"O Widening the permissions may be -.\"O delayed for other clients if attribute caching is enabled on them. -NFS ファイルシステム上では、パーミッションを制限すると、 -既にオープンされているファイルに対してすぐに影響が及ぶ。 -これはアクセス制御がサーバー上で行われているが、 -オープンされているファイルはクライアント側で管理されているためである。 -クライアント側でファイル属性のキャッシュが有効になっている場合に、 -パーミッションの制限を緩くすると、 +NFS ファイルシステム上では、パーミッションを制限すると、 既にオープンされているファイルに対してすぐに影響が及ぶ。 +これはアクセス制御がサーバー上で行われているが、 オープンされているファイルはクライアント側で管理されているためである。 +クライアント側でファイル属性のキャッシュが有効になっている場合に、 パーミッションの制限を緩くすると、 他のクライアントに情報が伝わるのが遅れるかもしれない。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O On success, zero is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功すると、0 を返す。失敗すると、\-1を返し、 -.I errno -に適切な値を設定する。 -.\"O .SH ERRORS +成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.\"O Depending on the file system, other errors can be returned. -.\"O The more general errors for -.\"O .BR chmod () -.\"O are listed below: -ファイル・システムによっては他のエラーを返す場合がある。 -.BR chmod () -で一般的なエラーを以下に挙げる。 -.TP -.B EACCES -.\"O Search permission is denied on a component of the path prefix. -.\"O (See also -.\"O .BR path_resolution (7).) -パス名の構成要素に検索許可がない -.RB ( path_resolution (7) -も見よ)。 -.TP -.B EFAULT -.\"O .I path -.\"O points outside your accessible address space. -.I path -が割り当てられたアドレス空間外を指している。 -.TP -.B EIO -.\"O An I/O error occurred. +ファイル・システムによっては他のエラーを返す場合がある。 \fBchmod\fP() で一般的なエラーを以下に挙げる。 +.TP +\fBEACCES\fP +パス名の構成要素に検索許可がない (\fBpath_resolution\fP(7) も見よ)。 +.TP +\fBEFAULT\fP +\fIpath\fP がアクセスできるアドレス空間外を指している。 +.TP +\fBEIO\fP I/O エラーが発生した。 -.TP -.B ELOOP -.\"O Too many symbolic links were encountered in resolving -.\"O .IR path . -.I path -を解決する際に遭遇したシンボリック・リンクが多過ぎる。 -.TP -.B ENAMETOOLONG -.\"O .I path -.\"O is too long. -.I path -が長過ぎる。 -.TP -.B ENOENT -.\"O The file does not exist. +.TP +\fBELOOP\fP +\fIpath\fP を解決する際に遭遇したシンボリック・リンクが多過ぎる。 +.TP +\fBENAMETOOLONG\fP +\fIpath\fP が長過ぎる。 +.TP +\fBENOENT\fP ファイルが存在しない。 -.TP -.B ENOMEM -.\"O Insufficient kernel memory was available. +.TP +\fBENOMEM\fP カーネルに十分なメモリがない。 -.TP -.B ENOTDIR -.\"O A component of the path prefix is not a directory. +.TP +\fBENOTDIR\fP パス名の構成要素がディレクトリではない。 -.TP -.B EPERM -.\"O The effective UID does not match the owner of the file, -.\"O and the process is not privileged (Linux: it does not have the -.\"O .B CAP_FOWNER -.\"O capability). -実効 UID がファイルの所有者と一致せず、プロセスに特権がない -(Linux では -.B CAP_FOWNER -ケーパビリティを持たない)。 -.TP -.B EROFS -.\"O The named file resides on a read-only file system. +.TP +\fBEPERM\fP +実効 UID がファイルの所有者と一致せず、プロセスに特権がない (Linux では \fBCAP_FOWNER\fP ケーパビリティを持たない)。 +.TP +\fBEROFS\fP ファイルが読み込み専用 (read only) のファイル・システム上にある。 .PP -.\"O The general errors for -.\"O .BR fchmod () -.\"O are listed below: -.BR fchmod () -で一般的なエラーを挙げる: -.TP -.B EBADF -.\"O The file descriptor -.\"O .I fd -.\"O is not valid. -ファイル・ディスクリプター -.I fd -が有効でない。 -.TP -.B EIO -.\"O See above. +\fBfchmod\fP() で一般的なエラーを挙げる: +.TP +\fBEBADF\fP +ファイル・ディスクリプター \fIfd\fP が有効でない。 +.TP +\fBEIO\fP 上記を参照。 -.TP -.B EPERM -.\"O See above. +.TP +\fBEPERM\fP 上記を参照。 -.TP -.B EROFS -.\"O See above. +.TP +\fBEROFS\fP 上記を参照。 -.\"O .SH "CONFORMING TO" .SH 準拠 -4.4BSD, SVr4, POSIX.1-2001. -.\"O .SH "SEE ALSO" +4.4BSD, SVr4, POSIX.1\-2001. .SH 関連項目 -.BR chown (2), -.BR execve (2), -.BR fchmodat (2), -.BR open (2), -.BR stat (2), -.BR path_resolution (7) +\fBchown\fP(2), \fBexecve\fP(2), \fBfchmodat\fP(2), \fBopen\fP(2), \fBstat\fP(2), +\fBpath_resolution\fP(7) diff --git a/draft/man2/chown.2 b/draft/man2/chown.2 deleted file mode 100644 index ae0b99b0..00000000 --- a/draft/man2/chown.2 +++ /dev/null @@ -1,512 +0,0 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992 -.\" and Copyright (c) 1998 Andries Brouwer (aeb@cwi.nl) -.\" and Copyright (c) 2007, 2008 Michael Kerrisk -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" Modified by Michael Haardt -.\" Modified 1993-07-21 by Rik Faith -.\" Modified 1996-07-09 by Andries Brouwer -.\" Modified 1996-11-06 by Eric S. Raymond -.\" Modified 1997-05-18 by Michael Haardt -.\" Modified 2004-06-23 by Michael Kerrisk -.\" 2007-07-08, mtk, added an example program; updated SYNOPSIS -.\" 2008-05-08, mtk, Describe rules governing ownership of new files -.\" (bsdgroups versus sysvgroups, and the effect of the parent -.\" directory's set-group-ID permission bit). -.\" -.\" Japanese Version Copyright (c) 1996 Yosiaki Yanagihara -.\" all rights reserved. -.\" Translated 1996-06-24, Yosiaki Yanagihara -.\" Modified 1998-05-11, HANATAKA Shinya -.\" Modified 2004-02-29, Yuichi SATO -.\" Updated & Modified Wed Dec 29 06:48:16 JST 2004 by Yuichi SATO -.\" Updated 2007-09-04, Akihiro MOTOKI , LDP v2.64 -.\" Updated 2008-08-09, Akihiro MOTOKI , LDP v3.05 -.\" -.TH CHOWN 2 2010-09-26 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O chown, fchown, lchown \- change ownership of a file -chown, fchown, lchown \- ファイルの所有者を変更する -.\"O .SH SYNOPSIS -.SH 書式 -.B #include -.sp -.BI "int chown(const char *" path ", uid_t " owner ", gid_t " group ); -.br -.BI "int fchown(int " fd ", uid_t " owner ", gid_t " group ); -.br -.BI "int lchown(const char *" path ", uid_t " owner ", gid_t " group ); -.sp -.in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): -.in -.sp -.BR fchown (), -.BR lchown (): -.PD 0 -.ad l -.RS 4 -_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED -.br -.\"O || /* Since glibc 2.12: */ _POSIX_C_SOURCE\ >=\ 200809L -|| /* glibc 2.12 以降: */ _POSIX_C_SOURCE\ >=\ 200809L -.RE -.ad -.PD -.\"O .SH DESCRIPTION -.SH 説明 -.\"O These system calls change the owner and group of a file. -.\"O The differ only in how the file is specified: -これらのシステムコールは、ファイルの所有者 (owner) とグループを変更する。 -システムコール間の違いは、ファイルの指定の仕方だけである。 -.IP * 2 -.\"O .BR chown () -.\"O changes the ownership of the file specified by -.\"O .IR path , -.\"O which is dereferenced if it is a symbolic link. -.BR chown () -は -.I path -で指定されたファイルの所有権を変更する。 -.I path -がシンボリック・リンクの場合は、リンクの展開が行われる。 -.IP * -.\"O .BR fchown () -.\"O changes the ownership of the file referred to by the open file descriptor -.\"O .IR fd . -.BR fchown () -はオープンされたファイルディスクリプタ -.I fd -により参照されるファイルの所有権を変更する。 -.IP * -.\"O .BR lchown () -.\"O is like -.\"O .BR chown (), -.\"O but does not dereference symbolic links. -.BR lchown () -は -.BR chown () -と同じだが、シンボリック・リンクを展開しない点が異なる。 -.PP -.\"O Only a privileged process (Linux: one with the -.\"O .B CAP_CHOWN -.\"O capability) may change the owner of a file. -特権を持つプロセス (Linux では -.B CAP_CHOWN -ケーパビリティ (capability) を持つプロセス) だけが -ファイルの所有者を変更できる。 -.\"O The owner of a file may change the group of the file -.\"O to any group of which that owner is a member. -ファイルの所有者は、その所有者が属しているグループのいずれかに -ファイルのグループを変更することができる。 -.\"O A privileged process (Linux: with -.\"O .BR CAP_CHOWN ) -.\"O may change the group arbitrarily. -特権 (Linux では -.BR CAP_CHOWN ) -を持つプロセスは、任意のグループに変更できる。 - -.\"O If the -.\"O .I owner -.\"O or -.\"O .I group -.\"O is specified as \-1, then that ID is not changed. -.I owner -または -.I group -に \-1 が指定された場合、それらの ID は変更されない。 - -.\"O When the owner or group of an executable file are -.\"O changed by an unprivileged user the -.\"O .B S_ISUID -.\"O and -.\"O .B S_ISGID -.\"O mode bits are cleared. -.\"O POSIX does not specify whether -.\"O this also should happen when root does the -.\"O .BR chown (); -非特権ユーザーにより実行ファイルの所有者またはグループが -変更された場合は -.B S_ISUID -と -.B ISGID -モードビットはクリアされる。 -POSIX はこの動作やルートが -.BR chown () -を行なった場合については特に指定されていない。 -.\"O the Linux behavior depends on the kernel version. -Linux における動作はカーネルのバージョンに依存する。 -.\"O .\" In Linux 2.0 kernels, superuser was like everyone else -.\"O .\" In 2.2, up to 2.2.12, these bits were not cleared for superuser. -.\"O .\" Since 2.2.13, superuser is once more like everyone else. -.\" Linux 2.0 カーネルでは、スーパー・ユーザーでの動作は -.\" 他のユーザーの場合と同じであった。 -.\" 2.2 では、2.2.12 までは、スーパー・ユーザーの場合には -.\" これらのビットはクリアされなくなった。 -.\" 2.2.13 以降では、スーパー・ユーザーでの動作は -.\" 再び他のユーザーの場合と同じになった。 -.\"O In case of a non-group-executable file (i.e., one for which the -.\"O .B S_IXGRP -.\"O bit is not set) the -.\"O .B S_ISGID -.\"O bit indicates mandatory locking, and is not cleared by a -.\"O .BR chown (). -非グループ実行ファイル -.RB ( S_IXGRP -ビットが設定されていないファイル) の場合には -.B S_ISGID -ビットは強制ロック (mandatory locking) を意味している。 -そしてそれは -.BR chown () -ではクリアできない。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success, zero is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功すると、0 を返す。 -失敗すると、\-1 を返し、 -.I errno -に適切な値を設定する。 -.\"O .SH ERRORS -.SH エラー -.\"O Depending on the file system, other errors can be returned. -.\"O The more general errors for -.\"O .BR chown () -.\"O are listed below. -ファイルシステムによっては他のエラーが返される事がある。 -.B chmod -で一般的なエラーを以下に挙げる。 -.TP -.B EACCES -.\"O Search permission is denied on a component of the path prefix. -.\"O (See also -.\"O .BR path_resolution (7).) -.I path -の構成要素に検索許可 (search permission) がない -.RB ( path_resolution (7) -も参照)。 -.TP -.B EFAULT -.\"O .I path -.\"O points outside your accessible address space. -.I path -が割り当てられたアドレス空間外を指している。 -.TP -.B ELOOP -.\"O Too many symbolic links were encountered in resolving -.\"O .IR path . -.I path -を解決する際に遭遇したシンボリック・リンクが多過ぎる。 -.TP -.B ENAMETOOLONG -.\"O .I path -.\"O is too long. -.I path -が長過ぎる。 -.TP -.B ENOENT -.\"O The file does not exist. -ファイルが存在しない。 -.TP -.B ENOMEM -.\"O Insufficient kernel memory was available. -カーネルに十分なメモリがない。 -.TP -.B ENOTDIR -.\"O A component of the path prefix is not a directory. -.I path -の構成要素がディレクトリでない。 -.TP -.B EPERM -.\"O The calling process did not have the required permissions -.\"O (see above) to change owner and/or group. -呼び出したプロセスに所有者またはグループ (もしくはその両方) を変更するために -要求される許可 (上記を参照) がない。 -.TP -.B EROFS -.\"O The named file resides on a read-only file system. -指定したファイルが読み込み専用 (read-only) のファイル・システム上にある。 -.PP -.\"O The general errors for -.\"O .BR fchown () -.\"O are listed below: -.BR fchown () -で一般的なエラーを以下に挙げる: -.TP -.B EBADF -.\"O The descriptor is not valid. -ディスクリプターが有効でない。 -.TP -.B EIO -.\"O A low-level I/O error occurred while modifying the inode. -i ノード (inode) を変更する際に低レベル I/O エラーが発生した。 -.TP -.B ENOENT -.\"O See above. -上記を参照。 -.TP -.B EPERM -.\"O See above. -上記を参照。 -.TP -.B EROFS -.\"O See above. -上記を参照。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -4.4BSD, SVr4, POSIX.1-2001. - -.\"O The 4.4BSD version can only be -.\"O used by the superuser (that is, ordinary users cannot give away files). -4.4BSD 版ではスーパー・ユーザーのみが使用できる -(つまり、普通のユーザーはファイルを手放すことはできない)。 -.\"O .\" chown(): -.\"O .\" SVr4 documents EINVAL, EINTR, ENOLINK and EMULTIHOP returns, but no -.\"O .\" ENOMEM. POSIX.1 does not document ENOMEM or ELOOP error conditions. -.\" chown(): -.\" SVr4 には EINVAL, EINTR, ENOLINK, EMULTIHOP を返すと記載されているが、 -.\" ENOMEM はない。 -.\" POSIX.1 には ENOMEM, ELOOP について記載はない。 -.\"O .\" fchown(): -.\"O .\" SVr4 documents additional EINVAL, EIO, EINTR, and ENOLINK -.\"O .\" error conditions. -.\" fchown(): -.\" SVr4 には他に EINVAL, EIO, EINTR, ENOLINK エラー状態についての記載がある。 -.\"O .SH NOTES -.SH 注意 -.\"O When a new file is created (by, for example, -.\"O .BR open (2) -.\"O or -.\"O .BR mkdir (2)), -.\"O its owner is made the same as the file system user ID of the -.\"O creating process. -.RB ( open (2) -や -.BR mkdir (2) -などにより) 新しいファイルが作成されるとき、 -その所有者は呼び出したプロセスのファイルシステム・ユーザ ID と -同じに設定される。 -.\"O The group of the file depends on a range of factors, -.\"O including the type of file system, -.\"O the options used to mount the file system, -.\"O and whether or not the set-group-ID permission bit is enabled -.\"O on the parent directory. -そのファイルのグループはいくつかの要因により決定される。 -その要因としては、 -ファイルシステムの種類、そのファイルシステムのマウント時に -使用されたオプション、親ディレクトリで set-group-ID 許可ビットが -有効になっているどうか、がある。 -.\"O If the file system supports the -.\"O .I "\-o\ grpid" -.\"O (or, synonymously -.\"O .IR "\-o\ bsdgroups" ) -.\"O and -.\"O .I "\-o\ nogrpid" -.\"O (or, synonymously -.\"O .IR "\-o\ sysvgroups" ) -.\"O .BR mount (8) -.\"O options, then the rules are as follows: -ファイルシステムが -.BR mount (8) -オプションの -.I "\-o\ grpid" -.RI ( "\-o\ bsdgroups" -も同義語) と -.I "\-o\ nogrpid" -.RI ( "\-o sysvgroups" -も同義語) に対応している場合、ルールは以下の通りとなる。 -.IP * 2 -.\"O If the file system is mounted with -.\"O .IR "\-o\ grpid" , -.\"O then the group of a new file is made -.\"O the same as that of the parent directory. -ファイルシステムが -.I "\-o\ grpid" -付きでマウントされている場合、新しいファイルのグループは -親ディレクトリのグループと同じになる。 -.IP * -.\"O If the file system is mounted with -.\"O .IR "\-o\ nogrpid" -.\"O and the set-group-ID bit is disabled on the parent directory, -.\"O then the group of a new file is made the same as the -.\"O process's file system GID. -ファイルシステムが -.I "\-o\ nogrpid" -付きでマウントされており、親ディレクトリでは set-group-ID ビットが -無効になっている場合、新しいファイルのグループは -プロセスのファイルシステム GID と同じになる。 -.IP * -.\"O If the file system is mounted with -.\"O .IR "\-o\ nogrpid" -.\"O and the set-group-ID bit is enabled on the parent directory, -.\"O then the group of a new file is made -.\"O the same as that of the parent directory. -ファイルシステムが -.I "\-o\ nogrpid" -付きでマウントされており、親ディレクトリでは set-group-ID ビットが -有効になっている場合、新しいファイルのグループは -親ディレクトリのグループと同じになる。 -.PP -.\"O As at Linux 2.6.25, -.\"O the -.\"O .IR "\-o\ grpid" -.\"O and -.\"O .IR "\-o\ nogrpid" -.\"O mount options are supported by ext2, ext3, ext4, and XFS. -.\"O File systems that don't support these mount options follow the -.\"O .IR "\-o\ nogrpid" -.\"O rules. -Linux 2.6.25 では、マウントオプション -.I "\-o\ grpid" -と -.I "\-o\ nogrpid" -に対応しているファイルシステムは -ext2, ext3, ext4, XFS である。 -これらのマウントオプションに対応していないファイルシステムでは、 -.I "\-o\ nogrpid" -に関するルールが適用される。 -.PP -.\"O The -.\"O .BR chown () -.\"O semantics are deliberately violated on NFS file systems -.\"O which have UID mapping enabled. -.\"O Additionally, the semantics of all system -.\"O calls which access the file contents are violated, because -.\"O .BR chown () -.\"O may cause immediate access revocation on already open files. -.\"O Client side -.\"O caching may lead to a delay between the time where ownership have -.\"O been changed to allow access for a user and the time where the file can -.\"O actually be accessed by the user on other clients. -.BR chown () -方式は UID マッピングを使用した -NFS ファイル・システムを侵害する。 -さらにファイルの内容にアクセスする全てのシステム・コールを侵害する。 -これは -.BR chown () -が既にオープンされたファイルに対する -アクセスをただちに取り消すことによる。 -クライアント側のキャッシュにより所有権が変更されて -ユーザーのアクセスが許した時点と、実際に他のクライアントでユーザーによって -ファイルにアクセスできる時点との間に時間差があるかもしれない。 - -.\"O In versions of Linux prior to 2.1.81 (and distinct from 2.1.46), -.\"O .BR chown () -.\"O did not follow symbolic links. -Linux の 2.1.81 より前のバージョン (特に 2.1.46 以前) では、 -.BR chown () -はシンボリック・リンクを追跡しない。 -.\"O Since Linux 2.1.81, -.\"O .BR chown () -.\"O does follow symbolic links, and there is a new system call -.\"O .BR lchown () -.\"O that does not follow symbolic links. -Linux 2.1.81 以降では -.BR chown () -はシンボリック・リンクを追跡し、新たなシステム・コール -.BR lchown () -はシンボリック・リンクを追跡しない。 -.\"O Since Linux 2.1.86, this new call (that has the same semantics -.\"O as the old -.\"O .BR chown ()) -.\"O has got the same syscall number, and -.\"O .BR chown () -.\"O got the newly introduced number. -Linux 2.1.86 以降ではこの新しいコール (古い -.BR chown () -と全く同じ動作を行なう) は同じシステムコール番号を持ち -.BR chown () -は新しく導入された番号を持つ。 -.\"O .SH EXAMPLE -.SH 例 -.PP -.\"O The following program changes the ownership of the file named in -.\"O its second command-line argument to the value specified in its -.\"O first command-line argument. -.\"O The new owner can be specified either as a numeric user ID, -.\"O or as a username (which is converted to a user ID by using -.\"O .BR getpwnam (3) -.\"O to perform a lookup in the system password file). -以下のプログラムは、 -二つ目のコマンドライン引き数で指定された名前のファイルの所有者を、 -一つ目のコマンドライン引き数で指定された値に変更する。 -新しい所有者は、数字のユーザ ID かユーザ名のいずれかで指定できる -(ユーザ名で指定した場合には、 -.BR getpwnam (3) -を使ってシステムのパスワードファイルの検索が行われ、 -ユーザ ID への変換が行われる)。 -.nf - -#include -#include -#include -#include - -int -main(int argc, char *argv[]) -{ - uid_t uid; - struct passwd *pwd; - char *endptr; - - if (argc != 3 || argv[1][0] == \(aq\\0\(aq) { - fprintf(stderr, "%s \\n", argv[0]); - exit(EXIT_FAILURE); - } - - uid = strtol(argv[1], &endptr, 10); /* Allow a numeric string */ - - if (*endptr != \(aq\\0\(aq) { /* Was not pure numeric string */ - pwd = getpwnam(argv[1]); /* Try getting UID for username */ - if (pwd == NULL) { - perror("getpwnam"); - exit(EXIT_FAILURE); - } - - uid = pwd\->pw_uid; - } - - if (chown(argv[2], uid, \-1) == \-1) { - perror("chown"); - exit(EXIT_FAILURE); - } - - exit(EXIT_SUCCESS); -} -.fi -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR chmod (2), -.BR fchownat (2), -.BR flock (2), -.BR path_resolution (7), -.BR symlink (7) diff --git a/draft/man2/chroot.2 b/draft/man2/chroot.2 index e2483bfb..6f9d5b2b 100644 --- a/draft/man2/chroot.2 +++ b/draft/man2/chroot.2 @@ -30,209 +30,102 @@ .\" Modified 1997-08-21 by Joseph S. Myers .\" Modified 2004-06-23 by Michael Kerrisk .\" -.\" Japanese Version Copyright (c) 1996 Yosiaki Yanagihara -.\" all rights reserved. -.\" Translated Mon Jun 24 14:29:55 JST 1996 -.\" by Yosiaki Yanagihara -.\" Modified Sat Dec 13 23:29:07 JST 1997 -.\" by HANATAKA Shinya -.\" Updated & Modified Fri 6 Apr 2001 -.\" by NAKANO Takeo -.\" Updated & Modified Thu Dec 23 10:04:20 JST 2004 -.\" by Yuichi SATO +.\"******************************************************************* .\" -.TH CHROOT 2 2010-09-20 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O chroot \- change root directory +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH CHROOT 2 2010\-09\-20 Linux "Linux Programmer's Manual" .SH 名前 chroot \- ルート・ディレクトリを変更する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int chroot(const char *" path ); +\fBint chroot(const char *\fP\fIpath\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR chroot (): +\fBchroot\fP(): .ad l .RS 4 .PD 0 -.TP 4 -.\"O Since glibc 2.2.2: +.TP 4 glibc 2.2.2 以降: .nf _BSD_SOURCE || (_XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) && !(_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600) +.TP 4 .fi -.TP 4 -.\"O Before glibc 2.2.2: none glibc 2.2.2 より前: なし .PD .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR chroot () -.\"O changes the root directory of the calling process to that specified in -.\"O .IR path . -.\"O This directory will be used for pathnames beginning with \fI/\fP. -.\"O The root directory is inherited by all children of the calling process. -.BR chroot () -は、呼び出し元プロセスのルート・ディレクトリを -.I path -で指定されたディレクトリに変更する。 -このディレクトリ以下が \fI/\fP から始まるパス名として使われる。 -このルート・ディレクトリは呼び出し元のプロセスの全ての子プロセスに受け継がれる。 -.\"O -.PP -.\"O Only a privileged process (Linux: one with the -.\"O .B CAP_SYS_CHROOT -.\"O capability) may call -.\"O .BR chroot (). -特権プロセス (Linux では、 -.B CAP_SYS_CHROOT -ケーパビリティを持つプロセス) のみが -.BR chroot () +\fBchroot\fP() は、呼び出し元プロセスのルート・ディレクトリを \fIpath\fP で指定されたディレクトリに変更する。 このディレクトリ以下が +\fI/\fP から始まるパス名として使われる。 このルート・ディレクトリは呼び出し元のプロセスの全ての子プロセスに受け継がれる。 + +特権プロセス (Linux では、 \fBCAP_SYS_CHROOT\fP ケーパビリティを持つプロセス) のみが \fBchroot\fP() を呼び出すことができる。 -.\"O -.PP -.\"O This call changes an ingredient in the pathname resolution process -.\"O and does nothing else. -このコールはパス名解決の過程で構成要素を変更するのみで、 -その他には何も行わない。 -.\"O -.PP -.\"O This call does not change the current working directory, -.\"O so that after the call \(aq\fI.\fP\(aq can -.\"O be outside the tree rooted at \(aq\fI/\fP\(aq. -.\"O In particular, the superuser can escape from a "chroot jail" -.\"O by doing: -このコールは現在の作業ディレクトリ -(working directory) を変更しない。 -そのため、このコールの後に \(aq\fI.\fP\(aq が \(aq\fI/\fP\(aq を -根とするツリーの外になる場合がある。 -特に、スーパー・ユーザーは以下のようにすることで -"chroot jail" から逃げ出せてしまう。 + +このコールはパス名解決の過程で構成要素を変更するのみで、 その他には何も行わない。 + +このコールは現在の作業ディレクトリ (working directory) を変更しない。 そのため、このコールの後に \(aq\fI.\fP\(aq が +\(aq\fI/\fP\(aq を 根とするツリーの外になる場合がある。 特に、スーパー・ユーザーは以下のようにすることで "chroot jail" +から逃げ出せてしまう。 .nf mkdir foo; chroot foo; cd .. .fi -.\"O This call does not close open file descriptors, and such file -.\"O descriptors may allow access to files outside the chroot tree. -このコールはオープンファイルディスクリプタをクローズしないので、 -このようなファイルディスクリプタは chroot ツリーの外にある +このコールはオープンファイルディスクリプタをクローズしないので、 このようなファイルディスクリプタは chroot ツリーの外にある ファイルにアクセスできる。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O On success, zero is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功すると 0 を返す。 -失敗すると \-1 を返し、 -.I errno -に適切な値を設定する。 -.\"O .SH ERRORS +成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.\"O Depending on the file system, other errors can be returned. -.\"O The more general errors are listed below: -ファイルシステムによっては他のエラーが返される事がある。 -一般的なエラーを以下に挙げる: -.TP -.B EACCES -.\"O Search permission is denied on a component of the path prefix. -パス名の途中のどこかに検索許可 (search permission) がない。 -.\"O (See also -.\"O .BR path_resolution (7).) -.RB ( path_resolution (7) -も参照すること。) -.\"O .\" Also search permission is required on the final component, -.\"O .\" maybe just to guarantee that it is a directory? -.\" パス名の最後の構成要素にも検索許可が必要である。 -.\" おそらく、それがディレクトリであることを保証するためなのか? -.TP -.B EFAULT -.\"O .I path -.\"O points outside your accessible address space. -.I path -が割り当てられたアドレス空間外を指している。 -.TP -.B EIO -.\"O An I/O error occurred. +ファイルシステムによっては他のエラーが返される事がある。 一般的なエラーを以下に挙げる: +.TP +\fBEACCES\fP +.\" Also search permission is required on the final component, +.\" maybe just to guarantee that it is a directory? +パス名の構成要素に検索許可がない (\fBpath_resolution\fP(7) も見よ)。 +.TP +\fBEFAULT\fP +\fIpath\fP がアクセスできるアドレス空間外を指している。 +.TP +\fBEIO\fP I/O エラーが発生した。 -.TP -.B ELOOP -.\"O Too many symbolic links were encountered in resolving -.\"O .IR path . -.I path -を解決する際に遭遇したシンボリック・リンクが多過ぎる。 -.TP -.B ENAMETOOLONG -.\"O .I path -.\"O is too long. -.I path -が長過ぎる。 -.TP -.B ENOENT -.\"O The file does not exist. +.TP +\fBELOOP\fP +\fIpath\fP を解決する際に遭遇したシンボリック・リンクが多過ぎる。 +.TP +\fBENAMETOOLONG\fP +\fIpath\fP が長過ぎる。 +.TP +\fBENOENT\fP ファイルが存在しない。 -.TP -.B ENOMEM -.\"O Insufficient kernel memory was available. +.TP +\fBENOMEM\fP カーネルに十分なメモリがない。 -.TP -.B ENOTDIR -.\"O A component of -.\"O .I path -.\"O is not a directory. -.I path -の内容がディレクトリではない。 -.TP -.B EPERM -.\"O The caller has insufficient privilege. +.TP +\fBENOTDIR\fP +\fIpath\fP の構成要素がディレクトリではない。 +.TP +\fBEPERM\fP 呼び出し側に十分な特権がない。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O SVr4, 4.4BSD, SUSv2 (marked LEGACY). -.\"O This function is not part of POSIX.1-2001. -.\"O .\" SVr4 documents additional EINTR, ENOLINK and EMULTIHOP error conditions. -.\"O .\" X/OPEN does not document EIO, ENOMEM or EFAULT error conditions. -SVr4, 4.4BSD, SUSv2 (但し、SUSv2 では過去の名残とされている)。 -この関数は POSIX.1-2001 にはない。 -.\" SVr4 には他に EINTR, ENOLINK, EMULTIHOP エラー状態についての記述がある。 -.\" X/OPEN には EIO, ENOMEM, EFAULT エラー状態の記述はない。 -.\"O .SH NOTES +.\" SVr4 documents additional EINTR, ENOLINK and EMULTIHOP error conditions. +.\" X/OPEN does not document EIO, ENOMEM or EFAULT error conditions. +SVr4, 4.4BSD, SUSv2 (但し、SUSv2 では過去の名残とされている)。 この関数は POSIX.1\-2001 にはない。 .SH 注意 -.\"O A child process created via -.\"O .BR fork (2) -.\"O inherits its parent's root directory. -.\"O The root directory is left unchanged by -.\"O .BR execve (2). -.BR fork (2) -で作成された子プロセスは、 -親プロセスのルート・ディレクトリを継承する。 -.BR execve (2) +\fBfork\fP(2) で作成された子プロセスは、 親プロセスのルート・ディレクトリを継承する。 \fBexecve\fP(2) の場合も、ルート・ディレクトリは変更されない。 -.\"O FreeBSD has a stronger -.\"O .BR jail () -.\"O system call. -FreeBSD にはより強力な -.BR jail () -システムコールがある。 .\" FIXME . eventually say something about containers, .\" virtual servers, etc.? -.\"O .SH "SEE ALSO" +FreeBSD にはより強力な \fBjail\fP() システムコールがある。 .SH 関連項目 -.BR chdir (2), -.BR path_resolution (7) +\fBchdir\fP(2), \fBpath_resolution\fP(7) diff --git a/draft/man2/clock_getres.2 b/draft/man2/clock_getres.2 index 1b74214d..0cb99118 100644 --- a/draft/man2/clock_getres.2 +++ b/draft/man2/clock_getres.2 @@ -29,117 +29,46 @@ .\" .\" FIXME: Linux 2.6.39 adds CLOCK_BOOTTIME .\" -.\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO -.\" all rights reserved. -.\" Translated 2004-07-19, Yuichi SATO -.\" Updated & Modified 2005-01-10, Yuichi SATO -.\" Updated 2010-04-11, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH CLOCK_GETRES 2 2010-02-03 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH CLOCK_GETRES 2 2010\-02\-03 "" "Linux Programmer's Manual" .SH 名前 -.\"O clock_getres, clock_gettime, clock_settime \- clock and time functions clock_getres, clock_gettime, clock_settime \- クロックと時間の関数 -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int clock_getres(clockid_t " clk_id ", struct timespec *" res ); +\fBint clock_getres(clockid_t \fP\fIclk_id\fP\fB, struct timespec *\fP\fIres\fP\fB);\fP -.BI "int clock_gettime(clockid_t " clk_id ", struct timespec *" tp ); +\fBint clock_gettime(clockid_t \fP\fIclk_id\fP\fB, struct timespec *\fP\fItp\fP\fB);\fP -.BI "int clock_settime(clockid_t " clk_id ", const struct timespec *" tp ); +\fBint clock_settime(clockid_t \fP\fIclk_id\fP\fB, const struct timespec +*\fP\fItp\fP\fB);\fP .sp -.\"O Link with \fI\-lrt\fP. -\fI\-lrt\fP とリンクする。 +\fI\-lrt\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR clock_getres (), -.BR clock_gettime (), -.BR clock_settime (): +\fBclock_getres\fP(), \fBclock_gettime\fP(), \fBclock_settime\fP(): .RS _POSIX_C_SOURCE\ >=\ 199309L .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The function -.\"O .BR clock_getres () -.\"O finds the resolution (precision) of the specified clock -.\"O .IR clk_id , -.\"O and, if -.\"O .I res -.\"O is non-NULL, stores it in the \fIstruct timespec\fP pointed to by -.\"O .IR res . -関数 -.BR clock_getres () -は -指定されたクロック -.I clk_id -の分解能 (精度) を探し出す。 -.I res -が NULL でない場合、その分解能を -.I res -で指される \fIstruct timespec\fP に格納する。 -.\"O The resolution of clocks depends on the implementation and cannot be -.\"O configured by a particular process. -クロックの分解能は実装に依存し、 -特定のプロセスによって設定することはできない。 -.\"O If the time value pointed to by the argument -.\"O .I tp -.\"O of -.\"O .BR clock_settime () -.\"O is not a multiple of -.\"O .IR res , -.\"O then it is truncated to a multiple of -.\"O .IR res . -.BR clock_settime () -の引き数 -.I tp -で指される時間の値が -.I res -の倍数でない場合、 -.I res -の倍数に切り詰められる。 +関数 \fBclock_getres\fP() は 指定されたクロック \fIclk_id\fP の分解能 (精度) を探し出す。 \fIres\fP が NULL +でない場合、その分解能を \fIres\fP で指される \fIstruct timespec\fP に格納する。 クロックの分解能は実装に依存し、 +特定のプロセスによって設定することはできない。 \fBclock_settime\fP() の引き数 \fItp\fP で指される時間の値が \fIres\fP +の倍数でない場合、 \fIres\fP の倍数に切り詰められる。 .PP -.\"O The functions -.\"O .BR clock_gettime () -.\"O and -.\"O .BR clock_settime () -.\"O retrieve and set the time of the specified clock -.\"O .IR clk_id . -関数 -.BR clock_gettime () -と -.BR clock_settime () -は、指定されたクロック -.I clk_id +関数 \fBclock_gettime\fP() と \fBclock_settime\fP() は、指定されたクロック \fIclk_id\fP の時間を取得または設定する。 .PP -.\"O The -.\"O .I res -.\"O and -.\"O .I tp -.\"O arguments are -.\"O .I timespec -.\"O structures, as specified in -.\"O .IR : -.I res -と -.I tp -引き数は -.I timespec -構造体であり、 -.I -で以下のように規定されている: +\fIres\fP と \fItp\fP 引き数は \fItimespec\fP 構造体であり、 \fI\fP で以下のように規定されている: .sp .in +4n .nf @@ -150,237 +79,75 @@ struct timespec { .fi .in .PP -.\"O The -.\"O .I clk_id -.\"O argument is the identifier of the particular clock on which to act. -.I clk_id -引き数は特定のクロックの識別子であり、そのクロックで動作する。 -.\"O A clock may be system-wide and hence visible for all processes, or -.\"O per-process if it measures time only within a single process. -クロックはシステム全体に適用することもでき、 -その場合は全てのプロセスから見ることができる。 -また 1 つのプロセス内でのみ時間を計測する場合は、 -プロセス毎に適用することもできる。 +\fIclk_id\fP 引き数は特定のクロックの識別子であり、そのクロックで動作する。 クロックはシステム全体に適用することもでき、 +その場合は全てのプロセスから見ることができる。 また 1 つのプロセス内でのみ時間を計測する場合は、 プロセス毎に適用することもできる。 .LP -.\"O All implementations support the system-wide real-time clock, -.\"O which is identified by -.\"O .BR CLOCK_REALTIME . -全ての実装においてシステム全体のリアルタイムクロックがサポートされ、 -.B CLOCK_REALTIME -で識別される。 -.\"O Its time represents seconds and nanoseconds since the Epoch. -時間は紀元 (the Epoch) からの秒とナノ秒で表される。 -.\"O When its time is changed, timers for a relative interval are -.\"O unaffected, but timers for an absolute point in time are affected. -時間が変更された場合、相対的な時間間隔のタイマは影響を受けないが、 -絶対的な時点のタイマは影響を受ける。 +全ての実装においてシステム全体のリアルタイムクロックがサポートされ、 \fBCLOCK_REALTIME\fP で識別される。 時間は紀元 (the +Epoch) からの秒とナノ秒で表される。 時間が変更された場合、相対的な時間間隔のタイマは影響を受けないが、 絶対的な時点のタイマは影響を受ける。 .LP -.\"O More clocks may be implemented. -.\"O The interpretation of the -.\"O corresponding time values and the effect on timers is unspecified. -さらにいくつかのクロックが実装されているかもしれない。 -対応する時間の値を解釈する方法とタイマへの影響は、定められていない。 +さらにいくつかのクロックが実装されているかもしれない。 対応する時間の値を解釈する方法とタイマへの影響は、定められていない。 .LP -.\"O Sufficiently recent versions of glibc and the Linux kernel -.\"O support the following clocks: -glibc と Linux カーネルの最新のバージョンでは、 -以下のような十分なクロックがサポートされている。 -.TP -.B CLOCK_REALTIME -.\"O System-wide real-time clock. -システム全体のリアルタイムクロック。 -.\"O Setting this clock requires appropriate privileges. -このクロックを設定するには適切な特権が必要である。 -.TP -.B CLOCK_MONOTONIC -.\"O Clock that cannot be set and represents monotonic time since -.\"O some unspecified starting point. -いくつかの開始点が指定されていないため、 -クロックがモノトニックタイムを設定したり表現したりできない。 -.TP -.\"O .BR CLOCK_MONOTONIC_RAW " (since Linux 2.6.28; Linux-specific)" -.BR CLOCK_MONOTONIC_RAW " (Linux 2.6.28 以降; Linux 特有)" +glibc と Linux カーネルの最新のバージョンでは、 以下のような十分なクロックがサポートされている。 +.TP +\fBCLOCK_REALTIME\fP +システム全体のリアルタイムクロック。 このクロックを設定するには適切な特権が必要である。 +.TP +\fBCLOCK_MONOTONIC\fP +いくつかの開始点が指定されていないため、 クロックがモノトニックタイムを設定したり表現したりできない。 +.TP +\fBCLOCK_MONOTONIC_RAW\fP (Linux 2.6.28 以降; Linux 特有) .\" Added in commit 2d42244ae71d6c7b0884b5664cf2eda30fb2ae68, John Stultz -.\"O Similar to -.\"O .BR CLOCK_MONOTONIC , -.\"O but provides access to a raw hardware-based time -.\"O that is not subject to NTP adjustments. -.B CLOCK_MONOTONIC -と同様だが、NTP による調整の影響を受けない、ハードウェアによる -生の時刻へのアクセスができる。 -.TP -.B CLOCK_PROCESS_CPUTIME_ID -.\"O High-resolution per-process timer from the CPU. +\fBCLOCK_MONOTONIC\fP と同様だが、NTP による調整の影響を受けない、ハードウェアによる 生の時刻へのアクセスができる。 +.TP +\fBCLOCK_PROCESS_CPUTIME_ID\fP CPU による高分解能のプロセス毎のタイマ。 -.TP -.B CLOCK_THREAD_CPUTIME_ID -.\"O Thread-specific CPU-time clock. +.TP +\fBCLOCK_THREAD_CPUTIME_ID\fP スレッド固有の CPU タイムクロック。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O .BR clock_gettime (), -.\"O .BR clock_settime () -.\"O and -.\"O .BR clock_getres () -.\"O return 0 for success, or \-1 for failure (in which case -.\"O .I errno -.\"O is set appropriately). -.BR clock_gettime (), -.BR clock_settime (), -.BR clock_getres () -は成功した場合に 0 を返し、失敗した場合に \-1 を返す -(失敗した場合、 -.I errno -が適切に設定される)。 -.\"O .SH ERRORS +\fBclock_gettime\fP(), \fBclock_settime\fP(), \fBclock_getres\fP() は成功した場合に 0 +を返し、失敗した場合に \-1 を返す (失敗した場合、 \fIerrno\fP が適切に設定される)。 .SH エラー -.TP -.B EFAULT -.\"O .I tp -.\"O points outside the accessible address space. -.I tp -がアクセス可能なアドレス空間の外を指した。 -.TP -.B EINVAL -.\"O The -.\"O .I clk_id -.\"O specified is not supported on this system. +.TP +\fBEFAULT\fP +\fItp\fP がアクセス可能なアドレス空間の外を指した。 +.TP +\fBEINVAL\fP .\" Linux also gives this error on attempts to set CLOCK_PROCESS_CPUTIME_ID .\" and CLOCK_THREAD_CPUTIME_ID, when probably the proper error should be .\" EPERM. -指定された -.I clk_id -がこのシステムでサポートされていない。 -.TP -.B EPERM -.\"O .BR clock_settime () -.\"O does not have permission to set the clock indicated. -指示されたクロックを設定する権限が -.BR clock_settime () -にない。 -.\"O .SH "CONFORMING TO" +指定された \fIclk_id\fP がこのシステムでサポートされていない。 +.TP +\fBEPERM\fP +指示されたクロックを設定する権限が \fBclock_settime\fP() にない。 .SH 準拠 -SUSv2, POSIX.1-2001. -.\"O .SH AVAILABILITY +SUSv2, POSIX.1\-2001. .SH 可用性 -.\"O On POSIX systems on which these functions are available, the symbol -.\"O .B _POSIX_TIMERS -.\"O is defined in \fI\fP to a value greater than 0. -これらの関数が利用可能な POSIX システムでは、\fI\fP においてシンボル -.B _POSIX_TIMERS -が 0 より大きい値に定義されている。 -.\"O The symbols -.\"O .BR _POSIX_MONOTONIC_CLOCK , -.\"O .BR _POSIX_CPUTIME , -.\"O .B _POSIX_THREAD_CPUTIME -.\"O indicate that -.\"O .BR CLOCK_MONOTONIC , -.\"O .BR CLOCK_PROCESS_CPUTIME_ID , -.\"O .B CLOCK_THREAD_CPUTIME_ID -.\"O are available. -シンボル -.BR _POSIX_MONOTONIC_CLOCK , -.BR _POSIX_CPUTIME , -.B _POSIX_THREAD_CPUTIME -は -.BR CLOCK_MONOTONIC , -.BR CLOCK_PROCESS_CPUTIME_ID , -.B CLOCK_THREAD_CPUTIME_ID -が利用可能なことを示す。 -.\"O (See also -.\"O .BR sysconf (3).) -.RB ( sysconf (3) -も参照すること。) -.\"O .SH NOTES +これらの関数が利用可能な POSIX システムでは、\fI\fP においてシンボル \fB_POSIX_TIMERS\fP が +0 より大きい値に定義されている。 シンボル \fB_POSIX_MONOTONIC_CLOCK\fP, \fB_POSIX_CPUTIME\fP, +\fB_POSIX_THREAD_CPUTIME\fP は \fBCLOCK_MONOTONIC\fP, \fBCLOCK_PROCESS_CPUTIME_ID\fP, +\fBCLOCK_THREAD_CPUTIME_ID\fP が利用可能なことを示す。 (\fBsysconf\fP(3) も参照すること。) .SH 注意 -.\"O .SS Note for SMP systems .SS "SMP システムについての注意" -.\"O The -.\"O .B CLOCK_PROCESS_CPUTIME_ID -.\"O and -.\"O .B CLOCK_THREAD_CPUTIME_ID -.\"O clocks are realized on many platforms using timers from the CPUs -.\"O (TSC on i386, AR.ITC on Itanium). -.B CLOCK_PROCESS_CPUTIME_ID -と -.B CLOCK_THREAD_CPUTIME_ID -クロックは、CPU からのタイマ -(i386 上の TSC、Itanium 上の AR.ITC) を用いて実現されている。 -.\"O These registers may differ between CPUs and as a consequence -.\"O these clocks may return -.\"O .B bogus results -.\"O if a process is migrated to another CPU. -これらのレジスタは CPU 間で異なる可能性があり、 -プロセスが他の CPU に移動させられた場合、 -結果としてこれらのクロックが\fB偽の結果\fR -(bogus results) を返すかもしれない。 +\fBCLOCK_PROCESS_CPUTIME_ID\fP と \fBCLOCK_THREAD_CPUTIME_ID\fP クロックは、CPU からのタイマ +(i386 上の TSC、Itanium 上の AR.ITC) を用いて実現されている。 これらのレジスタは CPU 間で異なる可能性があり、 +プロセスが他の CPU に移動させられた場合、 結果としてこれらのクロックが\fB偽の結果\fP (bogus results) を返すかもしれない。 .PP -.\"O If the CPUs in an SMP system have different clock sources then -.\"O there is no way to maintain a correlation between the timer registers since -.\"O each CPU will run at a slightly different frequency. -.\"O If that is the case then -.\"O .I clock_getcpuclockid(0) -.\"O will return -.\"O .B ENOENT -.\"O to signify this condition. -.\"O The two clocks will then only be useful if it -.\"O can be ensured that a process stays on a certain CPU. -SMP システムの各 CPU が別々のクロック源を持つ場合、 -タイマレジスタ間の相互関係を管理する方法はない。 -これは各 CPU が微妙に異なる周波数で動作するためである。 -これが真実の場合 (訳註: 各 CPU が別々のクロック源を持つ場合)、 -.I clock_getcpuclockid(0) -は -.B ENOENT -を返して、その状況を表す。 -2 つのクロックは、プロセスが特定の CPU 上に留まっていることが -保証できる場合にのみ有効である。 +SMP システムの各 CPU が別々のクロック源を持つ場合、 タイマレジスタ間の相互関係を管理する方法はない。 これは各 CPU +が微妙に異なる周波数で動作するためである。 これが真実の場合 (訳註: 各 CPU が別々のクロック源を持つ場合)、 +\fIclock_getcpuclockid(0)\fP は \fBENOENT\fP を返して、その状況を表す。 2 つのクロックは、プロセスが特定の CPU +上に留まっていることが 保証できる場合にのみ有効である。 .PP -.\"O The processors in an SMP system do not start all at exactly the same -.\"O time and therefore the timer registers are typically running at an offset. -SMP システムの各プロセッサは全く同じ時刻に起動する訳ではないので、 -各タイマレジスタは通常はあるオフセットで動作している。 -.\"O Some architectures include code that attempts to limit these offsets on bootup. -オフセットをブート時に制限するコードが含まれるアーキテクチャもある。 -.\"O However, the code cannot guarantee to accurately tune the offsets. -しかし、このコードがオフセットを正確に調整することは保証できない。 -.\"O Glibc contains no provisions to deal with these offsets (unlike the Linux -.\"O Kernel). -.\"O Typically these offsets are small and therefore the effects may be -.\"O negligible in most cases. -glibc は (Linux カーネルとは異なり) オフセットを扱うためのコードを提供しない。 -通常はこれらのオフセットが小さいので、多くの場合でその影響は無視できる。 -.\"O .SH BUGS +SMP システムの各プロセッサは全く同じ時刻に起動する訳ではないので、 各タイマレジスタは通常はあるオフセットで動作している。 +オフセットをブート時に制限するコードが含まれるアーキテクチャもある。 しかし、このコードがオフセットを正確に調整することは保証できない。 glibc は +(Linux カーネルとは異なり) オフセットを扱うためのコードを提供しない。 通常はこれらのオフセットが小さいので、多くの場合でその影響は無視できる。 .SH バグ -.\"O According to POSIX.1-2001, a process with "appropriate privileges" may set the -.\"O .B CLOCK_PROCESS_CPUTIME_ID -.\"O and -.\"O .B CLOCK_THREAD_CPUTIME_ID -.\"O clocks using -.\"O .BR clock_settime (). -.\"O On Linux, these clocks are not settable -.\"O (i.e., no process has "appropriate privileges"). -POSIX.1-2001 では、 -「適切な特権 (appropriate privileges)」を持ったプロセスは、 -.BR clock_settime () -を使って、クロック -.B CLOCK_PROCESS_CPUTIME_ID -と -.B CLOCK_THREAD_CPUTIME_ID -を設定することができるとされている。 -Linux では、これらのクロックは設定可能ではない -(すなわち、どのプロセスも「適切な特権」を持たない)。 .\" See http://bugzilla.kernel.org/show_bug.cgi?id=11972 -.\"O .SH "SEE ALSO" +POSIX.1\-2001 では、 「適切な特権 (appropriate privileges)」を持ったプロセスは、 +\fBclock_settime\fP() を使って、クロック \fBCLOCK_PROCESS_CPUTIME_ID\fP と +\fBCLOCK_THREAD_CPUTIME_ID\fP を設定することができるとされている。 Linux では、これらのクロックは設定可能ではない +(すなわち、どのプロセスも「適切な特権」を持たない)。 .SH 関連項目 -.BR date (1), -.BR adjtimex (2), -.BR gettimeofday (2), -.BR settimeofday (2), -.BR time (2), -.BR clock_getcpuclockid (3), -.BR ctime (3), -.BR ftime (3), -.BR pthread_getcpuclockid (3), -.BR sysconf (3), -.BR time (7) +\fBdate\fP(1), \fBadjtimex\fP(2), \fBgettimeofday\fP(2), \fBsettimeofday\fP(2), +\fBtime\fP(2), \fBclock_getcpuclockid\fP(3), \fBctime\fP(3), \fBftime\fP(3), +\fBpthread_getcpuclockid\fP(3), \fBsysconf\fP(3), \fBtime\fP(7) diff --git a/draft/man2/clock_nanosleep.2 b/draft/man2/clock_nanosleep.2 index 02c459c7..03a08ab4 100644 --- a/draft/man2/clock_nanosleep.2 +++ b/draft/man2/clock_nanosleep.2 @@ -21,67 +21,41 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2008-08-21, Akihiro MOTOKI , LDP v3.04 -.\" -.TH CLOCK_NANOSLEEP 2 2010-12-03 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH CLOCK_NANOSLEEP 2 2010\-12\-03 Linux "Linux Programmer's Manual" .SH 名前 -.\"O clock_nanosleep \- high-resolution sleep with specifiable clock clock_nanosleep \- 指定したクロックでの高精度な実行停止 (sleep) -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .nf .sp -.BI "int clock_nanosleep(clockid_t " clock_id ", int " flags , -.BI " const struct timespec *" request , -.BI " struct timespec *" remain ); +\fBint clock_nanosleep(clockid_t \fP\fIclock_id\fP\fB, int \fP\fIflags\fP\fB,\fP +\fB const struct timespec *\fP\fIrequest\fP\fB,\fP +\fB struct timespec *\fP\fIremain\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lrt\fP. \fI\-lrt\fP でリンクする。 .sp .ad l .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR clock_nanosleep (): +\fBclock_nanosleep\fP(): .RS 4 _XOPEN_SOURCE\ >=\ 600 || _POSIX_C_SOURCE\ >=\ 200112L .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O Like -.\"O .BR nanosleep (2), -.\"O .BR clock_nanosleep () -.\"O allows the calling thread to sleep for an interval specified -.\"O with nanosecond precision. -.\"O It differs in allowing the caller to select the clock against -.\"O which the sleep interval is to be measured, -.\"O and in allowing the sleep interval to be specified as -.\"O either an absolute or a relative value. -.BR clock_nanosleep () -を使うと、 -.BR nanosleep (2) -同様、ナノ秒の精度で指定された期間だけ呼び出したスレッドの実行を -停止することができる。 -.BR nanosleep (2) -と違うのは、呼び出し側が停止期間をどのクロックに対して計測するのかを選択 -できる点と、停止期間を絶対値でも相対値でも指定できる点である。 +\fBclock_nanosleep\fP() を使うと、 \fBnanosleep\fP(2) +同様、ナノ秒の精度で指定された期間だけ呼び出したスレッドの実行を 停止することができる。 \fBnanosleep\fP(2) +と違うのは、呼び出し側が停止期間をどのクロックに対して計測するのかを選択 できる点と、停止期間を絶対値でも相対値でも指定できる点である。 -.\"O The time values passed to and returned by this call are specified using -.\"O .I timespec -.\"O structures, defined as follows: -このシステムコールに渡したり、このシステムコールが返したりする時間の値は -.I timespec +このシステムコールに渡したり、このシステムコールが返したりする時間の値は \fItimespec\fP 構造体を使って指定される。この構造体の定義は以下の通りである。 .sp .in +4n @@ -93,319 +67,82 @@ struct timespec { .fi .in -.\"O The -.\"O .I clock_id -.\"O argument specifies the clock against which the sleep interval -.\"O is to be measured. -.\"O This argument can have one of the following values: -.I clock_id -引き数で、停止期間をどのクロックに対して計測するかを指定する。 -この引き数には以下の値のいずれか一つを指定できる。 -.TP 17 -.BR CLOCK_REALTIME -.\"O A settable system-wide real-time clock. -システム全体で使われる実時間クロック。 -このクロックは変更可能である。 -.TP -.BR CLOCK_MONOTONIC -.\"O A nonsettable, monotonically increasing clock that measures time -.\"O since some unspecified point in the past that does not change after -.\"O system startup. -.\"O .\" On Linux this clock measures time since boot. -過去のある時点からの時間を計測する、単調増加のクロック。 -起点となる時点はシステム起動後には変更されない。 -このクロックは変更することができない。 -.\" Linux では、このクロックは起動からの時間を計測する。 -.TP -.BR CLOCK_PROCESS_CPUTIME_ID -.\"O A settable per-process clock that measures CPU time consumed -.\"O by all threads in the process. -そのプロセスの全スレッドで消費される CPU 時間を計測するプロセス単位の -クロック。このクロックは設定可能である。 +\fIclock_id\fP 引き数で、停止期間をどのクロックに対して計測するかを指定する。 この引き数には以下の値のいずれか一つを指定できる。 +.TP 17 +\fBCLOCK_REALTIME\fP +システム全体で使われる実時間クロック。 このクロックは変更可能である。 +.TP +\fBCLOCK_MONOTONIC\fP +.\" On Linux this clock measures time since boot. +過去のある時点からの時間を計測する、単調増加のクロック。 起点となる時点はシステム起動後には変更されない。 このクロックは変更することができない。 +.TP +\fBCLOCK_PROCESS_CPUTIME_ID\fP .\" There is some trickery between glibc and the kernel .\" to deal with the CLOCK_PROCESS_CPUTIME_ID case. +そのプロセスの全スレッドで消費される CPU 時間を計測するプロセス単位の クロック。このクロックは設定可能である。 .PP -.\"O See -.\"O .BR clock_getres (2) -.\"O for further details on these clocks. -これらのクロックの詳細については -.BR clock_getres (2) -を参照。 +これらのクロックの詳細については \fBclock_getres\fP(2) を参照。 -.\"O If -.\"O .I flags -.\"O is 0, then the value specified in -.\"O .I request -.\"O is interpreted as an interval relative to the current -.\"O value of the clock specified by -.\"O .IR clock_id . -.I flags -が 0 の場合、 -.I request -に指定された値は -.I clock_id +\fIflags\fP が 0 の場合、 \fIrequest\fP に指定された値は \fIclock_id\fP で指定されたクロックの現在の値からの相対的な期間と解釈される。 -.\"O If -.\"O .I flags -.\"O is -.\"O .BR TIMER_ABSTIME , -.\"O then -.\"O .I request -.\"O is interpreted as an absolute time as measured by the clock, -.\"O .IR clock_id . -.\"O If -.\"O .I request -.\"O is less than or equal to the current value of the clock, -.\"O then -.\"O .BR clock_nanosleep () -.\"O returns immediately without suspending the calling thread. -.I flags -が -.B TIMER_ABSTIME -の場合、 -.I request -は指定されたクロックで計測される絶対時刻と解釈される。 -.I request -が指定されたクロックの現在の値以下の場合、 -.BR clock_nanosleep () +\fIflags\fP が \fBTIMER_ABSTIME\fP の場合、 \fIrequest\fP は指定されたクロックで計測される絶対時刻と解釈される。 +\fIrequest\fP が指定されたクロックの現在の値以下の場合、 \fBclock_nanosleep\fP() は、呼び出したスレッドの停止を行わず、すぐに返る。 -.\"O .BR clock_nanosleep () -.\"O suspends the execution of the calling thread -.\"O until either at least the time specified by -.\"O .IR request -.\"O has elapsed, -.\"O or a signal is delivered that causes a signal handler to be called or -.\"O that terminates the process. -.BR clock_nanosleep () -は、少なくとも -.I request -で指定された時間が経過するまで、呼び出したスレッドの実行を停止する。 -シグナルハンドラが呼び出されたり、そのプロセスを終了させるような -シグナルが配送されたりした場合にも、スレッドの実行停止は終了する。 +\fBclock_nanosleep\fP() は、少なくとも \fIrequest\fP で指定された時間が経過するまで、呼び出したスレッドの実行を停止する。 +シグナルハンドラが呼び出されたり、そのプロセスを終了させるような シグナルが配送されたりした場合にも、スレッドの実行停止は終了する。 -.\"O If the call is interrupted by a signal handler, -.\"O .BR clock_nanosleep () -.\"O fails with the error -.\"O .BR EINTR . -.\"O In addition, if -.\"O .I remain -.\"O is not NULL, and -.\"O .I flags -.\"O was not -.\"O .BR TIMER_ABSTIME , -.\"O it returns the remaining unslept time in -.\"O .IR remain . -.\"O This value can then be used to call -.\"O .BR clock_nanosleep () -.\"O again and complete a (relative) sleep. -呼び出しがシグナルハンドラによって割り込まれた場合、 -.BR clock_nanosleep () -はエラー -.B EINTR -で失敗する。さらに、 -.I remain -が NULL でなく、かつ -.I flags -が -.B TIMER_ABSTIME -でない場合には、 -.I remain -に残りの停止時間が返される。 -この値を使って -.BR clock_nanosleep () -を再度呼び出すことで、(相対的な期間の) 停止を完了することができる。 -.\"O .SH "RETURN VALUE" +呼び出しがシグナルハンドラによって割り込まれた場合、 \fBclock_nanosleep\fP() はエラー \fBEINTR\fP で失敗する。さらに、 +\fIremain\fP が NULL でなく、かつ \fIflags\fP が \fBTIMER_ABSTIME\fP でない場合には、 \fIremain\fP +に残りの停止時間が返される。 この値を使って \fBclock_nanosleep\fP() を再度呼び出すことで、(相対的な期間の) +停止を完了することができる。 .SH 返り値 -.\"O On successfully sleeping for the requested interval, -.\"O .BR clock_nanosleep () -.\"O returns 0. -.\"O If the call is interrupted by a signal handler or encounters an error, -.\"O then it returns one of the positive error number listed in ERRORS. -要求された期間の停止に成功すると、 -.BR clock_nanosleep () -は 0 を返す。 -シグナルハンドラで割り込まれたり、エラーが発生したりした場合、 -「エラー」の節のリストにある正のエラー番号のいずれか一つを返す。 -.\"O .SH ERRORS +要求された期間の停止に成功すると、 \fBclock_nanosleep\fP() は 0 を返す。 +シグナルハンドラで割り込まれたり、エラーが発生したりした場合、 「エラー」の節のリストにある正のエラー番号のいずれか一つを返す。 .SH エラー -.TP -.B EFAULT -.\"O .I request -.\"O or -.\"O .I remain -.\"O specified an invalid address. -.I request -や -.I remain -に無効なアドレスが指定された。 -.TP -.B EINTR -.\"O The sleep was interrupted by a signal handler. +.TP +\fBEFAULT\fP +\fIrequest\fP や \fIremain\fP に無効なアドレスが指定された。 +.TP +\fBEINTR\fP 停止がシグナルハンドラにより割り込まれた。 -.TP -.B EINVAL -.\"O The value in the -.\"O .I tv_nsec -.\"O field was not in the range 0 to 999999999 or -.\"O .I tv_sec -.\"O was negative. -.I tv_nsec -フィールドの値が 0 から 999999999 の範囲でないか、 -.I tv_sec -の値が負であった。 -.TP -.B EINVAL -.\"O .I clock_id -.\"O was invalid. -.\"O .RB ( CLOCK_THREAD_CPUTIME_ID -.\"O is not a permitted value for -.\"O .IR clock_id .) -.I clock_id -が無効であった -.RB ( CLOCK_THREAD_CPUTIME_ID -が -.I clock_id -として有効な値ではない)。 -.\"O .SH VERSIONS +.TP +\fBEINVAL\fP +\fItv_nsec\fP フィールドの値が 0 から 999999999 の範囲でないか、 \fItv_sec\fP の値が負であった。 +.TP +\fBEINVAL\fP +\fIclock_id\fP が無効であった (\fBCLOCK_THREAD_CPUTIME_ID\fP が \fIclock_id\fP として有効な値ではない)。 .SH バージョン -.\"O The -.\"O .BR clock_nanosleep () -.\"O system call first appeared in Linux 2.6. -.\"O Support is available in glibc since version 2.1. -.BR clock_nanosleep () -システムコールは Linux 2.6 で初めて登場した。 -glibc ではバージョン 2.1 以降でサポートされている。 -.\"O .SH "CONFORMING TO" +\fBclock_nanosleep\fP() システムコールは Linux 2.6 で初めて登場した。 glibc ではバージョン 2.1 +以降でサポートされている。 .SH 準拠 -POSIX.1-2001. -.\"O .SH NOTES +POSIX.1\-2001. .SH 注意 -.\"O If the interval specified in -.\"O .I request -.\"O is not an exact multiple of the granularity underlying clock (see -.\"O .BR time (7)), -.\"O then the interval will be rounded up to the next multiple. -.\"O Furthermore, after the sleep completes, there may still be a delay before -.\"O the CPU becomes free to once again execute the calling thread. -.I request -で指定された停止期間が、時間の計測に使用されるクロック -.RB ( time (7) -参照) の精度の倍数ちょうどでない場合、停止期間は一番近い次の倍数に -切り上げられる。さらに、停止が完了した後に、CPU が呼び出したスレッドを +\fIrequest\fP で指定された停止期間が、時間の計測に使用されるクロック (\fBtime\fP(7) 参照) +の精度の倍数ちょうどでない場合、停止期間は一番近い次の倍数に 切り上げられる。さらに、停止が完了した後に、CPU が呼び出したスレッドを もう一度実行できるようになるまでには、遅延が入る可能性がある。 -.\"O Using an absolute timer is useful for preventing -.\"O timer drift problems of the type described in -.\"O .BR nanosleep (2). -.\"O (Such problems are exacerbated in programs that try to restart -.\"O a relative sleep that is repeatedly interrupted by signals.) -絶対値指定のタイマを使うのは、 -.BR nanosleep (2) -に書かれている類のタイマのずれの問題を防止するのに役立つ -(この種の問題は、シグナルに割り込まれた際に相対指定の停止を -繰り返し再開しようとするプログラムでは、かえって悪化する)。 -.\"O To perform a relative sleep that avoids these problems, call -.\"O .BR clock_gettime (2) -.\"O for the desired clock, -.\"O add the desired interval to the returned time value, -.\"O and then call -.\"O .BR clock_nanosleep () -.\"O with the -.\"O .B TIMER_ABSTIME -.\"O flag. -これらの問題を回避して相対指定の停止を実行するには、 -希望するクロックで -.BR clock_gettime (2) -を呼び出し、その返り値の時刻値に希望する期間を加算してから、 -.B TIMER_ABSTIME -フラグを指定して -.BR clock_nanosleep () -を呼び出す。 +絶対値指定のタイマを使うのは、 \fBnanosleep\fP(2) に書かれている類のタイマのずれの問題を防止するのに役立つ +(この種の問題は、シグナルに割り込まれた際に相対指定の停止を 繰り返し再開しようとするプログラムでは、かえって悪化する)。 +これらの問題を回避して相対指定の停止を実行するには、 希望するクロックで \fBclock_gettime\fP(2) +を呼び出し、その返り値の時刻値に希望する期間を加算してから、 \fBTIMER_ABSTIME\fP フラグを指定して +\fBclock_nanosleep\fP() を呼び出す。 -.\"O .BR clock_nanosleep () -.\"O is never restarted after being interrupted by a signal handler, -.\"O regardless of the use of the -.\"O .BR sigaction (2) -.\"O .B SA_SIGACTION -.\"O flag. -.BR sigaction (2) -で -.BR SA_RESTART -フラグが指定されているかに関わらず、 -シグナルハンドラにより割り込まれた後に -.BR clock_nanosleep () -が再開されることは決してない。 +\fBsigaction\fP(2) で \fBSA_RESTART\fP フラグが指定されているかに関わらず、 シグナルハンドラにより割り込まれた後に +\fBclock_nanosleep\fP() が再開されることは決してない。 -.\"O The -.\"O .I remain -.\"O argument is unused, and unnecessary, when -.\"O .I flags -.\"O is -.\"O .BR TIMER_ABSTIME . -.\"O (An absolute sleep can be restarted using the same -.\"O .I request -.\"O argument.) -.I flags -が -.B TIMER_ABSTIME -の場合、 -.I remain -引き数は使用されず、不要である -(絶対値での停止では、同じ -.I request -引き数を使って再度呼び出すことができる)。 +\fIflags\fP が \fBTIMER_ABSTIME\fP の場合、 \fIremain\fP 引き数は使用されず、不要である (絶対値での停止では、同じ +\fIrequest\fP 引き数を使って再度呼び出すことができる)。 -.\"O POSIX.1 specifies that -.\"O .BR clock_nanosleep () -.\"O has no effect on signals dispositions or the signal mask. -POSIX.1 の規定では、 -.BR clock_nanosleep () -はシグナルの処理方法やシグナルマスクに影響を与えない、とされている。 +POSIX.1 の規定では、 \fBclock_nanosleep\fP() はシグナルの処理方法やシグナルマスクに影響を与えない、とされている。 -.\"O POSIX.1 specifies that after changing the value of the -.\"O .B CLOCK_REALTIME -.\"O clock via -.\"O .BR clock_settime (2), -.\"O the new clock value shall be used to determine the time -.\"O at which a thread blocked on an absolute -.\"O .BR clock_nanosleep () -.\"O will wake up; -.\"O if the new clock value falls past the end of the sleep interval, then the -.\"O .BR clock_nanosleep () -.\"O call will return immediately. -POSIX.1 の規定では、 -.BR clock_settime (2) -で -.B CLOCK_REALTIME -クロックの値を変更した後は、絶対値指定の -.BR clock_nanosleep () -で停止しているスレッドを起動させる時刻の判定は、 -新しいクロック値を使って行われる、とされている。 -新しいクロック値において停止期間の終了時刻が過去になってしまった場合には、 -.BR clock_nanosleep () -はすぐに返ることになる。 +POSIX.1 の規定では、 \fBclock_settime\fP(2) で \fBCLOCK_REALTIME\fP クロックの値を変更した後は、絶対値指定の +\fBclock_nanosleep\fP() で停止しているスレッドを起動させる時刻の判定は、 新しいクロック値を使って行われる、とされている。 +新しいクロック値において停止期間の終了時刻が過去になってしまった場合には、 \fBclock_nanosleep\fP() はすぐに返ることになる。 -.\"O POSIX.1 specifies that -.\"O changing the value of the -.\"O .B CLOCK_REALTIME -.\"O clock via -.\"O .BR clock_settime (2) -.\"O shall have no effect on a thread that is blocked on a relative -.\"O .BR clock_nanosleep (). -POSIX.1 の規定では、 -.BR clock_settime (2) -で -.B CLOCK_REALTIME -クロックの値を変更しても、相対値指定の -.BR clock_nanosleep () -で停止しているスレッドには影響を与えない、とされている。 -.\"O .SH "SEE ALSO" +POSIX.1 の規定では、 \fBclock_settime\fP(2) で \fBCLOCK_REALTIME\fP クロックの値を変更しても、相対値指定の +\fBclock_nanosleep\fP() で停止しているスレッドには影響を与えない、とされている。 .SH 関連項目 -.BR clock_getres (2), -.BR nanosleep (2), -.BR timer_create (2), -.BR sleep (3), -.BR usleep (3), -.BR time (7) +\fBclock_getres\fP(2), \fBnanosleep\fP(2), \fBtimer_create\fP(2), \fBsleep\fP(3), +\fBusleep\fP(3), \fBtime\fP(7) diff --git a/draft/man2/clone.2 b/draft/man2/clone.2 deleted file mode 100644 index 803a83da..00000000 --- a/draft/man2/clone.2 +++ /dev/null @@ -1,1831 +0,0 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" Copyright (c) 1992 Drew Eckhardt , March 28, 1992 -.\" and Copyright (c) Michael Kerrisk, 2001, 2002, 2005 -.\" May be distributed under the GNU General Public License. -.\" Modified by Michael Haardt -.\" Modified 24 Jul 1993 by Rik Faith -.\" Modified 21 Aug 1994 by Michael Chastain : -.\" New man page (copied from 'fork.2'). -.\" Modified 10 June 1995 by Andries Brouwer -.\" Modified 25 April 1998 by Xavier Leroy -.\" Modified 26 Jun 2001 by Michael Kerrisk -.\" Mostly upgraded to 2.4.x -.\" Added prototype for sys_clone() plus description -.\" Added CLONE_THREAD with a brief description of thread groups -.\" Added CLONE_PARENT and revised entire page remove ambiguity -.\" between "calling process" and "parent process" -.\" Added CLONE_PTRACE and CLONE_VFORK -.\" Added EPERM and EINVAL error codes -.\" Renamed "__clone" to "clone" (which is the prototype in ) -.\" various other minor tidy ups and clarifications. -.\" Modified 26 Jun 2001 by Michael Kerrisk -.\" Updated notes for 2.4.7+ behavior of CLONE_THREAD -.\" Modified 15 Oct 2002 by Michael Kerrisk -.\" Added description for CLONE_NEWNS, which was added in 2.4.19 -.\" Slightly rephrased, aeb. -.\" Modified 1 Feb 2003 - added CLONE_SIGHAND restriction, aeb. -.\" Modified 1 Jan 2004 - various updates, aeb -.\" Modified 2004-09-10 - added CLONE_PARENT_SETTID etc. - aeb. -.\" 2005-04-12, mtk, noted the PID caching behavior of NPTL's getpid() -.\" wrapper under BUGS. -.\" 2005-05-10, mtk, added CLONE_SYSVSEM, CLONE_UNTRACED, CLONE_STOPPED. -.\" 2005-05-17, mtk, Substantially enhanced discussion of CLONE_THREAD. -.\" 2008-11-18, mtk, order CLONE_* flags alphabetically -.\" 2008-11-18, mtk, document CLONE_NEWPID -.\" 2008-11-19, mtk, document CLONE_NEWUTS -.\" 2008-11-19, mtk, document CLONE_NEWIPC -.\" 2008-11-19, Jens Axboe, mtk, document CLONE_IO -.\" -.\" FIXME Document CLONE_NEWUSER, which is new in 2.6.23 -.\" (also supported for unshare()?) -.\" FIXME . 2.6.25 marks the unused CLONE_STOPPED as obsolete, and it will -.\" probably be removed in the future. -.\" -.\" Japanese Version Copyright (c) 2001 HANATAKA Shinya -.\" and Copyright(c) 2002, 2005-2008 Akihiro MOTOKI -.\" Translated 2001-08-17, HANATAKA Shinya -.\" Modified 2002-09-24, Akihiro MOTOKI -.\" Modified 2005-02-02, Akihiro MOTOKI -.\" Updated 2005-04-17, Akihiro MOTOKI -.\" Updated 2005-09-10, Akihiro MOTOKI -.\" Updated 2006-03-05, Akihiro MOTOKI, LDP v2.25 -.\" Updated 2007-01-05, Akihiro MOTOKI, LDP v2.43 -.\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46 -.\" Updated 2007-06-13, Akihiro MOTOKI, LDP v2.55 -.\" Updated 2008-08-04, Akihiro MOTOKI, LDP v3.05 -.\" Updated 2008-11-09, Akihiro MOTOKI, LDP v3.10 -.\" Updated 2009-03-02, Akihiro MOTOKI, LDP v3.19 -.\" Updated 2010-04-11, Akihiro MOTOKI, LDP v3.24 -.\" -.\"WORD: capability ケーパビリティ -.\"WORD: pending signals 処理待ちシグナル -.\"WORD: namespace 名前空間 -.\" -.TH CLONE 2 2010-11-01 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O clone, __clone2 \- create a child process -.SH 名前 -clone, __clone2 \- 子プロセスを作成する -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" -.\" Actually _BSD_SOURCE || _SVID_SOURCE -.\" See http://sources.redhat.com/bugzilla/show_bug.cgi?id=4749 -.B #include - -.BI "int clone(int (*" "fn" ")(void *), void *" child_stack , -.BI " int " flags ", void *" "arg" ", ... " -.BI " /* pid_t *" ptid ", struct user_desc *" tls \ -", pid_t *" ctid " */ );" -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O .BR clone () -.\"O creates a new process, in a manner similar to -.\"O .BR fork (2). -.\"O It is actually a library function layered on top of the underlying -.\"O .BR clone () -.\"O system call, hereinafter referred to as -.\"O .BR sys_clone . -.\"O A description of -.\"O .B sys_clone -.\"O is given toward the end of this page. -.BR clone () -は -.BR fork (2) -と同じような方法で新しいプロセスを作成する。 -.BR clone () -には、ライブラリ関数とその下層にあたる -.BR clone () -システムコールが存在する。以下の説明では、システムコールの方を -.B sys_clone -と表すこととする。 -.B sys_clone -に関する説明はこのマニュアルの最後の方にある。 - -.\"O Unlike -.\"O .BR fork (2), -.\"O these calls -.\"O allow the child process to share parts of its execution context with -.\"O the calling process, such as the memory space, the table of file -.\"O descriptors, and the table of signal handlers. -.\"O (Note that on this manual -.\"O page, "calling process" normally corresponds to "parent process". -.\"O But see the description of -.\"O .B CLONE_PARENT -.\"O below.) -.BR fork (2) -とは異なり、これらのコールでは、子プロセス (child process) -と呼び出し元のプロセスとが、メモリ空間、 -ファイルディスクリプタのテーブル、シグナル・ハンドラのテーブルなどの -実行コンテキストの一部を共有できる。 -(このマニュアルにおける「呼び出し元のプロセス」は、通常は -「親プロセス」と一致する。但し、後述の -.B CLONE_PARENT -の項も参照のこと) - -.\"O The main use of -.\"O .BR clone () -.\"O is to implement threads: multiple threads of control in a program that -.\"O run concurrently in a shared memory space. -.BR clone () -の主要な使用法はスレッド (threads) を実装することである: -一つのプログラムの中の複数のスレッドは共有されたメモリ空間で -同時に実行される。 - -.\"O When the child process is created with -.\"O .BR clone (), -.\"O it executes the function -.\"O application -.\"O .IR fn ( arg ). -.\"O (This differs from -.\"O .BR fork (2), -.\"O where execution continues in the child from the point -.\"O of the -.\"O .BR fork (2) -.\"O call.) -.\"O The -.\"O .I fn -.\"O argument is a pointer to a function that is called by the child -.\"O process at the beginning of its execution. -.\"O The -.\"O .I arg -.\"O argument is passed to the -.\"O .I fn -.\"O function. -.BR clone () -で子プロセスが作成された時に、作成された子プロセスは関数 -.IR fn ( arg ) -を実行する。 -(この点が -.BR fork (2) -とは異なる。 -.BR fork (2) -の場合、子プロセスは -.BR fork (2) -が呼び出された場所から実行を続ける。) -.I fn -引き数は、子プロセスが実行を始める時に子プロセスが呼び出す -関数へのポインタである。 -.I arg -引き数はそのまま -.I fn -関数へと渡される。 - -.\"O When the -.\"O .IR fn ( arg ) -.\"O function application returns, the child process terminates. -.\"O The integer returned by -.\"O .I fn -.\"O is the exit code for the child process. -.\"O The child process may also terminate explicitly by calling -.\"O .BR exit (2) -.\"O or after receiving a fatal signal. -.IR fn ( arg ) -関数が終了すると、子プロセスは終了する。 -.I fn -によって返された整数が子プロセスの終了コードとなる。 -子プロセスは、 -.BR exit (2) -を呼んで明示的に終了することもあるし、致命的なシグナルを受信した -場合に終了することもある。 - -.\"O The -.\"O .I child_stack -.\"O argument specifies the location of the stack used by the child process. -.\"O Since the child and calling process may share memory, -.\"O it is not possible for the child process to execute in the -.\"O same stack as the calling process. -.\"O The calling process must therefore -.\"O set up memory space for the child stack and pass a pointer to this -.\"O space to -.\"O .BR clone (). -.I child_stack -引き数は、子プロセスによって使用されるスタックの位置を指定する。 -子プロセスと呼び出し元のプロセスはメモリを共有することがあるため、 -子プロセスは呼び出し元のプロセスと同じスタックで実行することができない。 -このため、呼び出し元のプロセスは子プロセスのスタックのためのメモリ空間を -用意して、この空間へのポインタを -.BR clone () -へ渡さなければならない。 -.\"O Stacks grow downward on all processors that run Linux -.\"O (except the HP PA processors), so -.\"O .I child_stack -.\"O usually points to the topmost address of the memory space set up for -.\"O the child stack. -(HP PA プロセッサ以外の) Linux が動作する全てのプロセッサでは、 -スタックは下方 (アドレスが小さい方向) へと伸びる。このため、普通は -.I child_stack -は子プロセスのスタックのために用意したメモリ空間の一番大きい -アドレスを指すようにする。 - -.\"O The low byte of -.\"O .I flags -.\"O contains the number of the -.\"O .I "termination signal" -.\"O sent to the parent when the child dies. -.\"O If this signal is specified as anything other than -.\"O .BR SIGCHLD , -.\"O then the parent process must specify the -.\"O .B __WALL -.\"O or -.\"O .B __WCLONE -.\"O options when waiting for the child with -.\"O .BR wait (2). -.\"O If no signal is specified, then the parent process is not signaled -.\"O when the child terminates. -.I flags -の下位 1 バイトは子プロセスが死んだ場合に親プロセスへと送られる -.I "終了シグナル (termination signal)" -の番号を指定する。このシグナルとして -.B SIGCHLD -以外が指定された場合、親プロセスは、 -.BR wait (2) -で子プロセスを待つ際に、オプションとして -.B __WALL -または -.B __WCLONE -を指定しなければならない。 -どのシグナルも指定されなかった場合、子プロセスが終了した時に親プロセス -にシグナルは送られない。 - -.\"O .I flags -.\"O may also be bitwise-or'ed with zero or more of the following constants, -.\"O in order to specify what is shared between the calling process -.\"O and the child process: -.I flags -には、以下の定数のうち 0個以上をビット毎の論理和 (bitwise-or) -をとったものを指定できる。これらの定数は呼び出し元のプロセスと -子プロセスの間で何を共有するかを指定する: -.TP -.\"O .BR CLONE_CHILD_CLEARTID " (since Linux 2.5.49)" -.BR CLONE_CHILD_CLEARTID " (Linux 2.5.49 以降)" -.\"O Erase child thread ID at location -.\"O .I ctid -.\"O in child memory when the child exits, and do a wakeup on the futex -.\"O at that address. -.\"O The address involved may be changed by the -.\"O .BR set_tid_address (2) -.\"O system call. -.\"O This is used by threading libraries. -子プロセスが終了したときに子プロセスのメモリ内の -.I ctid -が指す場所にある子プロセスのスレッド ID を消去し、 -そのアドレスで futex を wake (起床) させる。 -このアドレスは -.BR set_tid_address (2) -システムコールで変更することができる。 -この機能はスレッドライブラリで使用される。 -.TP -.\"O .BR CLONE_CHILD_SETTID " (since Linux 2.5.49)" -.BR CLONE_CHILD_SETTID " (Linux 2.5.49 以降)" -.\"O Store child thread ID at location -.\"O .I ctid -.\"O in child memory. -子プロセスのメモリ内の -.I ctid -が指す場所に子プロセスのスレッド ID を格納する。 -.TP -.B CLONE_FILES -.\"O If -.\"O .B CLONE_FILES -.\"O is set, the calling process and the child process share the same file -.\"O descriptor table. -.\"O Any file descriptor created by the calling process or by the child -.\"O process is also valid in the other process. -.\"O Similarly, if one of the processes closes a file descriptor, -.\"O or changes its associated flags (using the -.\"O .BR fcntl (2) -.\"O .B F_SETFD -.\"O operation), the other process is also affected. -.B CLONE_FILES -が設定された場合、呼び出し元のプロセスと子プロセスはファイルディスクリプタの -テーブルを共有する。 -呼び出し元プロセスとその子プロセスの一方が作成した -ファイルディスクリプタは、もう一方においても有効である。 -同じように、一方のプロセスがファイルディスクリプタを閉じたり、 -.RB ( fcntl (2) -.B F_SETFD -操作を使って) ディスクリプタに関連するフラグを変更したりすると、 -もう一方のプロセスにも影響する。 - -.\"O If -.\"O .B CLONE_FILES -.\"O is not set, the child process inherits a copy of all file descriptors -.\"O opened in the calling process at the time of -.\"O .BR clone (). -.\"O (The duplicated file descriptors in the child refer to the -.\"O same open file descriptions (see -.\"O .BR open (2)) -.\"O as the corresponding file descriptors in the calling process.) -.\"O Subsequent operations that open or close file descriptors, -.\"O or change file descriptor flags, -.\"O performed by either the calling -.\"O process or the child process do not affect the other process. -.B CLONE_FILES -が設定されていない場合、子プロセスは、 -.BR clone () -が実行された時点で、呼び出し元のプロセスがオープンしている全ての -ファイルディスクリプタのコピーを継承する -(子プロセスの複製されたファイルディスクリプタは、 -対応する呼び出し元のプロセスのファイルディスクリプタと -同じファイル記述 -.RB ( open (2) -参照) を参照する)。 -これ以降に、呼び出し元のプロセスと子プロセスの一方が -ファイルディスクリプタの操作 (ファイルディスクリプタの -オープン・クローズや、ファイルディスクリプタ・フラグの変更) -を行っても、もう一方のプロセスには影響を与えない。 -.TP -.B CLONE_FS -.\"O If -.\"O .B CLONE_FS -.\"O is set, the caller and the child process share the same file system -.\"O information. -.\"O This includes the root of the file system, the current -.\"O working directory, and the umask. -.\"O Any call to -.\"O .BR chroot (2), -.\"O .BR chdir (2), -.\"O or -.\"O .BR umask (2) -.\"O performed by the calling process or the child process also affects the -.\"O other process. -.B CLONE_FS -が設定された場合、呼び出し元のプロセスと子プロセスが同じファイル・システム -情報を共有する。ファイル・システム情報は、ファイル・システムのルート (root)、 -カレント・ワーキング・ディレクトリ (current working directory) -や umask などである。 -呼び出し元のプロセスや子プロセスのどちらか一方によって -.BR chroot (2), -.BR chdir (2), -.BR umask (2) -が呼び出されると、もう一方のプロセスにも影響が及ぶ。 - -.\"O If -.\"O .B CLONE_FS -.\"O is not set, the child process works on a copy of the file system -.\"O information of the calling process at the time of the -.\"O .BR clone () -.\"O call. -.\"O Calls to -.\"O .BR chroot (2), -.\"O .BR chdir (2), -.\"O .BR umask (2) -.\"O performed later by one of the processes do not affect the other process. -.B CLONE_FS -が設定されていない場合、子プロセスは、 -.BR clone () -が実行された時点での、呼び出し元のプロセスのファイル・システム情報のコピーを -使用する。 -これ以降は、呼び出し元のプロセスと子プロセスの一方が -.BR chroot (2), -.BR chdir (2), -.BR umask (2) -を呼び出しても、もう一方のプロセスには影響を与えない。 -.TP -.\"O .BR CLONE_IO " (since Linux 2.6.25)" -.BR CLONE_IO " (Linux 2.6.25 以降)" -.\"O If -.\"O .B CLONE_IO -.\"O is set, then the new process shares an I/O context with -.\"O the calling process. -.\"O If this flag is not set, then (as with -.\"O .BR fork (2)) -.\"O the new process has its own I/O context. -.B CLONE_IO -が設定された場合、新しいプロセスは呼び出し元のプロセスと -I/O コンテキストを共有する。 -このフラグが設定されていない場合には、 -.RB ( fork (2) -の場合と同様) 新しいプロセスは自分専用の I/O コンテキストを持つ。 - -.\" The following based on text from Jens Axboe -.\"O The I/O context is the I/O scope of the disk scheduler (i.e, -.\"O what the I/O scheduler uses to model scheduling of a process's I/O). -.\"O If processes share the same I/O context, -.\"O they are treated as one by the I/O scheduler. -.\"O As a consequence, they get to share disk time. -I/O コンテキストは、ディスクスケジュールの I/O スコープである -(言い換えると、I/O コンテキストは I/O スケジューラがプロセス I/O の -スケジューリングをモデル化するのに使用される)。 -複数のプロセスが同じ I/O コンテキストを共有する場合、 -これらのプロセスは I/O スケジューラからは一つとして扱われる。 -結果として、これらのプロセスはディスクアクセスの時間を共有するようになる。 -.\"O For some I/O schedulers, -.\"O .\" the anticipatory and CFQ scheduler -.\"O if two processes share an I/O context, -.\"O they will be allowed to interleave their disk access. -.\"O If several threads are doing I/O on behalf of the same process -.\"O .RB ( aio_read (3), -.\"O for instance), they should employ -.\"O .BR CLONE_IO -.\"O to get better I/O performance. -.\"O .\" with CFQ and AS. -いくつかの I/O スケジューラでは、 -.\" 予測スケジューラと CFQ スケジューラ -二つのプロセスが I/O コンテキストを共有している場合、 -これらのプロセスはディスクアクセスを交互に行うことができる。 -同じプロセスの複数のスレッドが I/O を実行している場合 -(例えば -.BR aio_read (3))、 -.B CLONE_IO -を利用することで I/O 性能を良くすることができる。 -.\" CFQ と AS の場合 - -.\"O If the kernel is not configured with the -.\"O .B CONFIG_BLOCK -.\"O option, this flag is a no-op. -カーネルの設定が -.B CONFIG_BLOCK -オプション付きでない場合、 -このフラグは何の意味も持たない。 -.TP -.\"O .BR CLONE_NEWIPC " (since Linux 2.6.19)" -.BR CLONE_NEWIPC " (Linux 2.6.19 以降)" -.\"O If -.\"O .B CLONE_NEWIPC -.\"O is set, then create the process in a new IPC namespace. -.\"O If this flag is not set, then (as with -.\"O .BR fork (2)), -.\"O the process is created in the same IPC namespace as -.\"O the calling process. -.\"O This flag is intended for the implementation of containers. -.B CLONE_NEWIPC -が設定された場合、新しい IPC 名前空間 (namespace) でプロセスを作成する。 -このフラグが設定されていない場合、 -.RB ( fork (2) -の場合と同様) 呼び出し元のプロセスと同じ IPC 名前空間でプロセスが -作成される。 -このフラグは、コンテナの実装での使用を意図して用意されたものである。 - -.\"O An IPC namespace consists of the set of identifiers for -.\"O System V IPC objects. -.\"O (These objects are created using -.\"O .BR msgctl (2), -.\"O .BR semctl (2), -.\"O and -.\"O .BR shmctl (2)). -.\"O Objects created in an IPC namespace are visible to all other processes -.\"O that are members of that namespace, -.\"O but are not visible to processes in other IPC namespaces. -IPC 名前空間は、System V IPC オブジェクト用の識別子 (identifiers) の -集合で構成される -(System V IPC オブジェクトは -.BR msgctl (2), -.BR semctl (2), -.BR shmctl (2) -を使って作成される)。 -ある IPC 名前空間に作成されたオブジェクトは、 -その名前空間のメンバーである他のすべてのプロセスからも見えるが、 -違う IPC 名前空間のプロセスからは見えない。 - -.\"O When an IPC namespace is destroyed -.\"O (i.e, when the last process that is a member of the namespace terminates), -.\"O all IPC objects in the namespace are automatically destroyed. -IPC 名前空間が破棄される時 -(すなわち、その名前空間のメンバーの最後のプロセスが終了する時)、 -その名前空間の全ての IPC オブジェクトは自動的に破棄される。 - -.\"O Use of this flag requires: a kernel configured with the -.\"O .B CONFIG_SYSVIPC -.\"O and -.\"O .B CONFIG_IPC_NS -.\"O options and that the process be privileged -.\"O .RB ( CAP_SYS_ADMIN ). -.\"O This flag can't be specified in conjunction with -.\"O .BR CLONE_SYSVSEM . -このフラグを使用するためには、 -カーネルでオプション -.B CONFIG_SYSVIPC -と -.B CONFIG_IPC_NS -を有効になっていること、 -プロセスが特権 -.RB ( CAP_SYS_ADMIN ) -を持っていることが必要である。 -このフラグは -.B CLONE_SYSVSEM -と組み合わせて使うことはできない。 -.TP -.\"O .BR CLONE_NEWNET " (since Linux 2.6.24)" -.BR CLONE_NEWNET " (Linux 2.6.24 以降)" -.\"O (The implementation of this flag was only completed -.\"O by about kernel version 2.6.29.) -(このフラグの実装は、Linux 2.6.29 あたりまでに完成した。) - -.\"O If -.\"O .B CLONE_NEWNET -.\"O is set, then create the process in a new network namespace. -.\"O If this flag is not set, then (as with -.\"O .BR fork (2)), -.\"O the process is created in the same network namespace as -.\"O the calling process. -.\"O This flag is intended for the implementation of containers. -.B CLONE_NEWNET -が設定された場合、新しいネットワーク名前空間 (network namaspace) -でプロセスを作成する。 -このフラグが設定されていない場合、 -.RB ( fork (2) -の場合と同様) 呼び出し元のプロセスと同じネットワーク名前空間でプロセスが -作成される。 -このフラグは、コンテナの実装での使用を意図して用意されたものである。 - -.\"O A network namespace provides an isolated view of the networking stack -.\"O (network device interfaces, IPv4 and IPv6 protocol stacks, -.\"O IP routing tables, firewall rules, the -.\"O .I /proc/net -.\"O and -.\"O .I /sys/class/net -.\"O directory trees, sockets, etc.). -.\"O A physical network device can live in exactly one -.\"O network namespace. -.\"O A virtual network device ("veth") pair provides a pipe-like abstraction -.\"O that can be used to create tunnels between network namespaces, -.\"O and can be used to create a bridge to a physical network device -.\"O in another namespace. -ネットワーク名前空間は、分離されたネットワークスタックを提供するものである -(ネットワークスタックとは、 -ネットワークデバイスインタフェース、IPv4 や IPv6 プロトコルスタック、 -.IR /proc/net 、 -.I /sys/class/net -ディレクトリツリー、ソケットなどである)。 -物理ネットワークデバイスが所属できるネットワーク名前空間は一つだけである。 -仮想ネットワークデバイス ("veth") のペアにより -パイプ風の抽象化 (abstraction) が実現されており、 -これを使うことで、ネットワーク名前空間間のトンネルを作成したり、 -別の名前空間の物理ネットワークデバイスへのブリッジを作成したり -することができる。 - -.\"O When a network namespace is freed -.\"O (i.e., when the last process in the namespace terminates), -.\"O its physical network devices are moved back to the -.\"O initial network namespace (not to the parent of the process). -ネットワーク名前空間が解放される時 -(すなわち、その名前空間の最後のプロセスが終了する時)、 -物理ネットワークデバイスは初期ネットワーク名前空間 -(initial network namespace) に戻される -(親プロセスのネットワーク名前空間に戻される訳ではない)。 - -.\"O Use of this flag requires: a kernel configured with the -.\"O .B CONFIG_NET_NS -.\"O option and that the process be privileged -.\"O .RB ( CAP_SYS_ADMIN ). -このフラグを使用するためには、 -カーネルでオプション -.B CONFIG_NET_NS -を有効になっていること、 -プロセスが特権 -.RB ( CAP_SYS_ADMIN ) -を持っていることが必要である。 -.TP -.\"O .BR CLONE_NEWNS " (since Linux 2.4.19)" -.BR CLONE_NEWNS " (Linux 2.4.19 以降)" -.\"O Start the child in a new mount namespace. -子プロセスを新しいマウント名前空間 (mount namespace) で開始する。 - -.\"O Every process lives in a mount namespace. -.\"O The -.\"O .I namespace -.\"O of a process is the data (the set of mounts) describing the file hierarchy -.\"O as seen by that process. -.\"O After a -.\"O .BR fork (2) -.\"O or -.\"O .BR clone () -.\"O where the -.\"O .B CLONE_NEWNS -.\"O flag is not set, the child lives in the same mount -.\"O namespace as the parent. -各プロセスはある一つのマウント名前空間中に存在する。プロセスの -.I "名前空間 (namespace)" -は、そのプロセスから見えるファイル階層を表すデータ (mount の集合) である。 -.B CLONE_NEWNS -フラグがセットされずに -.BR fork (2) -か -.BR clone () -が呼ばれると、子プロセスは親プロセスと同じマウント名前空間に作成される。 -.\"O The system calls -.\"O .BR mount (2) -.\"O and -.\"O .BR umount (2) -.\"O change the mount namespace of the calling process, and hence affect -.\"O all processes that live in the same namespace, but do not affect -.\"O processes in a different mount namespace. -システムコール -.BR mount (2)、 -.BR umount (2) -が呼ばれると呼び出し元のプロセスのマウント名前空間が変更され、この結果 -呼び出し元のプロセスと同じ名前空間にいるプロセスはすべて影響を受けるが、 -異なるマウント名前空間にいるプロセスは影響を受けない。 - -.\"O After a -.\"O .BR clone () -.\"O where the -.\"O .B CLONE_NEWNS -.\"O flag is set, the cloned child is started in a new mount namespace, -.\"O initialized with a copy of the namespace of the parent. -.B CLONE_NEWNS -フラグがセットされて -.BR clone () -が呼ばれると、clone で作成された子プロセスは新しいマウント名前空間で -開始される。新しい名前空間は親プロセスの名前空間のコピーで初期化される。 - -.\"O Only a privileged process (one having the \fBCAP_SYS_ADMIN\fP capability) -.\"O may specify the -.\"O .B CLONE_NEWNS -.\"O flag. -.\"O It is not permitted to specify both -.\"O .B CLONE_NEWNS -.\"O and -.\"O .B CLONE_FS -.\"O in the same -.\"O .BR clone () -.\"O call. -特権プロセス (\fBCAP_SYS_ADMIN\fP ケーパビリティを持つプロセス) のみが -.B CLONE_NEWNS -フラグを指定することができる。 -一つの -.BR clone () -呼び出しで、 -.B CLONE_NEWNS -と -.B CLONE_FS -の両方を指定することはできない。 -.TP -.\"O .BR CLONE_NEWPID " (since Linux 2.6.24)" -.BR CLONE_NEWPID " (Linux 2.6.24 以降)" -.\" This explanation draws a lot of details from -.\" http://lwn.net/Articles/259217/ -.\" Authors: Pavel Emelyanov -.\" and Kir Kolyshkin -.\" -.\" The primary kernel commit is 30e49c263e36341b60b735cbef5ca37912549264 -.\" Author: Pavel Emelyanov -.\"O If -.\"O .B CLONE_NEWPID -.\"O is set, then create the process in a new PID namespace. -.\"O If this flag is not set, then (as with -.\"O .BR fork (2)), -.\"O the process is created in the same PID namespace as -.\"O the calling process. -.\"O This flag is intended for the implementation of containers. -.B CLONE_NEWPID -が設定された場合、新しい PID 名前空間でプロセスを作成する。 -このフラグが設定されていない場合、 -.RB ( fork (2) -の場合と同様) 呼び出し元のプロセスと同じ PID 名前空間で -プロセスが作成される。 -このフラグは、コンテナの実装での使用を意図して用意されたものである。 - -.\"O A PID namespace provides an isolated environment for PIDs: -.\"O PIDs in a new namespace start at 1, -.\"O somewhat like a standalone system, and calls to -.\"O .BR fork (2), -.\"O .BR vfork (2), -.\"O or -.\"O .BR clone () -.\"O will produce processes with PIDs that are unique within the namespace. -PID 名前空間は、PID に関して分離された環境を提供するものである。 -新しい名前空間における PID は 1 から始まり -(これはスタンドアロンのシステムと似たような感じ)、 -.BR fork (2), -.BR vfork (2), -.BR clone () -を呼び出すと、その名前空間で一意な PID を持ったプロセスが作成される。 - -.\"O The first process created in a new namespace -.\"O (i.e., the process created using the -.\"O .BR CLONE_NEWPID -.\"O flag) has the PID 1, and is the "init" process for the namespace. -.\"O Children that are orphaned within the namespace will be reparented -.\"O to this process rather than -.\"O .BR init (8). -.\"O Unlike the traditional -.\"O .B init -.\"O process, the "init" process of a PID namespace can terminate, -.\"O and if it does, all of the processes in the namespace are terminated. -新しい名前空間で作成される最初のプロセス -(つまり、 -.B CLONE_NEWPID -フラグを使って作成されたプロセス) の PID は 1 であり、 -このプロセスはその名前空間における "init" プロセスとなる。 -この名前空間において孤児 (orphaned) となった子プロセスについては、 -.BR init (8) -ではなくこのプロセスが親プロセスとなる。 -昔ながらの -.B init -プロセスとは違い、PID 名前空間の "init" プロセスは終了 (terminated) する -ことができ、その場合には、この名前空間の全てのプロセスが終了される。 - -.\"O PID namespaces form a hierarchy. -PID 名前空間間には階層構造が形成される。 -.\"O When a new PID namespace is created, -.\"O the processes in that namespace are visible -.\"O in the PID namespace of the process that created the new namespace; -.\"O analogously, if the parent PID namespace is itself -.\"O the child of another PID namespace, -.\"O then processes in the child and parent PID namespaces will both be -.\"O visible in the grandparent PID namespace. -新しい PID 名前空間が作成されると、その名前空間のプロセスは、 -新しい名前空間を作成したプロセスの PID 名前空間で見える。 -同様に、親の PID 名前空間自体が別の PID 名前空間の子供の場合には、 -子供の PID 名前空間と親の PID 名前空間のプロセスはどれも -親の親の PID 名前空間でも見えることになる。 -.\"O Conversely, the processes in the "child" PID namespace do not see -.\"O the processes in the parent namespace. -.\"O The existence of a namespace hierarchy means that each process -.\"O may now have multiple PIDs: -.\"O one for each namespace in which it is visible; -.\"O each of these PIDs is unique within the corresponding namespace. -.\"O (A call to -.\"O .BR getpid (2) -.\"O always returns the PID associated with the namespace in which -.\"O the process lives.) -反対に、「子供」の PID 名前空間のプロセスには、 -親の名前空間のプロセスは見えない。 -名前空間に階層構造が存在するということは、個々のプロセスは -複数の PID を持つということを意味している。 -そのプロセスが見える名前空間一つにつき PID が一つあり、 -それぞれの PID は対応する名前空間において一意である。 -.RB ( getpid (2) -を呼び出すと、常にそのプロセスが存在している名前空間における -PID が返される。) - -.\"O After creating the new namespace, -.\"O it is useful for the child to change its root directory -.\"O and mount a new procfs instance at -.\"O .I /proc -.\"O so that tools such as -.\"O .BR ps (1) -.\"O work correctly. -新しい名前空間の作成後には、 -子プロセスにおいて、 -.BR ps (1) -といったツールが正しく動作するように、 -自身の root ディレクトリを変更し、 -.I /proc -に新しい procfs インスタンスをマウントするのがよいだろう。 -.\" mount -t proc proc /proc -.\"O (If -.\"O .BR CLONE_NEWNS -.\"O is also included in -.\"O .IR flags , -.\"O then it isn't necessary to change the root directory: -.\"O a new procfs instance can be mounted directly over -.\"O .IR /proc .) -.RB ( flags -に -.B CLONE_NEWNS -も指定されていた場合には、root ディレクトリを変更する必要はなく、 -いきなり新しい procfs インスタンスを -.I /proc -にマウントすることができる。) - -.\"O Use of this flag requires: a kernel configured with the -.\"O .B CONFIG_PID_NS -.\"O option and that the process be privileged -.\"O .RB ( CAP_SYS_ADMIN ). -.\"O This flag can't be specified in conjunction with -.\"O .BR CLONE_THREAD . -このフラグを使用するためには、 -カーネルでオプション -.B CONFIG_PID_NS -を有効になっていること、 -プロセスが特権 -.RB ( CAP_SYS_ADMIN ) -を持っていることが必要である。 -このフラグは -.B CLONE_THREAD -と組み合わせて使うことはできない。 -.TP -.\"O .BR CLONE_NEWUTS " (since Linux 2.6.19)" -.BR CLONE_NEWUTS " (Linux 2.6.19 以降)" -.\"O If -.\"O .B CLONE_NEWUTS -.\"O is set, then create the process in a new UTS namespace, -.\"O whose identifiers are initialized by duplicating the identifiers -.\"O from the UTS namespace of the calling process. -.\"O If this flag is not set, then (as with -.\"O .BR fork (2)), -.\"O the process is created in the same UTS namespace as -.\"O the calling process. -.\"O This flag is intended for the implementation of containers. -.B CLONE_NEWUTS -が設定された場合、新しい UTS 名前空間でプロセスを作成する。 -新しい UTS 名前空間の識別子の初期値は、呼び出し元のプロセスの -UTS 名前空間の識別子を複製したものとなる。 -このフラグが設定されていない場合、 -.RB ( fork (2) -の場合と同様) 呼び出し元のプロセスと同じ UTS 名前空間で -プロセスが作成される。 -このフラグは、コンテナの実装での使用を意図して用意されたものである。 - -.\"O A UTS namespace is the set of identifiers returned by -.\"O .BR uname (2); -.\"O among these, the domain name and the host name can be modified by -.\"O .BR setdomainname (2) -.\"O and -.\"O .BR -.\"O .BR sethostname (2), -.\"O respectively. -.\"O Changes made to the identifiers in a UTS namespace -.\"O are visible to all other processes in the same namespace, -.\"O but are not visible to processes in other UTS namespaces. -UTS 名前空間は、 -.BR uname (2) -が返す識別子の集合である。 -識別子としてはドメイン名とホスト名があり、 -それぞれ -.BR setdomainname (2), -.BR sethostname (2) -で修正することができる。 -ある UTS 名前空間における識別子の変更は同じ名前空間の他のすべての -プロセスに見えるが、別の UTS 名前空間のプロセスには見えない。 - -.\"O Use of this flag requires: a kernel configured with the -.\"O .B CONFIG_UTS_NS -.\"O option and that the process be privileged -.\"O .RB ( CAP_SYS_ADMIN ). -このフラグを使用するためには、 -カーネルでオプション -.B CONFIG_UTS_NS -を有効になっていること、 -プロセスが特権 -.RB ( CAP_SYS_ADMIN ) -を持っていることが必要である。 -.TP -.\"O .BR CLONE_PARENT " (since Linux 2.3.12)" -.BR CLONE_PARENT " (Linux 2.3.12 以降)" -.\"O If -.\"O .B CLONE_PARENT -.\"O is set, then the parent of the new child (as returned by -.\"O .BR getppid (2)) -.\"O will be the same as that of the calling process. -.B CLONE_PARENT -が設定された場合、新しい子供の -.RB ( getppid (2) -で返される) 親プロセスは呼び出し元のプロセスの親プロセスと同じになる。 - -.\"O If -.\"O .B CLONE_PARENT -.\"O is not set, then (as with -.\"O .BR fork (2)) -.\"O the child's parent is the calling process. -.B CLONE_PARENT -が設定されていない場合、 -.RB ( fork (2) -と同様に) 呼び出し元のプロセスがその子供の親になる。 - -.\"O Note that it is the parent process, as returned by -.\"O .BR getppid (2), -.\"O which is signaled when the child terminates, so that -.\"O if -.\"O .B CLONE_PARENT -.\"O is set, then the parent of the calling process, rather than the -.\"O calling process itself, will be signaled. -子供が終了した時にシグナルが送られるのは -.BR getppid (2) -が返す親プロセスである点に注意すること。このため -.B CLONE_PARENT -が設定された場合、呼び出し元のプロセスではなく呼び出し元のプロセスの -親プロセスにシグナルが送られる。 -.TP -.\"O .BR CLONE_PARENT_SETTID " (since Linux 2.5.49)" -.BR CLONE_PARENT_SETTID " (Linux 2.5.49 以降)" -.\"O Store child thread ID at location -.\"O .I ptid -.\"O in parent and child memory. -.\"O (In Linux 2.5.32-2.5.48 there was a flag -.\"O .B CLONE_SETTID -.\"O that did this.) -親プロセスと子プロセスのメモリ内の -.I ptid -が指す領域に子プロセスのスレッド ID を格納する。 -(Linux 2.5.32-2.5.48 では、 -同じことをする -.B CLONE_SETTID -というフラグが存在した。) -.TP -.\"O .BR CLONE_PID " (obsolete)" -.BR CLONE_PID " (廃止予定)" -.\"O If -.\"O .B CLONE_PID -.\"O is set, the child process is created with the same process ID as -.\"O the calling process. -.\"O This is good for hacking the system, but otherwise -.\"O of not much use. -.\"O Since 2.3.21 this flag can be -.\"O specified only by the system boot process (PID 0). -.\"O It disappeared in Linux 2.5.16. -.B CLONE_PID -が設定された場合、子プロセスは呼び出し元のプロセスと同じプロセス ID -で作成される。これはシステムをハッキングするのには便利だが、 -それ以外にはあまり使われない。 Linux 2.3.21 以降では、 -システムのブートプロセス (PID 0) だけがこのフラグを指定できる。 -Linux 2.5.16 で削除された。 -.TP -.B CLONE_PTRACE -.\"O If -.\"O .B CLONE_PTRACE -.\"O is specified, and the calling process is being traced, -.\"O then trace the child also (see -.\"O .BR ptrace (2)). -.B CLONE_PTRACE -が指定され、かつ呼び出し元のプロセスが追跡 (trace) されていた場合、子プロセスも -同様に追跡される。 -.RB ( ptrace (2) -を参照のこと) -.TP -.\"O .BR CLONE_SETTLS " (since Linux 2.5.32)" -.BR CLONE_SETTLS " (Linux 2.5.32 以降)" -.\"O The -.\"O .I newtls -.\"O argument is the new TLS (Thread Local Storage) descriptor. -.\"O (See -.\"O .BR set_thread_area (2).) -.I newtls -引き数は、新しい TLS (Thread Local Storage) ディスクリプタである。 -.RB ( set_thread_area (2) -を参照のこと) -.TP -.B CLONE_SIGHAND -.\"O If -.\"O .B CLONE_SIGHAND -.\"O is set, the calling process and the child process share the same table of -.\"O signal handlers. -.\"O If the calling process or child process calls -.\"O .BR sigaction (2) -.\"O to change the behavior associated with a signal, the behavior is -.\"O changed in the other process as well. -.\"O However, the calling process and child -.\"O processes still have distinct signal masks and sets of pending -.\"O signals. -.\"O So, one of them may block or unblock some signals using -.\"O .BR sigprocmask (2) -.\"O without affecting the other process. -.B CLONE_SIGHAND -が設定された場合、呼び出し元のプロセスと子プロセスは同じシグナル・ハン -ドラのテーブルを共有する。呼び出し元のプロセスまたは子プロセスのどちらかが -.BR sigaction (2) -を呼び出してシグナルに対応する動作を変更した場合、 -もう一方のプロセスのシグナル動作も変更される。 -但し、呼び出し元のプロセスと子プロセスは、 -プロセス毎に、シグナル・マスク (signal mask) と処理待ちシグナルの集合 -を持っている。このため、あるプロセスは、 -.BR sigprocmask (2) -を使用して、もう一方のプロセスに影響を与えずに -シグナルを禁止 (block) したり許可 (unblock) したりできる。 - -.\"O If -.\"O .B CLONE_SIGHAND -.\"O is not set, the child process inherits a copy of the signal handlers -.\"O of the calling process at the time -.\"O .BR clone () -.\"O is called. -.\"O Calls to -.\"O .BR sigaction (2) -.\"O performed later by one of the processes have no effect on the other -.\"O process. -.B CLONE_SIGHAND -が設定されていない場合、子プロセスは -.BR clone () -が実行された時点での、呼び出し元のプロセスのシグナル・ハンドラの -コピーを継承する。これ以降は、一方のプロセスが -.BR sigaction (2) -を呼び出しても、もう一方のプロセスには影響を与えない。 - -.\"O Since Linux 2.6.0-test6, -.\"O .I flags -.\"O must also include -.\"O .B CLONE_VM -.\"O if -.\"O .B CLONE_SIGHAND -.\"O is specified -Linux 2.6.0-test6 以降では、 -.B CLONE_SIGHAND -を指定する場合、 -.B CLONE_VM -も -.I flags -に含めなければならない。 -.TP -.\"O .BR CLONE_STOPPED " (since Linux 2.6.0-test2)" -.BR CLONE_STOPPED " (Linux 2.6.0-test2 以降)" -.\"O If -.\"O .B CLONE_STOPPED -.\"O is set, then the child is initially stopped (as though it was sent a -.\"O .B SIGSTOP -.\"O signal), and must be resumed by sending it a -.\"O .B SIGCONT -.\"O signal. -.B CLONE_STOPPED -が設定されると、子プロセスは最初 -.RB ( SIGSTOP -シグナルを送られたかのように) 停止した状態となる。 -子プロセスを再開させるには -.B SIGCONT -シグナルを送信しなければならない。 - -.\"O .I "From Linux 2.6.25 this flag is deprecated." -.\"O You probably never wanted to use it, -.\"O you certainly shouldn't be using it, and soon it will go away. -.I "Linux 2.6.25 以降、このフラグは非推奨である。" -このフラグを使いたいと思うことは決してないだろうし、 -確実に使わないようにすべきである。 -このフラグは近いうちになくなることだろう。 -.\" glibc 2.8 removed this defn from bits/sched.h -.TP -.\"O .BR CLONE_SYSVSEM " (since Linux 2.5.10)" -.BR CLONE_SYSVSEM " (Linux 2.5.10 以降)" -.\"O If -.\"O .B CLONE_SYSVSEM -.\"O is set, then the child and the calling process share -.\"O a single list of System V semaphore undo values (see -.\"O .BR semop (2)). -.\"O If this flag is not set, then the child has a separate undo list, -.\"O which is initially empty. -.B CLONE_SYSVSEM -がセットされると、子プロセスと呼び出し元プロセスは一つの -System V セマフォのアンドゥ値リスト -.RB ( semop (2) -参照) を共有する。このフラグがセットされていなければ、 -子プロセスは独自のアンドゥリストを持つ (リストの初期値は空である)。 -.TP -.\"O .BR CLONE_THREAD " (since Linux 2.4.0-test8)" -.BR CLONE_THREAD " (Linux 2.4.0-test8以降)" -.\"O If -.\"O .B CLONE_THREAD -.\"O is set, the child is placed in the same thread group as the calling process. -.\"O To make the remainder of the discussion of -.\"O .B CLONE_THREAD -.\"O more readable, the term "thread" is used to refer to the -.\"O processes within a thread group. -.B CLONE_THREAD -が設定された場合、子プロセスは呼び出し元のプロセスと同じスレッド・グループに -置かれる。 -.B CLONE_THREAD -についての以降の議論を読みやすくするため、 -「スレッド」という用語はスレッド・グループの中のプロセスを -参照するのに使うこととする。 - -.\"O Thread groups were a feature added in Linux 2.4 to support the -.\"O POSIX threads notion of a set of threads that share a single PID. -.\"O Internally, this shared PID is the so-called -.\"O thread group identifier (TGID) for the thread group. -.\"O Since Linux 2.4, calls to -.\"O .BR getpid (2) -.\"O return the TGID of the caller. -スレッド・グループは、 スレッド集合で一つの PID を共有するという POSIX -スレッドの概念をサポートするために Linux 2.4 に加えられた機能であった。 -内部的には、この共有 PID はいわゆるそのスレッドグループの -スレッド・グループ識別子 (TGID) である。 -Linux 2.4 以降では、 -.BR getpid (2) -の呼び出しではそのプロセスのスレッド・グループ ID を返す。 - -.\"O The threads within a group can be distinguished by their (system-wide) -.\"O unique thread IDs (TID). -.\"O A new thread's TID is available as the function result -.\"O returned to the caller of -.\"O .BR clone (), -.\"O and a thread can obtain -.\"O its own TID using -.\"O .BR gettid (2). -あるグループに属するスレッドは (システム全体で) 一意なスレッド ID (TID) -で区別できる。新しいスレッドの TID は -.BR clone () -の呼び出し元へ関数の結果として返され、 -スレッドは自分自身の TID を -.BR gettid (2) -で取得できる。 - -.\"O When a call is made to -.\"O .BR clone () -.\"O without specifying -.\"O .BR CLONE_THREAD , -.\"O then the resulting thread is placed in a new thread group -.\"O whose TGID is the same as the thread's TID. -.\"O This thread is the -.\"O .I leader -.\"O of the new thread group. -.B CLONE_THREAD -を指定せずに -.BR clone () -の呼び出しが行われると、 -生成されたスレッドはそのスレッドの TID と同じ値の TGID を持つ -新しいスレッド・グループに置かれる。このスレッドは -新しいスレッド・グループの「リーダー」である。 - -.\"O A new thread created with -.\"O .B CLONE_THREAD -.\"O has the same parent process as the caller of -.\"O .BR clone () -.\"O (i.e., like -.\"O .BR CLONE_PARENT ), -.\"O so that calls to -.\"O .BR getppid (2) -.\"O return the same value for all of the threads in a thread group. -.B CLONE_THREAD -を指定して作成された新しいスレッドは、 -.RB ( CLONE_PARENT -の場合と同様に) -.BR clone () -を呼び出し元と同じ親プロセスを持つ。 -そのため、 -.BR getppid (2) -を呼ぶと、一つのスレッド・グループに属すスレッドは全て同じ値を返す。 -.\"O When a -.\"O .B CLONE_THREAD -.\"O thread terminates, the thread that created it using -.\"O .BR clone () -.\"O is not sent a -.\"O .B SIGCHLD -.\"O (or other termination) signal; -.\"O nor can the status of such a thread be obtained -.\"O using -.\"O .BR wait (2). -.\"O (The thread is said to be -.\"O .IR detached .) -.B CLONE_THREAD -で作られたスレッドが終了した際に、 -そのスレッドを -.BR clone () -を使って生成したスレッドには -.B SIGCHLD -(もしくは他の終了シグナル) は送信されない。 -また、 -.BR wait (2) -を使って終了したスレッドの状態を取得することもできない -(そのようなスレッドは -.I detached -(分離された) といわれる)。 - -.\"O After all of the threads in a thread group terminate -.\"O the parent process of the thread group is sent a -.\"O .B SIGCHLD -.\"O (or other termination) signal. -スレッド・グループに属す全てのスレッドが終了した後、 -そのスレッド・グループの親プロセスに -.B SIGCHLD -(もしくは他の終了シグナル) が送られる。 - -.\"O If any of the threads in a thread group performs an -.\"O .BR execve (2), -.\"O then all threads other than the thread group leader are terminated, -.\"O and the new program is executed in the thread group leader. -スレッド・グループに属すいずれかのスレッドが -.BR execve (2) -を実行すると、スレッド・グループ・リーダー以外の全てのスレッドは -終了され、新しいプロセスがそのスレッド・グループ・リーダーの下で -実行される。 - -.\"O If one of the threads in a thread group creates a child using -.\"O .BR fork (2), -.\"O then any thread in the group can -.\"O .BR wait (2) -.\"O for that child. -スレッド・グループに属すスレッドの一つが -.BR fork (2) -を使って子プロセスを作成した場合、 -スレッド・グループのどのスレッドであっても -その子供を -.BR wait (2) -できる。 - -.\"O Since Linux 2.5.35, -.\"O .I flags -.\"O must also include -.\"O .B CLONE_SIGHAND -.\"O if -.\"O .B CLONE_THREAD -.\"O is specified. -Linux 2.5.35 以降では、 -.B CLONE_THREAD -を指定する場合、 -.I flags -に -.B CLONE_SIGHAND -も含まれていなければならない。 - -.\"O Signals may be sent to a thread group as a whole (i.e., a TGID) using -.\"O .BR kill (2), -.\"O or to a specific thread (i.e., TID) using -.\"O .BR tgkill (2). -.BR kill (2) -を使ってスレッド・グループ全体 (つまり TGID) にシグナルを送ることもできれば、 -.BR tgkill (2) -を使って特定のスレッド (つまり TID) にシグナルを送ることもできる。 - -.\"O Signal dispositions and actions are process-wide: -.\"O if an unhandled signal is delivered to a thread, then -.\"O it will affect (terminate, stop, continue, be ignored in) -.\"O all members of the thread group. -シグナルの配送と処理はプロセス全体に影響する: -ハンドラを設定していないシグナルがあるスレッドに配送されると、 -そのシグナルはスレッド・グループの全メンバーに影響を及ぼす -(終了したり、停止したり、動作を継続したり、無視されたりする)。 - -.\"O Each thread has its own signal mask, as set by -.\"O .BR sigprocmask (2), -.\"O but signals can be pending either: for the whole process -.\"O (i.e., deliverable to any member of the thread group), -.\"O when sent with -.\"O .BR kill (2); -.\"O or for an individual thread, when sent with -.\"O .BR tgkill (2). -.\"O A call to -.\"O .BR sigpending (2) -.\"O returns a signal set that is the union of the signals pending for the -.\"O whole process and the signals that are pending for the calling thread. -各々のスレッドは独自のシグナルマスクを持っており、 -.BR sigprocmask (2) -で設定できる。 -だが、処理待ちのシグナルには、 -.BR kill (2) -で送信されるプロセス全体に対するもの (つまり、スレッド・グループの -どのメンバーにも配送できるもの) と、 -.BR tgkill (2) -で送信される個々のスレッドに対するものがありえる。 -.BR sigpending (2) -を呼び出すと、プロセス全体に対する処理待ちシグナルと呼び出し元の -スレッドに対する処理待ちシグナルを結合したシグナル集合が返される。 - -.\"O If -.\"O .BR kill (2) -.\"O is used to send a signal to a thread group, -.\"O and the thread group has installed a handler for the signal, then -.\"O the handler will be invoked in exactly one, arbitrarily selected -.\"O member of the thread group that has not blocked the signal. -.\"O If multiple threads in a group are waiting to accept the same signal using -.\"O .BR sigwaitinfo (2), -.\"O the kernel will arbitrarily select one of these threads -.\"O to receive a signal sent using -.\"O .BR kill (2). -.BR kill (2) -を使ってスレッド・グループにシグナルが送られた場合で、 -そのスレッド・グループがそのシグナルに対するシグナル・ハンドラが -登録されていたときには、シグナル・ハンドラはスレッド・グループの -メンバーのうち、ただ一つのスレッドでだけ起動される。ハンドラが -起動されるスレッドは、そのシグナルを禁止 (block) していない -メンバーの中から一つだけが勝手に (arbitrarily) 選ばれる。 -スレッド・グループに属す複数のスレッドが -.BR sigwaitinfo (2) -を使って同じシグナルを待っている場合、 -これらのスレッドの中から一つをカーネルが勝手に選択し、 -そのスレッドが -.B kill (2) -を使って送信されたシグナルを受信する。 -.TP -.\"O .BR CLONE_UNTRACED " (since Linux 2.5.46)" -.BR CLONE_UNTRACED " (Linux 2.5.46 以降)" -.\"O If -.\"O .B CLONE_UNTRACED -.\"O is specified, then a tracing process cannot force -.\"O .B CLONE_PTRACE -.\"O on this child process. -.B CLONE_UNTRACED -が指定されると、 trace を行っているプロセスは -この子プロセスに -.B CLONE_PTRACE -を適用することができない。 -.TP -.B CLONE_VFORK -.\"O If -.\"O .B CLONE_VFORK -.\"O is set, the execution of the calling process is suspended -.\"O until the child releases its virtual memory -.\"O resources via a call to -.\"O .BR execve (2) -.\"O or -.\"O .BR _exit (2) -.\"O (as with -.\"O .BR vfork (2)). -.B CLONE_VFORK -が設定された場合、 -.RB ( vfork (2) -と同様に) 子プロセスが -.BR execve (2) -または -.BR _exit (2) -によって仮想メモリを解放するまで、呼び出し元のプロセスの実行は停止される。 - -.\"O If -.\"O .B CLONE_VFORK -.\"O is not set then both the calling process and the child are schedulable -.\"O after the call, and an application should not rely on execution occurring -.\"O in any particular order. -.B CLONE_VFORK -が設定されていない場合、 -.BR clone () -呼び出し後は、呼び出し元のプロセスと子プロセスの -両方がスケジュール対象となり、アプリケーションはこれらのプロセスの -実行順序に依存しないようにすべきである。 -.TP -.B CLONE_VM -.\"O If -.\"O .B CLONE_VM -.\"O is set, the calling process and the child process run in the same memory -.\"O space. -.\"O In particular, memory writes performed by the calling process -.\"O or by the child process are also visible in the other process. -.\"O Moreover, any memory mapping or unmapping performed with -.\"O .BR mmap (2) -.\"O or -.\"O .BR munmap (2) -.\"O by the child or calling process also affects the other process. -.B CLONE_VM -が設定された場合、呼び出し元のプロセスと子プロセスは同じメモリ空間で -実行される。特に、呼び出し元のプロセスや子プロセスの一方がメモリに -書き込んだ内容はもう一方のプロセスからも見ることができる。さらに、 -子プロセスや呼び出し元のプロセスの一方が -.BR mmap (2) -や -.BR munmap (2) -を使ってメモリをマップしたりアンマップした場合、 -もう一方のプロセスにも影響が及ぶ。 - -.\"O If -.\"O .B CLONE_VM -.\"O is not set, the child process runs in a separate copy of the memory -.\"O space of the calling process at the time of -.\"O .BR clone (). -.\"O Memory writes or file mappings/unmappings performed by one of the -.\"O processes do not affect the other, as with -.\"O .BR fork (2). -.B CLONE_VM -が設定されていない場合、子プロセスは -.BR clone () -が実行された時点での、親プロセスのメモリ空間をコピーした -別のメモリ空間で実行される。 -一方のプロセスが行ったメモリへの書き込みや -ファイルのマップ/アンマップは、 -.BR fork (2) -の場合と同様、もう一方のプロセスには影響しない。 -.SS "sys_clone" -.\"O The -.\"O .B sys_clone -.\"O system call corresponds more closely to -.\"O .BR fork (2) -.\"O in that execution in the child continues from the point of the -.\"O call. -.\"O Thus, -.\"O .B sys_clone -.\"O only requires the -.\"O .I flags -.\"O and -.\"O .I child_stack -.\"O arguments, which have the same meaning as for -.\"O .BR clone (). -.\"O (Note that the order of these arguments differs from -.\"O .BR clone ().) -.B sys_clone -システムコールは、より -.BR fork (2) -に近いかたちになっており、子プロセスの実行が呼び出しが行われた場所から -続けられる。 -そのため、 -.B sys_clone -が必要とする引き数は -.I flags -と -.I child_stack -だけであり、それらは -.BR clone () -と同じ意味を持つ -(これらの引き数の順番は -.BR clone () -とは異なることに注意せよ)。 - -.\"O Another difference for -.\"O .B sys_clone -.\"O is that the -.\"O .I child_stack -.\"O argument may be zero, in which case copy-on-write semantics ensure that the -.\"O child gets separate copies of stack pages when either process modifies -.\"O the stack. -.\"O In this case, for correct operation, the -.\"O .B CLONE_VM -.\"O option should not be specified. -.B sys_clone -のもう一つの違いは、 -.I child_stack -引き数がゼロでも良いことである。この場合には、どちらかのプロセスが -スタックを変更した時に、書き込み時コピー (copy-on-write) 方式により -子プロセスがスタック・ページの独立したコピーを得られることが保証される。 -この場合、正常に動作させるためには、 -.B CLONE_VM -オプションを指定してはならない。 - -.\"O In Linux 2.4 and earlier, -.\"O .BR clone () -.\"O does not take arguments -.\"O .IR ptid , -.\"O .IR tls , -.\"O and -.\"O .IR ctid . -Linux 2.4 以前では、 -.BR clone () -は引き数 -.IR ptid , -.IR tls , -.IR ctid -を取らない。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O .\" gettid(2) returns current->pid; -.\"O .\" getpid(2) returns current->tgid; -.\"O On success, the thread ID of the child process is returned -.\"O in the caller's thread of execution. -.\"O On failure, \-1 is returned -.\"O in the caller's context, no child process will be created, and -.\"O .I errno -.\"O will be set appropriately. -.\" gettid(2) は current->pid を返す -.\" getpid(2) は current->tgid を返す -成功した場合、呼び出し元の実行スレッドには子プロセスのスレッドID が返される。 -失敗した場合、 呼び出し元のコンテキストには \-1 が返され、子プロセスは -作成されず、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EAGAIN -.\"O Too many processes are already running. -すでに実行中のプロセスが多すぎる。 -.TP -.B EINVAL -.\"O .B CLONE_SIGHAND -.\"O was specified, but -.\"O .B CLONE_VM -.\"O was not. -.\"O (Since Linux 2.6.0-test6.) -.B CLONE_SIGHAND -が指定されていたが、 -.B CLONE_VM -が指定されていなかった。 -(Linux 2.6.0-test6 以降) -.TP -.B EINVAL -.\"O .B CLONE_THREAD -.\"O was specified, but -.\"O .B CLONE_SIGHAND -.\"O was not. -.\"O (Since Linux 2.5.35.) -.B CLONE_THREAD -が指定されていたが、 -.B CLONE_SIGHAND -が指定されていなかった。 -(Linux 2.5.35 以降) -.\" .TP -.\" .B EINVAL -.\"O .\" Precisely one of -.\"O .\" .B CLONE_DETACHED -.\"O .\" and -.\"O .\" .B CLONE_THREAD -.\"O .\" was specified. -.\"O .\" (Since Linux 2.6.0-test6.) -.\" .B CLONE_DETACHED -.\" と -.\" .B CLONE_THREAD -.\" のいずれか一方だけが指定された。 -.\" (Linux 2.6.0-test6 以降) -.TP -.B EINVAL -.\"O Both -.\"O .B CLONE_FS -.\"O and -.\"O .B CLONE_NEWNS -.\"O were specified in -.\"O .IR flags . -.B CLONE_FS -と -.B CLONE_NEWNS -の両方が -.I flags -に指定された。 -.TP -.B EINVAL -.\"O Both -.\"O .B CLONE_NEWIPC -.\"O and -.\"O .B CLONE_SYSVSEM -.\"O were specified in -.\"O .IR flags . -.B CLONE_NEWIPC -と -.B CLONE_SYSVSEM -の両方が -.I flags -に指定された。 -.TP -.B EINVAL -.\"O Both -.\"O .BR CLONE_NEWPID -.\"O and -.\"O .BR CLONE_THREAD -.\"O were specified in -.\"O .IR flags . -.B CLONE_NEWPID -と -.B CLONE_THREAD -の両方が -.I flags -に指定された。 -.TP -.B EINVAL -.\"O Returned by -.\"O .BR clone () -.\"O when a zero value is specified for -.\"O .IR child_stack . -.I child_stack -にゼロを指定した場合に -.BR clone () -が返す。 -.TP -.B EINVAL -.\"O .BR CLONE_NEWIPC -.\"O was specified in -.\"O .IR flags , -.\"O but the kernel was not configured with the -.\"O .B CONFIG_SYSVIPC -.\"O and -.\"O .BR CONFIG_IPC_NS -.\"O options. -.I flags -に -.B CLONE_NEWIPC -が指定されたが、カーネルでオプション -.B CONFIG_SYSVIPC -と -.B CONFIG_IPC_NS -が有効になっていなかった。 -.TP -.B EINVAL -.\"O .BR CLONE_NEWNET -.\"O was specified in -.\"O .IR flags , -.\"O but the kernel was not configured with the -.\"O .B CONFIG_NET_NS -.\"O option. -.I flags -に -.B CLONE_NEWNET -が指定されたが、カーネルでオプション -.B CONFIG_NET_NS -が有効になっていなかった。 -.TP -.B EINVAL -.\"O .BR CLONE_NEWPID -.\"O was specified in -.\"O .IR flags , -.\"O but the kernel was not configured with the -.\"O .B CONFIG_PID_NS -.\"O option. -.I flags -に -.B CLONE_NEWPID -が指定されたが、カーネルでオプション -.B CONFIG_PID_NS -が有効になっていなかった。 -.TP -.B EINVAL -.\"O .BR CLONE_NEWUTS -.\"O was specified in -.\"O .IR flags , -.\"O but the kernel was not configured with the -.\"O .B CONFIG_UTS -.\"O option. -.I flags -に -.B CLONE_NEWUTS -が指定されたが、カーネルでオプション -.B CONFIG_UTS -が有効になっていなかった。 -.TP -.B ENOMEM -.\"O Cannot allocate sufficient memory to allocate a task structure for the -.\"O child, or to copy those parts of the caller's context that need to be -.\"O copied. -子プロセスのために確保すべきタスク構造体や、呼び出し元のコンテキストの -一部をコピーするのに必要なメモリを十分に割り当てることができない。 -.TP -.B EPERM -.\"O .BR CLONE_NEWIPC , -.\"O .BR CLONE_NEWNET , -.\"O .BR CLONE_NEWNS , -.\"O .BR CLONE_NEWPID , -.\"O or -.\"O .BR CLONE_NEWUTS -.\"O was specified by an unprivileged process (process without \fBCAP_SYS_ADMIN\fP). -非特権プロセス (\fBCAP_SYS_ADMIN\fP を持たないプロセス) が -.BR CLONE_NEWIPC , -.BR CLONE_NEWNET , -.BR CLONE_NEWNS , -.BR CLONE_NEWPID , -.BR CLONE_NEWUTS -を指定した。 -.TP -.B EPERM -.\"O .B CLONE_PID -.\"O was specified by a process other than process 0. -PID が 0 以外のプロセスによって -.B CLONE_PID -が指定された。 -.\"O .SH VERSIONS -.SH バージョン -.\"O There is no entry for -.\"O .BR clone () -.\"O in libc5. -.\"O glibc2 provides -.\"O .BR clone () -.\"O as described in this manual page. -libc5 には -.BR clone () -はない。glibc2 では -.BR clone () -が提供されており、このマニュアルページに記載の通りである。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -.\"O The -.\"O .BR clone () -.\"O and -.\"O .B sys_clone -.\"O calls are Linux-specific and should not be used in programs -.\"O intended to be portable. -.BR clone () -と -.B sys_clone -コールは Linux 特有であり、移植を考慮したプログラムでは使用すべき -ではない。 -.\"O .SH NOTES -.SH 注意 -.\"O In the kernel 2.4.x series, -.\"O .B CLONE_THREAD -.\"O generally does not make the parent of the new thread the same -.\"O as the parent of the calling process. -.\"O However, for kernel versions 2.4.7 to 2.4.18 the -.\"O .B CLONE_THREAD -.\"O flag implied the -.\"O .B CLONE_PARENT -.\"O flag (as in kernel 2.6). -カーネル 2.4.x 系列では、一般的には -.B CLONE_THREAD -フラグを指定しても新しいスレッドの親を -呼び出し元プロセスの親と同じにはしない。 -しかし、バージョン 2.4.7〜2.4.18 のカーネルでは、 -(カーネル 2.6 と同じように) CLONE_THREAD フラグを指定すると、 -暗黙のうちに CLONE_PARENT フラグを指定したことになる。 - -.\"O For a while there was -.\"O .B CLONE_DETACHED -.\"O (introduced in 2.5.32): -.\"O parent wants no child-exit signal. -.\"O In 2.6.2 the need to give this -.\"O together with -.\"O .B CLONE_THREAD -.\"O disappeared. -.\"O This flag is still defined, but has no effect. -.B CLONE_DETACHED -というフラグが、2.5.32 で導入されて以来しばらくの間存在した。 -このフラグは親プロセスが子プロセス終了のシグナルを必要としないことを -表すものである。 -2.6.2 で、 CLONE_DETATCHED を CLONE_THREAD と一緒に指定する必要はなくなった。 -このフラグはまだ定義されているが、何の効果もない。 - -.\"O On i386, -.\"O .BR clone () -.\"O should not be called through vsyscall, but directly through -.\"O .IR "int $0x80" . -i386 上では、 -.BR clone () -は vsyscall 経由ではなく、直接 -.I "int $0x80" -経由で呼び出すべきである。 - -.\"O On ia64, a different system call is used: -ia64 では、別のシステムコールが使用される: -.nf - -.BI "int __clone2(int (*" "fn" ")(void *), " -.BI " void *" child_stack_base ", size_t " stack_size , -.BI " int " flags ", void *" "arg" ", ... " -.BI " /* pid_t *" ptid ", struct user_desc *" tls \ -", pid_t *" ctid " */ );" -.fi -.PP -.\"O The -.\"O .BR __clone2 () -.\"O system call operates in the same way as -.\"O .BR clone (), -.\"O except that -.\"O .I child_stack_base -.\"O points to the lowest address of the child's stack area, -.\"O and -.\"O .I stack_size -.\"O specifies the size of the stack pointed to by -.\"O .IR child_stack_base . -.BR __clone2 () -システムコールは -.BR clone () -と同じように動作するが、以下の点が異なる: -.I child_stack_base -は子プロセスのスタックエリアの最小のアドレスを指し、 -.I stack_size -は -.I child_stack_base -が指し示すスタックエリアの大きさを示す。 -.\"O .SH BUGS -.SH バグ -.\"O Versions of the GNU C library that include the NPTL threading library -.\"O contain a wrapper function for -.\"O .BR getpid (2) -.\"O that performs caching of PIDs. -NPTL スレッド・ライブラリを含んでいる GNU C ライブラリのいくつかのバージョン -には、 -.BR getpid (2) -のラッパー関数が含まれており、このラッパー関数は PID をキャッシュする。 -.\"O This caching relies on support in the glibc wrapper for -.\"O .BR clone (), -.\"O but as currently implemented, -.\"O the cache may not be up to date in some circumstances. -このキャッシュ処理が正しく動作するためには glibc の -.BR clone () -のラッパー関数での助けが必要だが、現状の実装では、 -ある状況下においてキャッシュが最新とならない可能性がある。 -.\"O In particular, -.\"O if a signal is delivered to the child immediately after the -.\"O .BR clone () -.\"O call, then a call to -.\"O .BR getpid (2) -.\"O in a handler for the signal may return the PID -.\"O of the calling process ("the parent"), -.\"O if the clone wrapper has not yet had a chance to update the PID -.\"O cache in the child. -特に、 -.BR clone () -の呼び出し直後にシグナルが子プロセスに配送された場合に、 -そのシグナルに対するハンドラ内で -.BR getpid (2) -を呼び出すと、それまでに clone のラッパー関数が子プロセスの PID キャッシュを -更新する機会が得られていなければ、呼び出し元プロセス ("親プロセス") の PID が -返される可能性がある。 -.\"O (This discussion ignores the case where the child was created using -.\"O .BR CLONE_THREAD , -.\"O when -.\"O .BR getpid (2) -.\"O .I should -.\"O return the same value in the child and in the process that called -.\"O .BR clone (), -.\"O since the caller and the child are in the same thread group. -.\"O The stale-cache problem also does not occur if the -.\"O .I flags -.\"O argument includes -.\"O .BR CLONE_VM .) -(この議論では、子プロセスが -.B CLONE_THREAD -を使って作成された場合のことは無視している。 -子プロセスが -.B CLONE_THREAD -を作って作成された場合には、 -呼び出し元と子プロセスは同じスレッド・グループに属すので、 -.BR getpid (2) -は子プロセスと -.BR clone () -を呼び出したプロセスで同じ値を返すのが「正しい」。 -キャッシュが最新とならない問題 (stale-cache problem) は、 -.I flags -に -.B CLONE_VM -が含まれている場合にも発生しない。) -.\"O To get the truth, it may be necessary to use code such as the following: -本当の値を得るためには、次のようなコードを使う必要があるかもしれない。 -.nf - - #include - - pid_t mypid; - - mypid = syscall(SYS_getpid); -.fi -.\" See also the following bug reports -.\" https://bugzilla.redhat.com/show_bug.cgi?id=417521 -.\" http://sourceware.org/bugzilla/show_bug.cgi?id=6910 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR fork (2), -.BR futex (2), -.BR getpid (2), -.BR gettid (2), -.BR set_thread_area (2), -.BR set_tid_address (2), -.BR tkill (2), -.BR unshare (2), -.BR wait (2), -.BR capabilities (7), -.BR pthreads (7) diff --git a/draft/man2/close.2 b/draft/man2/close.2 index dc55c6b8..985de5b9 100644 --- a/draft/man2/close.2 +++ b/draft/man2/close.2 @@ -29,177 +29,56 @@ .\" corrected description of effect on locks (thanks to .\" Tigran Aivazian ). .\" Modified Fri Jan 31 16:21:46 1997 by Eric S. Raymond -.\" Modified 2000-07-22 by Nicolas Lichtmaier +.\" Modified 2000-07-22 by Nicolás Lichtmaier .\" added note about close(2) not guaranteeing that data is safe on close. .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Sat Jun 1 22:22:05 JST 1997 -.\" by HANATAKA Shinya -.\" Modified Mon Sep 23 20:42:13 JST 2000 -.\" by HANATAKA Shinya -.\" Updated & Modified Sat Apr 7 03:24:03 JST 2001 -.\" by Yuichi SATO -.\" Updated & Modified Mon Jan 14 12:41:36 JST 2002 by Yuichi SATO -.\" Updated & Modified Wed Dec 29 07:01:14 JST 2004 -.\" by Yuichi SATO -.\" Updated 2007-10-12, Akihiro MOTOKI, LDP v2.66 -.\" Updated 2008-02-10, Akihiro MOTOKI , LDP v2.77 +.\"******************************************************************* .\" -.\"WORD: descriptor ディスクリプタ -.\"WORD: close クローズ -.\"WORD: lock ロック -.\"WORD: process プロセス -.\"WORD: quota クォータ +.\" This file was generated with po4a. Translate the source file. .\" -.TH CLOSE 2 2007-12-28 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH CLOSE 2 2007\-12\-28 Linux "Linux Programmer's Manual" .SH 名前 -.\"O close \- close a file descriptor close \- ファイルディスクリプタをクローズする -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int close(int " fd ); +\fBint close(int \fP\fIfd\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR close () -.\"O closes a file descriptor, so that it no longer refers to any file and -.\"O may be reused. Any record locks (see -.\"O .BR fcntl (2)) -.\"O held on the file it was associated with, -.\"O and owned by the process, are removed (regardless of the file -.\"O descriptor that was used to obtain the lock). -.BR close () -は、ファイルディスクリプタをクローズする。 -そのディスクリプタは、どのファイルも参照していない状態になり、 -再利用が可能になる。 -そのファイルディスクリプタに関連づけられたファイルに -かけられたレコード・ロック -.RB ( fcntl (2) -参照) のうち、そのプロセスが保有しているものは、 -(そのファイルディスクリプタがロック取得に利用されたか -どうかによらず) すべて削除される。 +\fBclose\fP() は、ファイルディスクリプタをクローズする。 そのディスクリプタは、どのファイルも参照していない状態になり、 再利用が可能になる。 +そのファイルディスクリプタに関連づけられたファイルに かけられたレコード・ロック (\fBfcntl\fP(2) 参照) +のうち、そのプロセスが保有しているものは、 (そのファイルディスクリプタがロック取得に利用されたか どうかによらず) すべて削除される。 .PP -.\"O If -.\"O .I fd -.\"O is the last file descriptor referring to the underlying -.\"O open file description (see -.\"O .BR open (2)), -.\"O the resources associated with the open file description are freed; -.\"O if the descriptor was the last reference to a file which has been -.\"O removed using -.\"O .BR unlink (2) -.\"O the file is deleted. -.I fd -が、対応するオープンファイル記述 (open file description) -.RB ( open (2) -参照) を参照する最後のファイルディスクリプタだった場合、 -オープンファイル記述に関連するリソースが解放される。 -そのディスクリプタが、 -.B unlink -を使用して削除 (remove) されたファイルに対する最後の参照だった場合には、 -そのファイルは削除 (delete) される。 -.\"O .SH "RETURN VALUE" +\fIfd\fP が、対応するオープンファイル記述 (open file description) (\fBopen\fP(2) 参照) +を参照する最後のファイルディスクリプタだった場合、 オープンファイル記述に関連するリソースが解放される。 そのディスクリプタが、 \fBunlink\fP +を使用して削除 (remove) されたファイルに対する最後の参照だった場合には、 そのファイルは削除 (delete) される。 .SH 返り値 -.\"O .BR close () -.\"O returns zero on success. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -.BR close () -は成功した場合は 0 を返す。 -エラーが発生した場合は \-1 を返して、 -.I errno -を適切に設定する。 -.\"O .SH ERRORS +\fBclose\fP() は成功した場合は 0 を返す。 エラーが発生した場合は \-1 を返して、 \fIerrno\fP を適切に設定する。 .SH エラー -.TP -.B EBADF -.\"O .I fd -.\"O isn't a valid open file descriptor. -.I fd -が有効なオープンされたディスクリプタでない。 -.TP -.B EINTR -.\"O The -.\"O .BR close () -.\"O call was interrupted by a signal; see -.\"O .BR signal (7). -.BR close () -コールがシグナルにより中断 (interrupt) された。 -.BR signal (7) -参照。 -.TP -.B EIO -.\"O An I/O error occurred. +.TP +\fBEBADF\fP +\fIfd\fP が有効なオープンされたディスクリプタでない。 +.TP +\fBEINTR\fP +\fBclose\fP() コールがシグナルにより中断 (interrupt) された。 \fBsignal\fP(7) 参照。 +.TP +\fBEIO\fP I/O エラーが発生した。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O SVr4, 4.3BSD, POSIX.1-2001. -.\"O .\" SVr4 documents an additional ENOLINK error condition. -SVr4, 4.3BSD, POSIX.1-2001. -.\" SVr4, SVID, POSIX, X/OPEN, 4.3BSD に準拠する。 -.\" SVr4 には他に ENOLINK エラー状態についての記述がある。 -.\"O .SH "NOTES" +.\" SVr4 documents an additional ENOLINK error condition. +SVr4, 4.3BSD, POSIX.1\-2001. .SH 注意 -.\"O Not checking the return value of -.\"O .BR close () -.\"O is a common but nevertheless -.\"O serious programming error. -.\"O It is quite possible that errors on a -.\"O previous -.\"O .BR write (2) -.\"O operation are first reported at the final -.\"O .BR close (). -.\"O Not checking the return value when closing the file may lead to -.\"O silent loss of data. -.\"O This can especially be observed with NFS -.\"O and with disk quota. -.BR close () -の返り値のチェックはよく省略されるが、 -これは深刻なプログラミングエラーである。 -前の -.BR write (2) -処理に関するエラーが最後の -.BR close () -のときになって初めて通知される場合がありうる。 -ファイルクローズの際に返り値をチェックしないと、 -気付かないうちにデータを失ってしまうかもしれない。 -これは特に NFS やディスク・クォータを使用した場合に見られる。 +\fBclose\fP() の返り値のチェックはよく省略されるが、 これは深刻なプログラミングエラーである。 前の \fBwrite\fP(2) +処理に関するエラーが最後の \fBclose\fP() のときになって初めて通知される場合がありうる。 ファイルクローズの際に返り値をチェックしないと、 +気付かないうちにデータを失ってしまうかもしれない。 これは特に NFS やディスク・クォータを使用した場合に見られる。 .PP -.\"O A successful close does not guarantee that the data has been successfully -.\"O saved to disk, as the kernel defers writes. -.\"O Is not common for a file system -.\"O to flush the buffers when the stream is closed. -.\"O If you need to be sure that -.\"O the data is physically stored use -.\"O .BR fsync (2). -.\"O (It will depend on the disk hardware at this point.) -クローズに成功しても、データがディスクに保存されたかどうかは -保証されない (カーネルが書きこみを遅延させることがあるためである)。 -ストリームがクローズされるときにバッファをフラッシュするかどうかは、 -ファイルシステムによって異なる。 -データが物理的に保存されることを保証する必要がある場合には、 -.BR fsync (2) -を使用すること -.RB ( fsync (3) -を行った時点で、データの保存はディスクのハードウェアに依存する -問題となる)。 +クローズに成功しても、データがディスクに保存されたかどうかは 保証されない (カーネルが書きこみを遅延させることがあるためである)。 +ストリームがクローズされるときにバッファをフラッシュするかどうかは、 ファイルシステムによって異なる。 +データが物理的に保存されることを保証する必要がある場合には、 \fBfsync\fP(2) を使用すること (\fBfsync\fP(3) +を行った時点で、データの保存はディスクのハードウェアに依存する 問題となる)。 .PP -.\"O It is probably unwise to close file descriptors while -.\"O they may be in use by system calls in -.\"O other threads in the same process. -.\"O Since a file descriptor may be reused, -.\"O there are some obscure race conditions -.\"O that may cause unintended side effects. -同じプロセス内の他のスレッドのシステムコールが使用している可能性がある間に、 -ファイルディスクリプタをクローズするのは、おそらく賢明ではないだろう。 -ファイルディスクリプタは再利用されるかもしれないので、 -あいまいな競合条件となることがあり、意図しない副作用の原因となりうる。 .\" Date: Tue, 4 Sep 2007 13:57:35 +0200 .\" From: Fredrik Noring .\" One such race involves signals and ERESTARTSYS. If a file descriptor @@ -208,11 +87,8 @@ SVr4, 4.3BSD, POSIX.1-2001. .\" call has restared after ERESTARTSYS, the original system call will .\" later restart with the reused file descriptor. This is most likely a .\" serious programming error. -.\"O .SH "SEE ALSO" +同じプロセス内の他のスレッドのシステムコールが使用している可能性がある間に、 ファイルディスクリプタをクローズするのは、おそらく賢明ではないだろう。 +ファイルディスクリプタは再利用されるかもしれないので、 あいまいな競合条件となることがあり、意図しない副作用の原因となりうる。 .SH 関連項目 -.BR fcntl (2), -.BR fsync (2), -.BR open (2), -.BR shutdown (2), -.BR unlink (2), -.BR fclose (3) +\fBfcntl\fP(2), \fBfsync\fP(2), \fBopen\fP(2), \fBshutdown\fP(2), \fBunlink\fP(2), +\fBfclose\fP(3) diff --git a/draft/man2/connect.2 b/draft/man2/connect.2 index af6a4062..43b943d0 100644 --- a/draft/man2/connect.2 +++ b/draft/man2/connect.2 @@ -62,379 +62,120 @@ .\" Modified 1998, 1999 by Andi Kleen .\" Modified 2004-06-23 by Michael Kerrisk .\" -.\" Japanese Version Copyright (c) 1996 Yosiaki Yanagihara -.\" all rights reserved. -.\" Translated 1996-06-25, Yosiaki Yanagihara -.\" Updated & Modified 1997-11-06, HANATAKA Shinya -.\" Updated & Modified 1999-08-14, HANATAKA Shinya -.\" Updated & Modified 2000-01-13, Kentaro Shirakata -.\" Updated & Modified 2005-02-23, Akihiro MOTOKI -.\" Updated & Modified 2005-10-05, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH CONNECT 2 2008-12-03 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH CONNECT 2 2008\-12\-03 Linux "Linux Programmer's Manual" .SH 名前 -.\"O connect \- initiate a connection on a socket connect \- ソケットの接続を行う -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .BR "#include " " /* See NOTES */" -.BR "#include " " /* 「注意」参照 */" +\fB#include \fP /* 「注意」参照 */ .br -.B #include +\fB#include \fP .sp -.BI "int connect(int " sockfd ", const struct sockaddr *" addr , -.BI " socklen_t " addrlen ); +\fBint connect(int \fP\fIsockfd\fP\fB, const struct sockaddr *\fP\fIaddr\fP\fB,\fP +\fB socklen_t \fP\fIaddrlen\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR connect () -.\"O system call connects the socket referred to by the file descriptor -.\"O .I sockfd -.\"O to the address specified by -.\"O .IR addr . -.\"O The -.\"O .I addrlen -.\"O argument specifies the size of -.\"O .IR addr . -.\"O The format of the address in -.\"O .I addr -.\"O is determined by the address space of the socket -.\"O .IR sockfd ; -.\"O see -.\"O .BR socket (2) -.\"O for further details. -.BR connect () -システムコールは、ファイルディスクリプタ -.I sockfd -が参照しているソケットを -.I addr -で指定されたアドレスに接続する。 -.I addrlen -引き数は -.I addr -の大きさを示す。 -.I addr -のアドレスのフォーマットはソケット -.I sockfd -のアドレス空間により異なる。 -さらなる詳細は -.BR socket (2) -を参照のこと。 +\fBconnect\fP() システムコールは、ファイルディスクリプタ \fIsockfd\fP が参照しているソケットを \fIaddr\fP +で指定されたアドレスに接続する。 \fIaddrlen\fP 引き数は \fIaddr\fP の大きさを示す。 \fIaddr\fP のアドレスのフォーマットはソケット +\fIsockfd\fP のアドレス空間により異なる。 さらなる詳細は \fBsocket\fP(2) を参照のこと。 -.\"O If the socket -.\"O .I sockfd -.\"O is of type -.\"O .B SOCK_DGRAM -.\"O then -.\"O .I addr -.\"O is the address to which datagrams are sent by default, and the only -.\"O address from which datagrams are received. -.\"O If the socket is of type -.\"O .B SOCK_STREAM -.\"O or -.\"O .BR SOCK_SEQPACKET , -.\"O this call attempts to make a connection to the socket that is bound -.\"O to the address specified by -.\"O .IR addr . -ソケット -.I sockfd -が -.B SOCK_DGRAM -型であれば、 -.I addr -は、デフォルトのデータグラムの送信先のアドレスであり、 -データグラムを受信する唯一のアドレスを示すに過ぎない。 -ソケットが -.B SOCK_STREAM -型もしくは -.B SOCK_SEQPACKET -型であれば、このシステムコールは -.I addr -で指定されたアドレスに結び付けられたソケットに対する接続の -作成を試みる。 +ソケット \fIsockfd\fP が \fBSOCK_DGRAM\fP 型であれば、 \fIaddr\fP は、デフォルトのデータグラムの送信先のアドレスであり、 +データグラムを受信する唯一のアドレスを示すに過ぎない。 ソケットが \fBSOCK_STREAM\fP 型もしくは \fBSOCK_SEQPACKET\fP +型であれば、このシステムコールは \fIaddr\fP で指定されたアドレスに結び付けられたソケットに対する接続の 作成を試みる。 .PP -.\"O Generally, connection-based protocol sockets may successfully -.\"O .BR connect () -.\"O only once; connectionless protocol sockets may use -.\"O .BR connect () -.\"O multiple times to change their association. -.\"O Connectionless sockets may -.\"O dissolve the association by connecting to an address with the -.\"O .I sa_family -.\"O member of -.\"O .I sockaddr -.\"O set to -.\"O .BR AF_UNSPEC -.\"O (supported on Linux since kernel 2.2). -一般的に、接続指向 (connection-oriented) プロトコルでは一度だけ -.BR connect () -が成功する。 -非接続 (connectionless) プロトコルでは対応を変更するために何度も -.BR connect () -を使用できる。 -非接続ソケットは -.I sockaddr -の -.I sa_family -メンバに -.B AF_UNSPEC -を設定することで、接続アドレスの対応を解消することができる -.RB ( AF_UNSPEC -はカーネル 2.2 以降の Linux でサポート)。 -.\"O .SH "RETURN VALUE" +一般的に、接続指向 (connection\-oriented) プロトコルでは一度だけ \fBconnect\fP() が成功する。 非接続 +(connectionless) プロトコルでは対応を変更するために何度も \fBconnect\fP() を使用できる。 非接続ソケットは +\fIsockaddr\fP の \fIsa_family\fP メンバに \fBAF_UNSPEC\fP を設定することで、接続アドレスの対応を解消することができる +(\fBAF_UNSPEC\fP はカーネル 2.2 以降の Linux でサポート)。 .SH 返り値 -.\"O If the connection or binding succeeds, zero is returned. -.\"O On error, \-1 is -.\"O returned, and -.\"O .I errno -.\"O is set appropriately. -接続または対応づけに成功するとゼロを返す。 -失敗すると \-1 を返し、 -.I errno -に適切な値を設定する。 -.\"O .SH ERRORS +接続または対応づけに成功するとゼロを返す。 失敗すると \-1 を返し、 \fIerrno\fP に適切な値を設定する。 .SH エラー -.\"O The following are general socket errors only. -.\"O There may be other domain-specific error codes. -以下は一般的なソケットについてのエラーである。他にドメイン特有のエラー -が発生する可能性がある。 -.TP -.B EACCES -.\"O For UNIX domain sockets, which are identified by pathname: -.\"O Write permission is denied on the socket file, -.\"O or search permission is denied for one of the directories -.\"O in the path prefix. -.\"O (See also -.\"O .BR path_resolution (7).) -UNIX ドメインソケットはパス名で識別される。 -ソケット・ファイルへの書き込み許可がなかったか、パス名へ -到達するまでのディレクトリのいずれかに対する検索許可がなかった。 -.RB ( path_resolution (7) -も参照のこと) -.TP -.BR EACCES ", " EPERM -.\"O The user tried to connect to a broadcast address without having the socket -.\"O broadcast flag enabled or the connection request failed because of a local -.\"O firewall rule. -ソケットのブロードキャスト・フラグが有効になっていないのに -ユーザがブロードキャストへ接続を試みた。または、ローカルのファイアウォールの +以下は一般的なソケットについてのエラーである。他にドメイン特有のエラー が発生する可能性がある。 +.TP +\fBEACCES\fP +UNIX ドメインソケットはパス名で識別される。 ソケット・ファイルへの書き込み許可がなかったか、パス名へ +到達するまでのディレクトリのいずれかに対する検索許可がなかった。 (\fBpath_resolution\fP(7) も参照のこと) +.TP +\fBEACCES\fP, \fBEPERM\fP +ソケットのブロードキャスト・フラグが有効になっていないのに ユーザがブロードキャストへ接続を試みた。または、ローカルのファイアウォールの 規則により接続の要求が失敗した。 -.TP -.B EADDRINUSE -.\"O Local address is already in use. +.TP +\fBEADDRINUSE\fP ローカルアドレスが既に使用されている。 -.TP -.B EAFNOSUPPORT -.\"O The passed address didn't have the correct address family in its -.\"O .I sa_family -.\"O field. -渡されたアドレスの -.I sa_family -フィールドが正しいアドレス・ファミリーではない。 -.TP -.B EAGAIN -.\"O No more free local ports or insufficient entries in the routing cache. -.\"O For -.\"O .B AF_INET -.\"O see the description of -.\"O .I /proc/sys/net/ipv4/ip_local_port_range -.\"O .BR ip (7) -.\"O for information on how to increase the number of local ports. -使用可能なローカルのポートがないか、 -ルーティングキャッシュに十分なエントリがない。 -.B AF_INET -の場合に、ローカルポートの数を増やす方法については、 -.BR ip (7) -の -.I /proc/sys/net/ipv4/ip_local_port_range -の説明を参照のこと。 -.TP -.B EALREADY -.\"O The socket is nonblocking and a previous connection attempt has not yet -.\"O been completed. -ソケットが非停止 (nonblocking) に設定されており、 -前の接続が完了していない。 -.TP -.B EBADF -.\"O The file descriptor is not a valid index in the descriptor table. -ファイルディスクリプターがディスクリプターテーブルの -有効なインデックスではない。 -.TP -.B ECONNREFUSED -.\"O No-one listening on the remote address. +.TP +\fBEAFNOSUPPORT\fP +渡されたアドレスの \fIsa_family\fP フィールドが正しいアドレス・ファミリーではない。 +.TP +\fBEAGAIN\fP +使用可能なローカルのポートがないか、 ルーティングキャッシュに十分なエントリがない。 \fBAF_INET\fP +の場合に、ローカルポートの数を増やす方法については、 \fBip\fP(7) の +\fI/proc/sys/net/ipv4/ip_local_port_range\fP の説明を参照のこと。 +.TP +\fBEALREADY\fP +ソケットが非停止 (nonblocking) に設定されており、 前の接続が完了していない。 +.TP +\fBEBADF\fP +ファイルディスクリプターがディスクリプターテーブルの 有効なインデックスではない。 +.TP +\fBECONNREFUSED\fP リモートアドレスで接続を待っているプログラムがない。 -.TP -.B EFAULT -.\"O The socket structure address is outside the user's address space. +.TP +\fBEFAULT\fP ソケット構造体のアドレスがユーザーのアドレス空間外にある。 -.TP -.B EINPROGRESS -.\"O The socket is nonblocking and the connection cannot be completed -.\"O immediately. It is possible to -.\"O .BR select (2) -.\"O or -.\"O .BR poll (2) -.\"O for completion by selecting the socket for writing. -.\"O After -.\"O .BR select (2) -.\"O indicates writability, use -.\"O .BR getsockopt (2) -.\"O to read the -.\"O .B SO_ERROR -.\"O option at level -.\"O .B SOL_SOCKET -.\"O to determine whether -.\"O .BR connect () -.\"O completed successfully -.\"O .RB ( SO_ERROR -.\"O is zero) or unsuccessfully -.\"O .RB ( SO_ERROR -.\"O is one of the usual error codes listed here, -.\"O explaining the reason for the failure). -ソケットが非停止 (nonblocking) に設定されていて、接続をすぐに -完了することができない。その場合、 -.BR select (2) -や -.BR poll (2) -を使ってそのソケットが書き込み可能になるのを待つことで、 -接続の完了を知ることができる。 -.BR select (2) -で書き込み可能になった後に、 -.BR getsockopt (2) -を使って -.B SOL_SOCKET -レベルで -.B SO_ERROR -オプションを読み出すこ -とにより、 -.BR connect () -が成功したか、失敗したかを判断できる。 -成功の場合 -.B SO_ERROR -が 0 であり、 -失敗の場合 -.B SO_ERROR -がここのリストにあるいずれかのエラーコードであり、 -それにより失敗の原因が分かる。 -.TP -.B EINTR -.\"O The system call was interrupted by a signal that was caught; see -.\"O .BR signal (7). -.\"O .\" For TCP, the connection will complete asynchronously. -.\"O .\" See http://lkml.org/lkml/2005/7/12/254 -捕捉されたシグナルによりシステムコールが中断された。 -.BR signal (7) -参照。 -.\" TCP の場合は、接続処理は非同期になるが完了するだろう。 -.\" http://lkml.org/lkml/2005/7/12/254 を参照のこと。 -.TP -.B EISCONN -.\"O The socket is already connected. +.TP +\fBEINPROGRESS\fP +ソケットが非停止 (nonblocking) に設定されていて、接続をすぐに 完了することができない。その場合、 \fBselect\fP(2) や +\fBpoll\fP(2) を使ってそのソケットが書き込み可能になるのを待つことで、 接続の完了を知ることができる。 \fBselect\fP(2) +で書き込み可能になった後に、 \fBgetsockopt\fP(2) を使って \fBSOL_SOCKET\fP レベルで \fBSO_ERROR\fP +オプションを読み出すこ とにより、 \fBconnect\fP() が成功したか、失敗したかを判断できる。 成功の場合 \fBSO_ERROR\fP が 0 +であり、 失敗の場合 \fBSO_ERROR\fP がここのリストにあるいずれかのエラーコードであり、 それにより失敗の原因が分かる。 +.TP +\fBEINTR\fP +.\" For TCP, the connection will complete asynchronously. +.\" See http://lkml.org/lkml/2005/7/12/254 +捕捉されたシグナルによりシステムコールが中断された。 \fBsignal\fP(7) 参照。 +.TP +\fBEISCONN\fP ソケットは既に接続 (connect) されている。 -.TP -.B ENETUNREACH -.\"O Network is unreachable. +.TP +\fBENETUNREACH\fP 到達できないネットワークである。 -.TP -.B ENOTSOCK -.\"O The file descriptor is not associated with a socket. +.TP +\fBENOTSOCK\fP ファイルディスクリプターがソケットと関連付けられていない。 -.TP -.B ETIMEDOUT -.\"O Timeout while attempting connection. -.\"O The server may be too -.\"O busy to accept new connections. -.\"O Note that for IP sockets the timeout may -.\"O be very long when syncookies are enabled on the server. -接続を試みている途中で時間切れ (timeout) になった。サーバーが混雑していて -新たな接続を受け入れられないのかもしれない。 -IP ソケットでは、 syncookie がサーバーで有効になっている場合、 -タイムアウトが非常に長くなる場合があるので注意すること。 -.\"O .SH "CONFORMING TO" +.TP +\fBETIMEDOUT\fP +接続を試みている途中で時間切れ (timeout) になった。サーバーが混雑していて 新たな接続を受け入れられないのかもしれない。 IP ソケットでは、 +syncookie がサーバーで有効になっている場合、 タイムアウトが非常に長くなる場合があるので注意すること。 .SH 準拠 -.\"O SVr4, 4.4BSD, (the -.\"O .BR connect () -.\"O function first appeared in 4.2BSD), POSIX.1-2001. -.\"O .\" SVr4 documents the additional -.\"O .\" general error codes -.\"O .\" .BR EADDRNOTAVAIL , -.\"O .\" .BR EINVAL , -.\"O .\" .BR EAFNOSUPPORT , -.\"O .\" .BR EALREADY , -.\"O .\" .BR EINTR , -.\"O .\" .BR EPROTOTYPE , -.\"O .\" and -.\"O .\" .BR ENOSR . -SVr4, 4.4BSD, -.RB ( connect () -関数は 4.2BSD で最初に登場した), POSIX.1-2001. -.\" SVr4 では、一般的なエラー・コードとして +.\" SVr4 documents the additional +.\" general error codes .\" .BR EADDRNOTAVAIL , .\" .BR EINVAL , .\" .BR EAFNOSUPPORT , .\" .BR EALREADY , .\" .BR EINTR , .\" .BR EPROTOTYPE , -.\" .B ENOSR -.\" が追加されている。 -.\"O .\" It also -.\"O .\" documents many additional error conditions not described here. -.\" また、本マニュアルには記載していない追加のエラー条件が多く記載されている。 -.\"O .SH NOTES +.\" and +.\" .BR ENOSR . +.\" It also +.\" documents many additional error conditions not described here. +SVr4, 4.4BSD, (\fBconnect\fP() 関数は 4.2BSD で最初に登場した), POSIX.1\-2001. .SH 注意 -.\"O POSIX.1-2001 does not require the inclusion of -.\"O .IR , -.\"O and this header file is not required on Linux. -.\"O However, some historical (BSD) implementations required this header -.\"O file, and portable applications are probably wise to include it. -POSIX.1-2001 では -.I -のインクルードは必須とされておらず、 -Linux ではこのヘッダファイルは必要ではない。 -しかし、歴史的には、いくつかの実装 (BSD 系) でこのヘッダファイルが -必要であり、移植性が必要なアプリケーションではこのファイルを -インクルードするのが賢明であろう。 +POSIX.1\-2001 では \fI\fP のインクルードは必須とされておらず、 Linux +ではこのヘッダファイルは必要ではない。 しかし、歴史的には、いくつかの実装 (BSD 系) でこのヘッダファイルが +必要であり、移植性が必要なアプリケーションではこのファイルを インクルードするのが賢明であろう。 -.\"O The third argument of -.\"O .BR connect () -.\"O is in reality an -.\"O .I int -.\"O (and this is what 4.x BSD and libc4 and libc5 have). -.\"O Some POSIX confusion resulted in the present -.\"O .IR socklen_t , -.\"O also used by glibc. -.\"O See also -.\"O .BR accept (2). -.BR connect () -の三番目の引き数は 4.x BSD や libc4, libc5 と同様に実際には -.I int -である。 -POSIX では紆余曲折を経て現在の -.I socklen_t -になっており、 -glibc でも -.I socklen_t -を使っている。 -.BR accept (2) +\fBconnect\fP() の三番目の引き数は 4.x BSD や libc4, libc5 と同様に実際には \fIint\fP である。 POSIX +では紆余曲折を経て現在の \fIsocklen_t\fP になっており、 glibc でも \fIsocklen_t\fP を使っている。 \fBaccept\fP(2) も参照のこと。 -.\"O .SH EXAMPLE .SH 例 -.\"O An example of the use of -.\"O .BR connect () -.\"O is shown in -.\"O .BR getaddrinfo (3). -.BR connect () -の利用例が -.BR getaddrinfo (3) -に記載されている。 -.\"O .SH "SEE ALSO" +\fBconnect\fP() の利用例が \fBgetaddrinfo\fP(3) に記載されている。 .SH 関連項目 -.BR accept (2), -.BR bind (2), -.BR getsockname (2), -.BR listen (2), -.BR socket (2), -.BR path_resolution (7) +\fBaccept\fP(2), \fBbind\fP(2), \fBgetsockname\fP(2), \fBlisten\fP(2), \fBsocket\fP(2), +\fBpath_resolution\fP(7) diff --git a/draft/man2/dup.2 b/draft/man2/dup.2 index 230fc8cc..5821b305 100644 --- a/draft/man2/dup.2 +++ b/draft/man2/dup.2 @@ -33,332 +33,90 @@ .\" details for dup2(). .\" 2008-10-09, mtk: add description of dup3() .\" -.\" Japanese Version Copyright (c) 1996 Takeshi Ueno -.\" all rights reserved. -.\" Translated 1996-07-03, Takeshi Ueno -.\" Modified 1997-12-14, HANATAKA Shinya -.\" Modified 2003-01-16, Akihiro Motoki -.\" Updated & Modified 2004-05-19, Yuichi SATO -.\" Updated & Modified 2005-09-07, Akihiro MOTOKI -.\" Updated 2008-02-10, Akihiro MOTOKI , LDP v2.77 -.\" Updated 2008-11-09, Akihiro MOTOKI, LDP v3.13 +.\"******************************************************************* .\" -.TH DUP 2 2010-09-10 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O dup, dup2, dup3 \- duplicate a file descriptor +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH DUP 2 2012\-02\-14 Linux "Linux Programmer's Manual" .SH 名前 dup, dup2, dup3 \- ファイル・ディスクリプタを複製する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int dup(int " oldfd ); -.BI "int dup2(int " oldfd ", int " newfd ); +\fBint dup(int \fP\fIoldfd\fP\fB);\fP +\fBint dup2(int \fP\fIoldfd\fP\fB, int \fP\fInewfd\fP\fB);\fP .sp -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" -.B #include +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP /* 定数 O_* の定義の取得 */ +\fB#include \fP .sp -.BI "int dup3(int " oldfd ", int " newfd ", int " flags ); +\fBint dup3(int \fP\fIoldfd\fP\fB, int \fP\fInewfd\fP\fB, int \fP\fIflags\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O These system calls create a copy of the file descriptor -.\"O .IR oldfd . -これらのシステムコールは、ファイル・ディスクリプタ -.I oldfd -の複製を作る。 +これらのシステムコールは、ファイル・ディスクリプタ \fIoldfd\fP の複製を作る。 -.\"O .BR dup () -.\"O uses the lowest-numbered unused descriptor for the new descriptor. -.BR dup () -は最も小さい番号の未使用のディスクリプタを -新しいディスクリプタとして使用する。 +\fBdup\fP() は最も小さい番号の未使用のディスクリプタを 新しいディスクリプタとして使用する。 -.\"O .BR dup2 () -.\"O .RI "makes " newfd " be the copy of " oldfd ", closing " newfd -.\"O first if necessary, but note the following: -.BR dup2 () -は -.I newfd -を -.I oldfd -の複製として作成する。 -必要であれば最初に -.I newfd -をクローズする。 +\fBdup2\fP() は \fInewfd\fP を \fIoldfd\fP の複製として作成する。 必要であれば最初に \fInewfd\fP をクローズする。 以下の点に注意すること。 .IP * 3 -.\"O If -.\"O .I oldfd -.\"O is not a valid file descriptor, then the call fails, and -.\"O .I newfd -.\"O is not closed. -.I oldfd -が有効なファイルディスクリプタでない場合、その呼び出しは失敗し、 -.I newfd -はクローズされない。 +\fIoldfd\fP が有効なファイルディスクリプタでない場合、その呼び出しは失敗し、 \fInewfd\fP はクローズされない。 .IP * -.\"O If -.\"O .I oldfd -.\"O is a valid file descriptor, and -.\"O .I newfd -.\"O has the same value as -.\"O .IR oldfd , -.\"O then -.\"O .BR dup2 () -.\"O does nothing, and returns -.\"O .IR newfd . -.I oldfd -が有効なファイルディスクリプタで、 -.I newfd -が -.I oldfd -と同じ値の場合、 -.BR dup2 () -は何もせず、 -.I newfd -を返す。 +\fIoldfd\fP が有効なファイルディスクリプタで、 \fInewfd\fP が \fIoldfd\fP と同じ値の場合、 \fBdup2\fP() は何もせず、 +\fInewfd\fP を返す。 .PP -.\"O After a successful return from one of these system calls, -.\"O the old and new file descriptors may be used interchangeably. -.\"O They refer to the same open file description (see -.\"O .BR open (2)) -.\"O and thus share file offset and file status flags; -.\"O for example, if the file offset is modified by using -.\"O .BR lseek (2) -.\"O on one of the descriptors, the offset is also changed for the other. -これらのシステムコールのいずれかが成功を返した場合には、 -古いファイル・ディスクリプタと新しいファイル・ディスクリプタは -互いに可換なものとして使うことができる。 -2つのファイル・ディスクリプタは同じファイル記述 (description) -.RB ( open (2) -参照) を参照しており、したがってファイルオフセットやファイル状態フラグが -共有される。例えば、一方のディスクリプタに対して -.BR lseek (2) -を使ってファイルオフセットを変更した場合、もう一方のディスクリプタの -オフセットも変化する。 +これらのシステムコールのいずれかが成功を返した場合には、 古いファイル・ディスクリプタと新しいファイル・ディスクリプタは +互いに可換なものとして使うことができる。 2つのファイル・ディスクリプタは同じファイル記述 (description) (\fBopen\fP(2) +参照) を参照しており、したがってファイルオフセットやファイル状態フラグが 共有される。例えば、一方のディスクリプタに対して \fBlseek\fP(2) +を使ってファイルオフセットを変更した場合、もう一方のディスクリプタの オフセットも変化する。 -.\"O The two descriptors do not share file descriptor flags -.\"O (the close-on-exec flag). -.\"O The close-on-exec flag -.\"O .RB ( FD_CLOEXEC ; -.\"O see -.\"O .BR fcntl (2)) -.\"O for the duplicate descriptor is off. -2つのディスクリプタはファイル・ディスクリプタ・フラグ (close-on-exec flag) -を共有しない。複製されたディスクリプタの -close-on-exec flag -.RB ( fcntl (2) -参照) は off となる。 +2つのディスクリプタはファイル・ディスクリプタ・フラグ (close\-on\-exec flag) を共有しない。複製されたディスクリプタの +close\-on\-exec flag (\fBfcntl\fP(2) 参照) は off となる。 -.\"O .BR dup3 () -.\"O is the same as -.\"O .BR dup2 (), -.\"O except that: -.BR dup3 () -は -.BR dup2 () -と同じだが、以下の点が異なる。 +\fBdup3\fP() は \fBdup2\fP() と同じだが、以下の点が異なる。 .IP * 3 -.\"O The caller can force the close-on-exec flag to be set -.\"O for the new file descriptor by specifying -.\"O .BR O_CLOEXEC -.\"O in -.\"O .IR flags . -.\"O See the description of the same flag in -.\"O .BR open (2) -.\"O for reasons why this may be useful. -呼び出し元が、新しいファイル・ディスクリプタに対して -close-on-exec フラグを強制的に設定することができる。 -これを行うには、 -.I flags -に -.B O_CLOEXEC -を指定する。 -このフラグが役に立つ理由については、 -.BR open (2) -の -.B O_CLOEXEC +呼び出し元が、新しいファイル・ディスクリプタに対して close\-on\-exec フラグを強制的に設定することができる。 これを行うには、 +\fIflags\fP に \fBO_CLOEXEC\fP を指定する。 このフラグが役に立つ理由については、 \fBopen\fP(2) の \fBO_CLOEXEC\fP フラグの説明を参照のこと。 .IP * .\" FIXME . To confirm with Al Viro that this was intended, and its rationale -.\"O If -.\"O .IR oldfd -.\"O equals -.\"O .IR newfd , -.\"O then -.\"O .BR dup3 () -.\"O fails with the error -.\"O .BR EINVAL . -.I oldfd -が -.I newfd -と同じ場合、 -.BR dup3 () -は -.B EINVAL -エラーで失敗する。 -.\"O .SH "RETURN VALUE" +\fIoldfd\fP が \fInewfd\fP と同じ場合、 \fBdup3\fP() は \fBEINVAL\fP エラーで失敗する。 .SH 返り値 -.\"O On success, these system calls -.\"O return the new descriptor. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功すると、これらのシステムコールは新しいディスクリプタを返す。 -エラーの場合、\-1 を返し、 -.I errno -を適切に設定する。 -.\"O .SH ERRORS +成功すると、これらのシステムコールは新しいディスクリプタを返す。 エラーの場合、\-1 を返し、 \fIerrno\fP を適切に設定する。 .SH エラー -.TP -.\"O .B EBADF -.\"O .I oldfd -.\"O isn't an open file descriptor, or -.\"O .I newfd -.\"O is out of the allowed range for file descriptors. -.B EBADF -.I oldfd -がオープンされたファイル・ディスクリプタでないか、 -.I newfd -がファイル・ディスクリプタとして許される範囲から外れている。 -.TP -.B EBUSY -.\"O (Linux only) This may be returned by -.\"O .BR dup2 () -.\"O or -.\"O .BR dup3 () -.\"O during a race condition with -.\"O .BR open (2) -.\"O and -.\"O .BR dup (). -(Linux のみ) -.BR open (2) -や -.BR dup () -との競合状態の場合に、 -.BR dup2 () -や -.BR dup3 () +.TP +\fBEBADF\fP +\fIoldfd\fP がオープンされたファイル・ディスクリプタでないか、 \fInewfd\fP がファイル・ディスクリプタとして許される範囲から外れている。 +.TP +\fBEBUSY\fP +(Linux のみ) \fBopen\fP(2) や \fBdup\fP() との競合状態の場合に、 \fBdup2\fP() や \fBdup3\fP() はこのエラーを返すかもしれない。 -.TP -.B EINTR -.\"O The -.\"O .BR dup2 () -.\"O or -.\"O .BR dup3 () -.\"O call was interrupted by a signal; see -.\"O .BR signal (7). -.BR dup2 () -や -.BR dup3 () -の呼び出しがシグナルにより割り込まれた。 -.BR signal (7) -参照。 -.TP -.B EINVAL -.\"O .RB ( dup3 ()) -.\"O .I flags -.\"O contain an invalid value. -.RB ( dup3 ()) -.I flags -に無効な値が入っている。 +.TP +\fBEINTR\fP +\fBdup2\fP() や \fBdup3\fP() の呼び出しがシグナルにより割り込まれた。 \fBsignal\fP(7) 参照。 +.TP +\fBEINVAL\fP .\" FIXME . To confirm with Al Viro that this was intended, and its rationale -.\"O Or, -.\"O .I oldfd -.\"O was equal to -.\"O .IR newfd . -もしくは、 -.I oldfd -が -.I newfd -と同じであった。 -.TP -.\"O .B EMFILE -.\"O The process already has the maximum number of file -.\"O descriptors open and tried to open a new one. -.B EMFILE -プロセスがすでにオープンできる最大数までファイル・ディスクリプタ -を開いていて、さらに新しいものを開こうとした。 -.\"O .SH VERSIONS +(\fBdup3\fP()) \fIflags\fP に無効な値が入っている。 もしくは、 \fIoldfd\fP が \fInewfd\fP と同じであった。 +.TP +\fBEMFILE\fP +プロセスがすでにオープンできる最大数までファイル・ディスクリプタ を開いていて、さらに新しいものを開こうとした。 .SH バージョン -.\"O .BR dup3 () -.\"O was added to Linux in version 2.6.27; -.\"O glibc support is available starting with -.\"O version 2.9. -.BR dup3 () -はバージョン 2.6.27 で Linux に追加された。 -glibc によるサポートはバージョン 2.9 以降で利用できる。 -.\"O .SH "CONFORMING TO" +\fBdup3\fP() はバージョン 2.6.27 で Linux に追加された。 glibc によるサポートはバージョン 2.9 以降で利用できる。 .SH 準拠 -.BR dup (), -.BR dup2 (): -SVr4, 4.3BSD, POSIX.1-2001. +\fBdup\fP(), \fBdup2\fP(): SVr4, 4.3BSD, POSIX.1\-2001. -.\"O .BR dup3 () -.\"O is Linux-specific. -.BR dup3 () -は Linux 固有である。 -.\"O .\" SVr4 documents additional -.\"O .\" EINTR and ENOLINK error conditions. POSIX.1 adds EINTR. -.\"O .\" The EBUSY return is Linux-specific. -.\" SVr4 には他に EINTR, ENOLINK エラー状態の記述がある。 -.\" POSIX.1 には他に EINTR がある。 -.\" EBUSY が返されるのは Linux 独自のものである。 -.\"O .SH NOTES +.\" SVr4 documents additional +.\" EINTR and ENOLINK error conditions. POSIX.1 adds EINTR. +.\" The EBUSY return is Linux-specific. +\fBdup3\fP() は Linux 固有である。 .SH 注意 -.\"O The error returned by -.\"O .BR dup2 () -.\"O is different from that returned by -.\"O .BR fcntl( "..., " F_DUPFD ", ..." ) -.\"O when -.\"O .I newfd -.\"O is out of range. -.\"O On some systems -.\"O .BR dup2 () -.\"O also sometimes returns -.\"O .B EINVAL -.\"O like -.\"O .BR F_DUPFD . -.I newfd -が範囲を超えた時に返されるエラーは、 -.BR dup2 () -と -.BR fcntl( "..., " F_DUPFD ", ..." ) -では異っている。 -.BR dup2 () -が -.B F_DUPFD -と同じように -.B EINVAL -を返すシステムもある。 +\fInewfd\fP が範囲を超えた時に返されるエラーは、 \fBdup2\fP() と \fBfcntl(\fP..., \fBF_DUPFD\fP, ...\fB)\fP +では異っている。 \fBdup2\fP() が \fBF_DUPFD\fP と同じように \fBEINVAL\fP を返すシステムもある。 -.\"O If -.\"O .I newfd -.\"O was open, any errors that would have been reported at -.\"O .BR close 2() -.\"O time are lost. -.\"O A careful programmer will not use -.\"O .BR dup2 () -.\"O or -.\"O .BR dup3 () -.\"O without closing -.\"O .I newfd -.\"O first. -.I newfd -がオープンされていると、 -.BR close (2) -した時に報告されるはずのエラーが失われてしまう。 -.BR dup2 () -や -.BR dup3 () -を使う前に先ず -.I newfd -をクローズするようにした方がいいだろう。 -.\"O .SH "SEE ALSO" +\fInewfd\fP がオープンされていると、 \fBclose\fP(2) した時に報告されるはずのエラーが失われてしまう。 \fBdup2\fP() や +\fBdup3\fP() を使う前に先ず \fInewfd\fP をクローズするようにした方がいいだろう。 .SH 関連項目 -.BR close (2), -.BR fcntl (2), -.BR open (2) +\fBclose\fP(2), \fBfcntl\fP(2), \fBopen\fP(2) diff --git a/draft/man2/epoll_create.2 b/draft/man2/epoll_create.2 deleted file mode 100644 index 7f2db0dd..00000000 --- a/draft/man2/epoll_create.2 +++ /dev/null @@ -1,217 +0,0 @@ -.\" -.\" epoll by Davide Libenzi ( efficient event notification retrieval ) -.\" Copyright (C) 2003 Davide Libenzi -.\" -.\" This program is free software; you can redistribute it and/or modify -.\" it under the terms of the GNU General Public License as published by -.\" the Free Software Foundation; either version 2 of the License, or -.\" (at your option) any later version. -.\" -.\" This program is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; without even the implied warranty of -.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -.\" GNU General Public License for more details. -.\" -.\" You should have received a copy of the GNU General Public License -.\" along with this program; if not, write to the Free Software -.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -.\" -.\" Davide Libenzi -.\" -.\" Modified 2004-06-17 by Michael Kerrisk -.\" Modified 2005-04-04 by Marko Kohtala -.\" 2008-10-10, mtk: add description of epoll_create1() -.\" -.\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO -.\" all rights reserved. -.\" Translated Wed Jun 9 05:02:07 JST 2004 -.\" by Yuichi SATO -.\" Updated & Modified Wed Dec 29 07:12:00 JST 2004 by Yuichi SATO -.\" Updated & Modified Tue Apr 19 06:51:12 JST 2005 by Yuichi SATO -.\" Updated 2009-03-05 by Kentaro Shirakata -.\" -.\"WORD: backing store バッキングストア -.\" -.TH EPOLL_CREATE 2 2009-01-17 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O epoll_create, epoll_create1 \- open an epoll file descriptor -epoll_create, epoll_create1 \- epoll ファイルディスクリプタをオープンする -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.B #include -.sp -.BI "int epoll_create(int " size ); -.BI "int epoll_create1(int " flags ); -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O .BR epoll_create () -.\"O creates an epoll "instance", -.\"O requesting the kernel to allocate an event backing store dimensioned for -.\"O .I size -.\"O descriptors. -.\"O The -.\"O .I size -.\"O is not the maximum size of the backing store but -.\"O just a hint to the kernel about how to dimension internal structures. -.BR epoll_create () -は、 -.I size -個のディスクリプタを保持できる大きさのイベントバッキング -ストアの割り当てをカーネルに対して要求することにより、 -epoll 「インスタンス」を作成する。 -.I size -はバッキングストアの最大サイズではなく、 -内部構造の大きさをどの位にするかをカーネルに知らせるヒントでしかない。 -.\"O (Nowadays, -.\"O .I size -.\"O is ignored; see NOTES below.) -(現在は -.I size -は無視される。下記の「注意」を参照。) - -.\"O .BR epoll_create () -.\"O returns a file descriptor referring to the new epoll instance. -.\"O This file descriptor is used for all the subsequent calls to the -.\"O .B epoll -.\"O interface. -.\"O When no longer required, the file descriptor returned by -.\"O .BR epoll_create () -.\"O should be closed by using -.\"O .BR close (2). -.BR epoll_create () -は、新しい epoll インスタンスを参照するファイルディスクリプタを返す。 -このファイルディスクリプタは、その後の -.B epoll -インタフェースの呼び出しに使われる。 -もう必要でなくなった場合は、 -.BR epoll_create () -で返されたファイルディスクリプタは -.BR close (2) -を使ってクローズされるべきである。 -.\"O When all file descriptors referring to an epoll instance have been closed, -.\"O the kernel destroys the instance -.\"O and releases the associated resources for reuse. -ある epoll インスタンスを参照する全てのファイルディスクリプタがクローズされると、 -カーネルはそのインスタンスを破壊して、対応するリソースを解放し、 -再使用できるようにする。 - -.\"O If -.\"O .I flags -.\"O is 0, then, other than the fact that the obsolete -.\"O .I size -.\"O argument is dropped, -.\"O .BR epoll_create1 () -.\"O is the same as -.\"O .BR epoll_create (). -.\"O The following value can be included in -.\"O .IR flags -.\"O to obtain different behavior: -.BR epoll_create1 () -は、 -.I flags -が 0 の場合、現在では使われていない -.I size -引き数がなくなっている点を除けば -.BR epoll_create () -と同じである。 -.I flags -に以下の値をビット毎の論理和 (OR) で指定することで、 -異なる動作をさせることができる。 -.TP -.B EPOLL_CLOEXEC -.\"O Set the close-on-exec -.\"O .RB ( FD_CLOEXEC ) -.\"O flag on the new file descriptor. -.\"O See the description of the -.\"O .B O_CLOEXEC -.\"O flag in -.\"O .BR open (2) -.\"O for reasons why this may be useful. -新しいファイルディスクリプタに対して -close-on-exec -.RB ( FD_CLOEXEC ) -フラグをセットする。 -このフラグが役に立つ理由については、 -.BR open (2) -の -.B O_CLOEXEC -フラグの説明を参照のこと。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success, -.\"O these system calls -.\"O return a nonnegative file descriptor. -成功すると、これらのシステムコールは -非負のファイルディスクリプタを返す。 -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set to indicate the error. -エラーの場合、\-1 を返し、 -.I errno -にエラーを示す値を設定する。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EINVAL -.\"O .I size -.\"O is not positive. -.I size -が正でない。 -.TP -.B EINVAL -.\"O .RB ( epoll_create1 ()) -.\"O Invalid value specified in -.\"O .IR flags . -.RB ( epoll_create1 ()) -.I flags -に無効な値が指定された。 -.TP -.B EMFILE -.\"O The per-user limit on the number of epoll instances imposed by -.\"O .I /proc/sys/fs/epoll/max_user_instances -.\"O was encountered. -.\"O See -.\"O .BR epoll (7) -.\"O for further details. -.I /proc/sys/fs/epoll/max_user_instances -によって指定されている、epoll インスタンスのユーザー単位の制限に達した。 -更なる詳細については -.BR epoll (7) -を参照のこと。 -.TP -.B ENFILE -.\"O The system limit on the total number of open files has been reached. -オープンされたファイルの総数がシステム制限に達した。 -.TP -.B ENOMEM -.\"O There was insufficient memory to create the kernel object. -カーネルオブジェクトを作成するのに十分なメモリがなかった。 -.\"O .SH CONFORMING TO -.SH 準拠 -.\"O .BR epoll_create () -.\"O is Linux-specific, and was introduced in kernel 2.5.44. -.BR epoll_create () -は Linux 独自であり、カーネル 2.5.44 で導入された。 -.\"O .\" The interface should be finalized by Linux kernel 2.5.66. -.\" インタフェースは Linux カーネル 2.5.66 で確定されるべきである。 -.\"O .SH NOTES -.SH 注意 -.\"O Since Linux 2.6.8, the -.\"O .I size -.\"O argument is unused. -.\"O (The kernel dynamically sizes the required data structures -.\"O without needing this initial hint.) -Linux 2.6.8 以降では、 -.I size -引き数は使用されない -(カーネルは、動的に必要なデータ構造の大きさを決定し、 -最初のヒントを必要しない)。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR close (2), -.BR epoll_ctl (2), -.BR epoll_wait (2), -.BR epoll (7) diff --git a/draft/man2/epoll_ctl.2 b/draft/man2/epoll_ctl.2 index 9e0dc1ff..8c1b93cf 100644 --- a/draft/man2/epoll_ctl.2 +++ b/draft/man2/epoll_ctl.2 @@ -18,117 +18,38 @@ .\" .\" Davide Libenzi .\" -.\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO -.\" all rights reserved. -.\" Translated 2004-06-15, Yuichi SATO -.\" Updated & Modified 2004-12-29, Yuichi SATO -.\" Updated & Modified 2005-04-20, Yuichi SATO -.\" Updated & Modified 2005-09-06, Akihiro MOTOKI -.\" Updated 2006-07-19, Akihiro MOTOKI , LDP v2.36 -.\" Updated 2009-02-23, Akihiro MOTOKI , LDP v3.19 +.\"******************************************************************* .\" -.TH EPOLL_CTL 2 2010-08-29 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH EPOLL_CTL 2 2012\-04\-15 Linux "Linux Programmer's Manual" .SH 名前 -.\"O epoll_ctl \- control interface for an epoll descriptor epoll_ctl \- epoll ディスクリプタのインタフェースを操作する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int epoll_ctl(int " epfd ", int " op ", int " fd \ -", struct epoll_event *" event ); -.\"O .SH DESCRIPTION +\fBint epoll_ctl(int \fP\fIepfd\fP\fB, int \fP\fIop\fP\fB, int \fP\fIfd\fP\fB, struct +epoll_event *\fP\fIevent\fP\fB);\fP .SH 説明 -.\"O This system call performs control operations on the epoll instance -.\"O referred to by the file descriptor -.\"O .IR epfd . -.\"O It requests that the operation -.\"O .I op -.\"O be performed for the target file descriptor, -.\"O .IR fd . -このシステムコールは、ファイルディスクリプタ -.I epfd -が参照する epoll インスタンスに対する操作を行う。 -対象のファイルディスクリプタ -.I fd -に対して、操作 -.I op -の実行が要求される。 +このシステムコールは、ファイルディスクリプタ \fIepfd\fP が参照する \fBepoll\fP(7) +インスタンスに対する操作を行う。 対象のファイルディスクリプタ \fIfd\fP に対して、 +操作 \fIop\fP の実行が要求される。 -.\"O Valid values for the -.\"O .I op -.\"O argument are : -.I op -引き数に指定できる有効な値は以下の通りである。 -.TP -.B EPOLL_CTL_ADD -.\"O Register the target file descriptor -.\"O .I fd -.\"O on the -.\"O .B epoll -.\"O instance referred to by the file descriptor -.\"O .I epfd -.\"O and associate the event -.\"O .I event -.\"O with the internal file linked to -.\"O .IR fd . -対象のファイルディスクリプタ -.I fd -をファイルディスクリプタ -.I epfd -が参照する -.B epoll -インスタンスに登録し、イベント -.I event -を -.I fd -に結び付けられた内部ファイルに関連付ける。 -.TP -.B EPOLL_CTL_MOD -.\"O Change the event -.\"O .I event -.\"O associated with the target file descriptor -.\"O .IR fd . -イベント -.I event -を対象のファイルディスクリプタ -.I fd -に関連付けるように変更する。 -.TP -.B EPOLL_CTL_DEL -.\"O Remove (deregister) the target file descriptor -.\"O .I fd -.\"O from the -.\"O .B epoll -.\"O instance referred to by -.\"O .IR epfd . -.\"O The -.\"O .I event -.\"O is ignored and can be NULL (but see BUGS below). -対象のファイルディスクリプタ -.I fd -を -.I epfd -が参照する -.B epoll -インスタンスから削除する。 -.I event -引き数は無視されるので、NULL にすることもできる -(但し、下記の「バグ」を参照)。 +\fIop\fP 引き数に指定できる有効な値は以下の通りである。 +.TP +\fBEPOLL_CTL_ADD\fP +対象のファイルディスクリプタ \fIfd\fP をファイルディスクリプタ \fIepfd\fP が参照する \fBepoll\fP インスタンスに登録し、イベント +\fIevent\fP を \fIfd\fP に結び付けられた内部ファイルに関連付ける。 +.TP +\fBEPOLL_CTL_MOD\fP +イベント \fIevent\fP を対象のファイルディスクリプタ \fIfd\fP に関連付けるように変更する。 +.TP +\fBEPOLL_CTL_DEL\fP +対象のファイルディスクリプタ \fIfd\fP を \fIepfd\fP が参照する \fBepoll\fP インスタンスから削除する。 \fIevent\fP +引き数は無視されるので、NULL にすることもできる (但し、下記の「バグ」を参照)。 .PP -.\"O The -.\"O .I event -.\"O argument describes the object linked to the file descriptor -.\"O .IR fd . -.I event -引き数は、ファイルディスクリプタ -.I fd -にリンクされたオブジェクトを表す。 -.\"O The -.\"O .I struct epoll_event -.\"O is defined as : -.I struct epoll_event +\fIevent\fP 引き数は、ファイルディスクリプタ \fIfd\fP にリンクされたオブジェクトを表す。 \fIstruct epoll_event\fP は以下のように定義される: .sp .in +4n @@ -140,10 +61,6 @@ typedef union epoll_data { uint64_t u64; } epoll_data_t; -.\"O struct epoll_event { -.\"O uint32_t events; /* Epoll events */ -.\"O epoll_data_t data; /* User data variable */ -.\"O }; struct epoll_event { uint32_t events; /* epoll イベント */ epoll_data_t data; /* ユーザデータ変数 */ @@ -151,299 +68,82 @@ struct epoll_event { .fi .in -.\"O The -.\"O .I events -.\"O member is a bit set composed using the following available event -.\"O types: -.I events -メンバは、以下のような使用可能なイベントタイプを使って構成された -ビットセットである。 -.TP -.B EPOLLIN -.\"O The associated file is available for -.\"O .BR read (2) -.\"O operations. -関連付けられたファイルに対して、 -.BR read (2) -操作が可能である。 -.TP -.B EPOLLOUT -.\"O The associated file is available for -.\"O .BR write (2) -.\"O operations. -関連付けられたファイルに対して、 -.BR write (2) -操作が可能である。 -.TP -.\"O .BR EPOLLRDHUP " (since Linux 2.6.17)" -.BR EPOLLRDHUP" (Linux 2.6.17 以降)" -.\"O Stream socket peer closed connection, -.\"O or shut down writing half of connection. -.\"O (This flag is especially useful for writing simple code to detect -.\"O peer shutdown when using Edge Triggered monitoring.) -ストリームソケットの他端が、コネクションの close 、 -またはコネクションの書き込み側の shutdown を行った。 -(このフラグを使うと、エッジトリガの監視を行う場合に、 -通信のもう一端が閉じられたことを検知するコードを -非常に簡潔に書くことができる。) -.TP -.B EPOLLPRI -.\"O There is urgent data available for -.\"O .BR read (2) -.\"O operations. -.BR read (2) -操作が可能な緊急 (urgent) データがある。 -.TP -.B EPOLLERR -.\"O Error condition happened on the associated file descriptor. -関連付けられたファイルディスクリプタにエラー条件が起こった。 -.\"O .BR epoll_wait (2) -.\"O will always wait for this event; it is not necessary to set it in -.\"O .IR events . -.BR epoll_wait (2) -は常にこのイベントを待つので、 -.I events +\fIevents\fP メンバは、以下のような使用可能なイベントタイプを使って構成された ビットセットである。 +.TP +\fBEPOLLIN\fP +関連付けられたファイルに対して、 \fBread\fP(2) 操作が可能である。 +.TP +\fBEPOLLOUT\fP +関連付けられたファイルに対して、 \fBwrite\fP(2) 操作が可能である。 +.TP +\fBEPOLLRDHUP"\fP(Linux\fB2.6.17\fP以降)" +ストリームソケットの他端が、コネクションの close 、 またはコネクションの書き込み側の shutdown を行った。 +(このフラグを使うと、エッジトリガの監視を行う場合に、 通信のもう一端が閉じられたことを検知するコードを 非常に簡潔に書くことができる。) +.TP +\fBEPOLLPRI\fP +\fBread\fP(2) 操作が可能な緊急 (urgent) データがある。 +.TP +\fBEPOLLERR\fP +関連付けられたファイルディスクリプタにエラー条件が起こった。 \fBepoll_wait\fP(2) は常にこのイベントを待つので、 \fIevents\fP に設定する必要はない。 -.TP -.B EPOLLHUP -.\"O Hang up happened on the associated file descriptor. -関連付けられたファイルディスクリプタにハングアップが起こった。 -.\"O .BR epoll_wait (2) -.\"O will always wait for this event; it is not necessary to set it in -.\"O .IR events . -.BR epoll_wait (2) -は常にこのイベントを待つので、 -.I events +.TP +\fBEPOLLHUP\fP +関連付けられたファイルディスクリプタにハングアップが起こった。 \fBepoll_wait\fP(2) は常にこのイベントを待つので、 \fIevents\fP に設定する必要はない。 -.TP -.B EPOLLET -.\"O Sets the Edge Triggered behavior for the associated file descriptor. -関連付けられたファイルディスクリプタに -エッジトリガ動作 (Edge Triggered behavior) を設定する。 -.\"O The default behavior for -.\"O .B epoll -.\"O is Level Triggered. -.\"O See -.\"O .BR epoll (7) -.\"O for more detailed information about Edge and Level Triggered event -.\"O distribution architectures. -.\"O -.\"Osato: 最後の 2 行にある Edge and Level ... architectures を -.\"Osato: どこで切ってよいか分からない。 -.\"Omotoki: 今の分割場所でいいんではないでしょうか。 -.\"O -.B epoll -のデフォルトの動作は、レベルトリガ (Level Triggered) である。 -エッジトリガとレベルトリガによるイベント分配機構 -(event distribution architectures) についての詳細な情報は、 -.BR epoll (7) -を参照すること。 -.TP -.\"O .BR EPOLLONESHOT " (since Linux 2.6.2)" -.BR EPOLLONESHOT " (Linux 2.6.2 以降)" -.\"O Sets the one-shot behavior for the associated file descriptor. -.\"O This means that after an event is pulled out with -.\"O .BR epoll_wait (2) -.\"O the associated file descriptor is internally disabled and no other events -.\"O will be reported by the -.\"O .B epoll -.\"O interface. -.\"O The user must call -.\"O .BR epoll_ctl () -.\"O with -.\"O .B EPOLL_CTL_MOD -.\"O to rearm the file descriptor with a new event mask. -関連付けられたファイルディスクリプタに -一撃動作 (One-Shot behavior) を設定する。 -これはイベントが -.BR epoll_wait (2) -によって引き出された後、 -関連付けられたファイルディスクリプタが内部的に破棄され、 -.B epoll -インタフェースによってイベントが報告されなくなることを意味する。 -新しいイベントマスクでファイルディスクリプタを再度有効にするためには、 -.BR epoll_ctl () -に -.B EPOLL_CTL_MOD -を指定して呼び出さなければならない。 -.\"O Valid values for the -.\"O .I op -.\"O argument are : -.I op +.TP +\fBEPOLLET\fP +関連付けられたファイルディスクリプタに エッジトリガ動作 (Edge Triggered behavior) を設定する。 \fBepoll\fP +のデフォルトの動作は、レベルトリガ (Level Triggered) である。 エッジトリガとレベルトリガによるイベント分配機構 (event +distribution architectures) についての詳細な情報は、 \fBepoll\fP(7) を参照すること。 +.TP +\fBEPOLLONESHOT\fP (Linux 2.6.2 以降) +関連付けられたファイルディスクリプタに 一撃動作 (One\-Shot behavior) を設定する。 これはイベントが +\fBepoll_wait\fP(2) によって引き出された後、 関連付けられたファイルディスクリプタが内部的に破棄され、 \fBepoll\fP +インタフェースによってイベントが報告されなくなることを意味する。 新しいイベントマスクでファイルディスクリプタを再度有効にするためには、 +\fBepoll_ctl\fP() に \fBEPOLL_CTL_MOD\fP を指定して呼び出さなければならない。 \fIop\fP 引き数に指定できる有効な値は、以下の通り: -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O When successful, -.\"O .BR epoll_ctl () -.\"O returns zero. -.\"O When an error occurs, -.\"O .BR epoll_ctl () -.\"O returns \-1 and -.\"O .I errno -.\"O is set appropriately. -成功した場合、 -.BR epoll_ctl () -は 0 を返す。 -エラーが起こった場合、 -.BR epoll_ctl () -は \-1 を返し、 -.I errno -を適切に設定する。 -.\"O .SH ERRORS +成功した場合、 \fBepoll_ctl\fP() は 0 を返す。 エラーが起こった場合、 \fBepoll_ctl\fP() は \-1 を返し、 +\fIerrno\fP を適切に設定する。 .SH エラー -.TP -.B EBADF -.\"O .I epfd -.\"O or -.\"O .I fd -.\"O is not a valid file descriptor. -.I epfd -か -.I fd -が有効なファイルディスクリプタでない。 -.TP -.B EEXIST -.\"O .I op -.\"O was -.\"O .BR EPOLL_CTL_ADD , -.\"O and the supplied file descriptor -.\"O .I fd -.\"O is already registered with this epoll instance. -.I op -が -.B EPOLL_CTL_ADD -であり、かつ与えられたファイルディスクリプタ -.I fd -がこの epoll インスタンスに既に登録されている。 -.TP -.B EINVAL -.\"O .I epfd -.\"O is not an -.\"O .B epoll -.\"O file descriptor, -.\"O or -.\"O .I fd -.\"O is the same as -.\"O .IR epfd , -.\"O or the requested operation -.\"O .I op -.\"O is not supported by this interface. -.I epfd -が -.B epoll -ファイルディスクリプタでない。 -または -.I fd -が -.I epfd -と同一である。 -または要求された操作 -.I op -がこのインタフェースでサポートされていない。 -.TP -.B ENOENT -.\"O .I op -.\"O was -.\"O .B EPOLL_CTL_MOD -.\"O or -.\"O .BR EPOLL_CTL_DEL , -.\"O and -.\"O .I fd -.\"O is not registered with this epoll instance. -.I op -が -.B EPOLL_CTL_MOD -または -.B EPOLL_CTL_DEL -で、かつ -.I fd -がこの epoll インスタンスに登録されていない。 -.TP -.B ENOMEM -.\"O There was insufficient memory to handle the requested -.\"O .I op -.\"O control operation. -要求された -.I op -制御操作を扱うのに十分なメモリがない。 -.TP -.B ENOSPC -.\"O The limit imposed by -.\"O .I /proc/sys/fs/epoll/max_user_watches -.\"O was encountered while trying to register -.\"O .RB ( EPOLL_CTL_ADD ) -.\"O a new file descriptor on an epoll instance. -.\"O See -.\"O .BR epoll (7) -.\"O for further details. -epoll インスタンスに新しいファイルディスクリプタを登録 -.RB ( EPOLL_CTL_ADD ) -しようとした際に、 -.I /proc/sys/fs/epoll/max_user_watches -で決まる上限に達した。 -詳細は -.BR epoll (7) -を参照。 -.TP -.B EPERM -.\"O The target file -.\"O .I fd -.\"O does not support -.\"O .BR epoll . -対象ファイル -.I fd -が -.B epoll -をサポートしていない。 -.\"O .SH CONFORMING TO +.TP +\fBEBADF\fP +\fIepfd\fP か \fIfd\fP が有効なファイルディスクリプタでない。 +.TP +\fBEEXIST\fP +\fIop\fP が \fBEPOLL_CTL_ADD\fP であり、かつ与えられたファイルディスクリプタ \fIfd\fP がこの epoll +インスタンスに既に登録されている。 +.TP +\fBEINVAL\fP +\fIepfd\fP が \fBepoll\fP ファイルディスクリプタでない。 または \fIfd\fP が \fIepfd\fP と同一である。 または要求された操作 +\fIop\fP がこのインタフェースでサポートされていない。 +.TP +\fBENOENT\fP +\fIop\fP が \fBEPOLL_CTL_MOD\fP または \fBEPOLL_CTL_DEL\fP で、かつ \fIfd\fP がこの epoll +インスタンスに登録されていない。 +.TP +\fBENOMEM\fP +要求された \fIop\fP 制御操作を扱うのに十分なメモリがない。 +.TP +\fBENOSPC\fP +epoll インスタンスに新しいファイルディスクリプタを登録 (\fBEPOLL_CTL_ADD\fP) しようとした際に、 +\fI/proc/sys/fs/epoll/max_user_watches\fP で決まる上限に達した。 詳細は \fBepoll\fP(7) を参照。 +.TP +\fBEPERM\fP +対象ファイル \fIfd\fP が \fBepoll\fP をサポートしていない。 +.SH バージョン +.\" To be precise: kernel 2.5.44. +.\" The interface should be finalized by Linux kernel 2.5.66. +\fBepoll_ctl\fP() はカーネル 2.6 で追加された。 .SH 準拠 -.\"O .BR epoll_ctl () -.\"O is Linux-specific, and was introduced in kernel 2.5.44. -.BR epoll_ctl () -は Linux 独自であり、カーネル 2.5.44 で導入された。 -.\"O .\" The interface should be finalized by Linux kernel 2.5.66. -.\" インタフェースは Linux カーネル 2.5.66 で確定されるべきである。 -.\"O .SH NOTES -.SH 備考 -.\"O The -.\"O .B epoll -.\"O interface supports all file descriptors that support -.\"O .BR poll (2). -.B epoll -インタフェースは、 -.BR poll (2) -に対応している全てのファイルディスクリプタに対応している。 -.\"O .SH BUGS +\fBepoll_ctl\fP() は Linux 独自である。 +ライブラリによるサポートは glibc バージョン 2.3.2 以降で提供されている。 +.SH 注意 +\fBepoll\fP インタフェースは、 \fBpoll\fP(2) に対応している全てのファイルディスクリプタに対応している。 .SH バグ -.\"O In kernel versions before 2.6.9, the -.\"O .B EPOLL_CTL_DEL -.\"O operation required a non-NULL pointer in -.\"O .IR event , -.\"O even though this argument is ignored. -.\"O Since Linux 2.6.9, -.\"O .I event -.\"O can be specified as NULL -.\"O when using -.\"O .BR EPOLL_CTL_DEL . -Linux 2.6.9 より前では、 -.B EPOLL_CTL_DEL -操作の際、引き数 -.I event -に (たとえ無視される場合であっても) NULL でないポインタを渡す必要があった。 -カーネル 2.6.9 以降では、 -.B EPOLL_CTL_DEL -を使う際に -.I event -に NULL を指定できるようになっている。 -.\"O Applications that need to be portable to kernels before 2.6.9 -.\"O should specify a non-NULL pointer in -.\"O .IR event . -2.6.9 より前のカーネルへの移植性が必要なアプリケーションでは、 -.I event -に NULL でないポインタを指定すべきである。 -.\"O .SH "SEE ALSO" +Linux 2.6.9 より前では、 \fBEPOLL_CTL_DEL\fP 操作の際、引き数 \fIevent\fP に (たとえ無視される場合であっても) +NULL でないポインタを渡す必要があった。 カーネル 2.6.9 以降では、 \fBEPOLL_CTL_DEL\fP を使う際に \fIevent\fP に +NULL を指定できるようになっている。 2.6.9 より前のカーネルへの移植性が必要なアプリケーションでは、 \fIevent\fP に NULL +でないポインタを指定すべきである。 .SH 関連項目 -.BR epoll_create (2), -.BR epoll_wait (2), -.BR poll (2), -.BR epoll (7) +\fBepoll_create\fP(2), \fBepoll_wait\fP(2), \fBpoll\fP(2), \fBepoll\fP(7) diff --git a/draft/man2/epoll_wait.2 b/draft/man2/epoll_wait.2 deleted file mode 100644 index 1e6a0c1b..00000000 --- a/draft/man2/epoll_wait.2 +++ /dev/null @@ -1,308 +0,0 @@ -.\" -.\" epoll by Davide Libenzi ( efficient event notification retrieval ) -.\" Copyright (C) 2003 Davide Libenzi -.\" -.\" This program is free software; you can redistribute it and/or modify -.\" it under the terms of the GNU General Public License as published by -.\" the Free Software Foundation; either version 2 of the License, or -.\" (at your option) any later version. -.\" -.\" This program is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; without even the implied warranty of -.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -.\" GNU General Public License for more details. -.\" -.\" You should have received a copy of the GNU General Public License -.\" along with this program; if not, write to the Free Software -.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -.\" -.\" Davide Libenzi -.\" -.\" 2007-04-30: mtk, Added description of epoll_pwait() -.\" -.\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO -.\" all rights reserved. -.\" Translated Wed Jun 16 03:05:40 JST 2004 -.\" by Yuichi SATO -.\" Updated & Modified Tue Apr 19 07:05:42 JST 2005 by Yuichi SATO -.\" Updated 2007-06-02, Akihiro MOTOKI , LDP v2.51 -.\" Updated 2009-02-23, Akihiro MOTOKI , LDP v3.18 -.\" -.TH EPOLL_WAIT 2 2009-01-17 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O epoll_wait, epoll_pwait \- wait for an I/O event on an epoll file descriptor -epoll_wait, epoll_pwait \- epoll ファイルディスクリプタの I/O イベントを待つ -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.B #include -.sp -.BI "int epoll_wait(int " epfd ", struct epoll_event *" events , -.BI " int " maxevents ", int " timeout ); -.BI "int epoll_pwait(int " epfd ", struct epoll_event *" events , -.BI " int " maxevents ", int " timeout , -.BI " const sigset_t *" sigmask ); -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The -.\"O .BR epoll_wait () -.\"O system call waits for events on the -.\"O .B epoll -.\"O instance referred to by the file descriptor -.\"O .IR epfd . -.\"O The memory area pointed to by -.\"O .I events -.\"O will contain the events that will be available for the caller. -.BR epoll_wait () -システムコールは、 -ファイルディスクリプタ -.I epfd -で参照される -.B epoll -インスタンスに対するイベントを待つ。 -.I events -が指すメモリ領域には、呼び出し側が利用可能なイベントが格納される。 -.\"O Up to -.\"O .I maxevents -.\"O are returned by -.\"O .BR epoll_wait (). -最大 -.I maxevents -個のイベントが -.BR epoll_wait () -によって返される。 -.\"O The -.\"O .I maxevents -.\"O argument must be greater than zero. -.I maxevents -引き数は 0 より大きくなければならない。 - -.\"O The call waits for a maximum time of -.\"O .I timeout -.\"O milliseconds. -.\"O Specifying a -.\"O .I timeout -.\"O of \-1 makes -.\"O .BR epoll_wait () -.\"O wait indefinitely, while specifying a -.\"O .I timeout -.\"O equal to zero makes -.\"O .BR epoll_wait () -.\"O to return immediately even if no events are available -.\"O (return code equal to zero). -最大で -.I timeout -ミリ秒間イベントを待つ。 -.I timeout -を \-1 に指定すると、 -.BR epoll_wait () -は無限に待つ。 -また -.I timeout -を 0 に指定すると、 -.BR epoll_wait () -はイベントが利用可能でなくても、すぐに返る (返り値は 0 である)。 - -.\"O The -.\"O .I struct epoll_event -.\"O is defined as : -.I struct epoll_event -は以下のように定義される: -.sp -.in +4n -.nf -typedef union epoll_data { - void *ptr; - int fd; - uint32_t u32; - uint64_t u64; -} epoll_data_t; - -.\"O struct epoll_event { -.\"O uint32_t events; /* Epoll events */ -.\"O epoll_data_t data; /* User data variable */ -.\"O }; -struct epoll_event { - uint32_t events; /* epoll イベント */ - epoll_data_t data; /* ユーザデータ変数 */ -}; -.fi -.in - -.\"O The -.\"O .I data -.\"O of each returned structure will contain the same data the user set with an -.\"O .BR epoll_ctl (2) -.\"O .RB ( EPOLL_CTL_ADD , EPOLL_CTL_MOD ) -.\"O while the -.\"O .I events -.\"O member will contain the returned event bit field. -返される構造体の -.I data -メンバには、ユーザが -.BR epoll_ctl (2) -.RB ( EPOLL_CTL_ADD ", " EPOLL_CTL_MOD ) -で指定したデータが格納される。 -一方、 -.I events -メンバには返された利用可能なイベントのビットフィールドが格納される。 -.SS epoll_pwait() -.\"O The relationship between -.\"O .BR epoll_wait () -.\"O and -.\"O .BR epoll_pwait () -.\"O is analogous to the relationship between -.\"O .BR select (2) -.\"O and -.\"O .BR pselect (2): -.\"O like -.\"O .BR pselect (2), -.\"O .BR epoll_pwait () -.\"O allows an application to safely wait until either a file descriptor -.\"O becomes ready or until a signal is caught. -.BR epoll_wait () -と -.BR epoll_pwait () -の関係は、 -.BR select (2) -と -.BR pselect (2) -の関係と同様である。 -.BR pselect (2) -同様、 -.BR epoll_pwait () -を使うと、アプリケーションは、ファイルディスクリプタが準備できた状態になるか、 -シグナルが捕捉されるまで、安全に待つことができる。 - -.\"O The following -.\"O .BR epoll_pwait () -.\"O call: -以下の -.BR epoll_pwait () -の呼び出しは、 -.nf - - ready = epoll_pwait(epfd, &events, maxevents, timeout, &sigmask); - -.fi -.\"O is equivalent to -.\"O .I atomically -.\"O executing the following calls: -次の呼び出しを -.I atomic -に実行するのと等価である。 -.nf - - sigset_t origmask; - - sigprocmask(SIG_SETMASK, &sigmask, &origmask); - ready = epoll_wait(epfd, &events, maxevents, timeout); - sigprocmask(SIG_SETMASK, &origmask, NULL); -.fi -.PP -.\"O The -.\"O .I sigmask -.\"O argument may be specified as NULL, in which case -.\"O .BR epoll_pwait () -.\"O is equivalent to -.\"O .BR epoll_wait (). -.I sigmask -引き数には NULL を指定してもよい。 -その場合には、 -.BR epoll_pwait () -は -.BR epoll_wait () -と等価となる。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O When successful, -.\"O .BR epoll_wait () -.\"O returns the number of file descriptors ready for the requested I/O, or zero -.\"O if no file descriptor became ready during the requested -.\"O .I timeout -.\"O milliseconds. -.\"O When an error occurs, -.\"O .BR epoll_wait () -.\"O returns \-1 and -.\"O .I errno -.\"O is set appropriately. -成功した場合、 -.BR epoll_wait () -は要求された I/O に対して準備ができているファイルディスクリプタの数を返す。 -また要求された -.I timeout -ミリ秒の間にファイルディスクリプタが準備できない場合は、0 を返す。 -エラーが起こった場合、 -.BR epoll_wait () -は \-1 を返し、 -.I errno -を適切に設定する。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EBADF -.\"O .I epfd -.\"O is not a valid file descriptor. -.I epfd -が有効なファイルディスクリプタでない。 -.TP -.B EFAULT -.\"O The memory area pointed to by -.\"O .I events -.\"O is not accessible with write permissions. -.I events -で指されるメモリ領域に書き込み権限でアクセスできない。 -.TP -.B EINTR -.\"O The call was interrupted by a signal handler before any of the -.\"O requested events occurred or the -.\"O .I timeout -.\"O expired; see -.\"O .BR signal (7). -要求されたどのイベントも発生せず、かつ -.I timeout -の期限が切れる前に、システムコールがシグナルハンドラによって割り込まれた。 -.BR signal (7) -参照。 -.TP -.B EINVAL -.\"O .I epfd -.\"O is not an -.\"O .B epoll -.\"O file descriptor, or -.\"O .I maxevents -.\"O is less than or equal to zero. -.I epfd -が -.B epoll -ファイルディスクリプタでない。 -または -.I maxevents -が 0 以下である。 -.\"O .SH VERSIONS -.SH バージョン -.\"O .BR epoll_pwait () -.\"O was added to Linux in kernel 2.6.19. -.BR epoll_pwait () -はカーネル 2.6.19 で Linux に追加された。 - -.\"O Glibc support for -.\"O .BR epoll_pwait () -.\"O is provided starting with glibc 2.6. -.BR epoll_pwait () -の glibc でのサポートは glibc 2.6 以降で提供されている。 -.\"O .SH CONFORMING TO -.SH 準拠 -.\"O .BR epoll_wait () -.\"O is Linux-specific, and was introduced in kernel 2.5.44. -.BR epoll_wait () -は Linux 独自であり、カーネル 2.5.44 で導入された。 -.\"O .\" The interface should be finalized by Linux kernel 2.5.66. -.\" インタフェースは Linux カーネル 2.5.66 で確定されるべきである。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR epoll_create (2), -.BR epoll_ctl (2), -.BR epoll (7) diff --git a/draft/man2/execve.2 b/draft/man2/execve.2 index cccd328b..31a6a11b 100644 --- a/draft/man2/execve.2 +++ b/draft/man2/execve.2 @@ -34,64 +34,39 @@ .\" 2007-09-14 Ollie Wild , mtk .\" Add text describing limits on command-line arguments + environment .\" -.\" Japanese Version Copyright (c) 1996 TABATA Tomohira -.\" all rights reserved. -.\" Translated 1996-07-04, TABATA Tomohira -.\" Updated 1997-12-14, HANATAKA Shinya -.\" Updated 2001-08-17, HANATAKA Shinya -.\" Updated 2005-02-05, Yuichi SATO -.\" Updated 2005-09-06, Akihiro MOTOKI -.\" Updated 2005-11-19, Akihiro MOTOKI -.\" Updated 2006-08-13, Akihiro MOTOKI, LDP v2.39 -.\" Updated 2007-01-09, Akihiro MOTOKI, LDP v2.43 -.\" Updated 2007-06-03, Akihiro MOTOKI, LDP v2.51 -.\" Updated 2007-10-12, Akihiro MOTOKI, LDP v2.66 -.\" Updated 2008-04-04, Akihiro MOTOKI, LDP v2.79 -.\" Updated 2008-11-05, Akihiro MOTOKI, LDP v3.12 +.\"******************************************************************* .\" -.TH EXECVE 2 2010-01-06 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH EXECVE 2 2011\-09\-14 Linux "Linux Programmer's Manual" .SH 名前 -.\"O execve \- execute program execve \- プログラムを実行する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int execve(const char *" filename ", char *const " argv "[], " +\fBint execve(const char *\fP\fIfilename\fP\fB, char *const \fP\fIargv\fP\fB[], \fP .br -.BI " char *const " envp []); -.\"O .SH DESCRIPTION +\fB char *const \fP\fIenvp\fP\fB[]);\fP .SH 説明 -.\"O .BR execve () -.\"O executes the program pointed to by \fIfilename\fP. -.\"O \fIfilename\fP must be either a binary executable, or a script -.\"O starting with a line of the form: -.BR execve () -は、\fIfilename\fP によって指定されたプログラムを実行する。 -\fIfilename\fP は、バイナリ実行形式か、 +\fBexecve\fP() は、\fIfilename\fP によって指定されたプログラムを実行する。 \fIfilename\fP は、バイナリ実行形式か、 以下の形式の行で始まるスクリプトでなければならない。 .in +4n .nf -\fB#!\fP \fIinterpreter \fP[optional-arg] +\fB#!\fP \fIinterpreter \fP[optional\-arg] .fi .in -.\"O For details of the latter case, see "Interpreter scripts" below. 後者の詳細は、後ろの「インタプリタ・スクリプト」の節を参照のこと。 -.\"O \fIargv\fP is an array of argument strings passed to the new program. -.\"O \fIenvp\fP is an array of strings, conventionally of the form -.\"O \fBkey=value\fP, which are passed as environment to the new program. -.\"O Both \fIargv\fP and \fIenvp\fP must be terminated by a null pointer. -.\"O The argument vector and environment can be accessed by the -.\"O called program's main function, when it is defined as: \fIargv\fP は新しいプログラムに渡される引き数文字列の配列である。 -\fIenvp\fP は文字列の配列であり、伝統的に \fBkey=value\fP の形式を -しており、新しいプログラムの環境変数として渡される。 -\fIargv\fP と \fIenvp\fP はいずれもの NULL ポインタで終わっている -必要がある。引き数配列と環境変数は、呼び出されたプログラムの main 関数を +慣例では、引き数文字列の最初の要素には実行されたファイルに関連付けられた +ファイル名を含めることになっている。 +\fIenvp\fP は文字列の配列であり、伝統的に \fBkey=value\fP の形式をしており、 +新しいプログラムの環境変数として渡される。 +\fIargv\fP と \fIenvp\fP はいずれもの NULL ポインタで終わっている必要がある。 +引き数配列と環境変数は、呼び出されたプログラムの main 関数を 以下のように定義することによってアクセス可能になる。 .in +4n @@ -100,814 +75,263 @@ int main(int argc, char *argv[], char *envp[]) .fi .in -.\"O .BR execve () -.\"O does not return on success, and the text, data, bss, and -.\"O stack of the calling process are overwritten by that of the program -.\"O loaded. -成功した場合、 -.BR execve () -は返らない。 -そして、呼び出し元のプロセスの text, data, bss, スタックは、 +成功した場合、 \fBexecve\fP() は返らない。 そして、呼び出し元のプロセスの text, data, bss, スタックは、 読み込まれたプログラムによって上書きされる。 -.\"O If the current program is being ptraced, a \fBSIGTRAP\fP is sent to it -.\"O after a successful -.\"O .BR execve (). -元のプログラムが ptrace されている場合、 -.BR execve () -が成功した後に -そのプログラムに \fBSIGTRAP\fP が送られる。 - -.\"O If the set-user-ID bit is set on the program file pointed to by -.\"O \fIfilename\fP, -.\"O and the underlying file system is not mounted -.\"O .I nosuid -.\"O (the -.\"O .B MS_NOSUID -.\"O flag for -.\"O .BR mount (2)), -.\"O and the calling process is not being ptraced, -.\"O then the effective user ID of the calling process is changed -.\"O to that of the owner of the program file. -.\"O Similarly, when the set-group-ID -.\"O bit of the program file is set the effective group ID of the calling -.\"O process is set to the group of the program file. -.I filename -で指定されたプログラムファイルに set-user-ID ビットが設定されており、 -ファイルが存在するファイルシステムが -.I nosuid -.RB ( mount (2) -の -.B MS_NOSUID -フラグ) でマウントされておらず、 -呼び出したプロセスが ptrace されていない場合、 -呼び出したプロセスの実効 (effective) ユーザ ID は -プログラムファイルの所有者 (owner) に変更される。 -同様に、プログラムファイルに set-group-ID ビットが設定されていた場合、 -呼び出したプロセスの有効グループ ID は +元のプログラムが ptrace されている場合、 \fBexecve\fP() が成功した後に そのプログラムに \fBSIGTRAP\fP が送られる。 + +\fIfilename\fP で指定されたプログラムファイルに set\-user\-ID ビットが設定されており、 ファイルが存在するファイルシステムが +\fInosuid\fP (\fBmount\fP(2) の \fBMS_NOSUID\fP フラグ) でマウントされておらず、 呼び出したプロセスが ptrace +されていない場合、 呼び出したプロセスの実効 (effective) ユーザ ID は プログラムファイルの所有者 (owner) に変更される。 +同様に、プログラムファイルに set\-group\-ID ビットが設定されていた場合、 呼び出したプロセスの有効グループ ID は プログラムファイルのグループに変更される。 -.\"O The effective user ID of the process is copied to the saved set-user-ID; -.\"O similarly, the effective group ID is copied to the saved set-group-ID. -.\"O This copying takes place after any effective ID changes that occur -.\"O because of the set-user-ID and set-group-ID permission bits. -プロセスの実効ユーザ ID は保存 (saved) set-user-ID にコピーされる。 -同様に、実効グループ ID は保存 set-group-ID にコピーされる。 -このコピーは、set-user-ID / set-group-ID 許可ビットにより発生する -実効 ID の変更後に行われる。 - -.\"O If the executable is an a.out dynamically linked -.\"O binary executable containing -.\"O shared-library stubs, the Linux dynamic linker -.\"O .BR ld.so (8) -.\"O is called at the start of execution to bring -.\"O needed shared libraries into memory -.\"O and link the executable with them. -実行ファイルが動的リンクされた a.out 実行形式で、共有ライブラリの -スタブを含むものだった場合、実行の開始時に Linux の -ダイナミック・リンカ -.BR ld.so (8) -が呼び出され、必要な共有ライブラリをメモリに読み込んでリンクを行う。 - -.\"O If the executable is a dynamically linked ELF executable, the -.\"O interpreter named in the PT_INTERP segment is used to load the needed -.\"O shared libraries. -.\"O This interpreter is typically -.\"O \fI/lib/ld-linux.so.1\fP for binaries linked with the -.\"O Linux libc 5, or \fI/lib/ld-linux.so.2\fP for binaries linked with the -.\"O glibc 2. -実行ファイルがダイナミック・リンクされた ELF 実行形式だった場合、 -PT_INTERP セグメントに指定されたインタプリタが必要な -共有ライブラリ (shared library) を読み込むのに使用される。 -通常、インタプリタとしては、 -Linux libc 5 をリンクしたバイナリの場合には -\fI/lib/ld-linux.so.1\fP が、 -glibc 2 をリンクしたバイナリの場合には -\fI/lib/ld-linux.so.2\fP が使用される。 - -.\"O All process attributes are preserved during an -.\"O .BR execve (), -.\"O except the following: -以下に示す以外のすべてのプロセス属性は -.BR execve () -の前後で保持される。 +プロセスの実効ユーザ ID は保存 (saved) set\-user\-ID にコピーされる。 同様に、実効グループ ID は保存 +set\-group\-ID にコピーされる。 このコピーは、set\-user\-ID / set\-group\-ID 許可ビットにより発生する 実効 ID +の変更後に行われる。 + +実行ファイルが動的リンクされた a.out 実行形式で、共有ライブラリの スタブを含むものだった場合、実行の開始時に Linux の +ダイナミック・リンカ \fBld.so\fP(8) が呼び出され、必要な共有ライブラリをメモリに読み込んでリンクを行う。 + +実行ファイルがダイナミック・リンクされた ELF 実行形式だった場合、 PT_INTERP セグメントに指定されたインタプリタが必要な 共有ライブラリ +(shared library) を読み込むのに使用される。 通常、インタプリタとしては、 Linux libc 5 をリンクしたバイナリの場合には +\fI/lib/ld\-linux.so.1\fP が、 glibc 2 をリンクしたバイナリの場合には \fI/lib/ld\-linux.so.2\fP +が使用される。 + +以下に示す以外のすべてのプロセス属性は \fBexecve\fP() の前後で保持される。 .IP * -.\"O The dispositions of any signals that are being caught are -.\"O reset to the default -.\"O .RB ( signal (7)). -捕捉されたシグナルの処理方法 (disposition) は -デフォルト動作にリセットされる -.RB ( signal (7))。 +捕捉されたシグナルの処理方法 (disposition) は デフォルト動作にリセットされる (\fBsignal\fP(7))。 .IP * -.\"O Any alternate signal stack is not preserved -.\"O .RB ( sigaltstack (2)). -代替シグナルスタックはどれも保持されない -.RB ( sigaltstack (2))。 +代替シグナルスタックはどれも保持されない (\fBsigaltstack\fP(2))。 .IP * -.\"O Memory mappings are not preserved -.\"O .RB ( mmap (2)). -メモリマッピングは保持されない -.RB ( mmap (2))。 +メモリマッピングは保持されない (\fBmmap\fP(2))。 .IP * -.\"O Attached System V shared memory segments are detached -.\"O .RB ( shmat (2)). -付加された (attached) System V 共有メモリセグメントは分離される -.RB ( shmat (2))。 +付加された (attached) System V 共有メモリセグメントは分離される (\fBshmat\fP(2))。 .IP * -.\"O POSIX shared memory regions are unmapped -.\"O .RB ( shm_open (3)). -POSIX 共有メモリ領域はマッピングを解除される -.RB ( shm_open (3))。 +POSIX 共有メモリ領域はマッピングを解除される (\fBshm_open\fP(3))。 .IP * -.\"O Open POSIX message queue descriptors are closed -.\"O .RB ( mq_overview (7)). -オープンされた POSIX メッセージキューディスクリプタはクローズされる -.RB ( mq_overview (7))。 +オープンされた POSIX メッセージキューディスクリプタはクローズされる (\fBmq_overview\fP(7))。 .IP * -.\"O Any open POSIX named semaphores are closed -.\"O .RB ( sem_overview (7)). -オープンされた POSIX 名前付きセマフォはいずれもクローズされる -.RB ( sem_overview (7))。 +オープンされた POSIX 名前付きセマフォはいずれもクローズされる (\fBsem_overview\fP(7))。 .IP * -.\"O POSIX timers are not preserved -.\"O .RB ( timer_create (2)). -POSIX タイマは保持されない -.RB ( timer_create (2))。 +POSIX タイマは保持されない (\fBtimer_create\fP(2))。 .IP * -.\"O Any open directory streams are closed -.\"O .RB ( opendir (3)). -オープンされたディレクトリストリームはいずれもクローズされる -.RB ( opendir (3))。 +オープンされたディレクトリストリームはいずれもクローズされる (\fBopendir\fP(3))。 .IP * -.\"O Memory locks are not preserved -.\"O .RB ( mlock (2), -.\"O .BR mlockall (2)). -メモリロックは保持されない -.RB ( mlock (2), -.BR mlockall (2))。 +メモリロックは保持されない (\fBmlock\fP(2), \fBmlockall\fP(2))。 .IP * -.\"O Exit handlers are not preserved -.\"O .RB ( atexit (3), -.\"O .BR on_exit (3)). -終了 (exit) ハンドラは保持されない -.RB ( atexit (3), -.BR on_exit (3))。 +終了 (exit) ハンドラは保持されない (\fBatexit\fP(3), \fBon_exit\fP(3))。 .IP * -.\"O The floating-point environment is reset to the default (see -.\"O .BR fenv (3)). -浮動小数点関連の環境はデフォルトにリセットされる -.RB ( fenv (3) -参照)。 +浮動小数点関連の環境はデフォルトにリセットされる (\fBfenv\fP(3) 参照)。 .PP -.\"O The process attributes in the preceding list are all specified -.\"O in POSIX.1-2001. -.\"O The following Linux-specific process attributes are also -.\"O not preserved during an -.\"O .BR execve (): -上記のリストのプロセス属性はいずれも POSIX.1-2001 で規定されている。 -以下に示す Linux 固有のプロセス属性も -.BR execve () +上記のリストのプロセス属性はいずれも POSIX.1\-2001 で規定されている。 以下に示す Linux 固有のプロセス属性も \fBexecve\fP() の前後で保持されない。 .IP * 3 -.\"O The -.\"O .BR prctl (2) -.\"O .B PR_SET_DUMPABLE -.\"O flag is set, -.\"O unless a set-user-ID or set-group ID program is being executed, -.\"O in which case it is cleared. -set-user-ID か set-group-ID されたプログラムが実行されている場合、 -.BR prctl (2) -の -.B PR_SET_DUMPABLE -フラグはクリアされる。それ以外の場合、このフラグはセットされる。 +set\-user\-ID か set\-group\-ID されたプログラムが実行されている場合、 \fBprctl\fP(2) の +\fBPR_SET_DUMPABLE\fP フラグはクリアされる。それ以外の場合、このフラグはセットされる。 .IP * -.\"O The -.\"O .BR prctl (2) -.\"O .B PR_SET_KEEPCAPS -.\"O flag is cleared. -.BR prctl (2) -の -.B PR_SET_KEEPCAPS -フラグはクリアされる。 +\fBprctl\fP(2) の \fBPR_SET_KEEPCAPS\fP フラグはクリアされる。 .IP * -.\"O The process name, as set by -.\"O .BR prctl (2) -.\"O .B PR_SET_NAME -.\"O (and displayed by -.\"O .IR "ps\ \-o comm" ), -.\"O is reset to the name of the new executable file. -プロセス名は新しい実行ファイルの名前にリセットされる。 -プロセス名は -.BR prctl (2) -の -.B PR_SET_NAME -で設定でき、 -.I "ps\ \-o comm" -で表示できる。 +プロセス名は新しい実行ファイルの名前にリセットされる。 プロセス名は \fBprctl\fP(2) の \fBPR_SET_NAME\fP で設定でき、 +\fIps\ \-o comm\fP で表示できる。 .IP * -.\"O The termination signal is reset to -.\"O .B SIGCHLD -.\"O (see -.\"O .BR clone (2)). -終了シグナル (termination signal) は -.B SIGCHLD -にリセットされる -.RB ( clone (2) -参照)。 +終了シグナル (termination signal) は \fBSIGCHLD\fP にリセットされる (\fBclone\fP(2) 参照)。 .PP -.\"O Note the following further points: 以下の点についても注意すること: .IP * 3 -.\"O All threads other than the calling thread are destroyed during an -.\"O .BR execve (). -.\"O Mutexes, condition variables, and other pthreads objects are not preserved. -呼び出し元スレッド以外の全てのスレッドは -.BR execve () -中に破棄される。 -mutex、条件変数、その他の pthread オブジェクトは保持されない。 +呼び出し元スレッド以外の全てのスレッドは \fBexecve\fP() 中に破棄される。 mutex、条件変数、その他の pthread +オブジェクトは保持されない。 .IP * -.\"O The equivalent of \fIsetlocale(LC_ALL, "C")\fP -.\"O is executed at program start-up. \fIsetlocale(LC_ALL, "C")\fP 相当の処理がプログラム開始時に実行される。 .IP * -.\"O POSIX.1-2001 specifies that the dispositions of any signals that -.\"O are ignored or set to the default are left unchanged. -.\"O POSIX.1-2001 specifies one exception: if -.\"O .B SIGCHLD -.\"O is being ignored, -.\"O then an implementation may leave the disposition unchanged or -.\"O reset it to the default; Linux does the former. -POSIX.1-2001 は、動作が無視かデフォルトに設定されている全てのシグナル -の処理方法は変更せずそのままにする、と規定している。 -但し、POSIX.1-2001 には一つ例外があり、 -.B SIGCHLD -が無視になっている場合、 -その処理方法を変更せずにそのままにするか、デフォルト動作にリセットするかは -実装依存となっている。 -Linux では前者 (変更しない) となっている。 +POSIX.1\-2001 は、動作が無視かデフォルトに設定されている全てのシグナル の処理方法は変更せずそのままにする、と規定している。 +但し、POSIX.1\-2001 には一つ例外があり、 \fBSIGCHLD\fP が無視になっている場合、 +その処理方法を変更せずにそのままにするか、デフォルト動作にリセットするかは 実装依存となっている。 Linux では前者 (変更しない) となっている。 .IP * -.\"O Any outstanding asynchronous I/O operations are canceled -.\"O .RB ( aio_read (3), -.\"O .BR aio_write (3)). -完了していない非同期 I/O 操作はキャンセルされる -.RB ( aio_read (3), -.BR aio_write (3))。 +完了していない非同期 I/O 操作はキャンセルされる (\fBaio_read\fP(3), \fBaio_write\fP(3))。 .IP * -.\"O For the handling of capabilities during -.\"O .BR execve (), -.\"O see -.\"O .BR capabilities (7). -.BR execve (2) -時のケーパビリティの扱いについては、 -.BR capabilities (7) -を参照。 +\fBexecve\fP(2) 時のケーパビリティの扱いについては、 \fBcapabilities\fP(7) を参照。 .IP * -.\"O By default, file descriptors remain open across an -.\"O .BR execve (). -.\"O File descriptors that are marked close-on-exec are closed; -.\"O see the description of -.\"O .B FD_CLOEXEC -.\"O in -.\"O .BR fcntl (2). -.\"O (If a file descriptor is closed, this will cause the release -.\"O of all record locks obtained on the underlying file by this process. -.\"O See -.\"O .BR fcntl (2) -.\"O for details.) -デフォルトでは、ファイルディスクリプタは -.BR execve () -を行った後でもオープンされたままである。 -close-on-exec の印が付いているファイルディスクリプタはクローズされる。 -.BR fcntl (2) -の -.B FD_CLOEXEC -の説明を参照。 -(ファイルディスクリプタがクローズされると、このプロセスが -ファイルディスクリプタに対応するファイルに対して獲得していた -レコードのロックが全て解放されることになる。) -.\"O POSIX.1-2001 says that if file descriptors 0, 1, and 2 would -.\"O otherwise be closed after a successful -.\"O .BR execve (), -.\"O and the process would gain privilege because the set-user_ID or -.\"O set-group_ID permission bit was set on the executed file, -.\"O then the system may open an unspecified file for each of these -.\"O file descriptors. -.\"O As a general principle, no portable program, whether privileged or not, -.\"O can assume that these three file descriptors will remain -.\"O closed across an -.\"O .BR execve (). -POSIX.1-2001 では、 -ファイルディスクリプタ 0, 1, 2 が -.BR execve () -成功後にどこかでクローズされ、かつ -実行されるファイルに set-user_ID か set-group_ID の許可ビットが -セットされていてプロセスが特権を獲得した場合、 -システムは何らかのファイルをオープンする際に -これらの番号のディスクリプタのどれかを使うことがある、 -とされている。 -原則として、移植性が必要なプログラムでは、 -特権の有無に関わらず、 -.BR execve () -の前後でこれら 3つのファイルディスクリプタがクローズされたままで -あることを前提にすることはできない。 .\" On Linux it appears that these file descriptors are .\" always open after an execve(), and it looks like .\" Solaris 8 and FreeBSD 6.1 are the same. -- mtk, 30 Apr 2007 -.\"O .SS Interpreter scripts +デフォルトでは、ファイルディスクリプタは \fBexecve\fP() を行った後でもオープンされたままである。 close\-on\-exec +の印が付いているファイルディスクリプタはクローズされる。 \fBfcntl\fP(2) の \fBFD_CLOEXEC\fP の説明を参照。 +(ファイルディスクリプタがクローズされると、このプロセスが ファイルディスクリプタに対応するファイルに対して獲得していた +レコードのロックが全て解放されることになる。) POSIX.1\-2001 では、 ファイルディスクリプタ 0, 1, 2 が \fBexecve\fP() +成功後にどこかでクローズされ、かつ 実行されるファイルに set\-user_ID か set\-group_ID の許可ビットが +セットされていてプロセスが特権を獲得した場合、 システムは何らかのファイルをオープンする際に これらの番号のディスクリプタのどれかを使うことがある、 +とされている。 原則として、移植性が必要なプログラムでは、 特権の有無に関わらず、 \fBexecve\fP() の前後でこれら +3つのファイルディスクリプタがクローズされたままで あることを前提にすることはできない。 .SS インタプリタ・スクリプト -.\"O An interpreter script is a text file that has execute -.\"O permission enabled and whose first line is of the form: -インタプリタ・スクリプトとは、実行許可が有効になっていて、 -最初の行が以下の形になっているテキストファイルのことである。 +インタプリタ・スクリプトとは、実行許可が有効になっていて、 最初の行が以下の形になっているテキストファイルのことである。 .in +4n .nf -\fB#!\fP \fIinterpreter \fP[optional-arg] +\fB#!\fP \fIinterpreter \fP[optional\-arg] .fi .in -.\"O The -.\"O .I interpreter -.\"O must be a valid pathname for an -.\"O executable which is not itself a script. -.I interpreter -は有効な実行ファイルのパス名でなければならず、 -それ自身がスクリプトであってはならない。 -.\"O If the -.\"O .I filename -.\"O argument of -.\"O .BR execve () -.\"O specifies an interpreter script, then -.\"O .I interpreter -.\"O will be invoked with the following arguments: -.BR execve () -の -.I filename -引き数がインタプリタスクリプトを指定している場合、 -.I interpreter -は以下の引き数で起動される。 +\fIinterpreter\fP は有効な実行ファイルのパス名でなければならず、 それ自身がスクリプトであってはならない。 \fBexecve\fP() の +\fIfilename\fP 引き数がインタプリタスクリプトを指定している場合、 \fIinterpreter\fP は以下の引き数で起動される。 .in +4n .nf -\fIinterpreter\fP [optional-arg] \fIfilename\fP arg... +\fIinterpreter\fP [optional\-arg] \fIfilename\fP arg... .fi .in -.\"O where -.\"O .I arg... -.\"O is the series of words pointed to by the -.\"O .I argv -.\"O argument of -.\"O .BR execve (). -.I arg... -は -.BR execve () -の -.I argv -引き数が指すワード列である。 - -.\"O For portable use, -.\"O .I optional-arg -.\"O should either be absent, or be specified as a single word (i.e., it -.\"O should not contain white space); see NOTES below. -移植性を持たすには、 -.I optional-arg -は空か 1ワードだけにすべきである -(つまり、ホワイト・スペースを含めるべきではない)。 +\fIarg...\fP は \fBexecve\fP() の \fIargv\fP 引き数が指すワード列である。 + +移植性を持たすには、 \fIoptional\-arg\fP は空か 1ワードだけにすべきである (つまり、ホワイト・スペースを含めるべきではない)。 下記の「注意」の節を参照。 -.\"O .SS "Limits on size of arguments and environment" -.SS "引き数と環境変数の合計サイズの上限" -.\"O Most UNIX implementations impose some limit on the total size -.\"O of the command-line argument -.\"O .RI ( argv ) -.\"O and environment -.\"O .RI ( envp ) -.\"O strings that may be passed to a new program. -.\"O POSIX.1 allows an implementation to advertise this limit using the -.\"O .B ARG_MAX -.\"O constant (either defined in -.\"O .I -.\"O or available at run time using the call -.\"O .IR "sysconf(_SC_ARG_MAX)" ). -ほとんどの UNIX の実装は、新しいプログラムに渡すことができる -コマンドライン引き数 -.RI ( argv ) -と環境変数 -.RI ( envp ) -の文字列群の合計サイズに何らかの上限を設けている。 -POSIX.1 は、 -.B ARG_MAX -定数を使ってこの上限を決める実装を認めている -.RB ( ARG_MAX -は -.I -で定義されるか、実行時に -.I "sysconf(_SC_ARG_MAX)" +.SS 引き数と環境変数の合計サイズの上限 +ほとんどの UNIX の実装は、新しいプログラムに渡すことができる コマンドライン引き数 (\fIargv\fP) と環境変数 (\fIenvp\fP) +の文字列群の合計サイズに何らかの上限を設けている。 POSIX.1 は、 \fBARG_MAX\fP 定数を使ってこの上限を決める実装を認めている +(\fBARG_MAX\fP は \fI\fP で定義されるか、実行時に \fIsysconf(_SC_ARG_MAX)\fP の呼び出しで入手できるかのいずれかである)。 -.\"O On Linux prior to kernel 2.6.23, the memory used to store the -.\"O environment and argument strings was limited to 32 pages -.\"O (defined by the kernel constant -.\"O .BR MAX_ARG_PAGES ). -.\"O On architectures with a 4-kB page size, -.\"O this yields a maximum size of 128 kB. -カーネル 2.6.23 より前の Linux では、環境変数と引き数の文字列群を -格納するのに使用されるメモリは 32 ページに制限されていた -(32 ページというのはカーネル定数 -.B MAX_ARG_PAGES -で定義される)。したがって、 -ページサイズが 4 kB のアーキテクチャでは、 +カーネル 2.6.23 より前の Linux では、環境変数と引き数の文字列群を 格納するのに使用されるメモリは 32 ページに制限されていた (32 +ページというのはカーネル定数 \fBMAX_ARG_PAGES\fP で定義される)。したがって、 ページサイズが 4 kB のアーキテクチャでは、 最大サイズは 128 kB ということになる。 -.\"O On kernel 2.6.23 and later, most architectures support a size limit -.\"O derived from the soft -.\"O .B RLIMIT_STACK -.\"O resource limit (see -.\"O .BR getrlimit (2)) -.\"O that is in force at the time of the -.\"O .BR execve () -.\"O call. -カーネル 2.6.23 以降では、ほとんどのアーキテクチャにおいて、 -.BR execve () -が呼び出された時点で適用されているリソースのソフト上限 -.B RLIMIT_STACK -に基づいたサイズ上限が使われる -.\"O (Architectures with no memory management unit are excepted: -.\"O they maintain the limit that was in effect before kernel 2.6.23.) -.\"O This change allows programs to have a much larger -.\"O argument and/or environment list. -(メモリ管理ユニット (MMU) を持たないアーキテクチャは上記の変更の -例外であり、これらのアーキテクチャではカーネル 2.6.23 より前と -同じ上限がそのまま使用される)。 .\" For some background on the changes to ARG_MAX in kernels 2.6.23 and .\" 2.6.25, see: .\" http://sourceware.org/bugzilla/show_bug.cgi?id=5786 .\" http://bugzilla.kernel.org/show_bug.cgi?id=10095 .\" http://thread.gmane.org/gmane.linux.kernel/646709/focus=648101, .\" checked into 2.6.25 as commit a64e715fc74b1a7dcc5944f848acc38b2c4d4ee2. -.\"O For these architectures, the total size is limited to 1/4 of the allowed -.\"O stack size. -.\"O (Imposing the 1/4-limit -.\"O ensures that the new program always has some stack space.) -これらのアーキテクチャでは、合計サイズは許可されたスタックサイズの -1/4 に制限されている -(1/4 の上限を設けているのは、新しいプログラムが必ずある程度の -スタック空間を持てることを保証するためである)。 .\" Ollie: That doesn't include the lists of pointers, though, .\" so the actual usage is a bit higher (1 pointer per argument). -.\"O Since Linux 2.6.25, -.\"O the kernel places a floor of 32 pages on this size limit, -.\"O so that, even when -.\"O .BR RLIMIT_STACK -.\"O is set very low, -.\"O applications are guaranteed to have at least as much argument and -.\"O environment space as was provided by Linux 2.6.23 and earlier. -.\"O (This guarantee was not provided in Linux 2.6.23 and 2.6.24.) -Linux 2.6.25 以降では、カーネルはこのサイズ上限に 32 ページの下限を -設けている。これにより、 -.B RLIMIT_STACK -が非常に小さく設定された場合でも、アプリケーションが少なくとも -Linux 2.6.23 以前で提供されていたのと同じ大きさの引き数と環境変数の空間 -と同じだけは確保できることが保証されている -(この最低限の保証は Linux 2.6.23 と 2.6.24 では提供されていない)。 -.\"O Additionally, the limit per string is 32 pages (the kernel constant -.\"O .BR MAX_ARG_STRLEN ), -.\"O and the maximum number of strings is 0x7FFFFFFF. -また、各文字列の上限は 32 ページ (カーネル定数 -.BR MAX_ARG_STRLEN ) -で、文字列数の最大値は 0x7FFFFFFF である。 -.\"O .SH "RETURN VALUE" +カーネル 2.6.23 以降では、ほとんどのアーキテクチャにおいて、 \fBexecve\fP() が呼び出された時点で適用されているリソースのソフト上限 +\fBRLIMIT_STACK\fP に基づいたサイズ上限が使われる (メモリ管理ユニット (MMU) を持たないアーキテクチャは上記の変更の +例外であり、これらのアーキテクチャではカーネル 2.6.23 より前と 同じ上限がそのまま使用される)。 +これらのアーキテクチャでは、合計サイズは許可されたスタックサイズの 1/4 に制限されている (1/4 +の上限を設けているのは、新しいプログラムが必ずある程度の スタック空間を持てることを保証するためである)。 Linux 2.6.25 +以降では、カーネルはこのサイズ上限に 32 ページの下限を 設けている。これにより、 \fBRLIMIT_STACK\fP +が非常に小さく設定された場合でも、アプリケーションが少なくとも Linux 2.6.23 以前で提供されていたのと同じ大きさの引き数と環境変数の空間 +と同じだけは確保できることが保証されている (この最低限の保証は Linux 2.6.23 と 2.6.24 では提供されていない)。 +また、各文字列の上限は 32 ページ (カーネル定数 \fBMAX_ARG_STRLEN\fP) で、文字列数の最大値は 0x7FFFFFFF である。 .SH 返り値 -.\"O On success, -.\"O .BR execve () -.\"O does not return, on error \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功すると -.BR execve () -は返らない。エラーの場合は \-1 を返し、 -.I errno -を適切に設定する。 -.\"O .SH ERRORS +成功すると \fBexecve\fP() は返らない。エラーの場合は \-1 を返し、 \fIerrno\fP を適切に設定する。 .SH エラー -.TP -.B E2BIG -.\"O The total number of bytes in the environment -.\"O .RI ( envp ) -.\"O and argument list -.\"O .RI ( argv ) -.\"O is too large. -環境変数 -.RI ( envp ) -と引き数リスト -.RI ( argv ) -の合計バイト数が大き過ぎる。 -.TP -.B EACCES -.\"O Search permission is denied on a component of the path prefix of -.\"O .I filename -.\"O or the name of a script interpreter. -.\"O (See also -.\"O .BR path_resolution (7).) -.I filename -やスクリプトインタプリタ名の構成要素に検索許可 (search permission) -が与えられていない -.RB ( path_resolution (7) -も参照すること)。 -.TP -.B EACCES -.\"O The file or a script interpreter is not a regular file. -ファイルもしくはスクリプトのインタプリタが通常ファイル (regular file) -でない。 -.TP -.B EACCES -.\"O Execute permission is denied for the file or a script or ELF interpreter. -ファイルやスクリプトや ELF インタプリタに -実行許可 (execute permission) が与えられていない。 -.TP -.B EACCES -.\"O The file system is mounted -.\"O .IR noexec . -ファイル・システムが -.I noexec -でマウントされている。 -.TP -.B EFAULT -.\"O .I filename -.\"O points outside your accessible address space. -.I filename -がアクセス可能なアドレス空間の外を指している。 -.TP -.B EINVAL -.\"O An ELF executable had more than one PT_INTERP segment (i.e., tried to -.\"O name more than one interpreter). -ELF 実行形式で複数の PT_INTERP セグメントが存在する。 -(すなわち複数のインタプリタを指定した。) -.TP -.B EIO -.\"O An I/O error occurred. +.TP +\fBE2BIG\fP +環境変数 (\fIenvp\fP) と引き数リスト (\fIargv\fP) の合計バイト数が大き過ぎる。 +.TP +\fBEACCES\fP +\fIfilename\fP やスクリプトインタプリタ名の構成要素に検索許可 (search permission) が与えられていない +(\fBpath_resolution\fP(7) も参照すること)。 +.TP +\fBEACCES\fP +ファイルもしくはスクリプトのインタプリタが通常ファイル (regular file) でない。 +.TP +\fBEACCES\fP +ファイルやスクリプトや ELF インタプリタに 実行許可 (execute permission) が与えられていない。 +.TP +\fBEACCES\fP +ファイル・システムが \fInoexec\fP でマウントされている。 +.TP +\fBEFAULT\fP +\fIfilename\fP がアクセス可能なアドレス空間の外を指している。 +.TP +\fBEINVAL\fP +ELF 実行形式で複数の PT_INTERP セグメントが存在する。 (すなわち複数のインタプリタを指定した。) +.TP +\fBEIO\fP I/O エラーが発生した。 -.TP -.B EISDIR -.\"O An ELF interpreter was a directory. +.TP +\fBEISDIR\fP ELF インタプリタがディレクトリだった。 -.TP -.B ELIBBAD -.\"O An ELF interpreter was not in a recognized format. +.TP +\fBELIBBAD\fP ELF インタプリタが理解できるフォーマットでなかった。 -.TP -.B ELOOP -.\"O Too many symbolic links were encountered in resolving -.\"O .I filename -.\"O or the name of a script or ELF interpreter. -.I filename -やスクリプトや ELF のインタプリタを解決する際に遭遇した -シンボリック・リンクが多過ぎる。 -.TP -.B EMFILE -.\"O The process has the maximum number of files open. +.TP +\fBELOOP\fP +\fIfilename\fP やスクリプトや ELF のインタプリタを解決する際に遭遇した シンボリック・リンクが多過ぎる。 +.TP +\fBEMFILE\fP そのプロセスがオープンできるファイル数の上限まで既にオープンしている。 -.TP -.B ENAMETOOLONG -.\"O .I filename -.\"O is too long. -.I filename -が長過ぎる。 -.TP -.B ENFILE -.\"O The system limit on the total number of open files has been reached. -そのシステムでオープンできるファイル数の制限に達した。 -.TP -.B ENOENT -.\"O The file -.\"O .I filename -.\"O or a script or ELF interpreter does not exist, or a shared library -.\"O needed for file or interpreter cannot be found. -ファイル -.I filename -かスクリプトや ELF のインタプリタが存在しない。 -.TP -.B ENOEXEC -.\"O An executable is not in a recognized format, is for the wrong -.\"O architecture, or has some other format error that means it cannot be -.\"O executed. -実行ファイルが理解できない形式であるか、違うアーキテクチャのものか、 -その他のフォーマット・エラーにより実行ができなかった。 -.TP -.B ENOMEM -.\"O Insufficient kernel memory was available. +.TP +\fBENAMETOOLONG\fP +\fIfilename\fP が長過ぎる。 +.TP +\fBENFILE\fP +オープンされたファイルの総数がシステム全体の上限に達していた。 +.TP +\fBENOENT\fP +ファイル \fIfilename\fP かスクリプトや ELF のインタプリタが存在しない。 +.TP +\fBENOEXEC\fP +実行ファイルが理解できない形式であるか、違うアーキテクチャのものか、 その他のフォーマット・エラーにより実行ができなかった。 +.TP +\fBENOMEM\fP カーネルに十分なメモリがない。 -.TP -.B ENOTDIR -.\"O A component of the path prefix of -.\"O .I filename -.\"O or a script or ELF interpreter is not a directory. -.I filename -やスクリプトや ELF のインタプリタの構成要素がディレクトリでない。 -.TP -.B EPERM -.\"O The file system is mounted -.\"O .IR nosuid , -.\"O the user is not the superuser, -.\"O and the file has the set-user-ID or set-group-ID bit set. -ファイル・システムが -.I nosuid -でマウントされ、ユーザがスーパーユーザでなく、 -ファイルに set-user-ID あるいは set-group-ID ビットが設定されている。 -.TP -.B EPERM -.\"O The process is being traced, the user is not the superuser and the -.\"O file has the set-user-ID or set-group-ID bit set. -プロセスがトレースされ、ユーザがスーパーユーザでなく、 -ファイルに set-user-ID あるいは set-group-ID ビットが設定されている。 -.TP -.B ETXTBSY -.\"O Executable was open for writing by one or more processes. +.TP +\fBENOTDIR\fP +\fIfilename\fP やスクリプトや ELF のインタプリタの構成要素がディレクトリでない。 +.TP +\fBEPERM\fP +ファイル・システムが \fInosuid\fP でマウントされ、ユーザがスーパーユーザでなく、 ファイルに set\-user\-ID あるいは +set\-group\-ID ビットが設定されている。 +.TP +\fBEPERM\fP +プロセスがトレースされ、ユーザがスーパーユーザでなく、 ファイルに set\-user\-ID あるいは set\-group\-ID ビットが設定されている。 +.TP +\fBETXTBSY\fP 実行ファイルを書き込み用にオープンしているプロセスがある。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O SVr4, 4.3BSD, POSIX.1-2001. -.\"O POSIX.1-2001 does not document the #! behavior -.\"O but is otherwise compatible. -.\"O .\" SVr4 documents additional error -.\"O .\" conditions EAGAIN, EINTR, ELIBACC, ENOLINK, EMULTIHOP; POSIX does not -.\"O .\" document ETXTBSY, EPERM, EFAULT, ELOOP, EIO, ENFILE, EMFILE, EINVAL, -.\"O .\" EISDIR or ELIBBAD error conditions. -SVr4, 4.3BSD, POSIX.1-2001. -POSIX.1-2001 には #! 動作についての記述はないが、 -他は互換性がある。 -.\" SVr4 には他に EAGAIN, EINTR, ELIBACC, ENOLINK, EMULTIHOP -.\" についての記述がある。 -.\" POSIX には ETXTBSY, EPERM, EFAULT, ELOOP, EIO, ENFILE, EMFILE, -.\" EINVAL, EISDIR, ELIBBAD エラー状態についての記述はない。 -.\"O .SH NOTES +.\" SVr4 documents additional error +.\" conditions EAGAIN, EINTR, ELIBACC, ENOLINK, EMULTIHOP; POSIX does not +.\" document ETXTBSY, EPERM, EFAULT, ELOOP, EIO, ENFILE, EMFILE, EINVAL, +.\" EISDIR or ELIBBAD error conditions. +SVr4, 4.3BSD, POSIX.1\-2001. POSIX.1\-2001 には #! 動作についての記述はないが、 他は互換性がある。 .SH 注意 -.\"O Set-user-ID and set-group-ID processes can not be -.\"O .BR ptrace (2)d. -set-user-id プロセスと set-group-ID プロセスは -.BR ptrace (2) -できない。 - -.\"O Linux ignores the set-user-ID and set-group-ID bits on scripts. -Linux はスクリプトの set-user-ID と set-group-ID ビットを無視する。 - -.\"O The result of mounting a file system -.\"O .I nosuid -.\"O varies across Linux kernel versions: -.\"O some will refuse execution of set-user-ID and set-group-ID -.\"O executables when this would -.\"O give the user powers she did not have already (and return -.\"O .BR EPERM ), -.\"O some will just ignore the set-user-ID and set-group-ID bits and -.\"O .BR exec () -.\"O successfully. -ファイルシステムを -.I nosuid -でマウントした場合に set-user-ID/set-group-ID の実行ファイルを -どの様に扱うかは、Linux カーネルのバージョンによって異なる: -あるバージョンでは、すでに必要な権限を持っている場合を除いて、 -その実行を拒否する (そして -.B EPERM -を返す)。別のあるバージョンでは -set-user-ID/set-group-ID ビットのみを無視し -.BR exec () +set\-user\-id プロセスと set\-group\-ID プロセスは \fBptrace\fP(2) できない。 + +Linux はスクリプトの set\-user\-ID と set\-group\-ID ビットを無視する。 + +ファイルシステムを \fInosuid\fP でマウントした場合に set\-user\-ID/set\-group\-ID の実行ファイルを +どの様に扱うかは、Linux カーネルのバージョンによって異なる: あるバージョンでは、すでに必要な権限を持っている場合を除いて、 その実行を拒否する +(そして \fBEPERM\fP を返す)。別のあるバージョンでは set\-user\-ID/set\-group\-ID ビットのみを無視し \fBexec\fP() は成功する。 -.\"O A maximum line length of 127 characters is allowed for the first line in -.\"O a #! executable shell script. -#! 実行形式のシェル・スクリプトの 1行目に許されている文字数は、 -最大 127 文字である。 - -.\"O The semantics of the -.\"O .I optional-arg -.\"O argument of an interpreter script vary across implementations. -.\"O On Linux, the entire string following the -.\"O .I interpreter -.\"O name is passed as a single argument to the interpreter, -.\"O and this string can include white space. -.\"O However, behavior differs on some other systems. -.\"O Some systems -.\"O .\" e.g., Solaris 8 -.\"O use the first white space to terminate -.\"O .IR optional-arg . -.\"O On some systems, -.\"O .\" e.g., FreeBSD before 6.0, but not FreeBSD 6.0 onward -.\"O an interpreter script can have multiple arguments, -.\"O and white spaces in -.\"O .I optional-arg -.\"O are used to delimit the arguments. -インタプリタ・スクリプトの -.I optional-arg -引き数の解釈方法は実装により異なる。 -Linux では、インタプリタ名 -.I interpreter -に続く文字列全体がインタプリタに 1個の引き数として渡される。 -しかし、動作が異なるシステムもある。 -あるシステムでは、 -.\" 例えば、Solaris 8 -.I optional-arg -のうち最初のホワイト・スペースまでが -引き数として渡される。 -また、別のシステムでは -.\" 例えば、6.0 より前の FreeBSD (FreeBSD 6.0 以降は違う) -インタプリタ・スクリプトは複数の引き数を持つことができ、 -.I optional-arg -内のホワイト・スペースが引き数の区切りとなる。 - -.\"O On Linux, -.\"O .I argv -.\"O can be specified as NULL, -.\"O which has the same effect as specifying this argument -.\"O as a pointer to a list containing a single NULL pointer. -.\"O .B "Do not take advantage of this misfeature!" -.\"O It is nonstandard and nonportable: -.\"O on most other UNIX systems doing this will result in an error -.\"O .RB ( EFAULT ). -Linux では、 -.I argv -に NULL を指定することができる。これは、この引き数に NULL ポインタ -1個だけを含むリストへのポインタを指定したのと同じ効果を持つ。 -.BR 「この間違った機能を利用しないこと」 。 -これは非標準で、移植性もない。 -他のほとんどの UNIX システムでは、これを行うとエラー -.RB ( EFAULT ) -になる。 +#! 実行形式のシェル・スクリプトの 1行目に許されている文字数は、 最大 127 文字である。 + +.\" e.g., Solaris 8 +.\" e.g., FreeBSD before 6.0, but not FreeBSD 6.0 onward +インタプリタ・スクリプトの \fIoptional\-arg\fP 引き数の解釈方法は実装により異なる。 Linux では、インタプリタ名 +\fIinterpreter\fP に続く文字列全体がインタプリタに 1個の引き数として渡される。 しかし、動作が異なるシステムもある。 あるシステムでは、 +\fIoptional\-arg\fP のうち最初のホワイト・スペースまでが 引き数として渡される。 また、別のシステムでは +インタプリタ・スクリプトは複数の引き数を持つことができ、 \fIoptional\-arg\fP 内のホワイト・スペースが引き数の区切りとなる。 + .\" e.g., EFAULT on Solaris 8 and FreeBSD 6.1; but .\" HP-UX 11 is like Linux -- mtk, Apr 2007 .\" Bug filed 30 Apr 2007: http://bugzilla.kernel.org/show_bug.cgi?id=8408 .\" Bug rejected (because fix would constitute an ABI change). .\" +Linux では、 \fIargv\fP に NULL を指定することができる。これは、この引き数に NULL ポインタ +1個だけを含むリストへのポインタを指定したのと同じ効果を持つ。 \fB「この間違った機能を利用しないこと」\fP。 これは非標準で、移植性もない。 +他のほとんどの UNIX システムでは、これを行うとエラー (\fBEFAULT\fP) になる。 -.\"O POSIX.1-2001 says that values returned by -.\"O .BR sysconf (3) -.\"O should be invariant over the lifetime of a process. -.\"O However, since Linux 2.6.23, if the -.\"O .BR RLIMIT_STACK -.\"O resource limit changes, then the value reported by -.\"O .B _SC_ARG_MAX -.\"O will also change, -.\"O to reflect the fact that the limit on space for holding -.\"O command-line arguments and environment variables has changed. -POSIX.1-2001 は、 -.BR sysconf (3) -が返す値はプロセスの生存中は変化しないべきだとしている。 -しかしながら、Linux 2.6.23 以降では、リソース上限 -.B RLIMIT_STACK -が変化した場合、 -コマンドライン引き数と環境変数を保持するための空間に対する上限が -変化したことを反映して、 -.B _SC_ARG_MAX -が返す値も変化する。 .\" -.\"O .\" .SH BUGS -.\"O .\" Some Linux versions have failed to check permissions on ELF -.\"O .\" interpreters. This is a security hole, because it allows users to -.\"O .\" open any file, such as a rewinding tape device, for reading. Some -.\"O .\" Linux versions have also had other security holes in -.\"O .\" .BR execve () -.\"O .\" that could be exploited for denial of service by a suitably crafted -.\"O .\" ELF binary. There are no known problems with 2.0.34 or 2.2.15. -.\" .SH バグ -.\" Linux 版の中には、ELF インタプリタにおける -.\" 権限のチェックに失敗するものがある。 -.\" これはセキュリティホールである。 -.\" なぜなら、ユーザに任意のファイルをオープンを許可したり、 -.\" 読み込みのためにテープデバイスを巻き戻しを許可したりする。 -.\" Linux 版の中には +.\" .SH BUGS +.\" Some Linux versions have failed to check permissions on ELF +.\" interpreters. This is a security hole, because it allows users to +.\" open any file, such as a rewinding tape device, for reading. Some +.\" Linux versions have also had other security holes in .\" .BR execve () -.\" に他のセキュリティホールが -.\" 存在するものもあり、巧妙に細工された ELF バイナリによって -.\" サービス拒否 (denial of service) に利用されてしまう。 -.\" 2.0.34 また 2.2.15 には、知られている問題はない。 -.\"O .SS Historical +.\" that could be exploited for denial of service by a suitably crafted +.\" ELF binary. There are no known problems with 2.0.34 or 2.2.15. +POSIX.1\-2001 は、 \fBsysconf\fP(3) が返す値はプロセスの生存中は変化しないべきだとしている。 しかしながら、Linux +2.6.23 以降では、リソース上限 \fBRLIMIT_STACK\fP が変化した場合、 コマンドライン引き数と環境変数を保持するための空間に対する上限が +変化したことを反映して、 \fB_SC_ARG_MAX\fP が返す値も変化する。 .SS 歴史 -.\"O With UNIX V6 the argument list of an -.\"O .BR exec () -.\"O call was ended by 0, -.\"O while the argument list of -.\"O .I main -.\"O was ended by \-1. -.\"O Thus, this argument list was not directly usable in a further -.\"O .BR exec () -.\"O call. -.\"O Since UNIX V7 both are NULL. -UNIX V6 では -.BR exec () -コールの引き数リストは 0 で終端され、 -.I main -の引き数リストは \-1 で終端されていた。 -そのため、 -.I main -の引き数リストは、その後の -.BR exec () -コールには直接使用できなかった。 -UNIX V7 以降では、ともに NULL で終端される。 -.\"O .SH EXAMPLE +UNIX V6 では \fBexec\fP() コールの引き数リストは 0 で終端され、 \fImain\fP の引き数リストは \-1 で終端されていた。 +そのため、 \fImain\fP の引き数リストは、その後の \fBexec\fP() コールには直接使用できなかった。 UNIX V7 以降では、ともに +NULL で終端される。 .SH 例 -.\"O The following program is designed to be execed by the second program below. -.\"O It just echoes its command-line one per line. -このプログラムは、以下の二つ目のプログラムから実行するためのものである。 -コマンドラインを 1行に 1個ずつ表示するだけのプログラムである。 +このプログラムは、以下の二つ目のプログラムから実行するためのものである。 コマンドラインを 1行に 1個ずつ表示するだけのプログラムである。 .in +4n .nf @@ -922,17 +346,14 @@ main(int argc, char *argv[]) int j; for (j = 0; j < argc; j++) - printf("argv[%d]: %s\\n", j, argv[j]); + printf("argv[%d]: %s\en", j, argv[j]); exit(EXIT_SUCCESS); } .fi .in -.\"O This program can be used to exec the program named in its command-line -.\"O argument: -以下のプログラムは、コマンドライン引き数で指定した名前のプログラムを -実行するのに使う。 +以下のプログラムは、コマンドライン引き数で指定した名前のプログラムを 実行するのに使う。 .in +4n .nf @@ -949,7 +370,7 @@ main(int argc, char *argv[]) char *newenviron[] = { NULL }; if (argc != 2) { - fprintf(stderr, "Usage: %s \\n", argv[0]); + fprintf(stderr, "Usage: %s \en", argv[0]); exit(EXIT_FAILURE); } @@ -962,62 +383,44 @@ main(int argc, char *argv[]) .fi .in -.\"O We can use the second program to exec the first as follows: -二つ目のプログラムを使って一つ目のプログラムを実行するには -以下のようにする。 +二つ目のプログラムを使って一つ目のプログラムを実行するには 以下のようにする。 .in +4n .nf -.RB "$" " cc myecho.c \-o myecho" -.RB "$" " cc execve.c \-o execve" -.RB "$" " ./execve ./myecho" +$\fB cc myecho.c \-o myecho\fP +$\fB cc execve.c \-o execve\fP +$\fB ./execve ./myecho\fP argv[0]: ./myecho argv[1]: hello argv[2]: world .fi .in -.\"O We can also use these programs to demonstrate the use of a script -.\"O interpreter. -.\"O To do this we create a script whose "interpreter" is our -.\"O .I myecho -.\"O program: -さらに、これらのプログラムを使って、スクリプト・インタプリタの例を示す。 -このために、「インタプリタ」として先ほど作成したプログラム -.I myecho +さらに、これらのプログラムを使って、スクリプト・インタプリタの例を示す。 このために、「インタプリタ」として先ほど作成したプログラム \fImyecho\fP を使うスクリプトを作成する。 .in +4n .nf -.RB "$" " cat > script.sh" -.B #! ./myecho script-arg -.B ^D -.RB "$" " chmod +x script.sh" +$\fB cat > script.sh\fP +\fB#! ./myecho script\-arg\fP +\fB^D\fP +$\fB chmod +x script.sh\fP .fi .in -.\"O We can then use our program to exec the script: 作成しておいたプログラムを使ってスクリプトを実行する。 .in +4n .nf -.RB "$" " ./execve ./script.sh" +$\fB ./execve ./script.sh\fP argv[0]: ./myecho -argv[1]: script-arg +argv[1]: script\-arg argv[2]: ./script.sh argv[3]: hello argv[4]: world .fi .in -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR chmod (2), -.BR fork (2), -.BR ptrace (2), -.BR execl (3), -.BR fexecve (3), -.BR getopt (3), -.BR credentials (7), -.BR environ (7), -.BR path_resolution (7), -.BR ld.so (8) +\fBchmod\fP(2), \fBfork\fP(2), \fBptrace\fP(2), \fBexecl\fP(3), \fBfexecve\fP(3), +\fBgetopt\fP(3), \fBcredentials\fP(7), \fBenviron\fP(7), \fBpath_resolution\fP(7), +\fBld.so\fP(8) diff --git a/draft/man2/exit_group.2 b/draft/man2/exit_group.2 index 959ab96f..e1901746 100644 --- a/draft/man2/exit_group.2 +++ b/draft/man2/exit_group.2 @@ -20,55 +20,30 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2005 Yuichi SATO -.\" all rights reserved. -.\" Translated Sat Jan 22 22:18:14 JST 2005 -.\" by Yuichi SATO +.\"******************************************************************* .\" -.TH EXIT_GROUP 2 2008-11-27 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH EXIT_GROUP 2 2008\-11\-27 Linux "Linux Programmer's Manual" .SH 名前 -.\"O exit_group \- exit all threads in a process exit_group \- プロセス中の全てのスレッドを exit させる -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "void exit_group(int " status ); +\fBvoid exit_group(int \fP\fIstatus\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O This system call is equivalent to -.\"O .BR exit (2) -.\"O except that it terminates not only the calling thread, but all threads -.\"O in the calling process's thread group. -このシステムコールは、基本的に -.BR exit (2) -と等しいが、 -呼び出し元のスレッドだけでなく、呼び出し元のプロセスのスレッドグループに +このシステムコールは、基本的に \fBexit\fP(2) と等しいが、 呼び出し元のスレッドだけでなく、呼び出し元のプロセスのスレッドグループに ある全てのスレッドを終了させる点が異なる。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O This system call does not return. このシステムコールは値を返さない。 -.\"O .SH VERSIONS .SH バージョン -.\"O This call is present since Linux 2.5.35. このコールは、Linux 2.5.35 以降に存在する。 -.\"O .SH NOTES -.SH 注意 -.\"O Since glibc 2.3, this is the system call invoked when the -.\"O .BR exit (2) -.\"O wrapper function is called. -glibc 2.3 以降では、 -.BR exit (2) -のラッパー関数が呼び出された際に、 -このシステムコールが起動される。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O This call is Linux-specific. +glibc 2.3 以降では、 \fBexit\fP(2) のラッパー関数が呼び出された際に、 このシステムコールが起動される。 +.SH 注意 このコールは Linux 独自である。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR exit (2) +\fBexit\fP(2) diff --git a/draft/man2/faccessat.2 b/draft/man2/faccessat.2 deleted file mode 100644 index 58a14a3d..00000000 --- a/draft/man2/faccessat.2 +++ /dev/null @@ -1,259 +0,0 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" This manpage is Copyright (C) 2006, Michael Kerrisk -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" Japanese Version Copyright (c) 2006-2007 Yuichi SATO -.\" all rights reserved. -.\" Translated 2006-10-14 by Yuichi SATO , LDP v2.39 -.\" Updated & Modified 2007-01-08 by Yuichi SATO, LDP v2.43 -.\" Updated 2007-05-04, Akihiro MOTOKI -.\" -.TH FACCESSAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O faccessat \- check user's permissions of a file relative to a \ -.\"O directory file descriptor -faccessat \- ディレクトリファイルディスクリプタから相対的な位置にある -ファイルのアクセス権をチェックする -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.\"O .B #include /* Definition of AT_* constants */ -.B #include /* AT_* 定数の定義 */ -.B #include -.sp -.BI "int faccessat(int " dirfd ", const char *" pathname ", int " \ -mode ", int " flags ); -.fi -.sp -.in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): -.in -.sp -.BR faccessat (): -.PD 0 -.ad l -.RS 4 -.TP 4 -.\"O Since glibc 2.10: -glibc 2.10 以降: -_XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L -.TP -.\"O Before glibc 2.10: -glibc 2.10 より前: -_ATFILE_SOURCE -.RE -.ad -.PD -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The -.\"O .BR faccessat () -.\"O system call operates in exactly the same way as -.\"O .BR access (2), -.\"O except for the differences described in this manual page. -.BR faccessat () -システムコールは、この man ページで説明している違いがある以外は、 -.BR access (2) -と全く同じように動作する。 - -.\"O If the pathname given in -.\"O .I pathname -.\"O is relative, then it is interpreted relative to the directory -.\"O referred to by the file descriptor -.\"O .I dirfd -.\"O (rather than relative to the current working directory of -.\"O the calling process, as is done by -.\"O .BR access (2) -.\"O for a relative pathname). -.I pathname -で指定されるパス名が相対パスである場合、 -ファイルディスクリプタ -.I dirfd -で参照されるディレクトリからの相対パス名として解釈される -.RB ( access (2) -では、相対パスは呼び出し元プロセスのカレントワーキングディレクトリからの -相対パスとなる)。 - -.\"O If -.\"O .I pathname -.\"O is relative and -.\"O .I dirfd -.\"O is the special value -.\"O .BR AT_FDCWD , -.\"O then -.\"O .I pathname -.\"O is interpreted relative to the current working -.\"O directory of the calling process (like -.\"O .BR access (2)). -.I pathname -が相対パスであり、かつ -.I dirfd -が特別な値 -.B AT_FDCWD -である場合、 -.I pathname -は -.RB ( access (2) -と同じように) 呼び出し元プロセスの -カレントワーキングディレクトリからの相対パス名として解釈される。 - -.\"O If -.\"O .I pathname -.\"O is absolute, then -.\"O .I dirfd -.\"O is ignored. -.I pathname -が絶対パスである場合、 -.I dirfd -は無視される。 - -.\"O .I flags -.\"O is constructed by ORing together zero or more of the following values: -.I flags -は以下の値を 0 個以上 OR して作られる。 -.TP -.B AT_EACCESS -.\"O Perform access checks using the effective user and group IDs. -.\"O By default, -.\"O .BR faccessat () -.\"O uses the real IDs (like -.\"O .BR access (2)). -実効 (effective) ユーザ ID と実効グループ ID を使って、 -アクセス権のチェックを行う。 -デフォルトでは、 -.BR faccessat () -は -.RB ( access (2) -と同様に) 実 ID を使う。 -.TP -.B AT_SYMLINK_NOFOLLOW -.\"O If -.\"O .I pathname -.\"O is a symbolic link, do not dereference it: -.\"O instead return information about the link itself. -.I pathname -がシンボリックリンクの場合は、それを辿るのではなく、 -リンク自身についての情報を返す。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success, (all requested permissions granted) -.\"O .BR faccessat () -.\"O returns 0. -成功した場合 (全ての要求された許可が得られたら)、 -.BR faccessat () -は 0 を返す。 -.\"O On error, \-1 is returned and -.\"O .I errno -.\"O is set to indicate the error. -エラーの場合、\-1 が返され、 -.I errno -にはエラーを示す値が設定される。 -.\"O .SH ERRORS -.SH エラー -.\"O The same errors that occur for -.\"O .BR access (2) -.\"O can also occur for -.\"O .BR faccessat (). -.BR access (2) -と同じエラーが -.BR faccessat () -でも起こる。 -.\"O The following additional errors can occur for -.\"O .BR faccessat (): -.BR faccessat () -では、その他に以下のエラーが起こる: -.TP -.B EBADF -.\"O .I dirfd -.\"O is not a valid file descriptor. -.I dirfd -が有効なファイルディスクリプタでない。 -.TP -.B EINVAL -.\"O Invalid flag specified in -.\"O .IR flags . -.I flags -に不正なフラグ値が指定された。 -.TP -.B ENOTDIR -.\"O .I pathname -.\"O is relative and -.\"O .I dirfd -.\"O is a file descriptor referring to a file other than a directory. -.I pathname -が相対パスで、かつ -.I dirfd -がディレクトリ以外のファイルを参照するファイルディスクリプタである。 -.\"O .SH VERSIONS -.SH バージョン -.\"O .BR faccessat () -.\"O was added to Linux in kernel 2.6.16. -.BR faccessat () -は Linux カーネル 2.6.16 で追加された。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -POSIX.1-2008. -.\"O .SH NOTES -.SH 注意 -.\"O See -.\"O .BR openat (2) -.\"O for an explanation of the need for -.\"O .BR faccessat (). -.BR faccessat () -が必要な理由については、 -.BR openat (2) -を参照すること。 -.\"O .SS Glibc Notes -.SS glibc についての注意 -.\"O The -.\"O .B AT_EACCESS -.\"O and -.\"O .B AT_SYMLINK_NOFOLLOW -.\"O flags are actually implemented within the glibc wrapper function for -.\"O .BR faccessat (). -.B AT_EACCESS -と -.B AT_SYMLINK_NOFOLLOW -フラグは、 -.BR faccessat () -の glibc ラッパー関数で実際に実装されている。 -.\"O If either of these flags are specified, then the wrapper function employs -.\"O .BR fstatat (2) -.\"O to determine access permissions. -これらのフラグのいずれかが指定された場合、 -ラッパー関数はアクセス権を決定するために -.BR fstatat (2) -を使う。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR access (2), -.BR openat (2), -.BR eauidaccess (3), -.BR credentials (7), -.BR path_resolution (7), -.BR symlink (7) diff --git a/draft/man2/fallocate.2 b/draft/man2/fallocate.2 deleted file mode 100644 index 890e12b1..00000000 --- a/draft/man2/fallocate.2 +++ /dev/null @@ -1,234 +0,0 @@ -.\" Copyright (c) 2007 Silicon Graphics, Inc. All Rights Reserved -.\" Written by Dave Chinner -.\" May be distributed as per GNU General Public License version 2. -.\" -.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2007-10-16, Akihiro MOTOKI , LDP v2.66 -.\" Updated 2008-10-13, Akihiro MOTOKI , LDP v3.11 -.\" -.TH FALLOCATE 2 2010-09-10 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O fallocate \- manipulate file space -fallocate \- ファイル空間の操作 -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" -.B #include - -.BI "int fallocate(int " fd ", int " mode ", off_t " offset \ -", off_t " len ");" -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O This is a nonportable, Linux-specific system call. -.\"O For the portable, POSIX.1-specified method of ensuring that space -.\"O is allocated for a file, see -.\"O .BR posix_fallocate (). -このシステムコールは、移植性のない、Linux 固有のシステムコールである。 -移植性が必要な場合は、ファイルに対してディスク空間を確実に確保するために、 -POSIX.1 で規定された方法である -.BR posix_fallocate (3) -を使うこと。 - -.\"O .BR fallocate () -.\"O allows the caller to directly manipulate the allocated disk space -.\"O for the file referred to by -.\"O .I fd -.\"O for the byte range starting at -.\"O .I offset -.\"O and continuing for -.\"O .I len -.\"O bytes. -.BR fallocate () -を使うと、 -.I fd -が参照するファイルに割り当てられたディスク空間を直接操作できる。 -操作対象は、 -.I offset -から始まる長さ -.I len -バイトの領域である。 - -.\"O The -.\"O .I mode -.\"O argument determines the operation to be performed on the given range. -.\"O Currently only one flag is supported for -.\"O .IR mode : -.I mode -引き数は、指定された領域に対して実行する操作を指定する。 -現在のところ、 -.I mode -に指定できるフラグは以下の一つだけである。 -.TP -.B FALLOC_FL_KEEP_SIZE -.\"O This flag allocates and initializes to zero the disk space -.\"O within the range specified by -.\"O .I offset -.\"O and -.\"O .IR len . -.\"O After a successful call, subsequent writes into this range -.\"O are guaranteed not to fail because of lack of disk space. -このフラグは、 -.I offset -と -.I len -で指定された領域のディスク空間を割り当て、その空間を 0 で初期化する。 -呼び出しが成功すると、それに続いてこの領域への書き込みが行われるが、 -ディスク空間の不足による書き込み失敗が発生しないことが保証される。 -.\"O Preallocating zeroed blocks beyond the end of the file -.\"O is useful for optimizing append workloads. -.\"O Preallocating blocks does not change -.\"O the file size (as reported by -.\"O .BR stat (2)) -.\"O even if it is less than -.\"O .IR offset + len . -ファイル末尾より後ろの領域について 0 で埋めたブロックを前もって -割り当てておくことは、追記 (append) の作業負荷を最適化するのに -有用である。 -ファイルサイズが -.IR offset + len -よりも小さい場合であっても、ブロックの前もっての割り当てにより -.RB ( stat (2) -が返す) ファイルサイズは変更されることはない。 -.\" -.\" Note from Amit Arora: -.\" There were few more flags which were discussed, but none of -.\" them have been finalized upon. Here are these flags: -.\" FA_FL_DEALLOC, FA_FL_DEL_DATA, FA_FL_ERR_FREE, FA_FL_NO_MTIME, -.\" FA_FL_NO_CTIME -.\" All of the above flags were debated upon and we can not say -.\" if any/which one of these flags will make it to the later kernels. -.PP -.\"O If -.\"O .B FALLOC_FL_KEEP_SIZE -.\"O flag is not specified in -.\"O .IR mode , -.\"O the default behavior is almost same as when this flag is specified. -.\"O The only difference is that on success, -.\"O the file size will be changed if -.\"O .I "offset + len" -.\"O is greater than the file size. -.\"O This default behavior closely resembles the behavior of the -.\"O .BR posix_fallocate (3) -.\"O library function, -.\"O and is intended as a method of optimally implementing that function. -.B FALLOC_FL_KEEP_SIZE -フラグが -.I mode -に指定されなかった場合、デフォルトの動作は -.B FALLOC_FL_KEEP_SIZE -フラグが指定された場合とほとんど同じとなる。 -唯一の違いは、 -.I "offset + len" -がファイルサイズよりも大きかった場合、呼び出しが成功すると -ファイルサイズが変更される点である。 -このデフォルトの動作は、ライブラリ関数 -.BR posix_fallocate (3) -の動作と非常に似ている。これは -.BR posix_fallocate (3) -を最適に実装する手段を提供することを目的としているからである。 -.PP -.\"O Because allocation is done in block size chunks, -.\"O .BR fallocate () -.\"O may allocate a larger range than that which was specified. -割り当てはブロックサイズ単位で行われるため、 -.BR fallocate () -は指定されたよりも大きな領域を割り当てることがある。 -.\"O .SH RETURN VALUE -.SH 返り値 -.\"O .BR fallocate () -.\"O returns zero on success, and -1 on failure. -.BR fallocate () -は成功すると 0 を返し、エラーの場合は \-1 を返す。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EBADF -.\"O .I fd -.\"O is not a valid file descriptor, or is not opened for writing. -.I fd -が有効なファイルディスクリプタでないか、 -書き込み用としてオープンされていない。 -.TP -.B EFBIG -.\"O .IR offset + len -.\"O exceeds the maximum file size. -.I offset + len -がファイルサイズの最大値よりも大きい。 -.TP -.B EINTR -.\"O A signal was caught during execution. -実行中にシグナルが捕捉された。 -.TP -.B EINVAL -.\"O .I offset -.\"O was less than 0, or -.\"O .I len -.\"O was less than or equal to 0. -.I offset -が 0 未満であるか、 -.I len -が 0 以下である。 -.TP -.B EIO -.\"O An I/O error occurred while reading from or writing to a file system. -ファイルシステムとの読み書き中に入出力エラーが発生した。 -.TP -.B ENODEV -.\"O .I fd -.\"O does not refer to a regular file or a directory. -.\"O (If -.\"O .I fd -.\"O is a pipe or FIFO, a different error results.) -.I fd -が通常のファイルかディレクトリを参照していない -.RI ( fd -がパイプや FIFO を参照している場合、別のエラーが発生する)。 -.TP -.B ENOSPC -.\"O There is not enough space left on the device containing the file -.\"O referred to by -.\"O .IR fd . -.I fd -が参照するファイルを含むデバイスに十分な空き領域がない。 -.TP -.B ENOSYS -.\"O The file system containing the file referred to by -.\"O .I fd -.\"O does not support this operation. -.I fd -が参照するファイルを含むファイルシステムが -指定された操作をサポートしていない。 -.TP -.B EOPNOTSUPP -.\"O The -.\"O .I mode -.\"O is not supported by the file system containing the file referred to by -.\"O .IR fd . -.I fd -が参照するファイルを含むファイルシステムが -.I mode -をサポートしていない。 -.\"O .SH VERSIONS -.SH バージョン -.\"O .BR fallocate () -.\"O is available on Linux since kernel 2.6.23. -.\"O Support is provided by glibc since version 2.10. -.BR fallocate () -はカーネル 2.6.23 以降の Linux で利用可能である。 -glibc での対応はバージョン 3.10 以降で行われている。 -.\"O .SH CONFORMING TO -.SH 準拠 -.\"O .BR fallocate () -.\"O is Linux-specific. -.BR fallocate () -は Linux 固有である。 -.\"O .SH SEE ALSO -.SH 関連項目 -.BR ftruncate (2), -.BR posix_fadvise (3), -.BR posix_fallocate (3) diff --git a/draft/man2/fchmodat.2 b/draft/man2/fchmodat.2 deleted file mode 100644 index 454b0fa5..00000000 --- a/draft/man2/fchmodat.2 +++ /dev/null @@ -1,232 +0,0 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" This manpage is Copyright (C) 2006, Michael Kerrisk -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" Japanese Version Copyright (c) 2006 Yuichi SATO -.\" all rights reserved. -.\" Translated 2006-10-14 by Yuichi SATO , LDP v2.39 -.\" -.TH FCHMODAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O fchmodat \- change permissions of a file relative to a directory \ -.\"O file descriptor -fchmodat \- ディレクトリファイルディスクリプタから相対的な位置にあるファイルのアクセス権を変更する -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.\"O .B #include /* Definition of AT_* constants */ -.B #include /* AT_* 定数の定義 */ -.B #include -.sp -.BI "int fchmodat(int " dirfd ", const char *" pathname ", mode_t " \ -mode ", int " flags ); -.fi -.sp -.in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): -.in -.sp -.BR fchmodat (): -.PD 0 -.ad l -.RS 4 -.TP 4 -.\"O Since glibc 2.10: -glibc 2.10 以降: -_XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L -.TP -.\"O Before glibc 2.10: -glibc 2.10 より前: -_ATFILE_SOURCE -.RE -.ad -.PD -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The -.\"O .BR fchmodat () -.\"O system call operates in exactly the same way as -.\"O .BR chmod (2), -.\"O except for the differences described in this manual page. -.BR fchmodat () -システムコールは、この man ページで説明している違いがある以外は、 -.BR chmod (2) -と全く同じように動作する。 - -.\"O If the pathname given in -.\"O .I pathname -.\"O is relative, then it is interpreted relative to the directory -.\"O referred to by the file descriptor -.\"O .I dirfd -.\"O (rather than relative to the current working directory of -.\"O the calling process, as is done by -.\"O .BR chmod (2) -.\"O for a relative pathname). -.I pathname -で指定されるパス名が相対パスである場合、 -ファイルディスクリプタ -.I dirfd -で参照されるディレクトリからの相対パス名として解釈される -.RB ( chmod (2) -では、相対パスは呼び出し元プロセスのカレントワーキングディレクトリからの -相対パスとなる)。 - -.\"O If -.\"O .I pathname -.\"O is relative and -.\"O .I dirfd -.\"O is the special value -.\"O .BR AT_FDCWD , -.\"O then -.\"O .I pathname -.\"O is interpreted relative to the current working -.\"O directory of the calling process (like -.\"O .BR chmod (2)). -.I pathname -が相対パスであり、かつ -.I dirfd -が特別な値 -.B AT_FDCWD -である場合、 -.I pathname -は -.RB ( chmod (2) -と同じように) 呼び出し元プロセスの -カレントワーキングディレクトリからの相対パス名として解釈される。 - -.\"O If -.\"O .I pathname -.\"O is absolute, then -.\"O .I dirfd -.\"O is ignored. -.I pathname -が絶対パスである場合、 -.I dirfd -は無視される。 - -.\"O .I flags -.\"O can either be 0, or include the following flag: -.I flags -は 0 または以下のフラグである。 -.TP -.B AT_SYMLINK_NOFOLLOW -.\"O If -.\"O .I pathname -.\"O is a symbolic link, do not dereference it: -.\"O instead operate on the link itself. -.I pathname -がシンボリックリンクの場合は、それを辿るのではなく、 -リンク自身に対して (アクセス権の変更の) 操作を行う。 -.\"O This flag is not currently implemented. -このフラグは現在のところ実装されていない。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success, -.\"O .BR fchmodat () -.\"O returns 0. -成功した場合、 -.BR fchmodat () -は 0 を返す。 -.\"O On error, \-1 is returned and -.\"O .I errno -.\"O is set to indicate the error. -エラーの場合、\-1 が返されて、 -.I errno -にはエラーを示す値が設定される。 -.\"O .SH ERRORS -.SH エラー -.\"O The same errors that occur for -.\"O .BR chmod (2) -.\"O can also occur for -.\"O .BR fchmodat (). -.BR chmod (2) -と同じエラーが -.BR fchmodat () -でも起こる。 -.\"O The following additional errors can occur for -.\"O .BR fchmodat (): -.BR fchmodat () -では、その他に以下のエラーが起こる: -.TP -.B EBADF -.\"O .I dirfd -.\"O is not a valid file descriptor. -.I dirfd -が有効なファイルディスクリプタでない。 -.TP -.B EINVAL -.\"O Invalid flag specified in -.\"O .IR flags . -.I flags -に不正なフラグ値が指定された。 -.TP -.B ENOTDIR -.\"O .I pathname -.\"O is relative and -.\"O .I dirfd -.\"O is a file descriptor referring to a file other than a directory. -.I pathname -が相対パスで、かつ -.I dirfd -がディレクトリ以外のファイルを参照するファイルディスクリプタである。 -.TP -.B ENOTSUP -.\"O .I flags -.\"O specified -.\"O .BR AT_SYMLINK_NOFOLLOW , -.\"O which is not supported. -.I flags -にサポートされていない値 -.B AT_SYMLINK_NOFOLLOW -が -指定された。 -.\"O .SH VERSIONS -.SH バージョン -.\"O .BR fchmodat () -.\"O was added to Linux in kernel 2.6.16. -.BR fchmodat () -は Linux カーネル 2.6.16 で追加された。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -POSIX.1-2008. -.\"O .SH NOTES -.SH 注意 -.\"O See -.\"O .BR openat (2) -.\"O for an explanation of the need for -.\"O .BR fchmodat (). -.BR fchmodat () -が必要な理由については、 -.BR openat (2) -を参照すること。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR chmod (2), -.BR openat (2), -.BR path_resolution (7), -.BR symlink (7) diff --git a/draft/man2/fchownat.2 b/draft/man2/fchownat.2 index 81f6a0d3..977f0d1d 100644 --- a/draft/man2/fchownat.2 +++ b/draft/man2/fchownat.2 @@ -22,211 +22,77 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2006 Yuichi SATO -.\" all rights reserved. -.\" Translated 2006-10-14 by Yuichi SATO , LDP v2.39 .\" -.TH FCHOWNAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH FCHOWNAT 2 2009\-12\-13 Linux "Linux Programmer's Manual" .SH 名前 -.\"O fchownat \- change ownership of a file relative to a directory \ -.\"O file descriptor fchownat \- ディレクトリファイルディスクリプタから相対的な位置にあるファイルの所有者を変更する -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .B #include /* Definition of AT_* constants */ -.B #include /* AT_* 定数の定義 */ -.B #include +\fB#include /* AT_* 定数の定義 */\fP +\fB#include \fP .sp -.BI "int fchownat(int " dirfd ", const char *" pathname , -.BI " uid_t " owner ", gid_t " group ", int " flags ); +\fBint fchownat(int \fP\fIdirfd\fP\fB, const char *\fP\fIpathname\fP\fB,\fP +\fB uid_t \fP\fIowner\fP\fB, gid_t \fP\fIgroup\fP\fB, int \fP\fIflags\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR fchownat (): +\fBfchownat\fP(): .PD 0 .ad l .RS 4 -.TP 4 -.\"O Since glibc 2.10: +.TP 4 glibc 2.10 以降: _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L +.TP +glibc 2.10 より前: +_ATFILE_SOURCE .RE .ad .PD -.TP -.\"O Before glibc 2.10: -glibc 2.10 より前: -_ATFILE_SOURCE -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR fchownat () -.\"O system call operates in exactly the same way as -.\"O .BR chown (2), -.\"O except for the differences described in this manual page. -.BR fchownat () -システムコールは、この man ページで説明している違いがある以外は、 -.BR chown (2) +\fBfchownat\fP() システムコールは、この man ページで説明している違いがある以外は、 \fBchown\fP(2) と全く同じように動作する。 -.\"O If the pathname given in -.\"O .I pathname -.\"O is relative, then it is interpreted relative to the directory -.\"O referred to by the file descriptor -.\"O .I dirfd -.\"O (rather than relative to the current working directory of -.\"O the calling process, as is done by -.\"O .BR chown (2) -.\"O for a relative pathname). -.I pathname -で指定されるパス名が相対パスである場合、 -ファイルディスクリプタ -.I dirfd -で参照されるディレクトリからの相対パス名として解釈される -.RB ( chown (2) -では、相対パスは呼び出し元プロセスのカレントワーキングディレクトリからの -相対パスとなる)。 +\fIpathname\fP で指定されるパス名が相対パスである場合、 ファイルディスクリプタ \fIdirfd\fP +で参照されるディレクトリからの相対パス名として解釈される (\fBchown\fP(2) +では、相対パスは呼び出し元プロセスのカレントワーキングディレクトリからの 相対パスとなる)。 -.\"O If -.\"O .I pathname -.\"O is relative and -.\"O .I dirfd -.\"O is the special value -.\"O .BR AT_FDCWD , -.\"O then -.\"O .I pathname -.\"O is interpreted relative to the current working -.\"O directory of the calling process (like -.\"O .BR chown (2)). -.I pathname -が相対パスであり、かつ -.I dirfd -が特別な値 -.B AT_FDCWD -である場合、 -.I pathname -は -.RB ( chown (2) -と同じように) 呼び出し元プロセスの -カレントワーキングディレクトリからの相対パス名として解釈される。 +\fIpathname\fP が相対パスであり、かつ \fIdirfd\fP が特別な値 \fBAT_FDCWD\fP である場合、 \fIpathname\fP は +(\fBchown\fP(2) と同じように) 呼び出し元プロセスの カレントワーキングディレクトリからの相対パス名として解釈される。 -.\"O If -.\"O .I pathname -.\"O is absolute, then -.\"O .I dirfd -.\"O is ignored. -.I pathname -が絶対パスである場合、 -.I dirfd -は無視される。 +\fIpathname\fP が絶対パスである場合、 \fIdirfd\fP は無視される。 -.\"O .I flags -.\"O can either be 0, or include the following flag: -.I flags -は 0 または以下のフラグである。 -.TP -.B AT_SYMLINK_NOFOLLOW -.\"O If -.\"O .I pathname -.\"O is a symbolic link, do not dereference it: -.\"O instead operate on the link itself, like -.\"O .BR lchown (2). -.\"O (By default, -.\"O .BR fchownat () -.\"O dereferences symbolic links, like -.\"O .BR chown (2).) -.I pathname -がシンボリックリンクの場合は、それを辿るのではなく、 -.BR lchown (2) -と同様にリンク自身に対して (所有者の変更の) 操作を行う -(デフォルトでは、 -.BR fchownat () -は -.BR chown (2) -と同様にシンボリックリンクを辿る)。 -.\"O .SH "RETURN VALUE" +\fIflags\fP は 0 または以下のフラグである。 +.TP +\fBAT_SYMLINK_NOFOLLOW\fP +\fIpathname\fP がシンボリックリンクの場合は、それを辿るのではなく、 \fBlchown\fP(2) と同様にリンク自身に対して (所有者の変更の) +操作を行う (デフォルトでは、 \fBfchownat\fP() は \fBchown\fP(2) と同様にシンボリックリンクを辿る)。 .SH 返り値 -.\"O On success, -.\"O .BR fchownat () -.\"O returns 0. -成功した場合、 -.BR fchownat () -は 0 を返す。 -.\"O On error, \-1 is returned and -.\"O .I errno -.\"O is set to indicate the error. -エラーの場合、\-1 が返されて、 -.I errno -にはエラーを示す値が設定される。 -.\"O .SH ERRORS +成功した場合、 \fBfchownat\fP() は 0 を返す。 エラーの場合、\-1 が返されて、 \fIerrno\fP にはエラーを示す値が設定される。 .SH エラー -.\"O The same errors that occur for -.\"O .BR chown (2) -.\"O can also occur for -.\"O .BR fchownat (). -.BR chown (2) -と同じエラーが -.BR fchownat () -でも起こる。 -.\"O The following additional errors can occur for -.\"O .BR fchownat (): -.BR fchownat () -では、その他に以下のエラーが起こる: -.TP -.B EBADF -.\"O .I dirfd -.\"O is not a valid file descriptor. -.I dirfd -が有効なファイルディスクリプタでない。 -.TP -.B EINVAL -.\"O Invalid flag specified in -.\"O .IR flags . -.I flags -に不正なフラグ値が指定された。 -.TP -.B ENOTDIR -.\"O .I pathname -.\"O is relative and -.\"O .I dirfd -.\"O is a file descriptor referring to a file other than a directory. -.I pathname -が相対パスで、かつ -.I dirfd -がディレクトリ以外のファイルを参照するファイルディスクリプタである。 -.\"O .SH VERSIONS +\fBchown\fP(2) と同じエラーが \fBfchownat\fP() でも起こる。 \fBfchownat\fP() では、その他に以下のエラーが起こる: +.TP +\fBEBADF\fP +\fIdirfd\fP が有効なファイルディスクリプタでない。 +.TP +\fBEINVAL\fP +\fIflags\fP に不正なフラグ値が指定された。 +.TP +\fBENOTDIR\fP +\fIpathname\fP が相対パスで、かつ \fIdirfd\fP がディレクトリ以外のファイルを参照するファイルディスクリプタである。 .SH バージョン -.\"O .BR fchownat () -.\"O was added to Linux in kernel 2.6.16. -.BR fchownat () -は Linux カーネル 2.6.16 で追加された。 -.\"O .SH "CONFORMING TO" +\fBfchownat\fP() は Linux カーネル 2.6.16 で追加された。 .SH 準拠 -POSIX.1-2008. -.\"O A similar system call exists on Solaris. -Solaris には、これと同じようなシステムコールが存在する。 -.\"O .SH NOTES +POSIX.1\-2008. Solaris には、これと同じようなシステムコールが存在する。 .SH 注意 -.\"O See -.\"O .BR openat (2) -.\"O for an explanation of the need for -.\"O .BR fchownat (). -.BR fchownat () -が必要な理由については、 -.BR openat (2) -を参照すること。 -.\"O .SH "SEE ALSO" +\fBfchownat\fP() が必要な理由については、 \fBopenat\fP(2) を参照すること。 .SH 関連項目 -.BR chown (2), -.BR openat (2), -.BR path_resolution (7), -.BR symlink (7) +\fBchown\fP(2), \fBopenat\fP(2), \fBpath_resolution\fP(7), \fBsymlink\fP(7) diff --git a/draft/man2/fcntl.2 b/draft/man2/fcntl.2 deleted file mode 100644 index 82cf72db..00000000 --- a/draft/man2/fcntl.2 +++ /dev/null @@ -1,2222 +0,0 @@ -'\" t -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" This manpage is Copyright (C) 1992 Drew Eckhardt; -.\" and Copyright (C) 1993 Michael Haardt, Ian Jackson; -.\" and Copyright (C) 1998 Jamie Lokier; -.\" and Copyright (C) 2002 Michael Kerrisk. -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" Modified 1993-07-24 by Rik Faith -.\" Modified 1995-09-26 by Andries Brouwer -.\" and again on 960413 and 980804 and 981223. -.\" Modified 1998-12-11 by Jamie Lokier -.\" Applied correction by Christian Ehrhardt - aeb, 990712 -.\" Modified 2002-04-23 by Michael Kerrisk -.\" Added note on F_SETFL and O_DIRECT -.\" Complete rewrite + expansion of material on file locking -.\" Incorporated description of F_NOTIFY, drawing on -.\" Stephen Rothwell's notes in Documentation/dnotify.txt. -.\" Added description of F_SETLEASE and F_GETLEASE -.\" Corrected and polished, aeb, 020527. -.\" Modified 2004-03-03 by Michael Kerrisk -.\" Modified description of file leases: fixed some errors of detail -.\" Replaced the term "lease contestant" by "lease breaker" -.\" Modified, 27 May 2004, Michael Kerrisk -.\" Added notes on capability requirements -.\" Modified 2004-12-08, added O_NOATIME after note from Martin Pool -.\" 2004-12-10, mtk, noted F_GETOWN bug after suggestion from aeb. -.\" 2005-04-08 Jamie Lokier , mtk -.\" Described behavior of F_SETOWN/F_SETSIG in -.\" multithreaded processes, and generally cleaned -.\" up the discussion of F_SETOWN. -.\" 2005-05-20, Johannes Nicolai , -.\" mtk: Noted F_SETOWN bug for socket file descriptor in Linux 2.4 -.\" and earlier. Added text on permissions required to send signal. -.\" 2009-09-30, Michael Kerrisk -.\" Note obsolete F_SETOWN behavior with threads. -.\" Document F_SETOWN_EX and F_GETOWN_EX -.\" -.\" Japanese Version Copyright (c) 1996 Takeshi Ueno -.\" and Copyright (c) 2005, 2006, 2008 Akihiro MOTOKI -.\" -.\" Translated 1996-07-03, Takeshi Ueno -.\" Modified 1998-09-10, HANATAKA Shinya -.\" Modified 1999-08-14, HANATAKA Shinya -.\" Updated & Modified 2001-04-03, Yuichi SATO -.\" Updated & Modified 2005-03-15, Akihiro MOTOKI -.\" Updated & Modified 2005-04-22, Akihiro MOTOKI -.\" Updated & Modified 2005-10-14, Akihiro MOTOKI -.\" Updated & Modified 2005-11-19, Akihiro MOTOKI, LDP v2.14 -.\" Updated 2006-04-16, Akihiro MOTOKI, LDP v2.29 -.\" Updated 2008-02-11, Akihiro MOTOKI, LDP v2.77 -.\" Updated 2008-09-19, Akihiro MOTOKI, LDP v3.09 -.\" Updated 2010-04-23, Akihiro MOTOKI, LDP v3.24 -.\" -.\"WORD: asynchronous I/O 非同期 I/O -.\"WORD: descriptor ディスクリプタ -.\"WORD: open file description オープンファイル記述 -.\"WORD: feature test macro 機能検査マクロ -.\"WORD: I/O availability signal I/O が利用可能になったことを示すシグナル -.\" -.TH FCNTL 2 2009-10-17 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O fcntl \- manipulate file descriptor -fcntl \- ファイルディスクリプタの操作を行う -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.B #include -.B #include -.sp -.BI "int fcntl(int " fd ", int " cmd ", ... /* " arg " */ );" -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O .BR fcntl () -.\"O performs one of the operations described below on the open file descriptor -.\"O .IR fd . -.\"O The operation is determined by -.\"O .IR cmd . -.BR fcntl () -は、オープンされたファイルディスクリプタ -.I fd -に関して下記の操作を行う。操作は -.I cmd -によって決まる: - -.\"O .BR fcntl () -.\"O can take an optional third argument. -.\"O Whether or not this argument is required is determined by -.\"O .IR cmd . -.\"O The required argument type is indicated in parentheses after each -.\"O .I cmd -.\"O name (in most cases, the required type is -.\"O .IR long , -.\"O and we identify the argument using the name -.\"O .IR arg ), -.\"O or -.\"O .I void -.\"O is specified if the argument is not required. -.BR fcntl () -はオプションとして第三引き数をとることができる。 -第三引き数が必要かどうかは -.I cmd -により決まる。 -必要な引き数の型は -.I cmd -名の後ろの括弧内で指定されている -(ほとんどの場合、必要な型は -.I long -であり、この引き数を表すのに -.I arg -という名前を使っている)。 -引き数が必要ない場合には -.I void -が指定されている。 -.\"O .SS "Duplicating a file descriptor" -.SS "ファイルディスクリプタの複製" -.TP -.BR F_DUPFD " (\fIlong\fP)" -.\"O Find the lowest numbered available file descriptor -.\"O greater than or equal to -.\"O .I arg -.\"O and make it be a copy of -.\"O .IR fd . -.\"O This is different from -.\"O .BR dup2 (2), -.\"O which uses exactly the descriptor specified. -利用可能なファイルディスクリプタのうち、 -.I arg -以上で最小のものを探し、 -.I fd -のコピーとする。これは別の形の -.BR dup2 (2) -である。 -.BR dup2 (2) -では指定されたディスクリプタが使われる点が違う。 -.IP -.\"O On success, the new descriptor is returned. -成功すると、新しいディスクリプタが返される。 -.IP -.\"O See -.\"O .BR dup (2) -.\"O for further details. -詳細は -.BR dup (2) -を参照のこと。 -.TP -.\"O .BR F_DUPFD_CLOEXEC " (\fIlong\fP; since Linux 2.6.24)" -.BR F_DUPFD_CLOEXEC " (\fIlong\fP; Linux 2.6.24 以降)" -.\"O As for -.\"O .BR F_DUPFD , -.\"O but additionally set the -.\"O close-on-exec flag for the duplicate descriptor. -.B F_DUPFD -と同様だが、それに加えて複製されたディスクリプタに対して -close-on-exec フラグをセットする。 -.\"O Specifying this flag permits a program to avoid an additional -.\"O .BR fcntl () -.\"O .B F_SETFD -.\"O operation to set the -.\"O .B FD_CLOEXEC -.\"O flag. -このフラグを指定することで、プログラムは -.B FD_CLOEXEC -フラグをセットするために -.BR fcntl () -の -.B F_SETFD -操作を追加で行う必要がなくなる。 -.\"O For an explanation of why this flag is useful, -.\"O see the description of -.\"O .B O_CLOEXEC -.\"O in -.\"O .BR open (2). -このフラグがなぜ有用かについては、 -.BR open (2) -の -.B O_CLOEXEC -の説明を参照のこと。 -.\"O .SS "File descriptor flags" -.SS "ファイルディスクリプタ・フラグ" -.\"O The following commands manipulate the flags associated with -.\"O a file descriptor. -.\"O Currently, only one such flag is defined: -.\"O .BR FD_CLOEXEC , -.\"O the close-on-exec flag. -.\"O If the -.\"O .B FD_CLOEXEC -.\"O bit is 0, the file descriptor will remain open across an -.\"O .BR execve (2), -.\"O otherwise it will be closed. -以下のコマンドを使って、ファイルディスクリプタに関連するフラグ -を操作することができる。 -現在のところ、定義されているフラグは一つだけである: -.B FD_CLOEXEC -(close-on-exec フラグ)。 -.B FD_CLOEXEC -ビットが 0 なら、ファイルディスクリプタは -.BR execve (2) -を行ってもオープンされたままだが、そうでない場合はクローズされる。 -.TP -.BR F_GETFD " (\fIvoid\fP)" -.\"O Read the file descriptor flags; -.\"O .I arg -.\"O is ignored. -ファイルディスクリプタ・フラグを読み出す。 -.I arg -は無視される。 -.TP -.BR F_SETFD " (\fIlong\fP)" -.\"O Set the file descriptor flags to the value specified by -.\"O .IR arg . -ファイルディスクリプタ・フラグに -.I arg -で指定した値を設定する。 -.\"O .SS "File status flags" -.SS "ファイル状態フラグ" -.\"O Each open file description has certain associated status flags, -.\"O initialized by -.\"O .BR open (2) -.\"O .\" or -.\"O .\" .BR creat (2), -.\"O and possibly modified by -.\"O .BR fcntl (). -.\"O Duplicated file descriptors -.\"O (made with -.\"O .BR dup (2), -.\"O .BR fcntl (F_DUPFD), -.\"O .BR fork (2), -.\"O etc.) refer to the same open file description, and thus -.\"O share the same file status flags. -オープンファイル記述 (open file description) には、 -ファイル記述毎に設定される状態フラグがいくつかある。これらのフラグは -.BR open (2) -.\" や -.\" .BR creat (2) -によって初期化され、 -.BR fcntl (2) -により変更することもできる。これらは、 -.RB ( dup (2), -.BR fcntl (F_DUPFD), -.BR fork (2) -などで) 複製されたファイルディスクリプタ同士は -同じオープンファイル記述を参照する。 -そのため、 -同じファイル状態フラグが共有される。 - -.\"O The file status flags and their semantics are described in -.\"O .BR open (2). -ファイル状態フラグとその意味は -.BR open (2) -で説明されている。 -.TP -.BR F_GETFL " (\fIvoid\fP)" -.\"O Read the file status flags; -.\"O .I arg -.\"O is ignored. -ファイル状態フラグを読み出す。 -.I arg -は無視される。 -.TP -.BR F_SETFL " (\fIlong\fP)" -.\"O Set the file status flags to the value specified by -.\"O .IR arg . -.\"O File access mode -.\"O .RB ( O_RDONLY ", " O_WRONLY ", " O_RDWR ) -.\"O and file creation flags -.\"O (i.e., -.\"O .BR O_CREAT ", " O_EXCL ", " O_NOCTTY ", " O_TRUNC ) -.\"O in -.\"O .I arg -.\"O are ignored. -ファイル状態フラグに -.I arg -で指定された値を設定する。 -.I arg -のうち、ファイルのアクセスモード -.RB ( O_RDONLY ", " O_WRONLY ", " O_RDWR ) -とファイル作成フラグ (すなわち -.BR O_CREAT ", " O_EXCL ", " O_NOCTTY ", " O_TRUNC ) -に関するビットは無視される。 -.\"O On Linux this command can only change the -.\"O .BR O_APPEND , -.\"O .BR O_ASYNC , -.\"O .BR O_DIRECT , -.\"O .BR O_NOATIME , -.\"O and -.\"O .B O_NONBLOCK -.\"O flags. -Linux では、このコマンドで変更できるのは -.BR O_APPEND , -.BR O_ASYNC , -.BR O_DIRECT , -.BR O_NOATIME , -.B O_NONBLOCK -フラグだけである。 -.\"O .\" FIXME . According to POSIX.1-2001, O_SYNC should also be modifiable -.\"O .\" via fcntl(2), but currently Linux does not permit this -.\"O .\" See http://bugzilla.kernel.org/show_bug.cgi?id=5994 -.\" FIXME . POSIX.1-2001 によると、 O_SYNC も fcntl(2) で変更できるべきだが、 -.\" 現在のところ Linux では許可されていない。 -.\" http://bugzilla.kernel.org/show_bug.cgi?id=5994 参照 -.\"O .SS "Advisory locking" -.SS "アドバイザリ・ロック" -.\"O .BR F_GETLK ", " F_SETLK " and " F_SETLKW -.\"O are used to acquire, release, and test for the existence of record -.\"O locks (also known as file-segment or file-region locks). -.\"O The third argument, -.\"O .IR lock , -.\"O is a pointer to a structure that has at least the following fields -.\"O (in unspecified order). -.BR F_GETLK ", " F_SETLK ", " F_SETLKW -は、レコード・ロックの獲得/解放/テストのために使用する -(レコード・ロックはファイルセグメント・ロックや -ファイル領域ロックとも呼ばれる)。 -三番目の引き数 -.I lock -は、以下に示すフィールドを含む構造体へのポインタである -(フィールドの順序は関係なく、構造体に他のフィールドがあってもよい)。 -.in +4n -.nf -.sp -struct flock { - ... - short l_type; /* Type of lock: F_RDLCK, - F_WRLCK, F_UNLCK */ - short l_whence; /* How to interpret l_start: - SEEK_SET, SEEK_CUR, SEEK_END */ - off_t l_start; /* Starting offset for lock */ - off_t l_len; /* Number of bytes to lock */ - pid_t l_pid; /* PID of process blocking our lock - (F_GETLK only) */ - ... -}; -.fi -.in -.P -.\"O The -.\"O .IR l_whence ", " l_start ", and " l_len -.\"O fields of this structure specify the range of bytes we wish to lock. -.\"O Bytes past the end of the file may be locked, -.\"O but not bytes before the start of the file. -この構造体の -.IR l_whence ", " l_start ", " l_len -フィールドで、ロックを行いたいバイト範囲を指定する。 -ファイルの末尾より後ろのバイトをロックすることはできるが、 -ファイルの先頭より前のバイトをロックすることはできない。 - -.\"O .I l_start -.\"O is the starting offset for the lock, and is interpreted -.\"O relative to either: -.\"O the start of the file (if -.\"O .I l_whence -.\"O is -.\"O .BR SEEK_SET ); -.\"O the current file offset (if -.\"O .I l_whence -.\"O is -.\"O .BR SEEK_CUR ); -.\"O or the end of the file (if -.\"O .I l_whence -.\"O is -.\"O .BR SEEK_END ). -.\"O In the final two cases, -.\"O .I l_start -.\"O can be a negative number provided the -.\"O offset does not lie before the start of the file. -.I l_start -はロックを行う領域の開始オフセットである。 -その意味は -.I l_whence -により異なる: -.I l_whence -が -.B SEEK_SET -の場合はファイルの先頭からのオフセット、 -.I l_whence -が -.B SEEK_CUR -の場合は現在のファイルオフセットからのオフセット、 -.I l_whence -が -.B SEEK_END -の場合はファイルの末尾からのオフセットと解釈される。 -後ろの2つの場合には、 -ファイルの先頭より前にならない範囲で、 -.I l_start -に負の値を指定することができる。 - -.\"O .I l_len -.\"O specifies the number of bytes to be locked. -.\"O If -.\"O .I l_len -.\"O is positive, then the range to be locked covers bytes -.\"O .I l_start -.\"O up to and including -.\"O .IR l_start + l_len \- 1 . -.\"O Specifying 0 for -.\"O .I l_len -.\"O has the special meaning: lock all bytes starting at the -.\"O location specified by -.\"O .IR l_whence " and " l_start -.\"O through to the end of file, no matter how large the file grows. -.I l_len -はロックしたいバイト数を示す。 -.I l_len -が正の場合、ロックされるバイト範囲は -.I l_start -以上 -.IR l_start + l_len \- 1 -以下となる。 -.I l_len -に 0 を指定した場合は特別な意味を持つ: -.IR l_whence " and " l_start -で指定される位置からファイルの末尾までの全てのバイトをロックする -(ファイルがどんなに大きくなったとしてもファイルの末尾までロックする)。 - -.\"O POSIX.1-2001 allows (but does not require) -.\"O an implementation to support a negative -.\"O .I l_len -.\"O value; if -.\"O .I l_len -.\"O is negative, the interval described by -.\"O .I lock -.\"O covers bytes -.\"O .IR l_start + l_len -.\"O up to and including -.\"O .IR l_start \-1. -.\"O This is supported by Linux since kernel versions 2.4.21 and 2.5.49. -POSIX.1-2001 では、負の値の -.I l_len -をサポートする実装を認めている (必須ではない)。 -.I l_len -が負の場合、ロックされるバイト範囲は -.IR l_start + l_len -以上 -.IR l_start \-1 -以下となる。 -この動作はカーネル 2.4.21 以降および 2.5.49 以降の Linux で -サポートされている。 - -.\"O The -.\"O .I l_type -.\"O field can be used to place a read -.\"O .RB ( F_RDLCK ) -.\"O or a write -.\"O .RB ( F_WRLCK ) -.\"O lock on a file. -.\"O Any number of processes may hold a read lock (shared lock) -.\"O on a file region, but only one process may hold a write lock -.\"O (exclusive lock). -.\"O An exclusive lock excludes all other locks, -.\"O both shared and exclusive. -.I l_type -フィールドは、ファイルに対して読み出しロック -.RB ( F_RDLCK ) -と書き込みロック -.RB ( F_WRLCK ) -のどちらを -設定するかを指定する。 -ファイルのある領域に対して、読み出しロック (共有ロック) を保持できる -プロセス数に制限はないが、書き込みロック (排他ロック) を保持できる -のは一つのプロセスだけである。排他ロックを設定すると、(共有ロックか -排他ロックにかかわらず) 他のロックは何も設定できない。 -.\"O A single process can hold only one type of lock on a file region; -.\"O if a new lock is applied to an already-locked region, -.\"O then the existing lock is converted to the new lock type. -.\"O (Such conversions may involve splitting, shrinking, or coalescing with -.\"O an existing lock if the byte range specified by the new lock does not -.\"O precisely coincide with the range of the existing lock.) -一つのプロセスは、ファイルのある領域に対して一種類のロックしか保持できない。 -新規のロックがロックが設定されている領域に対して適用されると、既存のロック -は新規のロックの種別に変換される -(新規のロックで指定されたバイト範囲が既存ロックの範囲と一致する場合以外では、 -変換の過程で既存のロックの分割、縮小、結合が行われることがある)。 -.TP -.BR F_SETLK " (\fIstruct flock *\fP)" -.\"O Acquire a lock (when -.\"O .I l_type -.\"O is -.\"O .B F_RDLCK -.\"O or -.\"O .BR F_WRLCK ) -.\"O or release a lock (when -.\"O .I l_type -.\"O is -.\"O .BR F_UNLCK ) -.\"O on the bytes specified by the -.\"O .IR l_whence ", " l_start ", and " l_len -.\"O fields of -.\"O .IR lock . -.RI ( l_type -が -.B F_RDLCK -か -.B F_WRLCK -の場合は) ロックの獲得を、 -.RB ( F_UNLCK -の場合は) ロックの解放を、 -.I flock -構造体のフィールド -.IR l_whence ", " l_start ", " l_len -で指定された範囲のバイトに対して行う。 -.\"O If a conflicting lock is held by another process, -.\"O this call returns \-1 and sets -.\"O .I errno -.\"O to -.\"O .B EACCES -.\"O or -.\"O .BR EAGAIN . -指定されたロックが他のプロセスが設定しているロックと衝突する場合は、 -\-1 を返し、 -.I errno -に -.B EACCES -か -.B EAGAIN -を設定する。 -.TP -.BR F_SETLKW " (\fIstruct flock *\fP)" -.\"O As for -.\"O .BR F_SETLK , -.\"O but if a conflicting lock is held on the file, then wait for that -.\"O lock to be released. -.B F_SETLK -と同様だが、こちらではそのファイルに対して衝突するロックが -適用されていた場合に、そのロックが解放されるのを待つ点が異なる。 -.\"O If a signal is caught while waiting, then the call is interrupted -.\"O and (after the signal handler has returned) -.\"O returns immediately (with return value \-1 and -.\"O .I errno -.\"O set to -.\"O .BR EINTR ; -.\"O see -.\"O .BR signal (7)). -待っている間にシグナルを受けた場合は、システムコールは中断され、 -(シグナルハンドラが戻った直後に) 返り値 \-1 を返す (また -.I errno -に -.B EINTR -が設定される; -.BR signal (7) -参照)。 -.TP -.BR F_GETLK " (\fIstruct flock *\fP)" -.\"O On input to this call, -.\"O .I lock -.\"O describes a lock we would like to place on the file. -このコールの呼び出し時には、 -.I lock -にはそのファイルに適用しようとするロックに関する情報が入っている。 -.\"O If the lock could be placed, -.\"O .BR fcntl () -.\"O does not actually place it, but returns -.\"O .B F_UNLCK -.\"O in the -.\"O .I l_type -.\"O field of -.\"O .I lock -.\"O and leaves the other fields of the structure unchanged. -ロックを適用できる場合には、 -.BR fcntl () -は実際にはロックを行わず、構造体 -.I lock -の -.I l_type -フィールドに -.B F_UNLCK -を設定し、他のフィールドは変更せずに、復帰する。 -.\"O If one or more incompatible locks would prevent -.\"O this lock being placed, then -.\"O .BR fcntl () -.\"O returns details about one of these locks in the -.\"O .IR l_type ", " l_whence ", " l_start ", and " l_len -.\"O fields of -.\"O .I lock -.\"O and sets -.\"O .I l_pid -.\"O to be the PID of the process holding that lock. -違う種別のロックが (一つもしくは複数) 適用されていて -ロックを適用できないような場合には、 -.BR fcntl () -は、原因となったロックの一つについての詳細情報を構造体 -.I lock -のフィールド -.IR l_type ", " l_whence ", " l_start ", " l_len -に格納し、また -.I l_pid -にロックを保持しているプロセスの PID を設定して、復帰する。 -.P -.\"O In order to place a read lock, -.\"O .I fd -.\"O must be open for reading. -.\"O In order to place a write lock, -.\"O .I fd -.\"O must be open for writing. -.\"O To place both types of lock, open a file read-write. -読み出しロックを適用するには、 -.I fd -は読み出し用にオープンされていなければならない。 -書き込みロックを適用するには、 -.I fd -は書き込み用にオープンされていなければならない。 -読み書き両方のロックを適用するには、読み書き両用で -ファイルをオープンしなければならない。 -.P -.\"O As well as being removed by an explicit -.\"O .BR F_UNLCK , -.\"O record locks are automatically released when the process -.\"O terminates or if it closes -.\"O .I any -.\"O file descriptor referring to a file on which locks are held. -レコードのロックは、 -.B F_UNLCK -により明示的に削除されるだけでなく、 -プロセスが終了したときや、ロックが適用されているファイルを参照している -ファイルディスクリプタのいずれかがクローズされた場合にも解放される。 -このロックの解放は自動的に行われる。 -.\"O .\" (Additional file descriptors referring to the same file -.\"O .\" may have been obtained by calls to -.\"O .\" .BR open "(2), " dup "(2), " dup2 "(2), or " fcntl ().) -.\" .RB ( open "(2), " dup "(2), " dup2 "(2), " fcntl () -.\" の呼び出しによって同じファイルを参照するファイルディスクリプタが -.\" 他にもできているかもしれない) -.\"O This is bad: it means that a process can lose the locks on -.\"O a file like -.\"O .I /etc/passwd -.\"O or -.\"O .I /etc/mtab -.\"O when for some reason a library function decides to open, read -.\"O and close it. -この動作はまずい: あるプロセスが -.I /etc/passwd -や -.I /etc/mtab -といったファイルにロックを適用しているときに、 -あるライブラリ関数が何かの理由で同じファイルを open, read, close -すると、そのファイルへのロックが失われることになる。 -.P -.\"O Record locks are not inherited by a child created via -.\"O .BR fork (2), -.\"O but are preserved across an -.\"O .BR execve (2). -レコードのロックは -.BR fork (2) -で作成された子プロセスには継承されないが、 -.BR execve (2) -の前後では保存される。 -.P -.\"O Because of the buffering performed by the -.\"O .BR stdio (3) -.\"O library, the use of record locking with routines in that package -.\"O should be avoided; use -.\"O .BR read (2) -.\"O and -.\"O .BR write (2) -.\"O instead. -.BR stdio (3) -ではバッファリングが行われるので、 -stdio 関連の関数ではレコードのロックの使用は回避される; -代わりに -.BR read (2) -や -.BR write (2) -を使用すること。 -.\"O .SS "Mandatory locking" -.SS "強制ロック (mandatory locking)" -.\"O (Non-POSIX.) -.\"O The above record locks may be either advisory or mandatory, -.\"O and are advisory by default. -上述のロックにはアドバイザリ・ロック (advisory lock) と強制ロック (mandatory -lock) の二種類があるが、デフォルトではアドバイザリ・ロックとなる。 - -.\"O Advisory locks are not enforced and are useful only between -.\"O cooperating processes. -アドバイザリ・ロックに強制力はなく、協調して動作するプロセス間でのみ -有効である。 - -.\"O Mandatory locks are enforced for all processes. -強制ロックは全てのプロセスに対して効果がある。 -.\"O If a process tries to perform an incompatible access (e.g., -.\"O .BR read (2) -.\"O or -.\"O .BR write (2)) -.\"O on a file region that has an incompatible mandatory lock, -.\"O then the result depends upon whether the -.\"O .B O_NONBLOCK -.\"O flag is enabled for its open file description. -.\"O If the -.\"O .B O_NONBLOCK -.\"O flag is not enabled, then -.\"O system call is blocked until the lock is removed -.\"O or converted to a mode that is compatible with the access. -.\"O If the -.\"O .B O_NONBLOCK -.\"O flag is enabled, then the system call fails with the error -.\"O .BR EAGAIN . -あるプロセスが互換性のない強制ロックが適用されたファイル領域に対して -.RB ( read (2) -や -.BR write (2) -により) 互換性のないアクセスを実行しようとした場合、 -アクセスの結果は -そのファイルのオープンファイル記述で -.B O_NONBLOCK -フラグが有効になっているかにより決まる。 -.B O_NONBLOCK -フラグが有効になっていないときは、ロックが削除されるか、 -ロックがアクセスと互換性のあるモードに変換されるまで、 -システムコールは停止 (block) される。 -.B O_NONBLOCK -フラグが有効になっているときは、システムコールはエラー -.B EAGAIN -で失敗する。 - -.\"O To make use of mandatory locks, mandatory locking must be enabled -.\"O both on the file system that contains the file to be locked, -.\"O and on the file itself. -.\"O Mandatory locking is enabled on a file system -.\"O using the "\-o mand" option to -.\"O .BR mount (8), -.\"O or the -.\"O .B MS_MANDLOCK -.\"O flag for -.\"O .BR mount (2). -.\"O Mandatory locking is enabled on a file by disabling -.\"O group execute permission on the file and enabling the set-group-ID -.\"O permission bit (see -.\"O .BR chmod (1) -.\"O and -.\"O .BR chmod (2)). -強制ロックを使用するためには、ロック対象のファイルが含まれるファイルシステム -と、ロック対象のファイル自身の両方について、強制ロックが有効になっていなけれ -ばならない。ファイルシステムについて強制ロックを有効にするには、 -.BR mount (8) -に "\-o mand" オプションを渡すか、 -.BR mount (2) -に -.B MS_MANDLOCK -フラグを指定する。ファイルについて強制ロックを有効にするには、 -そのファイルのグループ実行許可 (group execute permission) を無効とし、 -かつ set-group-ID 許可ビットを有効にする -.RB ( chmod (1) -と -.BR chmod (2) -を参照)。 - -.\"O The Linux implementation of mandatory locking is unreliable. -.\"O See BUGS below. -Linux の強制ロックの実装は信頼性に欠けるものである。 -下記の「バグ」の節を参照のこと。 -.\"O .SS "Managing signals" -.SS "シグナルの管理" -.\"O .BR F_GETOWN , -.\"O .BR F_SETOWN , -.\"O .BR F_GETOWN_EX , -.\"O .BR F_SETOWN_EX , -.\"O .BR F_GETSIG -.\"O and -.\"O .B F_SETSIG -.\"O are used to manage I/O availability signals: -.BR F_GETOWN , -.BR F_SETOWN , -.BR F_GETOWN_EX , -.BR F_SETOWN_EX , -.BR F_GETSIG , -.B F_SETSIG -は、I/O が利用可能になったことを示すシグナルを管理するために使用される。 -.TP -.BR F_GETOWN " (\fIvoid\fP)" -.\"O Return (as the function result) -.\"O the process ID or process group currently receiving -.\"O .B SIGIO -.\"O and -.\"O .B SIGURG -.\"O signals for events on file descriptor -.\"O .IR fd . -.\"O Process IDs are returned as positive values; -.\"O process group IDs are returned as negative values (but see BUGS below). -.\"O .I arg -.\"O is ignored. -ファイルディスクリプタ -.I fd -のイベントに対するシグナル -.B SIGIO -および -.B SIGURG -を受けているプロセスのプロセスID かプロセスグループを -(関数の結果として) 返す。 -プロセスID は正の値として返される。 -プロセスグループID は負の値として返される (下記のバグの章を参照)。 -.I arg -は無視される。 -.TP -.BR F_SETOWN " (\fIlong\fP)" -.\"O Set the process ID or process group ID that will receive -.\"O .B SIGIO -.\"O and -.\"O .B SIGURG -.\"O signals for events on file descriptor -.\"O .IR fd -.\"O to the ID given in -.\"O .IR arg . -.\"O A process ID is specified as a positive value; -.\"O a process group ID is specified as a negative value. -ファイルディスクリプタ -.I fd -のイベント発生を知らせるシグナル -.B SIGIO -や -.B SIGURG -を受けるプロセスの -プロセス ID またはプロセスグループID を -.I arg -で指定された ID に設定する。 -プロセスID は正の値として指定し、 -プロセスグループID は負の値として指定する。 -.\"O Most commonly, the calling process specifies itself as the owner -.\"O (that is, -.\"O .I arg -.\"O is specified as -.\"O .BR getpid (2)). -ほとんどの場合、呼び出し元プロセスは所有者として自分自身を指定する -(つまり -.I arg -に -.BR getpid (2) -を指定する)。 - -.\"O .\" From glibc.info: -.\" glibc.info より: -.\"O If you set the -.\"O .B O_ASYNC -.\"O status flag on a file descriptor by using the -.\"O .B F_SETFL -.\"O command of -.\"O .BR fcntl (), -.\"O a -.\"O .B SIGIO -.\"O signal is sent whenever input or output becomes possible -.\"O on that file descriptor. -.\"O .B F_SETSIG -.\"O can be used to obtain delivery of a signal other than -.\"O .BR SIGIO . -.BR fcntl () -の -.B F_SETFL -コマンドを使用してファイルディスクリプタに -.B O_ASYNC -状態フラグを設定した場合には、そのファイルディスクリプタへの -入出力が可能になる度に -.B SIGIO -シグナルが送られる。 -.B F_SETSIG -は -.B SIGIO -以外の別のシグナルの配送を受けられるように -するのにも使うことができる。 -.\"O If this permission check fails, then the signal is -.\"O silently discarded. -許可 (permission) のチェックで失敗した場合には、 -シグナルは黙って捨てられる。 - -.\"O Sending a signal to the owner process (group) specified by -.\"O .B F_SETOWN -.\"O is subject to the same permissions checks as are described for -.\"O .BR kill (2), -.\"O where the sending process is the one that employs -.\"O .B F_SETOWN -.\"O (but see BUGS below). -.B F_SETOWN -により指定された所有者のプロセス (またはプロセスグループ) に -シグナルを送る際には、 -.BR kill (2) -に書かれているのと同じ許可のチェックが行われる。 -このとき、シグナルを送信するプロセスは -.B F_SETOWN -を使ったプロセスである -(但し、下記の「バグ」の章を参照のこと)。 - -.\"O If the file descriptor -.\"O .I fd -.\"O refers to a socket, -.\"O .B F_SETOWN -.\"O also selects -.\"O the recipient of -.\"O .B SIGURG -.\"O signals that are delivered when out-of-band -.\"O data arrives on that socket. -.\"O .RB ( SIGURG -.\"O is sent in any situation where -.\"O .BR select (2) -.\"O would report the socket as having an "exceptional condition".) -ファイルディスクリプタがソケットを参照している場合は、 -.B F_SETOWN -を使用して、ソケットに帯域外 (out-of-band) データが届いた時に -.B SIGURG -シグナルを配送する相手を選択することもできる -.RB ( SIGURG -が送られた場合には -.BR select (2) -がソケットが「特別な状態」にあると報告することだろう)。 -.\"O .\" The following appears to be rubbish. It doesn't seem to -.\"O .\" be true according to the kernel source, and I can write -.\"O .\" a program that gets a terminal-generated SIGIO even though -.\"O .\" it is not the foreground process group of the terminal. -.\"O .\" -- MTK, 8 Apr 05 -.\"O .\" -.\"O .\" If the file descriptor -.\"O .\" .I fd -.\"O .\" refers to a terminal device, then SIGIO -.\"O .\" signals are sent to the foreground process group of the terminal. -.\" 以下の記述はゴミだろう。 -.\" カーネルソースを見るとこの記述は間違っているようだし、 -.\" プログラムを書いてみたところ、端末のフォアグランド・プロセスグループで -.\" なくても、端末が生成した SIGIO シグナルを受けとる。 -.\" -- MTK, 8 Apr 05 -.\" -.\" ファイルディスクリプタが端末デバイスを参照している場合には、 -.\" SIGIO シグナルはその端末のフォアグランド・プロセスグループへと送られる。 - -.\"O The following was true in 2.6.x kernels up to and including -.\"O kernel 2.6.11: -バージョン 2.6.11 以前の 2.6.x カーネルでは、以下に示す動作であった。 -.RS -.IP -.\"O If a nonzero value is given to -.\"O .B F_SETSIG -.\"O in a multithreaded process running with a threading library -.\"O that supports thread groups (e.g., NPTL), -.\"O then a positive value given to -.\"O .B F_SETOWN -.\"O has a different meaning: -.\"O .\" The relevant place in the (2.6) kernel source is the -.\"O .\" 'switch' in fs/fcntl.c::send_sigio_to_task() -- MTK, Apr 2005 -.\"O instead of being a process ID identifying a whole process, -.\"O it is a thread ID identifying a specific thread within a process. -スレッドグループをサポートしているスレッドライブラリ (例えば NPTL) を -使って動作しているマルチスレッド・プロセスで -.B F_SETSIG -に 0 以外の値を指定した場合、 -.B F_SETOWN -に正の値を渡すと、その意味が違ってくる: -.\" The relevant place in the (2.6) kernel source is the -.\" 'switch' in fs/fcntl.c::send_sigio_to_task() -- MTK, Apr 2005 -プロセス全体を示すプロセスID ではなく、プロセス内の特定の -スレッドを示すスレッドID と解釈される。 -.\"O Consequently, it may be necessary to pass -.\"O .B F_SETOWN -.\"O the result of -.\"O .BR gettid (2) -.\"O instead of -.\"O .BR getpid (2) -.\"O to get sensible results when -.\"O .B F_SETSIG -.\"O is used. -したがって、 -.B F_SETSIG -を使う場合には、きちんと結果を受け取るには、 -.B F_SETOWN -に渡す値を -.BR getpid (2) -ではなく -.BR gettid (2) -の返り値にする必要があるだろう。 -.\"O (In current Linux threading implementations, -.\"O a main thread's thread ID is the same as its process ID. -.\"O This means that a single-threaded program can equally use -.\"O .BR gettid (2) -.\"O or -.\"O .BR getpid (2) -.\"O in this scenario.) -(現状の Linux スレッド実装では、メイン・スレッドのスレッドID は -そのスレッドのプロセスID と同じである。つまり、 -シグナル・スレッドのプログラムではこの場合 -.BR gettid (2) -と -.BR getpid (2) -は全く同じように使うことができる。) -.\"O Note, however, that the statements in this paragraph do not apply -.\"O to the -.\"O .B SIGURG -.\"O signal generated for out-of-band data on a socket: -.\"O this signal is always sent to either a process or a process group, -.\"O depending on the value given to -.\"O .BR F_SETOWN . -.\"O .\" send_sigurg()/send_sigurg_to_task() bypasses -.\"O .\" kill_fasync()/send_sigio()/send_sigio_to_task() -.\"O .\" to directly call send_group_sig_info() -.\"O .\" -- MTK, Apr 2005 (kernel 2.6.11) -ただし、注意すべき点として、この段落で述べたことは、 -ソケットの帯域外データが届いたときに生成される -.B SIGURG -シグナルにはあてはまらない。 -このシグナルは常にプロセスかプロセスグループに送られ、 -送信先は -.B F_SETOWN -に渡された値にしたがって決められる。 -.\" send_sigurg()/send_sigurg_to_task() bypasses -.\" kill_fasync()/send_sigio()/send_sigio_to_task() -.\" to directly call send_group_sig_info() -.\" -- MTK, Apr 2005 (kernel 2.6.11) -.RE -.IP -.\"O The above behavior was accidentally dropped in Linux 2.6.12, -.\"O and won't be restored. -.\"O From Linux 2.6.32 onwards, use -.\"O .BR F_SETOWN_EX -.\"O to target -.\"O .B SIGIO -.\"O and -.\"O .B SIGURG -.\"O signals at a particular thread. -上記の動作は、Linux 2.6.12 で図らずも削除され、 -元に戻されない予定である。 -Linux 2.6.32 以降で、特定のスレッド宛にシグナル -.B SIGIO -と -.B SIGURG -を送るには -.B F_SETOWN_EX -を使うこと。 -.TP -.\"O .BR F_GETOWN_EX " (struct f_owner_ex *) (since Linux 2.6.32)" -.BR F_GETOWN_EX " (struct f_owner_ex *) (Linux 2.6.32 以降)" -.\"O Return the current file descriptor owner settings -.\"O as defined by a previous -.\"O .BR F_SETOWN_EX -.\"O operation. -.\"O The information is returned in the structure pointed to by -.\"O .IR arg , -.\"O which has the following form: -直前の -.B F_SETOWN_EX -操作で定義された現在のファイルディスクリプタの所有者設定 -を返す。情報は -.I arg -が指す構造体に格納されて返される。構造体は以下の通りである。 -.nf -.in +4n - -struct f_owner_ex { - int type; - pid_t pid; -}; - -.in -.fi -.\"O The -.\"O .I type -.\"O field will have one of the values -.\"O .BR F_OWNER_TID , -.\"O .BR F_OWNER_PID , -.\"O or -.\"O .BR F_OWNER_PGRP . -.I type -フィールドは、 -.B F_OWNER_TID , -.B F_OWNER_PID , -.B F_OWNER_PGRP -のいずれか一つの値となる。 -.\"O The -.\"O .I pid -.\"O field is a positive integer representing a thread ID, process ID, -.\"O or process group ID. -.\"O See -.\"O .B F_SETOWN_EX -.\"O for more details. -.I pid -フィールドは、スレッド ID、プロセス ID、プロセスグループ ID を -表す正の整数である。詳細は -.B F_SETOWN_EX -を参照。 -.TP -.\"O .BR F_SETOWN_EX " (struct f_owner_ex *) (since Linux 2.6.32)" -.BR F_SETOWN_EX " (struct f_owner_ex *) (Linux 2.6.32 以降)" -.\"O This operation performs a similar task to -.\"O .BR F_SETOWN . -.\"O It allows the caller to direct I/O availability signals -.\"O to a specific thread, process, or process group. -この操作は -.B F_SETOWN -と同様の処理を行う。 -この操作を使うと、I/O が利用可能になったことを示すシグナルを、 -特定のスレッド、プロセス、プロセスグループに送ることができる -ようになる。 -.\"O The caller specifies the target of signals via -.\"O .IR arg , -.\"O which is a pointer to a -.\"O .IR f_owner_ex -.\"O structure. -.\"O The -.\"O .I type -.\"O field has one of the following values, which define how -.\"O .I pid -.\"O is interpreted: -呼び出し元は、 -.I arg -経由でシグナルの配送先を指定する。 -.I arg -は -.I f_owner_ex -構造体へのポインタである。 -.I type -フィールドは以下のいずれかの値を取り、 -この値により -.I pid -がどのように解釈されるかが規定される。 -.RS -.TP -.BR F_OWNER_TID -.\"O Send the signal to the thread whose thread ID -.\"O (the value returned by a call to -.\"O .BR clone (2) -.\"O or -.\"O .BR gettid (2)) -.\"O is specified in -.\"O .IR pid . -スレッド ID が -.I pid -で指定された値のスレッドにそのシグナルを送る -(スレッド ID は -.BR clone (2) -や -.BR gettid (2) -の呼び出しで返される値である)。 -.TP -.BR F_OWNER_PID -.\"O Send the signal to the process whose ID -.\"O is specified in -.\"O .IR pid . -ID が -.I pid -で指定された値のプロセスにそのシグナルを送る。 -.TP -.BR F_OWNER_PGRP -.\"O Send the signal to the process group whose ID -.\"O is specified in -.\"O .IR pid . -.\"O (Note that, unlike with -.\"O .BR F_SETOWN , -.\"O a process group ID is specified as a positive value here.) -ID が -.I pid -で指定された値のプロセスグループにそのシグナルを送る。 -.RB ( F_SETOWN -と異なり、プロセスグループ ID には正の値を指定する点に注意すること。) -.RE -.TP -.BR F_GETSIG " (\fIvoid\fP)" -.\"O Return (as the function result) -.\"O the signal sent when input or output becomes possible. -.\"O A value of zero means -.\"O .B SIGIO -.\"O is sent. -.\"O Any other value (including -.\"O .BR SIGIO ) -.\"O is the -.\"O signal sent instead, and in this case additional info is available to -.\"O the signal handler if installed with -.\"O .BR SA_SIGINFO . -.\"O .I arg -.\"O is ignored. -入力や出力が可能になった場合に送るシグナルを -(関数の結果として) 返す。 -値ゼロは -.B SIGIO -を送ることを意味する。 -.RB ( SIGIO -を含む) 他の値はいずれも、 -.B SIGIO -の代わりに送るシグナル番号を表す。 -後者の場合、シグナルハンドラを -.B SA_SIGINFO -フラグ付きで設定すれば、ハンドラで追加の情報を得ることができる。 -.I arg -は無視される。 -.TP -.BR F_SETSIG " (\fIlong\fP)" -.\"O Set the signal sent when input or output becomes possible -.\"O to the value given in -.\"O .IR arg . -.\"O A value of zero means to send the default -.\"O .B SIGIO -.\"O signal. -.\"O Any other value (including -.\"O .BR SIGIO ) -.\"O is the signal to send instead, and in this case additional info -.\"O is available to the signal handler if installed with -.\"O .BR SA_SIGINFO . -入力や出力が可能になった場合に送るシグナルを -.I arg -に指定された値に設定する。 -値ゼロは -.B SIGIO -を送ることを意味する。 -.RB ( SIGIO -を含む) 他の値はいずれも、 -.B SIGIO -の代わりに送るシグナル番号を表す。 -後者の場合、シグナルハンドラを -.B SA_SIGINFO -フラグ付きで設定すれば、 -ハンドラで追加の情報を得ることができる。 -.\" -.\" The following was true only up until 2.6.11: -.\" -.\"O .\" Additionally, passing a nonzero value to -.\"O .\" .B F_SETSIG -.\"O .\" changes the signal recipient from a whole process to a specific thread -.\"O .\" within a process. -.\"O .\" See the description of -.\"O .\" .B F_SETOWN -.\"O .\" for more details. -.\" また、 -.\" .B F_SETSIG -.\" に 0 以外の値を渡すと、シグナルの受信者をプロセス全体から -.\" プロセス内の特定のスレッドに変更される。詳細は -.\" .B F_SETOWN -.\" の説明を参照のこと。 - -.\"O By using -.\"O .B F_SETSIG -.\"O with a nonzero value, and setting -.\"O .B SA_SIGINFO -.\"O for the -.\"O signal handler (see -.\"O .BR sigaction (2)), -.\"O extra information about I/O events is passed to -.\"O the handler in a -.\"O .I siginfo_t -.\"O structure. -.B F_SETSIG -にゼロ以外の値を設定し、シグナルハンドラに -.B SA_SIGINFO -フラグを設定すると、 -.RB ( sigaction (2) -を参照) I/O イベントに関する追加の情報が -.I siginfo_t -構造体でシグナルハンドラへ渡される。 -.\"O If the -.\"O .I si_code -.\"O field indicates the source is -.\"O .BR SI_SIGIO , -.\"O the -.\"O .I si_fd -.\"O field gives the file descriptor associated with the event. -.\"O Otherwise, -.\"O there is no indication which file descriptors are pending, and you -.\"O should use the usual mechanisms -.\"O .RB ( select (2), -.\"O .BR poll (2), -.\"O .BR read (2) -.\"O with -.\"O .B O_NONBLOCK -.\"O set etc.) to determine which file descriptors are available for I/O. -.I si_code -フィールドが示すシグナルの原因が -.B SI_SIGIO -である場合、 -.I si_fd -フィールドにはイベントに対応するファイルディスクリプタが入っている。 -それ以外の場合は、どのファイルディスクリプタが利用可能かを示す情報は -ないので、どのファイルディスクリプタで I/O が可能かを判断するためには -通常の機構 -.RB ( select (2), -.BR poll (2), -.B O_NONBLOCK -を設定した -.BR read (2) -など) を使用しなければならない。 - -.\"O By selecting a real time signal (value >= -.\"O .BR SIGRTMIN ), -.\"O multiple I/O events may be queued using the same signal numbers. -.\"O (Queuing is dependent on available memory). -.\"O Extra information is available -.\"O if -.\"O .B SA_SIGINFO -.\"O is set for the signal handler, as above. -リアルタイムシグナル (値が -.B SIGRTMIN -以上) を選択している場合は、 -同じシグナル番号を持つ複数の I/O イベントがキューに入ることがある -(キューに入れるかどうかは利用可能なメモリに依存している)。 -上記と同様、 -.B SA_SIGINFO -が設定されている場合、シグナルハンドラのための追加の情報が得られる。 - -.\"O Note that Linux imposes a limit on the -.\"O number of real-time signals that may be queued to a -.\"O process (see -.\"O .BR getrlimit (2) -.\"O and -.\"O .BR signal (7)) -.\"O and if this limit is reached, then the kernel reverts to -.\"O delivering -.\"O .BR SIGIO , -.\"O and this signal is delivered to the entire -.\"O process rather than to a specific thread. -.\" See fs/fcntl.c::send_sigio_to_task() (2.4/2.6) sources -- MTK, Apr 05 -以下の点に注意すること。 -Linux では一つのプロセスに対してキューに入れられるリアルタイム -シグナルの数に上限が設けられており -.RB ( getrlimit (2) -と -.BR signal (7) -を参照)、この上限に達するとカーネルは -.B SIGIO -シグナルを配送する。この -.B SIGIO -シグナルは、指定されたスレッドではなくプロセス全体に送られる。 -.PP -.\"O Using these mechanisms, a program can implement fully asynchronous I/O -.\"O without using -.\"O .BR select (2) -.\"O or -.\"O .BR poll (2) -.\"O most of the time. -これらの機構を使用することで、ほとんどの場合で -.BR select (2) -や -.BR poll (2) -を使用せずに完全な非同期 I/O を実装することができる。 -.PP -.\"O The use of -.\"O .BR O_ASYNC , -.\"O .BR F_GETOWN , -.\"O .B F_SETOWN -.\"O is specific to BSD and Linux. -.BR O_ASYNC , -.BR F_GETOWN , -.B F_SETOWN -の使用は BSD と Linux に特有である。 -.\"O .BR F_GETOWN_EX , -.\"O .BR F_SETOWN_EX , -.\"O .BR F_GETSIG , -.\"O and -.\"O .B F_SETSIG -.\"O are Linux-specific. -.\"O POSIX has asynchronous I/O and the -.\"O .I aio_sigevent -.\"O structure to achieve similar things; these are also available -.\"O in Linux as part of the GNU C Library (Glibc). -.BR F_GETOWN_EX , -.BR F_SETOWN_EX , -.BR F_GETSIG , -.B F_SETSIG -は Linux 固有である。POSIX には、同様のことを行うために、非同期 I/O と -.I aio_sigevent -構造体がある。Linux では、GNU C ライブラリ (Glibc) の一部として -これらも利用可能である。 -.\"O .SS Leases -.SS "リース (leases)" -.\"O .B F_SETLEASE -.\"O and -.\"O .B F_GETLEASE -.\"O (Linux 2.4 onwards) are used (respectively) to establish a new lease, -.\"O and retrieve the current lease, on the open file description -.\"O referred to by the file descriptor -.\"O .IR fd . -(Linix 2.4 以降で利用可能) -.B F_SETLEASE -は、 -.I fd -が参照するオープンファイル記述に対して新しいリースを設定するのに使用される。 -.B F_GETLEASE -は、 -.I fd -が参照するオープンファイル記述に対して設定されている -現在のリースを取得するのに使用される。 -.\"O A file lease provides a mechanism whereby the process holding -.\"O the lease (the "lease holder") is notified (via delivery of a signal) -.\"O when a process (the "lease breaker") tries to -.\"O .BR open (2) -.\"O or -.\"O .BR truncate (2) -.\"O the file referred to by that file descriptor. -ファイルのリースにより、 -あるプロセス ("lease breaker") がそのファイルディスクリプタが参照 -しているファイルに対して -.BR open (2) -や -.BR truncate (2) -を行おうとした際に、リースを保持しているプロセス ("lease holder") へ -(シグナルの配送による) 通知が行われるという機構が提供される。 -.TP -.BR F_SETLEASE " (\fIlong\fP)" -.\"O Set or remove a file lease according to which of the following -.\"O values is specified in the integer -.\"O .IR arg : -.I arg -の内容に基いてファイルのリースの設定、削除を行う。整数 -.I arg -には以下の値が指定できる: - -.RS -.TP -.B F_RDLCK -.\"O Take out a read lease. -.\"O This will cause the calling process to be notified when -.\"O the file is opened for writing or is truncated. -.\"O .\" The following became true in kernel 2.6.10: -.\"O .\" See the man-pages-2.09 Changelog for further info. -.\"O A read lease can only be placed on a file descriptor that -.\"O is opened read-only. -読み出しリースを取得する。これにより、 -そのファイルが書き込み用にオープンされたり、ファイルが切り詰められた場合に、 -呼び出し元のプロセスに通知が行われるようになる。 -.\" 以下の内容はカーネル 2.6.10 で実装された。 -.\" より詳しい情報は man-pages-2.09 の Changelog を参照。 -読み出しリースを設定できるのは、読み出し専用でオープンされている -ファイルディスクリプタに対してのみである。 -.TP -.B F_WRLCK -.\"O Take out a write lease. -.\"O This will cause the caller to be notified when -.\"O the file is opened for reading or writing or is truncated. -.\"O A write lease may be placed on a file only if there are no -.\"O other open file descriptors for the file. -書き込みリースを取得する。これにより、 -(読み出し用か書き込み用にかかわらず) そのファイルがオープンされたり、 -ファイルが切り詰められた場合に、呼び出し元のプロセスに通知が行われるようになる。 -書き込みリースは、そのファイルに対するオープンされたファイルディスクリプタが -他にない場合にのみ設定できる。 -.TP -.B F_UNLCK -.\"O Remove our lease from the file. -そのファイルからリースを削除する。 -.RE -.P -.\"O Leases are associated with an open file description (see -.\"O .BR open (2)). -.\"O This means that duplicate file descriptors (created by, for example, -.\"O .BR fork (2) -.\"O or -.\"O .BR dup (2)) -.\"O refer to the same lease, and this lease may be modified -.\"O or released using any of these descriptors. -.\"O Furthermore, the lease is released by either an explicit -.\"O .B F_UNLCK -.\"O operation on any of these duplicate descriptors, or when all -.\"O such descriptors have been closed. -リースはオープンファイル記述に対して関連付けられる -.RB ( open (2) -参照)。 -つまり、 -.RB ( fork (2) -や -.BR dup (2) -などにより作成された) ファイルディスクリプタの複製は同じリースを参照し、 -複製も含めたどのファイルディスクリプタを使ってもこのリースを変更したり -解放したりできる。 -また、これらのファイルディスクリプタのいずれかに対して -.B F_UNLCK -操作が明示的に実行された場合や、すべてのファイルディスクリプタが -閉じられた場合にも、リースは解放される。 -.P -.\"O Leases may only be taken out on regular files. -.\"O An unprivileged process may only take out a lease on a file whose -.\"O UID (owner) matches the file system UID of the process. -.\"O A process with the -.\"O .B CAP_LEASE -.\"O capability may take out leases on arbitrary files. -リースの取得は通常のファイル (regular file) に対してのみ可能である。 -非特権プロセスがリースを取得できるのは、UID (所有者) がプロセスの -ファイルシステム UID と一致するファイルに対してだけである。 -.B CAP_LEASE -ケーパビリティを持つプロセスは任意のファイルに対してリースを取得できる。 -.TP -.BR F_GETLEASE " (\fIvoid\fP)" -.\"O Indicates what type of lease is associated with the file descriptor -.\"O .I fd -.\"O by returning either -.\"O .BR F_RDLCK ", " F_WRLCK ", or " F_UNLCK , -.\"O indicating, respectively, a read lease , a write lease, or no lease. -.\"O .I arg -.\"O is ignored. -ファイルディスクリプタ -.I fd -に対して設定されているリースの種別を取得する。 -.BR F_RDLCK ", " F_WRLCK ", " F_UNLCK -のいずれかが返される。 -.BR F_RDLCK ", " F_WRLCK -はそれぞれ、読み出しリース、書き込みリースが設定されていることを示し、 -.B F_UNLCK -はリースが何も設定されていないことを示す。 -.I arg -は無視される。 -.PP -.\"O When a process (the "lease breaker") performs an -.\"O .BR open (2) -.\"O or -.\"O .BR truncate (2) -.\"O that conflicts with a lease established via -.\"O .BR F_SETLEASE , -.\"O the system call is blocked by the kernel and -.\"O the kernel notifies the lease holder by sending it a signal -.\"O .RB ( SIGIO -.\"O by default). -あるプロセス ("lease folder") が -.B F_SETLEASE -で設定されたリースと矛盾するような -.BR open (2) -や -.BR truncate (2) -を実行した場合、 -そのシステムコールはカーネルによって停止され、 -カーネルは lease holder にシグナル (デフォルトでは -.BR SIGIO ) -を送って通知を行う。 -.\"O The lease holder should respond to receipt of this signal by doing -.\"O whatever cleanup is required in preparation for the file to be -.\"O accessed by another process (e.g., flushing cached buffers) and -.\"O then either remove or downgrade its lease. -lease holder はこのシグナルを受信したときにはきちんと対応すべきである。 -具体的には、別のプロセスがそのファイルにアクセスするための準備として -必要な後片付け (例えば、キャッシュされたバッファのフラッシュ) を -すべて行ってから、そのファイルのリースの削除または格下げを行う。 -.\"O A lease is removed by performing an -.\"O .B F_SETLEASE -.\"O command specifying -.\"O .I arg -.\"O as -.\"O .BR F_UNLCK . -リースを削除をするには、 -.I arg -に -.B F_UNLCK -を指定して -.B F_SETLEASE -を実行する。 -.\"O If the lease holder currently holds a write lease on the file, -.\"O and the lease breaker is opening the file for reading, -.\"O then it is sufficient for the lease holder to downgrade -.\"O the lease to a read lease. -.\"O This is done by performing an -.\"O .B F_SETLEASE -.\"O command specifying -.\"O .I arg -.\"O as -.\"O .BR F_RDLCK . -lease holder がファイルに書き込みリースを保持していて、 -lease breaker が読み出し用にそのファイルをオープンしている場合、 -lease holder が保持しているリースを読み出しリースに格下げすれば -十分である。これをするには、 -.I arg -に -.B F_RDLCK -を指定して -.B F_SETLEASE -を実行する。 - -.\"O If the lease holder fails to downgrade or remove the lease within -.\"O the number of seconds specified in -.\"O .I /proc/sys/fs/lease-break-time -.\"O then the kernel forcibly removes or downgrades the lease holder's lease. -lease holder が -.I /proc/sys/fs/lease-break-time -で指定された秒数以内にリースの格下げか削除を行えなかった場合、 -カーネルは強制的にその lease holder のリースを削除もしくは格下げを行う。 - -.\"O Once the lease has been voluntarily or forcibly removed or downgraded, -.\"O and assuming the lease breaker has not unblocked its system call, -.\"O the kernel permits the lease breaker's system call to proceed. -一度リースの削除か格下げが自発的もしくは強制的に行われると、 -lease breaker がまだシステムコールを再開していない場合には、 -カーネルが lease breaker のシステムコールの続行を許可する。 - -.\"O If the lease breaker's blocked -.\"O .BR open (2) -.\"O or -.\"O .BR truncate (2) -.\"O is interrupted by a signal handler, -.\"O then the system call fails with the error -.\"O .BR EINTR , -.\"O but the other steps still occur as described above. -lease breaker が実行した -.BR open (2) -や -.BR truncate (2) -が停止中にシグナルハンドラにより中断された場合、 -そのシステムコールは -.B EINTR -エラーで失敗するが、上で述べた他の処理は -そのまま行われる。 -.\"O If the lease breaker is killed by a signal while blocked in -.\"O .BR open (2) -.\"O or -.\"O .BR truncate (2), -.\"O then the other steps still occur as described above. -.BR open (2) -や -.BR truncate (2) -が停止中に lease breaker がシグナルにより kill された場合、 -上で述べた他の処理はそのまま行われる。 -.\"O If the lease breaker specifies the -.\"O .B O_NONBLOCK -.\"O flag when calling -.\"O .BR open (2), -.\"O then the call immediately fails with the error -.\"O .BR EWOULDBLOCK , -.\"O but the other steps still occur as described above. -lease breaker が -.BR open (2) -を呼ぶ際に -.B O_NONBLOCK -フラグを指定した場合、そのシステムコールは -.B EWOULDBLOCK -エラーで直ちに失敗するが、上で述べた他の処理はそのまま行われる。 - -.\"O The default signal used to notify the lease holder is -.\"O .BR SIGIO , -.\"O but this can be changed using the -.\"O .B F_SETSIG -.\"O command to -.\"O .BR fcntl (). -.\"O If a -.\"O .B F_SETSIG -.\"O command is performed (even one specifying -.\"O .BR SIGIO ), -.\"O and the signal -.\"O handler is established using -.\"O .BR SA_SIGINFO , -.\"O then the handler will receive a -.\"O .I siginfo_t -.\"O structure as its second argument, and the -.\"O .I si_fd -.\"O field of this argument will hold the descriptor of the leased file -.\"O that has been accessed by another process. -.\"O (This is useful if the caller holds leases against multiple files). -lease holder への通知に使われるデフォルトのシグナルは -.B SIGIO -だが、 -.BR fcntl () -の -.B F_SETSIG -コマンドで変更することができる。 -.B F_SETSIG -コマンドが実行され -.RB ( SIGIO -を指定された場合も含む)、 -.B SA_SIGINFO -フラグ付きでシグナルハンドラが設定されている場合には、 -ハンドラの第二引き数として -.I siginfo_t -構造体が渡され、この引き数の -.I si_fd -フィールドには別のプロセスがアクセスしたリース設定済みファイルの -ディスクリプタが入っている -(この機能は複数のファイルに対してリースを設定する場合に有用である)。 -.\"O .SS "File and directory change notification (dnotify)" -.SS "ファイルやディレクトリの変更の通知 (dnotify)" -.TP -.BR F_NOTIFY " (\fIlong\fP)" -.\"O (Linux 2.4 onwards) -(Linux 2.4 以降) -.\"O Provide notification when the directory referred to by -.\"O .I fd -.\"O or any of the files that it contains is changed. -.\"O The events to be notified are specified in -.\"O .IR arg , -.\"O which is a bit mask specified by ORing together zero or more of -.\"O the following bits: -.I fd -で参照されるディレクトリか、その中にあるファイルに変更があった場合に -通知を行う。どのイベントを通知するかは -.I arg -で指定する。 -.I arg -はビットマスクで、以下のビットの 0個以上の論理和をとったものを指定する。 -.RS -.sp -.PD 0 -.TP 12 -.B DN_ACCESS -.\"O A file was accessed (read, pread, readv) -ファイルへのアクセスがあった (read, pread, readv) -.TP -.B DN_MODIFY -.\"O A file was modified (write, pwrite, writev, truncate, ftruncate). -ファイルの内容が変更された (write, pwrite, writev, truncate, ftruncate). -.TP -.B DN_CREATE -.\"O A file was created (open, creat, mknod, mkdir, link, symlink, rename). -ファイルが作成された (open, creat, mknod, mkdir, link, symlink, rename). -.TP -.B DN_DELETE -.\"O A file was unlinked (unlink, rename to another directory, rmdir). -ファイルが削除 (unlink) された (unlink, 別のディレクトリへの rename, rmdir) -.TP -.B DN_RENAME -.\"O A file was renamed within this directory (rename). -ディレクトリ内でのファイル名の変更があった (rename) -.TP -.B DN_ATTRIB -.\"O The attributes of a file were changed (chown, chmod, utime[s]). -ファイル属性が変更された (chown, chmod, utime[s]) -.PD -.RE -.IP -.\"O (In order to obtain these definitions, the -.\"O .B _GNU_SOURCE -.\"O feature test macro must be defined.) -(上記の定義を利用するには -.B _GNU_SOURCE -機能検査マクロを定義しなければならない。) - -.\"O Directory notifications are normally "one-shot", and the application -.\"O must reregister to receive further notifications. -ディレクトリの変更通知は通常「一回限り (one-shot)」であり、 -アプリケーション側でその後さらに通知を受信したい場合は -再登録しなければならない。 -.\"O Alternatively, if -.\"O .B DN_MULTISHOT -.\"O is included in -.\"O .IR arg , -.\"O then notification will remain in effect until explicitly removed. -.I arg -に -.B DN_MULTISHOT -が含まれていた場合には、 -変更通知は明示的に解除されるまで有効状態が継続する。 - -.\"O .\" The following does seem a poor API-design choice... -.\" 以下は API の設計がまずいと思うのだが... -.\"O A series of -.\"O .B F_NOTIFY -.\"O requests is cumulative, with the events in -.\"O .I arg -.\"O being added to the set already monitored. -.B F_NOTIFY -要求は積算されていく。つまり、 -.I arg -で指定されたイベントがすでにモニタされている -イベント集合に加算される形になる。 -.\"O To disable notification of all events, make an -.\"O .B F_NOTIFY -.\"O call specifying -.\"O .I arg -.\"O as 0. -すべてのイベントの通知を無効にするには、 -.I arg -に 0 を指定して -.B F_NOTIFY -を呼び出す必要がある。 - -.\"O Notification occurs via delivery of a signal. -通知はシグナルの配送で行われる。 -.\"O The default signal is -.\"O .BR SIGIO , -.\"O but this can be changed using the -.\"O .B F_SETSIG -.\"O command to -.\"O .BR fcntl (). -デフォルトのシグナルは -.B SIGIO -だが、 -.BR fcntl () -の -.B F_SETSIG -コマンドで変更することができる。 -.\"O In the latter case, the signal handler receives a -.\"O .I siginfo_t -.\"O structure as its second argument (if the handler was -.\"O established using -.\"O .BR SA_SIGINFO ) -.\"O and the -.\"O .I si_fd -.\"O field of this structure contains the file descriptor which -.\"O generated the notification (useful when establishing notification -.\"O on multiple directories). -後者の場合には、 -.RB ( SA_SIGINFO -フラグ付きでシグナルハンドラが設定されている場合には) -ハンドラの第二引き数として -.I siginfo_t -構造体が渡され、この構造体の -.I si_fd -フィールドには通知の行われたファイルディスクリプタが入っている -(この機能は複数のディレクトリに対して通知を設定する場合に有用である)。 - -.\"O Especially when using -.\"O .BR DN_MULTISHOT , -.\"O a real time signal should be used for notification, -.\"O so that multiple notifications can be queued. -特に -.B DN_MULTISHOT -を使う場合は、通知にはリアルタイムシグナルを使うべきである。 -それは、リアルタイムシグナルを使うことで、複数の通知をキューに入れる -ことができるからである。 - -.\"O .B NOTE: -.\"O New applications should use the -.\"O .I inotify -.\"O interface (available since kernel 2.6.13), -.\"O which provides a much superior interface for obtaining notifications of -.\"O file system events. -.\"O See -.\"O .BR inotify (7). -.B 注意: -新しくアプリケーションを書く際には、(カーネル 2.6.13 以降で利用可能となった) -.I inotify -インタフェースを使用すべきである。 -.I inotify -はファイルシステムイベントの通知を取得するための -ずっと優れたインタフェースである。 -.BR inotify (7) -を参照。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O For a successful call, the return value depends on the operation: -成功した場合の返り値は操作の種類により違う: -.TP 0.9i -.B F_DUPFD -.\"O The new descriptor. -新しいディスクリプタを返す。 -.TP -.B F_GETFD -.\"O Value of file descriptor flags. -ファイルディスクリプタ・フラグの値を返す。 -.TP -.B F_GETFL -.\"O Value of file status flags. -ファイル状態フラグの値を返す。 -.TP -.B F_GETLEASE -.\"O Type of lease held on file descriptor. -ファイルディスクリプタに対して保持されているリースの種別を返す。 -.TP -.B F_GETOWN -.\"O Value of descriptor owner. -ディスクリプタの所有者を返す。 -.TP -.B F_GETSIG -.\"O Value of signal sent when read or write becomes possible, or zero -.\"O for traditional -.\"O .B SIGIO -.\"O behavior. -読み込みや書き出しが可能になった時に送られるシグナルの値、もしくは -伝統的な -.B SIGIO -動作の場合にはゼロを返す。 -.TP -.\"O All other commands -.\"O Zero. -他の全てのコマンドは 0 を返す。 -.PP -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -エラーの時は \-1 が返され、 -.I errno -に適切な値が設定される。 -.\"O .SH ERRORS -.SH エラー -.TP -.\"O .BR EACCES " or " EAGAIN -.BR EACCES " か " EAGAIN -.\"O Operation is prohibited by locks held by other processes. -他のプロセスが保持しているロックによって操作が禁止されている。 -.TP -.B EAGAIN -.\"O The operation is prohibited because the file has been memory-mapped by -.\"O another process. -そのファイルは他のプロセスによってメモリ・マップされているため、 -操作が禁止されている。 -.TP -.B EBADF -.\"O .I fd -.\"O is not an open file descriptor, or the command was -.\"O .B F_SETLK -.\"O or -.\"O .B F_SETLKW -.\"O and the file descriptor open mode doesn't match with the -.\"O type of lock requested. -.I fd -がオープンされたファイルディスクリプタでない。 -あるいはコマンドが -.B F_SETLK -または -.B F_SETLKW -だったが、対象のファイルディスクリプタのオープンモードが -必要となるロックの型にマッチしていない。 -.TP -.\"O .B EDEADLK -.\"O It was detected that the specified -.\"O .B F_SETLKW -.\"O command would cause a deadlock. -.B EDEADLK -指定された -.B F_SETLKW -コマンドを実行した場合にはデッドロックになることが検出された。 -.TP -.B EFAULT -.\"O .I lock -.\"O is outside your accessible address space. -.I lock -が利用可能なアドレス空間の外部にある。 -.TP -.B EINTR -.\"O For -.\"O .BR F_SETLKW , -.\"O the command was interrupted by a signal; see -.\"O .BR signal (7). -.\"O For -.\"O .BR F_GETLK " and " F_SETLK , -.\"O the command was interrupted by a signal before the lock was checked or -.\"O acquired. -.\"O Most likely when locking a remote file (e.g., locking over -.\"O NFS), but can sometimes happen locally. -.B F_SETLKW -コマンドがシグナルにより割り込まれた -.RB ( signal (7) -参照)。 -.BR F_GETLK " と " F_SETLK -の場合、ロックを確認したり取得したりする前にシグナルによって割り込まれた。 -これはたいていリモートのファイルをロックする場合 -(例えば NFS 上でロックする場合) に起こる。 -しかしローカルでも起こる場合がある。 -.TP -.B EINVAL -.\"O For -.\"O .BR F_DUPFD , -.\"O .I arg -.\"O is negative or is greater than the maximum allowable value. -.\"O For -.\"O .BR F_SETSIG , -.\"O .I arg -.\"O is not an allowable signal number. -.BR F_DUPFD で、 -.I arg -が負か、もしくは許される最大値よりも大きい。 -.B F_SETSIG -の場合、 -.I arg -が利用可能なシグナル番号ではない。 -.TP -.B EMFILE -.\"O For -.\"O .BR F_DUPFD , -.\"O the process already has the maximum number of file descriptors open. -.BR F_DUPFD で、 -プロセスがすでに最大数までファイルディスクリプタをオープンしている。 -.TP -.B ENOLCK -.\"O Too many segment locks open, lock table is full, or a remote locking -.\"O protocol failed (e.g., locking over NFS). -オープンされているロックの数が多過ぎて、ロック・テーブルがいっぱいである。 -または remote locking protocol (例えば NFS 上のロック) が失敗した。 -.TP -.B EPERM -.\"O Attempted to clear the -.\"O .B O_APPEND -.\"O flag on a file that has the append-only attribute set. -追加専用属性が設定されたファイルの -.B O_APPEND -フラグをクリアしようと試みた。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -.\"O SVr4, 4.3BSD, POSIX.1-2001. -SVr4, 4.3BSD, POSIX.1-2001. -.\"O Only the operations -.\"O .BR F_DUPFD , -.\"O .BR F_GETFD , -.\"O .BR F_SETFD , -.\"O .BR F_GETFL , -.\"O .BR F_SETFL , -.\"O .BR F_GETLK , -.\"O .BR F_SETLK , -.\"O .BR F_SETLKW , -.\"O .BR F_GETOWN , -.\"O and -.\"O .B F_SETOWN -.\"O are specified in POSIX.1-2001. -POSIX.1-2001 で規定されている操作は、 -.BR F_DUPFD , -.BR F_GETFD , -.BR F_SETFD , -.BR F_GETFL , -.BR F_SETFL , -.BR F_GETLK , -.BR F_SETLK , -.BR F_SETLKW , -.BR F_GETOWN , -.B F_SETOWN -だけである。 - -.\"O .B F_DUPFD_CLOEXEC -.\"O is specified in POSIX.1-2008. -.B F_DUPFD_CLOEXEC -は POSIX.1-2008 で規定されている。 - -.\"O .BR F_GETOWN_EX , -.\"O .BR F_SETOWN_EX , -.\"O .BR F_GETSIG , -.\"O .BR F_SETSIG , -.\"O .BR F_NOTIFY , -.\"O .BR F_GETLEASE , -.\"O and -.\"O .B F_SETLEASE -.\"O are Linux-specific. -.\"O (Define the -.\"O .B _GNU_SOURCE -.\"O macro to obtain these definitions.) -.BR F_GETOWN_EX , -.BR F_SETOWN_EX , -.BR F_GETSIG , -.BR F_SETSIG , -.BR F_NOTIFY , -.BR F_GETLEASE , -.B F_SETLEASE -は Linux 固有である (これらの定義を有効にするには -.B _GNU_SOURCE -マクロを定義すること)。 -.\" .PP -.\"O .\" SVr4 documents additional EIO, ENOLINK and EOVERFLOW error conditions. -.\" SVr4 には他に EFAULT, EINTR, EIO, ENOLINK, EOVERFLOW エラー状態についての -.\" 記述がある。 -.\"O .SH NOTES -.SH 注意 -.\"O The errors returned by -.\"O .BR dup2 (2) -.\"O are different from those returned by -.\"O .BR F_DUPFD . -エラーの際の返り値が -.BR dup2 (2) -と -.B F_DUPFD -では異なっている。 - -.\"O Since kernel 2.0, there is no interaction between the types of lock -.\"O placed by -.\"O .BR flock (2) -.\"O and -.\"O .BR fcntl (). -カーネル 2.0 以降では、 -.BR flock (2) -と -.BR fcntl () -が設定するロック種別の間に相互作用はない。 - -.\"O Several systems have more fields in -.\"O .I "struct flock" -.\"O such as, for example, -.\"O .IR l_sysid . -.\"O .\" e.g., Solaris 8 documents this field in fcntl(2), and Irix 6.5 -.\"O .\" documents it in fcntl(5). mtk, May 2007 -.\"O Clearly, -.\"O .I l_pid -.\"O alone is not going to be very useful if the process holding the lock -.\"O may live on a different machine. -システムによっては、 -.I "struct flock" -に上記以外のフィールドがあるものもある (例えば -.IR l_sysid )。 -.\" e.g., Solaris 8 documents this field in fcntl(2), and Irix 6.5 -.\" documents it in fcntl(5). mtk, May 2007 -はっきりと言えることは、ロックを保持しているプロセスが別のマシンに存在 -する場合には、 -.I l_pid -だけはあまり役にたたないだろうということである。 -.\"O .SH BUGS -.SH バグ -.\"O A limitation of the Linux system call conventions on some -.\"O architectures (notably i386) means that if a (negative) -.\"O process group ID to be returned by -.\"O .B F_GETOWN -.\"O falls in the range \-1 to \-4095, then the return value is wrongly -.\"O interpreted by glibc as an error in the system call; -.\"O .\" glibc source: sysdeps/unix/sysv/linux/i386/sysdep.h -.\"O that is, the return value of -.\"O .BR fcntl () -.\"O will be \-1, and -.\"O .I errno -.\"O will contain the (positive) process group ID. -いくつかのアーキテクチャ (特に i386) における Linux システムコールの慣習 -のため以下の制限が存在する。 -.B F_GETOWN -が返す (負の) プロセスグループID が \-1 から \-4095 の範囲に入った場合、 -glibc はこの返り値をシステムコールでエラーが起こったと -間違って解釈してしまう。つまり、 -.BR fcntl () -の返り値は \-1 となり、 -.I errno -には (正の) プロセスグループID が設定されることになる。 -.\"O The Linux-specific -.\"O .BR F_SETOWN_EX -.\"O and -.\"O .BR F_GETOWN_EX -.\"O operations avoid this problem. -Linux 固有の -.B F_SETOWN_EX -と -.B F_GETOWN_EX -ではこの問題を回避できる。 -.\"O .\" mtk, Dec 04: some limited testing on alpha and ia64 seems to -.\"O .\" indicate that ANY negative PGID value will cause F_GETOWN -.\"O .\" to misinterpret the return as an error. Some other architectures -.\"O .\" seem to have the same range check as i386. -.\" mtk, Dec 04: alpha と ia64 では、少しテストしてみた限り、 -.\" 「どんな」負の PGID でも F_GETOWN でエラーが起こったと間違って -.\" 解釈されてしまうようだ。他のいくつかのアーキテクチャでは、 -.\" i386 と同様の範囲のチェックが行われているようだ。 - -.\"O In Linux 2.4 and earlier, there is bug that can occur -.\"O when an unprivileged process uses -.\"O .B F_SETOWN -.\"O to specify the owner -.\"O of a socket file descriptor -.\"O as a process (group) other than the caller. -.\"O In this case, -.\"O .BR fcntl () -.\"O can return \-1 with -.\"O .I errno -.\"O set to -.\"O .BR EPERM , -.\"O even when the owner process (group) is one that the caller -.\"O has permission to send signals to. -.\"O Despite this error return, the file descriptor owner is set, -.\"O and signals will be sent to the owner. -Linux 2.4 以前では、非特権プロセスが -.B F_SETOWN -を使って、ソケットのファイルディスクリプタの所有者に -呼び出し元以外のプロセス (やプロセスグループ) を指定すると -発生するバグがある。この場合、 -呼び出し元が所有者として指定したプロセス (やプロセスグループ) に -シグナルを送る許可を持っていたとしても、 -.BR fcntl () -が \-1 を返し -.I errno -に -.B EPERM -を設定することがある。 -このエラーが返ったにもかかわらず、ファイルディスクリプタの所有者 -は設定され、シグナルはその所有者に送られる。 - -.\"O The implementation of mandatory locking in all known versions of Linux -.\"O is subject to race conditions which render it unreliable: -.\"O .\" http://marc.info/?l=linux-kernel&m=119013491707153&w=2 -.\"O a -.\"O .BR write (2) -.\"O call that overlaps with a lock may modify data after the mandatory lock is -.\"O acquired; -.\"O a -.\"O .BR read (2) -.\"O call that overlaps with a lock may detect changes to data that were made -.\"O only after a write lock was acquired. -.\"O Similar races exist between mandatory locks and -.\"O .BR mmap (2). -.\"O It is therefore inadvisable to rely on mandatory locking. -これまでの Linux の全てのバージョンにおける強制ロックの実装は、 -競合条件下で強制ロックが不完全になるような場合がある。 -.\" http://marc.info/?l=linux-kernel&m=119013491707153&w=2 -ロックと重なって実行された -.BR write (2) -の呼び出しは強制ロックが獲得された後にもデータを変更することができる。 -ロックと重なって実行された -.BR read (2) -の呼び出しは強制ロックが獲得された後になって行われたデータの変更を -検出することができる。 -同様の競合条件が強制ロックと -.BR mmap (2) -の間にも存在する。それゆえ、強制ロックに頼るのはお薦めできない。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR dup2 (2), -.BR flock (2), -.BR open (2), -.BR socket (2), -.BR lockf (3), -.BR capabilities (7), -.BR feature_test_macros (7) -.P -.\"O See also -.\"O .IR locks.txt , -.\"O .IR mandatory-locking.txt , -.\"O and -.\"O .I dnotify.txt -.\"O in the kernel source directory -.\"O .IR Documentation/filesystems/ . -.\"O (On older kernels, these files are directly under the -.\"O .I Documentation/ -.\"O directory, and -.\"O .I mandatory-locking.txt -.\"O is called -.\"O .IR mandatory.txt .) -カーネルソースの -.IR Documentation/filesystems/ -ディレクトリ内の -.IR locks.txt , -.IR mandatory-locking.txt , -.I dnotify.txt -も参照のこと。 -(以前のカーネルでは、これらのファイルは -.I Documentation/ -ディレクトリ直下にあり、 -.I mandatory-locking.txt -は -.I mandatory.txt -という名前であった。) diff --git a/draft/man2/flock.2 b/draft/man2/flock.2 index bcbcefa3..0e2ec102 100644 --- a/draft/man2/flock.2 +++ b/draft/man2/flock.2 @@ -1,3 +1,4 @@ + .\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) and @@ -30,333 +31,102 @@ .\" .\" FIXME: Maybe document LOCK_MAND, LOCK_RW, LOCK_READ, LOCK_WRITE .\" which only have effect for SAMBA. +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1996 Takeshi Ueno -.\" all rights reserved. -.\" Translated 1996-07-03, Takeshi Ueno -.\" Modified 1997-12-14, HANATAKA Shinya -.\" Modified 1999-08-14, HANATAKA Shinya -.\" Modified 2002-09-24, Akihiro MOTOKI -.\" Modified 2005-02-26, Akihiro MOTOKI -.\" Updated 2005-09-06, Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.TH FLOCK 2 2009-07-25 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O flock \- apply or remove an advisory lock on an open file +.\"******************************************************************* +.TH FLOCK 2 2009\-07\-25 Linux "Linux Programmer's Manual" .SH 名前 flock \- オープンされたファイルに対するアドバイザリ・ロックの適用、解除を行う -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int flock(int " fd ", int " operation ); -.\"O .SH DESCRIPTION +\fBint flock(int \fP\fIfd\fP\fB, int \fP\fIoperation\fP\fB);\fP .SH 説明 -.\"O Apply or remove an advisory lock on the open file specified by -.\"O .IR fd . -.\"O The argument -.\"O .I operation -.\"O is one of the following: -オープンされたファイルにアドバイザリ・ロック (advisory lock) の適用 -や解除を行う。 -ファイルは -.I fd -で指定する。引き数 -.I operation -には以下のいずれか一つを指定する: +オープンされたファイルにアドバイザリ・ロック (advisory lock) の適用 や解除を行う。 ファイルは \fIfd\fP で指定する。引き数 +\fIoperation\fP には以下のいずれか一つを指定する: .RS 4 -.TP 9 -.B LOCK_SH -.\"O Place a shared lock. -.\"O More than one process may hold a shared lock for a given file -.\"O at a given time. -共有ロックを適用する。 指定したファイルに対して、 -一つ以上のプロセスが同時に共有ロックを保持することができる。 -.TP -.B LOCK_EX -.\"O Place an exclusive lock. -.\"O Only one process may hold an exclusive lock for a given -.\"O file at a given time. -排他ロックを適用する。 指定したファイルに対して、 -ただ一つのプロセスだけが同時に排他ロックを保持することができる。 -.TP -.B LOCK_UN -.\"O Remove an existing lock held by this process. +.TP 9 +\fBLOCK_SH\fP +共有ロックを適用する。 指定したファイルに対して、 一つ以上のプロセスが同時に共有ロックを保持することができる。 +.TP +\fBLOCK_EX\fP +排他ロックを適用する。 指定したファイルに対して、 ただ一つのプロセスだけが同時に排他ロックを保持することができる。 +.TP +\fBLOCK_UN\fP このプロセスが保持している既存のロックを解除する。 .RE .PP -.\"O A call to -.\"O .BR flock () -.\"O may block if an incompatible lock is held by another process. -.\"O To make a nonblocking request, include -.\"O .B LOCK_NB -.\"O (by ORing) -.\"O with any of the above operations. -.BR flock () -を呼び出したときに、指定したロック種別と異なるロックが別プロセスによって -保持されていると、 -.BR flock () -は停止 (block) されることがある。 -非停止 (nonblocking) タイプの要求を行うためには、 -上記の操作 (operation) に -.B LOCK_NB -を論理和の形で指定する。 +\fBflock\fP() を呼び出したときに、指定したロック種別と異なるロックが別プロセスによって 保持されていると、 \fBflock\fP() は停止 +(block) されることがある。 非停止 (nonblocking) タイプの要求を行うためには、 上記の操作 (operation) に +\fBLOCK_NB\fP を論理和の形で指定する。 -.\"O A single file may not simultaneously have both shared and exclusive locks. 一つのファイルに共有ロックと排他ロックを同時に設定することはできない。 -.\"O Locks created by -.\"O .BR flock () -.\"O are associated with an open file table entry. -.\"O This means that duplicate file descriptors (created by, for example, -.\"O .BR fork (2) -.\"O or -.\"O .BR dup (2)) -.\"O refer to the same lock, and this lock may be modified -.\"O or released using any of these descriptors. -.BR flock () -によって作られるロックは、 -オープンされたファイルのテーブル・エントリと関連付けられる。 -したがって、ファイル・ディスクリプタの複製 -.RB ( fork (2) -や -.BR dup (2) -などにより作成される) は同じロックを参照し、 -これらのファイル・ディスクリプタのどれを使っても -このロックを変更したり解放したりできる。 -.\"O Furthermore, the lock is released either by an explicit -.\"O .B LOCK_UN -.\"O operation on any of these duplicate descriptors, or when all -.\"O such descriptors have been closed. -また、ロックの解放は、 -上記の複数のファイル・ディスクリプタのいずれかに対して -明示的に -.B LOCK_UN -操作を指示した場合か、これらのファイル・ディスクリプタがすべて +\fBflock\fP() によって作られるロックは、 オープンされたファイルのテーブル・エントリと関連付けられる。 +したがって、ファイル・ディスクリプタの複製 (\fBfork\fP(2) や \fBdup\fP(2) などにより作成される) は同じロックを参照し、 +これらのファイル・ディスクリプタのどれを使っても このロックを変更したり解放したりできる。 また、ロックの解放は、 +上記の複数のファイル・ディスクリプタのいずれかに対して 明示的に \fBLOCK_UN\fP 操作を指示した場合か、これらのファイル・ディスクリプタがすべて 閉じられた場合に行われる。 -.\"O If a process uses -.\"O .BR open (2) -.\"O (or similar) to obtain more than one descriptor for the same file, -.\"O these descriptors are treated independently by -.\"O .BR flock (). -.\"O An attempt to lock the file using one of these file descriptors -.\"O may be denied by a lock that the calling process has -.\"O already placed via another descriptor. -あるプロセスが -.BR open (2) -(もしくは同様の方法) を使って同じファイルに対して -複数のディスクリプタを取得した場合、 -.BR flock () -はこれら複数のディスクリプタを各々独立のものとして扱う。 -これらのファイル・ディスクリプタの一つを使ってファイルをロックしようと -した際、そのロック要求は、呼び出し元のプロセスがそのファイルの別の -ディスクリプタ経由ですでに設定しているロックによって拒否される場合がある。 +あるプロセスが \fBopen\fP(2) (もしくは同様の方法) を使って同じファイルに対して 複数のディスクリプタを取得した場合、 \fBflock\fP() +はこれら複数のディスクリプタを各々独立のものとして扱う。 これらのファイル・ディスクリプタの一つを使ってファイルをロックしようと +した際、そのロック要求は、呼び出し元のプロセスがそのファイルの別の ディスクリプタ経由ですでに設定しているロックによって拒否される場合がある。 -.\"O A process may only hold one type of lock (shared or exclusive) -.\"O on a file. -.\"O Subsequent -.\"O .BR flock () -.\"O calls on an already locked file will convert an existing lock to the new -.\"O lock mode. -一つのプロセスは、一つのファイルに対して (共有ロックと排他ロックのうち) -いずれか一種類のロックしか設定できない。 -既にロックされたファイルに対して -.BR flock () -を呼び出すと、既存のロックを新しいロックモードに変更することになる。 +一つのプロセスは、一つのファイルに対して (共有ロックと排他ロックのうち) いずれか一種類のロックしか設定できない。 既にロックされたファイルに対して +\fBflock\fP() を呼び出すと、既存のロックを新しいロックモードに変更することになる。 -.\"O Locks created by -.\"O .BR flock () -.\"O are preserved across an -.\"O .BR execve (2). -.BR flock () -により作成されたロックは -.BR execve (2) -の前後で保存される。 +\fBflock\fP() により作成されたロックは \fBexecve\fP(2) の前後で保存される。 -.\"O A shared or exclusive lock can be placed on a file regardless of the -.\"O mode in which the file was opened. -共有ロックも排他ロックも、ファイルがどのモードでオープンされたかに -関係なく適用することができる。 -.\"O .SH "RETURN VALUE" +共有ロックも排他ロックも、ファイルがどのモードでオープンされたかに 関係なく適用することができる。 .SH 返り値 -.\"O On success, zero is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功の場合、0 が返される。エラーの場合は、\-1 が返され、 -.I errno -に適切な値が設定される。 -.\"O .SH ERRORS +成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP -.B EBADF -.\"O .I fd -.\"O is not an open file descriptor. -.I fd -がオープンされたファイル・ディスクリプタではない。 -.TP -.B EINTR -.\"O While waiting to acquire a lock, the call was interrupted by -.\"O delivery of a signal caught by a handler; see -.\"O .BR signal (7). -ロックの獲得を待っている間に、ハンドラにより捕捉されたシグナルを -受信し、 -.BR flock () -が中断された。 -.BR signal (7) -参照。 -.TP -.B EINVAL -.\"O .I operation -.\"O is invalid. -.I oepration -が無効である。 -.TP -.B ENOLCK -.\"O The kernel ran out of memory for allocating lock records. +.TP +\fBEBADF\fP +\fIfd\fP がオープンされたファイル・ディスクリプタではない。 +.TP +\fBEINTR\fP +ロックの獲得を待っている間に、ハンドラにより捕捉されたシグナルを 受信し、 \fBflock\fP() が中断された。 \fBsignal\fP(7) 参照。 +.TP +\fBEINVAL\fP +\fIoepration\fP が無効である。 +.TP +\fBENOLCK\fP ロック・レコードを割り当てるためのメモリが不足している。 -.TP -.B EWOULDBLOCK -.\"O The file is locked and the -.\"O .B LOCK_NB -.\"O flag was selected. -指定したファイルがロックされており、 -.B LOCK_NB -フラグが指定されている。 -.\"O .SH "CONFORMING TO" +.TP +\fBEWOULDBLOCK\fP +指定したファイルがロックされており、 \fBLOCK_NB\fP フラグが指定されている。 .SH 準拠 -.\"O 4.4BSD (the -.\"O .BR flock () -.\"O call first appeared in 4.2BSD). -4.4BSD -.RB ( flock () -コールは 4.2BSD で最初に登場した)。 -.\"O A version of -.\"O .BR flock (), -.\"O possibly implemented in terms of -.\"O .BR fcntl (2), -.\"O appears on most UNIX systems. -.BR fcntl (2) -で実装されているものなどを含めると、 -.BR flock () -の機能はほとんどの UNIX システムで実装されている。 -.\"O .SH NOTES +4.4BSD (\fBflock\fP() コールは 4.2BSD で最初に登場した)。 \fBfcntl\fP(2) で実装されているものなどを含めると、 +\fBflock\fP() の機能はほとんどの UNIX システムで実装されている。 .SH 注意 -.\"O .BR flock () -.\"O does not lock files over NFS. -.\"O Use -.\"O .BR fcntl (2) -.\"O instead: that does work over NFS, given a sufficiently recent version of -.\"O Linux and a server which supports locking. -.BR flock () -は NFS 上のファイルのロックをしない。代わりに -.BR fcntl (2) -を使用すること。これにより、十分に新しいバージョンの Linux と、ロック機能を -サポートした NFS サーバを使用することにより、NFS 上でロックができる。 +\fBflock\fP() は NFS 上のファイルのロックをしない。代わりに \fBfcntl\fP(2) +を使用すること。これにより、十分に新しいバージョンの Linux と、ロック機能を サポートした NFS サーバを使用することにより、NFS +上でロックができる。 .PP -.\"O Since kernel 2.0, -.\"O .BR flock () -.\"O is implemented as a system call in its own right rather -.\"O than being emulated in the GNU C library as a call to -.\"O .BR fcntl (2). -kernel 2.0 以降では、 -.BR flock () -は、GNU C ライブラリでの -.BR fcntl (2) -を呼び出してのエミュレーションではなく、 -それ自体がシステムコールとして実装されている。 -.\"O This yields true BSD semantics: -.\"O there is no interaction between the types of lock -.\"O placed by -.\"O .BR flock () -.\"O and -.\"O .BR fcntl (2), -.\"O and -.\"O .BR flock () -.\"O does not detect deadlock. -これにより正真正銘の BSD での動作が達成される: -.BR flock () -と -.BR fcntl (2) -で適用されるロックの種別には相互作用がなくなり、 -.BR flock () +kernel 2.0 以降では、 \fBflock\fP() は、GNU C ライブラリでの \fBfcntl\fP(2) +を呼び出してのエミュレーションではなく、 それ自体がシステムコールとして実装されている。 これにより正真正銘の BSD での動作が達成される: +\fBflock\fP() と \fBfcntl\fP(2) で適用されるロックの種別には相互作用がなくなり、 \fBflock\fP() がデッドロックを検出しなくなる。 .PP -.\"O .BR flock () -.\"O places advisory locks only; given suitable permissions on a file, -.\"O a process is free to ignore the use of -.\"O .BR flock () -.\"O and perform I/O on the file. -.BR flock () -アドバイザリ・ロックだけを適用する。したがって、ファイルに適切なアクセス権を -付与していれば、プロセスは -.BR flock () +\fBflock\fP() アドバイザリ・ロックだけを適用する。したがって、ファイルに適切なアクセス権を 付与していれば、プロセスは \fBflock\fP() の使用に無視して、ファイルへの入出力を行うことができる。 .PP -.\"O .BR flock () -.\"O and -.\"O .BR fcntl (2) -.\"O locks have different semantics with respect to forked processes and -.\"O .BR dup (2). -.BR flock () -と -.BR fcntl (2) -は fork されたプロセスと -.BR dup (2) -で違った動作をする。 -.\"O On systems that implement -.\"O .BR flock () -.\"O using -.\"O .BR fcntl (2), -.\"O the semantics of -.\"O .BR flock () -.\"O will be different from those described in this manual page. -.BR flock () -を -.BR fcntl (2) -を使って実装しているシステムでは、 -.BR flock () +\fBflock\fP() と \fBfcntl\fP(2) は fork されたプロセスと \fBdup\fP(2) で違った動作をする。 \fBflock\fP() +を \fBfcntl\fP(2) を使って実装しているシステムでは、 \fBflock\fP() の動作はこのマニュアル・ページに記載されているものとは違うだろう。 .PP -.\"O Converting a lock -.\"O (shared to exclusive, or vice versa) is not guaranteed to be atomic: -.\"O the existing lock is first removed, and then a new lock is established. -.\"O Between these two steps, -.\"O a pending lock request by another process may be granted, -.\"O with the result that the conversion either blocks, or fails if -.\"O .B LOCK_NB -.\"O was specified. -.\"O (This is the original BSD behavior, -.\"O and occurs on many other implementations.) -.\"O .\" Kernel 2.5.21 changed things a little: during lock conversion -.\"O .\" it is now the highest priority process that will get the lock -- mtk -ロックの変換 (共有ロックから排他ロックへ、もしくはその反対) がアトミックに -行われることは保証されていない: 既存のロックがまず削除され、それから新しい -ロックが設定される。この 2つのステップの間に、他のプロセスからの処理待ちの -ロック要求が認められるかもしれず、結果として変換は停止 (block) したり、 -.RB ( LOCK_NB -が指定された場合には) 失敗したりする。 +.\" Kernel 2.5.21 changed things a little: during lock conversion +.\" it is now the highest priority process that will get the lock -- mtk +ロックの変換 (共有ロックから排他ロックへ、もしくはその反対) がアトミックに 行われることは保証されていない: +既存のロックがまず削除され、それから新しい ロックが設定される。この 2つのステップの間に、他のプロセスからの処理待ちの +ロック要求が認められるかもしれず、結果として変換は停止 (block) したり、 (\fBLOCK_NB\fP が指定された場合には) 失敗したりする。 (これは元々の BSD の動作であり、多くの他の実装でも起こる。) -.\" カーネル 2.5.21 で少し動作が変更された: ロック変換の最中は -.\" そのロックを行おうとしているプロセスが最高優先となる -- mtk -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR close (2), -.BR dup (2), -.BR execve (2), -.BR fcntl (2), -.BR fork (2), -.BR open (2), -.BR lockf (3) +\fBclose\fP(2), \fBdup\fP(2), \fBexecve\fP(2), \fBfcntl\fP(2), \fBfork\fP(2), \fBopen\fP(2), +\fBlockf\fP(3) -.\"O See also -.\"O .I Documentation/filesystem/locks.txt -.\"O in the kernel source -.\"O .RI ( Documentation/locks.txt -.\"O in older kernels). -カーネルソース内の -.I Documentation/filesystem/locks.txt -(以前のカーネルでは -.IR Documentation/locks.txt ) -も参照のこと。 +カーネルソース内の \fIDocumentation/filesystem/locks.txt\fP (以前のカーネルでは +\fIDocumentation/locks.txt\fP) も参照のこと。 diff --git a/draft/man2/fork.2 b/draft/man2/fork.2 index 50fa8825..b143d4c2 100644 --- a/draft/man2/fork.2 +++ b/draft/man2/fork.2 @@ -36,363 +36,109 @@ .\" Greatly expanded, to describe all attributes that differ .\" parent and child. .\" -.\" Japanese Version Copyright (c) 1996 TABATA Tomohira -.\" all rights reserved. -.\" Translated Thu Jun 27 20:35:06 JST 1996 -.\" by TABATA Tomohira -.\" Modified Sun Dec 14 00:43:22 JST 1997 -.\" by HANATAKA Shinya -.\" Modified Tue Jul 10 05:36:22 JST 2001 -.\" by Yuichi SATO , LDP v1.38 -.\" Updated & Modified Wed Dec 29 12:33:12 JST 2004 -.\" by Yuichi SATO , LDP v2.01 -.\" Updated & Modified Wed Jan 3 04:11:03 JST 2007 by Yuichi SATO, LDP v2.43 -.\" Updated 2008-08-04, Akihiro MOTOKI , LDP v3.05 +.\"******************************************************************* .\" -.TH FORK 2 2009-04-27 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH FORK 2 2012\-02\-27 Linux "Linux Programmer's Manual" .SH 名前 -.\"O fork \- create a child process fork \- 子プロセスを生成する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.B pid_t fork(void); -.\"O .SH DESCRIPTION +\fBpid_t fork(void);\fP .SH 説明 -.\"O .BR fork () -.\"O creates a new process by duplicating the calling process. -.\"O The new process, referred to as the \fIchild\fP, -.\"O is an exact duplicate of the calling process, -.\"O referred to as the \fIparent\fP, except for the following points: -.BR fork () -は呼び出し元プロセスを複製して新しいプロセスを生成する。 -\fIchild\fP で参照される新しいプロセスは、以下の点を除き、 +\fBfork\fP() は呼び出し元プロセスを複製して新しいプロセスを生成する。 \fIchild\fP で参照される新しいプロセスは、以下の点を除き、 \fIparent\fP で参照される呼び出し元プロセスの完全な複製である: .IP * 3 -.\"O The child has its own unique process ID, -.\"O and this PID does not match the ID of any existing process group -.\"O .RB ( setpgid (2)). -子プロセスは独自のプロセス ID を持ち、 -この PID は既存のどのプロセスグループ -.RB ( setpgid (2)) -の ID とも一致しない。 +子プロセスは独自のプロセス ID を持ち、 この PID は既存のどのプロセスグループ (\fBsetpgid\fP(2)) の ID とも一致しない。 .IP * -.\"O The child's parent process ID is the same as the parent's process ID. 子プロセスの親プロセス ID は、親プロセスのプロセス ID と同じである。 .IP * -.\"O The child does not inherit its parent's memory locks -.\"O .RB ( mlock (2), -.\"O .BR mlockall (2)). -子プロセスは親プロセスのメモリロック -.RB ( mlock (2), -.BR mlockall (2)) -を引き継がない。 +子プロセスは親プロセスのメモリロック (\fBmlock\fP(2), \fBmlockall\fP(2)) を引き継がない。 .IP * -.\"O Process resource utilizations -.\"O .RB ( getrusage (2)) -.\"O and CPU time counters -.\"O .RB ( times (2)) -.\"O are reset to zero in the child. -プロセスの資源利用量 -.RB ( getrusage (2)) -と CPU タイムカウンタ -.RB ( times (2)) -が、子プロセスでは 0 にリセットされる。 +プロセスの資源利用量 (\fBgetrusage\fP(2)) と CPU タイムカウンタ (\fBtimes\fP(2)) が、子プロセスでは 0 +にリセットされる。 .IP * -.\"O The child's set of pending signals is initially empty -.\"O .RB ( sigpending (2)). -子プロセスの処理待ちのシグナルの集合 -.RB ( sigpending (2)) -は、初期状態では空になる。 +子プロセスの処理待ちのシグナルの集合 (\fBsigpending\fP(2)) は、初期状態では空になる。 .IP * -.\"O The child does not inherit semaphore adjustments from its parent -.\"O .RB ( semop (2)). -子プロセスは親プロセスからセマフォ調整 -.RB ( semop (2)) -を引き継がない。 +子プロセスは親プロセスからセマフォ調整 (\fBsemop\fP(2)) を引き継がない。 .IP * -.\"O The child does not inherit record locks from its parent -.\"O .RB ( fcntl (2)). -子プロセスは親プロセスからレコードロック -.RB ( fcntl (2)) -を引き継がない。 +子プロセスは親プロセスからレコードロック (\fBfcntl\fP(2)) を引き継がない。 .IP * -.\"O The child does not inherit timers from its parent -.\"O .RB ( setitimer (2), -.\"O .BR alarm (2), -.\"O .BR timer_create (2)). -子プロセスは親プロセスからタイマー -.RB ( setitimer (2), -.BR alarm (2), -.BR timer_create (2)) +子プロセスは親プロセスからタイマー (\fBsetitimer\fP(2), \fBalarm\fP(2), \fBtimer_create\fP(2)) を引き継がない。 .IP * -.\"O The child does not inherit outstanding asynchronous I/O operations -.\"O from its parent -.\"O .RB ( aio_read (3), -.\"O .BR aio_write (3)), -.\"O nor does it inherit any asynchronous I/O contexts from its parent (see -.\"O .BR io_setup (2)). -子プロセスは親プロセスから主だった非同期 I/O 操作を引き継がない -.RB ( aio_read (3), -.BR aio_write (3) -参照)。 -また、親プロセスから非同期 I/O コンテキストを引き継がない -.RB ( io_setup (2) -参照)。 +子プロセスは親プロセスから主だった非同期 I/O 操作を引き継がない (\fBaio_read\fP(3), \fBaio_write\fP(3) 参照)。 +また、親プロセスから非同期 I/O コンテキストを引き継がない (\fBio_setup\fP(2) 参照)。 .PP -.\"O The process attributes in the preceding list are all specified -.\"O in POSIX.1-2001. -.\"O The parent and child also differ with respect to the following -.\"O Linux-specific process attributes: -上記のリストにあるプロセス属性は、POSIX.1-2001 で全て指定されている。 -親プロセスと子プロセスは、以下の Linux 固有のプロセス属性も異なる: +上記のリストにあるプロセス属性は、POSIX.1\-2001 で全て指定されている。 親プロセスと子プロセスは、以下の Linux +固有のプロセス属性も異なる: .IP * 3 -.\"O The child does not inherit directory change notifications (dnotify) -.\"O from its parent -.\"O (see the description of -.\"O .B F_NOTIFY -.\"O in -.\"O .BR fcntl (2)). -子プロセスは親プロセスからディレクトリ変更通知 (dnotify) -.RB ( fcntl (2) -における -.B F_NOTIFY -の説明を参照) を引き継がない。 +子プロセスは親プロセスからディレクトリ変更通知 (dnotify) (\fBfcntl\fP(2) における \fBF_NOTIFY\fP の説明を参照) +を引き継がない。 .IP * -.\"O The -.\"O .BR prctl (2) -.\"O .B PR_SET_PDEATHSIG -.\"O setting is reset so that the child does not receive a signal -.\"O when its parent terminates. -.BR prctl (2) -の -.B PR_SET_PDEATHSIG -の設定がリセットされ、子プロセスは親プロセスが終了したときに +\fBprctl\fP(2) の \fBPR_SET_PDEATHSIG\fP の設定がリセットされ、子プロセスは親プロセスが終了したときに シグナルを受信しない。 .IP * -.\"O Memory mappings that have been marked with the -.\"O .BR madvise (2) -.\"O .B MADV_DONTFORK -.\"O flag are not inherited across a -.\"O .BR fork (). -.BR madvise (2) -の -.B MADV_DONTFORK -フラグでマークされたメモリマッピングは、 -.BR fork () +\fBmadvise\fP(2) の \fBMADV_DONTFORK\fP フラグでマークされたメモリマッピングは、 \fBfork\fP() によって引き継がれない。 .IP * -.\"O The termination signal of the child is always -.\"O .B SIGCHLD -.\"O (see -.\"O .BR clone (2)). -子プロセスの終了シグナルは常に -.B SIGCHLD -である -.RB ( clone (2) -を参照)。 +子プロセスの終了シグナルは常に \fBSIGCHLD\fP である (\fBclone\fP(2) を参照)。 .PP -.\"O Note the following further points: -さらに以下の点について注意すること: +以下の点についても注意すること: .IP * 3 -.\"O The child process is created with a single thread\(emthe -.\"O one that called -.\"O .BR fork (). -子プロセスはシングルスレッドで生成される。つまり、 -.BR fork () -を呼び出したスレッドとなる。 -.\"O The entire virtual address space of the parent is replicated in the child, -.\"O including the states of mutexes, condition variables, -.\"O and other pthreads objects; the use of -.\"O .BR pthread_atfork (3) -.\"O may be helpful for dealing with problems that this can cause. -親プロセスの仮想アドレス空間全体が子プロセスに複製される。 -これにはミューテックス (mutex) の状態・条件変数・ -pthread オブジェクトが含まれる。 -これが引き起こす問題を扱うには、 -.BR pthread_atfork (3) -を使うと良いだろう。 +子プロセスはシングルスレッドで生成される。つまり、 \fBfork\fP() を呼び出したスレッドとなる。 +親プロセスの仮想アドレス空間全体が子プロセスに複製される。 これにはミューテックス (mutex) の状態・条件変数・ pthread +オブジェクトが含まれる。 これが引き起こす問題を扱うには、 \fBpthread_atfork\fP(3) を使うと良いだろう。 .IP * -.\"O The child inherits copies of the parent's set of open file descriptors. -.\"O Each file descriptor in the child refers to the same -.\"O open file description (see -.\"O .BR open (2)) -.\"O as the corresponding file descriptor in the parent. -子プロセスは親プロセスが持つ -オープンファイルディスクリプタの集合のコピーを引き継ぐ。 -子プロセスの各ファイルディスクリプタは、 -親プロセスのファイルディスクリプタに対応する -同じオープンファイル記述 (file description) を参照する -.RB ( open (2) -を参照)。 -.\"O This means that the two descriptors share open file status flags, -.\"O current file offset, -.\"O and signal-driven I/O attributes (see the description of -.\"O .B F_SETOWN -.\"O and -.\"O .B F_SETSIG -.\"O in -.\"O .BR fcntl (2)). -これは 2 つのディスクリプタが、ファイル状態フラグ・ -現在のファイルオフセット、シグナル駆動 (signal-driven) I/O 属性 -.RB ( fcntl (2) -における -.BR F_SETOWN , -.B F_SETSIG -の説明を参照) を共有することを意味する。 +子プロセスは親プロセスが持つ オープンファイルディスクリプタの集合のコピーを引き継ぐ。 子プロセスの各ファイルディスクリプタは、 +親プロセスのファイルディスクリプタに対応する 同じオープンファイル記述 (file description) を参照する (\fBopen\fP(2) +を参照)。 これは 2 つのディスクリプタが、ファイル状態フラグ・ 現在のファイルオフセット、シグナル駆動 (signal\-driven) I/O 属性 +(\fBfcntl\fP(2) における \fBF_SETOWN\fP, \fBF_SETSIG\fP の説明を参照) を共有することを意味する。 .IP * -.\"O The child inherits copies of the parent's set of open message -.\"O queue descriptors (see -.\"O .BR mq_overview (7)). -子プロセスは親プロセスが持つオープンメッセージキューディスクリプタ -.RB ( mq_overview (7) -を参照) の集合のコピーを引き継ぐ。 -.\"O Each descriptor in the child refers to the same -.\"O open message queue description -.\"O as the corresponding descriptor in the parent. -子プロセスの各ディスクリプタは、 -親プロセスのディスクリプタに対応する -同じオープンメッセージキューディスクリプタを参照する。 -.\"O This means that the two descriptors share the same flags -.\"O .RI ( mq_flags ). -これは 2 つのディスクリプタが同じフラグ -.RI ( mq_flags ) -を共有することを意味する。 +子プロセスは親プロセスが持つオープンメッセージキューディスクリプタ (\fBmq_overview\fP(7) を参照) の集合のコピーを引き継ぐ。 +子プロセスの各ディスクリプタは、 親プロセスのディスクリプタに対応する 同じオープンメッセージキューディスクリプタを参照する。 これは 2 +つのディスクリプタが同じフラグ (\fImq_flags\fP) を共有することを意味する。 .IP * -.\"O The child inherits copies of the parent's set of open directory streams (see -.\"O .BR opendir (3)). -.\"O POSIX.1-2001 says that the corresponding directory streams -.\"O in the parent and child -.\"O .I may -.\"O share the directory stream positioning; -.\"O on Linux/glibc they do not. -子プロセスは、親プロセスのオープン済みのディレクトリストリームの集合 -.RB ( opendir (3) -参照) のコピーを継承する。 -POSIX.1-2001 では、親プロセスと子プロセス間の対応するディレクトリストリーム -はディレクトリストリームの位置 (positioning) を共有してもよいとされている。 -Linux/glibc ではディレクトリストリームの位置の共有は行われていない。 -.\"O .SH "RETURN VALUE" +子プロセスは、親プロセスのオープン済みのディレクトリストリームの集合 (\fBopendir\fP(3) 参照) のコピーを継承する。 +POSIX.1\-2001 では、親プロセスと子プロセス間の対応するディレクトリストリーム はディレクトリストリームの位置 (positioning) +を共有してもよいとされている。 Linux/glibc ではディレクトリストリームの位置の共有は行われていない。 .SH 返り値 -.\"O On success, the PID of the child process is returned in the parent, -.\"O and 0 is returned in the child. -.\"O On failure, \-1 is returned in the parent, -.\"O no child process is created, and -.\"O .I errno -.\"O is set appropriately. -成功した場合、親プロセスには子プロセスの PID が返され、 -子プロセスには 0 が返される。 -失敗した場合、親プロセスに \-1 が返され、子プロセスは生成されず、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS +成功した場合、親プロセスには子プロセスの PID が返され、 子プロセスには 0 が返される。 失敗した場合、親プロセスに \-1 +が返され、子プロセスは生成されず、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP -.B EAGAIN -.\"O .BR fork () -.\"O cannot allocate sufficient memory to copy the parent's page tables and -.\"O allocate a task structure for the child. -親プロセスのページ・テーブルのコピーと -子プロセスのタスク構造に生成に必要なメモリを -.BR fork () -が割り当てることができなかった。 -.TP -.B EAGAIN -.\"O It was not possible to create a new process because the caller's -.\"O .B RLIMIT_NPROC -.\"O resource limit was encountered. -呼び出し元の -.B RLIMIT_NPROC -資源の制限 (resource limit) に達したために、新しいプロセスを生成できなかった。 -.\"O To exceed this limit, the process must have either the -.\"O .B CAP_SYS_ADMIN -.\"O or the -.\"O .B CAP_SYS_RESOURCE -.\"O capability. -この制限を超えるには、プロセスは -.B CAP_SYS_ADMIN -または -.B CAP_SYS_RESOURCE -ケーパビリティ (capability) を持っていなくてはならない。 -.TP -.B ENOMEM -.\"O .BR fork () -.\"O failed to allocate the necessary kernel structures because memory is tight. -メモリが足りないために、 -.BR fork () -は必要なカーネル構造体を割り当てることができなかった。 -.\"O .SH "CONFORMING TO" +.TP +\fBEAGAIN\fP +親プロセスのページ・テーブルのコピーと 子プロセスのタスク構造に生成に必要なメモリを \fBfork\fP() が割り当てることができなかった。 +.TP +\fBEAGAIN\fP +呼び出し元の \fBRLIMIT_NPROC\fP 資源の制限 (resource limit) に達したために、新しいプロセスを生成できなかった。 +この制限を超えるには、プロセスは \fBCAP_SYS_ADMIN\fP または \fBCAP_SYS_RESOURCE\fP ケーパビリティ +(capability) を持っていなくてはならない。 +.TP +\fBENOMEM\fP +メモリが足りないために、 \fBfork\fP() は必要なカーネル構造体を割り当てることができなかった。 .SH 準拠 -SVr4, 4.3BSD, POSIX.1-2001. -.\"O .SH NOTES +SVr4, 4.3BSD, POSIX.1\-2001. .SH 注意 -.\"O .PP -.\"O Under Linux, -.\"O .BR fork () -.\"O is implemented using copy-on-write pages, so the only penalty that it incurs -.\"O is the time and memory required to duplicate the parent's page tables, -.\"O and to create a unique task structure for the child. -Linux では、 -.BR fork () -を 書き込み時コピー (copy-on-write)・ページを用いて実装している。 -したがって、fork を行うことの唯一のデメリットは、 -親プロセスのページ・テーブルを複製と -子プロセス自身のタスク構造の作成のための時間とメモリが必要なことである。 - -.\"O Since version 2.3.3, -.\"O .\" nptl/sysdeps/unix/sysv/linux/fork.c -.\"O rather than invoking the kernel's -.\"O .BR fork () -.\"O system call, -.\"O the glibc -.\"O .BR fork () -.\"O wrapper that is provided as part of the -.\"O NPTL threading implementation invokes -.\"O .BR clone (2) -.\"O with flags that provide the same effect as the traditional system call. -.\"O The glibc wrapper invokes any fork handlers that have been -.\"O established using -.\"O .BR pthread_atfork (3). -.\"O .\" and does some magic to ensure that getpid(2) returns the right value. -glibc 2.3.3 以降では、 -NPTL スレッド実装の一部として提供されている glibc の -.BR fork () -ラッパー関数は、 -カーネルの -.BR fork () -システムコールを起動するのではなく、 -.BR clone (2) -を起動する。 -.BR clone (2) -に渡すフラグとして、伝統的な -.BR fork () -システムコールと同じ効果が得られるようなフラグが指定される。 -glibc のラッパー関数は -.BR pthread_atfork (3) -を使って設定されている任意の fork ハンドラを起動する。 -.\" getpid(2) が正しい値を返すことができるように何らかの処理を行う。 +.PP +Linux では、 \fBfork\fP() を 書き込み時コピー (copy\-on\-write)・ページを用いて実装している。 したがって、fork +を行うことの唯一のデメリットは、 親プロセスのページ・テーブルを複製と 子プロセス自身のタスク構造の作成のための時間とメモリが必要なことである。 -.\"O .SH EXAMPLE +.\" nptl/sysdeps/unix/sysv/linux/fork.c +.\" and does some magic to ensure that getpid(2) returns the right value. +glibc 2.3.3 以降では、 NPTL スレッド実装の一部として提供されている +glibc の\fBfork\fP() ラッパー関数は、 カーネルの \fBfork\fP() システムコール +を起動するのではなく、\fBclone\fP(2) を起動する。 +\fBclone\fP(2) に渡すフラグとして、伝統的な \fBfork\fP() システムコールと +同じ効果が得られるようなフラグが指定される (\fBfork\fP() の呼び出しは、 +\fIflags\fP に \fBSIGCHLD\fP だけを指定して \fBclone\fP(2) を呼び出すのと等価である)。 +glibc のラッパー関数は \fBpthread_atfork\fP(3) を使って設定されている +任意の fork ハンドラを起動する。 .SH 例 -.\"O See -.\"O .BR pipe (2) -.\"O and -.\"O .BR wait (2). -.BR pipe (2) -および -.BR wait (2) -を参照。 -.\"O .SH "SEE ALSO" +\fBpipe\fP(2) および \fBwait\fP(2) を参照。 .SH 関連項目 -.BR clone (2), -.BR execve (2), -.BR setrlimit (2), -.BR unshare (2), -.BR vfork (2), -.BR wait (2), -.BR daemon (3), -.BR capabilities (7), -.BR credentials (7) +\fBclone\fP(2), \fBexecve\fP(2), \fBsetrlimit\fP(2), \fBunshare\fP(2), \fBvfork\fP(2), +\fBwait\fP(2), \fBdaemon\fP(3), \fBcapabilities\fP(7), \fBcredentials\fP(7) diff --git a/draft/man2/fstatat.2 b/draft/man2/fstatat.2 deleted file mode 100644 index bf2225bc..00000000 --- a/draft/man2/fstatat.2 +++ /dev/null @@ -1,232 +0,0 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" This manpage is Copyright (C) 2006, Michael Kerrisk -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" Japanese Version Copyright (c) 2006 Yuichi SATO -.\" all rights reserved. -.\" Translated 2006-10-13 by Yuichi SATO , LDP v2.39 -.\" -.TH FSTATAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O fstatat \- get file status relative to a directory file descriptor -fstatat \- ディレクトリファイルディスクリプタから相対的な位置にあるファイルの状態を取得する -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.\"O .B #include /* Definition of AT_* constants */ -.B #include /* AT_* 定数の定義 */ -.B #include -.sp -.BI "int fstatat(int " dirfd ", const char *" pathname ", struct stat *" \ -buf , -.BI " int " flags ); -.fi -.sp -.in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): -.in -.sp -.BR fstatat (): -.PD 0 -.ad l -.RS 4 -.TP 4 -.\"O Since glibc 2.10: -glibc 2.10 以降: -_XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L -.TP -.\"O Before glibc 2.10: -glibc 2.10 より前: -_ATFILE_SOURCE -.RE -.ad -.PD -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The -.\"O .BR fstatat () -.\"O system call operates in exactly the same way as -.\"O .BR stat (2), -.\"O except for the differences described in this manual page. -.BR fstatat () -システムコールは、この man ページで説明している違いがある以外は、 -.BR stat (2) -と全く同じように動作する。 - -.\"O If the pathname given in -.\"O .I pathname -.\"O is relative, then it is interpreted relative to the directory -.\"O referred to by the file descriptor -.\"O .I dirfd -.\"O (rather than relative to the current working directory of -.\"O the calling process, as is done by -.\"O .BR stat (2) -.\"O for a relative pathname). -.I pathname -で指定されるパス名が相対パスである場合、 -ファイルディスクリプタ -.I dirfd -で参照されるディレクトリからの相対パス名として解釈される -.RB ( stat (2) -では、相対パスは呼び出し元プロセスのカレントワーキングディレクトリからの -相対パスとなる)。 - -.\"O If -.\"O .I pathname -.\"O is relative and -.\"O .I dirfd -.\"O is the special value -.\"O .BR AT_FDCWD , -.\"O then -.\"O .I pathname -.\"O is interpreted relative to the current working -.\"O directory of the calling process (like -.\"O .BR stat (2)). -.I pathname -が相対パスであり、かつ -.I dirfd -が特別な値 -.B AT_FDCWD -である場合、 -.I pathname -は -.RB ( stat (2) -と同じように) 呼び出し元プロセスの -カレントワーキングディレクトリからの相対パス名として解釈される。 - -.\"O If -.\"O .I pathname -.\"O is absolute, then -.\"O .I dirfd -.\"O is ignored. -.I pathname -が絶対パスである場合、 -.I dirfd -は無視される。 - -.\"O .I flags -.\"O can either be 0, or include the following flag: -.I flags -は 0 または以下のフラグである。 -.TP -.B AT_SYMLINK_NOFOLLOW -.\"O If -.\"O .I pathname -.\"O is a symbolic link, do not dereference it: -.\"O instead return information about the link itself, like -.\"O .BR lstat (2). -.\"O (By default, -.\"O .BR fstatat () -.\"O dereferences symbolic links, like -.\"O .BR stat (2).) -.I pathname -がシンボリックリンクの場合は、それを辿るのではなく、 -.BR lstat (2) -と同様にリンク自身についての情報を返す -(デフォルトでは、 -.BR fstatat () -は -.BR stat (2) -と同様にシンボリックリンクを辿る)。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success, -.\"O .BR fstatat () -.\"O returns 0. -成功した場合、 -.BR fstatat () -は 0 を返す。 -.\"O On error, \-1 is returned and -.\"O .I errno -.\"O is set to indicate the error. -エラーの場合、\-1 が返されて、 -.I errno -にはエラーを示す値が設定される。 -.\"O .SH ERRORS -.SH エラー -.\"O The same errors that occur for -.\"O .BR stat (2) -.\"O can also occur for -.\"O .BR fstatat (). -.BR stat (2) -と同じエラーが -.BR fstatat () -でも起こる。 -.\"O The following additional errors can occur for -.\"O .BR fstatat (): -.BR fstatat () -では、その他に以下のエラーが起こる: -.TP -.B EBADF -.\"O .I dirfd -.\"O is not a valid file descriptor. -.I dirfd -が有効なファイルディスクリプタでない。 -.TP -.B EINVAL -.\"O Invalid flag specified in -.\"O .IR flags . -.I flags -に不正なフラグ値が指定された。 -.TP -.B ENOTDIR -.\"O .I pathname -.\"O is relative and -.\"O .I dirfd -.\"O is a file descriptor referring to a file other than a directory. -.I pathname -が相対パスで、かつ -.I dirfd -がディレクトリ以外のファイルを参照するファイルディスクリプタである。 -.\"O .SH VERSIONS -.SH バージョン -.\"O .BR fstatat () -.\"O was added to Linux in kernel 2.6.16. -.BR fstatat () -は Linux カーネル 2.6.16 で追加された。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -POSIX.1-2008. -.\"O A similar system call exists on Solaris. -Solaris には、これと同じようなシステムコールが存在する。 -.\"O .SH NOTES -.SH 注意 -.\"O See -.\"O .BR openat (2) -.\"O for an explanation of the need for -.\"O .BR fstatat (). -.BR fstatat () -が必要な理由については、 -.BR openat (2) -を参照すること。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR openat (2), -.BR stat (2), -.BR path_resolution (7), -.BR symlink (7), diff --git a/draft/man2/fsync.2 b/draft/man2/fsync.2 deleted file mode 100644 index e11f20e4..00000000 --- a/draft/man2/fsync.2 +++ /dev/null @@ -1,314 +0,0 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) and -.\" and Copyright 2006 Michael Kerrisk -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" Modified 21 Aug 1994 by Michael Chastain : -.\" Removed note about old libc (pre-4.5.26) translating to 'sync'. -.\" Modified 15 Apr 1995 by Michael Chastain : -.\" Added `see also' section. -.\" Modified 13 Apr 1996 by Markus Kuhn -.\" Added remarks about fdatasync. -.\" Modified Fri Jan 31 16:27:42 1997 by Eric S. Raymond -.\" Modified 31 Jan 1997 by Eric S. Raymond -.\" Modified 18 Apr 2001 by Andi Kleen -.\" Fix description to describe what it really does; add a few caveats. -.\" 2006-04-28, mtk, substantial rewrite of various parts. -.\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1997-02-22, HANATAKA Shinya -.\" Modified 2001-05-19, HANATAKA Shinya -.\" Updated 2005-09-06, Akihiro MOTOKI -.\" Updated 2006-07-30, Kentaro Shirakata -.\" Updated 2007-10-13, Akihiro MOTOKI , LDP v2.65 -.\" -.\"WORD: core メモリ -.\"WORD: disk ディスク -.\"WORD: synchronize 同期させる -..\" -.TH FSYNC 2 2008-11-07 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O fsync, fdatasync \- synchronize a file's in-core state with storage device -fsync \- メモリ上にあるファイルの内容をストレージデバイス上のものと同期させる -.\"O .SH SYNOPSIS -.SH 書式 -.B #include -.sp -.BI "int fsync(int " fd ); -.sp -.BI "int fdatasync(int " fd ); -.sp -.in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): -.in -.sp -.BR fsync (): -_BSD_SOURCE || _XOPEN_SOURCE -.br -.\"O || /* since glibc 2.8: */ _POSIX_C_SOURCE\ >=\ 200112L - || /* glibc 2.8 以降では: */ _POSIX_C_SOURCE\ >=\ 200112L -.\"O .\" _POSIX_C_SOURCE\ >=\ 200112L only since glibc 2.8 -.\" _POSIX_C_SOURCE\ >=\ 200112L は glibc 2.8 以降のみ -.br -.BR fdatasync (): -_POSIX_C_SOURCE\ >=\ 199309L || _XOPEN_SOURCE\ >=\ 500 -.\"O .SH DESCRIPTION -.SH 説明 -.\"O .BR fsync () -.\"O transfers ("flushes") all modified in-core data of -.\"O (i.e., modified buffer cache pages for) the -.\"O file referred to by the file descriptor -.\"O .I fd -.\"O to the disk device (or other permanent storage device) -.\"O where that file resides. -.BR fsync () -は、ファイル記述子 -.I fd -で参照されるファイルの内部で持っているデータ -(つまりバッファキャッシュページ) のうち修正されたデータを、 -そのファイルが属するディスクデバイス (またはその他の永続ストレージデバイス) -に転送 (「フラッシュ」) する。 -.\"O The call blocks until the device reports that the transfer has completed. -.\"O It also flushes metadata information associated with the file (see -.\"O .BR stat (2)). -この呼び出しは転送が終わったとデバイスが報告するまでブロックする。 -またファイルに結びついたメタデータ情報 -.RB ( stat (2) -参照) もフラッシュする。 - -.\"O Calling -.\"O .BR fsync () -.\"O does not necessarily ensure -.\"O that the entry in the directory containing the file has also reached disk. -.\"O For that an explicit -.\"O .BR fsync () -.\"O on a file descriptor for the directory is also needed. -.BR fsync () -の呼び出しは、ファイルが存在しているディレクトリのエントリがディスクへ -書き込まれたことを保証するわけではない。 -保証するためには明示的にそのディレクトリのファイル記述子に対しても -.BR fsync () -する必要がある。 - -.\"O .BR fdatasync () -.\"O is similar to -.\"O .BR fsync (), -.\"O but does not flush modified metadata unless that metadata -.\"O is needed in order to allow a subsequent data retrieval to be -.\"O correctly handled. -.BR fdatasync () -は -.BR fsync () -と同様であるが、メタデータの扱いが異なる。 -.BR fdatasync () -は、それ以降のデータ読み込みを正しく扱うためにそのメタデータが必要に -ならない限り、変更されたメタデータをフラッシュしない。 -.\"O For example, changes to -.\"O .I st_atime -.\"O or -.\"O .I st_mtime -.\"O (respectively, time of last access and -.\"O time of last modification; see -.\"O .BR stat (2)) -.\"O do not require flushing because they are not necessary for -.\"O a subsequent data read to be handled correctly. -例えば、 -st_atime や st_mtime -(それぞれ最終アクセス時刻、最終修正時刻; -.BR stat (2) -参照) の変更はフラッシュを必要としない。 -なぜならこれらはそれ以降のデータ読み込みを正しく扱うために -必要ではないからである。 -.\"O On the other hand, a change to the file size -.\"O .RI ( st_size , -.\"O as made by say -.\"O .BR ftruncate (2)), -.\"O would require a metadata flush. -一方、ファイルサイズ -.RB ( ftruncate (2) -では -.IR st_size ) -の変更はメタデータのフラッシュが必要である。 -.\"O The aim of -.\"O .BR fdatasync () -.\"O is to reduce disk activity for applications that do not -.\"O require all metadata to be synchronized with the disk. -.BR fdatasync () -の狙いは、全てのメタデータをディスクと同期する必要のない -アプリケーションに対して、ディスクアクセスを減らすことである。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success, these system calls return zero. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合、これらのシステムコールはゼロを返す。 -エラーの場合、\-1 が返され、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EBADF -.\"O .I fd -.\"O is not a valid file descriptor open for writing. -.I fd -が書き込みのためにオープンされたファイル記述子でない。 -.TP -.B EIO -.\"O An error occurred during synchronization. -同期操作の間にエラーが発生した。 -.TP -.BR EROFS ", " EINVAL -.\"O .I fd -.\"O is bound to a special file which does not support synchronization. -.I fd -が同期操作をサポートしてない特殊なファイルを参照している。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -4.3BSD, POSIX.1-2001. -.\"O .SH AVAILABILITY -.SH 可用性 -.\"O On POSIX systems on which -.\"O .BR fdatasync () -.\"O is available, -.\"O .B _POSIX_SYNCHRONIZED_IO -.\"O is defined in -.\"O .I -.\"O to a value greater than 0. -.\"O (See also -.\"O .BR sysconf (3).) -.BR fdatasync () -が利用可能な POSIX システムでは、 -.B _POSIX_SYNCHRONIZED_IO -が -.I -で 0 より大きな値に定義される -.RB ( sysconf (3) -参照)。 -.\" POSIX.1-2001: It shall be defined to -1 or 0 or 200112L. -.\" -1: unavailable, 0: ask using sysconf(). -.\" glibc defines them to 1. -.\"O .SH NOTES -.SH 注意 -.\"O Applications that access databases or log files often write a tiny -.\"O data fragment (e.g., one line in a log file) and then call -.\"O .BR fsync () -.\"O immediately in order to ensure that the written data is physically -.\"O stored on the harddisk. -.\"O Unfortunately, -.\"O .BR fsync () -.\"O will always initiate two write operations: one for the newly written -.\"O data and another one in order to update the modification time stored -.\"O in the inode. -.\"O If the modification time is not a part of the transaction -.\"O concept -.\"O .BR fdatasync () -.\"O can be used to avoid unnecessary inode disk write operations. -データベースやログファイルにアクセスするアプリケーションは、 -非常に小さなデータの断片の書き込みを行い、その後すぐに -.BR fsync () -を呼び出して、書き込んだデータがハードディスクに物理的に -確実に格納されるようにすることが多い。 -残念ながら、 -.BR fsync () -は常に 2つの書き込み操作を開始する。 -一つは新しく書き込まれたデータに対するものであり、 -もう一つは inode に格納される修正時刻 (modification time) を -更新するためのものである。 -修正時刻の更新が不可分な操作 (トランザクション) の一部ではない場合、 -.BR fdatasync () -を使うことで、不必要な inode のディスク書き込み操作を避けることができる。 - -.\"O If the underlying hard disk has write caching enabled, then -.\"O the data may not really be on permanent storage when -.\"O .BR fsync () -.\"O / -.\"O .BR fdatasync () -.\"O return. -.\"O .\" See -.\"O .\" .BR hdparm (8) -.\"O .\" for how to disable that cache for IDE disks. -データが配置されているハードディスクの書き込みキャッシュが有効に -なっている場合、 -.BR fsync () -/ -.BR fdatasync () -から戻ってきたとしても、そのデータは実際には永続的な記憶媒体に -格納されていないかもしれない。 -.\" IDE ディスクのキャッシュを無効にする方法については -.\" .BR hdparm (8) -.\" を参照のこと。 -.LP -.\"O When an ext2 file system is mounted with the -.\"O .I sync -.\"O option, directory entries are also implicitly synced by -.\"O .BR fsync (). -ext2 ファイル・システムが -.I sync -オプションつきでマウントされている場合、 -.BR fsync () -でディレクトリ・エントリも暗黙のうちに同期する。 -.LP -.\"O On kernels before 2.4, -.\"O .BR fsync () -.\"O on big files can be inefficient. -.\"O An alternative might be to use the -.\"O .B O_SYNC -.\"O flag to -.\"O .BR open (2). -2.4 より前のカーネルでは巨大なファイルに -.BR fsync () -を使用することは効率が悪い場合がある。 -別の方法として -.BR open (2) -の際に -.B O_SYNC -フラグを使用するのが良いかもしれない。 - -.\"O In Linux 2.2 and earlier, -.\"O .BR fdatasync () -.\"O is equivalent to -.\"O .BR fsync (), -.\"O and so has no performance advantage. -Linux 2.2 以前では、 -.BR fdatasync () -は -.BR fsync () -と等価であり、性能面でのメリットはない。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR bdflush (2), -.BR open (2), -.BR sync (2), -.BR sync_file_range (2), -.BR hdparm (8), -.BR mount (8), -.BR sync (8), -.BR update (8) diff --git a/draft/man2/futimesat.2 b/draft/man2/futimesat.2 index 4968862d..3318cddb 100644 --- a/draft/man2/futimesat.2 +++ b/draft/man2/futimesat.2 @@ -22,205 +22,66 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2006 Yuichi SATO -.\" all rights reserved. -.\" Translated 2006-09-30 by Yuichi SATO , LDP v2.39 .\" -.TH FUTIMESAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH FUTIMESAT 2 2012\-03\-25 Linux "Linux Programmer's Manual" .SH 名前 -.\"O futimesat \- change timestamps of a file relative to a \ -.\"O directory file descriptor futimesat \- ディレクトリファイルディスクリプタから相対的な位置にあるファイルのタイムスタンプを変更する -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .B #include /* Definition of AT_* constants */ -.B #include /* AT_* 定数の定義 */ +\fB#include /* AT_* 定数の定義 */\fP +\fB#include \fP .sp -.BI "int futimesat(int " dirfd ", const char *" pathname , -.BI " const struct timeval " times [2]); +\fBint futimesat(int \fP\fIdirfd\fP\fB, const char *\fP\fIpathname\fP\fB,\fP +\fB const struct timeval \fP\fItimes\fP\fB[2]);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR futimesat (): -.PD 0 -.ad l -.RS 4 -.TP 4 -.\"O Since glibc 2.10: -glibc 2.10 以降: -_XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L -.TP -.\"O Before glibc 2.10: -glibc 2.10 より前: -_ATFILE_SOURCE -.RE -.ad -.PD -.\"O .SH DESCRIPTION +\fBfutimesat\fP(): _GNU_SOURCE .SH 説明 -.\"O This system call is obsolete. -.\"O Use -.\"O .BR utimensat (2) -.\"O instead. -このシステムコールは廃止予定である。 -代わりに -.BR utimensat (2) -を使用すること。 +このシステムコールは廃止予定である。 代わりに \fButimensat\fP(2) を使用すること。 -.\"O The -.\"O .BR futimesat () -.\"O system call operates in exactly the same way as -.\"O .BR utimes (2), -.\"O except for the differences described in this manual page. -.BR futimesat () -システムコールは、この man ページで説明している違いがある以外は、 -.BR utimes (2) +\fBfutimesat\fP() システムコールは、この man ページで説明している違いがある以外は、 \fButimes\fP(2) と全く同じように動作する。 -.\"O If the pathname given in -.\"O .I pathname -.\"O is relative, then it is interpreted relative to the directory -.\"O referred to by the file descriptor -.\"O .I dirfd -.\"O (rather than relative to the current working directory of -.\"O the calling process, as is done by -.\"O .BR utimes (2) -.\"O for a relative pathname). -.I pathname -で指定されるパス名が相対パス名である場合、 -ファイルディスクリプタ -.I dirfd -で参照されるディレクトリからの相対パス名として解釈される -.RB ( utimes (2) -では、相対パスは呼び出し元プロセスの +\fIpathname\fP で指定されるパス名が相対パス名である場合、 ファイルディスクリプタ \fIdirfd\fP +で参照されるディレクトリからの相対パス名として解釈される (\fButimes\fP(2) では、相対パスは呼び出し元プロセスの カレントワーキングディレクトリからの相対パスとなる)。 -.\"O If -.\"O .I pathname -.\"O is relative and -.\"O .I dirfd -.\"O is the special value -.\"O .BR AT_FDCWD , -.\"O then -.\"O .I pathname -.\"O is interpreted relative to the current working -.\"O directory of the calling process (like -.\"O .BR utimes (2)). -.I pathname -が相対パスであり、かつ -.I dirfd -が特別な値 -.B AT_FDCWD -である場合、 -.I pathname -は -.RB ( utimes (2) -と同じように) 呼び出し元プロセスの -カレントワーキングディレクトリからの相対パス名として解釈される。 +\fIpathname\fP が相対パスであり、かつ \fIdirfd\fP が特別な値 \fBAT_FDCWD\fP である場合、 \fIpathname\fP は +(\fButimes\fP(2) と同じように) 呼び出し元プロセスの カレントワーキングディレクトリからの相対パス名として解釈される。 -.\"O If -.\"O .I pathname -.\"O is absolute, then -.\"O .I dirfd -.\"O is ignored. -.I pathname -が絶対パスである場合、 -.I dirfd -は無視される。 -.\"O .SH "RETURN VALUE" +\fIpathname\fP が絶対パスである場合、 \fIdirfd\fP は無視される。 .SH 返り値 -.\"O On success, -.\"O .BR futimesat () -.\"O returns a 0. -成功した場合、 -.BR futimesat () -は 0 を返す。 -.\"O On error, \-1 is returned and -.\"O .I errno -.\"O is set to indicate the error. -エラーの場合、\-1 が返されて、 -.I errno -にはエラーを示す値が設定される。 -.\"O .SH ERRORS +成功した場合、 \fBfutimesat\fP() は 0 を返す。 エラーの場合、\-1 が返されて、 \fIerrno\fP にはエラーを示す値が設定される。 .SH エラー -.\"O The same errors that occur for -.\"O .BR utimes (2) -.\"O can also occur for -.\"O .BR futimesat (). -.BR utimes (2) -と同じエラーが -.BR futimesat () -でも起こる。 -.\"O The following additional errors can occur for -.\"O .BR futimesat (): -.BR futimesat () +\fButimes\fP(2) と同じエラーが \fBfutimesat\fP() でも起こる。 \fBfutimesat\fP() では、その他に以下のエラーが起こる: -.TP -.B EBADF -.\"O .I dirfd -.\"O is not a valid file descriptor. -.I dirfd -が有効なファイルディスクリプタでない。 -.TP -.B ENOTDIR -.\"O .I pathname -.\"O is relative and -.\"O .I dirfd -.\"O is a file descriptor referring to a file other than a directory. -.I pathname -が相対パスで、かつ -.I dirfd -がディレクトリ以外のファイルを参照するファイルディスクリプタである。 -.\"O .SH VERSIONS +.TP +\fBEBADF\fP +\fIdirfd\fP が有効なファイルディスクリプタでない。 +.TP +\fBENOTDIR\fP +\fIpathname\fP が相対パスで、かつ \fIdirfd\fP がディレクトリ以外のファイルを参照するファイルディスクリプタである。 .SH バージョン -.\"O .BR futimesat () -.\"O was added to Linux in kernel 2.6.16. -.BR futimesat () -は Linux カーネル 2.6.16 で追加された。 -.\"O .SH "CONFORMING TO" +\fBfutimesat\fP() は Linux カーネル 2.6.16 で追加された。 .SH 準拠 -.\"O This system call is nonstandard. -.\"O It was implemented from a specification that was proposed for POSIX.1, -.\"O but that specification was replaced by the one for -.\"O .BR utimensat (2). -このシステムコールは標準的ではない。 -POSIX.1 で提案されていた仕様に由来して実装されたが、 -その仕様は -.BR utimensat (2) +このシステムコールは標準的ではない。 POSIX.1 で提案されていた仕様に由来して実装されたが、 その仕様は \fButimensat\fP(2) で置き換えられた。 -.\"O A similar system call exists on Solaris. Solaris には、これと同じようなシステムコールが存在する。 -.\"O .SH NOTES -.\"O .SS Glibc Notes .SH 注意 -.SS GLIBC についての注意 -.\"O If -.\"O .I pathname -.\"O is NULL, then the glibc -.\"O .BR futimesat () -.\"O wrapper function updates the times for the file referred to by -.\"O .IR dirfd . -.I pathname -が NULL の場合、glibc の -.BR futimesat () -ラッパー関数は -.I dirfd -で参照されるファイルの時刻を更新する。 +.SS "glibc についての注意" .\" The Solaris futimesat() also has this strangeness. -.\"O .SH "SEE ALSO" +\fIpathname\fP が NULL の場合、glibc の \fBfutimesat\fP() ラッパー関数は \fIdirfd\fP +で参照されるファイルの時刻を更新する。 .SH 関連項目 -.BR stat (2), -.BR utimensat (2), -.BR utimes (2), -.BR futimes (3), -.BR path_resolution (7) +\fBstat\fP(2), \fButimensat\fP(2), \fButimes\fP(2), \fBfutimes\fP(3), +\fBpath_resolution\fP(7) diff --git a/draft/man2/get_thread_area.2 b/draft/man2/get_thread_area.2 index 2f0e6b01..e97bb022 100644 --- a/draft/man2/get_thread_area.2 +++ b/draft/man2/get_thread_area.2 @@ -3,93 +3,40 @@ .\" See the file COPYING in the top level source directory for details. .\" .\" Written by Kent Yoder. +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated Tue Jul 8 03:28:55 JST 2003 -.\" by Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.\"WORD: Thread Local Storage スレッド局所記憶 -.\" -.TH GET_THREAD_AREA 2 2008-11-27 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O get_thread_area \- Get a Thread Local Storage (TLS) area +.\"******************************************************************* +.TH GET_THREAD_AREA 2 2008\-11\-27 Linux "Linux Programmer's Manual" .SH 名前 get_thread_area \- スレッド局所記憶 (TLS) 領域を取り出す -.\"O .SH "SYNOPSIS" .SH 書式 -.B #include +\fB#include \fP .br -.B #include +\fB#include \fP .sp -.BI "int get_thread_area(struct user_desc *" u_info ); -.\"O .SH "DESCRIPTION" +\fBint get_thread_area(struct user_desc *\fP\fIu_info\fP\fB);\fP .SH 説明 -.\"O .BR get_thread_area () -.\"O returns an entry in the current thread's Thread Local Storage (TLS) array. -.\"O The index of the entry corresponds to the value -.\"O of \fIu_info\->entry_number\fP, passed in by the user. -.\"O If the value is in bounds, -.\"O .BR get_thread_info () -.\"O copies the corresponding -.\"O TLS entry into the area pointed to by \fIu_info\fP. -.BR get_thread_area () -は、カレント・スレッドのスレッド局所記憶 -(Thread Local Storage; TLS) 配列の中のエントリを返す。 -エントリのインデックスは、ユーザから引き数として渡される -\fIu_info\->entry_number\fP の値に対応している。 -値が範囲内にある場合、 -.BR get_thread_info () -は対応する TLS エントリを -\fIu_info\fP で指された領域にコピーする。 -.\"O .SH "RETURN VALUE" +\fBget_thread_area\fP() は、カレント・スレッドのスレッド局所記憶 (Thread Local Storage; TLS) +配列の中のエントリを返す。 エントリのインデックスは、ユーザから引き数として渡される \fIu_info\->entry_number\fP +の値に対応している。 値が範囲内にある場合、 \fBget_thread_info\fP() は対応する TLS エントリを \fIu_info\fP +で指された領域にコピーする。 .SH 返り値 -.\"O .BR get_thread_area () -.\"O returns 0 on success. -.\"O Otherwise, it returns \-1 and sets -.\"O .I errno -.\"O appropriately. -成功した場合、 -.BR get_thread_area () -は 0 を返す。 -そうでない場合、 \-1 を返し、 -.I errno +成功した場合、 \fBget_thread_area\fP() は 0 を返す。 そうでない場合、 \-1 を返し、 \fIerrno\fP に適切な値をセットする。 -.\"O .SH "ERRORS" .SH エラー -.TP -.B EFAULT -.\"O \fIu_info\fP is an invalid pointer. +.TP +\fBEFAULT\fP \fIu_info\fP が不正なポインタである。 -.TP -.B EINVAL -.\"O \fIu_info\->entry_number\fP is out of bounds. +.TP +\fBEINVAL\fP \fIu_info\->entry_number\fP が範囲外である。 -.\"O .SH VERSIONS .SH バージョン -.\"O A version of -.\"O .BR get_thread_area () -.\"O first appeared in Linux 2.5.32. -.BR get_thread_area () -は Linux 2.5.32 で初めて登場した。 -.\"O .SH "CONFORMING TO" +\fBget_thread_area\fP() は Linux 2.5.32 で初めて登場した。 .SH 準拠 -.\"O .BR get_thread_area () -.\"O is Linux-specific and should not be used in programs -.\"O that are intended to be portable. -.BR get_thread_area () -は Linux 独自の関数であり、 -移植を意図したプログラムでは使用すべきではない。 -.\"O .SH NOTES +\fBget_thread_area\fP() は Linux 独自の関数であり、 移植を意図したプログラムでは使用すべきではない。 .SH 注意 -.\"O Glibc does not provide a wrapper for this system call; -.\"O call it using -.\"O .BR syscall (2). -glibc はこのシステムコールに対するラッパー関数を提供していない。 -このシステムコールは呼び出すには -.BR syscall (2) -を使うこと。 -.\"O .SH "SEE ALSO" +glibc はこのシステムコールに対するラッパー関数を提供していない。 このシステムコールは呼び出すには \fBsyscall\fP(2) を使うこと。 .SH 関連項目 -.BR modify_ldt (2), -.BR set_thread_area (2) +\fBmodify_ldt\fP(2), \fBset_thread_area\fP(2) diff --git a/draft/man2/getcontext.2 b/draft/man2/getcontext.2 index 493767ab..6c1d10f3 100644 --- a/draft/man2/getcontext.2 +++ b/draft/man2/getcontext.2 @@ -20,51 +20,28 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved. -.\" Translated Sat Dec 15 2001 by NAKANO Takeo -.\" Updated 2009-04-13, Akihiro MOTOKI , LDP v3.20 +.\"******************************************************************* .\" -.TH GETCONTEXT 2 2009-03-15 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O getcontext, setcontext \- get or set the user context +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GETCONTEXT 2 2009\-03\-15 Linux "Linux Programmer's Manual" .SH 名前 getcontext, setcontext \- ユーザコンテキストを取得/設定する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int getcontext(ucontext_t *" ucp ); +\fBint getcontext(ucontext_t *\fP\fIucp\fP\fB);\fP .br -.BI "int setcontext(const ucontext_t *" ucp ); -.\"O .SH DESCRIPTION +\fBint setcontext(const ucontext_t *\fP\fIucp\fP\fB);\fP .SH 説明 -.\"O In a System V-like environment, one has the two types -.\"O \fImcontext_t\fP and \fIucontext_t\fP defined in -.\"O .I -.\"O and the four functions -.\"O .BR getcontext (), -.\"O .BR setcontext (), -.\"O .BR makecontext (3) -.\"O and -.\"O .BR swapcontext (3) -.\"O that allow user-level context switching between multiple -.\"O threads of control within a process. -System V 的な環境では、 -\fImcontext_t\fP および \fIucontext_t\fP という 2 つの型と、 -.BR getcontext (), -.BR setcontext (), -.BR makecontext (3), -.BR swapcontext (3) -という 4 つの関数が -.I -で定義されており、あるプロセス内部で制御下にある複数のスレッド間で、 +System V 的な環境では、 \fImcontext_t\fP および \fIucontext_t\fP という 2 つの型と、 +\fBgetcontext\fP(), \fBsetcontext\fP(), \fBmakecontext\fP(3), \fBswapcontext\fP(3) という +4 つの関数が \fI\fP で定義されており、あるプロセス内部で制御下にある複数のスレッド間で、 ユーザレベルのコンテキスト切替えができるようになっている。 .LP -.\"O The \fImcontext_t\fP type is machine-dependent and opaque. -.\"O The \fIucontext_t\fP type is a structure that has at least -.\"O the following fields: -\fImcontext_t\fP 型はマシン依存で、外部からは隠蔽されている。 -\fIucontext_t\fP 型は構造体で、少なくとも以下の 4 つのフィールドを持つ。 +\fImcontext_t\fP 型はマシン依存で、外部からは隠蔽されている。 \fIucontext_t\fP 型は構造体で、少なくとも以下の 4 +つのフィールドを持つ。 .in +4 .nf @@ -78,208 +55,47 @@ typedef struct ucontext { .fi .in -.\"O with \fIsigset_t\fP and \fIstack_t\fP defined in -.\"O .IR . -.\"O Here \fIuc_link\fP points to the context that will be resumed -.\"O when the current context terminates (in case the current context -.\"O was created using -.\"O .BR makecontext (3)), -.\"O \fIuc_sigmask\fP is the -.\"O set of signals blocked in this context (see -.\"O .BR sigprocmask (2)), -.\"O \fIuc_stack\fP is the stack used by this context (see -.\"O .BR sigaltstack (2)), -.\"O and \fIuc_mcontext\fP is the -.\"O machine-specific representation of the saved context, -.\"O that includes the calling thread's machine registers. -\fIsigset_t\fP と \fIstack_t\fP は -.I -で定義されている。 -ここで \fIuc_link\fP は、 -現在のコンテキストが終了したとき、 -続いて切り替わるコンテキストへのポインタである -(現在のコンテキストが -.BR makecontext (3) -で生成されたものの場合)。 -\fIuc_sigmask\fP はこのコンテキストでブロックされている -シグナル群である -.RB ( sigprocmask (2) -を見よ)。 -\fIuc_stack\fP はこのコンテキストが用いているスタックである -.RB ( signalstack (2) -を見よ)。 -\fIuc_mcontext\fP は保存されているコンテキストの -マシン特有の表現形式であり、 -ここには呼び出したスレッドのマシンレジスタが格納される。 +\fIsigset_t\fP と \fIstack_t\fP は \fI\fP で定義されている。 ここで \fIuc_link\fP は、 +現在のコンテキストが終了したとき、 続いて切り替わるコンテキストへのポインタである (現在のコンテキストが \fBmakecontext\fP(3) +で生成されたものの場合)。 \fIuc_sigmask\fP はこのコンテキストでブロックされている シグナル群である (\fBsigprocmask\fP(2) +を見よ)。 \fIuc_stack\fP はこのコンテキストが用いているスタックである (\fBsignalstack\fP(2) を見よ)。 +\fIuc_mcontext\fP は保存されているコンテキストの マシン特有の表現形式であり、 ここには呼び出したスレッドのマシンレジスタが格納される。 .LP -.\"O The function -.\"O .BR getcontext () -.\"O initializes the structure -.\"O pointed at by \fIucp\fP to the currently active context. -.BR getcontext () -関数は、 -ポインタ \fIucp\fP が指す構造体を、 -現在アクティブなコンテキストに初期化する。 +\fBgetcontext\fP() 関数は、 ポインタ \fIucp\fP が指す構造体を、 現在アクティブなコンテキストに初期化する。 .LP -.\"O The function -.\"O .BR setcontext () -.\"O restores the user context -.\"O pointed at by \fIucp\fP. -.\"O A successful call does not return. -.\"O The context should have been obtained by a call of -.\"O .BR getcontext (), -.\"O or -.\"O .BR makecontext (3), -.\"O or passed as third argument to a signal -.\"O handler. -.BR setcontext () -関数は、ポインタ -\fIucp\fP が指すユーザコンテキストをリストアする。 -呼び出しに成功すると返らない。 -このコンテキストは、以前に -.BR getcontext () -または -.BR makecontext (3) -で得られたものか、 +\fBsetcontext\fP() 関数は、ポインタ \fIucp\fP が指すユーザコンテキストをリストアする。 呼び出しに成功すると返らない。 +このコンテキストは、以前に \fBgetcontext\fP() または \fBmakecontext\fP(3) で得られたものか、 あるいはシグナルの第三引数として与えられたものになる。 .LP -.\"O If the context was obtained by a call of -.\"O .BR getcontext (), -.\"O program execution continues as if this call just returned. -コンテキストが -.BR getcontext () -の呼び出しによって得られていたものの場合は、 +コンテキストが \fBgetcontext\fP() の呼び出しによって得られていたものの場合は、 プログラムはこの呼び出しから返った直後からのように実行を継続する。 .LP -.\"O If the context was obtained by a call of -.\"O .BR makecontext 3(), -.\"O program execution continues by a call to the function \fIfunc\fP -.\"O specified as the second argument of that call to -.\"O .BR makecontext (3). -.\"O When the function \fIfunc\fP returns, we continue with the -.\"O \fIuc_link\fP member of the structure \fIucp\fP specified as the -.\"O first argument of that call to -.\"O .BR makecontext (3). -.\"O When this member is NULL, the thread exits. -コンテキストが -.BR makecontext (3) -の呼び出しによって得られていたものの場合は、 -プログラムの実行はその -.BR makecontext (3) -呼び出しの第二引数で指定された関数 \fIfunc\fP -を呼び出すかたちで継続する。 -\fIfunc\fP から返ると、 -.BR makecontext (3) -呼び出しの第一引数で指定されていた -\fIucp\fP 構造体の \fIuc_link\fP メンバで継続する。 -このメンバが NULL だった場合は、そのスレッドは終了する。 +コンテキストが \fBmakecontext\fP(3) の呼び出しによって得られていたものの場合は、 プログラムの実行はその +\fBmakecontext\fP(3) 呼び出しの第二引数で指定された関数 \fIfunc\fP を呼び出すかたちで継続する。 \fIfunc\fP から返ると、 +\fBmakecontext\fP(3) 呼び出しの第一引数で指定されていた \fIucp\fP 構造体の \fIuc_link\fP メンバで継続する。 このメンバが +NULL だった場合は、そのスレッドは終了する。 .LP -.\"O If the context was obtained by a call to a signal handler, -.\"O then old standard text says that "program execution continues with the -.\"O program instruction following the instruction interrupted -.\"O by the signal". -.\"O However, this sentence was removed in SUSv2, -.\"O and the present verdict is "the result is unspecified". -コンテキストがシグナルハンドラの呼び出しによって得られていたものの場合は、 -古い標準によれば -「プログラムの実行はシグナルによって割り込まれた命令の次の命令から継続される」。 -しかしこの文は SUSv2 で削除されたので、 +コンテキストがシグナルハンドラの呼び出しによって得られていたものの場合は、 古い標準によれば +「プログラムの実行はシグナルによって割り込まれた命令の次の命令から継続される」。 しかしこの文は SUSv2 で削除されたので、 現在の判断は「結果は定義されていない」である。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O When successful, -.\"O .BR getcontext () -.\"O returns 0 and -.\"O .BR setcontext () -.\"O does not return. -.\"O On error, both return \-1 and set \fIerrno\fP -.\"O appropriately. -成功すると、 -.BR getcontext () -は 0 を返し、 -.BR setcontext () -は返らない。 -失敗すると、両者とも \-1 を返し、\fIerrno\fP をエラーに応じて設定する。 -.\"O .SH ERRORS +成功すると、 \fBgetcontext\fP() は 0 を返し、 \fBsetcontext\fP() は返らない。 失敗すると、両者とも \-1 +を返し、\fIerrno\fP をエラーに応じて設定する。 .SH エラー -.\"O None defined. 定義されていない。 -.\"O .SH "CONFORMING TO" .SH 準拠 -SUSv2, POSIX.1-2001. -.\"O POSIX.1-2008 removes the specification of -.\"O .BR getcontext (), -.\"O citing portability issues, and -.\"O recommending that applications be rewritten to use POSIX threads instead. -POSIX.1-2008 では、移植性の問題から -.BR getcontext () -の仕様が削除された。 -代わりに、アプリケーションを POSIX スレッドを使って書き直すことが -推奨されている。 -.\"O .SH NOTES +SUSv2, POSIX.1\-2001. POSIX.1\-2008 では、移植性の問題から \fBgetcontext\fP() の仕様が削除された。 +代わりに、アプリケーションを POSIX スレッドを使って書き直すことが 推奨されている。 .SH 注意 -.\"O The earliest incarnation of this mechanism was the -.\"O .BR setjmp (3)/ longjmp (3) -.\"O mechanism. -.\"O Since that does not define -.\"O the handling of the signal context, the next stage was the -.\"O .BR sigsetjmp (3)/ siglongjmp (3) -.\"O pair. -.\"O The present mechanism gives much more control. -.\"O On the other hand, -.\"O there is no easy way to detect whether a return from -.\"O .BR getcontext () -.\"O is from the first call, or via a -.\"O .BR setcontext () -.\"O call. -.\"O The user has to invent her own bookkeeping device, and a register -.\"O variable won't do since registers are restored. -このメカニズムの最古の実装は、 -.BR setjmp (3)/ longjmp (3) -機構であった。 -これらにはシグナルコンテキストの取り扱いが定義されていなかったので、 -次の段階では -.BR sigsetjmp (3)/ siglongjmp (3) -のペアが現われた。 -現在の機構ではずっと細かな制御ができる。 -一方 -.BR getcontext () -から返ったとき、 -これが最初の呼び出しであったか、 -それとも -.BR setcontext () -呼び出しからのものであるかを -区別する容易な方法がなくなってしまった。 -ユーザは「しおり」機構を自分で作らなければならない。 -レジスタ変数は (レジスタはリストアされてしまうので) これをやってくれない。 +このメカニズムの最古の実装は、 \fBsetjmp\fP(3)/\fBlongjmp\fP(3) 機構であった。 +これらにはシグナルコンテキストの取り扱いが定義されていなかったので、 次の段階では \fBsigsetjmp\fP(3)/\fBsiglongjmp\fP(3) +のペアが現われた。 現在の機構ではずっと細かな制御ができる。 一方 \fBgetcontext\fP() から返ったとき、 これが最初の呼び出しであったか、 +それとも \fBsetcontext\fP() 呼び出しからのものであるかを 区別する容易な方法がなくなってしまった。 +ユーザは「しおり」機構を自分で作らなければならない。 レジスタ変数は (レジスタはリストアされてしまうので) これをやってくれない。 .LP -.\"O When a signal occurs, the current user context is saved and -.\"O a new context is created by the kernel for the signal handler. -.\"O Do not leave the handler using -.\"O .BR longjmp (3): -.\"O it is undefined what would happen with contexts. -.\"O Use -.\"O .BR siglongjmp (3) -.\"O or -.\"O .BR setcontext () -.\"O instead. -シグナルが発生すると、 -現在のユーザコンテキストは保存され、 -シグナルハンドラ用のコンテキストがカーネルによって生成される。 -今後はハンドラに -.BR longjmp (3) -を使わせないこと: -この関数のコンテキスト下での動作は定義されていない。 -代わりに -.BR siglongjmp (3) -か -.BR setcontext () -を使うこと。 -.\"O .SH "SEE ALSO" +シグナルが発生すると、 現在のユーザコンテキストは保存され、 シグナルハンドラ用のコンテキストがカーネルによって生成される。 今後はハンドラに +\fBlongjmp\fP(3) を使わせないこと: この関数のコンテキスト下での動作は定義されていない。 代わりに \fBsiglongjmp\fP(3) か +\fBsetcontext\fP() を使うこと。 .SH 関連項目 -.BR sigaction (2), -.BR sigaltstack (2), -.BR sigprocmask (2), -.BR longjmp (3), -.BR makecontext (3), -.BR sigsetjmp (3) +\fBsigaction\fP(2), \fBsigaltstack\fP(2), \fBsigprocmask\fP(2), \fBlongjmp\fP(3), +\fBmakecontext\fP(3), \fBsigsetjmp\fP(3) diff --git a/draft/man2/getcpu.2 b/draft/man2/getcpu.2 new file mode 100644 index 00000000..fe448b63 --- /dev/null +++ b/draft/man2/getcpu.2 @@ -0,0 +1,96 @@ +.\" This man page is Copyright (C) 2006 Andi Kleen . +.\" Permission is granted to distribute possibly modified copies +.\" of this page provided the header is included verbatim, +.\" and in case of nontrivial modification author and date +.\" of the modification is added to the header. +.\" 2008, mtk, various edits +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GETCPU 2 2008\-06\-03 Linux "Linux Programmer's Manual" +.SH 名前 +getcpu \- determine CPU and NUMA node on which the calling thread is running +.SH 書式 +.nf +\fB#include \fP +.sp +\fBint getcpu(unsigned *\fP\fIcpu\fP\fB, unsigned *\fP\fInode\fP\fB, struct getcpu_cache *\fP\fItcache\fP\fB);\fP +.fi +.SH 説明 +The \fBgetcpu\fP() system call identifies the processor and node on which the +calling thread or process is currently running and writes them into the +integers pointed to by the \fIcpu\fP and \fInode\fP arguments. The processor is a +unique small integer identifying a CPU. The node is a unique small +identifier identifying a NUMA node. When either \fIcpu\fP or \fInode\fP is NULL +nothing is written to the respective pointer. + +The third argument to this system call is nowadays unused. + +The information placed in \fIcpu\fP is only guaranteed to be current at the +time of the call: unless the CPU affinity has been fixed using +\fBsched_setaffinity\fP(2), the kernel might change the CPU at any time. +(Normally this does not happen because the scheduler tries to minimize +movements between CPUs to keep caches hot, but it is possible.) The caller +must be prepared to handle the situation when \fIcpu\fP and \fInode\fP are no +longer the current CPU and node. +.SH バージョン +\fBgetcpu\fP() was added in kernel 2.6.19 for x86_64 and i386. +.SH 準拠 +\fBgetcpu\fP() is Linux specific. +.SH 注意 +Linux makes a best effort to make this call as fast possible. The intention +of \fBgetcpu\fP() is to allow programs to make optimizations with per\-CPU data +or for NUMA optimization. + +Glibc does not provide a wrapper for this system call; call it using +\fBsyscall\fP(2); or use \fBsched_getcpu\fP(3) instead. + +.\" commit 4307d1e5ada595c87f9a4d16db16ba5edb70dcb1 +.\" Author: Ingo Molnar +.\" Date: Wed Nov 7 18:37:48 2007 +0100 +.\" x86: ignore the sys_getcpu() tcache parameter +.\" +.\" ===== Before kernel 2.6.24: ===== +.\" .I tcache +.\" is a pointer to a +.\" .IR "struct getcpu_cache" +.\" that is used as a cache by +.\" .BR getcpu (). +.\" The caller should put the cache into a thread-local variable +.\" if the process is multithreaded, +.\" because the cache cannot be shared between different threads. +.\" .I tcache +.\" can be NULL. +.\" If it is not NULL +.\" .BR getcpu () +.\" will use it to speed up operation. +.\" The information inside the cache is private to the system call +.\" and should not be accessed by the user program. +.\" The information placed in the cache can change between kernel releases. +.\" +.\" When no cache is specified +.\" .BR getcpu () +.\" will be slower, +.\" but always retrieve the current CPU and node information. +.\" With a cache +.\" .BR getcpu () +.\" is faster. +.\" However, the cached information is only updated once per jiffy (see +.\" .BR time (7)). +.\" This means that the information could theoretically be out of date, +.\" although in practice the scheduler's attempt to maintain +.\" soft CPU affinity means that the information is unlikely to change +.\" over the course of the caching interval. +The \fItcache\fP argument is unused since Linux 2.6.24. In earlier kernels, if +this argument was non\-NULL, then it specified a pointer to a +caller\-allocated buffer in thread\-local storage that was used to provide a +caching mechanism for \fBgetcpu\fP(). Use of the cache could speed \fBgetcpu\fP() +calls, at the cost that there was a very small chance that the returned +information would be out of date. The caching mechanism was considered to +cause problems when migrating threads between CPUs, and so the argument is +now ignored. +.SH 関連項目 +\fBmbind\fP(2), \fBsched_setaffinity\fP(2), \fBset_mempolicy\fP(2), +\fBsched_getcpu\fP(3), \fBcpuset\fP(7) diff --git a/draft/man2/getdents.2 b/draft/man2/getdents.2 deleted file mode 100644 index 27c26ea2..00000000 --- a/draft/man2/getdents.2 +++ /dev/null @@ -1,376 +0,0 @@ -.\" Copyright (C) 1995 Andries Brouwer (aeb@cwi.nl) -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" Written 11 June 1995 by Andries Brouwer -.\" Modified 22 July 1995 by Michael Chastain : -.\" Derived from 'readdir.2'. -.\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond -.\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Sat Feb 22 20:15:56 JST 1997 -.\" by HANATAKA Shinya -.\" Updated Sun Oct 12 JST 2003 by Kentaro Shirakata -.\" Updated Wed Jul 30 JST 2008 by Kentaro Shirakata -.\" Updated 2009-02-12 by Kentaro Shirakata -.\" -.\"WORD: directory ディレクトリ -.\"WORD: entry エントリ -.\"WORD: memory area メモリ領域 -.\"WORD: parameter パラメーター -.\"WORD: inode number inode 番号 -.\"WORD: null ヌル文字 -.\" -.TH GETDENTS 2 2009-07-04 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O getdents \- get directory entries -getdents \- ディレクトリ・エントリを取得する -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.BI "int getdents(unsigned int " fd ", struct linux_dirent *" dirp , -.BI " unsigned int " count ); -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O This is not the function you are interested in. -.\"O Look at -.\"O .BR readdir (3) -.\"O for the POSIX conforming C library interface. -.\"O This page documents the bare kernel system call interface. -これはあなたの関心を引くような関数ではない。 -POSIX 準拠の C ライブラリインターフェースについては -.BR readdir (3) -を見ること。 -このページは、カーネルシステムコールの生のインターフェースについて -記載したものである。 -.PP -.\"O The system call -.\"O .BR getdents () -.\"O reads several -.\"O .I linux_dirent -.\"O structures from the directory -.\"O referred to by the open file descriptor -.\"O .I fd -.\"O into the buffer pointed to by -.\"O .IR dirp . -.\"O The argument -.\"O .I count -.\"O specifies the size of that buffer. -.BR getdents () -システムコールは、オープン済みのファイル記述子 -.I fd -で参照されるディレクトリから -.I linux_dirent -構造体をいくつか読み出し、 -.I dirp -が指しているバッファに格納する。 -.I count -引き数はそのバッファのサイズを示す。 -.PP -.\"O The -.\"O .I linux_dirent -.\"O structure is declared as follows: -.I linux_dirent -構造体は以下のように宣言されている: -.PP -.in +4n -.nf -struct linux_dirent { - unsigned long d_ino; /* Inode number */ - unsigned long d_off; /* Offset to next \fIlinux_dirent\fP */ - unsigned short d_reclen; /* Length of this \fIlinux_dirent\fP */ - char d_name[]; /* Filename (null-terminated) */ - /* length is actually (d_reclen \- 2 \- - offsetof(struct linux_dirent, d_name) */ - /* - char pad; // Zero padding byte - char d_type; // File type (only since Linux 2.6.4; - // offset is (d_reclen \- 1)) - */ - -} -.fi -.in -.PP -.\"O .I d_ino -.\"O is an inode number. -.\"O .I d_off -.\"O is the distance from the start of the directory to the start of the next -.\"O .IR linux_dirent . -.\"O .I d_reclen -.\"O is the size of this entire -.\"O .IR linux_dirent . -.\"O .I d_name -.\"O is a null-terminated filename. -.I d_ino -は inode 番号である。 -.I d_off -はディレクトリの先頭から次の -.I linux_dirent -の先頭までの距離である。 -.I d_reclen -はこの -.I linux_dirent -全体のサイズである。 -.I d_name -はヌル(null)文字で終わるファイル名である。 - -.\"O .I d_type -.\"O is a byte at the end of the structure that indicates the file type. -.\"O It contains one of the following values (defined in -.\"O .IR ): -.I d_type -は、構造体の最後のバイトであり、ファイルタイプを示す。 -.I d_type -は以下の値の一つを取る -.RI ( -で定義されている)。 -.TP 12 -.B DT_BLK -.\"O This is a block device. -ブロックデバイスである。 -.TP -.B DT_CHR -.\"O This is a character device. -キャラクタデバイスである。 -.TP -.B DT_DIR -.\"O This is a directory. -ディレクトリである。 -.TP -.B DT_FIFO -.\"O This is a named pipe (FIFO). -名前つきパイプ (FIFO) である。 -.TP -.B DT_LNK -.\"O This is a symbolic link. -シンボリックリンクである。 -.TP -.B DT_REG -.\"O This is a regular file. -通常のファイルである。 -.TP -.B DT_SOCK -.\"O This is a UNIX domain socket. -UNIX ドメインソケットである。 -.TP -.B DT_UNKNOWN -.\"O The file type is unknown. -ファイルタイプは不明である。 -.PP -.\"O The -.\"O .I d_type -.\"O field is implemented since Linux 2.6.4. -.\"O It occupies a space that was previously a zero-filled padding byte in the -.\"O .IR linux_dirent -.\"O structure. -.\"O Thus, on kernels before 2.6.3, -.\"O attempting to access this field always provides the value 0 -.\"O .RB ( DT_UNKNOWN ). -.I d_type -フィールドは Linux 2.6.4 から実装されている。 -これは -.I linux_dirent -構造体のうち、以前はゼロで埋められていた空間に配置されている。 -従って、2.6.3 以前のカーネルでは、このフィールドにアクセスしようとすると -常に値 0 -.RB ( DT_UNKNOWN ) -が返される。 -.PP -.\"O Currently, -.\"O .\" kernel 2.6.27 -.\"O .\" The same sentence is in readdir.2 -.\"O only some file systems (among them: Btrfs, ext2, etx3, and ext4) -.\"O have full support for returning the file type in -.\"O .IR d_type . -.\"O All applications must properly handle a return of -.\"O .BR DT_UNKNOWN . -現在のところ、 -.\" カーネル 2.6.27 -.\" 同じ説明文が readdir.2 にもある。 -.I d_type -でファイルタイプを返す機能が完全にサポートされているのは、 -いくつかのファイルシステムにおいてのみである -(Btrfs, ext2, ext3, ext4 はサポートしている)。 -どのアプリケーションも、 -.B DT_UNKNOWN -が返された際に適切に処理できなければならない。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success, the number of bytes read is returned. -.\"O On end of directory, 0 is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合は、読み込んだバイト数が返される。 -ディレクトリの終わりならば 0 が返される。 -エラーの場合は \-1 を返され、 -.I errno -に適切な値が設定される。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EBADF -.\"O Invalid file descriptor -.\"O .IR fd . -ファイル記述子 -.I fd -は無効である。 -.TP -.B EFAULT -.\"O Argument points outside the calling process's address space. -引き数が、呼び出したプロセスのアドレス空間外を指している。 -.TP -.B EINVAL -.\"O Result buffer is too small. -結果用のバッファーが小さすぎる。 -.TP -.B ENOENT -.\"O No such directory. -そのようなディレクトリは存在しない。 -.TP -.B ENOTDIR -.\"O File descriptor does not refer to a directory. -ファイル記述子がディレクトリを参照していない。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -SVr4. -.\"O .\" SVr4 documents additional ENOLINK, EIO error conditions. -.\" SVr4 では、他に ENOLINK, EIO エラー状態についても記述されている。 -.\"O .SH NOTES -.SH 注意 -.\"O Glibc does not provide a wrapper for this system call; call it using -.\"O .BR syscall (2). -.\"O You will need to define the -.\"O .I linux_dirent -.\"O structure yourself. -glibc はこのシステムコールに対するラッパー関数を提供していないので、 -.BR syscall (2) -を使って呼び出すこと。 -.I linux_dirent -構造体は自分で定義する必要がある。 - -.\"O This call supersedes -.\"O .BR readdir (2). -このシステムコールは -.BR readdir (2) -を置き換えるものである。 -.\"O .SH EXAMPLE -.SH 例 -.\"O The program below demonstrates the use of -.\"O .BR getdents (). -.\"O The following output shows an example of what we see when running this -.\"O program on an ext2 directory: -下記のプログラムは -.BR getdents () -の使用例を示したものである。 -以下は、このプログラムを ext2 ディレクトリで実行した際に得られる -出力の例である。 - -.in +4n -.nf -.RB "$" " ./a.out /testfs/" ---------------- nread=120 --------------- -i-node# file type d_reclen d_off d_name - 2 directory 16 12 . - 2 directory 16 24 .. - 11 directory 24 44 lost+found - 12 regular 16 56 a - 228929 directory 16 68 sub - 16353 directory 16 80 sub2 - 130817 directory 16 4096 sub3 -.fi -.in -.\"O .SS Program source -.SS プログラムのソース -\& -.nf -#define _GNU_SOURCE -#include /* Defines DT_* constants */ -#include -#include -#include -#include -#include -#include - -#define handle_error(msg) \\ - do { perror(msg); exit(EXIT_FAILURE); } while (0) - -struct linux_dirent { - long d_ino; - off_t d_off; - unsigned short d_reclen; - char d_name[]; -}; - -#define BUF_SIZE 1024 - -int -main(int argc, char *argv[]) -{ - int fd, nread; - char buf[BUF_SIZE]; - struct linux_dirent *d; - int bpos; - char d_type; - - fd = open(argc > 1 ? argv[1] : ".", O_RDONLY | O_DIRECTORY); - if (fd == \-1) - handle_error("open"); - - for ( ; ; ) { - nread = syscall(SYS_getdents, fd, buf, BUF_SIZE); - if (nread == \-1) - handle_error("getdents"); - - if (nread == 0) - break; - - printf("\--------------- nread=%d ---------------\\n", nread); - printf("i\-node# file type d_reclen d_off d_name\\n"); - for (bpos = 0; bpos < nread;) { - d = (struct linux_dirent *) (buf + bpos); - printf("%8ld ", d\->d_ino); - d_type = *(buf + bpos + d\->d_reclen - 1); - printf("%\-10s ", (d_type == DT_REG) ? "regular" : - (d_type == DT_DIR) ? "directory" : - (d_type == DT_FIFO) ? "FIFO" : - (d_type == DT_SOCK) ? "socket" : - (d_type == DT_LNK) ? "symlink" : - (d_type == DT_BLK) ? "block dev" : - (d_type == DT_CHR) ? "char dev" : "???"); - printf("%4d %10lld %s\\n", d\->d_reclen, - (long long) d\->d_off, (char *) d->d_name); - bpos += d\->d_reclen; - } - } - - exit(EXIT_SUCCESS); -} -.fi -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR readdir (2), -.BR readdir (3) diff --git a/draft/man2/getdomainname.2 b/draft/man2/getdomainname.2 index 80f94403..d2e7d9e3 100644 --- a/draft/man2/getdomainname.2 +++ b/draft/man2/getdomainname.2 @@ -22,188 +22,72 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Modified 1997-08-25 by Nicolas Lichtmaier +.\" Modified 1997-08-25 by Nicolás Lichtmaier .\" Modified 2004-06-17 by Michael Kerrisk .\" Modified 2008-11-27 by mtk .\" -.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki -.\" all rights reserved. -.\" Translated 1997-06-27, SUTO, Mitsuaki -.\" Updated 2000-10-03, Yuichi SATO -.\" Updated & Modified 2004-12-29, Yuichi SATO -.\" Updated 2008-12-26, Akihiro MOTOKI , LDP v3.15 +.\"******************************************************************* .\" -.TH GETDOMAINNAME 2 2009-09-27 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GETDOMAINNAME 2 2009\-09\-27 Linux "Linux Programmer's Manual" .SH 名前 -.\"O getdomainname, setdomainname \- get/set domain name getdomainname, setdomainname \- ドメイン名の取得・設定をする -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int getdomainname(char *" name ", size_t " len ); +\fBint getdomainname(char *\fP\fIname\fP\fB, size_t \fP\fIlen\fP\fB);\fP .br -.BI "int setdomainname(const char *" name ", size_t " len ); +\fBint setdomainname(const char *\fP\fIname\fP\fB, size_t \fP\fIlen\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR getdomainname (), -.BR setdomainname (): +\fBgetdomainname\fP(), \fBsetdomainname\fP(): .RS 4 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O These functions are used to access or to change the domain name of the -.\"O host system. これらの関数は、ホストシステムのドメイン名を取得・変更するために使われる。 -.\"O .BR setdomainname () -.\"O sets the domain name to the value given in the character array -.\"O .IR name . -.\"O The -.\"O .I len -.\"O argument specifies the number of bytes in -.\"O .IR name . -.\"O (Thus, -.\"O .I name -.\"O does not require a terminating null byte.) -.BR setdomainname () -は、ドメイン名を、文字配列 -.I name -で指定された値に設定する。 -引き数 -.I len -には、 -.I name -のバイト数を指定する -(そのため、 -.I name -では文字列終端の NULL バイトは必要ない)。 +\fBsetdomainname\fP() は、ドメイン名を、文字配列 \fIname\fP で指定された値に設定する。 引き数 \fIlen\fP には、 +\fIname\fP のバイト数を指定する (そのため、 \fIname\fP では文字列終端の NULL バイトは必要ない)。 -.\"O .BR getdomainname () -.\"O returns the null-terminated domain name in the character array -.\"O .IR name , -.\"O which has a length of -.\"O .I len -.\"O bytes. -.\"O If the null-terminated domain name requires more than \fIlen\fP bytes, -.\"O .BR getdomainname () -.\"O returns the first \fIlen\fP bytes (glibc) or gives an error (libc). -.BR getdomainname () -は、NULL 終端されたドメイン名を、 -.I len -バイトの長さの文字配列 -.I name -に格納して返す。 -NULL 終端されたドメイン名が \fIlen\fP バイトより長い場合、 -.BR getdomainname () -は、(glibc では) 始めの \fIlen\fP バイトを返し、(libc では) エラーとなる。 -.\"O .SH "RETURN VALUE" +\fBgetdomainname\fP() は、NULL 終端されたドメイン名を、 \fIlen\fP バイトの長さの文字配列 \fIname\fP に格納して返す。 +NULL 終端されたドメイン名が \fIlen\fP バイトより長い場合、 \fBgetdomainname\fP() は、(glibc では) 始めの +\fIlen\fP バイトを返し、(libc では) エラーとなる。 .SH 返り値 -.\"O On success, zero is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合 0 が返る。失敗した場合 \-1 が返り、 -.I errno -がエラーの内容に従って設定される。 -.\"O .SH ERRORS +成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.\"O .BR setdomainname () -.\"O can fail with the following errors: -.BR setdomainname () -は以下のエラーで失敗する可能性がある。 -.TP -.B EFAULT -.\"O .I name -.\"O pointed outside of user address space. -.I name -がユーザアドレス空間の外を指した。 -.TP -.B EINVAL -.\"O .I len -.\"O was negative or too large. -.I len -が負であるか、長すぎる。 -.TP -.B EPERM -.\"O the caller is unprivileged (Linux: does not have the -.\"O .B CAP_SYS_ADMIN -.\"O capability). -.BR setdomainname () -において、呼び出した人に特権がない -(Linux では -.B CAP_SYS_ADMIN -ケーパビリティ (capability) がない)。 +\fBsetdomainname\fP() は以下のエラーで失敗する可能性がある。 +.TP +\fBEFAULT\fP +\fIname\fP がユーザアドレス空間の外を指した。 +.TP +\fBEINVAL\fP +\fIlen\fP が負であるか、長すぎる。 +.TP +\fBEPERM\fP +\fBsetdomainname\fP() において、呼び出した人に特権がない (Linux では \fBCAP_SYS_ADMIN\fP ケーパビリティ +(capability) がない)。 .PP -.\"O .BR getdomainname () -.\"O can fail with the following errors: -.BR getdomainname () -は以下のエラーで失敗する可能性がある。 -.TP -.B EINVAL -.\"O For -.\"O .BR getdomainname () -.\"O under libc: -.\"O .I name -.\"O is NULL or -.\"O .I name -.\"O is longer than -.\"O .I len -.\"O bytes. -libc での -.BR getdomainname () -において、 -.I name -が NULL ポインタであるか、 -.I len -バイトより長い。 -.\"O .SH "CONFORMING TO" +\fBgetdomainname\fP() は以下のエラーで失敗する可能性がある。 +.TP +\fBEINVAL\fP +libc での \fBgetdomainname\fP() において、 \fIname\fP が NULL ポインタであるか、 \fIlen\fP バイトより長い。 .SH 準拠 -.\"O POSIX does not specify these calls. -.\"O .\" But they appear on most systems... +.\" But they appear on most systems... POSIX では、これら関数は定義されていない。 -.\" しかし、ほとんどのシステムにある... -.\"O .SH NOTES .SH 注意 -.\"O Since Linux 1.0, the limit on the length of a domain name, -.\"O including the terminating null byte, is 64 bytes. -.\"O In older kernels, it was 8 bytes. -Linux 1.0 以降では、ドメイン名の長さの上限は -終端の NULL バイトを含めて 64 バイトである。 -もっと古いカーネルでは 8 バイトであった。 +Linux 1.0 以降では、ドメイン名の長さの上限は 終端の NULL バイトを含めて 64 バイトである。 もっと古いカーネルでは 8 +バイトであった。 -.\"O On most Linux architectures (including x86), -.\"O there is no -.\"O .BR getdomainname () -.\"O system call; instead, glibc implements -.\"O .BR getdomainname () -.\"O as a library function that returns a copy of the -.\"O .I domainname -.\"O field returned from a call to -.\"O .BR uname (2). -(x86 を含む) Linux のほとんどのアーキテクチャでは、 -.BR getdomainname () -というシステムコールは存在しない。 -その代わり、glibc で -.BR getdomainname () -がライブラリ関数として実装されており、この関数は -.BR uname (2) -の呼び出しで返された -.I domainname -フィールドのコピーを返す。 -.\"O .SH "SEE ALSO" +(x86 を含む) Linux のほとんどのアーキテクチャでは、 \fBgetdomainname\fP() というシステムコールは存在しない。 +その代わり、glibc で \fBgetdomainname\fP() がライブラリ関数として実装されており、この関数は \fBuname\fP(2) +の呼び出しで返された \fIdomainname\fP フィールドのコピーを返す。 .SH 関連項目 -.BR gethostname (2), -.BR sethostname (2), -.BR uname (2) +\fBgethostname\fP(2), \fBsethostname\fP(2), \fBuname\fP(2) diff --git a/draft/man2/getdtablesize.2 b/draft/man2/getdtablesize.2 index a152990f..824ebcac 100644 --- a/draft/man2/getdtablesize.2 +++ b/draft/man2/getdtablesize.2 @@ -24,122 +24,52 @@ .\" .\" Modified 2002-04-15 by Roger Luethi and aeb .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Sat Feb 22 20:20:24 JST 1997 -.\" by HANATAKA Shinya -.\" Updated 2002-10-14 by Kentaro Shirakata -.\" Updated 2007-01-01 by Kentaro Shirakata +.\"******************************************************************* .\" -.TH GETDTABLESIZE 2 2010-09-20 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GETDTABLESIZE 2 2010\-09\-20 Linux "Linux Programmer's Manual" .SH 名前 -.\"O getdtablesize \- get descriptor table size getdtablesize \- ディスクリプタ・テーブルのサイズを取得する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.B int getdtablesize(void); +\fBint getdtablesize(void);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR getdtablesize (): +\fBgetdtablesize\fP(): .ad l .RS 4 .PD 0 -.TP 4 -.\"O Since glibc 2.12: +.TP 4 glibc 2.12 以降: .nf _BSD_SOURCE || !(_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600) +.TP 4 .fi -.TP 4 -.\"O Before glibc 2.12: -glibc 2.12 より前: -_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +glibc 2.12 より前: _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .PD .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR getdtablesize () -.\"O returns the maximum number of files a process can have open, -.\"O one more than the largest possible value for a file descriptor. -.BR getdtablesize () -は 1 つのプロセスのオープンできるファイル数の最大値を返す。 +\fBgetdtablesize\fP() は 1 つのプロセスのオープンできるファイル数の最大値を返す。 返り値はファイルディスクリプタの取り得る最大値より 1 大きい値である。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O The current limit on the number of open files per process. プロセス毎にオープンできるファイル数の現在の制限値。 -.\"O .SH ERRORS .SH エラー -.\"O On Linux, -.\"O .BR getdtablesize () -.\"O can return any of the errors described for -.\"O .BR getrlimit (2); -.\"O see NOTES below. -Linux では、 -.BR getdtablesize () -は -.BR getrlimit (2) -で説明されているエラーを返すことがある。 +Linux では、 \fBgetdtablesize\fP() は \fBgetrlimit\fP(2) で説明されているエラーを返すことがある。 下記の「注意」を参照のこと。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O SVr4, 4.4BSD (the -.\"O .BR getdtablesize () -.\"O function first appeared in 4.2BSD). -SVr4, 4.4BSD -.RB ( getdtablesize () -関数は 4.2BSD で最初に現われた)。 -.\"O It is not specified in POSIX.1-2001; -.\"O portable applications should employ -.\"O .I sysconf(_SC_OPEN_MAX) -.\"O instead of this call. -これは POSIX.1-2001 で規定されていないので、 -移植性のあるアプリケーションはこの呼び出しの代わりに -.I sysconf(_SC_OPEN_MAX) -を使うべきである。 -.\"O .SH NOTES +SVr4, 4.4BSD (\fBgetdtablesize\fP() 関数は 4.2BSD で最初に現われた)。 これは POSIX.1\-2001 +で規定されていないので、 移植性のあるアプリケーションはこの呼び出しの代わりに \fIsysconf(_SC_OPEN_MAX)\fP を使うべきである。 .SH 注意 -.\"O .BR getdtablesize () -.\"O is implemented as a libc library function. -.\"O The glibc version calls -.\"O .BR getrlimit (2) -.\"O and returns the current -.\"O .B RLIMIT_NOFILE -.\"O limit, or -.\"O .B OPEN_MAX -.\"O when that fails. -.BR getdtablesize () -は libc のライブラリ関数として実装されている。glibc 版は -.BR getrlimit (2) -を呼び出して、現在の -.B RLIMIT_NOFILE -を返す。 -呼び出しに失敗した場合は -.B OPEN_MAX -を返す。 -.\"O The libc4 and libc5 versions return -.\"O .B OPEN_MAX -.\"O (set to 256 since Linux 0.98.4). -libc4 と libc5 では -.B OPEN_MAX -(Linux 0.98.4 以降では 256 に設定されている) -を返す。 -.\"O .SH "SEE ALSO" +\fBgetdtablesize\fP() は libc のライブラリ関数として実装されている。glibc 版は \fBgetrlimit\fP(2) +を呼び出して、現在の \fBRLIMIT_NOFILE\fP を返す。 呼び出しに失敗した場合は \fBOPEN_MAX\fP を返す。 libc4 と libc5 +では \fBOPEN_MAX\fP (Linux 0.98.4 以降では 256 に設定されている) を返す。 .SH 関連項目 -.BR close (2), -.BR dup (2), -.BR getrlimit (2), -.BR open (2) +\fBclose\fP(2), \fBdup\fP(2), \fBgetrlimit\fP(2), \fBopen\fP(2) diff --git a/draft/man2/gethostname.2 b/draft/man2/gethostname.2 index bf6e33b0..f1ae3e38 100644 --- a/draft/man2/gethostname.2 +++ b/draft/man2/gethostname.2 @@ -9,7 +9,6 @@ .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this @@ -30,285 +29,84 @@ .\" Modified 2004-06-17 by mtk .\" Modified 2008-11-27 by mtk .\" -.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki -.\" all rights reserved. -.\" Translated 1997-06-27, SUTO, Mitsuaki -.\" Updated 2000-09-30, Yuichi SATO -.\" Updated & Modified 2002-01-14, Yuichi SATO -.\" Updated & Modified 2004-12-30, Yuichi SATO -.\" Updated & Modified 2006-01-31, Akihiro MOTOKI -.\" Updated 2008-12-26, Akihiro MOTOKI, LDP v3.15 +.\"******************************************************************* .\" -.TH GETHOSTNAME 2 2010-09-26 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GETHOSTNAME 2 2010\-09\-26 Linux "Linux Programmer's Manual" .SH 名前 -.\"O gethostname, sethostname \- get/set hostname gethostname, sethostname \- ホスト名の取得・設定をする -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int gethostname(char *" name ", size_t " len ); +\fBint gethostname(char *\fP\fIname\fP\fB, size_t \fP\fIlen\fP\fB);\fP .br -.BI "int sethostname(const char *" name ", size_t " len ); +\fBint sethostname(const char *\fP\fIname\fP\fB, size_t \fP\fIlen\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l .PD 0 -.BR gethostname (): +\fBgethostname\fP(): .RS 4 -.\"O Since glibc 2.12: -glibc 2.12 以降: -_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 +glibc 2.12 以降: _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 .br -.\"O || /* Since glibc 2.12: */ _POSIX_C_SOURCE\ >=\ 200112L || /* glibc 2.12 以降: */ _POSIX_C_SOURCE\ >=\ 200112L .RE .br -.BR sethostname (): +\fBsethostname\fP(): .RS 4 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) .RE .PD .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O These system calls are used to access or to change the hostname of the -.\"O current processor. -これらのシステムコールは、現在のプロセッサのホスト名を取得・変更するために -使用される。 +これらのシステムコールは、現在のプロセッサのホスト名を取得・変更するために 使用される。 -.\"O .BR sethostname () -.\"O sets the hostname to the value given in the character array -.\"O .IR name . -.\"O The -.\"O .I len -.\"O argument specifies the number of bytes in -.\"O .IR name . -.\"O (Thus, -.\"O .I name -.\"O does not require a terminating null byte.) -.BR sethostname () -は、ホスト名を、文字配列 -.I name -で指定された値に設定する。 -引き数 -.I len -には、 -.I name -のバイト数を指定する -(そのため、 -.I name -では文字列終端の NULL バイトは必要ない)。 +\fBsethostname\fP() は、ホスト名を、文字配列 \fIname\fP で指定された値に設定する。 引き数 \fIlen\fP には、 \fIname\fP +のバイト数を指定する (そのため、 \fIname\fP では文字列終端の NULL バイトは必要ない)。 -.\"O .BR gethostname () -.\"O returns the null-terminated hostname in the character array -.\"O .IR name , -.\"O which has a length of -.\"O .I len -.\"O bytes. -.\"O If the null-terminated hostname is too large to fit, -.\"O then the name is truncated, and no error is returned (but see NOTES below). -.\"O POSIX.1-2001 says that if such truncation occurs, -.\"O then it is unspecified whether the returned buffer -.\"O includes a terminating null byte. -.BR gethostname () -は、NULL 終端されたホスト名を、 -.I len -バイトの長さの文字配列 -.I name -に格納して返す。 -NULL 終端されたホスト名が格納先のバッファよりも長い場合は、 -ホスト名は切り詰められ、エラーは返されない (下記の「注意」の節を参照)。 -POSIX.1-2001 では、結果の切り詰めが発生した場合に、 -返されたバッファに終端の NULL バイトが含まれているかどうかは -規定されていない。 -.\"O .SH "RETURN VALUE" +\fBgethostname\fP() は、NULL 終端されたホスト名を、 \fIlen\fP バイトの長さの文字配列 \fIname\fP に格納して返す。 +NULL 終端されたホスト名が格納先のバッファよりも長い場合は、 ホスト名は切り詰められ、エラーは返されない (下記の「注意」の節を参照)。 +POSIX.1\-2001 では、結果の切り詰めが発生した場合に、 返されたバッファに終端の NULL バイトが含まれているかどうかは 規定されていない。 .SH 返り値 -.\"O On success, zero is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合 0 が返る。失敗した場合 \-1 が返り、 -.I errno -がエラーの内容に従って設定される。 -.\"O .SH ERRORS +成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP -.B EFAULT -.\"O .I name -.\"O is an invalid address. -.I name -が不正なアドレスである。 -.TP -.B EINVAL -.\"O .I len -.\"O is negative -.\"O .\" Can't occur for gethostbyname() wrapper, since 'len' has an -.\"O .\" unsigned type; can occur for the underlying system call. -.\"O or, for -.\"O .BR sethostname (), -.\"O .I len -.\"O is larger than the maximum allowed size. -.I len -が負である。 -.\" gethostbyname() ラッパー関数では、'len' は unsigned 型なので -.\" このエラーが発生することはない。 -.\" その中で呼ばれるシステムコールでは発生することがある。 -.BR sethostname () -において -.I len -が許容された最大サイズを越えている。 -.TP -.B ENAMETOOLONG -.\"O .RB "(glibc " gethostname ()) -.\"O .I len -.\"O is smaller than the actual size. -.\"O (Before version 2.1, glibc uses -.\"O .BR EINVAL -.\"O for this case.) -.RB "(glibc " gethostname () -で) -.I len -が実際のホスト名の長さよりも小さい -(glibc バージョン 2.1 より前では、この状況で -.B EINVAL -が使用される)。 -.TP -.B EPERM -.\"O For -.\"O .BR sethostname (), -.\"O the caller did not have the -.\"O .B CAP_SYS_ADMIN -.\"O capability. -.BR sethostname () -において、呼び出した人が -.B CAP_SYS_ADMIN -ケーパビリティ (capability) を持っていなかった。 -.\"O .SH "CONFORMING TO" +.TP +\fBEFAULT\fP +\fIname\fP が不正なアドレスである。 +.TP +\fBEINVAL\fP +.\" Can't occur for gethostbyname() wrapper, since 'len' has an +.\" unsigned type; can occur for the underlying system call. +\fIlen\fP が負である。 \fBsethostname\fP() において \fIlen\fP が許容された最大サイズを越えている。 +.TP +\fBENAMETOOLONG\fP +(glibc \fBgethostname\fP() で) \fIlen\fP が実際のホスト名の長さよりも小さい (glibc バージョン 2.1 +より前では、この状況で \fBEINVAL\fP が使用される)。 +.TP +\fBEPERM\fP +\fBsethostname\fP() において、呼び出した人が \fBCAP_SYS_ADMIN\fP ケーパビリティ (capability) +を持っていなかった。 .SH 準拠 -.\"O SVr4, 4.4BSD (these interfaces first appeared in 4.2BSD). -.\"O POSIX.1-2001 specifies -.\"O .BR gethostname () -.\"O but not -.\"O .BR sethostname (). -SVr4, 4.4BSD (これらのインタフェースは 4.2BSD で初めて登場した)。 -POSIX.1-2001 では -.BR gethostname () -については規定しているが、 -.BR sethostname () -は規定していない。 -.\"O .SH NOTES +SVr4, 4.4BSD (これらのインタフェースは 4.2BSD で初めて登場した)。 POSIX.1\-2001 では +\fBgethostname\fP() については規定しているが、 \fBsethostname\fP() は規定していない。 .SH 注意 -.\"O SUSv2 guarantees that "Host names are limited to 255 bytes". -.\"O POSIX.1-2001 guarantees that "Host names (not including -.\"O the terminating null byte) are limited to -.\"O .B HOST_NAME_MAX -.\"O bytes". -SUSv2 では「ホスト名が 255 バイトに制限される」ことを保証している。 -POSIX.1-2001 では「ホスト名 (終端の NULL バイトは含まない) が -.B HOST_NAME_MAX -バイトに制限される」ことを保証している。 -.\"O On Linux, -.\"O .B HOST_NAME_MAX -.\"O is defined with the value 64, which has been the limit since Linux 1.0 -.\"O (earlier kernels imposed a limit of 8 bytes). -Linux では、 -.B HOST_NAME_MAX -は 64 に定義されており、 -Linux 1.0 以降ではこれが上限となってきた -(もっと古いカーネルでは 8 バイトの上限が適用されていた)。 -.\"O .SS Glibc Notes +SUSv2 では「ホスト名が 255 バイトに制限される」ことを保証している。 POSIX.1\-2001 では「ホスト名 (終端の NULL +バイトは含まない) が \fBHOST_NAME_MAX\fP バイトに制限される」ことを保証している。 Linux では、 \fBHOST_NAME_MAX\fP +は 64 に定義されており、 Linux 1.0 以降ではこれが上限となってきた (もっと古いカーネルでは 8 バイトの上限が適用されていた)。 .SS "glibc での注意" -.\"O The GNU C library does not employ the -.\"O .BR gethostname () -.\"O system call; instead, it implements -.\"O .BR gethostname () -.\"O as a library function that calls -.\"O .BR uname (2) -.\"O and copies up to -.\"O .I len -.\"O bytes from the returned -.\"O .I nodename -.\"O field into -.\"O .IR name . -GNU C ライブラリは、 -.BR gethostname () -システムコールを利用していない。その代わり、 -.BR gethostname () -をライブラリ関数として実装しており、 -この関数は -.BR uname (2) -を呼び出し、 -.BR uname (2) -が返した -.I nodename -フィールド (の最大 -.I len -バイト) を -.I name -にコピーする。 -.\"O Having performed the copy, the function then checks if the length of the -.\"O .I nodename -.\"O was greater than or equal to -.\"O .IR len , -.\"O and if it is, then the function returns \-1 with -.\"O .I errno -.\"O set to -.\"O .BR ENAMETOOLONG ; -.\"O in this case, a terminating null byte is not included in the returned -.\"O .IR name . -コピーを行った際に、この関数は -.I nodename -の長さが -.I len -以上かの確認を行い、 -.I len -以上の場合には \-1 を返し、 -.I errno -に -.B ENAMETOOLONG -を設定する。 -この場合、返された -.I name -には終端の NULL バイトは含まれない。 +GNU C ライブラリは、 \fBgethostname\fP() システムコールを利用していない。その代わり、 \fBgethostname\fP() +をライブラリ関数として実装しており、 この関数は \fBuname\fP(2) を呼び出し、 \fBuname\fP(2) が返した \fInodename\fP +フィールド (の最大 \fIlen\fP バイト) を \fIname\fP にコピーする。 コピーを行った際に、この関数は \fInodename\fP の長さが +\fIlen\fP 以上かの確認を行い、 \fIlen\fP 以上の場合には \-1 を返し、 \fIerrno\fP に \fBENAMETOOLONG\fP を設定する。 +この場合、返された \fIname\fP には終端の NULL バイトは含まれない。 -.\"O Versions of glibc before 2.2 -.\"O .\" At least glibc 2.0 and 2.1, older versions not checked -.\"O handle the case where the length of the -.\"O .I nodename -.\"O was greater than or equal to -.\"O .I len -.\"O differently: nothing is copied into -.\"O .I name -.\"O and the function returns \-1 with -.\"O .I errno -.\"O set to -.\"O .BR ENAMETOOLONG . -バージョン 2.2 より前の glibc -.\" 少なくとも glibc 2.0 と 2.1。それより古いバージョンは未確認 -では、 -.I nodename -の長さが -.I len -以上の場合の扱いが異なる; -.I len -以上の場合には、 -.I name -には何もコピーせず、関数は \-1 を返し、 -.I errno -に -.B ENAMETOOLONG -を設定する。 -.\"O .SH "SEE ALSO" +.\" At least glibc 2.0 and 2.1, older versions not checked +バージョン 2.2 より前の glibc では、 \fInodename\fP の長さが \fIlen\fP 以上の場合の扱いが異なる; \fIlen\fP +以上の場合には、 \fIname\fP には何もコピーせず、関数は \-1 を返し、 \fIerrno\fP に \fBENAMETOOLONG\fP を設定する。 .SH 関連項目 -.BR getdomainname (2), -.BR setdomainname (2), -.BR uname (2) +\fBgetdomainname\fP(2), \fBsetdomainname\fP(2), \fBuname\fP(2) diff --git a/draft/man2/getpagesize.2 b/draft/man2/getpagesize.2 deleted file mode 100644 index c2458d7f..00000000 --- a/draft/man2/getpagesize.2 +++ /dev/null @@ -1,180 +0,0 @@ -.\" Copyright (C) 2001 Andries Brouwer -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 2002-04-14, HANATAKA Shinya -.\" Updated 2003-07-03, Akihiro Motoki -.\" Updated 2007-01-07, Akihiro MOTOKI, catch up to LDP v2.43 -.\" -.\"WORD: page ページ -.\"WORD: legacy 過去の遺物 -.\" -.TH GETPAGESIZE 2 2010-09-20 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O getpagesize \- get memory page size -getpagesize \- メモリのページ・サイズを取得する -.SH 書式 -.B #include -.sp -.B int getpagesize(void); -.sp -.in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): -.in -.sp -.BR getpagesize (): -.ad l -.RS 4 -.PD 0 -.TP 4 -.\"O Since glibc 2.12: -glibc 2.12 以降: -.nf -_BSD_SOURCE || - !(_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600) -.fi -.TP 4 -.\"O Before glibc 2.12: -glibc 2.12 より前: -_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED -.PD -.RE -.ad b -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The function -.\"O .BR getpagesize () -.\"O returns the number of bytes in a page, where a "page" is the thing -.\"O used where it says in the description of -.\"O .BR mmap (2) -.\"O that files are mapped in page-sized units. -.BR getpagesize () -関数はページの大きさをバイト数で返す。ここでの「ページ」は -.BR mmap (2) -の説明の中で使用されているもので、 -.BR mmap () -はこのページサイズの単位でファイルをマップする。 - -.\"O The size of the kind of pages that -.\"O .BR mmap (2) -.\"O uses, is found using -.BR mmap (2) -が使用するページサイズは以下のようにして知ることができる。 - -.in +4n -.nf -#include -long sz = sysconf(_SC_PAGESIZE); -.fi -.in - -.\"O (most systems allow the synonym -.\"O .B _SC_PAGE_SIZE -.\"O for -.\"O .BR _SC_PAGESIZE ), -.\"O or -(ほとんどのシステムでは -.B _SC_PAGESIZE -の同義語として -.B _SC_PAGE_SIZE -を使用することができる)、もしくは以下のようにする: - -.in +4n -.nf -#include -int sz = getpagesize(); -.fi -.in -.\"O .\" .SH HISTORY -.\" .SH 歴史 -.\"O .\" This call first appeared in 4.2BSD. -.\" このシステムコールは 4.2BSD で初めて登場した。 -.\"O .SH CONFORMING TO -.SH 準拠 -SVr4, 4.4BSD, SUSv2. -.\"O In SUSv2 the -.\"O .BR getpagesize () -.\"O call is labeled LEGACY, and in POSIX.1-2001 -.\"O it has been dropped; -.\"O HP-UX does not have this call. -.\"O Portable applications should employ -.\"O .I sysconf(_SC_PAGESIZE) -.\"O instead of this call. -SUSv2 では -.BR getpagesize () -システムコールは「過去の遺物 (LEGACY)」とされており、 -POSIX.1-2001 からは外されている。 -HP-UX にはこのシステムコールは存在しない。 -移植性が必要なアプリケーションでは、このシステムコールの代わりに -.I sysconf(_SC_PAGESIZE) -を利用すべきである。 -.\"O .SH NOTES -.SH 注意 -.\"O Whether -.\"O .BR getpagesize () -.\"O is present as a Linux system call depends on the architecture. -.BR getpagesize () -が Linux のシステムコールとして存在するかどうかは、そのアーキテクチャに -依存している。 -.\"O If it is, it returns the kernel symbol -.\"O .BR PAGE_SIZE , -.\"O whose value depends on the architecture and machine model. -システムコールとして存在する場合には、カーネルシンボルの -.B PAGE_SIZE -を返す。 -.B PAGE_SIZE -の値は、アーキテクチャとマシンモデルに依存する。 -.\"O Generally, one uses binaries that are dependent on the architecture but not -.\"O on the machine model, in order to have a single binary -.\"O distribution per architecture. -.\"O This means that a user program -.\"O should not find -.\"O .B PAGE_SIZE -.\"O at compile time from a header file, -.\"O but use an actual system call, at least for those architectures -.\"O (like sun4) where this dependency exists. -一般に、バイナリは、アーキテクチャごとに1つのバイナリ配布で済ませるために、 -アーキテクチャには依存しているがマシンモデルには依存していない。 -つまり、ユーザプログラムはコンパイル時にヘッダーファイルから -.B PAGE_SIZE -を見つけて使用すべきではない。 -少なくとも、マシンモデルについても依存性が存在する (sun4 のような) -アーキテクチャにおいては本物のシステムコールを使用する必要がある。 -.\"O Here libc4, libc5, glibc 2.0 fail because their -.\"O .BR getpagesize () -.\"O returns a statically derived value, and does not use a system call. -.\"O Things are OK in glibc 2.1. -尚、 libc4, libc5, glibc 2.0 では、 -.BR getpagesize () -がシステム・コールを使用せず、固定の値を返すために、この方法は -失敗する。glibc 2.1 では大丈夫である。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR mmap (2), -.BR sysconf (3) diff --git a/draft/man2/getsockname.2 b/draft/man2/getsockname.2 index 9cf2a95b..ad9c389a 100644 --- a/draft/man2/getsockname.2 +++ b/draft/man2/getsockname.2 @@ -35,144 +35,53 @@ .\" Modified Tue Oct 22 00:22:35 EDT 1996 by Eric S. Raymond .\" Modified Sun Mar 28 21:26:46 1999 by Andries Brouwer .\" -.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki -.\" all rights reserved. -.\" Translated Thu Jun 26 20:36:49 JST 1997 -.\" by SUTO, Mitsuaki -.\" Modified Sat Apr 3 14:56:26 JST 1999 -.\" by HANATAKA Shinya -.\" Updated & Modified Sat Feb 5 17:23:11 JST 2005 -.\" by Yuichi SATO +.\"******************************************************************* .\" -.TH GETSOCKNAME 2 2008-12-03 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GETSOCKNAME 2 2008\-12\-03 Linux "Linux Programmer's Manual" .SH 名前 -.\"O getsockname \- get socket name getsockname \- ソケットの名前を取得する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int getsockname(int " sockfd ", struct sockaddr *" addr \ -", socklen_t *" addrlen ); +\fBint getsockname(int \fP\fIsockfd\fP\fB, struct sockaddr *\fP\fIaddr\fP\fB, socklen_t *\fP\fIaddrlen\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR getsockname () -.\"O returns the current address to which the socket -.\"O .I sockfd -.\"O is bound, in the buffer pointed to by -.\"O .IR addr . -.\"O The -.\"O .I addrlen -.\"O argument should be initialized to indicate -.\"O the amount of space (in bytes) pointed to by -.\"O .IR addr . -.BR getsockname () -は、ソケット -.I sockfd -に結び付けられている現在のアドレスを、 -.I addr -が指すバッファに格納して返す。 -.I addrlen -引き数は、 -.I addr -が指している領域のサイズ (バイト単位) に初期化しておかなければならない。 -.\"O On return it contains the actual size of the socket address. -.\"O returned (in bytes). -関数が返る時には、 -.I addrlen -にはソケットアドレスの実際のサイズ (バイト単位) が格納される。 +\fBgetsockname\fP() は、ソケット \fIsockfd\fP に結び付けられている現在のアドレスを、 \fIaddr\fP +が指すバッファに格納して返す。 \fIaddrlen\fP 引き数は、 \fIaddr\fP が指している領域のサイズ (バイト単位) +に初期化しておかなければならない。 関数が返る時には、 \fIaddrlen\fP にはソケットアドレスの実際のサイズ (バイト単位) が格納される。 -.\"O The returned address is truncated if the buffer provided is too small; -.\"O in this case, -.\"O .I addrlen -.\"O will return a value greater than was supplied to the call. 渡されたバッファが小さ過ぎた場合は、返されるアドレスの末尾が切り詰められる。 -この場合には、 -.I addrlen -には、呼び出し時に指定された値よりも大きな値が格納される。 -.\"O .SH "RETURN VALUE" +この場合には、 \fIaddrlen\fP には、呼び出し時に指定された値よりも大きな値が格納される。 .SH 返り値 -.\"O On success, zero is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合 0 を返す。失敗した場合 \-1 を返し、 -.I errno -をエラーの内容に従って設定する。 -.\"O .SH ERRORS +成功した場合にはゼロが返される。エラー時には \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP -.B EBADF -.\"O The argument -.\"O .I sockfd -.\"O is not a valid descriptor. -引き数 -.I sockfd -が有効なディスクリプタ (descriptor) ではない。 -.TP -.B EFAULT -.\"O The -.\"O .I addr -.\"O argument points to memory not in a valid part of the -.\"O process address space. -引き数 -.I addr -の指しているメモリがプロセスのアドレス空間の有効な部分ではない。 -.TP -.B EINVAL -.\"O .I addrlen -.\"O is invalid (e.g., is negative). -.I addrlen -が不正である (例えば、負で場合など)。 -.TP -.B ENOBUFS -.\"O Insufficient resources were available in the system -.\"O to perform the operation. +.TP +\fBEBADF\fP +引き数 \fIsockfd\fP は有効なディスクリプターでない。 +.TP +\fBEFAULT\fP +引き数 \fIaddr\fP の指しているメモリがプロセスのアドレス空間の有効な部分ではない。 +.TP +\fBEINVAL\fP +\fIaddrlen\fP が不正である (例えば、負で場合など)。 +.TP +\fBENOBUFS\fP 処理をするだけの十分なリソースがシステムに無い。 -.TP -.B ENOTSOCK -.\"O The argument -.\"O .I sockfd -.\"O is a file, not a socket. -引き数 -.I sockfd -がソケットではなくファイルである。 -.\"O .SH "CONFORMING TO" +.TP +\fBENOTSOCK\fP +引き数 \fIsockfd\fP がソケットではなくファイルである。 .SH 準拠 -.\"O SVr4, 4.4BSD (the -.\"O .BR getsockname () -.\"O function call appeared in 4.2BSD), POSIX.1-2001. -.\"O .\" SVr4 documents additional ENOMEM -.\"O .\" and ENOSR error codes. -SVr4, 4.4BSD -.RB ( getsockname () -関数は 4.2BSD で追加された), POSIX.1-2001. -.\" SVr4 には他に ENOMEM と ENOSR のエラーコードについての記述がある。 -.\"O .SH NOTES +.\" SVr4 documents additional ENOMEM +.\" and ENOSR error codes. +SVr4, 4.4BSD (\fBgetsockname\fP() 関数は 4.2BSD で追加された), POSIX.1\-2001. .SH 注意 -.\"O The third argument of -.\"O .BR getsockname () -.\"O is in reality an \fIint *\fP -.\"O (and this is what 4.x BSD and libc4 and libc5 have). -.\"O Some POSIX confusion resulted in the present \fIsocklen_t\fP, -.\"O also used by glibc. -.BR getsockname () -の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際には \fIint *\fP -である。 glibc でも使われている現在の \fIsocklen_t\fP に関して、 -POSIX には少し混乱がある。 -.\"O See also -.\"O .BR accept (2). -詳しくは -.BR accept (2) +\fBgetsockname\fP() の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際には \fIint *\fP である。 +glibc でも使われている現在の \fIsocklen_t\fP に関して、 POSIX には少し混乱がある。 詳しくは \fBaccept\fP(2) を参照のこと。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR bind (2), -.BR socket (2), -.BR getifaddrs (3), -.BR ip (7), -.BR socket (7), -.BR unix (7) +\fBbind\fP(2), \fBsocket\fP(2), \fBgetifaddrs\fP(3), \fBip\fP(7), \fBsocket\fP(7), +\fBunix\fP(7) diff --git a/draft/man2/getsockopt.2 b/draft/man2/getsockopt.2 index 0976287a..5b98cf7d 100644 --- a/draft/man2/getsockopt.2 +++ b/draft/man2/getsockopt.2 @@ -39,306 +39,86 @@ .\" Modified 1999 by Andi Kleen . .\" Removed most stuff because it is in socket.7 now. .\" -.\" Japanese Version Copyright (c) 1996 Akira Yoshiyama -.\" all rights reserved. -.\" Translated Sat Jul 6 00:43:37 JST 1996 -.\" by Akira Yoshiyama -.\" Modified Fri Nov 7 22:45:27 JST 1997 -.\" by HANATAKA Shinya -.\" Updated Sun Oct 12 JST 2003 by Kentaro Shirakata +.\"******************************************************************* .\" -.TH GETSOCKOPT 2 2008-12-03 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GETSOCKOPT 2 2008\-12\-03 Linux "Linux Programmer's Manual" .SH 名前 -.\"O getsockopt, setsockopt \- get and set options on sockets getsockopt, setsockopt \- ソケットのオプションの設定と取得を行なう -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .BR "#include " " /* See NOTES */" -.BR "#include " " /* 「注意」参照 */" +\fB#include \fP /* 「注意」参照 */ .br -.B #include +\fB#include \fP .sp -.BI "int getsockopt(int " sockfd ", int " level ", int " optname , -.BI " void *" optval ", socklen_t *" optlen ); -.BI "int setsockopt(int " sockfd ", int " level ", int " optname , -.BI " const void *" optval ", socklen_t " optlen ); +\fBint getsockopt(int \fP\fIsockfd\fP\fB, int \fP\fIlevel\fP\fB, int \fP\fIoptname\fP\fB,\fP +\fB void *\fP\fIoptval\fP\fB, socklen_t *\fP\fIoptlen\fP\fB);\fP +\fBint setsockopt(int \fP\fIsockfd\fP\fB, int \fP\fIlevel\fP\fB, int \fP\fIoptname\fP\fB,\fP +\fB const void *\fP\fIoptval\fP\fB, socklen_t \fP\fIoptlen\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR getsockopt () -.\"O and -.\"O .BR setsockopt () -.\"O manipulate options for the socket referred to by the file descriptor -.\"O .IR sockfd . -.\"O Options may exist at multiple -.\"O protocol levels; they are always present at the uppermost -.\"O socket level. -.BR getsockopt () -と -.BR setsockopt () -は、ファイルディスクリプタ -.I socket -で参照されるソケットに関連するオプションの操作を行う。 -オプションは複数のプロトコル層(level)に存在するかもしれないが、 +\fBgetsockopt\fP() と \fBsetsockopt\fP() は、ファイルディスクリプタ \fIsocket\fP +で参照されるソケットに関連するオプションの操作を行う。 オプションは複数のプロトコル層(level)に存在するかもしれないが、 これらは常に最上位のソケット層へと設定される。 -.\"O When manipulating socket options, the level at which the -.\"O option resides and the name of the option must be specified. -.\"O To manipulate options at the sockets API level, -.\"O .I level -.\"O is specified as -.\"O .BR SOL_SOCKET . -.\"O To manipulate options at any -.\"O other level the protocol number of the appropriate protocol -.\"O controlling the option is supplied. -.\"O For example, -.\"O to indicate that an option is to be interpreted by the -.\"O .B TCP -.\"O protocol, -.\"O .I level -.\"O should be set to the protocol number of -.\"O .BR TCP ; -.\"O see -.\"O .BR getprotoent (3). -ソケット・オプションを操作する際には、オプションの層 (level) と -オプションの名前を指定しなければならない。 -ソケット API 層でオプションを操作する為には、 -.I level -を -.B SOL_SOCKET -に指定する。 -他の全ての層でオプションを操作する為には、与えられたオプションの -制御主体となるプロトコルのプロトコル番号を指定する。例えば、 -オプションが -.B TCP -プロトコルで解釈されるべきことを指示するには、 -.I level -に -.B TCP -のプロトコル番号を指定しなければならない。 -.BR getprotoent (3) -を参照すること。 +ソケット・オプションを操作する際には、オプションの層 (level) と オプションの名前を指定しなければならない。 ソケット API +層でオプションを操作する為には、 \fIlevel\fP を \fBSOL_SOCKET\fP に指定する。 +他の全ての層でオプションを操作する為には、与えられたオプションの 制御主体となるプロトコルのプロトコル番号を指定する。例えば、 オプションが +\fBTCP\fP プロトコルで解釈されるべきことを指示するには、 \fIlevel\fP に \fBTCP\fP のプロトコル番号を指定しなければならない。 +\fBgetprotoent\fP(3) を参照すること。 -.\"O The arguments -.\"O .I optval -.\"O and -.\"O .I optlen -.\"O are used to access option values for -.\"O .BR setsockopt (). -.I optval -と -.I optlen -引き数は -.BR setsockopt () -のオプションの値にアクセスするために用いられる。 -.\"O For -.\"O .BR getsockopt () -.\"O they identify a buffer in which the value for the -.\"O requested option(s) are to be returned. -.BR getsockopt () -では要求したオプションの値を返すためのバッファーを指定する。 -.\"O For -.\"O .BR getsockopt (), -.\"O .I optlen -.\"O is a value-result argument, initially containing the -.\"O size of the buffer pointed to by -.\"O .IR optval , -.\"O and modified on return to indicate the actual size of -.\"O the value returned. -.\"O If no option value is to be supplied or returned, -.\"O .I optval -.\"O may be NULL. -.BR getsockopt () -では -.I optlen -は値と結果両用の引き数で、最初に -.I optval -の指しているバッファーのサイズを与え、実際に返される値のサイズに -書き換えられる。もしオプション値を与えず、返されもしない場合には -.I optval -は NULL でも良い。 +\fIoptval\fP と \fIoptlen\fP 引き数は \fBsetsockopt\fP() のオプションの値にアクセスするために用いられる。 +\fBgetsockopt\fP() では要求したオプションの値を返すためのバッファーを指定する。 \fBgetsockopt\fP() では +\fIoptlen\fP は値と結果両用の引き数で、最初に \fIoptval\fP の指しているバッファーのサイズを与え、実際に返される値のサイズに +書き換えられる。もしオプション値を与えず、返されもしない場合には \fIoptval\fP は NULL でも良い。 -.\"O .I Optname -.\"O and any specified options are passed uninterpreted to the appropriate -.\"O protocol module for interpretation. -.\"O The include file -.\"O .I -.\"O contains definitions for socket level options, described below. -.\"O Options at -.\"O other protocol levels vary in format and name; consult the appropriate -.\"O entries in section 4 of the manual. -.I optname -および指定されたオプションは解釈されずに、適切なプロトコル・モジュールに -渡されて解釈される。インクルード・ファイル -.I -には後述のソケット層のオプションの定義が含まれている。 -他のプロトコル層では名前や形式は異なる。 +\fIoptname\fP および指定されたオプションは解釈されずに、適切なプロトコル・モジュールに 渡されて解釈される。インクルード・ファイル +\fI\fP には後述のソケット層のオプションの定義が含まれている。 他のプロトコル層では名前や形式は異なる。 マニュアルのセクション 4 の適切なエントリを参照すること。 -.\"O Most socket-level options utilize an -.\"O .I int -.\"O argument for -.\"O .IR optval . -.\"O For -.\"O .BR setsockopt (), -.\"O the argument should be nonzero to enable a boolean option, or zero if the -.\"O option is to be disabled. -ほとんどのソケット層のオプションは -.I optval -に -.I int -引き数を利用する。 -.BR setsockopt () -で、二値(boolean)オプションを有効(enable)にするにはゼロ以外を指定し、 -無効(disable)にするにはゼロを指定する。 +ほとんどのソケット層のオプションは \fIoptval\fP に \fIint\fP 引き数を利用する。 \fBsetsockopt\fP() +で、二値(boolean)オプションを有効(enable)にするにはゼロ以外を指定し、 無効(disable)にするにはゼロを指定する。 .PP -.\"O For a description of the available socket options see -.\"O .BR socket (7) -.\"O and the appropriate protocol man pages. -利用可能なソケットオプションの説明に関しては、 -.BR socket (7) -と適切なプロトコルの man ページを参照のこと。 -.\"O .SH "RETURN VALUE" +利用可能なソケットオプションの説明に関しては、 \fBsocket\fP(7) と適切なプロトコルの man ページを参照のこと。 .SH 返り値 -.\"O On success, zero is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合にはゼロを返す。エラー時には \-1 が返され、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS +成功した場合にはゼロが返される。エラー時には \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP 10 -.B EBADF -.\"O The argument -.\"O .I sockfd -.\"O is not a valid descriptor. -引き数 -.I sockfd -が有効なディスクリプタでない。 -.TP -.B EFAULT -.\"O The address pointed to by -.\"O .I optval -.\"O is not in a valid part of the process address space. -.\"O For -.\"O .BR getsockopt (), -.\"O this error may also be returned if -.\"O .I optlen -.\"O is not in a valid part of the process address space. -.I optval -で指定されたアドレスがプロセスのアドレス空間の有効な部分ではない。 -.BR getsockopt () -の場合、 -.I optlen +.TP 10 +\fBEBADF\fP +引き数 \fIsockfd\fP は有効なディスクリプターでない。 +.TP +\fBEFAULT\fP +\fIoptval\fP で指定されたアドレスがプロセスのアドレス空間の有効な部分ではない。 \fBgetsockopt\fP() の場合、 \fIoptlen\fP がプロセスのアドレス空間の有効な部分でない場合にもこのエラーが返される。 -.TP -.B EINVAL -.\"O .I optlen -.\"O invalid in -.\"O .BR setsockopt (). -.BR setsockopt () -で -.I option -が不正である。 -.\"O In some cases this error can also occur for an invalid value in -.\"O .IR optval -.\"O (e.g., for the -.\"O .B IP_ADD_MEMBERSHIP -.\"O option described in -.\"O .BR ip (7)). -.I optval -に無効な値が指定された場合にも、このエラーが発生する可能性がある -(例えば、 -.BR ip (7) -に説明がある -.B IP_ADD_MEMBERSHIP +.TP +\fBEINVAL\fP +\fBsetsockopt\fP() で \fIoption\fP が不正である。 \fIoptval\fP +に無効な値が指定された場合にも、このエラーが発生する可能性がある (例えば、 \fBip\fP(7) に説明がある \fBIP_ADD_MEMBERSHIP\fP オプションなど)。 -.TP -.B ENOPROTOOPT -.\"O The option is unknown at the level indicated. +.TP +\fBENOPROTOOPT\fP 指定された層(level)にはこのオプションは存在しない。 -.TP -.B ENOTSOCK -.\"O The argument -.\"O .I sockfd -.\"O is a file, not a socket. -引き数 -.I sockfd -はファイルであり、ソケットでない。 -.\"O .SH "CONFORMING TO" +.TP +\fBENOTSOCK\fP +引き数 \fIsockfd\fP がソケットではなくファイルである。 .SH 準拠 -.\"O SVr4, 4.4BSD (these system calls first appeared in 4.2BSD), -.\"O POSIX.1-2001. -.\"O .\" SVr4 documents additional ENOMEM and ENOSR error codes, but does -.\"O .\" not document the -.\"O .\" .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO -.\"O .\" options -SVr4, 4.4BSD (これらのシステム・コールは 4.2BSD で最初に現れた), -POSIX.1-2001. -.\" SVr4 には他に ENOMEM と ENOSR エラー・コードについても記述されている。 -.\" しかし、 +.\" SVr4 documents additional ENOMEM and ENOSR error codes, but does +.\" not document the .\" .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO -.\" オプションに関する記述はない。 -.\"O .SH NOTES +.\" options +SVr4, 4.4BSD (これらのシステム・コールは 4.2BSD で最初に現れた), POSIX.1\-2001. .SH 注意 -.\"O POSIX.1-2001 does not require the inclusion of -.\"O .IR , -.\"O and this header file is not required on Linux. -.\"O However, some historical (BSD) implementations required this header -.\"O file, and portable applications are probably wise to include it. -POSIX.1-2001 では -.I -のインクルードは必須とされておらず、 -Linux ではこのヘッダファイルは必要ではない。 -しかし、歴史的には、いくつかの実装 (BSD 系) でこのヘッダファイルが -必要であり、移植性が必要なアプリケーションではこのファイルを -インクルードするのが賢明であろう。 +POSIX.1\-2001 では \fI\fP のインクルードは必須とされておらず、 Linux +ではこのヘッダファイルは必要ではない。 しかし、歴史的には、いくつかの実装 (BSD 系) でこのヘッダファイルが +必要であり、移植性が必要なアプリケーションではこのファイルを インクルードするのが賢明であろう。 -.\"O The -.\"O .I optlen -.\"O argument of -.\"O .BR getsockopt () -.\"O and -.\"O .BR setsockopt () -.\"O is in reality an -.\"O .I "int [*]" -.\"O (and this is what 4.x BSD and libc4 and libc5 have). -.BR getsockopt () -と -.BR setsockopt () -の -.I optlen -引き数は実際は -.I int [*] -である (そして 4.x BSD と libc4 と libc5 はそうなっている)。 -.\"O Some POSIX confusion resulted in the present -.\"O .IR socklen_t , -.\"O also used by glibc. -.\"O See also -POSIX では紆余曲折を経て現在の -.I socklen_t -になっており、 -glibc でも -.I socklen_t -を使っている。 -.BR accept (2) -も参照のこと。 -.\"O .SH BUGS +\fBgetsockopt\fP() と \fBsetsockopt\fP() の \fIoptlen\fP 引き数は実際は \fIint [*]\fP である (そして +4.x BSD と libc4 と libc5 はそうなっている)。 POSIX では紆余曲折を経て現在の \fIsocklen_t\fP になっており、 +glibc でも \fIsocklen_t\fP を使っている。 \fBaccept\fP(2) も参照のこと。 .SH バグ -.\"O Several of the socket options should be handled at lower levels of the -.\"O system. -ソケットのオプションのいくつかはシステムのより低い層で -処理されるべきである。 -.\"O .SH "SEE ALSO" +ソケットのオプションのいくつかはシステムのより低い層で 処理されるべきである。 .SH 関連項目 -.BR ioctl (2), -.BR socket (2), -.BR getprotoent (3), -.BR protocols (5), -.BR socket (7), -.BR tcp (7), -.BR unix (7) +\fBioctl\fP(2), \fBsocket\fP(2), \fBgetprotoent\fP(3), \fBprotocols\fP(5), \fBsocket\fP(7), +\fBtcp\fP(7), \fBunix\fP(7) diff --git a/draft/man2/gettid.2 b/draft/man2/gettid.2 index ac619bda..6591feb6 100644 --- a/draft/man2/gettid.2 +++ b/draft/man2/gettid.2 @@ -23,91 +23,38 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI, all rights reserved. -.\" Translated Mon Mar 5 2003 by Akihiro MOTOKI -.\" Updated Sun Sep 14 JST 2003 by Akihiro MOTOKI -.\" Updated 2008-02-10, Akihiro MOTOKI , LDP v2.77 -.\" Updated 2008-08-04, Akihiro MOTOKI , LDP v3.05 +.\"******************************************************************* .\" -.TH GETTID 2 2008-04-14 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GETTID 2 2008\-04\-14 Linux "Linux Programmer's Manual" .SH 名前 -.\"O gettid \- get thread identification gettid \- スレッドID を取得する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.B pid_t gettid(void); +\fBpid_t gettid(void);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR gettid () -.\"O returns the caller's thread ID (TID). -.\"O In a single-threaded process, the thread ID -.\"O is equal to the process ID (PID, as returned by -.\"O .BR getpid (2)). -.\"O In a multithreaded process, all threads -.\"O have the same PID, but each one has a unique TID. -.BR gettid () -は呼び出し元のスレッド ID (TID) を返す。 -シングルスレッドのプロセスでは、スレッド ID は -.RB ( getpid (2) -が返すプロセス ID (PID) と等しい。 -マルチスレッドのプロセスでは、全てのスレッドは同じ PID を持つが、 -それぞれのスレッドは一意な TID を持つ。 -.\"O For further details, see the discussion of -.\"O .BR CLONE_THREAD -.\"O in -.\"O .BR clone (2). -さらなる詳細は、 -.BR clone (2) -の -.BR CLONE_THREAD +\fBgettid\fP() は呼び出し元のスレッド ID (TID) を返す。 シングルスレッドのプロセスでは、スレッド ID は +(\fBgetpid\fP(2) が返すプロセス ID (PID) と等しい。 マルチスレッドのプロセスでは、全てのスレッドは同じ PID を持つが、 +それぞれのスレッドは一意な TID を持つ。 さらなる詳細は、 \fBclone\fP(2) の \fBCLONE_THREAD\fP についての議論を参照すること。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O On success, returns the thread ID of the calling process. 成功の場合、呼び出し元のプロセスのスレッドID を返す。 -.\"O .SH ERRORS .SH エラー -.\"O This call is always successful. このコールは常に成功する。 -.\"O .SH VERSIONS .SH バージョン -.\"O The -.\"O .BR gettid () -.\"O system call first appeared on Linux in kernel 2.4.11. -.BR gettid () -システムコールは、カーネル 2.4.11 の Linux で初めて登場した。 -.\"O .SH "CONFORMING TO" +\fBgettid\fP() システムコールは、カーネル 2.4.11 の Linux で初めて登場した。 .SH 準拠 -.\"O .BR gettid () -.\"O is Linux-specific and should not be used in programs that -.\"O are intended to be portable. -.BR gettid () -は Linux 固有であり、 -移植を想定したプログラムでは使用すべきではない。 -.\"O .SH NOTES +\fBgettid\fP() は Linux 固有であり、 移植を想定したプログラムでは使用すべきではない。 .SH 注意 -.\"O Glibc does not provide a wrapper for this system call; call it using -.\"O .BR syscall (2). -glibc はこのシステムコールに対するラッパー関数を提供していない。 -.BR syscall (2) -を使って呼び出すこと。 -.\" See http://sourceware.org/bugzilla/show_bug.cgi?id=6399 +.\" FIXME See http://sourceware.org/bugzilla/show_bug.cgi?id=6399 .\" "gettid() should have a wrapper" +glibc はこのシステムコールに対するラッパー関数を提供していない。 このシステムコールは呼び出すには \fBsyscall\fP(2) を使うこと。 -.\"O The thread ID returned by this call is not the same thing as a -.\"O POSIX thread ID (i.e., the opaque value returned by -.\"O .BR pthread_self (3)). -このシステムコールが返すスレッド ID は -POSIX スレッド ID -.RB ( pthread_self (3) -が返す曖昧な値) と同じものではない。 -.\"O .SH "SEE ALSO" +このシステムコールが返すスレッド ID は POSIX スレッド ID (\fBpthread_self\fP(3) が返す曖昧な値) と同じものではない。 .SH 関連項目 -.BR clone (2), -.BR fork (2), -.BR getpid (2) +\fBclone\fP(2), \fBfork\fP(2), \fBgetpid\fP(2) diff --git a/draft/man2/gettimeofday.2 b/draft/man2/gettimeofday.2 deleted file mode 100644 index 9ce63624..00000000 --- a/draft/man2/gettimeofday.2 +++ /dev/null @@ -1,386 +0,0 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992 -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" Modified by Michael Haardt (michael@moria.de) -.\" Modified 1993-07-23 by Rik Faith (faith@cs.unc.edu) -.\" Modified 1994-08-21 by Michael Chastain (mec@shell.portal.com): -.\" Fixed necessary '#include' lines. -.\" Modified 1995-04-15 by Michael Chastain (mec@shell.portal.com): -.\" Added reference to adjtimex. -.\" Removed some nonsense lines pointed out by Urs Thuermann, -.\" (urs@isnogud.escape.de), aeb, 950722. -.\" Modified 1997-01-14 by Austin Donnelly (and1000@debian.org): -.\" Added return values section, and bit on EFAULT -.\" Added clarification on timezone, aeb, 971210. -.\" Removed "#include ", aeb, 010316. -.\" Modified, 2004-05-27 by Michael Kerrisk -.\" Added notes on capability requirement. -.\" -.\" Japanese Version Copyright (c) 1998 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1998-05-11, HANATAKA Shinya -.\" Updated & Modified 2001-06-02, Yuichi SATO -.\" Updated & Modified 2001-12-23, Yuichi SATO -.\" Updated & Modified 2003-09-06, Yuichi SATO -.\" Updated & Modified 2004-12-30, Yuichi SATO -.\" Updated 2006-07-23, Akihiro MOTOKI -.\" Updated 2009-04-13, Akihiro MOTOKI, LDP v3.20 -.\" -.\"WORD: timezone タイムゾーン -.\"WORD: daylight savings times 夏時間(daylight savings times) -.\"WORD: macro マクロ -.\"WORD: null NULL -.\"WORD: superuser スーパー・ユーザー -.\" -.TH GETTIMEOFDAY 2 2009-03-25 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O gettimeofday, settimeofday \- get / set time -gettimeofday, settimeofday \- 時刻を取得/設定する -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.B #include - -.BI "int gettimeofday(struct timeval *" tv ", struct timezone *" tz ); - -.BI "int settimeofday(const struct timeval *" tv \ -", const struct timezone *" tz ); - -.fi -.in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): -.in -.sp -.BR settimeofday (): -_BSD_SOURCE -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The functions -.\"O .BR gettimeofday () -.\"O and -.\"O .BR settimeofday () -.\"O can get and set the time as well as a timezone. -.\"O .I tv -.\"O argument is a -.\"O .I struct timeval -.\"O (as specified in -.\"O .IR ): -関数 -.BR gettimeofday () -と -.BR settimeofday () -は時刻とタイムゾーンを取得または設定する。 -.I tv -引き数は -.I struct timeval -である -.RI ( -で定義されている): -.sp -.in +4n -.nf -struct timeval { -.\"O time_t tv_sec; /* seconds */ -.\"O suseconds_t tv_usec; /* microseconds */ - time_t tv_sec; /* 秒 */ - suseconds_t tv_usec; /* マイクロ秒 */ -}; -.fi -.in -.sp -.\"O and gives the number of seconds and microseconds since the Epoch (see -.\"O .BR time (2)). -.\"O The -.\"O .I tz -.\"O argument is a -.\"O .IR "struct timezone" : -これにより紀元 (the Epoch: -.BR time (2) -を参照) からの秒とマイクロ秒が取得できる。 -.I tz -引き数は -.I "struct timezone" -である: -.sp -.in +4n -.nf -struct timezone { -.\"O int tz_minuteswest; /* minutes west of Greenwich */ -.\"O int tz_dsttime; /* type of DST correction */ - int tz_minuteswest; /* グリニッジ標準時との差 (西方に分単位) */ - int tz_dsttime; /* 夏時間調整の型 */ -}; -.fi -.in -.PP -.\"O If either -.\"O .I tv -.\"O or -.\"O .I tz -.\"O is NULL, the corresponding structure is not set or returned. -.I tv -や -.I tz -が NULL の場合、対応する構造体の設定/取得は行われない。 -.\" The following is covered under EPERM below: -.\" .PP -.\" Only the superuser may use -.\" .BR settimeofday (). -.PP -.\"O The use of the -.\"O .I timezone -.\"O structure is obsolete; the -.\"O .I tz -.\"O argument should normally be specified as NULL. -.\"O The -.\"O .I tz_dsttime -.\"O field has never been used under Linux; it has not -.\"O been and will not be supported by libc or glibc. -.\"O Each and every occurrence of this field in the kernel source -.\"O (other than the declaration) is a bug. -.\"O Thus, the following -.\"O is purely of historic interest. -.I timezone -構造体を使うのは時代遅れ (obsolete) である: -.I tz -引き数は通常は NULL に指定すべきである。 -.I tz_dsttime -フィールドは Linux では一切使われてこなかった; -libc や glibc でもサポートされてこなかったし、 -これからもサポートされることはない。 -カーネルのソース中の宣言以外で、このフィールドが存在するのは全てバグである。 -よってこれ以降の記述は、純粋に歴史的興味に基づいたものである。 - -.\"O The field -.\"O .I tz_dsttime -.\"O contains a symbolic constant (values are given below) -.\"O that indicates in which part of the year Daylight Saving Time -.\"O is in force. -.\"O (Note: its value is constant throughout the year: -.\"O it does not indicate that DST is in force, it just selects an -.\"O algorithm.) -.\"O The daylight saving time algorithms defined are as follows : -.I tz_dsttime -フィールドには (以下で与えられるような) シンボル定数が格納される。 -これは一年のうちでいつ夏時間 (Daylight Savings Time) を実施するかを示している -(注意: その値は年間を通した定数である: -夏時間が実施中であることを示すわけではなく、 -アルゴリズムを選択しているだけである)。 -夏時間は以下のように定義される: -.in +4n -.nf - -.\"O \fBDST_NONE\fP /* not on dst */ -\fBDST_NONE\fP /* 夏時間を採用していない */ -.br -.\"O \fBDST_USA\fP /* USA style dst */ -\fBDST_USA\fP /* アメリカ合衆国式夏時間 */ -.br -.\"O \fBDST_AUST\fP /* Australian style dst */ -\fBDST_AUST\fP /* オーストラリア式夏時間 */ -.br -.\"O \fBDST_WET\fP /* Western European dst */ -\fBDST_WET\fP /* 西ヨーロッパ式夏時間 */ -.br -.\"O \fBDST_MET\fP /* Middle European dst */ -\fBDST_MET\fP /* 中央ヨーロッパ式夏時間 */ -.br -.\"O \fBDST_EET\fP /* Eastern European dst */ -\fBDST_EET\fP /* 東ヨーロッパ式夏時間 */ -.br -.\"O \fBDST_CAN\fP /* Canada */ -\fBDST_CAN\fP /* カナダ */ -.br -.\"O \fBDST_GB\fP /* Great Britain and Eire */ -\fBDST_GB\fP /* グレートブリテンおよびアイルランド */ -.br -.\"O \fBDST_RUM\fP /* Rumania */ -\fBDST_RUM\fP /* ルーマニア */ -.br -.\"O \fBDST_TUR\fP /* Turkey */ -\fBDST_TUR\fP /* トルコ */ -.br -.\"O \fBDST_AUSTALT\fP /* Australian style with shift in 1986 */ -\fBDST_AUSTALT\fP /* 1986年に移行されたオーストラリア式 */ -.fi -.in -.PP -.\"O Of course it turned out that the period in which -.\"O Daylight Saving Time is in force cannot be given -.\"O by a simple algorithm, one per country; indeed, -.\"O this period is determined by unpredictable political -.\"O decisions. -.\"O So this method of representing timezones -.\"O has been abandoned. -.\"O Under Linux, in a call to -.\"O .BR settimeofday () -.\"O the -.\"O .I tz_dsttime -.\"O field should be zero. -当然のことながら、夏時間がどの期間に実施されるかを -国ごとの簡単なアルゴリズムで導くことができないことが判明した。 -実際、夏時間の期間は予測不可能な政治的決定で決まる。 -そのためこの方法でタイム・ゾーンを表すことは断念された。 -Linux において -.BR settimeofday () -を呼び出すときは、 -.I tz_dsttime -フィールドを 0 にするべきである。 -.PP -.\"O Under Linux there are some peculiar "warp clock" semantics associated -.\"O with the -.\"O .BR settimeofday () -.\"O system call if on the very first call (after booting) -.\"O that has a non-NULL -.\"O .I tz -.\"O argument, the -.\"O .I tv -.\"O argument is NULL and the -.\"O .I tz_minuteswest -.\"O field is nonzero. -.\"O In such a case it is assumed that the CMOS clock -.\"O is on local time, and that it has to be incremented by this amount -.\"O to get UTC system time. -.\"O No doubt it is a bad idea to use this feature. -Linux では、 -.BR settimeofday () -システム・コールに関連して、独特の「クロックのズレ (warp clock)」が存在する。 -これは (ブート後の) 最初の呼び出しで -.I tz -引き数が NULL でなく、 -.I tv -引き数が NULL で -.I tz_minuteswest -フィールドが 0 でない場合に起こる。 -このような場合、 -.BR settimeofday () -は CMOS クロックが地方時 (local time) であり、 -UTC システム時間を得るためには、 -.I tz_minuteswest -の分だけ増加させなくてはならないとみなしてしまう。 -疑いもなく、この機構を使うことは良い考えではない。 -.PP -.\"O Macros for operating on -.\"O .I timeval -.\"O structures are described in -.\"O .BR timeradd (3). -.I timeval -構造体を操作するためのマクロの説明は -.BR timeradd (3) -にある。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O .BR gettimeofday () -.\"O and -.\"O .BR settimeofday () -.\"O return 0 for success, or \-1 for failure (in which case -.\"O .I errno -.\"O is set appropriately). -.BR gettimeofday () -と -.BR settimeofday () -は成功すると 0 を返し、失敗した場合は \-1 を返す -(この場合は -.I errno -が適切に設定される)。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EFAULT -.\"O One of -.\"O .I tv -.\"O or -.\"O .I tz -.\"O pointed outside the accessible address space. -.I tv -か -.I tz -のどちらかがアクセス可能なアドレス空間外を指している。 -.TP -.B EINVAL -.\"O Timezone (or something else) is invalid. -タイムゾーン (または他の何か) が不正である。 -.TP -.B EPERM -.\"O The calling process has insufficient privilege to call -.\"O .BR settimeofday (); -.\"O under Linux the -.\"O .B CAP_SYS_TIME -.\"O capability is required. -呼び出し元プロセスに -.BR settimeofday () -を呼び出すための十分な特権がない。 -Linux では -.B CAP_SYS_TIME -ケーパビリティ (capability) が必要である。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -.\"O SVr4, 4.3BSD. -.\"O POSIX.1-2001 describes -.\"O .BR gettimeofday () -.\"O but not -.\"O .BR settimeofday (). -SVr4, 4.3BSD に準拠する。 -POSIX.1-2001 は -.BR gettimeofday () -については記述しているが、 -.BR settimeofday () -については記述していない。 -.\"O POSIX.1-2008 marks -.\"O .BR gettimeofday () -.\"O as obsolete, recommending the use of -.\"O .BR clock_gettime (2) -.\"O instead. -POSIX.1-2008 では -.BR gettimeofday () -は廃止予定とされており、 -代わりに -.BR clock_gettime (2) -の使用が推奨されている。 -.\"O .SH NOTES -.SH 注意 -.LP -.\"O Traditionally, the fields of -.\"O .I struct timeval -.\"O were of type -.\"O .IR long . -昔は -.I struct timeval -のフィールドは -.I long -型であった。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR date (1), -.BR adjtimex (2), -.BR time (2), -.BR ctime (3), -.BR ftime (3), -.BR capabilities (7), -.BR time (7) diff --git a/draft/man2/idle.2 b/draft/man2/idle.2 index 223f33e3..3018e311 100644 --- a/draft/man2/idle.2 +++ b/draft/man2/idle.2 @@ -29,75 +29,32 @@ .\" N.B. calling "idle" from user process used to hang process! .\" Modified Thu Oct 31 14:41:15 1996 by Eric S. Raymond .\" " +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki -.\" all rights reserved. -.\" Translated Thu Jun 26 20:42:09 JST 1997 -.\" by SUTO, Mitsuaki -.\" Updated Mon Jan 3 18:16:36 JST 2000 -.\" by Kentaro Shirakata +.\" This file was generated with po4a. Translate the source file. .\" -.\"WORD: Linux-specific Linux 特有 -.\"WORK: portable 移植 -.\" -.TH IDLE 2 1994-08-21 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH IDLE 2 1994\-08\-21 Linux "Linux Programmer's Manual" .SH 名前 -.\"O idle \- make process 0 idle idle \- ID 0 のプロセスをアイドル状態にする -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.B int idle(void); -.\"O .SH DESCRIPTION +\fBint idle(void);\fP .SH 説明 -.\"O .BR idle () -.\"O is an internal system call used during bootstrap. -.\"O It marks the process's pages as swappable, lowers its priority, -.\"O and enters the main scheduling loop. -.\"O .BR idle () -.\"O never returns. -.BR idle () -はブートストラップ時に使用される、内部システムコールである。 -プロセスのページをスワップ可能に設定し、優先度を下げ、メインのスケジュー -ル処理のためのループへ移行する。 -従って -.BR idle () -は return することはない。 +\fBidle\fP() はブートストラップ時に使用される、内部システムコールである。 +プロセスのページをスワップ可能に設定し、優先度を下げ、メインのスケジュー ル処理のためのループへ移行する。 従って \fBidle\fP() は +return することはない。 .PP -.\"O Only process 0 may call -.\"O .BR idle (). -.\"O Any user process, even a process with superuser permission, -.\"O will receive -.\"O .BR EPERM . -ID 0 のプロセスのみが -.BR idle () -を使用することができる。 -他のユーザープロセスはたとえそれがスーパーユーザー権限を持っていたとして -も -.B EPERM -を受け取る。 -.\"O .SH "RETURN VALUE" +ID 0 のプロセスのみが \fBidle\fP() を使用することができる。 他のユーザープロセスはたとえそれがスーパーユーザー権限を持っていたとして も +\fBEPERM\fP を受け取る。 .SH 返り値 -.\"O .BR idle () -.\"O never returns for process 0, and always returns \-1 for a user process. -.BR idle () -ID 0 のプロセスに対しては return しない。それ以外のユーザープロセスには -常に \-1 を返す。 -.\"O .SH ERRORS +\fBidle\fP() ID 0 のプロセスに対しては return しない。それ以外のユーザープロセスには 常に \-1 を返す。 .SH エラー -.TP -.B EPERM -.\"O Always, for a user process. -ユーザープロセスには常にこの値をセットする。 -.\"O .SH VERSIONS +.TP +\fBEPERM\fP +ユーザプロセスに対しては、常にこのエラーとなる。 .SH バージョン -.\"O Since 2.3.13 this system call does not exist anymore. 2.3.13 以降、もはやこのシステムコールは存在しない。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O This function is Linux-specific, and should not be used in programs -.\"O intended to be portable. -この関数は Linux 特有の関数であり、移植性を持たせたいプログラムには使 -用すべきでない。 +この関数は Linux 特有であり、移植を意図したプログラムでは 使用すべきでない。 diff --git a/draft/man2/inotify_add_watch.2 b/draft/man2/inotify_add_watch.2 index e00b88ab..1638e71f 100644 --- a/draft/man2/inotify_add_watch.2 +++ b/draft/man2/inotify_add_watch.2 @@ -26,163 +26,63 @@ .\" 2005-07-19 Robert Love - initial version .\" 2006-02-07 mtk, various changes .\" -.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2006-08-15, Akihiro MOTOKI , LDP v2.39 +.\"******************************************************************* .\" -.TH INOTIFY_ADD_WATCH 2 2006-02-07 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH INOTIFY_ADD_WATCH 2 2010\-10\-20 Linux "Linux Programmer's Manual" .SH 名前 -.\"O inotify_add_watch \- add a watch to an initialized inotify instance inotify_add_watch \- 初期化済み inotify インスタンスに監視対象を追加する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int inotify_add_watch(int " fd ", const char *" pathname ", uint32_t " mask ); -.\"O .SH DESCRIPTION +\fBint inotify_add_watch(int \fP\fIfd\fP\fB, const char *\fP\fIpathname\fP\fB, uint32_t +\fP\fImask\fP\fB);\fP .SH 説明 -.\"O .BR inotify_add_watch () -.\"O adds a new watch, or modifies an existing watch, -.\"O for the file whose location is specified in -.\"O .IR pathname ; -.\"O the caller must have read permission for this file. -.\"O The -.\"O .I fd -.\"O argument is a file descriptor referring to the -.\"O inotify instance whose watch list is to be modified. -.BR inotify_add_watch () -は、 -.I pathname -で指定された位置にあるファイルを監視する監視アイテム (watch) の新規追加、 -または既存の監視アイテムの変更を行う。 -呼び出し元は、監視対象のファイルに対する読み出し許可を -持っていなければならない。 -.I fd -引き数は、変更を行う監視対象リスト (watch list) を持つ inotify -インスタンスを参照するファイルディスクリプタである。 -.\"O The events to be monitored for -.\"O .I pathname -.\"O are specified in the -.\"O .I mask -.\"O bit-mask argument. -.\"O See -.\"O .BR inotify (7) -.\"O for a description of the bits that can be set in -.\"O .IR mask . -.I pathname -のどのイベントを監視するかは、引き数のビットマスク -.I mask -で指定する。 -.I mask -に設定できるビットの説明については -.BR inotify (7) -を参照のこと。 +\fBinotify_add_watch\fP() は、 \fIpathname\fP で指定された位置にあるファイルを監視する監視アイテム (watch) +の新規追加、 または既存の監視アイテムの変更を行う。 呼び出し元は、監視対象のファイルに対する読み出し許可を 持っていなければならない。 \fIfd\fP +引き数は、変更を行う監視対象リスト (watch list) を持つ inotify インスタンスを参照するファイルディスクリプタである。 +\fIpathname\fP のどのイベントを監視するかは、引き数のビットマスク \fImask\fP で指定する。 \fImask\fP +に設定できるビットの説明については \fBinotify\fP(7) を参照のこと。 -.\"O A successful call to -.\"O .BR inotify_add_watch () -.\"O returns the unique watch descriptor associated with -.\"O .I pathname -.\"O for this inotify instance. -.\"O If -.\"O .I pathname -.\"O was not previously being watched by this inotify instance, -.\"O then the watch descriptor is newly allocated. -.\"O If -.\"O .I pathname -.\"O was already being watched, then the descriptor -.\"O for the existing watch is returned. -.BR inotify_add_watch () -の呼び出しが成功すると、変更対象の inotify インスタンスで -.I pathname -に対応付けられる一意な監視対象ディスクリプタ (watch descriptor) を返す。 -.I pathname -がその inotify インスタンスに追加されていなければ、 -監視対象ディスクリプタが新規に割り当てられる。 -.I pathname -がすでに監視対象になっていれば、既存の監視アイテムに対する -ディスクリプタが返される。 +\fBinotify_add_watch\fP() の呼び出しが成功すると、変更対象の inotify インスタンスで \fIpathname\fP +に対応付けられる一意な監視対象ディスクリプタ (watch descriptor) を返す。 \fIpathname\fP がその inotify +インスタンスに追加されていなければ、 監視対象ディスクリプタが新規に割り当てられる。 \fIpathname\fP +がすでに監視対象になっていれば、既存の監視アイテムに対する ディスクリプタが返される。 -.\"O The watch descriptor is returned by later -.\"O .BR read (2)s -.\"O from the inotify file descriptor. -.\"O These reads fetch -.\"O .I inotify_event -.\"O structures (see -.\"O .BR inotify (7)) -.\"O indicating file system events; -.\"O the watch descriptor inside this structure identifies -.\"O the object for which the event occurred. -これ以降に inotify ファイルディスクリプタから -.BR read (2) -を行うと、監視対象ディスクリプタが返される。 -これらの -.BR read () -を行うと、ファイルシステムイベントを示す -.I inotify_event -構造体が読み出される -.RB ( inotify (7) -参照)。この構造体内の監視対象ディスクリプタにより、 -どのオブジェクトでそのイベントが発生したかを特定できる。 -.\"O .SH "RETURN VALUE" +これ以降に inotify ファイルディスクリプタから \fBread\fP(2) を行うと、監視対象ディスクリプタが返される。 これらの +\fBread\fP() を行うと、ファイルシステムイベントを示す \fIinotify_event\fP 構造体が読み出される (\fBinotify\fP(7) +参照)。この構造体内の監視対象ディスクリプタにより、 どのオブジェクトでそのイベントが発生したかを特定できる。 .SH 返り値 -.\"O On success, -.\"O .BR inotify_add_watch () -.\"O returns a nonnegative watch descriptor. -.\"O On error \-1 is returned and -.\"O .I errno -.\"O is set appropriately. -成功すると、 -.BR inotify_add_watch () -は非負の監視対象ディスクリプタを返す。 -エラーの場合、\-1 を返し、 -.I errno +成功すると、 \fBinotify_add_watch\fP() は非負の監視対象ディスクリプタを返す。 エラーの場合、\-1 を返し、 \fIerrno\fP を適切に設定する。 -.\"O .SH ERRORS .SH エラー -.TP -.B EACCES -.\"O Read access to the given file is not permitted. +.TP +\fBEACCES\fP 指定されたファイルに対する読み出しアクセスが許可されていない。 -.TP -.B EBADF -.\"O The given file descriptor is not valid. +.TP +\fBEBADF\fP 指定されたファイルディスクリプタが有効ではない。 -.TP -.B EFAULT -.\"O .I pathname -.\"O points outside of the process's accessible address space. -.I pathname -が指すアドレスがプロセスがアクセスできるアドレス空間外である。 -.TP -.B EINVAL -.\"O The given event mask contains no valid events; or -.\"O .I fd -.\"O is not an inotify file descriptor. -指定されたイベントマスクに有効なイベントが含まれていない。 -もしくは -.I fd -が inotify ファイルディスクリプタではない。 -.TP -.B ENOMEM -.\"O Insufficient kernel memory was available. +.TP +\fBEFAULT\fP +\fIpathname\fP が指すアドレスがプロセスがアクセスできるアドレス空間外である。 +.TP +\fBEINVAL\fP +指定されたイベントマスクに有効なイベントが含まれていない。 もしくは \fIfd\fP が inotify ファイルディスクリプタではない。 +.TP +\fBENOENT\fP +\fIpathname\fP のディレクトリ部分の構成要素が、存在しないか、 +リンク切れのシンボリックリンクである。 +.TP +\fBENOMEM\fP カーネルメモリが十分になかった。 -.TP -.B ENOSPC -.\"O The user limit on the total number of inotify watches was reached or the -.\"O kernel failed to allocate a needed resource. -inotify 監視対象の総数がユーザが追加できる上限に達していた。 -もしくは、必要な資源の割り当てにカーネルが失敗した。 -.\"O .SH VERSIONS +.TP +\fBENOSPC\fP +inotify 監視対象の総数がユーザが追加できる上限に達していた。 もしくは、必要な資源の割り当てにカーネルが失敗した。 .SH バージョン -.\"O Inotify was merged into the 2.6.13 Linux kernel. inotify は Linux カーネル 2.6.13 に組み込まれた。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O This system call is Linux-specific. このシステムコールは Linux 独自である。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR inotify_init (2), -.BR inotify_rm_watch (2), -.BR inotify (7) +\fBinotify_init\fP(2), \fBinotify_rm_watch\fP(2), \fBinotify\fP(7) diff --git a/draft/man2/inotify_init.2 b/draft/man2/inotify_init.2 index 208b0f2e..656c0df5 100644 --- a/draft/man2/inotify_init.2 +++ b/draft/man2/inotify_init.2 @@ -26,135 +26,55 @@ .\" 2006-02-07 mtk, minor changes .\" 2008-10-10 mtk: add description of inotify_init1() .\" -.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2006-08-15, Akihiro MOTOKI , LDP v2.39 -.\" Updated 2008-11-10, Akihiro MOTOKI , LDP v3.12 +.\"******************************************************************* .\" -.TH INOTIFY_INIT 2 2008-10-10 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH INOTIFY_INIT 2 2008\-10\-10 Linux "Linux Programmer's Manual" .SH 名前 -.\"O inotify_init, inotify_init1 \- initialize an inotify instance inotify_init, inotify_init1 \- inotify インスタンスを初期化する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.B "int inotify_init(void);" -.BI "int inotify_init1(int " flags ); +\fBint inotify_init(void);\fP +\fBint inotify_init1(int \fP\fIflags\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR inotify_init () -.\"O initializes a new inotify instance and returns a file descriptor associated -.\"O with a new inotify event queue. -.BR inotify_init () -は、新規の inotify インスタンスを初期化し、作成された inotify イベントキュー +\fBinotify_init\fP() は、新規の inotify インスタンスを初期化し、作成された inotify イベントキュー に対応するファイルディスクリプタを返す。 -.\"O If -.\"O .I flags -.\"O is 0, then -.\"O .BR inotify_init1 () -.\"O is the same as -.\"O .BR inotify_init (). -.\"O The following values can be bitwise ORed in -.\"O .IR flags -.\"O to obtain different behavior: -.BR inotify_init1 () -は、 -.I flags -が 0 の場合、 -.BR inotify_init () -と同じである。 -.I flags -に以下の値をビット毎の論理和 (OR) で指定することで、 -異なる動作をさせることができる。 -.TP 12 -.B IN_NONBLOCK -.\"O Set the -.\"O .BR O_NONBLOCK -.\"O file status flag on the new open file description. -.\"O Using this flag saves extra calls to -.\"O .BR fcntl (2) -.\"O to achieve the same result. -新しく生成されるオープンファイル記述 (open file description) の -BR O_NONBLOCK -ファイルステータスフラグをセットする。 -このフラグを使うことで、 -.B O_NONBLOCK -をセットするために -.BR fcntl (2) +\fBinotify_init1\fP() は、 \fIflags\fP が 0 の場合、 \fBinotify_init\fP() と同じである。 \fIflags\fP +に以下の値をビット毎の論理和 (OR) で指定することで、 異なる動作をさせることができる。 +.TP 12 +\fBIN_NONBLOCK\fP +新しく生成されるオープンファイル記述 (open file description) の BR O_NONBLOCK +ファイルステータスフラグをセットする。 このフラグを使うことで、 \fBO_NONBLOCK\fP をセットするために \fBfcntl\fP(2) を追加で呼び出す必要がなくなる。 -.TP -.B IN_CLOEXEC -.\"O Set the close-on-exec -.\"O .RB ( FD_CLOEXEC ) -.\"O flag on the new file descriptor. -.\"O See the description of the -.\"O .B O_CLOEXEC -.\"O flag in -.\"O .BR open (2) -.\"O for reasons why this may be useful. -新しいファイル・ディスクリプターに対して -close-on-exec -.RB ( FD_CLOEXEC ) -フラグをセットする。 -このフラグが役に立つ理由については、 -.BR open (2) -の -.B O_CLOEXEC -フラグの説明を参照のこと。 -.\"O .SH "RETURN VALUE" +.TP +\fBIN_CLOEXEC\fP +新しいファイル・ディスクリプターに対して close\-on\-exec (\fBFD_CLOEXEC\fP) フラグをセットする。 +このフラグが役に立つ理由については、 \fBopen\fP(2) の \fBO_CLOEXEC\fP フラグの説明を参照のこと。 .SH 返り値 -.\"O On success, these system calls return a new file descriptor. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set to indicate the error. -成功すると、これらのシステムコールは新しいファイルディスクリプタを返す。 -エラーの場合、\-1 を返し、 -.I errno -をエラーを示す値に設定する。 -.\"O .SH ERRORS +成功すると、これらのシステムコールは新しいファイルディスクリプタを返す。 エラーの場合、\-1 を返し、 \fIerrno\fP をエラーを示す値に設定する。 .SH エラー -.TP -.B EINVAL -.\"O .RB ( inotify_init1 ()) -.\"O An invalid value was specified in -.\"O .IR flags . -.RB ( inotify_init1 ()) -無効な値が -.I flags -に指定された。 -.TP -.B EMFILE -.\"O The user limit on the total number of inotify instances has been reached. +.TP +\fBEINVAL\fP +(\fBinotify_init1\fP()) 無効な値が \fIflags\fP に指定された。 +.TP +\fBEMFILE\fP inotify インスタンスの総数がユーザ単位の上限に達していた。 -.TP -.B ENFILE -.\"O The system limit on the total number of file descriptors has been reached. +.TP +\fBENFILE\fP inotify インスタンスの総数がシステムの上限に達していた。 -.TP -.B ENOMEM -.\"O Insufficient kernel memory is available. +.TP +\fBENOMEM\fP カーネルメモリが十分になかった。 -.\"O .SH VERSIONS .SH バージョン -.\"O .BR inotify_init () -.\"O first appeared in Linux 2.6.13. -.\"O .BR inotify_init1 () -.\"O was added in Linux 2.6.27. -.BR inotify_init () -は Linux 2.6.13 で初めて登場した。 -.BR inotify_init1 () -は Linux 2.6.27 で追加された。 -.\"O .SH "CONFORMING TO" +\fBinotify_init\fP() は Linux 2.6.13 で初めて登場した。 \fBinotify_init1\fP() は Linux +2.6.27 で追加された。 .SH 準拠 -.\"O These system calls are Linux-specific. これらのシステムコールは Linux 独自である。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR inotify_add_watch (2), -.BR inotify_rm_watch (2), -.BR inotify (7) +\fBinotify_add_watch\fP(2), \fBinotify_rm_watch\fP(2), \fBinotify\fP(7) diff --git a/draft/man2/inotify_rm_watch.2 b/draft/man2/inotify_rm_watch.2 index df632310..7d9141bd 100644 --- a/draft/man2/inotify_rm_watch.2 +++ b/draft/man2/inotify_rm_watch.2 @@ -25,94 +25,37 @@ .\" 2005-07-19 Robert Love - initial version .\" 2006-02-07 mtk, minor changes .\" -.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2006-08-15, Akihiro MOTOKI , LDP v2.39 +.\"******************************************************************* .\" -.\" WORD: watch 監視アイテム -.\" WORD: watch descriptor 監視対象ディスクリプタ +.\" This file was generated with po4a. Translate the source file. .\" -.TH INOTIFY_RM_WATCH 2 2010-10-15 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH INOTIFY_RM_WATCH 2 2010\-10\-15 Linux "Linux Programmer's Manual" .SH 名前 -.\"O inotify_rm_watch \- remove an existing watch from an inotify instance inotify_rm_watch \- inotify インスタンスから既存の監視アイテムを削除する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int inotify_rm_watch(int " fd ", int " wd ); .\" Before glibc 2.10, the second argument was types as uint32_t. .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=7040 -.\"O .SH DESCRIPTION +\fBint inotify_rm_watch(int \fP\fIfd\fP\fB, int \fP\fIwd\fP\fB);\fP .SH 説明 -.\"O .BR inotify_rm_watch () -.\"O removes the watch associated with the watch descriptor -.\"O .I wd -.\"O from the inotify instance associated with the file descriptor -.\"O .IR fd . -.BR inotify_rm_watch () -は、監視対象ディスクリプタ (watch descriptor) -.I wd -に対応する監視アイテムを、 -ファイルディスクリプタ -.I fd -に対応する inotify インスタンスから削除する。 +\fBinotify_rm_watch\fP() は、監視対象ディスクリプタ (watch descriptor) \fIwd\fP に対応する監視アイテムを、 +ファイルディスクリプタ \fIfd\fP に対応する inotify インスタンスから削除する。 -.\"O Removing a watch causes an -.\"O .B IN_IGNORED -.\"O event to be generated for this watch descriptor. -.\"O (See -.\"O .BR inotify (7).) -監視対象を削除すると、 -この監視対象ディスクリプタに対して -.B IN_IGNORED -イベントが生成される -.RB ( inotify (7) -参照)。 -.\"O .SH "RETURN VALUE" +監視対象を削除すると、 この監視対象ディスクリプタに対して \fBIN_IGNORED\fP イベントが生成される (\fBinotify\fP(7) 参照)。 .SH 返り値 -.\"O On success, -.\"O .BR inotify_rm_watch () -.\"O returns zero, or \-1 if an error occurred (in which case, -.\"O .I errno -.\"O is set appropriately). -成功すると、 -.BR inotify_rm_watch () -は 0 を返す。 -エラーの場合、\-1 を返し、 -.I errno -を適切に設定する。 -.\"O .SH ERRORS +成功すると、 \fBinotify_rm_watch\fP() は 0 を返す。 エラーの場合、\-1 を返し、 \fIerrno\fP を適切に設定する。 .SH エラー -.TP -.B EBADF -.\"O .I fd -.\"O is not a valid file descriptor. -.I fd -が有効なファイルディスクリプタではない。 -.TP -.B EINVAL -.\"O The watch descriptor -.\"O .I wd -.\"O is not valid; or -.\"O .I fd -.\"O is not an inotify file descriptor. -監視対象ディスクリプタ -.I wd -が有効でない。もしくは、 -.I fd -が inotify ファイルディスクリプタではない。 -.\"O .SH VERSIONS +.TP +\fBEBADF\fP +\fIfd\fP が有効なファイルディスクリプタではない。 +.TP +\fBEINVAL\fP +監視対象ディスクリプタ \fIwd\fP が有効でない。もしくは、 \fIfd\fP が inotify ファイルディスクリプタではない。 .SH バージョン -.\"O Inotify was merged into the 2.6.13 Linux kernel. inotify は Linux カーネル 2.6.13 に組み込まれた。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O This system call is Linux-specific. このシステムコールは Linux 独自である。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR inotify_add_watch (2), -.BR inotify_init (2), -.BR inotify (7) +\fBinotify_add_watch\fP(2), \fBinotify_init\fP(2), \fBinotify\fP(7) diff --git a/draft/man2/intro.2 b/draft/man2/intro.2 index 14aa0a6b..ed640fc6 100644 --- a/draft/man2/intro.2 +++ b/draft/man2/intro.2 @@ -24,143 +24,47 @@ .\" new _syscall(2) page, and substantially enhanced and rewrote .\" the remaining material on this page. .\" -.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2008-02-10, Akihiro MOTOKI -.\" -.TH INTRO 2 2010-11-11 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH INTRO 2 2010\-11\-11 Linux "Linux Programmer's Manual" .SH 名前 -.\"O intro \- Introduction to system calls intro \- システムコールの説明 -.\"O .SH DESCRIPTION .SH 説明 -.\"O Section 2 of the manual describes the Linux system calls. -.\"O A system call is an entry point into the Linux kernel. -.\"O Usually, system calls are not invoked directly: -.\"O instead, most system calls have corresponding C library -.\"O wrapper functions which perform the steps required -.\"O (e.g., trapping to kernel mode) in order to invoke -.\"O the system call. -.\"O Thus, making a system call looks the same as invoking a normal -.\"O library function. -マニュアルの 2 章では Linux のシステムコールについて説明している。 -システムコールは Linux カーネルへのエントリポイントである。 -通常は、システムコールは直接起動される訳ではなく、 -ほとんどのシステムコールには対応する C ライブラリのラッパー関数があり、 -そのラッパー関数がシステムコールを呼び出すのに必要な処理を実行する。 -そのため、システムコールを呼び出すのは通常のライブラリ関数を呼び出すのと +マニュアルの 2 章では Linux のシステムコールについて説明している。 システムコールは Linux カーネルへのエントリポイントである。 +通常は、システムコールは直接起動される訳ではなく、 ほとんどのシステムコールには対応する C ライブラリのラッパー関数があり、 +そのラッパー関数がシステムコールを呼び出すのに必要な処理を実行する。 そのため、システムコールを呼び出すのは通常のライブラリ関数を呼び出すのと 同じように見える。 -.\"O For a list of the Linux system calls, see -.\"O .BR syscalls (2). -Linux のシステムコールのリストについては -.BR syscalls (2) -を参照のこと。 -.\"O .SH RETURN VALUE +Linux のシステムコールのリストについては \fBsyscalls\fP(2) を参照のこと。 .SH 返り値 -.\"O On error, most system calls return a negative error number -.\"O (i.e., the negated value of one of the constants described in -.\"O .BR errno (3)). -.\"O The C library wrapper hides this detail from the caller: when a -.\"O system call returns a negative value, the wrapper copies the -.\"O absolute value into the -.\"O .I errno -.\"O variable, and returns \-1 as the return value of the wrapper. -エラーの場合、ほとんどのシステムコールは負のエラー番号を返す -(具体的には -.BR errno (3) -で説明されている定数のいずれかを負にした値を返す)。 -C ライブラリのラッパーは呼び出し元からこうした詳細を隠蔽している。 -システムコールが負の値を返した場合、ラッパーは絶対値を -.I errno -変数にコピーし、ラッパーの返り値として \-1 を返す。 +エラーの場合、ほとんどのシステムコールは負のエラー番号を返す (具体的には \fBerrno\fP(3) +で説明されている定数のいずれかを負にした値を返す)。 C ライブラリのラッパーは呼び出し元からこうした詳細を隠蔽している。 +システムコールが負の値を返した場合、ラッパーは絶対値を \fIerrno\fP 変数にコピーし、ラッパーの返り値として \-1 を返す。 -.\"O The value returned by a successful system call depends on the call. -.\"O Many system calls return 0 on success, but some can return nonzero -.\"O values from a successful call. -.\"O The details are described in the individual manual pages. -成功時にシステムコールが返す値はシステムコールにより異なる。 -多くのシステムコールは成功時に 0 を返すが、 -成功時に 0 以外の値を返すシステムコールもある。 -詳細は個々のマニュアルページで説明されている。 +成功時にシステムコールが返す値はシステムコールにより異なる。 多くのシステムコールは成功時に 0 を返すが、 成功時に 0 +以外の値を返すシステムコールもある。 詳細は個々のマニュアルページで説明されている。 -.\"O In some cases, -.\"O the programmer must define a feature test macro in order to obtain -.\"O the declaration of a system call from the header file specified -.\"O in the man page SYNOPSIS section. -.\"O (Where required, these feature test macros must be defined before including -.\"O .I any -.\"O header files.) -.\"O In such cases, the required macro is described in the man page. -.\"O For further information on feature test macros, see -.\"O .BR feature_test_macros (7). -マニュアルページの「書式」の節に規定されたヘッダファイルから関数の定義を -得るために、プログラマが機能検査マクロを定義しなければならない場合がある -(機能検査マクロの定義が必要な場合、これらの機能検査マクロの定義は -「どの」ヘッダファイルのインクルードよりも前で行われなければならない)。 -このような場合には、必要なマクロがマニュアルページで説明されている。 -機能検査マクロのさらなる情報については、 -.BR feature_test_macros (7) -を参照のこと。 -.\"O .SH "CONFORMING TO" +マニュアルページの「書式」の節に規定されたヘッダファイルから関数の定義を 得るために、プログラマが機能検査マクロを定義しなければならない場合がある +(機能検査マクロの定義が必要な場合、これらの機能検査マクロの定義は 「どの」ヘッダファイルのインクルードよりも前で行われなければならない)。 +このような場合には、必要なマクロがマニュアルページで説明されている。 機能検査マクロのさらなる情報については、 +\fBfeature_test_macros\fP(7) を参照のこと。 .SH 準拠 -.\"O Certain terms and abbreviations are used to indicate UNIX variants -.\"O and standards to which calls in this section conform. -.\"O See -.\"O .BR standards (7). -この章の関数が準拠する UNIX システムや標準を示すのにいくつかの単語や略号が -使用されている。 -.BR standards (7) -を参照のこと。 -.\"O .SH NOTES +この章の関数が準拠する UNIX システムや標準を示すのにいくつかの単語や略号が 使用されている。 \fBstandards\fP(7) を参照のこと。 .SH 注意 -.\"O .SS "Calling Directly" -.SS "直接呼び出す" -.\"O In most cases, it is unnecessary to invoke a system call directly, -.\"O but there are times when the Standard C library does not implement -.\"O a nice wrapper function for you. -.\"O In this case, the programmer must manually invoke the system call using -.\"O .BR syscall (2). -.\"O Historically, this was also possible using one of the _syscall macros -.\"O described in -.\"O .BR _syscall (2). -ほとんどの場合、直接システムコールを呼び出す必要はないが、 -場合によっては標準 C ライブラリに適切な関数が実装されていないこともある。 -このような場合は、プログラマは -.BR syscall (2) -を使って、自分でシステムコールを呼び出さなければならない。 -過去には、 -.BR _syscall (2) -マクロの一つを使ってシステムコールの呼び出すこともできた。 -.\"O .SS Authors and Copyright Conditions -.SS "著者と著作権" -.\"O Look at the header of the manual page source for the author(s) and copyright -.\"O conditions. -.\"O Note that these can be different from page to page! -著者と著作権 (copyright) に関しては各マニュアル・ページのソースのヘッダを -見ること。これらはページごとに異っている。 -.\"O .SH "SEE ALSO" +.SS 直接呼び出す +ほとんどの場合、直接システムコールを呼び出す必要はないが、 場合によっては標準 C ライブラリに適切な関数が実装されていないこともある。 +このような場合は、プログラマは \fBsyscall\fP(2) を使って、自分でシステムコールを呼び出さなければならない。 過去には、 +\fB_syscall\fP(2) マクロの一つを使ってシステムコールの呼び出すこともできた。 +.SS 著者と著作権 +著者と著作権に関しては各マニュアルページのソースのヘッダを参照すること。 これらはページごとに異なる可能性があることに注意してほしい。 .SH 関連項目 .ad l .nh -.BR _syscall (2), -.BR syscall (2), -.BR syscalls (2), -.BR errno (3), -.BR intro (3), -.BR capabilities (7), -.BR credentials (7), -.BR feature_test_macros (7), -.BR mq_overview (7), -.BR path_resolution (7), -.BR pipe (7), -.BR pty (7), -.BR sem_overview (7), -.BR shm_overview (7), -.BR signal (7), -.BR svipc (7), -.BR standards (7), -.BR socket (7), -.BR symlink (7), -.BR time (7) +\fB_syscall\fP(2), \fBsyscall\fP(2), \fBsyscalls\fP(2), \fBerrno\fP(3), \fBintro\fP(3), +\fBcapabilities\fP(7), \fBcredentials\fP(7), \fBfeature_test_macros\fP(7), +\fBmq_overview\fP(7), \fBpath_resolution\fP(7), \fBpipe\fP(7), \fBpty\fP(7), +\fBsem_overview\fP(7), \fBshm_overview\fP(7), \fBsignal\fP(7), \fBsocket\fP(7), +\fBstandards\fP(7), \fBsvipc\fP(7), \fBsymlink\fP(7), \fBtime\fP(7) diff --git a/draft/man2/io_cancel.2 b/draft/man2/io_cancel.2 index 594ea65b..3663cf3f 100644 --- a/draft/man2/io_cancel.2 +++ b/draft/man2/io_cancel.2 @@ -2,18 +2,12 @@ .\" This file is distributed according to the GNU General Public License. .\" See the file COPYING in the top level source directory for details. .\" -.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI, all rights reserved. -.\" Translated Mon Mar 8 2003 by Akihiro MOTOKI -.\" -.\"WORD: operation 操作 -.\"WORD: completion queue 完了キュー -.\" .\" .de Sh \" Subsection .\" .br .\" .if t .Sp .\" .ne 5 .\" .PP -.\" \fB\\$1\fP +.\" \fB\$1\fP .\" .PP .\" .. .\" .de Sp \" Vertical space (when we can't use .PP) @@ -22,135 +16,75 @@ .\" .. .\" .de Ip \" List item .\" .br -.\" .ie \\n(.$>=3 .ne \\$3 +.\" .ie \n(.$>=3 .ne \$3 .\" .el .ne 3 -.\" .IP "\\$1" \\$2 +.\" .IP "\$1" \$2 .\" .. -.TH IO_CANCEL 2 2008-06-18 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O io_cancel \- cancel an outstanding asynchronous I/O operation +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH IO_CANCEL 2 2008\-06\-18 Linux "Linux Programmer's Manual" .SH 名前 io_cancel \- 未処理の非同期 I/O 操作の取り消し -.\"O .SH "SYNOPSIS" .SH 書式 .nf .\" .ad l .\" .hy 0 .\" -.B #include .\"#include +\fB#include \fP .sp .\" .HP 16 -.BI "int io_cancel(aio_context_t " ctx_id ", struct iocb *" iocb , -.BI " struct io_event *" result ); .\" .ad .\" .hy +\fBint io_cancel(aio_context_t \fP\fIctx_id\fP\fB, struct iocb *\fP\fIiocb\fP\fB,\fP +\fB struct io_event *\fP\fIresult\fP\fB);\fP .sp -.\"O Link with \fI\-laio\fP. \fI\-laio\fP とリンクする。 .fi -.\"O .SH "DESCRIPTION" .SH 説明 .PP -.\"O .BR io_cancel () -.\"O attempts to cancel an asynchronous I/O operation previously submitted with -.\"O .BR io_submit (2). -.\"O \fIctx_id\fP is the AIO context ID of the operation to be canceled. -.\"O If the AIO context is found, the event will be canceled and then copied -.\"O into the memory pointed to by \fIresult\fP without being placed -.\"O into the completion queue. -.BR io_cancel () -は、過去に -.BR io_submit (2) -を使って登録された非同期 I/O (AIO) 操作の取り消しを行おうとする。 -\fIctx_id\fP は、取り消しを行う操作の AIO コンテキストの ID である。 -指定した AIO コンテキストが見つかると、 -対象のイベントの取り消しが行われ、その後 \fIresult\fP で指されたメモリに -コピーされる (このとき、完了キューへの移動は行われない)。 -.\"O .SH "RETURN VALUE" +\fBio_cancel\fP() は、過去に \fBio_submit\fP(2) を使って登録された非同期 I/O (AIO) +操作の取り消しを行おうとする。 \fIctx_id\fP は、取り消しを行う操作の AIO コンテキストの ID である。 指定した AIO +コンテキストが見つかると、 対象のイベントの取り消しが行われ、その後 \fIresult\fP で指されたメモリに コピーされる +(このとき、完了キューへの移動は行われない)。 .SH 返り値 -.\"O On success, -.\"O .BR io_cancel () -.\"O returns 0. -.\"O For the failure return, see NOTES. -成功した場合、 -.BR io_cancel () -は 0 を返す。 -失敗時の返り値については、「注意」の節を参照すること。 -.\"O .SH "ERRORS" +成功した場合、 \fBio_cancel\fP() は 0 を返す。 失敗時の返り値については、「注意」の節を参照すること。 .SH エラー -.TP -.B EAGAIN -.\"O The \fIiocb\fP specified was not canceled. +.TP +\fBEAGAIN\fP 指定された \fIiocb\fP の取り消しが行われなかった。 -.TP -.B EFAULT -.\"O One of the data structures points to invalid data. +.TP +\fBEFAULT\fP データ構造の中に無効なデータを指しているものがある。 -.TP -.B EINVAL -.\"O The AIO context specified by \fIctx_id\fP is invalid. +.TP +\fBEINVAL\fP \fIctx_id\fP で指定された AIO コンテキストが無効である。 -.TP -.B ENOSYS -.\"O .BR io_cancel () -.\"O is not implemented on this architecture. -.BR io_cancel () -はこのアーキテクチャでは実装されていない。 -.\"O .SH "VERSIONS" +.TP +\fBENOSYS\fP +\fBio_cancel\fP() はこのアーキテクチャでは実装されていない。 .SH バージョン .PP -.\"O The asynchronous I/O system calls first appeared in Linux 2.5, August 2002. 非同期 I/O システム・コールは 2002年8月に Linux 2.5 で初めて登場した。 -.\"O .SH "CONFORMING TO" .SH 準拠 .PP -.\"O .BR io_cancel () -.\"O is Linux-specific and should not be used -.\"O in programs that are intended to be portable. -.BR io_cancel () -は Linux 固有であり、移植を想定したプログラムで使用すべきではない。 -.\"O .SH NOTES +\fBio_cancel\fP() は Linux 固有であり、移植を想定したプログラムで使用すべきではない。 .SH 注意 -.\"O Glibc does not provide a wrapper function for this system call. glibc はこのシステムコール用のラッパー関数を提供していない。 -.\"O The wrapper provided in -.\"O .I libaio -.\"O for -.\"O .BR io_cancel () -.\"O does not follow the usual C library conventions for indicating error: -.\"O on error it returns a negated error number -.\"O (the negative of one of the values listed in ERRORS). -.\"O If the system call is invoked via -.\"O .BR syscall (2), -.\"O then the return value follows the usual conventions for -.\"O indicating an error: \-1, with -.\"O .I errno -.\"O set to a (positive) value that indicates the error. -.I libaio -で -.BR io_cancel () -用に提供されているラッパー関数は、エラーの通知が通常の C ライブラリの -慣習にしたがっておらず、エラーの場合には負のエラー番号 -(エラーの節に列挙されている値の一つを負にしたもの) が返り値となる。 -.BR syscall (2) -経由でシステムコールを起動すると、返り値は通常のエラー通知の慣習に -したがってものとなり、エラーの場合には \-1 が返り、 -.I errno -にエラーを示す (正の) 値が設定される。 -.\"O .SH "SEE ALSO" +\fIlibaio\fP で \fBio_cancel\fP() 用に提供されているラッパー関数は、エラーの通知が通常の C ライブラリの +慣習にしたがっておらず、エラーの場合には負のエラー番号 (エラーの節に列挙されている値の一つを負にしたもの) が返り値となる。 +\fBsyscall\fP(2) 経由でシステムコールを起動すると、返り値は通常のエラー通知の慣習に したがってものとなり、エラーの場合には \-1 が返り、 +\fIerrno\fP にエラーを示す (正の) 値が設定される。 .SH 関連項目 -.BR io_destroy (2), -.BR io_getevents (2), -.BR io_setup (2), -.BR io_submit (2), -.BR aio (7) -.\"O .\" .SH "NOTES" -.\" .SH 注 +\fBio_destroy\fP(2), \fBio_getevents\fP(2), \fBio_setup\fP(2), \fBio_submit\fP(2), +\fBaio\fP(7) +.\" .SH "NOTES" +.\" .\" .PP -.\"O .\" The asynchronous I/O system calls were written by Benjamin LaHaise. -.\" 非同期 I/O システム・コールは Benjamin LaHaise が書いた。 -.\"O .\" .SH AUTHOR -.\" .SH 著者 +.\" The asynchronous I/O system calls were written by Benjamin LaHaise. +.\" +.\" .SH AUTHOR .\" Kent Yoder. diff --git a/draft/man2/io_destroy.2 b/draft/man2/io_destroy.2 index 9c3c062d..23bdba09 100644 --- a/draft/man2/io_destroy.2 +++ b/draft/man2/io_destroy.2 @@ -2,15 +2,12 @@ .\" This file is distributed according to the GNU General Public License. .\" See the file COPYING in the top level source directory for details. .\" -.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI, all rights reserved. -.\" Translated Mon Mar 8 2003 by Akihiro MOTOKI -.\" .\" .de Sh \" Subsection .\" .br .\" .if t .Sp .\" .ne 5 .\" .PP -.\" \fB\\$1\fP +.\" \fB\$1\fP .\" .PP .\" .. .\" .de Sp \" Vertical space (when we can't use .PP) @@ -19,127 +16,68 @@ .\" .. .\" .de Ip \" List item .\" .br -.\" .ie \\n(.$>=3 .ne \\$3 +.\" .ie \n(.$>=3 .ne \$3 .\" .el .ne 3 -.\" .IP "\\$1" \\$2 +.\" .IP "\$1" \$2 .\" .. -.TH IO_DESTROY 2 2008-06-18 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O io_destroy \- destroy an asynchronous I/O context +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH IO_DESTROY 2 2008\-06\-18 Linux "Linux Programmer's Manual" .SH 名前 io_destroy \- 非同期 I/O コンテキストの消去 -.\"O .SH "SYNOPSIS" .SH 書式 .nf .\" .ad l .\" .hy 0 -.B #include .\" #include +\fB#include \fP .sp .\" .HP 17 -.BI "int io_destroy(aio_context_t " ctx ); .\" .ad .\" .hy +\fBint io_destroy(aio_context_t \fP\fIctx\fP\fB);\fP .sp -.\"O Link with \fI\-laio\fP. \fI\-laio\fP とリンクする。 .fi -.\"O .SH "DESCRIPTION" .SH 説明 .PP -.\"O .BR io_destroy () -.\"O removes the asynchronous I/O context from the list of -.\"O I/O contexts and then destroys it. -.\"O .BR io_destroy () -.\"O can also cancel any outstanding asynchronous I/O -.\"O actions on \fIctx\fP and block on completion. -.BR io_destroy () -は、I/O コンテキストのリストから指定された非同期 I/O -コンテキストを削除した後、そのコンテキストを消去する。 -.BR io_destroy () -は、\fIctx\fP 上に未処理の非同期 I/O 命令及び -完了キューのブロックの取り消しも行うことができる。 -.\"O .SH "RETURN VALUE" +\fBio_destroy\fP() は、I/O コンテキストのリストから指定された非同期 I/O コンテキストを削除した後、そのコンテキストを消去する。 +\fBio_destroy\fP() は、\fIctx\fP 上に未処理の非同期 I/O 命令及び 完了キューのブロックの取り消しも行うことができる。 .SH 返り値 -.\"O On success, -.\"O .BR io_destroy () -.\"O returns 0. -.\"O For the failure return, see NOTES. -成功した場合、 -.BR io_destroy () -は 0 を返す。 -失敗時の返り値については、「注意」の節を参照すること。 -.\"O .SH "ERRORS" +成功した場合、 \fBio_destroy\fP() は 0 を返す。 失敗時の返り値については、「注意」の節を参照すること。 .SH エラー -.TP -.B EFAULT -.\"O The context pointed to is invalid. -.\"motoki: 分かりにくいので、io_cancel.2 から流用。おそらく同じ意味。 +.TP +\fBEFAULT\fP データ構造の中に無効なデータを指しているものがある。 -.TP -.B EINVAL -.\"O The AIO context specified by \fIctx\fP is invalid. +.TP +\fBEINVAL\fP \fIctx\fP で指定された AIO コンテキストが無効である。 -.TP -.B ENOSYS -.\"O .BR io_destroy () -.\"O is not implemented on this architecture. -.BR io_destroy () -はこのアーキテクチャでは実装されていない。 -.\"O .SH "VERSIONS" +.TP +\fBENOSYS\fP +\fBio_destroy\fP() はこのアーキテクチャでは実装されていない。 .SH バージョン .PP -.\"O The asynchronous I/O system calls first appeared in Linux 2.5, August 2002. 非同期 I/O システム・コールは 2002年8月に Linux 2.5 で初めて登場した。 -.\"O .SH "CONFORMING TO" .SH 準拠 .PP -.\"O .BR io_destroy () -.\"O is Linux-specific and should not be used in programs -.\"O that are intended to be portable. -.BR io_destroy () -は Linux 固有であり、移植を想定したプログラムで使用すべきではない。 -.\"O .SH NOTES +\fBio_destroy\fP() は Linux 固有であり、移植を想定したプログラムで使用すべきではない。 .SH 注意 -.\"O Glibc does not provide a wrapper function for this system call. glibc はこのシステムコール用のラッパー関数を提供していない。 -.\"O The wrapper provided in -.\"O .I libaio -.\"O for -.\"O .BR io_destroy () -.\"O does not follow the usual C library conventions for indicating error: -.\"O on error it returns a negated error number -.\"O (the negative of one of the values listed in ERRORS). -.\"O If the system call is invoked via -.\"O .BR syscall (2), -.\"O then the return value follows the usual conventions for -.\"O indicating an error: \-1, with -.\"O .I errno -.\"O set to a (positive) value that indicates the error. -.I libaio -で -.BR io_destroy () -用に提供されているラッパー関数は、エラーの通知が通常の C ライブラリの -慣習にしたがっておらず、エラーの場合には負のエラー番号 -(エラーの節に列挙されている値の一つを負にしたもの) が返り値となる。 -.BR syscall (2) -経由でシステムコールを起動すると、返り値は通常のエラー通知の慣習に -したがってものとなり、エラーの場合には \-1 が返り、 -.I errno -にエラーを示す (正の) 値が設定される。 -.\"O .SH "SEE ALSO" +\fIlibaio\fP で \fBio_destroy\fP() 用に提供されているラッパー関数は、エラーの通知が通常の C ライブラリの +慣習にしたがっておらず、エラーの場合には負のエラー番号 (エラーの節に列挙されている値の一つを負にしたもの) が返り値となる。 +\fBsyscall\fP(2) 経由でシステムコールを起動すると、返り値は通常のエラー通知の慣習に したがってものとなり、エラーの場合には \-1 が返り、 +\fIerrno\fP にエラーを示す (正の) 値が設定される。 .SH 関連項目 -.BR io_cancel (2), -.BR io_getevents (2), -.BR io_setup (2), -.BR io_submit (2), -.BR aio (7) -.\"O .\" .SH "NOTES" -.\" .SH 注 +\fBio_cancel\fP(2), \fBio_getevents\fP(2), \fBio_setup\fP(2), \fBio_submit\fP(2), +\fBaio\fP(7) +.\" .SH "NOTES" +.\" .\" .PP -.\"O .\" The asynchronous I/O system calls were written by Benjamin LaHaise. -.\" 非同期 I/O システム・コールは Benjamin LaHaise が書いた。 -.\"O .\" .SH AUTHOR -.\" .SH 著者 +.\" The asynchronous I/O system calls were written by Benjamin LaHaise. +.\" +.\" .SH AUTHOR .\" Kent Yoder. diff --git a/draft/man2/io_getevents.2 b/draft/man2/io_getevents.2 index 3ed93042..20e1a44c 100644 --- a/draft/man2/io_getevents.2 +++ b/draft/man2/io_getevents.2 @@ -2,17 +2,12 @@ .\" This file is distributed according to the GNU General Public License. .\" See the file COPYING in the top level source directory for details. .\" -.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI, all rights reserved. -.\" Translated Mon Mar 8 2003 by Akihiro MOTOKI -.\" -.\"WORD: completion queue 完了キュー -.\" .\" .de Sh \" Subsection .\" .br .\" .if t .Sp .\" .ne 5 .\" .PP -.\" \fB\\$1\fP +.\" \fB\$1\fP .\" .PP .\" .. .\" .de Sp \" Vertical space (when we can't use .PP) @@ -21,153 +16,77 @@ .\" .. .\" .de Ip \" List item .\" .br -.\" .ie \\n(.$>=3 .ne \\$3 +.\" .ie \n(.$>=3 .ne \$3 .\" .el .ne 3 -.\" .IP "\\$1" \\$2 +.\" .IP "\$1" \$2 .\" .. -.TH IO_GETEVENTS 2 2008-07-04 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH IO_GETEVENTS 2 2008\-07\-04 Linux "Linux Programmer's Manual" .SH 名前 -.\"O io_getevents \- read asynchronous I/O events from the completion queue io_getevents \- 完了キューから非同期 I/O イベントを読み出す -.\"O .SH "SYNOPSIS" .SH 書式 .nf .\" .ad l .\" .hy 0 -.B #include -.B #include .\" #include +\fB#include \fP +\fB#include \fP .sp .\" .HP 19 -.BI "int io_getevents(aio_context_t " ctx_id ", long " min_nr ", long " nr , -.BI " struct io_event *" events \ -", struct timespec *" timeout ); .\" .ad .\" .hy +\fBint io_getevents(aio_context_t \fP\fIctx_id\fP\fB, long \fP\fImin_nr\fP\fB, long \fP\fInr\fP\fB,\fP +\fB struct io_event *\fP\fIevents\fP\fB, struct timespec *\fP\fItimeout\fP\fB);\fP .sp -.\"O Link with \fI\-laio\fP. \fI\-laio\fP とリンクする。 .fi -.\"O .SH "DESCRIPTION" .SH 説明 .PP -.\"O .BR io_getevents () -.\"O attempts to read at least \fImin_nr\fP events and -.\"O up to \fInr\fP events from the completion queue of the AIO context -.\"O specified by \fIctx_id\fP. -.BR io_getevents () -は、少なくとも \fImin_nr\fP の、最大 \fInr\fP 個の -イベントを、 \fIctx_id\fP で指定された AIO (非同期 I/O) コンテキストの -完了キューから読み出そうとする。 -.\"O \fItimeout\fP specifies the amount of time to wait for events, -.\"O where a NULL timeout waits until at least \fImin_nr\fP events -.\"O have been seen. -\fItimeout\fP はイベント読み出しの待ち時間の合計を指定する。 -タイムアウトに NULL を指定した場合、少なくとも \fImin_nr\fP 個のイベントが -読み出されるまで待つことを意味する。 -.\"O Note that \fItimeout\fP is relative and will be updated if not NULL -.\"O and the operation blocks. -注意点を以下にあげる: -\fItimeout\fP は相対的な指定である。 -NULL でない場合更新されることもありえる。 -呼び出し元の動作は停止する。 -.\"O .SH "RETURN VALUE" +\fBio_getevents\fP() は、少なくとも \fImin_nr\fP の、最大 \fInr\fP 個の イベントを、 \fIctx_id\fP で指定された +AIO (非同期 I/O) コンテキストの 完了キューから読み出そうとする。 \fItimeout\fP はイベント読み出しの待ち時間の合計を指定する。 +タイムアウトに NULL を指定した場合、少なくとも \fImin_nr\fP 個のイベントが 読み出されるまで待つことを意味する。 注意点を以下にあげる: +\fItimeout\fP は相対的な指定である。 NULL でない場合更新されることもありえる。 呼び出し元の動作は停止する。 .SH 返り値 -.\"O On success, -.\"O .BR io_getevents () -.\"O returns the number of events read: 0 if no events are -.\"O available, or less than \fImin_nr\fP if the \fItimeout\fP has elapsed. -.\"O For the failure return, see NOTES. -成功すると、 -.BR io_getevents () -は読み出したイベント数を返す。 -イベントが一つも読み出されなかった場合は 0 が返され、 -\fItimeout\fP 時間が経過した場合は \fImin_nr\fP 未満の値が返される。 -失敗時の返り値については、「注意」の節を参照すること。 -.\"O .SH "ERRORS" +成功すると、 \fBio_getevents\fP() は読み出したイベント数を返す。 イベントが一つも読み出されなかった場合は 0 が返され、 +\fItimeout\fP 時間が経過した場合は \fImin_nr\fP 未満の値が返される。 失敗時の返り値については、「注意」の節を参照すること。 .SH エラー -.TP -.B EFAULT -.\"O Either \fIevents\fP or \fItimeout\fP is an invalid pointer. +.TP +\fBEFAULT\fP \fIevents\fP または \fItimeout\fP が無効なポインタである。 -.TP -.B EINVAL -.\"O \fIctx_id\fP is invalid. -.\"O \fImin_nr\fP is out of range or \fInr\fP is -.\"O out of range. -\fIctx_id\fP が無効である。もしくは、\fImin_nr\fP または \fInr\fP が -範囲外の値である。 -.TP -.B EINTR -.\"O Interrupted by a signal handler; see -.\"O .BR signal (7). -シグナルハンドラにより割り込まれた。 -.BR signal (7) -参照。 -.TP -.B ENOSYS -.\"O .BR io_getevents () -.\"O is not implemented on this architecture. -.BR io_getevents () -がこのアーキテクチャでは実装されていない。 -.\"O .SH "VERSIONS" +.TP +\fBEINVAL\fP +\fIctx_id\fP が無効である。もしくは、\fImin_nr\fP または \fInr\fP が 範囲外の値である。 +.TP +\fBEINTR\fP +シグナルハンドラにより割り込まれた。 \fBsignal\fP(7) 参照。 +.TP +\fBENOSYS\fP +\fBio_getevents\fP() がこのアーキテクチャでは実装されていない。 .SH バージョン .PP -.\"O The asynchronous I/O system calls first appeared in Linux 2.5, August 2002. 非同期 I/O システム・コールは 2002年8月に Linux 2.5 で初めて登場した。 -.\"O .SH "CONFORMING TO" .SH 準拠 .PP -.\"O .BR io_getevents () -.\"O is Linux-specific and should not be used in -.\"O programs that are intended to be portable. -.BR io_getevents () -は Linux 固有であり、移植を想定したプログラムで -使用すべきではない。 -.\"O .SH NOTES +\fBio_getevents\fP() は Linux 固有であり、移植を想定したプログラムで 使用すべきではない。 .SH 注意 -.\"O Glibc does not provide a wrapper function for this system call. glibc はこのシステムコール用のラッパー関数を提供していない。 -.\"O The wrapper provided in -.\"O .I libaio -.\"O for -.\"O .BR io_getevents () -.\"O does not follow the usual C library conventions for indicating error: -.\"O on error it returns a negated error number -.\"O (the negative of one of the values listed in ERRORS). -.\"O If the system call is invoked via -.\"O .BR syscall (2), -.\"O then the return value follows the usual conventions for -.\"O indicating an error: \-1, with -.\"O .I errno -.\"O set to a (positive) value that indicates the error. -.I libaio -で -.BR io_getevents () -用に提供されているラッパー関数は、エラーの通知が通常の C ライブラリの -慣習にしたがっておらず、エラーの場合には負のエラー番号 -(エラーの節に列挙されている値の一つを負にしたもの) が返り値となる。 -.BR syscall (2) -経由でシステムコールを起動すると、返り値は通常のエラー通知の慣習に -したがってものとなり、エラーの場合には \-1 が返り、 -.I errno -にエラーを示す (正の) 値が設定される。 -.\"O .SH "SEE ALSO" +\fIlibaio\fP で \fBio_getevents\fP() 用に提供されているラッパー関数は、エラーの通知が通常の C ライブラリの +慣習にしたがっておらず、エラーの場合には負のエラー番号 (エラーの節に列挙されている値の一つを負にしたもの) が返り値となる。 +\fBsyscall\fP(2) 経由でシステムコールを起動すると、返り値は通常のエラー通知の慣習に したがってものとなり、エラーの場合には \-1 が返り、 +\fIerrno\fP にエラーを示す (正の) 値が設定される。 .SH 関連項目 .PP -.BR io_cancel (2), -.BR io_destroy (2), -.BR io_setup (2), -.BR io_submit (2), -.BR aio (7), -.BR time (7) -.\"O .\" .SH "NOTES" -.\" .SH 注 +\fBio_cancel\fP(2), \fBio_destroy\fP(2), \fBio_setup\fP(2), \fBio_submit\fP(2), +\fBaio\fP(7), \fBtime\fP(7) +.\" .SH "NOTES" +.\" .\" .PP -.\"O .\" The asynchronous I/O system calls were written by Benjamin LaHaise. -.\" 非同期 I/O システム・コールは Benjamin LaHaise が書いた。 -.\"O .\" .SH AUTHOR -.\" .SH 著者 +.\" The asynchronous I/O system calls were written by Benjamin LaHaise. +.\" +.\" .SH AUTHOR .\" Kent Yoder. diff --git a/draft/man2/io_setup.2 b/draft/man2/io_setup.2 index a1a09aa7..ce39149f 100644 --- a/draft/man2/io_setup.2 +++ b/draft/man2/io_setup.2 @@ -2,15 +2,12 @@ .\" This file is distributed according to the GNU General Public License. .\" See the file COPYING in the top level source directory for details. .\" -.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI, all rights reserved. -.\" Translated Mon Mar 8 2003 by Akihiro MOTOKI -.\" .\" .de Sh \" Subsection .\" .br .\" .if t .Sp .\" .ne 5 .\" .PP -.\" \fB\\$1\fP +.\" \fB\$1\fP .\" .PP .\" .. .\" .de Sp \" Vertical space (when we can't use .PP) @@ -19,143 +16,75 @@ .\" .. .\" .de Ip \" List item .\" .br -.\" .ie \\n(.$>=3 .ne \\$3 +.\" .ie \n(.$>=3 .ne \$3 .\" .el .ne 3 -.\" .IP "\\$1" \\$2 +.\" .IP "\$1" \$2 .\" .. -.TH IO_SETUP 2 2003-06-18 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O io_setup \- create an asynchronous I/O context +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH IO_SETUP 2 2008\-06\-18 Linux "Linux Programmer's Manual" .SH 名前 io_setup \- 非同期 I/O コンテキストを作成する -.\"O .SH "SYNOPSIS" .SH 書式 .nf .\" .ad l .\" .hy 0 -.B #include .\" #include +\fB#include \fP .sp .\" .HP 15 -.BI "int io_setup(unsigned " nr_events ", aio_context_t *" ctxp ); .\" .ad .\" .hy +\fBint io_setup(unsigned \fP\fInr_events\fP\fB, aio_context_t *\fP\fIctxp\fP\fB);\fP .sp -.\"O Link with \fI\-laio\fP. \fI\-laio\fP とリンクする。 .fi -.\"O .SH "DESCRIPTION" .SH 説明 .PP -.\"O .BR io_setup () -.\"O creates an asynchronous I/O context capable of receiving -.\"O at least \fInr_events\fP. -.BR io_setup () -は、少なくとも \fInr_events\fP 個のイベントを受信可能な -非同期 I/O (AIO) コンテキストの作成を行う。 -.\"O \fIctxp\fP must not point to an AIO context that already exists, and must -.\"O be initialized to 0 prior to the call. -\fIctxp\fP は、すでに存在する AIO コンテキストを指していてはならず、 -.BR io_setup () -の呼び出しの前に 0 に初期化されていなければならない。 -.\"O On successful creation of the AIO context, \fI*ctxp\fP is filled in -.\"O with the resulting handle. -AIO コンテキストの作成に成功すると、\fI*ctxp\fP に作成された -AIO コンテキストへのポインタがセットされる。 -.\"O .SH "RETURN VALUE" +\fBio_setup\fP() は、少なくとも \fInr_events\fP 個のイベントを受信可能な 非同期 I/O (AIO) コンテキストの作成を行う。 +\fIctxp\fP は、すでに存在する AIO コンテキストを指していてはならず、 \fBio_setup\fP() の呼び出しの前に 0 +に初期化されていなければならない。 AIO コンテキストの作成に成功すると、\fI*ctxp\fP に作成された AIO +コンテキストへのポインタがセットされる。 .SH 返り値 -.\"O On success, -.\"O .BR io_setup () -.\"O returns 0. -.\"O For the failure return, see NOTES. -成功した場合、 -.BR io_setup () -は 0 を返す。 -失敗時の返り値については、「注意」の節を参照すること。 -.\"O .SH "ERRORS" +成功した場合、 \fBio_setup\fP() は 0 を返す。 失敗時の返り値については、「注意」の節を参照すること。 .SH エラー -.TP -.B EAGAIN -.\"O The specified \fInr_events\fP exceeds the user's limit of available events. +.TP +\fBEAGAIN\fP 指定された \fInr_events\fP がユーザが使用できるイベント数の上限を越えている。 -.TP -.B EFAULT -.\"O An invalid pointer is passed for \fIctxp\fP. +.TP +\fBEFAULT\fP \fIctxp\fP に無効なポインタが指定されている。 -.TP -.B EINVAL -.\"O \fIctxp\fP is not initialized, or the specified \fInr_events\fP -.\"O exceeds internal limits. -.\"O \fInr_events\fP should be greater than 0. -\fIctxp\fP が初期化されていないか、指定された \fInr_events\fP が -内部の制限値を越えている。また、 \fInr_events\fP は 0 より大きい値に -設定すべきである。 -.TP -.B ENOMEM -.\"O Insufficient kernel resources are available. +.TP +\fBEINVAL\fP +\fIctxp\fP が初期化されていないか、指定された \fInr_events\fP が 内部の制限値を越えている。また、 \fInr_events\fP は 0 +より大きい値に 設定すべきである。 +.TP +\fBENOMEM\fP 必要なカーネル・リソースを得られない。 -.TP -.B ENOSYS -.\"O .BR io_setup () -.\"O is not implemented on this architecture. -.BR io_setup () -がこのアーキテクチャでは実装されていない。 -.\"O .SH "VERSIONS" +.TP +\fBENOSYS\fP +\fBio_setup\fP() がこのアーキテクチャでは実装されていない。 .SH バージョン .PP -.\"O The asynchronous I/O system calls first appeared in Linux 2.5, August 2002. 非同期 I/O システム・コールは 2002年8月に Linux 2.5 で初めて登場した。 -.\"O .SH "CONFORMING TO" .SH 準拠 .PP -.\"O .BR io_setup () -.\"O is Linux-specific and should not be used in programs -.\"O that are intended to be portable. -.BR io_setup () -は Linux 固有であり、移植を想定したプログラムで -使用すべきではない。 -.\"O .SH NOTES +\fBio_setup\fP() は Linux 固有であり、移植を想定したプログラムで 使用すべきではない。 .SH 注意 -.\"O Glibc does not provide a wrapper function for this system call. glibc はこのシステムコール用のラッパー関数を提供していない。 -.\"O The wrapper provided in -.\"O .I libaio -.\"O for -.\"O .BR io_setup () -.\"O does not follow the usual C library conventions for indicating error: -.\"O on error it returns a negated error number -.\"O (the negative of one of the values listed in ERRORS). -.\"O If the system call is invoked via -.\"O .BR syscall (2), -.\"O then the return value follows the usual conventions for -.\"O indicating an error: \-1, with -.\"O .I errno -.\"O set to a (positive) value that indicates the error. -.I libaio -で -.BR io_setup () -用に提供されているラッパー関数は、エラーの通知が通常の C ライブラリの -慣習にしたがっておらず、エラーの場合には負のエラー番号 -(エラーの節に列挙されている値の一つを負にしたもの) が返り値となる。 -.BR syscall (2) -経由でシステムコールを起動すると、返り値は通常のエラー通知の慣習に -したがってものとなり、エラーの場合には \-1 が返り、 -.I errno -にエラーを示す (正の) 値が設定される。 -.\"O .SH "SEE ALSO" +\fIlibaio\fP で \fBio_setup\fP() 用に提供されているラッパー関数は、エラーの通知が通常の C ライブラリの +慣習にしたがっておらず、エラーの場合には負のエラー番号 (エラーの節に列挙されている値の一つを負にしたもの) が返り値となる。 +\fBsyscall\fP(2) 経由でシステムコールを起動すると、返り値は通常のエラー通知の慣習に したがってものとなり、エラーの場合には \-1 が返り、 +\fIerrno\fP にエラーを示す (正の) 値が設定される。 .SH 関連項目 -.PP -.BR io_cancel (2), -.BR io_destroy (2), -.BR io_getevents (2), -.BR io_submit (2), -.BR aio (7) -.\"O .\" .SH "NOTES" -.\" .SH 注 +\fBio_cancel\fP(2), \fBio_destroy\fP(2), \fBio_getevents\fP(2), \fBio_submit\fP(2), +\fBaio\fP(7) +.\" .SH "NOTES" .\" .PP -.\"O .\" The asynchronous I/O system calls were written by Benjamin LaHaise. -.\" 非同期 I/O システム・コールは Benjamin LaHaise が書いた。 -.\"O .\" .SH AUTHOR -.\" .SH 著者 +.\" The asynchronous I/O system calls were written by Benjamin LaHaise. +.\" .SH AUTHOR .\" Kent Yoder. diff --git a/draft/man2/io_submit.2 b/draft/man2/io_submit.2 index 58c276df..8b588fd5 100644 --- a/draft/man2/io_submit.2 +++ b/draft/man2/io_submit.2 @@ -2,15 +2,12 @@ .\" This file is distributed according to the GNU General Public License. .\" See the file COPYING in the top level source directory for details. .\" -.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI, all rights reserved. -.\" Translated Mon Mar 8 2003 by Akihiro MOTOKI -.\" .\" .de Sh \" Subsection .\" .br .\" .if t .Sp .\" .ne 5 .\" .PP -.\" \fB\\$1\fP +.\" \fB\$1\fP .\" .PP .\" .. .\" .de Sp \" Vertical space (when we can't use .PP) @@ -19,144 +16,74 @@ .\" .. .\" .de Ip \" List item .\" .br -.\" .ie \\n(.$>=3 .ne \\$3 +.\" .ie \n(.$>=3 .ne \$3 .\" .el .ne 3 -.\" .IP "\\$1" \\$2 +.\" .IP "\$1" \$2 .\" .. -.TH IO_SUBMIT 2 2008-06-18 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O io_submit \- submit asynchronous I/O blocks for processing +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH IO_SUBMIT 2 2008\-06\-18 Linux "Linux Programmer's Manual" .SH 名前 io_submit \- 非同期 I/O ブロックを処理待ちキューに登録する -.\"O .SH "SYNOPSIS" .SH 書式 .nf .\" .ad l .\" .hy 0 -.B #include .\" #include +\fB#include \fP .sp .\" .HP 16 -.BI "int io_submit(aio_context_t " ctx_id ", long " nr \ -", struct iocb **" iocbpp ); .\" .ad .\" .hy +\fBint io_submit(aio_context_t \fP\fIctx_id\fP\fB, long \fP\fInr\fP\fB, struct iocb **\fP\fIiocbpp\fP\fB);\fP .sp -.\"O Link with \fI\-laio\fP. \fI\-laio\fP とリンクする。 .fi -.\"O .SH "DESCRIPTION" .SH 説明 .PP -.\"O .BR io_submit () -.\"O queues \fInr\fP I/O request blocks for processing in -.\"O the AIO context \fIctx_id\fP. -.\"O \fIiocbpp\fP should be an array of \fInr\fP AIO control blocks, -.\"O which will be submitted to context \fIctx_id\fP. -.BR io_submit () -は、AIO コンテキスト \fIctx_id\fP に \fInr\fP 個の I/O -リクエストを処理待ちとしてキューに追加する。 -\fIiocbpp\fP は、AIO コンテキスト \fIctx_id\fP に登録される \fInr\fP 個の -AIO 制御ブロックの配列になっていなければならない。 -.\"O .SH "RETURN VALUE" +\fBio_submit\fP() は、AIO コンテキスト \fIctx_id\fP に \fInr\fP 個の I/O リクエストを処理待ちとしてキューに追加する。 +\fIiocbpp\fP は、AIO コンテキスト \fIctx_id\fP に登録される \fInr\fP 個の AIO 制御ブロックの配列になっていなければならない。 .SH 返り値 -.\"O On success, -.\"O .BR io_submit () -.\"O returns the number of \fIiocb\fPs submitted (which may be -.\"O 0 if \fInr\fP is zero). -.\"O For the failure return, see NOTES. -成功すると、 -.BR io_submit () -は登録した \fIiocb\fP の個数を返す -(\fInr\fP が 0 の場合は 0 を返す)。 +成功すると、 \fBio_submit\fP() は登録した \fIiocb\fP の個数を返す (\fInr\fP が 0 の場合は 0 を返す)。 失敗時の返り値については、「注意」の節を参照すること。 -.\"O .SH "ERRORS" .SH エラー -.TP -.B EAGAIN -.\"O Insufficient resources are available to queue any \fIiocb\fPs. +.TP +\fBEAGAIN\fP 何個かの \fIiocb\fP をキューに入れるのに必要なリソースが得られない。 -.TP -.B EBADF -.\"O The file descriptor specified in the first \fIiocb\fP is invalid. +.TP +\fBEBADF\fP 先頭の \fIiocb\fP に指定されたファイル・ディスクリプタが無効である。 -.TP -.B EFAULT -.\"O One of the data structures points to invalid data. +.TP +\fBEFAULT\fP データ構造の中に無効なデータを指しているものがある。 -.TP -.B EINVAL -.\"O The \fIaio_context\fP specified by \fIctx_id\fP is invalid. -.\"O \fInr\fP is less than 0. -.\"O The \fIiocb\fP at *iocbpp[0] is not properly initialized, -.\"O or the operation specified is invalid for the file descriptor -.\"O in the \fIiocb\fP. -\fIctx_id\fP で指定された \fIaio_context\fP が無効である。 -\fInr\fP が 0 未満である。 -*iocbpp[0] の \fIiocb\fP が適切に初期化されていないか、 -指定された操作がその \fIiocb\fP 中のファイル・ディスクリプタに対して -無効である。 -.TP -.B ENOSYS -.\"O .BR io_submit () -.\"O is not implemented on this architecture. -.BR io_submit () -はこのアーキテクチャでは実装されていない。 -.\"O .SH "VERSIONS" +.TP +\fBEINVAL\fP +\fIctx_id\fP で指定された \fIaio_context\fP が無効である。 \fInr\fP が 0 未満である。 *iocbpp[0] の +\fIiocb\fP が適切に初期化されていないか、 指定された操作がその \fIiocb\fP 中のファイル・ディスクリプタに対して 無効である。 +.TP +\fBENOSYS\fP +\fBio_submit\fP() はこのアーキテクチャでは実装されていない。 .SH バージョン .PP -.\"O The asynchronous I/O system calls first appeared in Linux 2.5, August 2002. 非同期 I/O システム・コールは 2002年8月に Linux 2.5 で初めて登場した。 -.\"O .SH "CONFORMING TO" .SH 準拠 .PP -.\"O .BR io_submit () -.\"O is Linux-specific and should not be used in -.\"O programs that are intended to be portable. -.BR io_submit () -は Linux 固有であり、移植を想定したプログラムで -使用すべきではない。 -.\"O .SH NOTES +\fBio_submit\fP() は Linux 固有であり、移植を想定したプログラムで 使用すべきではない。 .SH 注意 -.\"O Glibc does not provide a wrapper function for this system call. glibc はこのシステムコール用のラッパー関数を提供していない。 -.\"O The wrapper provided in -.\"O .I libaio -.\"O for -.\"O .BR io_submit () -.\"O does not follow the usual C library conventions for indicating error: -.\"O on error it returns a negated error number -.\"O (the negative of one of the values listed in ERRORS). -.\"O If the system call is invoked via -.\"O .BR syscall (2), -.\"O then the return value follows the usual conventions for -.\"O indicating an error: \-1, with -.\"O .I errno -.\"O set to a (positive) value that indicates the error. -.I libaio -で -.BR io_submit () -用に提供されているラッパー関数は、エラーの通知が通常の C ライブラリの -慣習にしたがっておらず、エラーの場合には負のエラー番号 -(エラーの節に列挙されている値の一つを負にしたもの) が返り値となる。 -.BR syscall (2) -経由でシステムコールを起動すると、返り値は通常のエラー通知の慣習に -したがってものとなり、エラーの場合には \-1 が返り、 -.I errno -にエラーを示す (正の) 値が設定される。 -.\"O .SH "SEE ALSO" +\fIlibaio\fP で \fBio_submit\fP() 用に提供されているラッパー関数は、エラーの通知が通常の C ライブラリの +慣習にしたがっておらず、エラーの場合には負のエラー番号 (エラーの節に列挙されている値の一つを負にしたもの) が返り値となる。 +\fBsyscall\fP(2) 経由でシステムコールを起動すると、返り値は通常のエラー通知の慣習に したがってものとなり、エラーの場合には \-1 が返り、 +\fIerrno\fP にエラーを示す (正の) 値が設定される。 .SH 関連項目 -.BR io_cancel (2), -.BR io_destroy (2), -.BR io_getevents (2), -.BR io_setup (2), -.BR aio (7) -.\"O .\" .SH "NOTES" -.\" .SH 注 +\fBio_cancel\fP(2), \fBio_destroy\fP(2), \fBio_getevents\fP(2), \fBio_setup\fP(2), +\fBaio\fP(7) +.\" .SH "NOTES" .\" .PP -.\"O .\" The asynchronous I/O system calls were written by Benjamin LaHaise. -.\" 非同期 I/O システム・コールは Benjamin LaHaise が書いた。 -.\"O .\" .SH AUTHOR -.\" .SH 著者 +.\" The asynchronous I/O system calls were written by Benjamin LaHaise. +.\" .SH AUTHOR .\" Kent Yoder. diff --git a/draft/man2/ioctl.2 b/draft/man2/ioctl.2 index 643d07ab..69ce4697 100644 --- a/draft/man2/ioctl.2 +++ b/draft/man2/ioctl.2 @@ -36,214 +36,58 @@ .\" Modified 1999-06-25 by Rachael Munns .\" Modified 2000-09-21 by Andries Brouwer .\" -.\" Japanese Version Copyright (c) 1997-1999 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Sat Aug 14 10:10:27 JST 1999 -.\" by HANATAKA Shinya -.\" Modified 2002-09-24 by Akihiro MOTOKI -.\" Updated 2005-02-24, Akihiro MOTOKI -.\" Updated 2011-08-10, TACHIBANA Akira -.\" Updated 2011-09-15, TACHIBANA Akira +.\"******************************************************************* .\" -.\"WORD: device デバイス -.\"WORD: control 制御する -.\"WORD: special スペシャル -.\"WORD: character キャラクタ -.\"WORD: parameter パラメータ -.\"WORD: operate 操作 -.\"WORD: open オープン -.\"WORD: request リクエスト -.\"WORD: descriptor ディスクリプタ -.\"WORD: argument 引き数 -.\"WORD: encode エンコード -.\"WORD: operating characteristics 動作特性 +.\" This file was generated with po4a. Translate the source file. .\" -.TH IOCTL 2 2000-09-21 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O ioctl \- control device +.\"******************************************************************* +.TH IOCTL 2 2000\-09\-21 Linux "Linux Programmer's Manual" .SH 名前 ioctl \- デバイスを制御する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int ioctl(int " d ", int " request ", ...);" -.\"O .SH DESCRIPTION +\fBint ioctl(int \fP\fId\fP\fB, int \fP\fIrequest\fP\fB, ...);\fP .SH 説明 -.\"O The -.\"O .BR ioctl () -.\"O function manipulates the underlying device parameters of special files. -.\"O In particular, many operating characteristics of character special files -.\"O (e.g., terminals) may be controlled with -.\"O .BR ioctl () -.\"O requests. -.\"O The argument -.\"O .I d -.\"O must be an open file descriptor. -.BR ioctl () -関数はスペシャル・ファイルを構成するデバイスのパラメータを -操作する。特に、キャラクタ型のスペシャル・ファイル (例えば端末 (terminal)) -の多くの動作特性を -.BR ioctl () -リクエストによって制御することができる。引き数 -.I d +\fBioctl\fP() 関数はスペシャル・ファイルを構成するデバイスのパラメータを 操作する。特に、キャラクタ型のスペシャル・ファイル (例えば端末 +(terminal)) の多くの動作特性を \fBioctl\fP() リクエストによって制御することができる。引き数 \fId\fP はオープンされたファイル・ディスクリプタでなければならない。 .PP -.\"O The second argument is a device-dependent request code. -.\"O The third argument is an untyped pointer to memory. -.\"O It's traditionally -.\"O .BI "char *" argp -.\"O (from the days before -.\"O .B "void *" -.\"O was valid C), and will be so named for this discussion. -2 番目の引き数は、デバイス依存のリクエスト・コードである。 -3 番目の引き数は、メモリへの型を指定しないポインタである。 -この引き数は伝統的に (C で -.B "void *" -という書き方が有効になる前から) -.BI "char *" argp +2 番目の引き数は、デバイス依存のリクエスト・コードである。 3 番目の引き数は、メモリへの型を指定しないポインタである。 この引き数は伝統的に (C +で \fBvoid *\fP という書き方が有効になる前から) \fBchar *\fP\fIargp\fP と表記されている。したがって、この文章でもそう名付けることとする。 .PP -.\"O An -.\"O .BR ioctl () -.\"O .I request -.\"O has encoded in it whether the argument is an -.\"O .I in -.\"O parameter or -.\"O .I out -.\"O parameter, and the size of the argument -.\"O .I argp -.\"O in bytes. -.\"O Macros and defines used in specifying an -.\"O .BR ioctl () -.\"O .I request -.\"O are located in the file -.\"O .IR . -.BR ioctl () -の -.I request -には、 -その引き数が -.I 入力 -パラメータと -.I 出力 -パラメータのどちらであるかの区別や、 -.I argp -引き数のバイト単位のサイズ、といった情報がエンコードされている。 -.BR ioctl () -の -.I request -を指定するためのマクロ (macro) と定義は -.I -ファイルにある。 -.\"O .SH "RETURN VALUE" +\fBioctl\fP() の \fIrequest\fP には、 その引き数が \fI入力\fP パラメータと \fI出力\fP パラメータのどちらであるかの区別や、 +\fIargp\fP 引き数のバイト単位のサイズ、といった情報がエンコードされている。 \fBioctl\fP() の \fIrequest\fP +を指定するためのマクロ (macro) と定義は \fI\fP ファイルにある。 .SH 返り値 -.\"O Usually, on success zero is returned. -.\"O A few -.\"O .BR ioctl () -.\"O requests use the return value as an output parameter -.\"O and return a nonnegative value on success. -たいていの場合、成功するとゼロが返される。 -ただし、 -.BR ioctl () -リクエストの中にはパラメータの出力に返り値を使用しているものが若干あり、 -その場合は、成功したときに非負の値が返される。 -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -エラーの場合は \-1 が返され、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS +たいていの場合、成功するとゼロが返される。 ただし、 \fBioctl\fP() リクエストの中にはパラメータの出力に返り値を使用しているものが若干あり、 +その場合は、成功したときに非負の値が返される。 エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP 0.7i -.B EBADF -.\"O .I d -.\"O is not a valid descriptor. -.I d -が有効なディスクリプタではない。 -.TP -.B EFAULT -.\"O .I argp -.\"O references an inaccessible memory area. -.I argp -がアクセス不可能なメモリを参照している。 -.TP -.B EINVAL -.\"O .I Request -.\"O or -.\"O .I argp -.\"O is not valid. -.I request -または -.I argp -が不正である。 -.TP -.B ENOTTY -.\"O .I d -.\"O is not associated with a character special device. -.I d -がキャラクタ型のスペシャル・デバイスを参照していない。 -.TP -.B ENOTTY -.\"O The specified request does not apply to the kind of object that the -.\"O descriptor -.\"O .I d -.\"O references. -指定されたリクエストはディスクリプタ -.I d -が参照する種類のオブジェクトには適用することができない。 -.\"O .SH CONFORMING TO +.TP 0.7i +\fBEBADF\fP +\fId\fP が有効なディスクリプタではない。 +.TP +\fBEFAULT\fP +\fIargp\fP がアクセス不可能なメモリを参照している。 +.TP +\fBEINVAL\fP +\fIrequest\fP または \fIargp\fP が不正である。 +.TP +\fBENOTTY\fP +\fId\fP がキャラクタ型のスペシャル・デバイスを参照していない。 +.TP +\fBENOTTY\fP +指定されたリクエストはディスクリプタ \fId\fP が参照する種類のオブジェクトには適用することができない。 .SH 準拠 -.\"O No single standard. -.\"O Arguments, returns, and semantics of -.\"O .BR ioctl () -.\"O vary according to the device driver in question (the call is used as a -.\"O catch-all for operations that don't cleanly fit the UNIX stream I/O -.\"O model). -.\"O See -.\"O .BR ioctl_list (2) -.\"O for a list of many of the known -.\"O .BR ioctl () -.\"O calls. -どれか一つの標準に対応しているわけではない。 -.BR ioctl () -の引き数、返り値、解釈は、処理対象のデバイス・ドライバごとに -異なる (この関数は UNIX の ストリーム I/O モデル に -きちんと適合していない操作のための便利屋として使用される)。 -よく知られている -.BR ioctl () -のリストについては -.BR ioctl_list (2) -を参照すること。 -.\"O The -.\"O .BR ioctl () -.\"O function call appeared in Version 7 AT&T UNIX. -.BR ioctl () -関数コールは Version 7 AT&T UNIX で登場した。 -.\"O .SH NOTES +どれか一つの標準に対応しているわけではない。 \fBioctl\fP() の引き数、返り値、解釈は、処理対象のデバイス・ドライバごとに 異なる (この関数は +UNIX の ストリーム I/O モデル に きちんと適合していない操作のための便利屋として使用される)。 よく知られている \fBioctl\fP() +のリストについては \fBioctl_list\fP(2) を参照すること。 \fBioctl\fP() 関数コールは Version 7 AT&T UNIX +で登場した。 .SH 注意 -.\"O In order to use this call, one needs an open file descriptor. -.\"O Often the -.\"O .BR open (2) -.\"O call has unwanted side effects, that can be avoided under Linux -.\"O by giving it the -.\"O .B O_NONBLOCK -.\"O flag. -このシステムコールを使うには、オープンされたファイル・ディスクリプタが -必要である。 -.BR open (2) -コールはしばしば望んでいない副作用を伴うことがあるが、Linux では -.BR open (2) -に -.B O_NONBLOCK +このシステムコールを使うには、オープンされたファイル・ディスクリプタが 必要である。 \fBopen\fP(2) +コールはしばしば望んでいない副作用を伴うことがあるが、Linux では \fBopen\fP(2) に \fBO_NONBLOCK\fP フラグをつけることでこの副作用を避けることができる。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR execve (2), -.BR fcntl (2), -.BR ioctl_list (2), -.BR open (2), .\" .BR mt (4), -.BR sd (4), -.BR tty (4) +\fBexecve\fP(2), \fBfcntl\fP(2), \fBioctl_list\fP(2), \fBopen\fP(2), \fBsd\fP(4), \fBtty\fP(4) diff --git a/draft/man2/ioctl_list.2 b/draft/man2/ioctl_list.2 index fe07d1fa..5744975e 100644 --- a/draft/man2/ioctl_list.2 +++ b/draft/man2/ioctl_list.2 @@ -24,174 +24,58 @@ .\" 2007-12-29 Alain Portal and Michael Kerrisk .\" : .\" Various formatting improvements +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1996 Akira Yoshiyama -.\" all rights reserved. -.\" Translated Sun Jun 30 20:46:54 JST 1996 -.\" by Akira Yoshiyama -.\" Modified Sat Dec 13 20:25:06 JST 1997 -.\" by HANATAKA Shinya -.\" Updated & Modified Wed May 19 05:31:50 JST 2004 -.\" by Yuichi SATO -.\" Updated 2008-02-12, Akihiro MOTOKI , LDP v2.77 +.\" This file was generated with po4a. Translate the source file. .\" -.TH IOCTL_LIST 2 2007-12-29 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH IOCTL_LIST 2 2007\-12\-29 Linux "Linux Programmer's Manual" .SH 名前 -.\"O ioctl_list \- list of ioctl calls in Linux/i386 kernel ioctl_list \- Linux/i386 カーネルの ioctl のリスト -.\"O .SH DESCRIPTION .SH 説明 -.\"O This is Ioctl List 1.3.27, a list of ioctl calls in Linux/i386 kernel -.\"O 1.3.27. -.\"O It contains 421 ioctls from -.\"O .IR . -.\"O For each ioctl, its numerical value, its name, and its argument -.\"O type are given. -この文章は ioctl リスト 1.3.27、つまり Linux/i386 カーネル 1.3.27 に -おける ioctl コールの一覧です。このリストは -.I -にある 421 の ioctl を含んでいます。全ての ioctl に対して、数値、名称、 -引き数の型を列挙してあります。 +この文章は ioctl リスト 1.3.27、つまり Linux/i386 カーネル 1.3.27 に おける ioctl +コールの一覧です。このリストは \fI\fP にある 421 の ioctl +を含んでいます。全ての ioctl に対して、数値、名称、 引き数の型を列挙してあります。 .PP -.\"O An argument type of -.\"O .I const struct foo * -.\"O means the argument is input to the kernel. -.\"O .I struct foo * -.\"O means the kernel outputs the argument. -.\"O If the kernel uses the argument for both input and output, this is -.\"O marked with \fI//\ I-O\fP. -引き数型 -.I const struct foo * -は、その引き数がカーネルへの入力である事を意味します。また、 -.I struct foo * -は、その引き数がカーネルからの出力である事を意味します。 -カーネルがその引き数を入力と出力の両方に使用する場合は、 -\fI//\ I-O\fP マークを付けてあります。 +引き数型 \fIconst struct foo *\fP は、その引き数がカーネルへの入力である事を意味します。また、 \fIstruct foo *\fP +は、その引き数がカーネルからの出力である事を意味します。 カーネルがその引き数を入力と出力の両方に使用する場合は、 \fI//\ I\-O\fP +マークを付けてあります。 .PP -.\"O Some ioctls take more arguments or return more values than a single -.\"O structure. -.\"O These are marked \fI//\ MORE\fP and documented further in a -.\"O separate section. -いくつかの ioctl は複数の構造体の引き数を必要としたり、値を返したり -します。これらには \fI//\ MORE\fP マークを付けて、 +いくつかの ioctl は複数の構造体の引き数を必要としたり、値を返したり します。これらには \fI//\ MORE\fP マークを付けて、 さらに分離したセクションで説明してあります。 .PP -.\"O This list is very incomplete. このリストは不完全です。 -.\"O .SS "ioctl structure" .SS "ioctl の構造" -.\"O .\" added two sections - aeb -.\" 2 つのセクションを追加 - aeb -.\"O Ioctl command values are 32-bit constants. -.\"O In principle these constants are completely arbitrary, but people have -.\"O tried to build some structure into them. -ioctl コマンドの値は 32 ビットの定数です。 -原則として、これらの定数は全く任意のものですが、 +.\" added two sections - aeb +ioctl コマンドの値は 32 ビットの定数です。 原則として、これらの定数は全く任意のものですが、 設計者は何らかの構造をこれらの定数に組み込もうとしています。 .LP -.\"O The old Linux situation was that of mostly 16-bit constants, where the -.\"O last byte is a serial number, and the preceding byte(s) give a type -.\"O indicating the driver. -.\"O Sometimes the major number was used: 0x03 -.\"O for the -.\"O .B HDIO_* -.\"O ioctls, 0x06 for the -.\"O .B LP* -.\"O ioctls. -.\"O And sometimes -.\"O one or more ASCII letters were used. -.\"O For example, -.\"O .B TCGETS -.\"O has value -.\"O 0x00005401, with 0x54 = \(aqT\(aq indicating the terminal driver, and -.\"O .B CYGETTIMEOUT -.\"O has value 0x00435906, with 0x43 0x59 = \(aqC\(aq \(aqY\(aq -.\"O indicating the cyclades driver. -昔の Linux では、大部分は 16 ビットの定数であり、 -下位バイトはシリアル番号で、上位バイトはドライバのタイプを表していました。 -メジャー番号が使われることもありました: -0x03 が -.B HDIO_* -ioctl, 0x06 が -.B LP* -ioctl などです。 -1 文字以上の ASCII 文字列が使われることもありました。 -たとえば -.B TCGETS -の値は 0x00005401 であり、 -0x54 = \(aqT\(aq でターミナルドライバを表します。 -.B CYGETTIMEOUT -の値は 0x00435906 であり、 -0x43 0x59 = \(aqC\(aq \(aqY\(aq で cyclades ドライバを表します。 +昔の Linux では、大部分は 16 ビットの定数であり、 下位バイトはシリアル番号で、上位バイトはドライバのタイプを表していました。 +メジャー番号が使われることもありました: 0x03 が \fBHDIO_*\fP ioctl, 0x06 が \fBLP*\fP ioctl などです。 1 +文字以上の ASCII 文字列が使われることもありました。 たとえば \fBTCGETS\fP の値は 0x00005401 であり、 0x54 = +\(aqT\(aq でターミナルドライバを表します。 \fBCYGETTIMEOUT\fP の値は 0x00435906 であり、 0x43 0x59 = +\(aqC\(aq \(aqY\(aq で cyclades ドライバを表します。 .LP -.\"O Later (0.98p5) some more information was built into the number. -.\"O One has 2 direction bits -.\"O (00: none, 01: write, 10: read, 11: read/write) -.\"O followed by 14 size bits (giving the size of the argument), -.\"O followed by an 8-bit type (collecting the ioctls in groups -.\"O for a common purpose or a common driver), and an 8-bit -.\"O serial number. -後の時代 (0.98p5) になると、 -より多くの情報が数値に組み込まれるようになりました。 -1 つの数値は、読み書きの方向を表す 2 ビット -(00: 読み書きなし, 01: 書き込み, 10: 読み込み, 11: 読み込み/書き込み)、 -(引き数のサイズを表す) 14 ビット、 -(共通の目的または共通のドライバで ioctl をグループにするための) -8 ビットのタイプ、8 ビットのシリアル番号から構成されます。 +後の時代 (0.98p5) になると、 より多くの情報が数値に組み込まれるようになりました。 1 つの数値は、読み書きの方向を表す 2 ビット (00: +読み書きなし, 01: 書き込み, 10: 読み込み, 11: 読み込み/書き込み)、 (引き数のサイズを表す) 14 ビット、 +(共通の目的または共通のドライバで ioctl をグループにするための) 8 ビットのタイプ、8 ビットのシリアル番号から構成されます。 .LP -.\"O The macros describing this structure live in \fI\fP -.\"O and are -.\"O .B _IO(type,nr) -.\"O and -.\"O .BR "{_IOR,_IOW,_IOWR}(type,nr,size)" . -.\"O They use -.\"O .I sizeof(size) -.\"O so that size is a -.\"O misnomer here: this third argument is a data type. -この構造を記述するマクロは \fI\fP にあり、 -.B _IO(type,nr) -と -.B "{_IOR,_IOW,_IOWR}(type,nr,size)" -です。 -これらのマクロは -.I sizeof(size) -を使うので、 -ここで size という名前にしているのは間違っています: -この 3 つ目の引き数はデータタイプです。 +この構造を記述するマクロは \fI\fP にあり、 \fB_IO(type,nr)\fP と +\fB{_IOR,_IOW,_IOWR}(type,nr,size)\fP です。 これらのマクロは \fIsizeof(size)\fP を使うので、 ここで +size という名前にしているのは間違っています: この 3 つ目の引き数はデータタイプです。 .LP -.\"O Note that the size bits are very unreliable: in lots of cases -.\"O they are wrong, either because of buggy macros using -.\"O .IR sizeof(sizeof(struct)) , -.\"O or because of legacy values. -size ビットは全く当てにならない点に注意して下さい: -多くの場合、間違っています。 -これは -.I sizeof(sizeof(struct)) +size ビットは全く当てにならない点に注意して下さい: 多くの場合、間違っています。 これは \fIsizeof(sizeof(struct))\fP を使ったバグを含んだマクロや、過去から受け継いだ値が原因です。 .LP -.\"O Thus, it seems that the new structure only gave disadvantages: -.\"O it does not help in checking, but it causes varying values -.\"O for the various architectures. -したがって、新しい構造は不都合な点しかないように思われます: -この構造はチェックの手助けにはならず、 +したがって、新しい構造は不都合な点しかないように思われます: この構造はチェックの手助けにはならず、 様々なアーキテクチャによって値を変化させてしまいます。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O Decent ioctls return 0 on success and \-1 on error, while -.\"O any output value is stored via the argument. -.\"O However, -.\"O quite a few ioctls in fact return an output value. -.\"O This is not yet indicated below. -きちんとした ioctl は、成功した場合は 0 を返し、 -エラーの場合は \-1 を返します。 -また出力値は引き数に格納します。 -しかし実際は、かなり多くの ioctl が出力値を返します。 -これは今のところ以下では示されていません。 +きちんとした ioctl は、成功した場合は 0 を返し、 エラーの場合は \-1 を返します。 また出力値は引き数に格納します。 +しかし実際は、かなり多くの ioctl が出力値を返します。 これは今のところ以下では示されていません。 // Main table. -// +// .TS l l l. 0x00008901 FIOSETOWN const int * @@ -202,7 +86,7 @@ l l l. 0x00008906 SIOCGSTAMP timeval * .TE -// +// .TS l l l l. 0x00005401 TCGETS struct termios * @@ -266,7 +150,7 @@ l l l l. 0x000089E2 SIOCAX25DELUID const struct sockaddr_ax25 * 0x000089E3 SIOCAX25NOUID const int * 0x000089E4 SIOCAX25DIGCTL const int * -0x000089E5 SIOCAX25GETPARMS struct ax25_parms_struct * // I-O +0x000089E5 SIOCAX25GETPARMS struct ax25_parms_struct * // I\-O 0x000089E6 SIOCAX25SETPARMS const struct ax25_parms_struct * .TE @@ -287,17 +171,17 @@ l l l l. 0x00005303 CDROMPLAYMSF const struct cdrom_msf * 0x00005304 CDROMPLAYTRKIND const struct cdrom_ti * 0x00005305 CDROMREADTOCHDR struct cdrom_tochdr * -0x00005306 CDROMREADTOCENTRY struct cdrom_tocentry * // I-O +0x00005306 CDROMREADTOCENTRY struct cdrom_tocentry * // I\-O 0x00005307 CDROMSTOP void 0x00005308 CDROMSTART void 0x00005309 CDROMEJECT void 0x0000530A CDROMVOLCTRL const struct cdrom_volctrl * -0x0000530B CDROMSUBCHNL struct cdrom_subchnl * // I-O +0x0000530B CDROMSUBCHNL struct cdrom_subchnl * // I\-O 0x0000530C CDROMREADMODE2 const struct cdrom_msf * // MORE 0x0000530D CDROMREADMODE1 const struct cdrom_msf * // MORE 0x0000530E CDROMREADAUDIO const struct cdrom_read_audio * // MORE 0x0000530F CDROMEJECT_SW int -0x00005310 CDROMMULTISESSION struct cdrom_multisession * // I-O +0x00005310 CDROMMULTISESSION struct cdrom_multisession * // I\-O 0x00005311 CDROM_GET_UPC struct { char [8]; } * 0x00005312 CDROMRESET void 0x00005313 CDROMVOLREAD struct cdrom_volctrl * @@ -361,7 +245,7 @@ l l l l. 0x00000019 FDGETFDCSTAT struct floppy_fdc_state * 0x0000001B FDWERRORCLR void 0x0000001C FDWERRORGET struct floppy_write_errors * -0x0000001E FDRAWCMD struct floppy_raw_cmd * // MORE // I-O +0x0000001E FDRAWCMD struct floppy_raw_cmd * // MORE // I\-O 0x00000028 FDTWADDLE void .TE @@ -375,7 +259,7 @@ l l l l. 0x00001261 BLKFLSBUF void 0x00001262 BLKRASET int 0x00001263 BLKRAGET int * -0x00000001 FIBMAP int * // I-O +0x00000001 FIBMAP int * // I\-O 0x00000002 FIGETBSZ int * .TE @@ -390,7 +274,7 @@ l l l l. 0x00000309 HDIO_GET_CHIPSET int * 0x0000030A HDIO_GET_NOWERR int * 0x0000030B HDIO_GET_DMA int * -0x0000031F HDIO_DRIVE_CMD int * // I-O +0x0000031F HDIO_DRIVE_CMD int * // I\-O 0x00000321 HDIO_SET_MULTCOUNT int 0x00000322 HDIO_SET_UNMASKINTR int 0x00000323 HDIO_SET_KEEPSETTINGS int @@ -402,18 +286,18 @@ l l l l. // .TS l l l l. -0x000089F0 EQL_ENSLAVE struct ifreq * // MORE // I-O -0x000089F1 EQL_EMANCIPATE struct ifreq * // MORE // I-O -0x000089F2 EQL_GETSLAVECFG struct ifreq * // MORE // I-O -0x000089F3 EQL_SETSLAVECFG struct ifreq * // MORE // I-O -0x000089F4 EQL_GETMASTRCFG struct ifreq * // MORE // I-O -0x000089F5 EQL_SETMASTRCFG struct ifreq * // MORE // I-O +0x000089F0 EQL_ENSLAVE struct ifreq * // MORE // I\-O +0x000089F1 EQL_EMANCIPATE struct ifreq * // MORE // I\-O +0x000089F2 EQL_GETSLAVECFG struct ifreq * // MORE // I\-O +0x000089F3 EQL_SETSLAVECFG struct ifreq * // MORE // I\-O +0x000089F4 EQL_GETMASTRCFG struct ifreq * // MORE // I\-O +0x000089F5 EQL_SETMASTRCFG struct ifreq * // MORE // I\-O .TE // .TS l l l l. -0x000089F0 SIOCDEVPLIP struct ifreq * // I-O +0x000089F0 SIOCDEVPLIP struct ifreq * // I\-O .TE // @@ -449,7 +333,7 @@ l l l l. l l l l. 0x00004B60 GIO_FONT struct { char [8192]; } * 0x00004B61 PIO_FONT const struct { char [8192]; } * -0x00004B6B GIO_FONTX struct console_font_desc * // MORE // I-O +0x00004B6B GIO_FONTX struct console_font_desc * // MORE // I\-O 0x00004B6C PIO_FONTX const struct console_font_desc * //MORE 0x00004B70 GIO_CMAP struct { char [48]; } * 0x00004B71 PIO_CMAP const struct { char [48]; } @@ -470,7 +354,7 @@ l l l l. 0x00004B41 PIO_SCRNMAP const struct { char [E_TABSZ]; } * 0x00004B69 GIO_UNISCRNMAP struct { short [E_TABSZ]; } * 0x00004B6A PIO_UNISCRNMAP const struct { short [E_TABSZ]; } * -0x00004B66 GIO_UNIMAP struct unimapdesc * // MORE // I-O +0x00004B66 GIO_UNIMAP struct unimapdesc * // MORE // I\-O 0x00004B67 PIO_UNIMAP const struct unimapdesc * // MORE 0x00004B68 PIO_UNIMAPCLR const struct unimapinit * 0x00004B44 KDGKBMODE int * @@ -479,13 +363,13 @@ l l l l. 0x00004B63 KDSKBMETA int 0x00004B64 KDGKBLED int * 0x00004B65 KDSKBLED int -0x00004B46 KDGKBENT struct kbentry * // I-O +0x00004B46 KDGKBENT struct kbentry * // I\-O 0x00004B47 KDSKBENT const struct kbentry * -0x00004B48 KDGKBSENT struct kbsentry * // I-O +0x00004B48 KDGKBSENT struct kbsentry * // I\-O 0x00004B49 KDSKBSENT const struct kbsentry * 0x00004B4A KDGKBDIACR struct kbdiacrs * 0x00004B4B KDSKBDIACR const struct kbdiacrs * -0x00004B4C KDGETKEYCODE struct kbkeycode * // I-O +0x00004B4C KDGETKEYCODE struct kbkeycode * // I\-O 0x00004B4D KDSETKEYCODE const struct kbkeycode * 0x00004B4E KDSIGACCEPT int .TE @@ -509,8 +393,8 @@ l l l l. // .TS l l l l. -0x000089E0 SIOCGETVIFCNT struct sioc_vif_req * // I-O -0x000089E1 SIOCGETSGCNT struct sioc_sg_req * // I-O +0x000089E0 SIOCGETVIFCNT struct sioc_vif_req * // I\-O +0x000089E1 SIOCGETSGCNT struct sioc_sg_req * // I\-O .TE // @@ -526,7 +410,7 @@ l l l l. // .TS l l l l. -0x000089E0 SIOCNRGETPARMS struct nr_parms_struct * // I-O +0x000089E0 SIOCNRGETPARMS struct nr_parms_struct * // I\-O 0x000089E1 SIOCNRSETPARMS const struct nr_parms_struct * 0x000089E2 SIOCNRDECOBS void 0x000089E3 SIOCNRRTCTL const int * @@ -544,7 +428,7 @@ l l l l. l l l l. 0x00005470 TIOCSCCINI void 0x00005471 TIOCCHANINI const struct scc_modem * -0x00005472 TIOCGKISS struct ioctl_command * // I-O +0x00005472 TIOCGKISS struct ioctl_command * // I\-O 0x00005473 TIOCSKISS const struct ioctl_command * 0x00005474 TIOCSCCSTAT struct scc_stat * .TE @@ -571,28 +455,28 @@ l l l l. 0x0000890C SIOCDELRT const struct rtentry * // MORE 0x00008910 SIOCGIFNAME char [] 0x00008911 SIOCSIFLINK void -0x00008912 SIOCGIFCONF struct ifconf * // MORE // I-O -0x00008913 SIOCGIFFLAGS struct ifreq * // I-O +0x00008912 SIOCGIFCONF struct ifconf * // MORE // I\-O +0x00008913 SIOCGIFFLAGS struct ifreq * // I\-O 0x00008914 SIOCSIFFLAGS const struct ifreq * -0x00008915 SIOCGIFADDR struct ifreq * // I-O +0x00008915 SIOCGIFADDR struct ifreq * // I\-O 0x00008916 SIOCSIFADDR const struct ifreq * -0x00008917 SIOCGIFDSTADDR struct ifreq * // I-O +0x00008917 SIOCGIFDSTADDR struct ifreq * // I\-O 0x00008918 SIOCSIFDSTADDR const struct ifreq * -0x00008919 SIOCGIFBRDADDR struct ifreq * // I-O +0x00008919 SIOCGIFBRDADDR struct ifreq * // I\-O 0x0000891A SIOCSIFBRDADDR const struct ifreq * -0x0000891B SIOCGIFNETMASK struct ifreq * // I-O +0x0000891B SIOCGIFNETMASK struct ifreq * // I\-O 0x0000891C SIOCSIFNETMASK const struct ifreq * -0x0000891D SIOCGIFMETRIC struct ifreq * // I-O +0x0000891D SIOCGIFMETRIC struct ifreq * // I\-O 0x0000891E SIOCSIFMETRIC const struct ifreq * -0x0000891F SIOCGIFMEM struct ifreq * // I-O +0x0000891F SIOCGIFMEM struct ifreq * // I\-O 0x00008920 SIOCSIFMEM const struct ifreq * -0x00008921 SIOCGIFMTU struct ifreq * // I-O +0x00008921 SIOCGIFMTU struct ifreq * // I\-O 0x00008922 SIOCSIFMTU const struct ifreq * -0x00008923 OLD_SIOCGIFHWADDR struct ifreq * // I-O +0x00008923 OLD_SIOCGIFHWADDR struct ifreq * // I\-O 0x00008924 SIOCSIFHWADDR const struct ifreq * // MORE 0x00008925 SIOCGIFENCAP int * 0x00008926 SIOCSIFENCAP const int * -0x00008927 SIOCGIFHWADDR struct ifreq * // I-O +0x00008927 SIOCGIFHWADDR struct ifreq * // I\-O 0x00008929 SIOCGIFSLAVE void 0x00008930 SIOCSIFSLAVE void 0x00008931 SIOCADDMULTI const struct ifreq * @@ -600,12 +484,12 @@ l l l l. 0x00008940 SIOCADDRTOLD void 0x00008941 SIOCDELRTOLD void 0x00008950 SIOCDARP const struct arpreq * -0x00008951 SIOCGARP struct arpreq * // I-O +0x00008951 SIOCGARP struct arpreq * // I\-O 0x00008952 SIOCSARP const struct arpreq * 0x00008960 SIOCDRARP const struct arpreq * -0x00008961 SIOCGRARP struct arpreq * // I-O +0x00008961 SIOCGRARP struct arpreq * // I\-O 0x00008962 SIOCSRARP const struct arpreq * -0x00008970 SIOCGIFMAP struct ifreq * // I-O +0x00008970 SIOCGIFMAP struct ifreq * // I\-O 0x00008971 SIOCSIFMAP const struct ifreq * .TE @@ -614,8 +498,8 @@ l l l l. l l l l. 0x00005100 SNDCTL_SEQ_RESET void 0x00005101 SNDCTL_SEQ_SYNC void -0xC08C5102 SNDCTL_SYNTH_INFO struct synth_info * // I-O -0xC0045103 SNDCTL_SEQ_CTRLRATE int * // I-O +0xC08C5102 SNDCTL_SYNTH_INFO struct synth_info * // I\-O +0xC0045103 SNDCTL_SEQ_CTRLRATE int * // I\-O 0x80045104 SNDCTL_SEQ_GETOUTCOUNT int * 0x80045105 SNDCTL_SEQ_GETINCOUNT int * 0x40045106 SNDCTL_SEQ_PERCMODE void @@ -624,37 +508,37 @@ l l l l. 0x40045109 SNDCTL_SEQ_RESETSAMPLES const int * 0x8004510A SNDCTL_SEQ_NRSYNTHS int * 0x8004510B SNDCTL_SEQ_NRMIDIS int * -0xC074510C SNDCTL_MIDI_INFO struct midi_info * // I-O +0xC074510C SNDCTL_MIDI_INFO struct midi_info * // I\-O 0x4004510D SNDCTL_SEQ_THRESHOLD const int * -0xC004510E SNDCTL_SYNTH_MEMAVL int * // I-O +0xC004510E SNDCTL_SYNTH_MEMAVL int * // I\-O 0x4004510F SNDCTL_FM_4OP_ENABLE const int * -0xCFB85110 SNDCTL_PMGR_ACCESS struct patmgr_info * // I-O +0xCFB85110 SNDCTL_PMGR_ACCESS struct patmgr_info * // I\-O 0x00005111 SNDCTL_SEQ_PANIC void 0x40085112 SNDCTL_SEQ_OUTOFBAND const struct seq_event_rec * -0xC0045401 SNDCTL_TMR_TIMEBASE int * // I-O +0xC0045401 SNDCTL_TMR_TIMEBASE int * // I\-O 0x00005402 SNDCTL_TMR_START void 0x00005403 SNDCTL_TMR_STOP void 0x00005404 SNDCTL_TMR_CONTINUE void -0xC0045405 SNDCTL_TMR_TEMPO int * // I-O -0xC0045406 SNDCTL_TMR_SOURCE int * // I-O +0xC0045405 SNDCTL_TMR_TEMPO int * // I\-O +0xC0045406 SNDCTL_TMR_SOURCE int * // I\-O 0x40045407 SNDCTL_TMR_METRONOME const int * -0x40045408 SNDCTL_TMR_SELECT int * // I-O -0xCFB85001 SNDCTL_PMGR_IFACE struct patmgr_info * // I-O -0xC0046D00 SNDCTL_MIDI_PRETIME int * // I-O +0x40045408 SNDCTL_TMR_SELECT int * // I\-O +0xCFB85001 SNDCTL_PMGR_IFACE struct patmgr_info * // I\-O +0xC0046D00 SNDCTL_MIDI_PRETIME int * // I\-O 0xC0046D01 SNDCTL_MIDI_MPUMODE const int * -0xC0216D02 SNDCTL_MIDI_MPUCMD struct mpu_command_rec * // I-O +0xC0216D02 SNDCTL_MIDI_MPUCMD struct mpu_command_rec * // I\-O 0x00005000 SNDCTL_DSP_RESET void 0x00005001 SNDCTL_DSP_SYNC void -0xC0045002 SNDCTL_DSP_SPEED int * // I-O -0xC0045003 SNDCTL_DSP_STEREO int * // I-O -0xC0045004 SNDCTL_DSP_GETBLKSIZE int * // I-O -0xC0045006 SOUND_PCM_WRITE_CHANNELS int * // I-O -0xC0045007 SOUND_PCM_WRITE_FILTER int * // I-O +0xC0045002 SNDCTL_DSP_SPEED int * // I\-O +0xC0045003 SNDCTL_DSP_STEREO int * // I\-O +0xC0045004 SNDCTL_DSP_GETBLKSIZE int * // I\-O +0xC0045006 SOUND_PCM_WRITE_CHANNELS int * // I\-O +0xC0045007 SOUND_PCM_WRITE_FILTER int * // I\-O 0x00005008 SNDCTL_DSP_POST void -0xC0045009 SNDCTL_DSP_SUBDIVIDE int * // I-O -0xC004500A SNDCTL_DSP_SETFRAGMENT int * // I-O +0xC0045009 SNDCTL_DSP_SUBDIVIDE int * // I\-O +0xC004500A SNDCTL_DSP_SETFRAGMENT int * // I\-O 0x8004500B SNDCTL_DSP_GETFMTS int * -0xC0045005 SNDCTL_DSP_SETFMT int * // I-O +0xC0045005 SNDCTL_DSP_SETFMT int * // I\-O 0x800C500C SNDCTL_DSP_GETOSPACE struct audio_buf_info * 0x800C500D SNDCTL_DSP_GETISPACE struct audio_buf_info * 0x0000500E SNDCTL_DSP_NONBLOCK void @@ -664,12 +548,12 @@ l l l l. 0x80045007 SOUND_PCM_READ_FILTER int * 0x00004300 SNDCTL_COPR_RESET void 0xCFB04301 SNDCTL_COPR_LOAD const struct copr_buffer * -0xC0144302 SNDCTL_COPR_RDATA struct copr_debug_buf * // I-O -0xC0144303 SNDCTL_COPR_RCODE struct copr_debug_buf * // I-O +0xC0144302 SNDCTL_COPR_RDATA struct copr_debug_buf * // I\-O +0xC0144303 SNDCTL_COPR_RCODE struct copr_debug_buf * // I\-O 0x40144304 SNDCTL_COPR_WDATA const struct copr_debug_buf * 0x40144305 SNDCTL_COPR_WCODE const struct copr_debug_buf * -0xC0144306 SNDCTL_COPR_RUN struct copr_debug_buf * // I-O -0xC0144307 SNDCTL_COPR_HALT struct copr_debug_buf * // I-O +0xC0144306 SNDCTL_COPR_RUN struct copr_debug_buf * // I\-O +0xC0144307 SNDCTL_COPR_HALT struct copr_debug_buf * // I\-O 0x4FA44308 SNDCTL_COPR_SENDMSG const struct copr_msg * 0x8FA44309 SNDCTL_COPR_RCVMSG struct copr_msg * 0x80044D00 SOUND_MIXER_READ_VOLUME int * @@ -697,39 +581,39 @@ l l l l. 0x80044DFD SOUND_MIXER_READ_RECMASK int * 0x80044DFB SOUND_MIXER_READ_STEREODEVS int * 0x80044DFC SOUND_MIXER_READ_CAPS int * -0xC0044D00 SOUND_MIXER_WRITE_VOLUME int * // I-O -0xC0044D01 SOUND_MIXER_WRITE_BASS int * // I-O -0xC0044D02 SOUND_MIXER_WRITE_TREBLE int * // I-O -0xC0044D03 SOUND_MIXER_WRITE_SYNTH int * // I-O -0xC0044D04 SOUND_MIXER_WRITE_PCM int * // I-O -0xC0044D05 SOUND_MIXER_WRITE_SPEAKER int * // I-O -0xC0044D06 SOUND_MIXER_WRITE_LINE int * // I-O -0xC0044D07 SOUND_MIXER_WRITE_MIC int * // I-O -0xC0044D08 SOUND_MIXER_WRITE_CD int * // I-O -0xC0044D09 SOUND_MIXER_WRITE_IMIX int * // I-O -0xC0044D0A SOUND_MIXER_WRITE_ALTPCM int * // I-O -0xC0044D0B SOUND_MIXER_WRITE_RECLEV int * // I-O -0xC0044D0C SOUND_MIXER_WRITE_IGAIN int * // I-O -0xC0044D0D SOUND_MIXER_WRITE_OGAIN int * // I-O -0xC0044D0E SOUND_MIXER_WRITE_LINE1 int * // I-O -0xC0044D0F SOUND_MIXER_WRITE_LINE2 int * // I-O -0xC0044D10 SOUND_MIXER_WRITE_LINE3 int * // I-O -0xC0044D1C SOUND_MIXER_WRITE_MUTE int * // I-O -0xC0044D1D SOUND_MIXER_WRITE_ENHANCE int * // I-O -0xC0044D1E SOUND_MIXER_WRITE_LOUD int * // I-O -0xC0044DFF SOUND_MIXER_WRITE_RECSRC int * // I-O +0xC0044D00 SOUND_MIXER_WRITE_VOLUME int * // I\-O +0xC0044D01 SOUND_MIXER_WRITE_BASS int * // I\-O +0xC0044D02 SOUND_MIXER_WRITE_TREBLE int * // I\-O +0xC0044D03 SOUND_MIXER_WRITE_SYNTH int * // I\-O +0xC0044D04 SOUND_MIXER_WRITE_PCM int * // I\-O +0xC0044D05 SOUND_MIXER_WRITE_SPEAKER int * // I\-O +0xC0044D06 SOUND_MIXER_WRITE_LINE int * // I\-O +0xC0044D07 SOUND_MIXER_WRITE_MIC int * // I\-O +0xC0044D08 SOUND_MIXER_WRITE_CD int * // I\-O +0xC0044D09 SOUND_MIXER_WRITE_IMIX int * // I\-O +0xC0044D0A SOUND_MIXER_WRITE_ALTPCM int * // I\-O +0xC0044D0B SOUND_MIXER_WRITE_RECLEV int * // I\-O +0xC0044D0C SOUND_MIXER_WRITE_IGAIN int * // I\-O +0xC0044D0D SOUND_MIXER_WRITE_OGAIN int * // I\-O +0xC0044D0E SOUND_MIXER_WRITE_LINE1 int * // I\-O +0xC0044D0F SOUND_MIXER_WRITE_LINE2 int * // I\-O +0xC0044D10 SOUND_MIXER_WRITE_LINE3 int * // I\-O +0xC0044D1C SOUND_MIXER_WRITE_MUTE int * // I\-O +0xC0044D1D SOUND_MIXER_WRITE_ENHANCE int * // I\-O +0xC0044D1E SOUND_MIXER_WRITE_LOUD int * // I\-O +0xC0044DFF SOUND_MIXER_WRITE_RECSRC int * // I\-O .TE // .TS l l l l. -0x000004D2 UMSDOS_READDIR_DOS struct umsdos_ioctl * // I-O +0x000004D2 UMSDOS_READDIR_DOS struct umsdos_ioctl * // I\-O 0x000004D3 UMSDOS_UNLINK_DOS const struct umsdos_ioctl * 0x000004D4 UMSDOS_RMDIR_DOS const struct umsdos_ioctl * -0x000004D5 UMSDOS_STAT_DOS struct umsdos_ioctl * // I-O +0x000004D5 UMSDOS_STAT_DOS struct umsdos_ioctl * // I\-O 0x000004D6 UMSDOS_CREAT_EMD const struct umsdos_ioctl * 0x000004D7 UMSDOS_UNLINK_EMD const struct umsdos_ioctl * -0x000004D8 UMSDOS_READDIR_EMD struct umsdos_ioctl * // I-O +0x000004D8 UMSDOS_READDIR_EMD struct umsdos_ioctl * // I\-O 0x000004D9 UMSDOS_GETVERSION struct umsdos_ioctl * 0x000004DA UMSDOS_INIT_EMD void 0x000004DB UMSDOS_DOS_SETUP const struct umsdos_ioctl * @@ -752,58 +636,16 @@ l l l l. 0x0000560A VT_RESIZEX const struct vt_consize * .TE -// More arguments. -.\"O Some ioctl's take a pointer to a structure which contains additional -.\"O pointers. -.\"O These are documented here in alphabetical order. -いくつかの ioctl は追加のポインタを含む構造体へのポインタを使用します。 +// More arguments. いくつかの ioctl は追加のポインタを含む構造体へのポインタを使用します。 ここでこれらをアルファベット順に説明します。 -.\"O .B CDROMREADAUDIO -.\"O takes an input pointer -.\"O .IR "const struct cdrom_read_audio *" . -.\"O The -.\"O .I buf -.\"O field points to an output buffer of length -.\"O .IR "nframes * CD_FRAMESIZE_RAW" . -.B CDROMREADAUDIO -は入力ポインタ -.I "const struct cdrom_read_audio *" -を使用します。 -.I buf -フィールドは大きさ -.IR "nframes * CD_FRAMESIZE_RAW" -の出力バッファへのポインタです。 +\fBCDROMREADAUDIO\fP は入力ポインタ \fIconst struct cdrom_read_audio *\fP を使用します。 \fIbuf\fP +フィールドは大きさ \fInframes * CD_FRAMESIZE_RAW\fP の出力バッファへのポインタです。 -.\"O .BR CDROMREADCOOKED , -.\"O .BR CDROMREADMODE1 , -.\"O .BR CDROMREADMODE2 , -.\"O and -.\"O .B CDROMREADRAW -.\"O take an input pointer -.\"O .IR "const struct cdrom_msf *" . -.\"O They use the same pointer as an output pointer to -.\"O .IR "char []" . -.\"O The length varies by request. -.\"O For -.\"O .BR CDROMREADMODE1 , -.\"O most drivers use CD_FRAMESIZE, but the Optics Storage -.\"O driver uses OPT_BLOCKSIZE instead (both have the numerical value -.\"O 2048). -.BR CDROMREADCOOKED , -.BR CDROMREADMODE1 , -.BR CDROMREADMODE2 , -.B CDROMREADRAW -は入力ポインタ -.I const struct cdrom_msf * -を使用します。これらは同じポインタを -.I char [] -への出力ポインタとして使用します。 -長さは要求によって変化します。 -.B CDROMREADMODE1 -には、多くのデバイスが -CD_FRAMESIZE を使用しますが、光学記憶装置 (光ディスク) のドライバは -OPT_BLOCKSIZE を使用します (どちらも同じ値で 2048 です)。 +\fBCDROMREADCOOKED\fP, \fBCDROMREADMODE1\fP, \fBCDROMREADMODE2\fP, \fBCDROMREADRAW\fP +は入力ポインタ \fIconst struct cdrom_msf *\fP を使用します。これらは同じポインタを \fIchar []\fP +への出力ポインタとして使用します。 長さは要求によって変化します。 \fBCDROMREADMODE1\fP には、多くのデバイスが CD_FRAMESIZE +を使用しますが、光学記憶装置 (光ディスク) のドライバは OPT_BLOCKSIZE を使用します (どちらも同じ値で 2048 です)。 .nf CDROMREADCOOKED char [CD_FRAMESIZE] @@ -812,174 +654,41 @@ OPT_BLOCKSIZE を使用します (どちらも同じ値で 2048 です)。 CDROMREADRAW char [CD_FRAMESIZE_RAW] .fi -.\"O .BR EQL_ENSLAVE , -.\"O .BR EQL_EMANCIPATE , -.\"O .BR EQL_GETSLAVECFG , -.\"O .BR EQL_SETSLAVECFG , -.\"O .BR EQL_GETMASTERCFG , -.\"O and -.\"O .B EQL_SETMASTERCFG -.\"O take a -.\"O .IR "struct ifreq *" . -.\"O The -.\"O .I ifr_data -.\"O field is a pointer to another structure as follows: -.BR EQL_ENSLAVE , -.BR EQL_EMANCIPATE , -.BR EQL_GETSLAVECFG , -.BR EQL_SETSLAVECFG , -.BR EQL_GETMASTERCFG , -.B EQL_SETMASTERCFG -は -.I struct ifreq * -を使用します。 -.I ifr_data -フィールドは以下に示す別の構造体へのポインタです: +\fBEQL_ENSLAVE\fP, \fBEQL_EMANCIPATE\fP, \fBEQL_GETSLAVECFG\fP, \fBEQL_SETSLAVECFG\fP, +\fBEQL_GETMASTERCFG\fP, \fBEQL_SETMASTERCFG\fP は \fIstruct ifreq *\fP を使用します。 +\fIifr_data\fP フィールドは以下に示す別の構造体へのポインタです: .nf EQL_ENSLAVE const struct slaving_request * EQL_EMANCIPATE const struct slaving_request * - EQL_GETSLAVECFG struct slave_config * // I-O + EQL_GETSLAVECFG struct slave_config * // I\-O EQL_SETSLAVECFG const struct slave_config * EQL_GETMASTERCFG struct master_config * EQL_SETMASTERCFG const struct master_config * .fi -.\"O .B FDRAWCMD -.\"O takes a -.\"O .IR "struct floppy raw_cmd *" . -.\"O If -.\"O .I flags & FD_RAW_WRITE -.\"O is nonzero, then -.\"O .I data -.\"O points to an input buffer of length -.\"O .IR length . -.\"O If -.\"O .I flags & FD_RAW_READ -.\"O is nonzero, then -.\"O .I data -.\"O points to an output buffer of length -.\"O .IR length . -.B FDRAWCMD -は -.I struct floppy raw_cmd * -を使用します。 -.I flags & FD_RAW_WRITE -がゼロ以外の場合、 -.I data -は大きさ -.I length -の入力バッファへのポインタになります。 -.I flags & FD_RAW_READ -がゼロ以外の場合、 -.I data -は大きさ -.I length -の出力バッファへのポインタになります。 +\fBFDRAWCMD\fP は \fIstruct floppy raw_cmd *\fP を使用します。 \fIflags & FD_RAW_WRITE\fP +がゼロ以外の場合、 \fIdata\fP は大きさ \fIlength\fP の入力バッファへのポインタになります。 \fIflags & FD_RAW_READ\fP +がゼロ以外の場合、 \fIdata\fP は大きさ \fIlength\fP の出力バッファへのポインタになります。 -.\"O .B GIO_FONTX -.\"O and -.\"O .B PIO_FONTX -.\"O take a -.\"O .I struct console_font_desc * -.\"O or a -.\"O .IR "const struct console_font_desc *" , -.\"O respectively. -.\"O .I chardata -.\"O points to a buffer of -.\"O .IR "char [charcount]" . -.\"O This is an output buffer for -.\"O .B GIO_FONTX -.\"O and an input buffer for -.\"O .BR PIO_FONTX . -.BR GIO_FONTX , -.B PIO_FONTX -はそれぞれ -.I struct console_font_desc * -と -.I const struct console_font_desc * -を使用します。 -.I chardata -は -.I char [charcount] -バッファへのポインタです。 -これは -.B GIO_FONTX -の出力バッファと -.B PIO_FONTX -の入力バッファです。 +\fBGIO_FONTX\fP, \fBPIO_FONTX\fP はそれぞれ \fIstruct console_font_desc *\fP と \fIconst +struct console_font_desc *\fP を使用します。 \fIchardata\fP は \fIchar [charcount]\fP +バッファへのポインタです。 これは \fBGIO_FONTX\fP の出力バッファと \fBPIO_FONTX\fP の入力バッファです。 -.\"O .B GIO_UNIMAP -.\"O and -.\"O .B PIO_UNIMAP -.\"O take a -.\"O .I struct unimapdesc * -.\"O or a -.\"O .IR "const struct unimapdesc *" , -.\"O respectively. -.\"O .I entries -.\"O points to a buffer of -.\"O .IR "struct unipair [entry_ct]" . -.\"O This is an output buffer for -.\"O .B GIO_UNIMAP -.\"O and an input buffer for -.\"O .BR PIO_UNIMAP . -.BR GIO_UNIMAP , -.B PIO_UNIMAP -はそれぞれ -.I struct unimapdesc * -と -.I const struct unimapdesc * -を使用します。 -.I entries -は -.I struct unipair [entry_ct] -バッファへのポインタです。 -これは -.B GIO_UNIMAP -の出力バッファと -.B PIO_UNIMAP -の入力バッファです。 +\fBGIO_UNIMAP\fP, \fBPIO_UNIMAP\fP はそれぞれ \fIstruct unimapdesc *\fP と \fIconst struct +unimapdesc *\fP を使用します。 \fIentries\fP は \fIstruct unipair [entry_ct]\fP +バッファへのポインタです。 これは \fBGIO_UNIMAP\fP の出力バッファと \fBPIO_UNIMAP\fP の入力バッファです。 -.\"O KDADDIO, KDDELIO, KDDISABIO, and KDENABIO enable or disable access to -.\"O I/O ports. -.\"O They are essentially alternate interfaces to 'ioperm'. KDADDIO, KDDELIO, KDDISABIO, KDENABIO は I/O ポートへのアクセスを -可能/不可能にします。これらは本質的に、'ioperm' への別の -インターフェースです。 +可能/不可能にします。これらは本質的に、'ioperm' への別の インターフェースです。 -.\"O .B KDMAPDISP -.\"O and -.\"O .B KDUNMAPDISP -.\"O enable or disable memory mappings or I/O port access. -.\"O They are not implemented in the kernel. -.BR KDMAPDISP , -.B KDUNMAPDISP -はメモリ・マッピングや I/O ポートへのアクセスを可能/不可能にします。 +\fBKDMAPDISP\fP, \fBKDUNMAPDISP\fP はメモリ・マッピングや I/O ポートへのアクセスを可能/不可能にします。 これらはカーネルに実装されていません。 -.\"O .B SCSI_IOCTL_PROBE_HOST -.\"O takes an input pointer -.\"O .IR "const int *" , -.\"O which is a length. -.\"O It uses the same pointer as an output pointer to a -.\"O .I char [] -.\"O buffer of this length. -.B SCSI_IOCTL_PROBE_HOST -は入力ポインタ -.I const int * -を大きさとして使用します。これは同じ大きさの -.I char [] -バッファ への出力ポインタとしても使用します。 +\fBSCSI_IOCTL_PROBE_HOST\fP は入力ポインタ \fIconst int *\fP を大きさとして使用します。これは同じ大きさの +\fIchar []\fP バッファ への出力ポインタとしても使用します。 -.\"O .B SIOCADDRT -.\"O and -.\"O .B SIOCDELRT -.\"O take an input pointer whose type depends on -.\"O the protocol: -.BR SIOCADDRT , -.B SIOCDELRT -は型が以下のプロトコルに依存する入力ポインタを使用します: +\fBSIOCADDRT\fP, \fBSIOCDELRT\fP は型が以下のプロトコルに依存する入力ポインタを使用します: .nf Most protocols const struct rtentry * @@ -987,85 +696,33 @@ KDADDIO, KDDELIO, KDDISABIO, KDENABIO は I/O ポートへのアクセスを NET/ROM const struct nr_route_struct * .fi -.\"O .B SIOCGIFCONF -.\"O takes a -.\"O .IR "struct ifconf *" . -.\"O The -.\"O .I ifc_buf -.\"O field points to a buffer of length -.\"O .I ifc_len -.\"O bytes, into which the kernel writes a list of type -.\"O .IR "struct ifreq []" . -.B SIOCGIFCONF -は -.I struct ifconf * -を使用します。この -.I ifc_buf -フィールドは長さ -.I ifc_len -バイトのバッファへのポインタです。 -これにカーネルが -.I struct ifreq [] -型のリストへ書き込みます。 +\fBSIOCGIFCONF\fP は \fIstruct ifconf *\fP を使用します。この \fIifc_buf\fP フィールドは長さ \fIifc_len\fP +バイトのバッファへのポインタです。 これにカーネルが \fIstruct ifreq []\fP 型のリストへ書き込みます。 -.\"O .B SIOCSIFHWADDR -.\"O takes an input pointer whose type depends on the protocol: -.B SIOCSIFHWADDR -は型が以下のプロトコルに依存する入力ポインタを使用します: +\fBSIOCSIFHWADDR\fP は型が以下のプロトコルに依存する入力ポインタを使用します: .nf Most protocols const struct ifreq * AX.25 const char [AX25_ADDR_LEN] .fi -.\"O .B TIOCLINUX -.\"O takes a -.\"O .IR "const char *" . -.\"O It uses this to distinguish several -.\"O independent subcases. -.\"O In the table below, -.\"O .I N + foo -.\"O means -.\"O .I foo -.\"O after an N-byte pad. -.\"O .I struct selection -.\"O is implicitly defined in -.\"O .IR drivers/char/selection.c -.B TIOCLINUX -は -.I const char * -を使用します。このポインタをいくつかの -独立したサブクラスを識別する為に使用します。以下のテーブルの中で、 -.I N + foo -は N バイトの詰めものの後にある -.I foo -を意味します。 -.I struct selection -は暗黙的に -.I drivers/char/selection.c -の中で定義されています。 +\fBTIOCLINUX\fP は \fIconst char *\fP を使用します。このポインタをいくつかの +独立したサブクラスを識別する為に使用します。以下のテーブルの中で、 \fIN + foo\fP は N バイトの詰めものの後にある \fIfoo\fP +を意味します。 \fIstruct selection\fP は暗黙的に \fIdrivers/char/selection.c\fP の中で定義されています。 .nf - TIOCLINUX-2 1 + const struct selection * - TIOCLINUX-3 void - TIOCLINUX-4 void - TIOCLINUX-5 4 + const struct { long [8]; } * - TIOCLINUX-6 char * - TIOCLINUX-7 char * - TIOCLINUX-10 1 + const char * + TIOCLINUX\-2 1 + const struct selection * + TIOCLINUX\-3 void + TIOCLINUX\-4 void + TIOCLINUX\-5 4 + const struct { long [8]; } * + TIOCLINUX\-6 char * + TIOCLINUX\-7 char * + TIOCLINUX\-10 1 + const char * .fi // Duplicate ioctls -.\"O This list does not include ioctls in the range -.\"O .B SIOCDEVPRIVATE -.\"O and -.\"O .BR SIOCPROTOPRIVATE . -このリストは -.B SIOCDEVPRIVATE -から -.B SIOCPROTOPRIVATE -の範囲の ioctl を含んでいません。 +このリストは \fBSIOCDEVPRIVATE\fP から \fBSIOCPROTOPRIVATE\fP の範囲の ioctl を含んでいません。 .TS l l l. 0x00000001 FDSETPRM FIBMAP @@ -1075,6 +732,5 @@ l l l. 0x00005403 SNDCTL_TMR_STOP TCSETSW 0x00005404 SNDCTL_TMR_CONTINUE TCSETSF .TE -.\"O .SH SEE ALSO .SH 関連項目 -.BR ioctl (2) +\fBioctl\fP(2) diff --git a/draft/man2/ioperm.2 b/draft/man2/ioperm.2 index bb93f79b..2775a898 100644 --- a/draft/man2/ioperm.2 +++ b/draft/man2/ioperm.2 @@ -32,134 +32,58 @@ .\" Modified, 27 May 2004, Michael Kerrisk .\" Added notes on capability requirements .\" -.\" Japanese Version Copyright (c) 1997 HORIMOTO Masafumi -.\" all rights reserved. -.\" Translated 1997-09-11, HORIMOTO Masafumi -.\" Modified 1999-04-03, HANATAKA Shinya -.\" Updated 2003-10-12, Kentaro Shirakata -.\" Updated 2005-02-24, Akihiro MOTOKI -.\" Updated 2007-01-07, Akihiro MOTOKI, catch up to LDP v2.43 +.\"******************************************************************* .\" -.TH IOPERM 2 2007-06-15 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH IOPERM 2 2007\-06\-15 Linux "Linux Programmer's Manual" .SH 名前 -.\"O ioperm \- set port input/output permissions ioperm \- ポートの入出力許可を設定する -.\"O .SH SYNOPSIS .SH 書式 -.B #include -/* for libc5 */ +\fB#include \fP /* for libc5 */ .br -.B #include -/* for glibc */ +\fB#include \fP /* for glibc */ .sp -.BI "int ioperm(unsigned long " from ", unsigned long " num ", int " turn_on ); -.\"O .SH DESCRIPTION +\fBint ioperm(unsigned long \fP\fIfrom\fP\fB, unsigned long \fP\fInum\fP\fB, int +\fP\fIturn_on\fP\fB);\fP .SH 説明 -.\"O .BR ioperm () -.\"O sets the port access permission bits for the calling process for -.\"O \fInum\fP bytes starting from port address \fIfrom\fP to the value -.\"O \fIturn_on\fP. -.\"O If \fIturn_on\fP is nonzero, the calling process must be privileged -.\"O .RB ( CAP_SYS_RAWIO ). -.BR ioperm () -は、引き数 \fIfrom\fP の I/O ポートアドレスから -\fInum\fP バイト分の領域に対する、呼び出し元プロセスの -アクセス許可ビットを、\fIturn_on\fP に設定する。 -\fIturn_on\fP が 0 以外の場合、呼び出し元プロセスは特権 -.RB ( CAP_SYS_RAWIO ) -を持っていなければならない。 +\fBioperm\fP() は、引き数 \fIfrom\fP の I/O ポートアドレスから \fInum\fP バイト分の領域に対する、呼び出し元プロセスの +アクセス許可ビットを、\fIturn_on\fP に設定する。 \fIturn_on\fP が 0 以外の場合、呼び出し元プロセスは特権 +(\fBCAP_SYS_RAWIO\fP) を持っていなければならない。 .\" FIXME is the following ("Only the first 0x3ff I/O ports can be .\" specified in this manner") still true? Looking at changes in .\" include/asm-i386/processor.h between 2.4 and 2.6 suggests .\" that the limit is different in 2.6. -.\"O Only the first 0x3ff I/O ports can be specified in this manner. -.\"O For more ports, the -.\"O .BR iopl (2) -.\"O function must be used. -この方法で設定できるのは 0x3ff 番地までの I/Oポートに限られる。 -これよりも大きなアドレスのポートに対しては -.BR iopl (2) +この方法で設定できるのは 0x3ff 番地までの I/Oポートに限られる。 これよりも大きなアドレスのポートに対しては \fBiopl\fP(2) 関数を使わなければならない。 -.\"O Permissions are not inherited by the child created by -.\"O .BR fork (2). -.\"O Permissions are preserved across -.\"O .BR execve (2); -.\"O this is useful for giving port access permissions to unprivileged -.\"O programs. -アクセス権は -.BR fork (2) -で作成された子プロセスには継承されない。 -.BR execve (2) -の前後でアクセス権は保存される。この機能は -非特権プログラムにポートへのアクセス権を -与えるのに使用できる。 +アクセス権は \fBfork\fP(2) で作成された子プロセスには継承されない。 \fBexecve\fP(2) の前後でアクセス権は保存される。この機能は +非特権プログラムにポートへのアクセス権を 与えるのに使用できる。 -.\"O This call is mostly for the i386 architecture. -.\"O On many other architectures it does not exist or will always -.\"O return an error. -このシステムコールはほとんど i386 アーキテクチャのためだけのものである。 -その他の多くのアーキテクチャでは存在しないか、常にエラーを返す。 +このシステムコールはほとんど i386 アーキテクチャのためだけのものである。 その他の多くのアーキテクチャでは存在しないか、常にエラーを返す。 .SH 返り値 -成功した場合には 0 を返す。エラーの場合に \-1 を返し、 -.I errno -に適切な値を設定する。 -.\"O .SH ERRORS +成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP -.B EINVAL -.\"O Invalid values for -.\"O .I from -.\"O or -.\"O .IR num . -.I from -または -.I num -の値が不正である。 -.TP -.B EIO -.\"O (on PowerPC) This call is not supported. +.TP +\fBEINVAL\fP +\fIfrom\fP または \fInum\fP の値が不正である。 +.TP +\fBEIO\fP (PowerPC で) このシステムコールはサポートしていない。 -.TP -.B ENOMEM +.TP +\fBENOMEM\fP .\" Could not allocate I/O bitmap. -.\"O Out of memory. メモリ不足。 -.TP -.B EPERM -.\"O The calling process has insufficient privilege. +.TP +\fBEPERM\fP 呼び出し元プロセスに十分な権限がなかった。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O .BR ioperm () -.\"O is Linux-specific and should not be used in programs -.\"O intended to be portable. -.BR ioperm () -は Linux 特有の関数であり、移植を意図したプログラムで -使用してはならない。 -.\"O .SH NOTES +\fBioperm\fP() は Linux 特有の関数であり、移植を意図したプログラムで 使用してはならない。 .SH 注意 -.\"O Libc5 treats it as a system call and has a prototype in -.\"O .IR . -.\"O Glibc1 does not have a prototype. -.\"O Glibc2 has a prototype both in -.\"O .I -.\"O and in -.\"O .IR . -.\"O Avoid the latter, it is available on i386 only. -libc5 ではシステムコールとして扱い -.I -にプロトタイプが存在している。 -glibc1 にはプロトタイプは存在しない。 -glibc2 は -.I -と -.I -の両方にプロトタイプを持っている。 -後者は i386 のみで利用可能なので、使用すべきではない。 -.\"O .SH "SEE ALSO" +libc5 ではシステムコールとして扱い \fI\fP にプロトタイプが存在している。 glibc1 +にはプロトタイプは存在しない。 glibc2 は \fI\fP と \fI\fP +の両方にプロトタイプを持っている。 後者は i386 のみで利用可能なので、使用すべきではない。 .SH 関連項目 -.BR iopl (2), -.BR capabilities (7) +\fBiopl\fP(2), \fBcapabilities\fP(7) diff --git a/draft/man2/kexec_load.2 b/draft/man2/kexec_load.2 new file mode 100644 index 00000000..e2da39b1 --- /dev/null +++ b/draft/man2/kexec_load.2 @@ -0,0 +1,117 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright (C) 2010 Intel Corporation +.\" Author: Andi Kleen +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH KEXEC_LOAD 2 2010\-11\-04 Linux "Linux Programmer's Manual" +.SH 名前 +kexec_load \- load a new kernel for later execution +.SH 書式 +\fB#include \fP +.br +\fBlong kexec_load(unsigned long \fP\fIentry\fP\fB, unsigned long +\fP\fInr_segments\fP\fB,\fP +.br +\fB struct kexec_segment *\fP\fIsegments\fP\fB, unsigned long \fP\fIflags\fP\fB);\fP +.SH 説明 +The \fBkexec_load\fP() system call loads a new kernel that can be executed +later by \fBreboot\fP(2). +.PP +The \fIflags\fP argument is a mask whose high\-order bits control the operation +of the call. The following values can be specified in \fIflags\fP: +.TP +\fBKEXEC_ON_CRASH\fP (since Linux 2.6.13) +.\" FIXME figure out how this is really used +Execute the new kernel automatically on a system crash. +.TP +\fBKEXEC_PRESERVE_CONTEXT\fP (since Linux 2.7.27) +Preserve the system hardware and software states before executing the new +kernel. This could be used for system suspend. This flag is only available +if the kernel was configured with \fBCONFIG_KEXEC_JUMP\fP, and is only +effective if \fInr_segments\fP is greater than 0. +.PP +The low\-order bits of \fIflags\fP contain the architecture of the +to\-be\-executed kernel. Specify (OR) the constant \fBKEXEC_ARCH_DEFAULT\fP to +use the current architecture, or one of the following architecture constants +\fBKEXEC_ARCH_386\fP, \fBKEXEC_ARCH_X86_64\fP, \fBKEXEC_ARCH_PPC\fP, +\fBKEXEC_ARCH_PPC64\fP, \fBKEXEC_ARCH_IA_64\fP, \fBKEXEC_ARCH_ARM\fP, +\fBKEXEC_ARCH_S390\fP, \fBKEXEC_ARCH_SH\fP, \fBKEXEC_ARCH_MIPS\fP, and +\fBKEXEC_ARCH_MIPS_LE\fP. The architecture must be executable on the CPU of +the system. + +The \fIentry\fP argument is the physical entry address in the kernel image. +The \fInr_segments\fP argument is the number of segments pointed to by the +\fIsegments\fP pointer. The \fIsegments\fP argument is an array of +\fIkexec_segment\fP structures which define the kernel layout: +.in +4n +.nf + +struct kexec_segment { + void *buf; /* Buffer in user space */ + size_t bufsz; /* Buffer length in user space */ + void *mem; /* Physical address of kernel */ + size_t memsz; /* Physical address length */ +}; +.fi +.in +.PP +.\" FIXME elaborate on the following: +The kernel image defined by \fIsegments\fP is copied from the calling process +into previously reserved memory. +.SH 返り値 +On success, \fBkexec_load\fP() returns 0. On error, \-1 is returned and +\fIerrno\fP is set to indicate the error. +.SH エラー +.TP +\fBEBUSY\fP +Another crash kernel is already being loaded or a crash kernel is already in +use. +.TP +\fBEINVAL\fP +.\" KEXEC_SEGMENT_MAX == 16 +\fIflags\fP is invalid; or \fInr_segments\fP is too large +.TP +\fBEPERM\fP +The caller does not have the \fBCAP_SYS_BOOT\fP capability. +.SH バージョン +The \fBkexec_load\fP() system call first appeared in Linux 2.6.13. +.SH 準拠 +このシステムコールは Linux 固有である。 +.SH 注意 +Currently, there is no glibc support for \fBkexec_load\fP(). Call it using +\fBsyscall\fP(2). +.PP +.\" FIXME Andi submitted a patch for this. +.\" Check if it got accepted later. +The required constants are in the kernel source file \fIlinux/kexec.h\fP, which +is not currently exported to glibc. Therefore, these constants must be +defined manually. + +This system call is only available if the kernel was configured with +\fBCONFIG_KEXEC\fP. +.SH 関連項目 +\fBreboot\fP(2), \fBsyscall\fP(2) diff --git a/draft/man2/linkat.2 b/draft/man2/linkat.2 index 1bf61056..a387e7e6 100644 --- a/draft/man2/linkat.2 +++ b/draft/man2/linkat.2 @@ -24,244 +24,75 @@ .\" .\" FIXME: Linux 2.6.39 added AT_EMPTY_PATH .\" -.\" Japanese Version Copyright (c) 2006 Yuichi SATO -.\" all rights reserved. -.\" Translated 2006-09-30 by Yuichi SATO , LDP v2.39 +.\"******************************************************************* .\" -.TH LINKAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH LINKAT 2 2009\-12\-13 Linux "Linux Programmer's Manual" .SH 名前 -.\"O linkat \- create a file link relative to directory file descriptors -linkat \- ディレクトリファイルディスクリプタから相対的な位置にファイルリンクを作成する -.\"O .SH SYNOPSIS +linkat \- ディレクトリファイルディスクリプタから相対的な位置にファイルリンクを作成する .SH 書式 .nf -.\"O .B #include /* Definition of AT_* constants */ -.B #include /* AT_* 定数の定義 */ -.B #include +\fB#include /* AT_* 定数の定義 */\fP +\fB#include \fP .sp -.BI "int linkat(int " olddirfd ", const char *" oldpath , -.BI " int " newdirfd ", const char *" newpath ", int " flags ); +\fBint linkat(int \fP\fIolddirfd\fP\fB, const char *\fP\fIoldpath\fP\fB,\fP +\fB int \fP\fInewdirfd\fP\fB, const char *\fP\fInewpath\fP\fB, int \fP\fIflags\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR linkat (): +\fBlinkat\fP(): .PD 0 .ad l .RS 4 -.TP 4 -.\"O Since glibc 2.10: +.TP 4 glibc 2.10 以降: _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L -.TP -.\"O Before glibc 2.10: +.TP glibc 2.10 より前: _ATFILE_SOURCE .RE .ad .PD -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR linkat () -.\"O system call operates in exactly the same way as -.\"O .BR link (2), -.\"O except for the differences described in this manual page. -.BR linkat () -システムコールは、この man ページで説明する違い以外は、 -.BR link (2) -と全く同じように動作する。 +\fBlinkat\fP() システムコールは、この man ページで説明する違い以外は、 \fBlink\fP(2) と全く同じように動作する。 -.\"O If the pathname given in -.\"O .I oldpath -.\"O is relative, then it is interpreted relative to the directory -.\"O referred to by the file descriptor -.\"O .I olddirfd -.\"O (rather than relative to the current working directory of -.\"O the calling process, as is done by -.\"O .BR link (2) -.\"O for a relative pathname). -.I oldpath -で指定されるパス名が相対パス名である場合、 -ファイルディスクリプタ -.I olddirfd -で参照されるディレクトリからの相対パス名として解釈される -.RB ( link (2) -では、相対パスは呼び出し元プロセスの +\fIoldpath\fP で指定されるパス名が相対パス名である場合、 ファイルディスクリプタ \fIolddirfd\fP +で参照されるディレクトリからの相対パス名として解釈される (\fBlink\fP(2) では、相対パスは呼び出し元プロセスの カレントワーキングディレクトリからの相対パスとなる)。 -.\"O If -.\"O .I oldpath -.\"O is relative and -.\"O .I olddirfd -.\"O is the special value -.\"O .BR AT_FDCWD , -.\"O then -.\"O .I oldpath -.\"O is interpreted relative to the current working -.\"O directory of the calling process (like -.\"O .BR link (2)). -.I oldpath -が相対パスであり、かつ -.I olddirfd -が特別な値 -.B AT_FDCWD -である場合、 -.I oldpath -は -.RB ( link (2) -と同じように) 呼び出し元プロセスの -カレントワーキングディレクトリからの相対パス名として解釈される。 +\fIoldpath\fP が相対パスであり、かつ \fIolddirfd\fP が特別な値 \fBAT_FDCWD\fP である場合、 \fIoldpath\fP は +(\fBlink\fP(2) と同じように) 呼び出し元プロセスの カレントワーキングディレクトリからの相対パス名として解釈される。 -.\"O If -.\"O .I oldpath -.\"O is absolute, then -.\"O .I olddirfd -.\"O is ignored. -.I oldpath -が絶対パスである場合、 -.I olddirfd -は無視される。 +\fIoldpath\fP が絶対パスである場合、 \fIolddirfd\fP は無視される。 -.\"O The interpretation of -.\"O .I newpath -.\"O is as for -.\"O .IR oldpath , -.\"O except that a relative pathname is interpreted relative -.\"O to the directory referred to by the file descriptor -.\"O .IR newdirfd . -.I newpath -の解釈は -.I oldpath -と同様であるが、 -相対パス名はファイルディスクリプタ -.I newdirfd +\fInewpath\fP の解釈は \fIoldpath\fP と同様であるが、 相対パス名はファイルディスクリプタ \fInewdirfd\fP で参照されるディレクトリからの相対パス名として解釈される。 -.\"O By default, -.\"O .BR linkat (), -.\"O does not dereference -.\"O .I oldpath -.\"O if it is a symbolic link (like -.\"O .BR link (2)). -.\"O Since Linux 2.6.18, the flag -.\"O .B AT_SYMLINK_FOLLOW -.\"O can be specified in -.\"O .I flags -.\"O to cause -.\"O .I oldpath -.\"O to be dereferenced if it is a symbolic link. -.\"O Before kernel 2.6.18, the -.\"O .I flags -.\"O argument was unused, and had to be specified as 0. -デフォルトでは、 -.I oldpath -がシンボリック・リンクの場合、 -.RB ( link (2) -同様) -.BR linkat () -は -.I oldpath -の参照の解決を行わない。 -Linux 2.6.18 以降では、 -.B AT_SYMLINK_FOLLOW -フラグを -.I flags -に指定することができる。このフラグを指定すると、 -.I oldpath -がシンボリック・リンクの場合、 -.I oldpath -の参照の解決を行う。 -2.6.18 以前のカーネルでは、 -.I flags -引き数は使用されず、 -0 を指定しなければならなかった。 -.\"O .SH "RETURN VALUE" +デフォルトでは、 \fIoldpath\fP がシンボリック・リンクの場合、 (\fBlink\fP(2) 同様) \fBlinkat\fP() は +\fIoldpath\fP の参照の解決を行わない。 Linux 2.6.18 以降では、 \fBAT_SYMLINK_FOLLOW\fP フラグを +\fIflags\fP に指定することができる。このフラグを指定すると、 \fIoldpath\fP がシンボリック・リンクの場合、 \fIoldpath\fP +の参照の解決を行う。 2.6.18 以前のカーネルでは、 \fIflags\fP 引き数は使用されず、 0 を指定しなければならなかった。 .SH 返り値 -.\"O On success, -.\"O .BR linkat () -.\"O returns 0. -成功した場合、 -.BR linkat () -は 0 を返す。 -.\"O On error, \-1 is returned and -.\"O .I errno -.\"O is set to indicate the error. -エラーの場合、\-1 が返されて、 -.I errno -にはエラーを示す値が設定される。 -.\"O .SH ERRORS +成功した場合、 \fBlinkat\fP() は 0 を返す。 エラーの場合、\-1 が返されて、 \fIerrno\fP にはエラーを示す値が設定される。 .SH エラー -.\"O The same errors that occur for -.\"O .BR link (2) -.\"O can also occur for -.\"O .BR linkat (). -.BR link (2) -と同じエラーが -.BR linkat () -でも起こる。 -.\"O The following additional errors can occur for -.\"O .BR linkat (): -.BR linkat () -では、その他に以下のエラーが起こる: -.TP -.B EBADF -.\"O .I olddirfd -.\"O or -.\"O .I newdirfd -.\"O is not a valid file descriptor. -.I olddirfd -または -.I newdirfd -が有効なファイルディスクリプタでない。 -.TP -.B ENOTDIR -.\"O .I oldpath -.\"O is relative and -.\"O .I olddirfd -.\"O is a file descriptor referring to a file other than a directory; -.I oldpath -が相対パスで、かつ -.I olddirfd -がディレクトリ以外のファイルを参照するファイルディスクリプタである。 -.\"O or similar for -.\"O .I newpath -.\"O and -.\"O .I newdirfd -または -.I newpath -と -.I newdirfd -について、同様のことが起きている。 -.\"O .SH VERSIONS +\fBlink\fP(2) と同じエラーが \fBlinkat\fP() でも起こる。 \fBlinkat\fP() では、その他に以下のエラーが起こる: +.TP +\fBEBADF\fP +\fIolddirfd\fP または \fInewdirfd\fP が有効なファイルディスクリプタでない。 +.TP +\fBENOTDIR\fP +\fIoldpath\fP が相対パスで、かつ \fIolddirfd\fP がディレクトリ以外のファイルを参照するファイルディスクリプタである。 または +\fInewpath\fP と \fInewdirfd\fP について、同様のことが起きている。 .SH バージョン -.\"O .BR linkat () -.\"O was added to Linux in kernel 2.6.16. -.BR linkat () -は Linux カーネル 2.6.16 で追加された。 -.\"O .SH "CONFORMING TO" +\fBlinkat\fP() は Linux カーネル 2.6.16 で追加された。 .SH 準拠 -POSIX.1-2008. -.\"O .SH NOTES +POSIX.1\-2008. .SH 注意 -.\"O See -.\"O .BR openat (2) -.\"O for an explanation of the need for -.\"O .BR linkat (). -.BR linkat () -が必要な理由については、 -.BR openat (2) -を参照すること。 -.\"O .SH "SEE ALSO" +\fBlinkat\fP() が必要な理由については、 \fBopenat\fP(2) を参照すること。 .SH 関連項目 -.BR link (2), -.BR openat (2), -.BR path_resolution (7), -.BR symlink (7) +\fBlink\fP(2), \fBopenat\fP(2), \fBpath_resolution\fP(7), \fBsymlink\fP(7) diff --git a/draft/man2/listen.2 b/draft/man2/listen.2 index 37ea92db..b8b5ffb4 100644 --- a/draft/man2/listen.2 +++ b/draft/man2/listen.2 @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: listen.2,v 1.4 2001/05/19 02:09:20 hanataka Exp $ +.\" $Id: listen.2,v 1.6 1999/05/18 14:10:32 freitag Exp $ .\" .\" Modified Fri Jul 23 22:07:54 1993 by Rik Faith .\" Modified 950727 by aeb, following a suggestion by Urs Thuermann @@ -39,246 +39,79 @@ .\" Modified 1998 by Andi Kleen .\" Modified 11 May 2001 by Sam Varshavchik .\" -.\" Japanese Version Copyright (c) 1998 Shinya HANATAKA, Takeshi Hakamada -.\" all rights reserved. -.\" Translated 1998-04-06,Shinya HANATAKA -.\" and Takeshi Hakamada -.\" Modified 2000-01-13, Kentaro Shirakata -.\" Modified 2001-05-19, Shinya HANATAKA -.\" Updated 2007-07-04, Akihiro MOTOKI , LDP v2.58 -.\" Updated 2008-02-10, Akihiro MOTOKI , LDP v2.77 .\" -.\"WORD: socket ソケット -.\"WORD: listen 監視 -.\"WORD: queue キュー -.\"WORD: descriptor ディスクリプター +.\"******************************************************************* .\" -.TH LISTEN 2 2008-11-20 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH LISTEN 2 2008\-11\-20 Linux "Linux Programmer's Manual" .SH 名前 -.\"O listen \- listen for connections on a socket listen \- ソケット(socket)上の接続を待つ -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .BR "#include " " /* See NOTES */" -.BR "#include " " /* 「注意」参照 */" +\fB#include \fP /* 「注意」参照 */ .br -.B #include +\fB#include \fP .sp -.BI "int listen(int " sockfd ", int " backlog ); +\fBint listen(int \fP\fIsockfd\fP\fB, int \fP\fIbacklog\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR listen () -.\"O marks the socket referred to by -.\"O .I sockfd -.\"O as a passive socket, that is, as a socket that will -.\"O be used to accept incoming connection requests using -.\"O .BR accept (2). -.BR listen () -は -.I sockfd -が参照するソケットを接続待ちソケット (passive socket) として印をつける。 -接続待ちソケットとは、 -.BR accept (2) -を使って到着した接続要求を受け付けるのに使用されるソケットである。 +\fBlisten\fP() は \fIsockfd\fP が参照するソケットを接続待ちソケット (passive socket) として印をつける。 +接続待ちソケットとは、 \fBaccept\fP(2) を使って到着した接続要求を受け付けるのに使用されるソケットである。 -.\"O The -.\"O .I sockfd -.\"O argument is a file descriptor that refers to a socket of type -.\"O .B SOCK_STREAM -.\"O or -.\"O .BR SOCK_SEQPACKET . -.I sockfd -引き数は、 -.B SOCK_STREAM -型か -.B SOCK_SEQPACKET +\fIsockfd\fP 引き数は、 \fBSOCK_STREAM\fP 型か \fBSOCK_SEQPACKET\fP 型のソケットを参照するファイルディスクリプタである。 -.\"O The -.\"O .I backlog -.\"O argument defines the maximum length -.\"O to which the queue of pending connections for -.\"O .I sockfd -.\"O may grow. -.\"O If a connection request arrives when the queue is full, the client -.\"O may receive an error with an indication of -.\"O .B ECONNREFUSED -.\"O or, if the underlying protocol supports retransmission, the request may be -.\"O ignored so that a later reattempt at connection succeeds. -.I backlog -引き数は、 -.I sockfd -についての保留中の接続のキューの最大長を指定する。 -キューがいっぱいの状態で接続要求が到着すると、クライアントは -.B ECONNREFUSED -というエラーを受け取る。下位層のプロトコルが再送信をサポート -していれば、要求は無視され、これ以降の接続要求の再送信が成功するかもしれない。 -.\"O .SH "RETURN VALUE" +\fIbacklog\fP 引き数は、 \fIsockfd\fP についての保留中の接続のキューの最大長を指定する。 +キューがいっぱいの状態で接続要求が到着すると、クライアントは \fBECONNREFUSED\fP +というエラーを受け取る。下位層のプロトコルが再送信をサポート していれば、要求は無視され、これ以降の接続要求の再送信が成功するかもしれない。 .SH 返り値 -.\"O On success, zero is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功時には0を返す。エラー時には \-1を返し、 -.I errno -を適切に設定する。 -.\"O .SH ERRORS +成功した場合にはゼロが返される。エラー時には \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.\"O .TP -.\"O .B EADDRINUSE -.\"O Another socket is already listening on the same port. -.TP -.B EADDRINUSE +.TP +\fBEADDRINUSE\fP 別のソケットが既に同じポートを listen している。 -.TP -.B EBADF -.\"O The argument -.\"O .I sockfd -.\"O is not a valid descriptor. -引き数 -.I sockfd -は有効なディスクリプターではない。 -.TP -.B ENOTSOCK -.\"O The argument -.\"O .I sockfd -.\"O is not a socket. -引き数 -.I sockfd -はソケットではない。 -.TP -.B EOPNOTSUPP -.\"O The socket is not of a type that supports the -.\"O .BR listen () -.\"O operation. -ソケットは -.BR listen () -がサポートしている型ではない。 -.\"O .SH "CONFORMING TO" +.TP +\fBEBADF\fP +引き数 \fIsockfd\fP は有効なディスクリプターでない。 +.TP +\fBENOTSOCK\fP +引き数 \fIsockfd\fP はソケットではない。 +.TP +\fBEOPNOTSUPP\fP +ソケットは \fBlisten\fP() がサポートしている型ではない。 .SH 準拠 -.\"O 4.4BSD, POSIX.1-2001. -.\"O The -.\"O .B listen -.\"O function call first appeared in 4.2BSD. -4.4BSD, POSIX.1-2001. -.BR listen () -関数は 4.2BSDで初めて実装された。 -.\"O .SH NOTES +4.4BSD, POSIX.1\-2001. \fBlisten\fP() 関数は 4.2BSDで初めて実装された。 .SH 注意 -.\"O To accept connections, the following steps are performed: 接続を受け付けるには、以下の処理が実行される。 .RS 4 .IP 1. 4 -.\"O A socket is created with -.\"O .BR socket (2). -.BR socket (2) -でソケットを作成する。 +\fBsocket\fP(2) でソケットを作成する。 .IP 2. -.\"O The socket is bound to a local address using -.\"O .BR bind (2), -.\"O so that other sockets may be -.\"O .BR connect (2)ed -.\"O to it. -.BR bind (2) -を使ってソケットにローカルアドレスを割り当てて、 -他のソケットがこのソケットに -.BR connect (2) -できるようにする。 +\fBbind\fP(2) を使ってソケットにローカルアドレスを割り当てて、 他のソケットがこのソケットに \fBconnect\fP(2) できるようにする。 .IP 3. -.\"O A willingness to accept incoming connections and a queue limit for incoming -.\"O connections are specified with -.\"O .BR listen (). -.BR listen () -を使って、接続要求を受け付ける意志と接続要求を入れるキュー長を指定する。 +\fBlisten\fP() を使って、接続要求を受け付ける意志と接続要求を入れるキュー長を指定する。 .IP 4. -.\"O Connections are accepted with -.\"O .BR accept (2). -.BR accept (2) -を使って接続を受け付ける。 +\fBaccept\fP(2) を使って接続を受け付ける。 .RE .PP -.\"O POSIX.1-2001 does not require the inclusion of -.\"O .IR , -.\"O and this header file is not required on Linux. -.\"O However, some historical (BSD) implementations required this header -.\"O file, and portable applications are probably wise to include it. -POSIX.1-2001 では -.I -のインクルードは必須とされておらず、 -Linux ではこのヘッダファイルは必要ではない。 -しかし、歴史的には、いくつかの実装 (BSD 系) でこのヘッダファイルが -必要であり、移植性が必要なアプリケーションではこのファイルを -インクルードするのが賢明であろう。 +POSIX.1\-2001 では \fI\fP のインクルードは必須とされておらず、 Linux +ではこのヘッダファイルは必要ではない。 しかし、歴史的には、いくつかの実装 (BSD 系) でこのヘッダファイルが +必要であり、移植性が必要なアプリケーションではこのファイルを インクルードするのが賢明であろう。 -.\"O The behavior of the -.\"O .I backlog -.\"O argument on TCP sockets changed with Linux 2.2. -TCP ソケットでの -.I backlog -引き数の振る舞いは Linux 2.2 で変更された。 -.\"O Now it specifies the queue length for -.\"O .I completely -.\"O established sockets waiting to be accepted, -.\"O instead of the number of incomplete connection requests. -.\"O The maximum length of the queue for incomplete sockets -.\"O can be set using -.\"O .IR /proc/sys/net/ipv4/tcp_max_syn_backlog . -現在ではこの引き数は、 -受け付けられるのを待っている、 -.I 完全に -確立されたソケットのキューの長さを指定する。 -以前は不完全な接続要求の数であったが、これを置き換えた。 -不完全なソケットのキューの最大長は -.I /proc/sys/net/ipv4/tcp_max_syn_backlog -を用いて設定できる。 -.\"O When syncookies are enabled there is no logical maximum -.\"O length and this setting is ignored. -.\"O See -.\"O .BR tcp (7) -.\"O for more information. -syncookie が有効になっている場合、 -論理的な最大長は存在せず、この設定は無視される。 +TCP ソケットでの \fIbacklog\fP 引き数の振る舞いは Linux 2.2 で変更された。 現在ではこの引き数は、 +受け付けられるのを待っている、 \fI完全に\fP 確立されたソケットのキューの長さを指定する。 以前は不完全な接続要求の数であったが、これを置き換えた。 +不完全なソケットのキューの最大長は \fI/proc/sys/net/ipv4/tcp_max_syn_backlog\fP を用いて設定できる。 +syncookie が有効になっている場合、 論理的な最大長は存在せず、この設定は無視される。 -.\"O If the -.\"O .I backlog -.\"O argument is greater than the value in -.\"O .IR /proc/sys/net/core/somaxconn , -.\"O then it is silently truncated to that value; -.\"O the default value in this file is 128. -.\"O In kernels before 2.4.25, this limit was a hard coded value, -.\"O .BR SOMAXCONN , -.\"O with the value 128. -.I backlog -引き数が -.I /proc/sys/net/core/somaxconn -の値よりも大きければ、 -.I backlog -の値は暗黙のうちにこの値に切り詰められる。 -このファイルのデフォルト値は 128 である。 -バージョン 2.4.5 以前のカーネルでは、この上限値は -コード埋め込みの固定値 -.B SOMAXCONN -であり、その値は 128 であった。 -.\"O .\" The following is now rather historic information (MTK, Jun 05) -.\"O .\" Don't rely on this value in portable applications since BSD -.\"O .\" (and some BSD-derived systems) limit the backlog to 5. -.\" 以下は、今では古い情報である。(MTK, Jun 05) -.\" BSD (と、いくつかの BSD から派生したシステム)では backlog を 5 に -.\" 制限しているので、移植性を考慮したアプリケーションでは -.\" この値 (SOMAXCONN) に頼ってはいけない。 -.\"O .SH EXAMPLE +.\" The following is now rather historic information (MTK, Jun 05) +.\" Don't rely on this value in portable applications since BSD +.\" (and some BSD-derived systems) limit the backlog to 5. +\fIbacklog\fP 引き数が \fI/proc/sys/net/core/somaxconn\fP の値よりも大きければ、 \fIbacklog\fP +の値は暗黙のうちにこの値に切り詰められる。 このファイルのデフォルト値は 128 である。 バージョン 2.4.5 以前のカーネルでは、この上限値は +コード埋め込みの固定値 \fBSOMAXCONN\fP であり、その値は 128 であった。 .SH 例 -.\"O See -.\"O .BR bind (2). -.BR bind (2) -参照。 -.\"O .SH "SEE ALSO" +\fBbind\fP(2) 参照。 .SH 関連項目 -.BR accept (2), -.BR bind (2), -.BR connect (2), -.BR socket (2), -.BR socket (7) +\fBaccept\fP(2), \fBbind\fP(2), \fBconnect\fP(2), \fBsocket\fP(2), \fBsocket\fP(7) diff --git a/draft/man2/madvise.2 b/draft/man2/madvise.2 deleted file mode 100644 index 18bc9a6e..00000000 --- a/draft/man2/madvise.2 +++ /dev/null @@ -1,373 +0,0 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" Copyright (C) 2001 David Gez -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" Based on comments from mm/filemap.c. Last modified on 10-06-2001 -.\" Modified, 25 Feb 2002, Michael Kerrisk, -.\" Added notes on MADV_DONTNEED -.\" FIXME -.\" 2.6.32 added MADV_HWPOISON, MADV_MERGEABLE, and MADV_UNMERGEABLE -.\" 2.6.33 added MADV_SOFT_OFFLINE -.\" -.\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved. -.\" Translated Thu Aug 16 2001 by NAKANO Takeo -.\" Updated Tue 8 Oct 2002 by NAKANO Takeo -.\" Updated 2007-01-08, Akihiro MOTOKI , LDP v2.43 -.\" -.TH MADVISE 2 2008-04-22 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O madvise \- give advice about use of memory -.SH 名前 -madvise \- メモリ利用に関するアドバイスを与える -.\"O .SH SYNOPSIS -.SH 書式 -.B #include -.sp -.BI "int madvise(void *" addr ", size_t " length ", int " advice ); -.sp -.in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): -.in -.sp -.BR madvise (): -_BSD_SOURCE -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The -.\"O .BR madvise () -.\"O system call advises the kernel about how to handle paging input/output in -.\"O the address range beginning at address -.\"O .I addr -.\"O and with size -.\"O .I length -.\"O bytes. -.\"O It allows an application to tell the kernel how it expects to use -.\"O some mapped or shared memory areas, so that the kernel can choose -.\"O appropriate read-ahead and caching techniques. -.\"O This call does not influence the semantics of the application -.\"O (except in the case of -.\"O .BR MADV_DONTNEED ), -.\"O but -.\"O may influence its performance. -.\"O The kernel is free to ignore the advice. -.BR madvise () -システムコールは、アドレス -.I addr -からはじまる -.I length -バイトのメモリブロックのページング入出力をどう扱えば良いか、 -カーネルにアドバイスする。 -これを用いると、 -アプリケーションからカーネルに、 -マップされたメモリや共有メモリをどのように扱ってほしいか伝えることができ、 -カーネルはそれに応じて先読みやキャッシュなどの適切な手法を選択できる。 -このコールはアプリケーションの動作そのものには影響しない -.RB ( MADV_DONTNEED -の場合は別) が、 -性能には影響しうる。 -なおこのアドバイスを受け入れるかどうかはカーネルに任される。 -.LP -.\"O The advice is indicated in the -.\"O .I advice -.\"O argument which can be -アドバイスは引き数 -.I advice -によって与える。以下のいずれかを指定できる。 -.TP -.B MADV_NORMAL -.\"O No special treatment. -.\"O This is the default. -特別な扱いは行わない。これがデフォルトである。 -.TP -.B MADV_RANDOM -.\"O Expect page references in random order. -.\"O (Hence, read ahead may be less useful than normally.) -ページ参照はランダムな順序で行われそうだ。 -(したがって、先読みはあまり効果がなさそうだ。) -.TP -.B MADV_SEQUENTIAL -.\"O Expect page references in sequential order. -.\"O (Hence, pages in the given range can be aggressively read ahead, -.\"O and may be freed soon after they are accessed.) -ページ参照はシーケンシャルな順序で行われそうだ。 -(したがって与えた範囲のページは積極的に先読みしておくと良いだろう。 -またアクセスが終わったら速やかに解放して良い。) -.TP -.B MADV_WILLNEED -.\"O Expect access in the near future. -.\"O (Hence, it might be a good idea to read some pages ahead.) -近い将来にアクセスされそうだ。 -(したがってこれらのページを今のうちに先読みしておくといいだろう。) -.TP -.B MADV_DONTNEED -.\"O Do not expect access in the near future. -.\"O (For the time being, the application is finished with the given range, -.\"O so the kernel can free resources associated with it.) -しばらくアクセスはなさそうだ。 -(現時点でアプリケーションは与えた範囲の処理を終えている。 -したがってカーネルはこれに関連するリソースを解放して良い。) -.\"O Subsequent accesses of pages in this range will succeed, but will result -.\"O either in reloading of the memory contents from the underlying mapped file -.\"O (see -.\"O .BR mmap (2)) -.\"O or zero-fill-on-demand pages for mappings -.\"O without an underlying file. -これ以降この範囲のページへのアクセスがあると、 -成功はするが、メモリの内容をマップ元のファイルからロードし直すことになる -.RB ( mmap (2) -を見よ) か、 -または元ファイルがないマップページでは -アクセスがあったときに 0 埋めが行われることになる。 -.TP -.\"O .BR MADV_REMOVE " (Since Linux 2.6.16)" -.BR MADV_REMOVE " (Linux 2.6.16 以降)" -.\"O Free up a given range of pages -.\"O and its associated backing store. -.\"O Currently, -.\"O .\" 2.6.18-rc5 -.\"O only shmfs/tmpfs supports this; other file systems return with the -.\"O error -.\"O .BR ENOSYS . -指定された範囲のページと関連するバッキングストアを解放する。 -現在のところ、 -.\" 2.6.18-rc5 -shmfs/tmpfs だけがこれに対応している。 -他のファイルシステムでは -.B ENOSYS -が返される。 -.\" Databases want to use this feature to drop a section of their -.\" bufferpool (shared memory segments) - without writing back to -.\" disk/swap space. This feature is also useful for supporting -.\" hot-plug memory on UML. -.TP -.\"O .BR MADV_DONTFORK " (Since Linux 2.6.16)" -.BR MADV_DONTFORK " (Linux 2.6.16 以降)" -.\" See http://lwn.net/Articles/171941/ -.\"O Do not make the pages in this range available to the child after a -.\"O .BR fork (2). -.\"O This is useful to prevent copy-on-write semantics from changing -.\"O the physical location of a page(s) if the parent writes to it after a -.\"O .BR fork (2). -.\"O (Such page relocations cause problems for hardware that -.\"O DMAs into the page(s).) -.BR fork (2) -が行われた後、指定された範囲のページを子プロセスが利用できないようにする。 -この機能は、書き込み時コピー (copy-on-write) 方式で、 -.BR fork (2) -の後で親プロセスがページに書き込みを行った場合に -ページの物理位置が変化しないようにするのに有効である -(ページの再配置はハードウェアがそのページに DMA 転送を行うような場合に -問題を起こすことがある)。 -.\" [PATCH] madvise MADV_DONTFORK/MADV_DOFORK -.\" Currently, copy-on-write may change the physical address of -.\" a page even if the user requested that the page is pinned in -.\" memory (either by mlock or by get_user_pages). This happens -.\" if the process forks meanwhile, and the parent writes to that -.\" page. As a result, the page is orphaned: in case of -.\" get_user_pages, the application will never see any data hardware -.\" DMA's into this page after the COW. In case of mlock'd memory, -.\" the parent is not getting the realtime/security benefits of mlock. -.\" -.\" In particular, this affects the Infiniband modules which do DMA from -.\" and into user pages all the time. -.\" -.\" This patch adds madvise options to control whether memory range is -.\" inherited across fork. Useful e.g. for when hardware is doing DMA -.\" from/into these pages. Could also be useful to an application -.\" wanting to speed up its forks by cutting large areas out of -.\" consideration. -.\" -.\" SEE ALSO: http://lwn.net/Articles/171941/ -.\" "Tweaks to madvise() and posix_fadvise()", 14 Feb 2006 -.TP -.\"O .BR MADV_DOFORK " (Since Linux 2.6.16)" -.BR MADV_DOFORK " (Linux 2.6.16 以降)" -.\"O Undo the effect of -.\"O .BR MADV_DONTFORK , -.\"O restoring the default behavior, whereby a mapping is inherited across -.\"O .BR fork (2). -.B MADV_DONTFORK -の影響を取り消し、デフォルトの動作に戻す。 -つまり、 -.BR fork (2) -の前後でマッピングは継承されるようになる。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success -.\"O .BR madvise () -.\"O returns zero. -.\"O On error, it returns \-1 and -.\"O .I errno -.\"O is set appropriately. -.BR madvise () -は成功すると 0 を返す。 -エラーが起こると \-1 を返し、 -.I errno -を適切な値に設定する。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EAGAIN -.\"O A kernel resource was temporarily unavailable. -何らかのカーネルリソースが一時的に利用できなかった。 -.TP -.B EBADF -.\"O The map exists, but the area maps something that isn't a file. -指定したマップは存在するが、ファイルではないところをマップしている。 -.TP -.B EINVAL -.\"O The value -.\"O .I len -.\"O is negative, -.\" .I len -.\" is zero, -.\"O .I addr -.\"O is not page-aligned, -.\"O .I advice -.\"O is not a valid value, or the application is attempting -.\"O to release locked or shared pages (with -.\"O .BR MADV_DONTNEED ). -.I len -の値が負、 -.I addr -がページ境界でない、 -.I advice -が正しい値でない、 -アプリケーションがロックされたページや共有ページを -.RB ( MADV_DONTNEED -で) 解放しようとしている、など。 -.TP -.B EIO -.\"O (for -.\"O .BR MADV_WILLNEED ) -.\"O Paging in this area would exceed the process's -.\"O maximum resident set size. -.RB ( MADV_WILLNEED -の場合) この範囲のページングを行うと、 -プロセスの RSS (resident set size) の最大値を越えてしまう。 -.\"nakano RSS は訳語がありましたっけ? -.TP -.B ENOMEM -.\"O (for -.\"O .BR MADV_WILLNEED ) -.\"O Not enough memory: paging in failed. -.RB ( MADV_WILLNEED -の場合) メモリが足りず、ページングに失敗した。 -.TP -.B ENOMEM -.\"O Addresses in the specified range are not currently -.\"O mapped, or are outside the address space of the process. -指定した範囲のアドレスが、現在マップされていない。 -あるいはプロセスのアドレス空間の内部にない。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -POSIX.1b. -.\"O POSIX.1-2001 describes -.\"O .BR posix_madvise (3) -.\"O .\" FIXME . Write a posix_fadvise(3) page. -.\"O with constants -.\"O .BR POSIX_MADV_NORMAL , -.\"O etc., -.\"O with a behavior close to that described here. -.\"O There is a similar -.\"O .BR posix_fadvise (2) -.\"O for file access. -POSIX.1-2001 では、 -.BR posix_madvise (3) -.\" FIXME . Write a posix_fadvise(3) page. -を -.B POSIX_MADV_NORMAL -などの定数とともに記述していた -(それぞれの振る舞いはここで述べたものに近い)。 -ファイルアクセスに対しても -.BR posix_fadvise (2) -という類似の関数が存在する。 - -.\"O .BR MADV_REMOVE , -.\"O .BR MADV_DONTFORK , -.\"O and -.\"O .B MADV_DOFORK -.\"O are Linux-specific. -.BR MADV_REMOVE , -.BR MADV_DONTFORK , -.B MADV_DOFORK -は Linux 固有である。 -.\"O .SH NOTES -.\"O .SS "Linux Notes" -.SH 注意 -.SS "Linux での注意" -.\"O .LP -.\"O The current Linux implementation (2.4.0) views this system call -.\"O more as a command than as advice and hence may return an error -.\"O when it cannot do what it usually would do in response to this -.\"O advice. -.\"O (See the ERRORS description above.) -.\"O This is nonstandard behavior. -現在の Linux の実装 (2.4.0) では、 -このシステムコールをアドバイスというよりは命令と見ている。 -したがってこのアドバイスに対して通常行われる動作が不可能な場合は、 -エラーを返すことがある (上記の エラー の記述を参照)。 -この振舞いは標準とは異なる。 -.LP -.\"O The Linux implementation requires that the address -.\"O .I addr -.\"O be page-aligned, and allows -.\"O .I length -.\"O to be zero. -.\"O If there are some parts of the specified address range -.\"O that are not mapped, the Linux version of -.\"O .BR madvise () -.\"O ignores them and applies the call to the rest (but returns -.\"O .B ENOMEM -.\"O from the system call, as it should). -Linux の実装では -.I addr -のアドレスはページ境界の値でなければならない。また -.I length -は 0 であっても構わない。 -また Linux 版の -.BR madvise () -では、指定されたアドレス範囲にマップされていない部分があると、 -これらを無視して残りの部分にアドバイスを適用する -(しかしシステムコールに対してはちゃんと -.B ENOMEM -を返す)。 -.\"O .\" .SH HISTORY -.\" .SH 歴史 -.\"O .\" The -.\"O .\" .BR madvise () -.\"O .\" function first appeared in 4.4BSD. -.\" .BR madvise () -.\" 関数は 4.4BSD で最初に登場した。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR getrlimit (2), -.BR mincore (2), -.BR mmap (2), -.BR mprotect (2), -.BR msync (2), -.BR munmap (2) diff --git a/draft/man2/migrate_pages.2 b/draft/man2/migrate_pages.2 new file mode 100644 index 00000000..fe46130f --- /dev/null +++ b/draft/man2/migrate_pages.2 @@ -0,0 +1,96 @@ +.\" Hey Emacs! This file is -*- nroff -*- source. +.\" +.\" Copyright 2009 Intel Corporation +.\" Author: Andi Kleen +.\" Based on the move_pages manpage which was +.\" This manpage is Copyright (C) 2006 Silicon Graphics, Inc. +.\" Christoph Lameter +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH MIGRATE_PAGES 2 2010\-11\-01 Linux "Linux Programmer's Manual" +.SH 名前 +migrate_pages \- move all pages in a process to another set of nodes +.SH 書式 +.nf +\fB#include \fP +.sp +\fBlong migrate_pages(int \fP\fIpid\fP\fB, unsigned long \fP\fImaxnode,\fP +\fB const unsigned long *\fP\fIold_nodes,\fP +\fB const unsigned long *\fP\fInew_nodes);\fP +.fi +.sp +\fI\-lnuma\fP とリンクする。 +.SH 説明 +\fBmigrate_pages\fP() moves all pages of the process \fIpid\fP that are in memory +nodes \fIold_nodes\fP to the memory nodes in \fInew_nodes\fP. Pages not located +in any node in \fIold_nodes\fP will not be migrated. As far as possible, the +kernel maintains the relative topology relationship inside \fIold_nodes\fP +during the migration to \fInew_nodes\fP. + +The \fIold_nodes\fP and \fInew_nodes\fP arguments are pointers to bit masks of +node numbers, with up to \fImaxnode\fP bits in each mask. These masks are +maintained as arrays of unsigned \fIlong\fP integers (in the last \fIlong\fP +integer, the bits beyond those specified by \fImaxnode\fP are ignored). The +\fImaxnode\fP argument is the maximum node number in the bit mask plus one +(this is the same as in \fBmbind\fP(2), but different from \fBselect\fP(2)). + +The \fIpid\fP argument is the ID of the process whose pages are to be moved. +To move pages in another process, the caller must be privileged +(\fBCAP_SYS_NICE\fP) or the real or effective user ID of the calling process +must match the real or saved\-set user ID of the target process. If \fIpid\fP +is 0, then \fBmigrate_pages\fP() moves pages of the calling process. + +Pages shared with another process will only be moved if the initiating +process has the \fBCAP_SYS_NICE\fP privilege. +.SH 返り値 +On success \fBmigrate_pages\fP() returns zero. On error, it returns \-1, and +sets \fIerrno\fP to indicate the error. +.SH エラー +.TP +\fBEPERM\fP +Insufficient privilege (\fBCAP_SYS_NICE\fP) to move pages of the process +specified by \fIpid\fP, or insufficient privilege (\fBCAP_SYS_NICE\fP) to access +the specified target nodes. +.TP +\fBESRCH\fP +.\" FIXME There are other errors +No process matching \fIpid\fP could be found. +.SH バージョン +The \fBmigrate_pages\fP() system call first appeared on Linux in version +2.6.16. +.SH 準拠 +このシステムコールは Linux 固有である。 +.SH 注意 +ライブラリによるサポートについては \fBnuma\fP(7) を参照。 + +Use \fBget_mempolicy\fP(2) with the \fBMPOL_F_MEMS_ALLOWED\fP flag to obtain the +set of nodes that are allowed by the calling process's cpuset. Note that +this information is subject to change at any time by manual or automatic +reconfiguration of the cpuset. + +Use of \fBmigrate_pages\fP() may result in pages whose location (node) +violates the memory policy established for the specified addresses (see +\fBmbind\fP(2)) and/or the specified process (see \fBset_mempolicy\fP(2)). That +is, memory policy does not constrain the destination nodes used by +\fBmigrate_pages\fP(). + +ヘッダファイル \fI\fP は glibc には含まれておらず、 \fIlibnuma\-devel\fP +か同様のパッケージをインストールする必要がある。 +.SH 関連項目 +\fBget_mempolicy\fP(2), \fBmbind\fP(2), \fBset_mempolicy\fP(2), \fBnuma\fP(3), +\fBnuma_maps\fP(5), \fBcpuset\fP(7), \fBnuma\fP(7), \fBmigratepages\fP(8), +\fBnuma_stat\fP(8); +.br +the kernel source file \fIDocumentation/vm/page_migration\fP. diff --git a/draft/man2/mincore.2 b/draft/man2/mincore.2 index b1429a61..4e8acfe8 100644 --- a/draft/man2/mincore.2 +++ b/draft/man2/mincore.2 @@ -31,257 +31,86 @@ .\" after message from .\" 2007-01-08 mtk, rewrote various parts .\" -.\" Japanese Version Copyright (c) 2001-2005 Yuichi SATO -.\" all rights reserved. -.\" Translated Sun Jul 8 21:09:35 JST 2001 -.\" by Yuichi SATO -.\" Updated & Modified Sat Jul 26 13:54:03 JST 2003 -.\" by Yuichi SATO -.\" Updated & Modified Fri Dec 31 05:59:40 JST 2004 by Yuichi SATO -.\" Updated & Modified Fri Apr 22 02:35:03 JST 2005 by Yuichi SATO -.\" Updated 2007-05-04, Akihiro MOTOKI , LDP v2.44 +.\"******************************************************************* .\" -.\"WORD: least significant bit 最下位ビット +.\" This file was generated with po4a. Translate the source file. .\" -.TH MINCORE 2 2008-04-22 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH MINCORE 2 2008\-04\-22 Linux "Linux Programmer's Manual" .SH 名前 -.\"O mincore \- determine whether pages are resident in memory mincore \- ページがメモリ内にあるかどうかを判定する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .br -.B #include +\fB#include \fP .sp -.BI "int mincore(void *" addr ", size_t " length ", unsigned char *" vec ); +\fBint mincore(void *\fP\fIaddr\fP\fB, size_t \fP\fIlength\fP\fB, unsigned char +*\fP\fIvec\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR mincore (): -_BSD_SOURCE || _SVID_SOURCE -.\"O .SH DESCRIPTION +\fBmincore\fP(): _BSD_SOURCE || _SVID_SOURCE .SH 説明 -.\"O .BR mincore () -.\"O returns a vector that indicates whether pages -.\"O of the calling process's virtual memory are resident in core (RAM), -.\"O and so will not cause a disk access (page fault) if referenced. -.\"O The kernel returns residency information about the pages -.\"O starting at the address -.\"O .IR addr , -.\"O and continuing for -.\"O .I length -.\"O bytes. -.BR mincore () -は、呼び出し元プロセスの仮想メモリのページがコア (RAM) 内に存在し、 -ページ参照時にディスクアクセス (ページ・フォールト) を起こさないか -どうかを示すベクトルを返す。カーネルは、アドレス -.I addr -から始まる -.I length +\fBmincore\fP() は、呼び出し元プロセスの仮想メモリのページがコア (RAM) 内に存在し、 ページ参照時にディスクアクセス +(ページ・フォールト) を起こさないか どうかを示すベクトルを返す。カーネルは、アドレス \fIaddr\fP から始まる \fIlength\fP バイトの範囲のページに関する存在情報を返す。 -.\"O The -.\"O .I addr -.\"O argument must be a multiple of the system page size. -.\"O The -.\"O .I length -.\"O argument need not be a multiple of the page size, -.\"O but since residency information is returned for whole pages, -.\"O .I length -.\"O is effectively rounded up to the next multiple of the page size. -.\"O One may obtain the page size -.\"O .RB ( PAGE_SIZE ) -.\"O using -.\"O .IR sysconf(_SC_PAGESIZE) . -.I addr -引き数はシステムのページサイズの倍数でなければならない。 -.I length -引き数はページサイズの倍数である必要はないが、 -ページ全体に関する存在情報が返されるので、事実上 -.I length -はページサイズの倍数に切り上げられることになる。 -ページサイズ -.RB ( PAGE_SIZE ) -は -.I sysconf(_SC_PAGESIZE) -を使って入手できる。 +\fIaddr\fP 引き数はシステムのページサイズの倍数でなければならない。 \fIlength\fP 引き数はページサイズの倍数である必要はないが、 +ページ全体に関する存在情報が返されるので、事実上 \fIlength\fP はページサイズの倍数に切り上げられることになる。 ページサイズ +(\fBPAGE_SIZE\fP) は \fIsysconf(_SC_PAGESIZE)\fP を使って入手できる。 -.\"O The -.\"O .I vec -.\"O argument must point to an array containing at least -.\"O .I "(length+PAGE_SIZE\-1) / PAGE_SIZE" -.\"O bytes. -.\"O On return, -.\"O the least significant bit of each byte will be set if -.\"O the corresponding page is currently resident in memory, -.\"O and be clear otherwise. -.\"O (The settings of the other bits in each byte are undefined; -.\"O these bits are reserved for possible later use.) -.I vec -引き数は、少なくとも -.I "(length+PAGE_SIZE\-1) / PAGE_SIZE" -バイトが格納できる配列を指していなければならない。 -この呼び出しが返るとき、 -各バイトの最下位ビットは、対応するページがメモリ内にそのとき存在すれば -セットされ、そうでない場合はクリアされる -(各バイトのその他のビットは未定義であり、これらのビットは将来の使用に -そなえて予約されている)。 -.\"O Of course the information returned in -.\"O .I vec -.\"O is only a snapshot: pages that are not -.\"O locked in memory can come and go at any moment, and the contents of -.\"O .I vec -.\"O may already be stale by the time this call returns. -もちろん、 -.I vec -で返された情報はスナップショットでしかない。 -メモリ内にロックされていないページは、任意の時点でメモリ内に -入ったり出たりでき、この呼び出しが返るときには -.I vec -の内容はすでに古くなっているかもしれない。 -.\"O .SH "RETURN VALUE" +\fIvec\fP 引き数は、少なくとも \fI(length+PAGE_SIZE\-1) / PAGE_SIZE\fP +バイトが格納できる配列を指していなければならない。 この呼び出しが返るとき、 各バイトの最下位ビットは、対応するページがメモリ内にそのとき存在すれば +セットされ、そうでない場合はクリアされる (各バイトのその他のビットは未定義であり、これらのビットは将来の使用に そなえて予約されている)。 もちろん、 +\fIvec\fP で返された情報はスナップショットでしかない。 メモリ内にロックされていないページは、任意の時点でメモリ内に +入ったり出たりでき、この呼び出しが返るときには \fIvec\fP の内容はすでに古くなっているかもしれない。 .SH 返り値 -.\"O On success, -.\"O .BR mincore () -.\"O returns zero. -成功した場合、 -.BR mincore () -は 0 を返す。 -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -エラーの場合は \-1 を返して、 -.I errno -を適切な値に設定する。 -.\"O .SH ERRORS +成功した場合、 \fBmincore\fP() は 0 を返す。 エラーの場合は \-1 を返して、 \fIerrno\fP を適切な値に設定する。 .SH エラー -.B EAGAIN -.\"O kernel is temporarily out of resources. -カーネルが一時的にリソースを使い果たしている。 -.TP -.B EFAULT -.\"O .I vec -.\"O points to an invalid address. -.I vec -が無効なアドレスを指している。 -.TP -.B EINVAL -.\"O .I addr -.\"O is not a multiple of the page size. -.I addr -がページサイズの倍数でない。 -.TP -.B ENOMEM -.\"O .I length -.\"O is greater than -.\"O .RI ( TASK_SIZE " \- " addr ). -.I length -が -.RI ( TASK_SIZE " \- " addr ) -より大きい。 -.\"O (This could occur if a negative value is specified for -.\"O .IR length , -.\"O since that value will be interpreted as a large -.\"O unsigned integer.) -.RI ( length -に負の値が指定された場合、 -その値が大きな符号なし整数として解釈されるために起こることがある。) -.\"O In Linux 2.6.11 and earlier, the error -.\"O .B EINVAL -.\"O was returned for this condition. -Linux 2.6.11 以前では、この条件の場合はエラー -.B EINVAL +\fBEAGAIN\fP カーネルが一時的にリソースを使い果たしている。 +.TP +\fBEFAULT\fP +\fIvec\fP が無効なアドレスを指している。 +.TP +\fBEINVAL\fP +\fIaddr\fP がページサイズの倍数でない。 +.TP +\fBENOMEM\fP +\fIlength\fP が (\fITASK_SIZE\fP \- \fIaddr\fP) より大きい。 (\fIlength\fP に負の値が指定された場合、 +その値が大きな符号なし整数として解釈されるために起こることがある。) Linux 2.6.11 以前では、この条件の場合はエラー \fBEINVAL\fP が返されていた。 -.TP -.B ENOMEM -.\"O .I addr -.\"O to -.\"O .I addr -.\"O + -.\"O .I length -.\"O contained unmapped memory. -.I addr -から -.I addr -+ -.I length -の間にマップされていないメモリがあった。 -.\"O .SH VERSIONS -.\"O Since Linux 2.3.99pre1 and glibc 2.2. +.TP +\fBENOMEM\fP +\fIaddr\fP から \fIaddr\fP + \fIlength\fP の間にマップされていないメモリがあった。 .SH バージョン Linux 2.3.99pre1 と glibc 2.2 から利用可能である。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O .BR mincore () -.\"O is not specified in POSIX.1-2001, -.\"O and it is not available on all UNIX implementations. -.BR mincore () -は POSIX.1-2001 に記述されておらず、 -全ての UNIX 実装で利用可能であるわけではない。 .\" It is on at least NetBSD, FreeBSD, OpenBSD, Solaris 8, .\" AIX 5.1, SunOS 4.1 -.\"O .\" .SH HISTORY -.\" .SH 歴史 -.\"O .\" The -.\"O .\" .BR mincore () -.\"O .\" function first appeared in 4.4BSD. +.\" .SH HISTORY +.\" The .\" .BR mincore () -.\" 関数は 4.4BSD で初めて登場した。 -.\"O .SH "BUGS" +.\" function first appeared in 4.4BSD. +\fBmincore\fP() は POSIX.1\-2001 に記述されておらず、 全ての UNIX 実装で利用可能であるわけではない。 .SH バグ -.\"O Before kernel 2.6.21, -.\"O .BR mincore () -.\"O did not return correct information for -.\"O .B MAP_PRIVATE -.\"O mappings, or for nonlinear mappings (established using -.\"O .BR remap_file_pages (2)). -カーネル 2.6.21 より前は、 -.BR mincore () -は、 -.B MAP_PRIVATE -マッピングや非線形マッピング -.RB ( remap_file_pages (2) -を使って作成される) について正しい情報を返さなかった。 -.\"O .\" Linux (up to now, 2.6.5), -.\"O .\" .B mincore -.\"O .\" does not return correct information for MAP_PRIVATE mappings: -.\" Linux では (2.6.5 の現在に至るまで)、 +.\" Linux (up to now, 2.6.5), .\" .B mincore -.\" は MAP_PRIVATE マッピングについての正しい情報を返さない。 -.\"O .\" for a MAP_PRIVATE file mapping, -.\"O .\" .B mincore -.\"O .\" returns the residency of the file pages, rather than any -.\"O .\" modified process-private pages that have been copied on write; -.\" MAP_PRIVATE ファイルマッピングについて、 +.\" does not return correct information for MAP_PRIVATE mappings: +.\" for a MAP_PRIVATE file mapping, .\" .B mincore -.\" は書き込み時コピー (copy on write) されていて -.\" 修正されたプロセスのプライベートページを返すのではなく、 -.\" ファイルページが存在するか否かを返す。 -.\"O .\" for a MAP_PRIVATE mapping of -.\"O .\" .IR /dev/zero , -.\"O .\" .B mincore -.\"O .\" always reports pages as nonresident; -.\" .I /dev/zero -.\" の MAP_PRIVATE マッピングについて、 +.\" returns the residency of the file pages, rather than any +.\" modified process-private pages that have been copied on write; +.\" for a MAP_PRIVATE mapping of +.\" .IR /dev/zero , .\" .B mincore -.\" は常にページが存在しないという答えを返す。 -.\"O .\" and for a MAP_PRIVATE, MAP_ANONYMOUS mapping, -.\"O .\" .B mincore -.\"O .\" always fails with the error -.\"O .\" .BR ENOMEM . -.\" MAP_PRIVATE, MAP_ANONYMOUS マッピングについて、 +.\" always reports pages as nonresident; +.\" and for a MAP_PRIVATE, MAP_ANONYMOUS mapping, .\" .B mincore -.\" は常に -.\" .B ENOMEM -.\" で失敗する。 -.\"O .SH "SEE ALSO" +.\" always fails with the error +.\" .BR ENOMEM . +カーネル 2.6.21 より前は、 \fBmincore\fP() は、 \fBMAP_PRIVATE\fP マッピングや非線形マッピング +(\fBremap_file_pages\fP(2) を使って作成される) について正しい情報を返さなかった。 .SH 関連項目 -.BR mlock (2), -.BR mmap (2) +\fBmlock\fP(2), \fBmmap\fP(2) diff --git a/draft/man2/mkdir.2 b/draft/man2/mkdir.2 deleted file mode 100644 index 8b3fa57f..00000000 --- a/draft/man2/mkdir.2 +++ /dev/null @@ -1,235 +0,0 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" This manpage is Copyright (C) 1992 Drew Eckhardt; -.\" 1993 Michael Haardt -.\" 1993,1994 Ian Jackson. -.\" You may distribute it under the terms of the GNU General -.\" Public License. It comes with NO WARRANTY. -.\" -.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki -.\" all rights reserved. -.\" Translated Thu Jun 26 20:47:26 JST 1997 -.\" by SUTO, Mitsuaki -.\" Updated & Modified Fri Jan 22 1999 -.\" by NAKANO Takeo -.\" Updated Fri Sep 13 JST 2000 by Kentaro Shirakata -.\" Updated Sun May 23 JST 2004 by Kentaro Shirakata -.\" Updated Thu Mar 24 JST 2005 by Kentaro Shirakata -.\" Updated Wed Jul 30 JST 2008 by Kentaro Shirakata -.\" -.\"WORD: permission 許可属性 -.\"WORD: resolve (パス名を) 解決する -.\" -.TH MKDIR 2 2008-05-13 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O mkdir \- create a directory -mkdir \- ディレクトリを作成する -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.B #include -.B #include -.\" .B #include -.sp -.BI "int mkdir(const char *" pathname ", mode_t " mode ); -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O .BR mkdir () -.\"O attempts to create a directory named -.\"O .IR pathname . -.BR mkdir () -は -.I pathname -で示される名前のディレクトリを作成しようとする。 - -.\"O The argument -.\"O .I mode -.\"O specifies the permissions to use. -.\"O It is modified by the process's -.\"O .I umask -.\"O in the usual way: the permissions of the created directory are -.\"O .RI ( mode " & ~" umask " & 0777)." -.I mode -引き数は、作成されたディレクトリの許可属性を決定するのに使われる。 -この値に、通常通りプロセスの -.I umask -による修正が加えられる。 -したがって、作成されたディレクトリの許可属性は -.RI ( mode " & ~" umask " & 0777)" -となる。 -.\"O Other mode bits of the created directory depend on the operating system. -.\"O For Linux, see below. -作成されたディレクトリのその他のモードビットはオペレーティングシステムに -依存する。Linux の場合は、以下の通りである。 - -.\"O The newly created directory will be owned by the effective user ID of the -.\"O process. -.\"O If the directory containing the file has the set-group-ID -.\"O bit set, or if the file system is mounted with BSD group semantics -.\"O .RI ( "mount -o bsdgroups" -.\"O or, synonymously -.\"O .IR "mount -o grpid" ), -.\"O the new directory will inherit the group ownership from its parent; -.\"O otherwise it will be owned by the effective group ID of the process. -新しく作成されたディレクトリの所有者はプロセスの実効ユーザ ID に設定される。 -新たに作成されたディレクトリが含まれる親ディレクトリに -set group ID ビットがセットされていたり、ファイルシステムが BSD の -グループセマンティクス -.RI ( "mount -o bsdgroups" -あるいは、同じ意味の -.IR "mount -o grpid" ) -に従ってマウントされている場合には、 -新たに作成されたディレクトリのグループ所有権は親ディレクトリの -ものが継承される (親ディレクトリと同じになる)。 -それ以外の場合は、グループ所有権はプロセスの実効グループ ID となる。 - -.\"O If the parent directory has the set-group-ID bit set then so will the -.\"O newly created directory. -もし親ディレクトリに set group ID ビットがセットされていれば新しく作成される -ディレクトリにも set group ID ビットがセットされる。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O .BR mkdir () -.\"O returns zero on success, or \-1 if an error occurred (in which case, -.\"O .I errno -.\"O is set appropriately). -.BR mkdir () -は成功した場合 0 を、失敗した場合 \-1 を返す (また、 -.I errno -がエラーの内容にしたがって適切に設定される)。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EACCES -.\"O The parent directory does not allow write permission to the process, -.\"O or one of the directories in -.\"O .I pathname -.\"O did not allow search permission. -.\"O (See also -.\"O .BR path_resolution (7).) -プロセスが親ディレクトリへの書き込み許可を持たない、もしくは -.I pathname -中のディレクトリのどれかに検索許可属性が無い -.RB ( path_resolution (7) -も参照)。 -.TP -.B EEXIST -.\"O .I pathname -.\"O already exists (not necessarily as a directory). -.I pathname -が既に存在している(ただしそれがディレクトリであるとは限らない)。 -.\"O This includes the case where -.\"O .I pathname -.\"O is a symbolic link, dangling or not. -.I pathname -がシンボリックリンクの場合も -(その指定先が存在するかどうかに関らず)エラーになる。 -.TP -.B EFAULT -.\"O .IR pathname " points outside your accessible address space." -.I pathname -がそのプロセスのアクセス可能なアドレス空間の外を指している。 -.TP -.B ELOOP -.\"O Too many symbolic links were encountered in resolving -.\"O .IR pathname . -パス名 -.I pathname -を解決するときに、解決すべきシンボリックリンクが多すぎた。 -.TP -.B ENAMETOOLONG -.\"O .IR pathname " was too long." -.I pathname -が長すぎる。 -.TP -.B ENOENT -.\"O A directory component in -.\"O .I pathname -.\"O does not exist or is a dangling symbolic link. -.I pathname -の構成要素のディレクトリのいずれかが存在しないか、 -またはリンク先が存在しないシンボリックリンクである。 -.TP -.B ENOMEM -.\"O Insufficient kernel memory was available. -カーネルに、利用できるメモリが不足している。 -.TP -.B ENOSPC -.\"O The device containing -.\"O .I pathname -.\"O has no room for the new directory. -.I pathname -を含むデバイスに新たにディレクトリを作成する空きが無い。 -.TP -.B ENOSPC -.\"?? ENOSPC がダブっているけど... -.\"O The new directory cannot be created because the user's disk quota is -.\"O exhausted. -もしくはユーザーのディスク quota が使い切られているため、 -新たにディレクトリを作成することができない。 -.TP -.B ENOTDIR -.\"O A component used as a directory in -.\"O .I pathname -.\"O is not, in fact, a directory. -.I pathname -中のディレクトリ部分が実際にはディレクトリでない。 -.TP -.B EPERM -.\"O The file system containing -.\"O .I pathname -.\"O does not support the creation of directories. -.I pathname -を含むファイルシステムがディレクトリの作成をサポートしていない。 -.TP -.B EROFS -.\"O .I pathname -.\"O refers to a file on a read-only file system. -.I pathname -が読み出し専用ファイルシステム上のファイルを指している。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -.\"O SVr4, BSD, POSIX.1-2001. -.\"O .\" SVr4 documents additional EIO, EMULTIHOP -SVr4, BSD, POSIX.1-2001. -.\" SVr4 にはさらにエラーコード EIO, EMULTIHOP についての記述がある。 -.\"O .SH NOTES -.SH 注意 -.\"O Under Linux apart from the permission bits, only the -.\"O .B S_ISVTX -.\"O mode bit is honored. -.\"O That is, under Linux the created directory actually gets mode -.\"O .RI ( mode " & ~" umask " & 01777)." -.\"O See also -.\"O .BR stat (2). -Linux では、許可ビット以外で意味を持つのは、 -.B S_ISVTX -モードビットだけである。 -つまり、Linux では作成されたディレクトリは実際には -.RI ( mode " & ~" umask " & 01777)" -のモードを持つことになる。 -.BR stat (2) -を参照のこと。 -.PP -.\"O There are many infelicities in the protocol underlying NFS. -.\"O Some of these affect -.\"O .BR mkdir (). -NFS を実現しているプロトコルには多くの不備が存在し、 -それら中には -.BR mkdir () -に影響を与えるものもある。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR mkdir (1), -.BR chmod (2), -.BR chown (2), -.BR mkdirat (2), -.BR mknod (2), -.BR mount (2), -.BR rmdir (2), -.BR stat (2), -.BR umask (2), -.BR unlink (2), -.BR path_resolution (7) diff --git a/draft/man2/mkdirat.2 b/draft/man2/mkdirat.2 index 141c2af0..f763975f 100644 --- a/draft/man2/mkdirat.2 +++ b/draft/man2/mkdirat.2 @@ -22,176 +22,66 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2006 Yuichi SATO -.\" all rights reserved. -.\" Translated 2006-09-30 by Yuichi SATO , LDP v2.39 .\" -.TH MKDIRAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH MKDIRAT 2 2009\-12\-13 Linux "Linux Programmer's Manual" .SH 名前 -.\"O mkdirat \- create a directory relative to a directory file descriptor mkdirat \- ディレクトリファイルディスクリプタから相対的な位置にディレクトリを作成する -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .B #include /* Definition of AT_* constants */ -.B #include /* AT_* 定数の定義 */ -.B #include +\fB#include /* AT_* 定数の定義 */\fP +\fB#include \fP .sp -.BI "int mkdirat(int " dirfd ", const char *" pathname ", mode_t " mode ); +\fBint mkdirat(int \fP\fIdirfd\fP\fB, const char *\fP\fIpathname\fP\fB, mode_t \fP\fImode\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR mkdirat (): +\fBmkdirat\fP(): .PD 0 .ad l .RS 4 -.TP 4 -.\"O Since glibc 2.10: +.TP 4 glibc 2.10 以降: _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L -.TP -.\"O Before glibc 2.10: +.TP glibc 2.10 より前: _ATFILE_SOURCE .RE .ad .PD -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR mkdirat () -.\"O system call operates in exactly the same way as -.\"O .BR mkdir (2), -.\"O except for the differences described in this manual page. -.BR mkdirat () -システムコールは、この man ページで説明している違いがある以外は、 -.BR mkdir (2) -と全く同じように動作する。 +\fBmkdirat\fP() システムコールは、この man ページで説明している違いがある以外は、 \fBmkdir\fP(2) と全く同じように動作する。 -.\"O If the pathname given in -.\"O .I pathname -.\"O is relative, then it is interpreted relative to the directory -.\"O referred to by the file descriptor -.\"O .I dirfd -.\"O (rather than relative to the current working directory of -.\"O the calling process, as is done by -.\"O .BR mkdir (2) -.\"O for a relative pathname). -.I pathname -で指定されるパス名が相対パス名である場合、 -ファイルディスクリプタ -.I dirfd -で参照されるディレクトリからの相対パス名として解釈される -.RB ( mkdir (2) -では、相対パスは呼び出し元プロセスの +\fIpathname\fP で指定されるパス名が相対パス名である場合、 ファイルディスクリプタ \fIdirfd\fP +で参照されるディレクトリからの相対パス名として解釈される (\fBmkdir\fP(2) では、相対パスは呼び出し元プロセスの カレントワーキングディレクトリからの相対パスとなる)。 -.\"O If -.\"O .I pathname -.\"O is relative and -.\"O .I dirfd -.\"O is the special value -.\"O .BR AT_FDCWD , -.\"O then -.\"O .I pathname -.\"O is interpreted relative to the current working -.\"O directory of the calling process (like -.\"O .BR mkdir (2)). -.I pathname -が相対パスであり、かつ -.I dirfd -が特別な値 -.B AT_FDCWD -である場合、 -.I pathname -は -.RB ( mkdir (2) -と同じように) 呼び出し元プロセスの -カレントワーキングディレクトリからの相対パス名として解釈される。 +\fIpathname\fP が相対パスであり、かつ \fIdirfd\fP が特別な値 \fBAT_FDCWD\fP である場合、 \fIpathname\fP は +(\fBmkdir\fP(2) と同じように) 呼び出し元プロセスの カレントワーキングディレクトリからの相対パス名として解釈される。 -.\"O If -.\"O .I pathname -.\"O is absolute, then -.\"O .I dirfd -.\"O is ignored. -.I pathname -が絶対パスである場合、 -.I dirfd -は無視される。 -.\"O .SH "RETURN VALUE" +\fIpathname\fP が絶対パスである場合、 \fIdirfd\fP は無視される。 .SH 返り値 -.\"O On success, -.\"O .BR mkdirat () -.\"O returns 0. -成功した場合、 -.BR mkdirat () -は 0 を返す。 -.\"O On error, \-1 is returned and -.\"O .I errno -.\"O is set to indicate the error. -エラーの場合、\-1 が返されて、 -.I errno -にはエラーを示す値が設定される。 -.\"O .SH ERRORS +成功した場合、 \fBmkdirat\fP() は 0 を返す。 エラーの場合、\-1 が返されて、 \fIerrno\fP にはエラーを示す値が設定される。 .SH エラー -.\"O The same errors that occur for -.\"O .BR mkdir (2) -.\"O can also occur for -.\"O .BR mkdirat (). -.BR mkdir (2) -と同じエラーが -.BR mkdirat () -でも起こる。 -.\"O The following additional errors can occur for -.\"O .BR mkdirat (): -.BR mkdirat () -では、その他に以下のエラーが起こる: -.TP -.B EBADF -.\"O .I dirfd -.\"O is not a valid file descriptor. -.I dirfd -が有効なファイルディスクリプタでない。 -.TP -.B ENOTDIR -.\"O .I pathname -.\"O is relative and -.\"O .I dirfd -.\"O is a file descriptor referring to a file other than a directory. -.I pathname -が相対パスで、かつ -.I dirfd -がディレクトリ以外のファイルを参照するファイルディスクリプタである。 -.\"O .SH VERSIONS +\fBmkdir\fP(2) と同じエラーが \fBmkdirat\fP() でも起こる。 \fBmkdirat\fP() では、その他に以下のエラーが起こる: +.TP +\fBEBADF\fP +\fIdirfd\fP が有効なファイルディスクリプタでない。 +.TP +\fBENOTDIR\fP +\fIpathname\fP が相対パスで、かつ \fIdirfd\fP がディレクトリ以外のファイルを参照するファイルディスクリプタである。 .SH バージョン -.\"O .BR mkdirat () -.\"O was added to Linux in kernel 2.6.16. -.BR mkdirat () -は Linux カーネル 2.6.16 で追加された。 -.\"O .SH "CONFORMING TO" +\fBmkdirat\fP() は Linux カーネル 2.6.16 で追加された。 .SH 準拠 -POSIX.1-2008. -.\"O .SH NOTES +POSIX.1\-2008. .SH 注意 -.\"O See -.\"O .BR openat (2) -.\"O for an explanation of the need for -.\"O .BR mkdirat (). -.\"O -.BR mkdirat () -が必要な理由については、 -.BR openat (2) -を参照すること。 -.\"O .SH "SEE ALSO" -.SH 説明 -.BR mkdir (2), -.BR openat (2), -.BR path_resolution (7) +\fBmkdirat\fP() が必要な理由については、 \fBopenat\fP(2) を参照すること。 +.SH 関連項目 +\fBmkdir\fP(2), \fBopenat\fP(2), \fBpath_resolution\fP(7) diff --git a/draft/man2/mknodat.2 b/draft/man2/mknodat.2 index bd1982dc..c9f6b30c 100644 --- a/draft/man2/mknodat.2 +++ b/draft/man2/mknodat.2 @@ -22,180 +22,68 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2006 Yuichi SATO -.\" all rights reserved. -.\" Translated 2006-09-30 by Yuichi SATO , LDP v2.39 .\" -.TH MKNODAT 2 2010-09-20 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH MKNODAT 2 2010\-09\-20 Linux "Linux Programmer's Manual" .SH 名前 -.\"O mknodat \- create a special or ordinary file relative to a directory -.\"O file descriptor -mknodat \- ディレクトリファイルディスクリプタから相対的な位置に、 -特殊ファイルや通常のファイルを作成する -.\"O .SH SYNOPSIS +mknodat \- ディレクトリファイルディスクリプタから相対的な位置に、 特殊ファイルや通常のファイルを作成する .SH 書式 .nf -.\"O .B #include /* Definition of AT_* constants */ -.B #include /* AT_* 定数の定義 */ -.B #include +\fB#include /* AT_* 定数の定義 */\fP +\fB#include \fP .sp -.BI "int mknodat(int " dirfd ", const char *" pathname ", mode_t " mode \ -", dev_t " dev ); +\fBint mknodat(int \fP\fIdirfd\fP\fB, const char *\fP\fIpathname\fP\fB, mode_t \fP\fImode\fP\fB, dev_t \fP\fIdev\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR mknodat (): +\fBmknodat\fP(): .PD 0 .ad l .RS 4 -.TP 4 -.\"O Since glibc 2.10: +.TP 4 glibc 2.10 以降: -_XOPEN_SOURCE\ >=\ 700 .\" Other FTM combinations will also expose mknodat(), but this function was -.\" added in SUSv4, marked XSI, so we'll just document what the standard says -.TP 4 -.\"O Before glibc 2.10: +.\" added in SUSv4, marked XSI, so we'll just document what the standard says. +_XOPEN_SOURCE\ >=\ 700 +.TP 4 glibc 2.10 より前: _ATFILE_SOURCE .RE .ad .PD -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR mknodat () -.\"O system call operates in exactly the same way as -.\"O .BR mknod (2), -.\"O except for the differences described in this manual page. -.BR mknodat () -システムコールは、この man ページで説明している違いがある以外は、 -.BR mknod (2) -と全く同じように動作する。 +\fBmknodat\fP() システムコールは、この man ページで説明している違いがある以外は、 \fBmknod\fP(2) と全く同じように動作する。 -.\"O If the pathname given in -.\"O .I pathname -.\"O is relative, then it is interpreted relative to the directory -.\"O referred to by the file descriptor -.\"O .I dirfd -.\"O (rather than relative to the current working directory of -.\"O the calling process, as is done by -.\"O .BR mknod (2) -.\"O for a relative pathname). -.I pathname -で指定されるパス名が相対パス名である場合、 -ファイルディスクリプタ -.I dirfd -で参照されるディレクトリからの相対パス名として解釈される -.RB ( mknod (2) -では、相対パスは呼び出し元プロセスの +\fIpathname\fP で指定されるパス名が相対パス名である場合、 ファイルディスクリプタ \fIdirfd\fP +で参照されるディレクトリからの相対パス名として解釈される (\fBmknod\fP(2) では、相対パスは呼び出し元プロセスの カレントワーキングディレクトリからの相対パスとなる)。 -.\"O If -.\"O .I pathname -.\"O is relative and -.\"O .I dirfd -.\"O is the special value -.\"O .BR AT_FDCWD , -.\"O then -.\"O .I pathname -.\"O is interpreted relative to the current working -.\"O directory of the calling process (like -.\"O .BR mknod (2)). -.I pathname -が相対パスであり、かつ -.I dirfd -が特別な値 -.B AT_FDCWD -である場合、 -.I pathname -は -.RB ( mknod (2) -と同じように) 呼び出し元プロセスの -カレントワーキングディレクトリからの相対パス名として解釈される。 +\fIpathname\fP が相対パスであり、かつ \fIdirfd\fP が特別な値 \fBAT_FDCWD\fP である場合、 \fIpathname\fP は +(\fBmknod\fP(2) と同じように) 呼び出し元プロセスの カレントワーキングディレクトリからの相対パス名として解釈される。 -.\"O If -.\"O .I pathname -.\"O is absolute, then -.\"O .I dirfd -.\"O is ignored. -.I pathname -が絶対パスである場合、 -.I dirfd -は無視される。 -.\"O .SH "RETURN VALUE" +\fIpathname\fP が絶対パスである場合、 \fIdirfd\fP は無視される。 .SH 返り値 -.\"O On success, -.\"O .BR mknodat () -.\"O returns 0. -成功した場合、 -.BR mknodat () -は 0 を返す。 -.\"O On error, \-1 is returned and -.\"O .I errno -.\"O is set to indicate the error. -エラーの場合、\-1 が返されて、 -.I errno -にはエラーを示す値が設定される。 -.\"O .SH ERRORS +成功した場合、 \fBmknodat\fP() は 0 を返す。 エラーの場合、\-1 が返されて、 \fIerrno\fP にはエラーを示す値が設定される。 .SH エラー -.\"O The same errors that occur for -.\"O .BR mknod (2) -.\"O can also occur for -.\"O .BR mknodat (). -.BR mknod (2) -と同じエラーが -.BR mknodat () -でも起こる。 -.\"O The following additional errors can occur for -.\"O .BR mknodat (): -.BR mknodat () -では、その他に以下のエラーが起こる: -.TP -.B EBADF -.\"O .I dirfd -.\"O is not a valid file descriptor. -.I dirfd -が有効なファイルディスクリプタでない。 -.TP -.B ENOTDIR -.\"O .I pathname -.\"O is relative and -.\"O .I dirfd -.\"O is a file descriptor referring to a file other than a directory. -.I pathname -が相対パスで、かつ -.I dirfd -がディレクトリ以外のファイルを参照するファイルディスクリプタである。 -.\"O .SH VERSIONS +\fBmknod\fP(2) と同じエラーが \fBmknodat\fP() でも起こる。 \fBmknodat\fP() では、その他に以下のエラーが起こる: +.TP +\fBEBADF\fP +\fIdirfd\fP が有効なファイルディスクリプタでない。 +.TP +\fBENOTDIR\fP +\fIpathname\fP が相対パスで、かつ \fIdirfd\fP がディレクトリ以外のファイルを参照するファイルディスクリプタである。 .SH バージョン -.\"O .BR mknodat () -.\"O was added to Linux in kernel 2.6.16. -.BR mknodat () -は Linux カーネル 2.6.16 で追加された。 -.\"O .SH "CONFORMING TO" +\fBmknodat\fP() は Linux カーネル 2.6.16 で追加された。 .SH 準拠 -POSIX.1-2008. -.\"O .SH NOTES +POSIX.1\-2008. .SH 注意 -.\"O See -.\"O .BR openat (2) -.\"O for an explanation of the need for -.\"O .BR mknodat (). -.BR mknodat () -が必要な理由については、 -.BR openat (2) -を参照すること。 -.\"O .SH "SEE ALSO" +\fBmknodat\fP() が必要な理由については、 \fBopenat\fP(2) を参照すること。 .SH 関連項目 -.BR mknod (2), -.BR openat (2), -.BR path_resolution (7) +\fBmknod\fP(2), \fBopenat\fP(2), \fBpath_resolution\fP(7) diff --git a/draft/man2/mlock.2 b/draft/man2/mlock.2 deleted file mode 100644 index 346c1fd5..00000000 --- a/draft/man2/mlock.2 +++ /dev/null @@ -1,577 +0,0 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" Copyright (C) Michael Kerrisk, 2004 -.\" using some material drawn from earlier man pages -.\" written by Thomas Kuhn, Copyright 1996 -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; without even the implied warranty of -.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -.\" GNU General Public License for more details. -.\" -.\" You should have received a copy of the GNU General Public -.\" License along with this manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, -.\" Boston, MA 02111, USA. -.\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1997-02-23, HANATAKA Shinya -.\" Updated 2003-10-12, Kentaro Shirakata -.\" Updated 2004-05-23, kentaro Shirakata -.\" Updated 2005-03-29, kentaro Shirakata -.\" Updated 2005-11-04, Akihiro MOTOKI -.\" Updated 2006-02-14, Akihiro MOTOKI -.\" Updated 2008-11-10, Akihiro MOTOKI, LDP v3.13 -.\" -.\"WORD: unlock ロック解除 -.\"WORD: previlege 特権 -.\" -.TH MLOCK 2 2008-09-25 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O mlock, munlock, mlockall, munlockall \- lock and unlock memory -.SH 名前 -mlock \- メモリのロックとロック解除を行う -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.B #include -.sp -.BI "int mlock(const void *" addr ", size_t " len ); -.BI "int munlock(const void *" addr ", size_t " len ); -.sp -.BI "int mlockall(int " flags ); -.B int munlockall(void); -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O .BR mlock () -.\"O and -.\"O .BR mlockall () -.\"O respectively lock part or all of the calling process's virtual address -.\"O space into RAM, preventing that memory from being paged to the -.\"O swap area. -.\"O .BR munlock () -.\"O and -.\"O .BR munlockall () -.\"O perform the converse operation, -.\"O respectively unlocking part or all of the calling process's virtual -.\"O address space, so that pages in the specified virtual address range may -.\"O once more to be swapped out if required by the kernel memory manager. -.\"O Memory locking and unlocking are performed in units of whole pages. -.BR mlock () -と -.BR mlockall () -はそれぞれ、呼び出し元プロセスの仮想アドレス空間の一部または全部を -RAM 上にロックし、メモリがスワップエリアにページングされるのを防ぐ。 -.BR munlock () -と -.BR munlockall () -は逆の操作で、それぞれ呼び出し元プロセスの仮想アドレス空間の一部または全部を -ロック解除する。つまり、指定された仮想アドレス範囲のページは -カーネルメモリマネージャーから要求されればスワップアウトするようになる。 -メモリのロックとロック解除はページ単位で行われる。 -.\"O .SS "mlock() and munlock()" -.SS "mlock() と munlock()" -.\"O .BR mlock () -.\"O locks pages in the address range starting at -.\"O .I addr -.\"O and continuing for -.\"O .I len -.\"O bytes. -.\"O All pages that contain a part of the specified address range are -.\"O guaranteed to be resident in RAM when the call returns successfully; -.\"O the pages are guaranteed to stay in RAM until later unlocked. -.BR mlock () -は -.I addr -から始まる長さ -.I len -バイトのアドレス範囲のページをロックする。 -呼び出しが成功した場合には、 -指定されたアドレス範囲を含む全てのページは -RAM に残り続けることが保証される。 -これらのページは後でロック解除されるまで RAM に残り続けることが保証される。 - -.\"O .BR munlock () -.\"O unlocks pages in the address range starting at -.\"O .I addr -.\"O and continuing for -.\"O .I len -.\"O bytes. -.\"O After this call, all pages that contain a part of the specified -.\"O memory range can be moved to external swap space again by the kernel. -.BR munlock () -は、 -.I addr -から始まる長さ -.I len -バイトのアドレス範囲のページのロックを解除する。 -この呼び出しを行った後は、カーネルが、指定されたメモリ範囲を含む -全てのページを外部のスワップ空間に移動できるようになる。 -.\"O .SS "mlockall() and munlockall()" -.SS "mlockall() と munlockall()" -.\"O .BR mlockall () -.\"O locks all pages mapped into the address space of the -.\"O calling process. -.\"O This includes the pages of the code, data and stack -.\"O segment, as well as shared libraries, user space kernel data, shared -.\"O memory, and memory-mapped files. -.\"O All mapped pages are guaranteed -.\"O to be resident in RAM when the call returns successfully; -.\"O the pages are guaranteed to stay in RAM until later unlocked. -.BR mlockall () -は呼び出し元プロセスのアドレス空間にマップされている全てのページを -ロックする。これにはコード、データ、スタックの -各セグメント、共有ライブラリ、カーネルのユーザー空間データ、 -共有メモリ、メモリ・マップされたファイルが含まれる。 -システム・コールが成功した場合には全てのマップされたページは RAM に -残ることを保証される。 -これらのページは後でロック解除されるまで RAM に残り続けることが保証される。 - -.\"O The -.\"O .I flags -.\"O argument is constructed as the bitwise OR of one or more of the -.\"O following constants: -.I flags -引数は以下の内容の一つまたは複数のビット OR から構成される: -.TP 1.2i -.B MCL_CURRENT -.\"O Lock all pages which are currently mapped into the address space of -.\"O the process. -現在、プロセスのアドレス空間にマップされている全てのページをロックする。 -.TP -.B MCL_FUTURE -.\"O Lock all pages which will become mapped into the address space of the -.\"O process in the future. -.\"O These could be for instance new pages required -.\"O by a growing heap and stack as well as new memory mapped files or -.\"O shared memory regions. -将来、プロセスのアドレス空間にマップされる全てのページをロックする。 -例えば、ヒープ (heap) やスタックの成長により新しく必要になったページだけで -なく、新しくメモリマップされたファイルや共有メモリ領域もロックされる。 -.PP -.\"O If -.\"O .B MCL_FUTURE -.\"O has been specified, then a later system call (e.g., -.\"O .BR mmap (2), -.\"O .BR sbrk (2), -.\"O .BR malloc (3)), -.\"O may fail if it would cause the number of locked bytes to exceed -.\"O the permitted maximum (see below). -.B MCL_FUTURE -が指定されていると、以後のシステムコール (例えば、 -.BR mmap (2), -.BR sbrk (2), -.BR malloc (3)) -は、ロックするバイト数が許可された最大値 (下記参照) を超えた場合に -失敗する可能性がある。 -.\"O In the same circumstances, stack growth may likewise fail: -.\"O the kernel will deny stack expansion and deliver a -.\"O .B SIGSEGV -.\"O signal to the process. -同様に、スタックの成長も失敗する可能性がある。 -その場合、カーネルはスタックの拡張を拒否し、 -.B SIGSEGV -をプロセスに送る。 - -.\"O .BR munlockall () -.\"O unlocks all pages mapped into the address space of the -.\"O calling process. -.BR munlockall () -は、呼び出し元プロセスのアドレス空間にマッピングされている -全てのページをロック解除する。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success these system calls return 0. -.\"O On error, \-1 is returned, -.\"O .I errno -.\"O is set appropriately, and no changes are made to any locks in the -.\"O address space of the process. -成功した場合は、これらのシステムコールはゼロを返す。 -エラーの場合は \-1 が返され、 -.I errno -が適切に設定され、プロセスのアドレス空間におけるロックは変更されない。 -.\"O .SH ERRORS -.SH エラー -.TP -.B ENOMEM -.\"O (Linux 2.6.9 and later) the caller had a nonzero -.\"O .B RLIMIT_MEMLOCK -.\"O soft resource limit, but tried to lock more memory than the limit -.\"O permitted. -(Linux 2.6.9 以降) 呼び出し元は非ゼロの -ソフト資源制限 -.B RLIMIT_MEMLOCK -を持つが、制限が許可している以上のメモリをロックしようとした。 -.\"O This limit is not enforced if the process is privileged -.\"O .RB ( CAP_IPC_LOCK ). -この制限は、プロセスが特権 -.RB ( CAP_IPC_LOCK ) -を持っている場合は適用されない。 -.TP -.B ENOMEM -.\"O (Linux 2.4 and earlier) the calling process tried to lock more than -.\"O half of RAM. -(Linux 2.4 以前) 呼び出し元プロセスが RAM の半分以上をロックしようとした。 -.\"O .\" In the case of mlock(), this check is somewhat buggy: it doesn't -.\"O .\" take into account whether the to-be-locked range overlaps with -.\"O .\" already locked pages. Thus, suppose we allocate -.\"O .\" (num_physpages / 4 + 1) of memory, and lock those pages once using -.\"O .\" mlock(), and then lock the *same* page range a second time. -.\"O .\" In the case, the second mlock() call will fail, since the check -.\"O .\" calculates that the process is trying to lock (num_physpages / 2 + 2) -.\"O .\" pages, which of course is not true. (MTK, Nov 04, kernel 2.4.28) -.TP -.B EPERM -.\"O (Linux 2.6.9 and later) the caller was not privileged -.\"O .RB ( CAP_IPC_LOCK ) -.\"O and its -.\"O .B RLIMIT_MEMLOCK -.\"O soft resource limit was 0. -(Linux 2.6.9 以降) 呼び出し元は特権 -.RB ( CAP_IPC_LOCK ) -を持たず、ソフト資源制限 -.B RLIMIT_MEMLOCK -が 0 である。 -.TP -.B EPERM -.\"O (Linux 2.6.8 and earlier) -.\"O The calling process has insufficient privilege to call -.\"O .BR munlockall (). -(Linux 2.6.8 以前) -呼び出し元プロセスが -.BR munlockall () -を呼び出すのに必要な特権を所有していなかった。 -.\"O Under Linux the -.\"O .B CAP_IPC_LOCK -.\"O capability is required. -Linux では、 -.B CAP_IPC_LOCK -ケーパビリティが必要である。 -.\"O .\"SVr4 documents an additional EAGAIN error code. -.\"SVr4 のドキュメントには、これ以外にエラーコード EAGAIN の記載がある。 -.LP -.\"O For -.\"O .BR mlock () -.\"O and -.\"O .BR munlock (): -.BR mlock () -と -.BR munlock () -用として: -.TP -.B EAGAIN -.\"O Some or all of the specified address range could not be locked. -指定されたアドレス範囲の一部または全てをロックすることができなかった。 -.TP -.B EINVAL -.\"O .I len -.\"O was negative. -.I len -が負の数である。 -.TP -.B EINVAL -.\"O (Not on Linux) -.\"O .I addr -.\"O was not a multiple of the page size. -(Linux ではこの意味で使われない) -.I addr -がページサイズの倍数ではない。 -.TP -.B ENOMEM -.\"O Some of the specified address range does not correspond to mapped -.\"O pages in the address space of the process. -指定されたアドレス範囲がプロセスのアドレス空間にマップされたページと -一致しない。 -.LP -.\"O For -.\"O .BR mlockall (): -.BR mlockall () -用として: -.TP -.B EINVAL -.\"O Unknown \fIflags\fP were specified. -未知の \fIflags\fP が指定された。 -.LP -.\"O For -.\"O .BR munlockall (): -.BR munlockall () -用として: -.TP -.B EPERM -.\"O (Linux 2.6.8 and earlier) The caller was not privileged -.\"O .RB ( CAP_IPC_LOCK ). -(Linux 2.6.8 以前) 呼び出し元が権限 -.RB ( CAP_IPC_LOCK ) -を持っていない。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -POSIX.1-2001, SVr4. -.\"O .SH AVAILABILITY -.SH 可用性 -.\"O On POSIX systems on which -.\"O .BR mlock () -.\"O and -.\"O .BR munlock () -.\"O are available, -.\"O .B _POSIX_MEMLOCK_RANGE -.\"O is defined in \fI\fP and the number of bytes in a page -.\"O can be determined from the constant -.\"O .B PAGESIZE -.\"O (if defined) in \fI\fP or by calling -.\"O .IR sysconf(_SC_PAGESIZE) . -.BR mlock () -と -.BR munlock () -が使用可能な POSIX システムでは -.B _POSIX_MEMLOCK_RANGE -が \fI\fP で定義されている。 -また、ページあたりのバイト数は、 -\fI\fP で定義される定数 -.B PAGESIZE -から (定義されている場合)、もしくは -.I sysconf(_SC_PAGESIZE) -を呼び出すことで決定できる。 - -.\"O On POSIX systems on which -.\"O .BR mlockall () -.\"O and -.\"O .BR munlockall () -.\"O are available, -.\"O .B _POSIX_MEMLOCK -.\"O is defined in \fI\fP to a value greater than 0. -.\"O (See also -.\"O .BR sysconf (3).) -.BR mlockall () -と -.BR munlockall () -が利用可能な POSIX システムでは、 -.B _POSIX_MEMLOCK -は \fI\fP で 0 より大きい値に定義されている -.RB ( sysconf (3) -も参照のこと)。 -.\"O .\" POSIX.1-2001: It shall be defined to -1 or 0 or 200112L. -.\"O .\" -1: unavailable, 0: ask using sysconf(). -.\"O .\" glibc defines it to 1. -.\" POSIX.1-2001: この変数は -1 か 0 か 200112l のいずれかに -.\" 定義すべきとなっている。 -.\" -1: 利用できない、0: sysconf() に問い合わせる -.\" glibc では 1 に定義している。 -.\"O .SH "NOTES" -.SH 注意 -.\"O Memory locking has two main applications: real-time algorithms and -.\"O high-security data processing. -.\"O Real-time applications require -.\"O deterministic timing, and, like scheduling, paging is one major cause -.\"O of unexpected program execution delays. -.\"O Real-time applications will -.\"O usually also switch to a real-time scheduler with -.\"O .BR sched_setscheduler (2). -メモリのロックの用途としては主に二つある: リアルタイム -アルゴリズムと高いセキュリティの必要なデータ処理である。リアルタイムの -アプリケーションは決定的なタイミングやスケジューリングを必要とするが、 -ページングは予期しないプログラムの実行遅延をもたらす主要な要因となる。 -リアルタイムのアプリケーションはたいていは -.BR sched_setscheduler (2) -でリアルタイムスケジューラに変更される。 -.\"O Cryptographic security software often handles critical bytes like -.\"O passwords or secret keys as data structures. -.\"O As a result of paging, -.\"O these secrets could be transferred onto a persistent swap store medium, -.\"O where they might be accessible to the enemy long after the security -.\"O software has erased the secrets in RAM and terminated. -.\"O (But be aware that the suspend mode on laptops and some desktop -.\"O computers will save a copy of the system's RAM to disk, regardless -.\"O of memory locks.) -暗号やセキュリティのソフトウェアはしばしばパスワードや秘密鍵のデータの -ような重要なバイト列を扱う。ページングの結果、これらの秘密が -スワップ用の固定媒体に転送されるかもしれない。そして、セキュリティ・ -ソフトウェアが RAM 上の秘密を削除して終了したずっと後になっても、 -このスワップされたデータには敵がアクセスできる可能性がある -(しかし、ラップトップといくつかのデスクトップコンピュータの -サスペンドモードはシステムの RAM の内容をメモリのロックに関わらず -ディスクに保存することに注意)。 - -.\"O Real-time processes that are using -.\"O .BR mlockall () -.\"O to prevent delays on page faults should reserve enough -.\"O locked stack pages before entering the time-critical section, -.\"O so that no page fault can be caused by function calls. -.\"O This can be achieved by calling a function that allocates a -.\"O sufficiently large automatic variable (an array) and writes to the -.\"O memory occupied by this array in order to touch these stack pages. -.\"O This way, enough pages will be mapped for the stack and can be -.\"O locked into RAM. -.\"O The dummy writes ensure that not even copy-on-write -.\"O page faults can occur in the critical section. -リアルタイムプロセスが -.BR mlockall () -を使ってページフォールトによる遅延を防ごうとする場合、 -関数呼び出しによってページフォールトが発生しないように、 -時間制限の厳しい部分 (time-critical section) に入る前に -十分な量のロックされたスタックを確保しておく必要がある。 -これを実現するには、十分な大きさの自動変数 (の配列) を確保し、 -これらのスタック用のページがメモリ上に確保されるようにこの配列に -書き込みを行う関数を用意し、これを呼び出せばよい。こうすることで、 -十分な量のページがスタックにマッピングされ、RAM にロックされる。 -ダミーの書き込みを行うことによって、 -時間制限の厳しい部分 (critical section) 内では書き込み時コピーによる -ページフォールトさえも発生しないことが保証される。 - -.\"O Memory locks are not inherited by a child created via -.\"O .BR fork (2) -.\"O and are automatically removed (unlocked) during an -.\"O .BR execve (2) -.\"O or when the process terminates. -メモリロックは -.BR fork (2) -で作成された子プロセスには継承されず、 -.BR execve (2) -が呼ばれたり、プロセスが終了した場合は -自動的に削除される (ロック解除される)。 - -.\"O The memory lock on an address range is automatically removed -.\"O if the address range is unmapped via -.\"O .BR munmap (2). -あるアドレス範囲に対するメモリロックは、そのアドレス範囲が -.BR munmap (2) -によってアンマップされた場合は削除される。 - -.\"O Memory locks do not stack, that is, pages which have been locked several times -.\"O by calls to -.\"O .BR mlock () -.\"O or -.\"O .BR mlockall () -.\"O will be unlocked by a single call to -.\"O .BR munlock () -.\"O for the corresponding range or by -.\"O .BR munlockall (). -.\"O Pages which are mapped to several locations or by several processes stay -.\"O locked into RAM as long as they are locked at least at one location or by -.\"O at least one process. -メモリのロックは累積しない。 -すなわち複数回 -.BR mlock () -や -.BR mlockall () -を呼び出してロックされたページでも、 -対応する範囲に対して -.BR munlock () -を 1 回呼び出したり -.BR munlockall () -を呼び出したりするだけでロック解除される。 -複数の場所や複数のプロセスにマップされているページは、少なくとも一つの場所、 -一つのプロセスでロックされている限りは RAM に残り続ける。 -.\"O .SS "Linux Notes" -.SS Linux での注意 -.\"O Under Linux, -.\"O .BR mlock () -.\"O and -.\"O .BR munlock () -.\"O automatically round -.\"O .I addr -.\"O down to the nearest page boundary. -Linux では、 -.BR mlock () -と -.BR munlock () -は自動的に -.I addr -を端数切り捨てにより一番近いページ境界へと丸める。 -.\"O However, POSIX.1-2001 allows an implementation to require that -.\"O .I addr -.\"O is page aligned, so portable applications should ensure this. -しかし POSIX.1-2001 は -.I addr -がページ境界に合っていることを要求する実装も許している。 -そのため移植性を意図したアプリケーションではきちんと境界に合わせた方が良い。 -.\"O .SS "Limits and permissions" -.SS 制限と権限 -.\"O In Linux 2.6.8 and earlier, -.\"O a process must be privileged -.\"O .RB ( CAP_IPC_LOCK ) -.\"O in order to lock memory and the -.\"O .B RLIMIT_MEMLOCK -.\"O soft resource limit defines a limit on how much memory the process may lock. -Linux 2.6.8 以前では、メモリをロックするためには特権 -.RB ( CAP_IPC_LOCK ) -が必要で、 -ソフト資源制限 -.B RLIMIT_MEMLOCK -はプロセスがどれだけのメモリをロックできるかの制限を定義する。 - -.\"O Since Linux 2.6.9, no limits are placed on the amount of memory -.\"O that a privileged process can lock and the -.\"O .B RLIMIT_MEMLOCK -.\"O soft resource limit instead defines a limit on how much memory an -.\"O unprivileged process may lock. -Linux 2.6.9 以降では、特権を持つプロセスがロックできるメモリ量は無制限となり、 -代わりにソフト資源制限 -.B RLIMIT_MEMLOCK -は特権を持たないプロセスがロックできるメモリ量の制限を定義する。 -.\"O .SH "BUGS" -.SH バグ -.\"O In the 2.4 series Linux kernels up to and including 2.4.17, -.\"O a bug caused the -.\"O .BR mlockall () -.\"O .B MCL_FUTURE -.\"O flag to be inherited across a -.\"O .BR fork (2). -2.4.17 までの 2.4 シリーズの Linux カーネルには、 -.BR mlockall () -.B MCL_FUTURE -フラグが -.BR fork (2) -で継承されると言うバグがある。 -.\"O This was rectified in kernel 2.4.18. -これはカーネル 2.4.18 で修正された。 - -.\"O Since kernel 2.6.9, if a privileged process calls -.\"O .I mlockall(MCL_FUTURE) -.\"O and later drops privileges (loses the -.\"O .B CAP_IPC_LOCK -.\"O capability by, for example, -.\"O setting its effective UID to a nonzero value), -.\"O then subsequent memory allocations (e.g., -.\"O .BR mmap (2), -.\"O .BR brk (2)) -.\"O will fail if the -.\"O .B RLIMIT_MEMLOCK -.\"O resource limit is encountered. -カーネル 2.6.9 以降では、特権を持ったプロセスが -.I mlockall(MCL_FUTURE) -を呼び出した後で、特権をなくした場合 (例えば、 -実効 UID を 0 以外の値に変更するなどにより、 -.B CAP_IPC_LOCK -ケーパビリティを失った場合)、リソース上限 -.B RLIMIT_MEMLOCK -に達すると、それ以降のメモリ割り当て (例えば -.BR mmap (2), -.BR brk (2)) -は失敗する。 -.\"O .\" See the following LKML thread: -.\"O .\" http://marc.theaimsgroup.com/?l=linux-kernel&m=113801392825023&w=2 -.\"O .\" "Rationale for RLIMIT_MEMLOCK" -.\"O .\" 23 Jan 2006 -.\" LKML の以下のスレッドを参照: -.\" http://marc.theaimsgroup.com/?l=linux-kernel&m=113801392825023&w=2 -.\" "Rationale for RLIMIT_MEMLOCK" -.\" 23 Jan 2006 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR mmap (2), -.BR setrlimit (2), -.BR shmctl (2), -.BR sysconf (3), -.BR capabilities (7) diff --git a/draft/man2/mmap.2 b/draft/man2/mmap.2 deleted file mode 100644 index 78828086..00000000 --- a/draft/man2/mmap.2 +++ /dev/null @@ -1,1118 +0,0 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" Copyright (C) 1996 Andries Brouwer -.\" and Copyright (C) 2006, 2007 Michael Kerrisk -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" Modified 1997-01-31 by Eric S. Raymond -.\" Modified 2000-03-25 by Jim Van Zandt -.\" Modified 2001-10-04 by John Levon -.\" Modified 2003-02-02 by Andi Kleen -.\" Modified 2003-05-21 by Michael Kerrisk -.\" MAP_LOCKED works from 2.5.37 -.\" Modified 2004-06-17 by Michael Kerrisk -.\" Modified 2004-09-11 by aeb -.\" Modified 2004-12-08, from Eric Estievenart -.\" Modified 2004-12-08, mtk, formatting tidy-ups -.\" Modified 2006-12-04, mtk, various parts rewritten -.\" 2007-07-10, mtk, Added an example program. -.\" 2008-11-18, mtk, document MAP_STACK -.\" -.\" Japanese Version Copyright (c) 1997-2000 SUTO, Mitsuaki and NAKANO Takeo -.\" all rights reserved. -.\" Translated 1997-06-26, SUTO, Mitsuaki -.\" Updated & Modified 1999-03-01, NAKANO Takeo -.\" Updated 2000-10-12, Nakano Takeo -.\" Updated 2001-08-16, Nakano Takeo -.\" Updated 2001-11-11, Akihiro MOTOKI -.\" Updated 2002-08-13, Akihiro MOTOKI -.\" Updated 2003-07- 2, Akihiro MOTOKI -.\" Updated 2003-09-14, Akihiro MOTOKI -.\" Updated & Modified 2004-12-28, Yuichi SATO -.\" Updated 2005-09-06, Akihiro MOTOKI -.\" Updated 2005-10-05, Akihiro MOTOKI -.\" Updated 2006-07-23, Akihiro MOTOKI, LDP v2.36 -.\" Updated 2007-01-07, Akihiro MOTOKI, LDP v2.43 -.\" Updated 2007-05-04, Akihiro MOTOKI, LDP v2.46 -.\" Updated 2007-09-03, Akihiro MOTOKI, LDP v2.64 -.\" Updated 2008-08-05, Akihiro MOTOKI, LDP v3.05 -.\" Updated 2008-09-02, Akihiro MOTOKI, LDP v3.08 -.\" Updated 2008-12-24, Akihiro MOTOKI, LDP v3.15 -.\" Updated 2010-04-18, Akihiro MOTOKI, LDP v3.24 -.\" -.\"WORD file descriptor ファイル記述子 -.\" -.TH MMAP 2 2009-09-26 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O mmap, munmap \- map or unmap files or devices into memory -.SH 名前 -mmap, munmap \- ファイルやデバイスをメモリにマップ/アンマップする -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.B #include -.sp -.BI "void *mmap(void *" addr ", size_t " length \ -", int " prot ", int " flags , -.BI " int " fd ", off_t " offset ); -.BI "int munmap(void *" addr ", size_t " length ); -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O .BR mmap () -.\"O creates a new mapping in the virtual address space of -.\"O the calling process. -.\"O The starting address for the new mapping is specified in -.\"O .IR addr . -.\"O The -.\"O .I length -.\"O argument specifies the length of the mapping. -.BR mmap () -は、新しいマッピングを呼び出し元プロセスの仮想アドレス空間に作成する。 -新しいマッピングの開始アドレスは -.I addr -で指定される。マッピングの長さは -.I length -引き数で指定される。 - -.\"O If -.\"O .I addr -.\"O is NULL, -.\"O then the kernel chooses the address at which to create the mapping; -.\"O this is the most portable method of creating a new mapping. -.\"O If -.\"O .I addr -.\"O is not NULL, -.\"O then the kernel takes it as a hint about where to place the mapping; -.\"O on Linux, the mapping will be created at a nearby page boundary. -.\"O .\" Before Linux 2.6.24, the address was rounded up to the next page -.\"O .\" boundary; since 2.6.24, it is rounded down! -.\"O The address of the new mapping is returned as the result of the call. -.I addr -が NULL の場合、カーネルがマッピングを作成するアドレスを選択する。 -この方法は最も移植性のある新しいマッピングの作成方法である。 -.I addr -が NULL でない場合、カーネルはマッピングをどこに配置するかのヒントとして -.I addr -を使用する。Linux では、マッピングはすぐ近くのページ境界に作成される。 -.\" Linux 2.6.24 より前では、アドレスは (アドレスが大きくなる方向で) -.\" すぐ次のページ境界に切り上げられていた。 -.\" Linux 2.6.24 以降では、切り下げられる! -新しいマッピングのアドレスは、呼び出しの返り値として返される。 - -.\"O The contents of a file mapping (as opposed to an anonymous mapping; see -.\"O .B MAP_ANONYMOUS -.\"O below), are initialized using -.\"O .I length -.\"O bytes starting at offset -.\"O .I offset -.\"O in the file (or other object) referred to by the file descriptor -.\"O .IR fd . -.\"O .I offset -.\"O must be a multiple of the page size as returned by -.\"O .IR sysconf(_SC_PAGE_SIZE) . -ファイルマッピングの内容は、 -ファイルディスクリプタ -.I fd -で参照されるファイル (もしくは他のオブジェクト) のオフセット -.I offset -から開始される -.I length -バイトのデータで初期化される -(ファイルマッピングは無名マッピングの反対語である。 -.B MAP_ANONYMOUS -を参照)。 -.I offset -は -.I sysconf(_SC_PAGE_SIZE) -が返すページサイズの倍数でなければならない。 -.LP -.\"O The -.\"O .I prot -.\"O argument describes the desired memory protection of the mapping -.\"O (and must not conflict with the open mode of the file). -.\"O It is either -.\"O .B PROT_NONE -.\"O or the bitwise OR of one or more of the following flags: -引き数 -.I prot -には、マッピングのメモリ保護をどのように行なうかを指定する -(ファイルのオープンモードと矛盾してはいけない)。 -.I prot -には、 -.B PROT_NONE -か、以下のフラグをひとつ以上ビット毎の論理和 (OR) をとったものを -指定できる。 -.TP 1.1i -.B PROT_EXEC -.\"O Pages may be executed. -ページは実行可能である。 -.TP -.B PROT_READ -.\"O Pages may be read. -ページは読み込み可能である。 -.TP -.B PROT_WRITE -.\"O Pages may be written. -ページに書き込み可能である。 -.TP -.B PROT_NONE -.\"O Pages may not be accessed. -ページにはアクセスできない。 -.LP -.\"O The -.\"O .I flags -.\"O argument determines whether updates to the mapping -.\"O are visible to other processes mapping the same region, -.\"O and whether updates are carried through to the underlying file. -.\"O This behavior is determined by including exactly one -.\"O of the following values in -.\"O .IR flags : -.I flags -引き数により、マッピングに対する更新が同じ領域をマッピングしている -他のプロセスに見えるか、更新がマッピング元のファイルを通じて -伝えられるか、が決定される。この動作は、以下の値のいずれか一つだけ -(複数は指定できない) を -.I flags -に含めることで指定する。 -.TP 1.1i -.B MAP_SHARED -.\"O Share this mapping. -.\"O Updates to the mapping are visible to other processes that map this file, -.\"O and are carried through to the underlying file. -.\"O The file may not actually be updated until -.\"O .BR msync (2) -.\"O or -.\"O .BR munmap () -.\"O is called. -このマッピングを共有する。 -マッピングに対する更新はこのファイルをマッピングしている他のプロセス -から見える。更新はマッピング元のファイルを通じて伝えられる。 -ただし、ファイルの実際の更新は -.BR msync (2) -または -.BR munmap () -が呼ばれるまで行われないこともある。 -.TP -.B MAP_PRIVATE -.\"O Create a private copy-on-write mapping. -.\"O Updates to the mapping are not visible to other processes -.\"O mapping the same file, and are not carried through to -.\"O the underlying file. -.\"O It is unspecified whether changes made to the file after the -.\"O .BR mmap () -.\"O call are visible in the mapped region. -プライベートな copy-on-write (書き込み時コピー) マップを生成する。 -マッピングに対する更新は同じファイルをマッピングしている他のプロセス -には見えず、更新がマッピング元のファイルを通じて伝えられることもない。 -.BR mmap () -の呼び出し後にマッピング元のファイルに対して行われた変更が、 -マップ領域に反映されるかどうかは規定されていない。 -.LP -.\"O Both of these flags are described in POSIX.1-2001. -上記の二つのフラグは POSIX.1-2001 で規定されている。 - -.\"O In addition, zero or more of the following values can be ORed in -.\"O .IR flags : -さらに、以下の値のうち 0 個以上をビット毎の論理和 (OR) で -.I flags -に指定することができる。 -.TP -.\"O .BR MAP_32BIT " (since Linux 2.4.20, 2.6)" -.BR MAP_32BIT " (Linux 2.4.20, 2.6 以降)" -.\"O Put the mapping into the first 2 Gigabytes of the process address space. -.\"O This flag is only supported on x86-64, for 64-bit programs. -.\"O It was added to allow thread stacks to be allocated somewhere -.\"O in the first 2GB of memory, -.\"O so as to improve context-switch performance on some early -.\"O 64-bit processors. -.\"O .\" See http://lwn.net/Articles/294642 "Tangled up in threads", 19 Aug 08 -.\"O Modern x86-64 processors no longer have this performance problem, -.\"O so use of this flag is not required on those systems. -.\"O The -.\"O .B MAP_32BIT -.\"O flag is ignored when -.\"O .B MAP_FIXED -.\"O is set. -マッピングをプロセスのアドレス空間の先頭 2 ギガバイト以内に配置する。 -このフラグがサポートされているのは x86-64 アーキテクチャ上の -64 ビットプログラムのみである。 -このフラグが追加されたのは、スレッドのスタックをメモリの先頭 2GB 以内の -どこかに割り当てることで、初期のいくつかの 64 ビットプロセッサにおける -コンテキストスイッチの性能問題を改善するためである。 -.\" See http://lwn.net/Articles/294642 "Tangled up in threads", 19 Aug 08 -最近の x86-64 プロセッサではこの性能問題はもはや存在せず、 -そのようなシステムではこのフラグを使用する必要はない。 -.B MAP_FIXED -がセットされている場合は、 -.B MAP_32BIT -フラグは無視される。 -.TP -.B MAP_ANON -.\"O Synonym for -.\"O .BR MAP_ANONYMOUS . -.\"O Deprecated. -.B MAP_ANONYMOUS -の同義語。非推奨。 -.TP -.B MAP_ANONYMOUS -.\"O The mapping is not backed by any file; -.\"O its contents are initialized to zero. -.\"O The -.\"O .I fd -.\"O and -.\"O .I offset -.\"O arguments are ignored; -.\"O however, some implementations require -.\"O .I fd -.\"O to be \-1 if -.\"O .B MAP_ANONYMOUS -.\"O (or -.\"O .BR MAP_ANON ) -.\"O is specified, -.\"O and portable applications should ensure this. -.\"O The use of -.\"O .B MAP_ANONYMOUS -.\"O in conjunction with -.\"O .B MAP_SHARED -.\"O is only supported on Linux since kernel 2.4. -マッピングはどのファイルとも関連付けされない。 -マッピングの内容は 0 で初期化される。 -引き数 -.I fd -と -.I offset -は無視される。 -ただし、実装によっては -.B MAP_ANONYMOUS -(もしくは -.BR MAP_ANON ) -が指定された場合、 -.I fd -を \-1 にする必要があり、 -移植性が必要なアプリケーションでは必ず -.I fd -を \-1 にすべきである。 -.B MAP_ANONYMOUS -と -.B MAP_SHARED -を組み合わせての利用は -カーネル 2.4 以降の Linux でのみサポートされている。 -.TP -.B MAP_DENYWRITE -.\"O This flag is ignored. -.\"O .\" Introduced in 1.1.36, removed in 1.3.24. -.\"O (Long ago, it signaled that attempts to write to the underlying file -.\"O should fail with -.\"O .B ETXTBUSY . -.\"O But this was a source of denial-of-service attacks.) -このフラグは無視される -.\" 1.1.36 で導入され、1.3.24 で削除された。 -(ずっと前は、マップ元のファイルへの書き込みを行おうとすると、エラー -.B ETXTBUSY -で失敗するようにシグナルが設定されていたが、これは denial-of-service -(サービス拒否) 攻撃の原因となった)。 -.TP -.B MAP_EXECUTABLE -.\"O This flag is ignored. -このフラグは無視される。 -.\"O .\" Introduced in 1.1.38, removed in 1.3.24. Flag tested in proc_follow_link. -.\"O .\" (Long ago, it signaled that the underlying file is an executable. -.\"O .\" However, that information was not really used anywhere.) -.\"O .\" Linus talked about DOS related to MAP_EXECUTABLE, but he was thinking of -.\"O .\" MAP_DENYWRITE? -.\" 1.1.38 で導入され、1.3.24 で削除された。 -.\" proc_follow_link でテストされるフラグである。(ずっと前は、 -.\" マップ元のファイルが実行可能であることを知らせるようになっていた。 -.\" しかし、その情報は実際にはどこでも使われなかった。) -.\" Linus は MAP_EXECUTABLE に関連して DoS の話をしたが、 -.\" MAP_DENYWRITE のことを考えていたのかな? -.TP -.B MAP_FILE -.\"O Compatibility flag. -.\"O Ignored. -互換性のためのフラグ。無視される。 -.\" On some systems, this was required as the opposite of -.\" MAP_ANONYMOUS -- mtk, 1 May 2007 -.TP -.B MAP_FIXED -.\"O Don't interpret -.\"O .I addr -.\"O as a hint: place the mapping at exactly that address. -.\"O .I addr -.\"O must be a multiple of the page size. -.I addr -をアドレスのヒントとして使用するのではなく、 -.I addr -で指定されたアドレスをそのまま使用してマッピングを配置する。 -.I addr -はページサイズの倍数でなければならない。 -.\"O If the memory region specified by -.\"O .I addr -.\"O and -.\"O .I len -.\"O overlaps pages of any existing mapping(s), then the overlapped -.\"O part of the existing mapping(s) will be discarded. -.I addr -と -.I len -で指定されたメモリ領域が既存のマッピングのページと重なる場合、 -既存のマッピングの重なった部分は捨てられる。 -.\"O If the specified address cannot be used, -.\"O .BR mmap () -.\"O will fail. -もし指定されたアドレスが使用できない場合、 -.BR mmap () -は失敗する。 -.\"O Because requiring a fixed address for a mapping is less portable, -.\"O the use of this option is discouraged. -マッピングに対して固定アドレスを要求するのは移植性の面で劣るので、 -このオプションは使用しないことを推奨する。 -.TP -.B MAP_GROWSDOWN -.\"O Used for stacks. -.\"O Indicates to the kernel virtual memory system that the mapping -.\"O should extend downwards in memory. -スタック用に使用される。マッピングをメモリ内で逆向きに行うことを -カーネル仮想メモリシステムに指示する。 -(訳注:マッピングは通常はメモリ・アドレスが増加する向きに行うが、 -このオプションを指定すると逆向きにマッピングを行う) -.TP -.\"O .BR MAP_HUGETLB " (since Linux 2.6.32)" -.BR MAP_HUGETLB " (Linux 2.6.32 以降)" -.\"O Allocate the mapping using "huge pages." -.\"O See the kernel source file -.\"O .I Documentation/vm/hugetlbpage.txt -.\"O for further information. -"huge page" を使ってマッピングを割り当てる。 -詳しい情報は、カーネル・ソースの -.I Documentation/vm/hugetlbpage.txt -を参照。 -.TP -.\"O .BR MAP_LOCKED " (since Linux 2.5.37)" -.BR MAP_LOCKED " (Linux 2.5.37 以降)" -.\"O Lock the pages of the mapped region into memory in the manner of -.\"O .BR mlock (2). -.\"O This flag is ignored in older kernels. -.\"O .\" If set, the mapped pages will not be swapped out. -マップされた領域のページを -.BR mlock (2) -の方法でメモリ内にロックする。 -それ以前のカーネルでは、このフラグは無視される。 -.\" このフラグがセットされていると、マッピングされたページはスワップアウト -.\" されない。 -.TP -.\"O .BR MAP_NONBLOCK " (since Linux 2.5.46)" -.BR MAP_NONBLOCK " (Linux 2.5.46 以降)" -.\"O Only meaningful in conjunction with -.\"O .BR MAP_POPULATE . -.\"O Don't perform read-ahead: -.\"O only create page tables entries for pages -.\"O that are already present in RAM. -.B MAP_POPULATE -と組み合わせた場合のみ意味を持つ。 -read-ahead (前もって読み込むこと) を実行しない。 -単に、すでに RAM 上に存在するページに対して -ページテーブルエントリを作成するだけである。 -.\"O Since Linux 2.6.23, this flag causes -.\"O .BR MAP_POPULATE -.\"O to do nothing. -.\"O One day the combination of -.\"O .BR MAP_POPULATE -.\"O and -.\"O .BR MAP_NONBLOCK -.\"O may be reimplemented. -Linux 2.6.23 以降では、このフラグは -.B MAP_POPULATE -に何の影響も与えない。 -いつか -.B MAP_POPULATE -と -.B MAP_NONBLOCK -を組み合わせた場合の動作は実装し直されるかもしれない。 -.TP -.B MAP_NORESERVE -.\"O Do not reserve swap space for this mapping. -.\"O When swap space is reserved, one has the guarantee -.\"O that it is possible to modify the mapping. -.\"O When swap space is not reserved one might get -.\"O .B SIGSEGV -.\"O upon a write -.\"O if no physical memory is available. -このマッピングに対するスワップ空間の予約を行わない。 -スワップ空間を予約した場合は、このマッピングの変更が必ず可能なことが -保証される。予約を行わなかった場合、物理メモリに空きがないと -書き込み時に -.B SIGSEGV -エラーを受け取ることがある。 -.\"O See also the discussion of the file -.\"O .I /proc/sys/vm/overcommit_memory -.\"O in -.\"O .BR proc (5). -.\"O In kernels before 2.6, this flag only had effect for -.\"O private writable mappings. -.BR proc (5) -の -.I /proc/sys/vm/overcommit_memory -ファイルについての議論も参照。 -バージョン 2.6 より前のカーネルでは、このフラグは書き込み可能な -プライベート・マッピングについてのみ効果があった。 -.TP -.\"O .BR MAP_POPULATE " (since Linux 2.5.46)" -.BR MAP_POPULATE " (Linux 2.5.46 以降)" -.\"O Populate (prefault) page tables for a mapping. -.\"O For a file mapping, this causes read-ahead on the file. -.\"O Later accesses to the mapping will not be blocked by page faults. -.\"O .BR MAP_POPULATE -.\"O is only supported for private mappings since Linux 2.6.23. -マッピング用のページテーブルを配置 (populate) する -ファイルマッピングの場合には、これによりファイルが先読み (read-ahead) -が行われる。この以後は、マッピングに対するアクセスがページフォールトで -ブロックされることがなくなる。 -.BR MAP_POPULATE -は Linux 2.6.23 以降でプライベート・マッピングについてのみ -サポートされている。 -.LP -.\"O Of the above flags, only -.\"O .B MAP_FIXED -.\"O is specified in POSIX.1-2001. -.\"O However, most systems also support -.\"O .B MAP_ANONYMOUS -.\"O (or its synonym -.\"O .BR MAP_ANON ). -上記のフラグの中では、 -.B MAP_FIXED -だけが POSIX.1-2001 で規定されている。 -しかしながら、ほとんどのシステムで -.B MAP_ANONYMOUS -(またはその同義語である -.BR MAP_ANON ) -もサポートされている。 -.TP -.\"O .BR MAP_STACK " (since Linux 2.6.27)" -.BR MAP_STACK " (Linux 2.6.27 以降)" -.\"O Allocate the mapping at an address suitable for a process -.\"O or thread stack. -.\"O This flag is currently a no-op, -.\"O but is used in the glibc threading implementation so that -.\"O if some architectures require special treatment for stack allocations, -.\"O support can later be transparently implemented for glibc. -プロセスやスレッドのスタックに適したアドレスにマッピングを割り当てる。 -現在のところ、このフラグは何もしないが、 -glibc のスレッド実装では使用されている。 -これは、いくつかのアーキテクチャではスタックの割り当てに関して特別な扱い -が必要な場合に、glibc にそのサポートを後で透過的に実装できるようにする -ためである。 -.\" See http://lwn.net/Articles/294642 "Tangled up in threads", 19 Aug 08 -.\" commit cd98a04a59e2f94fa64d5bf1e26498d27427d5e7 -.\" http://thread.gmane.org/gmane.linux.kernel/720412 -.\" "pthread_create() slow for many threads; also time to revisit 64b -.\" context switch optimization?" -.LP -.\"O Some systems document the additional flags -.\"O .BR MAP_AUTOGROW , -.\"O .BR MAP_AUTORESRV , -.\"O .BR MAP_COPY , -.\"O and -.\"O .BR MAP_LOCAL . -いくつかのシステムでは、上記以外にフラグとして -.BR MAP_AUTOGROW , -.BR MAP_AUTORESRV , -.BR MAP_COPY , -.B MAP_LOCAL -が規定されている。 -.LP -.\"O Memory mapped by -.\"O .BR mmap () -.\"O is preserved across -.\"O .BR fork (2), -.\"O with the same attributes. -.BR mmap () -によってマップされたメモリの属性は -.BR fork (2) -の際に継承される。 -.LP -.\"O A file is mapped in multiples of the page size. -.\"O For a file that is not -.\"O a multiple of the page size, the remaining memory is zeroed when mapped, -.\"O and writes to that region are not written out to the file. -.\"O The effect of -.\"O changing the size of the underlying file of a mapping on the pages that -.\"O correspond to added or removed regions of the file is unspecified. -ファイルはページサイズの整数倍の領域にマップされる。サイズがページサイズの -整数倍でないファイルの場合、マップ時に残りの領域は 0 で埋められ、この領域へ -書きこみを行ってもファイルに書き出されることはない。マッピングを行った元 -ファイルのサイズを変更した場合、元ファイルの追加されたり削除された領域に対応 -するマップされたページに対してどのような影響があるかは規定されていない。 -.SS munmap() -.\"O The -.\"O .BR munmap () -.\"O system call deletes the mappings for the specified address range, and -.\"O causes further references to addresses within the range to generate -.\"O invalid memory references. -.\"O The region is also automatically unmapped -.\"O when the process is terminated. -.\"O On the other hand, closing the file -.\"O descriptor does not unmap the region. -システムコール -.BR munmap () -は指定されたアドレス範囲のマップを消去し、 -これ以降のその範囲内へのメモリ参照は不正となる。 -この領域は、プロセスが終了したときにも自動的にアンマップされる。 -一方、ファイル記述子をクローズしても、この領域はアンマップされない。 -.LP -.\"O The address -.\"O .I addr -.\"O must be a multiple of the page size. -.\"O All pages containing a part -.\"O of the indicated range are unmapped, and subsequent references -.\"O to these pages will generate -.\"O .BR SIGSEGV . -.\"O It is not an error if the -.\"O indicated range does not contain any mapped pages. -.I addr -アドレスはページサイズの整数倍でなければならない。指定された範囲の一部分を -含む全てのページはアンマップされ、これ以降にこれらのページへの参照があると -.B SIGSEGV -が発生する。 -指定した範囲内にマップされたページが一つも含まれていない場合でも -エラーにならない。 -.\"O .SS Timestamps changes for file-backed mappings -.SS ファイルと関連付けられたマッピングに対するタイムスタンプの更新 -.\"O For file-backed mappings, the -.\"O .I st_atime -.\"O field for the mapped file may be updated at any time between the -.\"O .BR mmap () -.\"O and the corresponding unmapping; the first reference to a mapped -.\"O page will update the field if it has not been already. -ファイルと関連付けられたマッピングの場合、マッピングされたファイルの -.I st_atime -フィールドは、 -.BR mmap () -されてからアンマップ (unmap) されるまでの間に更新されることがある。 -それまでに更新が行われていなければ、マップされたページへの最初の参照があった -際に更新される。 -.LP -.\"O The -.\"O .I st_ctime -.\"O and -.\"O .I st_mtime -.\"O field for a file mapped with -.\"O .B PROT_WRITE -.\"O and -.\"O .B MAP_SHARED -.\"O will be updated after -.\"O a write to the mapped region, and before a subsequent -.\"O .BR msync (2) -.\"O with the -.\"O .B MS_SYNC -.\"O or -.\"O .B MS_ASYNC -.\"O flag, if one occurs. -.B PROT_WRITE -と -.B MAP_SHARED -の両方を指定してマップされたファイルの場合、書き込みがあると、 -.I st_ctime -と -.I st_mtime -の両フィールドは、マップされた領域への書き込みより後で、 -.B MS_SYNC -または -.B MS_ASYNC -フラグを指定して -.BR msync (2) -が呼ばれる前までに更新される。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success, -.\"O .BR mmap () -.\"O returns a pointer to the mapped area. -.\"O On error, the value -.\"O .B MAP_FAILED -.\"O (that is, -.\"O .IR "(void\ *)\ \-1" ) -.\"O is returned, and -.\"O .I errno -.\"O is set appropriately. -.BR mmap () -は成功するとマップされた領域へのポインタを返す。 -失敗すると値 -.B MAP_FAILED -(つまり -.IR "(void\ *)\ \-1" ) -を返し、 -.I errno -がエラーの内容にしたがってセットされる。 -.\"O On success, -.\"O .BR munmap () -.\"O returns 0, on failure \-1, and -.\"O .I errno -.\"O is set (probably to -.\"O .BR EINVAL ). -.BR munmap () -は成功すると 0 を返す。失敗すると \-1 を返し、 -.I errno -がセットされる (多くの場合 -.B EINVAL -になるだろう)。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EACCES -.\"O A file descriptor refers to a non-regular file. -.\"O Or -.\"O .B MAP_PRIVATE -.\"O was requested, but -.\"O .I fd -.\"O is not open for reading. -.\"O Or -.\"O .B MAP_SHARED -.\"O was requested and -.\"O .B PROT_WRITE -.\"O is set, but -.\"O .I fd -.\"O is not open in read/write -.\"O .RB ( O_RDWR ) -.\"O mode. -.\"O \"O Or -.\"O .B PROT_WRITE -.\"O is set, but the file is append-only. -以下のいずれかの場合。 -ファイル記述子の参照先が通常のファイルではない (non-regular file) 。 -.B MAP_PRIVATE -を要求したが -.I fd -は読み込み用にオープンされていない。 -.B MAP_SHARED -を要求して -.B PROT_WRITE -をセットしたが -.I fd -は読み書きモード -.RB ( O_RDWR ) -でオープンされていない、 -.B PROT_WRITE -をセットしたが、ファイルは追加 (append) 専用である。 -.TP -.B EAGAIN -.\"O The file has been locked, or too much memory has been locked (see -.\"O .BR setrlimit (2)). -ファイルがロックされている。またはロックされているメモリが多すぎる -.RB ( setrlimit (2) -を参照)。 -.TP -.B EBADF -.\"O .I fd -.\"O is not a valid file descriptor (and -.\"O .B MAP_ANONYMOUS -.\"O was not set). -.I fd -が有効なファイル記述子 (file descriptor) ではない -(かつ -.B MAP_ANONYMOUS -がセットされていない)。 -.TP -.B EINVAL -.\"O We don't like -.\"O .IR addr , -.\"O .IR length , -.\"O or -.\"O .I offset -.\"O (e.g., they are too large, or not aligned on a page boundary). -.I addr -か -.I length -か -.I offset -が適切でない -(例えば、大きすぎるとか、ページ境界にアラインメントされていない)。 -.TP -.B EINVAL -.\"O (since Linux 2.6.12) -.\"O .I length -.\"O was 0. -(Linux 2.6.12 以降) -.I length -が 0 であった。 -.TP -.B EINVAL -.\"O .I flags -.\"O contained neither -.\"O .B MAP_PRIVATE -.\"O or -.\"O .BR MAP_SHARED , -.\"O or contained both of these values. -.I flags -に -.B MAP_PRIVATE -と -.B MAP_SHARED -のどちらも含まれていなかった、もしくは -その両方が含まれていた。 -.TP -.B ENFILE -.\"O .\" This is for shared anonymous segments -.\" これは共有匿名 (anonymous) セグメントのためのものである。 -.\" [2.6.7] shmem_zero_setup()-->shmem_file_setup()-->get_empty_filp() -.\"O The system limit on the total number of open files has been reached. -オープンされたファイルの総数がシステムの制限に達した。 -.\" .TP -.\" .B ENOEXEC -.\"O .\" A file could not be mapped for reading. -.\" ファイルを読み込み用にマップできなかった。 -.TP -.B ENODEV -.\"O The underlying file system of the specified file does not support -.\"O memory mapping. -指定されたファイルが置かれているファイルシステムがメモリマッピングをサポート -していない。 -.TP -.B ENOMEM -.\"O No memory is available, or the process's maximum number of mappings would -.\"O have been exceeded. -メモリに空きがない、または処理中のプロセスのマッピング数が最大数を超過した。 -.TP -.B EPERM -.\"O The -.\"O .I prot -.\"O argument asks for -.\"O .B PROT_EXEC -.\"O but the mapped area belongs to a file on a file system that -.\"O was mounted no-exec. -.\"O .\" (Since 2.4.25 / 2.6.0.) -.I prot -引き数は -.B PROT_EXEC -を行うように指定されているが、 -no-exec でマウントされたファイルシステム上のファイルに -マップ領域が対応している。 -.\" (2.4.25 / 2.6.0 以降) -.TP -.B ETXTBSY -.\"O .B MAP_DENYWRITE -.\"O was set but the object specified by -.\"O .I fd -.\"O is open for writing. -.B MAP_DENYWRITE -がセットされているが -.I fd -で指定されているオブジェクトは書き込み用に開かれている。 -.LP -.\"O Use of a mapped region can result in these signals: -マップ領域を利用する際に、以下のシグナルが発生することがある: -.TP -.B SIGSEGV -.\"O Attempted write into a region mmaped as read-only. -読み込み専用で mmap された領域へ書き込みを行おうとした。 -.TP -.B SIGBUS -.\"O Attempted access to a portion of the buffer that does not correspond -.\"O to the file (for example, beyond the end of the file, including the -.\"O case where another process has truncated the file). -バッファのうち、ファイルに関連づけられていない部分 -(例えばファイル末尾を越えた部分など。これには -他のプロセスがファイルを切り詰めた場合なども含まれる) -にアクセスしようとした。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -.\"O SVr4, 4.4BSD, POSIX.1-2001. -.\"O .\" SVr4 documents additional error codes ENXIO and ENODEV. -.\"O .\" SUSv2 documents additional error codes EMFILE and EOVERFLOW. -SVr4, 4.4BSD, POSIX.1-2001. -.\" SVr4 にはさらに ENXIO と ENODEV のエラーコードについての記述がある。 -.\" SUSv2 にはさらに EMFILE と EOVERFLOW のエラーコードについての記述がある。 -.\"O .SH AVAILABILITY -.SH 可用性 -.\"O On POSIX systems on which -.\"O .BR mmap (), -.\"O .BR msync (2) -.\"O and -.\"O .BR munmap () -.\"O are available, -.\"O .B _POSIX_MAPPED_FILES -.\"O is defined in \fI\fP to a value greater than 0. -.\"O (See also -.\"O .BR sysconf (3).) -.\"O .\" POSIX.1-2001: It shall be defined to -1 or 0 or 200112L. -.\"O .\" -1: unavailable, 0: ask using sysconf(). -.\"O .\" glibc defines it to 1. -.BR mmap (), -.BR msync (2) -.BR munmap () -が利用可能な POSIX システムでは、 -.B _POSIX_MAPPED_FILES -は で 0 より大きな値に定義される -.RB ( sysconf (3) -も参照のこと)。 -.\" POSIX.1-2001: _POSIX_MAPPED_FILES は -1 か 0 か 200112L の -.\" いずれかに定義されることになっている。 -.\" -1: 利用不可、0: sysconf() に問いあわせる -.\" glibc では POSIX_MAPPED_FILES は 1 に定義されている。 -.\"O .SH NOTES -.SH 注意 -.\"O Since kernel 2.4, this system call has been superseded by -.\"O .BR mmap2 (2). -.\"O Nowadays, -.\"O .\" Since around glibc 2.1/2.2, depending on the platform. -.\"O the glibc -.\"O .BR mmap () -.\"O wrapper function invokes -.\"O .BR mmap2 (2) -.\"O with a suitably adjusted value for -.\"O .IR offset . -カーネル 2.4 以降、このシステムコールは -.BR mmap2 (2) -に取って代わられた。 -現在では、 -.\" プラットフォームにより異なるが、 glibc 2.1/2.2 あたりから。 -glibc の -.BR mmap () -のラッパー関数は -.I offset -を適切に調整してから -.BR mmap2 (2) -を起動する。 - -.\"O On some hardware architectures (e.g., i386), -.\"O .B PROT_WRITE -.\"O implies -.\"O .BR PROT_READ . -.\"O It is architecture dependent whether -.\"O .B PROT_READ -.\"O implies -.\"O .B PROT_EXEC -.\"O or not. -.\"O Portable programs should always set -.\"O .B PROT_EXEC -.\"O if they intend to execute code in the new mapping. -(i386 などの) いくつかのアーキテクチャでは、 -.B PROT_WRITE -をセットすると、暗黙のうちに -.B PROT_READ -がセットされる。 -.B PROT_READ -をセットした際に暗黙のうちに -.B PROT_EXEC -がセットされるかどうかは、アーキテクチャ依存である。 -移植性を考慮したプログラムでは、 -新規にマップした領域でコードを実行したい場合は、常に -.B PROT_EXEC -をセットすべきである。 - -.\"O The portable way to create a mapping is to specify -.\"O .I addr -.\"O as 0 (NULL), and omit -.\"O .B MAP_FIXED -.\"O from -.\"O .IR flags . -.\"O In this case, the system chooses the address for the mapping; -.\"O the address is chosen so as not to conflict with any existing mapping, -.\"O and will not be 0. -.\"O If the -.\"O .B MAP_FIXED -.\"O flag is specified, and -.\"O .I addr -.\"O is 0 (NULL), then the mapped address will be 0 (NULL). -マッピングを作成する移植性のある方法は、 -.I addr -に 0 (NULL) を指定し、 -.I flags -から -.B MAP_FIXED -を外すことである。 -この場合、システムがマッピング用のアドレスの選択を行う。 -アドレスは既存のマッピングと衝突しないように、 -かつ 0 にならないように選択される。 -.B MAP_FIXED -フラグが指定され、かつ -.I addr -が 0 (NULL) -の場合には、マップされるアドレスが 0 (NULL) になる。 -.\"O .SH BUGS -.SH バグ -.\"O On Linux there are no guarantees like those suggested above under -.\"O .BR MAP_NORESERVE . -.\"O By default, any process can be killed -.\"O at any moment when the system runs out of memory. -Linux においては、上記の -.B MAP_NORESERVE -で述べられているような保証はない。 -デフォルトでは、システムがメモリを使い切った場合には、 -どのプロセスがいつ強制終了されるか分からないからである。 - -.\"O In kernels before 2.6.7, the -.\"O .B MAP_POPULATE -.\"O flag only has effect if -.\"O .I prot -.\"O is specified as -.\"O .BR PROT_NONE . -2.6.7 より前のカーネルでは、 -.I prot -に -.B PROT_NONE -が指定された場合にのみ、 -.B MAP_POPULATE -フラグが効力を持つ。 - -.\"O SUSv3 specifies that -.\"O .BR mmap () -.\"O should fail if -.\"O .I length -.\"O is 0. -.\"O However, in kernels before 2.6.12, -.\"O .BR mmap () -.\"O succeeded in this case: no mapping was created and the call returned -.\"O .IR addr . -.\"O Since kernel 2.6.12, -.\"O .BR mmap () -.\"O fails with the error -.\"O .B EINVAL -.\"O for this case. -SUSv3 では、 -.I length -が 0 の場合、 -.BR mmap () -は失敗すると規定されている。しかしながら、2.6.12 より前のカーネルでは、 -この場合に -.BR mmap () -は成功していた (マッピングは作成されず、 -.I addr -が返されていた)。 -カーネル 2.6.12 以降では、 -.BR mmap () -はエラー -.B EINVAL -で失敗する。 -.\"O .SH EXAMPLE -.SH 例 -.\" FIXME . Add an example here that uses an anonymous shared region for -.\" IPC between parent and child. -.PP -.\"O The following program prints part of the file specified in -.\"O its first command-line argument to standard output. -.\"O The range of bytes to be printed is specified via offset and length -.\"O values in the second and third command-line arguments. -.\"O The program creates a memory mapping of the required -.\"O pages of the file and then uses -.\"O .BR write (2) -.\"O to output the desired bytes. -以下のプログラムは、一番目のコマンドライン引き数で指定された -ファイルの一部を標準出力に表示する。 -表示する範囲は、二番目、三番目のコマンドライン引き数で渡される -オフセットと長さで指定される。 -このプログラムは、指定されたファイルの必要なページのメモリ・ -マッピングを作成し、 -.BR write (2) -を使って所望のバイトを出力する。 -.nf - -#include -#include -#include -#include -#include -#include - -#define handle_error(msg) \\ - do { perror(msg); exit(EXIT_FAILURE); } while (0) - -int -main(int argc, char *argv[]) -{ - char *addr; - int fd; - struct stat sb; - off_t offset, pa_offset; - size_t length; - ssize_t s; - - if (argc < 3 || argc > 4) { - fprintf(stderr, "%s file offset [length]\\n", argv[0]); - exit(EXIT_FAILURE); - } - - fd = open(argv[1], O_RDONLY); - if (fd == \-1) - handle_error("open"); - - if (fstat(fd, &sb) == \-1) /* To obtain file size */ - handle_error("fstat"); - - offset = atoi(argv[2]); - pa_offset = offset & ~(sysconf(_SC_PAGE_SIZE) \- 1); - /* offset for mmap() must be page aligned */ - - if (offset >= sb.st_size) { - fprintf(stderr, "offset is past end of file\\n"); - exit(EXIT_FAILURE); - } - - if (argc == 4) { - length = atoi(argv[3]); - if (offset + length > sb.st_size) - length = sb.st_size \- offset; - /* Can\(aqt display bytes past end of file */ - - } else { /* No length arg ==> display to end of file */ - length = sb.st_size \- offset; - } - - addr = mmap(NULL, length + offset \- pa_offset, PROT_READ, - MAP_PRIVATE, fd, pa_offset); - if (addr == MAP_FAILED) - handle_error("mmap"); - - s = write(STDOUT_FILENO, addr + offset \- pa_offset, length); - if (s != length) { - if (s == \-1) - handle_error("write"); - - fprintf(stderr, "partial write"); - exit(EXIT_FAILURE); - } - - exit(EXIT_SUCCESS); -} /* main */ -.fi -\"O .SH "SEE ALSO" -.SH 関連項目 -.BR getpagesize (2), -.BR mincore (2), -.BR mlock (2), -.BR mmap2 (2), -.BR mprotect (2), -.BR mremap (2), -.BR msync (2), -.BR remap_file_pages (2), -.BR setrlimit (2), -.BR shmat (2), -.BR shm_open (3), -.BR shm_overview (7) -.br -B.O. Gallmeister, POSIX.4, O'Reilly, pp. 128-129 and 389-391. -.\" -.\"O .\" Repeat after me: private read-only mappings are 100% equivalent to -.\"O .\" shared read-only mappings. No ifs, buts, or maybes. -- Linus -.\" 私の後について言ってみて: プライベートな読み込み専用のマッピングは -.\" 共有された読み込み専用のマッピングと 100% 等しい。 -.\" 「もし」も「しかし」も「たぶん」もない。-- Linus diff --git a/draft/man2/mmap2.2 b/draft/man2/mmap2.2 deleted file mode 100644 index 0a97229c..00000000 --- a/draft/man2/mmap2.2 +++ /dev/null @@ -1,150 +0,0 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" Copyright (C) 2002, Michael Kerrisk -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" Modified 31 Jan 2002, Michael Kerrisk -.\" Added description of mmap2 -.\" Modified, 2004-11-25, mtk -- removed stray #endif in prototype -.\" -.\" Japanese Version Copyright (c) 2002 Yuichi SATO -.\" all rights reserved. -.\" Translated 2002-07-18, Yuichi SATO -.\" Updated & Modified 2003-09-06, Yuichi SATO -.\" Updated 2006-01-18, Akihiro MOTOKI -.\" Updated 2007-09-07, Akihiro MOTOKI, LDP v2.64 -.\" -.TH MMAP2 2 2008-04-22 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O mmap2 \- map files or devices into memory -mmap2 \- ファイルやデバイスをメモリにマップする -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.B #include -.sp -.BI "void *mmap2(void *" addr ", size_t " length ", int " prot , -.BI " int " flags ", int " fd ", off_t " pgoffset ); -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The -.\"O .BR mmap2 () -.\"O system call operates in exactly the same way as -.\"O .BR mmap (2), -.BR mmap2 () -システムコールは -.BR mmap (2) -と全く同じように動作する。 -.\"O except that the final argument specifies the offset into the -.\"O file in 4096-byte units (instead of bytes, as is done by -.\"O .BR mmap (2)). -ただし最後の引き数には、ファイルのオフセットを -.RB ( mmap (2) -が行っている、バイト単位ではなく) -4096 バイトを単位として指定する。 -.\"O This enables applications that use a 32-bit -.\"O .I off_t -.\"O to map large files (up to 2^44 bytes). -これにより、32 ビットの -.I off_t -を使うアプリケーションで (2^44 バイトまでの) -大きなファイルをマップできるようになる。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success, -.\"O .BR mmap2 () -.\"O returns a pointer to the mapped area. -.\"O On error \-1 is returned and -.\"O .I errno -.\"O is set appropriately. -成功した場合、 -.BR mmap2 () -はマップされた領域へのポインタを返す。 -エラーの場合は \-1 が返されて、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EFAULT -.\"O Problem with getting the data from userspace. -ユーザ空間からデータを取得するときに問題があった。 -.TP -.B EINVAL -.\"O (Various platforms where the page size is not 4096 bytes.) -.\"O .I offset * 4096 -.\"O is not a multiple of the system page size. -(ページサイズが 4096 バイトでないプラットフォームにおいて) -.I offset * 4096 -がシステムのページサイズの倍数ではない。 -.PP -.\"O .BR mmap2 () -.\"O can return any of the same errors as -.\"O .BR mmap (2). -.BR mmap2 () -は -.BR mmap (2) -と同じエラーを返すことができる。 -.\"O .SH VERSIONS -.SH バージョン -.\"O .BR mmap2 () -.\"O is available since Linux 2.3.31. -.BR mmap2 () -は、Linux 2.3.31 以降で使用可能である。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -.\"O This system call is Linux-specific. -このシステムコールは Linux 独自である。 -.\"O .SH NOTES -.SH 注意 -.\"O Nowadays, the glibc -.\"O .BR mmap () -.\"O wrapper function invokes this system call rather than the -.\"O .BR mmap (2) -.\"O system call. -現在では、glibc の -.BR mmap () -のラッパー関数は、 -.BR mmap (2) -システムコールではなく、このシステムコール -.RB ( mmap2 (2)) -を起動する。 - -.\"O On ia64, the unit for -.\"O .I offset -.\"O is actually the system page size, rather than 4096 bytes. -ia64 では、 -.I offset -の単位は、実際にはシステムのページサイズであり、 -4096 バイトではない。 -.\" ia64 can have page sizes ranging from 4kB to 64kB. -.\" On cris, it looks like the unit might also be the page size, -.\" which is 8192 bytes. -- mtk, June 2007 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR getpagesize (2), -.BR mmap (2), -.BR mremap (2), -.BR msync (2), -.BR shm_open (3) diff --git a/draft/man2/mprotect.2 b/draft/man2/mprotect.2 index 0d91a84e..1e1e40f5 100644 --- a/draft/man2/mprotect.2 +++ b/draft/man2/mprotect.2 @@ -29,236 +29,94 @@ .\" 2007-06-02, mtk: Fairly substantial rewrites and additions, and .\" a much improved example program. .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1997-06-01, HANATAKA Shinya -.\" Updated and revised 2003-10-24, Suzuki Takashi. -.\" Updated & Modified 2005-02-08, Yuichi SATO -.\" Updated & Modified 2005-10-15, Yuichi SATO -.\" Updated 2007-06-11, Akihiro MOTOKI , LDP v2.54 +.\"******************************************************************* .\" -.\"WORD: bitwise-or ビットごとの論理和 -.\"WORD: protection アクセス保護 -.\"WORD: read-only 読み取り専用 +.\" This file was generated with po4a. Translate the source file. .\" -.TH MPROTECT 2 2011-09-08 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH MPROTECT 2 2011\-09\-08 Linux "Linux Programmer's Manual" .SH 名前 -.\"O mprotect \- set protection on a region of memory mprotect \- メモリ領域の保護を設定する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int mprotect(const void *" addr ", size_t " len ", int " prot ); +\fBint mprotect(const void *\fP\fIaddr\fP\fB, size_t \fP\fIlen\fP\fB, int \fP\fIprot\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR mprotect () -.\"O changes protection for the calling process's memory page(s) -.\"O containing any part of the address range in the -.\"O interval [\fIaddr\fP,\ \fIaddr\fP+\fIlen\fP\-1]. -.\"O .I addr -.\"O must be aligned to a page boundary. -.BR mprotect () -は、区間 [\fIaddr\fP,\ \fIaddr\fP+\fIlen\fP\-1] のアドレス範囲を含む -呼び出し元のプロセスのメモリページのアクセス保護を変更する。 -.I addr -はページ境界に一致していなければならない。 +\fBmprotect\fP() は、区間 [\fIaddr\fP,\ \fIaddr\fP+\fIlen\fP\-1] のアドレス範囲を含む +呼び出し元のプロセスのメモリページのアクセス保護を変更する。 \fIaddr\fP はページ境界に一致していなければならない。 -.\"O If the calling process tries to access memory in a manner -.\"O that violates the protection, then the kernel generates a -.\"O .B SIGSEGV -.\"O signal for the process. -呼び出し元のプロセスがアクセス保護に違反するようなメモリアクセスを -行おうとすると、カーネルはシグナル -.B SIGSEGV +呼び出し元のプロセスがアクセス保護に違反するようなメモリアクセスを 行おうとすると、カーネルはシグナル \fBSIGSEGV\fP をそのプロセスに対して生成する。 .PP -.\"O .I prot -.\"O is either -.\"O .B PROT_NONE -.\"O or a bitwise-or of the other values in the following list: -.I prot -には、 -.B PROT_NONE -か、以下のリストの -.B PROT_NONE -以外の値をビット毎の論理和 (bitwize-or) で指定する: -.TP 1.1i -.B PROT_NONE -.\"O The memory cannot be accessed at all. +\fIprot\fP には、 \fBPROT_NONE\fP か、以下のリストの \fBPROT_NONE\fP 以外の値をビット毎の論理和 (bitwize\-or) +で指定する: +.TP 1.1i +\fBPROT_NONE\fP そのメモリには全くアクセスできない。 -.TP -.B PROT_READ -.\"O The memory can be read. +.TP +\fBPROT_READ\fP そのメモリを読み取ることができる。 -.TP -.B PROT_WRITE -.\"O The memory can be modified. +.TP +\fBPROT_WRITE\fP そのメモリを変更できる。 -.TP -.B PROT_EXEC -.\"O The memory can be executed. -そのメモリは実行可能である。 +.TP +\fBPROT_EXEC\fP .\" FIXME .\" Document PROT_GROWSUP and PROT_GROWSDOWN -.\"O .SH "RETURN VALUE" +そのメモリは実行可能である。 .SH 返り値 -.\"O On success, -.\"O .BR mprotect () -.\"O returns zero. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合、 -.BR mprotect () -は 0 を返す。エラーの場合は \-1 が返り、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS +成功した場合、 \fBmprotect\fP() は 0 を返す。エラーの場合は \-1 が返り、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP -.B EACCES -.\"O The memory cannot be given the specified access. -.\"O This can happen, for example, if you -.\"O .BR mmap (2) -.\"O a file to which you have read-only access, then ask -.\"O .BR mprotect () -.\"O to mark it -.\"O .BR PROT_WRITE . -指定されたアクセスをメモリに設定することができない。 -これは、例えば -ファイルを読み取り専用で -.BR mmap (2) -しており、その領域に対して -.BR mprotect () -を呼び出して -.B PROT_WRITE -に設定しようとした場合に発生する。 -.TP -.B EINVAL -.\"O \fIaddr\fP is not a valid pointer, -.\"O or not a multiple of the system page size. -\fIaddr\fP が有効なポインタでないか、 -システムのページサイズの倍数でない。 +.TP +\fBEACCES\fP +指定されたアクセスをメモリに設定することができない。 これは、例えば ファイルを読み取り専用で \fBmmap\fP(2) しており、その領域に対して +\fBmprotect\fP() を呼び出して \fBPROT_WRITE\fP に設定しようとした場合に発生する。 +.TP +\fBEINVAL\fP .\" Or: both PROT_GROWSUP and PROT_GROWSDOWN were specified in 'prot'. -.TP -.B ENOMEM -.\"O Internal kernel structures could not be allocated. +\fIaddr\fP が有効なポインタでないか、 システムのページサイズの倍数でない。 +.TP +\fBENOMEM\fP カーネル内部の構造体を割り当てることができなかった。 -.TP -.B ENOMEM -.\"O Addresses in the range -.\"O .RI [ addr , -.\"O .IR addr + len \-1] -.\"O are invalid for the address space of the process, -.\"O or specify one or more pages that are not mapped. -.\"O (Before kernel 2.4.19, the error -.\"O .BR EFAULT -.\"O was incorrectly produced for these cases.) -.RI [ addr , -.IR addr + len \-1] -という範囲のアドレスがプロセスのアドレス空間として不正であるか、 -その範囲のアドレスがマップされていない 1 つ以上のページを指している -(カーネル 2.4.19 より前では、この状況でエラー -.B EFAULT +.TP +\fBENOMEM\fP +[\fIaddr\fP, \fIaddr\fP+\fIlen\fP\-1] という範囲のアドレスがプロセスのアドレス空間として不正であるか、 +その範囲のアドレスがマップされていない 1 つ以上のページを指している (カーネル 2.4.19 より前では、この状況でエラー \fBEFAULT\fP が間違って生成されていた)。 -.\"O .SH "CONFORMING TO" .SH 準拠 -SVr4, POSIX.1-2001. -.\"O .\" SVr4 defines an additional error -.\"O .\" code EAGAIN. The SVr4 error conditions don't map neatly onto Linux's. -.\"O POSIX says that the behavior of -.\"O .BR mprotect () -.\"O is unspecified if it is applied to a region of memory that -.\"O was not obtained via -.\"O .BR mmap (2). -.\" SVr4 では他にエラーコード EAGAIN が定義されている。 -.\" SVr4 のエラー条件は Linux のものにきちんと対応しない。 -POSIX では、 -.BR mmap (2) -経由で獲得していないメモリ領域に対して -.BR mprotect () -を行った場合の -.BR mprotect () -の動作は未定義であるとされている。 -.\"O .SH NOTES +.\" SVr4 defines an additional error +.\" code EAGAIN. The SVr4 error conditions don't map neatly onto Linux's. +SVr4, POSIX.1\-2001. POSIX では、 \fBmmap\fP(2) 経由で獲得していないメモリ領域に対して \fBmprotect\fP() +を行った場合の \fBmprotect\fP() の動作は未定義であるとされている。 .SH 注意 -.\"O On Linux it is always permissible to call -.\"O .BR mprotect () -.\"O on any address in a process's address space (except for the -.\"O kernel vsyscall area). -.\"O In particular it can be used -.\"O to change existing code mappings to be writable. -Linux では、(カーネル vsyscall 領域以外の) -任意のプロセスアドレス空間に対して -.BR mprotect () -を呼び出すことが、常に許されている。 -これは特に既存のコードマッピングを書き込み可能にするために使われる。 +Linux では、(カーネル vsyscall 領域以外の) 任意のプロセスアドレス空間に対して \fBmprotect\fP() +を呼び出すことが、常に許されている。 これは特に既存のコードマッピングを書き込み可能にするために使われる。 -.\"O Whether -.\"O .B PROT_EXEC -.\"O has any effect different from -.\"O .B PROT_READ -.\"O is architecture- and kernel version-dependent. -.\"O On some hardware architectures (e.g., i386), -.\"O .B PROT_WRITE -.\"O implies -.\"O .BR PROT_READ . -.B PROT_EXEC -が -.B PROT_READ -と異なる影響を持つか否かは、アーキテクチャとカーネルのバージョンに依存する。 -(i386 などの) いくつかのアーキテクチャでは、 -.B PROT_WRITE -をセットすると、暗黙のうちに -.B PROT_READ -がセットされる。 +\fBPROT_EXEC\fP が \fBPROT_READ\fP と異なる影響を持つか否かは、アーキテクチャとカーネルのバージョンに依存する。 (i386 +などの) いくつかのアーキテクチャでは、 \fBPROT_WRITE\fP をセットすると、暗黙のうちに \fBPROT_READ\fP がセットされる。 -.\"O POSIX.1-2001 says that an implementation may permit access -.\"O other than that specified in -.\"O .IR prot , -.\"O but at a minimum can only allow write access if -.\"O .B PROT_WRITE -.\"O has been set, and must not allow any access if -.\"O .B PROT_NONE -.\"O has been set. -POSIX.1-2001 では、 -.I prot -で指定されていないアクセスを許可する実装を認めている。 -ただし、最低限、 -.B PROT_WRITE -がセットされている場合にのみ書き込みアクセスが許可され、 -.B PROT_NONE -がセットされている場合にはアクセスは許可されない点だけは +POSIX.1\-2001 では、 \fIprot\fP で指定されていないアクセスを許可する実装を認めている。 ただし、最低限、 \fBPROT_WRITE\fP +がセットされている場合にのみ書き込みアクセスが許可され、 \fBPROT_NONE\fP がセットされている場合にはアクセスは許可されない点だけは 満たす必要がある。 -.\"O .SH EXAMPLE .SH 例 .\" sigaction.2 refers to this example .PP -.\"O The program below allocates four pages of memory, makes the third -.\"O of these pages read-only, and then executes a loop that walks upward -.\"O through the allocated region modifying bytes. -以下のプログラムは、メモリページを 4つ確保し、そのうち 3番目のページを -読み込み専用に設定する。その後で、確保した領域のアドレスの小さい方から +以下のプログラムは、メモリページを 4つ確保し、そのうち 3番目のページを 読み込み専用に設定する。その後で、確保した領域のアドレスの小さい方から 大きな方に向かって順番にバイト値を変更するループを実行する。 -.\"O An example of what we might see when running the program is the -.\"O following: プログラムを実行した場合の一例を以下に示す。 .in +4n .nf -.RB "$" " ./a.out" +$\fB ./a.out\fP Start of region: 0x804c000 Got SIGSEGV at address: 0x804e000 .fi -.\"O .SS Program source +.in .SS プログラムのソース \& -.in .nf #include #include @@ -268,7 +126,7 @@ Got SIGSEGV at address: 0x804e000 #include #include -#define handle_error(msg) \\ +#define handle_error(msg) \e do { perror(msg); exit(EXIT_FAILURE); } while (0) char *buffer; @@ -276,7 +134,7 @@ char *buffer; static void handler(int sig, siginfo_t *si, void *unused) { - printf("Got SIGSEGV at address: 0x%lx\\n", + printf("Got SIGSEGV at address: 0x%lx\en", (long) si\->si_addr); exit(EXIT_FAILURE); } @@ -305,7 +163,7 @@ main(void) if (buffer == NULL) handle_error("memalign"); - printf("Start of region: 0x%lx\\n", (long) buffer); + printf("Start of region: 0x%lx\en", (long) buffer); if (mprotect(buffer + pagesize * 2, pagesize, PROT_READ) == \-1) @@ -314,11 +172,9 @@ main(void) for (p = buffer ; ; ) *(p++) = \(aqa\(aq; - printf("Loop completed\\n"); /* Should never happen */ + printf("Loop completed\en"); /* Should never happen */ exit(EXIT_SUCCESS); } .fi -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR mmap (2), -.BR sysconf (3) +\fBmmap\fP(2), \fBsysconf\fP(3) diff --git a/draft/man2/mremap.2 b/draft/man2/mremap.2 deleted file mode 100644 index 2bd1282a..00000000 --- a/draft/man2/mremap.2 +++ /dev/null @@ -1,380 +0,0 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" Copyright (c) 1996 Tom Bjorkholm -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" - -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; without even the implied warranty of -.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -.\" GNU General Public License for more details. -.\" -.\" You should have received a copy of the GNU General Public -.\" License along with this manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.\" -.\" 1996-04-11 Tom Bjorkholm -.\" First version written (1.3.86) -.\" 1996-04-12 Tom Bjorkholm -.\" Update for Linux 1.3.87 and later -.\" 2005-10-11 mtk: Added NOTES for MREMAP_FIXED; revised EINVAL text. -.\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1997-02-23, HANATAKA Shinya -.\" Updated 2002-11-26, Kentaro Shirakata -.\" Updated 2005-10-09, Kentaro Shirakata -.\" Updated 2006-04-16, Akihiro MOTOKI , LDP v2.28 -.\" -.\"WORD: virtual memory 仮想メモリ -.\"WORD: remap 再マッピング -.\"WORD: argument 引き数 -.\"WORD: address space アドレス空間 -.\"WORD: page align ページ境界 -.\"WORD: linear リニア -.\"WORD: process プロセス -.\"WORD: segment セグメント -.\"WORD: real memory 実メモリ -.\"WORD: segmentation violation セグメンテーション侵害 -.\"WORD: segmentation fault セグメンテーション違反 -.\"WORD: scheme 方式 -.\"WORD: implement 実装 -.\"WORD: lock ロック -.\" -.TH MREMAP 2 2010-06-10 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O mremap \- remap a virtual memory address -.SH 名前 -mremap \- 仮想メモリ・アドレスを再マッピングする -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" -.br -.B #include -.sp -.BI "void *mremap(void *" old_address ", size_t " old_size , -.BI " size_t " new_size ", int " flags ", ... /* void *" new_address " */);" -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O .BR mremap () -.\"O expands (or shrinks) an existing memory mapping, potentially -.\"O moving it at the same time (controlled by the \fIflags\fP argument and -.\"O the available virtual address space). -.BR mremap () -は既存のメモリ・マッピングの拡張 (または縮小) を行う。 -同時に移動されることもある -(\fIflags\fP 引き数と利用可能な仮想アドレス空間によって決まる)。 - -.\"O \fIold_address\fP is the old address of the virtual memory block that you -.\"O want to expand (or shrink). -.\"O Note that \fIold_address\fP has to be page -.\"O aligned. -.\"O \fIold_size\fP is the old size of the -.\"O virtual memory block. -.\"O \fInew_size\fP is the requested size of the -.\"O virtual memory block after the resize. -\fIold_address\fP は拡張 (または縮小) しようとする仮想メモリ・ブロック -の元のアドレスである。\fIold_address\fP はページ境界に合っていなければ -ならない点に注意すること。\fIold_size\fP は元の仮想メモリ・ブロックの -サイズである。 -\fInew_size\fP は要求する変更後の仮想メモリ・ブロックのサイズである。 -.\"O An optional fifth argument, -.\"O .IR new_address , -.\"O may be provided; see the description of -.\"O .B MREMAP_FIXED -.\"O below. -5 番目の引き数として -.I new_address -を指定することができる。下記の -.B MREMAP_FIXED -の説明を参照のこと。 - -.\"O In Linux the memory is divided into pages. -.\"O A user process has (one or) -.\"O several linear virtual memory segments. -.\"O Each virtual memory segment has one -.\"O or more mappings to real memory pages (in the page table). -.\"O Each virtual memory segment has its own -.\"O protection (access rights), which may cause -.\"O a segmentation violation if the memory is accessed incorrectly (e.g., -.\"O writing to a read-only segment). -.\"O Accessing virtual memory outside of the -.\"O segments will also cause a segmentation violation. -Linux ではメモリはページに分割される。ユーザー・プロセスは (一つまたは) -複数のリニアな仮想メモリセグメントを持つ。 -それぞれの仮想メモリセグメントは一つ以上の実メモリ・ページ -にマッピングされている (マッピング情報はページ・テーブルで管理される)。 -仮想メモリセグメントにはセグメント毎の保護 (アクセス権) が設定されており、 -メモリが不正にアクセスされた場合 (例えば読み込み専用のセグメントに -書き込んだ場合)、セグメンテーション侵害 (segmentation violation) を -引き起こす。また、セグメント外の仮想メモリにアクセスした場合にも -セグメンテーション侵害が発生する。 - -.\"O .BR mremap () -.\"O uses the Linux page table scheme. -.\"O .BR mremap () -.\"O changes the -.\"O mapping between virtual addresses and memory pages. -.\"O This can be used to implement a very efficient -.\"O .BR realloc (3). -.BR mremap () -は Linux のページ・テーブル方式を使用する。 -.BR mremap () -は仮想アドレスとメモリ・ページのマッピングを変更する。これは非常に効率的な -.BR realloc (3) -を実装するのに使用されている。 - -.\"O The \fIflags\fP bit-mask argument may be 0, or include the following flag: -\fIflags\fP ビットマスク引数は 0 または以下のフラグを含む: -.TP -.B MREMAP_MAYMOVE -.\"O By default, if there is not sufficient space to expand a mapping -.\"O at its current location, then -.\"O .BR mremap () -.\"O fails. -デフォルトでは、現在の位置にマッピングを拡張するための -十分な空きがなければ -.BR mremap () -は失敗する。 -.\"O If this flag is specified, then the kernel is permitted to -.\"O relocate the mapping to a new virtual address, if necessary. -このフラグが指定されると、カーネルは必要があればマッピングを -新しい仮想アドレスに再配置することができる -.\"O If the mapping is relocated, -.\"O then absolute pointers into the old mapping location -.\"O become invalid (offsets relative to the starting address of -.\"O the mapping should be employed). -マッピングが再配置されると、古いマッピング位置への絶対ポインタは -無効になる (マッピングの開始アドレスからの相対オフセットは有効のままである)。 -.TP -.\"O .BR MREMAP_FIXED " (since Linux 2.3.31)" -.BR MREMAP_FIXED " (Linux 2.3.31 以降)" -.\"O This flag serves a similar purpose to the -.\"O .B MAP_FIXED -.\"O flag of -.\"O .BR mmap (2). -このフラグは -.BR mmap (2) -の -.B MAP_FIXED -フラグと似たような目的で用いられる。 -.\"O If this flag is specified, then -.\"O .BR mremap () -.\"O accepts a fifth argument, -.\"O .IR "void *new_address" , -.\"O which specifies a page-aligned address to which the mapping must -.\"O be moved. -このフラグが指定されると、 -.BR mremap () -は 5 番目の引き数 -.I "void *new_address" -を受け取り、この引数はマッピングが移動されるべきアドレスを指定する。 -このアドレスはページ境界に合っていなければならない。 -.\"O Any previous mapping at the address range specified by -.\"O .I new_address -.\"O and -.\"O .I new_size -.\"O is unmapped. -.I new_address -と -.I new_size -で指定されるアドレス範囲に過去のマッピングがあった場合、 -そのマッピングはアンマップされる (unmapped)。 -.\"O If -.\"O .B MREMAP_FIXED -.\"O is specified, then -.\"O .B MREMAP_MAYMOVE -.\"O must also be specified. -.B MREMAP_FIXED -を指定した場合は、 -.B MREMAP_MAYMOVE -も指定しなければならない。 -.PP -.\"O If the memory segment specified by -.\"O .I old_address -.\"O and -.\"O .I old_size -.\"O is locked (using -.\"O .BR mlock (2) -.\"O or similar), then this lock is maintained when the segment is -.\"O resized and/or relocated. -.\"O As a consequence, the amount of memory locked by the process may change. -.I old_address -と -.I old_size -で指定されるメモリセグメントが -.RB ( mlock (2) -や同様のもので) ロックされている場合、セグメントのサイズが変わったり -再配置されたりした時にロックも維持される。 -その結果、プロセスによってロックされるメモリの量は変化する。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On On success -.\"O .BR mremap () -.\"O returns a pointer to the new virtual memory area. -.\"O On error, the value -.\"O .B MAP_FAILED -.\"O (that is, \fI(void\ *)\ \-1\fP) is returned, -.\"O and \fIerrno\fP is set appropriately. -成功した場合は -.BR mremap () -は新しい仮想メモリ領域へのポインタを返す。 -エラーの場合は -.B MAP_FAILED -(すなわち \fI(void\ *)\ \-1\fP) が返され、 -\fIerrno\fP が適切に設定される。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EAGAIN -.\"O The caller tried to expand a memory segment that is locked, -.\"O but this was not possible without exceeding the -.\"O .B RLIMIT_MEMLOCK -.\"O resource limit. -呼び出し元がロックされているメモリセグメントを拡張しようとしたが、 -.B RLIMIT_MEMLOCK -リソース制限を越えずにこれを行うことができない。 -.TP -.B EFAULT -.\"O "Segmentation fault." Some address in the range -.\"O \fIold_address\fP to \fIold_address\fP+\fIold_size\fP is an invalid -.\"O virtual memory address for this process. -.\"O You can also get -.\"O .B EFAULT -.\"O even if there exist mappings that cover the -.\"O whole address space requested, but those mappings are of different types. -「セグメンテーション違反(segmentation fault)」 -\fIold_address\fP から \fIold_address\fP+\fIold_size\fP の -範囲のアドレスのどれかがこのプロセスにおいて不正な仮想メモリ・アドレスである。 -たとえ要求したアドレス空間全体を含むようなマッピングがあったとしても、 -それらのマッピングが異なった型ならば -.B EFAULT -を受け取るだろう。 -.TP -.B EINVAL -.\"O An invalid argument was given. -不正な引き数が与えられた。 -.\"O Possible causes are: \fIold_address\fP was not -.\"O page aligned; a value other than -.\"O .B MREMAP_MAYMOVE -.\"O or -.\"O .B MREMAP_FIXED -.\"O was specified in -.\"O .IR flags ; -.\"O .I new_size -.\"O was zero; -.\"O .I new_size -.\"O or -.\"O .I new_address -.\"O was invalid; -.\"O or the new address range specified by -.\"O .I new_address -.\"O and -.\"O .I new_size -.\"O overlapped the old address range specified by -.\"O .I old_address -.\"O and -.\"O .IR old_size ; -.\"O or -.\"O .B MREMAP_FIXED -.\"O was specified without also specifying -.\"O .BR MREMAP_MAYMOVE . -可能性のある原因は以下の通りである: -たいていは \fIold_address\fP がページ境界に -合ってない; -.I flags -に -.B MREMAP_MAYMOVE -または -.B MREMAP_FIXED -以外の値が指定されている; -.I new_size -がゼロ; -.I new_size -または -.I new_address -の値が不正; -.I new_address -と -.I new_size -で指定される新しいアドレス範囲が -.I old_address -と -.I old_size -で指定される古いアドレス範囲と重なっている; -.B MREMAP_FIXED -が指定されているが -.B MREMAP_MAYMOVE -が指定されていない。 -.TP -.B ENOMEM -.\"O The memory area cannot be expanded at the current virtual address, and the -.\"O .B MREMAP_MAYMOVE -.\"O flag is not set in \fIflags\fP. -.\"O Or, there is not enough (virtual) memory available. -現在の仮想アドレスではメモリ領域が拡張できず、 -.B MREMAP_MAYMOVE -フラグが \fIflags\fP に設定されていない。 -または十分な (仮想) メモリが存在しない。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -.\"O This call is Linux-specific, and should not be used in programs -.\"O intended to be portable. -.\"O .\" 4.2BSD had a (never actually implemented) -.\"O .\" .BR mremap (2) -.\"O .\" call with completely different semantics. -このコールは Linux 特有であり、移植を意図したプログラムで -使用すべきではない。 -.\" 4.2BSD には (実際に実装されていたわけではないが) -.\" 全く異った方式 (semantics) による -.\" .BR mremap (2) -.\" コールがあった。 -.\" FIXME perhaps remove above statement about 4.2BSD. -.\"O .SH NOTES -.SH 注意 -.\"O Prior to version 2.4, glibc did not expose the definition of -.\"O .BR MREMAP_FIXED , -.\"O and the prototype for -.\"O .BR mremap () -.\"O did not allow for the -.\"O .I new_address -.\"O argument. -バージョン 2.4 より前の glibc では、 -.B MREMAP_FIXED -の定義は公開されておらず、 -.BR mremap () -のプロトタイプは -.I new_address -引き数を取らなかった。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR brk (2), -.BR getpagesize (2), -.BR getrlimit (2), -.BR mlock (2), -.BR mmap (2), -.BR sbrk (2), -.BR realloc (3), -.BR malloc (3) -.P -.\"O Your favorite OS text book for more information on paged memory. -.\"O (\fIModern Operating Systems\fP by Andrew S. Tannenbaum, -.\"O \fIInside Linux\fP by Randolf Bentson, -.\"O \fIThe Design of the UNIX Operating System\fP by Maurice J. Bach.) -ページ分割されたメモリについてもっと詳しく知りたいならば -あなたの好みの OS の教科書を参照すること。 -(\fIModern Operating Systems\fP by Andrew S. Tannenbaum, -\fIInside Linux\fP by Randolf Bentson, -\fIThe Design of the UNIX Operating System\fP by Maurice J. Bach.) diff --git a/draft/man2/msync.2 b/draft/man2/msync.2 index 95291fa0..0b8079e9 100644 --- a/draft/man2/msync.2 +++ b/draft/man2/msync.2 @@ -22,189 +22,55 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Sun Feb 23 19:45:43 JST 1997 -.\" by HANATAKA Shinya -.\" Updated and revised Fri Oct 24 23:34:51 JST 2003 -.\" by Suzuki Takashi. -.\" Updated 2007-01-01 by Kentaro Shirakata +.\"******************************************************************* .\" -.\"WORD: in-core メモリ上の +.\" This file was generated with po4a. Translate the source file. .\" -.TH MSYNC 2 2008-04-22 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH MSYNC 2 2008\-04\-22 Linux "Linux Programmer's Manual" .SH 名前 -.\"O msync \- synchronize a file with a memory map msync \- ファイルをマップしたメモリと同期させる -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int msync(void *" addr ", size_t " length ", int " flags ); -.\"O .SH DESCRIPTION +\fBint msync(void *\fP\fIaddr\fP\fB, size_t \fP\fIlength\fP\fB, int \fP\fIflags\fP\fB);\fP .SH 説明 -.\"O .BR msync () -.\"O flushes changes made to the in-core copy of a file that was mapped -.\"O into memory using -.\"O .BR mmap (2) -.\"O back to disk. -.\"O Without use of this call -.\"O there is no guarantee that changes are written back before -.\"O .BR munmap (2) -.\"O is called. -.\"O To be more precise, the part of the file that -.\"O corresponds to the memory area starting at -.\"O .I addr -.\"O and having length -.\"O .I length -.\"O is updated. -.BR msync () -は -.BR mmap (2) -を使ってメモリにマップされたファイルの、 -メモリ上のコピーになされた変更をディスクに反映させる。 -この関数を使用しないと、 -.BR munmap (2) -が呼び出されるまで変更が書き戻される保証はない。 -より正確には、ファイルのうち -.I addr -から始まり長さ -.I length -のメモリ領域に対応する部分が更新される。 +\fBmsync\fP() は \fBmmap\fP(2) を使ってメモリにマップされたファイルの、 メモリ上のコピーになされた変更をディスクに反映させる。 +この関数を使用しないと、 \fBmunmap\fP(2) が呼び出されるまで変更が書き戻される保証はない。 より正確には、ファイルのうち \fIaddr\fP +から始まり長さ \fIlength\fP のメモリ領域に対応する部分が更新される。 -.\"O The -.\"O .I flags -.\"O argument may have the bits -.\"O .BR MS_ASYNC , -.\"O .BR MS_SYNC , -.\"O and -.\"O .B MS_INVALIDATE -.\"O set, but not both -.\"O .B MS_ASYNC -.\"O and -.\"O .BR MS_SYNC . -.I flags -引数にはビット -.BR MS_ASYNC , -.BR MS_SYNC , -.B MS_INVALIDATE -を設定することができるが、 -.B MS_ASYNC -と -.B MS_SYNC -を同時に指定することはできない。 -.\"O .B MS_ASYNC -.\"O specifies that an update be scheduled, but the call -.\"O returns immediately. -.B MS_ASYNC -は更新を予定に組み込むことを表し、呼び出しは直ちに返る。 -.\"O .B MS_SYNC -.\"O asks for an update and waits for it to complete. -.B MS_SYNC -は更新を要求し、更新が完了するまで待つ。 -.\"O .B MS_INVALIDATE -.\"O asks to invalidate other mappings of the same file -.\"O (so that they can be updated with the fresh values just written). -.B MS_INVALIDATE -は(たった今書き込んだ新しい値でマッピングを更新することができるように) +\fIflags\fP 引数にはビット \fBMS_ASYNC\fP, \fBMS_SYNC\fP, \fBMS_INVALIDATE\fP を設定することができるが、 +\fBMS_ASYNC\fP と \fBMS_SYNC\fP を同時に指定することはできない。 \fBMS_ASYNC\fP +は更新を予定に組み込むことを表し、呼び出しは直ちに返る。 \fBMS_SYNC\fP は更新を要求し、更新が完了するまで待つ。 +\fBMS_INVALIDATE\fP は(たった今書き込んだ新しい値でマッピングを更新することができるように) 同じファイルに対する他のマッピングを無効にすることを要求する。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O On success, zero is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合、 0 が返る。エラーの場合、 \-1 が返り、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS +成功した場合、 0 が返る。エラーの場合、 \-1 が返り、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP -.B EBUSY -.\"O .B MS_INVALIDATE -.\"O was specified in -.\"O .IR flags , -.\"O and a memory lock exists for the specified address range. -I flags -に -.B MS_INVALIDATE -が指定されたが、指定されたアドレス範囲にロックが存在する。 -.TP -.B EINVAL -.\"O .I addr -.\"O is not a multiple of PAGESIZE; or any bit other than -.\"O .BR MS_ASYNC " | " MS_INVALIDATE " | " MS_SYNC -.\"O is set in -.\"O .IR flags ; -.\"O or both -.\"O .B MS_SYNC -.\"O and -.\"O .B MS_ASYNC -.\"O are set in -.\"O .IR flags . -.I addr -が PAGESIZE の倍数でない。または、 -.I flags -に -.BR MS_ASYNC 、 MS_INVALIDATE 、 MS_SYNC -以外のビットが設定された。 -または、 -.I flags -に -.B MS_SYNC -と -.B MS_ASYNC -の両方が設定された。 -.TP -.B ENOMEM -.\"O The indicated memory (or part of it) was not mapped. +.TP +\fBEBUSY\fP +I flags に \fBMS_INVALIDATE\fP が指定されたが、指定されたアドレス範囲にロックが存在する。 +.TP +\fBEINVAL\fP +\fIaddr\fP が PAGESIZE の倍数でない。または、 \fIflags\fP に +\fBMS_ASYNC\fP、\fBMS_INVALIDATE\fP、\fBMS_SYNC\fP 以外のビットが設定された。 または、 \fIflags\fP に +\fBMS_SYNC\fP と \fBMS_ASYNC\fP の両方が設定された。 +.TP +\fBENOMEM\fP 指定されたメモリ (またはその一部) がマップされていない。 -.\"O .SH "CONFORMING TO" .SH 準拠 -POSIX.1-2001. +POSIX.1\-2001. -.\"O This call was introduced in Linux 1.3.21, and then used -.\"O .B EFAULT -.\"O instead of -.\"O .BR ENOMEM . -.\"O In Linux 2.4.19 this was changed to the POSIX value -.\"O .BR ENOMEM . -この関数は Linux 1.3.21 で導入されたが、 -.B ENOMEM -ではなく -.B EFAULT -が使われていた。 -これは Linux 2.4.19 で POSIX における値 -.B ENOMEM -に変更された。 -.\"O .SH AVAILABILITY +この関数は Linux 1.3.21 で導入されたが、 \fBENOMEM\fP ではなく \fBEFAULT\fP が使われていた。 これは Linux +2.4.19 で POSIX における値 \fBENOMEM\fP に変更された。 .SH 可用性 -.\"O On POSIX systems on which -.\"O .BR msync () -.\"O is available, both -.\"O .B _POSIX_MAPPED_FILES -.\"O and -.\"O .B _POSIX_SYNCHRONIZED_IO -.\"O are defined in \fI\fP to a value greater than 0. -.\"O (See also -.\"O .BR sysconf (3).) -.BR msync () -が使用可能な POSIX システムでは -.B _POSIX_MAPPED_FILES -と -.B _POSIX_SYNCHRONIZED_IO -の両方が \fI\fP で 0 より大きい値に定義される。 -.RB ( sysconf (3) -を参照すること。 ) -.\"O .\" POSIX.1-2001: It shall be defined to -1 or 0 or 200112L. -.\"O .\" -1: unavailable, 0: ask using sysconf(). -.\"O .\" glibc defines them to 1. -.\" POSIX.1-2001: これらの値は -1 または 0 または 200112L と定義される。 -.\" -1 は使用不可能、 0 は sysconf() に問い合わせる -.\" glibc では 1 と定義している。 -.\"O .SH "SEE ALSO" +.\" POSIX.1-2001: It shall be defined to -1 or 0 or 200112L. +.\" -1: unavailable, 0: ask using sysconf(). +.\" glibc defines them to 1. +\fBmsync\fP() が使用可能な POSIX システムでは \fB_POSIX_MAPPED_FILES\fP と +\fB_POSIX_SYNCHRONIZED_IO\fP の両方が \fI\fP で 0 より大きい値に定義される。 +(\fBsysconf\fP(3) を参照すること。 ) .SH 関連項目 -.BR mmap (2) +\fBmmap\fP(2) .br -B.O. Gallmeister, POSIX.4, O'Reilly, pp. 128-129 and 389-391. +B.O. Gallmeister, POSIX.4, O'Reilly, pp. 128\-129 and 389\-391. diff --git a/draft/man2/nanosleep.2 b/draft/man2/nanosleep.2 index e91e5837..6936e085 100644 --- a/draft/man2/nanosleep.2 +++ b/draft/man2/nanosleep.2 @@ -32,344 +32,96 @@ .\" NOTES: describe case where clock_nanosleep() can be preferable. .\" NOTES: describe CLOCK_REALTIME versus CLOCK_NANOSLEEP .\" Replace crufty discussion of HZ with a pointer to time(7). +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1997-02-23, HANATAKA Shinya -.\" Updated 1999-02-27, HANATAKA Shinya -.\" Updated 2003-09-15, Akihiro MOTOKI -.\" Updated 2005-02-10, Akihiro MOTOKI -.\" Updated 2006-07-23, Akihiro MOTOKI, LDP v2.36 -.\" Updated 2006-08-13, Akihiro MOTOKI, LDP v2.39 -.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 +.\" This file was generated with po4a. Translate the source file. .\" -.\"WORD: puase 停止 -.\"WORD: sleep 停止 -.\"WORD: signal シグナル -.\"WORD: NULL NULL -.\"WORD: block 禁止(block) -.\"WORD: kernel カーネル -.\"WORD: real-time リアル・タイム -.\"WORD: schedule スケジュール -.\"WORD: busy wait ビシー・ウェイト -.\" -.TH NANOSLEEP 2 2009-01-19 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH NANOSLEEP 2 2009\-01\-19 Linux "Linux Programmer's Manual" .SH 名前 -.\"O nanosleep \- high-resolution sleep nanosleep \- 高精度なスリープ -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int nanosleep(const struct timespec *" req ", struct timespec *" rem ); +\fBint nanosleep(const struct timespec *\fP\fIreq\fP\fB, struct timespec +*\fP\fIrem\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR nanosleep (): -_POSIX_C_SOURCE\ >=\ 199309L -.\"O .SH DESCRIPTION +\fBnanosleep\fP(): _POSIX_C_SOURCE\ >=\ 199309L .SH 説明 -.\"O .BR nanosleep () -.\"O suspends the execution of the calling thread -.\"O until either at least the time specified in -.\"O .IR *req -.\"O has elapsed, or the delivery of a signal -.\"O that triggers the invocation of a handler in the calling thread or -.\"O that terminates the process. -.BR nanosleep () -は、少なくとも -.I *req -で指定された時間の間、プログラムの実行を遅延させる。 -.BR nanosleep () -は、呼び出したスレッドの実行を、 -少なくとも -.I *req -で指定された時間の間、もしくは呼び出したスレッドでハンドラの起動の -きっかけとなるシグナル、またはプロセスを終了させるシグナルの配送が -行われるまで一時停止する。 +\fBnanosleep\fP() は、少なくとも \fI*req\fP で指定された時間の間、プログラムの実行を遅延させる。 \fBnanosleep\fP() +は、呼び出したスレッドの実行を、 少なくとも \fI*req\fP で指定された時間の間、もしくは呼び出したスレッドでハンドラの起動の +きっかけとなるシグナル、またはプロセスを終了させるシグナルの配送が 行われるまで一時停止する。 -.\"O If the call is interrupted by a signal handler, -.\"O .BR nanosleep () -.\"O returns \-1, sets \fIerrno\fP to -.\"O .BR EINTR , -.\"O and writes the remaining time into the structure pointed to by -.\"O .I rem -.\"O unless -.\"O .I rem -.\"O is NULL. -呼び出しがシグナルハンドラにより割り込まれた場合、 -.BR nanosleep -は \-1 を返し、 -.I errno -に -.B EINTR -を設定し、 -.I rem -が NULL でなければ -残りの時間を -.I rem -が指す構造体に格納する。 -.\"O The value of -.\"O .I *rem -.\"O can then be used to call -.\"O .BR nanosleep () -.\"O again and complete the specified pause (but see NOTES). -.I *rem -の値を使うと、 -.BR nanosleep () -をもう一度呼び出して、指定した時間の停止を -完了させることができる (但し、「注意」の節を参照のこと)。 +呼び出しがシグナルハンドラにより割り込まれた場合、 \fBnanosleep\fP は \-1 を返し、 \fIerrno\fP に \fBEINTR\fP を設定し、 +\fIrem\fP が NULL でなければ 残りの時間を \fIrem\fP が指す構造体に格納する。 \fI*rem\fP の値を使うと、 +\fBnanosleep\fP() をもう一度呼び出して、指定した時間の停止を 完了させることができる (但し、「注意」の節を参照のこと)。 -.\"O The structure -.\"O .I timespec -.\"O is used to specify intervals of time with nanosecond precision. -.\"O It is defined as follows: -ナノ秒刻みの時間間隔を指定するのに -.I timespec -構造体が使用される。この構造体は次のように定義されている。 +ナノ秒刻みの時間間隔を指定するのに \fItimespec\fP 構造体が使用される。この構造体は次のように定義されている。 .sp .in +4n .nf -.\"O struct timespec { -.\"O time_t tv_sec; /* seconds */ -.\"O long tv_nsec; /* nanoseconds */ time_t tv_sec; /* 秒 */ long tv_nsec; /* ナノ秒 */ }; .fi .in .PP -.\"O The value of the nanoseconds field must be in the range 0 to 999999999. ナノ秒のフィールドの値は 0 から 999999999 の範囲になければならない。 -.\"O Compared to -.\"O .BR sleep (3) -.\"O and -.\"O .BR usleep (3), -.\"O .BR nanosleep () -.\"O has the following advantages: -.\"O it provides a higher resolution for specifying the sleep interval; -.\"O POSIX.1 explicitly specifies that it -.\"O does not interact with signals; -.\"O and it makes the task of resuming a sleep that has been -.\"O interrupted by a signal handler easier. -.BR sleep (3) -や -.BR usleep (3) -に比べると -.BR nanosleep () -には以下のような利点がある: -停止期間の指定に関して高い時間分解能が提供されている。 -シグナルと互いに影響を及ぼすことがないと -POSIX.1 で明示的に規定されている。 -シグナルハンドラによって割り込まれた際に、停止を再開するのが -より簡単にできる。 -.\"O .SH "RETURN VALUE" +\fBsleep\fP(3) や \fBusleep\fP(3) に比べると \fBnanosleep\fP() には以下のような利点がある: +停止期間の指定に関して高い時間分解能が提供されている。 シグナルと互いに影響を及ぼすことがないと POSIX.1 で明示的に規定されている。 +シグナルハンドラによって割り込まれた際に、停止を再開するのが より簡単にできる。 .SH 返り値 -.\"O On successfully sleeping for the requested interval, -.\"O .BR nanosleep () -.\"O returns 0. -.\"O If the call is interrupted by a signal handler or encounters an error, -.\"O then it returns \-1, with -.\"O .I errno -.\"O set to indicate the error. -要求された期間の停止に成功した場合、 -.BR nanosleep () -は 0 を返す。呼び出しがシグナルハンドラにより割り込まれたり、 -エラーが発生した場合は、\-1 を返し、 -.I errno -にエラー内容を示す値を設定する。 -.\"O .SH ERRORS +要求された期間の停止に成功した場合、 \fBnanosleep\fP() は 0 を返す。呼び出しがシグナルハンドラにより割り込まれたり、 +エラーが発生した場合は、\-1 を返し、 \fIerrno\fP にエラー内容を示す値を設定する。 .SH エラー -.TP -.B EFAULT -.\"O Problem with copying information from user space. +.TP +\fBEFAULT\fP ユーザ空間からの情報のコピーで問題があった。 -.TP -.B EINTR -.\"O The pause has been interrupted by a signal that was -.\"O delivered to the thread. -.\"O The remaining sleep time has been written -.\"O into \fI*rem\fP so that the thread can easily call -.\"O .BR nanosleep () -.\"O again and continue with the pause. -そのスレッドに配送されたシグナルにより停止が中断された。 -スレッドが簡単に -.BR nanosleep () -を再び呼び出して停止を続けることができるように、 -残りの停止時間が \fI*rem\fP に格納される。 -.TP -.B EINVAL -.\"O The value in the -.\"O .I tv_nsec -.\"O field was not in the range 0 to 999999999 or -.\"O .I tv_sec -.\"O was negative. -.I tv_nsec -フィールドの値が 0 から 999999999 までの範囲になかったか、 -.I tv_sec -が負であった。 -.\"O .SH "CONFORMING TO" +.TP +\fBEINTR\fP +そのスレッドに配送されたシグナルにより停止が中断された。 スレッドが簡単に \fBnanosleep\fP() +を再び呼び出して停止を続けることができるように、 残りの停止時間が \fI*rem\fP に格納される。 +.TP +\fBEINVAL\fP +\fItv_nsec\fP フィールドの値が 0 から 999999999 の範囲でないか、 \fItv_sec\fP の値が負であった。 .SH 準拠 -POSIX.1-2001. -.\"O .SH NOTES +POSIX.1\-2001. .SH 注意 -.\"O If the interval specified in -.\"O .I req -.\"O is not an exact multiple of the granularity underlying clock (see -.\"O .BR time (7)), -.\"O then the interval will be rounded up to the next multiple. -.\"O Furthermore, after the sleep completes, there may still be a delay before -.\"O the CPU becomes free to once again execute the calling thread. -.I req -で指定された期間が、内部で使用されるクロックの粒度の倍数になっていない -場合、期間は一番近い倍数に切り上げられる。 -また、停止が完了した後、CPU が呼び出し元のスレッドを再び実行できるように -なるまでには遅延が入る。 +\fIreq\fP で指定された期間が、内部で使用されるクロックの粒度の倍数になっていない 場合、期間は一番近い倍数に切り上げられる。 +また、停止が完了した後、CPU が呼び出し元のスレッドを再び実行できるように なるまでには遅延が入る。 -.\"O The fact that -.\"O .BR nanosleep () -.\"O sleeps for a relative interval can be problematic if the call -.\"O is repeatedly restarted after being interrupted by signals, -.\"O since the time between the interruptions and restarts of the call -.\"O will lead to drift in the time when the sleep finally completes. -.\"O This problem can be avoided by using -.\"O .BR clock_nanosleep (2) -.\"O with an absolute time value. -シグナルによる割り込み後に繰り返し再開された場合、 -.BR nanosleep () -の停止が相対的な期間であることは問題となることがある。 -これは、呼び出しの割り込みから再開までの間の時間が原因で -停止が最終的に完了した際に時間にずれが発生するからである。 -この問題は、絶対時刻が指定できる -.BR clock_nanosleep (2) -を使うことで回避できる。 +シグナルによる割り込み後に繰り返し再開された場合、 \fBnanosleep\fP() の停止が相対的な期間であることは問題となることがある。 +これは、呼び出しの割り込みから再開までの間の時間が原因で 停止が最終的に完了した際に時間にずれが発生するからである。 この問題は、絶対時刻が指定できる +\fBclock_nanosleep\fP(2) を使うことで回避できる。 -.\"O POSIX.1 specifies that -.\"O .BR nanosleep () -.\"O should measure time against the -.\"O .B CLOCK_REALTIME -.\"O clock. -.\"O However, Linux measures the time using the -.\"O .B CLOCK_MONOTONIC -.\"O clock. -POSIX.1 は、 -.BR nanosleep () -は -.B CLOCK_REALTIME -に対して時刻を計測するべきだと規定している。 -しかしながら、Linux は -.B CLOCK_MONOTONIC -クロックを用いて時刻を計測している。 .\" See also http://thread.gmane.org/gmane.linux.kernel/696854/ .\" Subject: nanosleep() uses CLOCK_MONOTONIC, should be CLOCK_REALTIME? .\" Date: 2008-06-22 07:35:41 GMT -.\"O This probably does not matter, since the POSIX.1 specification for -.\"O .BR clock_settime (2) -.\"O says that discontinuous changes in -.\"O .B CLOCK_REALTIME -.\"O should not affect -.\"O .BR nanosleep (): -このことはおそらく問題にならないだろう。 -なぜなら、POSIX.1 の -.BR clock_settime (2) -の仕様には、 -.B CLOCK_REALTIME -の不連続な変化は -.BR nanosleep () -に影響すべきではない、と書かれているからである。 +POSIX.1 は、 \fBnanosleep\fP() は \fBCLOCK_REALTIME\fP に対して時刻を計測するべきだと規定している。 +しかしながら、Linux は \fBCLOCK_MONOTONIC\fP クロックを用いて時刻を計測している。 このことはおそらく問題にならないだろう。 +なぜなら、POSIX.1 の \fBclock_settime\fP(2) の仕様には、 \fBCLOCK_REALTIME\fP の不連続な変化は +\fBnanosleep\fP() に影響すべきではない、と書かれているからである。 .RS .PP -.\"O Setting the value of the -.\"O .B CLOCK_REALTIME -.\"O clock via -.\"O .BR clock_settime (2) -.\"O shall -.\"O have no effect on threads that are blocked waiting for a relative time -.\"O service based upon this clock, including the -.\"O .BR nanosleep () -.\"O function; ... -.\"O Consequently, these time services shall expire when the requested relative -.\"O interval elapses, independently of the new or old value of the clock. -.BR clock_settime (2) -経由で -.B CLOCK_REALTIME -クロックの値を設定しても、 -.BR nanosleep () -関数などの -.B CLOCK_REALTIME -に基づくサービスにより相対的な期間だけ実行を停止するスレッドには影響はない。 -結果として、クロック値が更新前か後かに関わらず、要求された相対的な時間が -経過すると満了することになる。 +\fBclock_settime\fP(2) 経由で \fBCLOCK_REALTIME\fP クロックの値を設定しても、 \fBnanosleep\fP() +関数などの \fBCLOCK_REALTIME\fP に基づくサービスにより相対的な期間だけ実行を停止するスレッドには影響はない。 +結果として、クロック値が更新前か後かに関わらず、要求された相対的な時間が 経過すると満了することになる。 .RE -.\"O .SS "Old behavior" .SS 以前の動作 -.\"O In order to support applications requiring much more precise pauses -.\"O (e.g., in order to control some time-critical hardware), -.\"O .BR nanosleep () -.\"O would handle pauses of up to 2\ ms by busy waiting with microsecond -.\"O precision when called from a thread scheduled under a real-time policy -.\"O like -.\"O .B SCHED_FIFO -.\"O or -.\"O .BR SCHED_RR . -.\"O This special extension was removed in kernel 2.5.39, -.\"O hence is still present in -.\"O current 2.4 kernels, but not in 2.6 kernels. -(例えば、時間が重要な意味を持つハードウェアを制御する場合など) -より正確な停止を必要とするアプリケーションに対応するために、 -.BR nanosleep () -は、マイクロ秒精度のビジー・ウェイトを利用することで、 -2\ ms 以下の停止を行うことができた。 -但し、この機能を利用するには、呼び出し元のスレッドが -.B SCHED_FIFO -や -.B SCHED_RR -といったリアルタイム・ポリシーの元でスケジューリングされている -必要があった。 -この特別な拡張はカーネル 2.5.39 で削除された。したがって、 -現在の 2.4 系列のカーネルにはこの機能が存在するが、 -2.6系列のカーネルにはない。 -.\"O .SH BUGS +(例えば、時間が重要な意味を持つハードウェアを制御する場合など) より正確な停止を必要とするアプリケーションに対応するために、 +\fBnanosleep\fP() は、マイクロ秒精度のビジー・ウェイトを利用することで、 2\ ms 以下の停止を行うことができた。 +但し、この機能を利用するには、呼び出し元のスレッドが \fBSCHED_FIFO\fP や \fBSCHED_RR\fP +といったリアルタイム・ポリシーの元でスケジューリングされている 必要があった。 この特別な拡張はカーネル 2.5.39 で削除された。したがって、 +現在の 2.4 系列のカーネルにはこの機能が存在するが、 2.6系列のカーネルにはない。 .SH バグ -.\"O In Linux 2.4, if -.\"O .BR nanosleep () -.\"O is stopped by a signal (e.g., -.\"O .BR SIGTSTP ), -.\"O then the call fails with the error -.\"O .B EINTR -.\"O after the thread is resumed by a -.\"O .B SIGCONT -.\"O signal. -.\"O If the system call is subsequently restarted, -.\"O then the time that the thread spent in the stopped state is -.\"O \fInot\fP counted against the sleep interval. -Linux 2.4 では、 -.BR nanosleep () -が -.RB ( SIGTSTP -などの) シグナルにより停止された場合、 -.BR nanosleep () -の呼び出しは -.B SIGCONT -シグナルによるスレッドの再開後に -.B EINTR -エラーで失敗する。 -システムコールがこの後で再スタートされた場合、 -スレッドが停止状態にある間に経過した時間は -停止期間としてカウント「されない」。 -.\"O .SH "SEE ALSO" +Linux 2.4 では、 \fBnanosleep\fP() が (\fBSIGTSTP\fP などの) シグナルにより停止された場合、 +\fBnanosleep\fP() の呼び出しは \fBSIGCONT\fP シグナルによるスレッドの再開後に \fBEINTR\fP エラーで失敗する。 +システムコールがこの後で再スタートされた場合、 スレッドが停止状態にある間に経過した時間は 停止期間としてカウント「されない」。 .SH 関連項目 -.BR clock_nanosleep (2), -.BR sched_setscheduler (2), -.BR timer_create (2), -.BR sleep (3), -.BR usleep (3), -.BR time (7) +\fBclock_nanosleep\fP(2), \fBsched_setscheduler\fP(2), \fBtimer_create\fP(2), +\fBsleep\fP(3), \fBusleep\fP(3), \fBtime\fP(7) diff --git a/draft/man2/nice.2 b/draft/man2/nice.2 index 9f8f6ad9..2b7d5f5b 100644 --- a/draft/man2/nice.2 +++ b/draft/man2/nice.2 @@ -28,160 +28,49 @@ .\" Modified 2001-06-04 by aeb .\" Modified 2004-05-27 by Michael Kerrisk .\" -.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki -.\" all rights reserved. -.\" Translated 1997-06-26, SUTO, Mitsuaki -.\" Updated 2001-06-25, Kentaro Shirakata -.\" Updated 2005-09-03, Akihiro MOTOKI -.\" Updated 2005-10-07, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH NICE 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH NICE 2 2007\-07\-26 Linux "Linux Programmer's Manual" .SH 名前 nice \- プロセスの優先度を変更する .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int nice(int " inc ); +\fBint nice(int \fP\fIinc\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR nice (): -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE -.\"O .SH DESCRIPTION +\fBnice\fP(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE .SH 説明 -.\"O .BR nice () -.\"O adds -.\"O .I inc -.\"O to the nice value for the calling process. -.\"O (A higher nice value means a low priority.) -.\"O Only the super\%user may specify a negative increment, -.\"O or priority increase. -.\"O The range for nice values is described in -.\"O .BR getpriority (2). -.BR nice () -は -.I inc -の値を -.B nice -を呼んだプロセスの nice 値に加える -(nice 値が大きい数値ほど低い優先度を表す)。 -負の数を指定する、つまり、以前よりも優先度を上げるという指定ができるのは -スーパーユーザーだけである。 -nice 値の範囲については -.BR getpriority (2) -で説明されている。 -.\"O .SH "RETURN VALUE" +\fBnice\fP() は \fIinc\fP の値を \fBnice\fP を呼んだプロセスの nice 値に加える (nice +値が大きい数値ほど低い優先度を表す)。 負の数を指定する、つまり、以前よりも優先度を上げるという指定ができるのは スーパーユーザーだけである。 nice +値の範囲については \fBgetpriority\fP(2) で説明されている。 .SH 返り値 -.\"O On success, the new nice value is returned (but see NOTES below). -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合、新しい nice 値が返る (但し、下記の「注意」を参照)。 -失敗した場合 \-1 が返り、 -.I errno +成功した場合、新しい nice 値が返る (但し、下記の「注意」を参照)。 失敗した場合 \-1 が返り、 \fIerrno\fP がエラーの内容に従って設定される。 -.\"O .SH ERRORS .SH エラー -.TP -.B EPERM -.\"O A non-super user attempts to do a priority increase -.\"O by supplying a negative -スーパーユーザー以外が -.I inc -に負の数値を指定して優先度を上げようとした。 -.\"O The calling process attempted to increase its priority by -.\"O supplying a negative -.\"O .I inc -.\"O but has insufficient privileges. -.\"O Under Linux the -.\"O .B CAP_SYS_NICE -.\"O capability is required. -.\"O (But see the discussion of the -.\"O .B RLIMIT_NICE -.\"O resource limit in -.\"O .BR setrlimit (2).) -呼び出し元のプロセスが -.I inc -に負の数値を指定して優先度を上げようとしたが、 -十分な権限を持っていなかった。 -Linux では -.B CAP_SYS_NICE -ケーパビリティが必要である。 -.RB ( setrlimit (2) -のリソース上限 -.B RLIMIT_NICE -に関する議論も参照のこと)。 -.\"O .SH "CONFORMING TO" +.TP +\fBEPERM\fP +スーパーユーザー以外が \fIinc\fP に負の数値を指定して優先度を上げようとした。 呼び出し元のプロセスが \fIinc\fP +に負の数値を指定して優先度を上げようとしたが、 十分な権限を持っていなかった。 Linux では \fBCAP_SYS_NICE\fP +ケーパビリティが必要である。 (\fBsetrlimit\fP(2) のリソース上限 \fBRLIMIT_NICE\fP に関する議論も参照のこと)。 .SH 準拠 -.\"O SVr4, 4.3BSD, POSIX.1-2001. -.\"O However, the Linux and (g)libc -.\"O (earlier than glibc 2.2.4) return value is nonstandard, see below. -.\"O SVr4 documents an additional -.\"O .B EINVAL -.\"O error code. -SVr4, 4.3BSD, POSIX.1-2001. -しかし、Linux と (2.2.4より古い) (g)libc では返り値は標準と異なる。 -詳細は以下を参照のこと。 -SVr4 には他に -.B EINVAL -エラーコードについての記述がある。 -.\"O .SH NOTES +SVr4, 4.3BSD, POSIX.1\-2001. しかし、Linux と (2.2.4より古い) (g)libc では返り値は標準と異なる。 +詳細は以下を参照のこと。 SVr4 には他に \fBEINVAL\fP エラーコードについての記述がある。 .SH 注意 -.\"O SUSv2 and POSIX.1-2001 specify that -.\"O .BR nice () -.\"O should return the new nice value. -.\"O However, the Linux syscall and the -.\"O .BR nice () -.\"O library function provided in older versions of (g)libc -.\"O (earlier than glibc 2.2.4) return 0 on success. -.\"O The new nice value can be found using -.\"O .BR getpriority (2). -SUSv2 と POSIX 1003.1-2003 では、 -.BR nice () -は新しい nice 値を返すと規定されている。 -一方、Linux システムコールと (2.2.4 より古い) (g)libc ライブラリ関数は -成功時に 0 を返す。新しい nice 値は -.BR getpriority (2) -を使って取得できる。 +SUSv2 と POSIX 1003.1\-2003 では、 \fBnice\fP() は新しい nice 値を返すと規定されている。 一方、Linux +システムコールと (2.2.4 より古い) (g)libc ライブラリ関数は 成功時に 0 を返す。新しい nice 値は +\fBgetpriority\fP(2) を使って取得できる。 -.\"O Since glibc 2.2.4, -.\"O .BR nice () -.\"O is implemented as a library function that calls -.\"O .BR getpriority (2) -.\"O to obtain the new nice value to be returned to the caller. -.\"O With this implementation, -.\"O a successful call can legitimately return \-1. -glibc 2.2.4 以降では、 -.BR nice () -は -.BR getpriority (2) -を呼び出すライブラリ関数として実装されており、 -呼び出し元に返す新しい nice 値を -.BR getpriority (2) -を呼び出して取得するようになっている。 -この実装では、正常な動作でも \-1 が返される可能性がある。 -.\"O To reliably detect an error, set -.\"O .I errno -.\"O to 0 before the call, and check its value when -.\"O .BR nice () -.\"O returns \-1. -確実にエラーを検出するためには、 -呼び出しの前に -.I errno -に 0 を設定し、 -.BR nice () -が \-1 を返したときに errno をチェックすると良い。 -.\"O .SH "SEE ALSO" +glibc 2.2.4 以降では、 \fBnice\fP() は \fBgetpriority\fP(2) を呼び出すライブラリ関数として実装されており、 +呼び出し元に返す新しい nice 値を \fBgetpriority\fP(2) を呼び出して取得するようになっている。 この実装では、正常な動作でも \-1 +が返される可能性がある。 確実にエラーを検出するためには、 呼び出しの前に \fIerrno\fP に 0 を設定し、 \fBnice\fP() が \-1 +を返したときに errno をチェックすると良い。 .SH 関連項目 -.BR nice (1), -.BR renice (1), -.BR fork (2), -.BR getpriority (2), -.BR setpriority (2), -.BR capabilities (7) +\fBnice\fP(1), \fBrenice\fP(1), \fBfork\fP(2), \fBgetpriority\fP(2), \fBsetpriority\fP(2), +\fBcapabilities\fP(7) diff --git a/draft/man2/openat.2 b/draft/man2/openat.2 index 8c742673..ef26ab39 100644 --- a/draft/man2/openat.2 +++ b/draft/man2/openat.2 @@ -22,165 +22,65 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2006 Yuichi SATO -.\" all rights reserved. -.\" Translated 2006-09-27 by Yuichi SATO , LDP v2.39 .\" -.TH OPENAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH OPENAT 2 2009\-12\-13 Linux "Linux Programmer's Manual" .SH 名前 -.\"O openat \- open a file relative to a directory file descriptor openat \- ディレクトリファイルディスクリプタから相対的な位置にあるファイルをオープンする -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int openat(int " dirfd ", const char *" pathname ", int " flags ); -.BI "int openat(int " dirfd ", const char *" pathname ", int " flags \ -", mode_t " mode ); +\fBint openat(int \fP\fIdirfd\fP\fB, const char *\fP\fIpathname\fP\fB, int \fP\fIflags\fP\fB);\fP +\fBint openat(int \fP\fIdirfd\fP\fB, const char *\fP\fIpathname\fP\fB, int \fP\fIflags\fP\fB, mode_t \fP\fImode\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR openat (): +\fBopenat\fP(): .PD 0 .ad l .RS 4 -.TP 4 -.\"O Since glibc 2.10: +.TP 4 glibc 2.10 以降: _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L -.TP -.\"O Before glibc 2.10: +.TP glibc 2.10 より前: _ATFILE_SOURCE .RE .ad .PD -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR openat () -.\"O system call operates in exactly the same way as -.\"O .BR open (2), -.\"O except for the differences described in this manual page. -.BR openat () -システムコールは、この man ページで説明している違いがある以外は、 -.BR open (2) -と全く同じように動作する。 +\fBopenat\fP() システムコールは、この man ページで説明している違いがある以外は、 \fBopen\fP(2) と全く同じように動作する。 -.\"O If the pathname given in -.\"O .I pathname -.\"O is relative, then it is interpreted relative to the directory -.\"O referred to by the file descriptor -.\"O .I dirfd -.\"O (rather than relative to the current working directory of -.\"O the calling process, as is done by -.\"O .BR open (2) -.\"O for a relative pathname). -.I pathname -で指定されるパス名が相対パスである場合、 -ファイルディスクリプタ -.I dirfd -で参照されるディレクトリからの相対パス名として解釈される -.RB ( open (2) -では、相対パスは呼び出し元プロセスのカレントワーキングディレクトリからの -相対パスとなる)。 +\fIpathname\fP で指定されるパス名が相対パスである場合、 ファイルディスクリプタ \fIdirfd\fP +で参照されるディレクトリからの相対パス名として解釈される (\fBopen\fP(2) +では、相対パスは呼び出し元プロセスのカレントワーキングディレクトリからの 相対パスとなる)。 -.\"O If -.\"O .I pathname -.\"O is relative and -.\"O .I dirfd -.\"O is the special value -.\"O .BR AT_FDCWD , -.\"O then -.\"O .I pathname -.\"O is interpreted relative to the current working -.\"O directory of the calling process (like -.\"O .BR open (2)). -.I pathname -が相対パスであり、かつ -.I dirfd -が特別な値 -.B AT_FDCWD -である場合、 -.I pathname -は -.RB ( open (2) -と同じように) 呼び出し元プロセスの -カレントワーキングディレクトリからの相対パス名として解釈される。 +\fIpathname\fP が相対パスであり、かつ \fIdirfd\fP が特別な値 \fBAT_FDCWD\fP である場合、 \fIpathname\fP は +(\fBopen\fP(2) と同じように) 呼び出し元プロセスの カレントワーキングディレクトリからの相対パス名として解釈される。 -.\"O If -.\"O .I pathname -.\"O is absolute, then -.\"O .I dirfd -.\"O is ignored. -.I pathname -が絶対パスである場合、 -.I dirfd -は無視される。 -.\"O .SH "RETURN VALUE" +\fIpathname\fP が絶対パスである場合、 \fIdirfd\fP は無視される。 .SH 返り値 -.\"O On success, -.\"O .BR openat () -.\"O returns a new file descriptor. -成功した場合、 -.BR openat () -は新しいファイルディスクリプタを返す。 -.\"O On error, \-1 is returned and -.\"O .I errno -.\"O is set to indicate the error. -エラーの場合、\-1 が返されて、 -.I errno +成功した場合、 \fBopenat\fP() は新しいファイルディスクリプタを返す。 エラーの場合、\-1 が返されて、 \fIerrno\fP にはエラーを示す値が設定される。 -.\"O .SH ERRORS .SH エラー -.\"O The same errors that occur for -.\"O .BR open (2) -.\"O can also occur for -.\"O .BR openat (). -.BR open (2) -と同じエラーが -.BR openat () -でも起こる。 -.\"O The following additional errors can occur for -.\"O .BR openat (): -.BR openat () -では、その他に以下のエラーが起こる: -.TP -.B EBADF -.\"O .I dirfd -.\"O is not a valid file descriptor. -.I dirfd -が有効なファイルディスクリプタでない。 -.TP -.B ENOTDIR -.\"O .I pathname -.\"O is relative and -.\"O .I dirfd -.\"O is a file descriptor referring to a file other than a directory. -.I pathname -が相対パスで、かつ -.I dirfd -がディレクトリ以外のファイルを参照するファイルディスクリプタである。 -.\"O .SH VERSIONS +\fBopen\fP(2) と同じエラーが \fBopenat\fP() でも起こる。 \fBopenat\fP() では、その他に以下のエラーが起こる: +.TP +\fBEBADF\fP +\fIdirfd\fP が有効なファイルディスクリプタでない。 +.TP +\fBENOTDIR\fP +\fIpathname\fP が相対パスで、かつ \fIdirfd\fP がディレクトリ以外のファイルを参照するファイルディスクリプタである。 .SH バージョン -.\"O .BR openat () -.\"O was added to Linux in kernel 2.6.16. -.BR openat () -は Linux カーネル 2.6.16 で追加された。 -.\"O .SH "CONFORMING TO" +\fBopenat\fP() は Linux カーネル 2.6.16 で追加された。 .SH 準拠 -POSIX.1-2008. -.\"O A similar system call exists on Solaris. -Solaris には、これと同じようなシステムコールが存在する。 .\" The 'at' suffix in Solaris is actually double sensed. It .\" primarily referred to "extended *at*tributes", which are .\" handled by Solaris' O_XATTR flag, but was also intended @@ -193,84 +93,22 @@ Solaris には、これと同じようなシステムコールが存在する。 .\" From: Don Cragun .\" Date: Tue, 14 Feb 2006 14:56:50 -0800 (PST) .\" -.\"O .SH NOTES +POSIX.1\-2008. Solaris には、これと同じようなシステムコールが存在する。 .SH 注意 -.\"O .BR openat () -.\"O and other similar system calls suffixed "at" are supported -.\"O for two reasons. -.BR openat () -や "at" が後ろに付いたその他の同様のシステムコールは、 -2 つの理由により提供されている。 +\fBopenat\fP() や "at" が後ろに付いたその他の同様のシステムコールは、 2 つの理由により提供されている。 -.\"O First, -.\"O .BR openat () -.\"O allows an application to avoid race conditions that could -.\"O occur when using -.\"O .BR open (2) -.\"O to open files in directories other than the current working directory. -1 つ目の理由は、 -カレントワーキングディレクトリ以外のディレクトリにあるファイル群を -.BR open (2) -でオープンするときに起こる可能性がある競合状態 (race condition) を、 -.BR openat () -によってアプリケーションが回避できるためである。 -.\"O These race conditions result from the fact that some component -.\"O of the directory prefix given to -.\"O .BR open (2) -.\"O could be changed in parallel with the call to -.\"O .BR open (2). -これらの競合状態は、 -.BR open (2) -に指定されたパスのディレクトリ部分の -(/ で区切られた) いくつかの構成要素 (をオープンする処理) が、 -.BR open (2) -を並列に呼び出す処理に変換された場合に起こる。 -.\"Osato: -.\"Osato: 上記の訳は、語を補い過ぎかもしれない。 -.\"Osato: -.\"O Such races can be avoided by -.\"O opening a file descriptor for the target directory, -.\"O and then specifying that file descriptor as the -.\"O .I dirfd -.\"O argument of -.\"O .BR openat (). -このような競合は、対象ディレクトリのファイルディスクリプタをオープンし、 -そのファイルディスクリプタを -.BR openat () -の -.I dirfd +1 つ目の理由は、 カレントワーキングディレクトリ以外のディレクトリにあるファイル群を \fBopen\fP(2) +でオープンするときに起こる可能性がある競合状態 (race condition) を、 \fBopenat\fP() +によってアプリケーションが回避できるためである。 これらの競合状態は、 \fBopen\fP(2) に指定されたパスのディレクトリ部分の (/ +で区切られた) いくつかの構成要素 (をオープンする処理) が、 \fBopen\fP(2) を並列に呼び出す処理に変換された場合に起こる。 +このような競合は、対象ディレクトリのファイルディスクリプタをオープンし、 そのファイルディスクリプタを \fBopenat\fP() の \fIdirfd\fP 引き数に指定することで回避できる。 -.\"O Second, -.\"O .BR openat () -.\"O allows the implementation of a per-thread "current working -.\"O directory", via file descriptor(s) maintained by the application. -2 つ目の理由は、 -アプリケーションによって管理されるファイルディスクリプタ (群) を使うことで、 -.BR openat () -がスレッド毎のいわゆる「カレントワーキングディレクトリ」を実装できるためである。 -.\"O (This functionality can also be obtained by tricks based -.\"O on the use of -.\"O .IR /proc/self/fd/ dirfd, -.\"O but less efficiently.) -(この機能は -.IR /proc/self/fd/ dirfd +2 つ目の理由は、 アプリケーションによって管理されるファイルディスクリプタ (群) を使うことで、 \fBopenat\fP() +がスレッド毎のいわゆる「カレントワーキングディレクトリ」を実装できるためである。 (この機能は \fI/proc/self/fd/\fPdirfd を使った裏技でも実現できるが、あまり効率的ではない)。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR faccessat (2), -.BR fchmodat (2), -.BR fchownat (2), -.BR fstatat (2), -.BR futimesat (2), -.BR linkat (2), -.BR mkdirat (2), -.BR mknodat (2), -.BR open (2), -.BR readlinkat (2), -.BR renameat (2), -.BR symlinkat (2), -.BR unlinkat (2), -.BR utimensat (2), -.BR mkfifoat (3), -.BR path_resolution (7) +\fBfaccessat\fP(2), \fBfchmodat\fP(2), \fBfchownat\fP(2), \fBfstatat\fP(2), +\fBfutimesat\fP(2), \fBlinkat\fP(2), \fBmkdirat\fP(2), \fBmknodat\fP(2), \fBopen\fP(2), +\fBreadlinkat\fP(2), \fBrenameat\fP(2), \fBsymlinkat\fP(2), \fBunlinkat\fP(2), +\fButimensat\fP(2), \fBmkfifoat\fP(3), \fBpath_resolution\fP(7) diff --git a/draft/man2/poll.2 b/draft/man2/poll.2 deleted file mode 100644 index 3b5b73b3..00000000 --- a/draft/man2/poll.2 +++ /dev/null @@ -1,552 +0,0 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" Copyright (C) 1997 Andries Brouwer (aeb@cwi.nl) -.\" and Copyright (C) 2006, Michael Kerrisk -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" Additions from Richard Gooch and aeb, 971207 -.\" 2006-03-13, mtk, Added ppoll() + various other rewordings -.\" 2006-07-01, mtk, Added POLLRDHUP + various other wording and -.\" formatting changes. -.\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1997-12-11, HANATAKA Shinya -.\" Updated & Modified 2004-05-22, Yuichi SATO -.\" Updated & Modified 2005-01-03, Yuichi SATO -.\" Updated & Modified 2005-10-10, Akihiro MOTOKI -.\" Updated 2005-12-05, Akihiro MOTOKI, Catch up to LDP man-pages 2.16 -.\" Updated 2006-04-16, Akihiro MOTOKI, Catch up to LDP man-pages 2.28 -.\" Updated 2006-07-23, Akihiro MOTOKI, Catch up to LDP man-pages 2.36 -.\" -.\"WORD: descriptor ディスクリプタ -.\" -.TH POLL 2 2010-09-20 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O poll, ppoll \- wait for some event on a file descriptor -poll, ppoll \- ファイルディスクリプタにおけるイベントを待つ -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.B #include -.sp -.BI "int poll(struct pollfd *" fds ", nfds_t " nfds ", int " timeout ); -.sp -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" -.B #include -.sp -.BI "int ppoll(struct pollfd *" fds ", nfds_t " nfds ", " -.BI " const struct timespec *" timeout_ts ", const sigset_t *" sigmask ); -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O .BR poll () -.\"O performs a similar task to -.\"O .BR select (2): -.\"O it waits for one of a set of file descriptors to become ready -.\"O to perform I/O. -.BR poll () -は -.BR select (2) -と同様の仕事を行う、つまり、ファイルディスクリプタ集合のいずれか一つが -I/O を実行可能な状態になるのを待つ。 - -.\"O The set of file descriptors to be monitored is specified in the -.\"O .I fds -.\"O argument, which is an array of structures of the following form: -監視するファイルディスクリプタ集合は、 -.I fds -引き数で指定する。 -.I fds -は、以下の型の構造体の配列である。 -.in +4n -.nf - -struct pollfd { - int fd; /* file descriptor */ - short events; /* requested events */ - short revents; /* returned events */ -}; -.in -.fi -.PP -.\"O The caller should specify the number of items in the -.\"O .I fds -.\"O array in -.\"O .IR nfds . -.I nfds -には、 -.I fds -配列の要素数を指定する。 - -.\"O The field -.\"O .I fd -.\"O contains a file descriptor for an open file. -構造体の -.I fd -にはオープンしたファイルのファイルディスクリプタを入れる。 - -.\"O The field -.\"O .I events -.\"O is an input parameter, a bit mask specifying the events the application -.\"O is interested in. -構造体の -.I events -要素は入力パラメータで、アプリケーションが興味を持っているイベントの -ビットマスクを指定する。 - -.\"O The field -.\"O .I revents -.\"O is an output parameter, filled by the kernel with the events that -.\"O actually occurred. -.\"O The bits returned in -.\"O .I revents -.\"O can include any of those specified in -.\"O .IR events , -.\"O or one of the values -.\"O .BR POLLERR , -.\"O .BR POLLHUP , -.\"O or -.\"O .BR POLLNVAL . -.\"O (These three bits are meaningless in the -.\"O .I events -.\"O field, and will be set in the -.\"O .I revents -.\"O field whenever the corresponding condition is true.) -.I revents -要素は出力パラメータで、実際に起こったイベントがカーネルにより設定される。 -.I revents -で返されるビット列には、 -.I events -で指定したもののどれか、もしくは -.BR POLLERR , -.BR POLLHUP , -.B POLLNVAL -のうちの一つが含まれる -.RB ( POLLERR , -.BR POLLHUP , -.B POLLNVAL -の 3つのビットは -.I events -に指定しても意味がなく、対応した状態が真の場合に -.I revents -に設定される)。 - -.\"O If none of the events requested (and no error) has occurred for any -.\"O of the file descriptors, then -.\"O .BR poll () -.\"O blocks until one of the events occurs. -どのファイルディスクリプタにも要求したイベントが発生しておらず、 -エラーも起こらない場合、 -.BR poll () -はイベントのうちいずれか一つが発生するまで停止 (block) する。 - -.\"O The -.\"O .I timeout -.\"O argument specifies an upper limit on the time for which -.\"O .BR poll () -.\"O will block, in milliseconds. -.\"O Specifying a negative value in -.\"O .I timeout -.\"O means an infinite timeout. -.I timeout -引き数は -.BR poll () -が停止する時間の上限を設定するもので、ミリ秒単位で指定する。 -.I timeout -に負の値を指定すると、タイムアウト時間が無限となる。 - -.\"O The bits that may be set/returned in -.\"O .I events -.\"O and -.\"O .I revents -.\"O are defined in \fI\fP: -.I events -に指定したり、 -.I revents -で返されるビットは \fI\fP で定義されている: -.RS -.TP -.B POLLIN -.\"O There is data to read. -読み出し可能なデータがある。 -.TP -.B POLLPRI -.\"O There is urgent data to read (e.g., out-of-band data on TCP socket; -.\"O pseudoterminal master in packet mode has seen state change in slave). -読み出し可能な緊急データ (urgent data) がある -(例えば、TCP ソケットの帯域外 (out-of-band data) データを受信した場合や、 -パケットモードの擬似端末のマスタがスレーブ側の変化を見つけたとき)。 -.TP -.B POLLOUT -.\"O Writing now will not block. -書き込みが停止 (block) しない状態である。 -.TP -.\"O .BR POLLRDHUP " (since Linux 2.6.17)" -.BR POLLRDHUP " (Linux 2.6.17 以降)" -.\"O Stream socket peer closed connection, -.\"O or shut down writing half of connection. -.\"O The -.\"O .B _GNU_SOURCE -.\"O feature test macro must be defined -.\"O (before including -.\"O .I any -.\"O header files) -.\"O in order to obtain this definition. -ストリームソケットの他端が、コネクションを close したか、 -コネクションの書き込み側を shutdown した。 -この定義を有効にするには、 -(「どの」ヘッダファイルをインクルードするよりも前に) -.B _GNU_SOURCE -機能検査マクロを定義しなければならない。 -.TP -.B POLLERR -.\"O Error condition (output only). -エラー状態 (出力の場合のみ)。 -.TP -.B POLLHUP -.\"O Hang up (output only). -ハングアップした (出力の場合のみ)。 -.TP -.B POLLNVAL -.\"O Invalid request: -.\"O .I fd -.\"O not open (output only). -不正な要求: -.I fd -がオープンされていない (出力の場合のみ)。 -.RE -.PP -.\"O When compiling with -.\"O .B _XOPEN_SOURCE -.\"O defined, one also has the following, -.\"O which convey no further information beyond the bits listed above: -.B _XOPEN_SOURCE -を定義してコンパイルした場合には、以下の定義も行われる。 -ただし、上記のリストにあるビット以上の情報が得られる訳ではない。 -.RS -.TP -.B POLLRDNORM -.\"O Equivalent to -.\"O .BR POLLIN . -.B POLLIN -と同じ。 -.TP -.B POLLRDBAND -.\"O Priority band data can be read (generally unused on Linux). -優先帯域データ (priority band data) が読み出し可能である -(普通は Linux では使用されない)。 -.\" POLLRDBAND is used in the DECnet protocol. -.TP -.B POLLWRNORM -.\"O Equivalent to -.\"O .BR POLLOUT . -.B POLLOUT -と同じ。 -.TP -.B POLLWRBAND -.\"O Priority data may be written. -優先帯域データ (priority data) が書き込み可能である。 -.RE -.PP -.\"O Linux also knows about, but does not use -.\"O .BR POLLMSG . -Linux では -.B POLLMSG -も定義されているが、使用されていない。 -.SS ppoll() -.\"O The relationship between -.\"O .BR poll () -.\"O and -.\"O .BR ppoll () -.\"O is analogous to the relationship between -.\"O .BR select (2) -.\"O and -.\"O .BR pselect (2): -.\"O like -.\"O .BR pselect (2), -.\"O .BR ppoll () -.\"O allows an application to safely wait until either a file descriptor -.\"O becomes ready or until a signal is caught. -.BR poll () -と -.BR ppoll () -の関係は -.BR select (2) -と -.BR pselect (2) -の関係と同じようなものである: -.BR pselect (2) -と同様に、 -.BR ppoll () -を使うと、アプリケーションはファイルディスクリプタの状態変化 -もしくはシグナルの捕捉を安全に待つことができる。 -.PP -.\"O Other than the difference in the precision of the -.\"O .I timeout -.\"O argument, the following -.\"O .BR ppoll () -.\"O call: -.I timeout -引き数の精度の違いを除くと、以下の -.BR ppoll () -の呼び出しは、 -.nf - - ready = ppoll(&fds, nfds, timeout_ts, &sigmask); - -.fi -.\"O is equivalent to -.\"O .I atomically -.\"O executing the following calls: -次のコールを -.I atomic -に実行するのと等価である。 -.nf - - sigset_t origmask; - int timeout; - - timeout = (timeout_ts == NULL) ? \-1 : - (timeout_ts.tv_sec * 1000 + timeout_ts.tv_nsec / 1000000); - sigprocmask(SIG_SETMASK, &sigmask, &origmask); - ready = poll(&fds, nfds, timeout); - sigprocmask(SIG_SETMASK, &origmask, NULL); -.fi -.PP -.\"O See the description of -.\"O .BR pselect (2) -.\"O for an explanation of why -.\"O .BR ppoll () -.\"O is necessary. -なぜ -.BR ppoll () -が必要なのかについての説明は -.BR pselect (2) -の説明を参照のこと。 - -.\"O If the -.\"O .I sigmask -.\"O argument is specified as NULL, then -.\"O no signal mask manipulation is performed -.\"O (and thus -.\"O .BR ppoll () -.\"O differs from -.\"O .BR poll () -.\"O only in the precision of the -.\"O .I timeout -.\"O argument). -.I sigmask -引き数に NULL が指定された場合、シグナルマスクの操作は行われない -(したがって、 -.BR ppoll () -の -.BR poll () -との違いは -.I timeout -引き数の精度だけとなる)。 - -.\"O The -.\"O .I timeout -.\"O argument specifies an upper limit on the amount of time that -.\"O .BR ppoll () -.\"O will block. -.\"O This argument is a pointer to a structure of the following form: -.I timeout -引き数は -.BR ppoll () -が停止する時間の上限を指定するものである。 -この引き数には以下の型の構造体へのポインタを指定する。 -.in +4n -.nf - -struct timespec { - long tv_sec; /* seconds */ - long tv_nsec; /* nanoseconds */ -}; -.fi -.in - -.\"O If -.\"O .I timeout_ts -.\"O is specified as NULL, then -.\"O .BR ppoll () -.\"O can block indefinitely. -.I timeout_ts -に NULL が指定された場合、 -.B ppoll -は無限に停止することがあり得る。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success, a positive number is returned; this is -.\"O the number of structures which have nonzero -.\"O .I revents -.\"O fields (in other words, those descriptors with events or errors reported). -.\"O A value of 0 indicates that the call timed out and no file -.\"O descriptors were ready. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合は正の数を返す。この数は 0 以外の -.I revents -要素を持つ構造体の数である (別の言い方をすると、これらのディスクリプタ -にはイベントかエラー報告がある)。 -値 0 は、タイムアウトとなり、どのファイルディスクリプタでもイベントが -発生しなかったことを示す。エラーの場合は \-1 が返され、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EFAULT -.\"O The array given as argument was not contained in the calling program's -.\"O address space. -引き数として指定した配列が、呼び出したプロセスのアドレス空間に -含まれていない。 -.TP -.B EINTR -.\"O A signal occurred before any requested event; see -.\"O .BR signal (7). -要求されたイベントのどれかが起こる前にシグナルが発生した。 -.BR signal (7) -参照。 -.TP -.B EINVAL -.\"O The -.\"O .I nfds -.\"O value exceeds the -.\"O .B RLIMIT_NOFILE -.\"O value. -.I nfds -の値が -.B RLIMIT_NOFILE -を超えた。 -.TP -.B ENOMEM -.\"O There was no space to allocate file descriptor tables. -ファイルディスクリプタ・テーブルを確保するためのメモリがない。 -.\"O .SH VERSIONS -.SH バージョン -.\"O The -.\"O .BR poll () -.\"O system call was introduced in Linux 2.1.23. -.\"O The -.\"O .BR poll () -.\"O library call was introduced in libc 5.4.28 -.\"O (and provides emulation using -.\"O .BR select (2) -.\"O if your kernel does not -.\"O have a -.\"O .BR poll () -.\"O system call). -.BR poll () -システムコールは Linux 2.1.23 で導入された。 -.BR poll () -ライブラリ・コールは libc 5.4.28 から導入された -(これはカーネルが -.BR poll () -システムコールをサポートしていない場合に -.BR select (2) -を使用してエミュレートを行う)。 - -.\"O The -.\"O .BR ppoll () -.\"O system call was added to Linux in kernel 2.6.16. -.\"O The -.\"O .BR ppoll () -.\"O library call was added in glibc 2.4. -.BR ppoll () -システムコールは カーネル 2.6.16 で Linux に追加された。 -.BR ppoll () -ライブラリコールは glibc 2.4 に追加された。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -.\"O .BR poll () -.\"O conforms to POSIX.1-2001. -.\"O .BR ppoll () -.\"O is Linux-specific. -.\"O .\" NetBSD 3.0 has a pollts() which is like Linux ppoll(). -.BR poll () -は POSIX.1-2001 に準拠している。 -.BR ppoll () -は Linux 固有である。 -.\" NetBSD 3.0 には pollts() がある。 -.\" pollts() は Linux ppoll () と同じようなものである。 -.\"O .SH NOTES -.SH 注意 -.\"O Some implementations define the nonstandard constant -.\"O .B INFTIM -.\"O with the value \-1 for use as a -.\"O .IR timeout -.\"O for -.\"O .BR poll (). -.\"O This constant is not provided in glibc. -いくつかの実装では、値 \-1 を持った非標準の定数 -.B INFTIM -が定義されており、 -.BR poll () -の -.I timeout -の指定に使用できる。 -この定数は glibc では定義されていない。 -.\"O .SS "LINUX NOTES" -.SS "Linux での注意" -.\"O The Linux -.\"O .BR ppoll () -.\"O system call modifies its -.\"O .I timeout_ts -.\"O argument. -.\"O However, the glibc wrapper function hides this behavior -.\"O by using a local variable for the timeout argument that -.\"O is passed to the system call. -.\"O Thus, the glibc -.\"O .BR ppoll () -.\"O function does not modify its -.\"O .I timeout_ts -.\"O argument. -Linux の -.BR ppoll () -システムコールは -.I timeout_ts -引き数を変更する。 -しかし、glibc のラッパー関数は、システムコールに渡す timeout 引き数 -としてローカル変数を使うことでこの動作を隠蔽している。 -このため、glibc の -.BR ppoll () -関数では -.I timeout_ts -引き数は変更されない。 -.\"O .SH BUGS -.SH バグ -.\"O See the discussion of spurious readiness notifications under the -.\"O BUGS section of -.\"O .BR select (2). -.BR select (2) -の「バグ」の節に書かれている、誤った準備完了通知 (spurious readiness -notifications) についての議論を参照のこと。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR select (2), -.BR select_tut (2), -.BR time (7) diff --git a/draft/man2/posix_fadvise.2 b/draft/man2/posix_fadvise.2 deleted file mode 100644 index 9ad69b13..00000000 --- a/draft/man2/posix_fadvise.2 +++ /dev/null @@ -1,241 +0,0 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" Copyright 2003 Abhijit Menon-Sen -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" 2005-04-08 mtk, noted kernel version and added BUGS -.\" -.\" Japanese Version Copyright (c) 2004-2007 Yuichi SATO -.\" all rights reserved. -.\" Translated Sun Jun 20 16:23:17 JST 2004 -.\" by Yuichi SATO , LDP v1.66 -.\" Updated & Modified Fri Apr 22 03:05:51 JST 2005 by Yuichi SATO, LDP v2.02 -.\" Updated & Modified Thu Jan 4 23:55:18 JST 2007 by Yuichi SATO, LDP v2.43 -.\" -.TH POSIX_FADVISE 2 2003-02-14 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O posix_fadvise \- predeclare an access pattern for file data -posix_fadvise \- ファイルデータのアクセスパターンをあらかじめ宣言する -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.B #define _XOPEN_SOURCE 600 -.B #include -.sp -.BI "int posix_fadvise(int " fd ", off_t " offset ", off_t " len \ -", int " advice ");" -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O Programs can use -.\"O .BR posix_fadvise () -.\"O to announce an intention to access -.\"O file data in a specific pattern in the future, thus allowing the kernel -.\"O to perform appropriate optimizations. -プログラムは、将来特定のパターンでファイルデータに -アクセスする意思を伝えるために -.BR posix_fadvise () -を使うことができる。 -これにより、カーネルが適切な最適化を実行することが可能になる。 - -.\"O The \fIadvice\fP applies to a (not necessarily existent) region starting -.\"O at \fIoffset\fP and extending for \fIlen\fP bytes (or until the end of -.\"O the file if \fIlen\fP is 0) within the file referred to by \fIfd\fP. -.\"O The advice is not binding; it merely constitutes an expectation on behalf of -.\"O the application. -\fIadvice\fP は \fIfd\fP が参照しているファイルの -\fIoffset\fP から始まる \fIlen\fP バイトの範囲内 -(\fIlen\fP が 0 の場合はファイルの終りまで) の -(必ずしも存在しない) 領域に適用される。 -アドバイスは義務づけではない。 -アドバイスは単にアプリケーションのために可能性を構成するだけである。 - -.\"O Permissible values for \fIadvice\fP include: -\fIadvice\fP に許される値には、以下のものが含まれる: -.TP -.B POSIX_FADV_NORMAL -.\"O Indicates that the application has no advice to give about its access -.\"O pattern for the specified data. -.\"O If no advice is given for an open file, -.\"O this is the default assumption. -指定されたデータのアクセスパターンを指示するアドバイスを -アプリケーションが何も持っていないことを示す。 -オープンされたファイルにアドバイスが指定されない場合、 -これがデフォルトで仮定される。 -.TP -.B POSIX_FADV_SEQUENTIAL -.\"O The application expects to access the specified data sequentially (with -.\"O lower offsets read before higher ones). -アプリケーションは指定されたデータがシーケンシャルに -(大きなオフセットの前に小さなオフセットのデータを読むように) -アクセスされることを期待する。 -.TP -.B POSIX_FADV_RANDOM -.\"O The specified data will be accessed in random order. -指定されたデータがランダムな順番でアクセスされる。 -.TP -.B POSIX_FADV_NOREUSE -.\"O The specified data will be accessed only once. -指定されたデータは 1 度しかアクセスされない。 -.TP -.B POSIX_FADV_WILLNEED -.\"O The specified data will be accessed in the near future. -指定されたデータは近い将来アクセスされる。 -.TP -.B POSIX_FADV_DONTNEED -.\"O The specified data will not be accessed in the near future. -指定されたデータは近い将来アクセスされない。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success, zero is returned. -.\"O On error, an error number is returned. -成功した場合は 0 が返される。 -失敗した場合はエラー番号が返される。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EBADF -.\"O The \fIfd\fP argument was not a valid file descriptor. -\fIfd\fP 引き数が有効なファイルディスクリプタでない。 -.TP -.B EINVAL -.\"O An invalid value was specified for \fIadvice\fP. -無効な値が \fIadvice\fP に指定された。 -.TP -.B ESPIPE -.\"O returns EINVAL in this case.) -.\"O The specified file descriptor refers to a pipe or FIFO. -.\"O (Linux actually -.\"O returns -.\"O .B EINVAL -.\"O in this case.) -指定されたファイルディスクリプタがパイプまたは FIFO を参照している -(この場合、Linux は実際には -.B EINVAL -を返す)。 -.\"O .SH VERSIONS -.SH バージョン -.\"O .BR posix_fadvise () -.\"O appeared in kernel 2.5.60. -.\"O .\" Actually as fadvise64() -- MTK -.\"O Glibc support has been provided since version 2.2. -.BR posix_fadvise () -はカーネル 2.5.60 で登場した。 -.\" 実際には fadvise64() として登場した。-- MTK -glibc でのサポートは glibc バージョン 2.2 以降で行われている。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -POSIX.1-2001. -.\"O Note that the type of the -.\"O .I len -.\"O argument was changed from -.\"O .I size_t -.\"O to -.\"O .I off_t -.\"O in POSIX.1-2003 TC1. -.I len -引き数の型が POSIX.1-2003 TC1 において -.I size_t -から -.I off_t -に変更された点に注意すること。 -.\"O .SH NOTES -.\"O Under Linux, \fBPOSIX_FADV_NORMAL\fP sets the readahead window to the -.\"O default size for the backing device; \fBPOSIX_FADV_SEQUENTIAL\fP doubles -.\"O this size, and \fBPOSIX_FADV_RANDOM\fP disables file readahead entirely. -.SH 注意 -Linux では、\fBPOSIX_FADV_NORMAL\fP はバッキングデバイスの -デフォルトサイズに先読み (readahead) ウインドウを設定する。 -\fBPOSIX_FADV_SEQUENTIAL\fP はこのサイズを 2 倍し、 -\fBPOSIX_FADV_RANDOM\fP は先読みを全く無効にする。 -.\"O These changes affect the entire file, not just the specified region -.\"O (but other open file handles to the same file are unaffected). -これらの変更はファイル全体に影響し、指定された領域のみに影響するわけではない -(しかし同じファイルに対する他のオープンファイルハンドルは影響を受けない)。 - -.\"O \fBPOSIX_FADV_WILLNEED\fP initiates a -.\"O nonblocking read of the specified region into the page cache. -.\"O The amount of data read may be decreased by the kernel depending -.\"O on virtual memory load. -.\"O (A few megabytes will usually be fully satisfied, -.\"O and more is rarely useful.) -\fBPOSIX_FADV_WILLNEED\fP は、 -ページキャッシュに指定領域のブロックされない読み込みを開始する。 -読み込まれるデータの総量は、 -仮想メモリの負荷に依ってカーネルが減らすかもしれない -(数メガバイトであれば通常は全く十分であり、 -それより多くてもめったに役に立たない)。 - -.\"O In kernels before 2.6.18, \fBPOSIX_FADV_NOREUSE\fP had the -.\"O same semantics as \fBPOSIX_FADV_WILLNEED\fP. -.\"O This was probably a bug; since kernel 2.6.18, this flag is a no-op. -2.6.18 より前のカーネルでは、\fBPOSIX_FADV_NOREUSE\fP は -\fBPOSIX_FADV_WILLNEED\fP と同じ意味であった。 -これは多分バグであった。 -カーネル 2.6.18 以降では、このフラグは何も行わない。 - -.\"O \fBPOSIX_FADV_DONTNEED\fP attempts to free cached pages associated with -.\"O the specified region. -.\"O This is useful, for example, while streaming large -.\"O files. -.\"O A program may periodically request the kernel to free cached data -.\"O that has already been used, so that more useful cached pages are not -.\"O discarded instead. -\fBPOSIX_FADV_DONTNEED\fP は指定された領域に関連付けられた -キャッシュページを解放しようとする。 -例えば、これは大きなファイルをストリーミングするときに役立つ。 -プログラムは、使用済みのキャッシュされたデータを解放するように、 -定期的にカーネルに要求するかもしれない。 -そうすることにより、さらに有効なキャッシュされたページが、 -代わりに破棄されることはない。 - -.\"O Pages that have not yet been written out will be unaffected, so if the -.\"O application wishes to guarantee that pages will be released, it should -.\"O call -.\"O .BR fsync (2) -.\"O or -.\"O .BR fdatasync (2) -.\"O first. -まだ書き出されていないページは影響を受けないので、 -そのページの解放が保証されることをアプリケーションが望んでいるなら、 -最初に -.BR fsync (2) -または -.BR fdatasync (2) -を呼ぶべきである。 -.\"O .SH BUGS -.SH バグ -.\"O In kernels before 2.6.6, if -.\"O .I len -.\"O was specified as 0, then this was interpreted literally as "zero bytes", -.\"O rather than as meaning "all bytes through to the end of the file". -2.6.6 より前のカーネルでは、 -.I len -に 0 が指定された場合、 -「ファイルの終りまでの全てのバイト」という意味ではなく、 -文字通り「0 バイト」として解釈されていた。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR readahead (2), -.BR posix_fallocate (3), -.BR posix_madvise (3) -.\" FIXME . Write a posix_fadvise(3) page. diff --git a/draft/man2/pread.2 b/draft/man2/pread.2 deleted file mode 100644 index 71c5d31f..00000000 --- a/draft/man2/pread.2 +++ /dev/null @@ -1,193 +0,0 @@ -.\" Copyright (C) 1999 Joseph Samuel Myers. -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Fri Jun 25 23:32:20 JST 1999 -.\" by HANATAKA Shinya -.\" -.\"WORD: descriptor ディスクリプタ -.\"WORD: offset オフセット -.\"WORD: seek シーク -.\" -.TH PREAD 2 2010-09-26 "Linux" "Linux Programmer's Manual" -.SH 名前 -.\"O pread, pwrite \- read from or write to a file descriptor at a given offset -pread, pwrite \- 指定したオフセットでファイルディスクリプタを読み書きする -.SH 書式 -.B #include -.sp -.BI "ssize_t pread(int " fd ", void *" buf ", size_t " count \ -", off_t " offset ); -.sp -.BI "ssize_t pwrite(int " fd ", const void *" buf ", size_t " count \ -", off_t " offset ); -.sp -.in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): -.in -.PD 0 -.ad l -.sp -.BR pread (), -.BR pwrite (): -.RS 4 -_XOPEN_SOURCE\ >=\ 500 -.br -.\"O || /* Since glibc 2.12: */ _POSIX_C_SOURCE\ >=\ 200809L -|| /* glibc 2.12 以降: */ _POSIX_C_SOURCE\ >=\ 200809L -.RE -.ad -.PD -.\"O .SH DESCRIPTION -.SH 説明 -.\"O .BR pread () -.\"O reads up to -.\"O .I count -.\"O bytes from file descriptor -.\"O .I fd -.\"O at offset -.\"O .I offset -.\"O (from the start of the file) into the buffer starting at -.\"O .IR buf . -.\"O The file offset is not changed. -.BR pread () -は、ファイルディスクリプタ -.I fd -の (ファイルの先頭からの) オフセット -.I offset -から最大 -.I count -バイトをバッファ -.I buf -へ読み込む。ファイル・オフセットは変化しない。 -.PP -.\"O .BR pwrite () -.\"O writes up to -.\"O .I count -.\"O bytes from the buffer starting at -.\"O .I buf -.\"O to the file descriptor -.\"O .I fd -.\"O at offset -.\"O .IR offset . -.\"O The file offset is not changed. -.BR pwrite () -は、バッファ -.I buf -から最大 -.I count -バイトをファイルディスクリプタ -.I fd -のオフセット -.I offset -に書き込む。ファイル・オフセットは変化しない。 -.PP -.\"O The file referenced by -.\"O .I fd -.\"O must be capable of seeking. -.I fd -で参照されるファイルはシーク (seek) 可能でなければならない。 -.SH 返り値 -.\"O On success, the number of bytes read or written is returned (zero -.\"O indicates that nothing was written, in the case of -.\"O .BR pwrite (), -.\"O or -.\"O end of file, in the case of -.\"O .BR pread ()), -.\"O or \-1 on error, in which case -.\"O .I errno -.\"O is set to indicate the error. -成功した場合、読み書きを行ったバイト数が返される (ゼロは、 -.BR pwrite () -の場合には何も書かれなかったことを意味し、 -.BR pread () -の場合にはファイル -の末尾に達したことを意味する)。 -エラーの場合は \-1 が返され、 -.I errno -がそのエラーを示すように設定される。 -.SH エラー -.\"O .BR pread () -.\"O can fail and set -.\"O .I errno -.\"O to any error specified for -.\"O .BR read (2) -.\"O or -.\"O .BR lseek (2). -.BR pread () -では、 -.BR read (2) -および -.BR lseek (2) -で規定された全てのエラーが発生する可能性があり、 -.I error -にはエラーを示す値が設定される。 -.\"O .BR pwrite () -.\"O can fail and set -.\"O .I errno -.\"O to any error specified for -.\"O .BR write (2) -.\"O or -.\"O .BR lseek (2). -.BR pwrite () -では、 -.BR write (2) -および -.BR lseek (2) -で規定された全てのエラーが発生する可能性があり、 -.I error -にはエラーを示す値が設定される。 -.\"O .SH VERSIONS -.SH バージョン -.\"O The -.\"O .BR pread () -.\"O and -.\"O .BR pwrite () -.\"O system calls were added to Linux in -.\"O version 2.1.60; the entries in the i386 system call table were added -.\"O in 2.1.69. -.\"O C library support (including emulation using -.\"O .BR lseek (2) -.\"O on older kernels without the system calls) was added in glibc 2.1. -システムコール -.BR pread () -と -.BR pwrite () -は Linux にバージョン 2.1.60 で追加された。 -i386 のシステムコールのエントリは 2.1.69 で追加された。 -(システムコールを持たない古いカーネルでの -.BR lseek (2) -を使ったエミュレーションを含めると) -C ライブラリにおけるサポートは glibc 2.1 で追加された。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -POSIX.1-2001. -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR lseek (2), -.BR read (2), -.BR write (2) diff --git a/draft/man2/readahead.2 b/draft/man2/readahead.2 index daae4fe9..ff36a9df 100644 --- a/draft/man2/readahead.2 +++ b/draft/man2/readahead.2 @@ -25,130 +25,43 @@ .\" 2004-05-40 Created by Michael Kerrisk .\" 2004-10-05 aeb, minor correction .\" -.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2005-02-26, Akihiro MOTOKI +.\"******************************************************************* .\" -.\"WORD: page cache ページ・キャッシュ -.\"WORD: file descriptor ファイル記述子 +.\" This file was generated with po4a. Translate the source file. .\" -.TH READAHEAD 2 2010-09-10 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH READAHEAD 2 2010\-09\-10 Linux "Linux Programmer's Manual" .SH 名前 -.\"O readahead \- perform file readahead into page cache readahead \- 前もってファイルをページ・キャッシュに読み込む -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" -.B #include +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP .sp -.BI "ssize_t readahead(int " fd ", off64_t " offset ", size_t " count ); +\fBssize_t readahead(int \fP\fIfd\fP\fB, off64_t \fP\fIoffset\fP\fB, size_t \fP\fIcount\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR readahead () -.\"O populates the page cache with data from a file so that subsequent -.\"O reads from that file will not block on disk I/O. -.BR readahead () -は、この後の同じファイルからのデータ読み込み時にディスク I/O で -動作が停止 (block) しないように、前もってファイルの内容を -ページ・キャッシュに読み込む。 -.\"O The -.\"O .I fd -.\"O argument is a file descriptor identifying the file which is -.\"O to be read. -.I fd -引き数は読み込みを行うファイルを識別するファイル・ディスクリプタである。 -.\"O The -.\"O .I offset -.\"O argument specifies the starting point from which data is to be read -.\"O and -.\"O .I count -.\"O specifies the number of bytes to be read. -.I offset -引き数はデータの読み込み開始位置を指定し、 -.I count -は読み込むデータのバイト数を指定する。 -.\"O I/O is performed in whole pages, so that -.\"O .I offset -.\"O is effectively rounded down to a page boundary -.\"O and bytes are read up to the next page boundary greater than or -.\"O equal to -.\"O .IR "(offset+count)" . -ディスク I/O はページ単位で実行されるので、 -実際には -.I offset -はページ境界に切り下げられ、読み込みバイト数は -.I "(offset+count)" -より小さくない次のページ境界まで切り上げられる。 -.\"O .BR readahead () -.\"O does not read beyond the end of the file. -.\"O .BR readahead () -.\"O blocks until the specified data has been read. -.BR readahead () -はファイルの末尾を越えた範囲まで読み出しを行うことはない。また、 -.BR readahead () -は指定したデータの読み込みが終わるまで停止 (block) する。 -.\"O The current file offset of the open file referred to by -.\"O .I fd -.\"O is left unchanged. -.I fd -で参照されたオープン済のファイルのファイルオフセットの現在値は +\fBreadahead\fP() は、この後の同じファイルからのデータ読み込み時にディスク I/O で 動作が停止 (block) +しないように、前もってファイルの内容を ページ・キャッシュに読み込む。 \fIfd\fP +引き数は読み込みを行うファイルを識別するファイル・ディスクリプタである。 \fIoffset\fP 引き数はデータの読み込み開始位置を指定し、 +\fIcount\fP は読み込むデータのバイト数を指定する。 ディスク I/O はページ単位で実行されるので、 実際には \fIoffset\fP +はページ境界に切り下げられ、読み込みバイト数は \fI(offset+count)\fP より小さくない次のページ境界まで切り上げられる。 +\fBreadahead\fP() はファイルの末尾を越えた範囲まで読み出しを行うことはない。また、 \fBreadahead\fP() +は指定したデータの読み込みが終わるまで停止 (block) する。 \fIfd\fP で参照されたオープン済のファイルのファイルオフセットの現在値は 変更されない。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O On success, -.\"O .BR readahead () -.\"O returns 0; on failure, \-1 is returned, with -.\"O .I errno -.\"O set to indicate the cause of the error. -.BR readahead () -は成功すると 0 を返す。失敗した場合 \-1 を返し、 -.I errno -にエラーの原因を示す値を設定する。 -.\"O .SH ERRORS +\fBreadahead\fP() は成功すると 0 を返す。失敗した場合 \-1 を返し、 \fIerrno\fP にエラーの原因を示す値を設定する。 .SH エラー -.TP -.B EBADF -.\"O .I fd -.\"O is not a valid file descriptor or is not open for reading. -.I fd -が有効なファイル・ディスクリプタでない、または -読み込み用にオープンされていない。 -.TP -.B EINVAL -.\"O .I fd -.\"O does not refer to a file type to which -.\"O .BR readahead () -.\"O can be applied. -.I fd -が参照しているファイルが、 -.BR readahead () -を行うことができないタイプのファイルであった。 -.\"O .SH VERSIONS +.TP +\fBEBADF\fP +\fIfd\fP が有効なファイル・ディスクリプタでない、または 読み込み用にオープンされていない。 +.TP +\fBEINVAL\fP +\fIfd\fP が参照しているファイルが、 \fBreadahead\fP() を行うことができないタイプのファイルであった。 .SH バージョン -.\"O The -.\"O .BR readahead () -.\"O system call appeared in Linux 2.4.13; -.\"O glibc support has been provided since version 2.3. -.BR readahead () -システムコールは Linux 2.4.13 で登場した。 -glibc でのサポートは glibc バージョン 2.3 以降で行われている。 -.\"O .SH "CONFORMING TO" +\fBreadahead\fP() システムコールは Linux 2.4.13 で登場した。 glibc でのサポートは glibc バージョン 2.3 +以降で行われている。 .SH 準拠 -.\"O The -.\"O .BR readahead () -.\"O system call is Linux-specific, and its use should be avoided -.\"O in portable applications. -.BR readahead () -システムコールは Linux 固有であり、移植を考慮したプログラムでは -使用を避けるべきである。 -.\"O .SH "SEE ALSO" +\fBreadahead\fP() システムコールは Linux 固有であり、移植を考慮したプログラムでは 使用を避けるべきである。 .SH 関連項目 -.BR lseek (2), -.BR madvise (2), -.BR mmap (2), -.BR posix_fadvise (2), -.BR read (2) +\fBlseek\fP(2), \fBmadvise\fP(2), \fBmmap\fP(2), \fBposix_fadvise\fP(2), \fBread\fP(2) diff --git a/draft/man2/readdir.2 b/draft/man2/readdir.2 index 5f381dcb..76752850 100644 --- a/draft/man2/readdir.2 +++ b/draft/man2/readdir.2 @@ -25,80 +25,30 @@ .\" In 1.3.X, returns only one entry each time; return value is different. .\" Modified 2004-12-01, mtk, fixed headers listed in SYNOPSIS .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Sun Feb 23 21:06:24 JST 1997 -.\" by HANATAKA Shinya +.\"******************************************************************* .\" -.\"WORD: directory ディレクトリ -.\"WORD: entry エントリ -.\"WORD: kernel カーネル -.\"WORD: system call システム・コール -.\"WORD: memory メモリ -.\"WORD: inode number inode 番号 -.\"WORD: null ヌル文字 +.\" This file was generated with po4a. Translate the source file. .\" -.TH READDIR 2 2008-10-02 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH READDIR 2 2008\-10\-02 Linux "Linux Programmer's Manual" .SH 名前 -.\"O readdir \- read directory entry readdir \- ディレクトリ・エントリを読み込む -.\"O .SH SYNOPSIS .SH 書式 .nf .sp -.BI "int readdir(unsigned int " fd ", struct old_linux_dirent *" dirp "," -.BI " unsigned int " count ); +\fBint readdir(unsigned int \fP\fIfd\fP\fB, struct old_linux_dirent *\fP\fIdirp\fP\fB,\fP +\fB unsigned int \fP\fIcount\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O This is not the function you are interested in. -.\"O Look at -.\"O .BR readdir (3) -.\"O for the POSIX conforming C library interface. -.\"O This page documents the bare kernel system call interface, -.\"O which is superseded by -.\"O .BR getdents (2). -これはあなたの興味をもっている関数ではない。 -POSIX 準拠の C ライブラリ・インターフェースについては -.BR readdir (3) -を見ること。 -このページは裸のカーネルのシステムコール・インターフェースについて -記述しているが、このインターフェースは -.BR getdents (2) +これはあなたの興味をもっている関数ではない。 POSIX 準拠の C ライブラリ・インターフェースについては \fBreaddir\fP(3) を見ること。 +このページは裸のカーネルのシステムコール・インターフェースについて 記述しているが、このインターフェースは \fBgetdents\fP(2) によって取って代わられた。 .PP -.\"O .BR readdir () -.\"O reads one -.\"O .I old_linux_dirent -.\"O structure from the directory -.\"O referred to by the file descriptor -.\"O .I fd -.\"O into the buffer pointed to by -.\"O .IR dirp . -.\"O The argument -.\"O .I count -.\"O is ignored; at most one -.\"O .I old_linux_dirent -.\"O structure is read. -.BR readdir () -は、ファイルディスクリプタ -.I fd -が参照しているディレクトリから -.I old_linux_dirent -構造体を読み込み、 -.I dirp -で指されたバッファに格納する。 -.I count -引き数は(ほとんどの -.I old_linux_dirent +\fBreaddir\fP() は、ファイルディスクリプタ \fIfd\fP が参照しているディレクトリから \fIold_linux_dirent\fP +構造体を読み込み、 \fIdirp\fP で指されたバッファに格納する。 \fIcount\fP 引き数は(ほとんどの \fIold_linux_dirent\fP 構造体の読み込みにおいて)無視される .PP -.\"O The -.\"O .I old_linux_dirent -.\"O structure is declared as follows: -.I old_linux_dirent -構造体は以下のように宣言される: +\fIold_linux_dirent\fP 構造体は以下のように宣言される: .PP .in +4n .nf @@ -106,89 +56,36 @@ struct old_linux_dirent { long d_ino; /* inode number */ off_t d_off; /* offset to this \fIold_linux_dirent\fP */ unsigned short d_reclen; /* length of this \fId_name\fP */ - char d_name[NAME_MAX+1]; /* filename (null-terminated) */ + char d_name[NAME_MAX+1]; /* filename (null\-terminated) */ } .fi .in .PP -.\"O .I d_ino -.\"O is an inode number. -.\"O .I d_off -.\"O is the distance from the start of the directory to this -.\"O .IR old_linux_dirent . -.\"O .I d_reclen -.\"O is the size of -.\"O .IR d_name , -.\"O not counting the terminating null byte. -.\"O .I d_name -.\"O is a null-terminated filename. -.I d_ino -は inode 番号である。 -.I d_off -はディレクトリの最初からこの -.I old_linux_dirent -まで距離である。 -.I d_reclen -は -.I d_name -の大きさで、終端のヌルバイト (null byte) を含まない。 -.I d_name +\fId_ino\fP は inode 番号である。 \fId_off\fP はディレクトリの最初からこの \fIold_linux_dirent\fP まで距離である。 +\fId_reclen\fP は \fId_name\fP の大きさで、終端のヌルバイト (null byte) を含まない。 \fId_name\fP はヌルバイトで終わるファイル名である。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O On success, 1 is returned. -.\"O On end of directory, 0 is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合は、1 が返される。 -ディレクトリの最後では 0 が返される。 -エラーの場合は \-1 が返され、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS +成功した場合は、1 が返される。 ディレクトリの最後では 0 が返される。 エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP -.B EBADF -.\"O Invalid file descriptor -.\"O .IR fd . -ファイル・ディスクリプター -.I fd -が不正である。 -.TP -.B EFAULT -.\"O Argument points outside the calling process's address space. -引き数のポインターが呼び出したプロセスがアクセス可能な空間の -外部を指している。 -.TP -.B EINVAL -.\"O Result buffer is too small. -結果用のバッファーが小さ過ぎる。 -.TP -.B ENOENT -.\"O No such directory. +.TP +\fBEBADF\fP +ファイルディスクリプタ \fIfd\fP が不正である。 +.TP +\fBEFAULT\fP +引き数が呼び出したプロセスのアドレス空間外を指している。 +.TP +\fBEINVAL\fP +結果用のバッファーが小さすぎる。 +.TP +\fBENOENT\fP そのようなディレクトリは存在しない。 -.TP -.B ENOTDIR -.\"O File descriptor does not refer to a directory. -ファイル・ディスクリプターがディレクトリを参照していない。 -.\"O .SH "CONFORMING TO" +.TP +\fBENOTDIR\fP +ファイルディスクリプタがディレクトリを参照していない。 .SH 準拠 -.\"O This system call is Linux-specific. このシステム・コールは Linux 特有である。 -.\"O .SH NOTES .SH 注意 -.\"O Glibc does not provide a wrapper for this system call; call it using -.\"O .BR syscall (2). -glibc はこのシステムコールに対するラッパー関数を提供していない。 -.BR syscall (2) -を使って呼び出すこと。 -.\"O You will need to define the -.\"O .I old_linux_dirent -.\"O structure yourself. -.I old_linux_dirent -構造体を自分自身で定義する必要がある。 -.\"O .SH "SEE ALSO" +glibc はこのシステムコールに対するラッパー関数を提供していない。 \fBsyscall\fP(2) を使って呼び出すこと。 +\fIold_linux_dirent\fP 構造体を自分自身で定義する必要がある。 .SH 関連項目 -.BR getdents (2), -.BR readdir (3) +\fBgetdents\fP(2), \fBreaddir\fP(3) diff --git a/draft/man2/readlinkat.2 b/draft/man2/readlinkat.2 index aaffb0f1..b667c0d5 100644 --- a/draft/man2/readlinkat.2 +++ b/draft/man2/readlinkat.2 @@ -22,181 +22,70 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2006 Yuichi SATO -.\" all rights reserved. -.\" Translated 2006-09-27 by Yuichi SATO , LDP v2.39 .\" -.TH READLINKAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH READLINKAT 2 2009\-12\-13 Linux "Linux Programmer's Manual" .SH 名前 -.\"O readlinkat \- read value of a symbolic link relative to -.\"O a directory file descriptor -readlinkat \- ディレクトリファイルディスクリプタから相対的な位置にある -シンボリックリンクの値を読む -.\"O .SH SYNOPSIS +readlinkat \- ディレクトリファイルディスクリプタから相対的な位置にある シンボリックリンクの値を読む .SH 書式 .nf -.\"O .B #include /* Definition of AT_* constants */ -.B #include /* AT_* 定数の定義 */ -.B #include +\fB#include /* AT_* 定数の定義 */\fP +\fB#include \fP .sp -.BI "int readlinkat(int " dirfd ", const char *" pathname , -.BI " char *" buf ", size_t " bufsiz ); +\fBint readlinkat(int \fP\fIdirfd\fP\fB, const char *\fP\fIpathname\fP\fB,\fP +\fB char *\fP\fIbuf\fP\fB, size_t \fP\fIbufsiz\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR readlinkat (): +\fBreadlinkat\fP(): .PD 0 .ad l .RS 4 -.TP 4 -.\"O Since glibc 2.10: +.TP 4 glibc 2.10 以降: _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L -.TP -.\"O Before glibc 2.10: +.TP glibc 2.10 より前: _ATFILE_SOURCE .RE .ad .PD -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR readlinkat () -.\"O system call operates in exactly the same way as -.\"O .BR readlink (2), -.\"O except for the differences described in this manual page. -.BR readlinkat () -システムコールは、この man ページで説明している違いがある以外は、 -.BR readlink (2) +\fBreadlinkat\fP() システムコールは、この man ページで説明している違いがある以外は、 \fBreadlink\fP(2) と全く同じように動作する。 -.\"O If the pathname given in -.\"O .I pathname -.\"O is relative, then it is interpreted relative to the directory -.\"O referred to by the file descriptor -.\"O .I dirfd -.\"O (rather than relative to the current working directory of -.\"O the calling process, as is done by -.\"O .BR readlink (2) -.\"O for a relative pathname). -.I pathname -で指定されるパス名が相対パスである場合、 -ファイルディスクリプタ -.I dirfd -で参照されるディレクトリからの相対パス名として解釈される -.RB ( readlink (2) -では、相対パスは呼び出し元プロセスの +\fIpathname\fP で指定されるパス名が相対パスである場合、 ファイルディスクリプタ \fIdirfd\fP +で参照されるディレクトリからの相対パス名として解釈される (\fBreadlink\fP(2) では、相対パスは呼び出し元プロセスの カレントワーキングディレクトリからの相対パスとなる)。 -.\"O If -.\"O .I pathname -.\"O is relative and -.\"O .I dirfd -.\"O is the special value -.\"O .BR AT_FDCWD , -.\"O then -.\"O .I pathname -.\"O is interpreted relative to the current working -.\"O directory of the calling process (like -.\"O .BR readlink (2)). -.I pathname -が相対パスであり、かつ -.I dirfd -が特別な値 -.B AT_FDCWD -である場合、 -.I pathname -は -.RB ( readlink (2) -と同じように) 呼び出し元プロセスの -カレントワーキングディレクトリからの相対パス名として解釈される。 +\fIpathname\fP が相対パスであり、かつ \fIdirfd\fP が特別な値 \fBAT_FDCWD\fP である場合、 \fIpathname\fP は +(\fBreadlink\fP(2) と同じように) 呼び出し元プロセスの カレントワーキングディレクトリからの相対パス名として解釈される。 -.\"O If -.\"O .I pathname -.\"O is absolute, then -.\"O .I dirfd -.\"O is ignored. -.I pathname -が絶対パスである場合、 -.I dirfd -は無視される。 -.\"O .SH "RETURN VALUE" +\fIpathname\fP が絶対パスである場合、 \fIdirfd\fP は無視される。 .SH 返り値 -.\"O On success, -.\"O .BR readlinkat () -.\"O returns the number of bytes placed in -.\"O .IR buf . -成功した場合、 -.BR readlinkat () -は -.I buf -に格納されたバイト数を返す。 -.\"O On error, \-1 is returned and -.\"O .I errno -.\"O is set to indicate the error. -エラーの場合、\-1 が返されて、 -.I errno +成功した場合、 \fBreadlinkat\fP() は \fIbuf\fP に格納されたバイト数を返す。 エラーの場合、\-1 が返されて、 \fIerrno\fP にはエラーを示す値が設定される。 -.\"O .SH ERRORS .SH エラー -.\"O The same errors that occur for -.\"O .BR readlink (2) -.\"O can also occur for -.\"O .BR readlinkat (). -.BR readlink (2) -と同じエラーが -.BR readlinkat () -でも起こる。 -.\"O The following additional errors can occur for -.\"O .BR readlinkat (): -.BR readlinkat () +\fBreadlink\fP(2) と同じエラーが \fBreadlinkat\fP() でも起こる。 \fBreadlinkat\fP() では、その他に以下のエラーが起こる: -.TP -.B EBADF -.\"O .I dirfd -.\"O is not a valid file descriptor. -.I dirfd -が有効なファイルディスクリプタでない。 -.TP -.B ENOTDIR -.\"O .I pathname -.\"O is relative and -.\"O .I dirfd -.\"O is a file descriptor referring to a file other than a directory. -.I pathname -が相対パスで、かつ -.I dirfd -がディレクトリ以外のファイルを参照するファイルディスクリプタである。 -.\"O .SH VERSIONS +.TP +\fBEBADF\fP +\fIdirfd\fP が有効なファイルディスクリプタでない。 +.TP +\fBENOTDIR\fP +\fIpathname\fP が相対パスで、かつ \fIdirfd\fP がディレクトリ以外のファイルを参照するファイルディスクリプタである。 .SH バージョン -.\"O .BR readlinkat () -.\"O was added to Linux in kernel 2.6.16. -.BR readlinkat () -は Linux カーネル 2.6.16 で追加された。 -.\"O .SH "CONFORMING TO" +\fBreadlinkat\fP() は Linux カーネル 2.6.16 で追加された。 .SH 準拠 -POSIX.1-2008. -.\"O .SH NOTES +POSIX.1\-2008. .SH 注意 -.\"O See -.\"O .BR openat (2) -.\"O for an explanation of the need for -.\"O .BR readlinkat (). -.BR readlinkat () -が必要な理由については、 -.BR openat (2) -を参照すること。 -.\"O .SH "SEE ALSO" +\fBreadlinkat\fP() が必要な理由については、 \fBopenat\fP(2) を参照すること。 .SH 関連項目 -.BR openat (2), -.BR readlink (2), -.BR path_resolution (7) +\fBopenat\fP(2), \fBreadlink\fP(2), \fBpath_resolution\fP(7) diff --git a/draft/man2/recv.2 b/draft/man2/recv.2 index 8fda27e8..50097818 100644 --- a/draft/man2/recv.2 +++ b/draft/man2/recv.2 @@ -29,318 +29,94 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: recv.2,v 1.8 2001/08/15 18:00:48 hanataka Exp $ +.\" $Id: recv.2,v 1.3 1999/05/13 11:33:38 freitag Exp $ .\" .\" Modified Sat Jul 24 00:22:20 1993 by Rik Faith .\" Modified Tue Oct 22 17:45:19 1996 by Eric S. Raymond .\" Modified 1998,1999 by Andi Kleen .\" 2001-06-19 corrected SO_EE_OFFENDER, bug report by James Hawtin .\" -.\" Japanese Version Copyright (c) 1996 Akira Yoshiyama -.\" all rights reserved. -.\" Translated 1996-07-18, Akira Yoshiyama -.\" Modified 1997-12-14, HANATAKA Shinya -.\" Modified 1999-08-14, HANATAKA Shinya -.\" Updated & Modified 2000-10-12, HAYAKAWA Hitoshi -.\" and NAKANO Takeo -.\" Updated & Modified 2001-02-09, NAKANO Takeo -.\" Updated 2003-10-11, Kentaro Shirakata -.\" Updated 2005-03-14, Akihiro MOTOKI -.\" Updated 2006-04-15, Akihiro MOTOKI, Catch up to LDP v2.29 -.\" Updated 2007-10-12, Akihiro MOTOKI, LDP v2.66 -.\" Updated 2008-08-06, Akihiro MOTOKI, LDP v3.05 -.\" Updated 2009-04-13, Akihiro MOTOKI, LDP v3.20 +.\"******************************************************************* .\" -.\"WORD: ancillary data 補助データ -.\"WORD: ancillary message 補助メッセージ -.\"WORD: invalid 不正な +.\" This file was generated with po4a. Translate the source file. .\" -.TH RECV 2 2011-09-16 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O recv, recvfrom, recvmsg \- receive a message from a socket +.\"******************************************************************* +.TH RECV 2 2011\-09\-16 Linux "Linux Programmer's Manual" .SH 名前 recv, recvfrom, recvmsg \- ソケットからメッセージを受け取る -.\"O .SH SYNOPSIS .SH 書式 .\" .B #include .\" .br .nf -.B #include +\fB#include \fP .br -.B #include +\fB#include \fP .sp -.BI "ssize_t recv(int " sockfd ", void *" buf ", size_t " len ", int " flags ); +\fBssize_t recv(int \fP\fIsockfd\fP\fB, void *\fP\fIbuf\fP\fB, size_t \fP\fIlen\fP\fB, int \fP\fIflags\fP\fB);\fP .sp -.BI "ssize_t recvfrom(int " sockfd ", void *" buf ", size_t " len ", int " flags , -.BI " struct sockaddr *" src_addr ", socklen_t *" addrlen ); +\fBssize_t recvfrom(int \fP\fIsockfd\fP\fB, void *\fP\fIbuf\fP\fB, size_t \fP\fIlen\fP\fB, int \fP\fIflags\fP\fB,\fP +\fB struct sockaddr *\fP\fIsrc_addr\fP\fB, socklen_t *\fP\fIaddrlen\fP\fB);\fP .sp -.BI "ssize_t recvmsg(int " sockfd ", struct msghdr *" msg ", int " flags ); +\fBssize_t recvmsg(int \fP\fIsockfd\fP\fB, struct msghdr *\fP\fImsg\fP\fB, int \fP\fIflags\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR recvfrom () -.\"O and -.\"O .BR recvmsg () -.\"O calls are used to receive messages from a socket, and may be used -.\"O to receive data on a socket whether or not it is connection-oriented. -.BR recvfrom () -と -.BR recvmsg () -コールは、ソケットからメッセージを受け取るのに使用する。 -またソケットのデータ受信にも使うことができ、 -このときソケットは接続指向 (connection-oriened) であってもなくてもよい。 +\fBrecvfrom\fP() と \fBrecvmsg\fP() コールは、ソケットからメッセージを受け取るのに使用する。 +またソケットのデータ受信にも使うことができ、 このときソケットは接続指向 (connection\-oriened) であってもなくてもよい。 .PP -.\"O If -.\"O .I src_addr -.\"O is not NULL, and the underlying protocol provides the source address, -.\"O this source address is filled in. -.\"O When -.\"O .I src_addr -.\"O is NULL, nothing is filled in; in this case, -.\"O .I addrlen -.\"O is not used, and should also be NULL. -.\"O .\" (Note: for datagram sockets in both the UNIX and Internet domains, -.\"O .\" .I src_addr -.\"O .\" is filled in. -.\"O .\" .I src_addr -.\"O .\" is also filled in for stream sockets in the UNIX domain, but is not -.\"O .\" filled in for stream sockets in the Internet domain.) -.\"O .\" [The above notes on AF_UNIX and AF_INET sockets apply as at -.\"O .\" Kernel 2.4.18. (MTK, 22 Jul 02)] -.I src_addr -が NULL 以外で、下層のプロトコルから送信元アドレスが分かる場合、 -.I src_addr -にはこの送信元アドレスが入れられる。 -.I src_addr -が NULL の場合、 -.I src_addr -には何も入らない。この場合、 -.I addrlen -は使用されず、この引き数は NULL にしておくべきである。 -.\" (UNIX ドメインとインターネットドメインのどちらのデータグラムソケットでも +.\" (Note: for datagram sockets in both the UNIX and Internet domains, .\" .I src_addr -.\" に送信元アドレスが入れられる。また、UNIX ドメインのストリームソケットでも -.\" 同様だが、インターネットドメインのストリームソケットでは +.\" is filled in. .\" .I src_addr -.\" にアドレスが入れられない。) -.\" [上記の AF_UNIX と AF_INET ソケットに関する注記はカーネル 2.4.18 での -.\" 動作と同じである。 (MTK, 22 Jul 02)] -.\"O The argument -.\"O .I addrlen -.\"O is a value-result argument, -.\"O which the caller should initialize before the call to -.\"O the size of the buffer associated with -.\"O .IR src_addr , -.\"O and modified on return to indicate the actual size of the source address. -.\"O The returned address is truncated if the buffer provided is too small; -.\"O in this case, -.\"O .I addrlen -.\"O will return a value greater than was supplied to the call. -引き数 -.I addrlen -は入出力両用の引き数である。呼び出し時には、呼び出し元が -.I src_addr -に割り当てたバッファの大きさで初期化しておくべきである。 -返ってくる時には、送信元アドレスの実際の大きさに変更される。 -渡されたバッファが小さ過ぎる場合には、返されるアドレスの末尾は -切り詰められる。この場合には、 -.I addrlen -では、呼び出し時に渡された値よりも大きな値が返される。 +.\" is also filled in for stream sockets in the UNIX domain, but is not +.\" filled in for stream sockets in the Internet domain.) +.\" [The above notes on AF_UNIX and AF_INET sockets apply as at +.\" Kernel 2.4.18. (MTK, 22 Jul 02)] +\fIsrc_addr\fP が NULL 以外で、下層のプロトコルから送信元アドレスが分かる場合、 \fIsrc_addr\fP +にはこの送信元アドレスが入れられる。 \fIsrc_addr\fP が NULL の場合、 \fIsrc_addr\fP には何も入らない。この場合、 +\fIaddrlen\fP は使用されず、この引き数は NULL にしておくべきである。 引き数 \fIaddrlen\fP +は入出力両用の引き数である。呼び出し時には、呼び出し元が \fIsrc_addr\fP に割り当てたバッファの大きさで初期化しておくべきである。 +返ってくる時には、送信元アドレスの実際の大きさに変更される。 渡されたバッファが小さ過ぎる場合には、返されるアドレスの末尾は +切り詰められる。この場合には、 \fIaddrlen\fP では、呼び出し時に渡された値よりも大きな値が返される。 .PP -.\"O The -.\"O .BR recv () -.\"O call is normally used only on a -.\"O .I connected -.\"O socket (see -.\"O .BR connect (2)) -.\"O and is identical to -.\"O .BR recvfrom () -.\"O with a NULL -.\"O .I src_addr -.\"O argument. -.BR recv () -コールは通常 -.I 接続済みの (connected) -ソケット -.RB ( connect (2) -を参照) についてのみ使用され、 -.I src_addr -引き数に NULL を指定した -.BR recvfrom () -と等価である。 +\fBrecv\fP() コールは通常 \fI接続済みの (connected)\fP ソケット (\fBconnect\fP(2) を参照) についてのみ使用され、 +\fIsrc_addr\fP 引き数に NULL を指定した \fBrecvfrom\fP() と等価である。 .PP -.\"O All three routines return the length of the message on successful -.\"O completion. -.\"O If a message is too long to fit in the supplied buffer, excess -.\"O bytes may be discarded depending on the type of socket the message is -.\"O received from. -これらの三つのルーチンはいずれも、成功した場合にはメッセージの長さを返す。 -メッセージが長過ぎて指定されたバッファに入り切らなかった場合には、 -メッセージを受信したソケットの種類によっては余分のバイトが捨てられる -かもしれない。 +これらの三つのルーチンはいずれも、成功した場合にはメッセージの長さを返す。 メッセージが長過ぎて指定されたバッファに入り切らなかった場合には、 +メッセージを受信したソケットの種類によっては余分のバイトが捨てられる かもしれない。 .PP -.\"O If no messages are available at the socket, the receive calls wait for a -.\"O message to arrive, unless the socket is nonblocking (see -.\"O .BR fcntl (2)), -.\"O in which case the value \-1 is returned and the external variable -.\"O .I errno -.\"O is set to -.\"O .BR EAGAIN " or " EWOULDBLOCK . -.\"O The receive calls normally return any data available, up to the requested -.\"O amount, rather than waiting for receipt of the full amount requested. -ソケットに受け取るメッセージが存在しなかった場合、 -受信用のコールはメッセージが到着するまで待つ。 -ただし、ソケットが非停止 (nonblocking) -に設定されていた場合 -.RB ( fcntl (2) -を参照) は \-1 を返し、外部変数 -.I errno -に -.B EAGAIN -か -.B EWOULDBLOCK -を設定する。 -これらの受信用のコールは、受信したデータのサイズが要求したサイズに -達するまで待つのではなく、何らかのデータを受信すると復帰する -(受信されるデータの最大サイズは要求したサイズである)。 +ソケットに受け取るメッセージが存在しなかった場合、 受信用のコールはメッセージが到着するまで待つ。 ただし、ソケットが非停止 (nonblocking) +に設定されていた場合 (\fBfcntl\fP(2) を参照) は \-1 を返し、外部変数 \fIerrno\fP に \fBEAGAIN\fP か +\fBEWOULDBLOCK\fP を設定する。 これらの受信用のコールは、受信したデータのサイズが要求したサイズに +達するまで待つのではなく、何らかのデータを受信すると復帰する (受信されるデータの最大サイズは要求したサイズである)。 .PP -.\"O The -.\"O .BR select (2) -.\"O or -.\"O .BR poll (2) -.\"O call may be used to determine when more data arrives. -.BR select (2) -や -.BR poll (2) -コールを使って、次のデータがいつ届くかを判断できる。 +\fBselect\fP(2) や \fBpoll\fP(2) コールを使って、次のデータがいつ届くかを判断できる。 .PP -.\"O The -.\"O .I flags -.\"O argument to a -.\"O .BR recv () -.\"O call is formed by ORing one or more of the following values: -.BR recv () -コールの -.I flags -引き数には、以下の値を 1つ以上、ビット単位の論理和 -を取ったものを指定する: -.TP -.\"O .BR MSG_CMSG_CLOEXEC " (" recvmsg "() only; since Linux 2.6.23)" -.BR MSG_CMSG_CLOEXEC " (" recvmsg "() のみ; Linux 2.6.23)" -.\"O Set the close-on-exec flag for the file descriptor received -.\"O via a UNIX domain file descriptor using the -.\"O .B SCM_RIGHTS -.\"O operation (described in -.\"O .BR unix (7)). -.\"O This flag is useful for the same reasons as the -.\"O .B O_CLOEXEC -.\"O flag of -.\"O .BR open (2). -.RB ( unix (7) -で説明されている) -.B SCM_RIGHTS -操作を使って UNIX ドメインのファイルディスクリプタ経由で受信した -ファイルディスクリプタについて close-on-exec フラグをセットする。 -このフラグは、 -.BR open (2) -の -.B O_CLOEXEC +\fBrecv\fP() コールの \fIflags\fP 引き数には、以下の値を 1つ以上、ビット単位の論理和 を取ったものを指定する: +.TP +\fBMSG_CMSG_CLOEXEC\fP (\fBrecvmsg\fP() のみ; Linux 2.6.23) +(\fBunix\fP(7) で説明されている) \fBSCM_RIGHTS\fP 操作を使って UNIX ドメインのファイルディスクリプタ経由で受信した +ファイルディスクリプタについて close\-on\-exec フラグをセットする。 このフラグは、 \fBopen\fP(2) の \fBO_CLOEXEC\fP フラグと同じ理由で有用である。 -.TP -.\"O .BR MSG_DONTWAIT " (since Linux 2.2)" -.BR MSG_DONTWAIT " (Linux 2.2 以降)" -.\"O Enables nonblocking operation; if the operation would block, -.\"O the call fails with the error -.\"O .BR EAGAIN " or " EWOULDBLOCK -.\"O (this can also be enabled using the -.\"O .B O_NONBLOCK -.\"O flag with the -.\"O .B F_SETFL -.\"O .BR fcntl (2)). -非停止 (nonblocking) 操作を有効にする。 -操作が停止するような場合にエラー -.B EAGAIN -か -.B EWOULDBLOCK -で呼び出しが失敗する -.RB ( fcntl (2) -の -.B F_SETFL -で -.B O_NONBLOCK +.TP +\fBMSG_DONTWAIT\fP (Linux 2.2 以降) +非停止 (nonblocking) 操作を有効にする。 操作が停止するような場合にエラー \fBEAGAIN\fP か \fBEWOULDBLOCK\fP +で呼び出しが失敗する (\fBfcntl\fP(2) の \fBF_SETFL\fP で \fBO_NONBLOCK\fP フラグを指定することによっても有効にできる)。 -.TP -.\"O .BR MSG_ERRQUEUE " (since Linux 2.2)" -.BR MSG_ERRQUEUE " (Linux 2.2 以降)" -.\"O This flag -.\"O specifies that queued errors should be received from the socket error queue. -.\"O The error is passed in -.\"O an ancillary message with a type dependent on the protocol (for IPv4 -.\"O .BR IP_RECVERR ). -.\"O The user should supply a buffer of sufficient size. -.\"O See -.\"O .BR cmsg (3) -.\"O and -.\"O .BR ip (7) -.\"O for more information. -このフラグを指定すると、 -キューに入れられたエラーをソケットのエラーキューから取りだせるようになる。 -このエラーは補助メッセージに組み込まれて渡され、 -この補助メッセージの種別はプロトコルに依存する -(IPv4 の場合は -.BR IP_RECVERR )。 -ユーザは十分なサイズのバッファを用意しなければならない。 -補助メッセージに関するより詳細な情報は -.BR cmsg (3) -および -.BR ip (7) -を参照のこと。 -.\"O The payload of the original packet that caused the error -.\"O is passed as normal data via -.\"O .IR msg_iovec . -.\"O The original destination address of the datagram that caused the error -.\"O is supplied via -.\"O .IR msg_name . -エラーの原因となったオリジナルパケットのペイロードは、 -.I msg_iovec -経由で通常のデータとして渡される。 -エラーを起こしたデータグラムのオリジナルの宛先アドレスは、 -.I msg_name -経由で参照できる。 +.TP +\fBMSG_ERRQUEUE\fP (Linux 2.2 以降) +このフラグを指定すると、 キューに入れられたエラーをソケットのエラーキューから取りだせるようになる。 このエラーは補助メッセージに組み込まれて渡され、 +この補助メッセージの種別はプロトコルに依存する (IPv4 の場合は \fBIP_RECVERR\fP)。 +ユーザは十分なサイズのバッファを用意しなければならない。 補助メッセージに関するより詳細な情報は \fBcmsg\fP(3) および \fBip\fP(7) +を参照のこと。 エラーの原因となったオリジナルパケットのペイロードは、 \fImsg_iovec\fP 経由で通常のデータとして渡される。 +エラーを起こしたデータグラムのオリジナルの宛先アドレスは、 \fImsg_name\fP 経由で参照できる。 .IP -.\"O For local errors, no address is passed (this can be checked with the -.\"O .I cmsg_len -.\"O member of the -.\"O .IR cmsghdr ). -.\"O For error receives, the -.\"O .B MSG_ERRQUEUE -.\"O is set in the -.\"O .IR msghdr . -.\"O After an error has been passed, the pending socket error -.\"O is regenerated based on the next queued error and will be passed -.\"O on the next socket operation. ローカルなエラーの場合はアドレスは渡されない -(これは -.I cmsghdr -の -.I cmsg_len -メンバーでチェックできる)。 -受信エラーの場合は -.B MSG_ERRQUIE -が -.I msghdr -にセットされる。 +(これは \fIcmsghdr\fP の \fIcmsg_len\fP メンバーでチェックできる)。 +受信エラーの場合は \fBMSG_ERRQUIE\fP が \fImsghdr\fP にセットされる。 エラーが渡された後には、キューに入っている次のエラーに基いて、 処理待ちのソケット・エラーが再生成され、次のソケット操作の際に渡される。 -.IP -.\"O The error is supplied in a -.\"O .I sock_extended_err -.\"O structure: -このエラーは -.I sock_extended_err -構造体で提供される: +このエラーは \fIsock_extended_err\fP 構造体で提供される: .in +4n .nf @@ -365,150 +141,40 @@ struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *); .fi .in .IP -.\"O .I ee_errno -.\"O contains the -.\"O .I errno -.\"O number of the queued error. -.I ee_errno -にはキューに入れられたエラーの -.I errno -が入っている。 -.\"O .I ee_origin -.\"O is the origin code of where the error originated. -.I ee_origin -にはエラーが発生した場所のオリジン・コード (origin code) が入っている。 -.\"O The other fields are protocol-specific. -.\"O The macro -.\"O .B SOCK_EE_OFFENDER -.\"O returns a pointer to the address of the network object -.\"O where the error originated from given a pointer to the ancillary message. -.\"O If this address is not known, the -.\"O .I sa_family -.\"O member of the -.\"O .I sockaddr -.\"O contains -.\"O .B AF_UNSPEC -.\"O and the other fields of the -.\"O .I sockaddr -.\"O are undefined. -.\"O The payload of the packet that caused the error is passed as normal data. -他のフィールドはプロトコル依存である。 -.B SO_EE_OFFENDER -マクロは、この補助的なメッセージを引き数に取って、 -エラーの発生したネットワークオブジェクトのアドレスへのポインタを返す。 -アドレスが不明の場合には、 -.I sockaddr -の -.I sa_family -メンバーが -.B AF_UNSPEC -になっている。 -.I sockaddr -の他のフィールドは不定である。 +\fIee_errno\fP にはキューに入れられたエラーの \fIerrno\fP が入っている。 \fIee_origin\fP +にはエラーが発生した場所のオリジン・コード (origin code) が入っている。 他のフィールドはプロトコル依存である。 +\fBSO_EE_OFFENDER\fP マクロは、この補助的なメッセージを引き数に取って、 +エラーの発生したネットワークオブジェクトのアドレスへのポインタを返す。 アドレスが不明の場合には、 \fIsockaddr\fP の \fIsa_family\fP +メンバーが \fBAF_UNSPEC\fP になっている。 \fIsockaddr\fP の他のフィールドは不定である。 エラーの発生したパケットのペイロードは通常のデータとして渡される。 .IP -.\"O For local errors, no address is passed (this -.\"O can be checked with the -.\"O .I cmsg_len -.\"O member of the -.\"O .IR cmsghdr ). -.\"O For error receives, -.\"O the -.\"O .B MSG_ERRQUEUE -.\"O is set in the -.\"O .IR msghdr . -.\"O After an error has been passed, the pending socket error -.\"O is regenerated based on the next queued error and will be passed -.\"O on the next socket operation. -ローカルでのエラーの場合にはアドレスは渡されない (これは -.I cmsghdr -の -.I cmsg_len -メンバーでチェックできる)。 -エラーを受け取った場合、 -.B MSG_ERRQUEUE -が -.I msghdr -に設定される。 -エラーが渡された後には、 -処理待ちになっていたソケット・エラーが、キューに入っている -次のエラーに基づいて再生成され、次のソケット操作の際に渡される。 -.TP -.B MSG_OOB -.\"O This flag requests receipt of out-of-band data that would not be received -.\"O in the normal data stream. -.\"O Some protocols place expedited data -.\"O at the head of the normal data queue, and thus this flag cannot -.\"O be used with such protocols. -このフラグは、通常のデータ・ストリームでは受信できない -帯域外 (out-of-band) データの受信を要求する。 -プロトコルによっては、 -通常のデータ・キューの先頭に速達データを置くものがあるが、 -そのようなプロトコルではこのフラグは使用できない。 -.TP -.B MSG_PEEK -.\"O This flag causes the receive operation to -.\"O return data from the beginning of the -.\"O receive queue without removing that data from the queue. -.\"O Thus, a -.\"O subsequent receive call will return the same data. -このフラグを指定すると、 -受信キューの最初のデータを返すとき、キューからデータを削除しない。 +ローカルなエラーの場合はアドレスは渡されない +(これは \fIcmsghdr\fP の \fIcmsg_len\fP メンバーでチェックできる)。 +受信エラーの場合は \fBMSG_ERRQUIE\fP が \fImsghdr\fP にセットされる。 +エラーが渡された後には、キューに入っている次のエラーに基いて、 +処理待ちのソケット・エラーが再生成され、次のソケット操作の際に渡される。 +.TP +\fBMSG_OOB\fP +このフラグは、通常のデータ・ストリームでは受信できない 帯域外 (out\-of\-band) データの受信を要求する。 プロトコルによっては、 +通常のデータ・キューの先頭に速達データを置くものがあるが、 そのようなプロトコルではこのフラグは使用できない。 +.TP +\fBMSG_PEEK\fP +このフラグを指定すると、 受信キューの最初のデータを返すとき、キューからデータを削除しない。 したがって、この後でもう一度受信コールを呼び出すと、同じデータが返ることになる。 -.TP -.\"O .BR MSG_TRUNC " (since Linux 2.2)" -.BR MSG_TRUNC " (Linux 2.2 以降)" -.\"O For raw -.\"O .RB ( AF_PACKET ), -.\"O Internet datagram (since Linux 2.4.27/2.6.8), -.\"O and netlink (since Linux 2.6.22) sockets: -.\"O return the real length of the packet or datagram, -.\"O even when it was longer than the passed buffer. -.\"O Not implemented for UNIX domain -.\"O .RB ( unix (7)) -.\"O sockets. -raw ソケット -.RB ( AF_PACKET )、 -Internet datagram ソケット (Linux 2.4.27/2.6.8 以降)、 -netlink (Linux 2.6.22 以降) ソケットの場合、 -パケットやデータグラムの長さが渡したバッファよりも長かった場合にも、 -パケットやデータグラムの実際の長さを返す。 -UNIX ドメインソケット -.RB ( unix (7)) -ソケットについては実装されていない。 +.TP +\fBMSG_TRUNC\fP (Linux 2.2 以降) +raw ソケット (\fBAF_PACKET\fP)、 Internet datagram ソケット (Linux 2.4.27/2.6.8 以降)、 +netlink (Linux 2.6.22 以降) ソケットの場合、 パケットやデータグラムの長さが渡したバッファよりも長かった場合にも、 +パケットやデータグラムの実際の長さを返す。 UNIX ドメインソケット (\fBunix\fP(7)) ソケットについては実装されていない。 -.\"O For use with Internet stream sockets, see -.\"O .BR tcp (7). -Internet ストリームソケットでの利用については -.BR tcp (7) -を参照。 -.TP -.\"O .BR MSG_WAITALL " (since Linux 2.2)" -.BR MSG_WAITALL " (Linux 2.2 以降)" -.\"O This flag requests that the operation block until the full request is -.\"O satisfied. -.\"O However, the call may still return less data than requested if -.\"O a signal is caught, an error or disconnect occurs, or the next data to be -.\"O received is of a different type than that returned. -このフラグは、要求した量いっぱいのデータが到着するまで、 -操作を停止 (block) するよう要求する。 -但し、シグナルを受信したり、エラーや切断 (disconnect) が発生したり、 -次に受信されるデータが異なる型だったりした場合には、 -要求した量よりデータが少なくても返ることがある。 +Internet ストリームソケットでの利用については \fBtcp\fP(7) を参照。 +.TP +\fBMSG_WAITALL\fP (Linux 2.2 以降) +このフラグは、要求した量いっぱいのデータが到着するまで、 操作を停止 (block) するよう要求する。 但し、シグナルを受信したり、エラーや切断 +(disconnect) が発生したり、 次に受信されるデータが異なる型だったりした場合には、 要求した量よりデータが少なくても返ることがある。 .PP -.\"O The -.\"O .BR recvmsg () -.\"O call uses a -.\"O .I msghdr -.\"O structure to minimize the number of directly supplied arguments. -.\"O This structure is defined as follows in -.\"O .IR : -.BR recvmsg () -コールは、直接渡す引き数の数を減らすために -.I msghdr -構造体を使用する。この構造体は -.I -で以下のように定義されている: +\fBrecvmsg\fP() コールは、直接渡す引き数の数を減らすために \fImsghdr\fP 構造体を使用する。この構造体は +\fI\fP で以下のように定義されている: .in +4n .nf @@ -518,72 +184,24 @@ struct iovec { /* Scatter/gather array items */ }; struct msghdr { - void *msg_name; /* optional address */ - socklen_t msg_namelen; /* size of address */ - struct iovec *msg_iov; /* scatter/gather array */ - size_t msg_iovlen; /* # elements in msg_iov */ - void *msg_control; /* ancillary data, see below */ - size_t msg_controllen; /* ancillary data buffer len */ - int msg_flags; /* flags on received message */ + void *msg_name; /* 追加のアドレス */ + socklen_t msg_namelen; /* アドレスのサイズ */ + struct iovec *msg_iov; /* scatter/gather 配列 */ + size_t msg_iovlen; /* msg_iov の要素数 */ + void *msg_control; /* 補助データ (後述) */ + size_t msg_controllen; /* 補助データバッファ長 */ + int msg_flags; /* 受信メッセージのフラグ */ }; .fi .in .PP -.\"O Here -.\"O .I msg_name -.\"O and -.\"O .I msg_namelen -.\"O specify the source address if the socket is unconnected; -.\"O .I msg_name -.\"O may be given as a NULL pointer if no names are desired or required. -.I msg_name -と -.I msg_namelen -は、ソケットが接続されていない場合に送信元のアドレスを指定する。 -名前が必要ない場合には -.I msg_name -に NULL ポインタを指定する。 -.\"O The fields -.\"O .I msg_iov -.\"O and -.\"O .I msg_iovlen -.\"O describe scatter-gather locations, as discussed in -.\"O .BR readv (2). -.I msg_iov -と -.I msg_iovlen -フィールドは -.BR readv (2) -に記述されているような分解/結合用のベクトル (scatter-gather locations) -を指定する。 -.\"O The field -.\"O .IR msg_control , -.\"O which has length -.\"O .IR msg_controllen , -.\"O points to a buffer for other protocol control-related messages or -.\"O miscellaneous ancillary data. -.\"O When -.\"O .BR recvmsg () -.\"O is called, -.\"O .I msg_controllen -.\"O should contain the length of the available buffer in -.\"O .IR msg_control ; -.\"O upon return from a successful call it will contain the length -.\"O of the control message sequence. -.I msg_control -フィールドは -.I msg_controllen -の長さを持ち、他のプロトコル制御メッセージや -種々の補助データのためのバッファへのポインタである。 -.BR recvmsg () -を呼ぶ際には、 -.I msg_controllen -に -.I msg_control -のバッファの長さを入れておく必要がある。 -コールが成功して返った場合、制御メッセージ列の長さが入っている。 +\fImsg_name\fP と \fImsg_namelen\fP は、ソケットが接続されていない場合に送信元のアドレスを指定する。 名前が必要ない場合には +\fImsg_name\fP に NULL ポインタを指定する。 \fImsg_iov\fP と \fImsg_iovlen\fP フィールドは \fBreadv\fP(2) +に記述されているような分解/結合用のベクトル (scatter\-gather locations) を指定する。 \fImsg_control\fP +フィールドは \fImsg_controllen\fP の長さを持ち、他のプロトコル制御メッセージや 種々の補助データのためのバッファへのポインタである。 +\fBrecvmsg\fP() を呼ぶ際には、 \fImsg_controllen\fP に \fImsg_control\fP +のバッファの長さを入れておく必要がある。 コールが成功して返った場合、制御メッセージ列の長さが入っている。 .PP -.\"O The messages are of the form: メッセージの形式は以下の通り: .in +4n .nf @@ -591,263 +209,96 @@ struct msghdr { struct cmsghdr { socklen_t cmsg_len; /* data byte count, including hdr */ int cmsg_level; /* originating protocol */ - int cmsg_type; /* protocol-specific type */ + int cmsg_type; /* protocol\-specific type */ /* followed by unsigned char cmsg_data[]; */ }; .fi .in .PP -.\"O Ancillary data should only be accessed by the macros defined in -.\"O .BR cmsg (3). -補助データは、 -.BR cmsg (3) -に定義されたマクロ経由でのみアクセスすべきである。 +補助データは、 \fBcmsg\fP(3) に定義されたマクロ経由でのみアクセスすべきである。 .PP -.\"O As an example, Linux uses this ancillary data mechanism to pass extended -.\"O errors, IP options or file descriptors over UNIX domain sockets. -例をあげると、 Linux はこの補助データのメカニズムを、 -UNIX ドメインソケット上での拡張エラーや IP オプション、 +例をあげると、 Linux はこの補助データのメカニズムを、 UNIX ドメインソケット上での拡張エラーや IP オプション、 ファイル・ディスクリプタの受け渡しに利用している。 .PP -.\"O The -.\"O .I msg_flags -.\"O field in the -.\"O .I msghdr -.\"O is set on return of -.\"O .BR recvmsg (). -.\"O It can contain several flags: -.I msghdr -の -.I msg_flags -フィールドは -.BR recvmsg () +\fImsghdr\fP の \fImsg_flags\fP フィールドは \fBrecvmsg\fP() からのリターン時に設定される。ここにはいくつかのフラグが入る。 -.TP -.B MSG_EOR -.\"O indicates end-of-record; the data returned completed a record (generally -.\"O used with sockets of type -.\"O .BR SOCK_SEQPACKET ). -これはレコードの終り (end-of-record) を示し、 -返されたデータが完全なレコードであることを示す (一般的には -.B SOCK_SEQPACKET -型のソケットで使用される)。 -.TP -.B MSG_TRUNC -.\"O indicates that the trailing portion of a datagram was discarded because the -.\"O datagram was larger than the buffer supplied. -データグラムが与えられたバッファより大きかったために、 -データグラムのはみ出した部分が捨てられたことを示す。 -.TP -.B MSG_CTRUNC -.\"O indicates that some control data were discarded due to lack of space in the -.\"O buffer for ancillary data. -補助データのためのバッファが不足したために、 -制御データの一部が捨てられたことを示す。 -.TP -.B MSG_OOB -.\"O is returned to indicate that expedited or out-of-band data were received. +.TP +\fBMSG_EOR\fP +これはレコードの終り (end\-of\-record) を示し、 返されたデータが完全なレコードであることを示す (一般的には +\fBSOCK_SEQPACKET\fP 型のソケットで使用される)。 +.TP +\fBMSG_TRUNC\fP +データグラムが与えられたバッファより大きかったために、 データグラムのはみ出した部分が捨てられたことを示す。 +.TP +\fBMSG_CTRUNC\fP +補助データのためのバッファが不足したために、 制御データの一部が捨てられたことを示す。 +.TP +\fBMSG_OOB\fP 速達データや帯域外データを受信したことを示す。 -.TP -.B MSG_ERRQUEUE -.\"O indicates that no data was received but an extended error from the socket -.\"O error queue. -データは受信しなかったが -ソケットのエラー・キューから拡張エラーを受信したことを示す。 -.\"O .SH "RETURN VALUE" +.TP +\fBMSG_ERRQUEUE\fP +データは受信しなかったが ソケットのエラー・キューから拡張エラーを受信したことを示す。 .SH 返り値 -.\"O These calls return the number of bytes received, or \-1 -.\"O if an error occurred. -.\"O The return value will be 0 when the -.\"O peer has performed an orderly shutdown. -これらのコールは受信したバイト数を返す。 -エラーの場合は \-1 を返す。 -接続先が正しくシャットダウンを実行した場合は、返り値は 0 となる。 -.\"O .SH ERRORS +これらのコールは受信したバイト数を返す。 エラーの場合は \-1 を返す。 接続先が正しくシャットダウンを実行した場合は、返り値は 0 となる。 .SH エラー -.\"O These are some standard errors generated by the socket layer. -.\"O Additional errors -.\"O may be generated and returned from the underlying protocol modules; -.\"O see their manual pages. -これらはソケット層で発生する一般的なエラーである。 -他のエラーが下層のプロトコル・モジュールで生成され、 -返されるかもしれない。 +これらはソケット層で発生する一般的なエラーである。 他のエラーが下層のプロトコル・モジュールで生成され、 返されるかもしれない。 それらのマニュアルを参照すること。 -.TP -.\"O .BR EAGAIN " or " EWOULDBLOCK -.BR EAGAIN " または " EWOULDBLOCK +.TP +\fBEAGAIN\fP または \fBEWOULDBLOCK\fP .\" Actually EAGAIN on Linux -.\"O The socket is marked nonblocking and the receive operation -.\"O would block, or a receive timeout had been set and the timeout expired -.\"O before data was received. -ソケットが非停止 (nonblocking) に設定されていて -受信操作が停止するような状況になったか、 -受信に時間切れ (timeout) が設定されていて -データを受信する前に時間切れになった。 -.\"O POSIX.1-2001 allows either error to be returned for this case, -.\"O and does not require these constants to have the same value, -.\"O so a portable application should check for both possibilities. -POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めており、 -これら 2 つの定数が同じ値を持つことも求めていない。 -したがって、移植性が必要なアプリケーションでは、両方の可能性を -確認すべきである。 -.TP -.B EBADF -.\"O The argument -.\"O .I sockfd -.\"O is an invalid descriptor. -引き数 -.I sockfd -が不正なディスクリプタである。 -.TP -.B ECONNREFUSED -.\"O A remote host refused to allow the network connection (typically -.\"O because it is not running the requested service). -リモートのホストでネットワーク接続が拒否された -(よくある理由としては、要求したサービスが起動されていないなどがある)。 -.TP -.B EFAULT -.\"O The receive buffer pointer(s) point outside the process's -.\"O address space. +ソケットが非停止 (nonblocking) に設定されていて 受信操作が停止するような状況になったか、 受信に時間切れ (timeout) +が設定されていて データを受信する前に時間切れになった。 POSIX.1\-2001 は、この場合にどちらのエラーを返すことも認めており、 これら 2 +つの定数が同じ値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、両方の可能性を 確認すべきである。 +.TP +\fBEBADF\fP +引き数 \fIsockfd\fP が不正なディスクリプタである。 +.TP +\fBECONNREFUSED\fP +リモートのホストでネットワーク接続が拒否された (よくある理由としては、要求したサービスが起動されていないなどがある)。 +.TP +\fBEFAULT\fP 受信バッファへのポインタがプロセスのアドレス空間外を指している。 -.TP -.B EINTR -.\"O The receive was interrupted by delivery of a signal before -.\"O any data were available; see -.\"O .BR signal (7). -データを受信する前に、シグナルが配送されて割り込まれた。 -.BR signal (7) -参照。 -.TP -.B EINVAL -.\"O Invalid argument passed. -不正な引き数が渡された。 +.TP +\fBEINTR\fP +データを受信する前に、シグナルが配送されて割り込まれた。 \fBsignal\fP(7) 参照。 +.TP +\fBEINVAL\fP .\" e.g., msg_namelen < 0 for recvmsg() or addrlen < 0 for recvfrom() -.TP -.B ENOMEM -.\"O Could not allocate memory for -.\"O .BR recvmsg (). -.BR recvmsg () -のためのメモリが確保できなかった。 -.TP -.B ENOTCONN -.\"O The socket is associated with a connection-oriented protocol -.\"O and has not been connected (see -.\"O .BR connect (2) -.\"O and -.\"O .BR accept (2)). -ソケットに接続指向プロトコルが割り当てられており、 -まだ接続されていない -.RB ( connect (2) -と -.BR accept (2) +不正な引き数が渡された。 +.TP +\fBENOMEM\fP +\fBrecvmsg\fP() のためのメモリが確保できなかった。 +.TP +\fBENOTCONN\fP +ソケットに接続指向プロトコルが割り当てられており、 まだ接続されていない (\fBconnect\fP(2) と \fBaccept\fP(2) を参照のこと)。 -.TP -.B ENOTSOCK -.\"O The argument -.\"O .I sockfd -.\"O does not refer to a socket. -引き数 -.I sockfd -がソケットを参照していない。 -.\"O .SH "CONFORMING TO" +.TP +\fBENOTSOCK\fP +引き数 \fIsockfd\fP がソケットを参照していない。 .SH 準拠 -.\"O 4.4BSD (these function calls first appeared in 4.2BSD), -.\"O POSIX.1-2001. -4.4BSD (これらの関数は 4.2BSD で現われた), POSIX.1-2001。 +4.4BSD (これらの関数は 4.2BSD で現われた), POSIX.1\-2001。 .LP -.\"O POSIX.1-2001 only describes the -.\"O .BR MSG_OOB , -.\"O .BR MSG_PEEK , -.\"O and -.\"O .B MSG_WAITALL -.\"O flags. -POSIX.1-2001 では、 -.BR MSG_OOB , -.BR MSG_PEEK , -.B MSG_WAITALL -フラグだけが記載されている。 -.\"O .SH NOTES +POSIX.1\-2001 では、 \fBMSG_OOB\fP, \fBMSG_PEEK\fP, \fBMSG_WAITALL\fP フラグだけが記載されている。 .SH 注意 -.\"O The prototypes given above follow glibc2. -.\"O The Single UNIX Specification agrees, except that it has return values -.\"O of type \fIssize_t\fP (while 4.x BSD and libc4 and libc5 all have \fIint\fP). -.\"O The -.\"O .I flags -.\"O argument is \fIint\fP in 4.x BSD, but \fIunsigned int\fP in libc4 and libc5. -.\"O The -.\"O .I len -.\"O argument is \fIint\fP in 4.x BSD, but \fIsize_t\fP in libc4 and libc5. -.\"O The -.\"O .I addrlen -.\"O argument is \fIint\ *\fP in 4.x BSD, libc4 and libc5. -.\"O The present \fIsocklen_t\ *\fP was invented by POSIX. -.\"O See also -.\"O .BR accept (2). -上記のプロトタイプは glibc2 にしたがっている。 -Single UNIX Specification でも同様だが、 -返り値の型が \fIssize_t\fP となっている -(一方で 4.x BSD や libc4 や libc5 は全て \fIint\fP を使用している)。 -.I flags -引き数は 4.x BSD では \fIint\fP だが、libc4 と libc5 では \fIunsigned int\fP である。 -.I len -引き数は 4.x BSD では \fIint\fP だが、 libc4 と libc5 では \fIsize_t\fP である。 -.I addrlen -引き数は 4.x BSD, libc4, libc5 では \fIint\ *\fP である。 -現在の \fIsocklen_t\ *\fP は POSIX で発案された。 -.BR accept (2) -も参照すること。 +上記のプロトタイプは glibc2 にしたがっている。 Single UNIX Specification でも同様だが、 返り値の型が +\fIssize_t\fP となっている (一方で 4.x BSD や libc4 や libc5 は全て \fIint\fP を使用している)。 \fIflags\fP +引き数は 4.x BSD では \fIint\fP だが、libc4 と libc5 では \fIunsigned int\fP である。 \fIlen\fP 引き数は +4.x BSD では \fIint\fP だが、 libc4 と libc5 では \fIsize_t\fP である。 \fIaddrlen\fP 引き数は 4.x +BSD, libc4, libc5 では \fIint\ *\fP である。 現在の \fIsocklen_t\ *\fP は POSIX で発案された。 +\fBaccept\fP(2) も参照すること。 -.\"O According to POSIX.1-2001, the -.\"O .I msg_controllen -.\"O field of the -.\"O .I msghdr -.\"O structure should be typed as -.\"O .IR socklen_t , -.\"O but glibc currently types it as -.\"O .IR size_t . -POSIX.1-2001 では、構造体 -.I msghdr -のフィールド -.I msg_controllen -は -.I socklen_t -型であるべきだとされているが、 -現在の glibc では -.I size_t -型である。 .\" glibc bug raised 12 Mar 2006 .\" http://sourceware.org/bugzilla/show_bug.cgi?id=2448 .\" The problem is an underlying kernel issue: the size of the .\" __kernel_size_t type used to type this field varies .\" across architectures, but socklen_t is always 32 bits. +POSIX.1\-2001 では、構造体 \fImsghdr\fP のフィールド \fImsg_controllen\fP は \fIsocklen_t\fP +型であるべきだとされているが、 現在の glibc では \fIsize_t\fP 型である。 -.\"O See -.\"O .BR recvmmsg(2) -.\"O for information about a Linux-specific system call -.\"O that can be used to receive multiple datagrams in a single call. -.BR recvmmsg (2) -には、一度の呼び出しでの複数のデータグラムに使用できる Linux 固有の -システムコールに関する情報が書かれている。 -.\"O .SH EXAMPLE +\fBrecvmmsg\fP(2) には、一度の呼び出しでの複数のデータグラムに使用できる Linux 固有の システムコールに関する情報が書かれている。 .SH 例 -.\"O An example of the use of -.\"O .BR recvfrom () -.\"O is shown in -.\"O .BR getaddrinfo (3). -.BR recvfrom () -の利用例が -.BR getaddrinfo (3) -に記載されている。 -.\"O .SH "SEE ALSO" +\fBrecvfrom\fP() の利用例が \fBgetaddrinfo\fP(3) に記載されている。 .SH 関連項目 -.BR fcntl (2), -.BR getsockopt (2), -.BR read (2), -.BR recvmmsg (2), -.BR select (2), -.BR shutdown (2), -.BR socket (2), -.BR cmsg (3), -.BR sockatmark (3), -.BR socket (7) +\fBfcntl\fP(2), \fBgetsockopt\fP(2), \fBread\fP(2), \fBrecvmmsg\fP(2), \fBselect\fP(2), +\fBshutdown\fP(2), \fBsocket\fP(2), \fBcmsg\fP(3), \fBsockatmark\fP(3), \fBsocket\fP(7) diff --git a/draft/man2/recvmmsg.2 b/draft/man2/recvmmsg.2 new file mode 100644 index 00000000..386008ab --- /dev/null +++ b/draft/man2/recvmmsg.2 @@ -0,0 +1,110 @@ +.\" Copyright (C) 2011 by Andi Kleen +.\" and Copyright (c) 2011 by Michael Kerrisk +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\" FIXME: This page could be improved with an example program. +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH RECVMMSG 2 2011\-10\-04 Linux "Linux Programmer's Manual" +.SH 名前 +recvmmsg \- receive multiple messages on a socket +.SH 書式 +.nf +\fB#define _GNU_SOURCE\fP +\fB#include \fP + +\fBint recvmmsg(int \fP\fIsockfd\fP\fB, struct mmsghdr *\fP\fImsgvec\fP\fB, unsigned int \fP\fIvlen\fP\fB,\fP +.br +\fB unsigned int \fP\fIflags\fP\fB, struct timespec *\fP\fItimeout\fP\fB);\fP +.fi +.SH 説明 +The \fBrecvmmsg\fP() system call is an extension of \fBrecvmsg\fP(2) that allows +the caller to receive multiple messages from a socket using a single system +call. (This has performance benefits for some applications.) A further +extension over \fBrecvmsg\fP(2) is support for a timeout on the receive +operation. + +The \fIsockfd\fP argument is the file descriptor of the socket to receive data +from. + +The \fImsgvec\fP argument is a pointer to an array of \fImmsghdr\fP structures. +The size of this array is specified in \fIvlen\fP. + +The \fImmsghdr\fP structure is defined in \fI\fP as: + +.in +4n +.nf +struct mmsghdr { + struct msghdr msg_hdr; /* Message header */ + unsigned int msg_len; /* Number of received bytes for header */ +}; +.fi +.in +.PP +The \fImsg_hdr\fP field is a \fImsghdr\fP structure, as described in +\fBrecvmsg\fP(2). The \fImsg_len\fP field is the number of bytes returned for the +message in the entry. This field has the same value as the return value of +a single \fBrecvmsg\fP(2) on the header. + +The \fIflags\fP argument contains flags ORed together. The flags are the same +as documented for \fBrecvmsg\fP(2), with the following addition: +.TP +\fBMSG_WAITFORONE\fP +Turns on \fBMSG_DONTWAIT\fP after the first message has been received. +.PP +The \fItimeout\fP argument points to a \fIstruct timespec\fP (see +\fBclock_gettime\fP(2)) defining a timeout (seconds plus nanoseconds) for the +receive operation. If \fItimeout\fP is \fINULL\fP then the operation blocks +indefinitely. + +A blocking \fBrecvmmsg\fP() call blocks until \fIvlen\fP messages have been +received or until the timeout expires. A nonblocking call reads as many +messages as are available (up to the limit specified by \fIvlen\fP) and +returns immediately. + +On return from \fBrecvmmsg\fP(), successive elements of \fImsgvec\fP are updated +to contain information about each received message: \fImsg_len\fP contains the +size of the received message; the subfields of \fImsg_hdr\fP are updated as +described in \fBrecvmsg\fP(2). The return value of the call indicates the +number of elements of \fImsgvec\fP that have been updated. +.SH 返り値 +On success, \fBrecvmmsg\fP() returns the number of messages received in +\fImsgvec\fP; on error, \-1 is returned, and \fIerrno\fP is set to indicate the +error. +.SH エラー +Errors are as for \fBrecvmsg\fP(2). In addition, the following error can +occur: +.TP +\fBEINVAL\fP +\fItimeout\fP is invalid. +.SH バージョン +The \fBrecvmmsg\fP() system call was added in Linux 2.6.32. Support in glibc +was added in version 2.12. +.SH 準拠 +\fBrecvmmsg\fP() is Linux\-specific. +.SH 関連項目 +\fBclock_gettime\fP(2), \fBrecvmsg\fP(2), \fBsendmmsg\fP(2), \fBsendmsg\fP(2), +\fBsocket\fP(2), \fBsocket\fP(7) diff --git a/draft/man2/remap_file_pages.2 b/draft/man2/remap_file_pages.2 index 07059336..9e6aa10b 100644 --- a/draft/man2/remap_file_pages.2 +++ b/draft/man2/remap_file_pages.2 @@ -23,244 +23,69 @@ .\" 2003-12-10 Initial creation, Michael Kerrisk .\" 2004-10-28 aeb, corrected prototype, prot must be 0 .\" -.\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO -.\" all rights reserved. -.\" Translated Thu Jun 24 06:00:37 JST 2004 -.\" by Yuichi SATO -.\" Updated & Modified Mon Jan 3 02:50:11 JST 2005 by Yuichi SATO -.\" Updated & Modified Mon Oct 10 01:15:38 JST 2005 -.\" by Akihiro MOTOKI +.\"******************************************************************* .\" -.TH REMAP_FILE_PAGES 2 2008-04-22 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH REMAP_FILE_PAGES 2 2008\-04\-22 Linux "Linux Programmer's Manual" .SH 名前 -.\"O remap_file_pages \- create a nonlinear file mapping remap_file_pages \- 非線形ファイルマッピングを作成する。 -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" -.B #include +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP .sp -.BI "int remap_file_pages(void *" addr ", size_t " size ", int " prot , -.BI " ssize_t " pgoff ", int " flags ); +\fBint remap_file_pages(void *\fP\fIaddr\fP\fB, size_t \fP\fIsize\fP\fB, int \fP\fIprot\fP\fB,\fP +\fB ssize_t \fP\fIpgoff\fP\fB, int \fP\fIflags\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR remap_file_pages () -.\"O system call is used to create a nonlinear mapping, that is, a mapping -.\"O in which the pages of the file are mapped into a nonsequential order -.\"O in memory. -.BR remap_file_pages () -システムコールは非線形なマッピング、 -つまりファイルのページがメモリ上で連続しない順番でマップされる -マッピングを作成するために使われる。 -.\"O The advantage of using -.\"O .BR remap_file_pages () -.\"O over using repeated calls to -.\"O .BR mmap (2) -.\"O is that the former approach does not require the kernel to create -.\"O additional VMA (Virtual Memory Area) data structures. -.BR remap_file_pages () -を使う方が -.BR mmap (2) -を繰り返して使うより優れている点は、 -前者の方法ではカーネルが VMA (Virtual Memory Area, 仮想メモリ領域) +\fBremap_file_pages\fP() システムコールは非線形なマッピング、 つまりファイルのページがメモリ上で連続しない順番でマップされる +マッピングを作成するために使われる。 \fBremap_file_pages\fP() を使う方が \fBmmap\fP(2) +を繰り返して使うより優れている点は、 前者の方法ではカーネルが VMA (Virtual Memory Area, 仮想メモリ領域) データ構造体を追加で作成する必要がないことである。 -.\"O To create a nonlinear mapping we perform the following steps: -非線形マッピングを作成するためには、 -以下のようなステップを実行する: -.TP 3 +非線形マッピングを作成するためには、 以下のようなステップを実行する: +.TP 3 1. -.\"O Use -.\"O .BR mmap (2) -.\"O to create a mapping (which is initially linear). -.BR mmap (2) -を使い、マッピングを作成する (このマッピングは最初は線形である)。 -.\"O This mapping must be created with the -.\"O .B MAP_SHARED -.\"O flag. -このマッピングは -.B MAP_SHARED +\fBmmap\fP(2) を使い、マッピングを作成する (このマッピングは最初は線形である)。 このマッピングは \fBMAP_SHARED\fP フラグを指定して作成されなければならない。 -.TP +.TP 2. -.\"O Use one or more calls to -.\"O .BR remap_file_pages () -.\"O to rearrange the correspondence between the pages of the mapping -.\"O and the pages of the file. -.\"O It is possible to map the same page of a file -.\"O into multiple locations within the mapped region. -.BR remap_file_pages () -を 1 回以上呼び出して、 -マッピングのページとファイルのページの対応関係を再構成する。 -ファイルの同じページをマッピング領域の複数の場所に -マップすることが可能である。 +\fBremap_file_pages\fP() を 1 回以上呼び出して、 マッピングのページとファイルのページの対応関係を再構成する。 +ファイルの同じページをマッピング領域の複数の場所に マップすることが可能である。 .LP -.\"O The -.\"O .I pgoff -.\"O and -.\"O .I size -.\"O arguments specify the region of the file that is to be relocated -.\"O within the mapping: -.I pgoff -と -.I size -引き数は、マッピング内で再配置されるファイルの領域を指定する。 -.\"O .I pgoff -.\"O is a file offset in units of the system page size; -.I pgoff -はファイルオフセットであり、単位はシステムのページサイズである。 -.\"O .I size -.\"O is the length of the region in bytes. -.I size -は領域の長さであり、単位はバイトである。 +\fIpgoff\fP と \fIsize\fP 引き数は、マッピング内で再配置されるファイルの領域を指定する。 \fIpgoff\fP +はファイルオフセットであり、単位はシステムのページサイズである。 \fIsize\fP は領域の長さであり、単位はバイトである。 -.\"O The -.\"O .I addr -.\"O argument serves two purposes. -.I addr -引き数は 2 つの目的で使われる。 -.\"O First, it identifies the mapping whose pages we want to rearrange. -第 1 の目的は、この引き数によって再編成したいページの -マッピングを識別することである。 -.\"O Thus, -.\"O .I addr -.\"O must be an address that falls within -.\"O a region previously mapped by a call to -.\"O .BR mmap (2). -よって -.I addr -は -.BR mmap (2) -の呼び出しで過去にマップされた領域内のアドレスでなければならない。 -.\"O Second, -.\"O .I addr -.\"O specifies the address at which the file pages -.\"O identified by -.\"O .I pgoff -.\"O and -.\"O .I size -.\"O will be placed. -第 2 の目的は、 -.I pgoff -と -.I size -で識別されるファイルページが置かれる予定のアドレスを、 -.I addr -によって指定することである。 +\fIaddr\fP 引き数は 2 つの目的で使われる。 第 1 の目的は、この引き数によって再編成したいページの マッピングを識別することである。 よって +\fIaddr\fP は \fBmmap\fP(2) の呼び出しで過去にマップされた領域内のアドレスでなければならない。 第 2 の目的は、 \fIpgoff\fP と +\fIsize\fP で識別されるファイルページが置かれる予定のアドレスを、 \fIaddr\fP によって指定することである。 -.\"O The values specified in -.\"O .I addr -.\"O and -.\"O .I size -.\"O should be multiples of the system page size. -.\"O If they are not, then the kernel rounds -.\"O .I both -.\"O values -.\"O .I down -.\"O to the nearest multiple of the page size. -.\"O .\" This rounding is weird, and not consistent with the treatment of -.\"O .\" the analogous arguments for munmap()/mprotect() and for mlock(). -.\"O .\" MTK, 14 Sep 2005 -.I addr -と -.I size -に指定する値は、システムのページサイズの倍数とすべきである。 -それ以外の場合、カーネルは「両方」の値を -最も近いページサイズの倍数へ「切り下げる」。 -.\" この丸め処理は風変わりで、munmap()/mprotect() や mlock() の -.\" 同様の引き数の処理方法とも矛盾する。 +.\" This rounding is weird, and not consistent with the treatment of +.\" the analogous arguments for munmap()/mprotect() and for mlock(). .\" MTK, 14 Sep 2005 +\fIaddr\fP と \fIsize\fP に指定する値は、システムのページサイズの倍数とすべきである。 それ以外の場合、カーネルは「両方」の値を +最も近いページサイズの倍数へ「切り下げる」。 -.\"O The -.\"O .I prot -.\"O argument must be specified as 0. -.I prot -引き数は 0 に指定されなければならない。 +\fIprot\fP 引き数は 0 に指定されなければならない。 -.\"O The -.\"O .I flags -.\"O argument has the same meaning as for -.\"O .BR mmap (2), -.\"O but all flags other than -.\"O .B MAP_NONBLOCK -.\"O are ignored. -.I flags -引き数は -.BR mmap (2) -のものと同じ意味であるが、 -.B MAP_NONBLOCK -以外の全てのフラグは無視される。 -.\"O .SH "RETURN VALUE" +\fIflags\fP 引き数は \fBmmap\fP(2) のものと同じ意味であるが、 \fBMAP_NONBLOCK\fP 以外の全てのフラグは無視される。 .SH 返り値 -.\"O On success, -.\"O .BR remap_file_pages () -.\"O returns 0. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合、 -.BR remap_file_pages () -は 0 を返す。 -エラーの場合、\-1 が返され、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS +成功した場合、 \fBremap_file_pages\fP() は 0 を返す。 エラーの場合、\-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP -.B EINVAL -.\"O .I addr -.\"O does not refer to a valid mapping -.\"O created with the -.\"O .B MAP_SHARED -.\"O flag. -.I addr -が -.B MAP_SHARED -フラグを指定して作成された有効なマッピングを参照していない。 -.TP -.B EINVAL -.\"O .IR addr , -.\"O .IR size , -.\"O .IR prot , -.\"O or -.\"O .I pgoff -.\"O is invalid. -.IR addr , -.IR size , -.IR prot , -.I pgoff -のいずれかが不正である。 -.\"O .\" And possibly others from vma->vm_ops->populate() -.\"Osato: -.\"Osato: others が何を指すのかよく分からない。 -.\"Osato: -.\" または vma->vm_ops->populate() からの他のエラーかもしれない。 -.\"O .SH VERSIONS +.TP +\fBEINVAL\fP +\fIaddr\fP が \fBMAP_SHARED\fP フラグを指定して作成された有効なマッピングを参照していない。 +.TP +\fBEINVAL\fP +.\" And possibly others from vma->vm_ops->populate() +\fIaddr\fP, \fIsize\fP, \fIprot\fP, \fIpgoff\fP のいずれかが不正である。 .SH バージョン -.\"O The -.\"O .BR remap_file_pages () -.\"O system call appeared in Linux 2.5.46; -.\"O glibc support was added in version 2.3.3. -.BR remap_file_pages () -システムコールは Linux 2.5.46 で登場した。 -glibc でのサポートは glibc バージョン 2.3.3 で追加された。 -.\"O .SH "CONFORMING TO" +\fBremap_file_pages\fP() システムコールは Linux 2.5.46 で登場した。 glibc でのサポートは glibc +バージョン 2.3.3 で追加された。 .SH 準拠 -.\"O The -.\"O .BR remap_file_pages () -.\"O system call is Linux-specific. -.BR remap_file_pages () -システムコールは Linux 固有のものである。 -.\"O .SH "SEE ALSO" +\fBremap_file_pages\fP() システムコールは Linux 固有のものである。 .SH 関連項目 -.BR getpagesize (2), -.BR mmap (2), -.BR mmap2 (2), -.BR mprotect (2), -.BR mremap (2), -.BR msync (2) +\fBgetpagesize\fP(2), \fBmmap\fP(2), \fBmmap2\fP(2), \fBmprotect\fP(2), \fBmremap\fP(2), +\fBmsync\fP(2) diff --git a/draft/man2/renameat.2 b/draft/man2/renameat.2 index b0af8a09..abb75a87 100644 --- a/draft/man2/renameat.2 +++ b/draft/man2/renameat.2 @@ -22,204 +22,73 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2006 Yuichi SATO -.\" all rights reserved. -.\" Translated 2006-09-05 by Yuichi SATO , LDP v2.39 .\" -.TH RENAMEAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH RENAMEAT 2 2009\-12\-13 Linux "Linux Programmer's Manual" .SH 名前 -.\"O renameat \- rename a file relative to directory file descriptors renameat \- ディレクトリファイルディスクリプタから相対的な位置にあるファイルの名前を変更する -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .B #include /* Definition of AT_* constants */ -.B #include /* AT_* 定数の定義 */ -.B #include +\fB#include /* AT_* 定数の定義 */\fP +\fB#include \fP .sp -.BI "int renameat(int " olddirfd ", const char *" oldpath , -.BI " int " newdirfd ", const char *" newpath ); +\fBint renameat(int \fP\fIolddirfd\fP\fB, const char *\fP\fIoldpath\fP\fB,\fP +\fB int \fP\fInewdirfd\fP\fB, const char *\fP\fInewpath\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR renameat (): +\fBrenameat\fP(): .PD 0 .ad l .RS 4 -.TP 4 -.\"O Since glibc 2.10: +.TP 4 glibc 2.10 以降: _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L -.TP -.\"O Before glibc 2.10: +.TP glibc 2.10 より前: _ATFILE_SOURCE .RE .ad .PD -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR renameat () -.\"O system call operates in exactly the same way as -.\"O .BR rename (2), -.\"O except for the differences described in this manual page. -.BR renameat () -システムコールは、この man ページで説明している違いがある以外は、 -.BR rename (2) +\fBrenameat\fP() システムコールは、この man ページで説明している違いがある以外は、 \fBrename\fP(2) と全く同じように動作する。 -.\"O If the pathname given in -.\"O .I oldpath -.\"O is relative, then it is interpreted relative to the directory -.\"O referred to by the file descriptor -.\"O .I olddirfd -.\"O (rather than relative to the current working directory of -.\"O the calling process, as is done by -.\"O .BR rename (2) -.\"O for a relative pathname). -.I oldpath -で指定されるパス名が相対パスである場合、 -ファイルディスクリプタ -.I olddirfd -で参照されるディレクトリからの相対パス名として解釈される -.RB ( rename (2) -では、相対パスは呼び出し元プロセスのカレントワーキングディレクトリからの -相対パスとなる)。 +\fIoldpath\fP で指定されるパス名が相対パスである場合、 ファイルディスクリプタ \fIolddirfd\fP +で参照されるディレクトリからの相対パス名として解釈される (\fBrename\fP(2) +では、相対パスは呼び出し元プロセスのカレントワーキングディレクトリからの 相対パスとなる)。 -.\"O If -.\"O .I oldpath -.\"O is relative and -.\"O .I olddirfd -.\"O is the special value -.\"O .BR AT_FDCWD , -.\"O then -.\"O .I oldpath -.\"O is interpreted relative to the current working -.\"O directory of the calling process (like -.\"O .BR rename (2)). -.I oldpath -が相対パスであり、かつ -.I olddirfd -が特別な値 -.B AT_FDCWD -である場合、 -.I oldpath -は -.RB ( rename (2) -と同じように) 呼び出し元プロセスの -カレントワーキングディレクトリからの相対パス名として解釈される。 +\fIoldpath\fP が相対パスであり、かつ \fIolddirfd\fP が特別な値 \fBAT_FDCWD\fP である場合、 \fIoldpath\fP は +(\fBrename\fP(2) と同じように) 呼び出し元プロセスの カレントワーキングディレクトリからの相対パス名として解釈される。 -.\"O If -.\"O .I oldpath -.\"O is absolute, then -.\"O .I olddirfd -.\"O is ignored. -.I oldpath -が絶対パスである場合、 -.I olddirfd -は無視される。 +\fIoldpath\fP が絶対パスである場合、 \fIolddirfd\fP は無視される。 -.\"O The interpretation of -.\"O .I newpath -.\"O is as for -.\"O .IR oldpath , -.\"O except that a relative pathname is interpreted relative -.\"O to the directory referred to by the file descriptor -.\"O .IR newdirfd . -.I newpath -の解釈は -.I oldpath -と同様であるが、 -相対パス名はファイルディスクリプタ -.I newdirfd +\fInewpath\fP の解釈は \fIoldpath\fP と同様であるが、 相対パス名はファイルディスクリプタ \fInewdirfd\fP で参照されるディレクトリからの相対パス名として解釈される。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O On success, -.\"O .BR renameat () -.\"O returns 0. -成功した場合、 -.BR renameat () -は 0 を返す。 -.\"O On error, \-1 is returned and -.\"O .I errno -.\"O is set to indicate the error. -エラーの場合、\-1 が返されて、 -.I errno -にはエラーを示す値が設定される。 -.\"O .SH ERRORS +成功した場合、 \fBrenameat\fP() は 0 を返す。 エラーの場合、\-1 が返されて、 \fIerrno\fP にはエラーを示す値が設定される。 .SH エラー -.\"O The same errors that occur for -.\"O .BR rename (2) -.\"O can also occur for -.\"O .BR renameat (). -.BR rename (2) -と同じエラーが -.BR renameat () -でも起こる。 -.\"O The following additional errors can occur for -.\"O .BR renameat (): -.BR renameat () +\fBrename\fP(2) と同じエラーが \fBrenameat\fP() でも起こる。 \fBrenameat\fP() では、その他に以下のエラーが起こる: -.TP -.B EBADF -.\"O .I olddirfd -.\"O or -.\"O .I newdirfd -.\"O is not a valid file descriptor. -.I olddirfd -または -.I newdirfd -が有効なファイルディスクリプタでない。 -.TP -.B ENOTDIR -.\"O .I oldpath -.\"O is relative and -.\"O .I olddirfd -.\"O is a file descriptor referring to a file other than a directory; -.I oldpath -が相対パスで、かつ -.I olddirfd -がディレクトリ以外のファイルを参照するファイルディスクリプタである。 -.\"O or similar for -.\"O .I newpath -.\"O and -.\"O .I newdirfd -または -.I newpath -と -.I newdirfd -について、同様のことが起きている。 -.\"O .SH VERSIONS +.TP +\fBEBADF\fP +\fIolddirfd\fP または \fInewdirfd\fP が有効なファイルディスクリプタでない。 +.TP +\fBENOTDIR\fP +\fIoldpath\fP が相対パスで、かつ \fIolddirfd\fP がディレクトリ以外のファイルを参照するファイルディスクリプタである。 または +\fInewpath\fP と \fInewdirfd\fP について、同様のことが起きている。 .SH バージョン -.\"O .BR renameat () -.\"O was added to Linux in kernel 2.6.16. -.BR renameat () -は Linux カーネル 2.6.16 で追加された。 -.\"O .SH "CONFORMING TO" +\fBrenameat\fP() は Linux カーネル 2.6.16 で追加された。 .SH 準拠 -POSIX.1-2008. -.\"O .SH NOTES +POSIX.1\-2008. .SH 注意 -.\"O See -.\"O .BR openat (2) -.\"O for an explanation of the need for -.\"O .BR renameat (). -.BR renameat () -が必要な理由については、 -.BR openat (2) -を参照すること。 -.\"O .SH "SEE ALSO" +\fBrenameat\fP() が必要な理由については、 \fBopenat\fP(2) を参照すること。 .SH 関連項目 -.BR openat (2), -.BR rename (2), -.BR path_resolution (7) +\fBopenat\fP(2), \fBrename\fP(2), \fBpath_resolution\fP(7) diff --git a/draft/man2/sched_get_priority_max.2 b/draft/man2/sched_get_priority_max.2 index e7e578c3..7ed263a1 100644 --- a/draft/man2/sched_get_priority_max.2 +++ b/draft/man2/sched_get_priority_max.2 @@ -27,158 +27,53 @@ .\" 1996-04-10 Markus Kuhn .\" revision .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1997-02-23, HANATAKA Shinya -.\" Updated 2006-04-14, Akihiro MOTOKI , LDP v2.29 +.\"******************************************************************* .\" -.\"WORD: static 静的 -.\"WORD: priority プライオリティ -.\"WORD: scheduling スケジューリング -.\"WORD: algorithm アルゴリズム -.\"WORD: process プロセス -.\"WORD: portable 移植性のある -.\"WORD: policy 方針 +.\" This file was generated with po4a. Translate the source file. .\" -.TH SCHED_GET_PRIORITY_MAX 2 2006-03-23 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH SCHED_GET_PRIORITY_MAX 2 2006\-03\-23 Linux "Linux Programmer's Manual" .SH 名前 -.\"O sched_get_priority_max, sched_get_priority_min \- get static priority range -sched_get_priority_max, sched_get_priority_min \- 静的プライオリティの範囲を取得する -.\"O .SH SYNOPSIS +sched_get_priority_max, sched_get_priority_min \- 静的プライオリティの範囲を取得する .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int sched_get_priority_max(int " policy ); +\fBint sched_get_priority_max(int \fP\fIpolicy\fP\fB);\fP .sp -.BI "int sched_get_priority_min(int " policy ); -.\"O .SH DESCRIPTION +\fBint sched_get_priority_min(int \fP\fIpolicy\fP\fB);\fP .SH 説明 -.\"O .BR sched_get_priority_max () -.\"O returns the maximum priority value that can be used with the -.\"O scheduling algorithm identified by \fIpolicy\fP. -.\"O .BR sched_get_priority_min () -.\"O returns the minimum priority value that can be used with the -.\"O scheduling algorithm identified by \fIpolicy\fP. -.\"O Supported \fIpolicy\fP -.\"O values are -.\"O .BR SCHED_FIFO , -.\"O .BR SCHED_RR , -.\"O .BR SCHED_OTHER , -.\"O and -.\"O .BR SCHED_BATCH . -.\"O Further details about these policies can be found in -.\"O .BR sched_setscheduler (2). -.BR sched_get_priority_max () -は\fIpolicy\fP によって指定されたスケジューリングのアルゴリズムで -使用されるプライオリティの最大値を返す。 -.BR sched_get_priority_min () -は\fIpolicy\fP によって指定されたスケジューリングのアルゴリズムで -使用されるプライオリティの最小値を返す。 -サポートされる \fIpolicy\fP の値は -.BR SCHED_FIFO 、 -.BR SCHED_RR 、 -.BR SCHED_OTHER 、 -.B SCHED_BATCH -である。これらのスケジューリング方針に関する詳細は -.BR sched_setscheduler (2) -に書かれている。 +\fBsched_get_priority_max\fP() は\fIpolicy\fP によって指定されたスケジューリングのアルゴリズムで +使用されるプライオリティの最大値を返す。 \fBsched_get_priority_min\fP() は\fIpolicy\fP +によって指定されたスケジューリングのアルゴリズムで 使用されるプライオリティの最小値を返す。 サポートされる \fIpolicy\fP の値は +\fBSCHED_FIFO\fP、 \fBSCHED_RR\fP、 \fBSCHED_OTHER\fP、 \fBSCHED_BATCH\fP +である。これらのスケジューリング方針に関する詳細は \fBsched_setscheduler\fP(2) に書かれている。 -.\"O Processes with numerically higher priority values are scheduled before -.\"O processes with numerically lower priority values. -.\"O Thus, the value -.\"O returned by -.\"O .BR sched_get_priority_max () -.\"O will be greater than the -.\"O value returned by -.\"O .BR sched_get_priority_min (). -数値的に大きなプライオリティ値を持つプロセスは小さな -プライオリティ値を持つプロセスより前にスケジュールされる。 -このため -.BR sched_get_priority_max () -が返す値は -.BR sched_get_priority_min () -が返す値よりも大きい。 +数値的に大きなプライオリティ値を持つプロセスは小さな プライオリティ値を持つプロセスより前にスケジュールされる。 このため +\fBsched_get_priority_max\fP() が返す値は \fBsched_get_priority_min\fP() が返す値よりも大きい。 -.\"O Linux allows the static priority value range 1 to 99 for -.\"O \fBSCHED_FIFO\fP and \fBSCHED_RR\fP and the priority 0 for -.\"O \fBSCHED_OTHER\fP and \fBSCHED_BATCH\fP. -.\"O Scheduling priority ranges for the various policies -.\"O are not alterable. Linux では \fBSCHED_FIFO\fP と \fBSCHED_RR\fP では 1 から 99 の範囲の -静的プライオリティーを持ち、\fBSCHED_OTHER\fP と \fBSCHED_BATCH\fP では -プライオリティとして 0 を持つ。 -それぞれの方針のスケジューリング・プライオリティの範囲は -変更することができない。 +静的プライオリティーを持ち、\fBSCHED_OTHER\fP と \fBSCHED_BATCH\fP では プライオリティとして 0 を持つ。 +それぞれの方針のスケジューリング・プライオリティの範囲は 変更することができない。 -.\"O The range of scheduling priorities may vary on other POSIX systems, -.\"O thus it is a good idea for portable applications to use a virtual -.\"O priority range and map it to the interval given by -.\"O .BR sched_get_priority_max () -.\"O and -.\"O .BR sched_get_priority_min (). -.\"O POSIX.1-2001 requires a spread of at least 32 between the maximum and the -.\"O minimum values for \fBSCHED_FIFO\fP and \fBSCHED_RR\fP. -スケジューリング・プライオリティの範囲は他の POSIX システムと -異なっているかもしれない。それで、移植性(portable)のある -アプリケーションでは仮想的な範囲を用い -.BR sched_get_priority_max () -と -.BR sched_get_priority_min () -で与えられた間隔にマップして使用することはいい考えである。 -POSIX.1-2001 では \fBSCHED_FIFO\fP と \fBSCHED_RR\fP における -最大値と最小値の間隔を少なくとも 32 にすることを要求している。 +スケジューリング・プライオリティの範囲は他の POSIX システムと 異なっているかもしれない。それで、移植性(portable)のある +アプリケーションでは仮想的な範囲を用い \fBsched_get_priority_max\fP() と +\fBsched_get_priority_min\fP() で与えられた間隔にマップして使用することはいい考えである。 POSIX.1\-2001 では +\fBSCHED_FIFO\fP と \fBSCHED_RR\fP における 最大値と最小値の間隔を少なくとも 32 にすることを要求している。 -.\"O POSIX systems on which -.\"O .BR sched_get_priority_max () -.\"O and -.\"O .BR sched_get_priority_min () -.\"O are available define -.\"O .B _POSIX_PRIORITY_SCHEDULING -.\"O in \fI\fP. -POSIX システムでは -.BR sched_get_priority_max () -と -.BR sched_get_priority_min () -は \fI\fP に -.B _POSIX_PRIORITY_SCHEDULING -が定義されている場合にのみ使用可能である。 -.\"O .SH "RETURN VALUE" +POSIX システムでは \fBsched_get_priority_max\fP() と \fBsched_get_priority_min\fP() は +\fI\fP に \fB_POSIX_PRIORITY_SCHEDULING\fP が定義されている場合にのみ使用可能である。 .SH 返り値 -.\"O On success, -.\"O .BR sched_get_priority_max () -.\"O and -.\"O .BR sched_get_priority_min () -.\"O return the maximum/minimum priority value for the named scheduling -.\"O policy. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合は -.BR sched_get_priority_max () -と -.BR sched_get_priority_min () -は指定されたスケジューリング方針のプライオリティの最大値/最小値を返す。 -エラーの場合は \-1 が返され、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS +成功した場合は \fBsched_get_priority_max\fP() と \fBsched_get_priority_min\fP() +は指定されたスケジューリング方針のプライオリティの最大値/最小値を返す。 エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP -.B EINVAL -.\"O The argument \fIpolicy\fP does not identify a defined scheduling policy. +.TP +\fBEINVAL\fP 引き数 \fIpolicy\fP が定義されているスケジューリング方針と一致しない。 -.\"O .SH "CONFORMING TO" .SH 準拠 -POSIX.1-2001. -.\"O .SH "SEE ALSO" +POSIX.1\-2001. .SH 関連項目 -.BR sched_getaffinity (2), -.BR sched_getparam (2) -.BR sched_getscheduler (2), -.BR sched_setaffinity (2), -.BR sched_setparam (2), -.BR sched_setscheduler (2), +\fBsched_getaffinity\fP(2), \fBsched_getparam\fP(2) \fBsched_getscheduler\fP(2), +\fBsched_setaffinity\fP(2), \fBsched_setparam\fP(2), \fBsched_setscheduler\fP(2), .PP -.I Programming for the real world \- POSIX.4 -by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0 +\fIProgramming for the real world \- POSIX.4\fP by Bill O. Gallmeister, O'Reilly +& Associates, Inc., ISBN 1\-56592\-074\-0 diff --git a/draft/man2/sched_rr_get_interval.2 b/draft/man2/sched_rr_get_interval.2 deleted file mode 100644 index 3fc015d7..00000000 --- a/draft/man2/sched_rr_get_interval.2 +++ /dev/null @@ -1,191 +0,0 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" Copyright (C) Tom Bjorkholm & Markus Kuhn, 1996 -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; without even the implied warranty of -.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -.\" GNU General Public License for more details. -.\" -.\" You should have received a copy of the GNU General Public -.\" License along with this manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.\" -.\" 1996-04-01 Tom Bjorkholm -.\" First version written -.\" 1996-04-10 Markus Kuhn -.\" revision -.\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1997-02-23, HANATAKA Shinya -.\" Updated 2003-10-11, Kentaro Shirakata -.\" Updated 2007-05-28, Akihiro MOTOKI , LDP v2.48 -.\" -.\"WORD: interval 間隔 -.\"WORD: round robin ラウンド・ロビン -.\"WORD: process プロセス -.\"WORD: scheduling スケジューリング -.\"WORD: policy 方針 -.\"WORD: implement 実装 -.\" -.TH SCHED_RR_GET_INTERVAL 2 2007-04-06 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O sched_rr_get_interval \- get the SCHED_RR interval for the named process -sched_rr_get_interval \- 指定されたプロセスの SCHED_RR 間隔を取得する -.\"O .SH SYNOPSIS -.SH 書式 -.B #include -.sp -.BI "int sched_rr_get_interval(pid_t " pid ", struct timespec *" tp ); -.\"O .SH DESCRIPTION -.SH 説明 -.\"O .BR sched_rr_get_interval () -.\"O writes into the \fItimespec\fP structure pointed to by \fItp\fP the -.\"O round robin time quantum for the process identified by \fIpid\fP. -.BR sched_rr_get_interval () -は \fItp\fP で指定された \fItimespec\fP 構造体に -\fIpid\fP で指定されたプロセスのラウンド・ロビン時間量 -(round robin time quantum) を書き込む。 - -.\"O The \fItimespec\fP structure has the following form: -\fItimespec\fP 構造体は以下の通りである: - -.in +4n -.nf -struct timespec { - time_t tv_sec; /* seconds */ - long tv_nsec; /* nanoseconds */ -}; -.fi -.in - -.\"O If -.\"O \fIpid\fP is zero, the time quantum for the calling process is written -.\"O into \fI*tp\fP. -.\"O The identified process should be running under the -.\"O .B SCHED_RR -.\"O scheduling policy. -\fIpid\fP がゼロの場合、呼び出したプロセスの時間量が -\fI*tp\fP に書き込まれる。指定したプロセスは -.B SCHED_RR -スケジューリング方針で稼動している必要がある。 -.\" FIXME . On Linux, sched_rr_get_interval() -.\" returns the timeslice for SCHED_OTHER processes -- this timeslice -.\" is influenced by the nice value. -.\" For SCHED_FIFO processes, this always returns 0. -.\" -.\"O .\" The round robin time quantum value is not alterable under Linux -.\"O .\" 1.3.81. -.\" ラウンド・ロビン時間量は Linux 1.3.81 では変更できない。 -.\" -.\"O POSIX systems on which -.\"O .BR sched_rr_get_interval () -.\"O is available define -.\"O .B _POSIX_PRIORITY_SCHEDULING -.\"O in \fI\fP. -.BR sched_rr_get_interval () -の使用可能な POSIX システムでは -.I -で -.B _POSIX_PRIORITY_SCHEDULING -が定義されている。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success, -.\"O .BR sched_rr_get_interval () -.\"O returns 0. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合は -.BR sched_rr_get_interval () -は 0 を返す。 -エラーの場合は \-1 が返され、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EFAULT -.\"O Problem with copying information to userspace. -情報をユーザ空間にコピーする時に問題が起きた。 -.TP -.B EINVAL -.\"O Invalid pid. -PID が不正である。 -.TP -.B ENOSYS -.\"O The system call is not yet implemented (only on rather old kernels). -システム・コールがまだ実装されていない (かなり古いカーネルにおいてのみ)。 -.TP -.B ESRCH -.\"O The process whose ID is \fIpid\fP could not be found. -\fIpid\fP の ID を持つプロセスが見つからなかった。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -POSIX.1-2001. -.\"O .SH NOTES -.\"O .SS Linux Notes -.SH 注意 -.SS Linux での注意 -.\" FIXME -.\" From at least Linux 2.6.9, the following is no longer true -.\" for SCHED_RR processes. For RR processes the timeslice is always -.\" DEF_TIMESLICE, or 0.1 secs. -.\" Was the following really true for older kernels? -.\" Must build a 2.6.8 kernel and retest, and rewrite the following text -.\" appropriately. -.\"O POSIX does not specify any mechanism for controlling the size of the -.\"O round-robin time quantum. -.\"O However, Linux provides a (nonportable) method of doing this. -.\"O The quantum can be controlled by adjusting the process's nice value (see -.\"O .BR setpriority (2)). -.\"O Assigning a negative (i.e., high) nice value results in a longer quantum; -.\"O assigning a positive (i.e., low) nice value results in a shorter quantum. -.\"O The default quantum is 0.1 seconds; -.\"O the degree to which changing the nice value affects the -.\"O quantum has varied somewhat across kernel versions. -POSIX ではラウンド・ロビン時間量の大きさを制御する仕組みが規定されていない。 -しかし、Linux ではこれを変更する方法が提供されており (この方法に移植性はない)、 -プロセスの nice 値を調整することで時間量を制御できる -.RB ( setpriority (2) -参照)。 -負の nice 値 (すなわち、高い nice 値) を割り当てると時間量は長くなり、 -正の nice 値 (すなわち、低い nice 値) を割り当てると時間量は短くなる。 -デフォルトの時間量は 0.1 秒である。 -nice 値の変更が時間量にどの程度影響を与えるかは -カーネルのバージョンにより多少異なる。 -.\"O .\" .SH BUGS -.\" .SH バグ -.\"O .\" As of Linux 1.3.81 -.\"O .\" .BR sched_rr_get_interval () -.\"O .\" returns with error -.\"O .\" ENOSYS, because SCHED_RR has not yet been fully implemented and tested -.\"O .\" properly. -.\" Linux 1.3.81 の時点では -.\" .BR sched_rr_get_interval () -.\" は ENOSYS エラーを返す。 -.\" これは SCHED_RR はまだ完全には実装されておらず、 -.\" 適切にテストされていないからである。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.\"O .BR sched_setscheduler (2) -.\"O has a description of the Linux scheduling scheme. -.BR sched_setscheduler (2) -に Linux のスケジューリング方式についての説明がある。 -.PP -.I Programming for the real world \- POSIX.4 -by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0 diff --git a/draft/man2/sched_setaffinity.2 b/draft/man2/sched_setaffinity.2 index c97d98b0..7fb512ac 100644 --- a/draft/man2/sched_setaffinity.2 +++ b/draft/man2/sched_setaffinity.2 @@ -32,394 +32,99 @@ .\" 2008-11-12, mtk, removed CPU_*() macro descriptions to a .\" separate CPU_SET(3) page. .\" -.\" Japanese Version Copyright (c) 2003, 2005 Yuichi SATO -.\" all rights reserved. -.\" Translated 2003-01-23, Yuichi SATO -.\" Updated & Modified 2003-09-23, Yuichi SATO -.\" Updated & Modified 2005-01-03, Yuichi SATO -.\" Updated & Modified 2005-09-13, Akihiro MOTOKI -.\" Updated & Modified 2006-07-14, Akihiro MOTOKI, LDP v2.34 -.\" Updated & Modified 2008-12-24, Akihiro MOTOKI, LDP v3.14 +.\"******************************************************************* .\" -.\"WORD: affinity 親和度 -.\"WORD: most significant bit 最上位ビット -.\"WORD: least significant bit 最下位ビット -.\"WORD: capability 権限 +.\" This file was generated with po4a. Translate the source file. .\" -.TH SCHED_SETAFFINITY 2 2010-11-06 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH SCHED_SETAFFINITY 2 2010\-11\-06 Linux "Linux Programmer's Manual" .SH 名前 -.\"O sched_setaffinity, sched_getaffinity \- \ -.\"O set and get a process's CPU affinity mask -sched_setaffinity, sched_getaffinity \- \ -プロセスの CPU affinity マスクを設定・取得する -.\"O .SH SYNOPSIS +sched_setaffinity, sched_getaffinity \- プロセスの CPU affinity マスクを設定・取得する .SH 書式 .nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" -.B #include +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP .sp -.BI "int sched_setaffinity(pid_t " pid ", size_t " cpusetsize , -.BI " cpu_set_t *" mask ); +\fBint sched_setaffinity(pid_t \fP\fIpid\fP\fB, size_t \fP\fIcpusetsize\fP\fB,\fP +\fB cpu_set_t *\fP\fImask\fP\fB);\fP .sp -.BI "int sched_getaffinity(pid_t " pid ", size_t " cpusetsize , -.BI " cpu_set_t *" mask ); +\fBint sched_getaffinity(pid_t \fP\fIpid\fP\fB, size_t \fP\fIcpusetsize\fP\fB,\fP +\fB cpu_set_t *\fP\fImask\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"Osato: -.\"Osato: Kernel ドキュメント IRQ-affinity.txt の訳では、 -.\"Osato: "affinity" は「アフィニティ」になっていますが、 -.\"Osato: ここに一回だけ訳語 (親和度) を入れておくだけで、 -.\"Osato: 特に訳さないことにしようと思います。 -.\"Osato: -.\"O A process's CPU affinity mask determines the set of CPUs on which -.\"O it is eligible to run. -.\"O On a multiprocessor system, setting the CPU affinity mask -.\"O can be used to obtain performance benefits. -.\"O For example, -.\"O by dedicating one CPU to a particular process -.\"O (i.e., setting the affinity mask of that process to specify a single CPU, -.\"O and setting the affinity mask of all other processes to exclude that CPU), -.\"O it is possible to ensure maximum execution speed for that process. -.\"O Restricting a process to run on a single CPU also avoids -.\"O the performance cost caused by the cache invalidation that occurs -.\"O when a process ceases to execute on one CPU and then -.\"O recommences execution on a different CPU. -プロセスの CPU affinity (親和度) マスクは、そのプロセスが -実行を許可されている CPU の集合を決定する。 -マルチプロセッサ・システムでは、CPU affinity マスクを設定することで -性能上のメリットを得られる可能性がある。 -例えば、特定のプロセスを一つの CPU に括り付け -(すなわち、そのプロセスの affinity マスクを一つの CPU に設定し)、 -他の全てのプロセスの affinity マスクからその CPU を除外することで、 -確実にそのプロセスの実行速度を最大にすることができる。 -また、あるプロセスの実行を一つの CPU に限定することで、 -一つの CPU での実行を停止してから別の CPU で実行を再開するときに発生する +プロセスの CPU affinity (親和度) マスクは、そのプロセスが 実行を許可されている CPU の集合を決定する。 +マルチプロセッサ・システムでは、CPU affinity マスクを設定することで 性能上のメリットを得られる可能性がある。 +例えば、特定のプロセスを一つの CPU に括り付け (すなわち、そのプロセスの affinity マスクを一つの CPU に設定し)、 +他の全てのプロセスの affinity マスクからその CPU を除外することで、 確実にそのプロセスの実行速度を最大にすることができる。 +また、あるプロセスの実行を一つの CPU に限定することで、 一つの CPU での実行を停止してから別の CPU で実行を再開するときに発生する キャッシュ無効化 (cache invalidation) による性能面の劣化を避けることもできる。 -.\"O A CPU affinity mask is represented by the -.\"O .I cpu_set_t -.\"O structure, a "CPU set", pointed to by -.\"O .IR mask . -CPU affinity マスクは「CPU の集合」を表す -.I cpu_set_t -構造体で表現され、 -.I cpu_set_t -へのポインタ -.I mask -で指定される。 -.\"O A set of macros for manipulating CPU sets is described in -.\"O .BR CPU_SET (3). -CPU 集合を操作するためのマクロ群については -.BR CPU_SET (3) -で記載されている。 +CPU affinity マスクは「CPU の集合」を表す \fIcpu_set_t\fP 構造体で表現され、 \fIcpu_set_t\fP へのポインタ +\fImask\fP で指定される。 CPU 集合を操作するためのマクロ群については \fBCPU_SET\fP(3) で記載されている。 -.\"O .BR sched_setaffinity () -.\"O sets the CPU affinity mask of the process whose ID is -.\"O .I pid -.\"O to the value specified by -.\"O .IR mask . -.BR sched_setaffinity () -は、プロセスID が -.I pid -のプロセスの CPU affinity マスクを -.I mask -で指定された値に設定する。 -.\"O If -.\"O .I pid -.\"O is zero, then the calling process is used. -.\"O The argument -.\"O .I cpusetsize -.\"O is the length (in bytes) of the data pointed to by -.\"O .IR mask . -.I pid -が 0 の場合、呼び出し元プロセスが使われる。 -.I cpusetsize -引き数には -.I mask -が指すデータの長さ (バイト単位) である。 -.\"O Normally this argument would be specified as -.\"O .IR "sizeof(cpu_set_t)" . -通常は、この引き数には -.I "sizeof(cpu_set_t)" -を指定すればよい。 +\fBsched_setaffinity\fP() は、プロセスID が \fIpid\fP のプロセスの CPU affinity マスクを \fImask\fP +で指定された値に設定する。 \fIpid\fP が 0 の場合、呼び出し元プロセスが使われる。 \fIcpusetsize\fP 引き数には \fImask\fP +が指すデータの長さ (バイト単位) である。 通常は、この引き数には \fIsizeof(cpu_set_t)\fP を指定すればよい。 -.\"O If the process specified by -.\"O .I pid -.\"O is not currently running on one of the CPUs specified in -.\"O .IR mask , -.\"O then that process is migrated to one of the CPUs specified in -.\"O .IR mask . -.I pid -で指定されたプロセスが -.I mask -で指定された CPU のいずれかで現在実行されていない場合、 -そのプロセスは -.I mask +\fIpid\fP で指定されたプロセスが \fImask\fP で指定された CPU のいずれかで現在実行されていない場合、 そのプロセスは \fImask\fP で指定された CPU のいずれかに移動される。 -.\"O .BR sched_getaffinity () -.\"O writes the affinity mask of the process whose ID is -.\"O .I pid -.\"O into the -.\"O .I cpu_set_t -.\"O structure pointed to by -.\"O .IR mask . -.\"O The -.\"O .I cpusetsize -.\"O argument specifies the size (in bytes) of -.\"O .IR mask . -.BR sched_getaffinity () -は、 -プロセスID が -.I pid -のプロセスの affinity マスクを -.I mask -が指す -.I cpu_set_t -構造体に書き込む。 -.I cpusetsize -引き数には -.I mask -の (バイト単位の) 大きさを指定する。 - -関数 -.BR sched_getaffinity () -は長さ -.I len -のポインタ -.I mask -にプロセス -.I pid -の affinity マスクを書き込む。 -.\"O If -.\"O .I pid -.\"O is zero, then the mask of the calling process is returned. -.I pid -が 0 の場合、呼び出し元のプロセスのマスクが返される。 -.\"O .SH "RETURN VALUE" +\fBsched_getaffinity\fP() は、 プロセスID が \fIpid\fP のプロセスの affinity マスクを \fImask\fP が指す +\fIcpu_set_t\fP 構造体に書き込む。 \fIcpusetsize\fP 引き数には \fImask\fP の (バイト単位の) 大きさを指定する。 .SH 返り値 -.\"O On success, -.\"O .BR sched_setaffinity () -.\"O and -.\"O .BR sched_getaffinity () -.\"O return 0. -成功した場合、 -.BR sched_setaffinity () -と -.BR sched_getaffinity () -は 0 を返す。 -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -エラーの場合は \-1 を返し、 -.I errno -を適切に設定する。 -.\"O .SH ERRORS +成功した場合、 \fBsched_setaffinity\fP() と \fBsched_getaffinity\fP() は 0 を返す。 エラーの場合は +\-1 を返し、 \fIerrno\fP を適切に設定する。 .SH エラー -.TP -.B EFAULT -.\"O A supplied memory address was invalid. +.TP +\fBEFAULT\fP 指定されたメモリ番地が不正である。 -.TP -.B EINVAL -.\"O The affinity bit mask -.\"O .I mask -.\"O contains no processors that are currently physically on the system -.\"O and permitted to the process according to any restrictions that -.\"O may be imposed by the "cpuset" mechanism described in -.\"O .BR cpuset (7). -システム上に現在実際に存在し、かつ -"cpuset" 機構が課す制限においてそのプロセスに対して許可されている -プロセッサが、 -affinity ビットマスク -.I mask -に含まれていない。 -"cpuset" 機構については -.BR cpuset (7) -を参照。 -.TP -.B EINVAL -.\"O .RB ( sched_getaffinity () -.\"O and, in kernels before 2.6.9, -.\"O .BR sched_setaffinity ()) -.\"O .I cpusetsize -.\"O is smaller than the size of the affinity mask used by the kernel. -.RB ( sched_getaffinity () -と、カーネル 2.6.9 以前の -.BR sched_setaffinity ()) -.I cpusetsize -がカーネルで使われている affinity マスクのサイズより小さい。 -.TP -.B EPERM -.\"O .RB ( sched_setaffinity ()) -.\"O The calling process does not have appropriate privileges. -.\"O The caller needs an effective user ID equal to the real user ID -.\"O or effective user ID of the process identified by -.\"O .IR pid , -.\"O or it must possess the -.\"O .B CAP_SYS_NICE -.\"O capability. -.RB ( sched_setaffinity ()) -呼び出し元のプロセスに適切な特権がなかった。 -呼び出し元は、実効ユーザ ID が -.I pid -で識別されるプロセスの実ユーザ ID または実効ユーザ ID と同じであるか、 -.B CAP_SYS_NICE -ケーパビリティ (capability) を持たなければならない。 -.TP -.B ESRCH -.\"O The process whose ID is \fIpid\fP could not be found. +.TP +\fBEINVAL\fP +システム上に現在実際に存在し、かつ "cpuset" 機構が課す制限においてそのプロセスに対して許可されている プロセッサが、 affinity +ビットマスク \fImask\fP に含まれていない。 "cpuset" 機構については \fBcpuset\fP(7) を参照。 +.TP +\fBEINVAL\fP +(\fBsched_getaffinity\fP() と、カーネル 2.6.9 以前の \fBsched_setaffinity\fP()) +\fIcpusetsize\fP がカーネルで使われている affinity マスクのサイズより小さい。 +.TP +\fBEPERM\fP +(\fBsched_setaffinity\fP()) 呼び出し元のプロセスに適切な特権がなかった。 呼び出し元は、実効ユーザ ID が \fIpid\fP +で識別されるプロセスの実ユーザ ID または実効ユーザ ID と同じであるか、 \fBCAP_SYS_NICE\fP ケーパビリティ (capability) +を持たなければならない。 +.TP +\fBESRCH\fP プロセス ID \fIpid\fP のプロセスが見つからなかった。 -.\"O .SH VERSIONS .SH バージョン -.\"O The CPU affinity system calls were introduced in Linux kernel 2.5.8. -CPU affinity システムコールは Linux kernel 2.5.8 で導入された。 -.\"O The system call wrappers were introduced in glibc 2.3. -.\"O Initially, the glibc interfaces included a -.\"O .I cpusetsize -.\"O argument, typed as -.\"O .IR "unsigned int" . -.\"O In glibc 2.3.3, the -.\"O .I cpusetsize -.\"O argument was removed, but was then restored in glibc 2.3.4, with type -.\"O .IR size_t . -これらのシステムコールのラッパー関数は glibc 2.3 で導入された。 -最初は、glibc のインタフェースには -.I "unsigned int" -型の -.I cpusetsize -引き数が入っていた。 -glibc 2.3.3 では -.I cpusetsize -引き数が削除されたが、glibc 2.3.4 で -.I size_t -型で復活した。 -.\"O .SH "CONFORMING TO" +CPU affinity システムコールは Linux kernel 2.5.8 で導入された。 これらのシステムコールのラッパー関数は glibc +2.3 で導入された。 最初は、glibc のインタフェースには \fIunsigned int\fP 型の \fIcpusetsize\fP 引き数が入っていた。 +glibc 2.3.3 では \fIcpusetsize\fP 引き数が削除されたが、glibc 2.3.4 で \fIsize_t\fP 型で復活した。 .SH 準拠 -.\"O These system calls are Linux-specific. これらのシステムコールは Linux 固有である。 -.\"O .SH "NOTES" .SH 注意 -.\"O After a call to -.\"O .BR sched_setaffinity (), -.\"O the set of CPUs on which the process will actually run is -.\"O the intersection of the set specified in the -.\"O .I mask -.\"O argument and the set of CPUs actually present on the system. -.BR sched_setaffinity () -を呼び出した後は、プロセスが実際に実行される CPU の集合は、 -.I mask -引き数で指定された集合と、システム上に実際に存在する CPU の集合の -共通集合 (AND) となる。 -.\"O The system may further restrict the set of CPUs on which the process -.\"O runs if the "cpuset" mechanism described in -.\"O .BR cpuset (7) -.\"O is being used. -.\"O These restrictions on the actual set of CPUs on which the process -.\"O will run are silently imposed by the kernel. -"cpuset" 機構が使用されている場合には、プロセスが動作する CPU 集合 -に対してシステムはさらに制限を加えるかもしれない -("cpuset" 機構については -.BR cpuset (7) -を参照)。 -プロセスが動作する実際の CPU 集合に対する制限はカーネルにより -暗黙のうちに適用される。 +\fBsched_setaffinity\fP() を呼び出した後は、プロセスが実際に実行される CPU の集合は、 \fImask\fP +引き数で指定された集合と、システム上に実際に存在する CPU の集合の 共通集合 (AND) となる。 "cpuset" +機構が使用されている場合には、プロセスが動作する CPU 集合 に対してシステムはさらに制限を加えるかもしれない ("cpuset" 機構については +\fBcpuset\fP(7) を参照)。 プロセスが動作する実際の CPU 集合に対する制限はカーネルにより 暗黙のうちに適用される。 -.\"O .BR sched_setscheduler (2) -.\"O has a description of the Linux scheduling scheme. -.BR sched_setscheduler (2) -には Linux におけるスケジューリング機構についての説明がある。 +\fBsched_setscheduler\fP(2) に Linux のスケジューリング方式についての説明がある。 .PP -.\"O The affinity mask is actually a per-thread attribute that can be -.\"O adjusted independently for each of the threads in a thread group. -.\"O The value returned from a call to -.\"O .BR gettid (2) -.\"O can be passed in the argument -.\"O .IR pid . -実際には affinity マスクはスレッド単位の属性で、スレッドグループの -各スレッド単位に独立して調整することができる。 -.BR gettid (2) -コールからの返り値をこのコールの -.I pid -引き数として渡すことができる。 -.\"O Specifying -.\"O .I pid -.\"O as 0 will set the attribute for the calling thread, -.\"O and passing the value returned from a call to -.\"O .BR getpid (2) -.\"O will set the attribute for the main thread of the thread group. -.\"O (If you are using the POSIX threads API, then use -.\"O .BR pthread_setaffinity_np (3) -.\"O instead of -.\"O .BR sched_setaffinity ().) -.I pid -に 0 を指定すると呼び出し元のスレッドの属性が設定され、 -.BR getpid (2) -コールからの返り値を -.I pid -に指定するとスレッドグループのメインスレッドの属性が設定される -(POSIX スレッド API を使用している場合、 -.BR sched_setaffinity () -の代わりに -.BR pthread_setaffinity_np (3) +実際には affinity マスクはスレッド単位の属性で、スレッドグループの 各スレッド単位に独立して調整することができる。 \fBgettid\fP(2) +コールからの返り値をこのコールの \fIpid\fP 引き数として渡すことができる。 \fIpid\fP に 0 を指定すると呼び出し元のスレッドの属性が設定され、 +\fBgetpid\fP(2) コールからの返り値を \fIpid\fP に指定するとスレッドグループのメインスレッドの属性が設定される (POSIX スレッド +API を使用している場合、 \fBsched_setaffinity\fP() の代わりに \fBpthread_setaffinity_np\fP(3) を使用すること)。 -.\"O A child created via -.\"O .BR fork (2) -.\"O inherits its parent's CPU affinity mask. -.\"O The affinity mask is preserved across an -.\"O .BR execve (2). -.BR fork (2) -経由で生成された子プロセスは親プロセスの CPU affinity マスクを継承する。 -affinity マスクは -.BR execve (2) -の前後で保存される。 +\fBfork\fP(2) 経由で生成された子プロセスは親プロセスの CPU affinity マスクを継承する。 affinity マスクは +\fBexecve\fP(2) の前後で保存される。 -.\"O This manual page describes the glibc interface for the CPU affinity calls. -.\"O The actual system call interface is slightly different, with the -.\"O .I mask -.\"O being typed as -.\"O .IR "unsigned long *" , -.\"O reflecting the fact that the underlying implementation of CPU -.\"O sets is a simple bit mask. -.\"O On success, the raw -.\"O .BR sched_getaffinity () -.\"O system call returns the size (in bytes) of the -.\"O .I cpumask_t -.\"O data type that is used internally by the kernel to -.\"O represent the CPU set bit mask. このマニュアルページでは CPU affinity コールの glibc インタフェースを -説明している。実際のシステムコール・インタフェースは少し違っており、 -実際の実装では CPU 集合は簡単なビットマスクであるという実状を反映し、 -.I mask -の型が -.IR "unsigned long *" -となっている。 -成功時には、生の -.BR sched_getaffinity () -システムコール自身は -.I cpumask_t -データ型の (バイト単位の) 大きさを返す。 -.I cpumask_t -はカーネル内部で CPU 集合のビットマスクを表現するのに -使われているデータ型である。 -.\"O .SH "SEE ALSO" +説明している。実際のシステムコール・インタフェースは少し違っており、 実際の実装では CPU 集合は簡単なビットマスクであるという実状を反映し、 +\fImask\fP の型が \fIunsigned long *\fP となっている。 成功時には、生の \fBsched_getaffinity\fP() +システムコール自身は \fIcpumask_t\fP データ型の (バイト単位の) 大きさを返す。 \fIcpumask_t\fP はカーネル内部で CPU +集合のビットマスクを表現するのに 使われているデータ型である。 .SH 関連項目 -.BR clone (2), -.BR getcpu (2), -.BR getpriority (2), -.BR gettid (2), -.BR nice (2), -.BR sched_get_priority_max (2), -.BR sched_get_priority_min (2), -.BR sched_getscheduler (2), -.BR sched_setscheduler (2), -.BR setpriority (2), -.BR CPU_SET (3), -.BR pthread_setaffinity_np (3), -.BR sched_getcpu (3), -.BR capabilities (7), -.BR cpuset (7) +\fBclone\fP(2), \fBgetcpu\fP(2), \fBgetpriority\fP(2), \fBgettid\fP(2), \fBnice\fP(2), +\fBsched_get_priority_max\fP(2), \fBsched_get_priority_min\fP(2), +\fBsched_getscheduler\fP(2), \fBsched_setscheduler\fP(2), \fBsetpriority\fP(2), +\fBCPU_SET\fP(3), \fBpthread_setaffinity_np\fP(3), \fBsched_getcpu\fP(3), +\fBcapabilities\fP(7), \fBcpuset\fP(7) diff --git a/draft/man2/sched_setparam.2 b/draft/man2/sched_setparam.2 index b34617e8..8721172f 100644 --- a/draft/man2/sched_setparam.2 +++ b/draft/man2/sched_setparam.2 @@ -28,170 +28,65 @@ .\" revision .\" Modified 2004-05-27 by Michael Kerrisk .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1997-02-23, HANATAKA Shinya -.\" Updated & Modified 2005-02-10, Yuichi SATO -.\" Updated & Modified 2005-10-10, Akihiro MOTOKI -.\" Updated 2006-04-14, Akihiro MOTOKI, LDP v2.29 +.\"******************************************************************* .\" -.\"WORD: process プロセス -.\"WORD: scheduling スケジューリング -.\"WORD: policy 方針 -.\"WORD: implement 実装 -.\"WORD: parameter パラメータ -.\"WORD: effective user ID 実効ユーザーID +.\" This file was generated with po4a. Translate the source file. .\" -.TH SCHED_SETPARAM 2 2006-03-23 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH SCHED_SETPARAM 2 2006\-03\-23 Linux "Linux Programmer's Manual" .SH 名前 -.\"O sched_setparam, sched_getparam \- set and get scheduling parameters sched_setparam, sched_getparam \- スケジューリング・パラメータの設定と取得を行なう -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int sched_setparam(pid_t " pid ", const struct sched_param *" param ); +\fBint sched_setparam(pid_t \fP\fIpid\fP\fB, const struct sched_param *\fP\fIparam\fP\fB);\fP .sp -.BI "int sched_getparam(pid_t " pid ", struct sched_param *" param ); +\fBint sched_getparam(pid_t \fP\fIpid\fP\fB, struct sched_param *\fP\fIparam\fP\fB);\fP .sp -.nf -.ta 4n \fBstruct sched_param { ... - int \fIsched_priority\fB; + int \fP\fIsched_priority\fP\fB; ... -}; +};\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR sched_setparam () -.\"O sets the scheduling parameters associated with the scheduling policy -.\"O for the process identified by \fIpid\fP. -.\"O If \fIpid\fP is zero, then -.\"O the parameters of the calling process are set. -.\"O The interpretation of -.\"O the argument \fIparam\fP depends on the scheduling -.\"O policy of the process identified by -.\"O .IR pid . -.\"O See -.\"O .BR sched_setscheduler (2) -.\"O for a description of the scheduling policies supported under Linux. -.BR sched_setparam () -は \fIpid\fP で指定されたプロセスのスケジューリング方針 (scheduling policy) に -関連するスケジューリング・パラメータを設定する。 -\fIpid\fP が 0 ならば、呼び出し元のプロセスのパラメータが設定される。 -引き数 \fIparam\fP の解釈は、 -.I pid -で指定されたプロセスのスケジューリング方針によって異なる。 -Linux でサポートされているスケジューリング方針の説明は -.BR sched_setscheduler (2) -を参照のこと。 +\fBsched_setparam\fP() は \fIpid\fP で指定されたプロセスのスケジューリング方針 (scheduling policy) に +関連するスケジューリング・パラメータを設定する。 \fIpid\fP が 0 ならば、呼び出し元のプロセスのパラメータが設定される。 引き数 \fIparam\fP +の解釈は、 \fIpid\fP で指定されたプロセスのスケジューリング方針によって異なる。 Linux でサポートされているスケジューリング方針の説明は +\fBsched_setscheduler\fP(2) を参照のこと。 -.\"O .BR sched_getparam () -.\"O retrieves the scheduling parameters for the -.\"O process identified by \fIpid\fP. -.\"O If \fIpid\fP is zero, then the parameters -.\"O of the calling process are retrieved. -.BR sched_getparam () -は \fIpid\fP で指定されたプロセスのスケジューリング・パラメータを取得する。 -\fIpid\fP が 0 ならば、呼び出し元のプロセスのパラメータを取得する。 +\fBsched_getparam\fP() は \fIpid\fP で指定されたプロセスのスケジューリング・パラメータを取得する。 \fIpid\fP が 0 +ならば、呼び出し元のプロセスのパラメータを取得する。 -.\"O .BR sched_setparam () -.\"O checks the validity of \fIparam\fP for the scheduling policy of the -.\"O process. -.\"O The value \fIparam\->sched_priority\fP must lie within the -.\"O range given by -.\"O .BR sched_get_priority_min (2) -.\"O and -.\"O .BR sched_get_priority_max (2). -.BR sched_setparam () -はプロセスのスケジューリング方針における \fIparam\fP の妥当性をチェックする。 -\fIparam\->sched_priority\fP の値は -.BR sched_get_priority_min (2) -と -.BR sched_get_priority_max (2) -の範囲に入っていなければならない。 +\fBsched_setparam\fP() はプロセスのスケジューリング方針における \fIparam\fP の妥当性をチェックする。 +\fIparam\->sched_priority\fP の値は \fBsched_get_priority_min\fP(2) と +\fBsched_get_priority_max\fP(2) の範囲に入っていなければならない。 -.\"O For a discussion of the privileges and resource limits related to -.\"O scheduling priority and policy, see -.\"O .BR sched_setscheduler (2). -スケジューリングの優先度と方針に関連する特権とリソース制限の -議論に関しては -.BR sched_setscheduler (2) -を参照のこと。 +スケジューリングの優先度と方針に関連する特権とリソース制限の 議論に関しては \fBsched_setscheduler\fP(2) を参照のこと。 -.\"O POSIX systems on which -.\"O .BR sched_setparam () -.\"O and -.\"O .BR sched_getparam () -.\"O are available define -.\"O .B _POSIX_PRIORITY_SCHEDULING -.\"O in \fI\fP. -.BR sched_setparam () -と -.BR sched_getparam () -が使用できる POSIX システムでは、 -.I -に -.B _POSIX_PRIORITY_SCHEDULING -が定義されている。 -.\"O .SH "RETURN VALUE" +\fBsched_setparam\fP() と \fBsched_getparam\fP() が使用できる POSIX システムでは、 +\fI\fP に \fB_POSIX_PRIORITY_SCHEDULING\fP が定義されている。 .SH 返り値 -.\"O On success, -.\"O .BR sched_setparam () -.\"O and -.\"O .BR sched_getparam () -.\"O return 0. -成功した場合は -.BR sched_setparam () -と -.BR sched_getparam () -は 0 を返す。 -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -エラーの場合は \-1 が返され、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS +成功した場合は \fBsched_setparam\fP() と \fBsched_getparam\fP() は 0 を返す。 エラーの場合は \-1 +が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP -.B EINVAL -.\"O The argument \fIparam\fP does not make sense for the current -.\"O scheduling policy. -引き数 \fIparam\fP が現在のスケジューリング方針においては -無意味である。 -.TP -.B EPERM -.\"O The calling process does not have appropriate privileges -.\"O (Linux: does not have the -.\"O .B CAP_SYS_NICE -.\"O capability). -呼び出し元のプロセスが適切な特権を持っていない -(Linux では、 -.B CAP_SYS_NICE -ケーパビリティを持っていない)。 -.TP -.B ESRCH -.\"O The process whose ID is \fIpid\fP could not be found. -\fIpid\fP を ID に持つプロセスが見つからなかった。 -.\"O .SH "CONFORMING TO" +.TP +\fBEINVAL\fP +引き数 \fIparam\fP が現在のスケジューリング方針においては 無意味である。 +.TP +\fBEPERM\fP +呼び出し元のプロセスが適切な特権を持っていない (Linux では、 \fBCAP_SYS_NICE\fP ケーパビリティを持っていない)。 +.TP +\fBESRCH\fP +プロセス ID \fIpid\fP のプロセスが見つからなかった。 .SH 準拠 -POSIX.1-2001. -.\"O .SH "SEE ALSO" +POSIX.1\-2001. .SH 関連項目 -.BR getpriority (2), -.BR nice (2), -.BR sched_get_priority_max (2), -.BR sched_get_priority_min (2), -.BR sched_getaffinity (2), -.BR sched_getscheduler (2), -.BR sched_setaffinity (2), -.BR sched_setscheduler (2), -.BR setpriority (2), -.BR capabilities (7) +\fBgetpriority\fP(2), \fBnice\fP(2), \fBsched_get_priority_max\fP(2), +\fBsched_get_priority_min\fP(2), \fBsched_getaffinity\fP(2), +\fBsched_getscheduler\fP(2), \fBsched_setaffinity\fP(2), \fBsched_setscheduler\fP(2), +\fBsetpriority\fP(2), \fBcapabilities\fP(7) .PP -.I Programming for the real world \- POSIX.4 -by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0 +\fIProgramming for the real world \- POSIX.4\fP by Bill O. Gallmeister, O'Reilly +& Associates, Inc., ISBN 1\-56592\-074\-0 diff --git a/draft/man2/sched_setscheduler.2 b/draft/man2/sched_setscheduler.2 deleted file mode 100644 index 363382d4..00000000 --- a/draft/man2/sched_setscheduler.2 +++ /dev/null @@ -1,825 +0,0 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" Copyright (C) Tom Bjorkholm, Markus Kuhn & David A. Wheeler 1996-1999 -.\" and Copyright (C) 2007 Carsten Emde -.\" and Copyright (C) 2008 Michael Kerrisk -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; without even the implied warranty of -.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -.\" GNU General Public License for more details. -.\" -.\" You should have received a copy of the GNU General Public -.\" License along with this manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.\" -.\" 1996-04-01 Tom Bjorkholm -.\" First version written -.\" 1996-04-10 Markus Kuhn -.\" revision -.\" 1999-08-18 David A. Wheeler added Note. -.\" Modified, 25 Jun 2002, Michael Kerrisk -.\" Corrected description of queue placement by sched_setparam() and -.\" sched_setscheduler() -.\" A couple of grammar clean-ups -.\" Modified 2004-05-27 by Michael Kerrisk -.\" 2005-03-23, mtk, Added description of SCHED_BATCH. -.\" 2007-07-10, Carsten Emde -.\" Add text on real-time features that are currently being -.\" added to the mainline kernel. -.\" 2008-05-07, mtk; Rewrote and restructured various parts of the page to -.\" improve readability. -.\" -.\" Worth looking at: http://rt.wiki.kernel.org/index.php -.\" -.\" FIXME: 2.6.32 added SCHED_RESET_ON_FORK -.\" -.\" Japanese Version Copyright (c) 1996 Akira Yoshiyama -.\" all rights reserved. -.\" Translated Thu Jul 11 01:42:52 JST 1996 -.\" by Akira Yoshiyama -.\" Modified Sun Nov 21 19:36:18 JST 1999 -.\" by HANATAKA Shinya -.\" Updated Wed Jan 1 JST 2003 by Kentaro Shirakata -.\" Updated 2005-02-24, Akihiro MOTOKI -.\" Updated & Modified 2005-10-10, Akihiro MOTOKI -.\" Updated 2006-04-16, Akihiro MOTOKI, Catch up to LDP v2.28 -.\" Updated 2007-10-13, Akihiro MOTOKI, LDP v2.65 -.\" Updated 2008-08-13, Akihiro MOTOKI, LDP v3.05 -.\" -.\"WORD: privileges 特権 -.\"WORD: resource limit リソース制限 -.\"WORD: scheduling policy スケジューリング・ポリシー -.\" -.TH SCHED_SETSCHEDULER 2 2008-11-06 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O sched_setscheduler, sched_getscheduler \- -.\"O set and get scheduling policy/parameters -sched_setscheduler, sched_getscheduler \- -スケジューリング・ポリシーとパラメータを設定/取得する -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.B #include -.sp -.BI "int sched_setscheduler(pid_t " pid ", int " policy , -.br -.BI " const struct sched_param *" param ); -.sp -.BI "int sched_getscheduler(pid_t " pid ); -.sp -\fBstruct sched_param { - ... - int \fIsched_priority\fB; - ... -}; -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O .BR sched_setscheduler () -.\"O sets both the scheduling policy and the associated parameters for the -.\"O process whose ID is specified in \fIpid\fP. -.\"O If \fIpid\fP equals zero, the -.\"O scheduling policy and parameters of the calling process will be set. -.\"O The interpretation of -.\"O the argument \fIparam\fP depends on the selected policy. -.\"O Currently, Linux supports the following "normal" -.\"O (i.e., non-real-time) scheduling policies: -.BR sched_setscheduler () -は \fIpid\fP で指定された ID を持つプロセスのスケジューリング・ポリシーや -それに関連するパラメータを設定する。\fIpid\fP が 0 の場合は -呼び出したプロセスのスケジューリング・ポリシーとパラメータが設定される。 -引き数 \fIparam\fP の解釈は選択されたポリシーによる。 -現在のところ、Linux では -以下に示す「通常」(リアルタイムでない) スケジューリング・ポリシーが -サポートされている。 -.TP 14 -.BR SCHED_OTHER -.\"O the standard round-robin time-sharing policy; -標準の、ラウンドロビンによる時分割型のスケジューリング・ポリシー。 -.\"O .\" In the 2.6 kernel sources, SCHED_OTHER is actually called -.\"O .\" SCHED_NORMAL. -.\" 2.6 カーネルソースでは、SCHED_OTHER は実際には -.\" SCHED_NORMAL と呼ばれている。 -.TP -.BR SCHED_BATCH -.\"O for "batch" style execution of processes; and -「バッチ」形式でのプロセスの実行用。 -.TP -.BR SCHED_IDLE -.\"O for running -.\"O .I very -.\"O low priority background jobs. -「非常に」低い優先度で動作するバックグラウンド・ジョブ用。 -.PP -.\"O The following "real-time" policies are also supported, -.\"O for special time-critical applications that need precise control over -.\"O the way in which runnable processes are selected for execution: -どの実行可能プロセスを選択するかについて、より正確な制御を必要とする -時間の制約が厳しい特別なアプリケーション用として、 -以下の「リアルタイム」ポリシーもサポートされている。 -.TP 14 -.BR SCHED_FIFO -.\"O a first-in, first-out policy; and -ファーストイン、ファーストアウト型のポリシー。 -.TP -.BR SCHED_RR -.\"O a round-robin policy. -ラウンドロビン型のポリシー。 -.PP -.\"O The semantics of each of these policies are detailed below. -これらのポリシーのそれぞれの動作については以下で説明する。 - -.\"O .BR sched_getscheduler () -.\"O queries the scheduling policy currently applied to the process -.\"O identified by \fIpid\fP. -.\"O If \fIpid\fP equals zero, the policy of the -.\"O calling process will be retrieved. -.BR sched_getscheduler () -は \fIpid\fP で識別されるプロセスに現在適用されている -スケジューリング・ポリシーを尋ねる。\fIpid\fP が 0 ならば、呼び出した -プロセス自身のスケジューリング・ポリシーが返される。 -.\" -.\"O .SS Scheduling Policies -.SS スケジューリング・ポリシー (scheduling policy) -.\"O The scheduler is the kernel component that decides which runnable process -.\"O will be executed by the CPU next. -.\"O Each process has an associated scheduling policy and a \fIstatic\fP -.\"O scheduling priority, \fIsched_priority\fP; these are the settings -.\"O that are modified by -.\"O .BR sched_setscheduler (). -.\"O The scheduler makes it decisions based on knowledge of the scheduling -.\"O policy and static priority of all processes on the system. -スケジューラ (scheduler) とはカーネルの構成要素で、 -次に CPU で実行される実行可能なプロセスを決定するものである。 -各々のプロセスには、スケジューリング・ポリシーと -「静的」なスケジューリング優先度 \fIsched_priority\fP が対応付けられ、 -これらの設定は -.BR sched_setscheduler () -で変更できる。 -スケジューラは、システム上の全プロセスのスケジューリング・ポリシーと -静的優先度に関する知識に基づいて決定を行う。 - -.\"O For processes scheduled under one of the normal scheduling policies -.\"O (\fBSCHED_OTHER\fP, \fBSCHED_IDLE\fP, \fBSCHED_BATCH\fP), -.\"O \fIsched_priority\fP is not used in scheduling -.\"O decisions (it must be specified as 0). -通常のスケジューリング・ポリシー -(\fBSCHED_OTHER\fP, \fBSCHED_IDLE\fP, \fBSCHED_BATCH\fP) -の下でスケジューリングされるプロセスでは、 -\fIsched_priority\fP はスケジューリングの決定に使用されない -(\fIsched_priority\fP には 0 を指定しなければならない)。 - -.\"O Processes scheduled under one of the real-time policies -.\"O (\fBSCHED_FIFO\fP, \fBSCHED_RR\fP) have a -.\"O \fIsched_priority\fP value in the range 1 (low) to 99 (high). -.\"O (As the numbers imply, real-time processes always have higher priority -.\"O than normal processes.) -リアルタイム・スケジューリング・ポリシー (\fBSCHED_FIFO\fP, \fBSCHED_RR\fP) -の下でスケジューリングされるプロセスは、 -\fIsched_priority\fP の値は 1 (最低) から 99 (最高) の範囲となる -(数字から分かるように、リアルタイム・プロセスは常に通常のプロセスよりも -高い優先度を持つ)。 -.\"O Note well: POSIX.1-2001 only requires an implementation to support a -.\"O minimum 32 distinct priority levels for the real-time policies, -.\"O and some systems supply just this minimum. -.\"O Portable programs should use -.\"O .BR sched_get_priority_min (2) -.\"O and -.\"O .BR sched_get_priority_max (2) -.\"O to find the range of priorities supported for a particular policy. -ここで注意すべきなのは、POSIX.1-2001 が要求しているのは、 -リアルタイム・ポリシーの実装において最低 32 種類の異なる優先度レベルが -サポートされることだけであり、いくつかのシステムではこの最低限の数の -優先度しか提供されていない、ということである。 -移植性が必要なプログラムでは、 -.BR sched_get_priority_min (2) -と -.BR sched_get_priority_max (2) -を使って、あるポリシーがサポートする優先度の範囲を調べるべきである。 - -.\"O Conceptually, the scheduler maintains a list of runnable -.\"O processes for each possible \fIsched_priority\fP value. -.\"O In order to determine which process runs next, the scheduler looks for -.\"O the nonempty list with the highest static priority and selects the -.\"O process at the head of this list. -概念としては、 -スケジューラはその \fIsched_priority\fP の値それぞれに対して -実行可能なプロセスのリストを管理している。 -どのプロセスを次に実行するかを決定するために、 -スケジューラは静的優先度の最も高い空でないリストを探して、 -そのリストの先頭のプロセスを選択する。 - -.\"O A process's scheduling policy determines -.\"O where it will be inserted into the list of processes -.\"O with equal static priority and how it will move inside this list. -各プロセスのスケジューリング・ポリシーは、 -そのプロセスが同じ静的優先度を持つプロセスのリストの中のどこに挿入され、 -このリストの中をどのように移動するかを決定する。 - -.\"O All scheduling is preemptive: if a process with a higher static -.\"O priority becomes ready to run, the currently running process -.\"O will be preempted and -.\"O returned to the wait list for its static priority level. -.\"O The scheduling policy only determines the -.\"O ordering within the list of runnable processes with equal static -.\"O priority. -全てのスケジューリングはプリエンプティブ (preemptive) である: -より高い優先度のプロセスが実行可能になると、現在実行中のプロセスは実行権を -取り上げられ (preempted)、そのプロセスの静的優先度レベルの待ちリストに -戻される。スケジューリング・ポリシーは同じ静的優先度を持つ実行可能な -プロセスのリストの中で順番のみを決定する。 -.\"O .SS SCHED_FIFO: First In-First Out scheduling -.SS SCHED_FIFO: ファーストイン・ファーストアウト・スケジューリング -.\"O \fBSCHED_FIFO\fP can only be used with static priorities higher than -.\"O 0, which means that when a \fBSCHED_FIFO\fP processes becomes runnable, -.\"O it will always immediately preempt any currently running -.\"O \fBSCHED_OTHER\fP, \fBSCHED_BATCH\fP, or \fBSCHED_IDLE\fP process. -.\"O \fBSCHED_FIFO\fP is a simple scheduling -.\"O algorithm without time slicing. -.\"O For processes scheduled under the -.\"O \fBSCHED_FIFO\fP policy, the following rules apply: -\fBSCHED_FIFO\fP は 0 より大きな静的優先度でのみ使用できる。このポリシーでは、 -\fBSCHED_FIFO\fP プロセスが実行可能になった場合、 -そのポリシーが \fBSCHED_OTHER\fP、 \fBSCHED_BATCH\fP、 \fBSCHED_IDLE\fP の -現在実行中のプロセスは直ちに実行権を取り上げられる。 -\fBSCHED_FIFO\fP は時分割のない単純なスケジューリング・アルゴリズムである。 -\fBSCHED_FIFO\fP ポリシーでスケジューリングされているプロセスには以下の -ルールが適用される: -.IP * 3 -.\"O A \fBSCHED_FIFO\fP process that has been preempted by another process of -.\"O higher priority will stay at the head of the list for its priority and -.\"O will resume execution as soon as all processes of higher priority are -.\"O blocked again. -より高い優先度の他のプロセスによって取って代わられた -\fBSCHED_FIFO\fP プロセスはその優先度のリストの先頭に留まり続け、 -より高い優先度のプロセス全てが停止 (block) した場合に実行を再開する。 -.IP * -.\"O When a \fBSCHED_FIFO\fP process becomes runnable, it -.\"O will be inserted at the end of the list for its priority. -\fBSCHED_FIFO\fP プロセスが実行可能になった時、その優先度のリストの最後 -に挿入される。 -.IP * -.\"O A call to -.\"O .BR sched_setscheduler () -.\"O or -.\"O .BR sched_setparam (2) -.\"O will put the -.\"O \fBSCHED_FIFO\fP (or \fBSCHED_RR\fP) process identified by -.\"O \fIpid\fP at the start of the list if it was runnable. -.BR sched_setscheduler () -や -.BR sched_setparam (2) -は -\fIpid\fP で指定された \fBSCHED_FIFO\fP (または \fBSCHED_RR\fP) プロセスが -実行可能な場合、リストの最初に置く。 -.\"O As a consequence, it may preempt the currently running process if -.\"O it has the same priority. -.\"O (POSIX.1-2001 specifies that the process should go to the end -.\"O of the list.) -結果として、もし優先度が同じだった場合、 -現在実行中のプロセスに先んじるかもしれない。 -(POSIX.1-2001 ではプロセスはリストの最後に行くべきと規定されている。) -.\" In 2.2.x and 2.4.x, the process is placed at the front of the queue -.\" In 2.0.x, the Right Thing happened: the process went to the back -- MTK -.IP * -.\"O A process calling -.\"O .BR sched_yield (2) -.\"O will be put at the end of the list. -.BR sched_yield (2) -を呼び出したプロセスはリストの最後に置かれる。 -.PP -.\"O No other events will move a process -.\"O scheduled under the \fBSCHED_FIFO\fP policy in the wait list of -.\"O runnable processes with equal static priority. -その他のイベントによって \fBSCHED_FIFO\fP ポリシーで -スケジューリングされるプロセスが同じ優先度の実行可能な -プロセスの待ちリストの中を移動することはない。 - -.\"O A \fBSCHED_FIFO\fP -.\"O process runs until either it is blocked by an I/O request, it is -.\"O preempted by a higher priority process, or it calls -.\"O .BR sched_yield (2). -\fBSCHED_FIFO\fP プロセスは I/O 要求によって停止するか、 -より高い優先度のプロセスによって置きかえられるか、 -.BR sched_yield (2) -を呼び出すまで実行を続ける。 -.\"O .SS SCHED_RR: Round Robin scheduling -.SS SCHED_RR: ラウンド・ロビン (round robin) ・スケジューリング -.\"O \fBSCHED_RR\fP is a simple enhancement of \fBSCHED_FIFO\fP. -.\"O Everything -.\"O described above for \fBSCHED_FIFO\fP also applies to \fBSCHED_RR\fP, -.\"O except that each process is only allowed to run for a maximum time -.\"O quantum. -.\"O If a \fBSCHED_RR\fP process has been running for a time -.\"O period equal to or longer than the time quantum, it will be put at the -.\"O end of the list for its priority. -.\"O A \fBSCHED_RR\fP process that has -.\"O been preempted by a higher priority process and subsequently resumes -.\"O execution as a running process will complete the unexpired portion of -.\"O its round robin time quantum. -.\"O The length of the time quantum can be -.\"O retrieved using -.\"O .BR sched_rr_get_interval (2). -\fBSCHED_RR\fP は \fBSCHED_FIFO\fP の単純な拡張である。 -上述された \fBSCHED_FIFO\fP に関する記述は全て \fBSCHED_RR\fP に -適用できる。異なるのはそれぞれのプロセスは最大時間単位までしか実行できない -ということである。\fBSCHED_RR\fP プロセスが時間単位と同じかそれより -長い時間実行されると、その優先度のリストの最後に置かれる。 -より高い優先度のプロセスによって置きかえられ、その後実行を再開した -\fBSCHED_RR\fP プロセスは、そのラウンド・ロビン時間単位を完全に使い切る -まで実行される。その時間単位の長さは -.BR sched_rr_get_interval (2) -を使って取得できる。 -.\" On Linux 2.4, the length of the RR interval is influenced -.\" by the process nice value -- MTK -.\" -.\"O .SS SCHED_OTHER: Default Linux time-sharing scheduling -.SS SCHED_OTHER: Linux のデフォルトの時分割スケジューリング -.\"O \fBSCHED_OTHER\fP can only be used at static priority 0. -.\"O \fBSCHED_OTHER\fP is the standard Linux time-sharing scheduler that is -.\"O intended for all processes that do not require the special -.\"O real-time mechanisms. -.\"O The process to run is chosen from the static -.\"O priority 0 list based on a \fIdynamic\fP priority that is determined only -.\"O inside this list. -.\"O The dynamic priority is based on the nice value (set by -.\"O .BR nice (2) -.\"O or -.\"O .BR setpriority (2)) -.\"O and increased for each time quantum the process is ready to run, -.\"O but denied to run by the scheduler. -.\"O This ensures fair progress among all \fBSCHED_OTHER\fP processes. -\fBSCHED_OTHER\fP は静的優先度 0 でのみ使用できる。 -\fBSCHED_OTHER\fP は Linux 標準の時分割スケジューラで、 -特別なリアルタイム機構を必要としていない全てのプロセスで使用される。 -実行するプロセスは、静的優先度 0 のリストから、このリストの中だけで -決定される「動的な」優先度 (dynamic priority) に基いて決定される。 -動的な優先度は -.RB ( nice (2) -や -.BR setpriority (2) -により設定される) nice 値に基づいて決定されるもので、 -単位時間毎に、プロセスが実行可能だが、スケジューラにより実行が拒否された -場合にインクリメントされる。 -これにより、全ての \fBSCHED_OTHER\fP プロセスでの公平性が保証される。 -.\" -.\"O .SS SCHED_BATCH: Scheduling batch processes -.SS SCHED_BATCH: バッチプロセスのスケジューリング -.\"O (Since Linux 2.6.16.) -(Linux 2.6.16 以降) -.\"O \fBSCHED_BATCH\fP can only be used at static priority 0. -.\"O This policy is similar to \fBSCHED_OTHER\fP in that it schedules -.\"O the process according to its dynamic priority -.\"O (based on the nice value). -.\"O The difference is that this policy -.\"O will cause the scheduler to always assume -.\"O that the process is CPU-intensive. -.\"O Consequently, the scheduler will apply a small scheduling -.\"O penalty with respect to wakeup behaviour, -.\"O so that this process is mildly disfavored in scheduling decisions. -\fBSCHED_BATCH\fP は静的優先度 0 でのみ使用できる。 -このポリシーは (nice 値に基づく) 動的な優先度にしたがってプロセスの -スケジューリングが行われるという点で、\fBSCHED_OTHER\fP に似ている。 -異なるのは、このポリシーでは、プロセスが常に CPU に負荷のかかる (CPU-intensive) -処理を行うと、スケジューラが仮定する点である。 -スケジューラはプロセスを呼び起こす毎にそのプロセスにスケジューリング上の -ペナルティを少し課し、その結果、このプロセスはスケジューリングの決定で -若干冷遇されるようになる。 - -.\" The following paragraph is drawn largely from the text that -.\" accompanied Ingo Molnar's patch for the implementation of -.\" SCHED_BATCH. -.\"O This policy is useful for workloads that are noninteractive, -.\"O but do not want to lower their nice value, -.\"O and for workloads that want a deterministic scheduling policy without -.\"O interactivity causing extra preemptions (between the workload's tasks). -このポリシーは、非対話的な処理だがその nice 値を下げたくない処理や、 -(処理のタスク間で) 余計なタスクの置き換えの原因とある対話的な処理なしで -確定的な (deterministic) スケジューリング・ポリシーを適用したい処理に -対して有効である。 -.\" -.\"O .SS SCHED_IDLE: Scheduling very low priority jobs -.SS SCHED_IDLE: 非常に優先度の低いジョブのスケジューリング -.\"O (Since Linux 2.6.23.) -(Linux 2.6.23 以降) -.\"O \fBSCHED_IDLE\fP can only be used at static priority 0; -.\"O the process nice value has no influence for this policy. -\fBSCHED_IDLE\fP は静的優先度 0 でのみ使用できる。 -このポリシーではプロセスの nice 値はスケジューリングに影響を与えない。 - -.\"O This policy is intended for running jobs at extremely low -.\"O priority (lower even than a +19 nice value with the -.\"O .B SCHED_OTHER -.\"O or -.\"O .B SCHED_BATCH -.\"O policies). -非常に低い優先度でのジョブの実行を目的としたものである -(非常に低い優先度とは、ポリシー -.B SCHED_OTHER -か -.B SCHED_BATCH -での nice 値 +19 よりさらに低い優先度である)。 -.\" -.\"O .SS Privileges and resource limits -.SS 特権とリソース制限 -.\"O In Linux kernels before 2.6.12, only privileged -.\"O .RB ( CAP_SYS_NICE ) -.\"O processes can set a nonzero static priority (i.e., set a real-time -.\"O scheduling policy). -.\"O The only change that an unprivileged process can make is to set the -.\"O .B SCHED_OTHER -.\"O policy, and this can only be done if the effective user ID of the caller of -.\"O .BR sched_setscheduler () -.\"O matches the real or effective user ID of the target process -.\"O (i.e., the process specified by -.\"O .IR pid ) -.\"O whose policy is being changed. -2.6.12 より前のバージョンの Linux カーネルでは、 -特権プロセス -.RB ( CAP_SYS_NICE -ケーパビリティを持つプロセス) だけが 0 以外の静的優先度を設定する -(すなわち、リアルタイム・スケジューリング・ポリシーを設定する) ことができる。 -非特権プロセスができる変更は -.B SCHED_OTHER -ポリシーを設定することだけであり、さらにこの変更を行えるのは -.BR sched_setscheduler () -の呼び出し元の実効ユーザ ID がポリシーの変更対象プロセス -.RI ( pid -で指定されたプロセス) の実ユーザ ID か実効ユーザ ID と -一致する場合だけである。 - -.\"O Since Linux 2.6.12, the -.\"O .B RLIMIT_RTPRIO -.\"O resource limit defines a ceiling on an unprivileged process's -.\"O static priority for the -.\"O .B SCHED_RR -.\"O and -.\"O .B SCHED_FIFO -.\"O policies. -Linux 2.6.12 以降では、リソース制限 -.B RLIMIT_RTPRIO -が定義されており、 -スケジューリング・ポリシーが -.B SCHED_RR -と -.B SCHED_FIFO -の場合の、非特権プロセスの静的優先度の上限を定めている。 -.\"O The rules for changing scheduling policy and priority are as follows: -スケジューリング・ポリシーと優先度を変更する際のルールは以下の通りである。 -.IP * 2 -.\"O If an unprivileged process has a nonzero -.\"O .B RLIMIT_RTPRIO -.\"O soft limit, then it can change its scheduling policy and priority, -.\"O subject to the restriction that the priority cannot be set to a -.\"O value higher than the maximum of its current priority and its -.\"O .B RLIMIT_RTPRIO -.\"O soft limit. -非特権プロセスに 0 以外の -.B RLIMIT_RTPRIO -ソフト・リミットが設定されている場合、 -非特権プロセスはそのプロセスのスケジューリング・ポリシーと優先度を -変更できるが、優先度を現在の自身の優先度と -.B RLIMIT_RTPRIO -ソフト・リミットの大きい方よりも高い値に設定できないという制限が課される。 -.IP * -.\"O If the -.\"O .B RLIMIT_RTPRIO -.\"O soft limit is 0, then the only permitted changes are to lower the priority, -.\"O or to switch to a non-real-time policy. -.B RLIMIT_RTPRIO -ソフト・リミットが 0 の場合、優先度を下げるか、 -リアルタイムでないポリシーへ切り替えるかの変更だけが許可される。 -.IP * -.\"O Subject to the same rules, -.\"O another unprivileged process can also make these changes, -.\"O as long as the effective user ID of the process making the change -.\"O matches the real or effective user ID of the target process. -ある非特権プロセスが別のプロセスに対してこれらの変更を行う際にも、 -同じルールが適用される。変更を行えるのは、変更を行おうとするプロセス -の実効ユーザ ID が変更対象のプロセスの実ユーザ ID か実効ユーザ ID と -一致している場合に限られる。 -.IP * -.\"O Special rules apply for the -.\"O .BR SCHED_IDLE : -.\"O an unprivileged process operating under this policy cannot -.\"O change its policy, regardless of the value of its -.\"O .BR RLIMIT_RTPRIO -.\"O resource limit. -.B SCHED_IDLE -には特別なルールが適用され、 -このポリシーの下で動作する非特権プロセスは、リソース制限 -.B RLIMIT_RTPRIO -の値にかかわらず自身のポリシーを変更することができない。 -.PP -.\"O Privileged -.\"O .RB ( CAP_SYS_NICE ) -.\"O processes ignore the -.\"O .B RLIMIT_RTPRIO -.\"O limit; as with older kernels, -.\"O they can make arbitrary changes to scheduling policy and priority. -特権プロセス -.RB ( CAP_SYS_NICE -ケーパビリティを持つプロセス) の場合、 -.B RLIMIT_RTPRIO -の制限は無視される; -古いカーネルと同じように、スケジューリング・ポリシーと優先度に対し -任意の変更を行うことができる。 -.\"O See -.\"O .BR getrlimit (2) -.\"O for further information on -.\"O .BR RLIMIT_RTPRIO . -.B RLIMIT_RTPRIO -に関するもっと詳しい情報は -.BR getrlimit (2) -を参照のこと。 -.\"O .SS Response time -.SS 応答時間 (response time) -.\"O A blocked high priority process waiting for the I/O has a certain -.\"O response time before it is scheduled again. -.\"O The device driver writer -.\"O can greatly reduce this response time by using a "slow interrupt" -.\"O interrupt handler. -.\"O .\" as described in -.\"O .\" .BR request_irq (9). -I/O 待ちで停止したより高い優先度のプロセスは再びスケジューリングされる -前にいくらかの応答時間がかかる。デバイス・ドライバーを書く場合には -.\" .BR request_irq (9) -.\" に記述されている -"slow interrupt" 割り込みハンドラーを使用することで -この応答時間を劇的に減少させることができる。 -.\"O .SS Miscellaneous -.SS その他 -.\"O Child processes inherit the scheduling policy and parameters across a -.\"O .BR fork (2). -.\"O The scheduling policy and parameters are preserved across -.\"O .BR execve (2). -子プロセスは -.BR fork (2) -の際に親プロセスのスケジューリング・ポリシーとパラメータを継承する。 -.BR execve (2) -の前後で、スケジューリング・ポリシーとパラメータは保持される。 - -.\"O Memory locking is usually needed for real-time processes to avoid -.\"O paging delays; this can be done with -.\"O .BR mlock (2) -.\"O or -.\"O .BR mlockall (2). -リアルタイム・プロセスは大抵、ページングの待ち時間を避けるために -.BR mlock (2) -や -.BR mlockall (2) -を使ってメモリ・ロックをしなければならない。 - -.\"O Since a nonblocking infinite loop in a process scheduled under -.\"O \fBSCHED_FIFO\fP or \fBSCHED_RR\fP will block all processes with lower -.\"O priority forever, a software developer should always keep available on -.\"O the console a shell scheduled under a higher static priority than the -.\"O tested application. -.\"O This will allow an emergency kill of tested -.\"O real-time applications that do not block or terminate as expected. -\fBSCHED_FIFO\fP や \fBSCHED_RR\fP でスケジューリングされる -プロセスが停止せずに無限ループに陥ると、 -他の全てのより低い優先度のプロセスを永久に停止 (block) させてしまうので、 -ソフトウェア開発者はコンソールのシェルの静的優先度をテストする -アプリケーションよりも常に高く保つべきである。 -これによって期待通りに停止したり終了したりしないリアルタイム・ -アプリケーションを緊急終了させることが可能になる。 -.\"O See also the description of the -.\"O .BR RLIMIT_RTTIME -.\"O resource limit in -.\"O .BR getrlimit (2). -.BR getrlimit (2) -のリソース制限 -.B RLIMIT_RTTIME -の説明も参照のこと。 - -.\"O POSIX systems on which -.\"O .BR sched_setscheduler () -.\"O and -.\"O .BR sched_getscheduler () -.\"O are available define -.\"O .B _POSIX_PRIORITY_SCHEDULING -.\"O in \fI\fP. -POSIX システムでは \fI\fP に -.B _POSIX_PRIORITY_SCHEDULING -が定義されている場合にのみ -.BR sched_setscheduler () -と -.BR sched_getscheduler () -が使用できる。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success, -.\"O .BR sched_setscheduler () -.\"O returns zero. -.\"O On success, -.\"O .BR sched_getscheduler () -.\"O returns the policy for the process (a nonnegative integer). -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合、 -.BR sched_setscheduler () -は 0 を返す。 -成功した場合、 -.BR sched_getscheduler () -は現在のそのプロセスのポリシー (非負の整数) を返す。 -エラーの場合、\-1 が返され、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EINVAL -.\"O The scheduling \fIpolicy\fP is not one of the recognized policies, -.\"O or \fIparam\fP does not make sense for the \fIpolicy\fP. -スケジューリング・ポリシー \fIpolicy\fP が間違っているか、 -\fIparam\fP がそのポリシーでは意味をなさない。 -.TP -.B EPERM -.\"O The calling process does not have appropriate privileges. -呼び出したプロセスが適切な特権を持っていない。 -.TP -.B ESRCH -.\"O The process whose ID is \fIpid\fP could not be found. -IDが \fIpid\fP のプロセスが見つからない。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -.\"O POSIX.1-2001 (but see BUGS below). -.\"O The \fBSCHED_BATCH\fP and \fBSCHED_IDLE\fP policies are Linux-specific. -POSIX.1-2001 (但し、下記のバグの節も参照)。 -\fBSCHED_BATCH\fP と \fBSCHED_IDLE\fP ポリシーは Linux 固有である。 -.\"O .SH NOTES -.SH 注意 -.\"O POSIX.1 does not detail the permissions that an unprivileged -.\"O process requires in order to call -.\"O .BR sched_setscheduler (), -.\"O and details vary across systems. -.\"O For example, the Solaris 7 manual page says that -.\"O the real or effective user ID of the calling process must -.\"O match the real user ID or the save set-user-ID of the target process. -POSIX.1 は、非特権プロセスが -.BR sched_setscheduler () -を呼び出すために必要な権限の詳細を規定しておらず、 -詳細はシステムにより異なる。 -例えば、Solaris 7 のマニュアルページでは、 -呼び出し元プロセスの実ユーザ ID または実効ユーザ ID が -設定対象のプロセスの実ユーザ ID か保存 (save) set-user-ID と -一致していなければならない、となっている。 -.PP -.\"O Originally, Standard Linux was intended as a general-purpose operating -.\"O system being able to handle background processes, interactive -.\"O applications, and less demanding real-time applications (applications that -.\"O need to usually meet timing deadlines). -もともとは、標準の Linux は一般目的のオペレーティングシステムとして -設計されており、バックグラウンド・プロセスや対話的アプリケーション、 -リアルタイム性の要求が厳しくないリアルタイム・アプリケーション -(普通はタイミングの応答期限 (deadline) を満たす必要があるアプリケーション) -を扱うことができた。 -.\"O Although the Linux kernel 2.6 -.\"O allowed for kernel preemption and the newly introduced O(1) scheduler -.\"O ensures that the time needed to schedule is fixed and deterministic -.\"O irrespective of the number of active tasks, true real-time computing -.\"O was not possible up to kernel version 2.6.17. -Linux カーネル 2.6 では、 -カーネルのプリエンプション (タスクの置き換え) が可能であり、 -新たに導入された O(1) スケジューラにより、 -アクティブなタスクの数に関わらずスケジューリングに必要な時間は -固定で確定的 (deterministic) であることが保証されている。 -それにも関わらず、カーネル 2.6.17 までは -真のリアルタイム・コンピューティングは実現できなかった。 -.\"O .SS Real-time features in the mainline Linux kernel -.SS 本流の Linux カーネルでのリアルタイム機能 -.\" FIXME . Probably this text will need some minor tweaking -.\" by about the time of 2.6.30; ask Carsten Emde about this then. -.\"O From kernel version 2.6.18 onwards, however, Linux is gradually -.\"O becoming equipped with real-time capabilities, -.\"O most of which are derived from the former -.\"O .I realtime-preempt -.\"O patches developed by Ingo Molnar, Thomas Gleixner, -.\"O Steven Rostedt, and others. -.\"O Until the patches have been completely merged into the -.\"O mainline kernel -.\"O (this is expected to be around kernel version 2.6.30), -.\"O they must be installed to achieve the best real-time performance. -カーネル 2.6.18 から現在まで、 -Linux は徐々にリアルタイム機能を備えつつあるが、 -これらの機能のほとんどは、 -Ingo Molnar, Thomas Gleixner, Steven Rostedt らによって開発された、 -以前の -.I realtime-preempt -パッチからのものである。 -これらのパッチが本流のカーネルに完全にマージされるまでは -(マージの完了はカーネル 2.6.30 あたりの予定)、 -最高のリアルタイム性能を達成するには realtime-preempt パッチを -組み込まなければならない。 -.\"O These patches are named: -これらのパッチは -.in +4n -.nf - -patch-\fIkernelversion\fP-rt\fIpatchversion\fP -.fi -.in -.\"O .PP -.\"O and can be downloaded from -.\"O .IR http://www.kernel.org/pub/linux/kernel/projects/rt/ . -という名前で、 -.I http://www.kernel.org/pub/linux/kernel/projects/rt/ -からダウンロードできる。 - -.\"O Without the patches and prior to their full inclusion into the mainline -.\"O kernel, the kernel configuration offers only the three preemption classes -.\"O .BR CONFIG_PREEMPT_NONE , -.\"O .BR CONFIG_PREEMPT_VOLUNTARY , -.\"O and -.\"O .B CONFIG_PREEMPT_DESKTOP -.\"O which respectively provide no, some, and considerable -.\"O reduction of the worst-case scheduling latency. -このパッチが適用されず、かつパッチの内容の本流のカーネルへのマージが -完了するまでは、カーネルの設定では -.BR CONFIG_PREEMPT_NONE , -.BR CONFIG_PREEMPT_VOLUNTARY , -.B CONFIG_PREEMPT_DESKTOP -の 3つのプリエンプション・クラス (preemption class) だけが提供される。 -これらのクラスでは、最悪の場合のスケジューリング遅延がそれぞれ -全く減らない、いくらか減る、かなり減る。 - -.\"O With the patches applied or after their full inclusion into the mainline -.\"O kernel, the additional configuration item -.\"O .B CONFIG_PREEMPT_RT -.\"O becomes available. -.\"O If this is selected, Linux is transformed into a regular -.\"O real-time operating system. -パッチが適用された場合、またはパッチの内容の本流のカーネルへのマージが -完了した後では、上記に加えて設定項目として -.B CONFIG_PREEMPT_RT -が利用可能になる。この項目を選択すると、 -Linux は通常のリアルタイム・オペレーティングシステムに変身する。 -.\"O The FIFO and RR scheduling policies that can be selected using -.\"O .BR sched_setscheduler () -.\"O are then used to run a process -.\"O with true real-time priority and a minimum worst-case scheduling latency. -この場合には、 -.BR sched_setscheduler () -で選択できる FIFO と RR のスケジューリング・ポリシーは、 -真のリアルタイム優先度を持つプロセスを最悪の場合のスケジューリング遅延が -最小となる環境で動作させるために使われることになる。 -.\"O .SH BUGS -.SH バグ -.\"O POSIX says that on success, -.\"O .BR sched_setscheduler () -.\"O should return the previous scheduling policy. -.\"O Linux -.\"O .BR sched_setscheduler () -.\"O does not conform to this requirement, -.\"O since it always returns 0 on success. -POSIX では、成功時に -.BR sched_setscheduler () -は直前のスケジューリング・ポリシーを返すべきとされている。 -Linux の -.BR sched_setscheduler () -はこの要求仕様に準拠しておらず、 -成功時には常に 0 を返す。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR getpriority (2), -.BR mlock (2), -.BR mlockall (2), -.BR munlock (2), -.BR munlockall (2), -.BR nice (2), -.BR sched_get_priority_max (2), -.BR sched_get_priority_min (2), -.BR sched_getaffinity (2), -.BR sched_getparam (2), -.BR sched_rr_get_interval (2), -.BR sched_setaffinity (2), -.BR sched_setparam (2), -.BR sched_yield (2), -.BR setpriority (2), -.BR capabilities (7), -.BR cpuset (7) -.PP -.I Programming for the real world \- POSIX.4 -by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0 -.PP -.\"O The kernel source file -.\"O .I Documentation/scheduler/sched-rt-group.txt -.\"O (since kernel 2.6.25). -カーネル・ソース内のファイル -.I Documentation/scheduler/sched-rt-group.txt -(カーネル 2.6.25 以降) diff --git a/draft/man2/sched_yield.2 b/draft/man2/sched_yield.2 index 249032ec..43065177 100644 --- a/draft/man2/sched_yield.2 +++ b/draft/man2/sched_yield.2 @@ -27,117 +27,41 @@ .\" 1996-04-10 Markus Kuhn .\" revision .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Sun Feb 23 22:42:36 JST 1997 -.\" by HANATAKA Shinya -.\" Updated 2008-11-10, Akihiro MOTOKI , LDP v3.13 +.\"******************************************************************* .\" -.\"WORD: yield 空け渡す -.\"WORD: block 中断(block) -.\"WORD: process プロセス -.\"WORD: processor プロセッサー -.\"WORD: queue キュー -.\"WORD: static 静的 -.\"WORD: priority プライオリティ -.\"WORD: scheduling スケジューリング +.\" This file was generated with po4a. Translate the source file. .\" -.TH SCHED_YIELD 2 2008-10-18 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH SCHED_YIELD 2 2008\-10\-18 Linux "Linux Programmer's Manual" .SH 名前 -.\"O sched_yield \- yield the processor sched_yield \- プロセッサーを空け渡す(yield) -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.B int sched_yield(void); -.\"O .SH DESCRIPTION +\fBint sched_yield(void);\fP .SH 説明 -.\"O .BR sched_yield () -.\"O causes the calling thread to relinquish the CPU. -.BR sched_yield () -を呼び出すことで、呼び出したスレッドが CPU の使用権を手放すことができる。 -.\"O The thread is moved to the end of the queue for its static -.\"O priority and a new thread gets to run. -そのスレッドは、そのスレッドの静的プライオリティのキューの末尾に -移動し、新しいスレッドが走り始める。 -.\"O .SH "RETURN VALUE" +\fBsched_yield\fP() を呼び出すことで、呼び出したスレッドが CPU の使用権を手放すことができる。 +そのスレッドは、そのスレッドの静的プライオリティのキューの末尾に 移動し、新しいスレッドが走り始める。 .SH 返り値 -.\"O On success, -.\"O .BR sched_yield () -.\"O returns 0. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合は -.BR sched_yield () -は 0 を返す。 -エラーの場合は \-1 が返され、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS +成功した場合は \fBsched_yield\fP() は 0 を返す。 エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.\"O In the Linux implementation, -.\"O .BR sched_yield () -.\"O always succeeds. -Linux の実装では、 -.BR sched_yield () -は常に成功する。 -.\"O .SH "CONFORMING TO" +Linux の実装では、 \fBsched_yield\fP() は常に成功する。 .SH 準拠 -POSIX.1-2001. -.\"O .SH NOTES +POSIX.1\-2001. .SH 注意 -.\"O If the calling thread is the only thread in the highest -.\"O priority list at that time, -.\"O it will continue to run after a call to -.\"O .BR sched_yield (). -.BR sched_yield () -を呼び出した時点で最大優先度のリストの中に呼び出し元のスレッドしか +\fBsched_yield\fP() を呼び出した時点で最大優先度のリストの中に呼び出し元のスレッドしか 存在しなければ、そのスレッドは呼び出し後も走り続けることになる。 -.\"O POSIX systems on which -.\"O .BR sched_yield () -.\"O is available define -.\"O .B _POSIX_PRIORITY_SCHEDULING -.\"O in \fI\fP. -POSIX システムで -.BR sched_yield () -は \fI\fP に -.B _POSIX_PRIORITY_SCHEDULING -が定義されている場合にのみ使用可能である。 +POSIX システムで \fBsched_yield\fP() は \fI\fP に +\fB_POSIX_PRIORITY_SCHEDULING\fP が定義されている場合にのみ使用可能である。 -.\"O Strategic calls to -.\"O .BR sched_yield () -.\"O can improve performance by giving other threads or processes -.\"O a chance to run when (heavily) contended resources (e.g., mutexes) -.\"O have been released by the caller. -.\"O Avoid calling -.\"O .BR sched_yield () -.\"O unnecessarily or inappropriately -.\"O (e.g., when resources needed by other -.\"O schedulable threads are still held by the caller), -.\"O since doing so will result in unnecessary context switches, -.\"O which will degrade system performance. -.BR sched_yield () -を戦略的に呼び出すことで、(極度に) 競合するリソース (mutex など) -を呼び出し元が解放した際に他のスレッドやプロセスに実行機会を与えることで、 -性能を上げることができる。 -.BR sched_yield () -を必要もないのに呼び出したり、不適切な場面 (例えば、他のスケジューリング -対象となるスレッドが必要とするリソースを呼び出し元が保持したままの状態) -で呼び出したりするのは避けること。なぜなら、 -.BR sched_yield () -の呼び出しより不必要なコンテキストスイッチが起こり、システム性能が +\fBsched_yield\fP() を戦略的に呼び出すことで、(極度に) 競合するリソース (mutex など) +を呼び出し元が解放した際に他のスレッドやプロセスに実行機会を与えることで、 性能を上げることができる。 \fBsched_yield\fP() +を必要もないのに呼び出したり、不適切な場面 (例えば、他のスケジューリング 対象となるスレッドが必要とするリソースを呼び出し元が保持したままの状態) +で呼び出したりするのは避けること。なぜなら、 \fBsched_yield\fP() の呼び出しより不必要なコンテキストスイッチが起こり、システム性能が 劣化する結果になるからである。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.\"O .BR sched_setscheduler (2) -.\"O for a description of Linux scheduling. -Linux のスケージュリング(scheduling)については -.BR sched_setscheduler (2) -を参照せよ。 +Linux のスケージュリング(scheduling)については \fBsched_setscheduler\fP(2) を参照せよ。 .PP -.I Programming for the real world \- POSIX.4 -by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0 +\fIProgramming for the real world \- POSIX.4\fP by Bill O. Gallmeister, O'Reilly +& Associates, Inc., ISBN 1\-56592\-074\-0 diff --git a/draft/man2/select.2 b/draft/man2/select.2 index 39e30508..441ddff7 100644 --- a/draft/man2/select.2 +++ b/draft/man2/select.2 @@ -35,303 +35,99 @@ .\" 2005-03-11, mtk, modified pselect() text (it is now a system .\" call in 2.6.16. .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya all rights reserved. -.\" Translated 1997-02-23, HANATAKA Shinya -.\" Modified 2000-03-12, HANATAKA Shinya -.\" Updated & Modified 2001-06-04, Yuichi SATO -.\" Updated & Modified 2001-07-01, Yuichi SATO -.\" Updated & Modifedd 2002-01-14, Yuichi SATO -.\" Updated 2002-09-24, Akihiro MOTOKI -.\" Updated 2003-01-19, Akihiro MOTOKI -.\" Updated 2005-03-17, Akihiro MOTOKI -.\" Updated 2006-04-16, Akihiro MOTOKI, LDP v2.28 -.\" Updated 2006-07-23, Akihiro MOTOKI, LDP v2.36 -.\" Updated 2007-09-08, Akihiro MOTOKI, LDP v2.64 -.\" Updated 2008-08-06, Akihiro MOTOKI, LDP v3.05 +.\"******************************************************************* .\" -.\"WORD: synchronous 同期させる -.\"WORD: multiplexing 多重化 -.\"WORD: file descriptor ファイルディスクリプタ -.\"WORD: descriptor 記述子 -.\"WORD: macro マクロ -.\"WORD: block 停止(block) -.\"WORD: block 禁止(block) -.\"WORD: signal シグナル -.\"WORD: timeout 時間切れ(timeout) -.\"WORD: portable 移植性のある +.\" This file was generated with po4a. Translate the source file. .\" -.TH SELECT 2 2010-08-31 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH SELECT 2 2010\-08\-31 Linux "Linux Programmer's Manual" .SH 名前 -.\"O select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO \- -.\"O synchronous I/O multiplexing -select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO \- 多重化された I/O の同期をとる -.\"O .SH SYNOPSIS +select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO \- 同期 I/O の多重化 .SH 書式 .nf -.\"O /* According to POSIX.1-2001 */ -/* POSIX.1-2001 に従う場合 */ +/* POSIX.1\-2001 に従う場合 */ .br -.B #include +\fB#include \fP .sp -.\"O /* According to earlier standards */ /* 以前の規格に従う場合 */ .br -.B #include +\fB#include \fP .br -.B #include +\fB#include \fP .br -.B #include +\fB#include \fP .sp -.BI "int select(int " nfds ", fd_set *" readfds ", fd_set *" writefds , -.BI " fd_set *" exceptfds ", struct timeval *" timeout ); +\fBint select(int \fP\fInfds\fP\fB, fd_set *\fP\fIreadfds\fP\fB, fd_set *\fP\fIwritefds\fP\fB,\fP +\fB fd_set *\fP\fIexceptfds\fP\fB, struct timeval *\fP\fItimeout\fP\fB);\fP .sp -.BI "void FD_CLR(int " fd ", fd_set *" set ); +\fBvoid FD_CLR(int \fP\fIfd\fP\fB, fd_set *\fP\fIset\fP\fB);\fP .br -.BI "int FD_ISSET(int " fd ", fd_set *" set ); +\fBint FD_ISSET(int \fP\fIfd\fP\fB, fd_set *\fP\fIset\fP\fB);\fP .br -.BI "void FD_SET(int " fd ", fd_set *" set ); +\fBvoid FD_SET(int \fP\fIfd\fP\fB, fd_set *\fP\fIset\fP\fB);\fP .br -.BI "void FD_ZERO(fd_set *" set ); +\fBvoid FD_ZERO(fd_set *\fP\fIset\fP\fB);\fP .sp -.B #include +\fB#include \fP .sp -.BI "int pselect(int " nfds ", fd_set *" readfds ", fd_set *" writefds , -.BI " fd_set *" exceptfds ", const struct timespec *" timeout , -.BI " const sigset_t *" sigmask ); +\fBint pselect(int \fP\fInfds\fP\fB, fd_set *\fP\fIreadfds\fP\fB, fd_set *\fP\fIwritefds\fP\fB,\fP +\fB fd_set *\fP\fIexceptfds\fP\fB, const struct timespec *\fP\fItimeout\fP\fB,\fP +\fB const sigset_t *\fP\fIsigmask\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR pselect (): -_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 -.\"O .SH DESCRIPTION +\fBpselect\fP(): _POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 .SH 説明 -.\"O .BR select () -.\"O and -.\"O .BR pselect () -.\"O allow a program to monitor multiple file descriptors, -.\"O waiting until one or more of the file descriptors become "ready" -.\"O for some class of I/O operation (e.g., input possible). -.\"O A file descriptor is considered ready if it is possible to -.\"O perform the corresponding I/O operation (e.g., -.\"O .BR read (2)) -.\"O without blocking. -.BR select () -や -.BR pselect () -を使うと、プログラムで複数のファイルディスクリプタを監視し、 -一つ以上のファイルディスクリプタがある種の I/O 操作の -「ready (準備ができた)」状態 (例えば、読み込み可能になった状態) -になるまで待つことができる。 -ファイルディスクリプタが ready (準備ができた) とは、 -対応する I/O 操作 (例えば -.BR read (2) +\fBselect\fP() や \fBpselect\fP() を使うと、プログラムで複数のファイルディスクリプタを監視し、 +一つ以上のファイルディスクリプタがある種の I/O 操作の 「ready (準備ができた)」状態 (例えば、読み込み可能になった状態) +になるまで待つことができる。 ファイルディスクリプタが ready (準備ができた) とは、 対応する I/O 操作 (例えば \fBread\fP(2) など) が停止 (block) なしに実行可能な状態にあることを意味する。 .PP -.\"O The operation of -.\"O .BR select () -.\"O and -.\"O .BR pselect () -.\"O is identical, with three differences: -.BR select () -と -.BR pselect () -の動作は同じであるが、以下の 3 点が異なる: -.TP +\fBselect\fP() と \fBpselect\fP() の動作は同じであるが、以下の 3 点が異なる: +.TP (i) -.\"O .BR select () -.\"O uses a timeout that is a -.\"O .I struct timeval -.\"O (with seconds and microseconds), while -.\"O .BR pselect () -.\"O uses a -.\"O .I struct timespec -.\"O (with seconds and nanoseconds). -.BR select () -では、タイムアウト時間の指定に構造体 -.I struct timeval -(秒・マイクロ秒単位) を用いる。 -一方、 -.BR pselect () -関数では、構造体 -.I struct timespec -(秒・ナノ秒単位) を用いる。 -.TP +\fBselect\fP() では、タイムアウト時間の指定に構造体 \fIstruct timeval\fP (秒・マイクロ秒単位) を用いる。 一方、 +\fBpselect\fP() 関数では、構造体 \fIstruct timespec\fP (秒・ナノ秒単位) を用いる。 +.TP (ii) -.\"O .BR select () -.\"O may update the -.\"O .I timeout -.\"O argument to indicate how much time was left. -.\"O .BR pselect () -.\"O does not change this argument. -.BR select () -は残り時間を示す -.I timeout -引き数を更新することがある。 -.BR pselect () -はこの引き数を変更しない。 -.TP +\fBselect\fP() は残り時間を示す \fItimeout\fP 引き数を更新することがある。 \fBpselect\fP() はこの引き数を変更しない。 +.TP (iii) -.\"O The -.\"O .BR select () -.\"O has no -.\"O .I sigmask -.\"O argument, and behaves as -.\"O .BR pselect () -.\"O called with NULL -.\"O .IR sigmask . -.BR select () -は -.I sigmask -引き数を持たない。その動作は -.I sigmask -に NULL を指定した場合の -.BR pselect () -と同じである。 +\fBselect\fP() は \fIsigmask\fP 引き数を持たない。その動作は \fIsigmask\fP に NULL を指定した場合の +\fBpselect\fP() と同じである。 .PP -.\"O Three independent sets of file descriptors are watched. -.\"O Those listed in -.\"O .I readfds -.\"O will be watched to see if characters become -.\"O available for reading (more precisely, to see if a read will not -.\"O block; in particular, a file descriptor is also ready on end-of-file), -.\"O those in -.\"O .I writefds -.\"O will be watched to see if a write will not block, and -.\"O those in -.\"O .I exceptfds -.\"O will be watched for exceptions. -.\"O On exit, the sets are modified in place -.\"O to indicate which file descriptors actually changed status. -.\"O Each of the three file descriptor sets may be specified as NULL -.\"O if no file descriptors are to be watched for the corresponding class -.\"O of events. -3 つの独立したファイルディスクリプタ集合の監視を行う。 -.I readfds -に入れられたディスクリプタについては、読み込みが可能かどうかを -監視する (より正確にいうと、停止 (block) なしで読むことができるかを -調べる。ファイルの終端 (end-of-file) の場合も、 -ファイルディスクリプタは読み込み可能として扱われる)。 -.I writefds -に入れられたディスクリプタについては、停止せずに書き込みが -可能かどうかを監視する。 -.I exceptfds -にあるものについては、例外の監視を行なう。システムコール終了時に、 -どのファイルディスクリプタの状態が実際に変化したか示すために、 -集合の内容が変更される。 -ある種別のイベントを監視したいファイルディスクリプタが一つもない場合には、 -対応するファイルディスクリプタ集合に NULL を指定することができる。 +3 つの独立したファイルディスクリプタ集合の監視を行う。 \fIreadfds\fP に入れられたディスクリプタについては、読み込みが可能かどうかを 監視する +(より正確にいうと、停止 (block) なしで読むことができるかを 調べる。ファイルの終端 (end\-of\-file) の場合も、 +ファイルディスクリプタは読み込み可能として扱われる)。 \fIwritefds\fP に入れられたディスクリプタについては、停止せずに書き込みが +可能かどうかを監視する。 \fIexceptfds\fP にあるものについては、例外の監視を行なう。システムコール終了時に、 +どのファイルディスクリプタの状態が実際に変化したか示すために、 集合の内容が変更される。 +ある種別のイベントを監視したいファイルディスクリプタが一つもない場合には、 対応するファイルディスクリプタ集合に NULL を指定することができる。 .PP -.\"O Four macros are provided to manipulate the sets. -集合を操作するために 4 つのマクロが提供されている。 -.\"O .BR FD_ZERO () -.\"O clears a set. -.BR FD_ZERO () -は集合を消去する。 -.\"O .BR FD_SET () -.\"O and -.\"O .BR FD_CLR () -.\"O respectively add and remove a given file descriptor from a set. -.BR FD_SET () -と -.BR FD_CLR () -はそれぞれ指定したファイルディスクリプタの集合への追加、削除を行う。 -.\"O .BR FD_ISSET () -.\"O tests to see if a file descriptor is part of the set; -.\"O this is useful after -.\"O .BR select () -.\"O returns. -.BR FD_ISSET () -は集合にファイルディスクリプタがあるかどうか調べる; -このマクロは -.BR select () -が終了した後に使うと便利である。 +集合を操作するために 4 つのマクロが提供されている。 \fBFD_ZERO\fP() は集合を消去する。 \fBFD_SET\fP() と +\fBFD_CLR\fP() はそれぞれ指定したファイルディスクリプタの集合への追加、削除を行う。 \fBFD_ISSET\fP() +は集合にファイルディスクリプタがあるかどうか調べる; このマクロは \fBselect\fP() が終了した後に使うと便利である。 .PP -.\"O .I nfds -.\"O is the highest-numbered file descriptor in any of the three sets, plus 1. -.I nfds -は 3 つの集合に含まれるファイルディスクリプタの最大値に 1 を足したものである。 +\fInfds\fP は 3 つの集合に含まれるファイルディスクリプタの最大値に 1 を足したものである。 .PP -.\"O .I timeout -.\"O is an upper bound on the amount of time elapsed before -.\"O .BR select () -.\"O returns. -.\"O If both fields of the -.\"O .I timeval -.\"O structure are zero, then -.\"O .BR select () -.\"O returns immediately. -.\"O (This is useful for polling.) -.\"O If -.\"O .I timeout -.\"O is NULL (no timeout), -.\"O .BR select () -.\"O can block indefinitely. -.I timeout -は -.BR select () -が復帰するまでの経過時間の上限である。 -.I timeval -構造体の両方のフィールドが 0 の場合、 -.BR select () -はすぐに復帰する -(この機能はポーリング (polling) を行うのに便利である)。 -.I timeout -に NULL (タイムアウトなし) -が指定されると、 -.BR select () -は無期限に停止 (block) する。 +\fItimeout\fP は \fBselect\fP() が復帰するまでの経過時間の上限である。 \fItimeval\fP 構造体の両方のフィールドが 0 +の場合、 \fBselect\fP() はすぐに復帰する (この機能はポーリング (polling) を行うのに便利である)。 \fItimeout\fP に +NULL (タイムアウトなし) が指定されると、 \fBselect\fP() は無期限に停止 (block) する。 .PP -.\"O .I sigmask -.\"O is a pointer to a signal mask (see -.\"O .BR sigprocmask (2)); -.\"O if it is not NULL, then -.\"O .BR pselect () -.\"O first replaces the current signal mask by the one pointed to by -.\"O .IR sigmask , -.\"O then does the "select" function, and then restores the original -.\"O signal mask. -.I sigmask -は、シグナルマスク -.RB ( sigprocmask (2) -を参照) へのポインタである。 -.I sigmask -が NULL でない場合、 -.BR pselect () -は -.I sigmask -が指しているシグナルマスクで現在のシグナルマスクを置き換えてから、 -"select" 関数を実行し、 -終了後にシグナルマスクを元のシグナルマスクに戻す。 +\fIsigmask\fP は、シグナルマスク (\fBsigprocmask\fP(2) を参照) へのポインタである。 \fIsigmask\fP が NULL +でない場合、 \fBpselect\fP() は \fIsigmask\fP が指しているシグナルマスクで現在のシグナルマスクを置き換えてから、 "select" +関数を実行し、 終了後にシグナルマスクを元のシグナルマスクに戻す。 .PP -.\"O Other than the difference in the precision of the -.\"O .I timeout -.\"O argument, the following -.\"O .BR pselect () -.\"O call: -.I timeout -引き数の精度の違いを除くと、以下の -.BR pselect () -の呼び出しは、 +\fItimeout\fP 引き数の精度の違いを除くと、以下の \fBpselect\fP() の呼び出しは、 .nf ready = pselect(nfds, &readfds, &writefds, &exceptfds, timeout, &sigmask); .fi -.\"O is equivalent to -.\"O .I atomically -.\"O executing the following calls: -次のコールを -.I atomic -に実行するのと等価である。 +次のコールを \fIatomic\fP に実行するのと等価である。 .nf sigset_t origmask; @@ -341,61 +137,14 @@ _POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 sigprocmask(SIG_SETMASK, &origmask, NULL); .fi .PP -.\"O The reason that -.\"O .BR pselect () -.\"O is needed is that if one wants to wait for either a signal -.\"O or for a file descriptor to become ready, then -.\"O an atomic test is needed to prevent race conditions. -.\"O (Suppose the signal handler sets a global flag and -.\"O returns. -.\"O Then a test of this global flag followed by a call of -.\"O .BR select () -.\"O could hang indefinitely if the signal arrived just after the test -.\"O but just before the call. -.BR pselect () -が必要になる理由は、シグナルやファイルディスクリプタの状態変化を -待ちたいときには、競合状態を避けるために atomic なテストが必要になる -からである。 -(シグナルハンドラが大域フラグを設定して戻る場合を考えてみよう。 -この大域フラグのテストに続けて -.BR select () -を呼び出すと、 -シグナルがテストの直後かつ呼び出しの直前に届いた時には -.BR select () -は永久にハングしてしまうかもしれない。 -.\"O By contrast, -.\"O .BR pselect () -.\"O allows one to first block signals, handle the signals that have come in, -.\"O then call -.\"O .BR pselect () -.\"O with the desired -.\"O .IR sigmask , -.\"O avoiding the race.) -一方、 -.BR pselect () -を使うと、まずシグナルを禁止 (block) して、入ってくるシグナルを操作し、 -望みの -.I sigmask -で -.BR pselect () -を呼び出すことで、前記の競合を避けることができる。) -.\"O .SS "The timeout" +\fBpselect\fP() が必要になる理由は、シグナルやファイルディスクリプタの状態変化を 待ちたいときには、競合状態を避けるために atomic +なテストが必要になる からである。 (シグナルハンドラが大域フラグを設定して戻る場合を考えてみよう。 この大域フラグのテストに続けて +\fBselect\fP() を呼び出すと、 シグナルがテストの直後かつ呼び出しの直前に届いた時には \fBselect\fP() +は永久にハングしてしまうかもしれない。 一方、 \fBpselect\fP() を使うと、まずシグナルを禁止 (block) +して、入ってくるシグナルを操作し、 望みの \fIsigmask\fP で \fBpselect\fP() を呼び出すことで、前記の競合を避けることができる。) .SS タイムアウト -.\"O The time structures involved are defined in -.\"O .I -.\"O and look like -これらの関数で使用される時間関連の構造体は、 -.I -で以下のように定義されている。 +これらの関数で使用される時間関連の構造体は、 \fI\fP で -.\"O .in +4n -.\"O .nf -.\"O struct timeval { -.\"O long tv_sec; /* seconds */ -.\"O long tv_usec; /* microseconds */ -.\"O }; -.\"O .fi -.\"O .in .in +4n .nf struct timeval { @@ -405,16 +154,8 @@ struct timeval { .fi .in -.\"O and -.\"O -.\"O .in +4n -.\"O .nf -.\"O struct timespec { -.\"O long tv_sec; /* seconds */ -.\"O long tv_nsec; /* nanoseconds */ -.\"O }; -.\"O .fi -.\"O .in +や + .in +4n .nf struct timespec { @@ -424,242 +165,55 @@ struct timespec { .fi .in -.\"O (However, see below on the POSIX.1-2001 versions.) -(POSIX.1-2001 での定義については下記の「注意」を参照) +のように定義されている。 (POSIX.1\-2001 での定義については下記の「注意」を参照) .PP -.\"O Some code calls -.\"O .BR select () -.\"O with all three sets empty, -.\"O .I nfds -.\"O zero, and a non-NULL -.\"O .I timeout -.\"O as a fairly portable way to sleep with subsecond precision. -秒単位以下の精度でスリープを実現する -移植性の高い方法として、 -3 つの集合全てを空、 -.I nfds -を 0 、 -.I timeout -を NULL でない値に設定して -.BR select () -を呼び出すという方法を使っているコードもある。 +秒単位以下の精度でスリープを実現する 移植性の高い方法として、 3 つの集合全てを空、 \fInfds\fP を 0 、 \fItimeout\fP を NULL +でない値に設定して \fBselect\fP() を呼び出すという方法を使っているコードもある。 .PP -.\"O On Linux, -.\"O .BR select () -.\"O modifies -.\"O .I timeout -.\"O to reflect the amount of time not slept; most other implementations -.\"O do not do this. -.\"O (POSIX.1-2001 permits either behavior.) -.\"O This causes problems both when Linux code which reads -.\"O .I timeout -.\"O is ported to other operating systems, and when code is ported to Linux -.\"O that reuses a \fIstruct timeval\fP for multiple -.\"O .BR select ()s -.\"O in a loop without reinitializing it. -.\"O Consider -.\"O .I timeout -.\"O to be undefined after -.\"O .BR select () -.\"O returns. -Linux では、 -.BR select () -は -.I timeout -を変更し、残りの停止時間を反映するようになっているが、 -他のほとんどの実装ではこのようになっていない -(POSIX.1-2001 はどちらの動作も認めている)。 -このため、 -.I timeout -を参照している Linux のコードを他のオペレーティング・システムへ -移植する場合、問題が起こる。 -また、ループの中で \fItimeval\fP 構造体を初期化せずにそのまま再利用して -.BR select () -を複数回行なっているコードを Linux へ移植する場合にも、問題が起こる。 -.BR select () -から復帰した後は -.I timeout -は未定義であると考えるべきである。 -.\"O .\" .PP - it is rumored that: -.\"O .\" On BSD, when a timeout occurs, the file descriptor bits are not changed. -.\"O .\" - it is certainly true that: -.\"O .\" Linux follows SUSv2 and sets the bit masks to zero upon a timeout. -.\" .PP -.\" 「BSD ではタイムアウトが起こっても、 -.\" ファイルディスクリプタビットは変わらない」と聞いたことがある。 -.\" 「Linux は SUSv2 に従っており、 -.\" タイムアウトの際にはビットマスクを 0 にする」というのは確かに事実である。 -.\"O .SH "RETURN VALUE" +.\" .PP - it is rumored that: +.\" On BSD, when a timeout occurs, the file descriptor bits are not changed. +.\" - it is certainly true that: +.\" Linux follows SUSv2 and sets the bit masks to zero upon a timeout. +Linux では、 \fBselect\fP() は \fItimeout\fP を変更し、残りの停止時間を反映するようになっているが、 +他のほとんどの実装ではこのようになっていない (POSIX.1\-2001 はどちらの動作も認めている)。 このため、 \fItimeout\fP +を参照している Linux のコードを他のオペレーティング・システムへ 移植する場合、問題が起こる。 また、ループの中で \fItimeval\fP +構造体を初期化せずにそのまま再利用して \fBselect\fP() を複数回行なっているコードを Linux へ移植する場合にも、問題が起こる。 +\fBselect\fP() から復帰した後は \fItimeout\fP は未定義であると考えるべきである。 .SH 返り値 -.\"O On success, -.\"O .BR select () -.\"O and -.\"O .BR pselect () -.\"O return the number of file descriptors contained in the three returned -.\"O descriptor sets (that is, the total number of bits that are set in -.\"O .IR readfds , -.\"O .IR writefds , -.\"O .IR exceptfds ) -.\"O which may be zero if the timeout expires before anything interesting happens. -成功した場合、 -.BR select () -と -.BR pselect () -は更新された 3 つのディスクリプタ集合に含まれている -ファイルディスクリプタの数 (つまり、 -.IR readfds , -.IR writefds , -.I exceptfds -中の 1 になっているビットの総数) を返す。 -何も起こらずに時間切れになった場合、 -ディスクリプタの数は 0 になることもある。 -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately; the sets and -.\"O .I timeout -.\"O become undefined, so do not -.\"O rely on their contents after an error. -エラーならば \-1 を返し、 -.I errno -に適切な値が設定される; 集合と -.I timeout -は未定義となるので、エラーが起こった後はそれらの内容を信頼してはならない。 -.\"O .SH ERRORS +成功した場合、 \fBselect\fP() と \fBpselect\fP() は更新された 3 つのディスクリプタ集合に含まれている +ファイルディスクリプタの数 (つまり、 \fIreadfds\fP, \fIwritefds\fP, \fIexceptfds\fP 中の 1 になっているビットの総数) +を返す。 何も起こらずに時間切れになった場合、 ディスクリプタの数は 0 になることもある。 エラーならば \-1 を返し、 \fIerrno\fP +に適切な値が設定される; 集合と \fItimeout\fP は未定義となるので、エラーが起こった後はそれらの内容を信頼してはならない。 .SH エラー -.TP -.B EBADF -.\"O An invalid file descriptor was given in one of the sets. -.\"O (Perhaps a file descriptor that was already closed, -.\"O or one on which an error has occurred.) -いずれかの集合に無効なファイルディスクリプタが指定された -(おそらくは、すでにクローズされたファイルディスクリプタか、 +.TP +\fBEBADF\fP +いずれかの集合に無効なファイルディスクリプタが指定された (おそらくは、すでにクローズされたファイルディスクリプタか、 エラーが発生したファイルディスクリプタが指定された)。 -.TP -.B EINTR -.\"O A signal was caught; see -.\"O .BR signal (7). +.TP +\fBEINTR\fP シグナルを受信した。 -.TP -.B EINVAL -.\"O .I nfds -.\"O is negative or the value contained within -.\"O .I timeout -.\"O is invalid. -.I n -が負、または -.I timeout -に入っている値が不正である。 -.TP -.B ENOMEM -.\"O unable to allocate memory for internal tables. +.TP +\fBEINVAL\fP +\fIn\fP が負、または \fItimeout\fP に入っている値が不正である。 +.TP +\fBENOMEM\fP 内部テーブルにメモリを割り当てることができなかった。 -.\"O .SH VERSIONS .SH バージョン -.\"O .BR pselect () -.\"O was added to Linux in kernel 2.6.16. -.BR pselect () -はカーネル 2.6.16 で Linux に追加された。 -.\"O Prior to this, -.\"O .BR pselect () -.\"O was emulated in glibc (but see BUGS). -それ以前は、 -.BR pselect () -は glibc でエミュレートされていた (「バグ」の章を参照)。 -.\"O .SH "CONFORMING TO" +\fBpselect\fP() はカーネル 2.6.16 で Linux に追加された。 それ以前は、 \fBpselect\fP() は glibc +でエミュレートされていた (「バグ」の章を参照)。 .SH 準拠 -.\"O .BR select () -.\"O conforms to POSIX.1-2001 and -.\"O 4.4BSD -.\"O .RB ( select () -.\"O first appeared in 4.2BSD). -.\"O Generally portable to/from -.\"O non-BSD systems supporting clones of the BSD socket layer (including -.\"O System V variants). -.\"O However, note that the System V variant typically -.\"O sets the timeout variable before exit, but the BSD variant does not. -.BR select () -は POSIX.1-2001 と 4.4BSD -.RB ( select () -は 4.2BSD で最初に登場した) に準拠する。 -BSD ソケット層のクローンをサポートしている非 BSD システム -(System V 系も含む) との間でだいたい移植性がある。しかし System V 系では -たいがい timeout 変数を exit の前にセットするが、 -BSD 系ではそうでないので注意すること。 +\fBselect\fP() は POSIX.1\-2001 と 4.4BSD (\fBselect\fP() は 4.2BSD で最初に登場した) に準拠する。 +BSD ソケット層のクローンをサポートしている非 BSD システム (System V 系も含む) との間でだいたい移植性がある。しかし System +V 系では たいがい timeout 変数を exit の前にセットするが、 BSD 系ではそうでないので注意すること。 .PP -.\"O .BR pselect () -.\"O is defined in POSIX.1g, and in -.\"O POSIX.1-2001. -.BR pselect () -は POSIX.1g と POSIX.1-2001 で定義されている。 -.\"O .SH NOTES +\fBpselect\fP() は POSIX.1g と POSIX.1\-2001 で定義されている。 .SH 注意 -.\"O An -.\"O .I fd_set -.\"O is a fixed size buffer. -.\"O Executing -.\"O .BR FD_CLR () -.\"O or -.\"O .BR FD_SET () -.\"O with a value of -.\"O .I fd -.\"O that is negative or is equal to or larger than -.\"O .B FD_SETSIZE -.\"O will result -.\"O in undefined behavior. -.\"O Moreover, POSIX requires -.\"O .I fd -.\"O to be a valid file descriptor. -.I fd_set -は固定サイズのバッファである。 -負や -.B FD_SETSIZE -以上の値を持つ -.I fd -に対して -.BR FD_CLR () -や -.BR FD_SET () -を実行した場合、 -どのような動作をするかは定義されていない。 -また、 POSIX では -.I fd +\fIfd_set\fP は固定サイズのバッファである。 負や \fBFD_SETSIZE\fP 以上の値を持つ \fIfd\fP に対して \fBFD_CLR\fP() や +\fBFD_SET\fP() を実行した場合、 どのような動作をするかは定義されていない。 また、 POSIX では \fIfd\fP は有効なファイルディスクリプタでなければならないと規定されている。 -.\"O Concerning the types involved, the classical situation is that -.\"O the two fields of a -.\"O .I timeval -.\"O structure are typed as -.\"O .I long -.\"O (as shown above), and the structure is defined in -.\"O .IR . -型宣言に関しては、昔ながらの状況では -.I timeval -構造体の 2 つのフィールドは -(上記のように) 両方とも -.I long -型であり、構造体は -.I -で定義されている。 -.\"O The POSIX.1-2001 situation is -.\"O -.\"O .in +4n -.\"O .nf -.\"O struct timeval { -.\"O time_t tv_sec; /* seconds */ -.\"O suseconds_t tv_usec; /* microseconds */ -.\"O }; -.\"O .fi -.\"O .in -.\"O -.\"O where the structure is defined in -.\"O .I -.\"O and the data types -.\"O .I time_t -.\"O and -.\"O .I suseconds_t -.\"O are defined in -.\"O .IR . -POSIX.1-2001 の下では、以下のようになっている。 +型宣言に関しては、昔ながらの状況では \fItimeval\fP 構造体の 2 つのフィールドは (上記のように) 両方とも \fIlong\fP +型であり、構造体は \fI\fP で定義されている。 POSIX.1\-2001 の下では、以下のようになっている。 .in +4n .nf @@ -670,208 +224,46 @@ struct timeval { .fi .in -この構造体は -.I -で定義されており、データ型 -.I time_t -と -.I suseconds_t -は -.I -で定義されている。 +この構造体は \fI\fP で定義されており、データ型 \fItime_t\fP と \fIsuseconds_t\fP は +\fI\fP で定義されている。 .LP -.\"O Concerning prototypes, the classical situation is that one should -.\"O include -.\"O .I -.\"O for -.\"O .BR select (). -プロトタイプに関しては、昔ながらの状況で -.BR select () -を使いたい場合は、 -.I -をインクルードすればよい。 -.\"O The POSIX.1-2001 situation is that one should include -.\"O .I -.\"O for -.\"O .BR select () -.\"O and -.\"O .BR pselect (). -POSIX.1-2001 の環境で -.BR select () -と -.BR pselect () -を使いたい場合は、 -.I -をインクルードすればよい。 +プロトタイプに関しては、昔ながらの状況で \fBselect\fP() を使いたい場合は、 \fI\fP +をインクルードすればよい。 POSIX.1\-2001 の環境で \fBselect\fP() と \fBpselect\fP() を使いたい場合は、 +\fI\fP をインクルードすればよい。 -.\"O Libc4 and libc5 do not have a -.\"O .I -.\"O header; under glibc 2.0 and later this header exists. -ヘッダファイル -.I -は libc4 と libc5 にはなく、glibc 2.0 以降に存在する。 -.\"O Under glibc 2.0 it unconditionally gives the wrong prototype for -.\"O .BR pselect (). -.\"O Under glibc 2.1 to 2.2.1 it gives -.\"O .BR pselect () -.\"O when -.\"O .B _GNU_SOURCE -.\"O is defined. -.\"O Since glibc 2.2.2 the requirements are as shown in the SYNOPSIS. -悪いことに glibc 2.0 以前では -.BR pselect () -のプロトタイプが間違っている。 -glibc 2.1 から 2.2.1 では -.B _GNU_SOURCE -が定義されている場合に、 -.BR pselect () -が提供される。 -glibc 2.2.2 以降では、 -.BR pselect () -を使用するには、「書式」に記載された要件を満たす必要がある。 -.\"O .SS "LINUX NOTES" +ヘッダファイル \fI\fP は libc4 と libc5 にはなく、glibc 2.0 以降に存在する。 +悪いことに glibc 2.0 以前では \fBpselect\fP() のプロトタイプが間違っている。 glibc 2.1 から 2.2.1 では +\fB_GNU_SOURCE\fP が定義されている場合に、 \fBpselect\fP() が提供される。 glibc 2.2.2 以降では、 +\fBpselect\fP() を使用するには、「書式」に記載された要件を満たす必要がある。 .SS "Linux での注意" -.\"O The Linux -.\"O .BR pselect () -.\"O system call modifies its -.\"O .I timeout -.\"O argument. -Linux の -.BR pselect () -システムコールは -.I timeout -引き数を変更する。 -.\"O However, the glibc wrapper function hides this behavior -.\"O by using a local variable for the timeout argument that -.\"O is passed to the system call. -.\"O Thus, the glibc -.\"O .BR pselect () -.\"O function does not modify its timeout argument; -.\"O this is the behavior required by POSIX.1-2001. -しかし、 glibc のラッパー関数は、システムコールに渡す timeout 引き数 -としてローカル変数を使うことでこの動作を隠蔽している。 -このため、glibc の -.BR pselect () -関数は timeout 引き数を変更しない。 -これが POSIX.1-2001 が要求している動作である。 -.\"O .SH BUGS +Linux の \fBpselect\fP() システムコールは \fItimeout\fP 引き数を変更する。 しかし、 +glibc のラッパー関数は、システムコールに渡す timeout 引き数 としてローカル変数 +を使うことでこの動作を隠蔽している。 このため、glibc の \fBpselect\fP() 関数は +\fItimeout\fP 引き数を変更しない。 これが POSIX.1\-2001 が要求している動作である。 .SH バグ -.\"O Glibc 2.0 provided a version of -.\"O .BR pselect () -.\"O that did not take a -.\"O .I sigmask -.\"O argument. -glibc 2.0 では、 -.I sigmask -引き数を取らないバージョンの -.BR pselect () -が提供されていた。 +glibc 2.0 では、 \fIsigmask\fP 引き数を取らないバージョンの \fBpselect\fP() が提供されていた。 -.\"O Starting with version 2.1, glibc provided an emulation of -.\"O .BR pselect () -.\"O that was implemented using -.\"O .BR sigprocmask (2) -.\"O and -.\"O .BR select (). -.\"O This implementation remained vulnerable to the very race condition that -.\"O .BR pselect () -.\"O was designed to prevent. -バージョン 2.1 以降の glibc では、 -.BR pselect () -は -.BR sigprocmask (2) -と -.BR select () -を使ってエミュレートされていた。 -この実装にはきわどい競合条件において脆弱性が残っていた。 -この競合条件における問題を防止するために -.BR pselect () -は設計されたのである。 -.\"O Modern versions of glibc use the (race-free) -.\"O .BR pselect () -.\"O system call on kernels where it is provided. -最近のバージョンの glibc では、カーネルがサポートしている場合には、 -(競合が起こらない) -.BR pselect () -システムコールが使用される。 +バージョン 2.1 以降の glibc では、 \fBpselect\fP() は \fBsigprocmask\fP(2) と \fBselect\fP() +を使ってエミュレートされていた。 この実装にはきわどい競合条件において脆弱性が残っていた。 この競合条件における問題を防止するために +\fBpselect\fP() は設計されたのである。 最近のバージョンの glibc では、カーネルがサポートしている場合には、 (競合が起こらない) +\fBpselect\fP() システムコールが使用される。 -.\"O On systems that lack -.\"O .BR pselect (), -.\"O reliable (and more portable) signal trapping can be achieved -.\"O using the self-pipe trick -.\"O (where a signal handler writes a byte to a pipe whose other end -.\"O is monitored by -.\"O .BR select () -.\"O in the main program.) -.BR pselect () -がないシステムにおいて、 -シグナルの捕捉を信頼性があり (移植性も高い) 方法で行うには、 -自己パイプ (self-pipe) という技を使うとよい (シグナルハンドラはパイプへ -1 バイトのデータを書き込み、同じパイプのもう一端をメインプログラムの -.BR select () -で監視するという方法である)。 +\fBpselect\fP() がないシステムにおいて、 シグナルの捕捉を信頼性があり (移植性も高い) 方法で行うには、 自己パイプ +(self\-pipe) という技を使うとよい (シグナルハンドラはパイプへ 1 バイトのデータを書き込み、同じパイプのもう一端をメインプログラムの +\fBselect\fP() で監視するという方法である)。 -.\"O Under Linux, -.\"O .BR select () -.\"O may report a socket file descriptor as "ready for reading", while -.\"O nevertheless a subsequent read blocks. -.\"O This could for example -.\"O happen when data has arrived but upon examination has wrong -.\"O checksum and is discarded. -.\"O There may be other circumstances -.\"O in which a file descriptor is spuriously reported as ready. -.\"O .\" Stevens discusses a case where accept can block after select -.\"O .\" returns successfully because of an intervening RST from the client. -.\"O Thus it may be safer to use -.\"O .B O_NONBLOCK -.\"O on sockets that should not block. -Linux では、 -.BR select () -がソケットファイルディスクリプタで "読み込みの準備ができた" と報告した場合でも、 -この後で read を行うと停止 (block) することがある。このような状況は、 -例えば、データが到着したが、検査でチェックサム異常が見つかり廃棄された時 -などに起こりえる。他にもファイルディスクリプタが準備できたと間違って -報告される状況が起こるかもしれない。 -.\" Stevens が挙げたのは、select が成功して復帰してから accept が -.\" 呼ばれるまでの間に、クライアントから RST が送られると、 -.\" accept が停止する場合である。 -したがって、停止すべきではないソケットに対しては -.B O_NONBLOCK -を使うとより安全であろう。 -.\"O .\" Maybe the kernel should have returned EIO in such a situation? -.\" 多分、このような状況ではカーネルは EIO を返してしまう? +.\" Stevens discusses a case where accept can block after select +.\" returns successfully because of an intervening RST from the client. +.\" Maybe the kernel should have returned EIO in such a situation? +Linux では、 \fBselect\fP() がソケットファイルディスクリプタで "読み込みの準備ができた" と報告した場合でも、 この後で read +を行うと停止 (block) することがある。このような状況は、 例えば、データが到着したが、検査でチェックサム異常が見つかり廃棄された時 +などに起こりえる。他にもファイルディスクリプタが準備できたと間違って 報告される状況が起こるかもしれない。 +したがって、停止すべきではないソケットに対しては \fBO_NONBLOCK\fP を使うとより安全であろう。 -.\"O On Linux, -.\"O .BR select () -.\"O also modifies -.\"O .I timeout -.\"O if the call is interrupted by a signal handler (i.e., the -.\"O .B EINTR -.\"O error return). -.\"O This is not permitted by POSIX.1-2001. -.\"O The Linux -.\"O .BR pselect () -.\"O system call has the same behavior, -.\"O but the glibc wrapper hides this behavior by internally copying the -.\"O .I timeout -.\"O to a local variable and passing that variable to the system call. -Linux では、 -.BR select () -がシグナルハンドラにより割り込まれた場合 (つまり -.B EINTR -エラーが返る場合)、 -.I timeout -も変更する。 -これは POSIX.1-2001 では認められていない挙動である。 -Linux の -.BR pselect () -システムコールも同じ挙動をするが、 -glibc のラッパー関数がこの挙動を隠蔽している。 -具体的には、glibc のラッパー関数の内部で、 -.I timeout -をローカル変数にコピーし、 -このローカル変数をシステムコールに渡している。 -.\"O .SH EXAMPLE +Linux では、 \fBselect\fP() がシグナルハンドラにより割り込まれた場合 (つまり \fBEINTR\fP エラーが返る場合)、 +\fItimeout\fP も変更する。 これは POSIX.1\-2001 では認められていない挙動である。 Linux の \fBpselect\fP() +システムコールも同じ挙動をするが、 glibc のラッパー関数がこの挙動を隠蔽している。 具体的には、glibc のラッパー関数の内部で、 +\fItimeout\fP をローカル変数にコピーし、 このローカル変数をシステムコールに渡している。 .SH 例 .nf #include @@ -880,34 +272,6 @@ glibc のラッパー関数がこの挙動を隠蔽している。 #include #include -.\"O int -.\"O main(void) -.\"O { -.\"O fd_set rfds; -.\"O struct timeval tv; -.\"O int retval; -.\"O -.\"O /* Watch stdin (fd 0) to see when it has input. */ -.\"O FD_ZERO(&rfds); -.\"O FD_SET(0, &rfds); -.\"O -.\"O /* Wait up to five seconds. */ -.\"O tv.tv_sec = 5; -.\"O tv.tv_usec = 0; -.\"O -.\"O retval = select(1, &rfds, NULL, NULL, &tv); -.\"O /* Don't rely on the value of tv now! */ -.\"O -.\"O if (retval == \-1) -.\"O perror("select()"); -.\"O else if (retval) -.\"O printf("Data is available now.\\n"); -.\"O /* FD_ISSET(0, &rfds) will be true. */ -.\"O else -.\"O printf("No data within five seconds.\\n"); -.\"O -.\"O exit(EXIT_SUCCESS); -.\"O } int main(void) { @@ -929,31 +293,17 @@ main(void) if (retval == \-1) perror("select()"); else if (retval) - printf("今、データが取得できました。\\n"); + printf("今、データが取得できました。\en"); /* FD_ISSET(0, &rfds) が true になる。*/ else - printf("5 秒以内にデータが入力されませんでした。\\n"); + printf("5 秒以内にデータが入力されませんでした。\en"); exit(EXIT_SUCCESS); } .fi -.\"O .SH "SEE ALSO" .SH 関連項目 -.\"O For a tutorial with discussion and examples, see -.\"O .BR select_tut (2). -考察と使用例の書かれたチュートリアルとして、 -.BR select_tut (2) -がある。 +考察と使用例の書かれたチュートリアルとして、 \fBselect_tut\fP(2) がある。 .LP -.\"O For vaguely related stuff, see -関係がありそうなものを挙げておく: -.BR accept (2), -.BR connect (2), -.BR poll (2), -.BR read (2), -.BR recv (2), -.BR send (2), -.BR sigprocmask (2), -.BR write (2), -.BR epoll (7), -.BR time (7) +関係がありそうなものを挙げておく: \fBaccept\fP(2), \fBconnect\fP(2), \fBpoll\fP(2), \fBread\fP(2), +\fBrecv\fP(2), \fBsend\fP(2), \fBsigprocmask\fP(2), \fBwrite\fP(2), \fBepoll\fP(7), +\fBtime\fP(7) diff --git a/draft/man2/select_tut.2 b/draft/man2/select_tut.2 index 4c6e7026..6ab418c8 100644 --- a/draft/man2/select_tut.2 +++ b/draft/man2/select_tut.2 @@ -27,241 +27,91 @@ .\" various other changes .\" 2008-01-26, mtk, substantial changes and rewrites .\" -.\" Translated 2002-02-21, NAKANO Takeo -.\" Updated 2002-09-23, Akihiro MOTOKI -.\" Updated 2005-03-15, Akihiro MOTOKI -.\" Updated 2006-07-21, Akihiro MOTOKI, LDP v2.36 -.\" Updated 2009-02-13, Akihiro MOTOKI, LDP v3.18 +.\"******************************************************************* .\" -.\"WORD: file descriptor ファイルディスクリプタ -.\"WORD: exceptional condition 例外状態 +.\" This file was generated with po4a. Translate the source file. .\" -.TH SELECT_TUT 2 2010-06-10 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH SELECT_TUT 2 2010\-06\-10 Linux "Linux Programmer's Manual" .SH 名前 -.\"O select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO \- -.\"O synchronous I/O multiplexing select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO \- 同期 I/O の多重化 -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O /* According to POSIX.1-2001 */ -/* POSIX.1-2001 に従う場合 */ +/* POSIX.1\-2001 に従う場合 */ .br -.B #include +\fB#include \fP .sp -.\"O /* According to earlier standards */ /* 以前の規格に従う場合 */ .br -.B #include +\fB#include \fP .br -.B #include +\fB#include \fP .br -.B #include +\fB#include \fP .sp -.BI "int select(int " nfds ", fd_set *" readfds ", fd_set *" writefds , -.BI " fd_set *" exceptfds ", struct timeval *" utimeout ); +\fBint select(int \fP\fInfds\fP\fB, fd_set *\fP\fIreadfds\fP\fB, fd_set *\fP\fIwritefds\fP\fB,\fP +\fB fd_set *\fP\fIexceptfds\fP\fB, struct timeval *\fP\fIutimeout\fP\fB);\fP .sp -.BI "void FD_CLR(int " fd ", fd_set *" set ); +\fBvoid FD_CLR(int \fP\fIfd\fP\fB, fd_set *\fP\fIset\fP\fB);\fP .br -.BI "int FD_ISSET(int " fd ", fd_set *" set ); +\fBint FD_ISSET(int \fP\fIfd\fP\fB, fd_set *\fP\fIset\fP\fB);\fP .br -.BI "void FD_SET(int " fd ", fd_set *" set ); +\fBvoid FD_SET(int \fP\fIfd\fP\fB, fd_set *\fP\fIset\fP\fB);\fP .br -.BI "void FD_ZERO(fd_set *" set ); +\fBvoid FD_ZERO(fd_set *\fP\fIset\fP\fB);\fP .sp -.B #include +\fB#include \fP .sp -.BI "int pselect(int " nfds ", fd_set *" readfds ", fd_set *" writefds , -.BI " fd_set *" exceptfds ", const struct timespec *" ntimeout , -.BI " const sigset_t *" sigmask ); +\fBint pselect(int \fP\fInfds\fP\fB, fd_set *\fP\fIreadfds\fP\fB, fd_set *\fP\fIwritefds\fP\fB,\fP +\fB fd_set *\fP\fIexceptfds\fP\fB, const struct timespec *\fP\fIntimeout\fP\fB,\fP +\fB const sigset_t *\fP\fIsigmask\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR pselect (): -_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 -.\"O .SH DESCRIPTION +\fBpselect\fP(): _POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 .SH 説明 -.\"O .BR select () -.\"O (or -.\"O .BR pselect ()) -.\"O is used to efficiently monitor multiple file descriptors, -.\"O to see if any of them is, or becomes, "ready"; -.\"O that is, to see whether I/O becomes possible, -.\"O or an "exceptional condition" has occurred on any of the descriptors. -.BR select () -(や -.BR pselect ()) -を使うと、効率的に複数のファイルディスクリプタを監視し、 -そのファイルディスクリプタのいずれかが -「ready (準備ができた)」状態、つまり I/O (入出力) が可能になっているかや、 -ファイルディスクリプタのいずれかが -「例外状態 (exceptional condition)」が発生したか、を調べることができる。 - -.\"O Its principal arguments are three "sets" of file descriptors: -.\"O \fIreadfds\fP, \fIwritefds\fP, and \fIexceptfds\fP. -この関数の主要な引き数は、3種類のファイルディスクリプタの「集合」 -\fIreadfds\fP, \fIwritefds\fP, \fIexceptfds\fP である。 -.\"O Each set is declared as type -.\"O .IR fd_set , -.\"O and its contents can be manipulated with the macros -.\"O .BR FD_CLR (), -.\"O .BR FD_ISSET (), -.\"O .BR FD_SET (), -.\"O and -.\"O .BR FD_ZERO (). -.\"O A newly declared set should first be cleared using -.\"O .BR FD_ZERO (). -各々の集合は -.B fd_set -として宣言され、その内容は -.BR FD_CLR (), -.BR FD_ISSET (), -.BR FD_SET (), -.BR FD_ZERO () -といったマクロによって操作できる。 -新しく宣言された集合は、まず最初に -.BR FD_ZERO () -を使ってクリアすべきである。 -.\"O .BR select () -.\"O modifies the contents of the sets according to the rules -.\"O described below; after calling -.\"O .BR select () -.\"O you can test if a file descriptor is still present in a set with the -.\"O .BR FD_ISSET () -.\"O macro. -.\"O .BR FD_ISSET () -.\"O returns nonzero if a specified file descriptor is present in a set -.\"O and zero if it is not. -.\"O .BR FD_CLR () -.\"O removes a file descriptor from a set. -.BR select () -はこれらの集合の内容を、以降に述べる規則に従って修正する。 -.BR select () -を呼んだ後、ファイルディスクリプタがまだ集合に存在しているかどうかは、 -.BR FD_ISSET () -マクロによって調べることができる。 -.BR FD_ISSET () -は指定されたディスクリプタが集合に存在していれば 0 以外の値を返し、 -存在しなければ 0 を返す。 -.BR FD_CLR () -は集合からのファイルディスクリプタの削除を行う。 -.\"O .SS Arguments +\fBselect\fP() (や \fBpselect\fP()) を使うと、効率的に複数のファイルディスクリプタを監視し、 +そのファイルディスクリプタのいずれかが 「ready (準備ができた)」状態、つまり I/O (入出力) が可能になっているかや、 +ファイルディスクリプタのいずれかが 「例外状態 (exceptional condition)」が発生したか、を調べることができる。 + +この関数の主要な引き数は、3種類のファイルディスクリプタの「集合」 \fIreadfds\fP, \fIwritefds\fP, \fIexceptfds\fP である。 +各々の集合は \fBfd_set\fP として宣言され、その内容は \fBFD_CLR\fP(), \fBFD_ISSET\fP(), \fBFD_SET\fP(), +\fBFD_ZERO\fP() といったマクロによって操作できる。 新しく宣言された集合は、まず最初に \fBFD_ZERO\fP() +を使ってクリアすべきである。 \fBselect\fP() はこれらの集合の内容を、以降に述べる規則に従って修正する。 \fBselect\fP() +を呼んだ後、ファイルディスクリプタがまだ集合に存在しているかどうかは、 \fBFD_ISSET\fP() マクロによって調べることができる。 +\fBFD_ISSET\fP() は指定されたディスクリプタが集合に存在していれば 0 以外の値を返し、 存在しなければ 0 を返す。 +\fBFD_CLR\fP() は集合からのファイルディスクリプタの削除を行う。 .SS 引き数 -.TP +.TP \fIreadfds\fP -.\"O This set is watched to see if data is available for reading from any of -.\"O its file descriptors. -.\"O After -.\"O .BR select () -.\"O has returned, \fIreadfds\fP will be -.\"O cleared of all file descriptors except for those that -.\"O are immediately available for reading. -この集合に含まれるいずれかのファイルディスクリプタで、 -データの読み込みが可能になったかどうかを監視する。 -.BR select () -から戻る時に、\fIreadfds\fP のうち、 -直ちに読み込み可能なファイルディスクリプタ以外は -集合から削除される。 -.TP +この集合に含まれるいずれかのファイルディスクリプタで、 データの読み込みが可能になったかどうかを監視する。 \fBselect\fP() +から戻る時に、\fIreadfds\fP のうち、 直ちに読み込み可能なファイルディスクリプタ以外は 集合から削除される。 +.TP \fIwritefds\fP -.\"O This set is watched to see if there is space to write data to any of -.\"O its file descriptors. -.\"O After -.\"O .BR select () -.\"O has returned, \fIwritefds\fP will be -.\"O cleared of all file descriptors except for those that -.\"O are immediately available for writing. -この集合に含まれるいずれかのファイルディスクリプタで、 -データを書き込むスペースがあるかどうかを監視する。 -.BR select () -から戻る時に、\fIwritefds\fP のうち、 -直ちに書き込み可能なファイルディスクリプタ以外は -集合から削除される。 -.TP +この集合に含まれるいずれかのファイルディスクリプタで、 データを書き込むスペースがあるかどうかを監視する。 \fBselect\fP() +から戻る時に、\fIwritefds\fP のうち、 直ちに書き込み可能なファイルディスクリプタ以外は 集合から削除される。 +.TP \fIexceptfds\fP -.\"O This set is watched for "exceptional conditions". -.\"O In practice, only one such exceptional condition is common: -.\"O the availability of \fIout-of-band\fP (OOB) data for reading -.\"O from a TCP socket. -.\"O See -.\"O .BR recv (2), -.\"O .BR send (2), -.\"O and -.\"O .BR tcp (7) -.\"O for more details about OOB data. -.\"O (One other less common case where -.\"O .BR select (2) -.\"O indicates an exceptional condition occurs with pseudoterminals -.\"O in packet mode; see -.\"O .BR tty_ioctl (4).) -.\"O After -.\"O .BR select () -.\"O has returned, -.\"O \fIexceptfds\fP will be cleared of all file descriptors except for those -.\"O for which an exceptional condition has occurred. -この集合に含まれるいずれかのファイルディスクリプタで、 -「例外状態 (exceptional condition)」が発生したかどうかを監視する。 -実際の動作では、普通に起こり得る例外状態は一つだけであり、 -それは TCP ソケットで \fI帯域外 (out-of-band; OOB)\fP データが -読み込み可能な場合である。 -OOB データの詳細については、 -.BR recv (2), -.BR send (2), -.BR tcp (7) -を参照のこと。 -(これ以外では、まれなことだが、 -パケットモードの擬似端末 (pseudoterminals) で -.BR select () -が例外状態を示すことがある。) -.BR select () -が返る時に、\fIexceptfds\fP のうち、 +この集合に含まれるいずれかのファイルディスクリプタで、 「例外状態 (exceptional condition)」が発生したかどうかを監視する。 +実際の動作では、普通に起こり得る例外状態は一つだけであり、 それは TCP ソケットで \fI帯域外 (out\-of\-band; OOB)\fP データが +読み込み可能な場合である。 OOB データの詳細については、 \fBrecv\fP(2), \fBsend\fP(2), \fBtcp\fP(7) を参照のこと。 +(これ以外では、まれなことだが、 パケットモードの擬似端末 (pseudoterminals) で \fBselect\fP() +が例外状態を示すことがある。) \fBselect\fP() が返る時に、\fIexceptfds\fP のうち、 例外状態が発生したディスクリプタ以外は集合から削除される。 -.TP +.TP \fInfds\fP -.\"O This is an integer one more than the maximum of any file descriptor in -.\"O any of the sets. -.\"O In other words, while adding file descriptors to each of the sets, -.\"O you must calculate the maximum integer value of all of them, -.\"O then increment this value by one, and then pass this as \fInfds\fP. -全ての集合に含まれるファイルディスクリプタのうち、 -値が最大のものに 1 を足した整数である。 -すなわち、ファイルディスクリプタを各集合に加える作業の途中で、 -全てのファイルディスクリプタを見て最大値を求め、 -それに 1 を加えて \fInfds\fP として渡さないといけない、ということだ。 -.TP +全ての集合に含まれるファイルディスクリプタのうち、 値が最大のものに 1 を足した整数である。 +すなわち、ファイルディスクリプタを各集合に加える作業の途中で、 全てのファイルディスクリプタを見て最大値を求め、 それに 1 を加えて \fInfds\fP +として渡さないといけない、ということだ。 +.TP \fIutimeout\fP -.\"O This is the longest time -.\"O .BR select () -.\"O may wait before returning, even if nothing interesting happened. -.\"O If this value is passed as NULL, then -.\"O .BR select () -.\"O blocks indefinitely waiting for a file descriptor to become ready. -.\"O \fIutimeout\fP can be set to zero seconds, which causes -.\"O .BR select () -.\"O to return immediately, with information about the readiness -.\"O of file descriptors at the time of the call. -.\"O The structure \fIstruct timeval\fP is defined as: -(何も起こらなかった場合に) -.BR select () -が戻る前に待つ最大時間である。 -この値に NULL を渡すと、 -.BR select () -はファイルディスクリプタのいずれかが ready (準備ができた) 状態に -なるまで待ち続けてずっと停止する。 -\fIutimeout\fP は 0 秒にすることもでき、 -この場合 -.BR select () -は直ちに返り、呼び出し時点のファイルディスクリプタの状態に -関する情報が返される。 -構造体 \fIstruct timeval\fP は次のように定義されている: +(何も起こらなかった場合に) \fBselect\fP() が戻る前に待つ最大時間である。 この値に NULL を渡すと、 \fBselect\fP() +はファイルディスクリプタのいずれかが ready (準備ができた) 状態に なるまで待ち続けてずっと停止する。 \fIutimeout\fP は 0 +秒にすることもでき、 この場合 \fBselect\fP() は直ちに返り、呼び出し時点のファイルディスクリプタの状態に 関する情報が返される。 構造体 +\fIstruct timeval\fP は次のように定義されている: .IP .in +4n .nf @@ -271,21 +121,11 @@ struct timeval { }; .fi .in -.TP +.TP \fIntimeout\fP -.\"O This argument for -.\"O .BR pselect () -.\"O has the same meaning as -.\"O .IR utimeout , -.\"O but -.\"O .I "struct timespec" -.\"O has nanosecond precision as follows: -.BR pselect () -のこの引き数は -.I utimeout -と同じ意味を持つが、 -.I "struct timespec" +\fBpselect\fP() のこの引き数は \fIutimeout\fP と同じ意味を持つが、 \fIstruct timespec\fP は次に示すようにナノ秒の精度を持つ。 +.IP .in +4n .nf struct timespec { @@ -294,130 +134,25 @@ struct timespec { }; .fi .in -.TP +.TP \fIsigmask\fP -.\"O This argument holds a set of signals that the kernel should unblock -.\"O (i.e., remove from the signal mask of the calling thread), -.\"O while the caller is blocked inside the -.\"O .BR pselect () -.\"O call (see -.\"O .BR sigaddset (3) -.\"O and -.\"O .BR sigprocmask (2)). -.\"O It may be NULL, -.\"O in which case the call does not modify the signal mask on -.\"O entry and exit to the function. -.\"O In this case, -.\"O .BR pselect () -.\"O will then behave just like -.\"O .BR select (). -この引き数は、呼び出し側が -.BR pselect () -内部で停止している間に、カーネルが通知を許可すべきシグナル集合 -(すなわち、呼び出したスレッドのシグナルマスクから削除すべきシグナル集合) -を保持する -.RB ( sigaddset (3) -と -.BR sigprocmask (2) -を参照)。 -この引き数は NULL にすることもでき、その場合はこの関数へ -入るとき・出るときにシグナルマスクを変更しない。 -この場合、 -.BR pselect () -は -.BR select () -と全く同じ動作となる。 -.\"O .SS Combining Signal and Data Events +この引き数は、呼び出し側が \fBpselect\fP() 内部で停止している間に、カーネルが通知を許可すべきシグナル集合 +(すなわち、呼び出したスレッドのシグナルマスクから削除すべきシグナル集合) を保持する (\fBsigaddset\fP(3) と +\fBsigprocmask\fP(2) を参照)。 この引き数は NULL にすることもでき、その場合はこの関数へ +入るとき・出るときにシグナルマスクを変更しない。 この場合、 \fBpselect\fP() は \fBselect\fP() と全く同じ動作となる。 .SS シグナルとデータイベントを組み合わせる -.\"O .BR pselect () -.\"O is useful if you are waiting for a signal as well as -.\"O for file descriptor(s) to become ready for I/O. -.\"O Programs that receive signals -.\"O normally use the signal handler only to raise a global flag. -.\"O The global flag will indicate that the event must be processed -.\"O in the main loop of the program. -ファイルディスクリプタが I/O 可能な状態になるのと同時に -シグナルも待ちたい場合には、 -.BR pselect () -が便利である。 -シグナルを受信するプログラムは、通常は、 -シグナルハンドラをグローバルなフラグを立てるためだけに使う。 -このグローバルなフラグは、 -そのイベントをプログラムのメインループで -処理しなければならないことを示す。 -.\"O A signal will cause the -.\"O .BR select () -.\"O (or -.\"O .BR pselect ()) -.\"O call to return with \fIerrno\fP set to \fBEINTR\fP. -.\"O This behavior is essential so that signals can be processed -.\"O in the main loop of the program, otherwise -.\"O .BR select () -.\"O would block indefinitely. -シグナルを受けると -.BR select () -(や -.BR pselect ()) -は -\fIerrno\fP に \fBEINTR\fP をセットして戻ることになる。 -シグナルがプログラムのメインループで処理されるためにはこの動作が不可欠で、 -これがないと -.BR select () -は永遠に停止し続けることになる。 -.\"O Now, somewhere -.\"O in the main loop will be a conditional to check the global flag. -.\"O So we must ask: -.\"O what if a signal arrives after the conditional, but before the -.\"O .BR select () -.\"O call? -.\"O The answer is that -.\"O .BR select () -.\"O would block indefinitely, even though an event is actually pending. -さて、メインループのどこかにこのグローバルフラグをチェックする -条件文があるとしよう。ここで少し考えてみないといけない。 -「シグナルが条件文の後、しかし -.BR select () -コールの前に到着したら -どうなるのか?」 -答えは「その -.BR select () -は、たとえ解決待ちのイベントがあったとしても、 -永遠に停止する」である。 -.\"O This race condition is solved by the -.\"O .BR pselect () -.\"O call. -.\"O This call can be used to set the signal mask to a set of signals -.\"O that are only to be received within the -.\"O .BR pselect () -.\"O call. -この競合状態は -.BR pselect () -コールによって解決できる。 -このコールを使うと、 -.BR pselect () -で受信したいシグナルの集合だけをシグナルマスクに設定することができる。 -.\"O For instance, let us say that the event in question -.\"O was the exit of a child process. -.\"O Before the start of the main loop, we -.\"O would block \fBSIGCHLD\fP using -.\"O .BR sigprocmask (2). -.\"O Our -.\"O .BR pselect () -.\"O call would enable -.\"O .B SIGCHLD -.\"O by using an empty signal mask. -.\"O Our program would look like: -例えば、問題となっているイベントが子プロセスの終了の場合を考えよう。 -メインループが始まる前に、 -.B SIGCHLD -を -.BR sigprocmask (2) -でブロックする。 -.BR pselect () -コールでは -.B SIGCHLD -を、もともとのシグナルマスクを使って有効にするのだ。 -このプログラムは次のようになる。 +ファイルディスクリプタが I/O 可能な状態になるのと同時に シグナルも待ちたい場合には、 \fBpselect\fP() が便利である。 +シグナルを受信するプログラムは、通常は、 シグナルハンドラをグローバルなフラグを立てるためだけに使う。 このグローバルなフラグは、 +そのイベントをプログラムのメインループで 処理しなければならないことを示す。 シグナルを受けると \fBselect\fP() (や +\fBpselect\fP()) は \fIerrno\fP に \fBEINTR\fP をセットして戻ることになる。 +シグナルがプログラムのメインループで処理されるためにはこの動作が不可欠で、 これがないと \fBselect\fP() は永遠に停止し続けることになる。 +さて、メインループのどこかにこのグローバルフラグをチェックする 条件文があるとしよう。ここで少し考えてみないといけない。 「シグナルが条件文の後、しかし +\fBselect\fP() コールの前に到着したら どうなるのか?」 答えは「その \fBselect\fP() +は、たとえ解決待ちのイベントがあったとしても、 永遠に停止する」である。 この競合状態は \fBpselect\fP() コールによって解決できる。 +このコールを使うと、 \fBpselect\fP() で受信したいシグナルの集合だけをシグナルマスクに設定することができる。 +例えば、問題となっているイベントが子プロセスの終了の場合を考えよう。 メインループが始まる前に、 \fBSIGCHLD\fP を +\fBsigprocmask\fP(2) でブロックする。 \fBpselect\fP() コールでは \fBSIGCHLD\fP +を、もともとのシグナルマスクを使って有効にするのだ。 このプログラムは次のようになる。 .PP .nf static volatile sig_atomic_t got_SIGCHLD = 0; @@ -474,301 +209,83 @@ main(int argc, char *argv[]) } } .fi -.\"O .SS Practical .SS 実例 -.\"O So what is the point of -.\"O .BR select ()? -.\"O Can't I just read and write to my descriptors whenever I want? -.\"O The point of -.\"O .BR select () -.\"O is that it watches -.\"O multiple descriptors at the same time and properly puts the process to -.\"O sleep if there is no activity. -.\"O UNIX programmers often find -.\"O themselves in a position where they have to handle I/O from more than one -.\"O file descriptor where the data flow may be intermittent. -.\"O If you were to merely create a sequence of -.\"O .BR read (2) -.\"O and -.\"O .BR write (2) -.\"O calls, you would -.\"O find that one of your calls may block waiting for data from/to a file -.\"O descriptor, while another file descriptor is unused though ready for I/O. -.\"O .BR select () -.\"O efficiently copes with this situation. -実際のところ -.BR select () -の大事な点は何なのか? -ディスクリプタは好きなときに読み書きできるんじゃないの? -.BR select () -の重要なところは、複数のディスクリプタを同時に監視でき、 -なんの動きもなければプロセスを適切にスリープ状態に移行するところにあるのだ。 -UNIX プログラマは、 -複数のファイルディスクリプタの入出力を同時に扱わねばならず、 -しかもデータの流れは間欠的である、という状況によく出会う。 -単に -.BR read (2) -や -.BR write (2) -コールのシーケンスを作るだけでは、それらのコールのどれかが -ファイルディスクリプタからのデータを待ってブロックしており、 -別のファイルディスクリプタには I/O が可能なのに使えない、 -ということになってしまうだろう。 -.BR select () -を使うとこの状況に効果的に対処できる。 -.\"O .SS Select Law -.SS SELECT の掟 -.\"O Many people who try to use -.\"O .BR select () -.\"O come across behavior that is -.\"O difficult to understand and produces nonportable or borderline results. -.\"O For instance, the above program is carefully written not to -.\"O block at any point, even though it does not set its file descriptors to -.\"O nonblocking mode. -.\"O It is easy to introduce -.\"O subtle errors that will remove the advantage of using -.\"O .BR select (), -.\"O so here is a list of essentials to watch for when using -.\"O .BR select (). -.BR select () -を使おうとした多くの人は、理解しにくい挙動に出くわし、結果的に -できたものは移植性がないか、よくてもギリギリのものになってしまう。 -例えば、上記のプログラムは、 -集合に含まれるファイルディスクリプタを非停止 (nonblocking) モード -にしなくても、どこにもブロックが生じないよう注意して書かれている。 -微妙な間違いによって、 -.BR select () -を使う利点は簡単に失われてしまう。 -そこで、 -.BR select () -コールを使うときに注意すべき重要事項を列挙しておくことにする。 -.TP 4 +実際のところ \fBselect\fP() の大事な点は何なのか? ディスクリプタは好きなときに読み書きできるんじゃないの? \fBselect\fP() +の重要なところは、複数のディスクリプタを同時に監視でき、 なんの動きもなければプロセスを適切にスリープ状態に移行するところにあるのだ。 UNIX +プログラマは、 複数のファイルディスクリプタの入出力を同時に扱わねばならず、 しかもデータの流れは間欠的である、という状況によく出会う。 単に +\fBread\fP(2) や \fBwrite\fP(2) コールのシーケンスを作るだけでは、それらのコールのどれかが +ファイルディスクリプタからのデータを待ってブロックしており、 別のファイルディスクリプタには I/O が可能なのに使えない、 +ということになってしまうだろう。 \fBselect\fP() を使うとこの状況に効果的に対処できる。 +.SS "SELECT の掟" +\fBselect\fP() を使おうとした多くの人は、理解しにくい挙動に出くわし、結果的に +できたものは移植性がないか、よくてもギリギリのものになってしまう。 例えば、上記のプログラムは、 集合に含まれるファイルディスクリプタを非停止 +(nonblocking) モード にしなくても、どこにもブロックが生じないよう注意して書かれている。 微妙な間違いによって、 \fBselect\fP() +を使う利点は簡単に失われてしまう。 そこで、 \fBselect\fP() コールを使うときに注意すべき重要事項を列挙しておくことにする。 +.TP 4 1. -.\"O You should always try to use -.\"O .BR select () -.\"O without a timeout. -.\"O Your program -.\"O should have nothing to do if there is no data available. -.\"O Code that -.\"O depends on timeouts is not usually portable and is difficult to debug. -.BR select () -を使うときは、タイムアウトは設定すべきでない。 -処理するデータが無いときには、 -あなたのプログラムには何もすることは無いはずである。 -タイムアウトに依存したコードは通常移植性がなく、 -デバッグも難しくなる。 -.TP +\fBselect\fP() を使うときは、タイムアウトは設定すべきでない。 処理するデータが無いときには、 +あなたのプログラムには何もすることは無いはずである。 タイムアウトに依存したコードは通常移植性がなく、 デバッグも難しくなる。 +.TP 2. -.\"O The value \fInfds\fP must be properly calculated for efficiency as -.\"O explained above. -上述したように、 -効率的なプログラムを書くには -.I nfds -の値を適切に計算して与えなければならない。 -.TP +上述したように、 効率的なプログラムを書くには \fInfds\fP の値を適切に計算して与えなければならない。 +.TP 3. -.\"O No file descriptor must be added to any set if you do not intend -.\"O to check its result after the -.\"O .BR select () -.\"O call, and respond appropriately. -.\"O See next rule. -.BR select () -コールの終了後に結果をチェックして、 -適切に対応するつもりのないファイルディスクリプタは、 -どの集合にも加えてはならない。 +\fBselect\fP() コールの終了後に結果をチェックして、 適切に対応するつもりのないファイルディスクリプタは、 どの集合にも加えてはならない。 次のルールも参照。 -.TP +.TP 4. -.\"O After -.\"O .BR select () -.\"O returns, all file descriptors in all sets -.\"O should be checked to see if they are ready. -.BR select () -から返った後には、全ての集合の全てのファイルディスクリプタについて -読み書き可能な状態になっているかをチェックすべきである。 -.TP +\fBselect\fP() から返った後には、全ての集合の全てのファイルディスクリプタについて 読み書き可能な状態になっているかをチェックすべきである。 +.TP 5. -.\"O The functions -.\"O .BR read (2), -.\"O .BR recv (2), -.\"O .BR write (2), -.\"O and -.\"O .BR send (2) -.\"O do \fInot\fP necessarily read/write the full amount of data -.\"O that you have requested. -.\"O If they do read/write the full amount, it's -.\"O because you have a low traffic load and a fast stream. -.\"O This is not always going to be the case. -.\"O You should cope with the case of your -.\"O functions only managing to send or receive a single byte. -.BR read (2), -.BR recv (2), -.BR write (2), -.BR send (2) -といった関数は、こちらが要求した全データを読み書きする必要は\fIない\fP。 -もし全データを読み書きするなら、それはトラフィックの負荷が小さく、 -ストリームが速い場合だろう。この条件は常に満たされるとは限らない。 -これらの関数が頑張っても 1 バイトしか送受信できないような場合も +\fBread\fP(2), \fBrecv\fP(2), \fBwrite\fP(2), \fBsend\fP(2) +といった関数は、こちらが要求した全データを読み書きする必要は\fIない\fP。 もし全データを読み書きするなら、それはトラフィックの負荷が小さく、 +ストリームが速い場合だろう。この条件は常に満たされるとは限らない。 これらの関数が頑張っても 1 バイトしか送受信できないような場合も 考慮に入れてやらなければならない。 -.TP +.TP 6. -.\"O Never read/write only in single bytes at a time unless you are really -.\"O sure that you have a small amount of data to process. -.\"O It is extremely -.\"O inefficient not to read/write as much data as you can buffer each time. -.\"O The buffers in the example below are 1024 bytes although they could -.\"O easily be made larger. -処理するデータ量が小さいことがはっきりとわかっている場合を除いて、 -一度に 1 バイトずつ読み書きするようなことはしてはならない。 -バッファの許すかぎりのデータをまとめて読み書きしないと、 -非常に効率が悪い。下記の例ではバッファは 1024 バイトにしているが、 +処理するデータ量が小さいことがはっきりとわかっている場合を除いて、 一度に 1 バイトずつ読み書きするようなことはしてはならない。 +バッファの許すかぎりのデータをまとめて読み書きしないと、 非常に効率が悪い。下記の例ではバッファは 1024 バイトにしているが、 このサイズを大きくするのは簡単だろう。 -.TP +.TP 7. -.\"O The functions -.\"O .BR read (2), -.\"O .BR recv (2), -.\"O .BR write (2), -.\"O and -.\"O .BR send (2) -.\"O as well as the -.\"O .BR select () -.\"O call can return \-1 with -.\"O .I errno -.\"O set to \fBEINTR\fP, -.\"O or with -.\"O .I errno -.\"O set to \fBEAGAIN\fP (\fBEWOULDBLOCK\fP). -.\"O These results must be properly managed (not done properly above). -.\"O If your program is not going to receive any signals, then -.\"O it is unlikely you will get \fBEINTR\fP. -.\"O If your program does not set nonblocking I/O, -.\"O you will not get \fBEAGAIN\fP. -.\"O .\" Nonetheless, you should still cope with these errors for completeness. -.BR read (2), -.BR recv (2), -.BR write (2), -.BR send (2) -などの関数や -.BR select () -コールは、 -.I errno -を -.B EINTR " や " EAGAIN -.RB ( EWOULDBLOCK ) -にして \-1 を返すことがある。 -このような結果に対して適切に対応してやらなければならない -(上記の例ではしていない)。 -書いているプログラムがシグナルを受ける予定がなければ、 -.B EINTR -が返されることはあまり考えられない。 -書いているプログラムで非ブロック I/O をセットしていない場合は、 -.B EAGAIN +.\" Nonetheless, you should still cope with these errors for completeness. +\fBread\fP(2), \fBrecv\fP(2), \fBwrite\fP(2), \fBsend\fP(2) などの関数や \fBselect\fP() コールは、 +\fIerrno\fP を \fBEINTR や EAGAIN\fP (\fBEWOULDBLOCK\fP) にして \-1 を返すことがある。 +このような結果に対して適切に対応してやらなければならない (上記の例ではしていない)。 書いているプログラムがシグナルを受ける予定がなければ、 +\fBEINTR\fP が返されることはあまり考えられない。 書いているプログラムで非ブロック I/O をセットしていない場合は、 \fBEAGAIN\fP が返されることはないだろう。 -.\" それでもなお、完全を期するならば、 -.\" これらのエラーを考慮に入れる必要がある。 -.TP +.TP 8. -.\"O Never call -.\"O .BR read (2), -.\"O .BR recv (2), -.\"O .BR write (2), -.\"O or -.\"O .BR send (2) -.\"O with a buffer length of zero. -決して、引き数に長さ 0 のバッファを指定して -.BR read (2), -.BR recv (2), -.BR write (2), -.BR send (2) +決して、引き数に長さ 0 のバッファを指定して \fBread\fP(2), \fBrecv\fP(2), \fBwrite\fP(2), \fBsend\fP(2) を呼び出してはならない。 -.TP +.TP 9. -.\"O If the functions -.\"O .BR read (2), -.\"O .BR recv (2), -.\"O .BR write (2), -.\"O and -.\"O .BR send (2) -.\"O fail with errors other than those listed in \fB7.\fP, -.\"O or one of the input functions returns 0, indicating end of file, -.\"O then you should \fInot\fP pass that descriptor to -.\"O .BR select () -.\"O again. -.\"O In the example below, -.\"O I close the descriptor immediately, and then set it to \-1 -.\"O to prevent it being included in a set. -.BR read (2), -.BR recv (2), -.BR write (2), -.BR send (2) -が -\fB7.\fP に示した以外のエラーで失敗した場合や、 -入力系の関数の一つがファイル末尾を表す 0 を返した場合は、 -そのディスクリプタをもう一度 select に渡しては\fIならない\fP。 -下記の例では、そのディスクリプタをただちにクローズし、 -そこには \-1 をセットして、 -それが集合に含まれ続けるのを許さないようにしている。 -.TP +\fBread\fP(2), \fBrecv\fP(2), \fBwrite\fP(2), \fBsend\fP(2) が \fB7.\fP に示した以外のエラーで失敗した場合や、 +入力系の関数の一つがファイル末尾を表す 0 を返した場合は、 そのディスクリプタをもう一度 select に渡しては\fIならない\fP。 +下記の例では、そのディスクリプタをただちにクローズし、 そこには \-1 をセットして、 それが集合に含まれ続けるのを許さないようにしている。 +.TP 10. -.\"O The timeout value must be initialized with each new call to -.\"O .BR select (), -.\"O since some operating systems modify the structure. -.\"O .BR pselect () -.\"O however does not modify its timeout structure. -タイムアウトの値は -.BR select () -を呼ぶたびに初期化すべきである。 -OS によっては timeout 構造体が変更される場合があるからである。 -但し、 -.BR pselect () -は自分の timeout 構造体を変更することはない。 -.TP +タイムアウトの値は \fBselect\fP() を呼ぶたびに初期化すべきである。 OS によっては timeout +構造体が変更される場合があるからである。 但し、 \fBpselect\fP() は自分の timeout 構造体を変更することはない。 +.TP 11. -.\"O Since -.\"O .BR select () -.\"O modifies its file descriptor sets, -.\"O if the call is being used in a loop, -.\"O then the sets must be reinitialized before each call. -.BR select () -はファイルディスクリプタ集合を変更するので、 -.BR select () -がループの中で使用されている場合には、呼び出しを行う前に毎回 -ディスクリプタ集合を初期化し直さなければならない。 .\" "I have heard" does not fill me with confidence, and doesn't .\" belong in a man page, so I've commented this point out. .\" .TP -.\"O .\" 11. -.\"O .\" I have heard that the Windows socket layer does not cope with OOB data -.\"O .\" properly. -.\"O .\" It also does not cope with -.\"O .\" .BR select () -.\"O .\" calls when no file descriptors are set at all. -.\"O .\" Having no file descriptors set is a useful -.\"O .\" way to sleep the process with subsecond precision by using the timeout. -.\"O .\" (See further on.) -.\" 聞いたところでは、Windows のソケット層は -.\" OOB データを正しく処理しないらしい。 -.\" また、ファイルディスクリプタが全くセットされていないような +.\" 11. +.\" I have heard that the Windows socket layer does not cope with OOB data +.\" properly. +.\" It also does not cope with .\" .BR select () -.\" コールも正しく処理しないらしい。 -.\" ファイルディスクリプタを一切設定しないで timeout を使うやり方は、 -.\" 1 秒以下の精度でプロセスをスリープさせるには便利な方法なのだが -.\" (続きを見よ)。 -.\"O .SS Usleep Emulation -.SS usleep エミュレーション -.\"O On systems that do not have a -.\"O .BR usleep (3) -.\"O function, you can call -.\"O .BR select () -.\"O with a finite timeout and no file descriptors as -.\"O follows: -.BR usleep (3) -関数を持たないシステムでは、 -有限のタイムアウトを指定し、ファイルディスクリプタを全くセットせずに -.BR select () -を呼び出すことで、これを代用できる。 -以下のようにする。 +.\" calls when no file descriptors are set at all. +.\" Having no file descriptors set is a useful +.\" way to sleep the process with subsecond precision by using the timeout. +.\" (See further on.) +\fBselect\fP() はファイルディスクリプタ集合を変更するので、 \fBselect\fP() +がループの中で使用されている場合には、呼び出しを行う前に毎回 ディスクリプタ集合を初期化し直さなければならない。 +.SS "usleep エミュレーション" +\fBusleep\fP(3) 関数を持たないシステムでは、 有限のタイムアウトを指定し、ファイルディスクリプタを全くセットせずに \fBselect\fP() +を呼び出すことで、これを代用できる。 以下のようにする。 .PP .nf struct timeval tv; @@ -777,105 +294,29 @@ OS によっては timeout 構造体が変更される場合があるからで select(0, NULL, NULL, NULL, &tv); .fi .PP -.\"O This is only guaranteed to work on UNIX systems, however. 但し、これが動くと保証されているのは UNIX システムに限られる。 -.\"O .SH RETURN VALUE .SH 返り値 -.\"O On success, -.\"O .BR select () -.\"O returns the total number of file descriptors -.\"O still present in the file descriptor sets. -成功すると、 -.BR select () -はファイルディスクリプタ集合に残っている -ファイルディスクリプタの総数を返す。 +成功すると、 \fBselect\fP() はファイルディスクリプタ集合に残っている ファイルディスクリプタの総数を返す。 -.\"O If -.\"O .BR select () -.\"O timed out, then the return value will be zero. -.\"O The file descriptors set should be all -.\"O empty (but may not be on some systems). -.BR select () -がタイムアウトすると、返り値は 0 になる。 -その時、ファイルディスクリプタ集合はすべて空である +\fBselect\fP() がタイムアウトすると、返り値は 0 になる。 その時、ファイルディスクリプタ集合はすべて空である (しかしそうならないシステムもある)。 -.\"O A return value of \-1 indicates an error, with \fIerrno\fP being -.\"O set appropriately. -.\"O In the case of an error, the contents of the returned sets and -.\"O the \fIstruct timeout\fP contents are undefined and should not be used. -.\"O .BR pselect () -.\"O however never modifies \fIntimeout\fP. -返り値が \-1 の場合はエラーを意味し、 -.I errno -が適切にセットされる。エラーが起こった場合、 -返された集合の内容や構造体 \fIstruct timeout\fP の内容は -未定義となっており、使用すべきではない。 -しかし -.BR pselect () -は決して -.I ntimeout +返り値が \-1 の場合はエラーを意味し、 \fIerrno\fP が適切にセットされる。エラーが起こった場合、 返された集合の内容や構造体 \fIstruct +timeout\fP の内容は 未定義となっており、使用すべきではない。 しかし \fBpselect\fP() は決して \fIntimeout\fP を変更しない。 -.\"O .SH NOTES .SH 注意 -.\"O Generally speaking, -.\"O all operating systems that support sockets also support -.\"O .BR select (). -.\"O .BR select () -.\"O can be used to solve -.\"O many problems in a portable and efficient way that naive programmers try -.\"O to solve in a more complicated manner using -.\"O threads, forking, IPCs, signals, memory sharing, and so on. -一般的に言って、ソケットをサポートする全てのオペレーティングシステムは -.BR select () -もサポートしている。 -.BR select () -を使うと、プログラマがスレッド、フォーク、IPC、シグナル、メモリ共有、 -等々を使ってもっと複雑な方法で解決しようとする多くの問題が、 +一般的に言って、ソケットをサポートする全てのオペレーティングシステムは \fBselect\fP() もサポートしている。 \fBselect\fP() +を使うと、プログラマがスレッド、フォーク、IPC、シグナル、メモリ共有、 等々を使ってもっと複雑な方法で解決しようとする多くの問題が、 移植性がありかつ効率的な方法で解決できる。 .PP -.\"O The -.\"O .BR poll (2) -.\"O system call has the same functionality as -.\"O .BR select (), -.\"O and is somewhat more efficient when monitoring sparse -.\"O file descriptor sets. -.\"O It is nowadays widely available, but historically was less portable than -.\"O .BR select (). -.BR poll (2) -システムコールは -.BR select () -と同じ機能を持っており、 -まばらなファイルディスクリプタ集合を監視する場合に -いくらか効率がよい。 -現在では広く利用可能であるが、以前は -.BR select () -より移植性の面で劣っていた。 +\fBpoll\fP(2) システムコールは \fBselect\fP() と同じ機能を持っており、 まばらなファイルディスクリプタ集合を監視する場合に +いくらか効率がよい。 現在では広く利用可能であるが、以前は \fBselect\fP() より移植性の面で劣っていた。 .PP -.\"O The Linux-specific -.\"O .BR epoll (7) -.\"O API provides an interface that is more efficient than -.\"O .BR select (2) -.\"O and -.\"O .BR poll (2) -.\"O when monitoring large numbers of file descriptors. -Linux 独自の -.BR epoll (7) -API は、多数のファイルディスクリプタを監視する場合に -.BR select (2) -や -.BR poll (2) -よりも効率的なインタフェースを提供している。 -.\"O .SH EXAMPLE +Linux 独自の \fBepoll\fP(7) API は、多数のファイルディスクリプタを監視する場合に \fBselect\fP(2) や +\fBpoll\fP(2) よりも効率的なインタフェースを提供している。 .SH 例 -.\"O Here is an example that better demonstrates the true utility of -.\"O .BR select (). -.\"O The listing below a TCP forwarding program that forwards -.\"O from one TCP port to another. -.BR select () -の本当に便利な点を示す、よい例を紹介する。 -以下のリストは、ある TCP ポートから別のポートへ転送を行う -TCP フォワードプログラムである。 +\fBselect\fP() の本当に便利な点を示す、よい例を紹介する。 以下のリストは、ある TCP ポートから別のポートへ転送を行う TCP +フォワードプログラムである。 .PP .nf #include @@ -921,7 +362,7 @@ listen_socket(int listen_port) close(s); return \-1; } - printf("accepting connections on port %d\\n", listen_port); + printf("accepting connections on port %d\en", listen_port); listen(s, 10); return s; } @@ -957,20 +398,20 @@ connect_socket(int connect_port, char *address) return s; } -#define SHUT_FD1 do { \\ - if (fd1 >= 0) { \\ - shutdown(fd1, SHUT_RDWR); \\ - close(fd1); \\ - fd1 = \-1; \\ - } \\ +#define SHUT_FD1 do { \e + if (fd1 >= 0) { \e + shutdown(fd1, SHUT_RDWR); \e + close(fd1); \e + fd1 = \-1; \e + } \e } while (0) -#define SHUT_FD2 do { \\ - if (fd2 >= 0) { \\ - shutdown(fd2, SHUT_RDWR); \\ - close(fd2); \\ - fd2 = \-1; \\ - } \\ +#define SHUT_FD2 do { \e + if (fd2 >= 0) { \e + shutdown(fd2, SHUT_RDWR); \e + close(fd2); \e + fd2 = \-1; \e + } \e } while (0) #define BUF_SIZE 1024 @@ -985,8 +426,8 @@ main(int argc, char *argv[]) int buf2_avail, buf2_written; if (argc != 4) { - fprintf(stderr, "Usage\\n\\tfwd " - " \\n"); + fprintf(stderr, "Usage\en\etfwd " + " \en"); exit(EXIT_FAILURE); } @@ -1060,7 +501,7 @@ main(int argc, char *argv[]) if (fd2 == \-1) SHUT_FD1; else - printf("connect from %s\\n", + printf("connect from %s\en", inet_ntoa(client_address.sin_addr)); } } @@ -1143,57 +584,18 @@ main(int argc, char *argv[]) } .fi .PP -.\"O The above program properly forwards most kinds of TCP connections -.\"O including OOB signal data transmitted by \fBtelnet\fP servers. -.\"O It handles the tricky problem of having data flow in both directions -.\"O simultaneously. -.\"O You might think it more efficient to use a -.\"O .BR fork (2) -.\"O call and devote a thread to each stream. -.\"O This becomes more tricky than you might suspect. -.\"O Another idea is to set nonblocking I/O using -.\"O .BR fcntl (2). -.\"O This also has its problems because you end up using -.\"O inefficient timeouts. -上記のプログラムは、ほとんどの種類の TCP 接続をフォワードする。 -.B telnet -サーバによって中継される OOB シグナルデータも扱える。 -このプログラムは、データフローを双方向に同時に送るという、 -ややこしい問題も処理できる。 -.BR fork (2) -コールを使って、各ストリームごとに専用のスレッドを用いるほうが効率的だ、 -という人もいるかもしれない。しかし、これは考えているよりずっとややこしい。 -あるいは、 -.BR fcntl (2) -を使って非ブロック I/O をセットすれば良い、というアイデアもあるだろう。 +上記のプログラムは、ほとんどの種類の TCP 接続をフォワードする。 \fBtelnet\fP サーバによって中継される OOB シグナルデータも扱える。 +このプログラムは、データフローを双方向に同時に送るという、 ややこしい問題も処理できる。 \fBfork\fP(2) +コールを使って、各ストリームごとに専用のスレッドを用いるほうが効率的だ、 という人もいるかもしれない。しかし、これは考えているよりずっとややこしい。 +あるいは、 \fBfcntl\fP(2) を使って非ブロック I/O をセットすれば良い、というアイデアもあるだろう。 これにも実際には問題があり、タイムアウトが非効率的に起こってしまう。 -.\"O The program does not handle more than one simultaneous connection at a -.\"O time, although it could easily be extended to do this with a linked list -.\"O of buffers\(emone for each connection. -.\"O At the moment, new -.\"O connections cause the current connection to be dropped. -このプログラムは一度にひとつ以上の同時接続を扱うことはできないが、 -その様に拡張するのは簡単で、バッファのリンクリストを -(接続ごとにひとつずつ) 使えばよい。 -現時点のものでは、新しい接続がくると古い接続は落ちてしまう。 -.\"O .SH SEE ALSO +このプログラムは一度にひとつ以上の同時接続を扱うことはできないが、 その様に拡張するのは簡単で、バッファのリンクリストを (接続ごとにひとつずつ) +使えばよい。 現時点のものでは、新しい接続がくると古い接続は落ちてしまう。 .SH 関連項目 -.BR accept (2), -.BR connect (2), -.BR ioctl (2), -.BR poll (2), -.BR read (2), -.BR recv (2), -.BR select (2), -.BR send (2), -.BR sigprocmask (2), -.BR write (2), -.BR sigaddset (3), -.BR sigdelset (3), -.BR sigemptyset (3), -.BR sigfillset (3), -.BR sigismember (3), -.BR epoll (7) +\fBaccept\fP(2), \fBconnect\fP(2), \fBioctl\fP(2), \fBpoll\fP(2), \fBread\fP(2), +\fBrecv\fP(2), \fBselect\fP(2), \fBsend\fP(2), \fBsigprocmask\fP(2), \fBwrite\fP(2), +\fBsigaddset\fP(3), \fBsigdelset\fP(3), \fBsigemptyset\fP(3), \fBsigfillset\fP(3), +\fBsigismember\fP(3), \fBepoll\fP(7) .\" .SH AUTHORS .\" This man page was written by Paul Sheer. diff --git a/draft/man2/send.2 b/draft/man2/send.2 index f53462d7..b361d3d5 100644 --- a/draft/man2/send.2 +++ b/draft/man2/send.2 @@ -35,705 +35,210 @@ .\" Modified Oct 2003 by aeb .\" Modified 2004-07-01 by mtk .\" -.\" Japanese Version Copyright (c) 1996 HANATAKA Shinya all rights reserved. -.\" Translated 1997-02-23, HANATAKA Shinya -.\" Updated 1999-08-15, HANATAKA Shinya -.\" Updated 2000-01-13, Kentaro Shirakata -.\" Updated 2001-01-30, Kentaro Shirakata -.\" Updated 2005-03-14, Akihiro MOTOKI -.\" Updated 2005-12-26, Akihiro MOTOKI -.\" Updated 2006-04-15, Akihiro MOTOKI, LDP v2.29 -.\" Updated 2008-04-13, Akihiro MOTOKI, LDP v3.20 +.\"******************************************************************* .\" -.\"WORD: socket ソケット -.\"WORD: message メッセージ -.\"WORD: protocol プロトコル -.\"WORD: nonblocking I/O 非停止 I/O -.\"WORD: block 停止(block) -.\"WORD: out-of-band 帯域外 -.\"WORD: descriptor ディスクリプタ -.\"WORD: parameter パラメータ -.\"WORD: queue キュー -.\"WORD: buffer バッファ -.\"WORD: routing ルーティング -.\"WORD: congestion 輻輳 +.\" This file was generated with po4a. Translate the source file. .\" -.TH SEND 2 2011-10-01 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH SEND 2 2012\-02\-27 Linux "Linux Programmer's Manual" .SH 名前 -.\"O send, sendto, sendmsg \- send a message on a socket send, sendto, sendmsg \- ソケットへメッセージを送る -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include -.B #include +\fB#include \fP +\fB#include \fP .sp -.BI "ssize_t send(int " sockfd ", const void *" buf ", size_t " len \ -", int " flags ); +\fBssize_t send(int \fP\fIsockfd\fP\fB, const void *\fP\fIbuf\fP\fB, size_t \fP\fIlen\fP\fB, int \fP\fIflags\fP\fB);\fP -.BI "ssize_t sendto(int " sockfd ", const void *" buf ", size_t " len \ -", int " flags , -.BI " const struct sockaddr *" dest_addr ", socklen_t " addrlen ); +\fBssize_t sendto(int \fP\fIsockfd\fP\fB, const void *\fP\fIbuf\fP\fB, size_t \fP\fIlen\fP\fB, int \fP\fIflags\fP\fB,\fP +\fB const struct sockaddr *\fP\fIdest_addr\fP\fB, socklen_t \fP\fIaddrlen\fP\fB);\fP -.BI "ssize_t sendmsg(int " sockfd ", const struct msghdr *" msg \ -", int " flags ); +\fBssize_t sendmsg(int \fP\fIsockfd\fP\fB, const struct msghdr *\fP\fImsg\fP\fB, int \fP\fIflags\fP\fB);\fP .fi .SH 説明 -.\"O The system calls -.\"O .BR send (), -.\"O .BR sendto (), -.\"O and -.\"O .BR sendmsg () -.\"O are used to transmit a message to another socket. -システムコール -.BR send (), -.BR sendto (), -.BR sendmsg () -は、もう一方のソケットへメッセージを転送するのに使用される。 +システムコール \fBsend\fP(), \fBsendto\fP(), \fBsendmsg\fP() は、もう一方のソケットへメッセージを転送するのに使用される。 .PP -.\"O The -.\"O .BR send () -.\"O call may be used only when the socket is in a -.\"O .I connected -.\"O state (so that the intended recipient is known). -.\"O The only difference between -.\"O .BR send () -.\"O and -.\"O .BR write (2) -.\"O is the presence of -.\"O .IR flags . -.BR send () -は、ソケットが -.I "接続された (connected)" -状態にある場合にのみ使用できる -(つまり、どの相手に送信するかは既知である)。 -.BR send () -と -.BR write (2) -の違いは、引き数に -.I flags -があるかどうかだけである。 -.\"O With a zero -.\"O .I flags -.\"O argument, -.\"O .BR send () -.\"O is equivalent to -.\"O .BR write (2). -.\"O Also, the following call -.\"O -.\"O send(sockfd, buf, len, flags); -.\"O -.\"O is equivalent to -.\"O -.\"O sendto(sockfd, buf, len, flags, NULL, 0); -引き数 -.I flags -にフラグが指定されない場合、 -.BR send () -は -.BR write (2) -と等価である。 +\fBsend\fP() は、ソケットが \fI接続された (connected)\fP 状態にある場合にのみ使用できる +(つまり、どの相手に送信するかは既知である)。 \fBsend\fP() と \fBwrite\fP(2) の違いは、引き数に \fIflags\fP +があるかどうかだけである。 引き数 \fIflags\fP にフラグが指定されない場合、 \fBsend\fP() は \fBwrite\fP(2) と等価である。 また、 send(sockfd, buf, len, flags); -は +は以下と等価である。 sendto(sockfd, buf, len, flags, NULL, 0); - -と等価である。 .PP -.\"O The argument -.\"O .I sockfd -.\"O is the file descriptor of the sending socket. -引き数 -.I sockfd -は、データを送信するパケットのファイル・ディスクリプタである。 +引き数 \fIsockfd\fP は、データを送信するパケットのファイル・ディスクリプタである。 .PP -.\"O If -.\"O .BR sendto () -.\"O is used on a connection-mode -.\"O .RB ( SOCK_STREAM , -.\"O .BR SOCK_SEQPACKET ) -.\"O socket, the arguments -.\"O .I dest_addr -.\"O and -.\"O .I addrlen -.\"O are ignored (and the error -.\"O .B EISCONN -.\"O may be returned when they are -.\"O not NULL and 0), and the error -.\"O .B ENOTCONN -.\"O is returned when the socket was not actually connected. -.\"O Otherwise, the address of the target is given by -.\"O .I dest_addr -.\"O with -.\"O .I addrlen -.\"O specifying its size. -.BR sendto () -は、接続型 (connection-mode) のソケット -.RB ( SOCK_STREAM , -.BR SOCK_SEQPACKET ) -で -使用された場合、引き数 -.I dest_addr -と -.I addrlen -は無視される (各々の引き数が NULL と 0 でない場合は -.B EISCONN -エラーも返される)。 -また、ソケットが実際には接続されていなかった時には -.B ENOTCONN -エラーが返される。 -接続型のソケット以外で使用された場合は、接続先のアドレスは -.I dest_addr -で与えられ、そのサイズは -.I addrlen -で指定される。 -.\"O For -.\"O .BR sendmsg (), -.\"O the address of the target is given by -.\"O .IR msg.msg_name , -.\"O with -.\"O .I msg.msg_namelen -.\"O specifying its size. -.BR sendmsg () -では、接続先のアドレスは -.I msg.msg_name -で与えられ、そのサイズは -.I msg.msg_namelen -で指定される。 +\fBsendto\fP() は、接続型 (connection\-mode) のソケット (\fBSOCK_STREAM\fP, +\fBSOCK_SEQPACKET\fP) で 使用された場合、引き数 \fIdest_addr\fP と \fIaddrlen\fP は無視される (各々の引き数が +NULL と 0 でない場合は \fBEISCONN\fP エラーも返される)。 また、ソケットが実際には接続されていなかった時には \fBENOTCONN\fP +エラーが返される。 接続型のソケット以外で使用された場合は、接続先のアドレスは \fIdest_addr\fP で与えられ、そのサイズは \fIaddrlen\fP +で指定される。 \fBsendmsg\fP() では、接続先のアドレスは \fImsg.msg_name\fP で与えられ、そのサイズは +\fImsg.msg_namelen\fP で指定される。 .PP -.\"O For -.\"O .BR send () -.\"O and -.\"O .BR sendto (), -.\"O the message is found in -.\"O .I buf -.\"O and has length -.\"O .IR len . -.\"O For -.\"O .BR sendmsg (), -.\"O the message is pointed to by the elements of the array -.\"O .IR msg.msg_iov . -.\"O The -.\"O .BR sendmsg () -.\"O call also allows sending ancillary data (also known as control information). -.BR send () -と -.BR sendto () -では、メッセージは -.I buf -に格納されており、その長さは -.I len -であると解釈される。 -.BR sendmsg () -では、メッセージは -配列 -.I msg.msg_iov -の各要素が指す位置に格納されている。 -.BR sendmsg () +\fBsend\fP() と \fBsendto\fP() では、メッセージは \fIbuf\fP に格納されており、その長さは \fIlen\fP であると解釈される。 +\fBsendmsg\fP() では、メッセージは 配列 \fImsg.msg_iov\fP の各要素が指す位置に格納されている。 \fBsendmsg\fP() では、補助データ (制御情報とも呼ばれる) を送信することもできる。 .PP -.\"O If the message is too long to pass atomically through the -.\"O underlying protocol, the error -.\"O .B EMSGSIZE -.\"O is returned, and the message is not transmitted. -メッセージ長が長過ぎるために、そのソケットが使用するプロトコルでは、 -メッセージをソケットに渡されたままの形で送信することができない場合、 -.B EMSGSIZE -エラーが返され、そのメッセージは転送されない。 +メッセージ長が長過ぎるために、そのソケットが使用するプロトコルでは、 メッセージをソケットに渡されたままの形で送信することができない場合、 +\fBEMSGSIZE\fP エラーが返され、そのメッセージは転送されない。 .PP -.\"O No indication of failure to deliver is implicit in a -.\"O .BR send (). -.\"O Locally detected errors are indicated by a return value of \-1. -.BR send () -では、配送の失敗の通知は明示的に行われる。 -ローカル側でエラーが検出された場合は、返り値 \-1 として通知される。 +\fBsend\fP() では、配送の失敗の通知は明示的に行われる。 ローカル側でエラーが検出された場合は、返り値 \-1 として通知される。 .PP -.\"O When the message does not fit into the send buffer of the socket, -.\"O .BR send () -.\"O normally blocks, unless the socket has been placed in nonblocking I/O -.\"O mode. -.\"O In nonblocking mode it would fail with the error -.\"O .B EAGAIN -.\"O or -.\"O .B EWOULDBLOCK -.\"O in this case. -.\"O The -.\"O .BR select (2) -.\"O call may be used to determine when it is possible to send more data. -メッセージがソケットの送信バッファに入れることができない場合、 -.BR send () -は通常は停止 (block) する (ソケットが非停止 (nonblocking) I/O モード -でない場合)。非停止モードの場合にはエラー -.B EAGAIN -か -.B EWOULDBLOCK -で失敗する。 -いつデータをさらに送信できるようになるかを知るために、 -.BR select (2) -コールを使用することができる。 +メッセージがソケットの送信バッファに入れることができない場合、 \fBsend\fP() は通常は停止 (block) する (ソケットが非停止 +(nonblocking) I/O モード でない場合)。非停止モードの場合にはエラー \fBEAGAIN\fP か \fBEWOULDBLOCK\fP +で失敗する。 いつデータをさらに送信できるようになるかを知るために、 \fBselect\fP(2) コールを使用することができる。 .PP -.\"O .I flags -.\"O argument is the bitwise OR -.\"O of zero or more of the following flags. -.I flags -引き数は、以下のフラグの (0 個以上の) ビット単位の論理和を -とったものを指定する。 -.\"O .\" FIXME ? document MSG_PROXY (which went away in 2.3.15) -.\" FIXME ? MSG_PROXY について記載すること -.\" (MSG_PROXY は 2.3.15 でなくなった) -.TP -.\"O .BR MSG_CONFIRM " (Since Linux 2.3.15)" -.\"O Tell the link layer that forward progress happened: you got a successful -.\"O reply from the other side. -.\"O If the link layer doesn't get this -.\"O it will regularly reprobe the neighbor (e.g., via a unicast ARP). -.BR MSG_CONFIRM " (Linux 2.3.15 以降)" -転送処理に進展があった、つまり相手側から成功の応答を受けたことをリンク層に -知らせる。リンク層がこの通知を受け取らなかった場合には、通常どおり -(ユニキャスト ARP を使うなどの方法で) 近傍 (neighbor) の再検索を行う。 -.\"O Only valid on -.\"O .B SOCK_DGRAM -.\"O and -.\"O .B SOCK_RAW -.\"O sockets and currently only implemented for IPv4 and IPv6. -.\"O See -.\"O .BR arp (7) -.\"O for details. -.B SOCK_DGRAM -と -.B SOCK_RAW -のソケットに対してのみ有効で、現在のところ IPv4 と IPv6 のみ実装されている。 -詳しくは -.BR arp (7) -参照のこと。 -.TP -.B MSG_DONTROUTE -.\"O Don't use a gateway to send out the packet, only send to hosts on -.\"O directly connected networks. -.\"O This is usually used only -.\"O by diagnostic or routing programs. -.\"O This is only defined for protocol -.\"O families that route; packet sockets don't. -パケットを送り出すのにゲートウェイを使用せず、 -直接接続されているネットワーク上のホストだけに送る。 -通常、このフラグは診断 (diagnostic) やルーティング・プログラムに -よってのみ使用される。このフラグは、経路制御が行われるプロトコルファミリー +.\" FIXME ? document MSG_PROXY (which went away in 2.3.15) +\fIflags\fP 引き数は、以下のフラグの (0 個以上の) ビット単位の論理和を とったものを指定する。 +.TP +\fBMSG_CONFIRM\fP (Linux 2.3.15 以降) +転送処理に進展があった、つまり相手側から成功の応答を受けたことをリンク層に 知らせる。リンク層がこの通知を受け取らなかった場合には、通常どおり +(ユニキャスト ARP を使うなどの方法で) 近傍 (neighbor) の再検索を行う。 \fBSOCK_DGRAM\fP と \fBSOCK_RAW\fP +のソケットに対してのみ有効で、現在のところ IPv4 と IPv6 のみ実装されている。 詳しくは \fBarp\fP(7) 参照のこと。 +.TP +\fBMSG_DONTROUTE\fP +パケットを送り出すのにゲートウェイを使用せず、 直接接続されているネットワーク上のホストだけに送る。 通常、このフラグは診断 (diagnostic) +やルーティング・プログラムに よってのみ使用される。このフラグは、経路制御が行われるプロトコルファミリー に対してのみ定義されている。パケットソケットには定義されていない。 -.TP -.B MSG_DONTWAIT -.\"O Enables nonblocking operation; if the operation would block, -.\"O .B EAGAIN -.\"O or -.\"O .B EWOULDBLOCK -.\"O is returned (this can also be enabled using the -.\"O .B O_NONBLOCK -.\"O flag with the -.\"O .B F_SETFL -.\"O .BR fcntl (2)). -非停止 (nonblocking) 操作を有効にする。操作が停止されるような場合には -.B EAGAIN -か -.B EWOULDBLOCK -を返すようにする -.RB ( fcntl (2) -の -.B F_SETFL -で -.B O_NONBLOCK -フラグを指定することによっても有効にできる)。 -.TP -.\"O .BR MSG_EOR " (since Linux 2.2)" -.BR MSG_EOR " (Linux 2.2 以降)" -.\"O Terminates a record (when this notion is supported, as for sockets of type -.\"O .BR SOCK_SEQPACKET ). -レコードの終了を指示する -.RB ( SOCK_SEQPACKET -のようにこの概念に対応しているソケット種別のときに有効)。 -.TP -.\"O .BR MSG_MORE " (Since Linux 2.4.4)" -.BR MSG_MORE " (Linux 2.4.4 以降)" -.\"O The caller has more data to send. -.\"O This flag is used with TCP sockets to obtain the same effect -.\"O as the -.\"O .B TCP_CORK -.\"O socket option (see -.\"O .BR tcp (7)), -.\"O with the difference that this flag can be set on a per-call basis. -呼び出し元にさらに送るデータがあることを示す。 -このフラグは TCP ソケットとともに使用され、 -.B TCP_CORK -ソケットオプションと同じ効果が得られる -.RB ( tcp (7) -を参照)。 -.B TCP_CORK -との違いは、このフラグを使うと呼び出し単位で +.TP +\fBMSG_DONTWAIT\fP (Linux 2.2 以降) +非停止 (nonblocking) 操作を有効にする。操作が停止されるような場合には \fBEAGAIN\fP か \fBEWOULDBLOCK\fP +を返すようにする (\fBfcntl\fP(2) の \fBF_SETFL\fP で \fBO_NONBLOCK\fP フラグを指定することによっても有効にできる)。 +.TP +\fBMSG_EOR\fP (Linux 2.2 以降) +レコードの終了を指示する (\fBSOCK_SEQPACKET\fP のようにこの概念に対応しているソケット種別のときに有効)。 +.TP +\fBMSG_MORE\fP (Linux 2.4.4 以降) +呼び出し元にさらに送るデータがあることを示す。 このフラグは TCP ソケットとともに使用され、 \fBTCP_CORK\fP +ソケットオプションと同じ効果が得られる (\fBtcp\fP(7) を参照)。 \fBTCP_CORK\fP との違いは、このフラグを使うと呼び出し単位で この機能を有効にできる点である。 -.\"O Since Linux 2.6, this flag is also supported for UDP sockets, and informs -.\"O the kernel to package all of the data sent in calls with this flag set -.\"O into a single datagram which is only transmitted when a call is performed -.\"O that does not specify this flag. -.\"O (See also the -.\"O .B UDP_CORK -.\"O socket option described in -.\"O .BR udp (7).) Linux 2.6 以降では、このフラグは UDP ソケットでもサポートされており、 -このフラグ付きで送信された全てのデータを一つのデータグラムにまとめて -送信することを、カーネルに知らせる。まとめられたデータグラムは、 -このフラグを指定せずにこのシステムコールが実行された際に初めて送信される -.RB ( udp (7) -に記載されているソケットオプション -.B UDP_CORK -も参照)。 -.TP -.\"O .BR MSG_NOSIGNAL " (since Linux 2.2)" -.BR MSG_NOSIGNAL " (Linux 2.2 以降)" -.\"O Requests not to send -.\"O .B SIGPIPE -.\"O on errors on stream oriented sockets when the other end breaks the -.\"O connection. -.\"O The -.\"O .B EPIPE -.\"O error is still returned. -ストリーム指向のソケットで相手側が接続を切断した時に、エラーとして -.B SIGPIPE -を送信しないように要求する。この場合でも -.B EPIPE +このフラグ付きで送信された全てのデータを一つのデータグラムにまとめて 送信することを、カーネルに知らせる。まとめられたデータグラムは、 +このフラグを指定せずにこのシステムコールが実行された際に初めて送信される (\fBudp\fP(7) に記載されているソケットオプション +\fBUDP_CORK\fP も参照)。 +.TP +\fBMSG_NOSIGNAL\fP (Linux 2.2 以降) +ストリーム指向のソケットで相手側が接続を切断した時に、エラーとして \fBSIGPIPE\fP を送信しないように要求する。この場合でも \fBEPIPE\fP は返される。 -.TP -.B MSG_OOB -.\"O Sends -.\"O .I out-of-band -.\"O data on sockets that support this notion (e.g., of type -.\"O .BR SOCK_STREAM ); -.\"O the underlying protocol must also support -.\"O .I out-of-band -.\"O data. -.I "帯域外 (out-of-band)" -データをサポートするソケット (例えば -.BR SOCK_STREAM ) -で -.I 帯域外 -データを送る。下位プロトコルも -.I 帯域外 -データをサポートしている必要がある。 +.TP +\fBMSG_OOB\fP +\fI帯域外 (out\-of\-band)\fP データをサポートするソケット (例えば \fBSOCK_STREAM\fP) で \fI帯域外\fP +データを送る。下位プロトコルも \fI帯域外\fP データをサポートしている必要がある。 .PP -.\"O The definition of the -.\"O .I msghdr -.\"O structure follows. -.\"O See -.\"O .BR recv (2) -.\"O and below for an exact description of its fields. -.I msghdr -構造体の内容は以下の通り。 -各フィールドの正確な記述については -.BR recv (2) -と以下の説明を参照すること。 +\fImsghdr\fP 構造体の内容は以下の通り。 各フィールドの正確な記述については \fBrecv\fP(2) と以下の説明を参照すること。 .in +4n .nf struct msghdr { -.\"O void *msg_name; /* optional address */ -.\"O socklen_t msg_namelen; /* size of address */ -.\"O struct iovec *msg_iov; /* scatter/gather array */ -.\"O size_t msg_iovlen; /* # elements in msg_iov */ -.\"O void *msg_control; /* ancillary data, see below */ -.\"O size_t msg_controllen; /* ancillary data buffer len */ -.\"O int msg_flags; /* flags on received message */ void *msg_name; /* 追加のアドレス */ socklen_t msg_namelen; /* アドレスのサイズ */ struct iovec *msg_iov; /* scatter/gather 配列 */ size_t msg_iovlen; /* msg_iov の要素数 */ - void *msg_control; /* 補助データ(後述) */ + void *msg_control; /* 補助データ (後述) */ size_t msg_controllen; /* 補助データバッファ長 */ int msg_flags; /* 受信メッセージのフラグ */ }; .fi .in .PP -.\"O You may send control information using the -.\"O .I msg_control -.\"O and -.\"O .I msg_controllen -.\"O members. -.\"O The maximum control buffer length the kernel can process is limited -.\"O per socket by the value in -.\"O .IR /proc/sys/net/core/optmem_max ; -.\"O see -.\"O .BR socket (7). -.I msg_control -と -.I msg_controllen -メンバーを使用して制御情報を送信することができる。 -カーネルが処理できる制御バッファのソケットあたりの最大長は、 -.I /proc/sys/net/core/optmem_max -の値に制限されている。 -.BR socket (7) -を参照。 .\" Still to be documented: .\" Send file descriptors and user credentials using the .\" msg_control* fields. .\" The flags returned in msg_flags. -.\"O .SH "RETURN VALUE" +\fImsg_control\fP と \fImsg_controllen\fP メンバーを使用して制御情報を送信することができる。 +カーネルが処理できる制御バッファのソケットあたりの最大長は、 \fI/proc/sys/net/core/optmem_max\fP の値に制限されている。 +\fBsocket\fP(7) を参照。 .SH 返り値 -.\"O On success, these calls return the number of characters sent. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合、これらのシステムコールは送信されたバイト数を返す。 -エラーの場合、 \-1 を返し、 -.I errno -を適切に設定にする。 -.\"O .SH ERRORS +成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場合、 \-1 を返し、 \fIerrno\fP を適切に設定にする。 .SH エラー -.\"O These are some standard errors generated by the socket layer. -.\"O Additional errors -.\"O may be generated and returned from the underlying protocol modules; -.\"O see their respective manual pages. -これらはソケット層で発生する一般的なエラーである。これ以外に、下層の -プロトコル・モジュールで生成されたエラーが返されるかもしれない。 +これらはソケット層で発生する一般的なエラーである。これ以外に、下層の プロトコル・モジュールで生成されたエラーが返されるかもしれない。 これらについては、それぞれのマニュアルを参照すること。 -.TP -.B EACCES -.\"O (For UNIX domain sockets, which are identified by pathname) -.\"O Write permission is denied on the destination socket file, -.\"O or search permission is denied for one of the directories -.\"O the path prefix. -.\"O (See -.\"O .BR path_resolution (7).) -(UNIX ドメインソケットはパス名で識別される。) -ソケット・ファイルへの書き込み許可がなかったか、パス名へ -到達するまでのディレクトリのいずれかに対する検索許可がなかった。 -.RB ( path_resolution (7) -も参照のこと) -.TP -.\"O .BR EAGAIN " or " EWOULDBLOCK -.BR EAGAIN " または " EWOULDBLOCK +.TP +\fBEACCES\fP +(UNIX ドメインソケットはパス名で識別される。) ソケット・ファイルへの書き込み許可がなかったか、パス名へ +到達するまでのディレクトリのいずれかに対する検索許可がなかった。 (\fBpath_resolution\fP(7) も参照のこと) +.TP +\fBEAGAIN\fP または \fBEWOULDBLOCK\fP .\" Actually EAGAIN on Linux -.\"O The socket is marked nonblocking and the requested operation -.\"O would block. -.\"O POSIX.1-2001 allows either error to be returned for this case, -.\"O and does not require these constants to have the same value, -.\"O so a portable application should check for both possibilities. -ソケットが非停止に設定されており、 -要求された操作が停止した。 -POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めており、 -これら 2 つの定数が同じ値を持つことも求めていない。 -したがって、移植性が必要なアプリケーションでは、両方の可能性を -確認すべきである。 -.TP -.B EBADF -.\"O An invalid descriptor was specified. +ソケットが非停止に設定されており、 要求された操作が停止した。 POSIX.1\-2001 は、この場合にどちらのエラーを返すことも認めており、 これら +2 つの定数が同じ値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、両方の可能性を 確認すべきである。 +.TP +\fBEBADF\fP 無効なディスクリプターが指定された。 -.TP -.B ECONNRESET -.\"O Connection reset by peer. +.TP +\fBECONNRESET\fP 接続が接続相手によりリセットされた。 -.TP -.B EDESTADDRREQ -.\"O The socket is not connection-mode, and no peer address is set. -ソケットが接続型 (connection-mode) ではなく、 -かつ送信先のアドレスが設定されていない。 -.TP -.B EFAULT -.\"O An invalid user space address was specified for an argument. +.TP +\fBEDESTADDRREQ\fP +ソケットが接続型 (connection\-mode) ではなく、 かつ送信先のアドレスが設定されていない。 +.TP +\fBEFAULT\fP ユーザー空間として不正なアドレスがパラメーターとして指定された。 -.TP -.B EINTR -.\"O A signal occurred before any data was transmitted; see -.\"O .BR signal (7). -データが送信される前に、シグナルが発生した。 -.BR signal (7) -参照。 -.TP -.B EINVAL -.\"O Invalid argument passed. +.TP +\fBEINTR\fP +データが送信される前に、シグナルが発生した。 \fBsignal\fP(7) 参照。 +.TP +\fBEINVAL\fP 不正な引き数が渡された。 -.TP -.B EISCONN -.\"O The connection-mode socket was connected already but a -.\"O recipient was specified. -.\"O (Now either this error is returned, or the recipient specification -.\"O is ignored.) -接続型ソケットの接続がすでに確立していたが、受信者が指定されていた。 -(現在のところ、この状況では、このエラーが返されるか、 +.TP +\fBEISCONN\fP +接続型ソケットの接続がすでに確立していたが、受信者が指定されていた。 (現在のところ、この状況では、このエラーが返されるか、 受信者の指定が無視されるか、のいずれかとなる) -.TP -.B EMSGSIZE -.\"O The socket type -.\"O .\" (e.g., SOCK_DGRAM ) -.\"O requires that message be sent atomically, and the size -.\"O of the message to be sent made this impossible. -そのソケット種別 -.\" (例えば SOCK_DGRAM) -ではソケットに渡されたままの形でメッセージを送信する必要があるが、 -メッセージが大き過ぎるため送信することができない。 -.TP -.B ENOBUFS -.\"O The output queue for a network interface was full. -.\"O This generally indicates that the interface has stopped sending, -.\"O but may be caused by transient congestion. -ネットワーク・インターフェースの出力キューが一杯である。 -一般的には、一時的な輻輳 (congestion) のためにインターフェースが -送信を止めていることを意味する。 -.\"O (Normally, this cannot occur in Linux. -.\"O Packets are just silently dropped -.\"O when a device queue overflows.) -(通常、Linux ではこのようなことは起こらない。デバイスのキューが +.TP +\fBEMSGSIZE\fP +.\" (e.g., SOCK_DGRAM ) +そのソケット種別 ではソケットに渡されたままの形でメッセージを送信する必要があるが、 メッセージが大き過ぎるため送信することができない。 +.TP +\fBENOBUFS\fP +ネットワーク・インターフェースの出力キューが一杯である。 一般的には、一時的な輻輳 (congestion) のためにインターフェースが +送信を止めていることを意味する。 (通常、Linux ではこのようなことは起こらない。デバイスのキューが オーバーフローした場合にはパケットは黙って捨てられる) -.TP -.B ENOMEM -.\"O No memory available. +.TP +\fBENOMEM\fP メモリが足りない。 -.TP -.B ENOTCONN -.\"O The socket is not connected, and no target has been given. +.TP +\fBENOTCONN\fP ソケットが接続されておらず、接続先も指定されていない。 -.TP -.B ENOTSOCK -.\"O The argument -.\"O .I sockfd -.\"O is not a socket. -引き数 -.I sockfd -がソケットでない。 -.TP -.B EOPNOTSUPP -.\"O Some bit in the -.\"O .I flags -.\"O argument is inappropriate for the socket type. -引き数 -.I flags -のいくつかのビットが、そのソケット種別では不適切なものである。 -.TP -.B EPIPE -.\"O The local end has been shut down on a connection oriented socket. -.\"O In this case the process -.\"O will also receive a -.\"O .B SIGPIPE -.\"O unless -.\"O .B MSG_NOSIGNAL -.\"O is set. -接続指向のソケットでローカル側が閉じられている。 -この場合、 -.B MSG_NOSIGNAL -が設定されていなければ、プロセスには -.B SIGPIPE +.TP +\fBENOTSOCK\fP +引き数 \fIsockfd\fP はソケットではない。 +.TP +\fBEOPNOTSUPP\fP +引き数 \fIflags\fP のいくつかのビットが、そのソケット種別では不適切なものである。 +.TP +\fBEPIPE\fP +接続指向のソケットでローカル側が閉じられている。 この場合、 \fBMSG_NOSIGNAL\fP が設定されていなければ、プロセスには \fBSIGPIPE\fP も同時に送られる。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O 4.4BSD, SVr4, POSIX.1-2001. -.\"O These function calls appeared in 4.2BSD. -4.4BSD, SVr4, POSIX.1-2001. -(これらの関数コールは 4.2BSD で最初に登場した)。 - -.\"O POSIX.1-2001 only describes the -.\"O .B MSG_OOB -.\"O and -.\"O .B MSG_EOR -.\"O flags. -.\"O+ POSIX.1-2008 adds a specification of -.\"O+ .BR MSG_NOSIGNAL . -.\"O The -.\"O .B MSG_CONFIRM -.\"O flag is a Linux extension. -POSIX.1-2001 には、 -.B MSG_OOB -と -.B MSG_EOR -フラグだけが記載されている。 -POSIX.1-2008 では -.B MSG_NOSIGNAL -が規格に追加されている。 -.B MSG_CONFIRM -フラグは Linux での拡張である。 -.\"O .SH NOTES +4.4BSD, SVr4, POSIX.1\-2001. (これらの関数コールは 4.2BSD で最初に登場した)。 +.LP +POSIX.1\-2001 には、 \fBMSG_OOB\fP と \fBMSG_EOR\fP フラグだけが記載されている。 POSIX.1\-2008 では +\fBMSG_NOSIGNAL\fP が規格に追加されている。 \fBMSG_CONFIRM\fP フラグは Linux での拡張である。 .SH 注意 -.\"O The prototypes given above follow the Single UNIX Specification, -.\"O as glibc2 also does; the -.\"O .I flags -.\"O argument was \fIint\fP in 4.x BSD, but \fIunsigned int\fP in libc4 and libc5; -.\"O the -.\"O .I len -.\"O argument was \fIint\fP in 4.x BSD and libc4, but \fIsize_t\fP in libc5; -.\"O the -.\"O .I addrlen -.\"O argument was \fIint\fP in 4.x BSD and libc4 and libc5. -.\"O See also -.\"O .BR accept (2). -上記のプロトタイプは Single UNIX Specification に従っている。 -glibc2 も同様である。 -.I flags -引き数は 4.x BSD では \fIint\fP であり、 -libc4 と libc5 では \fIunsigned int\fP である。 -.I len -引き数は 4.x BSD と libc4 では \fIint\fP であり、 -libc5 では \fIsize_t\fP である。 -.I addrlen -引き数は 4.x BSD と libc4 と libc5 では \fIint\fP である。 -.BR accept (2) -も参照すること。 +上記のプロトタイプは Single UNIX Specification に従っている。 glibc2 も同様である。 \fIflags\fP 引き数は +4.x BSD では \fIint\fP であり、 libc4 と libc5 では \fIunsigned int\fP である。 \fIlen\fP 引き数は 4.x +BSD と libc4 では \fIint\fP であり、 libc5 では \fIsize_t\fP である。 \fIaddrlen\fP 引き数は 4.x BSD と +libc4 と libc5 では \fIint\fP である。 \fBaccept\fP(2) も参照すること。 -.\"O According to POSIX.1-2001, the -.\"O .I msg_controllen -.\"O field of the -.\"O .I msghdr -.\"O structure should be typed as -.\"O .IR socklen_t , -.\"O but glibc currently types it as -.\"O .IR size_t . -POSIX.1-2001 では、構造体 -.I msghdr -のフィールド -.I msg_controllen -は -.I socklen_t -型であるべきだとされているが、 -現在の glibc では -.I size_t -型である。 .\" glibc bug raised 12 Mar 2006 .\" http://sourceware.org/bugzilla/show_bug.cgi?id=2448 .\" The problem is an underlying kernel issue: the size of the .\" __kernel_size_t type used to type this field varies .\" across architectures, but socklen_t is always 32 bits. -.\"O .SH BUGS +POSIX.1\-2001 では、構造体 \fImsghdr\fP のフィールド \fImsg_controllen\fP は \fIsocklen_t\fP +型であるべきだとされているが、 現在の glibc では \fIsize_t\fP 型である。 + +\fBsendmmsg\fP(2) には、一度の呼び出しでの複数のデータグラムの送信に使用できる +Linux 固有の システムコールに関する情報が書かれている。 .SH バグ -.\"O Linux may return -.\"O .B EPIPE -.\"O instead of -.\"O .BR ENOTCONN . -Linux は -.B ENOTCONN -を返す状況で -.B EPIPE -を返すことがある。 -.\"O .SH EXAMPLE +Linux は \fBENOTCONN\fP を返す状況で \fBEPIPE\fP を返すことがある。 .SH 例 -.\"O An example of the use of -.\"O .BR sendto () -.\"O is shown in -.\"O .BR getaddrinfo (3). -.BR sendto () -の利用例が -.BR getaddrinfo (3) -に記載されている。 -.\"O .SH "SEE ALSO" +\fBsendto\fP() の利用例が \fBgetaddrinfo\fP(3) に記載されている。 .SH 関連項目 -.BR fcntl (2), -.BR getsockopt (2), -.BR recv (2), -.BR select (2), -.BR sendfile (2), -.BR shutdown (2), -.BR socket (2), -.BR write (2), -.BR cmsg (3), -.BR ip (7), -.BR socket (7), -.BR tcp (7), -.BR udp (7) +\fBfcntl\fP(2), \fBgetsockopt\fP(2), \fBrecv\fP(2), \fBselect\fP(2), \fBsendfile\fP(2), +\fBsendmmsg\fP(2), \fBshutdown\fP(2), \fBsocket\fP(2), \fBwrite\fP(2), \fBcmsg\fP(3), +\fBip\fP(7), \fBsocket\fP(7), \fBtcp\fP(7), \fBudp\fP(7) diff --git a/draft/man2/set_thread_area.2 b/draft/man2/set_thread_area.2 index 2f29a7fb..afea398e 100644 --- a/draft/man2/set_thread_area.2 +++ b/draft/man2/set_thread_area.2 @@ -2,119 +2,48 @@ .\" This file is distributed according to the GNU General Public License. .\" See the file COPYING in the top level source directory for details. .\" -.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2003-07-08, Akihiro MOTOKI -.\" Updated 2005-02-24, Akihiro MOTOKI +.\" Author: Kent Yoder .\" -.\"O .\" Author: Kent Yoder -.\"O .\" -.TH SET_THREAD_AREA 2 2008-11-27 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O set_thread_area \- Set a Thread Local Storage (TLS) area +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH SET_THREAD_AREA 2 2008\-11\-27 Linux "Linux Programmer's Manual" .SH 名前 set_thread_area \- スレッド局所記憶 (TLS) 領域を設定する -.\"O .SH "SYNOPSIS" .SH 書式 -.B #include +\fB#include \fP .br -.B #include +\fB#include \fP .sp -.BI "int set_thread_area(struct user_desc *" u_info ); -.\"O .SH "DESCRIPTION" +\fBint set_thread_area(struct user_desc *\fP\fIu_info\fP\fB);\fP .SH 説明 +\fBset_thread_area\fP() は、カレント・スレッドのスレッド局所記憶 (Thread Local Storage; TLS) +配列の中のエントリを設定する。 \fBset_thread_area\fP() により設定される TLS 配列のエントリは、ユーザから引き数として渡される +\fIu_info\->entry_number\fP の値に対応している。値が範囲内にある場合、 \fBset_thread_area\fP() は +\fIu_info\fP で指された TLS ディスクリプタをスレッドの TLS 配列にコピーする。 .PP -.\"O .BR set_thread_area () -.\"O sets an entry in the current thread's Thread Local Storage (TLS) array. -.\"O The TLS array entry set by -.\"O .BR set_thread_area () -.\"O corresponds to the value of -.\"O .I u_info\->entry_number -.\"O passed in by the user. -.\"O If this value is in bounds, -.\"O .BR set_thread_area () -.\"O copies the TLS descriptor pointed to by -.\"O .I u_info -.\"O into the thread's TLS array. -.BR set_thread_area () -は、カレント・スレッドのスレッド局所記憶 (Thread Local Storage; TLS) -配列の中のエントリを設定する。 -.BR set_thread_area () -により設定される TLS 配列のエントリは、ユーザから引き数として渡される -.I u_info\->entry_number -の値に対応している。値が範囲内にある場合、 -.BR set_thread_area () -は -.I u_info -で指された TLS ディスクリプタをスレッドの TLS 配列にコピーする。 -.PP -.\"O When -.\"O .BR set_thread_area () -.\"O is passed an -.\"O entry_number -.\"O \-1, it uses a free TLS entry. -.\"O If -.\"O .BR set_thread_area () -.\"O finds a free TLS entry, the value of -.\"O .I u_info\->entry_number -.\"O is set upon return to show which entry was changed. -.I entry_number -として \-1 が渡された場合、 -.BR set_thread_area () -は未使用 (free) の TLS エントリを使用する。 -未使用の TLS エントリがあった場合、どのエントリが変更されたかが分かる -ように終了時に -.I u_info\->entry_number -の値が変更される。 -.\"O .SH "RETURN VALUE" +\fIentry_number\fP として \-1 が渡された場合、 \fBset_thread_area\fP() は未使用 (free) の TLS +エントリを使用する。 未使用の TLS エントリがあった場合、どのエントリが変更されたかが分かる ように終了時に +\fIu_info\->entry_number\fP の値が変更される。 .SH 返り値 -.\"O .BR set_thread_area () -.\"O returns 0 on success, and \-1 on failure, with -.\"O .I errno -.\"O set appropriately. -.BR set_thread_area () -は成功した場合 0 を返す。失敗した場合は \-1 を返し、 -.I errno -を適切に設定する。 -.\"O .SH "ERRORS" +\fBset_thread_area\fP() は成功した場合 0 を返す。失敗した場合は \-1 を返し、 \fIerrno\fP を適切に設定する。 .SH エラー -.TP -.B EINVAL -.\"O \fIu_info\->entry_number\fP is out of bounds. -.I u_info\->entry_number -が範囲外である。 -.TP -.B EFAULT -.\"O \fIu_info\fP is an invalid pointer. -.I u_info -が不正なポインタである。 -.TP -.B ESRCH -.\"O A free TLS entry could not be located. +.TP +\fBEINVAL\fP +\fIu_info\->entry_number\fP が範囲外である。 +.TP +\fBEFAULT\fP +\fIu_info\fP が不正なポインタである。 +.TP +\fBESRCH\fP 未使用の TLS エントリが見つからなかった。 -.\"O .SH "VERSIONS" .SH バージョン -.\"O A version of -.\"O .BR set_thread_area () -.\"O first appeared in Linux 2.5.29. -.BR set_thread_area () -は Linux 2.5.29 で初めて登場した。 -.\"O .SH "CONFORMING TO" +\fBset_thread_area\fP() は Linux 2.5.29 で初めて登場した。 .SH 準拠 -.\"O .BR set_thread_area () -.\"O is Linux-specific and should not be used in programs that are intended -.\"O to be portable. -.BR set_thread_area () -は Linux 独自であり、移植を意図したプログラムでは使用すべきではない。 -.\"O .SH NOTES +\fBset_thread_area\fP() は Linux 独自であり、移植を意図したプログラムでは使用すべきではない。 .SH 注意 -.\"O Glibc does not provide a wrapper for this system call; -.\"O call it using -.\"O .BR syscall (2). -glibc はこのシステムコールに対するラッパー関数を提供していない。 -この関数を使用するには -.BR syscall (2) -を使用すること。 -.\"O .SH "SEE ALSO" +glibc はこのシステムコールに対するラッパー関数を提供していない。 このシステムコールは呼び出すには \fBsyscall\fP(2) を使うこと。 .SH 関連項目 -.BR get_thread_area (2) +\fBget_thread_area\fP(2) diff --git a/draft/man2/setns.2 b/draft/man2/setns.2 new file mode 100644 index 00000000..d0ee1367 --- /dev/null +++ b/draft/man2/setns.2 @@ -0,0 +1,82 @@ +.\" Copyright (C) 2011, Eric Biederman +.\" Licensed under the GPLv2 +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH SETNS 2 2011\-10\-04 Linux "Linux Programmer's Manual" +.SH 名前 +setns \- reassociate thread with a namespace +.SH 書式 +.nf +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP +.sp +\fBint setns(int \fP\fIfd\fP\fB, int \fP\fInstype\fP\fB);\fP +.fi +.SH 説明 +Given a file descriptor referring to a namespace, reassociate the calling +thread with that namespace. + +The \fIfd\fP argument is a file descriptor referring to one of the namespace +entries in a \fI/proc/[pid]/ns/\fP directory; see \fBproc\fP(5) for further +information on \fI/proc/[pid]/ns/\fP. The calling thread will be reassociated +with the corresponding namespace, subject to any constraints imposed by the +\fInstype\fP argument. + +The \fInstype\fP argument specifies which type of namespace the calling thread +may be reassociated with. This argument can have one of the following +values: +.TP +\fB0\fP +Allow any type of namespace to be joined. +.TP +\fBCLONE_NEWIPC\fP +\fIfd\fP must refer to an IPC namespace. +.TP +\fBCLONE_NEWNET\fP +\fIfd\fP must refer to a network namespace. +.TP +\fBCLONE_NEWUTS\fP +\fIfd\fP must refer to a UTS namespace. +.PP +Specifying \fInstype\fP as 0 suffices if the caller knows (or does not care) +what type of namespace is referred to by \fIfd\fP. Specifying a nonzero value +for \fInstype\fP is useful if the caller does not know what type of namespace +is referred to by \fIfd\fP and wants to ensure that the namespace is of a +particular type. (The caller might not know the type of the namespace +referred to by \fIfd\fP if the file descriptor was opened by another process +and, for example, passed to the caller via a UNIX domain socket.) +.SH 返り値 +On success, \fIsetns\fP() returns 0. On failure, \-1 is returned and \fIerrno\fP +is set to indicate the error. +.SH エラー +.TP +\fBEBADF\fP +\fIfd\fP is not a valid file descriptor. +.TP +\fBEINVAL\fP +\fIfd\fP refers to a namespace whose type does not match that specified in +\fInstype\fP, or there is problem with reassociating the the thread with the +specified namespace. +.TP +\fBENOMEM\fP +Cannot allocate sufficient memory to change the specified namespace. +.TP +\fBEPERM\fP +The calling thread did not have the required privilege (\fBCAP_SYS_ADMIN\fP) +for this operation. +.SH バージョン +The \fBsetns\fP() system call first appeared in Linux in kernel 3.0 +.SH 準拠 +The \fBsetns\fP() system call is Linux\-specific. +.SH 注意 +Not all of the attributes that can be shared when a new thread is created +using \fBclone\fP(2) can be changed using \fBsetns\fP(). +.SH バグ +The PID namespace and the mount namespace are not currently supported. (See +the descriptions of \fBCLONE_NEWPID\fP and \fBCLONE_NEWNS\fP in \fBclone\fP(2).) +.SH 関連項目 +\fBclone\fP(2), \fBfork\fP(2), \fBvfork\fP(2), \fBproc\fP(5), \fBunix\fP(7) diff --git a/draft/man2/setup.2 b/draft/man2/setup.2 index 8bb3f54a..10e0060d 100644 --- a/draft/man2/setup.2 +++ b/draft/man2/setup.2 @@ -31,92 +31,34 @@ .\" Modified Wed Nov 6 04:05:28 1996 by Eric S. Raymond .\" Modified Sat Jan 29 01:08:23 2000 by aeb .\" -.\" Japanese Version Copyright (c) 1997 Daisuke Sato -.\" all rights reserved. -.\" Translated Sat Apr 19 15:22:53 JST 1997 -.\" by Daisuke Sato -.\" Updated & Modified Mon Mar 1 1999 -.\" by NAKANO Takeo -.\" Updated Thu Mar 16 09:32:28 2000 -.\" by Kentaro Shirakata +.\"******************************************************************* .\" -.\"WORD: file systems ファイルシステム -.\"WORD: root file system ルートファイルシステム -.\"WORD: superuser スーパーユーザー -.\"WORD: user process ユーザープロセス +.\" This file was generated with po4a. Translate the source file. .\" -.TH SETUP 2 2008-12-03 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH SETUP 2 2008\-12\-03 Linux "Linux Programmer's Manual" .SH 名前 -.\"O setup \- setup devices and file systems, mount root file system -setup \- デバイスとファイルシステムの初期化を行い、 -ルートファイルシステムのマウントを行う -.\"O .SH SYNOPSIS +setup \- デバイスとファイルシステムの初期化を行い、 ルートファイルシステムのマウントを行う .SH 書式 -.B #include +\fB#include \fP .sp -.B int setup(void); -.\"O .SH DESCRIPTION +\fBint setup(void);\fP .SH 説明 -.\"O .BR setup () -.\"O is called once from within -.\"O .IR linux/init/main.c . -.\"O It calls initialization functions for devices and file systems -.\"O configured into the kernel and then mounts the root file system. -.BR setup () -は -.I linux/init/main.c -の中で一度だけ呼ばれる。 -カーネル内部のデバイスとファイルシステムの初期化関数を呼び、 -ルートファイルシステムのマウントを行う。 +\fBsetup\fP() は \fIlinux/init/main.c\fP の中で一度だけ呼ばれる。 +カーネル内部のデバイスとファイルシステムの初期化関数を呼び、 ルートファイルシステムのマウントを行う。 .PP -.\"O No user process may call -.\"O .BR setup (). -.\"O Any user process, even a process with superuser permission, -.\"O will receive -.\"O .BR EPERM . -ユーザープロセスからは -.BR setup () -を呼びだすことはできない。 -ユーザープロセスからのアクセスは、たとえそのプロセスが -スーパーユーザー権限を持っていても -.B EPERM -を受け取ることになる。 -.\"O .SH "RETURN VALUE" +ユーザープロセスからは \fBsetup\fP() を呼びだすことはできない。 ユーザープロセスからのアクセスは、たとえそのプロセスが +スーパーユーザー権限を持っていても \fBEPERM\fP を受け取ることになる。 .SH 返り値 -.\"O .BR setup () -.\"O always returns \-1 for a user process. -.BR setup () -はユーザープロセスに対して常に \-1 を返す。 -.\"O .SH ERRORS +\fBsetup\fP() はユーザープロセスに対して常に \-1 を返す。 .SH エラー -.TP -.B EPERM -.\"O Always, for a user process. +.TP +\fBEPERM\fP ユーザプロセスに対しては、常にこのエラーとなる。 -.\"O .SH VERSIONS .SH バージョン -.\"O Since Linux 2.1.121, no such function exists anymore. Linux 2.1.121 以降では、もはやこの関数は存在しない。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O This function is Linux-specific, and should not be used in programs -.\"O intended to be portable, or indeed in any programs at all. -この関数は Linux に特有のものであり、移植を考慮したプログラムでは -用いるべきではない。それどころか、あらゆるプログラムで用いるべきではない。 -.\"O .SH NOTES +この関数は Linux に特有のものであり、移植を考慮したプログラムでは 用いるべきではない。それどころか、あらゆるプログラムで用いるべきではない。 .SH 注意 -.\"O The calling sequence varied: at some times -.\"O .I setup () -.\"O has had a single argument -.\"O .I "void *BIOS" -.\"O and at other times a single argument -.\"O .IR "int magic" . -呼び出し手続きは変化してきた。 -ある時は -.I setup () -は一つの引数 -.I "void *BIOS" -を取っており、またある時には -.IR "int magic" -を一つの引数として取っていた。 +呼び出し手続きは変化してきた。 ある時は \fIsetup ()\fP は一つの引数 \fIvoid *BIOS\fP を取っており、またある時には \fIint +magic\fP を一つの引数として取っていた。 diff --git a/draft/man2/shmctl.2 b/draft/man2/shmctl.2 index 5e0ff3c1..64f3b808 100644 --- a/draft/man2/shmctl.2 +++ b/draft/man2/shmctl.2 @@ -40,110 +40,50 @@ .\" attaches to a segment that has already been marked for deletion. .\" 2005-08-02, mtk: Added IPC_INFO, SHM_INFO, SHM_STAT descriptions. .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1997-03-01, HANATAKA Shinya -.\" Updated & Modified 2001-06-13, Yuichi SATO -.\" Updated & Modified 2005-01-05, Yuichi SATO -.\" Updated & Modified 2005-09-06, Akihiro MOTOKI -.\" Updated & Modified 2005-10-08, Akihiro MOTOKI -.\" Updated 2006-07-21, Akihiro MOTOKI, LDP v2.36 +.\"******************************************************************* .\" -.\"WORD: shared memory 共有メモリ -.\"WORD: segment セグメント -.\"WORD: owner 所有者 -.\"WORD: group グループ -.\"WORD: creator 作成者 -.\"WORD: super-user スーパー・ユーザー -.\"WORD: detach 分離 -.\"WORD: attach 付加 -.\"WORD: swap スワップ -.\"WORD: identifier 識別子 -.\"WORD: member メンバー -.\"WORD: feature test macro 機能検査マクロ +.\" This file was generated with po4a. Translate the source file. .\" -.TH SHMCTL 2 2008-08-07 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH SHMCTL 2 2008\-08\-07 Linux "Linux Programmer's Manual" .SH 名前 -.\"O shmctl \- shared memory control shmctl \- 共有メモリ (shared memory) を制御する -.\"O .SH SYNOPSIS .SH 書式 .ad l -.B #include +\fB#include \fP .br -.B #include +\fB#include \fP .sp -.BI "int shmctl(int " shmid ", int " cmd ", struct shmid_ds *" buf ); +\fBint shmctl(int \fP\fIshmid\fP\fB, int \fP\fIcmd\fP\fB, struct shmid_ds *\fP\fIbuf\fP\fB);\fP .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR shmctl () -.\"O performs the control operation specified by -.\"O .I cmd -.\"O on the shared memory segment whose identifier is given in -.\"O .IR shmid . -.BR shmctl () -は、識別子が -.I shmid -の共有メモリ・セグメントに対して -.I cmd -で指示した制御命令を実行する。 +\fBshmctl\fP() は、識別子が \fIshmid\fP の共有メモリ・セグメントに対して \fIcmd\fP で指示した制御命令を実行する。 .PP -.\"O The -.\"O .I buf -.\"O argument is a pointer to a \fIshmid_ds\fP structure, -.\"O defined in \fI\fP as follows: -.I buf -引き数は、 \fIshmid_ds\fP 構造体へのポインタである。 -この構造体は \fI\fP で以下のように定義されている +\fIbuf\fP 引き数は、 \fIshmid_ds\fP 構造体へのポインタである。 この構造体は \fI\fP +で以下のように定義されている .PP .in +4n .nf struct shmid_ds { -.\"O struct ipc_perm shm_perm; /* Ownership and permissions */ struct ipc_perm shm_perm; /* 所有権と許可 */ -.\"O size_t shm_segsz; /* Size of segment (bytes) */ size_t shm_segsz; /* セグメントのサイズ (バイト) */ -.\"O time_t shm_atime; /* Last attach time */ time_t shm_atime; /* 最後の付加 (attach) の時刻 */ -.\"O time_t shm_dtime; /* Last detach time */ time_t shm_dtime; /* 最後の分離 (detach) の時刻 */ -.\"O time_t shm_ctime; /* Last change time */ time_t shm_ctime; /* 最後に変更が行われた時刻 */ -.\"O pid_t shm_cpid; /* PID of creator */ pid_t shm_cpid; /* 作成者 (creator) の PID */ -.\"O pid_t shm_lpid; /* PID of last shmat(2)/shmdt(2) */ pid_t shm_lpid; /* 最後の shmat(2)/shmdt(2) の PID */ -.\"O shmatt_t shm_nattch; /* No. of current attaches */ shmatt_t shm_nattch; /* 現在付加されている数 */ ... }; .fi .in .PP -.\"O The -.\"O .I ipc_perm -.\"O structure is defined in \fI\fP as follows -.\"O (the highlighted fields are settable using -.\"O .BR IPC_SET ): -.I ipc_perm -構造体は \fI\fP で以下のように定義されている -(強調されたフィールドは -.B IPC_SET -を使って設定可能である): +\fIipc_perm\fP 構造体は \fI\fP で以下のように定義されている (強調されたフィールドは +\fBIPC_SET\fP を使って設定可能である): .PP .in +4n .nf struct ipc_perm { -.\"O key_t __key; /* Key supplied to shmget(2) */ -.\"O uid_t \fBuid\fP; /* Effective UID of owner */ -.\"O gid_t \fBgid\fP; /* Effective GID of owner */ -.\"O uid_t cuid; /* Effective UID of creator */ -.\"O gid_t cgid; /* Effective GID of creator */ -.\"O unsigned short \fBmode\fP; /* \fBPermissions\fP + SHM_DEST and -.\"O SHM_LOCKED flags */ -.\"O unsigned short __seq; /* Sequence number */ key_t __key; /* shmget(2) に与えられるキー */ uid_t \fBuid\fP; /* 所有者の実効 UID */ gid_t \fBgid\fP; /* 所有者の実効 GID */ @@ -156,215 +96,66 @@ struct ipc_perm { .fi .in .PP -.\"O Valid values for -.\"O .I cmd -.\"O are: -.I cmd -として有効な値は以下の通り: +\fIcmd\fP として有効な値は以下の通り: .br -.TP 10 -.B IPC_STAT -.\"O Copy information from the kernel data structure associated with -.\"O .I shmid -.\"O into the -.\"O .I shmid_ds -.\"O structure pointed to by \fIbuf\fP. -.I shmid -に関連づけられたカーネルデータ構造体の情報を -\fIbuf\fP で指された -.I shmid_ds -構造体にコピーする。 -.\"O The caller must have read permission on the -.\"O shared memory segment. -呼び出し元は共有メモリ・セグメントに対する -読み込み許可を持たなければならない。 -.TP -.B IPC_SET -.\"O Write the values of some members of the -.\"O .I shmid_ds -.\"O structure pointed to by -.\"O .I buf -.\"O to the kernel data structure associated with this shared memory segment, -.\"O updating also its -.\"O .I shm_ctime -.\"O member. -.I buf -によって指される -.I shmid_ds -構造体のいくつかのメンバーの値を、 -この共有メモリ・セグメントに関連づけられたカーネルデータ構造体に書き込み、 -.I shm_ctime -メンバーも更新する。 -.\"O The following fields can be changed: -.\"O \fIshm_perm.uid\fP, \fIshm_perm.gid\fP, -.\"O and (the least significant 9 bits of) \fIshm_perm.mode\fP. -以下のフィールドは変更できる。 -\fIshm_perm.uid\fP, \fIshm_perm.gid\fP, -\fIshm_perm.mode\fP (の最下位 9 ビット)。 -.\"O The effective UID of the calling process must match the owner -.\"O .RI ( shm_perm.uid ) -.\"O or creator -.\"O .RI ( shm_perm.cuid ) -.\"O of the shared memory segment, or the caller must be privileged. -呼び出したプロセスの実効 UID が所有者 -.RI ( shm_perm.uid ) -または作成者 -.RI ( shm_perm.cuid ) +.TP 10 +\fBIPC_STAT\fP +\fIshmid\fP に関連づけられたカーネルデータ構造体の情報を \fIbuf\fP で指された \fIshmid_ds\fP 構造体にコピーする。 +呼び出し元は共有メモリ・セグメントに対する 読み込み許可を持たなければならない。 +.TP +\fBIPC_SET\fP +\fIbuf\fP によって指される \fIshmid_ds\fP 構造体のいくつかのメンバーの値を、 +この共有メモリ・セグメントに関連づけられたカーネルデータ構造体に書き込み、 \fIshm_ctime\fP メンバーも更新する。 +以下のフィールドは変更できる。 \fIshm_perm.uid\fP, \fIshm_perm.gid\fP, \fIshm_perm.mode\fP (の最下位 9 +ビット)。 呼び出したプロセスの実効 UID が所有者 (\fIshm_perm.uid\fP) または作成者 (\fIshm_perm.cuid\fP) と一致するか、呼び出し元が特権を持たなければならない。 -.TP -.B IPC_RMID -.\"O Mark the segment to be destroyed. -.\"O The segment will only actually be destroyed -.\"O after the last process detaches it (i.e., when the -.\"O .I shm_nattch -.\"O member of the associated structure -.\"O .I shmid_ds -.\"O is zero). -セグメントに破棄済みのマークを付ける。 -セグメントは、実際には最後プロセスがセグメントを分離した (関連する -.I shmid_ds -構造体の -.I shm_nattch -メンバーが 0 になった) 後でのみ破棄される。 -.\"O The caller must be the owner or creator, or be privileged. -呼び出し元は所有者か作成者であるか、特権を持たなければならない。 -.\"O If a segment has been marked for destruction, then the (nonstandard) -.\"O .B SHM_DEST -.\"O flag of the -.\"O .I shm_perm.mode -.\"O field in the associated data structure retrieved by -.\"O .B IPC_STAT -.\"O will be set. -セグメントに破棄のマークが付けられると、 -関連するデータ構造体において -.I shm_perm.mode -フィールドの (標準ではない) -.B SHM_DEST -フラグが設定される。 -このデータ構造体は -.B IPC_STAT -で取得される。 +.TP +\fBIPC_RMID\fP +セグメントに破棄済みのマークを付ける。 セグメントは、実際には最後プロセスがセグメントを分離した (関連する \fIshmid_ds\fP 構造体の +\fIshm_nattch\fP メンバーが 0 になった) 後でのみ破棄される。 呼び出し元は所有者か作成者であるか、特権を持たなければならない。 +セグメントに破棄のマークが付けられると、 関連するデータ構造体において \fIshm_perm.mode\fP フィールドの (標準ではない) +\fBSHM_DEST\fP フラグが設定される。 このデータ構造体は \fBIPC_STAT\fP で取得される。 .PP -.\"O The caller \fImust\fP ensure that a segment is eventually destroyed; -.\"O otherwise its pages that were faulted in will remain in memory or swap. -呼び出し元は最終的にはセグメントを忘れずに破棄\fIしなければならない\fP。 -そうでなれば、フォールト (fault) されたページは -メモリかスワップ (swap) に残り続ける。 -.TP 10 -.\"O .BR IPC_INFO " (Linux-specific)" -.BR IPC_INFO " (Linux 固有)" -.\"O Returns information about system-wide shared memory limits and -.\"O parameters in the structure pointed to by -.\"O .IR buf . -システム全体での共有メモリの制限とパラメータに関する情報を、 -.I buf -が指す構造体に入れて返す。 -.\"O This structure is of type -.\"O .I shminfo -.\"O (thus, a cast is required), -.\"O defined in -.\"O .I -.\"O if the -.\"O .B _GNU_SOURCE -.\"O feature test macro is defined: -この構造体は -.I shminfo -型である (そのためキャストが必要である)。 -.I shminfo -は -.B _GNU_SOURCE -機能検査マクロが定義された場合に -.I -で以下のように定義される: +呼び出し元は最終的にはセグメントを忘れずに破棄\fIしなければならない\fP。 そうでなれば、フォールト (fault) されたページは メモリかスワップ +(swap) に残り続ける。 +.TP 10 +\fBIPC_INFO\fP (Linux 固有) +システム全体での共有メモリの制限とパラメータに関する情報を、 \fIbuf\fP が指す構造体に入れて返す。 この構造体は \fIshminfo\fP 型である +(そのためキャストが必要である)。 \fIshminfo\fP は \fB_GNU_SOURCE\fP 機能検査マクロが定義された場合に +\fI\fP で以下のように定義される: .nf .in +4n struct shminfo { -.\"O unsigned long shmmax; /* Maximum segment size */ unsigned long shmmax; /* 最大セグメントサイズ */ -.\"O unsigned long shmmin; /* Minimum segment size; -.\"O always 1 */ unsigned long shmmin; /* 最小セグメントサイズ。 常に 1 */ -.\"O unsigned long shmmni; /* Maximum number of segments */ unsigned long shmmni; /* 最大セグメント数 */ -.\"O unsigned long shmseg; /* Maximum number of segments -.\"O that a process can attach; -.\"O unused within kernel */ unsigned long shmseg; /* プロセスが付加できる セグメントの最大数。 カーネル内では未使用 */ -.\"O unsigned long shmall; /* Maximum number of pages of -.\"O shared memory, system-wide */ unsigned long shmall; /* 共有メモリの最大ページ数。 システム全体での値 */ }; .in .fi -.\"O The -.\"O .IR shmmni , -.\"O .IR shmmax , -.\"O and -.\"O .I shmall -.\"O settings can be changed via -.\"O .I /proc -.\"O files of the same name; see -.\"O .BR proc (5) -.\"O for details. -設定 -.IR shmmni , -.IR shmmax , -.I shmall -は -.I /proc -にある同じ名前のファイル経由で変更可能である。 -詳しくは -.BR proc (5) -を参照。 -.TP -.\"O .BR SHM_INFO " (Linux-specific)" -.BR SHM_INFO " (Linux 固有)" -.\"O Returns a -.\"O .I shm_info -.\"O structure whose fields contain information -.\"O about system resources consumed by shared memory. -共有メモリが消費しているシステム資源に関する情報を -格納した -.I shm_info -構造体を返す。 -.\"O This structure is defined in -.\"O .I -.\"O if the -.\"O .B _GNU_SOURCE -.\"O feature test macro is defined: -この構造体は、 -.B _GNU_SOURCE -機能検査マクロが定義された場合に -.I -で以下のように定義される: +設定 \fIshmmni\fP, \fIshmmax\fP, \fIshmall\fP は \fI/proc\fP にある同じ名前のファイル経由で変更可能である。 詳しくは +\fBproc\fP(5) を参照。 +.TP +\fBSHM_INFO\fP (Linux 固有) +共有メモリが消費しているシステム資源に関する情報を 格納した \fIshm_info\fP 構造体を返す。 この構造体は、 \fB_GNU_SOURCE\fP +機能検査マクロが定義された場合に \fI\fP で以下のように定義される: .nf .in +4n struct shm_info { -.\"O int used_ids; /* # of currently existing -.\"O segments */ int used_ids; /* 現在存在するセグメント数 */ -.\"O unsigned long shm_tot; /* Total number of shared -.\"O memory pages */ unsigned long shm_tot; /* 共有メモリのページ総数 */ -.\"O unsigned long shm_rss; /* # of resident shared -.\"O memory pages */ unsigned long shm_rss; /* メモリ上にある (スワップされて いない) 共有メモリページ数 */ -.\"O unsigned long shm_swp; /* # of swapped shared -.\"O memory pages */ unsigned long shm_swp; /* スワップされている共有メモリ ページ数 */ -.\"O unsigned long swap_attempts; -.\"O /* Unused since Linux 2.4 */ -.\"O unsigned long swap_successes; -.\"O /* Unused since Linux 2.4 */ unsigned long swap_attempts; /* Linux 2.4 以降では未使用 */ unsigned long swap_successes; @@ -372,343 +163,88 @@ struct shm_info { }; .in .fi -.TP -.\"O .BR SHM_STAT " (Linux-specific)" -.BR SHM_STAT " (Linux 固有)" -.\"O Returns a -.\"O .I shmid_ds -.\"O structure as for -.\"O .BR IPC_STAT . -.B IPC_STAT -と同じく -.I shmid_ds -構造体を返す。 -.\"O However, the -.\"O .I shmid -.\"O argument is not a segment identifier, but instead an index into -.\"O the kernel's internal array that maintains information about -.\"O all shared memory segments on the system. -但し、 -.I shmid -引き数は、セグメント識別子ではなく、システム上の全ての共有メモリ -セグメントに関する情報を管理するカーネルの内部配列へのインデックス -である。 +.TP +\fBSHM_STAT\fP (Linux 固有) +\fBIPC_STAT\fP と同じく \fIshmid_ds\fP 構造体を返す。 但し、 \fIshmid\fP +引き数は、セグメント識別子ではなく、システム上の全ての共有メモリ セグメントに関する情報を管理するカーネルの内部配列へのインデックス である。 .PP -.\"O The caller can prevent or allow swapping of a shared -.\"O memory segment with the following \fIcmd\fP values: -呼び出し元は、\fIcmd\fP に以下の値を指定することで、共有メモリ・セグメントが -スワップされることを防止したり、許可したりできる: +呼び出し元は、\fIcmd\fP に以下の値を指定することで、共有メモリ・セグメントが スワップされることを防止したり、許可したりできる: .br -.TP 10 -.\"O .BR SHM_LOCK " (Linux-specific)" -.BR SHM_LOCK " (Linux 固有)" -.\"O Prevent swapping of the shared memory segment. -.\"O The caller must fault in -.\"O any pages that are required to be present after locking is enabled. -共有メモリ・セグメントをスワップすることを防止する。 -ロックが有効になった後、呼び出し元は、 -存在することが要求された全てのページをフォールトさせなければならない。 -.\"O If a segment has been locked, then the (nonstandard) -.\"O .B SHM_LOCKED -.\"O flag of the -.\"O .I shm_perm.mode -.\"O field in the associated data structure retrieved by -.\"O .B IPC_STAT -.\"O will be set. -セグメントがロックされると、 -関連するデータ構造体において -.I shm_perm.mode -フィールドの (標準的ではない) -.B SHM_LOCKED -フラグが設定される。 -このデータ構造体は -.B IPC_STAT -で取得される。 -.TP -.\"O .BR SHM_UNLOCK " (Linux-specific)" -.BR SHM_UNLOCK " (Linux 固有)" -.\"O Unlock the segment, allowing it to be swapped out. +.TP 10 +\fBSHM_LOCK\fP (Linux 固有) +共有メモリ・セグメントをスワップすることを防止する。 ロックが有効になった後、呼び出し元は、 +存在することが要求された全てのページをフォールトさせなければならない。 セグメントがロックされると、 関連するデータ構造体において +\fIshm_perm.mode\fP フィールドの (標準的ではない) \fBSHM_LOCKED\fP フラグが設定される。 このデータ構造体は +\fBIPC_STAT\fP で取得される。 +.TP +\fBSHM_UNLOCK\fP (Linux 固有) セグメントのロックを解除し、スワップ・アウトすることを可能にする。 .PP -.\"O In kernels before 2.6.10, only a privileged process -.\"O could employ -.\"O .B SHM_LOCK -.\"O and -.\"O .BR SHM_UNLOCK . -2.6.10 より前のカーネルでは、特権プロセスだけが -.B SHM_LOCK -と -.B SHM_UNLOCK -を利用することができた。 -.\"O Since kernel 2.6.10, an unprivileged process can employ these operations -.\"O if its effective UID matches the owner or creator UID of the segment, and -.\"O (for -.\"O .BR SHM_LOCK ) -.\"O the amount of memory to be locked falls within the -.\"O .B RLIMIT_MEMLOCK -.\"O resource limit (see -.\"O .BR setrlimit (2)). -2.6.10 以降のカーネルでは、非特権プロセスであっても次の条件を満たせば -これらの操作を利用することができる。その条件とは、プロセスの実効 UID -がそのセグメントの所有者もしくは作成者の UID と一致し、 -.RB ( SHM_LOCK -の場合には) ロックするメモリの合計が -.B RLIMIT_MEMLOCK -リソース上限 -.RB ( setrlimit (2) -参照) の範囲内に入っていることである。 .\" There was some weirdness in 2.6.9: SHM_LOCK and SHM_UNLOCK could .\" be applied to a segment, regardless of ownership of the segment. .\" This was a botch-up in the move to RLIMIT_MEMLOCK, and was fixed .\" in 2.6.10. MTK, May 2005 -.\"O .SH "RETURN VALUE" +2.6.10 より前のカーネルでは、特権プロセスだけが \fBSHM_LOCK\fP と \fBSHM_UNLOCK\fP を利用することができた。 2.6.10 +以降のカーネルでは、非特権プロセスであっても次の条件を満たせば これらの操作を利用することができる。その条件とは、プロセスの実効 UID +がそのセグメントの所有者もしくは作成者の UID と一致し、 (\fBSHM_LOCK\fP の場合には) ロックするメモリの合計が +\fBRLIMIT_MEMLOCK\fP リソース上限 (\fBsetrlimit\fP(2) 参照) の範囲内に入っていることである。 .SH 返り値 -.\"O A successful -.\"O .B IPC_INFO -.\"O or -.\"O .B SHM_INFO -.\"O operation returns the index of the highest used entry in the -.\"O kernel's internal array recording information about all -.\"O shared memory segments. -.B IPC_INFO -と -.B SHM_INFO -操作は、成功すると、全ての共有メモリセグメントに関する情報を -管理しているカーネルの内部配列の使用中エントリのインデックスの -うち最大値を返す -.\"O (This information can be used with repeated -.\"O .B SHM_STAT -.\"O operations to obtain information about all shared memory segments -.\"O on the system.) -(この情報は、システムの全ての共有メモリセグメントに関する情報を -取得するために、 -.B SHM_STAT -操作を繰り返し実行する際に使用できる)。 -.\"O A successful -.\"O .B SHM_STAT -.\"O operation returns the identifier of the shared memory segment -.\"O whose index was given in -.\"O .IR shmid . -.B SHM_STAT -操作は、成功すると、 -.I shmid -で指定されたインデックスを持つ共有メモリセグメントの識別子を返す。 -.\"O Other operations return 0 on success. -他の操作は、成功の場合 0 を返す。 +\fBIPC_INFO\fP と \fBSHM_INFO\fP 操作は、成功すると、全ての共有メモリセグメントに関する情報を +管理しているカーネルの内部配列の使用中エントリのインデックスの うち最大値を返す (この情報は、システムの全ての共有メモリセグメントに関する情報を +取得するために、 \fBSHM_STAT\fP 操作を繰り返し実行する際に使用できる)。 \fBSHM_STAT\fP 操作は、成功すると、 \fIshmid\fP +で指定されたインデックスを持つ共有メモリセグメントの識別子を返す。 他の操作は、成功の場合 0 を返す。 -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -エラーの場合は \-1 を返し、 -.I errno -を適切に設定する。 -.\"O .SH ERRORS +エラーの場合は \-1 を返し、 \fIerrno\fP を適切に設定する。 .SH エラー -.TP -.B EACCES -.\"O \fBIPC_STAT\fP or \fBSHM_STAT\fP is requested and - -.\"O \fIshm_perm.mode\fP does not allow read access for -.\"O .IR shmid , -.\"O and the calling process does not have the -.\"O .B CAP_IPC_OWNER -.\"O capability. -\fBIPC_STAT\fP または \fBSHM_STAT\fP が要求され、 -\fIshm_perm.mode\fP が -.I shmid -への読み込みアクセスを許しておらず、 -かつ呼び出したプロセスが -.B CAP_IPC_OWNER -ケーパビリティ (capability) を持っていない。 -.TP -.B EFAULT -.\"O The argument -.\"O .I cmd -.\"O has value -.\"O .B IPC_SET -.\"O or -.\"O .B IPC_STAT -.\"O but the address pointed to by -.\"O .I buf -.\"O isn't accessible. -.I cmd -引き数に -.B IPC_SET -か -.B IPC_STAT -が指定されたが -.I buf -で指されているアドレスにアクセスできない。 -.TP -.B EIDRM -.\"O \fIshmid\fP points to a removed identifier. +.TP +\fBEACCES\fP +\fBIPC_STAT\fP または \fBSHM_STAT\fP が要求され、 \fIshm_perm.mode\fP が \fIshmid\fP +への読み込みアクセスを許しておらず、 かつ呼び出したプロセスが \fBCAP_IPC_OWNER\fP ケーパビリティ (capability) +を持っていない。 +.TP +\fBEFAULT\fP +\fIcmd\fP 引き数に \fBIPC_SET\fP か \fBIPC_STAT\fP が指定されたが \fIbuf\fP で指されているアドレスにアクセスできない。 +.TP +\fBEIDRM\fP \fIshmid\fP が削除 (remove) された識別子 (identifier) を指している。 -.TP -.B EINVAL -.\"O \fIshmid\fP is not a valid identifier, or \fIcmd\fP -.\"O is not a valid command. -.\"O Or: for a -.\"O .B SHM_STAT -.\"O operation, the index value specified in -.\"O .I shmid -.\"O referred to an array slot that is currently unused. -\fIshmid\fP が有効な識別子でないか、 -\fIcmd\fP が有効なコマンドでない。 -もしくは、 -.B SHM_STAT -操作の場合に、 -.I shmid +.TP +\fBEINVAL\fP +\fIshmid\fP が有効な識別子でないか、 \fIcmd\fP が有効なコマンドでない。 もしくは、 \fBSHM_STAT\fP 操作の場合に、 \fIshmid\fP で指定されたインデックス値が現在未使用の配列のスロットを参照していた。 -.TP -.B ENOMEM -.\"O (In kernels since 2.6.9), -.\"O .B SHM_LOCK -.\"O was specified and the size of the to-be-locked segment would mean -.\"O that the total bytes in locked shared memory segments would exceed -.\"O the limit for the real user ID of the calling process. -(2.6.9 以降のカーネルにおいて) -.B SHM_LOCK -が指定され、 -ロックされる予定のセグメントのサイズ -(ロックされる共有メモリ・セグメントの合計バイト数) が、 -呼び出したプロセスの実ユーザー ID についての制限を超えた。 -.\"O This limit is defined by the -.\"O .B RLIMIT_MEMLOCK -.\"O soft resource limit (see -.\"O .BR setrlimit (2)). -この制限は -.B RLIMIT_MEMLOCK -ソフト資源制限で定義される -.RB ( setrlimit (2) -を参照)。 -.TP -.B EOVERFLOW -.\"O \fBIPC_STAT\fP is attempted, and the GID or UID value -.\"O is too large to be stored in the structure pointed to by -.\"O .IR buf . -\fBIPC_STAT\fP が試みられ、GID や UID の値が -.I buf -で指示される構造体に格納するには大き過ぎる。 -.TP -.B EPERM -.\"O \fBIPC_SET\fP or \fBIPC_RMID\fP is attempted, and the -.\"O effective user ID of the calling process is not that of the creator -.\"O (found in -.\"O .IR shm_perm.cuid ), -.\"O or the owner -.\"O (found in -.\"O .IR shm_perm.uid ), -.\"O and the process was not privileged (Linux: did not have the -.\"O .B CAP_SYS_ADMIN -.\"O capability). -\fBIPC_SET\fP か \fBIPC_RMID\fP が試みられ、 -呼び出したプロセスの実効ユーザー ID が作成者 -.RI ( shm_perm.cuid ) -でも所有者 -.RI ( shm_perm.uid ) -でもなく、プロセスが特権を持たない (Linux では -.B CAP_SYS_ADMIN +.TP +\fBENOMEM\fP +(2.6.9 以降のカーネルにおいて) \fBSHM_LOCK\fP が指定され、 ロックされる予定のセグメントのサイズ +(ロックされる共有メモリ・セグメントの合計バイト数) が、 呼び出したプロセスの実ユーザー ID についての制限を超えた。 この制限は +\fBRLIMIT_MEMLOCK\fP ソフト資源制限で定義される (\fBsetrlimit\fP(2) を参照)。 +.TP +\fBEOVERFLOW\fP +\fBIPC_STAT\fP が試みられ、GID や UID の値が \fIbuf\fP で指示される構造体に格納するには大き過ぎる。 +.TP +\fBEPERM\fP +\fBIPC_SET\fP か \fBIPC_RMID\fP が試みられ、 呼び出したプロセスの実効ユーザー ID が作成者 (\fIshm_perm.cuid\fP) +でも所有者 (\fIshm_perm.uid\fP) でもなく、プロセスが特権を持たない (Linux では \fBCAP_SYS_ADMIN\fP ケーパビリティを持たない)。 -.\"O Or (in kernels before 2.6.9), -.\"O .B SHM_LOCK -.\"O or -.\"O .B SHM_UNLOCK -.\"O was specified, but the process was not privileged -.\"O (Linux: did not have the -.\"O .B CAP_IPC_LOCK -.\"O capability). -または (2.6.9 より前のカーネルで) -.B SHM_LOCK -または -.B SHM_UNLOCK -が指定されているが、プロセスが特権を持たない -(Linux では -.B CAP_IPC_LOCK -ケーパビリティを持たない)。 -.\"O (Since Linux 2.6.9, this error can also occur if the -.\"O .B RLIMIT_MEMLOCK -.\"O is 0 and the caller is not privileged.) -(Linux 2.6.9 以降では、 -.B RLIMIT_MEMLOCK -が 0 で呼び出し元が特権を持たない場合にも、このエラーが起こる。) -.\"O .SH "CONFORMING TO" +または (2.6.9 より前のカーネルで) \fBSHM_LOCK\fP または \fBSHM_UNLOCK\fP が指定されているが、プロセスが特権を持たない +(Linux では \fBCAP_IPC_LOCK\fP ケーパビリティを持たない)。 (Linux 2.6.9 以降では、 +\fBRLIMIT_MEMLOCK\fP が 0 で呼び出し元が特権を持たない場合にも、このエラーが起こる。) .SH 準拠 -SVr4, POSIX.1-2001. -.\"O .\" SVr4 documents additional error conditions EINVAL, -.\"O .\" ENOENT, ENOSPC, ENOMEM, EEXIST. Neither SVr4 nor SVID documents -.\"O .\" an EIDRM error condition. -.\" SVr4 には他に EINVAL, ENOENT, ENOSPC, ENOMEM, -.\" EEXIST エラーについての記述がある。 -.\" SVr4 および SVID には EIDRM エラーについての記述はない。 -.\"O .SH NOTES +.\" SVr4 documents additional error conditions EINVAL, +.\" ENOENT, ENOSPC, ENOMEM, EEXIST. Neither SVr4 nor SVID documents +.\" an EIDRM error condition. +SVr4, POSIX.1\-2001. .SH 注意 -.\"O The -.\"O .BR IPC_INFO , -.\"O .B SHM_STAT -.\"O and -.\"O .B SHM_INFO -.\"O operations are used by the -.\"O .BR ipcs (1) -.\"O program to provide information on allocated resources. -.\"O In the future these may modified or moved to a /proc file system -.\"O interface. -.BR IPC_INFO , -.BR SHM_STAT , -.B SHM_INFO -操作は、 -.BR ipcs (1) -プログラムで割り当て済の資源に関する情報を提供するために -使用されている。将来、これらの操作は変更されたり、 -/proc ファイルシステムのインタフェースに移動されるかもしれない。 +\fBIPC_INFO\fP, \fBSHM_STAT\fP, \fBSHM_INFO\fP 操作は、 \fBipcs\fP(1) +プログラムで割り当て済の資源に関する情報を提供するために 使用されている。将来、これらの操作は変更されたり、 /proc +ファイルシステムのインタフェースに移動されるかもしれない。 -.\"O Linux permits a process to attach -.\"O .RB ( shmat (2)) -.\"O a shared memory segment that has already been marked for deletion -.\"O using -.\"O .IR shmctl(IPC_RMID) . -.\"O This feature is not available on other UNIX implementations; -.\"O portable applications should avoid relying on it. -Linux では、 -.I shmctl(IPC_RMID) -を使ってすでに削除マークがつけられている共有メモリ・セグメントを -あるプロセスが付加 (attach) -.RB ( shmat (2)) -することを許可している。 -この機能は他の UNIX の実装では利用できない。 +Linux では、 \fIshmctl(IPC_RMID)\fP を使ってすでに削除マークがつけられている共有メモリ・セグメントを あるプロセスが付加 +(attach) (\fBshmat\fP(2)) することを許可している。 この機能は他の UNIX の実装では利用できない。 移植性を考慮したアプリケーションではこれに依存しないようにすべきである。 -.\"O Various fields in a \fIstruct shmid_ds\fP were typed as -.\"O .I short -.\"O under Linux 2.2 -.\"O and have become -.\"O .I long -.\"O under Linux 2.4. -.\"O To take advantage of this, -.\"O a recompilation under glibc-2.1.91 or later should suffice. -.\"O (The kernel distinguishes old and new calls by an -.\"O .B IPC_64 -.\"O flag in -.\"O .IR cmd .) -\fI構造体 shmid_ds\fP 内の多くのフィールドは、 -Linux 2.2 では -.I short -型だったが、Linux 2.4 では -.I long -型になった。 -この利点を生かすには、glibc-2.1.91 以降の環境下で -再コンパイルすれば十分である。 -カーネルは新しい形式の呼び出しと古い形式の呼び出しを -.I cmd -内の -.B IPC_64 -フラグで区別する。 -.\"O .SH "SEE ALSO" +\fI構造体 shmid_ds\fP 内の多くのフィールドは、 Linux 2.2 では \fIshort\fP 型だったが、Linux 2.4 では +\fIlong\fP 型になった。 この利点を生かすには、glibc\-2.1.91 以降の環境下で 再コンパイルすれば十分である。 +カーネルは新しい形式の呼び出しと古い形式の呼び出しを \fIcmd\fP 内の \fBIPC_64\fP フラグで区別する。 .SH 関連項目 -.BR mlock (2), -.BR setrlimit (2), -.BR shmget (2), -.BR shmop (2), -.BR capabilities (7), -.BR shm_overview (7), -.BR svipc (7) +\fBmlock\fP(2), \fBsetrlimit\fP(2), \fBshmget\fP(2), \fBshmop\fP(2), \fBcapabilities\fP(7), +\fBshm_overview\fP(7), \fBsvipc\fP(7) diff --git a/draft/man2/shmget.2 b/draft/man2/shmget.2 index 1ea65db2..90cedfaa 100644 --- a/draft/man2/shmget.2 +++ b/draft/man2/shmget.2 @@ -33,493 +33,140 @@ .\" Language and formatting clean-ups .\" Added notes on /proc files .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1997-03-01, HANATAKA Shinya -.\" Updated & Modified 2001-06-03, Yuichi SATO -.\" Updated 2001-12-22, Kentaro Shirakata -.\" Updated 2002-10-16, Kentaro Shirakata -.\" Updated 2003-02-23, Kentaro Shirakata -.\" Updated 2005-03-02, Akihiro MOTOKI -.\" Updated 2005-11-04, Akihiro MOTOKI -.\" Updated 2006-07-21, Akihiro MOTOKI, LDP v2.36 +.\"******************************************************************* .\" -.\"WORD: shared memory 共有メモリ -.\"WORD: segment セグメント -.\"WORD: owner 所有者 -.\"WORD: group グループ -.\"WORD: world 他人 -.\"WORD: creator 作成者 -.\"WORD: super-user スーパー・ユーザー -.\"WORD: detach 分離 -.\"WORD: attach 付加 -.\"WORD: identifier 識別子 -.\"WORD: member メンバー -.\"WORD: effective user ID 実効ユーザーID -.\"WORD: effective group ID 実効グループID -.\"WORD: policy 方針 -.\"WORD: implement 実装 +.\" This file was generated with po4a. Translate the source file. .\" -.TH SHMGET 2 2006-05-02 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH SHMGET 2 2006\-05\-02 Linux "Linux Programmer's Manual" .SH 名前 -.\"O shmget \- allocates a shared memory segment shmget \- 共有メモリ・セグメントを割り当てる -.\"O .SH SYNOPSIS .SH 書式 .ad l -.B #include +\fB#include \fP .br -.B #include +\fB#include \fP .sp -.BI "int shmget(key_t " key ", size_t " size ", int " shmflg ); +\fBint shmget(key_t \fP\fIkey\fP\fB, size_t \fP\fIsize\fP\fB, int \fP\fIshmflg\fP\fB);\fP .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR shmget () -.\"O returns the identifier of the shared memory segment -.\"O associated with the value of the argument -.\"O .IR key . -.\"O A new shared memory segment, with size equal to the value of -.\"O .I size -.\"O rounded up to a multiple of -.\"O .BR PAGE_SIZE , -.\"O is created if -.\"O .I key -.\"O has the value -.\"O .B IPC_PRIVATE -.\"O or -.\"O .I key -.\"O isn't -.\"O .BR IPC_PRIVATE , -.\"O no shared memory segment corresponding to -.\"O .I key -.\"O exists, and -.\"O .B IPC_CREAT -.\"O is specified in -.\"O .IR shmflg . -.BR shmget () -は -.I key -引き数に対応する共有メモリ・セグメントの識別子を返す。 -.I key -の値が -.B IPC_PRIVATE -の場合、もしくは -.I key -に対応する共有メモリ・セグメントが存在せず、 -.I shmflg -に -.B IPC_CREAT -が指定されていた場合、 -新しい共有メモリ・セグメントを作成する。 -作成される共有メモリ・セグメントは、 -.I size -引き数の値を -.B PAGE_SIZE +\fBshmget\fP() は \fIkey\fP 引き数に対応する共有メモリ・セグメントの識別子を返す。 \fIkey\fP の値が \fBIPC_PRIVATE\fP +の場合、もしくは \fIkey\fP に対応する共有メモリ・セグメントが存在せず、 \fIshmflg\fP に \fBIPC_CREAT\fP が指定されていた場合、 +新しい共有メモリ・セグメントを作成する。 作成される共有メモリ・セグメントは、 \fIsize\fP 引き数の値を \fBPAGE_SIZE\fP の倍数へと切り上げた (round up) 大きさとなる。 .PP -.\"O If -.\"O .I shmflg -.\"O specifies both -.\"O .B IPC_CREAT -.\"O and -.\"O .B IPC_EXCL -.\"O and a shared memory segment already exists for -.\"O .IR key , -.\"O then -.\"O .BR shmget () -.\"O fails with -.\"O .I errno -.\"O set to -.\"O .BR EEXIST . -.\"O (This is analogous to the effect of the combination -.\"O .B O_CREAT | O_EXCL -.\"O for -.\"O .BR open (2).) -.I shmflg -に -.B IPC_CREAT -と -.B IPC_EXCL -の両方が指定された場合、 -.I key -に対応する共有メモリ・セグメントが既に存在すると、 -.BR shmget () -は失敗し、 -.I errno -に -.B EEXIST -が設定される (これは -.BR open (2) -に -.B O_CREAT | O_EXCL -を指定した場合の動作と同じである)。 +\fIshmflg\fP に \fBIPC_CREAT\fP と \fBIPC_EXCL\fP の両方が指定された場合、 \fIkey\fP +に対応する共有メモリ・セグメントが既に存在すると、 \fBshmget\fP() は失敗し、 \fIerrno\fP に \fBEEXIST\fP が設定される +(これは \fBopen\fP(2) に \fBO_CREAT | O_EXCL\fP を指定した場合の動作と同じである)。 .PP -.\"O The value -.\"O .I shmflg -.\"O is composed of: -.I shmflg -は以下の内容から構成される: -.TP 12 -.B IPC_CREAT -.\"O to create a new segment. -.\"O If this flag is not used, then -.\"O .BR shmget () -.\"O will find the segment associated with \fIkey\fP and check to see if -.\"O the user has permission to access the segment. -新しいセグメントを作成する。このフラグが指定されなかった場合、 -.BR shmget () -は \fIkey\fP に対応するセグメントを探し、 +\fIshmflg\fP は以下の内容から構成される: +.TP 12 +\fBIPC_CREAT\fP +新しいセグメントを作成する。このフラグが指定されなかった場合、 \fBshmget\fP() は \fIkey\fP に対応するセグメントを探し、 ユーザがそのセグメントにアクセスする許可があるかどうかをチェックする。 -.TP -.B IPC_EXCL -.\"O used with \fBIPC_CREAT\fP to ensure failure if the segment already exists. -\fBIPC_CREAT\fP と共に使用し、セグメントが既に存在した場合には -失敗することを保証する。 -.TP -.I mode_flags -.\"O (least significant 9 bits) -(下位 9 ビット) -.\"O specifying the permissions granted to the owner, group, and world. -.\"O These bits have the same format, and the same -.\"O meaning, as the -.\"O .I mode -.\"O argument of -.\"O .BR open (2). -.\"O Presently, the execute permissions are not used by the system. -所有者、グループ、他人 (world) への許可を指定する。 -これらのビットは -.BR open (2) -の -.I mode -引き数と同じ形式で同じ意味を持つ。 -今のところ、システムは実行 (execute) 許可を参照しない。 -.TP -.\"O .BR SHM_HUGETLB " (since Linux 2.6)" -.BR SHM_HUGETLB " (Linux 2.6 以降)" -.\"O Allocate the segment using "huge pages." -.\"O See the kernel source file -.\"O .I Documentation/vm/hugetlbpage.txt -.\"O for further information. -"ヒュージページ (huge page)" を使うセグメントを割り当てる。 -詳細な情報は、カーネル・ソースのファイル -.I Documentation/vm/hugetlbpage.txt -を参照。 -.TP -.\"O .BR SHM_NORESERVE " (since Linux 2.6.15)" -.BR SHM_NORESERVE " (Linux 2.6.15 以降)" -.\"O This flag serves the same purpose as the -.\"O .BR mmap (2) -.\"O .B MAP_NORESERVE -.\"O flag. -このフラグは、 -.BR mmap (2) -の -.B MAP_NORESERVE -フラグと同じ役割を果たす。 -.\"O Do not reserve swap space for this segment. -.\"O When swap space is reserved, one has the guarantee -.\"O that it is possible to modify the segment. -.\"O When swap space is not reserved one might get -.\"O .B SIGSEGV -.\"O upon a write -.\"O if no physical memory is available. -このセグメントに対するスワップ空間の予約を行わない。 -スワップ空間を予約した場合は、そのセグメントの変更が必ず成功することが -保証される。スワップ空間の予約を行わなかった場合は、物理メモリに空きが -ないと書き込み時に -.B SIGSEGV -を受け取る可能性がある。 -.\"O See also the discussion of the file -.\"O .I /proc/sys/vm/overcommit_memory -.\"O in -.\"O .BR proc (5). -.BR proc (5) -にある -.I /proc/sys/vm/overcommit_memory -ファイルに関する議論も参照のこと。 +.TP +\fBIPC_EXCL\fP +\fBIPC_CREAT\fP と共に使用し、セグメントが既に存在した場合には 失敗することを保証する。 +.TP +\fImode_flags\fP +(下位 9 ビット) 所有者、グループ、他人 (world) への許可を指定する。 これらのビットは \fBopen\fP(2) の \fImode\fP +引き数と同じ形式で同じ意味を持つ。 今のところ、システムは実行 (execute) 許可を参照しない。 +.TP +\fBSHM_HUGETLB\fP (Linux 2.6 以降) +"ヒュージページ (huge page)" を使うセグメントを割り当てる。 詳細な情報は、カーネル・ソースのファイル +\fIDocumentation/vm/hugetlbpage.txt\fP を参照。 +.TP +\fBSHM_NORESERVE\fP (Linux 2.6.15 以降) .\" As at 2.6.17-rc2, this flag has no effect if SHM_HUGETLB was also .\" specified. +このフラグは、 \fBmmap\fP(2) の \fBMAP_NORESERVE\fP フラグと同じ役割を果たす。 +このセグメントに対するスワップ空間の予約を行わない。 スワップ空間を予約した場合は、そのセグメントの変更が必ず成功することが +保証される。スワップ空間の予約を行わなかった場合は、物理メモリに空きが ないと書き込み時に \fBSIGSEGV\fP を受け取る可能性がある。 +\fBproc\fP(5) にある \fI/proc/sys/vm/overcommit_memory\fP ファイルに関する議論も参照のこと。 .PP -.\"O When a new shared memory segment is created, -.\"O its contents are initialized to zero values, and -.\"O its associated data structure, -.\"O .I shmid_ds -.\"O (see -.\"O .BR shmctl (2)), -.\"O is initialized as follows: -共有メモリ・セグメントが新たに作成される際、 -共有メモリ・セグメントの内容は 0 で初期化され、 -関連情報を保持するデータ構造体 -.I shmid_ds +共有メモリ・セグメントが新たに作成される際、 共有メモリ・セグメントの内容は 0 で初期化され、 関連情報を保持するデータ構造体 \fIshmid_ds\fP は以下のように初期化される。 .IP -.\"O .I shm_perm.cuid -.\"O and -.\"O .I shm_perm.uid -.\"O are set to the effective user ID of the calling process. -.I shm_perm.cuid -と -.I shm_perm.uid -に呼び出し元プロセスの実効 (effective) ユーザーID を設定する。 +\fIshm_perm.cuid\fP と \fIshm_perm.uid\fP に呼び出し元プロセスの実効 (effective) ユーザーID を設定する。 .IP -.\"O .I shm_perm.cgid -.\"O and -.\"O .I shm_perm.gid -.\"O are set to the effective group ID of the calling process. -.I shm_perm.cgid -と -.I shm_perm.gid -に呼び出し元プロセスの実効グループID を設定する。 +\fIshm_perm.cgid\fP と \fIshm_perm.gid\fP に呼び出し元プロセスの実効グループID を設定する。 .IP -.\"O The least significant 9 bits of -.\"O .I shm_perm.mode -.\"O are set to the least significant 9 bit of -.\"O .IR shmflg . -.I shm_perm.mode -の下位 9 ビットに -.I shmflg -の下位 9 ビットを設定する。 +\fIshm_perm.mode\fP の下位 9 ビットに \fIshmflg\fP の下位 9 ビットを設定する。 .IP -.\"O .I shm_segsz -.\"O is set to the value of -.\"O .IR size . -.I shm_segsz -に -.I size -の値を設定する。 +\fIshm_segsz\fP に \fIsize\fP の値を設定する。 .IP -.\"O .IR shm_lpid , -.\"O .IR shm_nattch , -.\"O .I shm_atime -.\"O and -.\"O .I shm_dtime -.\"O are set to 0. -.IR shm_lpid , -.IR shm_nattch , -.IR shm_atime , -.I shm_dtime -に 0 を設定する。 +\fIshm_lpid\fP, \fIshm_nattch\fP, \fIshm_atime\fP, \fIshm_dtime\fP に 0 を設定する。 .IP -.\"O .I shm_ctime -.\"O is set to the current time. -.I shm_ctime -に現在の時刻を設定する。 +\fIshm_ctime\fP に現在の時刻を設定する。 .PP -.\"O If the shared memory segment already exists, the permissions are -.\"O verified, and a check is made to see if it is marked for destruction. -共有メモリ・セグメントが既に存在する場合、アクセス許可の検査と、 -破壊 (destruction) マークがつけられていないかのチェックが行われる。 -.\"O .SH "RETURN VALUE" +共有メモリ・セグメントが既に存在する場合、アクセス許可の検査と、 破壊 (destruction) マークがつけられていないかのチェックが行われる。 .SH 返り値 -.\"O A valid segment identifier, -.\"O .IR shmid , -.\"O is returned on success, \-1 on error. -成功した場合、有効なセグメント識別子 -.I shmid -が返される。エラーの場合、 \-1 が返される。 -.\"O .SH ERRORS +成功した場合、有効なセグメント識別子 \fIshmid\fP が返される。エラーの場合、 \-1 が返される。 .SH エラー -.\"O On failure, -.\"O .I errno -.\"O is set to one of the following: -失敗した場合は -.I errno -が以下のどれかに設定される: -.TP -.B EACCES -.\"O The user does not have permission to access the -.\"O shared memory segment, and does not have the -.\"O .B CAP_IPC_OWNER -.\"O capability. -ユーザーはその共有メモリ・セグメントへのアクセス許可を持たず、 -.B CAP_IPC_OWNER -ケーパビリティも持っていない。 -.TP -.B EEXIST -.\"O .B IPC_CREAT | IPC_EXCL -.\"O was specified and the segment exists. -.B IPC_CREAT | IPC_EXCL -が指定されていたが、そのセグメントが既に存在する。 -.TP -.B EINVAL -.\"O A new segment was to be created and \fIsize\fP < \fBSHMMIN\fP -.\"O or \fIsize\fP > \fBSHMMAX\fP, or no new segment was to be created, -.\"O a segment with given key existed, but \fIsize\fP is greater than the size -.\"O of that segment. -新しいセグメントを作成しようとした際に -\fIsize\fP < \fBSHMMIN\fP または \fIsize\fP > \fBSHMMAX\fP であった。 -もしくは、指定されたキーに対応するセグメントが既に存在して、新しい -セグメントを作成しようとはしなかったが、\fIsize\fP が存在するセグメントの -サイズよりも大きかった。 -.TP -.B ENFILE -.\"O .\" [2.6.7] shmem_zero_setup()-->shmem_file_setup()-->get_empty_filp() -.\"O The system limit on the total number of open files has been reached. +失敗した場合は \fIerrno\fP が以下のどれかに設定される: +.TP +\fBEACCES\fP +ユーザーはその共有メモリ・セグメントへのアクセス許可を持たず、 \fBCAP_IPC_OWNER\fP ケーパビリティも持っていない。 +.TP +\fBEEXIST\fP +\fBIPC_CREAT | IPC_EXCL\fP が指定されていたが、そのセグメントが既に存在する。 +.TP +\fBEINVAL\fP +新しいセグメントを作成しようとした際に \fIsize\fP < \fBSHMMIN\fP または \fIsize\fP > \fBSHMMAX\fP +であった。 もしくは、指定されたキーに対応するセグメントが既に存在して、新しい セグメントを作成しようとはしなかったが、\fIsize\fP +が存在するセグメントの サイズよりも大きかった。 +.TP +\fBENFILE\fP .\" [2.6.7] shmem_zero_setup()-->shmem_file_setup()-->get_empty_filp() システム全体でオープンされているファイルの総数が上限に達した。 -.TP -.B ENOENT -.\"O No segment exists for the given \fIkey\fP, and -.\"O .B IPC_CREAT -.\"O was not specified. -指定された \fIkey\fP に対応するセグメントが存在せず、 -.B IPC_CREAT -も指定されていなかった。 -.TP -.B ENOMEM -.\"O No memory could be allocated for segment overhead. +.TP +\fBENOENT\fP +指定された \fIkey\fP に対応するセグメントが存在せず、 \fBIPC_CREAT\fP も指定されていなかった。 +.TP +\fBENOMEM\fP セグメントの管理情報 (overhead) に割り当てるメモリがなかった。 -.TP -.B ENOSPC -.\"O All possible shared memory ID's have been taken -.\"O .RB ( SHMMNI ), -.\"O or allocating a segment of the requested -.\"O .I size -.\"O would cause the system to exceed the system-wide limit on shared memory -.\"O .RB ( SHMALL ). -.\" motoki 2005-03-02 -- SHMMNI の意味を考慮して意訳 -システム全体の共有メモリ・セグメント数の制限 -.RB ( SHMMNI ) -に達した、または要求された -.I size -のセグメントの割り当てが -システム全体の共有メモリサイズの制限 -.RB ( SHMALL ) -を超過した。 -.TP -.B EPERM -.\"O The -.\"O .B SHM_HUGETLB -.\"O flag was specified, but the caller was not privileged (did not have the -.\"O .B CAP_IPC_LOCK -.\"O capability). -.B SHM_HUGETLB -フラグが指定されたが、呼び出し元には権限がなかった -.RB ( CAP_IPC_LOCK -ケーパビリティを持っていなかった)。 -.\"O .SH "CONFORMING TO" +.TP +\fBENOSPC\fP +システム全体の共有メモリ・セグメント数の制限 (\fBSHMMNI\fP) に達した、または要求された \fIsize\fP のセグメントの割り当てが +システム全体の共有メモリサイズの制限 (\fBSHMALL\fP) を超過した。 +.TP +\fBEPERM\fP +\fBSHM_HUGETLB\fP フラグが指定されたが、呼び出し元には権限がなかった (\fBCAP_IPC_LOCK\fP ケーパビリティを持っていなかった)。 .SH 準拠 -SVr4, POSIX.1-2001. -.\"O .\" SVr4 documents an additional error condition EEXIST. -.\" SVr4 には追加で EEXIST エラー状態の記述がある。 +.\" SVr4 documents an additional error condition EEXIST. +SVr4, POSIX.1\-2001. -.\"O .B SHM_HUGETLB -.\"O is a nonportable Linux extension. -.B SHM_HUGETLB -は Linux での拡張であり、移植性はない。 -.\"O .SH NOTES +\fBSHM_HUGETLB\fP は Linux での拡張であり、移植性はない。 .SH 注意 -.\"O .B IPC_PRIVATE -.\"O isn't a flag field but a -.\"O .I key_t -.\"O type. -.B IPC_PRIVATE -はフラグではなく -.I key_t -型である。 -.\"O If this special value is used for -.\"O .IR key , -.\"O the system call ignores everything but the least significant 9 bits of -.\"O .I shmflg -.\"O and creates a new shared memory segment (on success). -この特別な値が -.I key -に使用された場合は、 -.BR shmget () -は -.I shmflg -の下位 9 ビットを除いた全てを無視し、 -(成功すれば) 新しい共有メモリ・セグメントを作成する。 +\fBIPC_PRIVATE\fP はフラグではなく \fIkey_t\fP 型である。 この特別な値が \fIkey\fP に使用された場合は、 \fBshmget\fP() +は \fIshmflg\fP の下位 9 ビットを除いた全てを無視し、 (成功すれば) 新しい共有メモリ・セグメントを作成する。 .PP -.\"O The following limits on shared memory segment resources affect the -.\"O .BR shmget () -.\"O call: -.BR shmget () -コールに影響する共有メモリ・セグメント資源の制限は以下の通りである: -.TP -.B SHMALL -.\"O System wide maximum of shared memory pages -.\"O (on Linux, this limit can be read and modified via -.\"O .IR /proc/sys/kernel/shmall ). -システム全体の共有メモリ・ページの最大数 -(Linux では、この上限値は -.I /proc/sys/kernel/shmall +\fBshmget\fP() コールに影響する共有メモリ・セグメント資源の制限は以下の通りである: +.TP +\fBSHMALL\fP +システム全体の共有メモリ・ページの最大数 (Linux では、この上限値は \fI/proc/sys/kernel/shmall\fP 経由で参照したり、変更したりできる)。 -.TP -.B SHMMAX -.\"O Maximum size in bytes for a shared memory segment: policy dependent -.\"O (on Linux, this limit can be read and modified via -.\"O .IR /proc/sys/kernel/shmmax ). -共有メモリ・セグメントのバイト単位の大きさの上限: 方針依存 -(Linux では、この上限値は -.I /proc/sys/kernel/shmmax +.TP +\fBSHMMAX\fP +共有メモリ・セグメントのバイト単位の大きさの上限: 方針依存 (Linux では、この上限値は \fI/proc/sys/kernel/shmmax\fP 経由で参照したり、変更したりできる)。 -.TP -.B SHMMIN -.\"O Minimum size in bytes for a shared memory segment: implementation -.\"O dependent (currently 1 byte, though -.\"O .B PAGE_SIZE -.\"O is the effective minimum size). -共有メモリ・セグメントのバイト単位の大きさの下限: 実装依存 -(現在は 1 バイトだが、実質的な最小サイズは -.B PAGE_SIZE -である)。 -.TP -.B SHMMNI -.\"O System wide maximum number of shared memory segments: implementation -.\"O dependent (currently 4096, was 128 before Linux 2.3.99; -.\"O on Linux, this limit can be read and modified via -.\"O .IR /proc/sys/kernel/shmmni ). -.\"O .\" Kernels between 2.4.x and 2.6.8 had an off-by-one error that meant -.\"O .\" that we could create one more segment than SHMMNI -- MTK -.\"O .\" This /proc file is not available in Linux 2.2 and earlier -- MTK -システム全体の共有メモリーの数の上限: 実装依存 -(現在は 4096。Linux 2.3.99 より前では 128。 -Linux では、この上限値は -.I /proc/sys/kernel/shmmni -経由で参照したり、変更したりできる)。 -.\" 2.4.x と 2.6.8 の間のカーネルには、SHMMNI より一つの多くの -.\" セグメントを作成できるというバグがあった。 -.\" この /proc ファイルは Linux 2.2 以前では利用できない -- MTK +.TP +\fBSHMMIN\fP +共有メモリ・セグメントのバイト単位の大きさの下限: 実装依存 (現在は 1 バイトだが、実質的な最小サイズは \fBPAGE_SIZE\fP である)。 +.TP +\fBSHMMNI\fP +.\" Kernels between 2.4.x and 2.6.8 had an off-by-one error that meant +.\" that we could create one more segment than SHMMNI -- MTK +.\" This /proc file is not available in Linux 2.2 and earlier -- MTK +システム全体の共有メモリーの数の上限: 実装依存 (現在は 4096。Linux 2.3.99 より前では 128。 Linux では、この上限値は +\fI/proc/sys/kernel/shmmni\fP 経由で参照したり、変更したりできる)。 .PP -.\"O The implementation has no specific limits for the per-process maximum -.\"O number of shared memory segments -.\"O .RB ( SHMSEG ). -プロセス当りの共有メモリ・セグメントの個数の最大値 -.RB ( SHMSEG ) -に関する実装上の制限はない。 -.\"O .SS LINUX NOTES -.\"O Until version 2.3.30 Linux would return -.\"O .B EIDRM -.\"O for a -.\"O .BR shmget () -.\"O on a shared memory segment scheduled for deletion. -.SS Linux での注意 -バージョン 2.3.30 までは、Linux は -削除が予定されている共有メモリ・セグメントに対して -.BR shmget () -が行われると -.B EIDRM -を返していた。 -.\"O .SH BUGS +プロセス当りの共有メモリ・セグメントの個数の最大値 (\fBSHMSEG\fP) に関する実装上の制限はない。 +.SS "Linux での注意" +バージョン 2.3.30 までは、Linux は 削除が予定されている共有メモリ・セグメントに対して \fBshmget\fP() が行われると +\fBEIDRM\fP を返していた。 .SH バグ -.\"O The name choice -.\"O .B IPC_PRIVATE -.\"O was perhaps unfortunate, -.\"O .B IPC_NEW -.\"O would more clearly show its function. -.B IPC_PRIVATE -という名前を選んだのはおそらく失敗であろう。 -.B IPC_NEW -の方がより明確にその機能を表しているだろう。 -.\"O .SH "SEE ALSO" +\fBIPC_PRIVATE\fP という名前を選んだのはおそらく失敗であろう。 \fBIPC_NEW\fP の方がより明確にその機能を表しているだろう。 .SH 関連項目 -.BR shmat (2), -.BR shmctl (2), -.BR shmdt (2), -.BR ftok (3), -.BR capabilities (7), -.BR shm_overview (7), -.BR svipc (7) +\fBshmat\fP(2), \fBshmctl\fP(2), \fBshmdt\fP(2), \fBftok\fP(3), \fBcapabilities\fP(7), +\fBshm_overview\fP(7), \fBsvipc\fP(7) diff --git a/draft/man2/shmop.2 b/draft/man2/shmop.2 index 43107cbe..86bf390e 100644 --- a/draft/man2/shmop.2 +++ b/draft/man2/shmop.2 @@ -20,8 +20,8 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Modified Sun Nov 28 17:06:19 1993, Rik Faith -.\" with material from Luigi P. Bai +.\" Modified Sun Nov 28 17:06:19 1993, Rik Faith (faith@cs.unc.edu) +.\" with material from Luigi P. Bai (lpb@softint.com) .\" Portions Copyright 1993 Luigi P. Bai .\" Modified Tue Oct 22 22:04:23 1996 by Eric S. Raymond .\" Modified, 5 Jan 2002, Michael Kerrisk @@ -36,472 +36,121 @@ .\" .\" FIXME . Add an example program to this page. .\" FIXME Linux 2.6.9 added SHM_EXEC, which should be documented +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1999-08-15, HANATAKA Shinya -.\" Updated & Modified 2002-05-07, Yuichi SATO -.\" Updated & Modified 2003-01-18, Yuichi SATO -.\" Updated & Modified 2005-01-07, Yuichi SATO -.\" Updated 2005-12-05, Akihiro MOTOKI, Catch up to LDP man-pages 2.16 -.\" Updated 2006-04-14, Akihiro MOTOKI, Catch up to LDP man-pages 2.29 +.\" This file was generated with po4a. Translate the source file. .\" -.\"WORD: shared memory 共有メモリ -.\"WORD: segment セグメント -.\"WORD: super-user スーパー・ユーザー -.\"WORD: detach 分離 -.\"WORD: attach 付加 -.\"WORD: member メンバー -.\"WORD: implement 実装 -.\"WORD: page aligned ページ境界に合った -.\"WORD: unaligned 境界違反 -.\"WORD: descriptor ディスクリプター -.\"WORD: parameter パラメーター -.\" -.TH SHMOP 2 2008-06-03 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH SHMOP 2 2008\-06\-03 Linux "Linux Programmer's Manual" .SH 名前 -.\"O shmop, shmat, shmdt \- shared memory operations shmat, shmdt \- 共有メモリ (shared memory) の操作 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include -.B #include +\fB#include \fP +\fB#include \fP -.BI "void *shmat(int " shmid ", const void *" shmaddr ", int " shmflg ); +\fBvoid *shmat(int \fP\fIshmid\fP\fB, const void *\fP\fIshmaddr\fP\fB, int \fP\fIshmflg\fP\fB);\fP -.BI "int shmdt(const void *" shmaddr ); +\fBint shmdt(const void *\fP\fIshmaddr\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR shmat () -.\"O attaches the shared memory segment identified by -.\"O .I shmid -.\"O to the address space of the calling process. -.BR shmat () -は -.I shmid -で指定された共有メモリ・セグメント (shared memory segment) を -コールしたプロセスのアドレス空間に付加 (attach) する。 -.\"O The attaching address is specified by -.\"O .I shmaddr -.\"O with one of the following criteria: -付加するアドレスは -.I shmaddr -に以下のどれかの形式で指定する: +\fBshmat\fP() は \fIshmid\fP で指定された共有メモリ・セグメント (shared memory segment) を +コールしたプロセスのアドレス空間に付加 (attach) する。 付加するアドレスは \fIshmaddr\fP に以下のどれかの形式で指定する: .LP -.\"O If -.\"O .I shmaddr -.\"O is NULL, -.\"O the system chooses a suitable (unused) address at which to attach -.\"O the segment. -.I shmaddr -が NULL ならば、システムはセグメントを付加するための -適切な (使用されていない) アドレスを選択する。 +\fIshmaddr\fP が NULL ならば、システムはセグメントを付加するための 適切な (使用されていない) アドレスを選択する。 .LP -.\"O If -.\"O .I shmaddr -.\"O isn't NULL -.\"O and -.\"O .B SHM_RND -.\"O is specified in -.\"O .IR shmflg , -.\"O the attach occurs at the address equal to -.\"O .I shmaddr -.\"O rounded down to the nearest multiple of -.\"O .BR SHMLBA . -.I shmaddr -が NULL でなく -.B SHM_RND -が -.I shmflg -に指定されている場合は、 -.I shmaddr -を -.B SHMLBA -の倍数へと切り捨てた (rounding down) のと等しいアドレスへ付加する。 -.\"O Otherwise -.\"O .I shmaddr -.\"O must be a page-aligned address at which the attach occurs. -その他の場合は -.I shmaddr +\fIshmaddr\fP が NULL でなく \fBSHM_RND\fP が \fIshmflg\fP に指定されている場合は、 \fIshmaddr\fP を +\fBSHMLBA\fP の倍数へと切り捨てた (rounding down) のと等しいアドレスへ付加する。 その他の場合は \fIshmaddr\fP は付加を行なうアドレスで、ページ境界を指している必要がある。 .PP -.\"O If -.\"O .B SHM_RDONLY -.\"O is specified in -.\"O .IR shmflg , -.\"O the segment is attached for reading and the process must have -.\"O read permission for the segment. -.B SHM_RDONLY -が -.I shmflg -に指定されていた場合は、 -セグメントは読み込み専用に付加され、プロセスはそのセグメントへの -読み込み許可を持たなければならない。 -.\"O Otherwise the segment is attached for read and write -.\"O and the process must have read and write permission for the segment. -.\"O There is no notion of a write-only shared memory segment. -そうでなければそのセグメントは読み込みと書き込みのために付加され、 -プロセスはそのセグメントに読み込みと書き込みの許可を持つ必要がある。 -書き込み専用の共有メモリ・セグメントという概念は存在しない。 +\fBSHM_RDONLY\fP が \fIshmflg\fP に指定されていた場合は、 セグメントは読み込み専用に付加され、プロセスはそのセグメントへの +読み込み許可を持たなければならない。 そうでなければそのセグメントは読み込みと書き込みのために付加され、 +プロセスはそのセグメントに読み込みと書き込みの許可を持つ必要がある。 書き込み専用の共有メモリ・セグメントという概念は存在しない。 .PP -.\"O The (Linux-specific) -.\"O .B SHM_REMAP -.\"O flag may be specified in -.\"O .I shmflg -.\"O to indicate that the mapping of the segment should replace -.\"O any existing mapping in the range starting at -.\"O .I shmaddr -.\"O and continuing for the size of the segment. -(Linux 特有の) -.B SHM_REMAP -フラグが -.I shmflg -に指定された場合は、 -セグメントのマッピングを既存のマッピングに置き換える。 -マッピングの範囲は、 -.I shmaddr -から始まりセグメントのサイズ分だけある -.\"O (Normally an -.\"O .B EINVAL -.\"O error would result if a mapping already exists in this address range.) -.\"O In this case, -.\"O .I shmaddr -.\"O must not be NULL. -(通常 -.B EINVAL -エラーは、このアドレス範囲にマッピングが既に存在するために起る)。 -このフラグを指定する場合は、 -.I shmaddr -が NULL であってはならない。 +(Linux 特有の) \fBSHM_REMAP\fP フラグが \fIshmflg\fP に指定された場合は、 +セグメントのマッピングを既存のマッピングに置き換える。 マッピングの範囲は、 \fIshmaddr\fP から始まりセグメントのサイズ分だけある (通常 +\fBEINVAL\fP エラーは、このアドレス範囲にマッピングが既に存在するために起る)。 このフラグを指定する場合は、 \fIshmaddr\fP が NULL +であってはならない。 .PP -.\"O The -.\"O .BR brk (2) -.\"O value of the calling process is not altered by the attach. -呼び出したプロセスの -.BR brk (2) -の値は付加によって変化しない。 -.\"O The segment will automatically be detached at process exit. -そのセグメントはプロセスが終了 (exit) したら自動的に分離 (detach) される。 -.\"O The same segment may be attached as a read and as a read-write -.\"O one, and more than once, in the process's address space. -同じセグメントをプロセスのアドレス空間に、読み込み専用および読み書き両用 -として付加でき、また複数回付加することもできる。 +呼び出したプロセスの \fBbrk\fP(2) の値は付加によって変化しない。 そのセグメントはプロセスが終了 (exit) したら自動的に分離 +(detach) される。 同じセグメントをプロセスのアドレス空間に、読み込み専用および読み書き両用 として付加でき、また複数回付加することもできる。 .PP -.\"O A successful -.\"O .BR shmat () -.\"O call updates the members of the -.\"O .I shmid_ds -.\"O structure (see -.\"O .BR shmctl (2)) -.\"O associated with the shared memory segment as follows: -成功した -.BR shmat () -コールは共有メモリ・セグメントに関連する -.I shmid_ds -構造体 -.RB ( shmctl (2) -を参照) のメンバーを以下のように更新する: +成功した \fBshmat\fP() コールは共有メモリ・セグメントに関連する \fIshmid_ds\fP 構造体 (\fBshmctl\fP(2) を参照) +のメンバーを以下のように更新する: .IP -.\"O .I shm_atime -.\"O is set to the current time. -.I shm_atime -には現在の時刻を設定する。 +\fIshm_atime\fP には現在の時刻を設定する。 .IP -.\"O .I shm_lpid -.\"O is set to the process-ID of the calling process. -.I shm_lpid -には呼び出したプロセスのプロセス ID を設定する。 +\fIshm_lpid\fP には呼び出したプロセスのプロセス ID が設定される。 .IP -.\"O .I shm_nattch -.\"O is incremented by one. -.I shm_nattch -を 1 増加させる。 +\fIshm_nattch\fP を 1 増加させる。 .PP -.\"O .BR shmdt () -.\"O detaches the shared memory segment located at the address specified by -.\"O .I shmaddr -.\"O from the address space of the calling process. -.BR shmdt () -は呼び出したプロセスのアドレス空間から -.I shmaddr -で指定されたアドレスに配置された共有メモリ・セグメントを分離 (detach) する。 -.\"O The to-be-detached segment must be currently -.\"O attached with -.\"O .I shmaddr -.\"O equal to the value returned by the attaching -.\"O .BR shmat () -.\"O call. -分離する共有メモリ・セグメントは、現在 -.I shmaddr -に付加されているものでなければならない。 -.I shmaddr -は、それを付加した時に -.BR shmat () -が返した値に等しくなければならない。 +\fBshmdt\fP() は呼び出したプロセスのアドレス空間から \fIshmaddr\fP で指定されたアドレスに配置された共有メモリ・セグメントを分離 +(detach) する。 分離する共有メモリ・セグメントは、現在 \fIshmaddr\fP に付加されているものでなければならない。 \fIshmaddr\fP +は、それを付加した時に \fBshmat\fP() が返した値に等しくなければならない。 .PP -.\"O On a successful -.\"O .BR shmdt () -.\"O call the system updates the members of the -.\"O .I shmid_ds -.\"O structure associated with the shared memory segment as follows: -成功した -.BR shmdt () -コールはその共有メモリ・セグメントに関連する -.I shmid_ds -構造体のメンバーを以下のように更新する: +成功した \fBshmdt\fP() コールはその共有メモリ・セグメントに関連する \fIshmid_ds\fP 構造体のメンバーを以下のように更新する: .IP -.\"O .I shm_dtime -.\"O is set to the current time. -.I shm_dtime -には現在の時刻が設定される。 +\fIshm_dtime\fP には現在の時刻が設定される。 .IP -.\"O .I shm_lpid -.\"O is set to the process-ID of the calling process. -.I shm_lpid -には呼び出したプロセスのプロセス ID が設定される。 +\fIshm_lpid\fP には呼び出したプロセスのプロセス ID が設定される。 .IP -.\"O .I shm_nattch -.\"O is decremented by one. -.I shm_nattch -を 1 減少させる。 -.\"O If it becomes 0 and the segment is marked for deletion, -.\"O the segment is deleted. -もし 0 になり、削除マークがあった場合は -そのセグメントは削除される。 +\fIshm_nattch\fP を 1 減少させる。 もし 0 になり、削除マークがあった場合は そのセグメントは削除される。 .PP -.\"O After a -.\"O .BR fork (2) -.\"O the child inherits the attached shared memory segments. -.BR fork (2) -した後、子プロセスは付加された共有メモリ・セグメントを継承する。 +\fBfork\fP(2) した後、子プロセスは付加された共有メモリ・セグメントを継承する。 -.\"O After an -.\"O .BR exec (2) -.\"O all attached shared memory segments are detached from the process. -.BR exec (2) -した後、全ての付加された共有メモリ・セグメントはプロセスから分離される。 +\fBexec\fP(2) した後、全ての付加された共有メモリ・セグメントはプロセスから分離される。 -.\"O Upon -.\"O .BR exit (2) -.\"O all attached shared memory segments are detached from the process. -.BR exit (2) -において、全ての付加された共有メモリ・セグメントはプロセスから分離される。 -.PP -.\"O .SH "RETURN VALUE" +\fBexit\fP(2) において、全ての付加された共有メモリ・セグメントはプロセスから分離される。 .SH 返り値 -.\"O On success -.\"O .BR shmat () -.\"O returns the address of the attached shared memory segment; on error -.\"O .I (void\ *)\ \-1 -.\"O is returned, and -.\"O .I errno -.\"O is set to indicate the cause of the error. -.BR shmat () -は、成功した場合、 -付加された共有メモリ・セグメントのアドレスを返す。 -エラーの場合、 -.I (void\ *)\ \-1 -を返し、 -.I errno -にエラーの原因を示す値を設定する。 +\fBshmat\fP() は、成功した場合、 付加された共有メモリ・セグメントのアドレスを返す。 エラーの場合、 \fI(void\ *)\ \-1\fP +を返し、 \fIerrno\fP にエラーの原因を示す値を設定する。 -.\"O On success -.\"O .BR shmdt () -.\"O returns 0; on error \-1 is returned, and -.\"O .I errno -.\"O is set to indicate the cause of the error. -.BR shmdt () -は、成功すると 0 を返す。 -エラーの場合、\-1 を返し、 -.I errno -にエラーの原因を示す値を設定する。 -.\"O .SH ERRORS +\fBshmdt\fP() は、成功すると 0 を返す。 エラーの場合、\-1 を返し、 \fIerrno\fP にエラーの原因を示す値を設定する。 .SH エラー -.\"O When -.\"O .BR shmat () -.\"O fails, -.\"O .I errno -.\"O is set to one of the following: -.BR shmat () -が失敗した場合、 -.I errno -に以下の値のどれかを設定して返す: -.TP -.B EACCES -.\"O The calling process does not have the required permissions for -.\"O the requested attach type, and does not have the -.\"O .B CAP_IPC_OWNER -.\"O capability. -呼び出したプロセスに要求された種類の付加に必要な許可がなく、 -.B CAP_IPC_OWNER -ケーパビリティ (capability) がない。 -.TP -.B EINVAL -.\"O Invalid -.\"O .I shmid -.\"O value, unaligned (i.e., not page-aligned and \fBSHM_RND\fP was not -.\"O specified) or invalid -.\"O .I shmaddr -.\"O value, or can't attach segment at -.\"O .IR shmaddr , -.I shmid -の値が不正である。 -.I shmaddr -の値が境界違反 (unaligned) (つまり、ページ境界に合っておらず、 -\fBSHM_RND\fP が指定されていない) または -が不正である。 -.I shmaddr -へのセグメントの付加に失敗した。 -.\"O or -.\"O .B SHM_REMAP -.\"O was specified and -.\"O .I shmaddr -.\"O was NULL. -または -.B SHM_REMAP -が指定されているが、 -.I shmaddr -が NULL であった。 -.TP -.B ENOMEM -.\"O Could not allocate memory for the descriptor or for the page tables. -ディスクリプター (descriptor) やページ・テーブルのためのメモリを -割り当てることができない。 +\fBshmat\fP() が失敗した場合、 \fIerrno\fP に以下の値のどれかを設定して返す: +.TP +\fBEACCES\fP +呼び出したプロセスに要求された種類の付加に必要な許可がなく、 \fBCAP_IPC_OWNER\fP ケーパビリティ (capability) がない。 +.TP +\fBEINVAL\fP +\fIshmid\fP の値が不正である。 \fIshmaddr\fP の値が境界違反 (unaligned) (つまり、ページ境界に合っておらず、 +\fBSHM_RND\fP が指定されていない) または が不正である。 \fIshmaddr\fP へのセグメントの付加に失敗した。 または +\fBSHM_REMAP\fP が指定されているが、 \fIshmaddr\fP が NULL であった。 +.TP +\fBENOMEM\fP +ディスクリプター (descriptor) やページ・テーブルのためのメモリを 割り当てることができない。 .PP -.\"O When -.\"O .BR shmdt () -.\"O fails, -.\"O .I errno -.\"O is set as follows: -.BR shmdt () -が失敗した場合、 -.B EINVAL -は以下のようにセットされる: -.TP -.B EINVAL -.\"O There is no shared memory segment attached at -.\"O .IR shmaddr ; -.\"O or, -.\"O .\" The following since 2.6.17-rc1: -.\"O .I shmaddr -.\"O is not aligned on a page boundary. -.I shmaddr -に付加された共有メモリ・セグメントが存在しない。 -もしくは、 -.\" こちらは 2.6.17-rc1 以降の場合だけ。 -.I shmaddr -がページ境界に合っていない。 -.\"O .SH "CONFORMING TO" +\fBshmdt\fP() が失敗した場合、 \fBEINVAL\fP は以下のようにセットされる: +.TP +\fBEINVAL\fP +.\" The following since 2.6.17-rc1: +\fIshmaddr\fP に付加された共有メモリ・セグメントが存在しない。 もしくは、 \fIshmaddr\fP がページ境界に合っていない。 .SH 準拠 -SVr4, POSIX.1-2001. -.\"O .\" SVr4 documents an additional error condition EMFILE. -.\" SVr4 には他に EMFILE エラー状態についての記述がある。 +.\" SVr4 documents an additional error condition EMFILE. +SVr4, POSIX.1\-2001. -.\"O In SVID 3 (or perhaps earlier) -.\"O the type of the \fIshmaddr\fP argument was changed from -.\"O .I "char *" -.\"O into -.\"O .IR "const void *" , -.\"O and the returned type of -.\"O .BR shmat () -.\"O from -.\"O .I "char *" -.\"O into -.\"O .IR "void *" . -.\"O (Linux libc4 and libc5 have the -.\"O .I "char *" -.\"O prototypes; glibc2 has -.\"O .IR "void *" .) -SVID 3 で (たぶんそれより前だと思うが) -\fIshmaddr\fP 引き数の型は -.I "char *" -から -.I "const void *" -に、\fIshmat\fP() の返り値の型は -.I "char *" -から -.I "void *" -に変更された -(Linux では libc4 と libc5 のプロトタイプは -.I "char *" -であり、glibc2 のプロトタイプは -.I "void *" -である)。 -.\"O .SH NOTES +SVID 3 で (たぶんそれより前だと思うが) \fIshmaddr\fP 引き数の型は \fIchar *\fP から \fIconst void *\fP +に、\fIshmat\fP() の返り値の型は \fIchar *\fP から \fIvoid *\fP に変更された (Linux では libc4 と libc5 +のプロトタイプは \fIchar *\fP であり、glibc2 のプロトタイプは \fIvoid *\fP である)。 .SH 注意 -.\"O Using -.\"O .BR shmat () -.\"O with -.\"O .I shmaddr -.\"O equal to NULL -.\"O is the preferred, portable way of attaching a shared memory segment. -共有メモリセグメントを付加する場合の移植性の高い方法としては、 -.I shmaddr -を NULL にして -.BR shmat () -を使用するのがよい。 -.\"O Be aware that the shared memory segment attached in this way -.\"O may be attached at different addresses in different processes. -このような方法で付加される共有メモリセグメントは、 -プロセスが異なれば別のアドレスに付加される、という点に注意すること。 -.\"O Therefore, any pointers maintained within the shared memory must be -.\"O made relative (typically to the starting address of the segment), -.\"O rather than absolute. -よって共有メモリ内で管理されるポインタは、 -絶対アドレスではなく、 -(一般的にはセグメントの開始アドレスからの) -相対アドレスで作成するべきである。 +共有メモリセグメントを付加する場合の移植性の高い方法としては、 \fIshmaddr\fP を NULL にして \fBshmat\fP() を使用するのがよい。 +このような方法で付加される共有メモリセグメントは、 プロセスが異なれば別のアドレスに付加される、という点に注意すること。 +よって共有メモリ内で管理されるポインタは、 絶対アドレスではなく、 (一般的にはセグメントの開始アドレスからの) 相対アドレスで作成するべきである。 .PP -.\"O On Linux, it is possible to attach a shared memory segment even if it -.\"O is already marked to be deleted. -.\"O However, POSIX.1-2001 does not specify this behavior and -.\"O many other implementations do not support it. -Linux では共有メモリセグメントに既に削除マークが付けられていても、 -その共有メモリセグメントを付加することができる。 -しかし POSIX.1-2001 ではこのような動作を指定しておらず、 -他の多くの実装もこれをサポートしていない。 +Linux では共有メモリセグメントに既に削除マークが付けられていても、 その共有メモリセグメントを付加することができる。 しかし +POSIX.1\-2001 ではこのような動作を指定しておらず、 他の多くの実装もこれをサポートしていない。 .LP -.\"O The following system parameter affects -.\"O .BR shmat (): -以下のシステム・パラメーターは、 -.BR shmat () -に影響する: -.TP +以下のシステム・パラメーターは、 \fBshmat\fP() に影響する: +.TP .\" FIXME A good explanation of the rationale for the existence .\" of SHMLBA would be useful here -.B SHMLBA -.\"O Segment low boundary address multiple. -.\"O Must be page aligned. -.\"O For the current implementation the -.\"O .B SHMLBA -.\"O value is -.\"O .BR PAGE_SIZE . -セグメントの境界アドレスの最小倍数。ページ境界に合ってなければならない。 -現在の実装では -.B SHMLBA -の値は -.B PAGE_SIZE -である。 +\fBSHMLBA\fP .\" FIXME That last sentence isn't true for all Linux .\" architectures (i.e., SHMLBA != PAGE_SIZE for some architectures) .\" -- MTK, Nov 04 +セグメントの境界アドレスの最小倍数。ページ境界に合ってなければならない。 現在の実装では \fBSHMLBA\fP の値は \fBPAGE_SIZE\fP である。 .PP -.\"O The implementation places no intrinsic limit on the per-process maximum -.\"O number of shared memory segments -.\"O .RB ( SHMSEG ). -現在の実装では、プロセスごとの -共有メモリ・セグメントの最大数 -.RB ( SHMSEG ) -に関する実装依存の制限はない。 -.\"O .SH "SEE ALSO" +現在の実装では、プロセスごとの 共有メモリ・セグメントの最大数 (\fBSHMSEG\fP) に関する実装依存の制限はない。 .SH 関連項目 -.BR brk (2), -.BR mmap (2), -.BR shmctl (2), -.BR shmget (2), -.BR capabilities (7), -.BR shm_overview (7), -.BR svipc (7) +\fBbrk\fP(2), \fBmmap\fP(2), \fBshmctl\fP(2), \fBshmget\fP(2), \fBcapabilities\fP(7), +\fBshm_overview\fP(7), \fBsvipc\fP(7) diff --git a/draft/man2/socket.2 b/draft/man2/socket.2 index 7959bb35..6f7c925d 100644 --- a/draft/man2/socket.2 +++ b/draft/man2/socket.2 @@ -1,4 +1,4 @@ -'\" t +.\" t .\" Copyright (c) 1983, 1991 The Regents of the University of California. .\" All rights reserved. .\" @@ -38,660 +38,218 @@ .\" Modified 2002-07-17 by Michael Kerrisk .\" Modified 2004-06-17 by Michael Kerrisk .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Mon Mar 3 23:40:11 JST 1997 -.\" by HANATAKA Shinya -.\" Modified Sun Aug 15 23:52:28 JST 1999 -.\" by HANATAKA Shinya -.\" Updated Mon Jan 13 JST 2000 by Kentaro Shirakata -.\" Updated Mon Oct 15 JST 2001 by Kentaro Shirakata -.\" Updated Mon Oct 26 JST 2002 by Kentaro Shirakata -.\" Updated 2008-11-09, Akihiro MOTOKI , LDP v3.13 +.\"******************************************************************* .\" -.\"WORD: endpoint 端点 -.\"WORD: descriptor ディスクリプター -.\"WORD: link layer リンク層 -.\"WORD: byte stream バイト・ストリーム -.\"WORD: out-of-band 帯域外 -.\"WORD: sequenced 順序性のある -.\"WORD: reliable 信頼性のある -.\"WORD: two-way 双方向の -.\"WORD: datagram データグラム -.\"WORD: implement 実装 -.\"WORD: super-user スーパー・ユーザー -.\"WORD: full-duplex 全二重 -.\"WORD: non-blocking I/O 非停止 I/O -.\"WORD: asynchronous 非同期 +.\" This file was generated with po4a. Translate the source file. .\" -.TH SOCKET 2 2009-01-19 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH SOCKET 2 2009\-01\-19 Linux "Linux Programmer's Manual" .SH 名前 -.\"O socket \- create an endpoint for communication socket \- 通信のための端点(endpoint)を作成する -.\"O .SH SYNOPSIS .SH 書式 -.\"O .BR "#include " " /* See NOTES */" -.BR "#include " " /* 「注意」参照 */" +\fB#include \fP /* 「注意」参照 */ .br -.B #include +\fB#include \fP .sp -.BI "int socket(int " domain ", int " type ", int " protocol ); -.\"O .SH DESCRIPTION +\fBint socket(int \fP\fIdomain\fP\fB, int \fP\fItype\fP\fB, int \fP\fIprotocol\fP\fB);\fP .SH 説明 -.\"O .BR socket () -.\"O creates an endpoint for communication and returns a descriptor. -.BR socket () -は通信のための端点(endpoint)を作成し、ディスクリプター(descriptor)を返す。 +\fBsocket\fP() は通信のための端点(endpoint)を作成し、ディスクリプター(descriptor)を返す。 .PP -.\"O The -.\"O .I domain -.\"O argument specifies a communication domain; this selects the protocol -.\"O family which will be used for communication. -.\"O These families are defined in -.\"O .IR . -.\"O The currently understood formats include: -.I domain -引数は通信を行なうドメインを指定する; これはどの -プロトコル・ファミリ(protocol family)を通信に使用するかを指定する。 -これらのファミリは -.I -に定義されている。 +\fIdomain\fP 引数は通信を行なうドメインを指定する; これはどの プロトコル・ファミリ(protocol +family)を通信に使用するかを指定する。 これらのファミリは \fI\fP に定義されている。 現在、理解できるフォーマットは以下の通り。 .TS tab(:); l l l. -.\"O Name:Purpose:Man page 名前:目的:マニュアル T{ -.BR AF_UNIX ", " AF_LOCAL +\fBAF_UNIX\fP, \fBAF_LOCAL\fP T}:T{ -.\"O Local communication ローカル通信 T}:T{ -.BR unix (7) +\fBunix\fP(7) T} T{ -.B AF_INET -.\"O T}:IPv4 Internet protocols:T{ +\fBAF_INET\fP T}:IPv4 インターネット・プロトコル:T{ -.BR ip (7) +\fBip\fP(7) T} T{ -.B AF_INET6 -.\"O T}:IPv6 Internet protocols:T{ +\fBAF_INET6\fP T}:IPv6 インターネット・プロトコル:T{ -.BR ipv6 (7) +\fBipv6\fP(7) T} T{ -.B AF_IPX -.\"O T}:IPX \- Novell protocols: +\fBAF_IPX\fP T}:IPX \- Novell プロトコル: T{ -.B AF_NETLINK +\fBAF_NETLINK\fP T}:T{ -.\"O Kernel user interface device カーネル・ユーザ・デバイス T}:T{ -.BR netlink (7) +\fBnetlink\fP(7) T} T{ -.B AF_X25 -.\"O T}:ITU-T X.25 / ISO-8208 protocol:T{ -T}:ITU-T X.25 / ISO-8208 プロトコル:T{ -.BR x25 (7) +\fBAF_X25\fP +T}:ITU\-T X.25 / ISO\-8208 プロトコル:T{ +\fBx25\fP(7) T} T{ -.B AF_AX25 +\fBAF_AX25\fP T}:T{ -.\"O Amateur radio AX.25 protocol アマチュア無線 AX.25 プロトコル T}: T{ -.B AF_ATMPVC -.\"O T}:Access to raw ATM PVCs: +\fBAF_ATMPVC\fP T}:生の ATM PVC にアクセスする: T{ -.B AF_APPLETALK -.\"O T}:Appletalk:T{ +\fBAF_APPLETALK\fP T}:アップルトーク:T{ -.BR ddp (7) +\fBddp\fP(7) T} T{ -.B AF_PACKET +\fBAF_PACKET\fP T}:T{ -.\"O Low level packet interface 低レベルのパケットインターフェース T}:T{ -.BR packet (7) +\fBpacket\fP(7) T} .TE .PP -.\"O The socket has the indicated -.\"O .IR type , -.\"O which specifies the communication semantics. -.\"O Currently defined types -.\"O are: -ソケットは -.I type -で指定される型を持ち、それは通信方式(semantics)を指定する。 -定義されている型は現在以下の通り。 -.TP 16 -.B SOCK_STREAM -.\"O Provides sequenced, reliable, two-way, connection-based byte streams. -.\"O An out-of-band data transmission mechanism may be supported. -順序性と信頼性があり、双方向の、接続された -バイト・ストリーム(byte stream)を提供する。 -帯域外(out-of-band)データ転送メカニズムもサポートされる。 -.TP -.B SOCK_DGRAM -.\"O Supports datagrams (connectionless, unreliable messages of a fixed -.\"O maximum length). -データグラム(接続、信頼性無し、固定最大長メッセージ) -をサポートする。 -.TP -.B SOCK_SEQPACKET -.\"O Provides a sequenced, reliable, two-way connection-based data -.\"O transmission path for datagrams of fixed maximum length; a consumer is -.\"O required to read an entire packet with each input system call. -固定最大長のデータグラム転送パスに基づいた順序性、信頼性のある -双方向の接続に基づいた通信を提供する。受け取り側ではそれぞれの入力 +ソケットは \fItype\fP で指定される型を持ち、それは通信方式(semantics)を指定する。 定義されている型は現在以下の通り。 +.TP 16 +\fBSOCK_STREAM\fP +順序性と信頼性があり、双方向の、接続された バイト・ストリーム(byte stream)を提供する。 +帯域外(out\-of\-band)データ転送メカニズムもサポートされる。 +.TP +\fBSOCK_DGRAM\fP +データグラム(接続、信頼性無し、固定最大長メッセージ) をサポートする。 +.TP +\fBSOCK_SEQPACKET\fP +固定最大長のデータグラム転送パスに基づいた順序性、信頼性のある 双方向の接続に基づいた通信を提供する。受け取り側ではそれぞれの入力 システム・コールでパケット全体を読み取ることが要求される。 -.TP -.B SOCK_RAW -.\"O Provides raw network protocol access. +.TP +\fBSOCK_RAW\fP 生のネットワーク・プロトコルへのアクセスを提供する。 -.TP -.B SOCK_RDM -.\"O Provides a reliable datagram layer that does not guarantee ordering. +.TP +\fBSOCK_RDM\fP 信頼性はあるが、順序は保証しないデータグラム層を提供する。 -.TP -.B SOCK_PACKET -.\"O Obsolete and should not be used in new programs; -.\"O see -.\"O .BR packet (7). -廃止されており新しいプログラムで使用してはいけない。 -.BR packet (7) -を参照すること +.TP +\fBSOCK_PACKET\fP +廃止されており新しいプログラムで使用してはいけない。 \fBpacket\fP(7) を参照すること .PP -.\"O Some socket types may not be implemented by all protocol families; -.\"O for example, -.\"O .B SOCK_SEQPACKET -.\"O is not implemented for -.\"O .BR AF_INET . -ある種のソケット型が全てのプロトコル・ファミリで実装されているわけではない。 -例えば -.B SOCK_SEQPACKET -は -.B AF_INET +ある種のソケット型が全てのプロトコル・ファミリで実装されているわけではない。 例えば \fBSOCK_SEQPACKET\fP は \fBAF_INET\fP には実装されていない。 .PP -.\"O Since Linux 2.6.27, the -.\"O .I type -.\"O argument serves a second purpose: -.\"O in addition to specifying a socket type, -.\"O it may include the bitwise OR of any of the following values, -.\"O to modify the behavior of -.\"O .BR socket (): -Linux 2.6.27 以降では、 -.I type -引数は二つ目の目的にも使用される。 -ソケットの型を指定するのに加えて、 -以下の値のいくつかをビット単位の論理和 (OR) で指定することで、 -.BR socket () -の振舞いを変更することができる。 -.TP 16 -.B SOCK_NONBLOCK -.\"O Set the -.\"O .BR O_NONBLOCK -.\"O file status flag on the new open file description. -.\"O Using this flag saves extra calls to -.\"O .BR fcntl (2) -.\"O to achieve the same result. -新しく生成されるオープンファイル記述 (open file description) の -.B O_NONBLOCK -ファイルステータスフラグをセットする。 -このフラグを使うことで、 -.B O_NONBLOCK -をセットするために -.BR fcntl (2) +Linux 2.6.27 以降では、 \fItype\fP 引数は二つ目の目的にも使用される。 ソケットの型を指定するのに加えて、 +以下の値のいくつかをビット単位の論理和 (OR) で指定することで、 \fBsocket\fP() の振舞いを変更することができる。 +.TP 16 +\fBSOCK_NONBLOCK\fP +新しく生成されるオープンファイル記述 (open file description) の \fBO_NONBLOCK\fP +ファイルステータスフラグをセットする。 このフラグを使うことで、 \fBO_NONBLOCK\fP をセットするために \fBfcntl\fP(2) を追加で呼び出す必要がなくなる。 -.TP -.B SOCK_CLOEXEC -.\"O Set the close-on-exec -.\"O .RB ( FD_CLOEXEC ) -.\"O flag on the new file descriptor. -.\"O See the description of the -.\"O .B O_CLOEXEC -.\"O flag in -.\"O .BR open (2) -.\"O for reasons why this may be useful. -新しいファイル・ディスクリプターに対して -close-on-exec -.RB ( FD_CLOEXEC ) -フラグをセットする。 -このフラグが役に立つ理由については、 -.BR open (2) -の -.B O_CLOEXEC -フラグの説明を参照のこと。 +.TP +\fBSOCK_CLOEXEC\fP +新しいファイルディスクリプタに対して close\-on\-exec (\fBFD_CLOEXEC\fP) フラグをセットする。 +このフラグが役に立つ理由については、 \fBopen\fP(2) の \fBO_CLOEXEC\fP フラグの説明を参照のこと。 .PP -.\"O The -.\"O .I protocol -.\"O specifies a particular protocol to be used with the socket. -.\"O Normally only a single protocol exists to support a particular -.\"O socket type within a given protocol family, in which case -.\"O .I protocol -.\"O can be specified as 0. -.\"O However, it is possible that many protocols may exist, in -.\"O which case a particular protocol must be specified in this manner. -.\"O The protocol number to use is specific to the \*(lqcommunication domain\*(rq -.\"O in which communication is to take place; see -.\"O .BR protocols (5). -.\"O See -.\"O .BR getprotoent (3) -.\"O on how to map protocol name strings to protocol numbers. -.I protocol -はソケットによって使用される固有のプロトコルを指定する。通常それぞれの -ソケットは、与えられたプロトコル・ファミリの種類ごとに一つのプロトコルのみを -サポートする。 -その場合は -.I protocol -に 0 を指定できる。 -しかし、多くのプロトコルが存在してもかまわない。 -この場合にはこの方法により固有のプロトコルを指定する必要がある。 -使用されるプロトコル番号は通信の行なわれる\*(lq通信ドメイン\*(rqに -固有である; -.BR protocols (5) -を参照すること。 -プロトコル名をどうやってプロトコル番号に対応させるかについては -.BR getprotoent (3) -を参照すること。 +\fIprotocol\fP はソケットによって使用される固有のプロトコルを指定する。通常それぞれの +ソケットは、与えられたプロトコル・ファミリの種類ごとに一つのプロトコルのみを サポートする。 その場合は \fIprotocol\fP に 0 を指定できる。 +しかし、多くのプロトコルが存在してもかまわない。 この場合にはこの方法により固有のプロトコルを指定する必要がある。 +使用されるプロトコル番号は通信の行なわれる\*(lq通信ドメイン\*(rqに 固有である; \fBprotocols\fP(5) を参照すること。 +プロトコル名をどうやってプロトコル番号に対応させるかについては \fBgetprotoent\fP(3) を参照すること。 .PP -.\"O Sockets of type -.\"O .B SOCK_STREAM -.\"O are full-duplex byte streams, similar to pipes. -.\"O They do not preserve -.\"O record boundaries. -.\"O A stream socket must be in -.\"O a -.\"O .I connected -.\"O state before any data may be sent or received on it. -.\"O A connection to -.\"O another socket is created with a -.\"O .BR connect (2) -.\"O call. -.\"O Once connected, data may be transferred using -.\"O .BR read (2) -.\"O and -.\"O .BR write (2) -.\"O calls or some variant of the -.\"O .BR send (2) -.\"O and -.\"O .BR recv (2) -.\"O calls. -.\"O When a session has been completed a -.\"O .BR close (2) -.\"O may be performed. -.\"O Out-of-band data may also be transmitted as described in -.\"O .BR send (2) -.\"O and received as described in -.\"O .BR recv (2). -.B SOCK_STREAM -型のソケットはパイプのような全二重バイト・ストリームである。 -これらはレコード境界を保存しない。 -ストリームは、ソケットがデータを送ったり受けたりする前に -.I 接続された -状態になってなければならない。他のソケットへの接続は -.BR connect (2) -コールによって行なわれる。一度接続したらデータは -.BR read (2) -と -.BR write (2) -コールや -.BR send (2) -と -.BR recv (2) -コールの変種を使用して転送できる。 -セッションが完了したら -.BR close (2) -が行なわれる。帯域外データの転送も -.BR send (2) -に記述されており、 -受信も -.BR recv (2) -に記述されている。 +\fBSOCK_STREAM\fP 型のソケットはパイプのような全二重バイト・ストリームである。 これらはレコード境界を保存しない。 +ストリームは、ソケットがデータを送ったり受けたりする前に \fI接続された\fP 状態になってなければならない。他のソケットへの接続は +\fBconnect\fP(2) コールによって行なわれる。一度接続したらデータは \fBread\fP(2) と \fBwrite\fP(2) コールや +\fBsend\fP(2) と \fBrecv\fP(2) コールの変種を使用して転送できる。 セッションが完了したら \fBclose\fP(2) +が行なわれる。帯域外データの転送も \fBsend\fP(2) に記述されており、 受信も \fBrecv\fP(2) に記述されている。 .PP -.\"O The communications protocols which implement a -.\"O .B SOCK_STREAM -.\"O ensure that data is not lost or duplicated. -.\"O If a piece of data for which -.\"O the peer protocol has buffer space cannot be successfully transmitted -.\"O within a reasonable length of time, then the connection is considered -.\"O to be dead. -.\"O When -.\"O .B SO_KEEPALIVE -.\"O is enabled on the socket the protocol checks in a protocol-specific -.\"O manner if the other end is still alive. -.B SOCK_STREAM -を実装した通信プロトコルはデータに損失や重複がないことを保証する。 -もし相手のプロトコルがバッファー空間を持つ -データの断片を適当な時間のうちに転送できなければ、 -接続は断たれたとみなす。そのソケット -.B SO_KEEPALIVE -が有効になっている場合、プロトコル独自の方法で接続の相手側がまだ -有効であるかをチェックする。 -.\"O A -.\"O .B SIGPIPE -.\"O signal is raised if a process sends or receives -.\"O on a broken stream; this causes naive processes, -.\"O which do not handle the signal, to exit. -もしプロセスが、壊れたストリームでデータを送受信しようとした場合には -.B SIGPIPE -シグナルが送られる; これは通常のそのシグナルを扱っていないプロセスを -終了させる。 -.\"O .B SOCK_SEQPACKET -.\"O sockets employ the same system calls as -.\"O .B SOCK_STREAM -.\"O sockets. -.\"O The only difference is that -.\"O .BR read (2) -.\"O calls will return only the amount of data requested, -.\"O and any data remaining in the arriving packet will be discarded. -.\"O Also all message boundaries in incoming datagrams are preserved. -.B SOCK_SEQPACKET -ソケットは -.B SOCK_STREAM -ソケットと同じシステム・コールを使用する。 -唯一の違いは -.BR read (2) -コールが要求された量のデータのみを返し、到着したパケットの残りの部分を -捨ててしまうことである。同様に入ってくるデータグラムの全てのメッセージ境界は -保存される。 +\fBSOCK_STREAM\fP を実装した通信プロトコルはデータに損失や重複がないことを保証する。 もし相手のプロトコルがバッファー空間を持つ +データの断片を適当な時間のうちに転送できなければ、 接続は断たれたとみなす。そのソケット \fBSO_KEEPALIVE\fP +が有効になっている場合、プロトコル独自の方法で接続の相手側がまだ 有効であるかをチェックする。 +もしプロセスが、壊れたストリームでデータを送受信しようとした場合には \fBSIGPIPE\fP シグナルが送られる; +これは通常のそのシグナルを扱っていないプロセスを 終了させる。 \fBSOCK_SEQPACKET\fP ソケットは \fBSOCK_STREAM\fP +ソケットと同じシステム・コールを使用する。 唯一の違いは \fBread\fP(2) コールが要求された量のデータのみを返し、到着したパケットの残りの部分を +捨ててしまうことである。同様に入ってくるデータグラムの全てのメッセージ境界は 保存される。 .PP -.\"O .B SOCK_DGRAM -.\"O and -.\"O .B SOCK_RAW -.\"O sockets allow sending of datagrams to correspondents named in -.\"O .BR sendto (2) -.\"O calls. -.\"O Datagrams are generally received with -.\"O .BR recvfrom (2), -.\"O which returns the next datagram along with the address of its sender. -.B SOCK_DGRAM -と -.B SOCK_RAW -ソケットは -.BR sendto (2) -コールで指定された相手へデータグラムを送ることが許されている。 -データグラムは一般に -.BR recvfrom (2) -で受けとり、 +\fBSOCK_DGRAM\fP と \fBSOCK_RAW\fP ソケットは \fBsendto\fP(2) +コールで指定された相手へデータグラムを送ることが許されている。 データグラムは一般に \fBrecvfrom\fP(2) で受けとり、 このコールは次のデータグラムを送信者のアドレスと一緒に返す。 .PP -.\"O .B SOCK_PACKET -.\"O is an obsolete socket type to receive raw packets directly from the -.\"O device driver. -.\"O Use -.\"O .BR packet (7) -.\"O instead. -.B SOCK_PACKET -は古いソケット型で、生(raw)のパケットをデバイスドライバから -直接受信するためのものである。 -今は代わりに -.BR packet (7) -を用いること。 +\fBSOCK_PACKET\fP は古いソケット型で、生(raw)のパケットをデバイスドライバから 直接受信するためのものである。 今は代わりに +\fBpacket\fP(7) を用いること。 .PP -.\"O An -.\"O .BR fcntl (2) -.\"O .B F_SETOWN -.\"O operation can be used to specify a process or process group to receive a -.\"O .B SIGURG -.\"O signal when the out-of-band data arrives or -.\"O .B SIGPIPE -.\"O signal when a -.\"O .B SOCK_STREAM -.\"O connection breaks unexpectedly. -.BR fcntl (2) -の -.B F_SETOWN -操作を使って、シグナル -.B SIGURG -や -.B SIGPIPE -を受けとるプロセス・グループを指定できる。 -.B SIGURG -シグナルは帯域外データが到着した時に、 -.B SIGPIPE -シグナルは -.B SOCK_STREAM -接続が予期せず切断された時に送られる。 -.\"O This operation may also be used to set the process or process group -.\"O that receives the I/O and asynchronous notification of I/O events via -.\"O .BR SIGIO . -また、 -.B F_SETOWN -操作は、I/O や I/O イベントの非同期 (asynchronous) 通知を -.B SIGIO -を経由で受け取るプロセスやプロセス・グループを設定するのにも使用できる。 -.\"O Using -.\"O .B F_SETOWN -.\"O is equivalent to an -.\"O .BR ioctl (2) -.\"O call with the -.\"O .B FIOSETOWN -.\"O or -.\"O .B SIOCSPGRP -.\"O argument. -.B F_SETOWN -を使用することは -.B FIOSETOWN -または -.B SIOCSPGRP -の引数で -.BR ioctl (2) -を使用することと等価である。 +\fBfcntl\fP(2) の \fBF_SETOWN\fP 操作を使って、シグナル \fBSIGURG\fP や \fBSIGPIPE\fP +を受けとるプロセス・グループを指定できる。 \fBSIGURG\fP シグナルは帯域外データが到着した時に、 \fBSIGPIPE\fP シグナルは +\fBSOCK_STREAM\fP 接続が予期せず切断された時に送られる。 また、 \fBF_SETOWN\fP 操作は、I/O や I/O イベントの非同期 +(asynchronous) 通知を \fBSIGIO\fP を経由で受け取るプロセスやプロセス・グループを設定するのにも使用できる。 \fBF_SETOWN\fP +を使用することは \fBFIOSETOWN\fP または \fBSIOCSPGRP\fP の引数で \fBioctl\fP(2) を使用することと等価である。 .PP -.\"O When the network signals an error condition to the protocol module (e.g., -.\"O using a ICMP message for IP) the pending error flag is set for the socket. -.\"O The next operation on this socket will return the error code of the pending -.\"O error. -.\"O For some protocols it is possible to enable a per-socket error queue -.\"O to retrieve detailed information about the error; see -.\"O .B IP_RECVERR -.\"O in -.\"O .BR ip (7). -ネットワークがプロトコル・モジュールにエラー状態を伝えた場合 -(例えば、IP の ICMP メッセージを使用して)には、ソケットの -ペンディング・エラー・フラグが設定される。次にこのソケットを操作した -時にペンディングされていたエラー・コードが返される。プロトコルによっては -エラーについてのより詳しい情報を受け取るためにソケットごとのエラー・キューを -受け取ることが可能である。 -.BR ip (7) -の -.B IP_RECVERR -を参照すること。 +ネットワークがプロトコル・モジュールにエラー状態を伝えた場合 (例えば、IP の ICMP メッセージを使用して)には、ソケットの +ペンディング・エラー・フラグが設定される。次にこのソケットを操作した 時にペンディングされていたエラー・コードが返される。プロトコルによっては +エラーについてのより詳しい情報を受け取るためにソケットごとのエラー・キューを 受け取ることが可能である。 \fBip\fP(7) の +\fBIP_RECVERR\fP を参照すること。 .PP -.\"O The operation of sockets is controlled by socket level -.\"O .IR options . -.\"O These options are defined in -.\"O .IR . -.\"O The functions -.\"O .BR setsockopt (2) -.\"O and -.\"O .BR getsockopt (2) -.\"O are used to set and get options, respectively. -ソケットの操作はソケット・レベル -.I options -によって制御される。 -これらのオプションは -.I -に定義されている。 -.BR setsockopt (2) -と -.BR getsockopt (2) -関数はそれぞれオプションの設定と取得を行なう。 -.\"O .SH "RETURN VALUE" +ソケットの操作はソケット・レベル \fIoptions\fP によって制御される。 これらのオプションは \fI\fP +に定義されている。 \fBsetsockopt\fP(2) と \fBgetsockopt\fP(2) 関数はそれぞれオプションの設定と取得を行なう。 .SH 返り値 -.\"O On success, a file descriptor for the new socket is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合、新しいソケットのファイル・ディスクリプターを返す。 -エラーが発生した場合は \-1 を返し、 -.I errno -を適切に設定する。 -.\"O .SH ERRORS +成功した場合、新しいソケットのファイル・ディスクリプターを返す。 エラーが発生した場合は \-1 を返し、 \fIerrno\fP を適切に設定する。 .SH エラー -.TP -.B EACCES -.\"O Permission to create a socket of the specified type and/or protocol -.\"O is denied. +.TP +\fBEACCES\fP 指定されたタイプまたはプロトコルのソケットを作成する許可が与えられていない。 -.TP -.B EAFNOSUPPORT -.\"O The implementation does not support the specified address family. +.TP +\fBEAFNOSUPPORT\fP 指定されたアドレスファミリーがサポートされていない。 -.TP -.B EINVAL -.\"O Unknown protocol, or protocol family not available. +.TP +\fBEINVAL\fP 知らないプロトコル、または利用できないプロトコル・ファミリである。 -.TP -.B EINVAL +.TP +\fBEINVAL\fP .\" Since Linux 2.6.27 -.\"O Invalid flags in -.\"O .IR type . -.I type -に無効なフラグが指定されている。 -.TP -.B EMFILE -.\"O Process file table overflow. +\fItype\fP に無効なフラグが指定されている。 +.TP +\fBEMFILE\fP プロセスのファイルテーブルが溢れている。 -.TP -.B ENFILE -.\"O The system limit on the total number of open files has been reached. -オープンされたファイルの総数がシステム上限に達している。 -.TP -.\"O .BR ENOBUFS " or " ENOMEM -.BR ENOBUFS " または " ENOMEM -.\"O Insufficient memory is available. -.\"O The socket cannot be -.\"O created until sufficient resources are freed. -十分なメモリがない。十分な資源が解放されるまではソケットを -作成することはできない。 -.TP -.B EPROTONOSUPPORT -.\"O The protocol type or the specified protocol is not -.\"O supported within this domain. -このドメインでは指定されたプロトコルまたはプロトコル・タイプが -サポートされていない。 +.TP +\fBENFILE\fP +オープンされたファイルの総数がシステム全体の上限に達していた。 +.TP +\fBENOBUFS\fP または \fBENOMEM\fP +十分なメモリがない。十分な資源が解放されるまではソケットを 作成することはできない。 +.TP +\fBEPROTONOSUPPORT\fP +このドメインでは指定されたプロトコルまたはプロトコル・タイプが サポートされていない。 .PP -.\"O Other errors may be generated by the underlying protocol modules. 下位のプロトコル・モジュールから他のエラーが生成されるかもしれない。 -.\"O .SH "CONFORMING TO" .SH 準拠 -4.4BSD, POSIX.1-2001. +4.4BSD, POSIX.1\-2001. -.\"O The -.\"O .B SOCK_NONBLOCK -.\"O and -.\"O .B SOCK_CLOEXEC -.\"O flags are Linux-specific. -フラグ -.BR SOCK_NONBLOCK , -.B SOCK_CLOEXEC -は Linux 固有である。 +フラグ \fBSOCK_NONBLOCK\fP, \fBSOCK_CLOEXEC\fP は Linux 固有である。 -.\"O .BR socket () -.\"O appeared in 4.2BSD. -.\"O It is generally portable to/from -.\"O non-BSD systems supporting clones of the BSD socket layer (including -.\"O System V variants). -.BR socket () -は 4.2BSD で登場した。一般に、(System V の変種を含めて) -BSD のソケット層の互換性をサポートしている BSD 以外のシステムへの、 -または、BSD 以外のシステムからの移植ができる。 -.\"O .SH NOTES +\fBsocket\fP() は 4.2BSD で登場した。一般に、(System V の変種を含めて) BSD のソケット層の互換性をサポートしている +BSD 以外のシステムへの、 または、BSD 以外のシステムからの移植ができる。 .SH 注意 -.\"O POSIX.1-2001 does not require the inclusion of -.\"O .IR , -.\"O and this header file is not required on Linux. -.\"O However, some historical (BSD) implementations required this header -.\"O file, and portable applications are probably wise to include it. -POSIX.1-2001 では -.I -のインクルードは必須とされておらず、 -Linux ではこのヘッダファイルは必要ではない。 -しかし、歴史的には、いくつかの実装 (BSD 系) でこのヘッダファイルが -必要であり、移植性が必要なアプリケーションではこのファイルを -インクルードするのが賢明であろう。 +POSIX.1\-2001 では \fI\fP のインクルードは必須とされておらず、 Linux +ではこのヘッダファイルは必要ではない。 しかし、歴史的には、いくつかの実装 (BSD 系) でこのヘッダファイルが +必要であり、移植性が必要なアプリケーションではこのファイルを インクルードするのが賢明であろう。 -.\"O The manifest constants used under 4.x BSD for protocol families -.\"O are -.\"O .BR PF_UNIX , -.\"O .BR PF_INET , -.\"O etc., while -.\"O .B AF_UNIX -.\"O etc. are used for address -.\"O families. -.\"O However, already the BSD man page promises: "The protocol -.\"O family generally is the same as the address family", and subsequent -.\"O standards use AF_* everywhere. -4.x BSD において定数を使用する場合、プロトコル・ファミリーには -.BR PF_UNIX , -.B PF_INET -等を使用している。一方でアドレス・ファミリーには -.B AF_UNIX -等が使用されている。しかしながら BSD のマニュアルでは -「一般にプロトコル・ファミリーはアドレス・ファミリーと同じものである。」 -と保証している。それでそれ以外の規格では全ての場所で AF_* が使用されている。 -.\"O .SH EXAMPLE +4.x BSD において定数を使用する場合、プロトコル・ファミリーには \fBPF_UNIX\fP, \fBPF_INET\fP +等を使用している。一方でアドレス・ファミリーには \fBAF_UNIX\fP 等が使用されている。しかしながら BSD のマニュアルでは +「一般にプロトコル・ファミリーはアドレス・ファミリーと同じものである。」 と保証している。それでそれ以外の規格では全ての場所で AF_* +が使用されている。 .SH 例 -.\"O An example of the use of -.\"O .BR socket () -.\"O is shown in -.\"O .BR getaddrinfo (3). -.BR socket () -の利用例が -.BR getaddrinfo (3) -に記載されている。 -.\"O .SH "SEE ALSO" +\fBsocket\fP() の利用例が \fBgetaddrinfo\fP(3) に記載されている。 .SH 関連項目 -.BR accept (2), -.BR bind (2), -.BR connect (2), -.BR fcntl (2), -.BR getpeername (2), -.BR getsockname (2), -.BR getsockopt (2), -.BR ioctl (2), -.BR listen (2), -.BR read (2), -.BR recv (2), -.BR select (2), -.BR send (2), -.BR shutdown (2), -.BR socketpair (2), -.BR write (2), -.BR getprotoent (3), -.BR ip (7), -.BR socket (7), -.BR tcp (7), -.BR udp (7), -.BR unix (7) +\fBaccept\fP(2), \fBbind\fP(2), \fBconnect\fP(2), \fBfcntl\fP(2), \fBgetpeername\fP(2), +\fBgetsockname\fP(2), \fBgetsockopt\fP(2), \fBioctl\fP(2), \fBlisten\fP(2), \fBread\fP(2), +\fBrecv\fP(2), \fBselect\fP(2), \fBsend\fP(2), \fBshutdown\fP(2), \fBsocketpair\fP(2), +\fBwrite\fP(2), \fBgetprotoent\fP(3), \fBip\fP(7), \fBsocket\fP(7), \fBtcp\fP(7), +\fBudp\fP(7), \fBunix\fP(7) .PP -.\"O \(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\(rq -.\"O is reprinted in -.\"O .I UNIX Programmer's Supplementary Documents Volume 1. -\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\(rq -は -.I UNIX Programmer's Supplementary Documents Volume 1 -として再版された。 +\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\(rq は \fIUNIX +Programmer's Supplementary Documents Volume 1\fP として再版された。 .PP -.\"O \(lqBSD Interprocess Communication Tutorial\(rq -.\"O is reprinted in -.\"O .I UNIX Programmer's Supplementary Documents Volume 1. -\(lqBSD Interprocess Communication Tutorial\(rq -は -.I UNIX Programmer's Supplementary Documents Volume 1 -として再版された。 +\(lqBSD Interprocess Communication Tutorial\(rq は \fIUNIX Programmer's +Supplementary Documents Volume 1\fP として再版された。 diff --git a/draft/man2/socketcall.2 b/draft/man2/socketcall.2 index 958ee1a3..a6744c31 100644 --- a/draft/man2/socketcall.2 +++ b/draft/man2/socketcall.2 @@ -23,88 +23,29 @@ .\" USA. .\" .\" Modified Tue Oct 22 22:11:53 1996 by Eric S. Raymond +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Mon Mar 3 23:45:10 JST 1997 -.\" by HANATAKA Shinya +.\" This file was generated with po4a. Translate the source file. .\" -.\"WORD: socket ソケット -.\"WORD: kernel カーネル -.\"WORD: entry エントリ -.\"WORD: hacker ハッカー -.\"WORD: library ライブラリ -.\" -.TH SOCKETCALL 2 2007-06-28 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH SOCKETCALL 2 2007\-06\-28 Linux "Linux Programmer's Manual" .SH 名前 -.\"O socketcall \- socket system calls socketcall \- ソケット・システムコール -.\"O .SH SYNOPSIS .SH 書式 -.BI "int socketcall(int " call ", unsigned long *" args ); -.\"O .SH DESCRIPTION +\fBint socketcall(int \fP\fIcall\fP\fB, unsigned long *\fP\fIargs\fP\fB);\fP .SH 説明 -.\"O .BR socketcall () -.\"O is a common kernel entry point for the socket system calls. -.\"O .I call -.\"O determines which socket function to invoke. -.\"O .I args -.\"O points to a block containing the actual arguments, -.\"O which are passed through to the appropriate call. -.BR socketcall () -はソケット・システムコールのための共通のカーネル・エントリ・ -ポイント(kernel entry point)である。 -.I call -はどのソケット関数を呼び出すかを指定する。 -.I args -は適切なコールに渡すための実際の引き数を含んでいるブロックを指す。 +\fBsocketcall\fP() はソケット・システムコールのための共通のカーネル・エントリ・ ポイント(kernel entry point)である。 +\fIcall\fP はどのソケット関数を呼び出すかを指定する。 \fIargs\fP は適切なコールに渡すための実際の引き数を含んでいるブロックを指す。 .PP -.\"O User programs should call the appropriate functions by their usual names. -.\"O Only standard library implementors and kernel hackers need to know about -.\"O .BR socketcall (). -ユーザー・プログラムは通常の名前を使用して適切な関数を呼び出すべきである。 -標準ライブラリの実装者やカーネル・ハッカーのみが -.BR socketcall () -について知る必要がある。 -.\"O .SH "CONFORMING TO" +ユーザー・プログラムは通常の名前を使用して適切な関数を呼び出すべきである。 標準ライブラリの実装者やカーネル・ハッカーのみが +\fBsocketcall\fP() について知る必要がある。 .SH 準拠 -.\"O This call is specific to Linux, and should not be used in programs -.\"O intended to be portable. -このコールは Linux 特有であり、移植を意図したプログラムで -使用してはいけない。 -.\"O .SH NOTES +このコールは Linux 特有であり、移植を意図したプログラムで 使用してはいけない。 .SH 注意 -.\"O On a few architectures, for example ia64, there is no -.\"O .BR socketcall () -.\"O system call; instead -.\"O .BR socket (2), -.\"O .BR accept (2), -.\"O .BR bind (2), -.\"O and so on really are implemented as separate system calls. -ia64 などのいくつかのアーキテクチャでは、システムコール -.BR socketcall () -が存在しない。実際には、その代わりに -.BR socket (2), -.BR accept (2), -.BR bind (2) -などが独立したシステムコールとして実装されている。 -.\"O .SH "SEE ALSO" +ia64 などのいくつかのアーキテクチャでは、システムコール \fBsocketcall\fP() が存在しない。実際には、その代わりに +\fBsocket\fP(2), \fBaccept\fP(2), \fBbind\fP(2) などが独立したシステムコールとして実装されている。 .SH 関連項目 -.BR accept (2), -.BR bind (2), -.BR connect (2), -.BR getpeername (2), -.BR getsockname (2), -.BR getsockopt (2), -.BR listen (2), -.BR recv (2), -.BR recvfrom (2), -.BR recvmsg (2), -.BR send (2), -.BR sendmsg (2), -.BR sendto (2), -.BR setsockopt (2), -.BR shutdown (2), -.BR socket (2), -.BR socketpair (2) +\fBaccept\fP(2), \fBbind\fP(2), \fBconnect\fP(2), \fBgetpeername\fP(2), +\fBgetsockname\fP(2), \fBgetsockopt\fP(2), \fBlisten\fP(2), \fBrecv\fP(2), +\fBrecvfrom\fP(2), \fBrecvmsg\fP(2), \fBsend\fP(2), \fBsendmsg\fP(2), \fBsendto\fP(2), +\fBsetsockopt\fP(2), \fBshutdown\fP(2), \fBsocket\fP(2), \fBsocketpair\fP(2) diff --git a/draft/man2/socketpair.2 b/draft/man2/socketpair.2 index 46d68dc1..73df3166 100644 --- a/draft/man2/socketpair.2 +++ b/draft/man2/socketpair.2 @@ -37,171 +37,61 @@ .\" Modified 2004-06-17 by Michael Kerrisk .\" 2008-10-11, mtk: Add description of SOCK_NONBLOCK and SOCK_CLOEXEC .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1997-03-03, HANATAKA Shinya -.\" Updated 2002-09-24, Akihiro MOTOKI -.\" Updated 2005-02-24, Akihiro MOTOKI -.\" Updated 2008-11-09, Akihiro MOTOKI , LDP v3.13 +.\"******************************************************************* .\" -.\"WORD: socket ソケット -.\"WORD: pair ペア -.\"WORD: domain ドメイン -.\"WORD: descriptor ディスクリプタ -.\"WORD: family ファミリ -.\"WORD: implement 実装 +.\" This file was generated with po4a. Translate the source file. .\" -.TH SOCKETPAIR 2 2008-10-11 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O socketpair \- create a pair of connected sockets +.\"******************************************************************* +.TH SOCKETPAIR 2 2008\-10\-11 Linux "Linux Programmer's Manual" .SH 名前 socketpair \- 接続されたソケットのペアを作成する -.\"O .SH SYNOPSIS .SH 書式 -.\"O .BR "#include " " /* See NOTES */" -.BR "#include " " /* 「注意」参照 */" +\fB#include \fP /* 「注意」参照 */ .br -.B #include +\fB#include \fP .sp -.BI "int socketpair(int " domain ", int " type ", int " protocol \ -", int " sv [2]); -.\"O .SH DESCRIPTION +\fBint socketpair(int \fP\fIdomain\fP\fB, int \fP\fItype\fP\fB, int \fP\fIprotocol\fP\fB, int +\fP\fIsv\fP\fB[2]);\fP .SH 説明 -.\"O The -.\"O .BR socketpair () -.\"O call creates an unnamed pair of connected sockets in the specified -.\"O .IR domain , -.\"O of the specified -.\"O .IR type , -.\"O and using the optionally specified -.\"O .IR protocol . -.BR socketpair () -は、指定されたドメイン -.I domain -に指定された種類 -.I type -で名前のないソケットの接続されたペアを作成する。 -.I protocol -が指定されると、このプロトコルを用いる。 -.\"O For further details of these arguments, see -.\"O .BR socket (2). -これらの引き数の詳細は -.BR socket (2) -を参照のこと。 +\fBsocketpair\fP() は、指定されたドメイン \fIdomain\fP に指定された種類 \fItype\fP +で名前のないソケットの接続されたペアを作成する。 \fIprotocol\fP が指定されると、このプロトコルを用いる。 これらの引き数の詳細は +\fBsocket\fP(2) を参照のこと。 -.\"O The descriptors used in referencing the new sockets are returned in -.\"O .IR sv [0] -.\"O and -.\"O .IR sv [1]. -新しいソケットの参照に使用するディスクリプタ (descriptor) が -.IR sv [0] -と -.IR sv [1] -に返される。 -.\"O The two sockets are indistinguishable. +新しいソケットの参照に使用するディスクリプタ (descriptor) が \fIsv\fP[0] と \fIsv\fP[1] に返される。 二つのソケットは全く同じである。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O On success, zero is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合はゼロを返す、エラーの場合は \-1 を返し、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS +成功した場合にはゼロが返される。エラー時には \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP -.B EAFNOSUPPORT -.\"O The specified address family is not supported on this machine. +.TP +\fBEAFNOSUPPORT\fP このマシンでは指定されたアドレス・ファミリがサポートされていない。 -.TP -.B EFAULT -.\"O The address -.\"O .I sv -.\"O does not specify a valid part of the process address space. -アドレス -.I sv -がこのプロセスで使えるアドレス空間を指定していない。 -.TP -.B EMFILE -.\"O Too many descriptors are in use by this process. +.TP +\fBEFAULT\fP +アドレス \fIsv\fP がこのプロセスで使えるアドレス空間を指定していない。 +.TP +\fBEMFILE\fP このプロセスが使用しているディスクリプタの数が多すぎる。 -.TP -.B ENFILE -.\"O The system limit on the total number of open files has been reached. -オープンされたファイルの総数がシステム全体の上限に達した。 -.TP -.B EOPNOTSUPP -.\"O The specified protocol does not support creation of socket pairs. +.TP +\fBENFILE\fP +オープンされたファイルの総数がシステム全体の上限に達していた。 +.TP +\fBEOPNOTSUPP\fP 指定されたプロトコルではソケットのペアの作成がサポートされていない。 -.TP -.B EPROTONOSUPPORT -.\"O The specified protocol is not supported on this machine. +.TP +\fBEPROTONOSUPPORT\fP このマシンでは指定されたプロトコルがサポートされていない。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O 4.4BSD, POSIX.1-2001. -.\"O The -.\"O .BR socketpair () -.\"O function call appeared in 4.2BSD. -.\"O It is generally portable to/from -.\"O non-BSD systems supporting clones of the BSD socket layer (including -.\"O System V variants). -4.4BSD, POSIX.1-2001. -.BR socketpair () -関数コールは 4.2BSD で現われた。一般に (System V の変種を含めて) -BSD のソケット層のクローンをサポートしている、BSD 以外のシステムと、 -互いに移植性がある。 -.\"O .SH NOTES +4.4BSD, POSIX.1\-2001. \fBsocketpair\fP() 関数コールは 4.2BSD で現われた。一般に (System V +の変種を含めて) BSD のソケット層のクローンをサポートしている、BSD 以外のシステムと、 互いに移植性がある。 .SH 注意 -.\"O On Linux, the only supported domain for this call is -.\"O .B AF_UNIX -.\"O (or synonymously, -.\"O .BR AF_LOCAL ). -.\"O (Most implementations have the same restriction.) -Linux では、この関数でサポートされているドメインは -.B AF_UNIX -(または同義語である -.BR AF_LOCAL ) -だけである。 +Linux では、この関数でサポートされているドメインは \fBAF_UNIX\fP (または同義語である \fBAF_LOCAL\fP) だけである。 (ほとんどの実装で同じ制限がある) -.\"O Since Linux 2.6.27, -.\"O .BR socketpair () -.\"O supports the -.\"O .BR SOCK_NONBLOCK -.\"O and -.\"O .BR SOCK_CLOEXEC -.\"O flags described in -.\"O .BR socket (2). -Linux 2.6.27 以降では、 -.BR socketpair () -は、フラグ -.B SOCK_NONBLOCK -と -.B SOCK_CLOEXEC -に対応している。フラグの説明は -.BR socket (2) -を参照のこと。 +Linux 2.6.27 以降では、 \fBsocketpair\fP() は、フラグ \fBSOCK_NONBLOCK\fP と \fBSOCK_CLOEXEC\fP +に対応している。フラグの説明は \fBsocket\fP(2) を参照のこと。 -.\"O POSIX.1-2001 does not require the inclusion of -.\"O .IR , -.\"O and this header file is not required on Linux. -.\"O However, some historical (BSD) implementations required this header -.\"O file, and portable applications are probably wise to include it. -POSIX.1-2001 では -.I -のインクルードは必須とされておらず、 -Linux ではこのヘッダファイルは必要ではない。 -しかし、歴史的には、いくつかの実装 (BSD 系) でこのヘッダファイルが -必要であり、移植性が必要なアプリケーションではこのファイルを -インクルードするのが賢明であろう。 -.\"O .SH "SEE ALSO" +POSIX.1\-2001 では \fI\fP のインクルードは必須とされておらず、 Linux +ではこのヘッダファイルは必要ではない。 しかし、歴史的には、いくつかの実装 (BSD 系) でこのヘッダファイルが +必要であり、移植性が必要なアプリケーションではこのファイルを インクルードするのが賢明であろう。 .SH 関連項目 -.BR pipe (2), -.BR read (2), -.BR socket (2), -.BR write (2), -.BR socket (7), -.BR unix (7) +\fBpipe\fP(2), \fBread\fP(2), \fBsocket\fP(2), \fBwrite\fP(2), \fBsocket\fP(7), \fBunix\fP(7) diff --git a/draft/man2/stime.2 b/draft/man2/stime.2 index 06378df5..fff88cf6 100644 --- a/draft/man2/stime.2 +++ b/draft/man2/stime.2 @@ -27,74 +27,38 @@ .\" Modified 2001-03-16 by Andries Brouwer .\" Modified 2004-05-27 by Michael Kerrisk .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1997-03-03, HANATAKA Shinya -.\" Updated 2001-04-10, Kentaro Shirakata -.\" Updated 2003-09-08, Kentaro Shirakata -.\" Updated 2005-02-24, Akihiro MOTOKI +.\"******************************************************************* .\" -.\"WORD: GMT グリニッジ平均時(GMT) -.\"WORD: superuser スーパーユーザー +.\" This file was generated with po4a. Translate the source file. .\" -.TH STIME 2 2007-07-26 "Linux" "Linux Programmer's Manual" +.\"******************************************************************* +.TH STIME 2 2010\-02\-25 Linux "Linux Programmer's Manual" .SH 名前 stime \- 時間を設定する .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int stime(time_t *" t ); +\fBint stime(time_t *\fP\fIt\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR stime (): -_SVID_SOURCE -.\"O .SH DESCRIPTION +\fBstime\fP(): _SVID_SOURCE .SH 説明 -.\"O .BR stime () -.\"O sets the system's idea of the time and date. -.\"O The time, pointed -.\"O to by \fIt\fP, is measured in seconds since the -.\"O Epoch, 1970-01-01 00:00:00 +0000 (UTC). -.BR stime () -はシステムの時刻と日付を設定する。 -\fIt\fP が指す時刻は、時刻紀元 (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) -からの秒数で指定する。 -.\"O .BR stime () -.\"O may only be executed by the superuser. -スーパーユーザーのみが -.BR stime () -を実行できる。 - -(訳注: 正確にはグリニッジ平均時(GMT)ではなく協定世界時(UTC)が使用される) +\fBstime\fP() はシステムの時刻と日付を設定する。 \fIt\fP が指す時刻は、時刻紀元 (Epoch; 1970\-01\-01 00:00:00 ++0000 (UTC)) からの秒数で指定する。 スーパーユーザーのみが \fBstime\fP() を実行できる。 (訳注: +正確にはグリニッジ平均時(GMT)ではなく協定世界時(UTC)が使用される) .SH 返り値 -成功した場合はゼロが返される。エラーの場合は \-1 が返され、 -.I errno -が適切に設定される。 +成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP -.B EFAULT -.\"O Error in getting information from user space. +.TP +\fBEFAULT\fP ユーザー空間から情報を得るときにエラーが発生した。 -.TP -.B EPERM -.\"O The calling process has insufficient privilege. -.\"O Under Linux the -.\"O .B CAP_SYS_TIME -.\"O privilege is required. -呼び出し元のプロセスが十分な権限を持っていない。 -Linux では -.B CAP_SYS_TIME -権限が必要である。 +.TP +\fBEPERM\fP +呼び出し元のプロセスが十分な権限を持っていない。 Linux では \fBCAP_SYS_TIME\fP 権限が必要である。 .SH 準拠 SVr4. .SH 関連項目 -.BR date (1), -.BR settimeofday (2), -.BR capabilities (7) +\fBdate\fP(1), \fBsettimeofday\fP(2), \fBcapabilities\fP(7) diff --git a/draft/man2/subpage_prot.2 b/draft/man2/subpage_prot.2 new file mode 100644 index 00000000..20818aa4 --- /dev/null +++ b/draft/man2/subpage_prot.2 @@ -0,0 +1,105 @@ +.\" Copyright (c) 2010 Michael Kerrisk +.\" based on a proposal from Stephan Mueller +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of +.\" this manual under the conditions for verbatim copying, provided that +.\" the entire resulting derived work is distributed under the terms of +.\" a permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume. +.\" no responsibility for errors or omissions, or for damages resulting. +.\" from the use of the information contained herein. The author(s) may. +.\" not have taken the same level of care in the production of this. +.\" manual, which is licensed free of charge, as they might when working. +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\" Various pieces of text taken from the kernel source and the commentary +.\" in kernel commit fa28237cfcc5827553044cbd6ee52e33692b0faa +.\" both written by Paul Mackerras +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH SUBPAGE_PROT 2 2010\-10\-30 Linux "Linux Programmer's Manual" +.SH 名前 +subpage_prot \- define a subpage protection for an address range +.SH 書式 +.nf +\fBlong subpage_prot(unsigned long \fP\fIaddr\fP\fB, unsigned long \fP\fIlen\fP\fB,\fP +\fB uint32_t *\fP\fImap\fP\fB);\fP +.fi +.SH 説明 +The PowerPC\-specific \fBsubpage_prot\fP() system call provides the facility to +control the access permissions on individual 4kB subpages on systems +configured with a page size of 64kB. + +The protection map is applied to the memory pages in the region starting at +\fIaddr\fP and continuing for \fIlen\fP bytes. Both of these arguments must be +aligned to a 64\-kB boundary. + +The protection map is specified in the buffer pointed to by \fImap\fP. The map +has 2 bits per 4kB subpage; thus each 32\-bit word specifies the protections +of 16 4kB subpages inside a 64kB page (so, the number of 32\-bit words +pointed to by \fImap\fP should equate to the number of 64\-kB pages specified by +\fIlen\fP). Each 2\-bit field in the protection map is either 0 to allow any +access, 1 to prevent writes, or 2 or 3 to prevent all accesses. +.SH 返り値 +On success, \fBsubpage_prot\fP() returns 0. Otherwise, one of the error codes +specified below is returned. +.SH エラー +.TP +\fBEFAULT\fP +The buffer referred to by \fImap\fP is not accessible. +.TP +\fBEINVAL\fP +The \fIaddr\fP or \fIlen\fP arguments are incorrect. Both of these arguments must +be aligned to a multiple of the system page size, and they must not refer to +a region outside of the address space of the process or to a region that +consists of huge pages. +.TP +\fBENOMEM\fP +メモリ不足である。 +.SH バージョン +This system call is provided on the PowerPC architecture since Linux +2.6.25. The system call is provided only if the kernel is configured with +\fBCONFIG_PPC_64K_PAGES\fP. No library support is provided. +.SH 準拠 +このシステムコールは Linux 独自である。 +.SH 注意 +Normal page protections (at the 64\-kB page level) also apply; the subpage +protection mechanism is an additional constraint, so putting 0 in a 2\-bit +field won't allow writes to a page that is otherwise write\-protected. +.SS Rationale +.\" In the initial implementation, it was the case that: +.\" In fact the whole process is switched to use 4k hardware pages when the +.\" subpage_prot system call is used, but this could be improved in future +.\" to switch only the affected segments. +.\" But Paul Mackerass says (Oct 2010): I'm pretty sure we now only switch +.\" the affected segment, not the whole process. +This system call is provided to assist writing emulators that operate using +64\-kB pages on PowerPC systems. When emulating systems such as x86, which +uses a smaller page size, the emulator can no longer use the +memory\-management unit (MMU) and normal system calls for controlling page +protections. (The emulator could emulate the MMU by checking and possibly +remapping the address for each memory access in software, but that is slow.) +The idea is that the emulator supplies an array of protection masks to apply +to a specified range of virtual addresses. These masks are applied at the +level where hardware page\-table entries (PTEs) are inserted into the +hardware page table based on the Linux PTEs, so the Linux PTEs are not +affected. Implicit in this is that the regions of the address space that +are protected are switched to use 4\-kB hardware pages rather than 64\-kB +hardware pages (on machines with hardware 64\-kB page support). +.SH 関連項目 +\fBmprotect\fP(2), \fBsyscall\fP(2); +.br +the kernel source file \fIDocumentation/vm/hugetlbpage.txt\fP. diff --git a/draft/man2/swapon.2 b/draft/man2/swapon.2 deleted file mode 100644 index 1e05f7a1..00000000 --- a/draft/man2/swapon.2 +++ /dev/null @@ -1,302 +0,0 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992 -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" Modified by Michael Haardt -.\" Modified 1993-07-24 by Rik Faith -.\" Modified 1995-07-22 by Michael Chastain -.\" Modified 1995-07-23 by aeb -.\" Modified 1996-10-22 by Eric S. Raymond -.\" Modified 1998-09-08 by aeb -.\" Modified 2004-06-17 by Michael Kerrisk -.\" Modified 2004-10-10 by aeb -.\" 2004-12-14 mtk, Anand Kumria: added new errors -.\" 2007-06-22 Ivana Varekova , mtk -.\" Update text describing limit on number of swap files. -.\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Mon Mar 3 23:54:56 JST 1997 -.\" by HANATAKA Shinya -.\" Modified Tue Dec 1 00:08:07 JST 1998 -.\" by HANATAKA Shinya -.\" Updated & Modified Fri Feb 11 07:40:12 JST 2005 -.\" by Yuichi SATO -.\" Updated 2007-09-04, Akihiro MOTOKI , LDP v2.64 -.\" -.\"WORD: swap スワップ -.\"WORD: block device ブロック・デバイス -.\"WORD: super-user スーパー・ユーザー -.\"WORD: round robin ラウンド・ロビン -.\"WORD: partition パーティション -.\"WORD: page ページ -.\"WORD: kernel カーネル -.\" -.TH SWAPON 2 2010-06-15 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O swapon, swapoff \- start/stop swapping to file/device -swapon, swapoff \- ファイル/デバイスへのスワップを開始/停止する -.\"O .SH SYNOPSIS -.SH 書式 -.B #include -.br -.\"O .B #include /* to find PAGE_SIZE */ -.B #include /* PAGE_SIZE を見つけるため */ -.br -.B #include -.sp -.BI "int swapon(const char *" path ", int " swapflags ); -.br -.BI "int swapoff(const char *" path ); -.\"O .SH DESCRIPTION -.SH 説明 -.\"O .BR swapon () -.\"O sets the swap area to the file or block device specified by -.\"O .IR path . -.BR swapon () -は -.I path -で指定されたファイルやブロック・デバイスにスワップ領域を設定する。 -.\"O .BR swapoff () -.\"O stops swapping to the file or block device specified by -.\"O .IR path . -.BR swapoff () -は -.I path -で指定されたファイルやブロック・デバイスへのスワップを停止する。 -.PP -.\"O .BR swapon () -.\"O takes a -.\"O .I swapflags -.\"O argument. -.BR swapon () -は -.I swapflags -引き数を取る。 -.\"O If -.\"O .I swapflags -.\"O has the -.\"O .B SWAP_FLAG_PREFER -.\"O bit turned on, the new swap area will have a higher priority than default. -.I swapflags -に -.B SWAP_FLAG_PREFER -ビットが設定された場合は、新しいスワップ領域はデフォルトよりも高い -優先度を持つ。 -.\"O The priority is encoded within -.\"O .I swapflags -.\"O as: -優先度は -.I swapflags -に以下のようにコード化されている。 -.br -.sp -.I " (prio << SWAP_FLAG_PRIO_SHIFT) & SWAP_FLAG_PRIO_MASK" -.br -.PP -.\"O These functions may only be used by a privileged process (one having the -.\"O .B CAP_SYS_ADMIN -.\"O capability). -これらの関数は特権プロセス -.RB ( CAP_SYS_ADMIN -ケーパビリティ (capability) を持つプロセス) のみが使用できる。 -.\"O .SS Priority -.SS 優先度 -.\"O Each swap area has a priority, either high or low. -.\"O The default priority is low. -.\"O Within the low-priority areas, -.\"O newer areas are even lower priority than older areas. -それぞれのスワップ領域は高 (high) と低 (low) のどちらかの優先度を持つ。 -デフォルトの優先度は低である。 -低い優先度の領域において、新しい領域は古い領域よりさらに低い -優先度を持つ。 -.PP -.\"O All priorities set with -.\"O .I swapflags -.\"O are high-priority, higher than default. -.\"O They may have any nonnegative value chosen by the caller. -.\"O Higher numbers mean higher priority. -.I swapflags -が設定されたものは全て高い優先度となり、デフォルトよりも高い優先度を持つ。 -使用者はそれらに負でない値が指定できる。 -大きな数字は高い優先度を意味する。 -.PP -.\"O Swap pages are allocated from areas in priority order, -.\"O highest priority first. -.\"O For areas with different priorities, -.\"O a higher-priority area is exhausted before using a lower-priority area. -.\"O If two or more areas have the same priority, -.\"O and it is the highest priority available, -.\"O pages are allocated on a round-robin basis between them. -高い優先度の領域から順にスワップ・ページとして使用される。 -より低い優先度の領域を使用する前により高い優先度の -領域を使い切る。もし二つ以上の領域が同じ優先度を持ち、 -使える中で一番高い優先度であれば、それらのページは間で -ラウンド・ロビン方式で配分される。 -.PP -.\"O As of Linux 1.3.6, the kernel usually follows these rules, -.\"O but there are exceptions. -Linux 1.3.6 において、カーネルは通常はこれらの規則に従っている。 -しかし例外も存在している。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success, zero is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合は 0 が返される。エラーの場合は \-1 が返され、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EBUSY -.\"O (for -.\"O .BR swapon ()) -.\"O The specified -.\"O .I path -.\"O is already being used as a swap area. -.RB ( swapon () -において) 指定された -.I path -が既にスワップ領域として使用されている。 -.TP -.B EINVAL -.\"O The file -.\"O .I path -.\"O exists, but refers neither to a regular file nor to a block device; -ファイル -.I path -は存在するが、通常のファイルもブロック・デバイスも参照していない。 -.\"O or, for -.\"O .BR swapon (), -.\"O the indicated path does not contain a valid swap signature or -.\"O resides on an in-memory file system like tmpfs; or, for -.\"O or, for -.\"O .BR swapoff (), -.\"O .I path -.\"O is not currently a swap area. -または -.BR swapon () -において、指定された path のファイルが有効なスワップの署名 (signature) を -含んでいないか、tmpfs のようなインメモリ (in-memory) のファイルシステム -上にある。 -または -.BR swapoff () -において、 -.I path -が現在のところスワップ領域でない。 -.TP -.B ENFILE -.\"O The system limit on the total number of open files has been reached. -オープンされたファイルの総数がシステムの制限に達した。 -.TP -.B ENOENT -.\"O The file -.\"O .I path -.\"O does not exist. -ファイル -.I path -が存在しない。 -.TP -.B ENOMEM -.\"O The system has insufficient memory to start swapping. -スワップを開始するのに十分なメモリーがシステムにない。 -.TP -.B EPERM -.\"O The caller does not have the -.\"O .B CAP_SYS_ADMIN -.\"O capability. -.\"O Alternatively, the maximum number of swap files are already in use; -.\"O see NOTES below. -使用者が -.B CAP_SYS_ADMIN -ケーパビリティを持っていない。 -もしくは、最大数のスワップファイルがすでに使用されている -(下記の「注意」の節を参照)。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -.\"O These functions are Linux-specific and should not be used in programs -.\"O intended to be portable. -これらの関数は Linux 特有であり、移植を意図したプログラムでは -使用してはいけない。 -.\"O The second -.\"O .I swapflags -.\"O argument was introduced in Linux 1.3.2. -二番目の -.I swapflags -引き数は Linux 1.3.2 から導入された。 -.\"O .SH NOTES -.SH 注意 -.\"O The partition or path must be prepared with -.\"O .BR mkswap (8). -パーティションやパスは -.BR mkswap (8) -によって準備されていなければならない。 - -.\"O There is an upper limit on the number of swap files that may be used, -.\"O defined by the kernel constant -.\"O .BR MAX_SWAPFILES . -.\"O Before kernel 2.4.10, -.\"O .B MAX_SWAPFILES -.\"O has the value 8; -.\"O since kernel 2.4.10, it has the value 32. -.\"O Since kernel 2.6.18, the limit is decreased by 2 (thus: 30) -.\"O if the kernel is built with the -.\"O .B CONFIG_MIGRATION -.\"O option -.\"O (which reserves two swap table entries for the page migration features of -.\"O .BR mbind (2) -.\"O and -.\"O .BR migrate_pages (2)). -.\"O Since kernel 2.6.32, the limit is further decreased by 1 -.\"O if the kernel is built with the -.\"O .B CONFIG_MEMORY_FAILURE -.\"O option. -使用できるスワップファイルの数には上限があり、その上限は -カーネル定数 -.B MAX_SWAPFILES -で定義される。 -.B MAX_SWAPFILES -の値は、カーネル 2.4.10 より前では 8、 -カーネル 2.4.10 以降では 32 である。 -カーネル 2.6.18 以降では、カーネルが -.B CONFIG_MIGRATION -オプションを有効にして作成された場合、 -この上限が 2 少ない値 (つまり 30) となる -(このカーネルでは、 -.BR mbind (2) -と -.BR migrate_pages (2) -のページ・マイグレーション機能用にスワップ・テーブルのエントリーが -二つ予約される)。 -カーネル 2.6.32 以降では、カーネルが -.B CONFIG_MEMORY_FAILURE -オプションを有効にして作成された場合、 -この上限がさらに 1 少ない値となる。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR mkswap (8), -.BR swapoff (8), -.BR swapon (8) diff --git a/draft/man2/symlinkat.2 b/draft/man2/symlinkat.2 index 2ee2978a..e186c7c6 100644 --- a/draft/man2/symlinkat.2 +++ b/draft/man2/symlinkat.2 @@ -22,177 +22,68 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2006 Yuichi SATO -.\" all rights reserved. -.\" Translated 2006-08-29 by Yuichi SATO , LDP v2.39 .\" -.TH SYMLINKAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH SYMLINKAT 2 2012\-03\-25 Linux "Linux Programmer's Manual" .SH 名前 -.\"O symlinkat \- create a symbolic link relative to a directory file descriptor symlinkat \- ディレクトリファイルディスクリプタから相対的な位置にシンボリックリンクを作成する -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .B #include /* Definition of AT_* constants */ -.B #include /* AT_* 定数の定義 */ -.B #include +\fB#include /* AT_* 定数の定義 */\fP +\fB#include \fP .sp -.BI "int symlinkat(const char *" oldpath ", int " newdirfd \ -", const char *" newpath ); +\fBint symlinkat(const char *\fP\fIoldpath\fP\fB, int \fP\fInewdirfd\fP\fB, const char *\fP\fInewpath\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR symlinkat (): +\fBsymlinkat\fP(): .PD 0 .ad l .RS 4 -.TP 4 -.\"O Since glibc 2.10: -Since glibc 2.10 以降: +.TP 4 +glibc 2.10 以降: _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L -.TP -.\"O Before glibc 2.10: +.TP glibc 2.10 より前: _ATFILE_SOURCE .RE .ad .PD -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR symlinkat () -.\"O system call operates in exactly the same way as -.\"O .BR symlink (2), -.\"O except for the differences described in this manual page. -.BR symlinkat () -システムコールは、この man ページで説明している違いがある以外は、 -.BR symlink (2) +\fBsymlinkat\fP() システムコールは、この man ページで説明している違いがある以外は、 \fBsymlink\fP(2) と全く同じように動作する。 -.\"O If the pathname given in -.\"O .I newpath -.\"O is relative, then it is interpreted relative to the directory -.\"O referred to by the file descriptor -.\"O .I newdirfd -.\"O (rather than relative to the current working directory of -.\"O the calling process, as is done by -.\"O .BR symlink (2) -.\"O for a relative pathname). -.I newpath -で指定されるパス名が相対パスである場合、 -ファイルディスクリプタ -.I newdirfd -で参照されるディレクトリからの相対パス名として解釈される -.RB ( symlink (2) -では、相対パスは呼び出し元プロセスの +\fInewpath\fP で指定されるパス名が相対パスである場合、 ファイルディスクリプタ \fInewdirfd\fP +で参照されるディレクトリからの相対パス名として解釈される (\fBsymlink\fP(2) では、相対パスは呼び出し元プロセスの カレントワーキングディレクトリからの相対パスとなる)。 -.\"O If -.\"O .I newpath -.\"O is relative and -.\"O .I newdirfd -.\"O is the special value -.\"O .BR AT_FDCWD , -.\"O then -.\"O .I newpath -.\"O is interpreted relative to the current working -.\"O directory of the calling process (like -.\"O .BR symlink (2)). -.I newpath -が相対パスであり、かつ -.I newdirfd -が特別な値 -.B AT_FDCWD -である場合、 -.I newpath -は -.RB ( symlink (2) -と同じように) 呼び出し元プロセスの -カレントワーキングディレクトリからの相対パス名として解釈される。 +\fInewpath\fP が相対パスであり、かつ \fInewdirfd\fP が特別な値 \fBAT_FDCWD\fP である場合、 \fInewpath\fP は +(\fBsymlink\fP(2) と同じように) 呼び出し元プロセスの カレントワーキングディレクトリからの相対パス名として解釈される。 -.\"O If -.\"O .I newpath -.\"O is absolute, then -.\"O .I newdirfd -.\"O is ignored. -.I newpath -が絶対パスである場合、 -.I newdirfd -は無視される。 -.\"O .SH "RETURN VALUE" +\fInewpath\fP が絶対パスである場合、 \fInewdirfd\fP は無視される。 .SH 返り値 -.\"O On success, -.\"O .BR symlinkat () -.\"O returns 0. -成功した場合、 -.BR symlinkat () -は 0 を返す。 -.\"O On error, \-1 is returned and -.\"O .I errno -.\"O is set to indicate the error. -エラーの場合、\-1 が返されて、 -.I errno -にはエラーを示す値が設定される。 -.\"O .SH ERRORS +成功した場合、 \fBsymlinkat\fP() は 0 を返す。 エラーの場合、\-1 が返されて、 \fIerrno\fP にはエラーを示す値が設定される。 .SH エラー -.\"O The same errors that occur for -.\"O .BR symlink (2) -.\"O can also occur for -.\"O .BR symlinkat (). -.BR symlink (2) -と同じエラーが -.BR symlinkat () -でも起こる。 -.\"O The following additional errors can occur for -.\"O .BR symlinkat (): -.BR symlinkat () +\fBsymlink\fP(2) と同じエラーが \fBsymlinkat\fP() でも起こる。 \fBsymlinkat\fP() では、その他に以下のエラーが起こる: -.TP -.B EBADF -.\"O .I newdirfd -.\"O is not a valid file descriptor. -.I newdirfd -が有効なファイルディスクリプタでない。 -.TP -.B ENOTDIR -.\"O .I newpath -.\"O is relative and -.\"O .I newdirfd -.\"O is a file descriptor referring to a file other than a directory. -.I newpath -が相対パスで、かつ -.I newdirfd -がディレクトリ以外のファイルを参照するファイルディスクリプタである。 -.\"O .SH VERSIONS +.TP +\fBEBADF\fP +\fInewdirfd\fP が有効なファイルディスクリプタでない。 +.TP +\fBENOTDIR\fP +\fInewpath\fP が相対パスで、かつ \fInewdirfd\fP がディレクトリ以外のファイルを参照するファイルディスクリプタである。 .SH バージョン -.\"O .BR symlinkat () -.\"O was added to Linux in kernel 2.6.16. -.BR symlinkat () -は Linux カーネル 2.6.16 で追加された。 -.\"O .SH "CONFORMING TO" +\fBsymlinkat\fP() は Linux カーネル 2.6.16 で追加された。 .SH 準拠 -POSIX.1-2008. -.\"O .SH NOTES +POSIX.1\-2008. .SH 注意 -.\"O See -.\"O .BR openat (2) -.\"O for an explanation of the need for -.\"O .BR symlinkat (). -.BR symlinkat () -が必要な理由については、 -.BR openat (2) -を参照すること。 -.\"O .SH "SEE ALSO" +\fBsymlinkat\fP() が必要な理由については、 \fBopenat\fP(2) を参照すること。 .SH 関連項目 -.BR openat (2), -.BR symlink (2), -.BR path_resolution (7), -.BR symlink (7) +\fBopenat\fP(2), \fBsymlink\fP(2), \fBpath_resolution\fP(7), \fBsymlink\fP(7) diff --git a/draft/man2/sync_file_range.2 b/draft/man2/sync_file_range.2 deleted file mode 100644 index 1a5354cc..00000000 --- a/draft/man2/sync_file_range.2 +++ /dev/null @@ -1,302 +0,0 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" Copyright (c) 2006 Andrew Morton -.\" and Copyright 2006 Michael Kerrisk -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" 2006-07-05 Initial creation, Michael Kerrisk based on -.\" Andrew Morton's comments in fs/sync.c -.\" -.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2007-01-09, Akihiro MOTOKI , LDP v2.43 -.\" Updated 2008-08-06, Akihiro MOTOKI, LDP v3.05 -.\" Updated 2010-04-23, Akihiro MOTOKI, LDP v3.24 -.\" -.TH SYNC_FILE_RANGE 2 2010-01-17 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O sync_file_range \- sync a file segment with disk -sync_file_range \- ファイルセグメントをディスクと同期する -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" -.B #include - -.BI "int sync_file_range(int " fd ", off64_t " offset ", off64_t " nbytes , -.BI " unsigned int " flags ); -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O .BR sync_file_range () -.\"O permits fine control when synchronizing the open file referred to by the -.\"O file descriptor -.\"O .I fd -.\"O with disk. -.BR sync_file_range () -を使うと、ファイルディスクリプタ -.I fd -で参照されるオープンされたファイルのディスクとの同期に関して、 -きめ細かな制御が可能となる。 - -.\"O .I offset -.\"O is the starting byte of the file range to be synchronized. -.\"O .I nbytes -.\"O specifies the length of the range to be synchronized, in bytes; if -.\"O .I nbytes -.\"O is zero, then all bytes from -.\"O .I offset -.\"O through to the end of file are synchronized. -.\"O Synchronization is in units of the system page size: -.\"O .I offset -.\"O is rounded down to a page boundary; -.\"O .I (offset+nbytes-1) -.\"O is rounded up to a page boundary. -.I offset -は、同期を行うファイルの領域の開始バイトである。 -.I nbytes -には同期を行う領域の長さをバイト単位で指定する。 -.I nbytes -が 0 の場合は、 -.I offset -からファイル末尾までの全バイトを同期する。 -同期はシステムのページサイズの単位で行われる。 -.I offset -はページ境界にあわせて切り下げられ、 -.I (offset+nbytes-1) -はページ境界にあわせて切り上げられる。 - -.\"O The -.\"O .I flags -.\"O bit-mask argument can include any of the following values: -ビットマスク引き数 -.I flags -には以下の値を指定することができる: -.TP -.B SYNC_FILE_RANGE_WAIT_BEFORE -.\"O Wait upon write-out of all pages in the specified range -.\"O that have already been submitted to the device driver for write-out -.\"O before performing any write. -何らかの書き込みを行う前に、指定された領域のページで -書き出しを行うようにデバイスドライバにすでに要求が発行されている -ページの書き出しが全て完了するのを待つ。 -.TP -.B SYNC_FILE_RANGE_WRITE -.\"O Initiate write-out of all dirty pages in the specified -.\"O range which are not presently submitted write-out. -.\"O Note that even this may block if you attempt to -.\"O write more than request queue size. -指定された領域のページで、書き出し要求が発行されていない -全ての dirty (キャッシュだけが変更されている) ページの -書き出しを開始する。 -リクエストキューの大きさより多く書き込もうとした場合には、 -この処理は停止 (block) する可能性がある点に注意すること。 -.TP -.B SYNC_FILE_RANGE_WAIT_AFTER -.\"O Wait upon write-out of all pages in the range -.\"O after performing any write. -何らかの書き込み後に、指定された領域の全てのページの -書き出しが行われるのを待つ。 -.PP -.\"O Specifying -.\"O .I flags -.\"O as 0 is permitted, as a no-op. -.I flags -に 0 を指定した場合、何もしないことを表す。 -.\"O .SS Warning -.SS 警告 -.\"O This system call is extremely dangerous and should not be used in portable -.\"O programs. -このシステムコールは非常に危険であり、 -移植性が必要なプログラムで使用すべきではない。 -.\"O None of these operations writes out the file's metadata. -.\"O Therefore, unless the application is strictly performing overwrites of -.\"O already-instantiated disk blocks, there are no guarantees that the data will -.\"O be available after a crash. -これらの操作ではどれもファイルのメタデータの書き出しを行わない。 -したがって、アプリケーションにより作成済みのディスクブロックの -上書きの実行が確実に行われない限り、クラッシュの後でもデータが -利用できる保証はない。 -.\"O There is no user interface to know if a write is purely an overwrite. -.\"O On filesystem using copy-on-write semantics (e.g., -.\"O .IR btrfs ) -.\"O an overwrite of existing allocated blocks is impossible. -.\"O When writing into preallocated space, -.\"O many filesystems also require calls into the block -.\"O allocator, which this system call does not sync out to disk. -.\"O This system call does not flush disk write caches and thus does not provide -.\"O any data integrity on systems with volatile disk write caches. -書き込みが上書きだけであるかを知るためのユーザインタフェースは存在しない。 -.RI ( btrfs -などの) copy-on-write 動作を使ったファイルシステムでは、 -既存の割り当て済みのブロックに対する上書き自体ができない。 -前もって割り当てられた領域に書き込みを行う場合、 -多くのファイルシステムでは block allocator への書き込みも必要となるが、 -このシステムコールは block allocator のディスクへの同期を行わない。 -このシステムコールはディスク書き込みキャッシュのフラッシュを -行わないので、揮発性のディスク書き込みキャッシュを使ったシステムでは -このシステムコールではデータの一貫性を確保できないことになる。 -.\"O .SS Some details -.SS 詳細 -.\"O .B SYNC_FILE_RANGE_WAIT_BEFORE -.\"O and -.\"O .B SYNC_FILE_RANGE_WAIT_AFTER -.\"O will detect any -.\"O I/O errors or -.\"O .B ENOSPC -.\"O conditions and will return these to the caller. -.B SYNC_FILE_RANGE_WAIT_BEFORE -と -.B SYNC_FILE_RANGE_WAIT_AFTER -は I/O エラーや -.B ENOSPC -状態を検出し、呼び出し元にこれらの情報を返す。 - -.\"O Useful combinations of the -.\"O .I flags -.\"O bits are: -.I flags -の役に立つビットの組み合わせを以下に示す: -.TP -.B SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE -.\"O Ensures that all pages -.\"O in the specified range which were dirty when -.\"O .BR sync_file_range () -.\"O was called are placed -.\"O under write-out. -.\"O This is a start-write-for-data-integrity operation. -指定された範囲内のページで、 -.BR sync_file_range () -が呼び出された際に dirty であった全てのページが、 -確実に書き出し対象となるようにする。 -これは、start-write-for-data-integrity 操作 -(データ完全性確保のための書き込み開始の操作) である。 -.TP -.B SYNC_FILE_RANGE_WRITE -.\"O Start write-out of all dirty pages in the specified range which -.\"O are not presently under write-out. -.\"O This is an asynchronous flush-to-disk -.\"O operation. -.\"O This is not suitable for data integrity operations. -指定された範囲内のページで、現在書き出し中でない全ての dirty ページの -書き出しを開始する。これは非同期のディスクへのフラッシュ (flush-to-disk) -操作である。データ完全性確保が必要な操作としては適切ではない。 -.TP -.BR SYNC_FILE_RANGE_WAIT_BEFORE " (or " SYNC_FILE_RANGE_WAIT_AFTER ) -.\"O Wait for -.\"O completion of write-out of all pages in the specified range. -.\"O This can be used after an earlier -.\"O .B SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE -.\"O operation to wait for completion of that operation, and obtain its result. -指定された範囲内の全てのページの書き出しの完了を待つ。 -このフラグは、前に行われた操作 -.B SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE -の後に使用でき、この操作の完了を待ち、結果を取得することができる。 -.TP -.B SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE | \ -SYNC_FILE_RANGE_WAIT_AFTER -.\"O This is a write-for-data-integrity operation -.\"O that will ensure that all pages in the specified range which were dirty when -.\"O .BR sync_file_range () -.\"O was called are committed to disk. -これは write-for-data-integrity 操作 -(データ完全性確保のための書き込み) であり、指定された範囲内の、 -.BR sync_file_range () -が呼ばれた時点で dirty な全てのページが -ディスクに格納されることが保証される。 -.\"O .SH RETURN VALUE -.SH 返り値 -.\"O On success, -.\"O .BR sync_file_range () -.\"O returns 0; on failure \-1 is returned and -.\"O .I errno -.\"O is set to indicate the error. -成功の場合、 -.BR sync_file_range () -は 0 を返す。失敗の場合、\-1 を返し、 -.I error -にエラーを示す値を設定する。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EBADF -.\"O .I fd -.\"O is not a valid file descriptor. -.I fd -が有効なファイルディスクリプタではない。 -.TP -.B EINVAL -.\"O .I flags -.\"O specifies an invalid bit; or -.\"O .I offset -.\"O or -.\"O .I nbytes -.\"O is invalid. -.I flags -に不正なビットが指定されている。または -.I offset -か -.I nbytes -が不正である。 -.TP -.B EIO -.\"O I/O error. -I/O エラー。 -.TP -.B ENOMEM -.\"O Out of memory. -メモリ不足である。 -.TP -.B ENOSPC -.\"O Out of disk space. -ディスク領域不足である。 -.TP -.B ESPIPE -.\"O .I fd -.\"O refers to something other than a regular file, a block device, -.\"O a directory, or a symbolic link. -.I fd -が、通常のファイル、ブロックデバイス、ディレクトリ、シンボリックリンク -以外のものを指している。 -.\" FIXME . (bug?) Actually, how can 'fd' refer to a symbolic link (S_ISLNK)? -.\" (In userspace at least) it isn't possible to obtain a file descriptor -.\" for a symbolic link. -.SH バージョン -.\"O .BR sync_file_range () -.\"O appeared on Linux in kernel 2.6.17. -.BR sync_file_range () -はカーネル 2.6.17 で Linux に登場した。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -.\"O This system call is Linux-specific, and should be avoided -.\"O in portable programs. -このシステムコールは Linux 独自であり、 -移植性が必要なプログラムでは使用を避けるべきである。 -.\"O .SH VERSIONS -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR fdatasync (2), -.BR fsync (2), -.BR msync (2), -.BR sync (2) diff --git a/draft/man2/syscall.2 b/draft/man2/syscall.2 index abfce1d5..bdadfc6f 100644 --- a/draft/man2/syscall.2 +++ b/draft/man2/syscall.2 @@ -35,63 +35,30 @@ .\" 2002-03-20 Christoph Hellwig .\" - adopted for Linux .\" -.\" Japanese Version Copyright (c) 2002 Yuichi SATO -.\" all rights reserved. -.\" Translated Tue Aug 6 03:43:25 JST 2002 -.\" by Yuichi SATO +.\"******************************************************************* .\" -.TH SYSCALL 2 2007-07-26 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH SYSCALL 2 2007\-07\-26 Linux "Linux Programmer's Manual" .SH 名前 -.\"O syscall \- indirect system call syscall \- 間接システムコール -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" -.B #include -.BR "#include " "/* For SYS_xxx definitions */" +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP +\fB#include \fP/* For SYS_xxx definitions */ -.BI "int syscall(int " number ", ...);" +\fBint syscall(int \fP\fInumber\fP\fB, ...);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR syscall () -.\"O performs the system call whose assembly language -.\"O interface has the specified -.\"O .I number -.\"O with the specified arguments. -.BR syscall () -は -.I number -で指定されたアセンブリ言語インターフェースのシステムコールを、 -指定された引き数をつけて実行する。 -.\"O Symbolic constants for system calls can be found in the header file -.\"O .IR . -システムコールのシンボル定数はヘッダファイル -.I -に書かれている。 -.\"O .SH RETURN VALUE +\fBsyscall\fP() は \fInumber\fP で指定されたアセンブリ言語インターフェースのシステムコールを、 指定された引き数をつけて実行する。 +システムコールのシンボル定数はヘッダファイル \fI\fP に書かれている。 .SH 返り値 -.\"O The return value is defined by the system call being invoked. -返り値は呼び出されたシステムコールによって定義される。 -.\"O In general, a 0 return value indicates success. -一般に、返り値 0 は成功を表す。 -.\"O A \-1 return value indicates an error, -.\"O and an error code is stored in -.\"O .IR errno . -\-1 はエラーを表し、エラーコードは -.I errno +返り値は呼び出されたシステムコールによって定義される。 一般に、返り値 0 は成功を表す。 \-1 はエラーを表し、エラーコードは \fIerrno\fP に入れられる。 -.\"O .SH NOTES .SH 注意 -.\"O .BR syscall () -.\"O first appeared in -.\"O 4BSD. -.BR syscall () -は 4BSD で最初に登場した。 -.\"O .SH EXAMPLE +\fBsyscall\fP() は 4BSD で最初に登場した。 .SH 例 .nf #define _GNU_SOURCE @@ -107,8 +74,5 @@ main(int argc, char *argv[]) tid = syscall(SYS_gettid); } .fi -.\"O .SH SEE ALSO .SH 関連項目 -.BR _syscall (2), -.BR intro (2), -.BR syscalls (2) +\fB_syscall\fP(2), \fBintro\fP(2), \fBsyscalls\fP(2) diff --git a/draft/man2/syscalls.2 b/draft/man2/syscalls.2 deleted file mode 100644 index 54b96583..00000000 --- a/draft/man2/syscalls.2 +++ /dev/null @@ -1,1077 +0,0 @@ -.\" Copyright (C) 2007 Michael Kerrisk -.\" with some input from Stepan Kasal -.\" -.\" Some content retained from an earlier version of this page: -.\" Copyright (C) 1998 Andries Brouwer (aeb@cwi.nl) -.\" Modifications for 2.2 and 2.4 Copyright (C) 2002 Ian Redfern -.\" -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" Japanese Version Copyright (c) 1998 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1998-07-22, HANATAKA Shinya -.\" Updated 2003-02-06, Kentaro Shirakata -.\" Modified 2005-04-05, Akihiro MOTOKI -.\" Updated 2007-09-08, Akihiro MOTOKI , LDP v2.64 -.\" Updated 2008-11-09, Akihiro MOTOKI , LDP v3.13 -.\" -.TH SYSCALLS 2 2010-11-06 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O syscalls \- Linux system calls -syscalls \- Linux のシステムコール -.\"O .SH SYNOPSIS -.SH 書式 -.\"O Linux system calls. -Linux のシステムコール。 -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The system call is the fundamental interface between an application -.\"O and the Linux kernel. -システムコールは、アプリケーションと Linux カーネルとの間の -基本的なインタフェースである。 -.\"O .SS System calls and library wrapper functions -.SS システムコールとライブラリのラッパー関数 -.\"O System calls are generally not invoked directly, -.\"O but rather via wrapper functions in glibc (or perhaps some other library). -.\"O For details of direct invocation of a system call, see -.\"O .BR intro (2). -.\"O Often, but not always, the name of the wrapper function is the same -.\"O as the name of the system call that it invokes. -.\"O For example, glibc contains a function -.\"O .BR truncate () -.\"O which invokes the underlying "truncate" system call. -システムコールは一般には直接起動されず、 -glibc (や他の何らかのライブラリ) 経由で起動される。 -システムコールの直接起動については、詳細は -.BR intro (2) -を参照のこと。 -いつもという訳ではないが、普通は、ラッパー関数の名前はその関数が起動する -システムコールの名前と同じである。 -例えば、glibc には -.BR truncate () -という関数があり、この関数は "truncate" システムコールを起動する。 - -.\"O Often the glibc wrapper function is quite thin, doing little work -.\"O other than copying arguments to the right registers -.\"O before invoking the system call, -.\"O and then setting -.\"O .I errno -.\"O appropriately after the system call has returned. -.\"O (These are the same steps that are performed by -.\"O .BR syscall (2), -.\"O which can be used to invoke system calls -.\"O for which no wrapper function is provided.) -.\"O Note: system calls indicate a failure by returning a negative error -.\"O number to the caller; -.\"O when this happens, -.\"O the wrapper function negates the returned error number -.\"O (to make it positive), copies it to -.\"O .IR errno , -.\"O and returns \-1 to the caller of the wrapper. -たいていの場合、glibc のラッパー関数はかなり簡単なもので、 -システムコールを起動する前に引き数を適切なレジスタにコピーし、 -システムコールが返った後は -.I errno -を適切に設定する以外は、ほとんど処理を行わない -(これらは、ラッパー関数が提供されていない場合に -システムコールを起動するのに使用する -.BR syscall (2) -により実行される処理と同じである)。 -[注意] システムコールは失敗を示すのに負のエラー番号を呼び出し元に返す。 -失敗が起こった際には、ラッパー関数は返されたエラー番号を反転して -(正の値に変換し)、それを -.I errno -にコピーし、ラッパー関数の呼び出し元に \-1 を返す。 - -.\"O Sometimes, however, the wrapper function does some extra work -.\"O before invoking the system call. -.\"O For example, nowadays there are (for reasons described below) two -.\"O related system calls, -.\"O .BR truncate (2) -.\"O and -.\"O .BR truncate64 (2), -.\"O and the glibc -.\"O .BR truncate () -.\"O wrapper function checks which of those system calls -.\"O are provided by the kernel and determines which should be employed. -しかしながら、時には、ラッパー関数がシステムコールを起動する前に -何らかの追加の処理を行う場合がある。 -例えば、現在、 -二つの関連するシステムコール -.BR truncate (2) -と -.BR truncate64 (2) -があり、glibc のラッパー関数 -.BR truncate () -は、カーネルがこれらのシステムコールのうちどちらを提供しているかをチェックし、 -どちらを採用するかを決定する。 -.\"O .SS System call list -.SS システムコールのリスト -.\"O Below is a list of those system calls that are common to most platforms. -.\"O In the list, the -.\"O .I Kernel -.\"O column indicates the kernel version -.\"O for those system calls that were new in Linux 2.2, -.\"O or have appeared since that kernel version. -.\"O Note the following points: -以下は、ほとんどのプラットフォームに共通するシステムコールのリストである。 -このリストで、 -.I Kernel -の列は、Linux 2.2 以降で登場したシステムコールが -登場したカーネルバージョンを示す。 -以下に詳細な説明を記す。 -.IP * 3 -.\"O Where no kernel version is indicated, -.\"O the system call appeared in kernel 1.0 or earlier. -カーネルバージョンがない場合、そのシステムコールは -カーネル 1.0 もしくはそれ以前に登場した。 -.IP * -.\"O Where a system call is marked "1.2" -.\"O this means the system call probably appeared in a 1.1.x kernel version, -.\"O and first appeared in a stable kernel with 1.2. -.\"O (Development of the 1.2 kernel was initiated from a branch of kernel -.\"O 1.0.6 via the 1.1.x unstable kernel series.) -システムコールに "1.2" と書かれている場合、 -そのシステムコールがおそらくバージョン 1.1.x のカーネルで登場し、 -安定版のカーネルでは 1.2 で初めて登場したことを意味する。 -(バージョン 1.2 のカーネルは、カーネル 1.0.6 から分岐し、 -バージョン 1.1.x の不安定版のカーネル系列として開発された。) -.IP * -.\"O Where a system call is marked "2.0" -.\"O this means the system call probably appeared in a 1.3.x kernel version, -.\"O and first appeared in a stable kernel with 2.0. -.\"O (Development of the 2.0 kernel was initiated from a branch of kernel -.\"O 1.2.x, somewhere around 1.2.10, -.\"O via the 1.3.x unstable kernel series.) -システムコールに "2.0" と書かれている場合、 -そのシステムコールがおそらくバージョン 1.3.x のカーネルで登場し、 -安定版のカーネルでは 2.0 で初めて登場したことを意味する。 -(バージョン 2.0 のカーネルは、バージョン 1.2.10 あたりのカーネル 1.2.x -から分岐し、バージョン 1.3.x の不安定版のカーネル系列として開発された。) -.\" Was kernel 2.0 started from a branch of 1.2.10? -.\" At least from the timestamps of the tarballs of -.\" of 1.2.10 and 1.3.0, that's how it looks, but in -.\" fact the diff doesn't seem very clear, the -.\" 1.3.0 .tar.bz is much bigger (2.0 MB) than the -.\" 1.2.10 .tar.bz2 (1.8 MB), and AEB points out the -.\" timestamps of some files in 1.3.0 seem to be older -.\" than those in 1.2.10. All of this suggests -.\" that there might not have been a clean branch point. -.IP * -.\"O Where a system call is marked "2.2" -.\"O this means the system call probably appeared in a 2.1.x kernel version, -.\"O and first appeared in a stable kernel with 2.2.0. -.\"O (Development of the 2.2 kernel was initiated from a branch of kernel -.\"O 2.0.21 via the 2.1.x unstable kernel series.) -システムコールに "2.2" と書かれている場合、 -そのシステムコールがおそらくバージョン 2.1.x のカーネルで登場し、 -安定版のカーネルでは 2.2.0 で初めて登場したことを意味する。 -(バージョン 2.2 のカーネルは、カーネル 2.0.21 から分岐し、 -バージョン 2.1.x の不安定版のカーネル系列として開発された。) -.IP * -.\"O Where a system call is marked "2.4" -.\"O this means the system call probably appeared in a 2.3.x kernel version, -.\"O and first appeared in a stable kernel with 2.4.0. -.\"O (Development of the 2.4 kernel was initiated from a branch of -.\"O kernel 2.2.8 via the 2.3.x unstable kernel series.) -システムコールに "2.4" と書かれている場合、 -そのシステムコールがおそらくバージョン 2.3.x のカーネルで登場し、 -安定版のカーネルでは 2.4.0 で初めて登場したことを意味する。 -(バージョン 2.4 のカーネルは、カーネル 2.2.8 から分岐し、 -バージョン 2.3.x の不安定版のカーネル系列として開発された。) -.IP * -.\"O Where a system call is marked "2.6" -.\"O this means the system call probably appeared in a 2.5.x kernel version, -.\"O and first appeared in a stable kernel with 2.6.0. -.\"O (Development of kernel 2.6 was initiated from a branch -.\"O of kernel 2.4.15 via the 2.5.x unstable kernel series.) -システムコールに "2.6" と書かれている場合、 -そのシステムコールがおそらくバージョン 2.5.x のカーネルで登場し、 -安定版のカーネルでは 2.6.0 で初めて登場したことを意味する。 -(バージョン 2.6 のカーネルは、カーネル 2.4.15 から分岐し、 -バージョン 2.5.x の不安定版のカーネル系列として開発された。) -.IP * -.\"O Starting with kernel 2.6.0, the development model changed, -.\"O and new system calls may appear in each 2.6.x release. -.\"O In this case, the exact version number where the system call appeared -.\"O is shown. -カーネル 2.6.0 から開発モデルは変更され、 -新しいシステムコールが個々の 2.6.x のリリースでも登場するようになった。 -この場合、リストでは、システムコールが登場した -厳密なバージョン番号が記載されている。 -.IP * -.\"O In some cases, a system call was added to a stable kernel -.\"O series after it branched from the previous stable kernel -.\"O series, and then backported into the earlier stable kernel series. -.\"O For example some system calls that appeared in 2.6.x were also backported -.\"O into a 2.4.x release after 2.4.15. -.\"O When this is so, the version where the system call appeared -.\"O in both of the major kernel series is listed. -前の安定版カーネル系列から分岐した後に安定版カーネル系列にシステムコール -が追加された場合、以前の安定版カーネル系列にそのシステムコールが -移植 (backport) されることがある。 -例えば、2.6.x で登場したシステムコールのいくつかは、 -2.4.15 以降の 2.4.x リリースにも backport された。 -この場合、システムコールが登場したバージョンとして、 -両方の安定版系列のバージョンが記載されている。 -.PP -.\"O The list of system calls that are available as at kernel 2.6.33 -.\"O (or in a few cases only on older kernels) is as follows: -カーネル 2.6.33 で利用可能なシステムコールのリストを以下に示す -(それ以前のカーネルでだけ利用可能なものも少数だが含まれる): -.\" -.\" Looking at scripts/checksyscalls.sh in the kernel source is -.\" instructive about i386 specifics. -.\" -.TS -l l l ---- -l l l. -\fBSystem call\fP \fBKernel\fP \fBNotes\fP - -\fB_llseek\fP(2) 1.2 -\fB_newselect\fP(2) -\fB_sysctl\fP(2) -\fBaccept\fP(2) -\fBaccept4\fP(2) 2.6.28 -\fBaccess\fP(2) -\fBacct\fP(2) -\fBadd_key\fP(2) 2.6.11 -\fBadjtimex\fP(2) -\fBafs_syscall\fP(2) Not implemented -\fBalarm\fP(2) -\fBalloc_hugepages\fP(2) 2.5.36 Removed in 2.5.44 -\fBbdflush\fP(2) -\fBbind\fP(2) -\fBbreak\fP(2) Not implemented -\fBbrk\fP(2) -\fBcacheflush\fP(2) 1.2 Not on i386 -\fBcapget\fP(2) 2.2 -\fBcapset\fP(2) 2.2 -\fBchdir\fP(2) -\fBchmod\fP(2) -\fBchown\fP(2) -\fBchown32\fP(2) 2.4 -\fBchroot\fP(2) -\fBclock_getres\fP(2) 2.6 -\fBclock_gettime\fP(2) 2.6 -\fBclock_nanosleep\fP(2) 2.6 -\fBclock_settime\fP(2) 2.6 -\fBclone\fP(2) -\fBclose\fP(2) -\fBconnect\fP(2) -\fBcreat\fP(2) -\fBcreate_module\fP(2) -\fBdelete_module\fP(2) -\fBdup\fP(2) -\fBdup2\fP(2) -\fBdup3\fP(2) 2.6.27 -\fBepoll_create\fP(2) 2.6 -\fBepoll_create1\fP(2) 2.6.27 -\fBepoll_ctl\fP(2) 2.6 -\fBepoll_pwait\fP(2) 2.6.19 -\fBepoll_wait\fP(2) 2.6 -\fBeventfd\fP(2) 2.6.22 -\fBeventfd2\fP(2) 2.6.27 -\fBexecve\fP(2) -\fBexit\fP(2) -\fBexit_group\fP(2) 2.6 -\fBfaccessat\fP(2) 2.6.16 -\fBfadvise64\fP(2) 2.6 -.\" Implements \fBposix_fadvise\fP(2) -\fBfadvise64_64\fP(2) 2.6 -\fBfallocate\fP(2) 2.6.23 -\fBfchdir\fP(2) -\fBfchmod\fP(2) -\fBfchmodat\fP(2) 2.6.16 -\fBfchown\fP(2) -\fBfchown32\fP(2) 2.4 -\fBfchownat\fP(2) 2.6.16 -\fBfcntl\fP(2) -\fBfcntl64\fP(2) 2.4 -\fBfdatasync\fP(2) -\fBfgetxattr\fP(2) 2.6; 2.4.18 -\fBflistxattr\fP(2) 2.6; 2.4.18 -\fBflock\fP(2) 2.0 -\fBfork\fP(2) -\fBfree_hugepages\fP(2) 2.5.36 Removed in 2.5.44 -\fBfremovexattr\fP(2) 2.6; 2.4.18 -\fBfsetxattr\fP(2) 2.6; 2.4.18 -\fBfstat\fP(2) -\fBfstat64\fP(2) 2.4 -\fBfstatat64\fP(2) 2.6.16 -\fBfstatfs\fP(2) -\fBfstatfs64\fP(2) 2.6 -\fBfsync\fP(2) -\fBftime\fP(2) Not implemented -.\" Implemented in glibc; see \fBftime\fP(3) -\fBftruncate\fP(2) -\fBftruncate64\fP(2) 2.4 -\fBfutex\fP(2) 2.6 -\fBfutimesat\fP(2) 2.6.16 -\fBget_kernel_syms\fP(2) -\fBget_mempolicy\fP(2) 2.6.6 -\fBget_robust_list\fP(2) 2.6.17 -\fBget_thread_area\fP(2) 2.6 -\fBgetcpu\fP(2) 2.6.19 -\fBgetcwd\fP(2) 2.2 -\fBgetdents\fP(2) 2.0 -\fBgetdents64\fP(2) 2.4 -\fBgetegid\fP(2) -\fBgetegid32\fP(2) 2.4 -\fBgeteuid\fP(2) -\fBgeteuid32\fP(2) 2.4 -\fBgetgid\fP(2) -\fBgetgid32\fP(2) 2.4 -\fBgetgroups\fP(2) -\fBgetgroups32\fP(2) 2.4 -\fBgetitimer\fP(2) -\fBgetpeername\fP(2) -\fBgetpagesize\fP(2) 2.0 Not on i386 -\fBgetpgid\fP(2) -\fBgetpgrp\fP(2) -\fBgetpid\fP(2) -\fBgetpmsg\fP(2) Not implemented -.\" Reserved for STREAMS support -\fBgetppid\fP(2) -\fBgetpriority\fP(2) -\fBgetresgid\fP(2) 2.2 -\fBgetresgid32\fP(2) 2.4 -\fBgetresuid\fP(2) 2.2 -\fBgetresuid32\fP(2) 2.4 -\fBgetrlimit\fP(2) -\fBgetrusage\fP(2) -\fBgetsid\fP(2) 2.0 -\fBgetsockname\fP(2) -\fBgetsockopt\fP(2) -\fBgettid\fP(2) 2.4.11 -\fBgettimeofday\fP(2) -\fBgetuid\fP(2) -\fBgetuid32\fP(2) 2.4 -.\" \fBgetunwind\fP(2) 2.4.8 ia64; DEPRECATED -\fBgetxattr\fP(2) 2.6; 2.4.18 -\fBgtty\fP(2) Not implemented -\fBidle\fP(2) Not implemented -\fBinit_module\fP(2) -\fBinotify_add_watch\fP(2) 2.6.13 -\fBinotify_init\fP(2) 2.6.13 -\fBinotify_init1\fP(2) 2.6.27 -\fBinotify_rm_watch\fP(2) 2.6.13 -\fBio_cancel\fP(2) 2.6 -\fBio_destroy\fP(2) 2.6 -\fBio_getevents\fP(2) 2.6 -\fBio_setup\fP(2) 2.6 -\fBio_submit\fP(2) 2.6 -\fBioctl\fP(2) -\fBioperm\fP(2) -\fBiopl\fP(2) -\fBioprio_get\fP(2) 2.6.13 -\fBioprio_set\fP(2) 2.6.13 -\fBipc\fP(2) -.\" Implements System V IPC calls -\fBkexec_load\fP(2) 2.6.13 -.\" The entry in the syscall table was reserved starting in 2.6.7 -.\" Was named sys_kexec_load() from 2.6.7 to 2.6.16 -\fBkeyctl\fP(2) 2.6.11 -\fBkill\fP(2) -\fBlchown\fP(2) 2.2 -\fBlchown32\fP(2) 2.4 -\fBlgetxattr\fP(2) 2.6; 2.4.18 -\fBlink\fP(2) -\fBlinkat\fP(2) 2.6.16 -\fBlisten\fP(2) -\fBlistxattr\fP(2) 2.6; 2.4.18 -\fBllistxattr\fP(2) 2.6; 2.4.18 -\fBlock\fP(2) Not implemented -\fBlookup_dcookie\fP(2) 2.6 -\fBlremovexattr\fP(2) 2.6; 2.4.18 -\fBlseek\fP(2) -\fBlsetxattr\fP(2) 2.6; 2.4.18 -\fBlstat\fP(2) -\fBlstat64\fP(2) 2.4 -\fBmadvise\fP(2) 2.4 -\fBmadvise1\fP(2) 2.4 -\fBmbind\fP(2) 2.6.6 -.\" \fBmemory_ordering\fP(2) ??? Sparc64 -\fBmigrate_pages\fP(2) 2.6.16 -\fBmincore\fP(2) 2.4 -\fBmkdir\fP(2) -\fBmkdirat\fP(2) 2.6.16 -\fBmknod\fP(2) -\fBmknodat\fP(2) 2.6.16 -\fBmlock\fP(2) -\fBmlockall\fP(2) -\fBmmap\fP(2) -\fBmmap2\fP(2) 2.4 -\fBmodify_ldt\fP(2) -\fBmount\fP(2) -\fBmove_pages\fP(2) 2.6.18 -\fBmprotect\fP(2) -\fBmpx\fP(2) Not implemented -\fBmq_getsetattr\fP(2) 2.6.6 -.\" Implements \fBmq_getattr\fP(3) and \fBmq_setattr\fP(3) -\fBmq_notify\fP(2) 2.6.6 -\fBmq_open\fP(2) 2.6.6 -\fBmq_timedreceive\fP(2) 2.6.6 -\fBmq_timedsend\fP(2) 2.6.6 -\fBmq_unlink\fP(2) -\fBmremap\fP(2) 2.0 -\fBmsgctl\fP(2) -\fBmsgget\fP(2) -\fBmsgrcv\fP(2) -\fBmsgsnd\fP(2) -\fBmsync\fP(2) 2.0 -.\" \fBmultiplexer\fP(2) ?? __NR_multiplexer reserved on -.\" PowerPC, but unimplemented? -\fBmunlock\fP(2) -\fBmunlockall\fP(2) -\fBmunmap\fP(2) -\fBnanosleep\fP(2) 2.0 -\fBnfsservctl\fP(2) 2.2 -\fBnice\fP(2) -\fBoldfstat\fP(2) -\fBoldlstat\fP(2) -\fBoldolduname\fP(2) -\fBoldstat\fP(2) -\fBolduname\fP(2) -\fBopen\fP(2) -\fBopenat\fP(2) 2.6.16 -\fBpause\fP(2) -\fBpciconfig_iobase\fP(2) 2.2.15; 2.4 Not on i386 -.\" Alpha, PowerPC, ARM; not i386 -\fBpciconfig_read\fP(2) 2.0.26; 2.2 Not on i386 -.\" , PowerPC, ARM; not i386 -\fBpciconfig_write\fP(2) 2.0.26; 2.2 Not on i386 -.\" , PowerPC, ARM; not i386 -\fBperf_event_open\fP(2) 2.6.31 Was called perf_counter_open() - in 2.6.31; renamed in 2.6.32 -\fBpersonality\fP(2) 1.2 -.\" \fBperfctr\fP(2) ??? Sparc32, Sparc64 -.\" \fBperfmonctl\fP(2) ??? ia64 -\fBphys\fP(2) Not implemented -.\" Unimplemented (no slot since 2.1.116) -\fBpipe\fP(2) -\fBpipe2\fP(2) 2.6.27 -\fBpivot_root\fP(2) 2.4 -\fBpoll\fP(2) 2.2 -\fBppoll\fP(2) 2.6.16 -\fBprctl\fP(2) 2.2 -\fBpread64\fP(2) Added as "pread" in 2.2; - renamed "pread64" in 2.6 -\fBpreadv\fP(2) 2.6.30 -\fBprlimit\fP(2) 2.6.36 -\fBprof\fP(2) Not implemented -\fBprofil\fP(2) Not implemented -.\" Implemented in glibc; see \fBprofil\fP(3) -\fBpselect6\fP(2) 2.6.16 -.\" Implements \fBpselect\fP(2) -\fBptrace\fP(2) -\fBputpmsg\fP(2) Not implemented -.\" Reserved for STREAMS support -\fBpwrite64\fP(2) Added as "pwrite" in 2.2; - renamed "pwrite64" in 2.6 -\fBpwritev\fP(2) 2.6.30 -\fBquery_module\fP(2) 2.2 -\fBquotactl\fP(2) -\fBread\fP(2) -\fBreadahead\fP(2) 2.4.13 -\fBreaddir\fP(2) -.\" Supersedes \fBgetdents\fP(2) -\fBreadlink\fP(2) -\fBreadlinkat\fP(2) 2.6.16 -\fBreadv\fP(2) 2.0 -\fBreboot\fP(2) -\fBrecv\fP(2) -\fBrecvfrom\fP(2) -\fBrecvmsg\fP(2) -\fBrecvmmsg\fP(2) 2.6.33 -\fBremap_file_pages\fP(2) 2.6 -\fBremovexattr\fP(2) 2.6; 2.4.18 -\fBrename\fP(2) -\fBrenameat\fP(2) 2.6.16 -\fBrequest_key\fP(2) 2.6.11 -\fBrestart_syscall\fP(2) 2.6 -\fBrmdir\fP(2) -\fBrt_sigaction\fP(2) 2.2 -\fBrt_sigpending\fP(2) 2.2 -\fBrt_sigprocmask\fP(2) 2.2 -\fBrt_sigqueueinfo\fP(2) 2.2 -.\" Implements \fBsigqueue\fP(2) -\fBrt_sigreturn\fP(2) 2.2 -\fBrt_sigsuspend\fP(2) 2.2 -\fBrt_sigtimedwait\fP(2) 2.2 -\fBrt_tgsigqueueinfo\fP(2) 2.6.31 -.\" Implements \fBpthread_sigqueue\fP(3) -\fBsched_get_priority_max\fP(2) 2.0 -\fBsched_get_priority_min\fP(2) 2.0 -\fBsched_getaffinity\fP(2) 2.6 -\fBsched_getparam\fP(2) 2.0 -\fBsched_getscheduler\fP(2) 2.0 -\fBsched_rr_get_interval\fP(2) 2.0 -\fBsched_setaffinity\fP(2) 2.6 -\fBsched_setparam\fP(2) 2.0 -\fBsched_setscheduler\fP(2) 2.0 -\fBsched_yield\fP(2) 2.0 -\fBsecurity\fP(2) Not implemented -\fBselect\fP(2) -\fBsemctl\fP(2) -\fBsemget\fP(2) -\fBsemop\fP(2) -\fBsemtimedop\fP(2) 2.6; 2.4.22 -\fBsend\fP(2) -\fBsendfile\fP(2) 2.2 -\fBsendfile64\fP(2) 2.6; 2.4.19 -\fBsendmsg\fP(2) -\fBsendto\fP(2) -\fBset_mempolicy\fP(2) 2.6.6 -\fBset_robust_list\fP(2) 2.6.17 -\fBset_thread_area\fP(2) 2.6 -\fBset_tid_address\fP(2) 2.6 -\fBset_zone_reclaim\fP(2) 2.6.13 Removed in 2.6.16 (was never - available to userspace) -.\" See http://lkml.org/lkml/2005/8/1/83 -.\" "[PATCH] remove sys_set_zone_reclaim()" -\fBsetdomainname\fP(2) -\fBsetfsgid\fP(2) 1.2 -\fBsetfsgid32\fP(2) 2.4 -\fBsetfsuid\fP(2) 1.2 -\fBsetfsuid32\fP(2) 2.4 -\fBsetgid\fP(2) -\fBsetgid32\fP(2) 2.4 -\fBsetgroups\fP(2) -\fBsetgroups32\fP(2) 2.4 -\fBsethostname\fP(2) -\fBsetitimer\fP(2) -\fBsetpgid\fP(2) -\fBsetpriority\fP(2) -\fBsetregid\fP(2) -\fBsetregid32\fP(2) 2.4 -\fBsetresgid\fP(2) 2.2 -\fBsetresgid32\fP(2) 2.4 -\fBsetresuid\fP(2) 2.2 -\fBsetresuid32\fP(2) 2.4 -\fBsetreuid\fP(2) -\fBsetreuid32\fP(2) 2.4 -\fBsetrlimit\fP(2) -\fBsetsid\fP(2) -\fBsetsockopt\fP(2) -\fBsettimeofday\fP(2) -\fBsetuid\fP(2) -\fBsetuid32\fP(2) 2.4 -\fBsetup\fP(2) Removed in 2.2 -\fBsetxattr\fP(2) 2.6; 2.4.18 -\fBsgetmask\fP(2) -\fBshmat\fP(2) -\fBshmctl\fP(2) -\fBshmdt\fP(2) -\fBshmget\fP(2) -\fBshutdown\fP(2) -\fBsigaction\fP(2) -\fBsigaltstack\fP(2) 2.2 -\fBsignal\fP(2) -\fBsignalfd\fP(2) 2.6.22 -\fBsignalfd4\fP(2) 2.6.27 -\fBsigpending\fP(2) -\fBsigprocmask\fP(2) -\fBsigreturn\fP(2) -\fBsigsuspend\fP(2) -\fBsocket\fP(2) -\fBsocketcall\fP(2) -.\" Implements BSD socket calls -\fBsocketpair\fP(2) -\fBsplice\fP(2) 2.6.17 -\fBspu_create\fP(2) 2.6.16 PowerPC only -\fBspu_run\fP(2) 2.6.16 PowerPC only -\fBssetmask\fP(2) -\fBstat\fP(2) -\fBstat64\fP(2) 2.4 -\fBstatfs\fP(2) -\fBstatfs64\fP(2) 2.6 -\fBstime\fP(2) -\fBstty\fP(2) Not implemented -\fBsubpage_prot\fP(2) 2.6.25 PowerPC if CONFIG_PPC_64K_PAGES -\fBswapoff\fP(2) -\fBswapon\fP(2) -\fBsymlink\fP(2) -\fBsymlinkat\fP(2) 2.6.16 -\fBsync\fP(2) -\fBsync_file_range\fP(2) 2.6.17 -\fBsync_file_range2\fP(2) 2.6.22 Architecture-specific variant -.\" PowerPC, ARM, tile -.\" First appeared on ARM, as arm_sync_file_range(), but later renamed - of \fBsync_file_range\fP(2) -.\" \fBsys_debug_setcontext\fP(2) ??? PowerPC if CONFIG_PPC32 -\fBsysfs\fP(2) 1.2 -\fBsysinfo\fP(2) -\fBsyslog\fP(2) -.\" glibc interface is \fBklogctl\fP(3) -\fBtee\fP(2) 2.6.17 -\fBtgkill\fP(2) 2.6 -\fBtime\fP(2) -\fBtimer_create\fP(2) 2.6 -\fBtimer_delete\fP(2) 2.6 -\fBtimer_getoverrun\fP(2) 2.6 -\fBtimer_gettime\fP(2) 2.6 -\fBtimer_settime\fP(2) 2.6 -\fBtimerfd_create\fP(2) 2.6.25 -\fBtimerfd_gettime\fP(2) 2.6.25 -\fBtimerfd_settime\fP(2) 2.6.25 -\fBtimes\fP(2) -\fBtkill\fP(2) 2.6; 2.4.22 -\fBtruncate\fP(2) -\fBtruncate64\fP(2) 2.4 -\fBtuxcall\fP(2) Not implemented -.\" Unimplemented; no slot on i386 -.\" As at 2.6.22, tuxcall has a slot on PowerPC, x86_64, and alpha -\fBugetrlimit\fP(2) 2.4 -\fBulimit\fP(2) Not implemented -.\" Implemented in glibc; see \fBulimit\fP(3) -\fBumask\fP(2) -\fBumount\fP(2) -.\" sys_oldumount() -- __NR_umount -\fBumount2\fP(2) 2.2 -.\" sys_umount() -- __NR_umount2 -\fBuname\fP(2) -\fBunlink\fP(2) -\fBunlinkat\fP(2) 2.6.16 -\fBunshare\fP(2) 2.6.16 -\fBuselib\fP(2) -\fBustat\fP(2) -\fButime\fP(2) -\fButimensat\fP(2) 2.6.22 -\fButimes\fP(2) 2.2 -\fBvfork\fP(2) -\fBvhangup\fP(2) -\fBvm86old\fP(2) -.\" Superseded by \fBvm86\fP(2) -\fBvmsplice\fP(2) 2.6.17 -\fBvserver\fP(2) Not implemented -\fBwait4\fP(2) -\fBwaitid\fP(2) 2.6.10 -\fBwaitpid\fP(2) -\fBwrite\fP(2) -\fBwritev\fP(2) 2.0 -.TE -.PP -.\"O On many platforms, including i386, socket calls are all multiplexed -.\"O (via glibc wrapper functions) through -.\"O .BR socketcall (2) -.\"O and similarly System V IPC calls are multiplexed through -.\"O .BR ipc (2). -i386 を含む多くのプラットフォームでは、ソケット関連のシステムコールは -(glibc のラッパー関数を介してだが) すべて -.BR socketcall (2) -経由に多重されている。 -同様に、System V IPC 関連のシステムコールは -.BR ipc (2) -経由に多重されている。 -.\"O .SH NOTES -.SH 注意 -.\"O Note the following points: -以下の点に留意すること: -.IP * 3 -.\"O Although slots are reserved for them in the system call table, -.\"O the following system calls are not implemented in the standard kernel: -以下のシステムコールは、 -システムコール・テーブルにスロットが予約されているが、 -標準のカーネルには実装されていない: -.BR afs_syscall (2), \" __NR_afs_syscall is 53 on Linux 2.6.22/i386 -.BR break (2), \" __NR_break is 17 on Linux 2.6.22/i386 -.BR ftime (2), \" __NR_ftime is 35 on Linux 2.6.22/i386 -.BR getpmsg (2), \" __NR_getpmsg is 188 on Linux 2.6.22/i386 -.BR gtty (2), \" __NR_gtty is 32 on Linux 2.6.22/i386 -.BR idle (2), \" __NR_idle is 112 on Linux 2.6.22/i386 -.BR lock (2), \" __NR_lock is 53 on Linux 2.6.22/i386 -.BR madvise1 (2), \" __NR_madvise1 is 219 on Linux 2.6.22/i386 -.BR mpx (2), \" __NR_mpx is 66 on Linux 2.6.22/i386 -.BR phys (2), \" Slot has been reused -.BR prof (2), \" __NR_prof is 44 on Linux 2.6.22/i386 -.BR profil (2), \" __NR_profil is 98 on Linux 2.6.22/i386 -.BR putpmsg (2), \" __NR_putpmsg is 189 on Linux 2.6.22/i386 -.\" __NR_security is 223 on Linux 2.4/i386; absent on 2.6/i386, present -.\" on a couple of 2.6 architectures -.BR security (2), \" __NR_security is 223 on Linux 2.4/i386 -.BR stty (2), \" __NR_stty is 31 on Linux 2.6.22/i386 -.BR tuxcall (2), \" __NR_tuxcall is 184 on x86_64, also on PPC and alpha -.BR ulimit (2), \" __NR_ulimit is 58 on Linux 2.6.22/i386 -.\"O and -.BR vserver (2) \" __NR_vserver is 273 on Linux 2.6.22/i386 -.\"O (see also -.\"O .BR unimplemented (2)). -.RB ( unimplemented (2) -も参照)。 -.\"O However, -.\"O .BR ftime (3), -.\"O .BR profil (3) -.\"O and -.\"O .BR ulimit (3) -.\"O exist as library routines. -しかし、 -.BR ftime (3), -.BR profil (3), -.BR ulimit (3) -はライブラリ・ルーチンとして実装されている。 -.\"O The slot for -.\"O .BR phys (2) -.\"O is in use since kernel 2.1.116 for -.\"O .BR umount (2); -.\"O .BR phys (2) -.\"O will never be implemented. -.BR phys (2) -用の場所は 2.1.116 以降では -.BR umount (2) -用に使用されている; -将来においても -.BR phys (2) -は実装されない。 -.IP * -.\"O The -.\"O .BR getpmsg (2) -.\"O and -.\"O .BR putpmsg (2) -.\"O calls are for kernels patched to support STREAMS, -.\"O and may never be in the standard kernel. -.BR getpmsg (2) -と -.BR putpmsg (2) -は、ストリーム対応のパッチが当てられたカーネル用のもので、 -標準のカーネルに存在することは今後もない。 -.\" The security call is for future use. -.PP -.\"O Roughly speaking, the code belonging to the system call -.\"O with number __NR_xxx defined in -.\"O .I /usr/include/asm/unistd.h -.\"O can be found in the kernel source in the routine -.\"O .IR sys_xxx (). -.\"O (The dispatch table for i386 can be found in -.\"O .IR /usr/src/linux/arch/i386/kernel/entry.S .) -たいていは、 -.I /usr/include/asm/unistd.h -で定義されている番号 __NR_xxx のシステムコールのコードは、 -カーネル・ソースの -.IR sys_xxx () -というルーチンに書かれている -(i386 における実行テーブルは -.I /usr/src/linux/arch/i386/kernel/entry.S -に書かれている)。 -.\"O There are many exceptions, however, mostly because -.\"O older system calls were superseded by newer ones, -.\"O and this has been treated somewhat unsystematically. -.\"O On platforms with -.\"O proprietary OS emulation, such as parisc, sparc, sparc64 and alpha, -.\"O there are many additional system calls; mips64 also contains a full -.\"O set of 32-bit system calls. -しかしこれには多くの例外がある。古いシステムコールは新版に置き換えられて -きたが、この置き換えはあまり体系立てて行われて来なかったからである。 -parisc, sparc, sparc64, alpha といったプロプリエタリ OS のエミュレーション -機能があるプラットフォームでは、多くの追加システムコールがある。 -mips64 には、32 ビットシステムコールのフルセットも含まれている。 - -.\"O Over time, changes to the interfaces of some system calls have been -.\"O necessary. -.\"O One reason for such changes was the need to increase the size of -.\"O structures or scalar values passed to the system call. -時間の経過とともに、いくつかのシステムコールではインタフェースの -変更が必要になってきた。 -こうした変更の理由の一つは、システムコールに渡される構造体やスカラー値 -のサイズを増やす必要があることだった。 -.\"O Because of these changes, there are now various groups -.\"O of related system calls -.\"O (e.g., -.\"O .BR truncate (2) -.\"O and -.\"O .BR truncate64 (2)) -.\"O which perform similar tasks, but which vary in -.\"O details such as the size of their arguments. -これらの変更の結果、現在では、同様の処理を実行するが -引き数のサイズなどの詳細は異なる、一連のシステムコール群が -いくつか存在する -(例えば、 -.BR truncate (2) -と -.BR truncate64 (2))。 -.\"O (As noted earlier, applications are generally unaware of this: -.\"O the glibc wrapper functions do some work to ensure that the right -.\"O system call is invoked, and that ABI compatibility is -.\"O preserved for old binaries.) -(すでに述べたように、 -一般にはアプリケーションがこのことを意識することはない。 -glibc のラッパー関数が、適切なシステムコールを起動し、古いバイナリに -対して ABI レベルでの互換性を保持することを保証する処理を行っている。) -.\"O Examples of systems calls that exist in multiple versions are -.\"O the following: -複数のバージョンが存在するシステムコールの例を以下に挙げる。 -.IP * 3 -.\"O By now there are three different versions of -.\"O .BR stat (2): -.\"O .IR sys_stat () -.\"O (slot -.\"O .IR __NR_oldstat ), -.\"O .IR sys_newstat () -.\"O (slot -.\"O .IR __NR_stat ), -.\"O and -.\"O .IR sys_stat64 () -.\"O (slot -.\"O .IR __NR_stat64 ), -.\"O with the last being the most current. -これまでに、 -.BR stat (2) -には 3 種類の異なるバージョンが存在する。 -.IR sys_stat () -(スロットは -.IR __NR_oldstat )、 -.IR sys_newstat () -(スロットは -.IR __NR_stat )、 -.IR sys_stat64 () -(カーネル 2.4 で導入; スロットは -.IR __NR_stat64 )。 -3つのうち最後のものが最新である。 -.\" e.g., on 2.6.22/i386: __NR_oldstat 18, __NR_stat 106, __NR_stat64 195 -.\" The stat system calls deal with three different data structures, -.\" defined in include/asm-i386/stat.h: __old_kernel_stat, stat, stat64 -.\"O A similar story applies for -.\"O .BR lstat (2) -.\"O and -.\"O .BR fstat (2). -.BR lstat (2) -と -.BR fstat (2) -についても同様である。 -.IP * -.\"O Similarly, the defines -.\"O .IR __NR_oldolduname , -.\"O .IR __NR_olduname , -.\"O and -.\"O .I __NR_uname -.\"O refer to the routines -.\"O .IR sys_olduname (), -.\"O .IR sys_uname () -.\"O and -.\"O .IR sys_newuname (). -また、 -.IR __NR_oldolduname , -.IR __NR_olduname , -.I __NR_uname -という定義は、それぞれ -.IR sys_olduname (), -.IR sys_uname (), -.IR sys_newuname () -というルーチンを参照している。 -.IP * -.\"O In Linux 2.0, a new version of -.\"O .BR vm86 (2) -.\"O appeared, with the old and the new kernel routines being named -.\"O .IR sys_vm86old () -.\"O and -.\"O .IR sys_vm86 (). -Linux 2.0 では、 -.BR vm86 (2) -の新バージョンが登場した。カーネルルーチンの -古いバージョン、新しいバージョンはそれぞれ -.IR sys_vm86old (), -.IR sys_vm86 () -という名前である。 -.IP * -.\"O In Linux 2.4, a new version of -.\"O .BR getrlimit (2) -.\"O appeared, with the old and the new kernel routines being named -.\"O .IR sys_old_getrlimit () -.\"O (slot -.\"O .IR __NR_getrlimit ) -.\"O and -.\"O .IR sys_getrlimit () -.\"O (slot -.\"O .IR __NR_ugetrlimit ). -Linux 2.4 では、 -.BR getrlimit (2) -の新バージョンが登場した。カーネルルーチンの -古いバージョン、新しいバージョンはそれぞれ -.IR sys_old_getrlimit () -(スロットは -.IR __NR_getrlimit ), -.IR sys_getrlimit () -(スロットは -.IR __NR_ugetrlimit ) -という名前である。 -.IP * -.\"O Linux 2.4 increased the size of user and group IDs from 16 to 32 bits. -Linux 2.4 で、ユーザ ID とグループ ID のサイズが -16 ビットから 32 ビットに増えた。 -.\" 64-bit off_t changes: ftruncate64, *stat64, -.\" fcntl64 (because of the flock structure), getdents64, *statfs64 -.\"O To support this change, a range of system calls were added -.\"O (e.g., -.\"O .BR chown32 (2), -.\"O .BR getuid32 (2), -.\"O .BR getgroups32 (2), -.\"O .BR setresuid32 (2)), -.\"O superseding earlier calls of the same name without the -.\"O "32" suffix. -この変更に対応するため、いくつかのシステムコールが追加された -.RB ( chown32 (2), -.BR getuid32 (2), -.BR getgroups32 (2), -.BR setresuid32 (2) -など)。 -これらのシステムコールが、末尾の "32" が付かない同名の -古いバージョンに代わって使われるようになった。 -.IP * -.\"O Linux 2.4 added support for applications on 32-bit architectures -.\"O to access large files (i.e., files for which the sizes and -.\"O file offsets can't be represented in 32 bits.) -.\"O To support this change, replacements were required for system calls -.\"O that deal with file offsets and sizes. -.\"O Thus the following system calls were added: -.\"O .BR fcntl64 (2), -.\"O .BR ftruncate64 (2), -.\"O .BR getdents64 (2), -.\"O .BR stat64 (2), -.\"O .BR statfs64 (2), -.\"O and their analogs that work with file descriptors or -.\"O symbolic links. -.\"O These system calls supersede the older system calls -.\"O which, except in the case of the "stat" calls, -.\"O have the same name without the "64" suffix. -Linux 2.4 では、32 ビット・アーキテクチャ上のアプリケーションが -大きなファイル (つまり、32 ビットでは表現できないサイズや -ファイル・オフセットが必要なファイル) にアクセスできるようになった。 -この変更に対応するため、ファイル・オフセットとサイズを扱う -システムコールの置き換えが必要となった。その結果、 -.BR fcntl64 (2), -.BR ftruncate64 (2), -.BR getdents64 (2), -.BR stat64 (2), -.BR statfs64 (2) -と、ファイルディスクリプタやシンボリックリンクで同じ機能を持つ -システムコールが追加された。 -これらのシステムコールが、末尾の "64" が付かない同名の -古いバージョンに代わって使われるようになった。 -但し、"stat" 系のシステムコールはその限りではない。 - -.\"O On newer platforms that only have 64-bit file access and 32-bit uids -.\"O (e.g., alpha, ia64, s390x) there are no *64 or *32 calls. -.\"O Where the *64 and *32 calls exist, the other versions are obsolete. -64-bit ファイルアクセスと 32-bit UID のみを持つ -新しいプラットフォーム (alpha, ia64, s390x など) では、 -*64 や *32 という名前のシステムコールはない。 -*64 や *32 というシステムコールが存在する場合、 -*64 や *32 がついていないシステムコールは廃止扱いである。 -.IP * -.\"O The -.\"O .I rt_sig* -.\"O calls were added in kernel 2.2 to support the addition -.\"O of real-time signals (see -.\"O .BR signal (7)). -.\"O These system calls supersede the older system calls of the same -.\"O name without the "rt_" prefix. -リアルタイムシグナル -.RB ( signal (7) -参照) への対応を追加するために、 -.I rt_sig* -系のシステムコールがカーネル 2.2 で追加された。 -これらのシステムコールが、先頭に "rt_" が付かない同名の -古いバージョンに代わって使われるようになった。 -.IP * -.\"O The -.\"O .BR select (2) -.\"O and -.\"O .BR mmap (2) -.\"O system calls use five or more arguments, -.\"O which caused problems the way -.\"O argument passing on the i386 used to be set up. -.BR select (2) -と -.BR mmap (2) -は 5つもしくはそれ以上の引き数を使用しており、 -i386 では引き数の受け渡しに問題が生じる。 -.\"O Thus, while other architectures have -.\"O .IR sys_select () -.\"O and -.\"O .IR sys_mmap () -.\"O corresponding to -.\"O .I __NR_select -.\"O and -.\"O .IR __NR_mmap , -.\"O on i386 one finds -.\"O .IR old_select () -.\"O and -.\"O .IR old_mmap () -.\"O (routines that use a pointer to a -.\"O argument block) instead. -そのため、他のアーキテクチャでは -.I __NR_select -と -.I __NR_mmap -に対応する -.IR sys_select () -と -.IR sys_mmap () -が存在するが、i386 では代わりに -.IR old_select () -と -.IR old_mmap () -というルーチンがある -(これらのルーチンは引き数ブロックへのポインタを使用する)。 -.\"O These days passing five arguments -.\"O is not a problem any more, and there is a -.\"O .I __NR__newselect -.\"O .\" (used by libc 6) -.\"O that corresponds directly to -.\"O .IR sys_select () -.\"O and similarly -.\"O .IR __NR_mmap2 . -現在では 5つの引き数を渡すことはもはや問題ではなくなっており、 -.\" (libc 6 で使用される) -.I __NR__newselect -は -.IR sys_select () -に直接対応するようになっている。 -.I __NR_mmap2 -についても同様である。 -.\" .PP -.\" Two system call numbers, -.\" .IR __NR__llseek -.\" and -.\" .IR __NR__sysctl -.\" have an additional underscore absent in -.\" .IR sys_llseek () -.\" and -.\" .IR sys_sysctl (). -.\" -.\" In kernel 2.1.81, -.\" .BR lchown (2) -.\" and -.\" .BR chown (2) -.\" were swapped; that is, -.\" .BR lchown (2) -.\" was added with the semantics that were then current for -.\" .BR chown (2), -.\" and the semantics of the latter call were changed to what -.\" they are today. -.\"O .SH SEE ALSO -.SH 関連項目 -.BR syscall (2), -.BR unimplemented (2), -.BR libc (7) diff --git a/draft/man2/sysctl.2 b/draft/man2/sysctl.2 index 3eae9306..f40a596d 100644 --- a/draft/man2/sysctl.2 +++ b/draft/man2/sysctl.2 @@ -25,49 +25,26 @@ .\" Modified Tue Oct 22 22:28:41 1996 by Eric S. Raymond .\" Modified Mon Jan 5 20:31:04 1998 by aeb. .\" -.\" Japanese Version Copyright (c) 1997-1998 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1997-12-12, HANATAKA Shinya -.\" Modified 1998-05-11, HANATAKA Shinya -.\" Updated 2007-10-11, Akihiro MOTOKI , LDP v2.66 +.\"******************************************************************* .\" -.\"WORD: parameter パラメーター -.\"WORD: kernel カーネル -.\"WORD: hostname ホストネーム -.\"WORD: open オープン -.\"WORD: directory ディレクトリ -.\"WORD: tree ツリー +.\" This file was generated with po4a. Translate the source file. .\" -.TH SYSCTL 2 2008-11-20 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH SYSCTL 2 2008\-11\-20 Linux "Linux Programmer's Manual" .SH 名前 -.\"O sysctl \- read/write system parameters sysctl \- システム・パラメーターを読み書きする -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .br -.B #include +\fB#include \fP .sp -.BI "int _sysctl(struct __sysctl_args *" args ); +\fBint _sysctl(struct __sysctl_args *\fP\fIargs\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O .B Do not use this system call! -.\"O See NOTES. -.B このシステムコールを使用しないこと! -「注意」の節を参照。 +\fBこのシステムコールを使用しないこと!\fP 「注意」の節を参照。 -.\"O The -.\"O .BR _sysctl () -.\"O call reads and/or writes kernel parameters. -.\"O For example, the hostname, -.\"O or the maximum number of open files. -.\"O The argument has the form -.BR _sysctl () -コールはカーネルパラメーターを読み書きする。例えば、 -ホストネームや同時にオープンできるファイルの最大数など。 +\fB_sysctl\fP() コールはカーネルパラメーターを読み書きする。例えば、 ホストネームや同時にオープンできるファイルの最大数など。 引き数は以下の形式である。 .PP .in +4n @@ -84,128 +61,39 @@ struct __sysctl_args { .fi .in .PP -.\"O This call does a search in a tree structure, possibly resembling -.\"O a directory tree under -.\"O .IR /proc/sys , -.\"O and if the requested item is found calls some appropriate routine -.\"O to read or modify the value. -このコールは -.I /proc/sys -の下のディレクトリ・ツリーに似た木構造(tree structure)を検索する。 -そして、要求された項目が見つかった場合は適切なルーチンを呼び出して -値を読んだり修正したりする。 -.\"O .SH "RETURN VALUE" +このコールは \fI/proc/sys\fP の下のディレクトリ・ツリーに似た木構造(tree structure)を検索する。 +そして、要求された項目が見つかった場合は適切なルーチンを呼び出して 値を読んだり修正したりする。 .SH 返り値 -.\"O Upon successful completion, -.\"O .BR _sysctl () -.\"O returns 0. -.\"O Otherwise, a value of \-1 is returned and -.\"O .I errno -.\"O is set to indicate the error. -成功した場合は -.BR _sysctl () -は 0 を返す。失敗した場合、\-1 が返され、 -.I errno -がそのエラーを示す値に設定される。 -.\"O .SH ERRORS +成功した場合は \fB_sysctl\fP() は 0 を返す。失敗した場合、\-1 が返され、 \fIerrno\fP がそのエラーを示す値に設定される。 .SH エラー -.TP -.B EFAULT -.\"O The invocation asked for the previous value by setting -.\"O .I oldval -.\"O non-NULL, but allowed zero room in -.\"O .IR oldlenp . -.I oldval -に NULL でない値を設定して、以前の値を要求しているのに、 -.I oldlenp -に空きがない。 -.TP -.B ENOTDIR -.\"O .I name -.\"O was not found. -.I name -が見つからなかった。 -.TP -.B EPERM -.\"O No search permission for one of the encountered "directories", -.\"O or no read permission where -.\"O .I oldval -.\"O was nonzero, or no write permission where -.\"O .I newval -.\"O was nonzero. -「ディレクトリ」のどれかに検索許可がなかったか、 -.I oldval -が 0 でないのに読み込み許可がなかったか、 -.I newval -が 0 でないのに書き込み許可がなかった。 -.\"O .SH "CONFORMING TO" +.TP +\fBEFAULT\fP +\fIoldval\fP に NULL でない値を設定して、以前の値を要求しているのに、 \fIoldlenp\fP に空きがない。 +.TP +\fBENOTDIR\fP +\fIname\fP が見つからなかった。 +.TP +\fBEPERM\fP +「ディレクトリ」のどれかに検索許可がなかったか、 \fIoldval\fP が 0 でないのに読み込み許可がなかったか、 \fInewval\fP が 0 +でないのに書き込み許可がなかった。 .SH 準拠 -.\"O This call is Linux-specific, and should not be used in programs -.\"O intended to be portable. -このコールは Linux 特有であり、移植を意図したプログラムで使用しては -いけない。 -.\"O A -.\"O .BR sysctl () -.\"O call has been present in Linux since version 1.3.57. -.\"O It originated in -.\"O 4.4BSD. -.\"O Only Linux has the -.\"O .I /proc/sys -.\"O mirror, and the object naming schemes differ between Linux and 4.4BSD, -.\"O but the declaration of the -.\"O .BR sysctl () -.\"O function is the same in both. -.SH 歴史 -.BR sysctl () -コールは -Linux のバージョン 1.3.57 から存在している。 -これは 4.4BSD に由来している。Linux は -.I /proc/sys -に写し(mirror)をもっており、項目の名前の付け方が Linux と 4.4BSD では -異っている。しかし -.BR sysctl () +このコールは Linux 特有であり、移植を意図したプログラムで使用しては いけない。 \fBsysctl\fP() コールは Linux のバージョン +1.3.57 から存在している。 これは 4.4BSD に由来している。Linux は \fI/proc/sys\fP +に写し(mirror)をもっており、項目の名前の付け方が Linux と 4.4BSD では 異っている。しかし \fBsysctl\fP() 関数の宣言は両方で同じである。 -.\"O .SH NOTES .SH 注意 -.\"O Glibc does not provide a wrapper for this system call; call it using -.\"O .BR syscall (2). -glibc はこのシステムコールに対するラッパー関数を提供していない。 -.BR syscall (2) -を使って呼び出すこと。 +glibc はこのシステムコールに対するラッパー関数を提供していない。 このシステムコールは呼び出すには \fBsyscall\fP(2) を使うこと。 -.\"O Or rather... don't call it: -.\"O use of this system call has long been discouraged, -.\"O and it is so unloved that -.\"O \fBit is likely to disappear in a future kernel version\fP. -.\"O .\" See http://lwn.net/Articles/247243/ -.\"O Remove it from your programs now; use the -.\"O .I /proc/sys -.\"O interface instead. -というよりは・・・このシステムコールを呼び出さないこと。 -長い間このシステムコールの使用は非推奨とされており、 -「将来のバージョンのカーネルで削除されるようだ」と言われるほどである。 -.\" http://lwn.net/Articles/247243/ 参照 -あなたのプログラムにこのシステムコールがあれば、すぐにでも削除すること。 -代わりに -.I /proc/sys -インターフェースを使用すること。 -.\"O .SH BUGS +.\" See http://lwn.net/Articles/247243/ +というよりは・・・このシステムコールを呼び出さないこと。 長い間このシステムコールの使用は非推奨とされており、 +「将来のバージョンのカーネルで削除されるようだ」と言われるほどである。 あなたのプログラムにこのシステムコールがあれば、すぐにでも削除すること。 +代わりに \fI/proc/sys\fP インターフェースを使用すること。 .SH バグ -.\"O The object names vary between kernel versions, -.\"O making this system call worthless for applications. -オブジェクトの名前は、カーネルのバージョンごとに異なっている。 -このため、このシステム・コールはアプリケーションにとって -無価値なものとなっている。 +オブジェクトの名前は、カーネルのバージョンごとに異なっている。 このため、このシステム・コールはアプリケーションにとって 無価値なものとなっている。 .PP -.\"O Not all available objects are properly documented. 全ての可能な項目が正確に記述されているわけではない。 .PP -.\"O It is not yet possible to change operating system by writing to -.\"O .IR /proc/sys/kernel/ostype . -今のところ -.I /proc/sys/kernel/ostype -に書き込むことでオペーレーティング・システムを変えることはできない。 -.\"O .SH EXAMPLE +今のところ \fI/proc/sys/kernel/ostype\fP に書き込むことでオペーレーティング・システムを変えることはできない。 .SH 例 .nf #define _GNU_SOURCE @@ -240,10 +128,9 @@ main(void) perror("_sysctl"); exit(EXIT_FAILURE); } - printf("This machine is running %*s\\n", osnamelth, osname); + printf("This machine is running %*s\en", osnamelth, osname); exit(EXIT_SUCCESS); } .fi -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR proc (5) +\fBproc\fP(5) diff --git a/draft/man2/sysinfo.2 b/draft/man2/sysinfo.2 index 6cb1bd54..e387d3ce 100644 --- a/draft/man2/sysinfo.2 +++ b/draft/man2/sysinfo.2 @@ -9,38 +9,22 @@ .\" .\" Modified Sat Jul 24 12:35:12 1993 by Rik Faith .\" Modified Tue Oct 22 22:29:51 1996 by Eric S. Raymond -.\" Modified Mon Aug 25 16:06:11 1997 by Nicolas Lichtmaier +.\" Modified Mon Aug 25 16:06:11 1997 by Nicolás Lichtmaier .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Tue Mar 4 00:04:15 JST 1997 -.\" by HANATAKA Shinya -.\" Modified Mon Sep 23 21:56:40 JST 2000 -.\" by HANATAKA Shinya +.\"******************************************************************* .\" -.\"WORD: library ライブラリ -.\"WORD: statistic 統計 -.\"WORD: pointer ポインター -.\"WORD: prototype 型宣言 +.\" This file was generated with po4a. Translate the source file. .\" -.TH SYSINFO 2 2007-11-15 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH SYSINFO 2 2007\-11\-15 Linux "Linux Programmer's Manual" .SH 名前 -.\"O sysinfo \- returns information on overall system statistics sysinfo \- システム全体の統計情報を返す。 -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int sysinfo(struct sysinfo *" info ); -.\"O .SH DESCRIPTION +\fBint sysinfo(struct sysinfo *\fP\fIinfo\fP\fB);\fP .SH 説明 -.\"O Until Linux 2.3.16, -.\"O .BR sysinfo () -.\"O used to return information in the following structure: -Linux 2.3.16 までは -.BR sysinfo () -は以下の構造体に情報を入れて返す。 +Linux 2.3.16 までは \fBsysinfo\fP() は以下の構造体に情報を入れて返す。 .nf .in +4n @@ -59,11 +43,8 @@ struct sysinfo { .in .fi .PP -.\"O and the sizes were given in bytes. ここでバイト単位で与えられる。 -.\"O Since Linux 2.3.23 (i386), 2.3.48 -.\"O (all architectures) the structure is: Linux 2.3.23 (i386)、2.3.48 (全てのアーキテクチャ) からは構造体は .nf @@ -86,52 +67,19 @@ struct sysinfo { .in .fi .PP -.\"O and the sizes are given as multiples of \fImem_unit\fP bytes. となり、大きさは \fImem_unit\fP バイトの倍数で与えられる。 -.\"O .BR sysinfo () -.\"O provides a simple way of getting overall system statistics. -.\"O This is more -.\"O portable than reading \fI/dev/kmem\fP. -.BR sysinfo () -はシステム全体の統計を取得する簡単な方法を提供する。 -これは \fI/dev/kmem\fP を読むよりも移植性の高い方法である。 -.\"O .SH "RETURN VALUE" +\fBsysinfo\fP() はシステム全体の統計を取得する簡単な方法を提供する。 これは \fI/dev/kmem\fP を読むよりも移植性の高い方法である。 .SH 返り値 -.\"O On success, zero is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合はゼロが返される。エラーならば \-1 が返され、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS +成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP -.B EFAULT -.\"O pointer to \fIstruct\ sysinfo\fP is invalid -.I sysinfo 構造体 -へのポインターが不正である。 -.\"O .SH "CONFORMING TO" +.TP +\fBEFAULT\fP +\fIsysinfo 構造体\fP へのポインターが不正である。 .SH 準拠 -.\"O This function is Linux-specific, and should not be used in programs -.\"O intended to be portable. -この関数は Linux 特有であり、移植を意図したプログラムでは -使用してはいけない。 +この関数は Linux 特有であり、移植を意図したプログラムでは 使用すべきでない。 .sp -.\"O The Linux kernel has a -.\"O .BR sysinfo () -.\"O system call since 0.98.pl6. -Linux カーネルは 0.98.pl6 から -.BR sysinfo () -システムコールを持っている。 -.\"O Linux libc contains a -.\"O .BR sysinfo () -.\"O routine since 5.3.5, and -.\"O glibc has one since 1.90. -Linux の libc は 5.3.5 より、glibc では 1.90 より -.BR sysinfo () -ルーチンを含んでいる。 -.\"O .SH "SEE ALSO" +Linux カーネルは 0.98.pl6 から \fBsysinfo\fP() システムコールを持っている。 Linux の libc は 5.3.5 +より、glibc では 1.90 より \fBsysinfo\fP() ルーチンを含んでいる。 .SH 関連項目 -.BR proc (5) +\fBproc\fP(5) diff --git a/draft/man2/time.2 b/draft/man2/time.2 index 62b3a971..539aa937 100644 --- a/draft/man2/time.2 +++ b/draft/man2/time.2 @@ -26,98 +26,42 @@ .\" Modified Sat Jul 24 14:13:40 1993 by Rik Faith .\" Additions by Joseph S. Myers , 970909 .\" -.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki -.\" all rights reserved. -.\" Translated Thu Jun 26 21:11:17 JST 1997 -.\" by SUTO, Mitsuaki -.\" Modified Sun Mar 21 17:23:27 JST 1999 -.\" by HANATAKA Shinya +.\"******************************************************************* .\" -.\"WORD: the Epoch 紀元 +.\" This file was generated with po4a. Translate the source file. .\" -.TH TIME 2 2010-02-25 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH TIME 2 2011\-09\-09 Linux "Linux Programmer's Manual" .SH 名前 -.\"O time \- get time in seconds time \- 秒単位の時間を得る -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "time_t time(time_t *" t ); -.\"O .SH DESCRIPTION +\fBtime_t time(time_t *\fP\fIt\fP\fB);\fP .SH 説明 -.\"O .BR time () -.\"O returns the time as the number of seconds since the -.\"O Epoch, 1970-01-01 00:00:00 +0000 (UTC). -.BR time () -は、紀元 (Epoch; 1970-01-01 00:00:00 (UTC)) からの秒数で返す。 +\fBtime\fP() は、紀元 (Epoch; 1970\-01\-01 00:00:00 (UTC)) からの秒数で返す。 -.\"O If -.\"O .I t -.\"O is non-NULL, -.\"O the return value is also stored in the memory pointed to by -.\"O .IR t . -もし -.I t -が NULL でなかったら返り値は -.I t -の指しているメモリにも格納される。 -.\"O .SH "RETURN VALUE" +もし \fIt\fP が NULL でなかったら返り値は \fIt\fP の指しているメモリにも格納される。 .SH 返り値 -.\"O On success, the value of time in seconds since the Epoch is returned. -.\"O On error, \fI((time_t)\ \-1)\fP is returned, and \fIerrno\fP is set -.\"O appropriately. -成功した場合、紀元(the Epoch)からの経過秒数を返す。エラーの場合は -\fI((time_t)\ \-1)\fP を返し、\fIerrno\fP を設定する。 -.\"O .SH ERRORS +成功した場合、紀元(the Epoch)からの経過秒数を返す。エラーの場合は \fI((time_t)\ \-1)\fP を返し、\fIerrno\fP を設定する。 .SH エラー -.TP -.B EFAULT -.\"O .I t -.\"O points outside your accessible address space. -.I t -がアクセス可能なアドレス空間の外を指している。 -.\"O .SH "CONFORMING TO" +.TP +\fBEFAULT\fP +\fIt\fP がアクセス可能なアドレス空間の外を指している。 .SH 準拠 -SVr4, 4.3BSD, C89, C99, POSIX.1-2001. .\" .br -.\"O .\" Under 4.3BSD, this call is obsoleted by -.\"O .\" .BR gettimeofday (2). -.\"O POSIX does not specify any error conditions. -.\" 4.3BSD ではこの関数は -.\" .BR gettimeofday (2) -.\" に取って代わられている。 -POSIX にはエラー状態の規定はない。 -.\"O .SH NOTES +.\" Under 4.3BSD, this call is obsoleted by +.\" .BR gettimeofday (2). +SVr4, 4.3BSD, C89, C99, POSIX.1\-2001. POSIX にはエラー状態の規定はない。 .SH 注意 -.\"O POSIX.1 defines -.\"O .I seconds since the Epoch -.\"O as a value to be interpreted as the number of seconds between a -.\"O specified time and the Epoch, according to a formula for conversion -.\"O from UTC equivalent to conversion on the naive basis that leap -.\"O seconds are ignored and all years divisible by 4 are leap years. -.\"O This value is not the same as the actual number of seconds between the time -.\"O and the Epoch, because of leap seconds and because clocks are not -.\"O required to be synchronized to a standard reference. -.\"O The intention is -.\"O that the interpretation of seconds since the Epoch values be -.\"O consistent; see POSIX.1 Annex B 2.2.2 for further rationale. -POSIX.1 では -.I 「紀元からの経過秒数 (seconds since the Epoch)」 -は指定した時刻と紀元との間の秒数であると定義している。 -ただしこのとき UTC (協定世界時) から秒を求める変換には、素朴な変換式 -(閏秒を無視し、 4 で割り切れる年をすべて閏年とした式) -を用いるものとしている。 -この値は紀元と現在時刻との間で実際に経過した秒数と同じではない。 -なぜならば閏秒が存在するし、時計(clock)を標準時間(standard reference)に -同期させることを要求されていないからである。 -この定義の意図は紀元からの経過秒数の解釈を一定にすることである。 -より詳しい原理は POSIX.1 Annex B 2.2.2 を参照すること。 -.\"O .SH "SEE ALSO" +POSIX.1 では、指定した時刻と紀元との間の秒数を近似する変換式を使って、 + \fI「紀元からの経過秒数 (seconds since the Epoch)」\fP を定義している。 +この変換式では、4 で割り切れる年で、100 で割り切れない年はすべて閏年 +(但し、400 で割り切れる年は閏年) であるという点も考慮されている。 +「紀元からの経過秒数」は、紀元と現在時刻との間で実際に経過した秒数と同じではない。 +なぜならば、閏秒が存在するし、システムの時計を標準時間 (standard reference) +に同期させる必要もないからである。 +この定義の目的は、紀元からの経過秒数の解釈に一貫性を持たせることになる。 +より詳しい原理は POSIX.1 Rationale A.4.15 を参照すること。 .SH 関連項目 -.BR date (1), -.BR gettimeofday (2), -.BR ctime (3), -.BR ftime (3), -.BR time (7) +\fBdate\fP(1), \fBgettimeofday\fP(2), \fBctime\fP(3), \fBftime\fP(3), \fBtime\fP(7) diff --git a/draft/man2/timer_create.2 b/draft/man2/timer_create.2 new file mode 100644 index 00000000..16c4d3c1 --- /dev/null +++ b/draft/man2/timer_create.2 @@ -0,0 +1,326 @@ +.\" Copyright (c) 2009 Linux Foundation, written by Michael Kerrisk +.\" +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\" FIXME: Linux 2.6.39 adds CLOCK_BOOTTIME +.\" Does this also affect timerfd_create()? +.\" FIXME: Linux 2.3.0 adds CLOCK_BOOTTIME_ALARM and CLOCK_REALTIME_ALARM +.\" Does this also affect timerfd_create()? +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH TIMER_CREATE 2 2010\-09\-27 Linux "Linux Programmer's Manual" +.SH 名前 +timer_create \- create a POSIX per\-process timer +.SH 書式 +.nf +\fB#include \fP +\fB#include \fP + +\fBint timer_create(clockid_t \fP\fIclockid\fP\fB, struct sigevent *\fP\fIsevp\fP\fB,\fP +\fB timer_t *\fP\fItimerid\fP\fB);\fP +.fi + +Link with \fI\-lrt\fP. +.sp +.in -4n +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.in +.sp +\fBtimer_create\fP(): _POSIX_C_SOURCE\ >=\ 199309L +.SH 説明 +\fBtimer_create\fP() creates a new per\-process interval timer. The ID of the +new timer is returned in the buffer pointed to by \fItimerid\fP, which must be +a non\-NULL pointer. This ID is unique within the process, until the timer +is deleted. The new timer is initially disarmed. + +The \fIclockid\fP argument specifies the clock that the new timer uses to +measure time. It can be specified as one of the following values: +.TP +\fBCLOCK_REALTIME\fP +A settable system\-wide real\-time clock. +.TP +\fBCLOCK_MONOTONIC\fP +.\" Note: the CLOCK_MONOTONIC_RAW clock added for clock_gettime() +.\" in 2.6.28 is not supported for POSIX timers -- mtk, Feb 2009 +A nonsettable monotonically increasing clock that measures time from some +unspecified point in the past that does not change after system startup. +.TP +\fBCLOCK_PROCESS_CPUTIME_ID\fP (since Linux 2.6.12) +A clock that measures (user and system) CPU time consumed by (all of the +threads in) the calling process. +.TP +\fBCLOCK_THREAD_CPUTIME_ID\fP (since Linux 2.6.12) +.\" The CLOCK_MONOTONIC_RAW that was added in 2.6.28 can't be used +.\" to create a timer -- mtk, Feb 2009 +A clock that measures (user and system) CPU time consumed by the calling +thread. +.PP +As well as the above values, \fIclockid\fP can be specified as the \fIclockid\fP +returned by a call to \fBclock_getcpuclockid\fP(3) or +\fBpthread_getcpuclockid\fP(3). + +The \fIsevp\fP argument points to a \fIsigevent\fP structure that specifies how +the caller should be notified when the timer expires. For the definition +and general details of this structure, see \fBsigevent\fP(7). + +The \fIsevp.sigev_notify\fP field can have the following values: +.TP +\fBSIGEV_NONE\fP +Don't asynchronously notify when the timer expires. Progress of the timer +can be monitored using \fBtimer_gettime\fP(2). +.TP +\fBSIGEV_SIGNAL\fP +Upon timer expiration, generate the signal \fIsigev_signo\fP for the process. +See \fBsigevent\fP(7) for general details. The \fIsi_code\fP field of the +\fIsiginfo_t\fP structure will be set to \fBSI_TIMER\fP. At any point in time, at +most one signal is queued to the process for a given timer; see +\fBtimer_getoverrun\fP(2) for more details. +.TP +\fBSIGEV_THREAD\fP +Upon timer expiration, invoke \fIsigev_notify_function\fP as if it were the +start function of a new thread. See \fBsigevent\fP(7) for details. +.TP +\fBSIGEV_THREAD_ID\fP (Linux\-specific) +As for \fBSIGEV_SIGNAL\fP, but the signal is targeted at the thread whose ID is +given in \fIsigev_notify_thread_id\fP, which must be a thread in the same +process as the caller. The \fIsigev_notify_thread_id\fP field specifies a +kernel thread ID, that is, the value returned by \fBclone\fP(2) or +\fBgettid\fP(2). This flag is only intended for use by threading libraries. +.PP +Specifying \fIsevp\fP as NULL is equivalent to specifying a pointer to a +\fIsigevent\fP structure in which \fIsigev_notify\fP is \fBSIGEV_SIGNAL\fP, +\fIsigev_signo\fP is \fBSIGALRM\fP, and \fIsigev_value.sival_int\fP is the timer ID. +.SH 返り値 +On success, \fBtimer_create\fP() returns 0, and the ID of the new timer is +placed in \fI*timerid\fP. On failure, \-1 is returned, and \fIerrno\fP is set to +indicate the error. +.SH エラー +.TP +\fBEAGAIN\fP +Temporary error during kernel allocation of timer structures. +.TP +\fBEINVAL\fP +Clock ID, \fIsigev_notify\fP, \fIsigev_signo\fP, or \fIsigev_notify_thread_id\fP is +invalid. +.TP +\fBENOMEM\fP +.\" glibc layer: malloc() +Could not allocate memory. +.SH バージョン +This system call is available since Linux 2.6. +.SH 準拠 +POSIX.1\-2001. +.SH 注意 +A program may create multiple interval timers using \fBtimer_create\fP(). + +Timers are not inherited by the child of a \fBfork\fP(2), and are disarmed and +deleted during an \fBexecve\fP(2). + +The kernel preallocates a "queued real\-time signal" for each timer created +using \fBtimer_create\fP(). Consequently, the number of timers is limited by +the \fBRLIMIT_SIGPENDING\fP resource limit (see \fBsetrlimit\fP(2)). + +The timers created by \fBtimer_create\fP() are commonly known as "POSIX +(interval) timers". The POSIX timers API consists of the following +interfaces: +.IP * 3 +\fBtimer_create\fP(): Create a timer. +.IP * +\fBtimer_settime\fP(2): Arm (start) or disarm (stop) a timer. +.IP * +\fBtimer_gettime\fP(2): Fetch the time remaining until the next expiration of a +timer, along with the interval setting of the timer. +.IP * +\fBtimer_getoverrun\fP(2): Return the overrun count for the last timer +expiration. +.IP * +\fBtimer_delete\fP(2): Disarm and delete a timer. +.PP +Part of the implementation of the POSIX timers API is provided by glibc. In +particular: +.IP * 3 +The functionality for \fBSIGEV_THREAD\fP is implemented within glibc, rather +than the kernel. +.IP * +.\" See the glibc source file kernel-posix-timers.h for the structure +.\" that glibc uses to map userspace timer IDs to kernel timer IDs +.\" The kernel-level timer ID is exposed via siginfo.si_tid. +The timer IDs presented at user level are maintained by glibc, which maps +these IDs to the timer IDs employed by the kernel. +.PP +The POSIX timers system calls first appeared in Linux 2.6. Prior to this, +glibc provided an incomplete userspace implementation (\fBCLOCK_REALTIME\fP +timers only) using POSIX threads, and current glibc falls back to this +implementation on systems running pre\-2.6 Linux kernels. +.SH 例 +The program below takes two arguments: a sleep period in seconds, and a +timer frequency in nanoseconds. The program establishes a handler for the +signal it uses for the timer, blocks that signal, creates and arms a timer +that expires with the given frequency, sleeps for the specified number of +seconds, and then unblocks the timer signal. Assuming that the timer +expired at least once while the program slept, the signal handler will be +invoked, and the handler displays some information about the timer +notification. The program terminates after one invocation of the signal +handler. + +In the following example run, the program sleeps for 1 second, after +creating a timer that has a frequency of 100 nanoseconds. By the time the +signal is unblocked and delivered, there have been around ten million +overruns. +.in +4n +.nf + +$ \fB./a.out 1 100\fP +Establishing handler for signal 34 +Blocking signal 34 +timer ID is 0x804c008 +Sleeping for 1 seconds +Unblocking signal 34 +Caught signal 34 + sival_ptr = 0xbfb174f4; *sival_ptr = 0x804c008 + overrun count = 10004886 +.fi +.in +.SS "Program Source" +\& +.nf +#include +#include +#include +#include +#include + +#define CLOCKID CLOCK_REALTIME +#define SIG SIGRTMIN + +#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e + } while (0) + +static void +print_siginfo(siginfo_t *si) +{ + timer_t *tidp; + int or; + + tidp = si\->si_value.sival_ptr; + + printf(" sival_ptr = %p; ", si\->si_value.sival_ptr); + printf(" *sival_ptr = 0x%lx\en", (long) *tidp); + + or = timer_getoverrun(*tidp); + if (or == \-1) + errExit("timer_getoverrun"); + else + printf(" overrun count = %d\en", or); +} + +static void +handler(int sig, siginfo_t *si, void *uc) +{ + /* Note: calling printf() from a signal handler is not + strictly correct, since printf() is not async\-signal\-safe; + see signal(7) */ + + printf("Caught signal %d\en", sig); + print_siginfo(si); + signal(sig, SIG_IGN); +} + +int +main(int argc, char *argv[]) +{ + timer_t timerid; + struct sigevent sev; + struct itimerspec its; + long long freq_nanosecs; + sigset_t mask; + struct sigaction sa; + + if (argc != 3) { + fprintf(stderr, "Usage: %s \en", + argv[0]); + exit(EXIT_FAILURE); + } + + /* Establish handler for timer signal */ + + printf("Establishing handler for signal %d\en", SIG); + sa.sa_flags = SA_SIGINFO; + sa.sa_sigaction = handler; + sigemptyset(&sa.sa_mask); + if (sigaction(SIG, &sa, NULL) == \-1) + errExit("sigaction"); + + /* Block timer signal temporarily */ + + printf("Blocking signal %d\en", SIG); + sigemptyset(&mask); + sigaddset(&mask, SIG); + if (sigprocmask(SIG_SETMASK, &mask, NULL) == \-1) + errExit("sigprocmask"); + + /* Create the timer */ + + sev.sigev_notify = SIGEV_SIGNAL; + sev.sigev_signo = SIG; + sev.sigev_value.sival_ptr = &timerid; + if (timer_create(CLOCKID, &sev, &timerid) == \-1) + errExit("timer_create"); + + printf("timer ID is 0x%lx\en", (long) timerid); + + /* Start the timer */ + + freq_nanosecs = atoll(argv[2]); + its.it_value.tv_sec = freq_nanosecs / 1000000000; + its.it_value.tv_nsec = freq_nanosecs % 1000000000; + its.it_interval.tv_sec = its.it_value.tv_sec; + its.it_interval.tv_nsec = its.it_value.tv_nsec; + + if (timer_settime(timerid, 0, &its, NULL) == \-1) + errExit("timer_settime"); + + /* Sleep for a while; meanwhile, the timer may expire + multiple times */ + + printf("Sleeping for %d seconds\en", atoi(argv[1])); + sleep(atoi(argv[1])); + + /* Unlock the timer signal, so that timer notification + can be delivered */ + + printf("Unblocking signal %d\en", SIG); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL) == \-1) + errExit("sigprocmask"); + + exit(EXIT_SUCCESS); +} +.fi +.SH 関連項目 +\fBclock_gettime\fP(2), \fBsetitimer\fP(2), \fBtimer_delete\fP(2), +\fBtimer_getoverrun\fP(2), \fBtimer_settime\fP(2), \fBtimerfd_create\fP(2), +\fBclock_getcpuclockid\fP(3), \fBpthread_getcpuclockid\fP(3), \fBpthreads\fP(7), +\fBsigevent\fP(7), \fBsignal\fP(7), \fBtime\fP(7) diff --git a/draft/man2/timer_delete.2 b/draft/man2/timer_delete.2 new file mode 100644 index 00000000..9acc1174 --- /dev/null +++ b/draft/man2/timer_delete.2 @@ -0,0 +1,63 @@ +.\" Copyright (c) 2009 Linux Foundation, written by Michael Kerrisk +.\" +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH TIMER_DELETE 2 2009\-02\-20 Linux "Linux Programmer's Manual" +.SH 名前 +timer_delete \- delete a POSIX per\-process timer +.SH 書式 +.nf +\fB#include \fP + +\fBint timer_delete(timer_t \fP\fItimerid\fP\fB);\fP +.fi + +Link with \fI\-lrt\fP. +.sp +.in -4n +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.in +.sp +\fBtimer_delete\fP(): _POSIX_C_SOURCE\ >=\ 199309L +.SH 説明 +\fBtimer_delete\fP() deletes the timer whose ID is given in \fItimerid\fP. If +the timer was armed at the time of this call, it is disarmed before being +deleted. The treatment of any pending signal generated by the deleted timer +is unspecified. +.SH 返り値 +On success, \fBtimer_delete\fP() returns 0. On failure, \-1 is returned, and +\fIerrno\fP is set to indicate the error. +.SH エラー +.TP +\fBEINVAL\fP +\fItimerid\fP is not a valid timer ID. +.SH バージョン +This system call is available since Linux 2.6. +.SH 準拠 +POSIX.1\-2001. +.SH 関連項目 +\fBclock_gettime\fP(2), \fBtimer_create\fP(2), \fBtimer_getoverrun\fP(2), +\fBtimer_settime\fP(2), \fBtime\fP(7) diff --git a/draft/man2/timer_getoverrun.2 b/draft/man2/timer_getoverrun.2 new file mode 100644 index 00000000..6d11cc67 --- /dev/null +++ b/draft/man2/timer_getoverrun.2 @@ -0,0 +1,107 @@ +.\" Copyright (c) 2009 Linux Foundation, written by Michael Kerrisk +.\" +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH TIMER_GETOVERRUN 2 2009\-02\-20 Linux "Linux Programmer's Manual" +.SH 名前 +timer_getoverrun \- get overrun count for a POSIX per\-process timer +.SH 書式 +.nf +\fB#include \fP + +\fBint timer_getoverrun(timer_t \fP\fItimerid\fP\fB);\fP +.fi + +Link with \fI\-lrt\fP. +.sp +.in -4n +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.in +.sp +\fBtimer_getoverrun\fP(): _POSIX_C_SOURCE\ >=\ 199309L +.SH 説明 +\fBtimer_getoverrun\fP() returns the "overrun count" for the timer referred to +by \fItimerid\fP. An application can use the overrun count to accurately +calculate the number of timer expirations that would have occurred over a +given time interval. Timer overruns can occur both when receiving +expiration notifications via signals (\fBSIGEV_SIGNAL\fP), and via threads +(\fBSIGEV_THREAD\fP). + +When expiration notifications are delivered via a signal, overruns can occur +as follows. Regardless of whether or not a real\-time signal is used for +timer notifications, the system queues at most one signal per timer. (This +is the behavior specified by POSIX.1\-2001. The alternative, queuing one +signal for each timer expiration, could easily result in overflowing the +allowed limits for queued signals on the system.) Because of system +scheduling delays, or because the signal may be temporarily blocked, there +can be a delay between the time when the notification signal is generated +and the time when it is delivered (e.g., caught by a signal handler) or +accepted (e.g., using \fBsigwaitinfo\fP(2)). In this interval, further timer +expirations may occur. The timer overrun count is the number of additional +timer expirations that occurred between the time when the signal was +generated and when it was delivered or accepted. + +Timer overruns can also occur when expiration notifications are delivered +via invocation of a thread, since there may be an arbitrary delay between an +expiration of the timer and the invocation of the notification thread, and +in that delay interval, additional timer expirations may occur +.SH 返り値 +On success, \fBtimer_getoverrun\fP() returns the overrun count of the +specified timer; this count may be 0 if no overruns have occurred. On +failure, \-1 is returned, and \fIerrno\fP is set to indicate the error. +.SH エラー +.TP +\fBEINVAL\fP +\fItimerid\fP is not a valid timer ID. +.SH バージョン +This system call is available since Linux 2.6. +.SH 準拠 +POSIX.1\-2001. +.SH 注意 +When timer notifications are delivered via signals (\fBSIGEV_SIGNAL\fP), on +Linux it is also possible to obtain the overrun count via the \fIsi_overrun\fP +field of the \fIsiginfo_t\fP structure (see \fBsigaction\fP(2)). This allows an +application to avoid the overhead of making a system call to obtain the +overrun count, but is a nonportable extension to POSIX.1\-2001. + +.\" FIXME . Austin bug filed, 11 Feb 09 +POSIX.1\-2001 only discusses timer overruns in the context of timer +notifications using signals. +.SH バグ +.\" Bug filed: http://bugzilla.kernel.org/show_bug.cgi?id=12665 +.\" http://thread.gmane.org/gmane.linux.kernel/113276/ +POSIX.1\-2001 specifies that if the timer overrun count is equal to or +greater than an implementation\-defined maximum, \fBDELAYTIMER_MAX\fP, then +\fBtimer_getoverrun\fP() should return \fBDELAYTIMER_MAX\fP. However, Linux does +not implement this feature: instead, if the timer overrun value exceeds the +maximum representable integer, the counter cycles, starting once more from +low values. +.SH 例 +See \fBtimer_create\fP(2). +.SH 関連項目 +\fBclock_gettime\fP(2), \fBsigaction\fP(2), \fBsignalfd\fP(2), \fBsigwaitinfo\fP(2), +\fBtimer_create\fP(2), \fBtimer_delete\fP(2), \fBtimer_settime\fP(2), \fBsignal\fP(7), +\fBtime\fP(7) diff --git a/draft/man2/timer_settime.2 b/draft/man2/timer_settime.2 new file mode 100644 index 00000000..4fa3e0b5 --- /dev/null +++ b/draft/man2/timer_settime.2 @@ -0,0 +1,144 @@ +.\" Copyright (c) 2009 Linux Foundation, written by Michael Kerrisk +.\" +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH TIMER_SETTIME 2 2009\-02\-20 Linux "Linux Programmer's Manual" +.SH 名前 +timer_settime, timer_gettime \- arm/disarm and fetch state of POSIX +per\-process timer +.SH 書式 +.nf +\fB#include \fP + +\fBint timer_settime(timer_t \fP\fItimerid\fP\fB, int \fP\fIflags\fP\fB,\fP +\fB const struct itimerspec *\fP\fInew_value\fP\fB,\fP +\fB struct itimerspec * \fP\fIold_value\fP\fB);\fP +\fBint timer_gettime(timer_t \fP\fItimerid\fP\fB, struct itimerspec *\fP\fIcurr_value\fP\fB);\fP +.fi + +Link with \fI\-lrt\fP. +.sp +.in -4n +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.in +.sp +\fBtimer_settime\fP(), \fBtimer_gettime\fP(): _POSIX_C_SOURCE\ >=\ 199309L +.SH 説明 +\fBtimer_settime\fP() arms or disarms the timer identified by \fItimerid\fP. The +\fInew_value\fP argument is an \fIitimerspec\fP structure that specifies the new +initial value and the new interval for the timer. The \fIitimerspec\fP +structure is defined as follows: + +.in +4n +.nf +struct timespec { + time_t tv_sec; /* Seconds */ + long tv_nsec; /* Nanoseconds */ +}; + +struct itimerspec { + struct timespec it_interval; /* Timer interval */ + struct timespec it_value; /* Initial expiration */ +}; +.fi +.in + +Each of the substructures of the \fIitimerspec\fP structure is a \fItimespec\fP +structure that allows a time value to be specified in seconds and +nanoseconds. These time values are measured according to the clock that was +specified when the timer was created by \fBtimer_create\fP(2) + +If \fInew_value\->it_value\fP specifies a nonzero value (i.e., either +subfield is nonzero), then \fBtimer_settime\fP() arms (starts) the timer, +setting it to initially expire at the given time. (If the timer was already +armed, then the previous settings are overwritten.) If +\fInew_value\->it_value\fP specifies a zero value (i.e., both subfields are +zero), then the timer is disarmed. + +The \fInew_value\->it_interval\fP field specifies the period of the timer, +in seconds and nanoseconds. If this field is nonzero, then each time that +an armed timer expires, the timer is reloaded from the value specified in +\fInew_value\->it_interval\fP. If \fInew_value\->it_interval\fP specifies a +zero value then the timer expires just once, at the time specified by +\fIit_value\fP. + +.\" By experiment: the overrun count is set correctly, for CLOCK_REALTIME. +By default, the initial expiration time specified in +\fInew_value\->it_value\fP is interpreted relative to the current time on +the timer's clock at the time of the call. This can be modified by +specifying \fBTIMER_ABSTIME\fP in \fIflags\fP, in which case +\fInew_value\->it_value\fP is interpreted as an absolute value as measured +on the timer's clock; that is, the timer will expire when the clock value +reaches the value specified by \fInew_value\->it_value\fP. If the specified +absolute time has already passed, then the timer expires immediately, and +the overrun count (see \fBtimer_getoverrun\fP(2)) will be set correctly. + +.\" Similar remarks might apply with respect to process and thread CPU time +.\" clocks, but these clocks are not currently (2.6.28) settable on Linux. +If the value of the \fBCLOCK_REALTIME\fP clock is adjusted while an absolute +timer based on that clock is armed, then the expiration of the timer will be +appropriately adjusted. Adjustments to the \fBCLOCK_REALTIME\fP clock have no +effect on relative timers based on that clock. + +If \fIold_value\fP is not NULL, then it returns the previous interval of the +timer (in \fIold_value\->it_interval\fP) and the amount of time until the +timer would previously have next expired (in \fIold_value\->it_value\fP). + +\fBtimer_gettime\fP() returns the time until next expiration, and the +interval, for the timer specified by \fItimerid\fP, in the buffer pointed to by +\fIcurr_value\fP. The time remaining until the next timer expiration is +returned in \fIcurr_value\->it_value\fP; this is always a relative value, +regardless of whether the \fBTIMER_ABSTIME\fP flag was used when arming the +timer. If the value returned in \fIcurr_value\->it_value\fP is zero, then +the timer is currently disarmed. The timer interval is returned in +\fIcurr_value\->it_interval\fP. If the value returned in +\fIcurr_value\->it_interval\fP is zero, then this is a "one\-shot" timer. +.SH 返り値 +On success, \fBtimer_settime\fP() and \fBtimer_gettime\fP() return 0. On error, +\-1 is returned, and \fIerrno\fP is set to indicate the error. +.SH エラー +These functions may fail with the following errors: +.TP +\fBEFAULT\fP +\fInew_value\fP, \fIold_value\fP, or \fIcurr_value\fP is not a valid pointer. +.TP +\fBEINVAL\fP +.\" FIXME . eventually: invalid value in flags +\fItimerid\fP is invalid. +.PP +\fBtimer_settime\fP() may fail with the following errors: +.TP +\fBEINVAL\fP +\fInew_value.it_value\fP is negative; or \fInew_value.it_value.tv_nsec\fP is +negative or greater than 999,999,999. +.SH バージョン +These system calls are available since Linux 2.6. +.SH 準拠 +POSIX.1\-2001. +.SH 例 +See \fBtimer_create\fP(2). +.SH 関連項目 +\fBtimer_create\fP(2), \fBtimer_getoverrun\fP(2), \fBtime\fP(7) diff --git a/draft/man2/times.2 b/draft/man2/times.2 index a9dbf1e1..d9dfae15 100644 --- a/draft/man2/times.2 +++ b/draft/man2/times.2 @@ -35,48 +35,21 @@ .\" Added notes on nonstandard behavior: Linux allows 'buf' to .\" be NULL, but POSIX.1 doesn't specify this and it's nonportable. .\" -.\" Japanese Version Copyright (c) 1996 Satoshi Nozawa -.\" all rights reserved. -.\" Translated 1996-06-25, Satoshi I. Nozawa -.\" Modified 1997-12-14, HANATAKA Shinya -.\" Updated 2001-02-16, Kentaro Shirakata -.\" Updated 2001-04-10, Kentaro Shirakata -.\" Updated 2001-05-21, Kentaro Shirakata -.\" Updated 2002-10-21, Kentaro Shirakata -.\" Updated 2005-02-24, Akihiro MOTOKI -.\" Updated 2005-04-20, Kentaro Shirakata -.\" Updated 2008-02-12, Akihiro MOTOKI , LDP v2.77 +.\"******************************************************************* .\" -.\" WORD: clock ticks クロック数 +.\" This file was generated with po4a. Translate the source file. .\" -.TH TIMES 2 2008-06-25 "Linux" "Linux Programmer's Manual" +.\"******************************************************************* +.TH TIMES 2 2012\-04\-16 Linux "Linux Programmer's Manual" .SH 名前 -times - プロセス時間を取得する +times \- プロセス時間を取得する .SH 書式 -.B #include +\fB#include \fP .sp -.BI "clock_t times(struct tms *" buf ); +\fBclock_t times(struct tms *\fP\fIbuf\fP\fB);\fP .SH 説明 -.\"O .BR times () -.\"O stores the current process times in the -.\"O .B "struct tms" -.\"O that -.\"O .I buf -.\"O points to. -.BR times () -は現在のプロセス時間を -.I buf -が指している -.B "struct tms" -に格納する。 -.\"O The -.\"O .I struct tms -.\"O is as defined in -.\"O .IR : -.I struct tms -は -.I -で以下のように定義されている: +\fBtimes\fP() は現在のプロセス時間を \fIbuf\fP が指している \fBstruct tms\fP に格納する。 \fIstruct tms\fP は +\fI\fP で以下のように定義されている: .sp .in +4n .nf @@ -89,268 +62,70 @@ struct tms { .fi .in .LP -.\"O The -.\"O .I tms_utime -.\"O field contains the CPU time spent executing instructions -.\"O of the calling process. -.I tms_utime -フィールドは、呼び出したプロセスが命令を実行するのに消費した -CPU 時間である。 -.\"O The -.\"O .I tms_stime -.\"O field contains the CPU time spent in the system while -.\"O executing tasks on behalf of the calling process. -.I tms_stime -フィールドは、呼び出したプロセスのために実行されたタスクで、 -システムが消費した CPU 時間である。 -.\"O The -.\"O .I tms_cutime -.\"O field contains the sum of the -.\"O .I tms_utime -.\"O and -.\"O .I tms_cutime -.\"O values for all waited-for terminated children. -.I tms_cutime -フィールドは、 -終了を待っている全ての子プロセスの -.I tms_utime -と -.I tms_cutime -の合計である。 -.\"O The -.\"O .I tms_cstime -.\"O field contains the sum of the -.\"O .I tms_stime -.\"O and -.\"O .I tms_cstime -.\"O values for all waited-for terminated children. -.I tms_cstime -フィールドは、 -終了を待っている全ての子プロセスの -.I tms_stime -と -.I tms_cstime -の合計である。 +\fItms_utime\fP フィールドは、呼び出したプロセスが命令を実行するのに消費した CPU 時間である。 \fItms_stime\fP +フィールドは、呼び出したプロセスのために実行されたタスクで、 システムが消費した CPU 時間である。 \fItms_cutime\fP フィールドは、 +終了を待っている全ての子プロセスの \fItms_utime\fP と \fItms_cutime\fP の合計である。 \fItms_cstime\fP フィールドは、 +終了を待っている全ての子プロセスの \fItms_stime\fP と \fItms_cstime\fP の合計である。 .LP -.\"O Times for terminated children (and their descendants) -.\"O are added in at the moment -.\"O .BR wait (2) -.\"O or -.\"O .BR waitpid (2) -.\"O returns their process ID. -.\"O In particular, times of grandchildren -.\"O that the children did not wait for are never seen. -終了する子(及びその子孫)プロセスの時間は -.BR wait (2) -や -.BR waitpid (2) -がプロセス ID を返した瞬間に加算される。 -つまり、子がまだ終了を待っていない状態では -孫プロセスの時間は決して現れない。 +終了する子(及びその子孫)プロセスの時間は \fBwait\fP(2) や \fBwaitpid\fP(2) がプロセス ID を返した瞬間に加算される。 +つまり、子がまだ終了を待っていない状態では 孫プロセスの時間は決して現れない。 .LP -.\"O All times reported are in clock ticks. 全ての時間はクロック数で返される。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O The function -.\"O .BR times () -.\"O returns the number of clock ticks that have elapsed since -.\"O an arbitrary point in the past. -.\"O The return value may overflow the possible range of type -.\"O .IR clock_t . -.\"O On error, \fI(clock_t)\ \-1\fP is returned, and -.\"O .I errno -.\"O is set appropriately. -.BR times () -は過去のある時点から経過したクロック数 (clock tick) を返す。 -この返り値は -.I clock_t -型が取り得る範囲からオーバーフローするかもしれない。 -エラーの場合、\fI(clock_t)\ \-1\fP が返され、 -.I errno -が適切に設定される。 -.\" The only possible error is EFAULT. -.\"O .SH "CONFORMING TO" +\fBtimes\fP() は過去のある時点から経過したクロック数 (clock tick) を返す。 この返り値は \fIclock_t\fP +型が取り得る範囲からオーバーフローするかもしれない。 エラーの場合、\fI(clock_t)\ \-1\fP が返され、 \fIerrno\fP が適切に設定される。 +.SH エラー +.TP +\fBEFAULT\fP +\fItms\fP がプロセスのアドレス空間の外を指している。 .SH 準拠 -SVr4, 4.3BSD, POSIX.1-2001. -.\"O .SH NOTES +SVr4, 4.3BSD, POSIX.1\-2001. .SH 注意 -.\"O The number of clock ticks per second can be obtained using: -.\"O .in +4n -.\"O -.\"O sysconf(_SC_CLK_TCK); -.\"O .in -一秒あたりのクロック数は +一秒あたりのクロック数は以下で得ることができる。 .in +4n sysconf(_SC_CLK_TCK); - .in -を使って得ることが出来る。 .PP -.\"O In POSIX.1-1996 the symbol \fBCLK_TCK\fP (defined in -.\"O .IR ) -.\"O is mentioned as obsolescent. -.\"O It is obsolete now. -POSIX.1-1996 では、\fBCLK_TCK\fP シンボル -.RI ( -で定義されている) は古いものであると記述されている。 -今ではこれは古いものである。 +POSIX.1\-1996 では、\fBCLK_TCK\fP シンボル (\fI\fP で定義されている) +は古いものであると記述されている。 今ではこれは古いものである。 .PP -.\"O In Linux kernel versions before 2.6.9, -.\"O if the disposition of -.\"O .B SIGCHLD -.\"O is set to -.\"O .B SIG_IGN -.\"O then the times of terminated children -.\"O are automatically included in the -.\"O .I tms_cstime -.\"O and -.\"O .I tms_cutime -.\"O fields, although POSIX.1-2001 says that this should only happen -.\"O if the calling process -.\"O .BR wait (2)s -.\"O on its children. -.\"O +This nonconformance is rectified in Linux 2.6.9 and later. -Linux 2.6.9 より前のバージョンでは、 -.B SIGCHLD -を -.B SIG_IGN -に設定すると -終了した子プロセスの回数は -自動的に -.I tms_cstime -と -.I tms_cutime -フィールドに含まれる。 -しかし、POSIX.1-2001 では、この動作は呼び出し元が -.BR wait (2) -関数群で子プロセスを待った場合にのみ起きるべきだとしている。 -標準とは異なるこの動作は Linux 2.6.9 以降で修正されている。 -.\"O .\" See the description of times() in XSH, which says: -.\"O .\" The times of a terminated child process are included... when wait() -.\"O .\" or waitpid() returns the process ID of this terminated child. .\" See the description of times() in XSH, which says: .\" The times of a terminated child process are included... when wait() .\" or waitpid() returns the process ID of this terminated child. +Linux 2.6.9 より前のバージョンでは、 \fBSIGCHLD\fP を \fBSIG_IGN\fP に設定すると 終了した子プロセスの回数は 自動的に +\fItms_cstime\fP と \fItms_cutime\fP フィールドに含まれる。 しかし、POSIX.1\-2001 では、この動作は呼び出し元が +\fBwait\fP(2) 関数群で子プロセスを待った場合にのみ起きるべきだとしている。 標準とは異なるこの動作は Linux 2.6.9 +以降で修正されている。 -.\"O On Linux, the -.\"O .I buf -.\"O argument can be specified as NULL, with the result that -.\"O .BR times () -.\"O just returns a function result. -Linux では、 -.I buf -引数に NULL を指定することができ、その場合は -.BR times () -は単に関数の結果を返す。 -.\"O However, POSIX does not specify this behavior, and most -.\"O other UNIX implementations require a non-NULL value for -.\"O .IR buf . -しかし、POSIX はこの振る舞いは規定されておらず、 -その他のほとんどの UNIX 実装は -.I buf -の値として非 NULL の値を要求する。 +Linux では、 \fIbuf\fP 引数に NULL を指定することができ、その場合は \fBtimes\fP() は単に関数の結果を返す。 +しかし、POSIX はこの振る舞いは規定されておらず、 その他のほとんどの UNIX 実装は \fIbuf\fP の値として非 NULL の値を要求する。 .LP -.\"O Note that -.\"O .BR clock (3) -.\"O also returns a value of type -.\"O .IR clock_t , -.\"O but this value is measured in units of -.\"O .BR CLOCKS_PER_SEC , -.\"O not the clock ticks used by -.\"O .BR times (). -.BR clock (3) -も -.I clock_t -型の値を返すが、この値は -.BR times () -で使用されるクロック tick 数ではなく、 -.B CLOCKS_PER_SEC -が単位である点に注意すること。 +\fBclock\fP(3) も \fIclock_t\fP 型の値を返すが、この値は \fBtimes\fP() で使用されるクロック tick 数ではなく、 +\fBCLOCKS_PER_SEC\fP が単位である点に注意すること。 -.\"O On Linux, the "arbitrary point in the past" from which the return value of -.\"O .BR times () -.\"O is measured has varied across kernel versions. -.\"O On Linux 2.4 and earlier this point is the moment the system was booted. -.\"O Since Linux 2.6, this point is \fI(2^32/HZ) \- 300\fP -.\"O (i.e., about 429 million) seconds before system boot time. -.\"O This variability across kernel versions (and across UNIX implementations), -.\"O combined with the fact that the returned value may overflow the range of -.\"O .IR clock_t , -.\"O means that a portable application would be wise to avoid using this value. -.\"O To measure changes in elapsed time, use -.\"O .BR gettimeofday (2) -.\"O instead. -Linux では、 -.BR times () -の返り値を計算する起点となる「過去の任意の時点」は、カーネルのバージョン -により異なる。 -Linux 2.4 以前では、この時点はシステムが起動した瞬間である。 -Linux 2.6 以降では、この時点はシステム起動時刻の \fI(2^32/HZ) \- 300\fP -(および 4億2900万) 秒前である。 -このようにカーネルバージョン (や UNIX の実装) により異なることと、 -返り値が -.I clock_t -の範囲をオーバーフローする可能性があるという事実を考慮すると、 -移植性が必要なアプリケーションではこの値を使うのは避けるのが賢明であろう。 -経過時間を測りたい場合には、代わりに -.BR gettimeofday (2) -を使用すること。 .\" .PP -.\"O .\" On older systems the number of clock ticks per second is given -.\"O .\" by the variable HZ. -.\" 古いシステムでは一秒あたりのクロック数は HZ 変数で与えられる。 -.\"O .SS "Historical" +.\" On older systems the number of clock ticks per second is given +.\" by the variable HZ. +Linux では、 \fBtimes\fP() の返り値を計算する起点となる「過去の任意の時点」は、カーネルのバージョン により異なる。 Linux 2.4 +以前では、この時点はシステムが起動した瞬間である。 Linux 2.6 以降では、この時点はシステム起動時刻の \fI(2^32/HZ) \- 300\fP +(および 4億2900万) 秒前である。 このようにカーネルバージョン (や UNIX の実装) により異なることと、 返り値が \fIclock_t\fP +の範囲をオーバーフローする可能性があるという事実を考慮すると、 移植性が必要なアプリケーションではこの値を使うのは避けるのが賢明であろう。 +経過時間を測りたい場合には、代わりに \fBgettimeofday\fP(2) を使用すること。 .SS 歴史 -.\"O SVr1-3 returns -.\"O .I long -.\"O and the struct members are of type -.\"O .I time_t -.\"O although they store clock ticks, not seconds since the Epoch. -.\"O V7 used -.\"O .I long -.\"O for the struct members, because it had no type -.\"O .I time_t -.\"O yet. -SVr1-3 では -.I long -を返し、構造体のメンバに -.I time_t -型を使っていたが、紀元からの秒数ではなくクロック数を格納していた。 -V7 では構造体のメンバに -.I long -型を使っていた。まだ -.I time_t -型がなかったからである。 -.\"O .SH BUGS +SVr1\-3 では \fIlong\fP を返し、構造体のメンバに \fItime_t\fP 型を使っていたが、紀元からの秒数ではなくクロック数を格納していた。 +V7 では構造体のメンバに \fIlong\fP 型を使っていた。まだ \fItime_t\fP 型がなかったからである。 .SH バグ -.\"O A limitation of the Linux system call conventions on some architectures -.\"O (notably i386) means that on Linux 2.6 there is a small time window -.\"O (41 seconds) soon after boot when -.\"O .BR times () -.\"O can return \-1, falsely indicating that an error occurred. -.\"O The same problem can occur when the return value wraps passed -.\"O the maximum value that can be stored in -.\"O .BR clockid_t . -いくつかのアーキテクチャ (特に i386) における Linux のシステムコールの慣習の -制限により、Linux 2.6 では起動直後は (41秒と) タイムウィンドウが小さく、 -.BR times () -がエラーが起こったことを示す \-1 を間違って返すことがある。 -返り値が -.I clockid_t -が格納可能な最大値を超過した際にも同じ問題が起こり得る。 .\" The problem is that a syscall return of -4095 to -1 .\" is interpreted by glibc as an error, and the wrapper converts .\" the return value to -1. .\" http://marc.info/?l=linux-kernel&m=119447727031225&w=2 .\" "compat_sys_times() bogus until jiffies >= 0" .\" November 2007 -.\"O .SH "SEE ALSO" +いくつかのアーキテクチャ (特に i386) における Linux のシステムコールの慣習の +制限により、Linux 2.6 では起動直後は (41秒と) タイムウィンドウが小さく、 +\fBtimes\fP() がエラーが起こったことを示す \-1 を間違って返すことがある。 返り値 +が \fIclock_t\fP が格納可能な最大値を超過した際にも同じ問題が起こり得る。 .SH 関連項目 -.BR time (1), -.BR getrusage (2), -.BR wait (2), -.BR clock (3), -.BR sysconf (3), -.BR time (7) +\fBtime\fP(1), \fBgetrusage\fP(2), \fBwait\fP(2), \fBclock\fP(3), \fBsysconf\fP(3), +\fBtime\fP(7) diff --git a/draft/man2/truncate.2 b/draft/man2/truncate.2 deleted file mode 100644 index 29b1fdd1..00000000 --- a/draft/man2/truncate.2 +++ /dev/null @@ -1,379 +0,0 @@ -.\" Copyright (c) 1983, 1991 The Regents of the University of California. -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" @(#)truncate.2 6.9 (Berkeley) 3/10/91 -.\" -.\" Modified 1993-07-24 by Rik Faith -.\" Modified 1996-10-22 by Eric S. Raymond -.\" Modified 1998-12-21 by Andries Brouwer -.\" Modified 2002-01-07 by Michael Kerrisk -.\" Modified 2002-04-06 by Andries Brouwer -.\" Modified 2004-06-23 by Michael Kerrisk -.\" -.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki -.\" all rights reserved. -.\" Translated 1997-06-26, SUTO, Mitsuaki -.\" Modified 2000-03-12, HANATAKA Shinya -.\" Updated 2001-01-09, Kentaro Shirakata -.\" Updated 2002-04-13, Kentaro Shirakata -.\" Updated 2002-10-21, Kentaro Shirakata -.\" Updated 2005-09-06, Akihiro MOTOKI -.\" Updated 2006-07-21, Akihiro MOTOKI, LDP v2.36 -.\" -.TH TRUNCATE 2 2010-10-07 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O truncate, ftruncate \- truncate a file to a specified length -truncate, ftruncate \- 指定した長さにファイルを切り詰める -.\"O .SH SYNOPSIS -.SH 書式 -.B #include -.br -.B #include -.sp -.BI "int truncate(const char *" path ", off_t " length ); -.br -.BI "int ftruncate(int " fd ", off_t " length ); -.sp -.in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): -.in -.ad l -.PD 0 -.sp -.BR truncate (): -.RS 4 -_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED -.br -.\"O || /* Since glibc 2.12: */ _POSIX_C_SOURCE\ >=\ 200809L -|| /* glibc 2.12 以降: */ _POSIX_C_SOURCE\ >=\ 200809L -.RE -.sp -.BR ftruncate (): -.RS 4 -_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED -.br -.\"O || /* Since glibc 2.3.5: */ _POSIX_C_SOURCE\ >=\ 200112L -|| /* glibc 2.3.5 以降: */ _POSIX_C_SOURCE\ >=\ 200112L -.RE -.PD -.ad b -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The -.\"O .BR truncate () -.\"O and -.\"O .BR ftruncate () -.\"O functions cause the regular file named by -.\"O .I path -.\"O or referenced by -.\"O .I fd -.\"O to be truncated to a size of precisely -.\"O .I length -.\"O bytes. -.\"O If the file previously was larger than this size, the extra data is lost. -.BR truncate () -は -.I path -で指定されるファイルを、 -.BR ftruncate () -は -.I fd -で参照されるファイルを -.I length -バイトの長さになるように延長する、もしくは切り詰める。 -もし切り詰める前のファイルが -.I length -より長ければ、length バイトを越える部分のデータは失われる。 -.\"O If the file previously was shorter, it is extended, and -.\"O the extended part reads as null bytes (\(aq\\0\(aq). -もし切り詰める前のファイルが -.I length -より短かければ、伸張される。 -伸張された部分を読んだ場合は NULL バイト (\(aq\\0\(aq) の列が返される。 -.LP -.\"O The file offset is not changed. -ファイルオフセットは変更されない。 -.LP -.\"O If the size changed, then the st_ctime and st_mtime fields -.\"O (respectively, time of last status change and -.\"O time of last modification; see -.\"O .BR stat (2)) -.\"O for the file are updated, -.\"O and the set-user-ID and set-group-ID permission bits may be cleared. -大きさが変更されると、ファイルの st_ctime と st_mtime フィールド -(それぞれ最終状態変更時刻、最終修正時刻; -.BR stat (2) -参照) が更新される。 -また、set-user-ID と set-group-ID の許可ビットがクリアされるかもしれない。 -.LP -.\"O With -.\"O .BR ftruncate (), -.\"O the file must be open for writing; with -.\"O .BR truncate (), -.\"O the file must be writable. -.BR ftruncate () -の場合、ファイルは書き込み用に開いていなければならない。 -.BR truncate () -の場合、ファイルは書き込み可能でなければならない。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success, zero is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合 0 が返る。失敗した場合 \-1 が返り、 -.I errno -がエラーの内容に従って設定される。 -.\"O .SH ERRORS -.SH エラー -.\"O For -.\"O .BR truncate (): -.BR truncate () -では以下のエラーコードが定義されている。 -.TP -.B EACCES -.\"O Search permission is denied for a component of the path prefix, -.\"O or the named file is not writable by the user. -.\"O (See also -.\"O .BR path_resolution (7).) -パスで指定されているディレクトリに検索許可のないものがある -(訳注:x ビットが立っていない)。 -あるいは、指定されたファイルに対する書き込み許可を持っていない。 -.RB ( path_resolution (7) -も参照のこと) -.TP -.B EFAULT -.\"O .I Path -.\"O points outside the process's allocated address space. -.I path -がプロセスに割り当てられているアドレス空間外を指している。 -.TP -.B EFBIG -.\"O The argument -.\"O .I length -.\"O is larger than the maximum file size. (XSI) -引き数 -.I length -が最大ファイルサイズより大きい。(XSI) -.TP -.B EINTR -.\"O A signal was caught during execution. -実行中にシグナルを受けた。 -.TP -.B EINVAL -.\"O The argument -.\"O .I length -.\"O is negative or larger than the maximum file size. -引き数 -.I length -が負数であるか、最大ファイルサイズより大きい。 -.TP -.B EIO -.\"O An I/O error occurred updating the inode. -inode の更新時に I/O エラーが発生した。 -.TP -.B EINTR -.\"O While blocked waiting to complete, -.\"O the call was interrupted by a signal handler; see -.\"O .BR fcntl (2) -.\"O and -.\"O .BR signal (7). -完了待ちで停止 (block) している間に、呼び出しが -シグナルハンドラにより割り込まれた。 -.BR fcntl (2) -と -.BR signal (7) -を参照。 -.TP -.B EISDIR -.\"O The named file is a directory. -指定されたファイルはディレクトリである。 -.TP -.B ELOOP -.\"O Too many symbolic links were encountered in translating the pathname. -パス名を解釈する際にシンボリックリンクが多すぎた。 -.TP -.B ENAMETOOLONG -.\"O A component of a pathname exceeded 255 characters, -.\"O or an entire pathname exceeded 1023 characters. -パス名中のディレクトリ名が 255 文字を越えている、もしくはパス名全体が -1023 文字を越えている。 -.TP -.B ENOENT -.\"O The named file does not exist. -指定された名前のファイルが存在しない。 -.TP -.B ENOTDIR -.\"O A component of the path prefix is not a directory. -パス名中の項目にディレクトリではないものが入っている。 -.TP -.B EPERM -.\" This happens for at least MSDOS and VFAT file systems -.\" on kernel 2.6.13 -.\"O The underlying file system does not support extending -.\"O a file beyond its current size. -下層にあるファイルシステムでは、現在のファイル長を越えて -ファイルを伸長することができない。 -.TP -.B EROFS -.\"O The named file resides on a read-only file system. -指定されたファイルは読み出し専用のファイルシステム中にある。 -.TP -.B ETXTBSY -.\"O The file is a pure procedure (shared text) file that is being executed. -指定されたファイルは実行されているファイルである。 -.PP -.\"O For -.\"O .BR ftruncate () -.\"O the same errors apply, but instead of things that can be wrong with -.\"O .IR path , -.\"O we now have things that can be wrong with the file descriptor, -.\"O .IR fd : -.BR ftruncate () -にも同様のエラーが適用される。 -但し、 -.I path -に関するエラーの場合は、ファイルディスクリプター -.I fd -に関するエラーとなる。 -.TP -.B EBADF -.\"O .I fd -.\"O is not a valid descriptor. -.I fd -が無効なディスクリプターである。 -.TP -.\"O .BR EBADF " or " EINVAL -.BR EBADF " または " EINVAL -.\"O .I fd -.\"O is not open for writing. -.I fd -で指定されているものが書き込みモードで開かれていない。 -.TP -.B EINVAL -.\"O .I fd -.\"O does not reference a regular file. -.I fd -が通常のファイルを参照していない。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -.\"O 4.4BSD, SVr4, POSIX.1-2001 (these calls first appeared in 4.2BSD). -4.4BSD, SVr4, POSIX.1-2001 (これらのコールは 4.2BSD で初めて登場した)。 -.\"O .\" POSIX 1003.1-1996 has -.\"O .\" .BR ftruncate (). -.\"O .\" POSIX.1-2001 also has -.\"O .\" .BR truncate (), -.\"O .\" as an XSI extension. -.\"O .\" .LP -.\"O .\" SVr4 documents additional -.\"O .\" .BR truncate () -.\"O .\" error conditions EMFILE, EMULTIHP, ENFILE, ENOLINK. SVr4 documents for -.\"O .\" .BR ftruncate () -.\"O .\" an additional EAGAIN error condition. -.\" POSIX 1003.1-1996 には -.\" .BR ftruncate () -.\" がある。 -.\" POSIX.1-2001 には -.\" XSI 拡張として -.\" .BR truncate () -.\" もある。 -.\" .LP -.\" SVr4 には他のエラーコードとして、 -.\" .BR truncate () -.\" には EMFILE, EMULTIHP, ENFILE, ENOLINK が、 -.\" .BR ftruncate () -.\" には EAGAIN がそれぞれ記述されている。 -.\"O .SH NOTES -.SH 注意 -.\"O The above description is for XSI-compliant systems. -.\"O For non-XSI-compliant systems, the POSIX standard allows -.\"O two behaviors for -.\"O .BR ftruncate () -.\"O when -.\"O .I length -.\"O exceeds the file length -.\"O (note that -.\"O .BR truncate () -.\"O is not specified at all in such an environment): -.\"O either returning an error, or extending the file. -上記の記述は XSI 準拠のシステムのものである。 -XSI 非準拠のシステムの場合、POSIX 標準は -.BR ftruncate () -に対して -.I length -がファイルの長さより長かった場合、 -エラーを返すかファイルを伸張するかの二つの動作を許容している。 -.BR truncate () -に対しては全く規定されていない。 -.\"O Like most UNIX implementations, Linux follows the XSI requirement -.\"O when dealing with native file systems. -.\"O However, some nonnative file systems do not permit -.\"O .BR truncate () -.\"O and -.\"O .BR ftruncate () -.\"O to be used to extend a file beyond its current length: -.\"O a notable example on Linux is VFAT. -ほとんどの UNIX 実装と同様、Linux はネイティブ (Linux 由来) の -ファイルシステムの扱いでは XSI 要求仕様にしたがっている。 -しかしながら、いくつかの非ネイティブのファイルシステムでは、 -.BR truncate () -や -.BR ftruncate () -を使って現在のファイル長を越えてファイルを伸長することができない。 -Linux での有名な例としては VFAT がある。 -.\"O .\" At the very least: OSF/1, Solaris 7, and FreeBSD conform, mtk, Jan 2002 -.\"O .SH BUGS -.SH バグ -.\"O A header file bug in glibc 2.12 meant that the minimum value of -.\"O .\" http://sourceware.org/bugzilla/show_bug.cgi?id=12037 -.\"O .BR _POSIX_C_SOURCE -.\"O required to expose the declaration of -.\"O .BR ftruncate () -.\"O was 200809L instead of 200112L. -.\"O This has been fixed in later glibc versions. -glibc 2.12 のヘッダファイルにはバグがあり、 -.BR ftruncate () -の宣言を公開するのに必要な -.B _POSIX_C_SOURCE -の最小値が 200112L ではなく 200809L となっていた。 -このバグは、これ以降のバージョンの glibc では修正されている。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR open (2), -.BR stat (2), -.BR path_resolution (7) diff --git a/draft/man2/umask.2 b/draft/man2/umask.2 index 7cf17fbe..25ad15f9 100644 --- a/draft/man2/umask.2 +++ b/draft/man2/umask.2 @@ -27,166 +27,62 @@ .\" Modified by Michael Haardt .\" Modified Sat Jul 24 12:51:53 1993 by Rik Faith .\" Modified Tue Oct 22 22:39:04 1996 by Eric S. Raymond -.\" Modified Thu May 1 06:05:54 UTC 1997 by Nicolas Lichtmaier +.\" Modified Thu May 1 06:05:54 UTC 1997 by Nicolás Lichtmaier .\" with Lars Wirzenius suggestion .\" 2006-05-13, mtk, substantial rewrite of description of 'mask' .\" 2008-01-09, mtk, a few rewrites and additions. +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki -.\" all rights reserved. -.\" Translated 1997-06-26, SUTO Mitsuaki -.\" Modified 1999-03-21, HANATAKA Shinya -.\" Modified 2005-09-04, Akihiro MOTOKI -.\" Updated 2006-07-21, Akihiro MOTOKI, LDP v2.36 -.\" Updated 2008-02-10, Akihiro MOTOKI, LDP v2.77 +.\" This file was generated with po4a. Translate the source file. .\" -.TH UMASK 2 2008-01-09 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH UMASK 2 2008\-01\-09 Linux "Linux Programmer's Manual" .SH 名前 -.\"O umask \- set file mode creation mask umask \- ファイルモード作成マスクを設定する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .br -.B #include +\fB#include \fP .sp -.BI "mode_t umask(mode_t " mask ); -.\"O .SH DESCRIPTION +\fBmode_t umask(mode_t \fP\fImask\fP\fB);\fP .SH 説明 -.\"O .BR umask () -.\"O sets the calling process's file mode creation mask (umask) to -.\"O .I mask -.\"O & 0777 (i.e., only the file permission bits of -.\"O .I mask -.\"O are used), and returns the previous value of the mask. -.BR umask () -は、呼び出し元プロセスのファイルモード作成マスク (umask) を -.I mask -& 0777 に設定し -.RI ( umask -のファイル許可に対応するビットのみを使用する)、 -変更前のマスク値を返す。 +\fBumask\fP() は、呼び出し元プロセスのファイルモード作成マスク (umask) を \fImask\fP & 0777 に設定し (\fIumask\fP +のファイル許可に対応するビットのみを使用する)、 変更前のマスク値を返す。 -.\"O The umask is used by -.\"O .BR open (2), -.\"O .BR mkdir (2), -.\"O and other system calls that create files -.\"O .\" e.g., mkfifo(), creat(), mknod(), sem_open(), mq_open(), shm_open() -.\"O .\" but NOT the System V IPC *get() calls -.\"O to modify the permissions placed on newly created files or directories. -umask は、 -.BR open (2), -.BR mkdir (2) -やファイル作成を行うその他のシステムコールで、 -.\" 例えば mkfifo(), creat(), mknod(), sem_open(), mq_open(), shm_open() -.\" System V IPC *get() コールは該当しない。 -新しく作成されるファイルやディレクトリの許可 (permission) を -修正するために使用される。 -.\"O Specifically, permissions in the umask are turned off from -.\"O the \fImode\fP argument to -.\"O .BR open (2) -.\"O and -.\"O .BR mkdir (2). -具体的には umask に設定されている許可が -.BR open (2) -や -.BR mkdir (2) -の \fImode\fP 引き数から取り消される。 +.\" e.g., mkfifo(), creat(), mknod(), sem_open(), mq_open(), shm_open() +.\" but NOT the System V IPC *get() calls +umask は、 \fBopen\fP(2), \fBmkdir\fP(2) やファイル作成を行うその他のシステムコールで、 +新しく作成されるファイルやディレクトリの許可 (permission) を 修正するために使用される。 具体的には umask に設定されている許可が +\fBopen\fP(2) や \fBmkdir\fP(2) の \fImode\fP 引き数から取り消される。 -.\"O The constants that should be used to specify -.\"O .I mask -.\"O are described under -.\"O .BR stat (2). -.I mask -に指定するのに使用すべき定数については -.BR stat (2) -で説明されている。 +\fImask\fP に指定するのに使用すべき定数については \fBstat\fP(2) で説明されている。 -.\"O The typical default value for the process umask is -.\"O .I S_IWGRP\ |\ S_IWOTH -.\"O (octal 022). -.\"O In the usual case where the -.\"O .I mode -.\"O argument to -.\"O .BR open (2) -.\"O is specified as: -プロセスの umask のよくあるデフォルト値は -.I S_IWGRP\ |\ S_IWOTH -(8進で 022) である。 -新しいファイルを作成する際に -.BR open (2) -の -.I mode -引き数に +プロセスの umask のよくあるデフォルト値は \fIS_IWGRP\ |\ S_IWOTH\fP (8進で 022) である。 +新しいファイルを作成する際に \fBopen\fP(2) の \fImode\fP 引き数に .nf S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH + .fi を指定するというよくあるケースでは、作成されたファイルは -.\"O (octal 0666) when creating a new file, the permissions on the -.\"O resulting file will be: .nf S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH .fi -.\"O (because 0666 & ~022 = 0644; i.e., rw\-r\-\-r\-\-). -という許可を持つことになる -(なぜなら 0666 & ~022 = 0644、つまり rw\-r\-\-r\-\-)。 -.\"O .SH "RETURN VALUE" +という許可を持つことになる (なぜなら 0666 & ~022 = 0644、つまり rw\-r\-\-r\-\-)。 .SH 返り値 -.\"O This system call always succeeds and the previous value of the mask -.\"O is returned. このシステムコールは必ず成功し、以前の umask 値を返す。 -.\"O .SH "CONFORMING TO" .SH 準拠 -SVr4, 4.3BSD, POSIX.1-2001. -.\"O .SH NOTES +SVr4, 4.3BSD, POSIX.1\-2001. .SH 注意 -.\"O A child process created via -.\"O .BR fork (2) -.\"O inherits its parent's umask. -.\"O The umask is left unchanged by -.\"O .BR execve (2). -.BR fork (2) -で作成された子プロセスは、親プロセスの umask を継承する。 -.BR execve (2) -によって umask は変更されない。 +\fBfork\fP(2) で作成された子プロセスは、親プロセスの umask を継承する。 \fBexecve\fP(2) によって umask +は変更されない。 -.\"O The umask setting also affects the permissions assigned to POSIX IPC objects -.\"O .RB ( mq_open (3), -.\"O .BR sem_open (3), -.\"O .BR shm_open (3)), -.\"O FIFOs -.\"O .RB ( mkfifo (3)), -.\"O and UNIX domain sockets -.\"O .RB ( unix (7)) -.\"O created by the process. -.\"O The umask does not affect the permissions assigned -.\"O to System V IPC objects created by the process (using -.\"O .BR msgget (2), -.\"O .BR semget (2), -.\"O .BR shmget (2)). -umask の設定は、そのプロセスが生成する POSIX IPC オブジェクト -.RB ( mq_open (3), -.BR sem_open (3), -.BR shm_open (3)) -や FIFO -.RB ( mkfifo (3))、 -UNIX ドメインソケット -.RB ( unix (7)) -に設定される許可にも影響を与える。 -一方、umask は、そのプロセスが -.RB ( msgget (2), -.BR semget (2), -.BR shmget (2) -を使って) 生成する System V IPC オブジェクトに設定される許可には -影響を与えない。 -.\"O .SH "SEE ALSO" +umask の設定は、そのプロセスが生成する POSIX IPC オブジェクト (\fBmq_open\fP(3), \fBsem_open\fP(3), +\fBshm_open\fP(3)) や FIFO (\fBmkfifo\fP(3))、 UNIX ドメインソケット (\fBunix\fP(7)) +に設定される許可にも影響を与える。 一方、umask は、そのプロセスが (\fBmsgget\fP(2), \fBsemget\fP(2), +\fBshmget\fP(2) を使って) 生成する System V IPC オブジェクトに設定される許可には 影響を与えない。 .SH 関連項目 -.BR chmod (2), -.BR mkdir (2), -.BR open (2), -.BR stat (2) +\fBchmod\fP(2), \fBmkdir\fP(2), \fBopen\fP(2), \fBstat\fP(2) .\" FIXME . eventually: .BR acl (5) diff --git a/draft/man2/uname.2 b/draft/man2/uname.2 index ea248be3..02983ab0 100644 --- a/draft/man2/uname.2 +++ b/draft/man2/uname.2 @@ -22,51 +22,25 @@ .\" .\" 2007-07-05 mtk: Added details on underlying system call interfaces .\" -.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki -.\" all rights reserved. -.\" Translated Thu Jun 26 21:23:19 JST 1997 -.\" by SUTO, Mitsuaki -.\" Updated & Modified Thu Feb 14 21:53:41 JST 2002 -.\" by Yuichi SATO -.\" Updated 2007-09-04, Akihiro MOTOKI , LDP v2.64 +.\"******************************************************************* .\" -.TH UNAME 2 2008-12-03 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH UNAME 2 2008\-12\-03 Linux "Linux Programmer's Manual" .SH 名前 -.\"O uname \- get name and information about current kernel uname \- 現在稼働中のカーネルについての名前と情報を得る -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int uname(struct utsname *" buf ); -.\"O .SH DESCRIPTION +\fBint uname(struct utsname *\fP\fIbuf\fP\fB);\fP .SH 説明 -.\"O .BR uname () -.\"O returns system information in the structure pointed to by -.\"O .IR buf . -.BR uname () -は -.I buf -で指される構造体にシステム情報を返す。 -.\"O The -.\"O .I utsname -.\"O struct is defined in -.\"O .IR : -.I utsname -構造体は -.I -で以下のように定義されている。 +\fBuname\fP() は \fIbuf\fP で指される構造体にシステム情報を返す。 \fIutsname\fP 構造体は +\fI\fP で以下のように定義されている。 .in +4n .nf struct utsname { -.\"O char sysname[]; /* Operating system name (e.g., "Linux") */ -.\"O char nodename[]; /* Name within "some implementation-defined -.\"O network" */ -.\"O char release[]; /* OS release (e.g., "2.6.28") */ -.\"O char version[]; /* OS version */ -.\"O char machine[]; /* Hardware identifier */ char sysname[]; /* OS の名前 (例: "Linux") */ char nodename[]; /* 「実装時に定義された、何らかの ネットワーク」におけるマシン名 */ @@ -74,203 +48,54 @@ struct utsname { char version[]; /* OS のバージョン */ char machine[]; /* ハードウェア識別子 */ #ifdef _GNU_SOURCE -.\"O char domainname[]; /* NIS or YP domain name */ char domainname[]; /* NIS や YP のドメイン名 */ #endif }; .fi .in -.\"O The length of the arrays in a -.\"O .I struct utsname -.\"O is unspecified (see NOTES); -.\"O the fields are terminated by a null byte (\(aq\\0\(aq). -.I struct utsname -にある配列の長さは指定されていない (「注意」の節を参照)。 -フィールドは NULL バイト (\(aq\\0\(aq) で終端される。 -.\"O .SH "RETURN VALUE" +\fIstruct utsname\fP にある配列の長さは指定されていない (「注意」の節を参照)。 フィールドは NULL バイト +(\(aq\e0\(aq) で終端される。 .SH 返り値 -.\"O On success, zero is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合 0 が返る。失敗した場合 \-1 が返り、 -.I errno -がエラーの内容に従って設定される。 -.\"O .SH ERRORS +成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP -.B EFAULT -.\"O .I buf -.\"O is not valid. -.I buf -が有効でない。 -.\"O .SH "CONFORMING TO" +.TP +\fBEFAULT\fP +\fIbuf\fP が有効でない。 .SH 準拠 -SVr4, POSIX.1-2001. -.\"O There is no -.\"O .BR uname () -.\"O call in 4.3BSD. -4.3BSD には -.BR uname () -コールがない。 +SVr4, POSIX.1\-2001. 4.3BSD には \fBuname\fP() コールがない。 .PP -.\"O The -.\"O .I domainname -.\"O member (the NIS or YP domain name) is a GNU extension. -.I domainname -メンバー (NIS または YP ドメイン名) は GNU の拡張である。 -.\"O .SH NOTES +\fIdomainname\fP メンバー (NIS または YP ドメイン名) は GNU の拡張である。 .SH 注意 -.\"O This is a system call, and the operating system presumably knows -.\"O its name, release and version. -.\"O It also knows what hardware it runs on. -.\"O So, four of the fields of the struct are meaningful. -これはシステムコールであり、OS は名前・リリース・バージョンなどを -たぶん分かっているだろう。 -さらにそれが稼働しているハードウェアも分かっているだろう。 -よって構造体の 4 つのフィールドには意味がある。 -.\"O On the other hand, the field \fInodename\fP is meaningless: -.\"O it gives the name of the present machine in some undefined -.\"O network, but typically machines are in more than one network -.\"O and have several names. -.\"O Moreover, the kernel has no way of knowing -.\"O about such things, so it has to be told what to answer here. -.\"O The same holds for the additional \fIdomainname\fP field. -一方、\fInodename\fP フィールドには意味がない: -このフィールドは現在のマシンの (定義されていない) -どこかのネットワークにおける名前を与えるが、 -通常マシンは複数のネットワークに属し、複数の名前を持つ。 -さらに、カーネルはこのような情報を知る術を持たないので、 -ここでの答えは前もって教えてやらなければならない。 -これは追加フィールドである \fIdomainname\fP についても同様である。 +これはシステムコールであり、OS は名前・リリース・バージョンなどを たぶん分かっているだろう。 +さらにそれが稼働しているハードウェアも分かっているだろう。 よって構造体の 4 つのフィールドには意味がある。 一方、\fInodename\fP +フィールドには意味がない: このフィールドは現在のマシンの (定義されていない) どこかのネットワークにおける名前を与えるが、 +通常マシンは複数のネットワークに属し、複数の名前を持つ。 さらに、カーネルはこのような情報を知る術を持たないので、 +ここでの答えは前もって教えてやらなければならない。 これは追加フィールドである \fIdomainname\fP についても同様である。 .LP -.\"O To this end Linux uses the system calls -.\"O .BR sethostname (2) -.\"O and -.\"O .BR setdomainname (2). -このため Linux ではシステムコール -.BR sethostname (2) -と -.BR setdomainname (2) -が使われる。 -.\"O Note that there is no standard that says that the hostname set by -.\"O .BR sethostname (2) -.\"O is the same string as the \fInodename\fP field of the struct returned by -.\"O .BR uname () -.RB 「 sethostname (2) -で設定されるホスト名は、 -.BR uname () -で返される構造体の \fInodename\fP フィールドと同じ文字列である」 -と規定している標準規格はない -.\"O (indeed, some systems allow a 256-byte hostname and an 8-byte nodename), -.\"O but this is true on Linux. -.\"O The same holds for -.\"O .BR setdomainname (2) -.\"O and the \fIdomainname\fP field. -(実際、256 バイトのホスト名と 8 バイトのノード名を許可しているシステムもある)。 -しかし、Linux では同じ文字列が返される。 -.BR setdomainname (2) -と \fIdomainname\fP フィールドについても同じことが成り立つ。 +このため Linux ではシステムコール \fBsethostname\fP(2) と \fBsetdomainname\fP(2) が使われる。 +「\fBsethostname\fP(2) で設定されるホスト名は、 \fBuname\fP() で返される構造体の \fInodename\fP +フィールドと同じ文字列である」 と規定している標準規格はない (実際、256 バイトのホスト名と 8 バイトのノード名を許可しているシステムもある)。 +しかし、Linux では同じ文字列が返される。 \fBsetdomainname\fP(2) と \fIdomainname\fP +フィールドについても同じことが成り立つ。 .LP -.\"O The length of the fields in the struct varies. -.\"O Some operating systems -.\"O or libraries use a hardcoded 9 or 33 or 65 or 257. -.\"O Other systems use -.\"O .B SYS_NMLN -.\"O or -.\"O .B _SYS_NMLN -.\"O or -.\"O .B UTSLEN -.\"O or -.\"O .BR _UTSNAME_LENGTH . -.\"O Clearly, it is a bad -.\"O idea to use any of these constants; just use sizeof(...). -.\"O Often 257 is chosen in order to have room for an internet hostname. -構造体のフィールドの長さはさまざまである。 -OS やライブラリの中には、 -ハードコードされた 9, 33, 65, 257 などの値を使っているものもある。 -また -.BR SYS_NMLN , -.BR _SYS_NMLN , -.BR UTSLEN , -.B _UTSNAME_LENGTH -などを使っているシステムもある。 -はっきり言って、これらの定数を使うのは悪い考え方であり、 -sizeof(...) を使うべきである。 -インターネットホスト名で使う領域を持たせるために、 -257 が選ばれることが多い。 +構造体のフィールドの長さはさまざまである。 OS やライブラリの中には、 ハードコードされた 9, 33, 65, 257 +などの値を使っているものもある。 また \fBSYS_NMLN\fP, \fB_SYS_NMLN\fP, \fBUTSLEN\fP, \fB_UTSNAME_LENGTH\fP +などを使っているシステムもある。 はっきり言って、これらの定数を使うのは悪い考え方であり、 sizeof(...) を使うべきである。 +インターネットホスト名で使う領域を持たせるために、 257 が選ばれることが多い。 .LP -.\"O Part of the utsname information is also accessible via -.\"O .IR /proc/sys/kernel/ { ostype , -.\"O .IR hostname , -.\"O .IR osrelease , -.\"O .IR version , -.\"O .IR domainname }. -utsname の情報は、 -.IR /proc/sys/kernel/ { ostype , -.IR hostname , -.IR osrelease , -.IR version , -.IR domainname } -を使ってアクセスすることもできる。 -.\"O .SS Underlying kernel interface +utsname の情報は、 \fI/proc/sys/kernel/\fP{\fIostype\fP, \fIhostname\fP, \fIosrelease\fP, +\fIversion\fP, \fIdomainname\fP} を使ってアクセスすることもできる。 .SS 背後のカーネル・インタフェース .LP -.\"O Over time, increases in the size of the -.\"O .I utsname -.\"O structure have led to three successive versions of -.\"O .BR uname (): -時間の経過とともに、 -.I utsname -構造体のサイズが大きくなり、この影響で -.BR uname () -には 3つのバージョンが存在する: -.\"O .IR sys_olduname () -.\"O (slot -.\"O .IR __NR_oldolduname ), -.\"O .IR sys_uname () -.\"O (slot -.\"O .IR __NR_olduname ), -.\"O and -.\"O .IR sys_newuname () -.\"O (slot -.\"O .IR __NR_uname) . -.IR sys_olduname () -(スロットは -.IR __NR_oldolduname )、 -.IR sys_uname () -(スロットは -.IR __NR_olduname )、 -.IR sys_newuname () -(スロットは -.IR __NR_uname )。 -.\"O The first one -.\"O .\" That was back before Linux 1.0 -.\"O used length 9 for all fields; -.\"O the second -.\"O .\" That was also back before Linux 1.0 -.\"O used 65; -.\"O the third also uses 65 but adds the \fIdomainname\fP field. -.IR sys_olduname () -.\" これは Linux 1.0 より前に遡る話である。 -はすべてのフィールドが長さ 9 を使っていた。 -.IR sys_uname () -.\" これも Linux 1.0 より前に遡る話である。 -は長さ 65 を使っていた。 -.IR sys_newuname () -も長さ 65 を使っているが、 -\fIdomainname\fP フィールドが追加されている。 -.\"O The glibc -.\"O .BR uname () -.\"O wrapper function hides these details from applications, -.\"O invoking the most recent version of the system call provided by the kernel. -glibc の -.BR uname () -ラッパー関数は、これらの詳細をアプリケーションから隠蔽し、 +.\" That was back before Linux 1.0 +.\" That was also back before Linux 1.0 +時間の経過とともに、 \fIutsname\fP 構造体のサイズが大きくなり、この影響で \fBuname\fP() には 3つのバージョンが存在する: +\fIsys_olduname\fP() (スロットは \fI__NR_oldolduname\fP)、 \fIsys_uname\fP() (スロットは +\fI__NR_olduname\fP)、 \fIsys_newuname\fP() (スロットは \fI__NR_uname\fP)。 +\fIsys_olduname\fP() はすべてのフィールドが長さ 9 を使っていた。 \fIsys_uname\fP() は長さ 65 を使っていた。 +\fIsys_newuname\fP() も長さ 65 を使っているが、 \fIdomainname\fP フィールドが追加されている。 glibc の +\fBuname\fP() ラッパー関数は、これらの詳細をアプリケーションから隠蔽し、 カーネルが提供しているシステムコールのうち最新のバージョンを起動する。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR uname (1), -.BR getdomainname (2), -.BR gethostname (2) +\fBuname\fP(1), \fBgetdomainname\fP(2), \fBgethostname\fP(2) diff --git a/draft/man2/unimplemented.2 b/draft/man2/unimplemented.2 index 6eb5963e..a9391260 100644 --- a/draft/man2/unimplemented.2 +++ b/draft/man2/unimplemented.2 @@ -24,80 +24,29 @@ .\" .\" Updated, aeb, 980612 .\" -.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki -.\" all rights reserved. -.\" Translated Thu Jun 26 21:24:15 JST 1997 -.\" by SUTO, Mitsuaki -.\" Modified Tue Jan 26 00:04:30 JST 1999 -.\" by HANATAKA Shinya +.\"******************************************************************* .\" -.TH UNIMPLEMENTED 2 2007-07-05 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH UNIMPLEMENTED 2 2007\-07\-05 Linux "Linux Programmer's Manual" .SH 名前 -.\"O afs_syscall, break, ftime, getpmsg, gtty, lock, madvise1, mpx, prof, profil, -.\"O putpmsg, security, stty, tuxcall, ulimit, vserver \- unimplemented system calls afs_syscall, break, ftime, getpmsg, gtty, lock, madvise1, mpx, prof, profil, -putpmsg, security, stty, tuxcall, ulimit, vserver \- 実装されていないシステムコール -.\"O .SH SYNOPSIS +putpmsg, security, stty, tuxcall, ulimit, vserver \- +実装されていないシステム .SH 書式 -.\"O Unimplemented system calls. 実装されていないシステムコール -.\"O .SH DESCRIPTION .SH 説明 -.\"O These system calls are not implemented in the Linux 2.6.22 kernel. これらのシステムコールは Linux 2.6.22 カーネルでは実装されていない。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O These system calls always return \-1 and set -.\"O .I errno -.\"O to -.\"O .BR ENOSYS . -これらのシステムコールは常に \-1 を返し、 -.I errno -に -.BR ENOSYS -を設定する。 -.\"O .SH NOTES +これらのシステムコールは常に \-1 を返し、 \fIerrno\fP に \fBENOSYS\fP を設定する。 .SH 注意 -.\"O Note that -.\"O .BR ftime (3), -.\"O .BR profil (3) -.\"O and -.\"O .BR ulimit (3) -.\"O are implemented as library functions. -.BR ftime (3), -.BR profil (3), -.BR ulimit (3) -はライブラリ関数として実装されていることに注意すること。 +\fBftime\fP(3), \fBprofil\fP(3), \fBulimit\fP(3) はライブラリ関数として実装されていることに注意すること。 -.\"O Some system calls, like -.\"O .BR alloc_hugepages (2), -.\"O .BR free_hugepages (2), -.\"O .BR ioperm (2), -.\"O .BR iopl (2), -.\"O and -.\"O .BR vm86 (2) -.\"O only exist on certain architectures. -.BR alloc_hugepages (2), -.BR free_hugepages (2), -.BR ioperm (2), -.BR iopl (2), -.BR vm86 (2) -のようなシステムコールは特定のアーキテクチャにのみ存在する。 +\fBalloc_hugepages\fP(2), \fBfree_hugepages\fP(2), \fBioperm\fP(2), \fBiopl\fP(2), +\fBvm86\fP(2) のようなシステムコールは特定のアーキテクチャにのみ存在する。 -.\"O Some system calls, like -.\"O .BR ipc (2), -.\"O .BR create_module (2), -.\"O .BR init_module (2), -.\"O and -.\"O .BR delete_module (2) -.\"O only exist when the Linux kernel was built with support for them. -.BR ipc (2), -.BR create_module (2), -.BR init_module (2), -.BR delete_module (2) -のようなシステムコールは Linux カーネルがそれらをサポートするよう -に構築されている場合にのみ存在する。 -.\"O .SH "SEE ALSO" +\fBipc\fP(2), \fBcreate_module\fP(2), \fBinit_module\fP(2), \fBdelete_module\fP(2) +のようなシステムコールは Linux カーネルがそれらをサポートするよう に構築されている場合にのみ存在する。 .SH 関連項目 -.BR syscalls (2) +\fBsyscalls\fP(2) diff --git a/draft/man2/unlinkat.2 b/draft/man2/unlinkat.2 index 62da99e6..a8803b43 100644 --- a/draft/man2/unlinkat.2 +++ b/draft/man2/unlinkat.2 @@ -22,246 +22,80 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2006 Yuichi SATO -.\" all rights reserved. -.\" Translated 2006-08-24 by Yuichi SATO , LDP v2.39 .\" -.TH UNLINKAT 2 2009-12-13 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH UNLINKAT 2 2012\-03\-25 Linux "Linux Programmer's Manual" .SH 名前 -.\"O unlinkat \- remove a directory entry relative to a directory file descriptor unlinkat \- ディレクトリファイルディスクリプタから相対的な位置にあるディレクトリエントリを削除する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include /* AT_* 定数の定義 */\fP +\fB#include \fP .sp -.BI "int unlinkat(int " dirfd ", const char *" pathname ", int " flags ); +\fBint unlinkat(int \fP\fIdirfd\fP\fB, const char *\fP\fIpathname\fP\fB, int \fP\fIflags\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR unlinkat (): +\fBunlinkat\fP(): .PD 0 .ad l .RS 4 -.TP 4 -.\"O Since glibc 2.10: +.TP 4 glibc 2.10 以降: _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L -.TP -.\"O Before glibc 2.10: +.TP glibc 2.10 より前: _ATFILE_SOURCE .RE .ad .PD -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR unlinkat () -.\"O system call operates in exactly the same way as either -.\"O .BR unlink (2) -.\"O or -.\"O .BR rmdir (2) -.\"O (depending on whether or not -.\"O .I flags -.\"O includes the -.\"O .B AT_REMOVEDIR -.\"O flag) -.\"O except for the differences described in this manual page. -.BR unlinkat () -システムコールは、この man ページで説明している違いがある以外は、 -.RI ( flags -に -.B AT_REMOVEDIR -フラグが含まれるか否かにより) -.BR unlink (2) -または -.BR rmdir (2) +\fBunlinkat\fP() システムコールは、この man ページで説明している違いがある以外は、 (\fIflags\fP に +\fBAT_REMOVEDIR\fP フラグが含まれるか否かにより) \fBunlink\fP(2) または \fBrmdir\fP(2) と全く同じように動作する。 -.\"O If the pathname given in -.\"O .I pathname -.\"O is relative, then it is interpreted relative to the directory -.\"O referred to by the file descriptor -.\"O .I dirfd -.\"O (rather than relative to the current working directory of -.\"O the calling process, as is done by -.\"O .BR unlink (2) -.\"O and -.\"O .BR rmdir (2) -.\"O for a relative pathname). -.I pathname -で指定されるパス名が相対パス名である場合、 -ファイルディスクリプタ -.I dirfd -で参照されるディレクトリからの相対パス名として解釈される -.RB ( unlink (2) -または -.BR rmdir (2) -では、相対パスは呼び出し元プロセスの -カレントワーキングディレクトリからの相対パスとなる)。 +\fIpathname\fP で指定されるパス名が相対パス名である場合、 ファイルディスクリプタ \fIdirfd\fP +で参照されるディレクトリからの相対パス名として解釈される (\fBunlink\fP(2) または \fBrmdir\fP(2) +では、相対パスは呼び出し元プロセスの カレントワーキングディレクトリからの相対パスとなる)。 -.\"O If the pathname given in -.\"O .I pathname -.\"O is relative and -.\"O .I dirfd -.\"O is the special value -.\"O .BR AT_FDCWD , -.\"O then -.\"O .I pathname -.\"O is interpreted relative to the current working -.\"O directory of the calling process (like -.\"O .BR unlink (2) -.\"O and -.\"O .BR rmdir (2)). -.I pathname -で指定されるパス名が相対パス名であり、かつ -.I dirfd -が特別な値 -.B AT_FDCWD -である場合、 -.I pathname -は -.RB ( unlink (2) -または -.BR rmdir (2) -と同じように) 呼び出し元プロセスの +\fIpathname\fP で指定されるパス名が相対パス名であり、かつ \fIdirfd\fP が特別な値 \fBAT_FDCWD\fP である場合、 +\fIpathname\fP は (\fBunlink\fP(2) または \fBrmdir\fP(2) と同じように) 呼び出し元プロセスの カレントワーキングディレクトリからの相対パス名として解釈される。 -.\"O If the pathname given in -.\"O .I pathname -.\"O is absolute, then -.\"O .I dirfd -.\"O is ignored. -.I pathname -で指定されるパス名が絶対パス名である場合、 -.I dirfd -は無視される。 +\fIpathname\fP で指定されるパス名が絶対パス名である場合、 \fIdirfd\fP は無視される。 -.\"O .I flags -.\"O is a bit mask that can either be specified as 0, or by ORing -.\"O together flag values that control the operation of -.\"O .BR unlinkat (). -.I flags -はビットマスクであり、0 または -.BR unlinkat () -の操作を制御するフラグ値の OR を指定できる。 -.\"O Currently only one such flags is defined: -現在のところ 1 つのフラグだけが定義されている: -.TP -.B AT_REMOVEDIR -.\"O By default, -.\"O .BR unlinkat () -.\"O performs the equivalent of -.\"O .BR unlink (2) -.\"O on -.\"O .IR pathname . -デフォルトでは、 -.BR unlinkat () -は -.I pathname -に対して -.BR unlink (2) -と同じ操作を行う。 -.\"O If the -.\"O .B AT_REMOVEDIR -.\"O flag is specified, then -.\"O performs the equivalent of -.\"O .BR rmdir (2) -.\"O on -.\"O .IR pathname . -.B AT_REMOVEDIR -フラグが指定されると、 -.I pathname -に対して -.BR rmdir (2) -と同じ操作を行う。 -.\"O .SH "RETURN VALUE" +\fIflags\fP はビットマスクであり、0 または \fBunlinkat\fP() の操作を制御するフラグ値の OR を指定できる。 現在のところ 1 +つのフラグだけが定義されている: +.TP +\fBAT_REMOVEDIR\fP +デフォルトでは、 \fBunlinkat\fP() は \fIpathname\fP に対して \fBunlink\fP(2) と同じ操作を行う。 +\fBAT_REMOVEDIR\fP フラグが指定されると、 \fIpathname\fP に対して \fBrmdir\fP(2) と同じ操作を行う。 .SH 返り値 -.\"O On success, -.\"O .BR unlinkat () -.\"O returns 0. -成功した場合、 -.BR unlinkat () -は 0 を返す。 -.\"O On error, \-1 is returned and -.\"O .I errno -.\"O is set to indicate the error. -エラーの場合、\-1 が返されて、 -.I errno -にはエラーを示す値が設定される。 -.\"O .SH ERRORS +成功した場合、 \fBunlinkat\fP() は 0 を返す。 エラーの場合、\-1 が返されて、 \fIerrno\fP にはエラーを示す値が設定される。 .SH エラー -.\"O The same errors that occur for -.\"O .BR unlink (2) -.\"O and -.\"O .BR rmdir (2) -.\"O can also occur for -.\"O .BR unlinkat (). -.BR unlink (2) -または -.BR rmdir (2) -と同じエラーが -.BR unlinkat () -でも起こる。 -.\"O The following additional errors can occur for -.\"O .BR unlinkat (): -.BR unlinkat () +\fBunlink\fP(2) または \fBrmdir\fP(2) と同じエラーが \fBunlinkat\fP() でも起こる。 \fBunlinkat\fP() では、その他に以下のエラーが起こる: -.TP -.B EBADF -.\"O .I dirfd -.\"O is not a valid file descriptor. -.I dirfd -が有効なファイルディスクリプタでない。 -.TP -.B EINVAL -.\"O An invalid flag value was specified in -.\"O .IR flags . -.I flags -に不正なフラグ値が指定された。 -.TP -.B ENOTDIR -.\"O .I pathname -.\"O is relative and -.\"O .I dirfd -.\"O is a file descriptor referring to a file other than a directory. -.I pathname -が相対パスで、かつ -.I dirfd -がディレクトリ以外のファイルを参照するファイルディスクリプタである。 -.\"O .SH VERSIONS +.TP +\fBEBADF\fP +\fIdirfd\fP が有効なファイルディスクリプタでない。 +.TP +\fBEINVAL\fP +\fIflags\fP に不正なフラグ値が指定された。 +.TP +\fBENOTDIR\fP +\fIpathname\fP が相対パスで、かつ \fIdirfd\fP がディレクトリ以外のファイルを参照するファイルディスクリプタである。 .SH バージョン -.\"O .BR unlinkat () -.\"O was added to Linux in kernel 2.6.16. -.BR unlinkat () -は Linux カーネル 2.6.16 で追加された。 -.\"O .SH "CONFORMING TO" +\fBunlinkat\fP() は Linux カーネル 2.6.16 で追加された。 .SH 準拠 -POSIX.1-2008. -.\"O A similar system call exists on Solaris. -Solaris には、これと同じようなシステムコールが存在する。 -.\"O .SH NOTES +POSIX.1\-2008. Solaris には、これと同じようなシステムコールが存在する。 .SH 注意 -.\"O See -.\"O .BR openat (2) -.\"O for an explanation of the need for -.\"O .BR unlinkat (). -.BR unlinkat () -が必要な理由については、 -.BR openat (2) -を参照すること。 -.\"O .SH "SEE ALSO" +\fBunlinkat\fP() が必要な理由については、 \fBopenat\fP(2) を参照すること。 .SH 関連項目 -.BR openat (2), -.BR rmdir (2), -.BR unlink (2), -.BR path_resolution (7) +\fBopenat\fP(2), \fBrmdir\fP(2), \fBunlink\fP(2), \fBpath_resolution\fP(7) diff --git a/draft/man2/unshare.2 b/draft/man2/unshare.2 deleted file mode 100644 index e76cda8f..00000000 --- a/draft/man2/unshare.2 +++ /dev/null @@ -1,286 +0,0 @@ -.\" Copyright (C) 2006, Janak Desai -.\" and Copyright (C) 2006, Michael Kerrisk -.\" Licensed under the GPL -.\" -.\" Patch Justification: -.\" unshare system call is needed to implement, using PAM, -.\" per-security_context and/or per-user namespace to provide -.\" polyinstantiated directories. Using unshare and bind mounts, a -.\" PAM module can create private namespace with appropriate -.\" directories(based on user's security context) bind mounted on -.\" public directories such as /tmp, thus providing an instance of -.\" /tmp that is based on user's security context. Without the -.\" unshare system call, namespace separation can only be achieved -.\" by clone, which would require porting and maintaining all commands -.\" such as login, and su, that establish a user session. -.\" -.\" FIXME Document CLONE_NEWIPC, which is new in 2.6.18 -.\" FIXME Document CLONE_NEWUTS, which is new in 2.6.19 -.\" FIXME Document CLONE_SYSVSEM, which is new in 2.6.26 -.\" -.\" Japanese Version Copyright (c) 2006 Yuichi SATO -.\" all rights reserved. -.\" Translated 2006-08-10 by Yuichi SATO , LDP v2.36 -.\" -.TH UNSHARE 2 2010-09-10 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O unshare \- disassociate parts of the process execution context -unshare \- プロセス実行コンテキストの一部を分離する -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" -.\" Actually _BSD_SOURCE || _SVID_SOURCE -.\" See http://sources.redhat.com/bugzilla/show_bug.cgi?id=4749 -.B #include -.sp -.BI "int unshare(int " flags ); -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O .BR unshare () -.\"O allows a process to disassociate parts of its execution -.\"O context that are currently being shared with other processes. -.BR unshare () -を使うと、プロセスは他のプロセスと現在共有している -実行コンテキストの一部を分離することができる。 -.\"O Part of the execution context, such as the mount namespace, is shared -.\"O implicitly when a new process is created using -.\"O .BR fork (2) -.\"O or -.\"O .BR vfork (2), -.\"O while other parts, such as virtual memory, may be -.\"O shared by explicit request when creating a process using -.\"O .BR clone (2). -実行コンテキストの一部、たとえばマウント名前空間 (mount namespace) -などは、新しいプロセスを -.BR fork (2) -または -.BR vfork (2) -を使って生成したときに、暗黙のうちに共有される。 -一方、仮想メモリなどは、 -.BR clone (2) -を使ってプロセスを生成するときに、明示的に共有することを要求できる。 - -.\"O The main use of -.\"O .BR unshare () -.\"O is to allow a process to control its -.\"O shared execution context without creating a new process. -.BR unshare () -の主な利用法は、プロセスが新しいプロセスを生成することなく、 -共有実行コンテキストを制御することである。 - -.\"O The -.\"O .I flags -.\"O argument is a bit mask that specifies which parts of -.\"O the execution context should be unshared. -.I flags -引き数はビットマスクであり、 -実行コンテキストのどの部分の共有を解除するかを表す。 -.\"O This argument is specified by ORing together zero or more -.\"O of the following constants: -この引き数は、以下の定数の 0 個以上の OR で指定する: -.TP -.B CLONE_FILES -.\"O Reverse the effect of the -.\"O .BR clone (2) -.\"O .B CLONE_FILES -.\"O flag. -.BR clone (2) -.B CLONE_FILES -フラグの効果を取り消す。 -.\"O Unshare the file descriptor table, so that the calling process -.\"O no longer shares its file descriptors with any other process. -ファイルディスクリプタテーブルを共有させず、 -呼び出し元プロセスは他のプロセスとファイルディスクリプタを共有しなくなる。 -.TP -.B CLONE_FS -.\"O Reverse the effect of the -.\"O .BR clone (2) -.\"O .B CLONE_FS -.\"O flag. -.BR clone (2) -.B CLONE_FS -フラグの効果を取り消す。 -.\"O Unshare file system attributes, so that the calling process -.\"O no longer shares its root directory, current directory, -.\"O or umask attributes with any other process. -ファイルシステム属性を共有させず、 -呼び出し元プロセスは他のプロセスとルートディレクトリ・ -カレントディレクトリ・umask 属性を共有しなくなる。 -.\"O .BR chroot (2), -.\"O .BR chdir (2), -.\"O or -.\"O .BR umask (2) -.BR chroot (2), -.BR chdir (2), -.BR umask (2) -に影響する。 -.TP -.B CLONE_NEWNS -.\" These flag name are inconsistent: -.\" CLONE_NEWNS does the same thing in clone(), but CLONE_VM, -.\" CLONE_FS, and CLONE_FILES reverse the action of the clone() -.\" flags of the same name. -.\"O This flag has the -.\"O .I same -.\"O effect as the -.\"O .BR clone (2) -.\"O .B CLONE_NEWNS -.\"O flag. -このフラグは -.BR clone (2) -.B CLONE_NEWNS -フラグと\fI同じ\fR効果を持つ。 -.\"O Unshare the mount namespace, -.\"O so that the calling process has a private copy of -.\"O its namespace which is not shared with any other process. -マウント名前空間を共有せず、呼び出し元プロセスは -他のプロセスとは共有しない固有の名前空間のコピーを持つ。 -.\"O Specifying this flag automatically implies -.\"O .B CLONE_FS -.\"O as well. -このフラグを指定すると、 -.B CLONE_FS -も暗黙のうちに指定される。 -.\" As at 2.6.16, the following forced implications also apply, -.\" although the relevant flags are not yet implemented. -.\" If CLONE_THREAD is set force CLONE_VM. -.\" If CLONE_VM is set, force CLONE_SIGHAND. -.\" If CLONE_SIGHAND is set and signals are also being shared -.\" (i.e., current->signal->count > 1), force CLONE_THREAD. -.\" -.\" FIXME . CLONE_VM is not (yet, as at 2.6.16) implemented. -.\" .TP -.\" .B CLONE_VM -.\" Reverse the effect of the -.\" .BR clone (2) -.\" .B CLONE_VM -.\" flag. -.\" .RB ( CLONE_VM -.\" is also implicitly set by -.\" .BR vfork (2), -.\" and can be reversed using this -.\" .BR unshare () -.\" flag.) -.\" Unshare virtual memory, so that the calling process no -.\" longer shares its virtual address space with any other process. -.PP -.\"O If -.\"O .I flags -.\"O is specified as zero, then -.\"O .BR unshare () -.\"O is a no-op; -.\"O no changes are made to the calling process's execution context. -.I flags -に 0 が指定された場合、 -.BR unshare () -は何も行わないので、 -呼び出し元プロセスの実行コンテキストは、何も変更されない。 -.\"O .SH RETURN VALUE -.SH 返り値 -.\"O On success, zero returned. -.\"O On failure, \-1 is returned and -.\"O .I errno -.\"O is set to indicate the error. -成功した場合は 0 が返される。 -失敗した場合は \-1 が返されて、 -.I errno -にはエラーを示す値が設定される。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EINVAL -.\"O An invalid bit was specified in -.\"O .IR flags . -.I flags -に不正なビットが指定された。 -.TP -.B ENOMEM -.\"O Cannot allocate sufficient memory to copy parts of caller's -.\"O context that need to be unshared. -呼び出し元のコンテキストのうち共有を解除する必要がある部分をコピーするために、 -十分なメモリが確保できなかった。 -.TP -.B EPERM -.\"O .I flags -.\"O specified -.\"O .B CLONE_NEWNS -.\"O but the calling process was not privileged (did not have the -.\"O .B CAP_SYS_ADMIN -.\"O capability). -.I flags -に -.B CLONE_NEWNS -が指定されたが、呼び出し元プロセスに特権 -.RB ( CAP_SYS_ADMIN -ケーパビリティ) がなかった。 -.\"O .SH VERSIONS -.SH バージョン -.\"O The -.\"O .BR unshare () -.\"O system call was added to Linux in kernel 2.6.16. -.BR unshare () -システムコールは Linux カーネル 2.6.16 で追加された。 -.\"O .SH CONFORMING TO -.SH 準拠 -.\"O The -.\"O .BR unshare () -.\"O system call is Linux-specific. -.BR unshare () -システムコールは Linux 固有である。 -.\"O .SH NOTES -.SH 注意 -.\"O Not all of the process attributes that can be shared when -.\"O a new process is created using -.\"O .BR clone (2) -.\"O can be unshared using -.\"O .BR unshare (). -.BR clone (2) -で新しいプロセスを生成したときに共有される全てのプロセス属性を、 -.BR unshare () -によって共有の解除ができるわけではない。 -.\"O In particular, as at kernel 2.6.16, -.\"O .BR unshare () -.\"O does not implement flags that reverse the effects of -特に、カーネル 2.6.16 においては、 -.BR unshare () -に -.BR CLONE_SIGHAND , -.\" However, we can do unshare(CLONE_SIGHAND) if CLONE_SIGHAND -.\" was not specified when doing clone(); i.e., unsharing -.\" signal handlers is permitted if we are not actually -.\" sharing signal handlers. mtk -.BR CLONE_SYSVSEM , -.BR CLONE_THREAD , -.\"O or -.\" FIXME . check future kernel versions (e.g., 2.6.17) -.\" to see if CLONE_VM gets implemented. -.\"O .BR CLONE_VM . -.B CLONE_VM -の効果を取り消すためのフラグが実装されていない。 -.\" However, as at 2.6.16, we can do unshare(CLONE_VM) if CLONE_VM -.\" was not specified when doing clone(); i.e., unsharing -.\" virtual memory is permitted if we are not actually -.\" sharing virtual memory. mtk -.\"O Such functionality may be added in the future, if required. -これらの機能は、必要であれば将来追加されるかもしれない。 -.\" -.\"9) Future Work -.\"-------------- -.\"The current implementation of unshare does not allow unsharing of -.\"signals and signal handlers. Signals are complex to begin with and -.\"to unshare signals and/or signal handlers of a currently running -.\"process is even more complex. If in the future there is a specific -.\"need to allow unsharing of signals and/or signal handlers, it can -.\"be incrementally added to unshare without affecting legacy -.\"applications using unshare. -.\" -.\"O .SH SEE ALSO -.SH 関連項目 -.BR clone (2), -.BR fork (2), -.BR vfork (2), -Documentation/unshare.txt diff --git a/draft/man2/uselib.2 b/draft/man2/uselib.2 index 65c938a5..5dc98820 100644 --- a/draft/man2/uselib.2 +++ b/draft/man2/uselib.2 @@ -28,145 +28,52 @@ .\" Modified 2004-06-23 by Michael Kerrisk .\" Modified 2005-01-09 by aeb .\" -.\" Japanese Version Copyright (c) 1997 SUTO Mitsuaki -.\" all rights reserved. -.\" Translated 1997-06-26, SUTO Mitsuaki -.\" Updated 2000-01-13,Kentaro Shirakata -.\" Updated 2005-02-28, Akihiro MOTOKI -.\" Updated 2005-04-20, Akihiro MOTOKI +.\"******************************************************************* .\" -.\"WORD: Linux-specific Linux 特有 +.\" This file was generated with po4a. Translate the source file. .\" -.TH USELIB 2 2005-01-09 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH USELIB 2 2005\-01\-09 Linux "Linux Programmer's Manual" .SH 名前 -.\"O uselib \- select shared library uselib \- 共有ライブラリを選択する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int uselib(const char *" library ); -.\"O .SH DESCRIPTION +\fBint uselib(const char *\fP\fIlibrary\fP\fB);\fP .SH 説明 -.\"O The system call -.\"O .BR uselib () -.\"O serves to load -.\"O a shared library to be used by the calling process. -.\"O It is given a pathname. -.\"O The address where to load is found -.\"O in the library itself. -.\"O The library can have any recognized -.\"O binary format. -システムコール -.BR uselib () -は、呼び出し元プロセスが使用する -共有ライブラリをロードする際に使用される。 -このシステムコールにはライブラリのパス名を指定する。 -ライブラリをロードするアドレスはライブラリ自身に書かれている。 +システムコール \fBuselib\fP() は、呼び出し元プロセスが使用する 共有ライブラリをロードする際に使用される。 +このシステムコールにはライブラリのパス名を指定する。 ライブラリをロードするアドレスはライブラリ自身に書かれている。 ライブラリは認識可能なバイナリ形式であればどんな形式でもよい。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O On success, zero is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合 0 を返す。失敗した場合 \-1 を返し、 -.I errno -をエラーの内容に従って設定する。 -.\"O .SH ERRORS +成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.\"O In addition to all of the error codes returned by -.\"O .BR open (2) -.\"O and -.\"O .BR mmap (2), -.\"O the following may also be returned: -.BR open (2) -と -.BR mmap (2) -が返すエラーコードに加えて、以下のエラーコードが設定されることがある。 -.TP -.B EACCES -.\"O The library specified by -.\"O .I library -.\"O does not have read or execute permission, or the caller does not have -.\"O search permission for one of the directories in the path prefix. -.\"O (See also -.\"O .BR path_resolution (7).) -.I library -で指定されたライブラリに対する読み込み許可、または実行許可がない。 -もしくは -.I library -が存在するディレクトリかその上位のいずれかに対する検索許可がない -.RB ( path_resolution (7) -も参照)。 -.TP -.B ENFILE -.\"O The system limit on the total number of open files has been reached. -オープンされたファイルの総数がシステム全体の上限に達した。 -.TP -.B ENOEXEC -.\"O The file specified by -.\"O .I library -.\"O is not an executable of known type, -.\"O e.g., does not have the correct magic numbers. -.I library -で指定されたファイルが、実行可能ファイルと認識されるファイル種別では -ない、つまり正しいマジック・ナンバーが付いていない。 -.\"O .SH "CONFORMING TO" +\fBopen\fP(2) と \fBmmap\fP(2) が返すエラーコードに加えて、以下のエラーコードが設定されることがある。 +.TP +\fBEACCES\fP +\fIlibrary\fP で指定されたライブラリに対する読み込み許可、または実行許可がない。 もしくは \fIlibrary\fP +が存在するディレクトリかその上位のいずれかに対する検索許可がない (\fBpath_resolution\fP(7) も参照)。 +.TP +\fBENFILE\fP +オープンされたファイルの総数がシステム全体の上限に達していた。 +.TP +\fBENOEXEC\fP +\fIlibrary\fP で指定されたファイルが、実行可能ファイルと認識されるファイル種別では ない、つまり正しいマジック・ナンバーが付いていない。 .SH 準拠 -.\"O .BR uselib () -.\"O is Linux-specific, and should not be used in programs -.\"O intended to be portable. -.BR uselib () -は Linux 特有の関数であり、移植性を持たせたいプログラム -には使用すべきでない。 -.\"O .SH NOTES +\fBuselib\fP() は Linux 特有の関数であり、移植性を持たせたいプログラム には使用すべきでない。 .SH 注意 -.\"O .BR uselib () -.\"O was used by early libc startup code to load -.\"O the shared libraries with names found in an array of names -.\"O in the binary. -初期の libc の起動コードは、 -.BR uselib () -を使って、 -バイナリ中のリストに書かれている共有ライブラリを +初期の libc の起動コードは、 \fBuselib\fP() を使って、 バイナリ中のリストに書かれている共有ライブラリを リスト中のそのままの名前でロードしていた。 .LP .\" libc 4.3.1f - changelog 1993-03-02 -.\"O Since libc 4.3.2, startup code tries to prefix these names -.\"O with "/usr/lib", "/lib" and "" before giving up. -libc 4.3.2 以降では、これらの名前の前に "/usr/lib", "/lib", "" を -つけて共有ライブラリを探すようになった。 .\" libc 4.3.4 - changelog 1993-04-21 -.\"O In libc 4.3.4 and later these names are looked for in the directories -.\"O found in -.\"O .BR LD_LIBRARY_PATH , -.\"O and if not found there, -.\"O prefixes "/usr/lib", "/lib" and "/" are tried. -libc 4.3.4 以降では、これらの名前の共有ライブラリをまず -.B LD_LIBRARY_PATH -で指定されたディレクトリで探し、見つからなければ、 +libc 4.3.2 以降では、これらの名前の前に "/usr/lib", "/lib", "" を つけて共有ライブラリを探すようになった。 libc +4.3.4 以降では、これらの名前の共有ライブラリをまず \fBLD_LIBRARY_PATH\fP で指定されたディレクトリで探し、見つからなければ、 名前の前に "/usr/lib", "/lib", "/" をつけて探す。 .LP -.\"O From libc 4.4.4 on only the library "/lib/ld.so" is loaded, -.\"O so that this dynamic library can load the remaining libraries needed -.\"O (again using this call). -.\"O This is also the state of affairs in libc5. -libc 4.4.4 以降では、ライブラリ "/lib/ld.so" だけがロードされ、その後で -この動的ライブラリが (このシステムコールをもう一度使って) -必要な残りのライブラリをロードできるようになっている。 +libc 4.4.4 以降では、ライブラリ "/lib/ld.so" だけがロードされ、その後で この動的ライブラリが +(このシステムコールをもう一度使って) 必要な残りのライブラリをロードできるようになっている。 .LP -.\"O glibc2 does not use this call. glibc2 は、このシステムコールを使用しない。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR ar (1), -.BR gcc (1), -.BR ld (1), -.BR ldd (1), -.BR mmap (2), -.BR open (2), -.BR dlopen (3), -.BR capabilities (7), -.BR ld.so (8) +\fBar\fP(1), \fBgcc\fP(1), \fBld\fP(1), \fBldd\fP(1), \fBmmap\fP(2), \fBopen\fP(2), +\fBdlopen\fP(3), \fBcapabilities\fP(7), \fBld.so\fP(8) diff --git a/draft/man2/utime.2 b/draft/man2/utime.2 index 94af698c..648f3769 100644 --- a/draft/man2/utime.2 +++ b/draft/man2/utime.2 @@ -28,263 +28,94 @@ .\" Modified 2004-06-23 by Michael Kerrisk .\" Modified 2004-10-10 by Andries Brouwer .\" -.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki -.\" all rights reserved. -.\" Translated Thu Jun 26 21:28:00 JST 1997 -.\" by SUTO, Mitsuaki -.\" Updated & Modified Tue Feb 15 03:21:17 JST 2005 -.\" by Yuichi SATO -.\" Updated 2006-07-21, Akihiro MOTOKI, LDP v2.36 -.\" Updated 2007-10-13, Akihiro MOTOKI, LDP v2.65 -.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 +.\"******************************************************************* .\" -.TH UTIME 2 2008-08-06 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH UTIME 2 2008\-08\-06 Linux "Linux Programmer's Manual" .SH 名前 -.\"O utime, utimes \- change file last access and modification times utime, utimes \- ファイルの最終アクセス時刻と修正時刻を変更する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .br -.B #include +\fB#include \fP .sp -.BI "int utime(const char *" filename ", const struct utimbuf *" times ); +\fBint utime(const char *\fP\fIfilename\fP\fB, const struct utimbuf *\fP\fItimes\fP\fB);\fP .sp -.B #include +\fB#include \fP .sp -.BI "int utimes(const char *" filename ", const struct timeval " times [2]); +\fBint utimes(const char *\fP\fIfilename\fP\fB, const struct timeval \fP\fItimes\fP\fB[2]);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR utime () -.\"O system call -.\"O changes the access and modification times of the inode specified by -.\"O .I filename -.\"O to the -.\"O .IR actime " and " modtime -.\"O fields of -.\"O .I times -.\"O respectively. -.BR utime () -システムコールは -.I filename -で示される inode のアクセス時刻と修正時刻を -.I times -中の -.IR actime " と " modtime -にそれぞれ変更する。 +\fButime\fP() システムコールは \fIfilename\fP で示される inode のアクセス時刻と修正時刻を \fItimes\fP 中の +\fIactime\fP と \fImodtime\fP にそれぞれ変更する。 -.\"O If -.\"O .I times -.\"O is NULL, then the access and modification times of the file are set -.\"O to the current time. -.I times -が -.B NULL -の場合、ファイルのアクセス時刻と修正時刻は現在の時刻に設定される。 +\fItimes\fP が \fBNULL\fP の場合、ファイルのアクセス時刻と修正時刻は現在の時刻に設定される。 -.\"O Changing timestamps is permitted when: either -.\"O the process has appropriate privileges, -.\"O or the effective user ID equals the user ID -.\"O of the file, or -.\"O .I times -.\"O is NULL and the process has write permission for the file. -タイムスタンプの変更は以下のいずれかの場合に許可される。 -プロセスに適切な特権がある場合、 -実効 (effective) ユーザ ID がファイルのユーザ ID と等しい場合、 -.I times -が NULL かつ、プロセスがファイルへの書き込み許可を持っている場合。 +タイムスタンプの変更は以下のいずれかの場合に許可される。 プロセスに適切な特権がある場合、 実効 (effective) ユーザ ID +がファイルのユーザ ID と等しい場合、 \fItimes\fP が NULL かつ、プロセスがファイルへの書き込み許可を持っている場合。 -.\"O The -.\"O .I utimbuf -.\"O structure is: -構造体 -.I utimbuf -は以下に示すようになっている。 +構造体 \fIutimbuf\fP は以下に示すようになっている。 .in +4n .nf struct utimbuf { -.\"O time_t actime; /* access time */ -.\"O time_t modtime; /* modification time */ time_t actime; /* アクセス時刻 */ time_t modtime; /* 修正時刻 */ }; .fi .in -.\"O The -.\"O .BR utime () -.\"O system call -.\"O allows specification of timestamps with a resolution of 1 second. -.BR utime () -システムコールは 1 秒の分解能でタイムスタンプを指定することができる。 +\fButime\fP() システムコールは 1 秒の分解能でタイムスタンプを指定することができる。 -.\"O The -.\"O .BR utimes () -.\"O system call -.\"O is similar, but the -.\"O .I times -.\"O argument refers to an array rather than a structure. -.\"O The elements of this array are -.\"O .I timeval -.\"O structures, which allow a precision of 1 microsecond for specifying timestamps. -.BR utimes () -は -.BR utime () -と同様であるが、 -.I times -引き数が構造体ではなく配列を参照する。 -この配列の要素は -.I timeval -構造体で、タイムスタンプの指定を 1 マイクロ秒の分解能で行うことができる。 -.\"O The -.\"O .I timeval -.\"O structure is: -構造体 -.I timeval +\fButimes\fP() は \fButime\fP() と同様であるが、 \fItimes\fP 引き数が構造体ではなく配列を参照する。 この配列の要素は +\fItimeval\fP 構造体で、タイムスタンプの指定を 1 マイクロ秒の分解能で行うことができる。 構造体 \fItimeval\fP は以下に示す通りである。 .in +4n .nf struct timeval { -.\"O long tv_sec; /* seconds */ long tv_sec; /* 秒 */ -.\"O long tv_usec; /* microseconds */ long tv_usec; /* マイクロ秒 */ }; .fi .in .PP -.\"O .IR times [0] -.\"O specifies the new access time, and -.\"O .IR times [1] -.\"O specifies the new modification time. -.IR times [0] -は新しいアクセス時刻を、 -.IR times [1] -は新しい修正時刻を規定する。 -.\"O If -.\"O .I times -.\"O is NULL, then analogously to -.\"O .BR utime (), -.\"O the access and modification times of the file are -.\"O set to the current time. -.I times -が NULL の場合、 -.BR utime () -同様、ファイルのアクセス時刻と修正時刻は現在の時刻に設定される。 -.\"O .SH "RETURN VALUE" +\fItimes\fP[0] は新しいアクセス時刻を、 \fItimes\fP[1] は新しい修正時刻を規定する。 \fItimes\fP が NULL の場合、 +\fButime\fP() 同様、ファイルのアクセス時刻と修正時刻は現在の時刻に設定される。 .SH 返り値 -.\"O On success, zero is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合 0 が返る。失敗した場合 \-1 が返り、 -.I errno -がエラーの内容に従って設定される。 -.\"O .SH ERRORS +成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP -.B EACCES -.\"O Search permission is denied for one of the directories in -.\"O the path prefix of -.\"O .I path -.\"O (see also -.\"O .BR path_resolution (7)). -.I path -を構成する何れかのディレクトリに検索許可がない -.RB ( path_resolution (7) -も参照すること)。 -.TP -.B EACCES -.\"O .I times -.\"O is NULL, -.\"O the caller's effective user ID does not match the owner of the file, -.\"O the caller does not have write access to the file, -.\"O and the caller is not privileged -.\"O (Linux: does not have either the -.\"O .B CAP_DAC_OVERRIDE -.\"O or the -.\"O .B CAP_FOWNER -.\"O capability). -.I times -が NULL である。 -または、呼び出し元の実効ユーザ ID がファイルの所有者と一致しない。 -または、呼び出し元がそのファイルへの書き込み許可を持たず、 -特権も持っていない (Linux の場合、ケーパビリティ -.B CAP_DAC_OVERRIDE -も -.B CAP_FOWNER -も持っていない)。または、 -.TP -.B ENOENT -.\"O .I filename -.\"O does not exist. -.I filename -が存在しない。 -.TP -.B EPERM -.\"O .I times -.\"O is not NULL, -.\"O the caller's effective UID does not match the owner of the file, -.\"O and the caller is not privileged -.\"O (Linux: does not have the -.\"O .B CAP_FOWNER -.\"O capability). -.I times -が NULL でなく、かつ呼び出し元の実効 UID がファイルの所有者と一致せず、 -かつ呼び出し元が特権を持っていない -(Linux の場合、ケーパビリティ -.B CAP_FOWNER -を持っていない)。 -.TP -.B EROFS -.\"O .I path -.\"O resides on a read-only file system. -.I path -が読み込み専用のファイルシステム上にある。 -.\"O .SH "CONFORMING TO" +.TP +\fBEACCES\fP +\fIpath\fP を構成する何れかのディレクトリに検索許可がない (\fBpath_resolution\fP(7) も参照すること)。 +.TP +\fBEACCES\fP +\fItimes\fP が NULL である。 または、呼び出し元の実効ユーザ ID がファイルの所有者と一致しない。 +または、呼び出し元がそのファイルへの書き込み許可を持たず、 特権も持っていない (Linux の場合、ケーパビリティ +\fBCAP_DAC_OVERRIDE\fP も \fBCAP_FOWNER\fP も持っていない)。または、 +.TP +\fBENOENT\fP +\fIfilename\fP が存在しない。 +.TP +\fBEPERM\fP +\fItimes\fP が NULL でなく、かつ呼び出し元の実効 UID がファイルの所有者と一致せず、 かつ呼び出し元が特権を持っていない (Linux +の場合、ケーパビリティ \fBCAP_FOWNER\fP を持っていない)。 +.TP +\fBEROFS\fP +\fIpath\fP が読み込み専用のファイルシステム上にある。 .SH 準拠 -.BR utime (): -SVr4, POSIX.1-2001. -.\"O POSIX.1-2008 marks -.\"O .BR utime () -.\"O as obsolete. -POSIX.1-2008 は -.BR utime () -を廃止予定としている。 +\fButime\fP(): SVr4, POSIX.1\-2001. POSIX.1\-2008 は \fButime\fP() を廃止予定としている。 .br -.BR utimes (): -4.3BSD, POSIX.1-2001. -.\"O .SH NOTES +\fButimes\fP(): 4.3BSD, POSIX.1\-2001. .SH 注意 -.\"O Linux does not allow changing the timestamps on an immutable file, -.\"O or setting the timestamps to something other than the current time -.\"O on an append-only file. -Linux では、不変 (immutable) ファイルのタイムスタンプを変更したり、 -追加専用 (append-only) のファイルに現在時刻以外のタイムスタンプを -設定したりすることは、許可されていない。 +Linux では、不変 (immutable) ファイルのタイムスタンプを変更したり、 追加専用 (append\-only) +のファイルに現在時刻以外のタイムスタンプを 設定したりすることは、許可されていない。 -.\"O In libc4 and libc5, -.\"O .BR utimes () -.\"O is just a wrapper for -.\"O .BR utime () -.\"O and hence does not allow a subsecond resolution. -libc4 と libc5 では、 -.BR utimes () -は単に -.BR utime () -のラッパー (wrapper) である。 +libc4 と libc5 では、 \fButimes\fP() は単に \fButime\fP() のラッパー (wrapper) である。 そのため秒以下を指定することはできない。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR chattr (1), -.BR futimesat (2), -.BR stat (2), -.BR utimensat (2), -.BR futimens (3), -.BR futimes (3) +\fBchattr\fP(1), \fBfutimesat\fP(2), \fBstat\fP(2), \fButimensat\fP(2), \fBfutimens\fP(3), +\fBfutimes\fP(3) diff --git a/draft/man2/vfork.2 b/draft/man2/vfork.2 deleted file mode 100644 index b20a11a8..00000000 --- a/draft/man2/vfork.2 +++ /dev/null @@ -1,390 +0,0 @@ -.\" Copyright (c) 1999 Andries Brouwer (aeb@cwi.nl), 1 Nov 1999 -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" 1999-11-10: Merged text taken from the page contributed by -.\" Reed H. Petty (rhp@draper.net) -.\" -.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1999-12-04, HANATAKA Shinya -.\" Updated 2007-01-09, Akihiro MOTOKI , LDP v2.43 -.\" Updated 2008-11-10, Akihiro MOTOKI , LDP v3.13 -.\" -.TH VFORK 2 2010-09-20 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O vfork \- create a child process and block parent -vfork \- 子プロセスを生成し親プロセスを停止させる -.\"O .SH SYNOPSIS -.SH 書式 -.B #include -.br -.B #include -.sp -.B pid_t vfork(void); -.sp -.in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): -.in -.sp -.BR vfork (): -.ad l -.RS 4 -.PD 0 -.TP 4 -.\"O Since glibc 2.12: -glibc 2.12 以降: -.nf -_BSD_SOURCE || - (_XOPEN_SOURCE\ >=\ 500 || - _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) && - !(_POSIX_C_SOURCE\ >=\ 200809L || _XOPEN_SOURCE\ >=\ 700) -.fi -.TP 4 -.\"O Before glibc 2.12: -glibc 2.12 より前: -_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED -.PD -.RE -.ad b -.\"O .SH DESCRIPTION -.SH 説明 -.\"O .SS "Standard Description" -.SS 規格の説明 -.\"O (From POSIX.1) -(POSIX.1 より引用) -.\"O The -.\"O .BR vfork () -.\"O function has the same effect as -.\"O .BR fork (2), -.\"O except that the behavior is undefined if the process created by -.\"O .BR vfork () -.\"O either modifies any data other than a variable of type -.\"O .I pid_t -.\"O used to store the return value from -.\"O .BR vfork (), -.\"O or returns from the function in which -.\"O .BR vfork () -.\"O was called, or calls any other function before successfully calling -.\"O .BR _exit (2) -.\"O or one of the -.\"O .BR exec (3) -.\"O family of functions. -.BR vfork () -関数は -.BR fork (2) -と同じ働きをするが、 -.BR vfork () -で作成されたプロセスが -.BR vfork () -からの返り値を格納している -.I pid_t -型の変数以外を変更したり、 -.BR vfork () -を呼び出している関数から return したり、 -.BR _exit (2) -や -.BR exec (3) -族の関数をコールする前に他の関数をコールした場合の動作が -未定義であるという点が異なる。 -.\"O .SS "Linux Description" -.SS "LINUX での説明" -.\"O .BR vfork (), -.\"O just like -.\"O .BR fork (2), -.\"O creates a child process of the calling process. -.\"O For details and return value and errors, see -.\"O .BR fork (2). -.BR vfork () -は -.BR fork (2) -と全く同じように呼び出したプロセスの子プロセスを生成する。 -詳しい説明と返り値、エラーについては -.BR fork (2) -を参照すること。 -.PP -.\"O .BR vfork () -.\"O is a special case of -.\"O .BR clone (2). -.\"O It is used to create new processes without copying the page tables of -.\"O the parent process. -.\"O It may be useful in performance-sensitive applications -.\"O where a child is created which then immediately issues an -.\"O .BR execve (2). -.BR vfork () -は -.BR clone (2) -の特殊な場合である。 -親プロセスのページテーブルのコピーを行わずに新しいプロセスを -作成するために使用する。これは性能に敏感なアプリケーションにおいて -子プロセスを生成してすぐに -.BR execve (2) -する場合に有用かもしれない。 -.PP -.\"O .BR vfork () -.\"O differs from -.\"O .BR fork (2) -.\"O in that the parent is suspended until the child terminates -.\"O (either normally, -.\"O by calling -.\"O .BR _exit (2), -.\"O or abnormally, after delivery of a fatal signal), -.\"O or it makes a call to -.\"O .BR execve (2). -.BR vfork () -は -.BR fork (2) -と違い、子プロセスが終了するか、 -.BR execve (2) -をコールするまで親プロセスを停止 (suspend) させる。 -子プロセスの終了は、 -.BR _exit (2) -の呼び出しによる通常終了、 -致命的なシグナルの配送後の異常終了の二つのケースがある。 -.\"O Until that point, the child shares all memory with its parent, -.\"O including the stack. -.\"O The child must not return from the current function or call -.\"O .BR exit (3), -.\"O but may call -.\"O .BR _exit (2). -この時点までは、子プロセスはスタックを含む全てのメモリを -親プロセスと共有する。 -子プロセスは現在の関数から return してはならず、 -.BR exit (3) -もコールしてはならないが、 -.BR _exit (2) -ならばコールしてもよい。 -.PP -.\"O Signal handlers are inherited, but not shared. -.\"O Signals to the parent -.\"O arrive after the child releases the parent's memory -.\"O (i.e., after the child terminates -.\"O or calls -.\"O .BR execve (2)). -シグナルハンドラは継承されるが、共有はされない。 -親プロセスへのシグナルは、子プロセスが親プロセスのメモリを -解放した後 (すなわち、子プロセスが終了するか -.BR execve (2) -を呼んだ後) に到着する。 -.\"O .SS "Historic Description" -.SS 歴史的な説明 -.\"O Under Linux, -.\"O .BR fork (2) -.\"O is implemented using copy-on-write pages, so the only penalty incurred by -.\"O .BR fork (2) -.\"O is the time and memory required to duplicate the parent's page tables, -.\"O and to create a unique task structure for the child. -Linux において -.BR fork (2) -は書き込み時コピー (copy-on-write) ページを使用して実装されている。 -そのため -.BR fork (2) -を使用することによって被る損害は親プロセスのページ・テーブルを -複製するために必要な時間とメモリだけである。 -.\"O However, in the bad old days a -.\"O .BR fork (2) -.\"O would require making a complete copy of the caller's data space, -.\"O often needlessly, since usually immediately afterward an -.\"O .BR exec (3) -.\"O is done. -.\"O Thus, for greater efficiency, BSD introduced the -.\"O .BR vfork () -.\"O system call, which did not fully copy the address space of -.\"O the parent process, but borrowed the parent's memory and thread -.\"O of control until a call to -.\"O .BR execve (2) -.\"O or an exit occurred. -.\"O The parent process was suspended while the -.\"O child was using its resources. -.\"O The use of -.\"O .BR vfork () -.\"O was tricky: for example, not modifying data -.\"O in the parent process depended on knowing which variables were -.\"O held in a register. -しかしながら、忌しき昔には -.BR fork (2) -は呼び出したプロセスのデータ空間の全てのコピーしていたが、 -これはしばしば不必要であった。なぜなら、たいていはすぐ後に -.BR exec (3) -を実行していたからである。 -この場合の効率を上げるために BSD は -.BR vfork () -システムコールを導入して親プロセスのアドレス空間を完全にコピー -するかわりに、 -.BR execve (2) -をコールするか exit が起きるまで親プロセスのメモリと制御スレッド -を借りるようにした。 -親プロセスは子プロセスがその資源を使用している間は停止された。 -.BR vfork () -は使いにくいものであった: 例えば、親プロセスの変数を変更しな -いようにするためにはどの変数がレジスタに保持されているかを知らな -ければならなかった。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -4.3BSD, POSIX.1-2001. -.\"O POSIX.1-2008 removes the specification of -.\"O .BR vfork (). -POSIX.1-2008 では、 -.BR vfork () -の規定が削除されている。 -.\"O The requirements put on -.\"O .BR vfork () -.\"O by the standards are weaker than those put on -.\"O .BR fork (2), -.\"O so an implementation where the two are synonymous is compliant. -.\"O In particular, the programmer cannot rely on the parent -.\"O remaining blocked until the child either terminates or calls -.\"O .BR execve (2), -.\"O and cannot rely on any specific behavior with respect to shared memory. -.BR vfork () -コールは他のオペレーティング・システムの同名のコールと -ちょっと似ているかもしれない。規格が -.BR vfork () -に要求していることは、 -.BR fork (2) -に要求していることよりは弱い。したがって、 -両者を同じものとして実装しても、規格に準拠していることになる。 -特にプログラマーは、子プロセスが終了するか -.BR execve (2) -を呼び出すまで親プロセスが停止していることや、メモリを共有するこ -とによる特殊な動作をあてにすべきではない。 -.\" In AIXv3.1 vfork is equivalent to fork. -.\"O .SH NOTES -.\"O .SS Linux Notes -.SH 注意 -.SS Linux での注意 -.\"O Fork handlers established using -.\"O .BR pthread_atfork (3) -.\"O are not called when a multithreaded program employing -.\"O the NPTL threading library calls -.\"O .BR vfork (). -.\"O Fork handlers are called in this case in a program using the -.\"O LinuxThreads threading library. -.\"O (See -.\"O .BR pthreads (7) -.\"O for a description of Linux threading libraries.) -.BR pthread_atfork (3) -を使って設定された fork ハンドラは -NPTL スレッドライブラリコールを採用したマルチスレッドプログラムでは -呼び出されない。一方、LinuxThreads スレッドライブラリを使った -プログラムでは、fork ハンドラは呼び出される。 -(Linux のスレッドライブラリの説明は -.BR pthreads (7) -を参照。) -.\"O .SS History -.SS 歴史 -.\"O The -.\"O .BR vfork () -.\"O system call appeared in 3.0BSD. -.BR vfork () -システムコールは 3.0BSD に現われた。 -.\" In the release notes for 4.2BSD Sam Leffler wrote: `vfork: Is still -.\" present, but definitely on its way out'. -.\"O In 4.4BSD it was made synonymous to -.\"O .BR fork (2) -.\"O but NetBSD introduced it again, -.\"O cf. http://www.netbsd.org/Documentation/kernel/vfork.html . -4.4BSD において -.BR fork (2) -の同義語となったが、NetBSD では再び導入された。 -http://www.netbsd.org/Documentation/kernel/vfork.html を参照。 -.\"O In Linux, it has been equivalent to -.\"O .BR fork (2) -.\"O until 2.2.0-pre6 or so. -.\"O Since 2.2.0-pre9 (on i386, somewhat later on -.\"O other architectures) it is an independent system call. -.\"O Support was added in glibc 2.0.112. -Linux では 2.2.0-pre6 あたりまでは -.BR fork (2) -と等価であった。(i386 では) 2.2.0-pre9 から (他のアーキテクチャでは -少し遅れて) 独立したシステムコールとなった。 -glibc でのサポートは glibc-2.0.112 で追加された。 -.\"O .SH BUGS -.SH バグ -.\"O It is rather unfortunate that Linux revived this specter from the past. -.\"O The BSD man page states: -.\"O "This system call will be eliminated when proper system sharing mechanisms -.\"O are implemented. -.\"O Users should not depend on the memory sharing semantics of -.\"O .BR vfork () -.\"O as it will, in that case, be made synonymous to -.\"O .BR fork (2).\c -.\"O " -Linux がこの過去の亡霊を復活させたことは、むしろ不幸と言うべきである。 -BSD のマニュアルには、 -「このシステムコールは妥当なシステム共有機構が実装された場合には -削除される。ユーザは -.BR vfork () -のメモリ共有機能に依存するべきではない。何故ならば、このシステムコール -が削除された場合には、それは -.BR fork (2) -の同義語とされるからである。」と書かれている。 - -.\"O Details of the signal handling are obscure and differ between systems. -.\"O The BSD man page states: -.\"O "To avoid a possible deadlock situation, processes that are children -.\"O in the middle of a -.\"O .BR vfork () -.\"O are never sent -.\"O .B SIGTTOU -.\"O or -.\"O .B SIGTTIN -.\"O signals; rather, output or -.\"O .IR ioctl s -.\"O are allowed and input attempts result in an end-of-file indication." -シグナルの扱いの詳細は不明瞭でシステムごとに異っている。 -BSD のマニュアルには、 -「デッドロック状態になる可能性があるので -.BR vfork () -の途中の子プロセスに -.B SIGTTOU -や -.B SIGTTIN -シグナルを送信してはならない; -さらに出力や -.I ioctl -は許されるが、入力を試みた場合には結果はファイル終端 (EOF) になる。」 -と書かれている。 -.\" -.\" As far as I can tell, the following is not true in 2.6.19: -.\"O .\" Currently (Linux 2.3.25), -.\"O .\" .BR strace (1) -.\"O .\" cannot follow -.\"O .\" .BR vfork () -.\"O .\" and requires a kernel patch. -.\" 現在のところ (Linux 2.3.25)、 -.\" .BR strace (1) -.\" は -.\" .BR vfork () -.\" を追跡することができず、カーネルパッチが必要である。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR clone (2), -.BR execve (2), -.BR fork (2), -.BR unshare (2), -.BR wait (2) diff --git a/draft/man2/vhangup.2 b/draft/man2/vhangup.2 index 7c0359ef..e064eaba 100644 --- a/draft/man2/vhangup.2 +++ b/draft/man2/vhangup.2 @@ -24,80 +24,37 @@ .\" Modified, 27 May 2004, Michael Kerrisk .\" Added notes on capability requirements .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Tue Mar 4 00:12:32 JST 1997 -.\" by HANATAKA Shinya -.\" Updated & Modified Tue Feb 15 03:38:03 JST 2005 -.\" by Yuichi SATO +.\"******************************************************************* .\" -.\"WORD: virtualy 仮想的に -.\"WORD: hangup ハングアップ -.\"WORD: terminal 端末 +.\" This file was generated with po4a. Translate the source file. .\" -.TH VHANGUP 2 2007-07-26 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH VHANGUP 2 2007\-07\-26 Linux "Linux Programmer's Manual" .SH 名前 -.\"O vhangup \- virtually hangup the current tty vhangup \- 現在の tty を仮想的に (virtualy) ハングアップ (hangup) させる -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.B int vhangup(void); +\fBint vhangup(void);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR vhangup (): -_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) +\fBvhangup\fP(): _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR vhangup () -.\"O simulates a hangup on the current terminal. -.\"O This call arranges for other -.\"O users to have a \*(lqclean\*(rq tty at login time. -.BR vhangup () -は現在の端末 (terminal) でハングアップをシミュレートする。 -このコールは他のユーザーがログインした時に綺麗 (clean) な tty を -得ることができるよう手配する。 -.\"O .SH "RETURN VALUE" +\fBvhangup\fP() は現在の端末 (terminal) でハングアップをシミュレートする。 このコールは他のユーザーがログインした時に綺麗 +(clean) な tty を 得ることができるよう手配する。 .SH 返り値 -.\"O On success, zero is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合は 0 が返される。エラーの場合は \-1 が返され、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS +成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP -.B EPERM -.\"O The calling process has insufficient privilege to call -.\"O .BR vhangup (); -呼び出し元プロセスに -.BR vhangup () -を呼び出すための十分な特権がない。 -.\"O the -.\"O .B CAP_SYS_TTY_CONFIG -.\"O capability is required. -.B CAP_SYS_TTY_CONFIG -ケーパビリティ (capability) が必要である。 -.\"O .SH "CONFORMING TO" +.TP +\fBEPERM\fP +呼び出し元プロセスに \fBvhangup\fP() を呼び出すための十分な特権がない。 \fBCAP_SYS_TTY_CONFIG\fP ケーパビリティ +(capability) が必要である。 .SH 準拠 -.\"O This call is Linux-specific, and should not be used in programs -.\"O intended to be portable. -このコールは Linux 特有であり、移植を意図したプログラムで -使用してはいけない。 -.\"O .SH "SEE ALSO" +このコールは Linux 特有であり、移植を意図したプログラムで 使用してはいけない。 .SH 関連項目 -.BR capabilities (7), -.BR init (8) +\fBcapabilities\fP(7), \fBinit\fP(8) diff --git a/draft/man3/INFINITY.3 b/draft/man3/INFINITY.3 index b0b2bd41..00b33b3c 100644 --- a/draft/man3/INFINITY.3 +++ b/draft/man3/INFINITY.3 @@ -20,128 +20,45 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2005 Yuichi SATO -.\" all rights reserved. -.\" Translated Thu Jan 27 00:33:04 JST 2005 -.\" by Yuichi SATO +.\"******************************************************************* .\" -.TH INFINITY 3 2007-07-26 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH INFINITY 3 2007\-07\-26 "" "Linux Programmer's Manual" .SH 名前 -.\"O INFINITY, NAN, HUGE_VAL, HUGE_VALF, HUGE_VALL \- floating-point constants INFINITY, NAN, HUGE_VAL, HUGE_VALF, HUGE_VALL \- 浮動小数点数の定数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .BR "#define _ISOC99_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _ISOC99_SOURCE" " /* feature_test_macros(7) 参照 */" +\fB#define _ISOC99_SOURCE\fP /* feature_test_macros(7) 参照 */ .br -.B #include +\fB#include \fP .sp -.B INFINITY +\fBINFINITY\fP .sp -.B NAN +\fBNAN\fP .sp -.B HUGE_VAL +\fBHUGE_VAL\fP .br -.B HUGE_VALF +\fBHUGE_VALF\fP .br -.B HUGE_VALL +\fBHUGE_VALL\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The macro -.\"O .B INFINITY -.\"O expands to a \fIfloat\fP constant representing positive infinity. -マクロ -.B INFINITY -は正の無限大を表す -\fIfloat\fP 型の定数に展開される。 +マクロ \fBINFINITY\fP は正の無限大を表す \fIfloat\fP 型の定数に展開される。 -.\"O The macro -.\"O .B NAN -.\"O expands to a \fIfloat\fP constant representing a quiet NaN -.\"O (when supported). -.\"O A -.\"O .I quiet -.\"O NaN is a NaN ("not-a-number") that does not raise exceptions -.\"O when it is used in arithmetic. -.\"O The opposite is a -.\"O .I signaling -.\"O NaN. -.\"O See IEC 60559:1989. -(サポートされている場合) マクロ -.B NAN -は quiet NaN を表す \fIfloat\fP 型の定数に展開される。 -.I quiet -NaN は計算式の中で使われたときに例外を起こさない -NaN ("not-a-number") である。 -この反対は -.I signalling -NaN である。 -IEC 60559:1989 を参照すること。 +(サポートされている場合) マクロ \fBNAN\fP は quiet NaN を表す \fIfloat\fP 型の定数に展開される。 \fIquiet\fP NaN +は計算式の中で使われたときに例外を起こさない NaN ("not\-a\-number") である。 この反対は \fIsignalling\fP NaN +である。 IEC 60559:1989 を参照すること。 -.\"O The macros -.\"O .BR HUGE_VAL , -.\"O .BR HUGE_VALF , -.\"O .B HUGE_VALL -.\"O expand to constants of types \fIdouble\fP, \fIfloat\fP -.\"O and \fIlong double\fP, respectively, -.\"O that represent a large positive value, possibly plus infinity. -マクロ -.BR HUGE_VAL , -.BR HUGE_VALF , -.B HUGE_VALL -はそれぞれ \fIdouble\fP, \fIfloat\fP, \fIlong double\fP 型の定数で、 -大きな正の値を表し、可能な場合には正の無限大を表す。 -.\"O .SH "CONFORMING TO" +マクロ \fBHUGE_VAL\fP, \fBHUGE_VALF\fP, \fBHUGE_VALL\fP はそれぞれ \fIdouble\fP, \fIfloat\fP, +\fIlong double\fP 型の定数で、 大きな正の値を表し、可能な場合には正の無限大を表す。 .SH 準拠 C99. -.\"O .SH AVAILABILITY .SH 可用性 -.\"O On a glibc system, the macro -.\"O .B HUGE_VAL -.\"O is always available. -.\"O Availability of the -.\"O .B NAN -.\"O macro can be tested using -.\"O .BR "#ifdef NAN" , -.\"O and similarly for -.\"O .BR INFINITY , -.\"O .BR HUGE_VALF , -.\"O .BR HUGE_VALL . -glibc システムではマクロ -.B HUGE_VAL -が常に使用可能である。 -.B NAN -マクロが使用できるかは、 -.B "#ifdef NAN" -を使ってテストできる。 -.BR INFINITY , -.BR HUGE_VALF , -.B HUGE_VALL -も同様である。 -.\"O They will be defined by -.\"O .I -.\"O if -.\"O .B _ISOC99_SOURCE -.\"O or -.\"O .B _GNU_SOURCE -.\"O is defined, or -.\"O .B __STDC_VERSION__ -.\"O is defined -.\"O and has a value not less than 199901L. -.B _ISOC99_SOURCE -か -.B _GNU_SOURCE -が定義されている場合、 -または -.B __STDC_VERSION__ -が定義されていて、その値が 199901L 以上である場合、 -これらのマクロは -.I -で定義される。 -.\"O .SH "SEE ALSO" +glibc システムではマクロ \fBHUGE_VAL\fP が常に使用可能である。 \fBNAN\fP マクロが使用できるかは、 \fB#ifdef NAN\fP +を使ってテストできる。 \fBINFINITY\fP, \fBHUGE_VALF\fP, \fBHUGE_VALL\fP も同様である。 +\fB_ISOC99_SOURCE\fP か \fB_GNU_SOURCE\fP が定義されている場合、 または \fB__STDC_VERSION__\fP +が定義されていて、その値が 199901L 以上である場合、 これらのマクロは \fI\fP で定義される。 .SH 関連項目 -.BR fpclassify (3), -.BR math_error (7) +\fBfpclassify\fP(3), \fBmath_error\fP(7) diff --git a/draft/man3/MB_CUR_MAX.3 b/draft/man3/MB_CUR_MAX.3 index efefdcc4..ff95d056 100644 --- a/draft/man3/MB_CUR_MAX.3 +++ b/draft/man3/MB_CUR_MAX.3 @@ -12,52 +12,26 @@ .\" .\" Modified, aeb, 990824 .\" -.\" Japanese Version Copyright (c) 1999 HAYAKAWA Hitoshi -.\" all rights reserved. -.\" Translated Sep 11 1999, HAYAKAWA Hitoshi -.\" -.\"WORD: multibyte マルチバイト -.\"WORD: locale ロケール +.\"******************************************************************* .\" -.TH MB_CUR_MAX 3 1999-07-04 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH MB_CUR_MAX 3 1999\-07\-04 Linux "Linux Programmer's Manual" .SH 名前 -.\"O MB_CUR_MAX \- maximum length of a multibyte character in the current locale MB_CUR_MAX \- 現在のロケールでのマルチバイト文字の最大長 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .B MB_CUR_MAX -.\"O macro defines an integer expression giving -.\"O the maximum number of bytes needed to represent a single -.\"O wide character in the current locale. -.\"O It is locale dependent and therefore not a compile-time constant. -.B MB_CUR_MAX -マクロは、現在のロケールで一つのワイド文字を表現するために必要な -最大バイト数を表す整数表現を定義する。 +\fBMB_CUR_MAX\fP マクロは、現在のロケールで一つのワイド文字を表現するために必要な 最大バイト数を表す整数表現を定義する。 これはロケール依存であり、コンパイル時に決まる定数ではない。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O An integer in the range [1, -.\"O .BR MB_LEN_MAX ]. -.\"O The value 1 denotes traditional 8-bit encoded characters. -[1, -.BR MB_LEN_MAX ] -の範囲の整数を返す。 -1 という値は伝統的な (traditional) 8-bit エンコードされた文字を意味する。 -.\"O .SH "CONFORMING TO" +[1, \fBMB_LEN_MAX\fP] の範囲の整数を返す。 1 という値は伝統的な (traditional) 8\-bit +エンコードされた文字を意味する。 .SH 準拠 -C99, POSIX.1-2001. -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. .SH 関連項目 -.BR MB_LEN_MAX (3), -.BR mblen (3), -.BR mbstowcs (3), -.BR mbtowc (3), -.BR wcstombs (3), -.BR wctomb (3) +\fBMB_LEN_MAX\fP(3), \fBmblen\fP(3), \fBmbstowcs\fP(3), \fBmbtowc\fP(3), \fBwcstombs\fP(3), +\fBwctomb\fP(3) diff --git a/draft/man3/MB_LEN_MAX.3 b/draft/man3/MB_LEN_MAX.3 index 25a955d4..473a2442 100644 --- a/draft/man3/MB_LEN_MAX.3 +++ b/draft/man3/MB_LEN_MAX.3 @@ -12,59 +12,26 @@ .\" .\" Modified, aeb, 990824 .\" -.\" Japanese Version Copyright (c) 1999 HAYAKAWA Hitoshi -.\" all rights reserved. -.\" Translated Sep 11 1999, HAYAKAWA Hitoshi +.\"******************************************************************* .\" -.\"WORD: locale ロケール +.\" This file was generated with po4a. Translate the source file. .\" -.TH MB_LEN_MAX 3 1999-07-04 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH MB_LEN_MAX 3 1999\-07\-04 Linux "Linux Programmer's Manual" .SH 名前 -.\"O MB_LEN_MAX \- maximum multibyte length of a character across all locales MB_LEN_MAX \- 全てのロケールでの1文字の最大マルチバイト長 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .B MB_LEN_MAX -.\"O macro is the upper bound for the number of bytes needed to represent a single -.\"O wide character, across all locales. -.B MB_LEN_MAX -マクロは、全てのロケールで一つのワイド文字を表現するために必要となる -最大バイト数である。 -.\"O .SH "RETURN VALUE" +\fBMB_LEN_MAX\fP マクロは、全てのロケールで一つのワイド文字を表現するために必要となる 最大バイト数である。 .SH 返り値 -.\"O A constant integer greater than zero. 0 より大きいの整数型の定数。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O .SH NOTES -.\"O The entities -.\"O .B MB_LEN_MAX -.\"O and -.\"O .I sizeof(wchar_t) -.\"O are totally unrelated. -.\"O In glibc, -.\"O .B MB_LEN_MAX -.\"O is typically 6 while -.\"O .I sizeof(wchar_t) -.\"O is 4. +C99, POSIX.1\-2001. .SH 注意 -.B MB_LEN_MAX -と -.I sizeof(wchar_t) -の値にはなんの関係もない。 -glibc では -.B MB_LEN_MAX -は通常は 6 で、 -.I sizeof(wchar_t) -は 4 である。 -.\"O .SH "SEE ALSO" +\fBMB_LEN_MAX\fP と \fIsizeof(wchar_t)\fP の値にはなんの関係もない。 glibc では \fBMB_LEN_MAX\fP は通常は +6 で、 \fIsizeof(wchar_t)\fP は 4 である。 .SH 関連項目 -.BR MB_CUR_MAX (3) +\fBMB_CUR_MAX\fP(3) diff --git a/draft/man3/a64l.3 b/draft/man3/a64l.3 index e2880419..b230ebeb 100644 --- a/draft/man3/a64l.3 +++ b/draft/man3/a64l.3 @@ -3,135 +3,61 @@ .\" .\" Corrected, aeb, 2002-05-30 .\" -.\" Japanese Version Copyright (c) 2002-2003 Yuichi SATO -.\" all rights reserved. -.\" Translated Tue Aug 6 04:34:20 JST 2002 -.\" by Yuichi SATO -.\" Updated & Modified Thu Nov 27 01:02:55 JST 2003 -.\" by Yuichi SATO +.\"******************************************************************* .\" -.\"WORD: sign-extend 符号拡張 +.\" This file was generated with po4a. Translate the source file. .\" -.TH A64L 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH A64L 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O a64l, l64a \- convert between long and base-64 -a64l, l64a \- long と base-64 を変換する -.\"O .SH SYNOPSIS +a64l, l64a \- long と base\-64 を変換する .SH 書式 -.B #include +\fB#include \fP .sp -.BI "long a64l(char *" str64 ); +\fBlong a64l(char *\fP\fIstr64\fP\fB);\fP .sp -.BI "char *l64a(long " value ); +\fBchar *l64a(long \fP\fIvalue\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR a64l (), -.BR l64a (): +\fBa64l\fP(), \fBl64a\fP(): .br .RS 4 .ad l -_SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +_SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O These functions provide a conversion between 32-bit long integers -.\"O and little-endian base-64 ASCII strings (of length zero to six). -これらの関数は 32 ビット long 整数と -リトルエンディアン base-64 ASCII 文字列 (長さ 0 〜 6) の間の変換を行う。 -.\"O If the string used as argument for -.\"O .BR a64l () -.\"O has length greater than six, only the first six bytes are used. -.BR a64l () -の引き数の文字列が 7 文字以上の場合、 -最初の 6 バイトが使われる。 -.\"O If the type -.\"O .I long -.\"O has more than 32 bits, then -.\"O .BR l64a () -.\"O uses only the low order 32 bits of -.\"O .IR value , -.\"O and -.\"O .BR a64l () -.\"O sign-extends its 32-bit result. -.I long -型が 32 ビットより大きい場合、 -.BR l64a () -は -.I value -の下位 32 ビットのみを使い、 -.BR a64l () -は 32 ビットの結果を符号拡張 (sign-extend) する。 +これらの関数は 32 ビット long 整数と リトルエンディアン base\-64 ASCII 文字列 (長さ 0 〜 6) の間の変換を行う。 +\fBa64l\fP() の引き数の文字列が 7 文字以上の場合、 最初の 6 バイトが使われる。 \fIlong\fP 型が 32 ビットより大きい場合、 +\fBl64a\fP() は \fIvalue\fP の下位 32 ビットのみを使い、 \fBa64l\fP() は 32 ビットの結果を符号拡張 +(sign\-extend) する。 .LP -.\"O The 64 digits in the base-64 system are: -base-64 システムで使われる 64 個の文字は以下の通りである: +base\-64 システムで使われる 64 個の文字は以下の通りである: .RS .nf -.\"O \&\(aq.\(aq represents a 0 \&\(aq.\(aq は 0 を表す。 -.\"O \&\(aq/\(aq\& represents a 1 \&\(aq/\(aq は 1 を表す。 -.\"O 0-9 represent 2-11 -0-9 は 2-11 を表す。 -.\"O A-Z represent 12-37 -A-Z は 12-37 を表す。 -.\"O a-z represent 38-63 -a-z は 38-63 を表す。 +0\-9 は 2\-11 を表す。 +A\-Z は 12\-37 を表す。 +a\-z は 38\-63 を表す。 .fi .RE -.\"O So 123 = 59*64^0 + 1*64^1 = "v/". よって 123 = 59*64^0 + 1*64^1 = "v/" である。 -.\"O .SH "CONFORMING TO" .SH 準拠 -POSIX.1-2001. -.\"O .SH NOTES +POSIX.1\-2001. .SH 注意 -.\"O The value returned by -.\"O .BR l64a () -.\"O may be a pointer to a static buffer, possibly overwritten -.\"O by later calls. -.BR l64a () -で返される値は静的バッファへのポインタかもしれないので、 -以降の呼び出しで上書きされる可能性がある。 +\fBl64a\fP() で返される値は静的バッファへのポインタかもしれないので、 以降の呼び出しで上書きされる可能性がある。 .LP -.\"O The behavior of -.\"O .BR l64a () -.\"O is undefined when -.\"O .I value -.\"O is negative. -.\"O If -.\"O .I value -.\"O is zero, it returns an empty string. -.I value -が負の場合、 -.BR l64a () -の動作は定義されていない。 -.I value -が 0 の場合は空文字列を返す。 +\fIvalue\fP が負の場合、 \fBl64a\fP() の動作は定義されていない。 \fIvalue\fP が 0 の場合は空文字列を返す。 .LP -.\"O These functions are broken in glibc before 2.2.5 -.\"O (puts most significant digit first). -これらの関数は glibc 2.2.5 以前では間違っている -(最上位デジットを最初にしている)。 +これらの関数は glibc 2.2.5 以前では間違っている (最上位デジットを最初にしている)。 .LP -.\"O This is not the encoding used by -.\"O .BR uuencode (1). -これは -.BR uuencode (1) -で使われるエンコーディングではない。 -.\"O .SH "SEE ALSO" +これは \fBuuencode\fP(1) で使われるエンコーディングではない。 .SH 関連項目 -.BR uuencode (1), .\" .BR itoa (3), -.BR strtoul (3) +\fBuuencode\fP(1), \fBstrtoul\fP(3) diff --git a/draft/man3/abs.3 b/draft/man3/abs.3 index b5f64384..0bd8d728 100644 --- a/draft/man3/abs.3 +++ b/draft/man3/abs.3 @@ -29,151 +29,62 @@ .\" Modified Sat Jul 24 21:45:37 1993, Rik Faith (faith@cs.unc.edu) .\" Modified Sat Dec 16 15:02:59 2000, Joseph S. Myers .\" -.\" Japanese Version Copyright (c) 1996 Kentaro OGAWA -.\" all rights reserved. -.\" Translated Sat, 13 Jul 1996 22:44:04 +0900 -.\" by Kentaro OGAWA -.\" Updated Mon 29 Jan 2001 17:18:34 JST by Kentaro Shirakata +.\"******************************************************************* .\" -.TH ABS 3 2010-09-20 "GNU" "Linux Programmer's Manual" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ABS 3 2010\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 -.\"O abs, labs, llabs, imaxabs \- compute the absolute value of an integer abs, labs, llabs, imaxabs \- 整数の絶対値を計算する .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int abs(int " j ); +\fBint abs(int \fP\fIj\fP\fB);\fP .br -.BI "long int labs(long int " j ); +\fBlong int labs(long int \fP\fIj\fP\fB);\fP .br -.BI "long long int llabs(long long int " j ); +\fBlong long int llabs(long long int \fP\fIj\fP\fB);\fP .sp -.B #include +\fB#include \fP .sp -.BI "intmax_t imaxabs(intmax_t " j ); +\fBintmax_t imaxabs(intmax_t \fP\fIj\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR llabs (): +\fBllabs\fP(): .RS 4 -_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP +.RE .ad .SH 説明 -.\"O The -.\"O .BR abs () -.\"O function computes the absolute value of the integer -.\"O argument \fIj\fP. -.\"O The -.\"O .BR labs (), -.\"O .BR llabs () -.\"O and -.\"O .BR imaxabs () -.\"O functions compute the absolute value of the argument \fIj\fP of the -.\"O appropriate integer type for the function. -.BR abs () -関数は、整数の引数 \fIj\fP の絶対値を計算する。 -.BR labs (), -.BR llabs (), -.BR imaxabs () -関数は、 -それぞれの関数の型に応じた引数 \fIj\fP の絶対値を計算する。 +\fBabs\fP() 関数は、整数の引数 \fIj\fP の絶対値を計算する。 \fBlabs\fP(), \fBllabs\fP(), \fBimaxabs\fP() +関数は、 それぞれの関数の型に応じた引数 \fIj\fP の絶対値を計算する。 .SH 返り値 -.\"O Returns the absolute value of the integer argument, of the appropriate -.\"O integer type for the function. それぞれの関数の型に応じた整数の引数の絶対値を返す。 .SH 準拠 -.\"O SVr4, POSIX.1-2001, 4.3BSD, C99. -.\"O .\" POSIX.1 (1996 edition) only requires the -.\"O .\" .BR abs () -.\"O .\" function. -.\"O C89 only -.\"O includes the -.\"O .BR abs () -.\"O and -.\"O .BR labs () -.\"O functions; the functions -.\"O .BR llabs () -.\"O and -.\"O .BR imaxabs () -.\"O were added in C99. -SVr4, POSIX.1-2001, 4.3BSD, C99. -.\" POSIX.1 (1996 年版) は +.\" POSIX.1 (1996 edition) only requires the .\" .BR abs () -.\" 関数のみを要求している。 -C89 は -.BR abs () -関数と -.BR labs () -関数のみを含んでいる。 -.BR llabs () -関数と -.BR imaxabs () -関数は C99 で追加された。 +.\" function. +SVr4, POSIX.1\-2001, 4.3BSD, C99. C89 は \fBabs\fP() 関数と \fBlabs\fP() 関数のみを含んでいる。 +\fBllabs\fP() 関数と \fBimaxabs\fP() 関数は C99 で追加された。 .SH 注意 -.\"O Trying to take the absolute value of the most negative integer -.\"O is not defined. 最大の負整数の絶対値は、定義されていない。 .PP -.\"O The -.\"O .BR llabs () -.\"O function is included in glibc since version 2.0, but -.\"O is not in libc5 or libc4. -.\"O The -.\"O .BR imaxabs () -.\"O function is included in -.\"O glibc since version 2.1.1. -.BR llabs () -関数はバージョン 2.0 から glibc に含まれるようになったが、 -libc5 や libc4 にはない。 -.BR imaxabs () -関数は バージョン 2.1.1 から glibc に含まれるようになった。 +\fBllabs\fP() 関数はバージョン 2.0 から glibc に含まれるようになったが、 libc5 や libc4 にはない。 +\fBimaxabs\fP() 関数は バージョン 2.1.1 から glibc に含まれるようになった。 .PP -.\"O For -.\"O .BR llabs () -.\"O to be declared, it may be necessary to define -.\"O \fB_ISOC99_SOURCE\fP or \fB_ISOC9X_SOURCE\fP (depending on the -.\"O version of glibc) before including any standard headers. -.BR llabs () -が宣言されるためには、標準ヘッダを include する前に -\fB_ISOC99_SOURCE\fP か \fB_ISOC9X_SOURCE\fP(どちらかは glibc の -バージョンに依存する)を define しておく必要がある。 +\fBllabs\fP() が宣言されるためには、標準ヘッダを include する前に \fB_ISOC99_SOURCE\fP か +\fB_ISOC9X_SOURCE\fP(どちらかは glibc の バージョンに依存する)を define しておく必要がある。 .PP -.\"O GCC handles -.\"O .BR abs () -.\"O and -.\"O .BR labs () -.\"O as builtin functions. -.\"O GCC 3.0 also handles -.\"O .BR llabs () -.\"O and -.\"O .BR imaxabs () -.\"O as builtins. -GCC は -.BR abs () -と -.BR labs () -をビルドイン関数として扱う。 -GCC 3.0 は -.BR llabs () -と -.BR imaxabs () -もビルドインとして扱う。 +GCC は \fBabs\fP() と \fBlabs\fP() をビルドイン関数として扱う。 GCC 3.0 は \fBllabs\fP() と +\fBimaxabs\fP() もビルドインとして扱う。 .SH 関連項目 -.BR cabs (3), -.BR ceil (3), -.BR fabs (3), -.BR floor (3), -.BR rint (3) +\fBcabs\fP(3), \fBceil\fP(3), \fBfabs\fP(3), \fBfloor\fP(3), \fBrint\fP(3) diff --git a/draft/man3/acos.3 b/draft/man3/acos.3 index a332ceba..148f0e44 100644 --- a/draft/man3/acos.3 +++ b/draft/man3/acos.3 @@ -30,144 +30,60 @@ .\" Modified 2002-07-25 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 1996 Kenji Kajiwara and Kentaro Ogawa -.\" all rights reserved. -.\" Translated Sat, 13 Jul 1996 17:50:45 JST -.\" by Kenji Kajiwara and Kentaro Ogawa -.\" Proof Reading: Takashi Yoshino -.\" Updated Tue Aug 5 23:12:59 JST 2003 -.\" by Akihiro MOTOKI -.\" Updated 2008-09-14, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH ACOS 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ACOS 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O acos, acosf, acosl \- arc cosine function acos, acosf, acosl \- 逆余弦(arc cosine)関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double acos(double " x ); -.BI "float acosf(float " x ); -.BI "long double acosl(long double " x ); +\fBdouble acos(double \fP\fIx\fP\fB);\fP +\fBfloat acosf(float \fP\fIx\fP\fB);\fP +\fBlong double acosl(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR acosf (), -.BR acosl (): +\fBacosf\fP(), \fBacosl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR acos () -.\"O function calculates the arc cosine of \fIx\fP; that is -.\"O the value whose cosine is \fIx\fP. -.BR acos () -関数は \fIx\fP の逆余弦(arc cosine) を計算する。 -すなわち、その余弦 (cosine) が \fIx\fP となる値である。 -.\"O .SH "RETURN VALUE" +\fBacos\fP() 関数は \fIx\fP の逆余弦(arc cosine) を計算する。 すなわち、その余弦 (cosine) が \fIx\fP +となる値である。 .SH 返り値 -.\"O On success, these functions return the arc cosine of -.\"O .IR x -.\"O in radians; the return value is in the range [0,\ pi]. -成功すると、これらの関数は -.I x -の逆余弦をラジアン単位で返す。 -返り値は [0,\ pi] の範囲となる。 +成功すると、これらの関数は \fIx\fP の逆余弦をラジアン単位で返す。 返り値は [0,\ pi] の範囲となる。 -.\"O If -.\"O .I x -.\"O is a NaN, a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is +1, -.\"O +0 is returned. -.I x -が +1 の場合、+0 が返される。 +\fIx\fP が +1 の場合、+0 が返される。 -.\"O If -.\"O .I x -.\"O is positive infinity or negative infinity, -.\"O a domain error occurs, -.\"O and a NaN is returned. -.I x -が正の無限大か負の無限大の場合、 -領域エラー (domain error) が発生し、NaN が返される。 +\fIx\fP が正の無限大か負の無限大の場合、 領域エラー (domain error) が発生し、NaN が返される。 -.\"O If -.\"O .I x -.\"O is outside the range [\-1,\ 1], -.\"O a domain error occurs, -.\"O and a NaN is returned. -.I x -が [\-1,\ 1] の範囲に入っていない場合、 -領域エラー (domain error) が発生し、NaN が返される。 -.\"O .SH ERRORS +\fIx\fP が [\-1,\ 1] の範囲に入っていない場合、 領域エラー (domain error) が発生し、NaN が返される。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Domain error: \fIx\fP is outside the range [\-1,\ 1] +.TP 領域エラー (domain error): \fIx\fP が [\-1,\ 1] の範囲に入っていない -.\"O .I errno -.\"O is set to -.\"O .BR EDOM . -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -.I errno -に -.B EDOM -が設定される。 -無効 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) -が上がる。 -.\"O .SH "CONFORMING TO" +\fIerrno\fP に \fBEDOM\fP が設定される。 不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH 関連項目 -.BR asin (3), -.BR atan (3), -.BR atan2 (3), -.BR cacos (3), -.BR cos (3), -.BR sin (3), -.BR tan (3) +\fBasin\fP(3), \fBatan\fP(3), \fBatan2\fP(3), \fBcacos\fP(3), \fBcos\fP(3), \fBsin\fP(3), +\fBtan\fP(3) diff --git a/draft/man3/acosh.3 b/draft/man3/acosh.3 index 704bc753..3afe16b5 100644 --- a/draft/man3/acosh.3 +++ b/draft/man3/acosh.3 @@ -30,151 +30,68 @@ .\" Modified 2002-07-25 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 1996 Kenji Kajiwara and Kentaro Ogawa -.\" all rights reserved. -.\" Translated Sat, 13 Jul 1996 17:58:16 JST -.\" by Kenji Kajiwara and Kentaro Ogawa -.\" Proof Reading: Takashi Yoshino -.\" Updated Tue Aug 5 23:16:48 JST 2003 -.\" by Akihiro MOTOKI -.\" Updated 2008-09-14, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH ACOSH 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ACOSH 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O acosh, acoshf, acoshl \- inverse hyperbolic cosine function acosh, acoshf, acoshl \- 逆双曲線余弦(inverse hyperbolic cosine)関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double acosh(double " x ); +\fBdouble acosh(double \fP\fIx\fP\fB);\fP .br -.BI "float acoshf(float " x ); +\fBfloat acoshf(float \fP\fIx\fP\fB);\fP .br -.BI "long double acoshl(long double " x ); +\fBlong double acoshl(long double \fP\fIx\fP\fB);\fP .sp .fi -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR acosh (): +\fBacosh\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .br -.BR acoshf (), -.BR acoshl (): +\fBacoshf\fP(), \fBacoshl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR acosh () -.\"O function calculates the inverse hyperbolic cosine of -.\"O \fIx\fP; that is the value whose hyperbolic cosine is \fIx\fP. -.BR acosh () -関数は \fIx\fP の逆双曲線余弦(inverse hyperbolic cosine)を -計算する。 -すなわち、その双曲線余弦(hyperbolic cosine)が \fIx\fP に -なるような値である。 -.\"O .SH "RETURN VALUE" +\fBacosh\fP() 関数は \fIx\fP の逆双曲線余弦(inverse hyperbolic cosine)を 計算する。 +すなわち、その双曲線余弦(hyperbolic cosine)が \fIx\fP に なるような値である。 .SH 返り値 -.\"O On success, these functions return the inverse hyperbolic cosine of -.\"O .IR x . -成功すると、これらの関数は -.I x -の逆双曲線余弦を返す。 +成功すると、これらの関数は \fIx\fP の逆双曲線余弦を返す。 -.\"O If -.\"O .I x -.\"O is a NaN, a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is +1, +0 is returned. -.I x -が +1 の場合、+0 が返される。 +\fIx\fP が +1 の場合、+0 が返される。 -.\"O If -.\"O .I x -.\"O is positive infinity, positive infinity is returned. -.I x -が正の無限大の場合、正の無限大が返される。 +\fIx\fP が正の無限大の場合、正の無限大が返される。 -.\"O If -.\"O .I x -.\"O is less than 1, -.\"O a domain error occurs, -.\"O and the functions return a NaN. -.I x -が 1 より小さい場合、 -領域エラー (domain error) が発生し、NaN が返される。 -.\"O .SH ERRORS +\fIx\fP が 1 より小さい場合、 領域エラー (domain error) が発生し、NaN が返される。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Domain error: \fIx\fP is less than 1 +.TP 領域エラー (domain error): \fIx\fP が 1 より小さい -.\"O .I errno -.\"O is set to -.\"O .BR EDOM . -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -.I errno -に -.B EDOM -が設定される。 -無効 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) -が上がる。 -.\"O .SH "CONFORMING TO" +\fIerrno\fP に \fBEDOM\fP が設定される。 不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH 関連項目 -.BR asinh (3), -.BR atanh (3), -.BR cacosh (3), -.BR cosh (3), -.BR sinh (3), -.BR tanh (3) +\fBasinh\fP(3), \fBatanh\fP(3), \fBcacosh\fP(3), \fBcosh\fP(3), \fBsinh\fP(3), \fBtanh\fP(3) diff --git a/draft/man3/adjtime.3 b/draft/man3/adjtime.3 index d2932056..12f8ee68 100644 --- a/draft/man3/adjtime.3 +++ b/draft/man3/adjtime.3 @@ -20,209 +20,71 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved. -.\" Translated 2006-07-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH ADJTIME 3 2008-06-22 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ADJTIME 3 2008\-06\-22 Linux "Linux Programmer's Manual" .SH 名前 -.\"O adjtime \- correct the time to synchronize the system clock adjtime \- システムクロックに同期する時刻を調整する -.\"O .SH SYNOPSIS .SH 書式 .nf -.BI "int adjtime(const struct timeval *" delta ", struct timeval *" olddelta ); +\fBint adjtime(const struct timeval *\fP\fIdelta\fP\fB, struct timeval *\fP\fIolddelta\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR adjtime (): -_BSD_SOURCE -.\"O .SH DESCRIPTION +\fBadjtime\fP(): _BSD_SOURCE .SH 説明 -.\"O The -.\"O .BR adjtime () -.\"O function gradually adjusts the system clock (as returned by -.\"O .BR gettimeofday (2)). -.\"O The amount of time by which the clock is to be adjusted is specified -.\"O in the structure pointed to by -.\"O .IR delta . -.\"O This structure has the following form: -.BR adjtime () -関数は -.RB ( gettimeofday (2) -が返す) システムクロックを徐々に調整する。 -調整すべきクロックの時間量は -.I delta -が指す構造体で指定される。 -この構造体は以下の形である: +\fBadjtime\fP() 関数は (\fBgettimeofday\fP(2) が返す) システムクロックを徐々に調整する。 調整すべきクロックの時間量は +\fIdelta\fP が指す構造体で指定される。 この構造体は以下の形である: .in +4n .nf struct timeval { -.\"O time_t tv_sec; /* seconds */ -.\"O suseconds_t tv_usec; /* microseconds */ time_t tv_sec; /* 秒 */ suseconds_t tv_usec; /* マイクロ秒 */ }; .fi .in .PP -.\"O If the adjustment in -.\"O .I delta -.\"O is positive, then the system clock is speeded up by some -.\"O small percentage (i.e., by adding a small -.\"O amount of time to the clock value in each second) until the adjustment -.\"O has been completed. -.\"O If the adjustment in -.\"O .I delta -.\"O is negative, then the clock is slowed down in a similar fashion. -.I delta -の調整量が正の場合、調整量に達するまでシステムクロックを -少し割合だけスピードアップさせる (つまり、毎秒クロック値に少しだけ -時刻を加算する)。 -.I delta -の調整量が負の場合、同様の方法でクロックを遅くする。 +\fIdelta\fP の調整量が正の場合、調整量に達するまでシステムクロックを 少し割合だけスピードアップさせる (つまり、毎秒クロック値に少しだけ +時刻を加算する)。 \fIdelta\fP の調整量が負の場合、同様の方法でクロックを遅くする。 -.\"O If a clock adjustment from an earlier -.\"O .BR adjtime () -.\"O call is already in progress -.\"O at the time of a later -.\"O .BR adjtime () -.\"O call, and -.\"O .I delta -.\"O is not NULL for the later call, then the earlier adjustment is stopped, -.\"O but any already completed part of that adjustment is not undone. -.BR adjtime () -が呼び出されたときに以前の -.BR adjtime () -の呼び出しによるクロックの調整がまだ実行中で、かつ後の -.BR adjtime () -の -.I delta -が NULL でない場合、実行中の調整は停止される。 +\fBadjtime\fP() が呼び出されたときに以前の \fBadjtime\fP() の呼び出しによるクロックの調整がまだ実行中で、かつ後の +\fBadjtime\fP() の \fIdelta\fP が NULL でない場合、実行中の調整は停止される。 しかし、すでに実行された調整の取り消しは行われない。 -.\"O If -.\"O .I olddelta -.\"O is not NULL, then the buffer that it points to is used to return -.\"O the amount of time remaining from any previous adjustment that -.\"O has not yet been completed. -.I olddelta -が NULL でない場合、 -.I olddelta -が指すバッファに、過去の調整要求でまだ完了せず残っている時間量が +\fIolddelta\fP が NULL でない場合、 \fIolddelta\fP が指すバッファに、過去の調整要求でまだ完了せず残っている時間量が 格納して返される。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O On success, -.\"O .BR adjtime () -.\"O returns 0. On failure, \-1 is returned, and -.\"O .I errno -.\"O is set to indicate the error. -成功すると、 -.BR adjtime () -は 0 を返す。失敗すると、\-1 を返し、 -.I errno -にエラーを示す値をセットする。 -.\"O .SH ERRORS +成功すると、 \fBadjtime\fP() は 0 を返す。失敗すると、\-1 を返し、 \fIerrno\fP にエラーを示す値をセットする。 .SH エラー -.TP -.B EINVAL -.\"O The adjustment in -.\"O .I delta -.\"O is outside the permitted range. -.I delta -で指定された調整量が許可された範囲に入っていない。 -.TP -.B EPERM -.\"O The caller does not have sufficient privilege to adjust the time. -.\"O Under Linux the -.\"O .B CAP_SYS_TIME -.\"O capability is required. -呼び出し者が時刻を調整するのに必要な権限を持っていない。 -Linux では -.B CAP_SYS_TIME -ケーパビリティが必要である。 -.\"O .SH CONFORMING TO +.TP +\fBEINVAL\fP +\fIdelta\fP で指定された調整量が許可された範囲に入っていない。 +.TP +\fBEPERM\fP +呼び出し者が時刻を調整するのに必要な権限を持っていない。 Linux では \fBCAP_SYS_TIME\fP ケーパビリティが必要である。 .SH 準拠 4.3BSD, System V. -.\"O .SH NOTES .SH 注意 -.\"O The adjustment that -.\"O .BR adjtime () -.\"O makes to the clock is carried out in such a manner that the clock -.\"O is always monotonically increasing. -.\"O Using -.\"O .BR adjtime () -.\"O to adjust the time prevents the problems that can be caused for certain -.\"O applications (e.g., -.\"O .BR make (1)) -.\"O by abrupt positive or negative jumps in the system time. -.BR adjtime () -が行うクロックの調整は、クロックは常に単調増加するという範囲内で -実行される。 -.BR adjtime () -を使って時刻を調整することで、システムタイムの突然の正や負のジャンプ -により、いくつかのアプリケーション (例えば -.BR make (1) -など) に起こる問題を防ぐことができる。 +\fBadjtime\fP() が行うクロックの調整は、クロックは常に単調増加するという範囲内で 実行される。 \fBadjtime\fP() +を使って時刻を調整することで、システムタイムの突然の正や負のジャンプ により、いくつかのアプリケーション (例えば \fBmake\fP(1) など) +に起こる問題を防ぐことができる。 -.\"O .BR adjtime () -.\"O is intended to be used to make small adjustments to the system time. -.\"O Most systems impose a limit on the adjustment that can be specified in -.\"O .IR delta . -.\"O In the glibc implementation, -.\"O .I delta -.\"O must be less than or equal to (INT_MAX / 1000000 \- 2) -.\"O and greater than or equal to (INT_MIN / 1000000 + 2) -.\"O (respectively 2145 and \-2145 seconds on i386). -.BR adjtime () -はシステム時刻に少しずつ調整を行うために使用されることを期待されている。 -ほとんどのシステムでは、 -.I delta -に指定できる調整量に制限を課している。 -glibc の実装では、 -.I delta -は (INT_MIN / 1000000 + 2) 以上 (INT_MAX / 1000000 \- 2) 以下 -(i386 では \-2145 以上 2145 以下) でなければならない。 -.\"O .SH BUGS +\fBadjtime\fP() はシステム時刻に少しずつ調整を行うために使用されることを期待されている。 ほとんどのシステムでは、 \fIdelta\fP +に指定できる調整量に制限を課している。 glibc の実装では、 \fIdelta\fP は (INT_MIN / 1000000 + 2) 以上 +(INT_MAX / 1000000 \- 2) 以下 (i386 では \-2145 以上 2145 以下) でなければならない。 .SH バグ -.\"O A longstanding bug -.\"O .\" http://sourceware.org/bugzilla/show_bug?id=2449 -.\"O .\" http://bugzilla.kernel.org/show_bug.cgi?id=6761 -.\"O meant that if -.\"O .I delta -.\"O was specified as NULL, -.\"O no valid information about the outstanding clock adjustment was returned in -.\"O .IR olddelta . -.\"O (In this circumstance, -.\"O .BR adjtime () -.\"O should return the outstanding clock adjustment, without changing it.) -.\"O This bug is fixed -.\"O .\" Thanks to the new adjtimex() ADJ_OFFSET_SS_READ flag -.\"O on systems with glibc 2.8 or later and -.\"O Linux kernel 2.6.26 or later. -ずっと昔から、 .\" http://sourceware.org/bugzilla/show_bug?id=2449 .\" http://bugzilla.kernel.org/show_bug.cgi?id=6761 -.I delta -に NULL を指定すると、未完了のクロック調整に関する有効な情報が -.I olddelta -に返されないというバグがあった (この場合、 -.BR adjtime () -は、未完了のクロック調整に関する情報を、変更せずに返すべきである)。 -このバグは、 -.\" adjtimex() の新しいフラグ ADJ_OFFSET_SS_READ のおかげだ。 -glibc 2.8 以降で、Linux カーネル 2.6.26 以降のシステムで修正されている。 -.\"O .SH "SEE ALSO" +.\" Thanks to the new adjtimex() ADJ_OFFSET_SS_READ flag +ずっと昔から、 \fIdelta\fP に NULL を指定すると、未完了のクロック調整に関する有効な情報が \fIolddelta\fP +に返されないというバグがあった (この場合、 \fBadjtime\fP() は、未完了のクロック調整に関する情報を、変更せずに返すべきである)。 +このバグは、 glibc 2.8 以降で、Linux カーネル 2.6.26 以降のシステムで修正されている。 .SH 関連項目 -.BR adjtimex (2), -.BR gettimeofday (2), -.BR time (7) +\fBadjtimex\fP(2), \fBgettimeofday\fP(2), \fBtime\fP(7) diff --git a/draft/man3/aio_cancel.3 b/draft/man3/aio_cancel.3 deleted file mode 100644 index 55885754..00000000 --- a/draft/man3/aio_cancel.3 +++ /dev/null @@ -1,148 +0,0 @@ -.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl) -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; without even the implied warranty of -.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -.\" GNU General Public License for more details. -.\" -.\" You should have received a copy of the GNU General Public -.\" License along with this manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.\" -.\" Japanese Version Copyright (c) 2004 Yuichi SATO -.\" all rights reserved. -.\" Translated Thu Jul 01 02:44:30 JST 2004 -.\" by Yuichi SATO -.\" -.TH AIO_CANCEL 3 2003-11-14 "" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O aio_cancel \- cancel an outstanding asynchronous I/O request -aio_cancel \- 完了していない非同期 I/O リクエストをキャンセルする -.\"O .SH SYNOPSIS -.SH 書式 -.B "#include " -.sp -.BI "int aio_cancel(int " fd ", struct aiocb *" aiocbp ); -.sp -.\"O Link with \fI\-lrt\fP. -\fI\-lrt\fP でリンクする。 -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The -.\"O .BR aio_cancel () -.\"O function attempts to cancel outstanding asynchronous I/O requests -.\"O for the file descriptor -.\"O .IR fd . -.BR aio_cancel () -関数は、ファイルディスクリプタ -.I fd -についての完了していない非同期 I/O リクエストをキャンセルしようとする。 -.\"O If -.\"O .I aiocbp -.\"O is NULL, all such requests are canceled. -.\"O Otherwise, only the request -.\"O described by the control block pointed to by -.\"O .I aiocbp -.\"O is canceled. -.I aiocbp -が NULL の場合、そのような全てのリクエストがキャンセルされる。 -.I aiocbp -が NULL でない場合、 -.I aiocbp -で指された制御ブロックで記述されたリクエストのみがキャンセルされる。 -.LP -.\"O Normal asynchronous notification occurs for canceled requests. -キャンセルされたリクエストに対して、通常の非同期通知が起こる。 -.\"O The request return status is set to \-1, and the request error status -.\"O is set to -.\"O .BR ECANCELED . -リクエストの返り値は \-1 に設定され、 -リクエストのエラー状態は -.B ECANCELED -に設定される。 -.\"O The control block of requests that cannot be canceled is not changed. -キャンセルできなかったリクエストの制御ブロックは変更されない。 -.LP -.\"O If -.\"O .I aiocbp -.\"O is not NULL, and -.\"O .I fd -.\"O differs from the file descriptor with which the asynchronous operation -.\"O was initiated, unspecified results occur. -.I aiocbp -が NULL でなく、かつ -.I fd -が非同期操作が開始されたファイルディスクリプタと異なる場合、 -生じる結果は不定である。 -.LP -.\"O Which operations are cancellable is implementation-defined. -どの操作をキャンセルできるかは、実装定義である。 -.\"O .\" FreeBSD: not those on raw disk devices. -.\" FreeBSD: raw ディスクデバイスへのリクエストはキャンセルできない。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O This function returns -.\"O .B AIO_CANCELED -.\"O if all requests were successfully -.\"O canceled. -.\"O It returns -.\"O .B AIO_NOTCANCELED -.\"O when at least one of the -.\"O requests specified was not canceled because it was in progress. -全てのリクエストのキャンセルが成功した場合、この関数は -.B AIO_CANCELED -を返す。 -指定されたリクエストのうち少なくとも 1 つが進行中であるために -キャンセルできなかった場合は、 -.B AIO_NOTCANCELED -が返される。 -.\"O In this case one may check the status of individual requests using -.\"O .BR aio_error (3). -この場合は、 -.BR aio_error (3) -を使って個々のリクエストの状態をチェックすることができる。 -.\"O This function returns -.\"O .B AIO_ALLDONE -.\"O when all requests had -.\"O been completed already before this call. -呼び出される前に全てのリクエストが完了していた場合、 -この関数は -.B AIO_ALLDONE -を返す。 -.\"O When some error occurs, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -何らかのエラーが起こった場合は、\-1 が返されて、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EBADF -.\"O .I fd -.\"O is not a valid file descriptor. -.I fd -が有効なファイルディスクリプタでない。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -POSIX.1-2001. -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR aio_error (3), -.BR aio_fsync (3), -.BR aio_read (3), -.BR aio_return (3), -.BR aio_suspend (3), -.BR aio_write (3) diff --git a/draft/man3/aio_error.3 b/draft/man3/aio_error.3 deleted file mode 100644 index 78b56cbd..00000000 --- a/draft/man3/aio_error.3 +++ /dev/null @@ -1,111 +0,0 @@ -.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl) -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; without even the implied warranty of -.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -.\" GNU General Public License for more details. -.\" -.\" You should have received a copy of the GNU General Public -.\" License along with this manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.\" -.\" Japanese Version Copyright (c) 2004 Yuichi SATO -.\" all rights reserved. -.\" Translated Sat Jul 3 05:28:09 JST 2004 -.\" by Yuichi SATO -.\" -.TH AIO_ERROR 3 2003-11-14 "" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O aio_error \- get error status of asynchronous I/O operation -aio_error \- 非同期 I/O 操作のエラー状態を取得する -.\"O .SH SYNOPSIS -.SH 書式 -.B "#include " -.sp -.BI "int aio_error(const struct aiocb *" aiocbp ); -.sp -.\"O Link with \fI\-lrt\fP. -\fI\-lrt\fP でリンクする。 -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The -.\"O .BR aio_error () -.\"O function returns the error status for the asynchronous I/O request -.\"O with control block pointed to by -.\"O .IR aiocbp . -.BR aio_error () -関数は -.I aiocbp -で指された制御ブロックでの非同期 I/O リクエストのエラー状態を返す。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O This function returns -.\"O .B EINPROGRESS -.\"O if the request has not been -.\"O completed yet. -.\"O It returns -.\"O .B ECANCELED -.\"O if the request was canceled. -.\"O It returns 0 if the request completed successfully. -リクエストがまだ完了していない場合、この関数は -.B EINPROGRESS -を返す。リクエストがキャンセルされた場合、この関数は -.B ECANCELED -を返す。リクエストが成功して完了した場合、この関数は 0 を返す。 -.\"O Otherwise an error value is returned, the same value that would have -.\"O been stored in the -.\"O .I errno -.\"O variable in case of a synchronous -.\"O .IR read , -.\"O .IR write , -.\"O .IR fsync , -.\"O or -.\"O .I fdatasync -.\"O request. -それ以外の場合はエラー値が返される。 -このエラー値は、同期 -.IR read , -.IR write , -.IR fsync , -.I fdatasync -リクエストの場合に -.I errno -に格納されるのと同じ値である。 -.\"O On error, the error value is returned. -エラーの場合はエラー値が返される。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EINVAL -.\"O .I aiocbp -.\"O does not point at a control block for an asynchronous I/O request -.\"O of which the return status (see -.\"O .BR aio_return (3)) -.\"O has not been retrieved yet. -.I aiocbp -が、まだ返り値 (return status) -.RB ( aio_return (3) -を参照) が取得されていない非同期 I/O リクエストの制御ブロックを指していない。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -POSIX.1-2001. -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR aio_cancel (3), -.BR aio_fsync (3), -.BR aio_read (3), -.BR aio_return (3), -.BR aio_suspend (3), -.BR aio_write (3) diff --git a/draft/man3/aio_fsync.3 b/draft/man3/aio_fsync.3 deleted file mode 100644 index fc4049bc..00000000 --- a/draft/man3/aio_fsync.3 +++ /dev/null @@ -1,152 +0,0 @@ -.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl) -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; without even the implied warranty of -.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -.\" GNU General Public License for more details. -.\" -.\" You should have received a copy of the GNU General Public -.\" License along with this manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.\" -.\" Japanese Version Copyright (c) 2004 Yuichi SATO -.\" all rights reserved. -.\" Translated Sun Jul 4 17:20:13 JST 2004 -.\" by Yuichi SATO -.\" -.TH AIO_FSYNC 3 2003-11-14 "" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O aio_fsync \- asynchronous file synchronization -aio_fsync \- 非同期ファイルを同期させる -.\"O .SH SYNOPSIS -.SH 書式 -.B "#include " -.sp -.BI "int aio_fsync(int " op ", struct aiocb *" aiocbp ); -.sp -.\"O Link with \fI\-lrt\fP. -\fI\-lrt\fP でリンクする。 -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The -.\"O .BR aio_fsync () -.\"O function does a sync on all outstanding asynchronous I/O operations -.\"O associated with -.\"O .IR aiocbp\->aio_fildes . -.BR aio_fsync () -関数は、 -.I aiocbp\->aio_fildes -で関連付けられているまだ完了していない全ての非同期 I/O 操作を同期させる。 -.LP -.\"O More precisely, if -.\"O .I op -.\"O is -.\"O .BR O_SYNC , -.\"O then all currently queued I/O operations shall be -.\"O completed as if by a call of -.\"O .BR fsync (2), -.\"O and if -.\"O .I op -.\"O is -.\"O .BR O_DSYNC , -.\"O this call is the asynchronous analog of -.\"O .BR fdatasync (2). -より正確に言うと、 -.I op -が -.B O_SYNC -の場合、現在キューに入れられている全ての I/O 操作は、 -.BR fsync (2) -が呼ばれたかのように完了されるだろう。 -また -.I op -が -.B O_DSYNC -の場合、この呼び出しは -.BR fdatasync (2) -の非同期版となる。 -.\"O Note that this is a request only \(em this call does not wait -.\"O for I/O completion. -この関数はリクエストを行うだけである点に注意すること \(em -この呼び出しは I/O の完了を待たない。 -.LP -.\"O Apart from -.\"O .I aio_fildes -.\"O the only field in the structure pointed to by -.\"O .I aiocbp -.\"O that is used by this call is the -.\"O .I aio_sigevent -.\"O field (a \fIstruct sigevent\fP) that indicates the desired type of -.\"O asynchronous notification at completion. -.I aiocbp -で指される構造体のフィールドのうち、この呼び出しで -.I aio_fildes -以外に使用されるのは -.I aio_sigevent -フィールド (\fIstruct sigevent\fP) のみである。 -このフィールドは、完了時の非同期通知に使用したいタイプを示す。 -.\"O All other fields are ignored. -その他のフィールドは無視される。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success (the sync request was successfully queued) -.\"O this function returns 0. -.\"O On error \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合 (同期リクエストをキューに入れるのに成功した場合)、 -この関数は 0 を返す。 -エラーの場合、\-1 が返され、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EAGAIN -.\"O Out of resources. -リソースが足りない。 -.TP -.B EBADF -.\"O .I aio_fildes -.\"O is not a valid file descriptor open for writing. -.I aio_fildes -が書き込みのためにオープンされた有効なファイルディスクリプタではない。 -.TP -.B EINVAL -.\"O No synchronized I/O for this file is supported, or -.\"O .I op -.\"O is not -.\"O .B O_SYNC -.\"O or -.\"O .BR O_DSYNC . -このファイルに対する同期 I/O がサポートされていない。 -または -.I op -が -.B O_SYNC -でも -.B O_DSYNC -でもない。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -POSIX.1-2001. -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR aio_cancel (3), -.BR aio_error (3), -.BR aio_read (3), -.BR aio_return (3), -.BR aio_suspend (3), -.BR aio_write (3) diff --git a/draft/man3/aio_read.3 b/draft/man3/aio_read.3 deleted file mode 100644 index 684d2fda..00000000 --- a/draft/man3/aio_read.3 +++ /dev/null @@ -1,202 +0,0 @@ -.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl) -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; without even the implied warranty of -.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -.\" GNU General Public License for more details. -.\" -.\" You should have received a copy of the GNU General Public -.\" License along with this manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.\" -.\" Japanese Version Copyright (c) 2004 Yuichi SATO -.\" all rights reserved. -.\" Translated Mon Jul 5 00:46:45 JST 2004 -.\" by Yuichi SATO -.\" -.TH AIO_READ 3 2003-11-14 "" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O aio_read \- asynchronous read -aio_read \- 非同期で読み込む -.\"O .SH SYNOPSIS -.SH 書式 -.B "#include " -.sp -.BI "int aio_read(struct aiocb *" aiocbp ); -.sp -.\"O Link with \fI\-lrt\fP. -\fI\-lrt\fP でリンクする。 -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The -.\"O .BR aio_read () -.\"O function requests an asynchronous "n = read(fd, buf, count)" -.\"O with fd, buf, count given by -.\"O .IR aiocbp\->aio_fildes , -.\"O .IR aiocbp\->aio_buf , -.\"O .IR aiocbp\->aio_nbytes , -.\"O respectively. -.\"O The return status n can be retrieved upon completion using -.\"O .BR aio_return (3). -.BR aio_read () -関数は非同期の "n = read(fd, buf, count)" をリクエストする。 -ここで fd, buf, count は、それぞれ -.IR aiocbp\->aio_fildes , -.IR aiocbp\->aio_buf , -.I aiocbp\->aio_nbytes -で与えられる。 -返り値 (return status) n は、完了時に -.BR aio_return (3) -を使って取得できる。 -.LP -.\"O The data is read starting at the absolute file offset -.\"O .IR aiocbp\->aio_offset , -.\"O regardless of the current file position. -.\"O After this request, -.\"O the value of the current file position is unspecified. -データは、カレントのファイル位置に関係なく、絶対ファイルオフセット -.I aiocbp\->aio_offset -を開始点として読み込まれる。 -このリクエスト後の、カレントのファイル位置は規定されていない。 -.LP -.\"O The "asynchronous" means that this call returns as soon as the -.\"O request has been enqueued; the read may or may not have completed -.\"O when the call returns. -.\"O One tests for completion using -.\"O .BR aio_error (3). -「非同期」とは「リクエストがキューに入れられたら、この呼び出しはすぐに返る」 -ということである。 -呼び出しから戻った時に、読み込みは完了しているかも知れないし、 -完了していないかも知れない。 -.BR aio_error (3) -を使うことで完了したかをテストできる。 -.LP -.\"O If -.\"O .B _POSIX_PRIORITIZED_IO -.\"O is defined, and this file supports it, -.\"O then the asynchronous operation is submitted at a priority equal -.\"O to that of the calling process minus -.\"O .IR aiocbp\->aio_reqprio . -.B _POSIX_PRIORITIZED_IO -が定義されていて、 -かつファイルがこれをサポートしている場合、 -非同期操作は呼び出したプロセスの優先度から -.I aiocbp\->aio_reqprio -を引いた優先度で登録 (submit) される。 -.LP -.\"O The field -.\"O .I aiocbp\->aio_lio_opcode -.\"O is ignored. -フィールド -.I aiocbp\->aio_lio_opcode -は無視される。 -.LP -.\"O No data is read from a regular file beyond its maximum offset. -最大オフセットを超えた通常のファイルからは、何もデータが読み込まれない。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success, 0 is returned. -.\"O On error the request is not enqueued, \-1 -.\"O is returned, and -.\"O .I errno -.\"O is set appropriately. -.\"O If an error is first detected later, it will -.\"O be reported via -.\"O .BR aio_return (3) -.\"O (returns status \-1) and -.\"O .BR aio_error (3) -.\"O (error status whatever one would have gotten in -.\"O .IR errno , -.\"O such as -.\"O .BR EBADF ). -成功した場合、0 が返される。 -エラーの場合、リクエストはキューに入れられず、 -\-1 が返されて、 -.I errno -が適切に設定される。 -エラーは最初に検知された後で、 -(状態 \-1 を返す) -.BR aio_return (3) -と -.RI ( errno -で取得できる -.B EBADF -のようなエラー状態を返す) -.BR aio_error (3) -で報告されるだろう。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EAGAIN -.\"O Out of resources. -リソースが足りない。 -.TP -.B EBADF -.\"O .I aio_fildes -.\"O is not a valid file descriptor open for reading. -.I aio_fildes -は読み込みのためにオープンされた有効なファイルディスクリプタでない。 -.TP -.B EINVAL -.\"O One or more of -.\"O .IR aio_offset , -.\"O .IR aio_reqprio , -.\"O .I aio_nbytes -.\"O are invalid. -.IR aio_offset , -.IR aio_reqprio , -.I aio_nbytes -のうち 1 つ以上が無効である。 -.TP -.B ENOSYS -.\"O This function is not supported. -この関数がサポートされていない。 -.TP -.B EOVERFLOW -.\"O The file is a regular file, we start reading before end-of-file -.\"O and want at least one byte, but the starting position is past -.\"O the maximum offset for this file. -ファイルが通常のファイルであり、 -ファイルの終端の前から読み込みを開始して、 -少なくとも 1 バイトを読み込もうとした。 -しかし開始位置がこのファイルの最大オフセットを超えていた。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -POSIX.1-2001. -.\"O .SH NOTES -.SH 注意 -.\"O It is a good idea to zero out the control block before use. -使用する前に制御ブロックを 0 にしておくのは、よい考えである。 -.\"O This control block must not be changed while the read operation -.\"O is in progress. -この制御ブロックは、読み込み操作が進行している間は変更すべきでない。 -.\"O The buffer area being read into -.\"O .\" or the control block of the operation -.\"O must not be accessed during the operation or undefined results may -.\"O occur. -.\"O The memory areas involved must remain valid. -読み込まれるバッファ領域は -.\" または操作の制御ブロックは -操作の最中にアクセスすべきではない。 -さもないと起こる結果が不定になる。 -これに含まれるメモリ領域は、有効なままにしなければならない。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR aio_cancel (3), -.BR aio_error (3), -.BR aio_fsync (3), -.BR aio_return (3), -.BR aio_suspend (3), -.BR aio_write (3) diff --git a/draft/man3/aio_return.3 b/draft/man3/aio_return.3 deleted file mode 100644 index dba66872..00000000 --- a/draft/man3/aio_return.3 +++ /dev/null @@ -1,101 +0,0 @@ -.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl) -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; without even the implied warranty of -.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -.\" GNU General Public License for more details. -.\" -.\" You should have received a copy of the GNU General Public -.\" License along with this manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.\" -.\" Japanese Version Copyright (c) 2004 Yuichi SATO -.\" all rights reserved. -.\" Translated Fri Jul 9 05:07:19 JST 2004 -.\" by Yuichi SATO -.\" -.TH AIO_RETURN 3 2003-11-14 "" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O aio_return \- get return status of asynchronous I/O operation -aio_return \- 非同期 I/O 操作の返り値 (return status) を取得する -.\"O .SH SYNOPSIS -.SH 書式 -.B "#include " -.sp -.BI "ssize_t aio_return(struct aiocb *" aiocbp ); -.sp -.\"O Link with \fI\-lrt\fP. -\fI\-lrt\fP でリンクする。 -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The -.\"O .BR aio_return () -.\"O function returns the final return status for the asynchronous I/O request -.\"O with control block pointed to by -.\"O .IR aiocbp . -.BR aio_return () -関数は -.I aiocbp -で指された制御ブロックにおける非同期 I/O リクエストの最終的な返り値を返す。 -.LP -.\"O This function should be called only once for any given request, after -.\"O .BR aio_error (3) -.\"O returns something other than -.\"O .B EINPROGRESS. -この関数は、 -.BR aio_error (3) -が -.B EINPROGRESS -以外を返した後で、 -与えられたリクエストに対して 1 回だけ呼ばれるべきである。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O If the asynchronous I/O operation has completed, this function returns -.\"O the value that would have been returned in case of a synchronous -.\"O .IR read , -.\"O .IR write , -.\"O or -.\"O .I fsync -.\"O request. -非同期 I/O 操作が完了した場合、この関数は同期 -.IR read , -.IR write , -.I fsync -リクエストのときに返されるのと同じ値を返す。 -.\"O Otherwise the return value is undefined. -それ以外の場合、返り値は未定義である。 -.\"O On error, the error value is returned. -エラーの場合、エラー値が返される。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EINVAL -.\"O .I aiocbp -.\"O does not point at a control block for an asynchronous I/O request -.\"O of which the return status has not been retrieved yet. -.I aiocbp -が、返り値がまだ取得されていない非同期 I/O リクエストの -制御ブロックを指していない。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -POSIX.1-2001. -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR aio_cancel (3), -.BR aio_error (3), -.BR aio_fsync (3), -.BR aio_read (3), -.BR aio_suspend (3), -.BR aio_write (3) diff --git a/draft/man3/aio_suspend.3 b/draft/man3/aio_suspend.3 deleted file mode 100644 index 56471585..00000000 --- a/draft/man3/aio_suspend.3 +++ /dev/null @@ -1,136 +0,0 @@ -.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl) -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; without even the implied warranty of -.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -.\" GNU General Public License for more details. -.\" -.\" You should have received a copy of the GNU General Public -.\" License along with this manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.\" -.\" Japanese Version Copyright (c) 2004 Yuichi SATO -.\" all rights reserved. -.\" Translated Sat Jul 10 03:18:23 JST 2004 -.\" by Yuichi SATO -.\" -.TH AIO_SUSPEND 3 2003-11-14 "" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O aio_suspend \- wait for asynchronous I/O operation or timeout -aio_suspend \- 非同期 I/O 操作またはタイムアウトを待つ -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.sp -.B "#include " -.sp -.BI "int aio_suspend(const struct aiocb * const " cblist [], -.br -.BI " int " n ", const struct timespec *" timeout ); -.sp -.\"O Link with \fI\-lrt\fP. -\fI\-lrt\fP でリンクする。 -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The -.\"O .BR aio_suspend () -.\"O function suspends the calling process until at least one of the -.\"O asynchronous I/O requests in the list -.\"O .I cblist -.\"O of length -.\"O .I n -.\"O have completed, a signal is delivered, or -.\"O .I timeout -.\"O is not NULL and the time interval it indicates has passed. -.BR aio_suspend () -関数は、長さ -.I n -のリスト -.I cblist -に含まれる非同期 I/O リクエストのうち少なくとも 1 つが完了するか、 -シグナルが配送されるか、 -.I timeout -が NULL でなく、かつその時間が過ぎるまで、 -呼び出したプロセスを停止 (suspend) する。 -.LP -.\"O Each item in the list must either be NULL (and then is ignored), -.\"O or a pointer to a control block on which I/O was initiated using -.\"O .BR aio_read (3), -.\"O .BR aio_write (3), -.\"O or -.\"O .BR lio_listio (3). -リストの各アイテムは、NULL (これは無視される) か、 -.BR aio_read (3), -.BR aio_write (3), -.BR lio_listio (3) -を使って I/O が開始された制御ブロックへのポインタでなければならない。 -.LP -.\"O If -.\"O .B CLOCK_MONOTONIC -.\"O is supported, this clock is used to measure -.\"O the timeout interval. -.B CLOCK_MONOTONIC -がサポートされる場合、 -このクロックを使ってタイムアウトの間隔が計測される。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O If this function returns after completion of one of the indicated -.\"O requests, it returns 0. -.\"O Otherwise it returns \-1 and sets -.\"O .I errno -.\"O appropriately. -指示されたリクエストの 1 つが完了した後にこの関数が返る場合は、0 を返す。 -それ以外の場合は \-1 を返して、 -.I errno -を適切に設定する。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EAGAIN -.\"O The call was ended by timeout, before any of the indicated operations -.\"O had completed. -指示された操作のどれも完了しないうちに、 -この呼び出しがタイムアウトによって終了させられた。 -.TP -.B EINTR -.\"O The call was ended by signal; see -.\"O .BR signal (7). -.\"O (Possibly the completion signal of one of the operations we were -.\"O waiting for.) -この呼び出しがシグナルによって終了させられた。 -.BR signal (7) -参照。 -(このシグナルは、完了を待っていた操作のいずれかの完了シグナルの可能性もある。) -.\"O .SH "CONFORMING TO" -.SH 準拠 -POSIX.1-2001. -.\"O .SH NOTES -.SH 注意 -.\"O One can achieve polling by using a non-NULL -.\"O .I timeout -.\"O that specifies a zero time interval. -時間間隔が 0 であることを指定する NULL ではない -.I timeout -を使って、ポーリングを行うこともできる。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR aio_cancel (3), -.BR aio_error (3), -.BR aio_fsync (3), -.BR aio_read (3), -.BR aio_return (3), -.BR aio_write (3), -.BR time (7) diff --git a/draft/man3/aio_write.3 b/draft/man3/aio_write.3 deleted file mode 100644 index 91ce219d..00000000 --- a/draft/man3/aio_write.3 +++ /dev/null @@ -1,208 +0,0 @@ -.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl) -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; without even the implied warranty of -.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -.\" GNU General Public License for more details. -.\" -.\" You should have received a copy of the GNU General Public -.\" License along with this manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.\" -.\" Japanese Version Copyright (c) 2004 Yuichi SATO -.\" all rights reserved. -.\" Translated Sat Jul 10 03:54:47 JST 2004 -.\" by Yuichi SATO -.\" -.TH AIO_WRITE 3 2003-11-14 "" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O aio_write \- asynchronous write -aio_write \- 非同期で書き込む -.\"O .SH SYNOPSIS -.SH 書式 -.B "#include " -.sp -.BI "int aio_write(struct aiocb *" aiocbp ); -.sp -.\"O Link with \fI\-lrt\fP. -\fI\-lrt\fP でリンクする。 -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The -.\"O .BR aio_write () -.\"O function requests an asynchronous "n = write(fd, buf, count)" -.\"O with fd, buf, count given by -.\"O .IR aiocbp\->aio_fildes , -.\"O .IR aiocbp\->aio_buf , -.\"O .IR aiocbp\->aio_nbytes , -.\"O respectively. -.\"O The return status n can be retrieved upon completion using -.\"O .BR aio_return (3). -.BR aio_write () -関数は非同期の "n = write(fd, buf, count)" をリクエストする。 -ここで fd, buf, count は、それぞれ -.IR aiocbp\->aio_fildes , -.IR aiocbp\->aio_buf , -.I aiocbp\->aio_nbytes -で与えられる。 -返り値 (return status) n は、完了時に -.BR aio_return (3) -を使って取得できる。 -.LP -.\"O If -.\"O .B O_APPEND -.\"O is not set, the data is written starting at the -.\"O absolute file offset -.\"O .IR aiocbp\->aio_offset , -.\"O regardless of the current file position. -.B O_APPEND -が設定されない場合、カレントのファイル位置に関係なく、 -データは絶対ファイルオフセット -.I aiocbp\->aio_offset -を開始点として書き込まれる。 -.\"O If -.\"O .B O_APPEND -.\"O is set, the data is written at the end of the file. -.B O_APPEND -が設定されている場合、データはファイルの終端に書き込まれる。 -.\"O After this request, the value of the current file position is unspecified. -このリクエストの後の、カレントのファイル位置は規定されていない。 -.LP -.\"O The "asynchronous" means that this call returns as soon as the -.\"O request has been enqueued; the write may or may not have completed -.\"O when the call returns. -.\"O One tests for completion using -.\"O .BR aio_error (3). -「非同期」とは「リクエストがキューに入れられたら、この呼び出しはすぐに返る」 -ということである。 -呼び出しから戻った時に、書き込みは完了しているかも知れないし、 -完了していないかも知れない。 -.BR aio_error (3) -を使うことで完了したかをテストできる。 -.LP -.\"O If -.\"O .B _POSIX_PRIORITIZED_IO -.\"O is defined, and this file supports it, -.\"O then the asynchronous operation is submitted at a priority equal -.\"O to that of the calling process minus -.\"O .IR aiocbp\->aio_reqprio . -.B _POSIX_PRIORITIZED_IO -が定義されていて、 -かつファイルがこれをサポートしている場合、 -非同期操作は呼び出したプロセスの優先度から -.I aiocbp\->aio_reqprio -を引いた優先度で登録 (submit) される。 -.LP -.\"O The field -.\"O .I aiocbp\->aio_lio_opcode -.\"O is ignored. -フィールド -.I aiocbp\->aio_lio_opcode -は無視される。 -.LP -.\"O No data is written to a regular file beyond its maximum offset. -最大オフセットを超えた通常のファイルには、何もデータが書き込まれない。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success, 0 is returned. -.\"O On error the request is not enqueued, \-1 -.\"O is returned, and -.\"O .I errno -.\"O is set appropriately. -.\"O If an error is first detected later, it will -.\"O be reported via -.\"O .BR aio_return (3) -.\"O (returns status \-1) and -.\"O .BR aio_error (3) -.\"O (error status whatever one would have gotten in -.\"O .IR errno , -.\"O such as -.\"O .BR EBADF ). -成功した場合、0 が返される。 -エラーの場合、リクエストはキューに入れられず、 -\-1 が返されて、 -.I errno -が適切に設定される。 -エラーは最初に検知された後で、 -(状態 \-1 を返す) -.BR aio_return (3) -と -.RI ( errno -で取得できる -.B EBADF -のようなエラー状態を返す) -.BR aio_error (3) -で報告されるだろう。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EAGAIN -.\"O Out of resources. -リソースが足りない。 -.TP -.B EBADF -.\"O .I aio_fildes -.\"O is not a valid file descriptor open for writing. -.I aio_fildes -は書き込みのためにオープンされた有効なファイルディスクリプタでない。 -.TP -.B EFBIG -.\"O The file is a regular file, we want to write at least one byte, -.\"O but the starting position is at or beyond the maximum offset for this file. -ファイルは通常のファイルであり、少なくとも 1 バイトを書き込もうとしている。 -しかし開始位置が、このファイルの最大オフセットと同じかそれを超えている。 -.TP -.B EINVAL -.\"O One or more of -.\"O .IR aio_offset , -.\"O .IR aio_reqprio , -.\"O .I aio_nbytes -.\"O are invalid. -.IR aio_offset , -.IR aio_reqprio , -.I aio_nbytes -のうち 1 つ以上が無効である。 -.TP -.B ENOSYS -.\"O This function is not supported. -この関数がサポートされていない。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -POSIX.1-2001. -.\"O .SH NOTES -.SH 注意 -.\"O It is a good idea to zero out the control block before use. -使用する前に制御ブロックを 0 にしておくのは、よい考えである。 -.\"O This control block must not be changed while the write operation -.\"O is in progress. -この制御ブロックは、読み込み操作が進行している間は変更すべきでない。 -.\"O The buffer area being written out -.\"O .\" or the control block of the operation -.\"O must not be accessed during the operation or undefined results may -.\"O occur. -.\"O The memory areas involved must remain valid. -読み込まれるバッファ領域は -.\" または操作の制御ブロックは -操作の最中にアクセスすべきではない。 -さもないと起こる結果が不定になる。 -これに含まれるメモリ領域は、有効なままにしなければならない。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR aio_cancel (3), -.BR aio_error (3), -.BR aio_fsync (3), -.BR aio_read (3), -.BR aio_return (3), -.BR aio_suspend (3) diff --git a/draft/man3/alloca.3 b/draft/man3/alloca.3 index 18843ed5..3b7c3845 100644 --- a/draft/man3/alloca.3 +++ b/draft/man3/alloca.3 @@ -38,171 +38,44 @@ .\" Various rewrites and additions (notes on longjmp() and SIGSEGV). .\" Weaken warning against use of alloca() (as per Debian bug 461100). .\" -.\" Japanese Version Copyright (c) 1996 Kentaro OGAWA -.\" all rights reserved. -.\" Translated Sat, 13 Jul 1996 22:44:04 +0900 -.\" by Kentaro OGAWA -.\" Updated & Modified Tue Oct 16 01:01:48 JST 2001 -.\" by Yuichi SATO -.\" Updated & Modified Sat Aug 31 04:42:49 JST 2002 by Yuichi SATO +.\"******************************************************************* .\" -.TH ALLOCA 3 2008-01-24 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ALLOCA 3 2008\-01\-24 GNU "Linux Programmer's Manual" .SH 名前 -.\"O alloca \- allocate memory that is automatically freed alloca \- 自動的に解放されるメモリを割り当てる -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "void *alloca(size_t " size ); -.\"O .SH DESCRIPTION +\fBvoid *alloca(size_t \fP\fIsize\fP\fB);\fP .SH 説明 -.\"O The -.\"O .BR alloca () -.\"O function allocates -.\"O .I size -.\"O bytes of space in the stack frame of the caller. -.\"O This temporary space is -.\"O automatically freed when the function that called -.\"O .BR alloca () -.\"O returns to its caller. -.BR alloca () -関数は、 -.I size -バイトの領域を呼出元のスタック・フレームに割り付ける。 -この一時的な領域は、 -.BR alloca () +\fBalloca\fP() 関数は、 \fIsize\fP バイトの領域を呼出元のスタック・フレームに割り付ける。 この一時的な領域は、 \fBalloca\fP() を呼び出した関数が呼出元に返るときに自動的に解放される。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O The -.\"O .BR alloca () -.\"O function returns a pointer to the beginning of the allocated space. -.\"O If the allocation causes stack overflow, program behavior is undefined. -.BR alloca () -関数は、割り付けた領域の始まりを指すポインタを返す。 -割り付けによってスタックオーバーフローが起った場合の +\fBalloca\fP() 関数は、割り付けた領域の始まりを指すポインタを返す。 割り付けによってスタックオーバーフローが起った場合の プログラムの動作は定義されていない。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O This function is not in POSIX.1-2001. -この関数は POSIX.1-2001 にはない。 +この関数は POSIX.1\-2001 にはない。 -.\"O There is evidence that the -.\"O .BR alloca () -.\"O function appeared in 32V, PWB, PWB.2, 3BSD, and 4BSD. -.\"O There is a man page for it in 4.3BSD. -.\"O Linux uses the GNU version. -.\"O This function is not in POSIX.1-2001. -32V, PWB, PWB.2, 3BSD, 4BSD に -.BR alloca () -関数が登場した証拠がある。 -4.3BSD には、マニュアルページがある。 -Linux は、GNU 版を使っている。 -この関数は POSIX.1-2001 にはない。 -.\"O .SH NOTES +32V, PWB, PWB.2, 3BSD, 4BSD に \fBalloca\fP() 関数が登場した証拠がある。 4.3BSD +には、マニュアルページがある。 Linux は、GNU 版を使っている。 この関数は POSIX.1\-2001 にはない。 .SH 注意 -.\"O The -.\"O .BR alloca () -.\"O function is machine- and compiler-dependent. -.BR alloca () -関数は、機種とコンパイラに依存する。 -.\"O For certain applications, -.\"O its use can improve efficiency compared to the use of -.\"O .BR malloc (3) -.\"O plus -.\"O .BR free (3). -.\"O In certain cases, -.\"O it can also simplify memory deallocation in applications that use -.\"O .BR longjmp (3) -.\"O or -.\"O .BR siglongjmp (3). -.\"O Otherwise, its use is discouraged. -特定のアプリケーションでは、この関数を使うと -.BR malloc (3) -と -.BR free (3) -を組み合わせて使った場合に比べて効率を改善することができる。 -特定の場合では、この関数を使うことで、 -.BR longjmp (3) -や -.BR siglongjmp (3) -を使うアプリケーションでのメモリの開放を簡単にすることができる。 +\fBalloca\fP() 関数は、機種とコンパイラに依存する。 特定のアプリケーションでは、この関数を使うと \fBmalloc\fP(3) と +\fBfree\fP(3) を組み合わせて使った場合に比べて効率を改善することができる。 特定の場合では、この関数を使うことで、 \fBlongjmp\fP(3) +や \fBsiglongjmp\fP(3) を使うアプリケーションでのメモリの開放を簡単にすることができる。 それ以外の場合では、この関数の使用は推奨されない。 -.\"O Because the space allocated by -.\"O .BR alloca () -.\"O is allocated within the stack frame, -.\"O that space is automatically freed if the function return -.\"O is jumped over by a call to -.\"O .BR longjmp (3) -.\"O or -.\"O .BR siglongjmp (3). -.BR alloca () -により割り当てられる空間はスタックフレームから割り当てらるので、 -関数の戻り先が -.BR longjmp (3) -や -.BR siglongjmp (3) -の呼び出しによりジャンプした場合には、 -割り当てられた空間は自動的に解放される。 +\fBalloca\fP() により割り当てられる空間はスタックフレームから割り当てらるので、 関数の戻り先が \fBlongjmp\fP(3) や +\fBsiglongjmp\fP(3) の呼び出しによりジャンプした場合には、 割り当てられた空間は自動的に解放される。 -.\"O Do not attempt to -.\"O .BR free (3) -.\"O space allocated by -.\"O .BR alloca ()! -.BR alloca () -で割り当てられた空間を -.BR free (3) -しようとすることのないように! -.\"O .SS Notes on the GNU Version -.SH 注意 -.SS GNU 版についての注意 -.\"O Normally, -.\"O .BR gcc (1) -.\"O translates calls to -.\"O .BR alloca () -.\"O with inlined code. -.\"O This is not done when either the -.\"O .IR "\-ansi" , -.\"O .IR "\-std=c89" , -.\"O .IR "\-std=c99" , -.\"O or the -.\"O .IR "\-fno\-builtin" -.\"O option is given -.\"O (and the header -.\"O .I -.\"O is not included). -.\"O But beware! -.\"O By default the glibc version of -.\"O .I -.\"O includes -.\"O .I -.\"O and that contains the line: -.\"O .nf -.\"O -.\"O #define alloca(size) __builtin_alloca (size) -.\"O -.\"O .fi -.\"O with messy consequences if one has a private version of this function. -通常 -.BR gcc (1) -は -.BR alloca () -の呼び出しをインラインコードに変換する。 -.IR "\-ansi" , -.IR "\-std=c89" , -.IR "\-std=c99" , -.IR "\-fno\-builtin" -のいずれかのオプションが指定された場合、この変換は行われない -(また -.I -のインクルードも行われない)。 -だだし、デフォルトでは glibc 版の -.I -は -.I +\fBalloca\fP() で割り当てられた空間を \fBfree\fP(3) しようとすることのないように! +.SS "GNU 版についての注意" +通常 \fBgcc\fP(1) は \fBalloca\fP() の呼び出しをインラインコードに変換する。 \fI\-ansi\fP, \fI\-std=c89\fP, +\fI\-std=c99\fP, \fI\-fno\-builtin\fP のいずれかのオプションが指定された場合、この変換は行われない (また +\fI\fP のインクルードも行われない)。 だだし、デフォルトでは glibc 版の +\fI\fP は \fI\fP をインクルードしており、これには以下の行が含まれているので注意すること。 .nf @@ -211,48 +84,15 @@ Linux は、GNU 版を使っている。 .fi 独自版の __builtin_alloca (size) 関数があると厄介な結果になる。 .LP -.\"O The fact that the code is inlined means that it is impossible -.\"O to take the address of this function, or to change its behavior -.\"O by linking with a different library. -このコードはインライン化されているので、 -この関数のアドレスを取得したり、 -他のライブラリをリンクして動作を変更することはできない。 +このコードはインライン化されているので、 この関数のアドレスを取得したり、 他のライブラリをリンクして動作を変更することはできない。 .LP -.\"O The inlined code often consists of a single instruction adjusting -.\"O the stack pointer, and does not check for stack overflow. -.\"O Thus, there is no NULL error return. -通常このインラインコードはスタックポインタを移動する -1 つの命令 (instruction) から構成されており、 -スタックオーバーフローをチェックしない。 -よって NULL エラーが返されることはない。 -.\"O .SH BUGS +通常このインラインコードはスタックポインタを移動する 1 つの命令 (instruction) から構成されており、 +スタックオーバーフローをチェックしない。 よって NULL エラーが返されることはない。 .SH バグ -.\"O There is no error indication if the stack frame cannot be extended. -.\"O (However, after a failed allocation, the program is likely to receive a -.\"O .B SIGSEGV -.\"O signal if it attempts to access the unallocated space.) -スタックフレームが拡張できなかった場合、エラー通知は行われない。 -(しかしながら、割り当てに失敗した後で、プログラムが割り当てられなかった -空間にアクセスしようとした場合に -.B SIGSEGV -シグナルを受信することだろう。) +スタックフレームが拡張できなかった場合、エラー通知は行われない。 (しかしながら、割り当てに失敗した後で、プログラムが割り当てられなかった +空間にアクセスしようとした場合に \fBSIGSEGV\fP シグナルを受信することだろう。) -.\"O On many systems -.\"O .BR alloca () -.\"O cannot be used inside the list of arguments of a function call, because -.\"O the stack space reserved by -.\"O .BR alloca () -.\"O would appear on the stack in the middle of the space for the -.\"O function arguments. -多くのシステムにおいて、関数コールの引き数のリスト内では -.BR alloca () -が使えない。 -これは、 -.BR alloca () -によって予約されるスタック領域が、 -関数引き数に使われるスタック領域の中に現れてしまうためである。 -.\"O .SH "SEE ALSO" +多くのシステムにおいて、関数コールの引き数のリスト内では \fBalloca\fP() が使えない。 これは、 \fBalloca\fP() +によって予約されるスタック領域が、 関数引き数に使われるスタック領域の中に現れてしまうためである。 .SH 関連項目 -.BR brk (2), -.BR longjmp (3), -.BR malloc (3) +\fBbrk\fP(2), \fBlongjmp\fP(3), \fBmalloc\fP(3) diff --git a/draft/man3/asin.3 b/draft/man3/asin.3 index 957ea4d4..601f796c 100644 --- a/draft/man3/asin.3 +++ b/draft/man3/asin.3 @@ -1,4 +1,4 @@ -.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk .\" .\" @@ -30,140 +30,63 @@ .\" Modified 2002-07-25 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 1996 Kenji Kajiwara and Kentaro Ogawa -.\" all rights reserved. -.\" Translated Sat, 13 Jul 1996 17:50:45 JST -.\" by Kenji Kajiwara and Kentaro Ogawa -.\" Proof Reading: Takashi Yoshino -.\" Updated Tue Aug 5 23:16:48 JST 2003 -.\" by Akihiro MOTOKI -.\" Updated 2008-09-14, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH ASIN 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ASIN 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O asin, asinf, asinl \- arc sine function asin, asinf, asinl \- 逆正弦(arc sine)関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double asin(double " x ); +\fBdouble asin(double \fP\fIx\fP\fB);\fP .br -.BI "float asinf(float " x ); +\fBfloat asinf(float \fP\fIx\fP\fB);\fP .br -.BI "long double asinl(long double " x ); +\fBlong double asinl(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR asinf (), -.BR asinl (): +\fBasinf\fP(), \fBasinl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR asin () -.\"O function calculates the principal value of the arc sine of \fIx\fP; -.\"O that is the value whose sine is \fIx\fP. -.BR asin () -関数は \fIx\fP の逆正弦(arc sine) の主値を計算する。 -すなわち、その正弦(sine)が \fIx\fP となるような値である。 -.\"O .SH "RETURN VALUE" +\fBasin\fP() 関数は \fIx\fP の逆正弦(arc sine) の主値を計算する。 すなわち、その正弦(sine)が \fIx\fP +となるような値である。 .SH 返り値 -.\"O On success, these functions return the principal value of the arc sine of -.\"O .IR x -.\"O in radians; the return value is in the range [\-pi/2,\ pi/2]. -成功すると、これらの関数は -.I x -の逆正弦の主値をラジアン単位で返す。 -返り値は [\-pi/2,\ pi/2] の範囲となる。 +成功すると、これらの関数は \fIx\fP の逆正弦の主値をラジアン単位で返す。 返り値は [\-pi/2,\ pi/2] の範囲となる。 -.\"O If -.\"O .I x -.\"O is a NaN, a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is +0 (\-0), -.\"O +0 (\-0) is returned. -.I x -が +0 (\-0) の場合、+0 (\-0) が返される。 +\fIx\fP が +0 (\-0) の場合、+0 (\-0) が返される。 -.\"O If -.\"O .I x -.\"O is outside the range [\-1,\ 1], -.\"O a domain error occurs, -.\"O and a NaN is returned. -.I x -が [\-1,\ 1] の範囲に入っていない場合、 -領域エラー (domain error) が発生し、NaN が返される。 .\" .\" POSIX.1-2001 documents an optional range error for subnormal x; .\" glibc 2.8 does not do this. -.\"O .SH ERRORS +\fIx\fP が [\-1,\ 1] の範囲に入っていない場合、 領域エラー (domain error) が発生し、NaN が返される。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Domain error: \fIx\fP is outside the range [\-1,\ 1] +.TP 領域エラー (domain error): \fIx\fP が [\-1,\ 1] の範囲に入っていない -.\"O .I errno -.\"O is set to -.\"O .BR EDOM . -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -.I errno -に -.B EDOM -が設定される。 -無効 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) -が上がる。 -.\"O .SH "CONFORMING TO" +\fIerrno\fP に \fBEDOM\fP が設定される。 不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH 関連項目 -.BR acos (3), -.BR atan (3), -.BR atan2 (3), -.BR casin (3), -.BR cos (3), -.BR sin (3), -.BR tan (3) +\fBacos\fP(3), \fBatan\fP(3), \fBatan2\fP(3), \fBcasin\fP(3), \fBcos\fP(3), \fBsin\fP(3), +\fBtan\fP(3) diff --git a/draft/man3/asinh.3 b/draft/man3/asinh.3 index bb8fac5f..6491497a 100644 --- a/draft/man3/asinh.3 +++ b/draft/man3/asinh.3 @@ -30,121 +30,64 @@ .\" Modified 2002-07-27 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 1996 Kenji Kajiwara and Kentaro Ogawa -.\" all rights reserved. -.\" Translated Sat, 13 Jul 1996 17:58:16 JST -.\" by Kenji Kajiwara and Kentaro Ogawa -.\" Proof Reading: Takashi Yoshino -.\" Updated Tue Aug 5 23:16:48 JST 2003 -.\" by Akihiro MOTOKI -.\" Updated 2008-09-14, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH ASINH 3 2010-09-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ASINH 3 2010\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 -.\"O asinh, asinhf, asinhl \- inverse hyperbolic sine function asinh, asinhf, asinhl \- 逆双曲線正弦(inverse hyperbolic sine)関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double asinh(double " x ); +\fBdouble asinh(double \fP\fIx\fP\fB);\fP .br -.BI "float asinhf(float " x ); +\fBfloat asinhf(float \fP\fIx\fP\fB);\fP .br -.BI "long double asinhl(long double " x ); +\fBlong double asinhl(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR asinh (): +\fBasinh\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .br -.BR asinhf (), -.BR asinhl (): +\fBasinhf\fP(), \fBasinhl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR asinh () -.\"O function calculates the inverse hyperbolic sine of -.\"O \fIx\fP; that is the value whose hyperbolic sine is \fIx\fP. -.BR asinh () -関数は \fIx\fP 逆双曲線正弦(inverse hyperbolic sine)を -計算する。すなわち、その双曲線正弦(hyperbolic sine)が \fIx\fP に -なるような値である。 -.\"O .SH "RETURN VALUE" +\fBasinh\fP() 関数は \fIx\fP 逆双曲線正弦(inverse hyperbolic sine)を +計算する。すなわち、その双曲線正弦(hyperbolic sine)が \fIx\fP に なるような値である。 .SH 返り値 -.\"O On success, these functions return the inverse hyperbolic sine of -.\"O .IR x . -成功すると、これらの関数は -.I x -の逆双曲線正弦を返す。 +成功すると、これらの関数は \fIx\fP の逆双曲線正弦を返す。 -.\"O If -.\"O .I x -.\"O is a NaN, a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is +0 (\-0), +0 (\-0) is returned. -.I x -が +0 (\-0) の場合、+0 (\-0) が返される。 +\fIx\fP が +0 (\-0) の場合、+0 (\-0) が返される。 -.\"O If -.\"O .I x -.\"O is positive infinity (negative infinity), -.\"O positive infinity (negative infinity) is returned. -.I x -が正の無限大 (負の無限大) の場合、正の無限大 (負の無限大) が返される。 .\" .\" POSIX.1-2001 documents an optional range error for subnormal x; .\" glibc 2.8 does not do this. -.\"O .SH ERRORS +\fIx\fP が正の無限大 (負の無限大) の場合、正の無限大 (負の無限大) が返される。 .SH エラー -.\"O No errors occur. エラーは発生しない。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH 関連項目 -.BR acosh (3), -.BR atanh (3), -.BR casinh (3), -.BR cosh (3), -.BR sinh (3), -.BR tanh (3) +\fBacosh\fP(3), \fBatanh\fP(3), \fBcasinh\fP(3), \fBcosh\fP(3), \fBsinh\fP(3), \fBtanh\fP(3) diff --git a/draft/man3/atan.3 b/draft/man3/atan.3 index a5e245f4..5595b1a5 100644 --- a/draft/man3/atan.3 +++ b/draft/man3/atan.3 @@ -30,115 +30,58 @@ .\" Modified 2002-07-27 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 1996 Kenji Kajiwara and Kentaro Ogawa -.\" all rights reserved. -.\" Translated Sat, 13 Jul 1996 17:50:45 JST -.\" by Kenji Kajiwara and Kentaro Ogawa -.\" Proof Reading: Takashi Yoshino -.\" Updated Tue Aug 5 23:16:48 JST 2003 -.\" by Akihiro MOTOKI -.\" Updated 2008-09-14, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH ATAN 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ATAN 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O atan, atanf, atanl \- arc tangent function atan, atanf, atanl \- 逆正接(arc tangent)関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double atan(double " x ); +\fBdouble atan(double \fP\fIx\fP\fB);\fP .br -.BI "float atanf(float " x ); +\fBfloat atanf(float \fP\fIx\fP\fB);\fP .br -.BI "long double atanl( long double " x ); +\fBlong double atanl( long double \fP\fIx\fP\fB);\fP .sp .fi -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR atanf (), -.BR atanl (): +\fBatanf\fP(), \fBatanl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR atan () -.\"O function calculates the principal value of the arc tangent of \fIx\fP; -.\"O that is the value whose tangent is \fIx\fP. -.BR atan () -\fIx\fP の逆正接(arc tangent)の主値を計算する。 -すなわち、 -その正接(tangent)が \fIx\fP となるような値である。 -.\"O .SH "RETURN VALUE" +\fBatan\fP() \fIx\fP の逆正接(arc tangent)の主値を計算する。 すなわち、 その正接(tangent)が \fIx\fP +となるような値である。 .SH 返り値 -.\"O On success, these functions return the principal value of the arc tangent of -.\"O .IR x -.\"O in radians; the return value is in the range [\-pi/2,\ pi/2]. -成功すると、これらの関数は -.I x -の逆正接の主値をラジアン単位で返す。 -返り値は [\-pi/2,\ pi/2] の範囲となる。 +成功すると、これらの関数は \fIx\fP の逆正接の主値をラジアン単位で返す。 返り値は [\-pi/2,\ pi/2] の範囲となる。 -.\"O If -.\"O .I x -.\"O is a NaN, a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is +0 (\-0), -.\"O +0 (\-0) is returned. -.I x -が +0 (\-0) の場合、+0 (\-0) が返される。 +\fIx\fP が +0 (\-0) の場合、+0 (\-0) が返される。 -.\"O If -.\"O .I x -.\"O is positive infinity (negative infinity), +pi/2 (\-pi/2) is returned. -.I x -が正の無限大 (負の無限大) の場合、+pi/2 (\-pi/2) が返される。 .\" .\" POSIX.1-2001 documents an optional range error for subnormal x; .\" glibc 2.8 does not do this. -.\"O .SH ERRORS +\fIx\fP が正の無限大 (負の無限大) の場合、+pi/2 (\-pi/2) が返される。 .SH エラー -.\"O No errors occur. エラーは発生しない。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH 関連項目 -.BR acos (3), -.BR asin (3), -.BR atan2 (3), -.BR carg (3), -.BR catan (3), -.BR cos (3), -.BR sin (3), -.BR tan (3) +\fBacos\fP(3), \fBasin\fP(3), \fBatan2\fP(3), \fBcarg\fP(3), \fBcatan\fP(3), \fBcos\fP(3), +\fBsin\fP(3), \fBtan\fP(3) diff --git a/draft/man3/atan2.3 b/draft/man3/atan2.3 index e0182748..f110e757 100644 --- a/draft/man3/atan2.3 +++ b/draft/man3/atan2.3 @@ -30,229 +30,86 @@ .\" Modified 2002-07-27 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 1996 Kenji Kajiwara and Kentaro Ogawa -.\" all rights reserved. -.\" Translated Sat, 13 Jul 1996 17:50:45 JST -.\" by Kenji Kajiwara and Kentaro Ogawa -.\" Proof Reading: Takashi Yoshino -.\" Updated Tue Aug 5 23:16:48 JST 2003 -.\" by Akihiro MOTOKI -.\" Updated 2008-09-15, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH ATAN2 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ATAN2 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O atan2, atan2f, atan2l \- arc tangent function of two variables atan2, atan2f, atan2l \- 二つの変数に対する逆正接(arc tangent)関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP -.BI "double atan2(double " y ", double " x ); -.BI "float atan2f(float " y ", float " x ); -.BI "long double atan2l(long double " y ", long double " x ); +\fBdouble atan2(double \fP\fIy\fP\fB, double \fP\fIx\fP\fB);\fP +\fBfloat atan2f(float \fP\fIy\fP\fB, float \fP\fIx\fP\fB);\fP +\fBlong double atan2l(long double \fP\fIy\fP\fB, long double \fP\fIx\fP\fB);\fP .fi -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR atan2f (), -.BR atan2l (): +\fBatan2f\fP(), \fBatan2l\fP(): .RS -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR atan2 () -.\"O function calculates the principal value of the arc tangent of -.\"O .IR y/x , -.\"O using the signs of the two arguments to determine -.\"O the quadrant of the result. -.BR atan2 () -関数は -.I y/x -の逆正接 (arg tangent) の主値を計算する。 +\fBatan2\fP() 関数は \fIy/x\fP の逆正接 (arg tangent) の主値を計算する。 二つの引き数の符号は結果の象限を決定するために使われる。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O On success, these functions return the principal value of the arc tangent of -.\"O .IR y/x -.\"O in radians; the return value is in the range [\-pi,\ pi]. -成功すると、これらの関数は -.I y/x -の逆正接の主値をラジアン単位で返す。 -返り値は [\-pi,\ pi] の範囲となる。 +成功すると、これらの関数は \fIy/x\fP の逆正接の主値をラジアン単位で返す。 返り値は [\-pi,\ pi] の範囲となる。 -.\"O If -.\"O .I y -.\"O is +0 (\-0) and -.\"O .I x -.\"O is less than 0, +pi (\-pi) is returned. -.I y -が +0 (\-0) で -.I x -が 0 未満の場合、+pi (\-pi) が返される。 +\fIy\fP が +0 (\-0) で \fIx\fP が 0 未満の場合、+pi (\-pi) が返される。 -.\"O If -.\"O .I y -.\"O is +0 (\-0) and -.\"O .I x -.\"O is greater than 0, +0 (\-0) is returned. -.I y -が +0 (\-0) で -.I x -が 0 より大きい場合、+0 (\-0) が返される。 +\fIy\fP が +0 (\-0) で \fIx\fP が 0 より大きい場合、+0 (\-0) が返される。 -.\"O If -.\"O .I y -.\"O is less than 0 and -.\"O .I x -.\"O is +0 or \-0, \-pi/2 is returned. -.I y -が 0 未満で -.I x -が +0 か \-0 の場合、\-pi/2 が返される。 +\fIy\fP が 0 未満で \fIx\fP が +0 か \-0 の場合、\-pi/2 が返される。 -.\"O If -.\"O .I y -.\"O is greater than 0 and -.\"O .I x -.\"O is +0 or \-0, pi/2 is returned. -.I y -が 0 より大きく -.I x -が +0 か \-0 の場合、pi/2 が返される。 +\fIy\fP が 0 より大きく \fIx\fP が +0 か \-0 の場合、pi/2 が返される。 .\" POSIX.1 says: .\" If .\" .I x .\" is 0, a pole error shall not occur. .\" -.\"O If either -.\"O .I x -.\"O or -.\"O .I y -.\"O is NaN, a NaN is returned. -.I x -か -.I y -のいずかが NaN の場合、NaN が返される。 +\fIx\fP か \fIy\fP のいずかが NaN の場合、NaN が返される。 .\" POSIX.1 says: .\" If the result underflows, a range error may occur and .\" .I y/x .\" should be returned. .\" -.\"O If -.\"O .I y -.\"O is +0 (\-0) and -.\"O .I x -.\"O is \-0, +pi (\-pi) is returned. -.I y -が +0 (\-0) で -.I x -が \-0 の場合、+pi (\-pi) が返される。 +\fIy\fP が +0 (\-0) で \fIx\fP が \-0 の場合、+pi (\-pi) が返される。 -.\"O If -.\"O .I y -.\"O is +0 (\-0) and -.\"O .I x -.\"O is +0, +0 (\-0) is returned. -.I y -が +0 (\-0) で -.I x -が +0 の場合、+0 (\-0) が返される。 +\fIy\fP が +0 (\-0) で \fIx\fP が +0 の場合、+0 (\-0) が返される。 -.\"O If -.\"O .I y -.\"O is a finite value greater (less) than 0, and -.\"O .I x -.\"O is negative infinity, +pi (\-pi) is returned. -.I y -が 0 より大きい (小さい) 有限値で -.I x -が負の無限大の場合、+pi (\-pi) が返される。 +\fIy\fP が 0 より大きい (小さい) 有限値で \fIx\fP が負の無限大の場合、+pi (\-pi) が返される。 -.\"O If -.\"O .I y -.\"O is a finite value greater (less) than 0, and -.\"O .I x -.\"O is positive infinity, +0 (\-0) is returned. -.I y -が 0 より大きい (小さい) 有限値で -.I x -が正の無限大の場合、+0 (\-0) が返される。 +\fIy\fP が 0 より大きい (小さい) 有限値で \fIx\fP が正の無限大の場合、+0 (\-0) が返される。 -.\"O If -.\"O .I y -.\"O is positive infinity (negative infinity), and -.\"O .I x -.\"O is finite, -.\"O pi/2 (\-pi/2) is returned. -.I y -が正の無限大 (負の無限大) で -.I x -が有限値の場合、pi/2 (\-pi/2) が返される。 +\fIy\fP が正の無限大 (負の無限大) で \fIx\fP が有限値の場合、pi/2 (\-pi/2) が返される。 -.\"O If -.\"O .I y -.\"O is positive infinity (negative infinity) and -.\"O .I x -.\"O is negative infinity, +3*pi/4 (\-3*pi/4) is returned. -.I y -が正の無限大 (負の無限大) で -.I x -が負の無限大の場合、+3*pi/4 (\-3*pi/4) が返される。 +\fIy\fP が正の無限大 (負の無限大) で \fIx\fP が負の無限大の場合、+3*pi/4 (\-3*pi/4) が返される。 -.\"O If -.\"O .I y -.\"O is positive infinity (negative infinity) and -.\"O .I x -.\"O is positive infinity, +pi/4 (\-pi/4) is returned. -.I y -が正の無限大 (負の無限大) で -.I x -が正の無限大の場合、+pi/4 (\-pi/4) が返される。 .\" .\" POSIX.1 says: .\" If both arguments are 0, a domain error shall not occur. -.\"O .SH ERRORS +\fIy\fP が正の無限大 (負の無限大) で \fIx\fP が正の無限大の場合、+pi/4 (\-pi/4) が返される。 .SH エラー -.\"O No errors occur. -エラーは発生しない。 .\" POSIX.1 documents an optional underflow error .\" glibc 2.8 does not do this. -.\"O .SH "CONFORMING TO" +エラーは発生しない。 .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH 関連項目 -.BR acos (3), -.BR asin (3), -.BR atan (3), -.BR carg (3), -.BR cos (3), -.BR sin (3), -.BR tan (3) +\fBacos\fP(3), \fBasin\fP(3), \fBatan\fP(3), \fBcarg\fP(3), \fBcos\fP(3), \fBsin\fP(3), +\fBtan\fP(3) diff --git a/draft/man3/atanh.3 b/draft/man3/atanh.3 index ee74b608..90b6b597 100644 --- a/draft/man3/atanh.3 +++ b/draft/man3/atanh.3 @@ -30,205 +30,81 @@ .\" Modified 2002-07-27 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 1996 Kenji Kajiwara and Kentaro Ogawa -.\" all rights reserved. -.\" Translated Sat, 13 Jul 1996 17:58:16 JST -.\" by Kenji Kajiwara and Kentaro Ogawa -.\" Proof Reading: Takashi Yoshino -.\" Updated Tue Aug 5 23:16:48 JST 2003 -.\" by Akihiro MOTOKI -.\" Updated 2008-09-14, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH ATANH 3 2010-09-11 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ATANH 3 2010\-09\-11 "" "Linux Programmer's Manual" .SH 名前 -.\"O atanh, atanhf, atanhl \- inverse hyperbolic tangent function atanh, atanhf, atanhl \- 逆双曲線正接(inverse hyperbolic tangent)関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double atanh(double " x ); +\fBdouble atanh(double \fP\fIx\fP\fB);\fP .br -.BI "float atanhf(float " x ); +\fBfloat atanhf(float \fP\fIx\fP\fB);\fP .br -.BI "long double atanhl(long double " x ); +\fBlong double atanhl(long double \fP\fIx\fP\fB);\fP .sp .fi -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR atanh (): +\fBatanh\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .br -.BR atanhf (), -.BR atanhl (): +\fBatanhf\fP(), \fBatanhl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR atanh () -.\"O function calculates the inverse hyperbolic tangent of -.\"O \fIx\fP; that is the value whose hyperbolic tangent is \fIx\fP. -.BR atanh () -関数は \fIx\fP の逆双曲線正接 (inverse hyperbolic tangent) を計算する。 -すなわち、その双曲線正接 (hyperbolic tangent) が \fIx\fP になる -ような値である。 -.\"O .SH "RETURN VALUE" +\fBatanh\fP() 関数は \fIx\fP の逆双曲線正接 (inverse hyperbolic tangent) を計算する。 +すなわち、その双曲線正接 (hyperbolic tangent) が \fIx\fP になる ような値である。 .SH 返り値 -.\"O On success, these functions return the inverse hyperbolic tangent of -.\"O .IR x . -成功すると、これらの関数は -.I x -の逆双曲線正接を返す。 +成功すると、これらの関数は \fIx\fP の逆双曲線正接を返す。 -.\"O If -.\"O .I x -.\"O is a NaN, a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is +0 (\-0), +0 (\-0) is returned. -.I x -が +0 (\-0) の場合、+0 (\-0) が返される。 +\fIx\fP が +0 (\-0) の場合、+0 (\-0) が返される。 -.\"O If -.\"O .I x -.\"O is +1 or \-1, -.\"O a pole error occurs, -.\"O and the functions return -.\"O .BR HUGE_VAL , -.\"O .BR HUGE_VALF , -.\"O or -.\"O .BR HUGE_VALL , -.\"O respectively, with the mathematically correct sign. -.I x -が +1 か \-1 の場合、 -極エラー (pole error) が発生し、 -関数の種類に応じて、数学的に正しい符号の -.BR HUGE_VAL , -.BR HUGE_VALF , -.BR HUGE_VALL -がそれぞれ返される。 +\fIx\fP が +1 か \-1 の場合、 極エラー (pole error) が発生し、 関数の種類に応じて、数学的に正しい符号の +\fBHUGE_VAL\fP, \fBHUGE_VALF\fP, \fBHUGE_VALL\fP がそれぞれ返される。 -.\"O If the absolute value of -.\"O .I x -.\"O is greater than 1, -.\"O a domain error occurs, -.\"O and a NaN is returned. -.I x -の絶対値が 1 より大きい場合、 -領域エラー (domain error) が発生し、 -NaN が返される。 .\" .\" POSIX.1-2001 documents an optional range error for subnormal x; .\" glibc 2.8 does not do this. -.\"O .SH ERRORS +\fIx\fP の絶対値が 1 より大きい場合、 領域エラー (domain error) が発生し、 NaN が返される。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Domain error: \fIx\fP less than \-1 or greater than +1 +.TP 領域エラー (domain error): \fIx\fP が \-1 より小さいか +1 より大きい -.\"O .I errno -.\"O is set to -.\"O .BR EDOM . -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -.I errno -に -.B EDOM -が設定される。 -無効 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) -が上がる。 -.TP -.\"O Pole error: \fIx\fP is +1 or \-1 +\fIerrno\fP に \fBEDOM\fP が設定される。 不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 +.TP 極エラー (pole error): \fIx\fP が +1 か \-1 -.\"O .I errno -.\"O is set to -.\"O .BR ERANGE -.\"O (but see BUGS). -.I errno -に -.B ERANGE -が設定される (但し「バグ」の節も参照)。 -.\"O A divide-by-zero floating-point exception -.\"O .RB ( FE_DIVBYZERO ) -.\"O is raised. -0 による除算 (divide-by-zero) 浮動小数点例外 -.RB ( FE_DIVBYZERO ) -が上がる。 -.\"O .SH "CONFORMING TO" +\fIerrno\fP に \fBERANGE\fP が設定される (「バグ」の節も参照)。 0 による除算 (divide\-by\-zero) 浮動小数点例外 +(\fBFE_DIVBYZERO\fP) が上がる。 .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 -.\"O .SH BUGS +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH バグ -.\"O In glibc 2.9 and earlier, .\" Bug: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6759 .\" This can be seen in sysdeps/ieee754/k_standard.c -.\"O when a pole error occurs, -.\"O .I errno -.\"O as set to -.\"O .BR EDOM -.\"O instead of the POSIX-mandated -.\"O .BR ERANGE . -.\"O Since version 2.10, glibc does the right thing. -glibc 2.9 とそれ以前のバージョンでは、 -極エラーが発生した場合、POSIX で要求されている -.B ERANGE -ではなく -.B EDOM -が -.I errno -に設定される。 -バージョン 2.10 以降の glibc では、正しい動作をする。 -.\"O .SH "SEE ALSO" +glibc 2.9 とそれ以前のバージョンでは、 極エラーが発生した場合、POSIX で要求されている \fBERANGE\fP ではなく \fBEDOM\fP が +\fIerrno\fP に設定される。 バージョン 2.10 以降の glibc では、正しい動作をする。 .SH 関連項目 -.BR acosh (3), -.BR asinh (3), -.BR catanh (3), -.BR cosh (3), -.BR sinh (3), -.BR tanh (3) +\fBacosh\fP(3), \fBasinh\fP(3), \fBcatanh\fP(3), \fBcosh\fP(3), \fBsinh\fP(3), \fBtanh\fP(3) diff --git a/draft/man3/atexit.3 b/draft/man3/atexit.3 index 0ab829a0..1e8465a4 100644 --- a/draft/man3/atexit.3 +++ b/draft/man3/atexit.3 @@ -28,181 +28,60 @@ .\" Modified 1993-07-24, Rik Faith (faith@cs.unc.edu) .\" Modified 2003-10-25, Walter Harms .\" -.\" Japanese Version Copyright (c) 1996 Kentaro OGAWA -.\" all rights reserved. -.\" Translated 2006-07-14, Kentaro OGAWA -.\" Updated & Modified 2004-05-23, Yuichi SATO -.\" Updated 2008-12-26, Akihiro MOTOKI , LDP v3.15 +.\"******************************************************************* .\" -.TH ATEXIT 3 2008-12-05 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ATEXIT 3 2008\-12\-05 Linux "Linux Programmer's Manual" .SH 名前 -.\"O atexit \- register a function to be called at normal process termination atexit \- プロセスが正常終了した時に呼び出される関数を登録する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int atexit(void (*" function )(void)); +\fBint atexit(void (*\fP\fIfunction\fP\fB)(void));\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR atexit () -.\"O function registers the given \fIfunction\fP to be -.\"O called at normal process termination, either via -.\"O .BR exit (3) -.\"O or via return from the program's \fImain\fP(). -.BR atexit () -関数は、与えられた \fIfunction\fP を、 -.BR exit (3) -やプログラムの \fImain\fP() -関数からの返りを通じて、プロセスが正常終了した時に呼び出される -関数として登録する。 -.\"O Functions so registered are called in -.\"O the reverse order of their registration; no arguments are passed. -ここで定義された関数は、登録した順番とは逆の順番で呼び出される。 +\fBatexit\fP() 関数は、与えられた \fIfunction\fP を、 \fBexit\fP(3) やプログラムの \fImain\fP() +関数からの返りを通じて、プロセスが正常終了した時に呼び出される 関数として登録する。 ここで定義された関数は、登録した順番とは逆の順番で呼び出される。 登録した関数に引き数は渡されない。 -.\"O The same function may be registered multiple times: -.\"O it is called once for each registration. -同じ関数を複数回登録してもよい。 -登録された関数は登録 1 回につき 1 回呼び出される。 +同じ関数を複数回登録してもよい。 登録された関数は登録 1 回につき 1 回呼び出される。 .LP -.\"O POSIX.1-2001 requires that an implementation allow at least -.\"O .B ATEXIT_MAX -.\"O (32) such functions to be registered. -.\"O The actual limit supported by an implementation can be obtained using -.\"O .BR sysconf (3). -POSIX.1-2001 では、このような関数を少なくとも -.B ATEXIT_MAX -個 (32個) 登録できることを要求している。 -その実装でサポートされている実際の上限は -.BR sysconf (3) -を使って取得できる。 +POSIX.1\-2001 では、このような関数を少なくとも \fBATEXIT_MAX\fP 個 (32個) 登録できることを要求している。 +その実装でサポートされている実際の上限は \fBsysconf\fP(3) を使って取得できる。 .LP -.\"O When a child process is created via -.\"O .BR fork (2), -.\"O it inherits copies of its parent's registrations. -.BR fork (2) -で作成された場合、子プロセスは親プロセスの登録のコピーを継承する。 -.\"O Upon a successful call to one of the -.\"O .BR exec (3) -.\"O functions, -.\"O all registrations are removed. -.BR exec (3) -ファミリーの関数のいずれかの呼び出しに成功すると、 -全ての登録が削除される。 -.\"O .SH "RETURN VALUE" +\fBfork\fP(2) で作成された場合、子プロセスは親プロセスの登録のコピーを継承する。 +\fBexec\fP(3) ファミリーの関数の場合、呼び出しに成功すると、 全ての登録が削除される。 .SH 返り値 -.\"O The -.\"O .BR atexit () -.\"O function returns the value 0 if successful; otherwise -.\"O it returns a nonzero value. -.BR atexit () -関数は、関数登録が成功した時には 0 を返す。 -その他の場合には 0 以外の値を返す。 -.\"O .SH "CONFORMING TO" +\fBatexit\fP() 関数は、関数登録が成功した時には 0 を返す。 その他の場合には 0 以外の値を返す。 .SH 準拠 -SVr4, 4.3BSD, C89, C99, POSIX.1-2001. -.\"O .SH NOTES +SVr4, 4.3BSD, C89, C99, POSIX.1\-2001. .SH 注意 -.\"O Functions registered using -.\"O .BR atexit () -.\"O (and -.\"O .BR on_exit (3)) -.\"O are not called if a process terminates abnormally because -.\"O of the delivery of a signal. -.BR atexit () -(と -.BR on_exit (3)) -を使って登録された関数は、 +\fBatexit\fP() (と \fBon_exit\fP(3)) を使って登録された関数は、 シグナルの配送によりプロセスが異常終了した場合には呼び出されない。 -.\"O If one of the functions registered functions calls -.\"O .BR _exit (2), -.\"O then any remaining functions are not invoked, -.\"O and the other process termination steps performed by -.\"O .BR exit (3) -.\"O are not performed. -登録された関数の一つが -.BR _exit (2) -を呼び出した場合、残りの関数はどれも起動されず、 -.BR exit (3) +登録された関数の一つが \fB_exit\fP(2) を呼び出した場合、残りの関数はどれも起動されず、 \fBexit\fP(3) により実行される他のプロセス終了ステップは実行されない。 -.\"O POSIX.1-2001 says that the result of calling -.\"O .BR exit (3) -.\"O more than once (i.e., calling -.\"O .BR exit (3) -.\"O within a function registered using -.\"O .BR atexit ()) -.\"O is undefined. -POSIX.1-2001 では、 -.BR atexit () -を使って登録された一つの関数内で、複数回 -.BR exit (3) -を呼び出した際の結果は未定義である。 -.\"O On some systems (but not Linux), this can result in an infinite recursion; .\" This can happen on OpenBSD 4.2 for example, and is documented .\" as occurring on FreeBSD as well. .\" Glibc does "the Right Thing" -- invocation of the remaining .\" exit handlers carries on as normal. -.\"O portable programs should not invoke -.\"O .BR exit (3) -.\"O inside a function registered using -.\"O .BR atexit (). -(Linux ではないが) いくつかのシステムでは、この場合、 -繰り返しが無限に起こることになる。 -移植性が必要なプログラムでは、 -.BR atexit () -で登録された関数内で -.BR exit (3) -を起動すべきではない。 +POSIX.1\-2001 では、 \fBatexit\fP() を使って登録された一つの関数内で、複数回 \fBexit\fP(3) +を呼び出した際の結果は未定義である。 (Linux ではないが) いくつかのシステムでは、この場合、 繰り返しが無限に起こることになる。 +移植性が必要なプログラムでは、 \fBatexit\fP() で登録された関数内で \fBexit\fP(3) を起動すべきではない。 -.\"O The -.\"O .BR atexit () -.\"O and -.\"O .BR on_exit (3) -.\"O functions register functions on the same list: -.\"O at normal process termination, -.\"O the registered functions are invoked in reverse order -.\"O of their registration by these two functions. -.BR atexit () -と -.BR on_exit (3) -は、同じリストに対して関数を登録する。 -プロセスが正常に終了した際には、 -これらの二つの関数で登録された順序の逆順で、 -登録された関数が起動される。 +\fBatexit\fP() と \fBon_exit\fP(3) は、同じリストに対して関数を登録する。 プロセスが正常に終了した際には、 +これらの二つの関数で登録された順序の逆順で、 登録された関数が起動される。 -.\"O POSIX.1-2001 says that the result is undefined if -.\"O .BR longjmp (3) -.\"O is used to terminate execution of one of the functions registered -.\"O .BR atexit (). -POSIX.1-2001 では、 -.BR atexit () -で登録された関数の実行を終了するために -.BR longjmp (3) -が使用された場合の結果は未定義である。 .\" In glibc, things seem to be handled okay -.\"O .SS "Linux Notes" -.SS Linux での注意 -.\"O Since glibc 2.2.3, -.\"O .BR atexit () -.\"O (and -.\"O .BR on_exit (3)) -.\"O can be used to within a shared library to establish functions -.\"O that are called when the shared library is unloaded. -glibc 2.2.3 以降では、共有ライブラリがアンロードされるときに呼ばれる -関数を登録するために、共有ライブラリの中で -.BR atexit () -(と -.BR on_exit (3)) -を使用することができる。 -.PP -.\"O .SH EXAMPLE +POSIX.1\-2001 では、 \fBatexit\fP() で登録された関数の実行を終了するために \fBlongjmp\fP(3) +が使用された場合の結果は未定義である。 +.SS "Linux での注意" +glibc 2.2.3 以降では、共有ライブラリがアンロードされるときに呼ばれる 関数を登録するために、共有ライブラリの中で \fBatexit\fP() +(と \fBon_exit\fP(3)) を使用することができる。 .SH 例 .nf #include @@ -233,8 +112,5 @@ main(void) exit(EXIT_SUCCESS); } .fi -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR _exit (2), -.BR exit (3), -.BR on_exit (3) +\fB_exit\fP(2), \fBexit\fP(3), \fBon_exit\fP(3) diff --git a/draft/man3/atof.3 b/draft/man3/atof.3 index ad2351f7..9b6d2b29 100644 --- a/draft/man3/atof.3 +++ b/draft/man3/atof.3 @@ -26,64 +26,32 @@ .\" 386BSD man pages .\" Modified Mon Mar 29 22:39:24 1993, David Metcalfe .\" Modified Sat Jul 24 21:39:22 1993, Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1996 Kentaro OGAWA -.\" all rights reserved. -.\" Translated Sat, 13 Jul 1996 22:47:32 +0900 -.\" by Kentaro OGAWA +.\" This file was generated with po4a. Translate the source file. .\" -.TH ATOF 3 1993-03-29 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH ATOF 3 1993\-03\-29 GNU "Linux Programmer's Manual" .SH 名前 -.\"O atof \- convert a string to a double atof \- 文字列を double 型の数値に変換 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double atof(const char *" nptr ); +\fBdouble atof(const char *\fP\fInptr\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR atof () -.\"O function converts the initial portion of the string -.\"O pointed to by \fInptr\fP to -.\"O .IR double . -.\"O The behavior is the same as -.\"O .sp -.\"O .in +4n -.\"O strtod(nptr, (char **) NULL); -.\"O .in -.\"O .sp -.\"O except that -.\"O .BR atof () -.\"O does not detect errors. -.BR atof () -関数は、\fInptr\fPによって指示される文字列のはじめの部分を -.I double -型の数値に変換する。 -この振る舞いは、 -.BR atof () -関数がエラーを見つけないことを除いては、 +\fBatof\fP() 関数は、\fInptr\fPによって指示される文字列のはじめの部分を \fIdouble\fP 型の数値に変換する。 この振る舞いは、 +\fBatof\fP() 関数がエラーを見つけないことを除いては、 .sp .in +4n strtod(nptr, (char **) NULL); .in .sp と同じである。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O The converted value. 変換された値。 -.\"O .SH "CONFORMING TO" .SH 準拠 -SVr4, POSIX.1-2001, 4.3BSD, C89, C99. -.\"O .SH "SEE ALSO" +SVr4, POSIX.1\-2001, 4.3BSD, C89, C99. .SH 関連項目 -.BR atoi (3), -.BR atol (3), -.BR strtod (3), -.BR strtol (3), -.BR strtoul (3) +\fBatoi\fP(3), \fBatol\fP(3), \fBstrtod\fP(3), \fBstrtol\fP(3), \fBstrtoul\fP(3) diff --git a/draft/man3/atoi.3 b/draft/man3/atoi.3 index cf3128d7..55d40b09 100644 --- a/draft/man3/atoi.3 +++ b/draft/man3/atoi.3 @@ -28,56 +28,43 @@ .\" Modified Sat Jul 24 21:38:42 1993, Rik Faith (faith@cs.unc.edu) .\" Modified Sun Dec 17 18:35:06 2000, Joseph S. Myers .\" -.\" Japanese Version Copyright (c) 1996 Kentaro OGAWA -.\" all rights reserved. -.\" Translated Sat, 13 Jul 1996 22:47:32 +0900 -.\" by Kentaro OGAWA -.\" Updated Tue 30 Jan 2001 JST by Kentaro Shirakata +.\"******************************************************************* .\" -.TH ATOI 3 2010-09-20 "GNU" "Linux Programmer's Manual" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ATOI 3 2010\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 -.\"O atoi, atol, atoll, atoq \- convert a string to an integer atoi, atol, atoll, atoq \- 文字列を整数型に変換する .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int atoi(const char *" nptr ); +\fBint atoi(const char *\fP\fInptr\fP\fB);\fP .br -.BI "long atol(const char *" nptr ); +\fBlong atol(const char *\fP\fInptr\fP\fB);\fP .br -.BI "long long atoll(const char *" nptr ); +\fBlong long atoll(const char *\fP\fInptr\fP\fB);\fP .br -.BI "long long atoq(const char *" nptr ); +\fBlong long atoq(const char *\fP\fInptr\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR atoll (): +\fBatoll\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +または \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.BR atoi () -関数は、\fInptr\fP によって指示される文字列のはじめの部分を -.I int -型整数に変換する。 -この振る舞いは、 -.BR atoi () -関数がエラーを見つけない点以外は、 +\fBatoi\fP() 関数は、\fInptr\fP によって指示される文字列のはじめの部分を \fIint\fP 型整数に変換する。 この振る舞いは、 +\fBatoi\fP() 関数がエラーを見つけない点以外は、 .sp .in +4n strtol(nptr, (char **) NULL, 10); @@ -85,68 +72,16 @@ strtol(nptr, (char **) NULL, 10); .sp と同じである。 .PP -.\"O The -.\"O .BR atol () -.\"O and -.\"O .BR atoll () -.\"O functions behave the same as -.\"O .BR atoi (), -.\"O except that they convert the initial portion of the -.\"O string to their return type of \fIlong\fP or \fIlong long\fP. -.BR atol () -関数と -.BR atoll () -関数は -.BR atoi () -と同様の振る舞いをするが、 -文字列のはじめの部分をそれぞれ \fIlong\fP や \fIlong long\fP に変換する。 -.\"O .BR atoq () -.\"O is an obsolete name for -.\"O .BR atoll (). -.BR atoq () -は -.BR atoll () -の古い名前である。 +\fBatol\fP() 関数と \fBatoll\fP() 関数は \fBatoi\fP() と同様の振る舞いをするが、 文字列のはじめの部分をそれぞれ +\fIlong\fP や \fIlong long\fP に変換する。 \fBatoq\fP() は \fBatoll\fP() の古い名前である。 .SH 返り値 変換された値。 .SH 準拠 -SVr4, POSIX.1-2001, 4.3BSD, C99. -.\"O C89 and -.\"O POSIX.1-1996 include the functions -.\"O .BR atoi () -.\"O and -.\"O .BR atol () -.\"O only. -.\"O .BR atoq () -.\"O is a GNU extension. -C89 と POSIX.1-1996 には -.BR atoi () -と -.BR atol () -だけが含まれている。 -.BR atoq () -は GNU による拡張である。 -.\"O .SH "NOTES" +SVr4, POSIX.1\-2001, 4.3BSD, C99. C89 と POSIX.1\-1996 には \fBatoi\fP() と +\fBatol\fP() だけが含まれている。 \fBatoq\fP() は GNU による拡張である。 .SH 注意 -.\"O The nonstandard -.\"O .BR atoq () -.\"O function is not present in libc 4.6.27 -.\"O or glibc 2, but is present in libc5 and libc 4.7 (though only as an -.\"O inline function in \fI\fP until libc 5.4.44). -.\"O The -.\"O .BR atoll () -.\"O function is present in glibc 2 since version 2.0.2, but -.\"O not in libc4 or libc5. -非標準である -.BR atoq () -関数は libc 4.6.27 や glibc 2 には含まれていないが、 -libc5 と libc 4.7 には存在している (ただし libc 5.4.44 までは -\fI\fP のインライン関数のみである)。 -.BR atoll () -関数は glibc 2 のバージョン 2.0.2 から存在しているが、 -libc4 や libc5 には存在しない。 +非標準である \fBatoq\fP() 関数は libc 4.6.27 や glibc 2 には含まれていないが、 libc5 と libc 4.7 +には存在している (ただし libc 5.4.44 までは \fI\fP のインライン関数のみである)。 +\fBatoll\fP() 関数は glibc 2 のバージョン 2.0.2 から存在しているが、 libc4 や libc5 には存在しない。 .SH 関連項目 -.BR atof (3), -.BR strtod (3), -.BR strtol (3), -.BR strtoul (3) +\fBatof\fP(3), \fBstrtod\fP(3), \fBstrtol\fP(3), \fBstrtoul\fP(3) diff --git a/draft/man3/bcmp.3 b/draft/man3/bcmp.3 index ad2b97c9..73134539 100644 --- a/draft/man3/bcmp.3 +++ b/draft/man3/bcmp.3 @@ -1,3 +1,4 @@ +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are @@ -25,77 +26,28 @@ .\" 386BSD man pages .\" Modified Sat Jul 24 21:36:50 1993 by Rik Faith .\" Modified Tue Oct 22 23:47:36 1996 by Eric S. Raymond +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 Ueyama Rui -.\" all rights reserved. -.\" Translated Sun Sep 7 07:27:24 JST 1997 -.\" by Ueyama Rui -.\" Updated Sun Feb 23 JST 2003 by Kentaro Shirakata +.\" This file was generated with po4a. Translate the source file. .\" -.TH BCMP 3 2008-08-06 "Linux" "Linux Programmer's Manual" +.\"******************************************************************* +.TH BCMP 3 2008\-08\-06 Linux "Linux Programmer's Manual" .SH 名前 -.\"O bcmp \- compare byte sequences bcmp \- バイト列を比較する .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int bcmp(const void *" s1 ", const void *" s2 ", size_t " n ); +\fBint bcmp(const void *\fP\fIs1\fP\fB, const void *\fP\fIs2\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi .SH 説明 -.\"O The -.\"O .BR bcmp () -.\"O function compares the two byte sequences -.\"O .I s1 -.\"O and -.\"O .I s2 -.\"O of length -.\"O .I n -.\"O each. -.\"O If they are equal, and in particular if -.\"O .I n -.\"O is zero, -.\"O .BR bcmp () -.\"O returns 0. -.\"O Otherwise it returns a nonzero result. -.BR bcmp () -は、2 つのバイト列 -.I s1 -と -.I s2 -の先頭 -.I n -バイトを -比較する。2 つが等しいか、特に -.I n -が 0 の場合 -.BR bcmp () -は 0 を返す。 -さもなければ 0 以外を返す。 +\fBbcmp\fP() は、2 つのバイト列 \fIs1\fP と \fIs2\fP の先頭 \fIn\fP バイトを 比較する。2 つが等しいか、特に \fIn\fP が 0 +の場合 \fBbcmp\fP() は 0 を返す。 さもなければ 0 以外を返す。 .SH 返り値 -.\"O The -.\"O .BR bcmp () -.\"O function returns 0 if the byte sequences are equal, -.\"O otherwise a nonzero result is returned. バイト列が等しい場合は 0 、等しくない場合は 0 以外を返す。 .SH 準拠 -4.3BSD. -.\"O This function is deprecated (marked as LEGACY in POSIX.1-2001): use -.\"O .BR memcmp (3) -.\"O in new programs. -この関数は廃止予定である (POSIX.1-2001 では -過去の名残 (LEGACY) とされている)。新しいプログラムでは -.BR memcmp (3) -を使うべきである。 -.\"O POSIX.1-2008 removes the specification of -.\"O .BR bcmp (). -POSIX.1-2008 では -.BR bcmp () -の仕様が削除されている。 +4.3BSD. この関数は廃止予定である (POSIX.1\-2001 では 過去の名残 (LEGACY) とされている)。新しいプログラムでは +\fBmemcmp\fP(3) を使うべきである。 POSIX.1\-2008 では \fBbcmp\fP() の仕様が削除されている。 .SH 関連項目 -.BR memcmp (3), -.BR strcasecmp (3), -.BR strcmp (3), -.BR strcoll (3), -.BR strncasecmp (3), -.BR strncmp (3) +\fBmemcmp\fP(3), \fBstrcasecmp\fP(3), \fBstrcmp\fP(3), \fBstrcoll\fP(3), +\fBstrncasecmp\fP(3), \fBstrncmp\fP(3) diff --git a/draft/man3/bcopy.3 b/draft/man3/bcopy.3 index 3398fce1..ed17ac8c 100644 --- a/draft/man3/bcopy.3 +++ b/draft/man3/bcopy.3 @@ -28,75 +28,27 @@ .\" Modified Sun Feb 26 14:52:00 1995 by Rik Faith .\" Modified Tue Oct 22 23:48:10 1996 by Eric S. Raymond .\" " -.\" Japanese Version Copyright (c) 1997 Ueyama Rui -.\" all rights reserved. -.\" Translated Tue Feb 21 0:45:00 JST 1997 -.\" by Ueyama Rui -.\" Updated Sun Feb 23 JST 2003 by Kentaro Shirakata +.\"******************************************************************* .\" -.TH BCOPY 3 2009-03-15 "Linux" "Linux Programmer's Manual" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH BCOPY 3 2009\-03\-15 Linux "Linux Programmer's Manual" .SH 名前 -.\"O bcopy \- copy byte sequence bcopy \- バイト列をコピーする .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "void bcopy(const void *" src ", void *" dest ", size_t " n ); +\fBvoid bcopy(const void *\fP\fIsrc\fP\fB, void *\fP\fIdest\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi .SH 説明 -.\"O The -.\"O .BR bcopy () -.\"O function copies -.\"O .I n -.\"O bytes from -.\"O .I src -.\"O to -.\"O .IR dest . -.BR bcopy () -は -.I src -から先頭 -.I n -バイトを -.I dest -にコピーする。 -.\"O The result is correct, even when both areas overlap. -領域が重なっていても、結果は正しいものである。 +\fBbcopy\fP() は \fIsrc\fP から先頭 \fIn\fP バイトを \fIdest\fP にコピーする。 領域が重なっていても、結果は正しいものである。 .SH 返り値 -.\"O None. なし。 .SH 準拠 -4.3BSD. -.\"O This function is deprecated (marked as LEGACY in POSIX.1-2001): use -.\"O .BR memcpy (3) -.\"O or -.\"O .BR memmove (3) -.\"O in new programs. -.\"O Note that the first two arguments -.\"O are interchanged for -.\"O .BR memcpy (3) -.\"O and -.\"O .BR memmove (3). -.\"O POSIX.1-2008 removes the specification of -.\"O .BR bcopy (). -この関数は廃止予定である (POSIX.1-2001 では -過去の名残 (LEGACY) とされている)。新しいプログラムでは -.BR memcpy () -や -.BR memmove () -を使用すべきである。 -.BR memcpy () -や -.BR memmove () -では、最初の 2 つの引数の順序が入れ替わっていることに注意すること。 -POSIX.1-2008 では、 -.BR bcopy () -の仕様が削除されている。 -.\"O .SH "SEE ALSO" +4.3BSD. この関数は廃止予定である (POSIX.1\-2001 では 過去の名残 (LEGACY) とされている)。新しいプログラムでは +\fBmemcpy\fP() や \fBmemmove\fP() を使用すべきである。 \fBmemcpy\fP() や \fBmemmove\fP() では、最初の +2 つの引数の順序が入れ替わっていることに注意すること。 POSIX.1\-2008 では、 \fBbcopy\fP() の仕様が削除されている。 .SH 関連項目 -.BR memccpy (3), -.BR memcpy (3), -.BR memmove (3), -.BR strcpy (3), -.BR strncpy (3) +\fBmemccpy\fP(3), \fBmemcpy\fP(3), \fBmemmove\fP(3), \fBstrcpy\fP(3), \fBstrncpy\fP(3) diff --git a/draft/man3/bindresvport.3 b/draft/man3/bindresvport.3 index c016d184..4895f3e2 100644 --- a/draft/man3/bindresvport.3 +++ b/draft/man3/bindresvport.3 @@ -24,143 +24,50 @@ .\" 2007-05-31, mtk: Rewrite and substantial additional text. .\" 2008-12-03, mtk: Rewrote some pieces and fixed some errors .\" -.\" Japanese Version Copyright (c) 1999 Shouichi Saito all rights reserved. -.\" Translated 1999-08-28, Shouichi Saito -.\" Proofed 1999-09-25, NAKANO Takeo -.\" Updated 2007-06-11, Akihiro MOTOKI , LDP v2.54 -.\" Updated 2008-12-24, Akihiro MOTOKI , LDP v3.15 +.\"******************************************************************* .\" -.TH BINDRESVPORT 3 2008-12-03 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH BINDRESVPORT 3 2008\-12\-03 "" "Linux Programmer's Manual" .SH 名前 -.\"O bindresvport \- bind a socket to a privileged IP port bindresvport \- ソケットを特権 IP ポートにバインドする -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include -.B #include +\fB#include \fP +\fB#include \fP .LP -.BI "int bindresvport(int " sockfd ", struct sockaddr_in *" sin ); +\fBint bindresvport(int \fP\fIsockfd\fP\fB, struct sockaddr_in *\fP\fIsin\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 .LP -.\"O .BR bindresvport () -.\"O is used to bind a socket descriptor to a privileged anonymous IP port, -.\"O that is, a port number arbitrarily selected from the range 512 to 1023. -.BR bindresvport () -は、ソケット・ディスクリプタを特権無名 (privileged anonymous) IP ポートに -バインドするのに使う。特権無名 IP ポートとは、 -ポート番号が 512 から 1023 の範囲から任意に選択されるポートである。 .\" Glibc actually starts searching with a port # in the range 600 to 1023 +\fBbindresvport\fP() は、ソケット・ディスクリプタを特権無名 (privileged anonymous) IP ポートに +バインドするのに使う。特権無名 IP ポートとは、 ポート番号が 512 から 1023 の範囲から任意に選択されるポートである。 -.\"O If the -.\"O .BR bind (2) -.\"O performed by -.\"O .BR bindresvport () -.\"O is successful, and -.\"O .I sin -.\"O is not NULL, then -.\"O .I sin\->sin_port -.\"O returns the port number actually allocated. -.BR bindresvport () -によって実行された -.BR bind (2) -が成功し、 -.I sin -が NULL 以外の場合、実際に割り当てられたポート番号が -.I sin\->sin_port -に入れて返される。 +\fBbindresvport\fP() によって実行された \fBbind\fP(2) が成功し、 \fIsin\fP が NULL +以外の場合、実際に割り当てられたポート番号が \fIsin\->sin_port\fP に入れて返される。 -.\"O .I sin -.\"O can be NULL, in which case -.\"O .I sin\->sin_family -.\"O is implicitly taken to be -.\"O .BR AF_INET . -.\"O However, in this case, -.\"O .BR bindresvport () -.\"O has no way to return the port number actually allocated. -.\"O (This information can later be obtained using -.\"O .BR getsockname (2).) -.I sin -には NULL を指定することもでき、その場合には -.I sin\->sin_family -は暗黙のうちに -.B AF_INET -とみなされる。 -しかし、この場合には、 -.BR bindresvport () -は実際に割り当てられたポート番号を返す手段を持たない -(割り当てられたポート番号は、後で -.BR getsockname (2) -を使って取得できる)。 -.\"O .SH RETURN VALUE +\fIsin\fP には NULL を指定することもでき、その場合には \fIsin\->sin_family\fP は暗黙のうちに \fBAF_INET\fP +とみなされる。 しかし、この場合には、 \fBbindresvport\fP() は実際に割り当てられたポート番号を返す手段を持たない +(割り当てられたポート番号は、後で \fBgetsockname\fP(2) を使って取得できる)。 .SH 返り値 -.\"O .BR bindresvport () -.\"O returns 0 on success; otherwise \-1 is returned and -.\"O .I errno -.\"O set to indicate the cause of the error. -.BR bindresvport () -は成功すると 0 を返す。それ以外の場合、\-1 を返し、 -.I errno -にエラーの原因を示す値を設定する。 -.\"O .SH ERRORS +\fBbindresvport\fP() は成功すると 0 を返す。それ以外の場合、\-1 を返し、 \fIerrno\fP にエラーの原因を示す値を設定する。 .SH エラー -.\"O .BR bindresvport () -.\"O can fail for any of the same reasons as -.\"O .BR bind (2). -.BR bindresvport () -は -.BR bind (2) -と同じ原因で失敗する可能性がある。 -.\"O In addition, the following errors may occur: -さらに、以下のエラーが発生することがある: -.TP -.BR EACCES -.\"O The caller did not have superuser privilege (to be precise: the -.\"O .B CAP_NET_BIND_SERVICE -.\"O capability is required). -呼び出し元がスーパーユーザの特権を持っていなかった (より正確に言うと、 -.B CAP_NET_BIND_SERVICE -ケーパビリティが必要である)。 -.TP -.B EADDRINUSE -.\"O All privileged ports are in use. +\fBbindresvport\fP() は \fBbind\fP(2) と同じ原因で失敗する可能性がある。 さらに、以下のエラーが発生することがある: +.TP +\fBEACCES\fP +呼び出し元がスーパーユーザの特権を持っていなかった (より正確に言うと、 \fBCAP_NET_BIND_SERVICE\fP ケーパビリティが必要である)。 +.TP +\fBEADDRINUSE\fP 全ての特権ポートが使用中である。 -.TP -.\"O .BR EAFNOSUPPORT " (" EPFNOSUPPORT " in glibc 2.7 and earlier)" -.BR EAFNOSUPPORT " (glibc 2.7 以前では " EPFNOSUPPORT ")" -.\"O .I sin -.\"O is not NULL and -.\"O .I sin->sin_family -.\"O is not -.\"O .BR AF_INET . -.I sin -が NULL 以外で、かつ -.I sin->sin_family -が -.B AF_INET -でなかった。 -.\"O .SH "CONFORMING TO" +.TP +\fBEAFNOSUPPORT\fP (glibc 2.7 以前では \fBEPFNOSUPPORT\fP) +\fIsin\fP が NULL 以外で、かつ \fIsin\->sin_family\fP が \fBAF_INET\fP でなかった。 .SH 準拠 -.\"O Not in POSIX.1-2001. -.\"O Present on the BSDs, Solaris, and many other systems. -POSIX.1-2001 にはない。 -BSD, Solaris およびその他の多くのシステムに存在する。 -.\"O .SH NOTES +POSIX.1\-2001 にはない。 BSD, Solaris およびその他の多くのシステムに存在する。 .SH 注意 -.LP -.\"O Unlike some -.\"O .BR bindresvport () -.\"O implementations, -.\"O the glibc implementation ignores any value that the caller supplies in -.\"O .IR sin\->sin_port . -.BR bindresvport () -のいくつかの実装と異なり、glibc の実装では呼び出し元が -.I sin\->sin_port +\fBbindresvport\fP() のいくつかの実装と異なり、glibc の実装では呼び出し元が \fIsin\->sin_port\fP で渡した値はどんな値であっても無視される。 -.\"O .SH SEE ALSO .SH 関連項目 -.BR bind (2), -.BR getsockname (2) +\fBbind\fP(2), \fBgetsockname\fP(2) diff --git a/draft/man3/bstring.3 b/draft/man3/bstring.3 index 5371e5b7..2f528ba5 100644 --- a/draft/man3/bstring.3 +++ b/draft/man3/bstring.3 @@ -27,84 +27,49 @@ .\" Modified 1993-04-12, David Metcalfe .\" Modified 1993-07-24, Rik Faith (faith@cs.unc.edu) .\" Modified 2002-01-20, Walter Harms +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 Ueyama Rui -.\" all rights reserved. -.\" Translated Tue Feb 21 0:46:20 JST 1997 -.\" by Ueyama Rui -.\" Updated Wed Oct 15 JST 2003 by Kentaro Shirakata +.\" This file was generated with po4a. Translate the source file. .\" -.TH BSTRING 3 2002-01-20 "" "Linux Programmer's Manual" +.\"******************************************************************* +.TH BSTRING 3 2002\-01\-20 "" "Linux Programmer's Manual" .SH 名前 bcmp, bcopy, bzero, memccpy, memchr, memcmp, memcpy, memfrob, memmem, memmove, memset \- バイト列の操作を行なう .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int bcmp(const void *" s1 ", const void *" s2 ", int " n ); +\fBint bcmp(const void *\fP\fIs1\fP\fB, const void *\fP\fIs2\fP\fB, int \fP\fIn\fP\fB);\fP .sp -.BI "void bcopy(const void *" src ", void *" dest ", int " n ); +\fBvoid bcopy(const void *\fP\fIsrc\fP\fB, void *\fP\fIdest\fP\fB, int \fP\fIn\fP\fB);\fP .sp -.BI "void bzero(void *" s ", int " n ); +\fBvoid bzero(void *\fP\fIs\fP\fB, int \fP\fIn\fP\fB);\fP .sp -.BI "void *memccpy(void *" dest ", const void *" src ", int " c ", size_t " n ); +\fBvoid *memccpy(void *\fP\fIdest\fP\fB, const void *\fP\fIsrc\fP\fB, int \fP\fIc\fP\fB, size_t \fP\fIn\fP\fB);\fP .sp -.BI "void *memchr(const void *" s ", int " c ", size_t " n ); +\fBvoid *memchr(const void *\fP\fIs\fP\fB, int \fP\fIc\fP\fB, size_t \fP\fIn\fP\fB);\fP .sp -.BI "int memcmp(const void *" s1 ", const void *" s2 ", size_t " n ); +\fBint memcmp(const void *\fP\fIs1\fP\fB, const void *\fP\fIs2\fP\fB, size_t \fP\fIn\fP\fB);\fP .sp -.BI "void *memcpy(void *" dest ", const void *" src ", size_t " n ); +\fBvoid *memcpy(void *\fP\fIdest\fP\fB, const void *\fP\fIsrc\fP\fB, size_t \fP\fIn\fP\fB);\fP .sp -.BI "void *memfrob(void *" s ", size_t " n ); +\fBvoid *memfrob(void *\fP\fIs\fP\fB, size_t \fP\fIn\fP\fB);\fP .sp -.BI "void *memmem(const void *" needle ", size_t " needlelen , -.BI " const void *" haystack ", size_t " haystacklen ); +\fBvoid *memmem(const void *\fP\fIneedle\fP\fB, size_t \fP\fIneedlelen\fP\fB,\fP +\fB const void *\fP\fIhaystack\fP\fB, size_t \fP\fIhaystacklen\fP\fB);\fP .sp -.BI "void *memmove(void *" dest ", const void *" src ", size_t " n ); +\fBvoid *memmove(void *\fP\fIdest\fP\fB, const void *\fP\fIsrc\fP\fB, size_t \fP\fIn\fP\fB);\fP .sp -.BI "void *memset(void *" s ", int " c ", size_t " n ); +\fBvoid *memset(void *\fP\fIs\fP\fB, int \fP\fIc\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi .SH 説明 -.\"O The byte string functions perform operations on strings (byte arrays) -.\"O that are not necessarily null-terminated. -.\"O See the individual man pages -.\"O for descriptions of each function. -これらの関数は NULL 終端する必要のない文字列 (バイト配列) の操作を行う。 -関数の詳しい説明は、それぞれの man ページを参照すること。 -.\"O .SH NOTES +これらの関数は NULL 終端する必要のない文字列 (バイト配列) の操作を行う。 関数の詳しい説明は、それぞれの man ページを参照すること。 .SH 注意 -.\"O The functions -.\"O .BR bcmp (), -.\"O .BR bcopy () -.\"O and -.\"O .BR bzero () -.\"O are obsolete. -.\"O Use -.\"O .BR memcmp (), -.\"O .BR memcpy () -.\"O and -.\"O .BR memset () -.\"O instead. -.BR bcmp (), -.BR bcopy (), -.BR bzero () -関数は古いものである。代わりに -.BR memcmp (), -.BR memcpy () -.BR memset () -を使うこと。 -.\"O .\" The old functions are not even available on some non-GNU/Linux systems. -.\" 古い関数は GNU/Linux 以外のシステムでは用意されていない場合すらある。 +.\" The old functions are not even available on some non-GNU/Linux systems. +\fBbcmp\fP(), \fBbcopy\fP(), \fBbzero\fP() 関数は古いものである。代わりに \fBmemcmp\fP(), \fBmemcpy\fP() +\fBmemset\fP() を使うこと。 .SH 関連項目 -.BR bcmp (3), -.BR bcopy (3), -.BR bzero (3), -.BR memccpy (3), -.BR memchr (3), -.BR memcmp (3), -.BR memcpy (3), -.BR memfrob (3), -.BR memmem (3), -.BR memmove (3), -.BR memset (3) +\fBbcmp\fP(3), \fBbcopy\fP(3), \fBbzero\fP(3), \fBmemccpy\fP(3), \fBmemchr\fP(3), +\fBmemcmp\fP(3), \fBmemcpy\fP(3), \fBmemfrob\fP(3), \fBmemmem\fP(3), \fBmemmove\fP(3), +\fBmemset\fP(3) diff --git a/draft/man3/bzero.3 b/draft/man3/bzero.3 index 8bebf306..abf1e159 100644 --- a/draft/man3/bzero.3 +++ b/draft/man3/bzero.3 @@ -26,63 +26,27 @@ .\" 386BSD man pages .\" Modified Sat Jul 24 21:28:17 1993 by Rik Faith .\" Modified Tue Oct 22 23:49:37 1996 by Eric S. Raymond +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 Ueyama Rui -.\" all rights reserved. -.\" Translated Tue Feb 21 0:47:30 JST 1997 -.\" by Ueyama Rui -.\" Modified Wed 23 Aug 2000 by NAKANO Takeo -.\" Modified Thu 6 Mar 2003 by Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.TH BZERO 3 2008-08-06 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O bzero \- write zero-valued bytes +.\"******************************************************************* +.TH BZERO 3 2008\-08\-06 Linux "Linux Programmer's Manual" .SH 名前 bzero \- 値 0 のバイトで埋める -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "void bzero(void *" s ", size_t " n ); +\fBvoid bzero(void *\fP\fIs\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR bzero () -.\"O function sets the first -.\"O .I n -.\"O bytes of the area starting at -.\"O .I s -.\"O to zero (bytes containing \(aq\\0\(aq). -.BR bzero () -関数は -バイト列 -.I s -から始まる領域の先頭 -.I n -バイトを -数値ゼロ (値が \(aq\\0\(aq のバイト) で埋める。 -.\"O .SH "RETURN VALUE" +\fBbzero\fP() 関数は バイト列 \fIs\fP から始まる領域の先頭 \fIn\fP バイトを 数値ゼロ (値が \(aq\e0\(aq のバイト) +で埋める。 .SH 返り値 -.\"O None. なし。 -.\"O .SH "CONFORMING TO" .SH 準拠 -4.3BSD. -.\"O This function is deprecated (marked as LEGACY in POSIX.1-2001): use -.\"O .BR memset (3) -.\"O in new programs. -この関数は廃止予定である (POSIX.1-2001 では -過去の名残 (LEGACY) とされている)。新しいプログラムでは -.BR memset (3) -を使用すべきである。 -.\"O POSIX.1-2008 removes the specification of -.\"O .BR bzero (). -POSIX.1-2008 では -.BR bzero () -の仕様が削除されている。 -.\"O .SH "SEE ALSO" +4.3BSD. この関数は廃止予定である (POSIX.1\-2001 では 過去の名残 (LEGACY) とされている)。新しいプログラムでは +\fBmemset\fP(3) を使用すべきである。 POSIX.1\-2008 では \fBbzero\fP() の仕様が削除されている。 .SH 関連項目 -.BR memset (3), -.BR swab (3) +\fBmemset\fP(3), \fBswab\fP(3) diff --git a/draft/man3/canonicalize_file_name.3 b/draft/man3/canonicalize_file_name.3 index 6515889c..0e89b0d4 100644 --- a/draft/man3/canonicalize_file_name.3 +++ b/draft/man3/canonicalize_file_name.3 @@ -2,36 +2,23 @@ .\" and Copyright 2005 Michael Kerrisk (mtk.manpages@gmail.com). .\" Distributed under the GNU General Public License. .\" -.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved. -.\" Translated 2005-09-06, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH CANONICALIZE_FILE_NAME 3 2005-07-14 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH CANONICALIZE_FILE_NAME 3 2005\-07\-14 GNU "Linux Programmer's Manual" .SH 名前 -.\"O canonicalize_file_name \- return the canonicalized filename canonicalize_file_name \- 正規化されたファイル名を返す -.\"O .SH SYNOPSIS .SH 書式 -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ .br -.B #include +\fB#include \fP .sp -.BI "char *canonicalize_file_name(const char *" path ");" -.\"O .SH DESCRIPTION +\fBchar *canonicalize_file_name(const char *\fP\fIpath\fP\fB);\fP .SH 説明 -.\"O The call -.\"O .I canonicalize_file_name(path) -.\"O is equivalent to the call -.\"O .IR "realpath(path,\ NULL)" . -.I canonicalize_file_name(path) -は -.I "realpath(path,\ NULL)" -と等価である。 -.\"O .SH "CONFORMING TO" +\fIcanonicalize_file_name(path)\fP は \fIrealpath(path,\ NULL)\fP と等価である。 .SH 準拠 -.\"O The function is a GNU extension. この関数は GNU による拡張である。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR realpath (3) +\fBrealpath\fP(3) diff --git a/draft/man3/cbrt.3 b/draft/man3/cbrt.3 index a21cd87f..d587efa0 100644 --- a/draft/man3/cbrt.3 +++ b/draft/man3/cbrt.3 @@ -25,108 +25,59 @@ .\" Modified 2002-07-27 Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi -.\" all rights reserved. -.\" Translated Mon Jan 20 17:29:27 JST 1997 -.\" by YOSHINO Takashi Yoshino -.\" Updated & Modified Fri Jul 25 22:03:54 JST 2003 -.\" by Akihiro MOTOKI -.\" Updated 2008-09-15, Akihiro MOTOKI +.\"******************************************************************* .\" -.\" WORD: cube root 立方根 -.\" WORD: GNU extension GNU による拡張 +.\" This file was generated with po4a. Translate the source file. .\" -.TH CBRT 3 2010-09-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O cbrt, cbrtf, cbrtl \- cube root function +.\"******************************************************************* +.TH CBRT 3 2010\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 cbrt, cbrtf, cbrtl \- 立方根を計算する関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double cbrt(double " x ); +\fBdouble cbrt(double \fP\fIx\fP\fB);\fP .br -.BI "float cbrtf(float " x ); +\fBfloat cbrtf(float \fP\fIx\fP\fB);\fP .br -.BI "long double cbrtl(long double " x ); +\fBlong double cbrtl(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR cbrt (): +\fBcbrt\fP(): .br .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE -.BR cbrtf (), -.BR cbrtl (): +\fBcbrtf\fP(), \fBcbrtl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOUCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOUCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 -.RS +or \fIcc\ \-std=c99\fP +.RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR cbrt () -.\"O function returns the (real) cube root of \fIx\fP. -.\"O This function cannot fail; every representable real value has a -.\"O representable real cube root. -.BR cbrt () -関数は \fIx\fP の (実数)立方根を返す。 -この関数が失敗することはない。なぜなら、 -すべての内部表現可能な (representable) 実数は -必ず内部表現可能な立方根を持つためである。 -.\"O .SH RETURN VALUE +\fBcbrt\fP() 関数は \fIx\fP の (実数)立方根を返す。 この関数が失敗することはない。なぜなら、 すべての内部表現可能な +(representable) 実数は 必ず内部表現可能な立方根を持つためである。 .SH 返り値 -.\"O These functions return the cube root of -.\"O .IR x . -これらの関数は -.I x -の立方根を返す。 +これらの関数は \fIx\fP の立方根を返す。 -.\"O If -.\"O .I x -.\"O is +0, \-0, positive infinity, negative infinity, or NaN, -.\"O .I x -.\"O is returned. -.I x -が +0、\-0、正の無限大、負の無限大、NaN のいずれかの場合、 -.I x -が返される。 -.\"O .SH ERRORS +\fIx\fP が +0、\-0、正の無限大、負の無限大、NaN のいずれかの場合、 \fIx\fP が返される。 .SH エラー -.\"O No errors occur. エラーは発生しない。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O .\" .BR cbrt () -.\"O .\" was a GNU extension. It is now a C99 requirement. .\" .BR cbrt () -.\" は以前は GNU による拡張であった。 -.\" 現在は C99 で必須の関数である。 -.\"O .SH "SEE ALSO" +.\" was a GNU extension. It is now a C99 requirement. +C99, POSIX.1\-2001. .SH 関連項目 -.BR pow (3), -.BR sqrt (3) +\fBpow\fP(3), \fBsqrt\fP(3) diff --git a/draft/man3/ceil.3 b/draft/man3/ceil.3 index c4ed0554..1059865b 100644 --- a/draft/man3/ceil.3 +++ b/draft/man3/ceil.3 @@ -22,155 +22,63 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 1997 Ueyama Rui -.\" all rights reserved. -.\" Translated Tue Feb 21 0:47:30 JST 1997 -.\" by Ueyama Rui -.\" Updated & Modified Fri Jul 6 20:35:28 JST 2001 -.\" by Yuichi SATO -.\" Updated & Modified Sun Jan 9 23:39:35 JST 2005 -.\" by Yuichi SATO -.\" Updated 2008-09-15, Akihiro MOTOKI +.\"******************************************************************* .\" -.\"WORD: mantissa 仮数 +.\" This file was generated with po4a. Translate the source file. .\" -.TH CEIL 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH CEIL 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O ceil, ceilf, ceill \- ceiling function: smallest integral value not -.\"O less than argument ceil, ceilf, ceill \- 引き数を下回らない最小の整数値 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double ceil(double " x ); +\fBdouble ceil(double \fP\fIx\fP\fB);\fP .br -.BI "float ceilf(float " x ); +\fBfloat ceilf(float \fP\fIx\fP\fB);\fP .br -.BI "long double ceill(long double " x ); +\fBlong double ceill(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR ceilf (), -.BR ceill (): +\fBceilf\fP(), \fBceill\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O These functions return the smallest integral value that is not less than -.\"O .IR x . これらの関数は \fIx\fP より小さくない最小の整数値を返す。 -.\"O For example, -.\"O .IR ceil(0.5) -.\"O is 1.0, and -.\"O .IR ceil(\-0.5) -.\"O is 0.0. -例えば、 -.I ceil(0.5) -は 1.0 であり、 -.I ceil(\-0.5) -は 0.0 である。 -.\"O .SH "RETURN VALUE" +例えば、 \fIceil(0.5)\fP は 1.0 であり、 \fIceil(\-0.5)\fP は 0.0 である。 .SH 返り値 -.\"O These functions return the ceiling of -.\"O .IR x . -これらの関数は -.I x -を下回らない整数値を返す。 +これらの関数は \fIx\fP を下回らない整数値を返す。 -.\"O If \fIx\fP is integral, +0, \-0, NaN, or infinite, -.\"O \fIx\fP itself is returned. -\fIx\fP が整数、+0、\-0、NaN、無限のいずれかの場合、 -\fIx\fP そのものを返す。 -.\"O .SH ERRORS +\fIx\fP が整数、+0、\-0、NaN、無限のいずれかの場合、 \fIx\fP そのものが返される。 .SH エラー -.\"O No errors occur. -エラーは発生しない。 -.\"O POSIX.1-2001 documents a range error for overflows, but see NOTES. -POSIX.1-2001 にはオーバーフローに対して範囲エラーが記載されている。 -「注意」の節を参照。 -.\"O .SH "CONFORMING TO" +エラーは発生しない。 POSIX.1\-2001 にはオーバーフローでの範囲エラー (range error) の 記載がある。「注意」の節を参照のこと。 .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 -.\"O .SH NOTES +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH 注意 -.\"O SUSv2 and POSIX.1-2001 contain text about overflow (which might set -.\"O .I errno -.\"O to -.\"O .BR ERANGE , -.\"O or raise an -.\"O .B FE_OVERFLOW -.\"O exception). -SUSv2 と POSIX.1-2001 にはオーバーフローに関する記述があり、 -オーバーフローの際には -.I errno -を -.B ERANGE -に設定するか -.B FE_OVERFLOW -例外を起こすとなっている。 -.\"O In practice, the result cannot overflow on any current machine, -.\"O so this error-handling stuff is just nonsense. -実際のところ、どの現行のマシンでも結果がオーバーフローを起こすことは -ないので、このエラー処理は意味がない。 .\" The POSIX.1-2001 APPLICATION USAGE SECTION discusses this point. -.\"O (More precisely, overflow can happen only when the maximum value -.\"O of the exponent is smaller than the number of mantissa bits. -.\"O For the IEEE-754 standard 32-bit and 64-bit floating-point numbers -.\"O the maximum value of the exponent is 128 (respectively, 1024), -.\"O and the number of mantissa bits is 24 (respectively, 53).) -(より正確に言うと、オーバーフローは指数部の最大値が -仮数部を表すビットの数より小さい場合にしか起こらない。 -IEEE-754 規格の 32 ビットと 64 ビットの浮動小数では、 -指数部の最大値はそれぞれ 128 と 1024 であり、 -仮数部のビット数はそれぞれ 24 と 53 である。) +SUSv2 と POSIX.1\-2001 にはオーバーフローに関する記述があり、 オーバーフローの場合には、 \fIerrno\fP を \fBERANGE\fP +に設定するか、 \fBFE_OVERFLOW\fP 例外を発生することとされている。 +実際のところ、どの現行のマシンでも結果がオーバーフローを起こすことはないので、 このエラー処理は意味がない。 +(より正確に言うと、オーバーフローは指数部の最大値が 仮数部を表すビットの数より小さい場合にしか起こらない。 IEEE\-754 規格の 32 ビットと +64 ビットの浮動小数では、 指数部の最大値はそれぞれ 128 と 1024 であり、 仮数部のビット数はそれぞれ 24 と 53 である。) -.\"O The integral value returned by these functions may be too large -.\"O to store in an integer type -.\"O .RI ( int , -.\"O .IR long , -.\"O etc.). -.\"O To avoid an overflow, which will produce undefined results, -.\"O an application should perform a range check on the returned value -.\"O before assigning it to an integer type. -これらの関数が返す整数値は整数型 -.RI ( int , -.I long -など) に格納するには大き過ぎるかもしれない。 -オーバーフローが起こった場合の結果は分からないので、 -オーバーフローを避けるため、アプリケーションでは整数型に代入する前に +これらの関数が返す整数値は整数型 (\fIint\fP, \fIlong\fP など) に格納するには大き過ぎるかもしれない。 +オーバーフローが起こった場合の結果は分からないので、 オーバーフローを避けるため、アプリケーションでは整数型に代入する前に 返された値の範囲確認を実行すべきである。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR floor (3), -.BR lrint (3), -.BR nearbyint (3), -.BR rint (3), -.BR round (3), -.BR trunc (3) +\fBfloor\fP(3), \fBlrint\fP(3), \fBnearbyint\fP(3), \fBrint\fP(3), \fBround\fP(3), +\fBtrunc\fP(3) diff --git a/draft/man3/cfree.3 b/draft/man3/cfree.3 index 4fbd7cdc..43cb4593 100644 --- a/draft/man3/cfree.3 +++ b/draft/man3/cfree.3 @@ -20,175 +20,67 @@ .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, .\" USA. .\" -.\" Japanese Version Copyright (c) 2004 Yuichi SATO -.\" all rights reserved. -.\" Translated Mon Jul 19 04:38:03 JST 2004 -.\" by Yuichi SATO +.\"******************************************************************* .\" -.TH CFREE 3 2007-07-26 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH CFREE 3 2007\-07\-26 "" "Linux Programmer's Manual" .SH 名前 -.\"O cfree \- free allocated memory cfree \- 割り当てられたメモリを解放する -.\"O .SH SYNOPSIS .SH 書式 .nf .sp -.B "#include " +\fB#include \fP .sp -.\"O /* In SunOS 4 */ /* SunOS 4 では */ -.BI "int cfree(void *" ptr ); +\fBint cfree(void *\fP\fIptr\fP\fB);\fP .sp -.\"O /* In glibc or FreeBSD libcompat */ /* glibc と FreeBSD libcompat では */ -.BI "void cfree(void *" ptr ); +\fBvoid cfree(void *\fP\fIptr\fP\fB);\fP .sp -.\"O /* In SCO OpenServer */ /* SCO OpenServer では */ -.BI "void cfree(char *" ptr ", unsigned " num ", unsigned " size ); +\fBvoid cfree(char *\fP\fIptr\fP\fB, unsigned \fP\fInum\fP\fB, unsigned \fP\fIsize\fP\fB);\fP .sp -.\"O /* In Solaris watchmalloc.so.1 */ /* Solaris watchmalloc.so.1 では */ -.BI "void cfree(void *" ptr ", size_t " nelem ", size_t " elsize ); +\fBvoid cfree(void *\fP\fIptr\fP\fB, size_t \fP\fInelem\fP\fB, size_t \fP\fIelsize\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR cfree (): -_BSD_SOURCE || _SVID_SOURCE -.\"O .SH DESCRIPTION +\fBcfree\fP(): _BSD_SOURCE || _SVID_SOURCE .SH 説明 -.\"O This function should never be used. -.\"O Use -.\"O .BR free (3) -.\"O instead. -この関数は決して使用すべきではない。 -代わりに -.BR free (3) -を使うこと。 -.\"O .SS "1-arg cfree" +この関数は決して使用すべきではない。 代わりに \fBfree\fP(3) を使うこと。 .SS "引き数が 1 つの cfree" -.\"O In glibc, the function -.\"O .BR cfree () -.\"O is a synonym for -.\"O .BR free (3), -.\"O "added for compatibility with SunOS". -glibc では、関数 -.BR cfree () -は -.BR free (3) -の別名であり、「SunOS との互換性のために追加された」。 +glibc では、関数 \fBcfree\fP() は \fBfree\fP(3) の別名であり、「SunOS との互換性のために追加された」。 .LP -.\"O Other systems have other functions with this name. -他のシステムでは、この名前の別の関数がある。 -.\"O The declaration is sometimes in -.\"O .I -.\"O and sometimes in -.\"O .IR . -この宣言は -.I -に存在する場合もあるし、 -.I -に存在する場合もある。 -.\"O .SS "3-arg cfree" +他のシステムでは、この名前の別の関数がある。 この宣言は \fI\fP に存在する場合もあるし、 +\fI\fP に存在する場合もある。 .SS "引き数が 3 つの cfree" -.\"O Some SCO and Solaris versions have malloc libraries with a 3-argument -.\"O .BR cfree (), -.\"O apparently as an analog to -.\"O .BR calloc (3). -SCO と Solaris のいくつかのバージョンでは、 -引き数が 3 つの -.BR cfree () -が含まれる malloc ライブラリがある。 -これは明らかに -.BR calloc (3) -に類似している。 +SCO と Solaris のいくつかのバージョンでは、 引き数が 3 つの \fBcfree\fP() が含まれる malloc ライブラリがある。 +これは明らかに \fBcalloc\fP(3) に類似している。 .LP -.\"O If you need it while porting something, add 何かを移植する時にこの関数が必要な場合、 .sp .in +4n #define cfree(p, n, s) free((p)) .in .sp -.\"O to your file. をファイルに追加すること。 .LP -.\"O A frequently asked question is "Can I use -.\"O .BR free (3) -.\"O to free memory allocated with -.\"O .BR calloc (3), -.\"O or do I need -.\"O .BR cfree ()?" -よく尋ねられる質問は -.RB 「 calloc (3) -で割り当てられたメモリを解放するのに -.BR free (3) -を使うことができるか、 -それとも -.BR cfree () -を使う必要があるか」というものである。 -答え: -.BR free (3) -を使うこと。 +よく尋ねられる質問は 「\fBcalloc\fP(3) で割り当てられたメモリを解放するのに \fBfree\fP(3) を使うことができるか、 それとも +\fBcfree\fP() を使う必要があるか」というものである。 答え: \fBfree\fP(3) を使うこと。 .LP -.\"O An SCO manual writes: "The cfree routine is provided for compliance -.\"O to the iBCSe2 standard and simply calls free. -.\"O The num and size -.\"O arguments to cfree are not used." -SCO のマニュアルには以下のように記述されている: -「cfree ルーチンは iBCSe2 規格に従うために提供されており、 -単に free を呼んでいるだけである。 -cfree の num と size 引き数は使用されない。」 -.\"O .SH "RETURN VALUE" +SCO のマニュアルには以下のように記述されている: 「cfree ルーチンは iBCSe2 規格に従うために提供されており、 単に free +を呼んでいるだけである。 cfree の num と size 引き数は使用されない。」 .SH 返り値 -.\"O The SunOS version of -.\"O .BR cfree () -.\"O (which is a synonym for -.\"O .BR free (3)) -.\"O returns 1 on success and 0 on failure. -SunOS 版の -.BR cfree () -.RB ( free (3) -の別名) は、成功した場合に 1 を返し、失敗した場合に 0 を返す。 -.\"O In case of error, -.\"O .I errno -.\"O is set to -.\"O .BR EINVAL : -.\"O the value of -.\"O .I ptr -.\"O was not a pointer to a block previously allocated by -.\"O one of the routines in the -.\"O .BR malloc () -.\"O family. -エラーの場合、 -.I errno -が -.B EINVAL -に設定される: -.I ptr -の値が -.BR malloc () -系のルーチンの 1 つで以前に割り当てられた -ブロックへのポインタでない。 -.\"O .SH "CONFORMING TO" +SunOS 版の \fBcfree\fP() (\fBfree\fP(3) の別名) は、成功した場合に 1 を返し、失敗した場合に 0 を返す。 +エラーの場合、 \fIerrno\fP が \fBEINVAL\fP に設定される: \fIptr\fP の値が \fBmalloc\fP() 系のルーチンの 1 +つで以前に割り当てられた ブロックへのポインタでない。 .SH 準拠 -.\"O The 3-argument version of -.\"O .BR cfree () -.\"O as used by SCO conforms to the iBCSe2 standard: -.\"O Intel386 Binary Compatibility Specification, Edition 2. -SCO で用いられている引き数が 3 つの -.BR cfree () -は、iBCSe2 規格: -Intel386 Binary Compatibility Specification, Edition 2 -(Intel386 バイナリ互換仕様、第 2 版) に準拠する。 -.\"O .SH SEE ALSO +SCO で用いられている引き数が 3 つの \fBcfree\fP() は、iBCSe2 規格: Intel386 Binary Compatibility +Specification, Edition 2 (Intel386 バイナリ互換仕様、第 2 版) に準拠する。 .SH 関連項目 -.BR malloc (3) +\fBmalloc\fP(3) diff --git a/draft/man3/clearenv.3 b/draft/man3/clearenv.3 index 53431d25..95852f52 100644 --- a/draft/man3/clearenv.3 +++ b/draft/man3/clearenv.3 @@ -21,138 +21,51 @@ .\" the source, must acknowledge the copyright and authors of this work. .\" .\" Additions, aeb, 2001-10-17. +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 2001-2002 Yuichi SATO -.\" all rights reserved. -.\" Translated Sun Nov 4 22:46:03 JST 2001 -.\" by Yuichi SATO -.\" Updated & Modifined Mon Jul 15 02:10:29 JST 2002 by Yuichi SATO +.\" This file was generated with po4a. Translate the source file. .\" -.TH CLEARENV 3 2010-10-04 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH CLEARENV 3 2010\-10\-04 Linux "Linux Programmer's Manual" .SH 名前 -.\"O clearenv \- clear the environment clearenv \- 環境 (environment) をクリアする -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.B "int clearenv(void);" +\fBint clearenv(void);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR clearenv (): -_SVID_SOURCE || _BSD_SOURCE -.\"O .SH DESCRIPTION +\fBclearenv\fP(): _SVID_SOURCE || _BSD_SOURCE .SH 説明 -.\"O The -.\"O .BR clearenv () -.\"O function clears the environment of all name-value -.\"O pairs and sets the value of the external variable -.\"O .I environ -.\"O to NULL. -.BR clearenv () -関数は、名前と値が組になった全ての環境をクリアする。 -さらに外部変数 -.I environ -の値を NULL にする。 -.\"O .SH "RETURN VALUE" +\fBclearenv\fP() 関数は、名前と値が組になった全ての環境をクリアする。 さらに外部変数 \fIenviron\fP の値を NULL にする。 .SH 返り値 -.\"O The -.\"O .BR clearenv () -.\"O function returns zero on success, and a nonzero -.\"O value on failure. -.BR clearenv () -関数は、成功した場合は 0 を返し、 -失敗した場合は 0 以外を返す。 -.\"O .\" Most versions of UNIX return -1 on error, or do not even have errors. -.\"O .\" Glibc info and the Watcom C library document "a nonzero value". -.\" UNIX ç³» OS の多くは、エラーの場合に \-1 を返す。 -.\" もしくはエラーの場合でも何も返さない。 -.\" glibc の info と Watcom C ライブラリには、 -.\" 「0 以外の値 (を返す)」と記述されている。 -.\"O .SH VERSIONS +.\" Most versions of UNIX return -1 on error, or do not even have errors. +.\" Glibc info and the Watcom C library document "a nonzero value". +\fBclearenv\fP() 関数は、成功した場合は 0 を返し、 失敗した場合は 0 以外を返す。 .SH バージョン -.\"O Not in libc4, libc5. -.\"O In glibc since glibc 2.0. -libc4, libc5 では使用できない。 -glibc 2.0 以降の glibc で使用できる。 -.\"O .SH "CONFORMING TO" +libc4, libc5 では使用できない。 glibc 2.0 以降の glibc で使用できる。 .SH 準拠 -.\"O Various UNIX variants (DG/UX, HP-UX, QNX, ...). -.\"O POSIX.9 (bindings for FORTRAN77). -.\"O POSIX.1-1996 did not accept -.\"O .BR clearenv () -.\"O and -.\"O .BR putenv (3), -.\"O but changed its mind and scheduled these functions for some -.\"O later issue of this standard (cf. B.4.6.1). -.\"O However, POSIX.1-2001 -.\"O only adds \fBputenv\fP(3), and rejected -.\"O .BR clearenv (). -(DG/UX, HP-UX, QNX, などの) 多くの UNIX ç³» OS。 -(FORTRAN77 へのバインディングである) POSIX.9。 -POSIX.1-1996 では -.BR clearenv () -と -.BR putenv (3) -は採用されなかったが、 -方針が変更され、この標準規格の以降の号 (B.4.6.1 を参照) では -採用されることになった。 -しかし POSIX.1-2001 では -.BR putenv (3) -しか追加されず、 -.BR clearenv () -の追加は否決された。 -.\"O .SH NOTES +(DG/UX, HP\-UX, QNX, などの) 多くの UNIX ç³» OS。 (FORTRAN77 へのバインディングである) POSIX.9。 +POSIX.1\-1996 では \fBclearenv\fP() と \fBputenv\fP(3) は採用されなかったが、 +方針が変更され、この標準規格の以降の号 (B.4.6.1 を参照) では 採用されることになった。 しかし POSIX.1\-2001 では +\fBputenv\fP(3) しか追加されず、 \fBclearenv\fP() の追加は否決された。 .SH 注意 -.\"O Used in security-conscious applications. -.\"O If it is unavailable -.\"O the assignment -この関数はセキュリティに考慮したアプリケーションで使われる。 -この関数が使用できない場合は、 +この関数はセキュリティに考慮したアプリケーションで使われる。 この関数が使用できない場合は、 .nf environ = NULL; .fi -.\"O will probably do. というように変数 environ を設定すればよい。 .LP -.\"O The DG/UX and Tru64 man pages write: If -.\"O .I environ -.\"O has been modified by anything other than the -.\"O .BR putenv (3), -.\"O .BR getenv (3), -.\"O or -.\"O .BR clearenv () -.\"O functions, then -.\"O .BR clearenv () -.\"O will return an error and the process environment will remain unchanged. -DG/UX と Tru64 man ページには次のように記されている: -.I environ -が -.BR putenv (3), -.BR getenv (3), -.BR clearenv () -関数以外で変更された場合、 -.BR clearenv () -はエラーを返し、プロセス環境は変更前のままにされる。 .\" .LP -.\"O .\" HP-UX has a ENOMEM error return. -.\" HP-UX には ENOMEM エラーがある。 -.\"O .SH "SEE ALSO" +.\" HP-UX has a ENOMEM error return. +DG/UX と Tru64 man ページには次のように記されている: \fIenviron\fP が \fBputenv\fP(3), \fBgetenv\fP(3), +\fBclearenv\fP() 関数以外で変更された場合、 \fBclearenv\fP() はエラーを返し、プロセス環境は変更前のままにされる。 .SH 関連項目 -.BR getenv (3), -.BR putenv (3), -.BR setenv (3), -.BR unsetenv (3), -.BR environ (7) +\fBgetenv\fP(3), \fBputenv\fP(3), \fBsetenv\fP(3), \fBunsetenv\fP(3), \fBenviron\fP(7) diff --git a/draft/man3/clock.3 b/draft/man3/clock.3 index 4da83472..b52ea0cb 100644 --- a/draft/man3/clock.3 +++ b/draft/man3/clock.3 @@ -24,120 +24,41 @@ .\" Modified 14 Jun 2002, Michael Kerrisk .\" Added notes on differences from other UNIX systems with respect to .\" waited-for children. +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1996 Hiroaki Nagoya -.\" all rights reserved. -.\" Translated Mon Feb 3 15:35:19 JST 1997 -.\" by Hiroaki Nagoya -.\" Updated Fri Sep 27 JST 2002 by Kentaro Shirakata -.\" Updated 2007-05-28, Akihiro MOTOKI , LDP v2.48 +.\" This file was generated with po4a. Translate the source file. .\" -.\"WORD: processor time プロセッサ時間 -.\"WORD: CPU time CPU時間 -.\" -.TH CLOCK 3 2008-08-28 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH CLOCK 3 2008\-08\-28 GNU "Linux Programmer's Manual" .SH 名前 -.\"O clock \- Determine processor time clock \- プロセッサ時間の取得 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.B clock_t clock(void); +\fBclock_t clock(void);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR clock () -.\"O function returns an approximation of processor time used by the program. -.BR clock () -はプログラムの使用したプロセッサ時間の近似値を返す。 -.\"O .SH "RETURN VALUE" +\fBclock\fP() はプログラムの使用したプロセッサ時間の近似値を返す。 .SH 返り値 -.\"O The value returned is the CPU time used so far as a -.\"O .IR clock_t ; -.\"O to get the number of seconds used, divide by -.\"O .BR CLOCKS_PER_SEC . -.\"O If the processor time used is not available or its value cannot -.\"O be represented, the function returns the value -.\"O .IR (clock_t)\ \-1 . -返り値は -.I clock_t -単位での CPU 時間である。 -秒単位での値を得るためには -.B CLOCKS_PER_SEC -で割ればよい。 -使用したプロセッサ時間が得られない場合や、その値を表現できない場合、 -この関数は -.I (clock_t)\ \-1 -を返す。 -.\"O .SH "CONFORMING TO" +返り値は \fIclock_t\fP 単位での CPU 時間である。 秒単位での値を得るためには \fBCLOCKS_PER_SEC\fP で割ればよい。 +使用したプロセッサ時間が得られない場合や、その値を表現できない場合、 この関数は \fI(clock_t)\ \-1\fP を返す。 .SH 準拠 -.\"O C89, C99, POSIX.1-2001. -.\"O POSIX requires that -.\"O .B CLOCKS_PER_SEC -.\"O equals 1000000 independent -.\"O of the actual resolution. -C89, C99, POSIX.1-2001. -POSIX は実際の精度にはよらず -.B CLOCKS_PER_SEC -が 1000000 であることを要求している。 -.\"O .SH NOTES +C89, C99, POSIX.1\-2001. POSIX は実際の精度にはよらず \fBCLOCKS_PER_SEC\fP が 1000000 +であることを要求している。 .SH 注意 -.\"O The C standard allows for arbitrary values at the start of the program; -.\"O subtract the value returned from a call to -.\"O .BR clock () -.\"O at the start of the program to get maximum portability. -C の標準規格ではプログラムの開始の時点ではどんな値が返ってきても -かまわない。 -移植性を最大限確保するためには、プログラムの開始時に -.BR clock () -を呼び出してその値を差し引くこと。 +C の標準規格ではプログラムの開始の時点ではどんな値が返ってきても かまわない。 移植性を最大限確保するためには、プログラムの開始時に +\fBclock\fP() を呼び出してその値を差し引くこと。 .PP -.\"O Note that the time can wrap around. -.\"O On a 32-bit system where -.\"O .B CLOCKS_PER_SEC -.\"O equals 1000000 this function will return the same -.\"O value approximately every 72 minutes. -時刻は桁あふれする可能性がある点に注意すること。 -.B CLOCKS_PER_SEC -が 1000000 である 32 ビットシステムでは、 +時刻は桁あふれする可能性がある点に注意すること。 \fBCLOCKS_PER_SEC\fP が 1000000 である 32 ビットシステムでは、 この関数は約 72 分毎に同じ値を返すことになる。 .PP -.\"O On several other implementations, -.\"O the value returned by -.\"O .BR clock () -.\"O also includes the times of any children whose status has been -.\"O collected via -.\"O .BR wait (2) -.\"O (or another wait-type call). -実装によっては、 -.BR clock () -で返される値に -.BR wait (2) -(あるいはその他の wait のような関数) で収集された -子プロセスの時間が含まれる場合もある。 -.\"O Linux does not include the times of waited-for children in the -.\"O value returned by -.\"O .BR clock (). -Linux では、 -.BR clock () -が返す値には wait された子プロセスの時間は含まれない。 .\" I have seen this behavior on Irix 6.3, and the OSF/1, HP/UX, and .\" Solaris manual pages say that clock() also does this on those systems. .\" POSIX.1-2001 doesn't explicitly allow this, nor is there an .\" explicit prohibition. -- MTK -.\"O The -.\"O .BR times (2) -.\"O function, which explicitly returns (separate) information about the -.\"O caller and its children, may be preferable. -.BR times (2) -関数は呼び出し元とその子プロセスに関する情報を -(別々に) 明示的に返すので、より好ましいだろう。 -.\"O .SH "SEE ALSO" +実装によっては、 \fBclock\fP() で返される値に \fBwait\fP(2) (あるいはその他の wait のような関数) で収集された +子プロセスの時間が含まれる場合もある。 Linux では、 \fBclock\fP() が返す値には wait された子プロセスの時間は含まれない。 +\fBtimes\fP(2) 関数は呼び出し元とその子プロセスに関する情報を (別々に) 明示的に返すので、より好ましいだろう。 .SH 関連項目 -.BR clock_gettime (2), -.BR getrusage (2), -.BR times (2) +\fBclock_gettime\fP(2), \fBgetrusage\fP(2), \fBtimes\fP(2) diff --git a/draft/man3/clock_getcpuclockid.3 b/draft/man3/clock_getcpuclockid.3 new file mode 100644 index 00000000..ab6ef0fd --- /dev/null +++ b/draft/man3/clock_getcpuclockid.3 @@ -0,0 +1,130 @@ +.\" Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH CLOCK_GETCPUCLOCKID 3 2010\-09\-10 Linux "Linux Programmer's Manual" +.SH 名前 +clock_getcpuclockid \- obtain ID of a process CPU\-time clock +.SH 書式 +\fB#include \fP +.nf +.sp +\fBint clock_getcpuclockid(pid_t \fP\fIpid\fP\fB, clockid_t *\fP\fIclock_id\fP\fB);\fP +.fi +.sp +\fI\-lrt\fP でリンクする。 +.sp +.ad l +.in -4n +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.in +.sp +\fBclock_getcpuclockid\fP(): +.RS 4 +_XOPEN_SOURCE\ >=\ 600 || _POSIX_C_SOURCE\ >=\ 200112L +.RE +.ad +.SH 説明 +The \fBclock_getcpuclockid\fP() function obtains the ID of the CPU\-time clock +of the process whose ID is \fIpid\fP, and returns it in the location pointed to +by \fIclock_id\fP. If \fIpid\fP is zero, then the clock ID of the CPU\-time clock +of the calling process is returned. +.SH 返り値 +On success, \fBclock_getcpuclockid\fP() returns 0; on error, it returns one of +the positive error numbers listed in ERRORS. +.SH エラー +.TP +\fBENOSYS\fP +The kernel does not support obtaining the per\-process CPU\-time clock of +another process, and \fIpid\fP does not specify the calling process. +.TP +\fBEPERM\fP +The caller does not have permission to access the CPU\-time clock of the +process specified by \fIpid\fP. (Specified as an optional error in +POSIX.1\-2001; does not occur on Linux unless the kernel does not support +obtaining the per\-process CPU\-time clock of another process.) +.TP +\fBESRCH\fP +There is no process with the ID \fIpid\fP. +.SH バージョン +The \fBclock_getcpuclockid\fP() function is available in glibc since version +2.2. +.SH 準拠 +POSIX.1\-2001. +.SH 注意 +Calling \fBclock_gettime\fP(2) with the clock ID obtained by a call to +\fBclock_getcpuclockid\fP() with a \fIpid\fP of 0, is the same as using the clock +ID \fBCLOCK_PROCESS_CPUTIME_ID\fP. +.SH 例 +The example program below obtains the CPU\-time clock ID of the process whose +ID is given on the command line, and then uses \fBclock_gettime\fP(2) to +obtain the time on that clock. An example run is the following: +.in +4n +.nf + +$\fB ./a.out 1\fP # Show CPU clock of init process +CPU\-time clock for PID 1 is 2.213466748 seconds +.fi +.in +.SS プログラムのソース +\& +.nf +#define _XOPEN_SOURCE 600 +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + clockid_t clockid; + struct timespec ts; + + if (argc != 2) { + fprintf(stderr, "%s \en", argv[0]); + exit(EXIT_FAILURE); + } + + if (clock_getcpuclockid(atoi(argv[1]), &clockid) != 0) { + perror("clock_getcpuclockid"); + exit(EXIT_FAILURE); + } + + if (clock_gettime(clockid, &ts) == \-1) { + perror("clock_gettime"); + exit(EXIT_FAILURE); + } + + printf("CPU\-time clock for PID %s is %ld.%09ld seconds\en", + argv[1], (long) ts.tv_sec, (long) ts.tv_nsec); + exit(EXIT_SUCCESS); +} +.fi +.SH 関連項目 +\fBclock_getres\fP(2), \fBtimer_create\fP(2), \fBpthread_getcpuclockid\fP(3), +\fBtime\fP(7) diff --git a/draft/man3/closedir.3 b/draft/man3/closedir.3 index 936be3ab..d7a0fbf3 100644 --- a/draft/man3/closedir.3 +++ b/draft/man3/closedir.3 @@ -26,80 +26,36 @@ .\" 386BSD man pages .\" Modified Sat Jul 24 21:25:52 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified 11 June 1995 by Andries Brouwer (aeb@cwi.nl) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi -.\" all rights reserved. -.\" Translated Mon Jan 20 17:49:23 JST 1997 -.\" by YOSHINO Takashi Yoshino -.\" Updated & Modified Tue Feb 15 04:01:41 JST 2005 -.\" by Yuichi SATO +.\" This file was generated with po4a. Translate the source file. .\" -.\"WORD: directory stream descriptor ディレクトリストリームディスクリプター -.\" -.TH CLOSEDIR 3 2008-09-23 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH CLOSEDIR 3 2008\-09\-23 "" "Linux Programmer's Manual" .SH 名前 -.\"O closedir \- close a directory closedir \- ディレクトリをクローズする -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.B #include +\fB#include \fP .sp -.BI "int closedir(DIR *" dirp ); +\fBint closedir(DIR *\fP\fIdirp\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR closedir () -.\"O function closes the directory stream associated with -.\"O \fIdirp\fP. -.\"O A successful call to -.\"O .BR closedir () -.\"O also closes the underlying file descriptor associated with -.\"O .IR dirp . -.\"O The directory stream descriptor \fIdirp\fP is not available -.\"O after this call. -.BR closedir () -関数は \fIdirp\fP に関連付けられた -ディレクトリストリームをクローズする。 -.BR closedir () -の呼び出しが成功すると、 -.I dirp -に関連付けられたファイルディスクリプターもクローズされる。 -ディレクトリストリームディスクリプター -(directory stream descriptor) \fIdirp\fP は、 +\fBclosedir\fP() 関数は \fIdirp\fP に関連付けられた ディレクトリストリームをクローズする。 +\fBclosedir\fP() の呼び出しが成功すると、 \fIdirp\fP に関連付けられた +ファイルディスクリプタもクローズされる。 +ディレクトリストリームディスクリプタ (directory stream descriptor) \fIdirp\fP は、 この呼び出しの後では使用することができない。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O The -.\"O .BR closedir () -.\"O function returns 0 on success. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -.BR closedir () -関数は成功時に 0 を返す。 -エラーの場合は、\-1 が返されて、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS +\fBclosedir\fP() 関数は成功時に 0 を返す。 エラーの場合は、\-1 が返されて、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP -.B EBADF -.\"O Invalid directory stream descriptor \fIdirp\fP. -ディレクトリストリームディスクリプター \fIdirp\fP が無効である。 -.\"O .SH "CONFORMING TO" +.TP +\fBEBADF\fP +ディレクトリストリームディスクリプタ \fIdirp\fP が無効である。 .SH 準拠 -SVr4, POSIX.1-2001, 4.3BSD. -.\"O .SH "SEE ALSO" +SVr4, POSIX.1\-2001, 4.3BSD. .SH 関連項目 -.BR close (2), -.BR opendir (3), -.BR readdir (3), -.BR rewinddir (3), -.BR scandir (3), -.BR seekdir (3), -.BR telldir (3) +\fBclose\fP(2), \fBopendir\fP(3), \fBreaddir\fP(3), \fBrewinddir\fP(3), \fBscandir\fP(3), +\fBseekdir\fP(3), \fBtelldir\fP(3) diff --git a/draft/man3/confstr.3 b/draft/man3/confstr.3 index 2c5a1460..7d847356 100644 --- a/draft/man3/confstr.3 +++ b/draft/man3/confstr.3 @@ -26,189 +26,62 @@ .\" See for the rest. .\" These should all be added to this page. .\" See also the POSIX.1-2001 specification of confstr() +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 Hiroaki Nagoya -.\" all rights reserved. -.\" Translated by Hiroaki Nagoya -.\" Updated 2005-09-06, Akihiro MOTOKI -.\" Updated 2006-07-20, Akihiro MOTOKI , LDP v2.36 +.\" This file was generated with po4a. Translate the source file. .\" -.TH CONFSTR 3 2010-02-03 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH CONFSTR 3 2010\-02\-03 GNU "Linux Programmer's Manual" .SH 名前 -.\"O confstr \- get configuration dependent string variables confstr \- コンフィグレーションに依存した文字列変数の取得 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "size_t confstr(int " "name" ", char *" buf ", size_t " len ); +\fBsize_t confstr(int \fP\fIname\fP\fB, char *\fP\fIbuf\fP\fB, size_t \fP\fIlen\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR confstr (): -_POSIX_C_SOURCE\ >=\ 2 || _XOPEN_SOURCE -.\"O .SH DESCRIPTION +\fBconfstr\fP(): _POSIX_C_SOURCE\ >=\ 2 || _XOPEN_SOURCE .SH 説明 -.\"O .BR confstr () -.\"O gets the value of configuration-dependent string variables. -.BR confstr () -はコンフィグレーションに依存した文字列変数の値を取得する。 +\fBconfstr\fP() はコンフィグレーションに依存した文字列変数の値を取得する。 .PP -.\"O The -.\"O .I name -.\"O argument is the system variable to be queried. -.\"O The following variables are supported: -引き数 -.I name -は、問い合わせ内容を表すシステム変数である。 -以下の変数がサポートされている。 -.TP -.\"O .BR _CS_GNU_LIBC_VERSION " (GNU C library only; since glibc 2.3.2)" -.\"O A string which identifies the GNU C library version on this system -.\"O (e.g, "glibc 2.3.4"). -.BR _CS_GNU_LIBC_VERSION " (GNU C library 限定; glibc 2.3.2 以降)" -そのシステムの GNU C ライブラリのバージョンを示す文字列 -(例えば "glibc 2.3.4")。 -.TP -.\"O .BR _CS_GNU_LIBPTHREAD_VERSION " (GNU C library only; since glibc 2.3.2)" -.\"O A string which identifies the POSIX implementation supplied by this -.\"O C library (e.g, "NPTL 2.3.4" or "linuxthreads-0.10"). -.BR _CS_GNU_LIBPTHREAD_VERSION " (GNU C library 限定; glibc 2.3.2 以降)" -その C ライブラリが提供している POSIX 実装を示す文字列 -(例えば "NPTL 2.3.4" や "linuxthreads-0.10")。 -.TP -.B _CS_PATH -.\"O A value for the -.\"O .B PATH -.\"O variable which indicates where all the POSIX.2 standard utilities can -.\"O be found. -すべての POSIX.2 標準ユーティリティが見つかるような -.B PATH -の値。 +引き数 \fIname\fP は、問い合わせ内容を表すシステム変数である。 以下の変数がサポートされている。 +.TP +\fB_CS_GNU_LIBC_VERSION\fP (GNU C library 限定; glibc 2.3.2 以降) +そのシステムの GNU C ライブラリのバージョンを示す文字列 (例えば "glibc 2.3.4")。 +.TP +\fB_CS_GNU_LIBPTHREAD_VERSION\fP (GNU C library 限定; glibc 2.3.2 以降) +その C ライブラリが提供している POSIX 実装を示す文字列 (例えば "NPTL 2.3.4" や "linuxthreads\-0.10")。 +.TP +\fB_CS_PATH\fP +すべての POSIX.2 標準ユーティリティが見つかるような \fBPATH\fP の値。 .PP -.\"O If -.\"O .I buf -.\"O is not NULL and -.\"O .I len -.\"O is not zero, -.\"O .BR confstr () -.\"O copies the value of the string to -.\"O .I buf -.\"O truncated to -.\"O .I len \- 1 -.\"O characters if necessary, with a null byte (\(aq\\0\(aq) as termination. -.I buf -が NULL でなく、かつ -.I len -が 0 でなければ -.BR confstr () -は取得した文字列の内容を -.I buf -にコピーする。必要ならば長さは -.I len \- 1 -文字に切り捨てられて、NULL バイト (\(aq\\0\(aq) で終端される。 -.\"O This can be detected by comparing the return value of -.\"O .BR confstr () -.\"O against -.\"O .IR len . -末尾が切り捨てられたかどうかを判定するには、 -.BR confstr () -の返り値を -.I len -と比較すればよい。 +\fIbuf\fP が NULL でなく、かつ \fIlen\fP が 0 でなければ \fBconfstr\fP() は取得した文字列の内容を \fIbuf\fP +にコピーする。必要ならば長さは \fIlen \- 1\fP 文字に切り捨てられて、NULL バイト (\(aq\e0\(aq) で終端される。 +末尾が切り捨てられたかどうかを判定するには、 \fBconfstr\fP() の返り値を \fIlen\fP と比較すればよい。 .PP -.\"O If -.\"O .I len -.\"O is zero and -.\"O .I buf -.\"O is NULL, -.\"O .BR confstr () -.\"O just returns the value as defined below. -.I len -が 0 で -.I buf -が NULL ならば、 -.BR confstr () -は以下で定義された値 (訳注: 切り捨てる前の、取得した文字列の長さ) を返す。 -.\"O .SH "RETURN VALUE" +\fIlen\fP が 0 で \fIbuf\fP が NULL ならば、 \fBconfstr\fP() は以下で定義された値 (訳注: +切り捨てる前の、取得した文字列の長さ) を返す。 .SH 返り値 -.\"O If -.\"O .I name -.\"O is a valid configuration variable, -.\"O .BR confstr () -.\"O returns the number of bytes (including the terminating null byte) -.\"O that would be required to hold the entire value of that variable. -.\"O This value may be greater than -.\"O .IR len , -.\"O which means that the value in -.\"O .I buf -.\"O is truncated. -.I name -が有効なコンフィギュレーション変数の場合、 -.BR confstr () -はその変数の値全体を保持するのに必要であったバイト数を返す -(文字列終端のヌルバイトも含む)。この値は -.I len -より大きいこともある。この場合には、 -.I buf +\fIname\fP が有効なコンフィギュレーション変数の場合、 \fBconfstr\fP() はその変数の値全体を保持するのに必要であったバイト数を返す +(文字列終端のヌルバイトも含む)。この値は \fIlen\fP より大きいこともある。この場合には、 \fIbuf\fP に格納された値の末尾が切り詰められたことを意味する。 -.\"O If -.\"O .I name -.\"O is a valid configuration variable, -.\"O but that variable does not have a value, then -.\"O .BR confstr () -.\"O returns 0. -.I name -が有効なコンフィギュレーション変数だが、 -変数が値を持っていない場合、 -.BR confstr () -は 0 を返す。 -.\"O If -.\"O .I name -.\"O does not correspond to a valid configuration variable, -.\"O .BR confstr () -.\"O returns 0, and -.\"O .I errno -.\"O is set to -.\"O .BR EINVAL . -.I name -が有効なコンフィグレーション変数に対応していなければ、 -.BR confstr () -は 0 を返し、 -.I errno -に -.B EINVAL +\fIname\fP が有効なコンフィギュレーション変数だが、 変数が値を持っていない場合、 \fBconfstr\fP() は 0 を返す。 \fIname\fP +が有効なコンフィグレーション変数に対応していなければ、 \fBconfstr\fP() は 0 を返し、 \fIerrno\fP に \fBEINVAL\fP を設定する。 -.\"O .SH ERRORS .SH エラー -.\"O .TP -.\"O .B EINVAL -.\"O If the value of -.\"O .I name -.\"O is invalid. -.TP -.B EINVAL -.I name -の値が不正である。 -.\"O .SH "CONFORMING TO" +.TP +\fBEINVAL\fP +\fIname\fP の値が不正である。 .SH 準拠 -POSIX.1-2001. -.\"O .SH EXAMPLE +POSIX.1\-2001. .SH 例 -.\"O The following code fragment determines the path where to find -.\"O the POSIX.2 system utilities: -次の部分的なコードは、 POSIX.2 システムのユーティリティがあるパス -を取得するものである。 +次の部分的なコードは、 POSIX.2 システムのユーティリティがあるパス を取得するものである。 .br .nf .in +4n @@ -223,8 +96,5 @@ if (pathbuf == NULL) confstr(_CS_PATH, pathbuf, n); .in .fi -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR sh (1), -.BR exec (3), -.BR system (3) +\fBsh\fP(1), \fBexec\fP(3), \fBsystem\fP(3) diff --git a/draft/man3/copysign.3 b/draft/man3/copysign.3 index 1856c262..cd295ed5 100644 --- a/draft/man3/copysign.3 +++ b/draft/man3/copysign.3 @@ -26,98 +26,56 @@ .\" 386BSD man pages .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) .\" Modified 2002-08-10 by Walter Harms (walter.harms@informatik.uni-oldenburg.de) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 Hiroaki Nagoya -.\" all rights reserved. -.\" Translated Mon Feb 10 1997 by Hiroaki Nagoya -.\" Updated 2002-08-24 by Akihiro MOTOKI -.\" Updated 2007-06-01, Akihiro MOTOKI, LDP v2.50 -.\" Updated 2008-09-15, Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.TH COPYSIGN 3 2010-09-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O copysign, copysignf, copysignl \- copy sign of a number +.\"******************************************************************* +.TH COPYSIGN 3 2012\-03\-25 GNU "Linux Programmer's Manual" .SH 名前 copysign, copysignf, copysignl \- 数の符号をコピーする -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double copysign(double " x ", double " y ); +\fBdouble copysign(double \fP\fIx\fP\fB, double \fP\fIy\fP\fB);\fP .br -.BI "float copysignf(float " x ", float " y ); +\fBfloat copysignf(float \fP\fIx\fP\fB, float \fP\fIy\fP\fB);\fP .br -.BI "long double copysignl(long double " x ", long double " y ); +\fBlong double copysignl(long double \fP\fIx\fP\fB, long double \fP\fIy\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR copysign (), -.BR copysignf (), -.BR copysignl (): +\fBcopysign\fP(), \fBcopysignf\fP(), \fBcopysignl\fP(): .RS 4 -_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR copysign () -.\"O functions return a value whose absolute value matches -.\"O that of \fIx\fP, but whose sign bit matches that of \fIy\fP. -関数 -.BR copysign () -は絶対値が -\fIx\fP に等しく、符号ビットが \fIy\fP に等しい値を返す。 -.\"O .SH RETURN VALUE +関数 \fBcopysign\fP() は絶対値が \fIx\fP に等しく、符号ビットが \fIy\fP に等しい値を返す。 + +例えば、 +\fIcopysign(42.0,\ \-1.0)\fP と \fIcopysign(\-42.0, \-1.0)\fP はどちらも \-42.0 を返す。 .SH 返り値 -.\"O On success, these functions return a value whose magnitude is taken from -.\"O .I x -.\"O and whose sign is taken from -.\"O .IR y . -成功すると、これらの関数は、その絶対値は -.I x -に等しく、符号は -.I y -に等しい値を返す。 +成功すると、これらの関数は、その絶対値は \fIx\fP に等しく、符号は \fIy\fP に等しい値を返す。 -.\"O If \fIx\fP is a NaN, -.\"O a NaN with the sign bit of \fIy\fP is returned. -.\"O .SH ERRORS -.\"O No errors occur. \fIx\fP が NaN の場合、NaN に \fIy\fP の符号ビットをつけて返す。 -.\"O .SH "CONFORMING TO" +.SH エラー +エラーは発生しない。 .SH 準拠 -C99, POSIX.1-2001. .\" 4.3BSD. -.\"O This function is defined in IEC 559 (and the appendix with -.\"O recommended functions in IEEE 754/IEEE 854). -この関数は IEC 559 で定義されている。 -(また IEEE 754/IEEE 854 では、付録で推奨関数として定義されている。) -.\"O .SH NOTES +C99, POSIX.1\-2001. この関数は IEC 559 で定義されている (また IEEE 754/IEEE 854 +では付録で推奨関数として定義されている)。 .SH 注意 -.\"O On architectures where the floating-point formats are not IEEE 754 compliant, -.\"O the -.\"O .BR copysign () -.\"O functions may treat a negative zero as positive. -浮動小数点形式が IEEE 754 準拠でないアーキテクチャでは、 -.BR copysign () -は負の 0 を正として扱うことがある。 -.\"O .SH "SEE ALSO" +浮動小数点形式が IEEE 754 準拠でないアーキテクチャでは、 \fBcopysign\fP() は負の 0 を正として扱うことがある。 .SH 関連項目 -.BR signbit (3) +\fBsignbit\fP(3) diff --git a/draft/man3/cos.3 b/draft/man3/cos.3 index 7b063a55..264851c1 100644 --- a/draft/man3/cos.3 +++ b/draft/man3/cos.3 @@ -29,148 +29,61 @@ .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) .\" Modified 2002-07-27 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1996 Kenji Kajiwara and Kentaro Ogawa -.\" all rights reserved. -.\" Translated Sat, 13 Jul 1996 17:42:24 JST -.\" by Kenji Kajiwara and Kentaro Ogawa -.\" Proof Reading: Takashi Yoshino -.\" Updated Tue Aug 5 23:16:48 JST 2003 -.\" by Akihiro MOTOKI -.\" Updated & Modified Tue Feb 15 04:17:01 JST 2005 -.\" by Yuichi SATO -.\" Updated 2008-09-15, Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.TH COS 3 2010-09-11 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH COS 3 2010\-09\-11 "" "Linux Programmer's Manual" .SH 名前 -.\"O cos, cosf, cosl \- cosine function cos, cosf, cosl \- 余弦 (コサイン) 関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double cos(double " x ); +\fBdouble cos(double \fP\fIx\fP\fB);\fP .br -.BI "float cosf(float " x ); +\fBfloat cosf(float \fP\fIx\fP\fB);\fP .br -.BI "long double cosl(long double " x ); +\fBlong double cosl(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR cosf (), -.BR cosl (): +\fBcosf\fP(), \fBcosl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR cos () -.\"O function returns the cosine of \fIx\fP, where \fIx\fP is -.\"O given in radians. -.BR cos () -関数は \fIx\fP の余弦 (コサイン) の値を返す。 -\fIx\fP はラジアン単位で指定する。 -.\"O .SH RETURN VALUE +\fBcos\fP() 関数は \fIx\fP の余弦 (コサイン) の値を返す。 \fIx\fP はラジアン単位で指定する。 .SH 返り値 -.\"O On success, these functions return the cosine of -.\"O .IR x . -成功すると、これらの関数は -.I x -の余弦を返す。 +成功すると、これらの関数は \fIx\fP の余弦を返す。 -.\"O If -.\"O .I x -.\"O is a NaN, a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is positive infinity or negative infinity, -.\"O a domain error occurs, -.\"O and a NaN is returned. -.I x -が正の無限大か負の無限大の場合、 -領域エラー (domain error) が発生し、NaN が返される。 -.\"O .SH ERRORS +\fIx\fP が正の無限大か負の無限大の場合、 領域エラー (domain error) が発生し、NaN が返される。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Domain error: \fIx\fP is an infinity +.TP 領域エラー (domain error): \fIx\fP が無限大である -.\"O .I errno -.\"O is set to -.\"O .BR EDOM -.\"O (but see BUGS). -.I errno -が -.B EDOM -に設定される -(「バグ」の節を参照)。 -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -無効 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) +\fIerrno\fP に \fBEDOM\fP が設定される (「バグ」の節も参照)。 不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD. -.I double -版の関数は SVr4, 4.3BSD にも準拠している。 -.\"O .SH BUGS +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD にも準拠している。 .SH バグ -.\"O Before version 2.10, the glibc implementation did not set .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6780 -.\"O .I errno -.\"O to -.\"O .B EDOM -.\"O when a domain error occurred. -バージョン 2.10 より前の glibc の実装では、 -ドメインエラーが発生した際に、 -.I errno -に -.B EDOM -が設定されなかった。 -.\"O .SH "SEE ALSO" +バージョン 2.10 より前の glibc の実装では、 領域エラーが発生した際に、 \fIerror\fP に \fBEDOM\fP が設定されなかった。 .SH 関連項目 -.BR acos (3), -.BR asin (3), -.BR atan (3), -.BR atan2 (3), -.BR ccos (3), -.BR sin (3), -.BR sincos (3), -.BR tan (3) +\fBacos\fP(3), \fBasin\fP(3), \fBatan\fP(3), \fBatan2\fP(3), \fBccos\fP(3), \fBsin\fP(3), +\fBsincos\fP(3), \fBtan\fP(3) diff --git a/draft/man3/cosh.3 b/draft/man3/cosh.3 index 2aee3949..87951dc2 100644 --- a/draft/man3/cosh.3 +++ b/draft/man3/cosh.3 @@ -31,161 +31,68 @@ .\" Modified 2002-07-27 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 1996 Kenji Kajiwara and Kentaro Ogawa -.\" all rights reserved. -.\" Translated Sat, 13 Jul 1996 17:54:30 JST -.\" by Kenji Kajiwara and Kentaro Ogawa -.\" Updated Tue Aug 5 23:16:48 JST 2003 -.\" by Akihiro MOTOKI -.\" Updated & Modified Tue Feb 15 04:28:36 JST 2005 -.\" by Yuichi SATO -.\" Updated 2008-09-15, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH COSH 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH COSH 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O cosh, coshf, coshl \- hyperbolic cosine function cosh, coshf, coshl \- 双曲線余弦 (ハイパボリックコサイン) 関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double cosh(double " x ); +\fBdouble cosh(double \fP\fIx\fP\fB);\fP .br -.BI "float coshf(float " x ); +\fBfloat coshf(float \fP\fIx\fP\fB);\fP .br -.BI "long double coshl(long double " x ); +\fBlong double coshl(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR coshf (), -.BR coshl (): +\fBcoshf\fP(), \fBcoshl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR cosh () -.\"O function returns the hyperbolic cosine of \fIx\fP, which -.\"O is defined mathematically as: -.BR cosh () -関数は双曲線余弦 (ハイパボリックコサイン) の値を返す。 -数学的には以下のように定義される. +\fBcosh\fP() 関数は双曲線余弦 (ハイパボリックコサイン) の値を返す。 数学的には以下のように定義される. .nf cosh(x) = (exp(x) + exp(\-x)) / 2 .fi -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O On success, these functions return the hyperbolic cosine of -.\"O .IR x . -成功すると、これらの関数は -.I x -の双曲線余弦を返す。 +成功すると、これらの関数は \fIx\fP の双曲線余弦を返す。 -.\"O If -.\"O .I x -.\"O is a NaN, a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is +0 or \-0, 1 is returned. -.I x -が +0 か \-0 の場合、 1 が返される。 +\fIx\fP が +0 か \-0 の場合、1 が返される。 -.\"O If -.\"O .I x -.\"O is positive infinity or negative infinity, -.\"O positive infinity is returned. -.I x -が正の無限大か負の無限大の場合、正の無限大が返される。 +\fIx\fP が正の無限大か負の無限大の場合、正の無限大が返される。 -.\"O If the result overflows, -.\"O a range error occurs, -.\"O and the functions return -.\"O .RB + HUGE_VAL , -.\"O .RB + HUGE_VALF , -.\"O or -.\"O .RB + HUGE_VALL , -.\"O respectively. -結果がオーバーフローする場合、範囲エラーが発生し、 -各関数はそれぞれ -.RB + HUGE_VAL , -.RB + HUGE_VALF , -.RB + HUGE_VALL -を返す。 -.\"O .SH ERRORS +結果がオーバーフローする場合、範囲エラーが発生し、 各関数はそれぞれ +\fBHUGE_VAL\fP, +\fBHUGE_VALF\fP, ++\fBHUGE_VALL\fP を返す。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Range error: result overflow -範囲エラー (range error): 結果がオーバーフローした -.\"O .I errno -.\"O is set to -.\"O .BR ERANGE . -.\"O An overflow floating-point exception -.\"O .RB ( FE_OVERFLOW ) -.\"O is raised. -.I errno -に -.B ERANGE -が設定される。 -オーバーフロー浮動小数点例外 -.RB ( FE_OVERFLOW ) -が上がる。 -.\"O .SH "CONFORMING TO" +.TP +範囲エラー (range error): 結果のオーバーフロー +\fIerrno\fP に \fBERANGE\fP が設定される。 オーバーフロー浮動小数点例外 (\fBFE_OVERFLOW\fP) が上がる。 .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD. -.I double -版の関数は SVr4, 4.3BSD にも準拠している。 -.\"O .SH BUGS +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD にも準拠している。 .SH バグ -.\"O In glibc version 2.3.4 and earlier, -.\"O an overflow floating-point -.\"O .RB ( FE_OVERFLOW ) -.\"O exception is not raised when an overflow occurs. -glibc バージョン 2.3.4 以前では、オーバーフローが発生したときに、 -オーバーフロー浮動小数点例外 -.RB ( FE_OVERFLOW ) +glibc バージョン 2.3.4 以前では、オーバーフローが発生したときに、 オーバーフロー浮動小数点例外 (\fBFE_OVERFLOW\fP) が上がらなかった。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR acosh (3), -.BR asinh (3), -.BR atanh (3), -.BR ccos (3), -.BR sinh (3), -.BR tanh (3) +\fBacosh\fP(3), \fBasinh\fP(3), \fBatanh\fP(3), \fBccos\fP(3), \fBsinh\fP(3), \fBtanh\fP(3) diff --git a/draft/man3/crypt.3 b/draft/man3/crypt.3 index 86aa7ae3..ec2d9c4e 100644 --- a/draft/man3/crypt.3 +++ b/draft/man3/crypt.3 @@ -32,276 +32,112 @@ .\" added _XOPEN_SOURCE, aeb, 970705 .\" added GNU MD5 stuff, aeb, 011223 .\" -.\" Japanese Version Copyright (c) 1998 Hiroaki Nagoya and MAEHARA Kouichi all rights reserved. -.\" Translated Sun Sep 27 JST 1998 by Hiroaki Nagoya and MAEHARA Kouichi -.\" Updated 2002-01-19 by Kentaro Shirakata -.\" Updated 2007-01-01 by Kentaro Shirakata -.\" Updated 2008-07-30 by Kentaro Shirakata -.\" Updated 2009-09-28 by Kentaro Shirakata +.\"******************************************************************* .\" -.\"WORD: encryption 暗号化 -.\"WORD: key 鍵 -.\" " -.TH CRYPT 3 2011-09-15 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH CRYPT 3 2011\-09\-15 "" "Linux Programmer's Manual" .SH 名前 -.\"O crypt, crypt_r \- password and data encryption crypt, crypt_r \- パスワードとデータの暗号化 -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _XOPEN_SOURCE" " /* feature_test_macros(7) 参照 */" +\fB#define _XOPEN_SOURCE\fP /* feature_test_macros(7) 参照 */ .br -.B #include +\fB#include \fP .sp -.BI "char *crypt(const char *" key ", const char *" salt ); +\fBchar *crypt(const char *\fP\fIkey\fP\fB, const char *\fP\fIsalt\fP\fB);\fP .sp -.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" +\fB#define _GNU_SOURCE\fP /* See feature_test_macros(7) */ .br -.B #include +\fB#include \fP .sp -.BI "char *crypt_r(const char *" key ", const char *" salt , -.BI " struct crypt_data *" data ); +\fBchar *crypt_r(const char *\fP\fIkey\fP\fB, const char *\fP\fIsalt\fP\fB,\fP +\fB struct crypt_data *\fP\fIdata\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lcrypt\fP. \fI\-lcrypt\fP でリンクする。 -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR crypt () -.\"O is the password encryption function. -.\"O It is based on the Data Encryption -.\"O Standard algorithm with variations intended (among other things) to -.\"O discourage use of hardware implementations of a key search. -.BR crypt () -はパスワード暗号化関数である。 -鍵探索のハードウェアによる実装を妨げるように(その他にもいろいろ) -変更した Data Encryption Standard アルゴリズムを元にしている。 +\fBcrypt\fP() はパスワード暗号化関数である。 鍵探索のハードウェアによる実装を妨げるように(その他にもいろいろ) 変更した Data +Encryption Standard アルゴリズムを元にしている。 .PP -.\"O .I key -.\"O is a user's typed password. -.I key -はユーザが入力するパスワードである。 +\fIkey\fP はユーザが入力するパスワードである。 .PP -.\"O .I salt -.\"O is a two-character string chosen from the set -.\"O [\fBa\fP\(en\fBzA\fP\(en\fBZ0\fP\(en\fB9./\fP]. -.\"O This string is used to -.\"O perturb the algorithm in one of 4096 different ways. -.I salt -は集合 -[\fBa\fP\(en\fBzA\fP\(en\fBZ0\fP\(en\fB9./\fP] -から選ばれた 2 文字の文字列である。 +\fIsalt\fP は集合 [\fBa\fP\(en\fBzA\fP\(en\fBZ0\fP\(en\fB9./\fP] から選ばれた 2 文字の文字列である。 この文字列はアルゴリズムの出力を 4096 通りにかき乱すのに使われる。 .PP -.\"O By taking the lowest 7 bits of each of the first eight characters of the -.\"O .IR key , -.\"O a 56-bit key is obtained. -.\"O This 56-bit key is used to encrypt repeatedly a -.\"O constant string (usually a string consisting of all zeros). -.\"O The returned -.\"O value points to the encrypted password, a series of 13 printable ASCII -.\"O characters (the first two characters represent the salt itself). -.\"O The return value points to static data whose content is -.\"O overwritten by each call. -.I key -の最初の 8 文字の各文字から下位 7 ビットをとって 56 ビットの鍵が得られる。 -この 56 ビットの鍵は特定の文字列(ふつうはすべて 0 の文字列) -を繰り返し暗号化するのに用いられる。 -返り値は暗号化されたパスワードへのポインタで、13 の印字可能な ASCII 文字 -からなる(最初の 2 文字は salt そのもの)。 -返り値は、関数呼出しのたびに上書きされる静的なデータへのポインタである。 +\fIkey\fP の最初の 8 文字の各文字から下位 7 ビットをとって 56 ビットの鍵が得られる。 この 56 ビットの鍵は特定の文字列(ふつうはすべて +0 の文字列) を繰り返し暗号化するのに用いられる。 返り値は暗号化されたパスワードへのポインタで、13 の印字可能な ASCII 文字 +からなる(最初の 2 文字は salt そのもの)。 返り値は、関数呼出しのたびに上書きされる静的なデータへのポインタである。 .PP -.\"O Warning: The key space consists of -.\"O .if t 2\s-2\u56\s0\d -.\"O .if n 2**56 -.\"O equal 7.2e16 possible values. -.\"O Exhaustive searches of this key space are -.\"O possible using massively parallel computers. -.\"O Software, such as -.\"O .BR crack (1), -.\"O is available which will search the portion of this key space that is -.\"O generally used by humans for passwords. -.\"O Hence, password selection should, -.\"O at minimum, avoid common words and names. -.\"O The use of a -.\"O .BR passwd (1) -.\"O program that checks for crackable passwords during the selection process is -.\"O recommended. 警告: 鍵空間は -.if t 2\s-2\u56\s0\d -.if n 2**56 -= 7.2e16 の可能な値から成る。 -この鍵空間の全探索は強力な並列計算機を使えば可能である。また -.BR crack (1) -のようなソフトウェアはこの鍵空間の中で、多くの人にパスワードとして -使われるような鍵についての全探索が可能である。 -それゆえ、パスワードを選択するときには、すくなくとも、 -一般的に使われる単語と名前は避けるべきである。 -.BR passwd (1) -を使う時にはクラックされうるパスワードについての検査をすることが -推奨される。 +.if t 2\s-2\u56\s0\d +.if n 2**56 += 7.2e16 の可能な値から成る。 この鍵空間の全探索は強力な並列計算機を使えば可能である。また \fBcrack\fP(1) +のようなソフトウェアはこの鍵空間の中で、多くの人にパスワードとして 使われるような鍵についての全探索が可能である。 +それゆえ、パスワードを選択するときには、すくなくとも、 一般的に使われる単語と名前は避けるべきである。 \fBpasswd\fP(1) +を使う時にはクラックされうるパスワードについての検査をすることが 推奨される。 .PP -.\"O The DES algorithm itself has a few quirks which make the use of the -.\"O .BR crypt () -.\"O interface a very poor choice for anything other than password -.\"O authentication. -.\"O If you are planning on using the -.\"O .BR crypt () -.\"O interface for a cryptography project, don't do it: get a good book on -.\"O encryption and one of the widely available DES libraries. -DES アルゴリズムにはいくつかの癖があり、それによってパスワード認証以外に -.BR crypt () -を使うのはたいへんよくない選択となっている。もし -.BR crypt () -を暗号プロジェクトに使おうという案をもっているならば、それはやめたほうが -よい。暗号化についてのよい本と誰でも入手できる DES ライブラリのひとつを -手にいれるべきだ。 +DES アルゴリズムにはいくつかの癖があり、それによってパスワード認証以外に \fBcrypt\fP() を使うのはたいへんよくない選択となっている。もし +\fBcrypt\fP() を暗号プロジェクトに使おうという案をもっているならば、それはやめたほうが よい。暗号化についてのよい本と誰でも入手できる DES +ライブラリのひとつを 手にいれるべきだ。 -.\"O .BR crypt_r () -.\"O is a reentrant version of -.\"O .BR crypt (). -.\"O The structure pointed to by -.\"O .I data -.\"O is used to store result data and bookkeeping information. -.\"O Other than allocating it, -.\"O the only thing that the caller should do with this structure is to set -.\"O .I data->initialized -.\"O to zero before the first call to -.\"O .BR crypt_r (). -.BR crypt_r () -は -.BR crypt () -の再入可能版である。 -.I data -で示される構造体は結果データの保存と情報の管理に使われる。 -この構造体に対して(メモリを割り当てること以外に)呼び出し元がするべき唯一の -ことは、 -.BR crypt_r () -の初回の呼び出しの前に -.I data->initialized -をゼロにすることだけである。 -.\"O .SH "RETURN VALUE" +\fBcrypt_r\fP() は \fBcrypt\fP() の再入可能版である。 \fIdata\fP で示される構造体は結果データの保存と情報の管理に使われる。 +この構造体に対して(メモリを割り当てること以外に)呼び出し元がするべき唯一の ことは、 \fBcrypt_r\fP() の初回の呼び出しの前に +\fIdata\->initialized\fP をゼロにすることだけである。 .SH 返り値 -.\"O On success, a pointer to the encrypted password is returned. -.\"O On error, NULL is returned. -成功の場合には、暗号化されたパスワードへのポインターが返される。 -エラーの場合には NULL が返される。 -.\"O .SH ERRORS +成功の場合には、暗号化されたパスワードへのポインターが返される。 エラーの場合には NULL が返される。 .SH エラー -.TP -.B ENOSYS -.\"O The -.\"O .BR crypt () -.\"O function was not implemented, probably because of U.S.A. export restrictions. -.BR crypt () -関数が実装されていない。多分アメリカの輸出規制のために。 -.\"O .\" This level of detail is not necessary in this man page. . . -.\" このレベルの詳細はこのマニュアルには必要ないだろう… -.\" (訳注: 以下は MAEHARA Kouichi さんの訳) +.TP +\fBENOSYS\fP +.\" This level of detail is not necessary in this man page. . . +.\" .PP +.\" When encrypting a plain text P using DES with the key K results in the +.\" encrypted text C, then the complementary plain text P' being encrypted +.\" using the complementary key K' will result in the complementary encrypted +.\" text C'. +.\" .PP +.\" Weak keys are keys which stay invariant under the DES key transformation. +.\" The four known weak keys 0101010101010101, fefefefefefefefe, +.\" 1f1f1f1f0e0e0e0e and e0e0e0e0f1f1f1f1 must be avoided. +.\" .PP +.\" There are six known half weak key pairs, which keys lead to the same +.\" encrypted data. Keys which are part of such key clusters should be +.\" avoided. +.\" Sorry, I could not find out what they are. +.\"" +.\" .PP +.\" Heavily redundant data causes trouble with DES encryption, when used in the +.\" .I codebook +.\" mode that +.\" .BR crypt () +.\" implements. The +.\" .BR crypt () +.\" interface should be used only for its intended purpose of password +.\" verification, and should not be used as part of a data encryption tool. +.\" .PP +.\" The first and last three output bits of the fourth S-box can be +.\" represented as function of their input bits. Empiric studies have +.\" shown that S-boxes partially compute the same output for similar input. +.\" It is suspected that this may contain a back door which could allow the +.\" NSA to decrypt DES encrypted data. .\" .PP -.\"O .\" When encrypting a plain text P using DES with the key K results in the -.\"O .\" encrypted text C, then the complementary plain text P' being encrypted -.\"O .\" using the complementary key K' will result in the complementary encrypted -.\"O .\" text C'. -.\"平文 P を鍵 K でもって DES を用いて暗号化したときの結果の暗号文 -.\"を C とするならば、P に対する 2 の補数的な平文 P' を鍵 K -.\"に対する同様に補数的な鍵 K' を用いて暗号化すると C に対してやはり補 -.\"数的な暗号文 C' となる。 -.\".PP -.\"O .\" Weak keys are keys which stay invariant under the DES key transformation. -.\"O .\" The four known weak keys 0101010101010101, fefefefefefefefe, -.\"O .\" 1f1f1f1f0e0e0e0e and e0e0e0e0f1f1f1f1 must be avoided. -.\"DES による鍵の変形において、常に攻撃に対して弱い鍵が存在する。よく -.\"知られた四つの弱い鍵は 0101010101010101、fefefefefefefefe、 -.\"1f1f1f1f0e0e0e0e、e0e0e0e0f1f1f1f1 でありこれらの使用は避けなければ -.\"ならない。 -.\".PP -.\"O .\" There are six known half weak key pairs, which keys lead to the same -.\"O .\" encrypted data. Keys which are part of such key clusters should be -.\"O .\" avoided. -.\"O .\" Sorry, I could not find out what they are. -.\"O .\"" -.\"同一の暗号化結果を導いてしまう六組のやや弱い鍵もある。こうしたいく -.\"つかの鍵の使用はやはり避けるべきである。 -.\"申しわけないことだが、これにどんな鍵が該当するのかは調べきれなかっ -.\"た。 -.\".PP -.\"O .\" Heavily redundant data causes trouble with DES encryption, when used in the -.\"O .\" .I codebook -.\"O .\" mode that -.\"O .\" .BR crypt () -.\"O .\" implements. The -.\"O .\" .BR crypt () -.\"O .\" interface should be used only for its intended purpose of password -.\"O .\" verification, and should not be used as part of a data encryption tool. -.\"極端に冗長化であるデータは、 -.\".BR crypt () -.\"のように -.\".I "暗号表(codebook)" -.\"モードで実装されている DES による暗号化においてはトラブルのもととな -.\"る。 -.\".BR crypt () -.\"はその想定通り、パスワードの認証の目的にのみ利用すべきものであり、 -.\"データの暗号化ツールとして用いてはならない。 -.\".PP -.\"O .\" The first and last three output bits of the fourth S-box can be -.\"O .\" represented as function of their input bits. Empiric studies have -.\"O .\" shown that S-boxes partially compute the same output for similar input. -.\"O .\" It is suspected that this may contain a back door which could allow the -.\"O .\" NSA to decrypt DES encrypted data. -.\"第四 S-box の、先頭と末尾三つの出力 bit 群は、その入力 bit 群の関数 -.\"として表わすことができる。このような S-box 群は同じ入力に対しては部 -.\"分的に同じ暗号化結果を生成してしまうことが実験によってあきらかにさ -.\"れている。これは、国家安全保障局(NSA)が DES による暗号データの解読を可能 -.\"にするために設けた裏口なのではないかと疑われている。 -.\".PP -.\"O .\" Making encrypted data computed using crypt() publicly available has -.\"O .\" to be considered insecure for the given reasons. -.\"こういった理由により、crypt() を使用した暗号化データを公開すること -.\"は安全ではないと認識するべきなのである。 -.\"O .SH "CONFORMING TO" +.\" Making encrypted data computed using crypt() publicly available has +.\" to be considered insecure for the given reasons. +\fBcrypt\fP() 関数が実装されていない。多分アメリカの輸出規制のために。 .SH 準拠 -.BR crypt (): -SVr4, 4.3BSD, POSIX.1-2001. -.\"O .BR crypt_r () -.\"O is a GNU extension. -.BR crypt_r () -は GNU 拡張である。 -.\"O .SH NOTES -.\"O .SS Glibc Notes +\fBcrypt\fP(): SVr4, 4.3BSD, POSIX.1\-2001. \fBcrypt_r\fP() は GNU 拡張である。 .SH 注意 -.SS glibc での注意 -.\"O The glibc2 version of this function supports additional -.\"O encryption algorithms. +.SS "glibc での注意" この関数の glibc2 版は追加の暗号化アルゴリズムに対応している。 -.\"O If -.\"O .I salt -.\"O is a character string starting with the characters "$\fIid\fP$" -.\"O followed by a string terminated by "$": -もし -.I salt -の文字列が "$\fIid\fP$" で始まっていて、"$" で終わっている文字列が -続いている場合: +もし \fIsalt\fP の文字列が "$\fIid\fP$" で始まっていて、"$" で終わっている文字列が 続いている場合: .RS $\fIid\fP$\fIsalt\fP$\fIencrypted\fP .RE -.\"O then instead of using the DES machine, -.\"O .I id -.\"O identifies the encryption method used and this then determines how the rest -.\"O of the password string is interpreted. -.\"O The following values of -.\"O .I id -.\"O are supported: -DES を使う代わりに、 -.I id -で使用する暗号化手法を識別し、これがパスワード文字列の残りの部分を解釈する -方法を決定する。 -.I id +DES を使う代わりに、 \fIid\fP で使用する暗号化手法を識別し、これがパスワード文字列の残りの部分を解釈する 方法を決定する。 \fIid\fP の値として、以下の値に対応している: .RS .TS @@ -309,8 +145,6 @@ l l. ID | Method _ 1 | MD5 -.\"O 2a | Blowfish (not in mainline glibc; added in some -.\"O | Linux distributions) 2a | Blowfish (本流の glibc には入っていない; | いくつかの Linux ディストリビューションで追加されている) .\" openSUSE has Blowfish, but AFAICS, this option is not supported @@ -319,53 +153,24 @@ _ .\" md5 | Sun MD5 .\" glibc doesn't appear to natively support Sun MD5; I don't know .\" if any distros add the support. -.\"O 5 | SHA-256 (since glibc 2.7) -.\"O 6 | SHA-512 (since glibc 2.7) -5 | SHA-256 (glibc 2.7 以降) -6 | SHA-512 (glibc 2.7 以降) +5 | SHA\-256 (glibc 2.7 以降) +6 | SHA\-512 (glibc 2.7 以降) .TE .RE -.\"O So $5$\fIsalt\fP$\fIencrypted\fP is an SHA-256 encoded -.\"O password and $6$\fIsalt\fP$\fIencrypted\fP is an -.\"O SHA-512 encoded one. -従って、$5$\fIsalt\fP$\fIencrypted\fP は SHA-256 でエンコードされた -パスワードであり、$6$\fIsalt\fP$\fIencrypted\fP は SHA-512 で -エンコードされたパスワードである。 +従って、$5$\fIsalt\fP$\fIencrypted\fP は SHA\-256 でエンコードされた +パスワードであり、$6$\fIsalt\fP$\fIencrypted\fP は SHA\-512 で エンコードされたパスワードである。 -.\"O "\fIsalt\fP" stands for the up to 16 characters -.\"O following "$\fIid\fP$" in the salt. -.\"O The encrypted part of the password string is the actual computed password. -.\"O The size of this string is fixed: -"\fIsalt\fP" は salt における "$\fIid\fP$" に引き続く 16 文字以下の -文字列である。 -パスワード文字列の暗号化部分は実際に計算されたパスワードである。 -この文字列のサイズは固定である: +"\fIsalt\fP" は salt における "$\fIid\fP$" に引き続く 16 文字以下の 文字列である。 +パスワード文字列の暗号化部分は実際に計算されたパスワードである。 この文字列のサイズは固定である: .TS l l. MD5 | 22 characters -SHA-256 | 43 characters -SHA-512 | 86 characters +SHA\-256 | 43 characters +SHA\-512 | 86 characters .TE -.\"O The characters in "\fIsalt\fP" and "\fIencrypted\fP" are drawn from the set -.\"O The characters in "" and "" are drawn from the set -.\"O [\fBa\fP\(en\fBzA\fP\(en\fBZ0\fP\(en\fB9./\fP]. -"\fIsalt\fP" と "\fIencrypted\fP" の文字は -[\fBa\fP\(en\fBzA\fP\(en\fBZ0\fP\(en\fB9./\fP] の集合から -選ばれる。 -.\"O In the MD5 and SHA implementations the entire -.\"O .I key -.\"O is significant (instead of only the first -.\"O 8 bytes in DES). -MD5 と SHA の実装では、 -.I key -全体が意味がある -(DES の場合には最初の 8 文字だけに意味がある)。 -.\"O .SH "SEE ALSO" +"\fIsalt\fP" と "\fIencrypted\fP" の文字は [\fBa\fP\(en\fBzA\fP\(en\fBZ0\fP\(en\fB9./\fP] の集合から +選ばれる。 MD5 と SHA の実装では、 \fIkey\fP 全体が意味がある (DES の場合には最初の 8 文字だけに意味がある)。 .SH 関連項目 -.BR login (1), -.BR passwd (1), -.BR encrypt (3), -.BR getpass (3), -.BR passwd (5) +\fBlogin\fP(1), \fBpasswd\fP(1), \fBencrypt\fP(3), \fBgetpass\fP(3), \fBpasswd\fP(5) diff --git a/draft/man3/ctime.3 b/draft/man3/ctime.3 index 327c024f..2e76be65 100644 --- a/draft/man3/ctime.3 +++ b/draft/man3/ctime.3 @@ -27,123 +27,64 @@ .\" Modified Sat Jul 24 19:49:27 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified Fri Apr 26 12:38:55 MET DST 1996 by Martin Schulze (joey@linux.de) .\" Modified 2001-11-13, aeb +.\" Modified 2001-12-13, joey, aeb .\" Modified 2004-11-16, mtk .\" -.\" Japanese Version Copyright (c) 1997 Hiroaki Nagoya -.\" all rights reserved. -.\" Translated 1997-02-10, Hiroaki Nagoya -.\" Updated 1999-09-01, Kentaro Shirakata -.\" Updated 2001-10-15, Kentaro Shirakata -.\" Updated 2001-12-13, Kentaro Shirakata -.\" Updated 2002-01-03, Kentaro Shirakata -.\" Updated 2005-02-24, Akihiro MOTOKI -.\" Updated 2008-04-04, Akihiro MOTOKI , LDP v2.79 -.\" Updated 2008-08-08, Akihiro MOTOKI , LDP v3.05 -.\" Updated 2008-11-10, Akihiro MOTOKI , LDP v3.13 +.\"******************************************************************* .\" -.\"WORD: Coordinated Univarsal Time 協定世界時 -.\"WORD: broken-down time 要素別の時刻 +.\" This file was generated with po4a. Translate the source file. .\" -.TH CTIME 3 2010-02-25 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH CTIME 3 2010\-02\-25 "" "Linux Programmer's Manual" .SH 名前 -.\"O asctime, ctime, gmtime, localtime, mktime, asctime_r, ctime_r, gmtime_r, -.\"O localtime_r \- transform date and time to broken-down time or ASCII asctime, ctime, gmtime, localtime, mktime, asctime_r, ctime_r, gmtime_r, localtime_r \- 日付と時刻を要素別の時刻や ASCII に変換する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "char *asctime(const struct tm *" tm ); +\fBchar *asctime(const struct tm *\fP\fItm\fP\fB);\fP .br -.BI "char *asctime_r(const struct tm *" tm ", char *" buf ); +\fBchar *asctime_r(const struct tm *\fP\fItm\fP\fB, char *\fP\fIbuf\fP\fB);\fP .sp -.BI "char *ctime(const time_t *" timep ); +\fBchar *ctime(const time_t *\fP\fItimep\fP\fB);\fP .br -.BI "char *ctime_r(const time_t *" timep ", char *" buf ); +\fBchar *ctime_r(const time_t *\fP\fItimep\fP\fB, char *\fP\fIbuf\fP\fB);\fP .sp -.BI "struct tm *gmtime(const time_t *" timep ); +\fBstruct tm *gmtime(const time_t *\fP\fItimep\fP\fB);\fP .br -.BI "struct tm *gmtime_r(const time_t *" timep ", struct tm *" result ); +\fBstruct tm *gmtime_r(const time_t *\fP\fItimep\fP\fB, struct tm *\fP\fIresult\fP\fB);\fP .sp -.BI "struct tm *localtime(const time_t *" timep ); +\fBstruct tm *localtime(const time_t *\fP\fItimep\fP\fB);\fP .br -.BI "struct tm *localtime_r(const time_t *" timep ", struct tm *" result ); +\fBstruct tm *localtime_r(const time_t *\fP\fItimep\fP\fB, struct tm *\fP\fIresult\fP\fB);\fP .sp -.BI "time_t mktime(struct tm *" tm ); +\fBtime_t mktime(struct tm *\fP\fItm\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .ad l .sp -.BR asctime_r (), -.BR ctime_r (), -.BR gmtime_r (), -.BR localtime_r (): +\fBasctime_r\fP(), \fBctime_r\fP(), \fBgmtime_r\fP(), \fBlocaltime_r\fP(): .RS -_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || -_SVID_SOURCE || _POSIX_SOURCE +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE +|| _POSIX_SOURCE .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR ctime (), -.\"O .BR gmtime () -.\"O and -.\"O .BR localtime () -.\"O functions all take -.\"O an argument of data type \fItime_t\fP which represents calendar time. -.\"O When interpreted as an absolute time value, it represents the number of -.\"O seconds elapsed since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). -関数 -.BR ctime (), -.BR gmtime (), -.BR localtime () -は -\fItime_t\fP 型のカレンダー時刻を引き数にとる。 -引き数が絶対値として解釈される場合は、時刻紀元 (Epoch; -1970-01-01 00:00:00 +0000 (UTC)) からの経過秒数と解釈される。 +関数 \fBctime\fP(), \fBgmtime\fP(), \fBlocaltime\fP() は \fItime_t\fP 型のカレンダー時刻を引き数にとる。 +引き数が絶対値として解釈される場合は、時刻紀元 (Epoch; 1970\-01\-01 00:00:00 +0000 (UTC)) +からの経過秒数と解釈される。 .PP -.\"O The -.\"O .BR asctime () -.\"O and -.\"O .BR mktime () -.\"O functions both take an argument -.\"O representing broken-down time which is a representation -.\"O separated into year, month, day, etc. -関数 -.BR asctime () -と -.BR mktime () -は -年・月・日などに分離された要素別の時刻を引き数とする。 +関数 \fBasctime\fP() と \fBmktime\fP() は 年・月・日などに分離された要素別の時刻を引き数とする。 .PP -.\"O Broken-down time is stored -.\"O in the structure \fItm\fP which is defined in \fI\fP as follows: -要素別の時刻は \fI\fP で以下のように定義されている -\fItm\fP 構造体に保持される。 +要素別の時刻は \fI\fP で以下のように定義されている \fItm\fP 構造体に保持される。 .sp .in +4n .nf struct tm { -.\"O int tm_sec; /* seconds */ -.\"O int tm_min; /* minutes */ -.\"O int tm_hour; /* hours */ -.\"O int tm_mday; /* day of the month */ -.\"O int tm_mon; /* month */ -.\"O int tm_year; /* year */ -.\"O int tm_wday; /* day of the week */ -.\"O int tm_yday; /* day in the year */ -.\"O int tm_isdst; /* daylight saving time */ int tm_sec; /* 秒 */ int tm_min; /* 分 */ int tm_hour; /* 時間 */ @@ -157,420 +98,100 @@ struct tm { .fi .in .PP -.\"O The members of the \fItm\fP structure are: \fItm\fP 構造体のメンバーは以下の通り: -.TP 10 -.I tm_sec -.\"O The number of seconds after the minute, normally in the range 0 to 59, -.\"O but can be up to 60 to allow for leap seconds. -秒数、ふつうは 0 から 59 までの値、 -しかし閏秒のため 60 までの値は許される。 -.TP -.I tm_min -.\"O The number of minutes after the hour, in the range 0 to 59. +.TP 10 +\fItm_sec\fP +秒数、ふつうは 0 から 59 までの値、 しかし閏秒のため 60 までの値は許される。 +.TP +\fItm_min\fP 分数、0 から 59 までの値。 -.TP -.I tm_hour -.\"O The number of hours past midnight, in the range 0 to 23. +.TP +\fItm_hour\fP 真夜中からの通算時間、0 から 23 までの値。 -.TP -.I tm_mday -.\"O The day of the month, in the range 1 to 31. +.TP +\fItm_mday\fP 月はじめからの日数、1 から 31 までの値。 -.TP -.I tm_mon -.\"O The number of months since January, in the range 0 to 11. +.TP +\fItm_mon\fP 1月からの通算月数、0 から 11 までの値。 -.TP -.I tm_year -.\"O The number of years since 1900. +.TP +\fItm_year\fP 1900 年からの通算年数。 -.TP -.I tm_wday -.\"O The number of days since Sunday, in the range 0 to 6. +.TP +\fItm_wday\fP 日曜日からの通算日数(曜日)。0 から 6 までの値。 -.TP -.I tm_yday -.\"O The number of days since January 1, in the range 0 to 365. +.TP +\fItm_yday\fP 1 月 1 日からの通算日数、0 から 365 までの値。 -.TP -.I tm_isdst -.\"O A flag that indicates whether daylight saving time is in effect at the -.\"O time described. -.\"O The value is positive if daylight saving time is in -.\"O effect, zero if it is not, and negative if the information is not -.\"O available. -夏時間が有効かどうかのフラグ。 -正の値ならば夏時間は有効になり、0 ならば無効、負の値ならばこの情報には -意味がない。 +.TP +\fItm_isdst\fP +夏時間が有効かどうかのフラグ。 正の値ならば夏時間は有効になり、0 ならば無効、負の値ならばこの情報には 意味がない。 .PP -.\"O The call -.\"O .BI ctime( t ) -.\"O is equivalent to -.\"O .BI asctime(localtime( t )) \fR. -.\"O It converts the calendar time \fIt\fP into a -.\"O null-terminated string of the form -.\"O .sp -.\"O .RS -.\"O "Wed Jun 30 21:49:08 1993\\n" -.\"O .RE -.\"O .sp -.BI ctime( t ) -関数は、 -.BI asctime(localtime( t )) -と等価である。 -カレンダー時刻 \fIt\fP を +\fBctime(\fP\fIt\fP\fB)\fP 関数は、 \fBasctime(localtime(\fP\fIt\fP\fB))\fP と等価である。 カレンダー時刻 \fIt\fP を .sp .RS -"Wed Jun 30 21:49:08 1993\\n" +"Wed Jun 30 21:49:08 1993\en" .RE .sp -という形式の NULL 終端された文字列へ変換する。 -.\"O The abbreviations for the days of the week are "Sun", "Mon", "Tue", "Wed", -.\"O "Thu", "Fri", and "Sat". -.\"O The abbreviations for the months are "Jan", -.\"O "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", and -.\"O "Dec". -.\"O The return value points to a statically allocated string which -.\"O might be overwritten by subsequent calls to any of the date and time -.\"O functions. -.\"O The function also sets the external -.\"O variables \fItzname\fP, \fItimezone\fP, and \fIdaylight\fP (see -.\"O .BR tzset (3)) -.\"O with information about the current timezone. -曜日の略称は -"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" である。 -月の略称は "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", -"Sep", "Oct", "Nov", "Dec" である。 -返り値は、静的 (static) に割り当てられた文字列へのポインタである。 -この文字列は、日付・時刻関数のいずれかが呼び出されると上書きされることがある。 -またこの関数は大域変数 \fItzname\fP, \fItimezone\fP, \fIdaylight\fP -に現在のタイムゾーンの情報を設定する -.RB ( tzset (3) -参照)。 -.\"O The reentrant version -.\"O .BR ctime_r () -.\"O does the same, but stores the -.\"O string in a user-supplied buffer -.\"O which should have room for at least 26 bytes. -.\"O It need not -.\"O set \fItzname\fP, \fItimezone\fP, and \fIdaylight\fP. -リエントラント版である -.BR ctime_r () -も同様だが、 -文字列はユーザーが用意したバッファに格納される。バッファのサイズは -少なくとも 26 バイト以上でなければならない。 -この関数は \fItzname\fP, \fItimezone\fP, and \fIdaylight\fP -を設定する必要はない。 +という形式の NULL 終端された文字列へ変換する。 曜日の略称は "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", +"Sat" である。 月の略称は "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", +"Sep", "Oct", "Nov", "Dec" である。 返り値は、静的 (static) に割り当てられた文字列へのポインタである。 +この文字列は、日付・時刻関数のいずれかが呼び出されると上書きされることがある。 またこの関数は大域変数 \fItzname\fP, \fItimezone\fP, +\fIdaylight\fP に現在のタイムゾーンの情報を設定する (\fBtzset\fP(3) 参照)。 リエントラント版である \fBctime_r\fP() +も同様だが、 文字列はユーザーが用意したバッファに格納される。バッファのサイズは 少なくとも 26 バイト以上でなければならない。 この関数は +\fItzname\fP, \fItimezone\fP, and \fIdaylight\fP を設定する必要はない。 .PP -.\"O The -.\"O .BR gmtime () -.\"O function converts the calendar time \fItimep\fP to -.\"O broken-down time representation, expressed in Coordinated Universal Time -.\"O (UTC). -.\"O It may return NULL when the year does not fit into an integer. -関数 -.BR gmtime () -は、カレンダー時刻 \fItimep\fP を -協定世界時 (UTC) での要素別の時刻へ変換する。 -年が整数型に収まらない場合、NULL を返す。 -.\"O The return value points to a statically allocated struct which might be -.\"O overwritten by subsequent calls to any of the date and time functions. -返り値は静的に確保された構造体を指しており、この後で -日付や時刻に関する関数のいずれかが呼び出されると -上書きされる可能性がある。 -.\"O The -.\"O .BR gmtime_r () -.\"O function does the same, but stores the data in a -.\"O user-supplied struct. -.BR gmtime_r () -も同様だが、 -データはユーザーが用意した構造体に格納される。 +関数 \fBgmtime\fP() は、カレンダー時刻 \fItimep\fP を 協定世界時 (UTC) での要素別の時刻へ変換する。 +年が整数型に収まらない場合、NULL を返す。 返り値は静的に確保された構造体を指しており、この後で 日付や時刻に関する関数のいずれかが呼び出されると +上書きされる可能性がある。 \fBgmtime_r\fP() も同様だが、 データはユーザーが用意した構造体に格納される。 .PP -.\"O The -.\"O .BR localtime () -.\"O function converts the calendar time \fItimep\fP to -.\"O broken-down time representation, -.\"O expressed relative to the user's specified timezone. -.\"O The function acts as if it called -.\"O .BR tzset (3) -.\"O and sets the external variables \fItzname\fP with -.\"O information about the current timezone, \fItimezone\fP with the difference -.\"O between Coordinated Universal Time (UTC) and local standard time in -.\"O seconds, and \fIdaylight\fP to a nonzero value if daylight savings -.\"O time rules apply during some part of the year. -関数 -.BR localtime () -は、カレンダー時刻 \fItimep\fP を -ユーザが指定したタイムゾーンでの時刻要素別の表現へ変換する。 -この関数は -.BR tzset (3) -を呼び出したかのように振舞い、 -大域変数 \fItzname\fP に現在のタイムゾーンの情報を設定する。 -また、\fItimezone\fP に協定世界時 (UTC) とローカル標準時との -時差の秒数を設定し、 -一年の一部で夏時間が適用される場合は \fIdaylight\fP に 0 が設定される。 -.\"O The return value points to a statically allocated struct which might be -.\"O overwritten by subsequent calls to any of the date and time functions. -返り値は静的に確保された構造体を指しており、この後で -日付や時刻に関する関数のいずれかが呼び出されると -上書きされる可能性がある。 -.\"O The -.\"O .BR localtime_r () -.\"O function does the same, but stores the data in a -.\"O user-supplied struct. -.\"O It need not set \fItzname\fP, \fItimezone\fP, and \fIdaylight\fP. -.BR localtime_r () -も同様だが、 -データはユーザーが用意した構造体に格納される。 -この関数は \fItzname\fP, \fItimezone\fP, and \fIdaylight\fP -を設定する必要はない。 +関数 \fBlocaltime\fP() は、カレンダー時刻 \fItimep\fP を ユーザが指定したタイムゾーンでの時刻要素別の表現へ変換する。 この関数は +\fBtzset\fP(3) を呼び出したかのように振舞い、 大域変数 \fItzname\fP に現在のタイムゾーンの情報を設定する。 +また、\fItimezone\fP に協定世界時 (UTC) とローカル標準時との 時差の秒数を設定し、 一年の一部で夏時間が適用される場合は +\fIdaylight\fP に 0 が設定される。 返り値は静的に確保された構造体を指しており、この後で 日付や時刻に関する関数のいずれかが呼び出されると +上書きされる可能性がある。 \fBlocaltime_r\fP() も同様だが、 データはユーザーが用意した構造体に格納される。 この関数は +\fItzname\fP, \fItimezone\fP, and \fIdaylight\fP を設定する必要はない。 .PP -.\"O The -.\"O .BR asctime () -.\"O function converts the broken-down time value -.\"O \fItm\fP into a null-terminated string with the same format as -.\"O .BR ctime (). -.\"O The return value points to a statically allocated string which might be -.\"O overwritten by subsequent calls to any of the date and time functions. -関数 -.BR asctime () -は、要素別の時刻 \fItm\fP を -.BR ctime () -と同じ形式の NULL 終端された文字列へ変換する。 -返り値は静的に割り当てられた文字列へのポインタである。この文字列は、 -日付・時刻関数のいずれかが呼び出されると上書きされることがある。 -.\"O The -.\"O .BR asctime_r () -.\"O function does the same, but stores the string in -.\"O a user-supplied buffer which should have room for at least 26 bytes. -リエントラント版である -.BR asctime_r () -も同様だが、 -文字列はユーザーが用意したバッファに格納される。バッファのサイズは -少なくとも 26 バイト以上でなければならない。 +関数 \fBasctime\fP() は、要素別の時刻 \fItm\fP を \fBctime\fP() と同じ形式の NULL 終端された文字列へ変換する。 +返り値は静的に割り当てられた文字列へのポインタである。この文字列は、 日付・時刻関数のいずれかが呼び出されると上書きされることがある。 +リエントラント版である \fBasctime_r\fP() も同様だが、 文字列はユーザーが用意したバッファに格納される。バッファのサイズは 少なくとも +26 バイト以上でなければならない。 .PP -.\"O The -.\"O .BR mktime () -.\"O function converts a broken-down time structure, expressed -.\"O as local time, to calendar time representation. -.\"O The function ignores -.\"O the values supplied by the caller in the -.\"O .I tm_wday -.\"O and -.\"O .I tm_yday -.\"O fields. -.\"O The value specified in the -.\"O .I tm_isdst -.\"O field informs -.\"O .BR mktime () -.\"O whether or not daylight saving time (DST) -.\"O is in effect for the time supplied in the -.\"O .I tm -.\"O structure: -.\"O a positive value means DST is in effect; -.\"O zero means that DST is not in effect; -.\"O and a negative value means that -.\"O .BR mktime () -.\"O should (use timezone information and system databases to) -.\"O attempt to determine whether DST is in effect at the specified time. -関数 -.BR mktime () -は、(ローカルタイムで記述されている) 要素別の時刻を -カレンダー時刻へ変換する。この際、呼び出し元がフィールド -.I tm_wday -と -.I tm_yday -で指定した値は無視される。 -.BR mktime () -は、フィールド -.I tm_isdst -で指定された値により、 -.I tm -構造体で渡された時刻で夏時間 (daylight saving time; DST) が有効になって -いるかを知る。 -正の値は夏時間が有効であることを意味する。 -負の値であれば、 -.BR mktime () -は (タイムゾーン情報とシステムのデータベースを使って) +関数 \fBmktime\fP() は、(ローカルタイムで記述されている) 要素別の時刻を カレンダー時刻へ変換する。この際、呼び出し元がフィールド +\fItm_wday\fP と \fItm_yday\fP で指定した値は無視される。 \fBmktime\fP() は、フィールド \fItm_isdst\fP +で指定された値により、 \fItm\fP 構造体で渡された時刻で夏時間 (daylight saving time; DST) が有効になって いるかを知る。 +正の値は夏時間が有効であることを意味する。 負の値であれば、 \fBmktime\fP() は (タイムゾーン情報とシステムのデータベースを使って) 指定された時刻で夏時間が有効かどうかを判断する必要があることを意味する。 -.\"O The -.\"O .BR mktime () -.\"O function modifies the fields of the -.\"O .IR tm -.\"O structure as follows: -.\"O .I tm_wday -.\"O and -.\"O .I tm_yday -.\"O are set to values determined from the contents of the other fields; -.BR mktime () -は -.I tm -構造体の各フィールドを以下のように修正する。 -.I tm_wday -と -.I tm_yday -には他のフィールドの内容から求めた値を設定する。 -.\"O if structure members are outside their valid interval, they will be -.\"O normalized (so that, for example, 40 October is changed into 9 November); -.\"O .I tm_isdst -.\"O is set (regardless of its initial value) -.\"O to a positive value or to 0, respectively, -.\"O to indicate whether DST is or is not in effect at the specified time. -構造体の要素が有効な範囲にない場合、正規化される -(例えば、10 月 40 日は 11 月 9 日に変更される)。 -.I tm_isdst -には (最初の値にかかわらず) 正の値か 0 が設定される。 -正の値は指定された時間で夏時間が有効であることを示し、 -0 は無効であることを示す。 -.\"O Calling -.\"O .BR mktime () -.\"O also sets the external variable \fItzname\fP with -.\"O information about the current timezone. -関数 -.BR mktime () -を呼び出すと、 -大域変数 \fItzname\fP が現在のタイムゾーンに設定される。 +\fBmktime\fP() は \fItm\fP 構造体の各フィールドを以下のように修正する。 \fItm_wday\fP と \fItm_yday\fP +には他のフィールドの内容から求めた値を設定する。 構造体の要素が有効な範囲にない場合、正規化される (例えば、10 月 40 日は 11 月 9 +日に変更される)。 \fItm_isdst\fP には (最初の値にかかわらず) 正の値か 0 が設定される。 +正の値は指定された時間で夏時間が有効であることを示し、 0 は無効であることを示す。 関数 \fBmktime\fP() を呼び出すと、 大域変数 +\fItzname\fP が現在のタイムゾーンに設定される。 -.\"O If the specified broken-down -.\"O time cannot be represented as calendar time (seconds since the Epoch), -.\"O .BR mktime () -.\"O returns -.\"O .I (time_t)\ \-1 -.\"O and does not alter the -.\"O members of the broken-down time structure. -要素別の時刻をカレンダー時刻 (紀元 (Epoch) からの秒数) で表現できない場合、 -.BR mktime () -は -.I (time_t)\ (-1) -を返し、要素別の時刻の構造体メンバーを変更しない。 -.\"O .SH "RETURN VALUE" +要素別の時刻をカレンダー時刻 (紀元 (Epoch) からの秒数) で表現できない場合、 \fBmktime\fP() は \fI(time_t)\ (\-1)\fP を返し、要素別の時刻の構造体メンバーを変更しない。 .SH 返り値 -.\"O Each of these functions returns the value described, or NULL -.\"O (\-1 in case of -.\"O .BR mktime ()) -.\"O in case an error was detected. -各関数はそれぞれ前述した値を返す。エラーの場合は NULL -.RB ( mktime () -では \-1) を返す。 +各関数はそれぞれ前述した値を返す。エラーの場合は NULL (\fBmktime\fP() では \-1) を返す。 .SH 準拠 -.\"O POSIX.1-2001. -.\"O C89 and C99 specify -.\"O .BR asctime (), -.\"O .BR ctime (), -.\"O .BR gmtime (), -.\"O .BR localtime (), -.\"O and -.\"O .BR mktime (). -POSIX.1-2001. -C89 と C99 では -.BR asctime (), -.BR ctime (), -.BR gmtime (), -.BR localtime (), -.BR mktime () -が規定されている。 -.\"O POSIX.1-2008 marks -.\"O .BR asctime (), -.\"O .BR asctime_r (), -.\"O .BR ctime (), -.\"O and -.\"O .BR ctime_r () -.\"O as obsolete, -.\"O recommending the use of -.\"O .BR strftime (3) -.\"O instead. -POSIX.1-2008 は、 -.BR asctime (), -.BR asctime_r (), -.BR ctime (), -.BR ctime_r () -を廃止予定としている。 -代わりに、 -.BR strftime (3) +POSIX.1\-2001. C89 と C99 では \fBasctime\fP(), \fBctime\fP(), \fBgmtime\fP(), +\fBlocaltime\fP(), \fBmktime\fP() が規定されている。 POSIX.1\-2008 は、 \fBasctime\fP(), +\fBasctime_r\fP(), \fBctime\fP(), \fBctime_r\fP() を廃止予定としている。 代わりに、 \fBstrftime\fP(3) の使用が推奨されている。 -.\"O .SH NOTES .SH 注意 -.\"O The four functions -.\"O .BR asctime (), -.\"O .BR ctime (), -.\"O .BR gmtime () -.\"O and -.\"O .BR localtime () -.\"O return a pointer to static data and hence are not thread-safe. -.BR asctime (), -.BR ctime (), -.BR gmtime (), -.BR localtime () -の 4 つの関数は静的データへのポインタを返すので、スレッドセーフではない。 -.\"O Thread-safe versions -.\"O .BR asctime_r (), -.\"O .BR ctime_r (), -.\"O .BR gmtime_r () -.\"O and -.\"O .BR localtime_r () -.\"O are specified by SUSv2, and available since libc 5.2.5. -これらの関数のスレッドセーフ版である -.BR asctime_r (), -.BR ctime_r (), -.BR gmtime_r (), -.BR localtime_r () -は SUSv2 で規定されており、 -libc 5.2.5 以降で利用できる。 +\fBasctime\fP(), \fBctime\fP(), \fBgmtime\fP(), \fBlocaltime\fP() の 4 +つの関数は静的データへのポインタを返すので、スレッドセーフではない。 これらの関数のスレッドセーフ版である \fBasctime_r\fP(), +\fBctime_r\fP(), \fBgmtime_r\fP(), \fBlocaltime_r\fP() は SUSv2 で規定されており、 libc 5.2.5 +以降で利用できる。 -.\"O POSIX.1-2001 says: -.\"O "The -.\"O .BR asctime (), -.\"O .BR ctime (), -.\"O .BR gmtime (), -.\"O and -.\"O .BR localtime () -.\"O functions shall return values in one of two static objects: -.\"O a broken-down time structure and an array of type -.\"O .IR char . -.\"O Execution of any of the functions may overwrite the information returned -.\"O in either of these objects by any of the other functions." -.\"O This can occur in the glibc implementation. -POSIX.1-2001 では、「関数 -.BR asctime (), -.BR ctime (), -.BR gmtime (), -.BR localtime () -は、要素別の時刻の構造体か -.I char -型の配列かのどちらかの静的オブジェクトを返すものとする。 -これらの関数のいずれかを実行すると、他の関数のどれかがこれらの -静的オブジェクトのどちらかに格納して返した情報が上書きされるかも -しれない。」となっている。 -このことは glibc の実装で起こりうる。 +POSIX.1\-2001 では、「関数 \fBasctime\fP(), \fBctime\fP(), \fBgmtime\fP(), \fBlocaltime\fP() +は、要素別の時刻の構造体か \fIchar\fP 型の配列かのどちらかの静的オブジェクトを返すものとする。 +これらの関数のいずれかを実行すると、他の関数のどれかがこれらの 静的オブジェクトのどちらかに格納して返した情報が上書きされるかも +しれない。」となっている。 このことは glibc の実装で起こりうる。 .LP -.\"O In many implementations, including glibc, a 0 in -.\"O .I tm_mday -.\"O is interpreted as meaning the last day of the preceding month. -glibc を含む多くの実装では、 -.I tm_mday -に 0 を指定すると前月の最終日を意味していると解釈される。 +glibc を含む多くの実装では、 \fItm_mday\fP に 0 を指定すると前月の最終日を意味していると解釈される。 .LP -.\"O The glibc version of \fIstruct tm\fP has additional fields -.\"O .sp -.\"O .RS -.\"O .nf -.\"O long tm_gmtoff; /* Seconds east of UTC */ -.\"O const char *tm_zone; /* Timezone abbreviation */ -.\"O .fi -.\"O .RE -.\"O .sp -.\"O defined when -.\"O .B _BSD_SOURCE -.\"O was set before including -.\"O .IR . -glibc では、 -.I -がインクルードされる前に -.B _BSD_SOURCE -が定義されると、 -\fIstruct tm\fP に以下のフィールドが追加される。 +glibc では、 \fI\fP がインクルードされる前に \fB_BSD_SOURCE\fP が定義されると、 \fIstruct +tm\fP に以下のフィールドが追加される。 .sp .RS .nf @@ -579,44 +200,13 @@ const char *tm_zone; /* Timezone abbreviation */ .fi .RE .sp -.\"O This is a BSD extension, present in 4.3BSD-Reno. -これは BSD 拡張であり、4.3BSD-Reno から現れた。 +これは BSD 拡張であり、4.3BSD\-Reno から現れた。 -.\"O According to POSIX.1-2004, -.\"O .BR localtime () -.\"O is required to behave as though -.\"O .BR tzset (3) -.\"O was called, while -.\"O .BR localtime_r () -.\"O does not have this requirement. -.\"O .\" See http://thread.gmane.org/gmane.comp.time.tz/2034/ -.\"O For portable code -.\"O .BR tzset (3) -.\"O should be called before -.\"O .BR localtime_r (). -POSIX.1-2004 によると、 -.BR localtime () -はあたかも -.BR tzset (3) -が呼ばれたかのように振舞うことが要求されているが、 -.BR localtime_r () -にはこの要件はない。 -.\" http://thread.gmane.org/gmane.comp.time.tz/2034/ を参照。 -移植性が必要なコードでは、 -.BR localtime_r () -の前に -.BR tzset (3) -を呼び出しておくべきである。 -.\"O .SH "SEE ALSO" +.\" See http://thread.gmane.org/gmane.comp.time.tz/2034/ +POSIX.1\-2004 によると、 \fBlocaltime\fP() はあたかも \fBtzset\fP(3) +が呼ばれたかのように振舞うことが要求されているが、 \fBlocaltime_r\fP() にはこの要件はない。 移植性が必要なコードでは、 +\fBlocaltime_r\fP() の前に \fBtzset\fP(3) を呼び出しておくべきである。 .SH 関連項目 -.BR date (1), -.BR gettimeofday (2), -.BR time (2), -.BR utime (2), -.BR clock (3), -.BR difftime (3), -.BR strftime (3), -.BR strptime (3), -.BR timegm (3), -.BR tzset (3), -.BR time (7) +\fBdate\fP(1), \fBgettimeofday\fP(2), \fBtime\fP(2), \fButime\fP(2), \fBclock\fP(3), +\fBdifftime\fP(3), \fBstrftime\fP(3), \fBstrptime\fP(3), \fBtimegm\fP(3), \fBtzset\fP(3), +\fBtime\fP(7) diff --git a/draft/man3/daemon.3 b/draft/man3/daemon.3 index 91c4e037..853a56fb 100644 --- a/draft/man3/daemon.3 +++ b/draft/man3/daemon.3 @@ -31,142 +31,42 @@ .\" .\" @(#)daemon.3 8.1 (Berkeley) 6/9/93 .\" Added mentioning of glibc weirdness wrt unistd.h. 5/11/98, Al Viro +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 2000-2001 Yuichi SATO -.\" all rights reserved. -.\" Translated Tue Jun 27 10:54:22 JST 2000 -.\" by Yuichi SATO -.\" Updated & Modified Mon Jan 14 06:50:04 JST 2002 -.\" by Yuichi SATO +.\" This file was generated with po4a. Translate the source file. .\" -.\"WORD: detach 分離 -.\"WORD: controlling terminal 制御端末 -.\"WORD: current working directory カレント・ワーキング・ディレクトリ -.\"WORD: global variable 大域変数 -.\" -.TH DAEMON 3 2009-12-05 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH DAEMON 3 2009\-12\-05 GNU "Linux Programmer's Manual" .SH 名前 -.\"O daemon \- run in the background daemon \- バックグラウンドで動作させる -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP +.sp +\fBint daemon(int \fP\fInochdir\fP\fB, int \fP\fInoclose\fP\fB);\fP +.sp +.in -4n +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.in .sp -.BI "int daemon(int " nochdir ", int " noclose ); -.\"O .sp -.\"O .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): -.\"O .in -.\"O .sp -.\"O .BR daemon (): -.\"O _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) -.\"O .SH DESCRIPTION +\fBdaemon\fP(): _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) .SH 説明 -.\"O The -.\"O .BR daemon () -.\"O function is for programs wishing to detach themselves from the -.\"O controlling terminal and run in the background as system daemons. -.BR daemon () -は、制御端末から分離させてシステムデーモンとして動作させたい -プログラムのための関数である。 +\fBdaemon\fP() は、制御端末から分離させてシステムデーモンとして動作させたい プログラムのための関数である。 .PP -.\"O If -.\"O .I nochdir -.\"O is zero, -.\"O .BR daemon () -.\"O changes the calling process's current working directory -.\"O to the root directory ("/"); -.\"O otherwise, the current working directory is left unchanged. -.I nochdir -が 0 の場合、 -.BR daemon () -は呼び出したプロセスの現在の作業ディレクトリ (current working directory) -をルートディレクトリ ("/") に変更する。 -それ以外の場合、現在の作業ディレクトリは変更されない。 +\fInochdir\fP が 0 の場合、 \fBdaemon\fP() は呼び出したプロセスの現在の作業ディレクトリ (current working +directory) をルートディレクトリ ("/") に変更する。 それ以外の場合、現在の作業ディレクトリは変更されない。 .PP -.\"O If -.\"O .I noclose -.\"O is zero, -.\"O .BR daemon () -.\"O redirects standard input, standard output and standard error -.\"O to \fI/dev/null\fP; -.\"O otherwise, no changes are made to these file descriptors. -.I noclose -が 0 の場合、 -.BR daemon () -は標準入力・標準出力・標準エラーを \fI/dev/null\fP にリダイレクトする。 +\fInoclose\fP が 0 の場合、 \fBdaemon\fP() は標準入力・標準出力・標準エラーを \fI/dev/null\fP にリダイレクトする。 それ以外の場合、これらのファイル・ディスクリプタは変更されない。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O (This function forks, and if the -.\"O .BR fork (2) -.\"O succeeds, the parent calls -.\"O .\" not .IR in order not to underline _ -.\"O .BR _exit (2), -.\"O so that further errors are seen by the child only.) -.\"O On success -.\"O .BR daemon () -.\"O returns zero. -(この関数が fork して -.BR fork (2) -が成功すると、親プロセスでは -.BR _exit (2) -を呼び出すので、これ以降のエラーは子プロセスからしか見れない)。 -.\" アンダースコア _ に下線を引かないようにするため .IR は使わない。 -成功した場合、 -.BR daemon () -は 0 を返す。 -.\"O If an error occurs, -.\"O .BR daemon () -.\"O returns \-1 and sets -.\"O .I errno -.\"O to any of the errors specified for the -.\"O .BR fork (2) -.\"O and -.\"O .BR setsid (2). -エラーが起こった場合、 -.BR daemon () -は \-1 を返す。 -さらに、 -.I errno -に -.BR fork (2) -と -.BR setsid (2) +.\" not .IR in order not to underline _ +(この関数が fork して \fBfork\fP(2) が成功すると、親プロセスでは \fB_exit\fP(2) +を呼び出すので、これ以降のエラーは子プロセスからしか見れない)。 成功した場合、 \fBdaemon\fP() は 0 を返す。 エラーが起こった場合、 +\fBdaemon\fP() は \-1 を返す。 さらに、 \fIerrno\fP に \fBfork\fP(2) と \fBsetsid\fP(2) に関して規定されたエラーを設定する。 -.\"O .SH CONFORMING TO .SH 準拠 -.\"O Not in POSIX.1-2001. -.\"O A similar function appears on the BSDs. -.\"O The -.\"O .BR daemon () -.\"O function first appeared in 4.4BSD. -POSIX.1-2001 にはない。 -同様の関数が BSD には見られる。 -.BR daemon () -関数は 4.4BSD で始めて登場した。 -.\"O .SH NOTES +POSIX.1\-2001 にはない。 同様の関数が BSD には見られる。 \fBdaemon\fP() 関数は 4.4BSD で始めて登場した。 .SH 注意 -.\"O The glibc implementation can also return \-1 when -.\"O .I /dev/null -.\"O exists but is not a character device with the expected -.\"O major and minor numbers. -.\"O In this case -.\"O .I errno -.\"O need not be set. -.I /dev/null -は存在するが、想定するメジャー番号とマイナー番号の -キャラクタデバイスでなかった場合、 -glibc の実装でも \-1 が返される。 -この場合、 -.I errno -が設定される必要はない。 -.\"O .SH SEE ALSO +\fI/dev/null\fP は存在するが、想定するメジャー番号とマイナー番号の キャラクタデバイスでなかった場合、 glibc の実装でも \-1 +が返される。 この場合、 \fIerrno\fP が設定される必要はない。 .SH 関連項目 -.BR fork (2), -.BR setsid (2) +\fBfork\fP(2), \fBsetsid\fP(2) diff --git a/draft/man3/des_crypt.3 b/draft/man3/des_crypt.3 index 2c8e7bdc..12138cf9 100644 --- a/draft/man3/des_crypt.3 +++ b/draft/man3/des_crypt.3 @@ -7,229 +7,71 @@ .\" Copyright Sun Microsystems, Inc (and is provided for unrestricted use, .\" see other Sun RPC sources). .\" -.\" Japanese Version Copyright (c) 2004 Yuichi SATO -.\" all rights reserved. -.\" Translated Fri Jul 23 05:53:35 JST 2004 -.\" by Yuichi SATO +.\"******************************************************************* .\" -.TH DES_CRYPT 3 2007-05-18 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH DES_CRYPT 3 2007\-05\-18 "" "Linux Programmer's Manual" .SH 名前 -.\"O des_crypt, ecb_crypt, cbc_crypt, des_setparity, DES_FAILED \- fast -.\"O DES encryption des_crypt, ecb_crypt, cbc_crypt, des_setparity, DES_FAILED \- 高速な DES 暗号化 -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .\" Sun version -.\" Sun の場合は +.\" Sun version .\" .B #include -.B #include +\fB#include \fP .LP -.BI "int ecb_crypt(char *" key ", char *" data ", unsigned " datalen , -.BI " unsigned " mode ); +\fBint ecb_crypt(char *\fP\fIkey\fP\fB, char *\fP\fIdata\fP\fB, unsigned \fP\fIdatalen\fP\fB,\fP +\fB unsigned \fP\fImode\fP\fB);\fP .LP -.BI "int cbc_crypt(char *" key ", char *" data ", unsigned " datalen , -.BI " unsigned " mode ", char *" ivec ); +\fBint cbc_crypt(char *\fP\fIkey\fP\fB, char *\fP\fIdata\fP\fB, unsigned \fP\fIdatalen\fP\fB,\fP +\fB unsigned \fP\fImode\fP\fB, char *\fP\fIivec\fP\fB);\fP .LP -.BI "void des_setparity(char *" key ); +\fBvoid des_setparity(char *\fP\fIkey\fP\fB);\fP .LP -.BI "int DES_FAILED(int " status ); +\fBint DES_FAILED(int \fP\fIstatus\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR ecb_crypt () -.\"O and -.\"O .BR cbc_crypt () -.\"O implement the -.\"O NBS -.\"O DES -.\"O (Data Encryption Standard). -.BR ecb_crypt () -と -.BR cbc_crypt () -は -NBS -DES -(Data Encryption Standard, データ暗号化規格) を実装している。 -.\"O These routines are faster and more general purpose than -.\"O .BR crypt (3). -これらのルーチンは -.BR crypt (3) -よりも高速でより一般的な目的に使用できる。 -.\"O They also are able to utilize -.\"O DES -.\"O hardware if it is available. -利用可能であれば、これらのルーチンは -DES -ハードウェアを使用することもできる。 -.\"O .BR ecb_crypt () -.\"O encrypts in -.\"O ECB -.\"O (Electronic Code Book) -.\"O mode, which encrypts blocks of data independently. -.BR ecb_crypt () -は -ECB -(Electronic Code Book) モードで暗号化する。 -このモードでは (個々の) データのブロックを独立して暗号化する -.\"O .BR cbc_crypt () -.\"O encrypts in -.\"O CBC -.\"O (Cipher Block Chaining) -.\"O mode, which chains together -.\"O successive blocks. -.BR cbc_crypt () -は -CBC -(Cipher Block Chaining) モードで暗号化する。 -このモードでは連続するブロックを互いに連鎖させて暗号化する。 -.\"O CBC -.\"O mode protects against insertions, deletions and -.\"O substitutions of blocks. -.\"O Also, regularities in the clear text will -.\"O not appear in the cipher text. -CBC -はブロックの挿入・削除・置き換えから保護する。 -また平文の規則性が暗号文に現れない。 +\fBecb_crypt\fP() と \fBcbc_crypt\fP() は NBS DES (Data Encryption Standard, +データ暗号化規格) を実装している。 これらのルーチンは \fBcrypt\fP(3) よりも高速でより一般的な目的に使用できる。 +利用可能であれば、これらのルーチンは DES ハードウェアを使用することもできる。 \fBecb_crypt\fP() は ECB (Electronic +Code Book) モードで暗号化する。 このモードでは (個々の) データのブロックを独立して暗号化する \fBcbc_crypt\fP() は CBC +(Cipher Block Chaining) モードで暗号化する。 このモードでは連続するブロックを互いに連鎖させて暗号化する。 CBC +はブロックの挿入・削除・置き換えから保護する。 また平文の規則性が暗号文に現れない。 .LP -.\"O Here is how to use these routines. -.\"O The first argument, -.\"O .IR key , -.\"O is the 8-byte encryption key with parity. -これらのルーチンの使用法を示す。 -第 1 引き数 -.I key -はパリティ付きの 8 バイトの暗号化鍵である。 -.\"O To set the key's parity, which for -.\"O DES -.\"O is in the low bit of each byte, use -.\"O .BR des_setparity (). -鍵のパリティを設定するには -.BR des_setparity () -を使うこと。 -DES -の場合、鍵のパリティは各バイトの最下位ビットである。 -.\"O The second argument, -.\"O .IR data , -.\"O contains the data to be encrypted or decrypted. -第 2 引き数 -.I data -は暗号化または復号化されるデータを含む。 -.\"O The -.\"O third argument, -.\"O .IR datalen , -.\"O is the length in bytes of -.\"O .IR data , -.\"O which must be a multiple of 8. -第 3 引き数 -.I datalen -は -.I data -のバイト長であり、8 の倍数でなければならない。 -.\"O The fourth argument, -.\"O .IR mode , -.\"O is formed by ORing together some things. -第 4 引き数 -.I mode -はいくつかの値を OR することで作成する。 -.\"O For the encryption direction OR in either -.\"O .BR DES_ENCRYPT -.\"O or -.\"O .BR DES_DECRYPT . -暗号化の方向 (訳註: 暗号化なのか復号化なのか) を指定するため、 -.BR DES_ENCRYPT -または -.BR DES_DECRYPT -を OR する。 -.\"O For software versus hardware -.\"O encryption, OR in either -.\"O .BR DES_HW -.\"O or -.\"O .BR DES_SW . -暗号化をソフトウェアで行うかハードウェアで行うかを指定するため、 -.BR DES_HW -または -.BR DES_SW -を OR する。 -.\"O If -.\"O .BR DES_HW -.\"O is specified, and there is no hardware, then the encryption is performed -.\"O in software and the routine returns -.\"O .BR DESERR_NOHWDEVICE . -.BR DES_HW -が指定されていて、かつハードウェアがない場合、 -暗号化はソフトウェアで実行されて、ルーチンは -.BR DESERR_NOHWDEVICE -を返す。 -.\"O For -.\"O .BR cbc_crypt (), -.\"O the argument -.\"O .I ivec -.\"O is the 8-byte initialization -.\"O vector for the chaining. -.\"O It is updated to the next initialization -.\"O vector upon return. -.BR cbc_crypt () -において、引き数 -.I ivec -はデータブロックを連鎖させる際の 8 バイトの初期化ベクトルである。 -この引き数はルーチンから戻るときに次の初期化ベクトルに更新される。 -.\"O .SH RETURN VALUE +これらのルーチンの使用法を示す。 第 1 引き数 \fIkey\fP はパリティ付きの 8 バイトの暗号化鍵である。 鍵のパリティを設定するには +\fBdes_setparity\fP() を使うこと。 DES の場合、鍵のパリティは各バイトの最下位ビットである。 第 2 引き数 \fIdata\fP +は暗号化または復号化されるデータを含む。 第 3 引き数 \fIdatalen\fP は \fIdata\fP のバイト長であり、8 の倍数でなければならない。 第 +4 引き数 \fImode\fP はいくつかの値を OR することで作成する。 暗号化の方向 (訳註: 暗号化なのか復号化なのか) を指定するため、 +\fBDES_ENCRYPT\fP または \fBDES_DECRYPT\fP を OR する。 暗号化をソフトウェアで行うかハードウェアで行うかを指定するため、 +\fBDES_HW\fP または \fBDES_SW\fP を OR する。 \fBDES_HW\fP が指定されていて、かつハードウェアがない場合、 +暗号化はソフトウェアで実行されて、ルーチンは \fBDESERR_NOHWDEVICE\fP を返す。 \fBcbc_crypt\fP() において、引き数 +\fIivec\fP はデータブロックを連鎖させる際の 8 バイトの初期化ベクトルである。 この引き数はルーチンから戻るときに次の初期化ベクトルに更新される。 .SH 返り値 .PD 0 -.TP 20 -.\"O .BR DESERR_NONE -.B DESERR_NONE -.\"O No error. +.TP 20 +\fBDESERR_NONE\fP エラーなし。 -.TP -.\"O .BR DESERR_NOHWDEVICE -.B DESERR_NOHWDEVICE -.\"O Encryption succeeded, but done in software instead of the requested hardware. +.TP +\fBDESERR_NOHWDEVICE\fP 暗号化は成功したが、要求されたハードウェアの代わりにソフトウェアで実行された。 -.TP -.\"O .BR DESERR_HWERROR -.B DESERR_HWERROR -.\"O An error occurred in the hardware or driver. +.TP +\fBDESERR_HWERROR\fP ハードウェアまたはドライバでエラーが発生した。 -.TP -.\"O .BR DESERR_BADPARAM -.B DESERR_BADPARAM -.\"O Bad argument to routine. +.TP +\fBDESERR_BADPARAM\fP ルーチンへの引き数が不正である。 .PD .LP -.\"O Given a result status -.\"O .IR stat , -.\"O the macro -.\"O .\" .BR DES_FAILED\c -.\"O .\" .BR ( stat ) -.\"O .BI DES_FAILED( stat ) -.\"O is false only for the first two statuses. -結果の状態 -.I stat -を与えたとき、マクロ .\" .BR DES_FAILED\c .\" .BR ( stat ) -.BI DES_FAILED( stat ) -が false になるのは、最初の 2 つだけである。 -.\"O .\" So far the Sun page -.\"O .\" Some additions - aeb -.\" ここまでが Sun の man ページである。 -.\" aeb がいくつか追加を行った。 -.\"O .SH VERSIONS +.\" So far the Sun page +.\" Some additions - aeb +結果の状態 \fIstat\fP を与えたとき、マクロ \fBDES_FAILED(\fP\fIstat\fP\fB)\fP が false になるのは、最初の 2 +つだけである。 .SH バージョン -.\"O These routines are present in libc 4.6.27 and later, and in -.\"O glibc 2.1 and later. これらのルーチンは libc 4.6.27 以降と glibc 2.1 以降に存在する。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O 4.3BSD. -.\"O Not in POSIX.1-2001. -4.3BSD. POSIX.1-2001 にはない。 -.\"O .SH "SEE ALSO" +4.3BSD. POSIX.1\-2001 にはない。 .SH 関連項目 -.BR des (1), -.BR crypt (3), -.BR xcrypt (3) +\fBdes\fP(1), \fBcrypt\fP(3), \fBxcrypt\fP(3) diff --git a/draft/man3/difftime.3 b/draft/man3/difftime.3 index 191f7bd3..37561909 100644 --- a/draft/man3/difftime.3 +++ b/draft/man3/difftime.3 @@ -25,58 +25,28 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 19:48:17 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 NAGOYA Hiroaki -.\" all rights reserved. -.\" Translated Mon Feb 10 1997 by Hiroaki Nagoya -.\" Updated & Modified Sat Mar 23 23:57:43 JST 2002 -.\" by Yuichi SATO +.\" This file was generated with po4a. Translate the source file. .\" -.\"WORD: epoch 紀元 -.\" -.TH DIFFTIME 3 2010-02-25 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH DIFFTIME 3 2010\-02\-25 GNU "Linux Programmer's Manual" .SH 名前 -.\"O difftime \- calculate time difference difftime \- 時刻の間隔の計算 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double difftime(time_t " time1 ", time_t " time0 ); +\fBdouble difftime(time_t \fP\fItime1\fP\fB, time_t \fP\fItime0\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR difftime () -.\"O function returns the number of seconds elapsed -.\"O between time \fItime1\fP and time \fItime0\fP, represented as a -.\"O .IR double . -.\"O Each of the times is specified in calendar time, which means its -.\"O value is a measurement (in seconds) relative to the -.\"O Epoch, 1970-01-01 00:00:00 +0000 (UTC). -関数 -.BR difftime () -は時刻 \fItime0\fP から -時刻 \fItime1\fP までの経過時間を -.I double -型で返す。各々の時刻はカレンダー時間で指定する。 -つまり、紀元 (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) からの +関数 \fBdifftime\fP() は時刻 \fItime0\fP から 時刻 \fItime1\fP までの経過時間を \fIdouble\fP +型で返す。各々の時刻はカレンダー時間で指定する。 つまり、紀元 (Epoch; 1970\-01\-01 00:00:00 +0000 (UTC)) からの 経過時間を秒単位で指定する。 -.\"O .SH "CONFORMING TO" .SH 準拠 SVr4, 4.3BSD, C89, C99. -.\"O .SH NOTES .SH 注意 -.\"O On a POSIX system, -.\"O .I time_t -.\"O is an arithmetic type, and one could just -.\"O define -POSIX システムでは -.I time_t -は数値型なので、引き算の際に起こる可能性のあるオーバーフローを -気にしない場合は、単純に +POSIX システムでは \fItime_t\fP は数値型なので、引き算の際に起こる可能性のあるオーバーフローを 気にしない場合は、単純に .RS .nf @@ -84,21 +54,8 @@ POSIX システムでは .fi .RE -.\"O when the possible overflow in the subtraction is not a concern. -と定義できる。 -.\"O On other systems, the data type -.\"O .I time_t -.\"O might use some other encoding -.\"O where subtraction doesn't work directly. -他のシステムでは、データ型 -.I time_t -に何か別のエンコーディングが使われていることがあり、 +と定義できる。 他のシステムでは、データ型 \fItime_t\fP に何か別のエンコーディングが使われていることがあり、 その場合には直接引き算を行うことはできない。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR date (1), -.BR gettimeofday (2), -.BR time (2), -.BR ctime (3), -.BR gmtime (3), -.BR localtime (3) +\fBdate\fP(1), \fBgettimeofday\fP(2), \fBtime\fP(2), \fBctime\fP(3), \fBgmtime\fP(3), +\fBlocaltime\fP(3) diff --git a/draft/man3/dirfd.3 b/draft/man3/dirfd.3 index 64fb15e6..3a1810a6 100644 --- a/draft/man3/dirfd.3 +++ b/draft/man3/dirfd.3 @@ -20,43 +20,32 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 2002-2003 Yuichi SATO -.\" all rights reserved. -.\" Translated Mon May 6 21:32:36 JST 2002 -.\" by Yuichi SATO -.\" Updated & Modified Sun Sep 7 01:23:08 JST 2003 -.\" by Yuichi SATO +.\" This file was generated with po4a. Translate the source file. .\" -.TH DIRFD 3 2010-09-26 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH DIRFD 3 2010\-09\-26 Linux "Linux Programmer's Manual" .SH 名前 -.\"O dirfd \- get directory stream file descriptor -dirfd \- ディレクトリ・ストリームのファイル・ディスクリプタを取得する -.\"O .SH SYNOPSIS +dirfd \- ディレクトリストリームのファイルディスクリプタを取得する .SH 書式 -.B #include +\fB#include \fP .br -.B #include +\fB#include \fP .sp -.BI "int dirfd(DIR *" dirp ); +\fBint dirfd(DIR *\fP\fIdirp\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR dirfd (): +\fBdirfd\fP(): .br .RS 4 .PD 0 .ad l _BSD_SOURCE || _SVID_SOURCE .br -.\"O || /* Since glibc 2.10: */ || /* glibc 2.10 以降: */ .RS 4 (_POSIX_C_SOURCE\ >=\ 200809L || _XOPEN_SOURCE\ >=\ 700) @@ -64,93 +53,29 @@ _BSD_SOURCE || _SVID_SOURCE .PD .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The function -.\"O .BR dirfd () -.\"O returns the file descriptor associated with the directory stream -.\"O .IR dirp . -関数 -.BR dirfd () -はディレクトリ・ストリーム -.I dirp -に関連づけられたファイル・ディスクリプタを返す。 +関数 \fBdirfd\fP() はディレクトリストリーム \fIdirp\fP に関連づけられたファイルディスクリプタを返す。 .LP -.\"O This descriptor is the one used internally by the directory stream. -このディスクリプタはディレクトリ・ストリームが内部で使用するものである。 -.\"O As a result, it is only useful for functions which do not depend on -.\"O or alter the file position, such as -.\"O .BR fstat (2) -.\"O and -.\"O .BR fchdir (2). -よって、ファイルの位置に依存せず、かつその位置を変更しない関数 -.BR fstat (2) -や -.BR fchdir (2) -などでしか役に立たない。 -.\"O It will be automatically closed when -.\"O .BR closedir (3) -.\"O is called. -このディスクリプタは -.BR closedir (3) +このディスクリプタはディレクトリストリームが内部で使用するものである。 よって、ファイルの位置に依存せず、かつその位置を変更しない関数 +\fBfstat\fP(2) や \fBfchdir\fP(2) などでしか役に立たない。 このディスクリプタは \fBclosedir\fP(3) が呼ばれたときに自動的にクローズされる。 -.\"O .SH RETURN VALUE .SH 返り値 -.\"O On success, a nonnegative file descriptor is returned. -.\"O On error, \-1 is returned. -成功すると、負でない値のファイルディスクリプタが返される。 -エラーの場合は \-1 が返される。 -.\"O .SH ERRORS +成功すると、負でない値のファイルディスクリプタが返される。 エラーの場合は \-1 が返される。 .SH エラー -.\"O POSIX.1-2008 specifies two errors, -.\"O neither of which is returned by the current -.\"O .\" glibc 2.8 -.\"O implementation. -POSIX.1-2008 では 2 つのエラーが規定されている。 -現在の実装ではどちらのエラーも返されない。 .\" glibc 2.8 -.TP -.B EINVAL -.\"O .I dirp -.\"O does not refer to a valid directory stream. -.I dirp -が有効なディレクトリ・ストリームを参照していない。 -.TP -.B ENOTSUP -.\"O The implementation does not support the association of a file -.\"O descriptor with a directory. -この実装では、ファイルディスクリプタのディレクトリとの関連付けが -サポートされていない。 -.\"O .SH "CONFORMING TO" +POSIX.1\-2008 では 2 つのエラーが規定されている。 現在の実装ではどちらのエラーも返されない。 +.TP +\fBEINVAL\fP +\fIdirp\fP が有効なディレクトリストリームを参照していない。 +.TP +\fBENOTSUP\fP +この実装では、ファイルディスクリプタのディレクトリとの関連付けが サポートされていない。 .SH 準拠 -POSIX.1-2008. -.\"O This function was a BSD extension, present in 4.3BSD-Reno, not in 4.2BSD. -.\"O .\" It is present in libc5 (since 5.1.2) and in glibc2. -この関数は BSD 拡張であった。 -4.3BSD-Reno には存在するが、4.2BSD には存在しない。 -.\" libc5 (5.1.2 以降) と glibc2 に存在する。 -.\"O .SH NOTES +.\" It is present in libc5 (since 5.1.2) and in glibc2. +POSIX.1\-2008. この関数は BSD 拡張であった。 4.3BSD\-Reno には存在するが、4.2BSD には存在しない。 .SH 注意 -.\"O The prototype for -.\"O .BR dirfd () -.\"O is only available if -.\"O .B _BSD_SOURCE -.\"O or -.\"O .B _SVID_SOURCE -.\"O is defined. -.BR dirfd () -のプロトタイプが使用可能なのは、 -.B _BSD_SOURCE -または -.B _SVID_SOURCE +\fBdirfd\fP() のプロトタイプが使用可能なのは、 \fB_BSD_SOURCE\fP または \fB_SVID_SOURCE\fP が定義されたときのみである。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR open (2), -.BR closedir (3), -.BR opendir (3), -.BR readdir (3), -.BR rewinddir (3), -.BR scandir (3), -.BR seekdir (3), -.BR telldir (3) +\fBopen\fP(2), \fBclosedir\fP(3), \fBopendir\fP(3), \fBreaddir\fP(3), \fBrewinddir\fP(3), +\fBscandir\fP(3), \fBseekdir\fP(3), \fBtelldir\fP(3) diff --git a/draft/man3/div.3 b/draft/man3/div.3 index 1dd893e3..aaa34a94 100644 --- a/draft/man3/div.3 +++ b/draft/man3/div.3 @@ -29,119 +29,62 @@ .\" Modified 1993-07-24, Rik Faith (faith@cs.unc.edu) .\" Modified 2002-08-10, 2003-11-01 Walter Harms, aeb .\" -.\" Japanese Version Copyright (c) 1996 Kenji Kajiwara -.\" all rights reserved. -.\" Translated Mon Jul 15 18:00:00 JST 1996 -.\" by Kenji Kajiwara -.\" Proof Reading: Takashi Yoshino -.\" Updated & Modified Sun May 30 13:03:43 JST 2004 -.\" by Yuichi SATO +.\"******************************************************************* .\" -.TH DIV 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH DIV 3 2012\-04\-17 "" "Linux Programmer's Manual" .SH 名前 -.\"O div, ldiv, lldiv, imaxdiv \- compute quotient and remainder of -.\"O an integer division div, ldiv, lldiv, imaxdiv \- integer 型の割算の商と余りを計算する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "div_t div(int " numerator ", int " denominator ); +\fBdiv_t div(int \fP\fInumerator\fP\fB, int \fP\fIdenominator\fP\fB);\fP .br -.BI "ldiv_t ldiv(long " numerator ", long " denominator ); +\fBldiv_t ldiv(long \fP\fInumerator\fP\fB, long \fP\fIdenominator\fP\fB);\fP .br -.BI "lldiv_t lldiv(long long " numerator ", long long " denominator ); +\fBlldiv_t lldiv(long long \fP\fInumerator\fP\fB, long long \fP\fIdenominator\fP\fB);\fP .sp -.B #include +\fB#include \fP .sp -.BI "imaxdiv_t imaxdiv(intmax_t " numerator ", intmax_t " denominator ); +\fBimaxdiv_t imaxdiv(intmax_t \fP\fInumerator\fP\fB, intmax_t \fP\fIdenominator\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .ad l .sp -.BR lldiv (): +\fBlldiv\fP(): .RS 4 -_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR div () -.\"O function computes the value -.\"O \fInumerator\fP/\fIdenominator\fP and -.\"O returns the quotient and remainder in a structure -.\"O named \fIdiv_t\fP that contains -.\"O two integer members (in unspecified order) named \fIquot\fP and \fIrem\fP. -.BR div () -関数は \fInumerator\fP/\fIdenominator\fP の値を計算する。 -商と余りは、 -\fIquot\fP (商) と \fIrem\fP (余り) という名前の 2 つの integer 型メンバを含む -\fIdiv_t\fP という構造体の中に返される -(メンバの順番は不定である)。 -.\"O The quotient is rounded toward zero. -商は 0 に近い方に丸められる。 -.\"O The result satisfies \fIquot\fP*\fIdenominator\fP+\fIrem\fP = \fInumerator\fP. -結果は \fIquot\fP*\fIdenominator\fP+\fIrem\fP = \fInumerator\fP を満たす。 +\fBdiv\fP() 関数は \fInumerator\fP/\fIdenominator\fP の値を計算する。 商と余りは、 \fIquot\fP (商) と +\fIrem\fP (余り) という名前の 2 つの integer 型メンバを含む \fIdiv_t\fP という構造体の中に返される +(メンバの順番は不定である)。 商は 0 に近い方に丸められる。 結果は \fIquot\fP*\fIdenominator\fP+\fIrem\fP = +\fInumerator\fP を満たす。 .LP -.\"O The -.\"O .BR ldiv (), -.\"O .BR lldiv (), -.\"O and -.\"O .BR imaxdiv () -.\"O functions do the same, -.\"O dividing numbers of the indicated type and -.\"O returning the result in a structure -.\"O of the indicated name, in all cases with fields \fIquot\fP and \fIrem\fP -.\"O of the same type as the function arguments. -.BR ldiv (), -.BR lldiv (), -.BR imaxdiv () -関数は同様な動作をし、 -上に示した型の数値を割算して、上に示した名前の構造体に結果を返す。 -どの場合でもフィールド \fIquot\fP と \fIrem\fP は、 +\fBldiv\fP(), \fBlldiv\fP(), \fBimaxdiv\fP() 関数は同様な動作をし、 +上に示した型の数値を割算して、上に示した名前の構造体に結果を返す。 どの場合でもフィールド \fIquot\fP と \fIrem\fP は、 関数の引き数と同じ型である。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O The \fIdiv_t\fP (etc.) structure. \fIdiv_t\fP (などの) 構造体。 -.\"O .SH "CONFORMING TO" .SH 準拠 -SVr4, 4.3BSD, C89. -.\"O The functions -.\"O .BR lldiv () -.\"O and -.\"O .BR imaxdiv () -.\"O were added in C99. -関数 -.BR lldiv () -と -.BR imaxdiv () -は C99 に追加された。 -.\"O .SH EXAMPLE +SVr4, 4.3BSD, C89, C99. +関数 \fBlldiv\fP() と \fBimaxdiv\fP() は C99 に追加された。 .SH 例 -.\"O After +以下の式を計算すると、 .nf div_t q = div(\-5, 3); .fi -.\"O the values \fIq.quot\fP and \fIq.rem\fP are \-1 and \-2, respectively. -を計算すると、\fIq.quot\fP と \fIq.rem\fP はそれぞれ \-1 と \-2 になる。 -.\"O .SH "SEE ALSO" +\fIq.quot\fP と \fIq.rem\fP はそれぞれ \-1 と \-2 になる。 .SH 関連項目 -.BR abs (3), -.BR remainder (3) +\fBabs\fP(3), \fBremainder\fP(3) diff --git a/draft/man3/dl_iterate_phdr.3 b/draft/man3/dl_iterate_phdr.3 index 1a4af608..ec19d14e 100644 --- a/draft/man3/dl_iterate_phdr.3 +++ b/draft/man3/dl_iterate_phdr.3 @@ -21,250 +21,95 @@ .\" the source, must acknowledge the copyright and authors of this work. .\" License. .\" -.\" Japanese Version Copyright (c) 2005 Yuichi SATO -.\" all rights reserved. -.\" Translated Thu Jan 27 07:03:56 JST 2005 -.\" by Yuichi SATO +.\"******************************************************************* .\" -.TH DL_ITERATE_PHDR 3 2007-05-18 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH DL_ITERATE_PHDR 3 2007\-05\-18 GNU "Linux Programmer's Manual" .SH 名前 -.\"O dl_iterate_phdr \- walk through list of shared objects dl_iterate_phdr \- 共有オブジェクトのリストを辿る -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" -.B #include +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP \fBint dl_iterate_phdr(\fP - \fBint (*\fPcallback\fB) \ -(struct dl_phdr_info *\fPinfo\fB,\fP + \fBint (*\fPcallback\fB) (struct dl_phdr_info *\fPinfo\fB,\fP \fBsize_t\fP size\fB, void *\fPdata\fB),\fP \fBvoid *\fPdata\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR dl_iterate_phdr () -.\"O function allows an application to inquire at run time to find -.\"O out which shared objects it has loaded. -.BR dl_iterate_phdr () -関数を使うと、アプリケーションは実行時に -どの共有オブジェクトをロードしたかを見つけることができる。 +\fBdl_iterate_phdr\fP() 関数を使うと、アプリケーションは実行時に どの共有オブジェクトをロードしたかを見つけることができる。 -.\"O The -.\"O .BR dl_iterate_phdr () -.\"O function walks through the list of an -.\"O application's shared objects and calls the function -.\"O .I callback -.\"O once for each object, -.\"O until either all shared objects have been processed or -.\"O .I callback -.\"O returns a nonzero value. -.BR dl_iterate_phdr () -関数はアプリケーションの共有オブジェクトのリストを辿り、 -各オブジェクトに対して関数 -.I callback -を 1 回ずつ呼び出す。 -これは全ての共有オブジェクトが処理されるか、 -.I callback -が 0 以外の値を返すまで行われる。 +\fBdl_iterate_phdr\fP() 関数はアプリケーションの共有オブジェクトのリストを辿り、 各オブジェクトに対して関数 \fIcallback\fP +を 1 回ずつ呼び出す。 これは全ての共有オブジェクトが処理されるか、 \fIcallback\fP が 0 以外の値を返すまで行われる。 -.\"O Each call to -.\"O .I callback -.\"O receives three arguments: -各々の -.I callback -呼び出しは 3 つの引き数を受け取る: -.\"O .IR info , -.\"O which is a pointer to a structure containing information -.\"O about the shared object; -.I info -は共有オブジェクトの情報を保持する構造体へのポインタである。 -.\"O .IR size , -.\"O which is the size of the structure pointed to by -.\"O .IR info ; -.I size -は -.I info -で指される構造体のサイズである。 -.\"O and -.\"O .IR data , -.\"O which is a copy of whatever value was passed by the calling -.\"O program as the second argument (also named -.\"O .IR data ) -.\"O in the call to -.\"O .BR dl_iterate_phdr (). -.I data -は呼び出し元プログラムから -.BR dl_iterate_phdr () -の呼び出しの (同じく -.I data -という名前の) 第 2 引き数として渡される値のコピーである。 +各々の \fIcallback\fP 呼び出しは 3 つの引き数を受け取る: \fIinfo\fP は共有オブジェクトの情報を保持する構造体へのポインタである。 +\fIsize\fP は \fIinfo\fP で指される構造体のサイズである。 \fIdata\fP は呼び出し元プログラムから +\fBdl_iterate_phdr\fP() の呼び出しの (同じく \fIdata\fP という名前の) 第 2 引き数として渡される値のコピーである。 -.\"O The -.\"O .I info -.\"O argument is a structure of the following type: -.I info -引き数は、以下のような型の構造体である。 +\fIinfo\fP 引き数は、以下のような型の構造体である。 .in +4n .nf struct dl_phdr_info { -.\"O ElfW(Addr) dlpi_addr; /* Base address of object */ ElfW(Addr) dlpi_addr; /* オブジェクトのベースアドレス */ -.\"O const char *dlpi_name; /* (Null-terminated) name of -.\"O object */ const char *dlpi_name; /* (null 文字で終端された) オブジェクト名 */ -.\"O const ElfW(Phdr) *dlpi_phdr; /* Pointer to array of -.\"O ELF program headers -.\"O for this object */ const ElfW(Phdr) *dlpi_phdr; /* このオブジェクトの ELF プログラムヘッダの 配列へのポインタ */ -.\"O ElfW(Half) dlpi_phnum; /* # of items in \fIdlpi_phdr\fP */ ElfW(Half) dlpi_phnum; /* \fIdlpi_phdr\fP のアイテム数 */ }; .fi .in -.\"O (The -.\"O .IR ElfW () -.\"O macro definition turns its argument into the name of an ELF data -.\"O type suitable for the hardware architecture. -.RI ( ElfW () -マクロ定義は引き数をハードウェアアーキテクチャに適した -ELF データ型の名前に変換する。 -.\"O For example, on a 32-bit platform, -.\"O ElfW(Addr) yields the data type name Elf32_Addr. -たとえば、32 ビットプラットフォームでは -ElfW(Addr) はデータ型名 Elf32_Addr を生成する。 -.\"O Further information on these types can be found in the -.\"O .IR " and " -.\"O header files.) -これらの型についての更に詳細な情報は、ヘッダファイル -.IR " と " -にある。 +(\fIElfW\fP() マクロ定義は引き数をハードウェアアーキテクチャに適した ELF データ型の名前に変換する。 たとえば、32 +ビットプラットフォームでは ElfW(Addr) はデータ型名 Elf32_Addr を生成する。 これらの型についての更に詳細な情報は、ヘッダファイル +\fI\fP と \fI\fP にある。 -.\"O The -.\"O .I dlpi_addr -.\"O field indicates the base address of the shared object -.\"O (i.e., the difference between the virtual memory address of -.\"O the shared object and the offset of that object in the file -.\"O from which it was loaded). -.I dlpi_addr -フィールドは共有オブジェクトのベースアドレス -(つまり、共有オブジェクトの仮想メモリアドレスと、 -ファイル (このファイルから共有オブジェクトがロードされる) における -共有オブジェクトのオフセットとの差分) を表す。 -.\"O The -.\"O .I dlpi_name -.\"O field is a null-terminated string giving the pathname -.\"O from which the shared object was loaded. -.I dlpi_name -は null 文字で終端された文字列であり、 -このパス名のファイルから共有オブジェクトがロードされる。 +\fIdlpi_addr\fP フィールドは共有オブジェクトのベースアドレス (つまり、共有オブジェクトの仮想メモリアドレスと、 ファイル +(このファイルから共有オブジェクトがロードされる) における 共有オブジェクトのオフセットとの差分) を表す。 \fIdlpi_name\fP は null +文字で終端された文字列であり、 このパス名のファイルから共有オブジェクトがロードされる。 -.\"O To understand the meaning of the -.\"O .I dlpi_phdr -.\"O and -.\"O .I dlpi_phnum -.\"O fields, we need to be aware that an ELF shared object consists -.\"O of a number of segments, each of which has a corresponding -.\"O program header describing the segment. -.I dlpi_phdr -と -.I dlpi_phnum -フィールドの意味を理解するには、 -ELF 共有オブジェクトが幾つかのセグメントから構成されていることと、 -各セグメントがそれに対応するプログラムヘッダ -(そのセグメントを説明する) を持っていることを知っている必要がある。 -.\"O The -.\"O .I dlpi_phdr -.\"O field is a pointer to an array of the program headers for this -.\"O shared object. -.I dlpi_phdr -フィールドは、この共有オブジェクトのプログラムヘッダの配列へのポインタである。 -.\"O The -.\"O .I dlpi_phnum -.\"O field indicates the size of this array. -.I dlpi_phnum -は、この配列のサイズを表す。 +\fIdlpi_phdr\fP と \fIdlpi_phnum\fP フィールドの意味を理解するには、 ELF +共有オブジェクトが幾つかのセグメントから構成されていることと、 各セグメントがそれに対応するプログラムヘッダ (そのセグメントを説明する) +を持っていることを知っている必要がある。 \fIdlpi_phdr\fP フィールドは、この共有オブジェクトのプログラムヘッダの配列へのポインタである。 +\fIdlpi_phnum\fP は、この配列のサイズを表す。 -.\"O These program headers are structures of the following form: これらのプログラムヘッダは以下のような形式の構造体である: .in +4n .nf typedef struct { -.\"O Elf32_Word p_type; /* Segment type */ Elf32_Word p_type; /* セグメントの型 */ -.\"O Elf32_Off p_offset; /* Segment file offset */ Elf32_Off p_offset; /* セグメントのファイルオフセット */ -.\"O Elf32_Addr p_vaddr; /* Segment virtual address */ Elf32_Addr p_vaddr; /* セグメントの仮想アドレス */ -.\"O Elf32_Addr p_paddr; /* Segment physical address */ Elf32_Addr p_paddr; /* セグメントの物理アドレス */ -.\"O Elf32_Word p_filesz; /* Segment size in file */ Elf32_Word p_filesz; /* ファイルにおけるセグメントサイズ */ -.\"O Elf32_Word p_memsz; /* Segment size in memory */ Elf32_Word p_memsz; /* メモリにおけるセグメントサイズ */ -.\"O Elf32_Word p_flags; /* Segment flags */ Elf32_Word p_flags; /* セグメントフラグ */ -.\"O Elf32_Word p_align; /* Segment alignment */ Elf32_Word p_align; /* セグメントの配置 (alignment) */ } Elf32_Phdr; .fi .in -.\"O Note that we can calculate the location of a particular program header, -.\"O .IR x , -.\"O in virtual memory using the formula: -特定のプログラムヘッダ -.I x -の仮想メモリにおける位置は、以下の式で計算できる点に注意すること: +特定のプログラムヘッダ \fIx\fP の仮想メモリにおける位置は、以下の式で計算できる点に注意すること: .nf addr == info\->dlpi_addr + info\->dlpi_phdr[x].p_vaddr; .fi -.\"O .SH RETURN VALUE .SH 返り値 -.\"O The -.\"O .BR dl_iterate_phdr () -.\"O function returns whatever value was returned by the last call to -.\"O .IR callback . -.BR dl_iterate_phdr () -関数は最後の -.I callback -の呼び出しで返された値を返す。 -.\"O .SH VERSIONS +\fBdl_iterate_phdr\fP() 関数は最後の \fIcallback\fP の呼び出しで返された値を返す。 .SH バージョン -.\"O .BR dl_iterate_phdr () -.\"O has been supported in glibc since version 2.2.4. -.BR dl_iterate_phdr () -は glibc のバージョン 2.2.4 以降でサポートされている。 -.\"O .SH "CONFORMING TO" +\fBdl_iterate_phdr\fP() は glibc のバージョン 2.2.4 以降でサポートされている。 .SH 準拠 -.\"O The -.\"O .BR dl_iterate_phdr () -.\"O function is Linux-specific and should be avoided in portable applications. -.BR dl_iterate_phdr () -関数は Linux 固有であり、移植を考えたアプリケーションでは避けるべきである。 -.\"O .SH EXAMPLE +\fBdl_iterate_phdr\fP() 関数は Linux 固有であり、移植を考えたアプリケーションでは避けるべきである。 .SH 例 -.\"O The following program displays a list of pathnames of the -.\"O shared objects it has loaded. -以下のプログラムは、共有オブジェクトがロードされた -パス名の一覧を表示する。 -.\"O For each shared object, the program lists the virtual addresses -.\"O at which the object's ELF segments are loaded. -各共有オブジェクトについて、このプログラムは -オブジェクトの ELF セグメントがロードされた -仮想アドレスの一覧を表示する。 +以下のプログラムは、共有オブジェクトがロードされた パス名の一覧を表示する。 各共有オブジェクトについて、このプログラムは オブジェクトの ELF +セグメントがロードされた 仮想アドレスの一覧を表示する。 .nf #define _GNU_SOURCE @@ -277,11 +122,11 @@ callback(struct dl_phdr_info *info, size_t size, void *data) { int j; - printf("name=%s (%d segments)\\n", info\->dlpi_name, + printf("name=%s (%d segments)\en", info\->dlpi_name, info\->dlpi_phnum); for (j = 0; j < info\->dlpi_phnum; j++) - printf("\\t\\t header %2d: address=%10p\\n", j, + printf("\et\et header %2d: address=%10p\en", j, (void *) (info\->dlpi_addr + info\->dlpi_phdr[j].p_vaddr)); return 0; } @@ -294,16 +139,7 @@ main(int argc, char *argv[]) exit(EXIT_SUCCESS); } .fi -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR ldd (1), -.BR objdump (1), -.BR readelf (1), -.BR dlopen (3), -.BR elf (5), -.BR ld.so (8), -.\"O and the -.\"O .I "Executable and Linking Format Specification" -.\"O available at various locations online. -オンラインのいろいろな場所で入手できる -.I "Executable and Linking Format Specification" +\fBldd\fP(1), \fBobjdump\fP(1), \fBreadelf\fP(1), \fBdlopen\fP(3), \fBelf\fP(5), +\fBld.so\fP(8), オンラインのいろいろな場所で入手できる \fIExecutable and Linking Format +Specification\fP diff --git a/draft/man3/dlopen.3 b/draft/man3/dlopen.3 index 6e7fdf68..235bfb40 100644 --- a/draft/man3/dlopen.3 +++ b/draft/man3/dlopen.3 @@ -32,593 +32,161 @@ .\" Modified by Walter Harms: dladdr, dlvsym .\" Modified by Petr Baudis , 2008-12-04: dladdr caveat .\" -.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. -.\" Translated Sat May 23 1998 by NAKANO Takeo -.\" Updated & Modified 1999-09-14, NAKANO Takeo -.\" Modified 2000-03-19, HANATAKA Shinya -.\" Updated 2001-02-16, Kentaro Shirakata -.\" Updated 2001-12-21, Kentaro Shirakata -.\" Updated 2002-10-21, Kentaro Shirakata -.\" Updated 2003-09-01, Kentaro Shirakata -.\" Updated 2005-03-15, Akihiro MOTOKI -.\" Updated 2006-01-20, Akihiro MOTOKI -.\" Updated 2009-03-02, Akihiro MOTOKI, LDP v3.19 +.\"******************************************************************* .\" -.\"WORD: linker リンカ -.\"WORD: dynamic linking 動的リンク -.\"WORD: dynamic library 動的ライブラリ +.\" This file was generated with po4a. Translate the source file. .\" -.TH DLOPEN 3 2008-12-06 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O dlclose, dlerror, dlopen, dlsym \- Programming interface to dynamic linking loader +.\"******************************************************************* +.TH DLOPEN 3 2008\-12\-06 Linux "Linux Programmer's Manual" .SH 名前 -dlclose, dlerror, dlopen, dlsym \- 動的リンクを行うローダへの -プログラミングインターフェース -.\"O .SH SYNOPSIS +dlclose, dlerror, dlopen, dlsym \- 動的リンクを行うローダへの プログラミングインターフェース .SH 書式 -.B #include +\fB#include \fP .sp -.BI "void *dlopen(const char *" filename ", int " flag ); +\fBvoid *dlopen(const char *\fP\fIfilename\fP\fB, int \fP\fIflag\fP\fB);\fP .sp -.B "char *dlerror(void);" +\fBchar *dlerror(void);\fP .sp -.BI "void *dlsym(void *" handle ", const char *" symbol ); +\fBvoid *dlsym(void *\fP\fIhandle\fP\fB, const char *\fP\fIsymbol\fP\fB);\fP .sp -.BI "int dlclose(void *" handle ); +\fBint dlclose(void *\fP\fIhandle\fP\fB);\fP .sp -.\"O Link with \fI\-ldl\fP. \fI\-ldl\fP でリンクする。 -.\"O .SH DESCRIPTION .SH 説明 -.\"O The four functions -.\"O .BR dlopen (), -.\"O .BR dlsym (), -.\"O .BR dlclose (), -.\"O .BR dlerror () -.\"O implement the interface to the dynamic linking loader. -.BR dlopen (), -.BR dlsym (), -.BR dlclose (), -.BR dlerror () -の 4つの関数は、動的リンク (dynamic linking) を行うローダへの -インタフェースを実装したものである。 -.SS "dlerror()" -.\"O The function -.\"O .BR dlerror () -.\"O returns a human readable string describing the most recent error -.\"O that occurred from -.\"O .BR dlopen (), -.\"O .BR dlsym () -.\"O or -.\"O .BR dlclose () -.\"O since the last call to -.\"O .BR dlerror (). -.\"O It returns NULL if no errors have occurred since initialization or since -.\"O it was last called. -関数 -.BR dlerror () -は、前回 -.BR dlerror () -が呼び出された後に、 -.BR dlopen (), -.BR dlsym (), -.BR dlclose () -のいずれかで最後に発生したエラーについての説明メッセージを返す。 +\fBdlopen\fP(), \fBdlsym\fP(), \fBdlclose\fP(), \fBdlerror\fP() の 4つの関数は、動的リンク (dynamic +linking) を行うローダへの インタフェースを実装したものである。 +.SS dlerror() +関数 \fBdlerror\fP() は、前回 \fBdlerror\fP() が呼び出された後に、 \fBdlopen\fP(), \fBdlsym\fP(), +\fBdlclose\fP() のいずれかで最後に発生したエラーについての説明メッセージを返す。 初期化後または前回呼び出された後で、エラーが発生していなければ NULL を返す。 -.SS "dlopen()" -.\"O The function -.\"O .BR dlopen () -.\"O loads the dynamic library file named by the null-terminated -.\"O string -.\"O .I filename -.\"O and returns an opaque "handle" for the dynamic library. -関数 -.BR dlopen () -は、NULL 終端された文字列 -.I filename -で指定されたファイル名の動的ライブラリ (dynamic library) をロードし、 -その動的ライブラリへの内部「ハンドル」を返す。 -.\"O If -.\"O .I filename -.\"O is NULL, then the returned handle is for the main program. -.\"O If -.\"O .I filename -.\"O contains a slash ("/"), then it is interpreted as a (relative -.\"O or absolute) pathname. -.I filename -が NULL の場合、メイン・プログラムへのハンドルが返される。 -.I filename -がスラッシュ ("/") を含む場合、(相対か絶対かの)パス名として解釈される。 -.\"O Otherwise, the dynamic linker searches for the library as follows -.\"O (see -.\"O .BR ld.so (8) -.\"O for further details): -それ以外の場合、動的リンカは以下の手順でライブラリを検索する -(詳細は -.BR ld.so (8) +.SS dlopen() +関数 \fBdlopen\fP() は、NULL 終端された文字列 \fIfilename\fP で指定されたファイル名の動的ライブラリ (dynamic +library) をロードし、 その動的ライブラリへの内部「ハンドル」を返す。 \fIfilename\fP が NULL +の場合、メイン・プログラムへのハンドルが返される。 \fIfilename\fP がスラッシュ ("/") +を含む場合、(相対か絶対かの)パス名として解釈される。 それ以外の場合、動的リンカは以下の手順でライブラリを検索する (詳細は \fBld.so\fP(8) を参照): .IP o 4 -.\"O (ELF only) If the executable file for the calling program -.\"O contains a DT_RPATH tag, and does not contain a DT_RUNPATH tag, -.\"O then the directories listed in the DT_RPATH tag are searched. -(ELF のみ) 呼び出し元プログラムの実行ファイルに DT_RPATH タグが含まれており、 -DT_RUNPATH タグが含まれていない場合、DT_RPATH タグに書かれている -ディレクトリ・リストを検索する。 +(ELF のみ) 呼び出し元プログラムの実行ファイルに DT_RPATH タグが含まれており、 DT_RUNPATH +タグが含まれていない場合、DT_RPATH タグに書かれている ディレクトリ・リストを検索する。 .IP o -.\"O If, at the time that the program was started, the environment variable -.\"O .B LD_LIBRARY_PATH -.\"O was defined to contain a colon-separated list of directories, -.\"O then these are searched. -.\"O (As a security measure this variable is ignored for set-user-ID and -.\"O set-group-ID programs.) -プログラムの開始時に環境変数 -.B LD_LIBRARY_PATH -にコロン区切りのディレクトリのリストが定義されていれば、 -この環境変数に定義されたディレクトリが検索される -(セキュリティ上の理由で、この変数は set-UID や set-GID された +プログラムの開始時に環境変数 \fBLD_LIBRARY_PATH\fP にコロン区切りのディレクトリのリストが定義されていれば、 +この環境変数に定義されたディレクトリが検索される (セキュリティ上の理由で、この変数は set\-UID や set\-GID された プログラムの場合は無視される)。 .IP o -.\"O (ELF only) If the executable file for the calling program -.\"O contains a DT_RUNPATH tag, then the directories listed in that tag -.\"O are searched. (ELF のみ) 呼び出し元プログラムの実行ファイルに DT_RUNPATH タグが含まれて いる場合、そのタグに書かれているディレクトリ・リストを検索する。 .IP o -.\"O The cache file -.\"O .I /etc/ld.so.cache -.\"O (maintained by -.\"O .BR ldconfig (8)) -.\"O is checked to see whether it contains an entry for -.\"O .IR filename . -キャッシュファイル -.I /etc/ld.so.cache -の中に -.I filename -のエントリが入っているかをチェックする -.RB ( /etc/ld.so.cache -は -.BR ldconfig (8) -によって管理されている)。 +キャッシュファイル \fI/etc/ld.so.cache\fP の中に \fIfilename\fP のエントリが入っているかをチェックする +(\fB/etc/ld.so.cache\fP は \fBldconfig\fP(8) によって管理されている)。 .IP o -.\"O The directories -.\"O .I /lib -.\"O and -.\"O .I /usr/lib -.\"O are searched (in that order). -ディレクトリ -.I /lib -と -.I /usr/lib -をこの順番で検索する。 +ディレクトリ \fI/lib\fP と \fI/usr/lib\fP をこの順番で検索する。 .PP -.\"O If the library has dependencies on other shared libraries, -.\"O then these are also automatically loaded by the dynamic linker -.\"O using the same rules. -.\"O (This process may occur recursively, -.\"O if those libraries in turn have dependencies, and so on.) -そのライブラリが他の共有ライブラリに依存している場合は、 -依存しているライブラリも動的リンカが同じ検索ルールに基づいて -自動的にロードする (それらのライブラリにさらに依存関係がある場合などは -この処理は再帰的に行われる)。 +そのライブラリが他の共有ライブラリに依存している場合は、 依存しているライブラリも動的リンカが同じ検索ルールに基づいて 自動的にロードする +(それらのライブラリにさらに依存関係がある場合などは この処理は再帰的に行われる)。 .PP -.\"O One of the following two values must be included in -.\"O .IR flag : -.I flag -には以下の 2 つの値のいずれかを含めなければならない: -.TP -.B RTLD_LAZY -.\"O Perform lazy binding. -.\"O Only resolve symbols as the code that references them is executed. -.\"O If the symbol is never referenced, then it is never resolved. -.\"O (Lazy binding is only performed for function references; -.\"O references to variables are always immediately bound when -.\"O the library is loaded.) -lazy binding (手抜きなシンボルの結び付け) が行う。 -シンボルの解決はそのシンボルを参照するコードが実行されるときにのみ -行われる。シンボルが一度も参照されなかった場合には、そのシンボルは -解決されないままとなる。 -(lazy binding は関数参照についてのみ実施される; 変数への参照は常に -ライブラリがロードされた時点で直ちに解決される。) -.TP -.B RTLD_NOW -.\"O If this value is specified, or the environment variable -.\"O .B LD_BIND_NOW -.\"O is set to a nonempty string, -.\"O all undefined symbols in the library are resolved before -.\"O .BR dlopen () -.\"O returns. -.\"O If this cannot be done, an error is returned. -この値が指定されるか、環境変数 -.B LD_BIND_NOW -に空でない文字列が設定された場合、 -ライブラリ中の未定義のシンボルを全て解決してから -.BR dlopen () -は復帰する。解決できなかったときにはエラーが返される。 +\fIflag\fP には以下の 2 つの値のいずれかを含めなければならない: +.TP +\fBRTLD_LAZY\fP +lazy binding (手抜きなシンボルの結び付け) が行う。 シンボルの解決はそのシンボルを参照するコードが実行されるときにのみ +行われる。シンボルが一度も参照されなかった場合には、そのシンボルは 解決されないままとなる。 (lazy binding +は関数参照についてのみ実施される; 変数への参照は常に ライブラリがロードされた時点で直ちに解決される。) +.TP +\fBRTLD_NOW\fP +この値が指定されるか、環境変数 \fBLD_BIND_NOW\fP に空でない文字列が設定された場合、 ライブラリ中の未定義のシンボルを全て解決してから +\fBdlopen\fP() は復帰する。解決できなかったときにはエラーが返される。 .PP -.\"O Zero or more of the following values may also be ORed in -.\"O .IR flag : -以下の値のうち 0 個以上を論理和 (OR) の形で -.I flag -に追加することもできる: -.TP -.B RTLD_GLOBAL -.\"O The symbols defined by this library will be -.\"O made available for symbol resolution of subsequently loaded libraries. -このライブラリで定義されているシンボルが、これより後でロードされる -ライブラリのシンボル解決で利用できるようになる。 -.TP -.B RTLD_LOCAL -.\"O This is the converse of -.\"O .BR RTLD_GLOBAL , -.\"O and the default if neither flag is specified. -.\"O Symbols defined in this library are not made available to resolve -.\"O references in subsequently loaded libraries. -このフラグは -.B RTLD_GLOBAL -の反対の意味であり、どちらのフラグも指定されなかった場合は -こちらがデフォルトとなる。 -このライブラリで定義されているシンボルは、これより後でロードされる -ライブラリでのシンボル参照で利用できない。 -.TP -.\"O .BR RTLD_NODELETE " (since glibc 2.2)" -.BR RTLD_NODELETE " (glibc 2.2 以降)" -.\"O Do not unload the library during -.\"O .BR dlclose (). -.\"O Consequently, the library's static variables are not reinitialized -.\"O if the library is reloaded with -.\"O .BR dlopen () -.\"O at a later time. -.\"O This flag is not specified in POSIX.1-2001. -.\"O .\" (But it is present on Solaris.) -.BR dlclose () -中にそのライブラリをアンロードしない。 -そのため、同じライブラリをこれ以降に -.BR dlopen () -で再度ロードした場合に、ライブラリ内の静的変数は再初期化されない。 -このフラグは POSIX.1-2001 では規定されていない。 -.\" (しかし Solaris に存在する) -.TP -.\"O .BR RTLD_NOLOAD " (since glibc 2.2)" -.BR RTLD_NOLOAD " (glibc 2.2 以降)" -.\"O Don't load the library. -.\"O This can be used to test if the library is already resident -.\"O .RB ( dlopen () -.\"O returns NULL if it is not, or the library's handle if it is resident). -.\"O This flag can also be used to promote the flags on a library -.\"O that is already loaded. -.\"O For example, a library that was previously loaded with -.\"O .B RTLD_LOCAL -.\"O can be reopened with -.\"O .BR RTLD_NOLOAD\ |\ RTLD_GLOBAL . -.\"O This flag is not specified in POSIX.1-2001. -.\"O .\" (But it is present on Solaris.) -.\"O .\" -そのライブラリをロードしない。 -このフラグはそのライブラリがすでに組み込まれているかを検査するのに -利用できる -.RB ( dlopen () -は、ライブラリが組み込まれていなければ NULL を返し、 -すでに組み込まれていればそのライブラリのハンドルを返す)。 -また、すでにロードされているライブラリのフラグを昇格させるのにも -利用できる。例えば、過去に -.B RTLD_LOCAL -でロードしたライブラリを -.BR RTLD_NOLOAD\ |\ RTLD_GLOBAL -で再オープンすることができる。 -このフラグは POSIX.1-2001 では規定されていない。 -.\" (しかし Solaris に存在する) -.TP -.\"O .BR RTLD_DEEPBIND " (since glibc 2.3.4)" -.BR RTLD_DEEPBIND " (glibc 2.3.4 以降)" +以下の値のうち 0 個以上を論理和 (OR) の形で \fIflag\fP に追加することもできる: +.TP +\fBRTLD_GLOBAL\fP +このライブラリで定義されているシンボルが、これより後でロードされる ライブラリのシンボル解決で利用できるようになる。 +.TP +\fBRTLD_LOCAL\fP +このフラグは \fBRTLD_GLOBAL\fP の反対の意味であり、どちらのフラグも指定されなかった場合は こちらがデフォルトとなる。 +このライブラリで定義されているシンボルは、これより後でロードされる ライブラリでのシンボル参照で利用できない。 +.TP +\fBRTLD_NODELETE\fP (glibc 2.2 以降) +.\" (But it is present on Solaris.) +\fBdlclose\fP() 中にそのライブラリをアンロードしない。 そのため、同じライブラリをこれ以降に \fBdlopen\fP() +で再度ロードした場合に、ライブラリ内の静的変数は再初期化されない。 このフラグは POSIX.1\-2001 では規定されていない。 +.TP +\fBRTLD_NOLOAD\fP (glibc 2.2 以降) +.\" (But it is present on Solaris.) +.\" +そのライブラリをロードしない。 このフラグはそのライブラリがすでに組み込まれているかを検査するのに 利用できる (\fBdlopen\fP() +は、ライブラリが組み込まれていなければ NULL を返し、 すでに組み込まれていればそのライブラリのハンドルを返す)。 +また、すでにロードされているライブラリのフラグを昇格させるのにも 利用できる。例えば、過去に \fBRTLD_LOCAL\fP でロードしたライブラリを +\fBRTLD_NOLOAD\ |\ RTLD_GLOBAL\fP で再オープンすることができる。 このフラグは POSIX.1\-2001 +では規定されていない。 +.TP +\fBRTLD_DEEPBIND\fP (glibc 2.3.4 以降) .\" Inimitably described by UD in .\" http://sources.redhat.com/ml/libc-hacker/2004-09/msg00083.html. -.\"O Place the lookup scope of the symbols in this -.\"O library ahead of the global scope. -.\"O This means that a self-contained library will use -.\"O its own symbols in preference to global symbols with the same name -.\"O contained in libraries that have already been loaded. -.\"O This flag is not specified in POSIX.1-2001. -このライブラリ内のシンボルの参照領域をグローバル領域よりも前に配置する。 -つまり、内蔵型のライブラリでは、すでにロードされたライブラリに含まれる -同じ名前のグローバルなシンボルよりも自ライブラリ内のシンボルが優先して -使われる。 -このフラグは POSIX.1-2001 では規定されていない。 +このライブラリ内のシンボルの参照領域をグローバル領域よりも前に配置する。 つまり、内蔵型のライブラリでは、すでにロードされたライブラリに含まれる +同じ名前のグローバルなシンボルよりも自ライブラリ内のシンボルが優先して 使われる。 このフラグは POSIX.1\-2001 では規定されていない。 .PP -.\"O If -.\"O .I filename -.\"O is a NULL pointer, then the returned handle is for the main program. -.I filename -が NULL ポインタである場合は、 -返されるハンドルはメイン・プログラムのものになる。 -.\"O When given to -.\"O .BR dlsym (), -.\"O this handle causes a search for a symbol in the main program, -.\"O followed by all shared libraries loaded at program startup, -.\"O and then all shared libraries loaded by -.\"O .BR dlopen () -.\"O with the flag -.\"O .BR RTLD_GLOBAL . -このハンドルが -.BR dlsym () -に渡されると、シンボルの検索は、メイン・プログラム内、 -プログラムの起動時にロードされる全ての共有ライブラリ、 -.BR dlopen () -によって -.B RTLD_GLOBAL -フラグ付きでロードされた全ての共有ライブラリ、の順序で行われる。 +\fIfilename\fP が NULL ポインタである場合は、 返されるハンドルはメイン・プログラムのものになる。 このハンドルが \fBdlsym\fP() +に渡されると、シンボルの検索は、メイン・プログラム内、 プログラムの起動時にロードされる全ての共有ライブラリ、 \fBdlopen\fP() によって +\fBRTLD_GLOBAL\fP フラグ付きでロードされた全ての共有ライブラリ、の順序で行われる。 .PP -.\"O External references in the library are resolved using the libraries -.\"O in that library's dependency list and any other libraries previously -.\"O opened with the -.\"O .B RTLD_GLOBAL -.\"O flag. -.\"O If the executable was linked with the flag "\-rdynamic" -.\"O (or, synonymously, "\-\-export\-dynamic"), -.\"O then the global symbols in the executable will also be used -.\"O to resolve references in a dynamically loaded library. -オープンされたライブラリ中での外部参照は、 -そのライブラリの依存リストにあるライブラリか、 -.B RTLD_GLOBAL -フラグ付きで既にオープンされているライブラリを使って解決される。 -実行ファイルが "\-rdynamic" フラグ ("\-\-export\-dynamic" も同義) -付きでリンクされている場合は、実行ファイル中のグローバルシンボルも、 -動的にロードされるライブラリ内の参照解決に用いられる。 +オープンされたライブラリ中での外部参照は、 そのライブラリの依存リストにあるライブラリか、 \fBRTLD_GLOBAL\fP +フラグ付きで既にオープンされているライブラリを使って解決される。 実行ファイルが "\-rdynamic" フラグ ("\-\-export\-dynamic" +も同義) 付きでリンクされている場合は、実行ファイル中のグローバルシンボルも、 動的にロードされるライブラリ内の参照解決に用いられる。 .PP -.\"O If the same library is loaded again with -.\"O .BR dlopen (), -.\"O the same file handle is returned. -.\"O The dl library maintains reference -.\"O counts for library handles, so a dynamic library is not -.\"O deallocated until -.\"O .BR dlclose () -.\"O has been called on it as many times as -.\"O .BR dlopen () -.\"O has succeeded on it. -.\"O The -.\"O .BR _init () -.\"O routine, if present, is only called once. -.\"O But a subsequent call with -.\"O .B RTLD_NOW -.\"O may force symbol resolution for a library earlier loaded with -.\"O .BR RTLD_LAZY . -同じライブラリが -.BR dlopen () -によって再度ロードされた場合には、同じファイルハンドルが返される。 -dl ライブラリはライブラリハンドルのリンク数を管理している。 -したがって動的ライブラリは -.BR dlclose () -が -.BR dlopen () -と同じ回数だけ呼び出されない限りアンロードされない。 -.BR _init () -ルーチンは一度だけ呼び出される -.RB ( _init () -が存在する場合のみ)。 -.B RTLD_NOW -が指定されて -.BR dlopen () -が呼び出された場合、 -.B RTLD_LAZY +同じライブラリが \fBdlopen\fP() によって再度ロードされた場合には、同じファイルハンドルが返される。 dl +ライブラリはライブラリハンドルのリンク数を管理している。 したがって動的ライブラリは \fBdlclose\fP() が \fBdlopen\fP() +と同じ回数だけ呼び出されない限りアンロードされない。 \fB_init\fP() ルーチンは一度だけ呼び出される (\fB_init\fP() +が存在する場合のみ)。 \fBRTLD_NOW\fP が指定されて \fBdlopen\fP() が呼び出された場合、 \fBRTLD_LAZY\fP で以前にロードされたライブラリのシンボル解決が実行されることがある。 .PP -.\"O If -.\"O .BR dlopen () -.\"O fails for any reason, it returns NULL. -.BR dlopen () -は、何らかの理由で失敗すると NULL を返す。 - -.SS "dlsym()" -.\"O The function -.\"O .BR dlsym () -.\"O takes a "handle" of a dynamic library returned by -.\"O .BR dlopen () -.\"O and the -.\"O null-terminated symbol name, returning the address where that symbol is -.\"O loaded into memory. -.\"O If the symbol is not found, in the specified -.\"O library or any of the libraries that were automatically loaded by -.\"O .BR dlopen () -.\"O when that library was loaded, -.\"O .BR dlsym () -.\"O returns NULL. -関数 -.BR dlsym () -は、 -.BR dlopen () -が返した動的ライブラリの「ハンドル」と、 -NULL 終端されたシンボル名の文字列を引き数に取り、 -そのシンボルがロードされたメモリのアドレスを返す。 -シンボルが、指定されたライブラリと、指定されたライブラリがロードされる際に -.BR dlopen () -が自動的にロードしてライブラリのいずれにも見つからない場合には、 -.BR dlsym () -は NULL を返す -.\"O (The search performed by -.\"O .BR dlsym () -.\"O is breadth first through the dependency tree of these libraries.) -.RB ( dlsym () -による検索は、これらのライブラリの依存関係のツリーを先頭から -辿って行われる)。 -.\"O Since the value of the symbol could actually be NULL (so that a -.\"O NULL return from -.\"O .BR dlsym () -.\"O need not indicate an error), the correct way to test for an error -.\"O is to call -.\"O .BR dlerror () -.\"O to clear any old error conditions, then call -.\"O .BR dlsym (), -.\"O and then call -.\"O .BR dlerror () -.\"O again, saving its return value into a variable, and check whether -.\"O this saved value is not NULL. -実際にはシンボルの値自体が NULL になることもある (そのため、 -.BR dlsym () -の返り値が NULL であったとしても必ずしもエラーという訳ではない)。 -エラーかどうかを確認する正しい方法は以下の通りである: -.BR dlerror () -を呼び出して以前のエラー状態をクリアしてから、 -.BR dlsym () -を呼び出す。その後でもう一度 -.BR dlerror () -を呼び出して、 -.BR dlerror () -の返り値を変数に保存し、保存した値が NULL であるか判定する。 +\fBdlopen\fP() は、何らかの理由で失敗すると NULL を返す。 +.SS dlsym() +関数 \fBdlsym\fP() は、 \fBdlopen\fP() が返した動的ライブラリの「ハンドル」と、 NULL +終端されたシンボル名の文字列を引き数に取り、 そのシンボルがロードされたメモリのアドレスを返す。 +シンボルが、指定されたライブラリと、指定されたライブラリがロードされる際に \fBdlopen\fP() +が自動的にロードしてライブラリのいずれにも見つからない場合には、 \fBdlsym\fP() は NULL を返す (\fBdlsym\fP() +による検索は、これらのライブラリの依存関係のツリーを先頭から 辿って行われる)。 実際にはシンボルの値自体が NULL になることもある (そのため、 +\fBdlsym\fP() の返り値が NULL であったとしても必ずしもエラーという訳ではない)。 エラーかどうかを確認する正しい方法は以下の通りである: +\fBdlerror\fP() を呼び出して以前のエラー状態をクリアしてから、 \fBdlsym\fP() を呼び出す。その後でもう一度 +\fBdlerror\fP() を呼び出して、 \fBdlerror\fP() の返り値を変数に保存し、保存した値が NULL であるか判定する。 .PP -.\"O There are two special pseudo-handles, -.\"O .B RTLD_DEFAULT -.\"O and -.\"O .BR RTLD_NEXT . -.B RTLD_DEFAULT -と -.B RTLD_NEXT -という二つの特別な擬似ハンドルがある。 -.\"O The former will find the first occurrence of the desired symbol -.\"O using the default library search order. -.\"O The latter -.\"O will find the next occurrence of a function in the search order -.\"O after the current library. -.\"O This allows one to provide a wrapper -.\"O around a function in another shared library. -.B RTLD_DEFAULT -は、デフォルトのライブラリ検索順序にしたがって、 -検索対象のシンボルが最初に現れるところを探す。 -.B RTLD_NEXT -は、ライブラリ検索順序の中で現在のライブラリ以降で最初に -関数が現れるところを探す。この機能を使うことで、別の共有ライブラリの +\fBRTLD_DEFAULT\fP と \fBRTLD_NEXT\fP という二つの特別な擬似ハンドルがある。 \fBRTLD_DEFAULT\fP +は、デフォルトのライブラリ検索順序にしたがって、 検索対象のシンボルが最初に現れるところを探す。 \fBRTLD_NEXT\fP +は、ライブラリ検索順序の中で現在のライブラリ以降で最初に 関数が現れるところを探す。この機能を使うことで、別の共有ライブラリの 関数へのラッパーを提供することができる。 -.SS "dlclose()" -.\"O The function -.\"O .BR dlclose () -.\"O decrements the reference count on the dynamic library handle -.\"O .IR handle . -.\"O If the reference count drops to zero and no other loaded libraries use -.\"O symbols in it, then the dynamic library is unloaded. -関数 -.BR dlclose () -は動的ライブラリのハンドル -.I handle -の参照カウントを 1 減らす。参照カウントが 0 になり、ロードされている -他のライブラリからそのライブラリ内のシンボルが使われていなければ、 -その動的ライブラリをアンロードする。 +.SS dlclose() +関数 \fBdlclose\fP() は動的ライブラリのハンドル \fIhandle\fP の参照カウントを 1 減らす。参照カウントが 0 +になり、ロードされている 他のライブラリからそのライブラリ内のシンボルが使われていなければ、 その動的ライブラリをアンロードする。 .LP -.\"O The function -.\"O .BR dlclose () -.\"O returns 0 on success, and nonzero on error. -関数 -.BR dlclose () -は、成功した場合は 0 を返し、エラーの場合 0 以外を返す。 -.\"O .SS "The obsolete symbols _init(0 and _fini()" +関数 \fBdlclose\fP() は、成功した場合は 0 を返し、エラーの場合 0 以外を返す。 .SS "廃止されたシンボル _init() と _fini()" -.\"O The linker recognizes special symbols -.\"O .B _init -.\"O and -.\"O .BR _fini . -.\"O If a dynamic library exports a routine named -.\"O .BR _init (), -.\"O then that code is executed after the loading, before -.\"O .BR dlopen () -.\"O returns. -.\"O If the dynamic library exports a routine named -.\"O .BR _fini (), -.\"O then that routine is called just before the library is unloaded. -リンカは -.B _init -と -.B _fini -を特別なシンボルと解釈する。 -ある動的ライブラリで -.BR _init () -という名前のルーチンがエクスポートされていれば、 -そのコードは、ライブラリのロード後、かつ -.BR dlopen () -が復帰する前に実行される。 -その動的ライブラリで -.BR _fini () -という名前のルーチンがエクスポートされていれば、 -ライブラリがアンロードされる直前にそのルーチンが呼び出される。 -.\"O In case you need to avoid linking against the system startup files, -.\"O this can be done by using the -.\"O .BR gcc (1) -.\"O .I \-nostartfiles -.\"O command-line option. -システムの起動ファイルに対するリンクを避ける必要がある場合、 -.BR gcc (1) -のコマンドラインに -.I \-nostartfiles -オプションを指定すればよい。 +リンカは \fB_init\fP と \fB_fini\fP を特別なシンボルと解釈する。 ある動的ライブラリで \fB_init\fP() +という名前のルーチンがエクスポートされていれば、 そのコードは、ライブラリのロード後、かつ \fBdlopen\fP() が復帰する前に実行される。 +その動的ライブラリで \fB_fini\fP() という名前のルーチンがエクスポートされていれば、 +ライブラリがアンロードされる直前にそのルーチンが呼び出される。 システムの起動ファイルに対するリンクを避ける必要がある場合、 \fBgcc\fP(1) +のコマンドラインに \fI\-nostartfiles\fP オプションを指定すればよい。 .LP -.\"O Using these routines, or the gcc -.\"O .B \-nostartfiles -.\"O or -.\"O .B \-nostdlib -.\"O options, is not recommended. -.\"O Their use may result in undesired behavior, -.\"O since the constructor/destructor routines will not be executed -.\"O (unless special measures are taken). -.\"O .\" void _init(void) __attribute__((constructor)); -.\"O .\" void _fini(void) __attribute__((destructor)); -このルーチンや、gcc のオプション -.B \-nostartfiles -や -.B \-nostdlib -は使用しないことを推奨する。 -これらを使うと、望ましくない動作をすることがある。 -なぜなら、(特別な措置が行われない限り) これらの constructor/destructor -ルーチンは実行されないからである。 .\" void _init(void) __attribute__((constructor)); .\" void _fini(void) __attribute__((destructor)); +このルーチンや、gcc のオプション \fB\-nostartfiles\fP や \fB\-nostdlib\fP は使用しないことを推奨する。 +これらを使うと、望ましくない動作をすることがある。 なぜなら、(特別な措置が行われない限り) これらの constructor/destructor +ルーチンは実行されないからである。 .LP -.\"O Instead, libraries should export routines using the -.\"O .B __attribute__((constructor)) -.\"O and -.\"O .B __attribute__((destructor)) -.\"O function attributes. -.\"O See the gcc info pages for information on these. -.\"O Constructor routines are executed before -.\"O .BR dlopen () -.\"O returns, and destructor routines are executed before -.\"O .BR dlclose () -.\"O returns. -代わりに、ライブラリは -.B __attribute__((constructor)) -や -.B __attribute__((destructor)) -の関数属性を使って必要なルーチンをエクスポートするのがよい。 -これらについては gcc の info ページを参照のこと。 -constructor ルーチンは -.BR dlopen () -が復帰する前に実行され、 -destructor ルーチンは -.BR dlclose () -が復帰する前に実行される。 -.\"O .SS Glibc extensions: dladdr() and dlvsym() -.SS GNU での拡張: dladdr() と dlvsym() -.\"O Glibc adds two functions not described by POSIX, with prototypes -glibc では POSIX には記載されていない関数が 2つ追加されている。 -プロトタイプは以下の通りである。 +代わりに、ライブラリは \fB__attribute__((constructor))\fP や \fB__attribute__((destructor))\fP +の関数属性を使って必要なルーチンをエクスポートするのがよい。 これらについては gcc の info ページを参照のこと。 constructor +ルーチンは \fBdlopen\fP() が復帰する前に実行され、 destructor ルーチンは \fBdlclose\fP() が復帰する前に実行される。 +.SS "GNU での拡張: dladdr() と dlvsym()" +glibc では POSIX には記載されていない関数が 2つ追加されている。 プロトタイプは以下の通りである。 .sp .nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" -.B #include +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP .sp -.BI "int dladdr(void *" addr ", Dl_info *" info ); +\fBint dladdr(void *\fP\fIaddr\fP\fB, Dl_info *\fP\fIinfo\fP\fB);\fP .sp -.BI "void *dlvsym(void *" handle ", char *" symbol ", char *" version ); +\fBvoid *dlvsym(void *\fP\fIhandle\fP\fB, char *\fP\fIsymbol\fP\fB, char *\fP\fIversion\fP\fB);\fP .fi .PP -.\"O The function -.\"O .BR dladdr () -.\"O takes a function pointer and tries to resolve name -.\"O and file where it is located. -.\"O Information is stored in the -.\"O .I Dl_info -.\"O structure: -関数 -.BR dladdr () -は、関数のポインタを引き数にとり、関数の名前と関数が定義されている -ファイルの解決を試みる。情報は -.I Dl_info +関数 \fBdladdr\fP() は、関数のポインタを引き数にとり、関数の名前と関数が定義されている ファイルの解決を試みる。情報は \fIDl_info\fP 構造体に格納される。 .sp .in +4n @@ -636,176 +204,45 @@ typedef struct { .fi .in .PP -.\"O If no symbol matching -.\"O .I addr -.\"O could be found, then -.\"O .I dli_sname -.\"O and -.\"O .I dli_saddr -.\"O are set to NULL. -.I addr -にマッチするシンボルが見つからなかった場合、 -.I dli_sname -と -.I dli_saddr -は NULL にセットされる。 +\fIaddr\fP にマッチするシンボルが見つからなかった場合、 \fIdli_sname\fP と \fIdli_saddr\fP は NULL にセットされる。 .PP -.\"O .BR dladdr () -.\"O returns 0 on error, and nonzero on success. -.BR dladdr () -は、エラー時には 0 を返し、成功した場合は 0 以外を返す。 +\fBdladdr\fP() は、エラー時には 0 を返し、成功した場合は 0 以外を返す。 .PP -.\"O The function -.\"O .BR dlvsym (), -.\"O provided by glibc since version 2.1, -.\"O does the same as -.\"O .BR dlsym () -.\"O but takes a version string as an additional argument. -関数 -.BR dlvsym () -は -.BR dlsym () -と同じ動作をするが、バージョンの文字列を渡す引き数が -追加されている点が異なる -.RB ( dlvsym () -はバージョン 2.1 以降の glibc で提供されている)。 -.\"O .SH "CONFORMING TO" +関数 \fBdlvsym\fP() は \fBdlsym\fP() と同じ動作をするが、バージョンの文字列を渡す引き数が 追加されている点が異なる +(\fBdlvsym\fP() はバージョン 2.1 以降の glibc で提供されている)。 .SH 準拠 -.\"O POSIX.1-2003 describes -.\"O .BR dlclose (), -.\"O .BR dlerror (), -.\"O .BR dlopen (), -.\"O and -.\"O .BR dlsym (). -POSIX.1-2003 には -.BR dlclose (), -.BR dlerror (), -.BR dlopen (), -.BR dlsym (). +POSIX.1\-2003 には \fBdlclose\fP(), \fBdlerror\fP(), \fBdlopen\fP(), \fBdlsym\fP(). の記載がある。 -.\"O .SH NOTES .SH 注意 -.\"O The symbols -.\"O .B RTLD_DEFAULT -.\"O and -.\"O .B RTLD_NEXT -.\"O are defined by -.\"O .I -.\"O only when -.\"O .B _GNU_SOURCE -.\"O was defined before including it. -シンボル -.B RTLD_DEFAULT -と -.B RTLD_NEXT -は -.I -で定義されており、 -.I -のインクルード前に -.B _GNU_SOURCE -が定義されている場合のみ有効となる。 .\" .LP -.\"O .\" The string returned by -.\"O .\" .BR dlerror () -.\"O .\" should not be modified. -.\"O .\" Some systems give the prototype as -.\"O .\" .sp -.\"O .\" .in +5 -.\"O .\" .B "const char *dlerror(void);" -.\"O .\" .in +.\" The string returned by .\" .BR dlerror () -.\" が返す文字列は変更すべきではない。システムによっては、 -.\" 以下のようなプロトタイプになっている。 +.\" should not be modified. +.\" Some systems give the prototype as .\" .sp .\" .in +5 .\" .B "const char *dlerror(void);" .\" .in +シンボル \fBRTLD_DEFAULT\fP と \fBRTLD_NEXT\fP は \fI\fP で定義されており、 +\fI\fP のインクルード前に \fB_GNU_SOURCE\fP が定義されている場合のみ有効となる。 -.\"O Since glibc 2.2.3, -.\"O .BR atexit (3) -.\"O can be used to register an exit handler that is automatically -.\"O called when a library is unloaded. -glibc 2.2.3 以降では、 -.BR atexit (3) -を使って、ライブラリがアンロードされる際に自動的に呼び出される -終了ハンドラ (exit handler) を登録することができる。 -.\"O .SS History +glibc 2.2.3 以降では、 \fBatexit\fP(3) を使って、ライブラリがアンロードされる際に自動的に呼び出される 終了ハンドラ (exit +handler) を登録することができる。 .SS 歴史 -.\"O The dlopen interface standard comes from SunOS. -.\"O That system also has -.\"O .BR dladdr (), -.\"O but not -.\"O .BR dlvsym (). -dlopen インターフェースの標準は SunOS をもとにしている。 -SunOS には -.BR dladdr () -もあったが、 -.BR dlvsym () +dlopen インターフェースの標準は SunOS をもとにしている。 SunOS には \fBdladdr\fP() もあったが、 \fBdlvsym\fP() はなかった。 -.\"O .SH BUGS .SH バグ -.\"O Sometimes, the function pointers you pass to -.\"O .BR dladdr () -.\"O may surprise you. -.\"O On some architectures (notably i386 and x86_64), -.\"O .I dli_fname -.\"O and -.\"O .I dli_fbase -.\"O may end up pointing back at the object from which you called -.\"O .BR dladdr (), -.\"O even if the function used as an argument should come from -.\"O a dynamically linked library. -時として、 -.BR dladdr () -に渡した関数ポインタは驚くような値になることがある。 -いくつかのアーキテクチャ (特に i386 と x86_64) では、 -引き数として使用した関数が動的リンクライブラリで定義されるもので -あったとしても、 -.I dli_fname -と -.I dli_fbase -が -.BR dladdr () -を呼び出したオブジェクトを参照した状態で終わっていることがある。 +時として、 \fBdladdr\fP() に渡した関数ポインタは驚くような値になることがある。 いくつかのアーキテクチャ (特に i386 と +x86_64) では、 引き数として使用した関数が動的リンクライブラリで定義されるもので あったとしても、 \fIdli_fname\fP と +\fIdli_fbase\fP が \fBdladdr\fP() を呼び出したオブジェクトを参照した状態で終わっていることがある。 .PP -.\"O The problem is that the function pointer will still be resolved -.\"O at compile time, but merely point to the -.\"O .I plt -.\"O (Procedure Linkage Table) -.\"O section of the original object (which dispatches the call after -.\"O asking the dynamic linker to resolve the symbol). -.\"O To work around this, -.\"O you can try to compile the code to be position-independent: -.\"O then, the compiler cannot prepare the pointer -.\"O at compile time anymore and today's -.\"O .BR gcc (1) -.\"O will generate code that just loads the final symbol address from the -.\"O .I got -.\"O (Global Offset Table) at run time before passing it to -.\"O .BR dladdr (). -.\"O motoki: 括弧内 (which dispatches 〜) の部分の訳に自信なし。 -.\"O which の主語は original object でいいのか? -問題は、関数ポインタの解決は今なおコンパイル時に行われるが、 -そのポインタは元のオブジェクトの -.I plt -(Procedure Linkage Table) セクションを指しているだけだという点にある -(オブジェクト自体は、ダイナミックリンカによってシンボルの解決が行われた後に、 -関数の呼び出しを行う)。 -これに対処する方法としては、 -コードを position-independent でコンパイルするという方法がある。 -そうすると、コンパイラはコンパイル時にポインタを用意することができず、 -今日の -.BR gcc (1) -では、実行時に -.BR dladdr () -に関数ポインタを渡す前に、 -.I got -(Global Offset Table) から最終的なシンボルのアドレスをロードするだけの +問題は、関数ポインタの解決は今なおコンパイル時に行われるが、 そのポインタは元のオブジェクトの \fIplt\fP (Procedure Linkage +Table) セクションを指しているだけだという点にある (オブジェクト自体は、ダイナミックリンカによってシンボルの解決が行われた後に、 +関数の呼び出しを行う)。 これに対処する方法としては、 コードを position\-independent でコンパイルするという方法がある。 +そうすると、コンパイラはコンパイル時にポインタを用意することができず、 今日の \fBgcc\fP(1) では、実行時に \fBdladdr\fP() +に関数ポインタを渡す前に、 \fIgot\fP (Global Offset Table) から最終的なシンボルのアドレスをロードするだけの コードが生成される。 -.\"O .SH EXAMPLE .SH 例 -.\"O Load the math library, and print the cosine of 2.0: math ライブラリをロードし、2.0 の余弦を表示する .nf @@ -835,8 +272,8 @@ main(int argc, char **argv) Corrigendum 1) workaround; see the Rationale for the POSIX specification of dlsym(). */ - *(void **) (&cosine) = dlsym(handle, "cos"); .\" But in fact "gcc -O2 -Wall" will complain about the preceding cast. + *(void **) (&cosine) = dlsym(handle, "cos"); if ((error = dlerror()) != NULL) { fprintf(stderr, "%s\en", error); @@ -849,37 +286,18 @@ main(int argc, char **argv) } .fi .PP -.\"O If this program were in a file named "foo.c", you would build the program -.\"O with the following command: -このプログラムを "foo.c" に書いたとすると、以下のコマンドでプログラムを -ビルドできる。 +このプログラムを "foo.c" に書いたとすると、以下のコマンドでプログラムを ビルドできる。 .in +4n .LP gcc \-rdynamic \-o foo foo.c \-ldl .in .PP -.\"O Libraries exporting -.\"O .BR _init () -.\"O and -.\"O .BR _fini () -.\"O will want to be compiled as -.\"O follows, using \fIbar.c\fP as the example name: -.BR _init () -と -.BR _fini () -をエクスポートするライブラリの場合は -以下のようにしてコンパイルする必要がある。 -例として \fIbar.c\fP をコンパイルする場合: +\fB_init\fP() と \fB_fini\fP() をエクスポートするライブラリの場合は 以下のようにしてコンパイルする必要がある。 例として +\fIbar.c\fP をコンパイルする場合: .in +4n .LP gcc \-shared \-nostartfiles \-o bar bar.c .in -.\"O .SH SEE ALSO .SH 関連項目 -.BR ld (1), -.BR ldd (1), -.BR dl_iterate_phdr (3), -.BR rtld-audit (7), -.BR ld.so (8), -.BR ldconfig (8), -ld.so info pages, gcc info pages, ld info pages +\fBld\fP(1), \fBldd\fP(1), \fBdl_iterate_phdr\fP(3), \fBrtld\-audit\fP(7), \fBld.so\fP(8), +\fBldconfig\fP(8), ld.so info pages, gcc info pages, ld info pages diff --git a/draft/man3/drand48.3 b/draft/man3/drand48.3 index ac7bdcea..66c8689d 100644 --- a/draft/man3/drand48.3 +++ b/draft/man3/drand48.3 @@ -25,56 +25,43 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 19:46:03 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi -.\" all rights reserved. -.\" Translated Mon Jan 20 20:04:05 JST 1997 -.\" by YOSHINO Takashi +.\" This file was generated with po4a. Translate the source file. .\" -.\" WORD: internal buffer 内部バッファ -.\" -.TH DRAND48 3 2007-07-26 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH DRAND48 3 2007\-07\-26 "" "Linux Programmer's Manual" .SH 名前 -.\"O drand48, erand48, lrand48, nrand48, mrand48, jrand48, srand48, seed48, -.\"O lcong48 \- generate uniformly distributed pseudo-random numbers drand48, erand48, lrand48, nrand48, mrand48, jrand48, srand48, seed48, lcong48 \- 一様分布する疑似乱数を生成する関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.B double drand48(void); +\fBdouble drand48(void);\fP .sp -.BI "double erand48(unsigned short " xsubi [3]); +\fBdouble erand48(unsigned short \fP\fIxsubi\fP\fB[3]);\fP .sp -.B long int lrand48(void); +\fBlong int lrand48(void);\fP .sp -.BI "long int nrand48(unsigned short " xsubi [3]); +\fBlong int nrand48(unsigned short \fP\fIxsubi\fP\fB[3]);\fP .sp -.B long int mrand48(void); +\fBlong int mrand48(void);\fP .sp -.BI "long int jrand48(unsigned short " xsubi [3]); +\fBlong int jrand48(unsigned short \fP\fIxsubi\fP\fB[3]);\fP .sp -.BI "void srand48(long int " seedval ); +\fBvoid srand48(long int \fP\fIseedval\fP\fB);\fP .sp -.BI "unsigned short *seed48(unsigned short " seed16v [3]); +\fBunsigned short *seed48(unsigned short \fP\fIseed16v\fP\fB[3]);\fP .sp -.BI "void lcong48(unsigned short " param [7]); +\fBvoid lcong48(unsigned short \fP\fIparam\fP\fB[7]);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.\"O All functions shown above: -上記の全ての関数: .\" .BR drand48 (), .\" .BR erand48 (), .\" .BR lrand48 (), @@ -84,249 +71,61 @@ glibc 向けの機能検査マクロの要件 .\" .BR srand48 (), .\" .BR seed48 (), .\" .BR lcong48 (): -_SVID_SOURCE || _XOPEN_SOURCE +上記の全ての関数: _SVID_SOURCE || _XOPEN_SOURCE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O These functions generate pseudo-random numbers using the linear congruential -.\"O algorithm and 48-bit integer arithmetic. -これらの関数は線形合同アルゴリズムと 48ビット整数演算を用いて -疑似乱数を生成する。 +これらの関数は線形合同アルゴリズムと 48ビット整数演算を用いて 疑似乱数を生成する。 .PP -.\"O The -.\"O .BR drand48 () -.\"O and -.\"O .BR erand48 () -.\"O functions return nonnegative -.\"O double-precision floating-point values uniformly distributed between -.\"O [0.0, 1.0). -関数 -.BR drand48 () -と -.BR erand48 () -は、区間 [0.0, 1.0) で -一様分布する非負の倍精度浮動小数点実数値を返す。 +関数 \fBdrand48\fP() と \fBerand48\fP() は、区間 [0.0, 1.0) で 一様分布する非負の倍精度浮動小数点実数値を返す。 .PP -.\"O The -.\"O .BR lrand48 () -.\"O and -.\"O .BR nrand48 () -.\"O functions return nonnegative -.\"O long integers uniformly distributed between 0 and 2^31. -関数 -.BR lrand48 () -と -.BR nrand48 () -は 0 と 2^31 の間で一様分布する -非負のロング整数を返す。 +関数 \fBlrand48\fP() と \fBnrand48\fP() は 0 と 2^31 の間で一様分布する 非負のロング整数を返す。 .PP -.\"O The -.\"O .BR mrand48 () -.\"O and -.\"O .BR jrand48 () -.\"O functions return signed long -.\"O integers uniformly distributed between \-2^31 and 2^31. -関数 -.BR mrand48 () -と -.BR jrand48 () -は -\-2^31 と 2^31 の間で一様分布する符号付きロング整数を返す。 +関数 \fBmrand48\fP() と \fBjrand48\fP() は \-2^31 と 2^31 の間で一様分布する符号付きロング整数を返す。 .PP -.\"O The -.\"O .BR srand48 (), -.\"O .BR seed48 () -.\"O and -.\"O .BR lcong48 () -.\"O functions are -.\"O initialization functions, one of which should be called before using -.\"O .BR drand48 (), -.\"O .BR lrand48 () -.\"O or -.\"O .BR mrand48 (). -.\"O The functions -.\"O .BR erand48 (), -.\"O .BR nrand48 () -.\"O and -.\"O .BR jrand48 () -.\"O do not require -.\"O an initialization function to be called first. -関数 -.BR srand48 (), -.BR seed48 (), -.BR lcong48 () -は初期化関数 -である。 -関数 -.BR drand48 (), -.BR lrand48 (), -.BR mrand48 () -を -使用する前に、これらの初期化関数のいずれかを呼ぶべきである。 -関数 -.BR erand48 (), -.BR nrand48 (), -.BR jrand48 () -は初めに -初期化関数を呼ぶことを必要としない。 +関数 \fBsrand48\fP(), \fBseed48\fP(), \fBlcong48\fP() は初期化関数 である。 関数 \fBdrand48\fP(), +\fBlrand48\fP(), \fBmrand48\fP() を 使用する前に、これらの初期化関数のいずれかを呼ぶべきである。 関数 +\fBerand48\fP(), \fBnrand48\fP(), \fBjrand48\fP() は初めに 初期化関数を呼ぶことを必要としない。 .PP -.\"O All the functions work by generating a sequence of 48-bit integers, -.\"O \fIXi\fP, according to the linear congruential formula: -ここで説明しているすべての関数は 48ビットの整数の -シーケンス (\fIXi\fP) を生成することで -機能している。生成方法は以下の線形合同の式による。 +ここで説明しているすべての関数は 48ビットの整数の シーケンス (\fIXi\fP) を生成することで 機能している。生成方法は以下の線形合同の式による。 .sp .nf .RS -.B Xn+1 = (aXn + c) mod m, +\fBXn+1 = (aXn + c) mod m,\fP .RE .fi .sp -.\"O The parameter \fIm\fP = 2^48, hence 48-bit integer arithmetic is performed. -.\"O Unless -.\"O .BR lcong48 () -.\"O is called, \fIa\fP and \fIc\fP are given by: -ここで n >= 0 である。 -パラメータが \fIm\fP = 2^48 であるため、48ビット整数演算が行われている。 -.BR lcong48 () +ここで n >= 0 である。 パラメータが \fIm\fP = 2^48 であるため、48ビット整数演算が行われている。 \fBlcong48\fP() が呼ばれていない場合、\fIa\fP と \fIc\fP は以下の式で与えられる。 .sp .nf .RS -.B a = 0x5DEECE66D -.B c = 0xB +\fBa = 0x5DEECE66D\fP +\fBc = 0xB\fP .RE .fi .sp -.\"O The value returned by any of the functions -.\"O .BR drand48 (), -.\"O .BR erand48 (), -.\"O .BR lrand48 (), -.\"O .BR nrand48 (), -.\"O .BR mrand48 () -.\"O or -.\"O .BR jrand48 () -.\"O is -.\"O computed by first generating the next 48-bit \fIXi\fP in the sequence. -.\"O Then the appropriate number of bits, according to the type of data item to -.\"O be returned, is copied from the high-order bits of \fIXi\fP and transformed -.\"O into the returned value. -関数 -.BR drand48 (), -.BR erand48 (), -.BR lrand48 (), -.BR nrand48 (), -.BR mrand48 (), -.BR jrand48 () -で返される値は次のようにして計算される。 -はじめに、次の48ビットの \fIXi\fP が計算される。 -そして、返すべきデータの型に依存した適切な -ビット数が \fIXi\fP の上位ビットからコピーされる。 -最後に、この値を返り値に変換する。 +関数 \fBdrand48\fP(), \fBerand48\fP(), \fBlrand48\fP(), \fBnrand48\fP(), \fBmrand48\fP(), +\fBjrand48\fP() で返される値は次のようにして計算される。 はじめに、次の48ビットの \fIXi\fP が計算される。 +そして、返すべきデータの型に依存した適切な ビット数が \fIXi\fP の上位ビットからコピーされる。 最後に、この値を返り値に変換する。 .PP -.\"O The functions -.\"O .BR drand48 (), -.\"O .BR lrand48 () -.\"O and -.\"O .BR mrand48 () -.\"O store -.\"O the last 48-bit \fIXi\fP generated in an internal buffer. -.\"O The functions -.\"O .BR erand48 (), -.\"O .BR nrand48 () -.\"O and -.\"O .BR jrand48 () -.\"O require the calling -.\"O program to provide storage for the successive \fIXi\fP values in the array -.\"O argument \fIxsubi\fP. -.\"O The functions are initialized by placing the initial -.\"O value of \fIXi\fP into the array before calling the function for the first -.\"O time. -関数 -.BR drand48 (), -.BR lrand48 (), -.BR mrand48 () -は -最後に生成された48ビットの \fIXi\fP を内部バッファに格納する。 -配列の形の引数 \fIxsubi\fP に個々の \fIXi\fP の値を -格納できるような領域を確保することを、 -関数 -.BR erand48 (), -.BR nrand48 (), -.BR jrand48 () -は、 -呼び出し側のプログラムに要求する。 -これらの関数は、はじめてそれらの関数を呼ぶ前に \fIXi\fP の初期値を配列に -代入することで初期化される。 +関数 \fBdrand48\fP(), \fBlrand48\fP(), \fBmrand48\fP() は 最後に生成された48ビットの \fIXi\fP +を内部バッファに格納する。 配列の形の引数 \fIxsubi\fP に個々の \fIXi\fP の値を 格納できるような領域を確保することを、 関数 +\fBerand48\fP(), \fBnrand48\fP(), \fBjrand48\fP() は、 呼び出し側のプログラムに要求する。 +これらの関数は、はじめてそれらの関数を呼ぶ前に \fIXi\fP の初期値を配列に 代入することで初期化される。 .PP -.\"O The initializer function -.\"O .BR srand48 () -.\"O sets the high order 32-bits of -.\"O \fIXi\fP to the argument \fIseedval\fP. -.\"O The low order 16-bits are set -.\"O to the arbitrary value 0x330E. -初期化関数 -.BR srand48 () -は、\fIXi\fP の -上位32ビットを引数 \fIseedval\fP に設定する。 +初期化関数 \fBsrand48\fP() は、\fIXi\fP の 上位32ビットを引数 \fIseedval\fP に設定する。 下位の16ビットは、適当に決められた値である0x330Eに設定される。 .PP -.\"O The initializer function -.\"O .BR seed48 () -.\"O sets the value of \fIXi\fP to -.\"O the 48-bit value specified in the array argument \fIseed16v\fP. -.\"O The -.\"O previous value of \fIXi\fP is copied into an internal buffer and a -.\"O pointer to this buffer is returned by -.\"O .BR seed48 (). -初期化関数 -.BR seed48 () -は、\fIXi\fP の値を、 -配列の形をした引数である \fIseed16v\fP の中で指定された 48ビットの値に設定する。 -\fIXi\fP の前の値は内部バッファにコピーされ、このバッファへのポインタが -.BR seed48 () -によって返される。 +初期化関数 \fBseed48\fP() は、\fIXi\fP の値を、 配列の形をした引数である \fIseed16v\fP の中で指定された +48ビットの値に設定する。 \fIXi\fP の前の値は内部バッファにコピーされ、このバッファへのポインタが \fBseed48\fP() によって返される。 .PP -.\"O The initialization function -.\"O .BR lcong48 () -.\"O allows the user to specify -.\"O initial values for \fIXi\fP, \fIa\fP and \fIc\fP. -.\"O Array argument -.\"O elements \fIparam[0-2]\fP specify \fIXi\fP, \fIparam[3-5]\fP specify -.\"O \fIa\fP, and \fIparam[6]\fP specifies \fIc\fP. -.\"O After -.\"O .BR lcong48 () -.\"O has been called, a subsequent call to either -.\"O .BR srand48 () -.\"O or -.\"O .BR seed48 () -.\"O will restore the standard values of \fIa\fP and \fIc\fP. -初期化関数 -.BR lcong48 () -は使用者が \fIXi\fP, \fIa\fP, \fIc\fP の -初期値を指定するための関数である。 -配列の形をした引数の要素はそれぞれ、\fIparam[0-2]\fP は \fIXi\fP を、 -\fIparam[3-5]\fP は \fIa\fP を、\fIparam[6]\fP は \fIc\fP を指定するもの -である。 -.BR lcong48 () -が呼ばれた後で、 -.BR srand48 () -か -.BR seed48 () -を呼ぶと、前述の \fIa\fP と \fIc\fP の -標準値が再び設定される。 +初期化関数 \fBlcong48\fP() は使用者が \fIXi\fP, \fIa\fP, \fIc\fP の 初期値を指定するための関数である。 +配列の形をした引数の要素はそれぞれ、\fIparam[0\-2]\fP は \fIXi\fP を、 \fIparam[3\-5]\fP は \fIa\fP +を、\fIparam[6]\fP は \fIc\fP を指定するもの である。 \fBlcong48\fP() が呼ばれた後で、 \fBsrand48\fP() か +\fBseed48\fP() を呼ぶと、前述の \fIa\fP と \fIc\fP の 標準値が再び設定される。 .SH 準拠 -SVr4, POSIX.1-2001. -.\"O .SH NOTES +SVr4, POSIX.1\-2001. .SH 注意 -.\"O These functions are declared obsolete by SVID 3, which states that -.\"O .BR rand (3) -.\"O should be used instead. -SVID 3 ではこれらの関数は時代遅れと宣言されている。 -SVID 3 では -.BR rand (3) -が代わりに使用されるべきだと記述されている。 -.\"O .SH "SEE ALSO" +SVID 3 ではこれらの関数は時代遅れと宣言されている。 SVID 3 では \fBrand\fP(3) が代わりに使用されるべきだと記述されている。 .SH 関連項目 -.BR rand (3), -.BR random (3) +\fBrand\fP(3), \fBrandom\fP(3) diff --git a/draft/man3/drand48_r.3 b/draft/man3/drand48_r.3 index 0abda65d..7ce16cf6 100644 --- a/draft/man3/drand48_r.3 +++ b/draft/man3/drand48_r.3 @@ -22,63 +22,53 @@ .\" .\" Created 2004-10-31. Text taken from a page by Walter Harms, 2003-09-08 .\" -.\" Japanese Version Copyright (c) 2005 Yuichi SATO -.\" all rights reserved. -.\" Translated Sat Jan 29 04:28:24 JST 2005 -.\" by Yuichi SATO +.\"******************************************************************* .\" -.TH DRAND48_R 3 2007-07-26 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH DRAND48_R 3 2007\-07\-26 GNU "Linux Programmer's Manual" .SH 名前 -.\"O drand48_r, erand48_r, lrand48_r, nrand48_r, mrand48_r, jrand48_r, -.\"O srand48_r, seed48_r, lcong48_r -.\"O \- generate uniformly distributed pseudo-random numbers reentrantly -drand48_r, erand48_r, lrand48_r, nrand48_r, mrand48_r, jrand48_r, srand48_r, seed48_r, lcong48_r \- 一様分布する疑似乱数をリエントラント (reentrant) に生成する -.\"O .SH SYNOPSIS +drand48_r, erand48_r, lrand48_r, nrand48_r, mrand48_r, jrand48_r, srand48_r, +seed48_r, lcong48_r \- 一様分布する疑似乱数をリエントラント (reentrant) に生成する .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int drand48_r(struct drand48_data *" buffer ", double *" result ); +\fBint drand48_r(struct drand48_data *\fP\fIbuffer\fP\fB, double *\fP\fIresult\fP\fB);\fP .sp -.BI "int erand48_r(unsigned short " xsubi [3] "," +\fBint erand48_r(unsigned short \fP\fIxsubi\fP\fB[3]\fP\fI,\fP .br -.BI " struct drand48_data *"buffer ", double *" result ");" +\fB struct drand48_data *\fP\fIbuffer\fP\fB, double *\fP\fIresult\fP\fB);\fP .sp -.BI "int lrand48_r(struct drand48_data *" buffer ", long int *" result ); +\fBint lrand48_r(struct drand48_data *\fP\fIbuffer\fP\fB, long int *\fP\fIresult\fP\fB);\fP .sp -.BI "int nrand48_r(unsigned short int " xsubi[3] "," +\fBint nrand48_r(unsigned short int \fP\fIxsubi[3]\fP\fB,\fP .br -.BI " struct drand48_data *"buffer ", long int *" result ");" +\fB struct drand48_data *\fP\fIbuffer\fP\fB, long int *\fP\fIresult\fP\fB);\fP .sp -.BI "int mrand48_r(struct drand48_data *" buffer ",long int *" result ");" +\fBint mrand48_r(struct drand48_data *\fP\fIbuffer\fP\fB,long int *\fP\fIresult\fP\fB);\fP .sp -.BI "int jrand48_r(unsigned short int " xsubi[3] "," +\fBint jrand48_r(unsigned short int \fP\fIxsubi[3]\fP\fB,\fP .br -.BI " struct drand48_data *" buffer ", long int *" result ");" +\fB struct drand48_data *\fP\fIbuffer\fP\fB, long int *\fP\fIresult\fP\fB);\fP .sp -.BI "int srand48_r(long int " seedval ", struct drand48_data *" buffer ");" +\fBint srand48_r(long int \fP\fIseedval\fP\fB, struct drand48_data *\fP\fIbuffer\fP\fB);\fP .sp -.BI "int seed48_r(unsigned short int " seed16v[3] "," +\fBint seed48_r(unsigned short int \fP\fIseed16v[3]\fP\fB,\fP .br -.BI " struct drand48_data *" buffer ");" +\fB struct drand48_data *\fP\fIbuffer\fP\fB);\fP .sp -.BI "int lcong48_r(unsigned short int " param[7] "," +\fBint lcong48_r(unsigned short int \fP\fIparam[7]\fP\fB,\fP .br -.BI " struct drand48_data *" buffer ");" +\fB struct drand48_data *\fP\fIbuffer\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.\"O All functions shown above: -上記の全ての関数: .\" .BR drand48_r (), .\" .BR erand48_r (), .\" .BR lrand48_r (), @@ -88,45 +78,17 @@ glibc 向けの機能検査マクロの要件 .\" .BR srand48_r (), .\" .BR seed48_r (), .\" .BR lcong48_r (): -_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE +上記の全ての関数: _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O These functions are the reentrant analogs of the functions described in -.\"O .BR drand48 (3). -.\"O Instead of modifying the global random generator state, they use -.\"O the supplied data -.\"O .IR buffer . -これらの関数は -.BR drand48 (3) -で説明されている関数に類似するリエントラントな関数である。 -大域的な乱数生成の状態を変更する代わりに、 -これらの関数は指定されたデータ -.I buffer -を使う。 +これらの関数は \fBdrand48\fP(3) で説明されている関数に類似するリエントラントな関数である。 大域的な乱数生成の状態を変更する代わりに、 +これらの関数は指定されたデータ \fIbuffer\fP を使う。 -.\"O Before the first use, this struct must be initialized, for example, -.\"O by filling it with zeros, or by calling one of the functions -.\"O .BR srand48_r (), -.\"O .BR seed48_r (), -.\"O or -.\"O .BR lcong48_r (). -最初に使う前に、この構造体は初期化されていなければならない。 -初期化は、たとえば 0 で埋めたり、関数 -.BR srand48_r (), -.BR seed48_r (), -.BR lcong48_r () -のいずれかを呼び出すことによって行われる。 -.\"O .SH "RETURN VALUE" +最初に使う前に、この構造体は初期化されていなければならない。 初期化は、たとえば 0 で埋めたり、関数 \fBsrand48_r\fP(), +\fBseed48_r\fP(), \fBlcong48_r\fP() のいずれかを呼び出すことによって行われる。 .SH 返り値 -.\"O The return value is 0. 返り値は 0 である。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O These functions are GNU extensions and are not portable. これらの関数は GNU による拡張であり、移植性はない。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR drand48 (3), -.BR rand (3), -.BR random (3) +\fBdrand48\fP(3), \fBrand\fP(3), \fBrandom\fP(3) diff --git a/draft/man3/dysize.3 b/draft/man3/dysize.3 index 1eb7e8f0..6509f29f 100644 --- a/draft/man3/dysize.3 +++ b/draft/man3/dysize.3 @@ -21,60 +21,34 @@ .\" the source, must acknowledge the copyright and authors of this work. .\" .\" aeb: some corrections +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved. -.\" Translated Sun 6 Jan 2002 by NAKANO Takeo +.\" This file was generated with po4a. Translate the source file. .\" -.TH DYSIZE 3 2010-09-22 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O dysize \- get number of days for a given year +.\"******************************************************************* +.TH DYSIZE 3 2010\-09\-22 GNU "Linux Programmer's Manual" .SH 名前 dysize \- 与えた年の日数を返す -.\"O .SH SYNOPSIS .SH 書式 -.B "#include " +\fB#include \fP .sp -.BI "int dysize(int " year ); +\fBint dysize(int \fP\fIyear\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR dysize (): -_BSD_SOURCE || _SVID_SOURCE -.\"O .SH DESCRIPTION +\fBdysize\fP(): _BSD_SOURCE || _SVID_SOURCE .SH 説明 -.\"O The function returns 365 for a normal year and 366 for a leap year. -.\"O The calculation for leap year is based on: -この関数は通常の年には 365 を返し、うるう年には 366 を返す。 -うるう年の計算は次の式による: +この関数は通常の年には 365 を返し、うるう年には 366 を返す。 うるう年の計算は次の式による: .sp (year) %4 == 0 && ((year) %100 != 0 || (year) %400 == 0) .sp -.\"O The formula is defined in the macro -.\"O .I __isleap(year) -.\"O also found in -.\"O .IR . -この式は -.I __isleap(year) -マクロで定義されており、 -.I -にもある。 -.\"O .SH "CONFORMING TO" +この式は \fI__isleap(year)\fP マクロで定義されており、 \fI\fP にもある。 .SH 準拠 -.\"O This function occurs in SunOS 4.x. この関数は SunOS 4.x で生まれた。 -.\"O .SH NOTES .SH 注意 -.\"O This is a compatibility function only. -.\"O Don't use it in new programs. -.\"O .\" The SCO version of this function had a year-2000 problem. +.\" The SCO version of this function had a year-2000 problem. これは互換用の関数に過ぎない。新しいプログラムでは使わないこと。 -.\" この関数の SCO 版には 2000 年問題が含まれていた。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR strftime (3) +\fBstrftime\fP(3) diff --git a/draft/man3/ecvt.3 b/draft/man3/ecvt.3 index e9072f47..a9d214be 100644 --- a/draft/man3/ecvt.3 +++ b/draft/man3/ecvt.3 @@ -27,42 +27,32 @@ .\" Modified Sat Jul 24 19:40:39 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified Fri Jun 25 12:10:47 1999 by Andries Brouwer (aeb@cwi.nl) .\" -.\" Japanese Version Copyright (c) 1997 Hiroaki Nagoya -.\" all rights reserved. -.\" Translated Mon Feb 10 1997 by Hiroaki Nagoya -.\" Updated 2000-01-08 by Kentaro Shirakata -.\" Updated 2009-04-22 by Kentaro Shirakata +.\"******************************************************************* .\" -.TH ECVT 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ECVT 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O ecvt, fcvt \- convert a floating-point number to a string ecvt, fcvt \- 浮動小数点数の文字列への変換 -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "char *ecvt(double " number ", int " ndigits ", int *" decpt , -.BI "int *" sign ); +\fBchar *ecvt(double \fP\fInumber\fP\fB, int \fP\fIndigits\fP\fB, int *\fP\fIdecpt\fP\fB,\fP +\fBint *\fP\fIsign\fP\fB);\fP .sp -.BI "char *fcvt(double " number ", int " ndigits ", int *" decpt , -.BI "int *" sign ); +\fBchar *fcvt(double \fP\fInumber\fP\fB, int \fP\fIndigits\fP\fB, int *\fP\fIdecpt\fP\fB,\fP +\fBint *\fP\fIsign\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR ecvt (), -.BR fcvt (): +\fBecvt\fP(), \fBfcvt\fP(): .ad l .RS 4 .PD 0 -.TP 4 -.\"O Since glibc 2.12: +.TP 4 glibc 2.12 以降: .nf _SVID_SOURCE || @@ -70,132 +60,31 @@ _SVID_SOURCE || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) && !(_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600) .fi -.TP 4 -.\"O Before glibc 2.12: +.TP 4 glibc 2.12 より前: -_SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +_SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .PD .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR ecvt () -.\"O function converts \fInumber\fP to a null-terminated -.\"O string of \fIndigits\fP digits (where \fIndigits\fP is reduced to a -.\"O system-specific limit determined by the precision of a -.\"O .IR double ), -.\"O and returns a pointer to the string. -.\"O The high-order digit is nonzero, unless -.\"O .I number -.\"O is zero. -.\"O The low order digit is rounded. -関数 -.BR ecvt () -は \fInumber\fP を NUL 文字で終端された -\fIndigits\fP 文字の文字列へ変換し、その文字列へのポインタを返す -(\fIndigits\fP が -.I double -の精度によって決定されるシステム依存の上限値より大きい場合は、 -その条件値が \fIndigits\fP の値となる)。 -.I number -が 0 でなければ、最上位の桁は 0 以外である。 -最下位の桁は丸められる。 -.\"O The string itself does not contain a decimal point; however, -.\"O the position of the decimal point relative to the start of the string -.\"O is stored in \fI*decpt\fP. -.\"O A negative value for \fI*decpt\fP means that -.\"O the decimal point is to the left of the start of the string. -.\"O If the sign of -.\"O \fInumber\fP is negative, \fI*sign\fP is set to a nonzero value, -.\"O otherwise it's set to 0. -.\"O If -.\"O .I number -.\"O is zero, it is unspecified whether \fI*decpt\fP is 0 or 1. -文字列には小数点は含まれない。そのかわりに、文字列の先頭からの小数点の -位置が \fI*decpt\fP に保持される。 -\fI*decpt\fP が負の値の場合、小数点が文字列の先頭の左側にあることを意味する。 -もし(\fInumber\fPの)符号が負ならば \fI*sign\fP は 0 以外の値に、 -そうでなければ 0 に設定される。 -.I number -が 0 なら、\fI*decpt\fP が 0 か 1 かは未規定である。 +関数 \fBecvt\fP() は \fInumber\fP を NUL 文字で終端された \fIndigits\fP +文字の文字列へ変換し、その文字列へのポインタを返す (\fIndigits\fP が \fIdouble\fP +の精度によって決定されるシステム依存の上限値より大きい場合は、 その条件値が \fIndigits\fP の値となる)。 \fInumber\fP が 0 +でなければ、最上位の桁は 0 以外である。 最下位の桁は丸められる。 文字列には小数点は含まれない。そのかわりに、文字列の先頭からの小数点の 位置が +\fI*decpt\fP に保持される。 \fI*decpt\fP が負の値の場合、小数点が文字列の先頭の左側にあることを意味する。 +もし(\fInumber\fPの)符号が負ならば \fI*sign\fP は 0 以外の値に、 そうでなければ 0 に設定される。 \fInumber\fP が 0 +なら、\fI*decpt\fP が 0 か 1 かは未規定である。 .PP -.\"O The -.\"O .BR fcvt () -.\"O function is identical to -.\"O .BR ecvt (), -.\"O except that -.\"O \fIndigits\fP specifies the number of digits after the decimal point. -関数 -.BR fcvt () -は -.BR ecvt () -と同じ機能を持つが、\fIndigits\fP は小数点以下の文字数を指定する。 -.\"O .SH "RETURN VALUE" +関数 \fBfcvt\fP() は \fBecvt\fP() と同じ機能を持つが、\fIndigits\fP は小数点以下の文字数を指定する。 .SH 返り値 -.\"O Both the -.\"O .BR ecvt () -.\"O and -.\"O .BR fcvt () -.\"O functions return a pointer to a -.\"O static string containing the ASCII representation of \fInumber\fP. -関数 -.BR ecvt () -と -.BR fcvt () -は \fInumber\fP の ASCII 表現を含む -静的な領域内の文字列へのポインタを返す。 -.\"O The static string is overwritten by each call to -.\"O .BR ecvt () -.\"O or -.\"O .BR fcvt (). -この文字列は -.BR ecvt () -や -.BR fcvt () -の呼び出しのたびに上書きされる。 -.\"O .SH "CONFORMING TO" +関数 \fBecvt\fP() と \fBfcvt\fP() は \fInumber\fP の ASCII 表現を含む 静的な領域内の文字列へのポインタを返す。 +この文字列は \fBecvt\fP() や \fBfcvt\fP() の呼び出しのたびに上書きされる。 .SH 準拠 -.\"O SVr2; -.\"O marked as LEGACY in POSIX.1-2001. -SVr2。 -POSIX.1-2001 では「過去の名残 (LEGACY)」と位置付けられている。 -.\"O POSIX.1-2008 removes the specifications of -.\"O .BR ecvt () -.\"O and -.\"O .BR fcvt (), -.\"O recommending the use of -.\"O .BR sprintf (3) -.\"O instead (though -.\"O .BR snprintf (3) -.\"O may be preferable). -POSIX.1-2008 では -.BR ecvt () -と -.BR fcvt () -の仕様が削除され、代わりに -.BR sprintf (3) -の使用が推奨されている(しかし -.BR snprintf (3) +SVr2。 POSIX.1\-2001 では「過去の名残 (LEGACY)」と位置付けられている。 POSIX.1\-2008 では \fBecvt\fP() +と \fBfcvt\fP() の仕様が削除され、代わりに \fBsprintf\fP(3) の使用が推奨されている(しかし \fBsnprintf\fP(3) がより適切かもしれない)。 -.\"O .SH NOTES .SH 注意 -.\"O Linux libc4 and libc5 specified the type of -.\"O .I ndigits -.\"O as -.\"O .IR size_t . -Linux libc4 と libc5 では -.I ndigits -の型は -.I size_t -となっていた。 -.\"O Not all locales use a point as the radix character ("decimal point"). +Linux libc4 と libc5 では \fIndigits\fP の型は \fIsize_t\fP となっていた。 小数点にピリオドを使わないロケールもある。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR ecvt_r (3), -.BR gcvt (3), -.BR qecvt (3), -.BR setlocale (3), -.BR sprintf (3) +\fBecvt_r\fP(3), \fBgcvt\fP(3), \fBqecvt\fP(3), \fBsetlocale\fP(3), \fBsprintf\fP(3) diff --git a/draft/man3/ecvt_r.3 b/draft/man3/ecvt_r.3 index 2514e506..0c1f3ab5 100644 --- a/draft/man3/ecvt_r.3 +++ b/draft/man3/ecvt_r.3 @@ -25,114 +25,50 @@ .\" .\" Corrected return types; from Fabian; 2004-10-05 .\" -.\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated Sun Sep 22 09:46:55 2002 -.\" by Akihiro MOTOKI +.\"******************************************************************* .\" -.\"WORD: obsolete 廃止された +.\" This file was generated with po4a. Translate the source file. .\" -.TH ECVT_R 3 2007-07-26 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH ECVT_R 3 2007\-07\-26 GNU "Linux Programmer's Manual" .SH 名前 -.\"O ecvt_r, fcvt_r, qecvt_r, qfcvt_r \- convert a floating-point number to a string ecvt_r, fcvt_r, qecvt_r, qfcvt_r \- 浮動小数点数の文字列への変換 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int ecvt_r(double " number ", int " ndigits ", int *" decpt , -.BI " int *" sign ", char *" buf ", size_t " len ); +\fBint ecvt_r(double \fP\fInumber\fP\fB, int \fP\fIndigits\fP\fB, int *\fP\fIdecpt\fP\fB,\fP +\fB int *\fP\fIsign\fP\fB, char *\fP\fIbuf\fP\fB, size_t \fP\fIlen\fP\fB);\fP .sp -.BI "int fcvt_r(double " number ", int " ndigits ", int *" decpt , -.BI " int *" sign ", char *" buf ", size_t " len ); +\fBint fcvt_r(double \fP\fInumber\fP\fB, int \fP\fIndigits\fP\fB, int *\fP\fIdecpt\fP\fB,\fP +\fB int *\fP\fIsign\fP\fB, char *\fP\fIbuf\fP\fB, size_t \fP\fIlen\fP\fB);\fP .sp -.BI "int qecvt_r(long double " number ", int " ndigits ", int *" decpt , -.BI " int *" sign ", char *" buf ", size_t " len ); +\fBint qecvt_r(long double \fP\fInumber\fP\fB, int \fP\fIndigits\fP\fB, int *\fP\fIdecpt\fP\fB,\fP +\fB int *\fP\fIsign\fP\fB, char *\fP\fIbuf\fP\fB, size_t \fP\fIlen\fP\fB);\fP .sp -.BI "int qfcvt_r(long double " number ", int " ndigits ", int *" decpt , -.BI " int *" sign ", char *" buf ", size_t " len ); +\fBint qfcvt_r(long double \fP\fInumber\fP\fB, int \fP\fIndigits\fP\fB, int *\fP\fIdecpt\fP\fB,\fP +\fB int *\fP\fIsign\fP\fB, char *\fP\fIbuf\fP\fB, size_t \fP\fIlen\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR ecvt_r (), -.BR fcvt_r (), -.BR qecvt_r (), -.BR qfcvt_r (): +\fBecvt_r\fP(), \fBfcvt_r\fP(), \fBqecvt_r\fP(), \fBqfcvt_r\fP(): .RS 4 _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The functions -.\"O .BR ecvt_r (), -.\"O .BR fcvt_r (), -.\"O .BR qecvt_r () -.\"O and -.\"O .BR qfcvt_r () -.\"O are identical to -.\"O .BR ecvt (3), -.\"O .BR fcvt (3), -.\"O .BR qecvt (3) -.\"O and -.\"O .BR qfcvt (3), -.\"O respectively, except that they do not return their result in a static -.\"O buffer, but instead use the supplied -.\"O .I buf -.\"O of size -.\"O .IR len . -.\"O See -.\"O .BR ecvt (3) -.\"O and -.\"O .BR qecvt (3). -関数 -.BR ecvt_r (), -.BR fcvt_r (), -.BR qecvt_r (), -.BR qfcvt_r () -は、それぞれ -.BR ecvt (3), -.BR fcvt (3), -.BR qecvt (3), -.BR qfcvt (3) -と同じであるが、 -静的バッファの代わりに、長さ -.I len -の指定された -.I buf -に結果を格納する点が異なる。 -.BR ecvt (3), -.BR qecvt (3) -を参照のこと。 -.\"O .SH "RETURN VALUE" +関数 \fBecvt_r\fP(), \fBfcvt_r\fP(), \fBqecvt_r\fP(), \fBqfcvt_r\fP() は、それぞれ \fBecvt\fP(3), +\fBfcvt\fP(3), \fBqecvt\fP(3), \fBqfcvt\fP(3) と同じであるが、 静的バッファの代わりに、長さ \fIlen\fP の指定された +\fIbuf\fP に結果を格納する点が異なる。 \fBecvt\fP(3), \fBqecvt\fP(3) を参照のこと。 .SH 返り値 -.\"O These functions return 0 on success, and \-1 otherwise. これらの関数は成功すると 0 を、それ以外は \-1 を返す。 -.\"O .SH "CONFORMING TO" -.\"O These functions are GNU extensions. .SH 準拠 これらの関数は GNU による拡張である。 -.\"O .SH NOTES .SH 注意 -.\"O These functions are obsolete. -.\"O Instead, -.\"O .BR sprintf (3) -.\"O is recommended. -これらの関数は廃止された。代わりに -.BR sprintf (3) -の使用を推奨する。 -.\"O .SH "SEE ALSO" +これらの関数は廃止された。代わりに \fBsprintf\fP(3) の使用を推奨する。 .SH 関連項目 -.BR ecvt (3), -.BR qecvt (3), -.BR sprintf (3) +\fBecvt\fP(3), \fBqecvt\fP(3), \fBsprintf\fP(3) diff --git a/draft/man3/encrypt.3 b/draft/man3/encrypt.3 index 0fcc6d47..4c037282 100644 --- a/draft/man3/encrypt.3 +++ b/draft/man3/encrypt.3 @@ -1,4 +1,4 @@ -.\" Copyright 2000 Nicolas Lichtmaier +.\" Copyright 2000 Nicolás Lichtmaier .\" Created 2000-07-22 00:52-0300 .\" .\" This is free documentation; you can redistribute it and/or @@ -21,114 +21,48 @@ .\" .\" Modified 2003-04-04, aeb .\" -.\" Japanese Version Copyright (c) 2000-2004 Yuichi SATO -.\" all rights reserved. -.\" Translated Sun Sep 24 06:18:14 JST 2000 -.\" by Yuichi SATO -.\" Updated & Modified Sun Sep 7 13:20:43 JST 2003 -.\" by Yuichi SATO -.\" Updated & Modified Sat Jan 17 01:27:31 JST 2004 by Yuichi SATO +.\"******************************************************************* .\" -.\"WORD: encrypt 暗号化 -.\"WORD: decrypt 復号化 +.\" This file was generated with po4a. Translate the source file. .\" -.TH ENCRYPT 3 2003-04-04 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH ENCRYPT 3 2003\-04\-04 "" "Linux Programmer's Manual" .SH 名前 -.\"O encrypt, setkey, encrypt_r, setkey_r \- encrypt 64-bit messages encrypt, setkey, encrypt_r, setkey_r \- 64 ビットのメッセージを暗号化する -.\"O .SH SYNOPSIS .SH 書式 -.\"O .BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _XOPEN_SOURCE" " /* feature_test_macros(7) 参照 */" +\fB#define _XOPEN_SOURCE\fP /* feature_test_macros(7) 参照 */ .br -.B #include +\fB#include \fP .sp -.BI "void encrypt(char " block "[64], int " edflag ); +\fBvoid encrypt(char \fP\fIblock\fP\fB[64], int \fP\fIedflag\fP\fB);\fP .sp -.\"O .BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _XOPEN_SOURCE" " /* feature_test_macros(7) 参照 */" +\fB#define _XOPEN_SOURCE\fP /* feature_test_macros(7) 参照 */ .br -.B #include +\fB#include \fP .sp -.BI "void setkey(const char *" key ); +\fBvoid setkey(const char *\fP\fIkey\fP\fB);\fP .sp -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ .br -.B #include +\fB#include \fP .sp -.BI "void setkey_r(const char *" key ", struct crypt_data *" data ); +\fBvoid setkey_r(const char *\fP\fIkey\fP\fB, struct crypt_data *\fP\fIdata\fP\fB);\fP .br -.BI "void encrypt_r(char *" block ", int " edflag \ -", struct crypt_data *" data ); +\fBvoid encrypt_r(char *\fP\fIblock\fP\fB, int \fP\fIedflag\fP\fB, struct crypt_data +*\fP\fIdata\fP\fB);\fP .sp -.\"O Each of these requires linking with \fI\-lcrypt\fP. これらの関数は \fI\-lcrypt\fP でリンクする必要がある。 -.\"O .SH DESCRIPTION .SH 説明 -.\"O These functions encrypt and decrypt 64-bit messages. -.\"O The -.\"O .BR setkey () -.\"O function sets the key used by -.\"O .BR encrypt (). -これらの関数は、64 ビットのメッセージの暗号化と復号化を行う。 -.BR setkey () -関数は -.BR encrypt () -によって使われる暗号鍵を設定する。 -.\"O The -.\"O .I key -.\"O argument used here is an array of 64 bytes, each of which has -.\"O numerical value 1 or 0. -.\"O The bytes key[n] where n=8*i-1 are ignored, -.\"O so that the effective key length is 56 bits. -ここで使われる引き数 -.I key -は 64 バイトの配列であり、各バイトは数値 1 または 0 である。 -n=8*i-1 に対するバイト key[n] は無視されるので、 -有効な暗号鍵の長さは 56 ビットになる。 +これらの関数は、64 ビットのメッセージの暗号化と復号化を行う。 \fBsetkey\fP() 関数は \fBencrypt\fP() +によって使われる暗号鍵を設定する。 ここで使われる引き数 \fIkey\fP は 64 バイトの配列であり、各バイトは数値 1 または 0 である。 +n=8*i\-1 に対するバイト key[n] は無視されるので、 有効な暗号鍵の長さは 56 ビットになる。 .PP -.\"O The -.\"O .BR encrypt () -.\"O function modifies the passed buffer, encoding if -.\"O .I edflag -.\"O is 0, and decoding if 1 is being passed. -.\"O Like the -.\"O .I key -.\"O argument, also -.\"O .I block -.\"O is a bit vector representation of the actual value that is encoded. -.\"O The result is returned in that same vector. -.BR encrypt () -関数は、 -.I edflag -が 0 の場合は暗号化し、1 が渡された場合は復号化するというように、 -渡されたバッファを変更する。 -引き数 -.I key -と同様に、 -.I block -はエンコードされた実際の値を表現するビットの配列である。 +\fBencrypt\fP() 関数は、 \fIedflag\fP が 0 の場合は暗号化し、1 が渡された場合は復号化するというように、 +渡されたバッファを変更する。 引き数 \fIkey\fP と同様に、 \fIblock\fP はエンコードされた実際の値を表現するビットの配列である。 結果はこの同じ配列を使って返される。 .PP -.\"O These two functions are not reentrant, that is, the key data is -.\"O kept in static storage. -.\"O The functions -.\"O .BR setkey_r () -.\"O and -.\"O .BR encrypt_r () -.\"O are the reentrant versions. -.\"O They use the following -.\"O structure to hold the key data: -これら 2 つの関数はリエントラント (reentrant) ではない。 -つまり暗号鍵データは静的な領域に保存される。 -関数 -.BR setkey_r () -と -.BR encrypt_r () -はリエントラントなバージョンである。 -これらの関数は暗号鍵データを保持するために以下のような構造体を使う。 +これら 2 つの関数はリエントラント (reentrant) ではない。 つまり暗号鍵データは静的な領域に保存される。 関数 \fBsetkey_r\fP() +と \fBencrypt_r\fP() はリエントラントなバージョンである。 これらの関数は暗号鍵データを保持するために以下のような構造体を使う。 .in +4n .nf @@ -147,75 +81,22 @@ struct crypt_data { .fi .in .PP -.\"O Before calling -.\"O .BR setkey_r () -.\"O set -.\"O .I data\->initialized -.\"O to zero. -.BR setkey_r () -を呼び出す前には、 -.I data\->initialized -を 0 に設定すること。 -.\"O .SH "RETURN VALUES" +\fBsetkey_r\fP() を呼び出す前には、 \fIdata\->initialized\fP を 0 に設定すること。 .SH 返り値 -.\"O These functions do not return any value. これらの関数は、なにも値を返さない。 -.\"O .SH ERRORS .SH エラー -.\"O Set -.\"O .I errno -.\"O to zero before calling the above functions. -上記の関数を呼び出す前に -.I errno -を 0 に設定すること。 -.\"O On success, it is unchanged. -成功した場合、この値は変更されない。 -.TP -.B ENOSYS -.\"O The function is not provided. -.\"O (For example because of former USA export restrictions.) -(例えば以前のアメリカ合衆国輸出規制などにより) -この関数が提供されていない。 -.\"O .SH "CONFORMING TO" +上記の関数を呼び出す前に \fIerrno\fP を 0 に設定すること。 成功した場合、この値は変更されない。 +.TP +\fBENOSYS\fP +(例えば以前のアメリカ合衆国輸出規制などにより) この関数が提供されていない。 .SH 準拠 -.\"O The functions -.\"O .BR encrypt () -.\"O and -.\"O .BR setkey () -.\"O conform to SVr4, SUSv2, and POSIX.1-2001. -関数 -.BR encrypt () -と -.BR setkey () -は SVr4, SUSv2, and POSIX.1-2001 に準拠する。 -.\"O The functions -.\"O .BR encrypt_r () -.\"O and -.\"O .BR setkey_r () -.\"O are GNU extensions. -関数 -.BR encrypt_r () -と -.BR setkey_r () -は GNU 拡張である。 -.\"O .SH NOTES +関数 \fBencrypt\fP() と \fBsetkey\fP() は SVr4, SUSv2, and POSIX.1\-2001 に準拠する。 関数 +\fBencrypt_r\fP() と \fBsetkey_r\fP() は GNU 拡張である。 .SH 注意 -.\"O In glibc 2.2 these functions use the DES algorithm. glibc 2.2 では、これらの関数は DES アルゴリズムを使う。 -.\"O .SH EXAMPLE .SH 例 -.\"O You need to link with libcrypt to compile this example with glibc. -.\"O To do useful work the -.\"O .I key[] -.\"O and -.\"O .I txt[] -.\"O arrays must be filled with a useful bit pattern. -この例を glibc でコンパイルするには libcrypt とリンクする必要がある。 -実際に動作させるためには、配列 -.I key[] -と -.I txt[] -に有効なビットパターンを指定しなければならない。 +この例を glibc でコンパイルするには libcrypt とリンクする必要がある。 実際に動作させるためには、配列 \fIkey[]\fP と +\fItxt[]\fP に有効なビットパターンを指定しなければならない。 .sp .nf #define _XOPEN_SOURCE @@ -233,9 +114,6 @@ main(void) encrypt(txt, 1); /* decode */ } .fi -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR cbc_crypt (3), -.BR crypt (3), -.BR ecb_crypt (3) +\fBcbc_crypt\fP(3), \fBcrypt\fP(3), \fBecb_crypt\fP(3) .\" .BR fcrypt (3) diff --git a/draft/man3/end.3 b/draft/man3/end.3 index 06725edd..40a6effb 100644 --- a/draft/man3/end.3 +++ b/draft/man3/end.3 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2008, Linux Foundation, written by by Michael Kerrisk +.\" Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk .\" .\" .\" Permission is granted to make and distribute verbatim copies of this @@ -22,111 +22,56 @@ .\" the source, must acknowledge the copyright and authors of this work. .\" License. .\" -.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2008-08-21, Akihiro MOTOKI , LDP v3.05 -.\" -.TH END 3 2008-07-17 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH END 3 2008\-07\-17 GNU "Linux Programmer's Manual" .SH 名前 -.\"O etext, edata, end \- end of program segments etext, edata, end \- プログラムセグメントの終わり -.\"O .SH SYNOPSIS .SH 書式 .nf -.BI extern " etext" ; -.BI extern " edata" ; -.BI extern " end" ; +\fBextern\fP\fI etext\fP\fB;\fP +\fBextern\fP\fI edata\fP\fB;\fP +\fBextern\fP\fI end\fP\fB;\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The addresses of these symbols indicate the end of various program -.\"O segments: これらのシンボルのアドレスは各種のプログラムセグメントの終わりを示す。 -.TP -.I etext -.\"O This is the first address past the end of the text segment -.\"O (the program code). +.TP +\fIetext\fP テキストセグメント (プログラムのコード) の末尾の次のアドレス。 -.TP -.I edata -.\"O This is the first address past the end of the -.\"O initialized data segment. +.TP +\fIedata\fP 初期化されたデータのセグメントの末尾の次のアドレス。 -.TP -.I end -.\"O This is the first address past the end of the -.\"O uninitialized data segment (also known as the BSS segment). -初期化されていないデータのセグメント (BSS セグメントとも言われる) -の末尾の次のアドレス。 -.\"O .SH CONFORMING TO +.TP +\fIend\fP +初期化されていないデータのセグメント (BSS セグメントとも言われる) の末尾の次のアドレス。 .SH 準拠 -.\"O Although these symbols have long been provided on most UNIX systems, -.\"O they are not standardized; use with caution. -これらのシンボルは長年ほとんどの UNIX システムで提供されているが、 -標準化されてはいない。注意して使うこと。 -.\"O .SH NOTES +これらのシンボルは長年ほとんどの UNIX システムで提供されているが、 標準化されてはいない。注意して使うこと。 .SH 注意 -.\"O The program must explicitly declare these symbols; -.\"O they are not defined in any header file. -プログラムではこれらのシンボルは明示的に宣言しなければならない。 -これらはどのヘッダファイルでも定義されていない。 +プログラムではこれらのシンボルは明示的に宣言しなければならない。 これらはどのヘッダファイルでも定義されていない。 -.\"O On some systems the names of these symbols are preceded by underscores, -.\"O thus: -.\"O .IR _etext , -.\"O .IR _edata , -.\"O and -.\"O .IR _end . -.\"O These symbols are also defined for programs compiled on Linux. -いくつかのシステムでは、これらのシンボルの名前は前にアンダースコアが -付いていて、 -.IR _etext , -.IR _edata , -.I _end -となっている。 -Linux でコンパイルされたプログラムでは、 -これらのシンボルでも定義される。 +いくつかのシステムでは、これらのシンボルの名前は前にアンダースコアが 付いていて、 \fI_etext\fP, \fI_edata\fP, \fI_end\fP +となっている。 Linux でコンパイルされたプログラムでは、 これらのシンボルでも定義される。 -.\"O At the start of program execution, -.\"O the program break will be somewhere near -.\"O .IR &end -.\"O (perhaps at the start of the following page). -.\"O However, the break will change as memory is allocated via -.\"O .BR brk (2) -.\"O or -.\"O .BR malloc (3). -.\"O Use -.\"O .BR sbrk (2) -.\"O with an argument of zero to find the current value of the program break. -プログラムの実行開始時に、プログラム・ブレークは -.I &end -の近くのどこか (おそらく次のページの先頭) になる。 -しかしながら、 -.BR brk (2) -や -.BR malloc (3) -でメモリが割り当てられるに連れて、プログラム・ブレークは変化していく。 -引き数に 0 を指定して -.BR sbrk (2) -を呼び出すことで、プログラム・ブレークの現在値を知ることができる。 -.\"O .SH EXAMPLE +プログラムの実行開始時に、プログラム・ブレークは \fI&end\fP の近くのどこか (おそらく次のページの先頭) になる。 しかしながら、 +\fBbrk\fP(2) や \fBmalloc\fP(3) でメモリが割り当てられるに連れて、プログラム・ブレークは変化していく。 引き数に 0 を指定して +\fBsbrk\fP(2) を呼び出すことで、プログラム・ブレークの現在値を知ることができる。 .SH 例 -.\"O When run, the program below produces output such as the following: 下記のプログラムを実行すると、次のような出力が得られる。 .in +4n .nf -.RB "$" " ./a.out" +$\fB ./a.out\fP First address past: program text (etext) 0x8048568 initialized data (edata) 0x804a01c uninitialized data (end) 0x804a024 .fi -.\"O .SS Program source +.in .SS プログラムのソース \& -.in .nf #include #include @@ -137,17 +82,13 @@ extern char etext, edata, end; /* The symbols must have some type, int main(int argc, char *argv[]) { - printf("First address past:\\n"); - printf(" program text (etext) %10p\\n", &etext); - printf(" initialized data (edata) %10p\\n", &edata); - printf(" uninitialized data (end) %10p\\n", &end); + printf("First address past:\en"); + printf(" program text (etext) %10p\en", &etext); + printf(" initialized data (edata) %10p\en", &edata); + printf(" uninitialized data (end) %10p\en", &end); exit(EXIT_SUCCESS); } .fi -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR objdump (1), -.BR readelf (1), -.BR sbrk (2), -.BR elf (5) +\fBobjdump\fP(1), \fBreadelf\fP(1), \fBsbrk\fP(2), \fBelf\fP(5) diff --git a/draft/man3/endian.3 b/draft/man3/endian.3 new file mode 100644 index 00000000..7bbe7168 --- /dev/null +++ b/draft/man3/endian.3 @@ -0,0 +1,137 @@ +.\" Copyright (C) 2009, Linux Foundation, written by Michael Kerrisk +.\" +.\" a few pieces remain from an earlier version +.\" Copyright (C) 2008, Nanno Langstraat +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ENDIAN 3 2010\-09\-10 GNU "Linux Programmer's Manual" +.SH 名前 +htobe16, htole16, be16toh, le16toh, htobe32, htole32, be32toh, le32toh, +htobe64, htole64, be64toh, le64toh \- convert values between host and +big\-/little\-endian byte order +.SH 書式 +.nf +\fB#define _BSD_SOURCE\fP /* See feature_test_macros(7) */ +\fB#include \fP + +\fBuint16_t htobe16(uint16_t \fP\fIhost_16bits\fP\fB);\fP +\fBuint16_t htole16(uint16_t \fP\fIhost_16bits\fP\fB);\fP +\fBuint16_t be16toh(uint16_t \fP\fIbig_endian_16bits\fP\fB);\fP +\fBuint16_t le16toh(uint16_t \fP\fIlittle_endian_16bits\fP\fB);\fP + +\fBuint32_t htobe32(uint32_t \fP\fIhost_32bits\fP\fB);\fP +\fBuint32_t htole32(uint32_t \fP\fIhost_32bits\fP\fB);\fP +\fBuint32_t be32toh(uint32_t \fP\fIbig_endian_32bits\fP\fB);\fP +\fBuint32_t le32toh(uint32_t \fP\fIlittle_endian_32bits\fP\fB);\fP + +\fBuint64_t htobe64(uint64_t \fP\fIhost_64bits\fP\fB);\fP +\fBuint64_t htole64(uint64_t \fP\fIhost_64bits\fP\fB);\fP +\fBuint64_t be64toh(uint64_t \fP\fIbig_endian_64bits\fP\fB);\fP +\fBuint64_t le64toh(uint64_t \fP\fIlittle_endian_64bits\fP\fB);\fP +.fi +.SH 説明 +These functions convert the byte encoding of integer values from the byte +order that the current CPU (the "host") uses, to and from little\-endian and +big\-endian byte order. + +The number, \fInn\fP, in the name of each function indicates the size of +integer handled by the function, either 16, 32, or 64 bits. + +The functions with names of the form "htobe\fInn\fP" convert from host byte +order to big\-endian order. + +The functions with names of the form "htole\fInn\fP" convert from host byte +order to little\-endian order. + +The functions with names of the form "be\fInn\fPtoh" convert from big\-endian +order to host byte order. + +The functions with names of the form "le\fInn\fPtoh" convert from little\-endian +order to host byte order. +.SH バージョン +These function were added to glibc in version 2.9. +.SH 準拠 +These functions are nonstandard. Similar functions are present on the BSDs, +where the required header file is \fI\fP instead of +\fI\fP. Unfortunately, NetBSD, FreeBSD, and glibc haven't +followed the original OpenBSD naming convention for these functions, whereby +the \fInn\fP component always appears at the end of the function name (thus, +for example, in NetBSD, FreeBSD, and glibc, the equivalent of OpenBSDs +"betoh32" is "be32toh"). +.SH 注意 +These functions are similar to the older \fBbyteorder\fP(3) family of +functions. For example, \fBbe32toh\fP() is identical to \fBntohl\fP()\fB.\fP + +The advantage of the \fBbyteorder\fP(3) functions is that they are standard +functions available on all UNIX systems. On the other hand, the fact that +they were designed for use in the context of TCP/IP means that they lack the +64\-bit and little\-endian variants described in this page. +.SH 例 +The program below display the results of converting an integer from host +byte order to both little\-endian and big\-endian byte order. Since host byte +order is either little\-endian or big\-endian, only one of these conversions +will have an effect. When we run this program on a little\-endian system +such as x86\-32, we see the following: +.in +4n +.nf + +$ \fB./a.out\fP +x.u32 = 0x44332211 +htole32(x.u32) = 0x44332211 +htobe32(x.u32) = 0x11223344 +.fi +.in +.SS プログラムのソース +\& +.nf +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + union { + uint32_t u32; + uint8_t arr[4]; + } x; + + x.arr[0] = 0x11; /* Lowest\-address byte */ + x.arr[1] = 0x22; + x.arr[2] = 0x33; + x.arr[3] = 0x44; /* Highest\-address byte */ + + printf("x.u32 = 0x%x\en", x.u32); + printf("htole32(x.u32) = 0x%x\en", htole32(x.u32)); + printf("htobe32(x.u32) = 0x%x\en", htobe32(x.u32)); + + exit(EXIT_SUCCESS); +} +.fi +.SH 関連項目 +\fBbyteorder\fP(3) diff --git a/draft/man3/erf.3 b/draft/man3/erf.3 index e4dcf0fa..50e8ee07 100644 --- a/draft/man3/erf.3 +++ b/draft/man3/erf.3 @@ -30,154 +30,75 @@ .\" Modified 2002-07-27 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi -.\" all rights reserved. -.\" Translated Mon Jan 20 20:17:40 JST 1997 -.\" by YOSHINO Takashi -.\" Updated Tue Aug 5 23:16:48 JST 2003 -.\" by Akihiro MOTOKI -.\" Updated & Modified Tue Feb 15 04:46:24 JST 2005 -.\" by Yuichi SATO +.\"******************************************************************* .\" -.\"WORD: complementary error function 相補誤差関数 -.\"WORD: subnormal 非正規化の +.\" This file was generated with po4a. Translate the source file. .\" -.TH ERF 3 2010-09-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH ERF 3 2010\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 -.\"O erf, erff, erfl, \- error function erf, erff, erfl \- 誤差関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP -.BI "double erf(double " x ); -.BI "float erff(float " x ); -.BI "long double erfl(long double " x ); +\fBdouble erf(double \fP\fIx\fP\fB);\fP +\fBfloat erff(float \fP\fIx\fP\fB);\fP +\fBlong double erfl(long double \fP\fIx\fP\fB);\fP .fi -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR erf (): +\fBerf\fP(): .RS 4 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .br -.BR erff (), -.BR erfl (): +\fBerff\fP(), \fBerfl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR erf () -.\"O function returns the error function of \fIx\fP, defined -.\"O as -.BR erf () -は \fIx\fP の誤差関数を返す関数で、以下のように定義されている。 -.TP +\fBerf\fP() は \fIx\fP の誤差関数を返す関数で、以下のように定義されている。 +.TP erf(x) = 2/sqrt(pi)* integral from 0 to x of exp(\-t*t) dt -.\"O .SH RETURN VALUE .SH 返り値 -.\"O On success, these functions return the error function of -.\"O .IR x , -.\"O a value in the range [\-1,\ 1]. -成功すると、これらの関数は -.I x -の誤差関数を返す。 -返り値は [\-1,\ 1] の範囲となる。 +成功すると、これらの関数は \fIx\fP の誤差関数を返す。 返り値は [\-1,\ 1] の範囲となる。 -.\"O If -.\"O .I x -.\"O is a NaN, a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is +0 (\-0), +0 (\-0) is returned. -.I x -が +0 (\-0) の場合、+0 (\-0) が返される。 +\fIx\fP が +0 (\-0) の場合、+0 (\-0) が返される。 -.\"O If -.\"O .I x -.\"O is positive infinity (negative infinity), -.\"O +1 (\-1) is returned. -.I x -が正の無限大 (負の無限大) の場合、+1 (\-1) が返される。 +\fIx\fP が正の無限大 (負の無限大) の場合、+1 (\-1) が返される。 -.\"O If -.\"O .I x -.\"O is subnormal, -.\"O a range error occurs, -.\"O and the return value is 2*x/sqrt(pi). -.I x -が非正規化数の場合、範囲エラー (range error) が発生し、 -返り値は 2*x/sqrt(pi) となる。 -.\"O .SH ERRORS +\fIx\fP が非正規化数の場合、範囲エラー (range error) が発生し、 返り値は 2*x/sqrt(pi) となる。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Range error: result underflow (\fIx\fP is subnormal) +.TP 範囲エラー (range error): 結果がアンダーフローする (\fIx\fP が非正規化数) .\" .I errno .\" is set to .\" .BR ERANGE . -.\"O An underflow floating-point exception -.\"O .RB ( FE_UNDERFLOW ) -.\"O is raised. -アンダーフロー浮動小数点例外 -.RB ( FE_UNDERFLOW ) -が上がる。 +アンダーフロー浮動小数点例外 (\fBFE_UNDERFLOW\fP) が上がる。 .PP -.\"O These functions do not set -.\"O .IR errno . -これらの関数は -.I errno -を設定しない。 .\" FIXME . Is it intentional that these functions do not set errno? .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6785 -.\"O .SH "CONFORMING TO" +これらの関数は \fIerrno\fP を設定しない。 .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD. -.I double -版の関数は SVr4, 4.3BSD にも準拠している。 -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD にも準拠している。 .SH 関連項目 -.BR cerf (3), -.BR erfc (3), -.BR exp (3) +\fBcerf\fP(3), \fBerfc\fP(3), \fBexp\fP(3) diff --git a/draft/man3/erfc.3 b/draft/man3/erfc.3 index dfc327e7..68ee543e 100644 --- a/draft/man3/erfc.3 +++ b/draft/man3/erfc.3 @@ -21,175 +21,82 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2008-09-15, Akihiro MOTOKI -.\" -.\"WORD: subnormal 非正規化の -.\" -.TH ERFC 3 2010-09-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ERFC 3 2010\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 -.\"O erfc, erfcf, erfcl \- complementary error function erfc, erfcf, erfcl \- 相補誤差関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP -.BI "double erfc(double " x ); -.BI "float erfcf(float " x ); -.BI "long double erfcl(long double " x ); +\fBdouble erfc(double \fP\fIx\fP\fB);\fP +\fBfloat erfcf(float \fP\fIx\fP\fB);\fP +\fBlong double erfcl(long double \fP\fIx\fP\fB);\fP .fi -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR erfc (): +\fBerfc\fP(): .RS 4 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .br -.BR erfcf (), -.BR erfcl (): +\fBerfcf\fP(), \fBerfcl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR erfc () -.\"O function returns the complementary error function of -.\"O .IR x , -.\"O that is, 1.0 \- erf(x). -.BR erfc () -関数は -.I x -の相補誤差関数、つまり 1.0 \- erf(x) を返す。 -.\"O .SH RETURN VALUE +\fBerfc\fP() 関数は \fIx\fP の相補誤差関数、つまり 1.0 \- erf(x) を返す。 .SH 返り値 -.\"O On success, these functions return the complementary error function of -.\"O .IR x , -.\"O a value in the range [0,2]. -成功すると、これらの関数は -.I x -の相補誤差関数を返す。 -返り値は [0,2] の範囲となる。 +成功すると、これらの関数は \fIx\fP の相補誤差関数を返す。 返り値は [0,2] の範囲となる。 -.\"O If -.\"O .I x -.\"O is a NaN, a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is +0 or \-0, 1 is returned. -.I x -が +0 か \-0 の場合、1 が返される。 +\fIx\fP が +0 か \-0 の場合、1 が返される。 -.\"O If -.\"O .I x -.\"O is positive infinity, -.\"O +0 is returned. -.I x -が正の無限大の場合、+0 が返される。 +\fIx\fP が正の無限大の場合、+0 が返される。 -.\"O If -.\"O .I x -.\"O is negative infinity, -.\"O +2 is returned. -.I x -が負の無限大の場合、+2 が返される。 +\fIx\fP が負の無限大の場合、+2 が返される。 -.\"O If the function result underflows and produces an unrepresentable value, -.\"O the return value is 0.0. -関数の結果がアンダーフローし、表現できない値となる場合は、 -返り値は 0.0 となる。 +関数の結果がアンダーフローし、表現できない値となる場合は、 返り値は 0.0 となる。 -.\"O If the function result underflows but produces a representable -.\"O (i.e., subnormal) value, -.\"O .\" e.g., erfc(27) on x86-32 -.\"O that value is returned, and -.\"O a range error occurs. -関数の結果がアンダーフローするが、 -表現できる値 (つまり非正規化数 (subnormal)) となる場合は、 -.\" 例えば x86-32 での erfc(27) -その値が返され、範囲エラー (range error) が発生する。 -.\"O .SH ERRORS +.\" e.g., erfc(27) on x86-32 +関数の結果がアンダーフローするが、 表現できる値 (つまり非正規化数 (subnormal)) となる場合は、 その値が返され、範囲エラー (range +error) が発生する。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Range error: result underflow (result is subnormal) +.TP 範囲エラー: 結果のアンダーフロー (結果が非正規化数) .\" .I errno .\" is set to .\" .BR ERANGE . -.\"O An underflow floating-point exception -.\"O .RB ( FE_UNDERFLOW ) -.\"O is raised. -アンダーフロー浮動小数点例外 -.RB ( FE_UNDERFLOW ) -が上がる。 +アンダーフロー浮動小数点例外 (\fBFE_UNDERFLOW\fP) が上がる。 .PP -.\"O These functions do not set -.\"O .IR errno . -これらの関数は -.I errno -を設定しない。 .\" FIXME . Is it intentional that these functions do not set errno? .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6785 -.\"O .SH "CONFORMING TO" +これらの関数は \fIerrno\fP を設定しない。 .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD. -.I double -版の関数は SVr4, 4.3BSD にも準拠している。 -.\"O .SH NOTES +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD にも準拠している。 .SH 注意 -.\"O The -.\"O .BR erfc () -.\"O functions are provided to avoid the loss accuracy that -.\"O would occur for the calculation 1-erf(x) for large values of -.\"O .IR x -.\"O (for which the value of erf(x) approaches 1). -.BR erfc () -関数が提供されているのは、 -.I x -が大きな値の場合に (erf(x) の値は 1 に近付いていくことで) -1-erf(x) の計算において精度が失われるのを避けるためである。 -.\"O .SH "SEE ALSO" +\fBerfc\fP() 関数が提供されているのは、 \fIx\fP が大きな値の場合に (erf(x) の値は 1 に近付いていくことで) 1\-erf(x) +の計算において精度が失われるのを避けるためである。 .SH 関連項目 -.BR cerf (3), -.BR erf (3), -.BR exp (3) +\fBcerf\fP(3), \fBerf\fP(3), \fBexp\fP(3) diff --git a/draft/man3/euidaccess.3 b/draft/man3/euidaccess.3 deleted file mode 100644 index 213ae1b4..00000000 --- a/draft/man3/euidaccess.3 +++ /dev/null @@ -1,141 +0,0 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" Copyright (C) 2007 Michael Kerrisk -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2007-06-02, Akihiro MOTOKI -.\" -.TH EUIDACCESS 3 2010-09-10 "" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O euidaccess, eaccess \- check effective user's permissions for a file -euidaccess, eaccess \- ファイルへのアクセス権を実効ユーザでチェックする -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" -.B #include -.sp -.BI "int euidaccess(const char *" pathname ", int " mode ); -.BI "int eaccess(const char *" pathname ", int " mode ); -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O Like -.\"O .BR access (2), -.\"O .BR euidaccess () -.\"O checks permissions and existence of the file identified by its argument -.\"O .IR pathname . -.\"O However, whereas -.\"O .BR access (2), -.\"O performs checks using the real user and group identifiers of the process, -.\"O .BR euidaccess () -.\"O uses the effective identifiers. -.BR access (2) -と同様、 -.BR euidaccess () -は引き数 -.I pathname -で指定されたファイルの許可 (permission) と存在のチェックを行う。 -.BR access (2) -はプロセスの実 (real) ユーザID / 実グループID を用いてチェックを行うのに対し、 -.BR euidaccess () -は実効 (effective) ID を用いる。 - -.\"O .I mode -.\"O is a mask consisting of one or more of -.\"O .BR R_OK ", " W_OK ", " X_OK " and " F_OK , -.\"O with the same meanings as for -.\"O .BR access (2). -.I mode -は -.BR R_OK ", " W_OK ", " X_OK ", " F_OK -の一つ以上から構成されるマスクである。 -.BR R_OK ", " W_OK ", " X_OK ", " F_OK -は -.BR access (2) -と同じ意味を持つ。 - -.\"O .BR eaccess () -.\"O is a synonym for -.\"O .BR euidaccess (), -.\"O provided for compatibility with some other systems. -.BR eaccess () -は -.BR euidaccess () -の同義語であり、他のいくつかのシステムとの互換性のために提供されている。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success (all requested permissions granted), zero is returned. -.\"O On error (at least one bit in -.\"O .I mode -.\"O asked for a permission that is denied, or some other error occurred), -.\"O \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合 (要求した全てについての許可が得られたら)、ゼロが返される。 -エラーの場合 -.RI ( mode -の少なくとも一つのビットで要求した許可がなかった場合や、 -他のエラーが起こった場合)、\-1 が返され、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS -.SH エラー -.\"O As for -.\"O .BR access (2). -.BR access (2) -と同じ。 -.\"O .SH VERSIONS -.SH バージョン -.\"O The -.\"O .BR eaccess () -.\"O function was added to glibc in version 2.4. -.BR eaccess () -関数は glibc のバージョン 2.4 で追加された。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -.\"O These functions are nonstandard. -.\"O Some other systems have an -.\"O .\" e.g., FreeBSD 6.1. -.\"O .BR eaccess () -.\"O function. -これらの関数は非標準である。 -他のいくつかのシステムには -.\" 例えば、FreeBSD 6.1. -.BR eaccess () -関数がある。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR access (2), -.BR chmod (2), -.BR chown (2), -.BR faccessat (2), -.BR open (2), -.BR setgid (2), -.BR setuid (2), -.BR stat (2), -.BR credentials (7), -.BR path_resolution (7) diff --git a/draft/man3/exec.3 b/draft/man3/exec.3 index 1696bc17..1eb852e6 100644 --- a/draft/man3/exec.3 +++ b/draft/man3/exec.3 @@ -36,372 +36,101 @@ .\" Modified, 24 Jun 2004, Michael Kerrisk .\" Added note on casting NULL .\" -.\" Japanese Version Copyright (c) 1998 Masato Taruishi -.\" all rights reserved. -.\" Translated 1998-05-27, Masato Taruishi -.\" Modified 1998-08-08, Fujiwara Teruyoshi -.\" Modified 2000-10-06, Kentaro Shirakata -.\" Modified 2005-02-26, Akihiro MOTOKI -.\" Updated 2010-10-27, Akihiro Motoki , LDP v3.29 +.\"******************************************************************* .\" -.\"WORD: null-terminated strings NULLで終わる文字列 -.\"WORD: anti-Trojan-horse measure トロイの木馬対策 -.\"WORD: external variable 外部変数 -.\"WORD: current directory first カレントディレクトリが最初 -.\"WORD: the attempted execve 呼び出そうとしたexecve -.\"WORD: variadic function 可変長引き数関数 -.\"WORD: semantics (プログラムの)動作 +.\" This file was generated with po4a. Translate the source file. .\" -.TH EXEC 3 2010-09-25 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH EXEC 3 2010\-09\-25 GNU "Linux Programmer's Manual" .SH 名前 -.\"O execl, execlp, execle, execv, execvp, execvpe \- execute a file execl, execlp, execle, execv, execvp, execvpe \- ファイルを実行する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.B extern char **environ; +\fBextern char **environ;\fP .sp -.BI "int execl(const char *" path ", const char *" arg ", ...);" +\fBint execl(const char *\fP\fIpath\fP\fB, const char *\fP\fIarg\fP\fB, ...);\fP .br -.BI "int execlp(const char *" file ", const char *" arg ", ...);" +\fBint execlp(const char *\fP\fIfile\fP\fB, const char *\fP\fIarg\fP\fB, ...);\fP .br -.BI "int execle(const char *" path ", const char *" arg , +\fBint execle(const char *\fP\fIpath\fP\fB, const char *\fP\fIarg\fP\fB,\fP .br -.BI " ..., char * const " envp "[]);" +\fB ..., char * const \fP\fIenvp\fP\fB[]);\fP .br -.BI "int execv(const char *" path ", char *const " argv "[]);" +\fBint execv(const char *\fP\fIpath\fP\fB, char *const \fP\fIargv\fP\fB[]);\fP .br -.BI "int execvp(const char *" file ", char *const " argv "[]);" +\fBint execvp(const char *\fP\fIfile\fP\fB, char *const \fP\fIargv\fP\fB[]);\fP .br -.BI "int execvpe(const char *" file ", char *const " argv "[]," +\fBint execvpe(const char *\fP\fIfile\fP\fB, char *const \fP\fIargv\fP\fB[],\fP .br -.BI " char *const " envp "[]);" +\fB char *const \fP\fIenvp\fP\fB[]);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR execvpe (): -_GNU_SOURCE -.\"O .SH DESCRIPTION +\fBexecvpe\fP(): _GNU_SOURCE .SH 説明 -.\"O The -.\"O .BR exec () -.\"O family of functions replaces the current process image with a new process -.\"O image. -.\"O The functions described in this manual page are front-ends for -.\"O .BR execve (2). -.\"O (See the manual page for -.\"O .BR execve (2) -.\"O for further details about the replacement of the current process image.) -.BR exec () -ファミリーの関数は現在のプロセスイメージを新しいプロセスイメージで置き -換える。このマニュアルで説明されている関数は -.BR execve (2) -のフロントエンドである。 -(現在のプロセスイメージの置き換えについての詳細は -.BR execve (2) +\fBexec\fP() ファミリーの関数は現在のプロセスイメージを新しいプロセスイメージで置き 換える。このマニュアルで説明されている関数は +\fBexecve\fP(2) のフロントエンドである。 (現在のプロセスイメージの置き換えについての詳細は \fBexecve\fP(2) のマニュアルを参照) .PP -.\"O The initial argument for these functions is the name of a file that is -.\"O to be executed. これらの関数の最初の引き数は、実行されるファイルの名前である。 .PP -.\"O The -.\"O .I "const char *arg" -.\"O and subsequent ellipses in the -.\"O .BR execl (), -.\"O .BR execlp (), -.\"O and -.\"O .BR execle () -.\"O functions can be thought of as -.\"O .IR arg0 , -.\"O .IR arg1 , -.\"O \&..., -.\"O .IR argn . -関数 -.BR execl (), -.BR execlp (), -.BR execle () -の -.I "const char *arg" -とそれに続く省略部分は -.IR arg0 , -.IR arg1 , -\&..., -.I argn -とみなされる。 -.\"O Together they describe a list of one or more pointers to null-terminated -.\"O strings that represent the argument list available to the executed program. -.\"O The first argument, by convention, should point to the filename associated -.\"O with the file being executed. -.\"O The list of arguments -.\"O .I must -.\"O be terminated by a NULL -.\"O pointer, and, since these are variadic functions, this pointer must be cast -.\"O .IR "(char *) NULL" . -これらには、実行されるプログラムで利用可能な引き数のリストを指定する -(引き数のリストは NULL で終端された文字列へのポインタから構成される)。 -慣習として、最初の引き数は、実行されるファイル名 -へのポインタにする。引き数のリストは必ず NULL -で終わらなければならず、これらの関数は可変長引き数関数なので、 -このポインタは -.I "(char *) NULL" -とキャストしなければならない。 +関数 \fBexecl\fP(), \fBexeclp\fP(), \fBexecle\fP() の \fIconst char *arg\fP とそれに続く省略部分は +\fIarg0\fP, \fIarg1\fP, \&..., \fIargn\fP とみなされる。 これらには、実行されるプログラムで利用可能な引き数のリストを指定する +(引き数のリストは NULL で終端された文字列へのポインタから構成される)。 慣習として、最初の引き数は、実行されるファイル名 +へのポインタにする。引き数のリストは必ず NULL で終わらなければならず、これらの関数は可変長引き数関数なので、 このポインタは \fI(char *) +NULL\fP とキャストしなければならない。 .PP -.\"O The -.\"O .BR execv (), -.\"O .BR execvp (), -.\"O and -.\"O .BR execvpe () -.\"O functions provide an array of pointers to null-terminated strings that -.\"O represent the argument list available to the new program. -.\"O The first argument, by convention, should point to the filename -.\"O associated with the file being executed. -.\"O The array of pointers -.\"O .I must -.\"O be terminated by a NULL pointer. -関数 -.BR execv (), -.BR execvp (), -.BR execvpe () -は、利用可能な引き数リスト (NULL で終端された文字列への -ポインタの配列) を新しいプログラムに渡す。 -慣習として、最初の引き数は実行されるファイル名へ -のポインタにする。ポインタの配列は必ず -NULL で終わらなければならない。 +関数 \fBexecv\fP(), \fBexecvp\fP(), \fBexecvpe\fP() は、利用可能な引き数リスト (NULL で終端された文字列への +ポインタの配列) を新しいプログラムに渡す。 慣習として、最初の引き数は実行されるファイル名へ のポインタにする。ポインタの配列は必ず NULL +で終わらなければならない。 .PP -.\"O The -.\"O .BR execle () -.\"O and -.\"O .BR execvpe () -.\"O functions allow the caller to specify the environment of the -.\"O executed program via the argument -.\"O .IR envp . -関数 -.BR execle (), -.BR execvpe () -では、呼び出し元が引き数 -.I envp -経由実行されるプログラムの環境を指定することができる。 -.\"O The -.\"O .I envp -.\"O argument is an array of pointers to null-terminated strings and -.\"O .I must -.\"O be terminated by a NULL pointer. -.\"O The other functions take the environment for the new process -.\"O image from the external variable -.\"O .I environ -.\"O in the calling process. -.I envp -引き数は、NULL で終端された文字列へのポインタの配列であり、 -NULL ポインタで終わらなければならない。 -他の関数では、呼び出し元のプロセスの外部変数 -.B environ -から新しいプロセス用の環境を与える。 -.\"O .SS Special semantics for execlp() and execvp() -.SS execlp() と execvp() の特別な動作 +関数 \fBexecle\fP(), \fBexecvpe\fP() では、呼び出し元が引き数 \fIenvp\fP +経由実行されるプログラムの環境を指定することができる。 \fIenvp\fP 引き数は、NULL で終端された文字列へのポインタの配列であり、 NULL +ポインタで終わらなければならない。 他の関数では、呼び出し元のプロセスの外部変数 \fBenviron\fP から新しいプロセス用の環境を与える。 +.SS "execlp() と execvp() の特別な動作" .PP -.\"O The -.\"O .BR execlp (), -.\"O .BR execvp (), -.\"O and -.\"O .BR execvpe () -.\"O functions duplicate the actions of the shell in -.\"O searching for an executable file -.\"O if the specified filename does not contain a slash (/) character. -関数 -.BR execlp (), -.BR execvp (), -.BR execvpe () -は、指定されたファイル名がスラッシュ (/) を含んでいない場合、 -シェルと同じ動作で実行可能なファイルを探索する。 -.\"O The file is sought in the colon-separated list of directory pathnames -.\"O specified in the -.\"O .B PATH -.\"O environment variable. -.\"O If this variable isn't defined, the path list defaults to -.\"O the current directory followed by the list of directories returned by -.\"O .IR confstr(_CS_PATH) . -.\"O (This -.\"O .BR confstr (3) -.\"O call typically returns the value "/bin:/usr/bin".) -ファイルの検索は、環境変数 -.B PATH -で指定されたコロン区切りのディレクトリのパス名のリストを対象に行われる。 -この変数が定義されていない場合、パス名のリストのデフォルト値として、 -カレントディレクトリの後ろに、 -.I confstr(_CS_PATH) -が返すディレクトリのリストをつなげた値が使用される (この -.BR confstr (3) -の呼び出しでは通常 "/bin:/usr/bin" が返される)。 +関数 \fBexeclp\fP(), \fBexecvp\fP(), \fBexecvpe\fP() は、指定されたファイル名がスラッシュ (/) を含んでいない場合、 +シェルと同じ動作で実行可能なファイルを探索する。 ファイルの検索は、環境変数 \fBPATH\fP +で指定されたコロン区切りのディレクトリのパス名のリストを対象に行われる。 この変数が定義されていない場合、パス名のリストのデフォルト値として、 +カレントディレクトリの後ろに、 \fIconfstr(_CS_PATH)\fP が返すディレクトリのリストをつなげた値が使用される (この +\fBconfstr\fP(3) の呼び出しでは通常 "/bin:/usr/bin" が返される)。 -.\"O If the specified filename includes a slash character, then -.\"O .B PATH -.\"O is ignored, and the file at the specified pathname is executed. -指定されたファイル名がスラッシュを含む場合、 -.B PATH -は無視され、指定されたパス名のファイルが実行される。 +指定されたファイル名がスラッシュを含む場合、 \fBPATH\fP は無視され、指定されたパス名のファイルが実行される。 -.\"O In addition, certain errors are treated specially. さらに、いくつかのエラーは特別に処理される。 -.\"O If permission is denied for a file (the attempted -.\"O .BR execve (2) -.\"O failed with the error -.\"O .BR EACCES ), -.\"O these functions will continue searching the rest of the search path. -.\"O If no other file is found, however, -.\"O they will return with -.\"O .I errno -.\"O set to -.\"O .BR EACCES . -ファイルが実行ファイルでない場合 (このとき呼び出そうとした -.BR execve (2) -はエラー -.B EACCES -で失敗する)、これらの関数は残りの検索パスの検索を続ける。 -他にファイルが見つからなくなった場合 -.I errno -に -.B EACCES +ファイルが実行ファイルでない場合 (このとき呼び出そうとした \fBexecve\fP(2) はエラー \fBEACCES\fP +で失敗する)、これらの関数は残りの検索パスの検索を続ける。 他にファイルが見つからなくなった場合 \fIerrno\fP に \fBEACCES\fP を設定し復帰する。 -.\" fujiwara: 個人的には「復帰する」の方が好き(^_^; -.\"O If the header of a file isn't recognized (the attempted -.\"O .BR execve (2) -.\"O failed with the error -.\"O .BR ENOEXEC ), -.\"O these functions will execute the shell -.\"O .RI ( /bin/sh ) -.\"O with the path of the file as its first argument. -.\"O (If this attempt fails, no further searching is done.) -ファイルのヘッダが実行形式として認識できない場合 -(このとき呼び出そうとした -.BR execve (2) -はエラー -.B ENOEXEC -で失敗する)、これらの関数はそのファイルを最初の引き数としたシェル -.RI ( /bin/sh ) -を実行する (これにも失敗した場合、これ以上の検索は行われない)。 -.\"O .SH "RETURN VALUE" +ファイルのヘッダが実行形式として認識できない場合 (このとき呼び出そうとした \fBexecve\fP(2) はエラー \fBENOEXEC\fP +で失敗する)、これらの関数はそのファイルを最初の引き数としたシェル (\fI/bin/sh\fP) を実行する +(これにも失敗した場合、これ以上の検索は行われない)。 .SH 返り値 -.\"O The -.\"O .BR exec () -.\"O functions only return if an error has have occurred. -.\"O The return value is \-1, and -.\"O .I errno -.\"O is set to indicate the error. -.BR exec () -群の関数が復帰するのは、エラーが発生した場合のみである。 -返り値は \-1 で、 -.I errno -にエラーの内容がセットされる。 -.\"O .SH ERRORS +\fBexec\fP() 群の関数が復帰するのは、エラーが発生した場合のみである。 返り値は \-1 で、 \fIerrno\fP にエラーの内容がセットされる。 .SH エラー -.\"O All of these functions may fail and set -.\"O .I errno -.\"O for any of the errors specified for -.\"O .BR execve (2). -これら全ての関数は失敗する場合がある。その場合、 -.BR execve (2) -に対して規定されたエラーが -.I errno -に設定される。 -.\"O .SH VERSIONS +これら全ての関数は失敗する場合がある。その場合、 \fBexecve\fP(2) に対して規定されたエラーが \fIerrno\fP に設定される。 .SH バージョン -.\"O The -.\"O .BR execvpe () -.\"O function first appeared in glibc 2.11. -.BR execvpe () -関数は glibc 2.11 で初めて登場した。 -.\"O .SH "CONFORMING TO" +\fBexecvpe\fP() 関数は glibc 2.11 で初めて登場した。 .SH 準拠 -POSIX.1-2001, POSIX.1-2008. +POSIX.1\-2001, POSIX.1\-2008. -.\"O The -.\"O .BR execvpe () -.\"O function is a GNU extension. -.BR execvpe () -関数は GNU による拡張である。 -.\"O .SH NOTES +\fBexecvpe\fP() 関数は GNU による拡張である。 .SH 注意 -.\"O On some other systems, the default path (used when the environment -.\"O does not contain the variable \fBPATH\fR) has the current working -.\"O directory listed after -.\"O .I /bin -.\"O and -.\"O .IR /usr/bin , -.\"O as an anti-Trojan-horse measure. -.\"O Linux uses here the -.\"O traditional "current directory first" default path. -Linux 以外のシステムには、 -(環境変数 \fBPATH\fR が定義されていないときの) -デフォルトのパスにおいて、カレント・ディレクトリが -.I /bin -と -.I /usr/bin -の後ろに配置されるものもある。 -これはトロイの木馬対策のためである。 -Linux では、デフォルトのパスに、昔ながらの「現在のディレクトリを -先に探索」というルールを使っている。 +Linux 以外のシステムには、 (環境変数 \fBPATH\fP が定義されていないときの) デフォルトのパスにおいて、カレント・ディレクトリが +\fI/bin\fP と \fI/usr/bin\fP の後ろに配置されるものもある。 これはトロイの木馬対策のためである。 Linux +では、デフォルトのパスに、昔ながらの「現在のディレクトリを 先に探索」というルールを使っている。 .PP -.\"O The behavior of -.\"O .BR execlp () -.\"O and -.\"O .BR execvp () -.\"O when errors occur while attempting to execute the file is historic -.\"O practice, but has not traditionally been documented and is not specified by -.\"O the POSIX standard. -.\"O BSD (and possibly other systems) do an automatic -.\"O sleep and retry if -.\"O .B ETXTBSY -.\"O is encountered. -.\"O Linux treats it as a hard -.\"O error and returns immediately. -ファイルを実行しようとしている間にエラーが発生した時の -.BR execlp () -と -.BR execvp () -のふるまいについて歴史的な慣習はあるが、伝統的に文書として記載されておらず、 -POSIX 標準でも規定されていない。BSD (またおそらく他のシステム) では、 -.B ETXTBSY -が発生した場合、自動的に中断 (sleep) し再試行を行う。 -Linux はそれをハードエラーとして取り扱い即座に復帰する。 +ファイルを実行しようとしている間にエラーが発生した時の \fBexeclp\fP() と \fBexecvp\fP() +のふるまいについて歴史的な慣習はあるが、伝統的に文書として記載されておらず、 POSIX 標準でも規定されていない。BSD (またおそらく他のシステム) +では、 \fBETXTBSY\fP が発生した場合、自動的に中断 (sleep) し再試行を行う。 Linux +はそれをハードエラーとして取り扱い即座に復帰する。 .PP -.\"O Traditionally, the functions -.\"O .BR execlp () -.\"O and -.\"O .BR execvp () -.\"O ignored all errors except for the ones described above and -.\"O .B ENOMEM -.\"O and -.\"O .BR E2BIG , -.\"O upon which they returned. -.\"O They now return if any error other than the ones -.\"O described above occurs. -伝統的に、関数 -.BR execlp () -と -.BR execvp () -は、上で説明したエラーと、これら 2 つの関数自身が返す -.B ENOMEM -と -.B E2BIG -以外の全てのエラーを無視していたが、 -今では、上で説明した以外のエラーが発生した場合でも、 -返ってくるよう変更された。 -.\"O .SH "SEE ALSO" +伝統的に、関数 \fBexeclp\fP() と \fBexecvp\fP() は、上で説明したエラーと、これら 2 つの関数自身が返す \fBENOMEM\fP と +\fBE2BIG\fP 以外の全てのエラーを無視していたが、 今では、上で説明した以外のエラーが発生した場合でも、 返ってくるよう変更された。 .SH 関連項目 -.BR sh (1), -.BR execve (2), -.BR fork (2), -.BR ptrace (2), -.BR fexecve (3), -.BR environ (7) +\fBsh\fP(1), \fBexecve\fP(2), \fBfork\fP(2), \fBptrace\fP(2), \fBfexecve\fP(3), +\fBenviron\fP(7) diff --git a/draft/man3/exit.3 b/draft/man3/exit.3 index 87fcb0f1..bc88bf20 100644 --- a/draft/man3/exit.3 +++ b/draft/man3/exit.3 @@ -20,281 +20,67 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 1997 HORIMOTO Masafumi -.\" all rights reserved. -.\" Translated 1997-09-10, HORIMOTO Masafumi -.\" Updated & Modified 2001-10-27, Yuichi SATO -.\" Updated & Modified 2001-12-09, Yuichi SATO -.\" Updated & Modified 2005-09-06, Akihiro MOTOKI -.\" Updated 2007-06-18, Akihiro MOTOKI, LDP v2.57 +.\"******************************************************************* .\" -.TH EXIT 3 2009-09-20 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH EXIT 3 2009\-09\-20 Linux "Linux Programmer's Manual" .SH 名前 -.\"O exit \- cause normal process termination exit \- プロセスの正常終了 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "void exit(int " status ); +\fBvoid exit(int \fP\fIstatus\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR exit () -.\"O function causes normal process termination and the -.\"O value of \fIstatus & 0377\fP is returned to the parent -.\"O (see -.\"O .BR wait (2)). -.BR exit () -関数は、プロセスを正常に終了させ、 -\fIstatus & 0377\fP という値を親プロセスへ返す -.RB ( wait (2) +\fBexit\fP() 関数は、プロセスを正常に終了させ、 \fIstatus & 0377\fP という値を親プロセスへ返す (\fBwait\fP(2) を参照)。 .LP -.\"O All functions registered with -.\"O .BR atexit (3) -.\"O and -.\"O .BR on_exit (3) -.\"O are called, in the reverse order of their registration. -.\"O (It is possible for one of these functions to use -.\"O .BR atexit (3) -.\"O or -.\"O .BR on_exit (3) -.\"O to register an additional -.\"O function to be executed during exit processing; -.\"O the new registration is added to the front of the list of functions -.\"O that remain to be called.) -.BR atexit (3) -や -.BR on_exit (3) -によって -登録された全ての関数は、それらが登録された順番と逆順にコールされる。 -(登録された関数の中で -.BR atexit (3) -or -.BR on_exit (3) -を使って -exit 処理中に実行される追加の関数を登録することができる; -新規に登録された関数は、この後で実行される関数リストの先頭に -追加される。) -.\"O If one of these functions does not return -.\"O (e.g., it calls -.\"O .BR _exit (2), -.\"O or kills itself with a signal), -.\"O then none of the remaining functions is called, -.\"O and further exit processing (in particular, flushing of -.\"O .BR stdio (3) -.\"O streams) is abandoned. -.\"O If a function has been registered multiple times using -.\"O .BR atexit (3) -.\"O or -.\"O .BR on_exit (3), -.\"O then it is called as many times as it was registered. -これらの関数の一つが返らなかった場合 -(例えば、その関数が -.BR _exit (2) -を呼び出したり、シグナルで自分自身を kill した場合)、 -残りの関数はどれも呼び出されず、それ以降の exit 処理 -(特に -.BR stdio (3) -ストリームのフラッシュなど) は中止される。 -ある関数が -.BR atexit (3) -や -.BR on_exit (3) -を使って複数回登録されていた場合、 -その関数は登録されたのと同じ回数だけ呼び出される。 +\fBatexit\fP(3) や \fBon_exit\fP(3) によって 登録された全ての関数は、それらが登録された順番と逆順にコールされる。 +(登録された関数の中で \fBatexit\fP(3) or \fBon_exit\fP(3) を使って exit +処理中に実行される追加の関数を登録することができる; 新規に登録された関数は、この後で実行される関数リストの先頭に 追加される。) +これらの関数の一つが返らなかった場合 (例えば、その関数が \fB_exit\fP(2) を呼び出したり、シグナルで自分自身を kill した場合)、 +残りの関数はどれも呼び出されず、それ以降の exit 処理 (特に \fBstdio\fP(3) ストリームのフラッシュなど) は中止される。 ある関数が +\fBatexit\fP(3) や \fBon_exit\fP(3) を使って複数回登録されていた場合、 その関数は登録されたのと同じ回数だけ呼び出される。 .LP -.\"O All open -.\"O .BR stdio (3) -.\"O streams are flushed and closed. -.\"O Files created by -.\"O .BR tmpfile (3) -.\"O are removed. -オープン中の -.BR stdio (3) -ストリームは全てフラッシュされて、クローズされる。 -.BR tmpfile (3) +オープン中の \fBstdio\fP(3) ストリームは全てフラッシュされて、クローズされる。 \fBtmpfile\fP(3) によって作成されたファイルは削除される。 .LP -.\"O The C standard specifies two constants, -.\"O \fBEXIT_SUCCESS\fP and \fBEXIT_FAILURE\fP, -.\"O that may be passed to -.\"O .BR exit () -.\"O to indicate successful or unsuccessful -.\"O termination, respectively. -C 標準では -.B EXIT_SUCCESS -と -.B EXIT_FAILURE -という 2つの定数が -定義されている。それぞれ正常終了と異常終了を示すもので、 -.BR exit () -として渡すことができる。 -.\"O .SH "RETURN VALUE" +C 標準では \fBEXIT_SUCCESS\fP と \fBEXIT_FAILURE\fP という 2つの定数が +定義されている。それぞれ正常終了と異常終了を示すもので、 \fBexit\fP() として渡すことができる。 .SH 返り値 -.\"O The -.\"O .BR exit () -.\"O function does not return. -.BR exit () -関数は返らない。 -.\"O .SH "CONFORMING TO" +\fBexit\fP() 関数は返らない。 .SH 準拠 -SVr4, 4.3BSD, POSIX.1-2001, C89, C99. -.\"O .SH NOTES +SVr4, 4.3BSD, POSIX.1\-2001, C89, C99. .SH 注意 .LP -.\"O It is undefined what happens if one of the -.\"O functions registered using -.\"O .BR atexit (3) -.\"O and -.\"O .BR on_exit (3) -.\"O calls either -.\"O .BR exit () -.\"O or -.\"O .BR longjmp (3). -.BR atexit (3) -や -.BR on_exit (3) -を使って登録された関数の中で -.BR exit () -か -.BR longjmp (3) -が呼び出された場合、 -何が起こるかは未定義である。 +\fBatexit\fP(3) や \fBon_exit\fP(3) を使って登録された関数の中で \fBexit\fP() か \fBlongjmp\fP(3) +が呼び出された場合、 何が起こるかは未定義である。 .LP -.\"O The use of -.\"O .B EXIT_SUCCESS -.\"O and -.\"O .B EXIT_FAILURE -.\"O is slightly more portable -.\"O (to non-UNIX environments) than the use of 0 and some nonzero value -.\"O like 1 or \-1. -.\"O In particular, VMS uses a different convention. -.B EXIT_SUCCESS -と -.B EXIT_FAILURE -を使うと、0 や (1 や \-1 といった) 0 以外の値を使うのに比べて -(UNIX 以外の環境に) 移植するのがいくらか簡単になる。 -特に VMS は別の方式を用いている。 +\fBEXIT_SUCCESS\fP と \fBEXIT_FAILURE\fP を使うと、0 や (1 や \-1 といった) 0 以外の値を使うのに比べて +(UNIX 以外の環境に) 移植するのがいくらか簡単になる。 特に VMS は別の方式を用いている。 .LP -.\"O BSD has attempted to standardize exit codes; see the file -.\"O .IR . -BSD は終了コードを標準化しようとしている; -.I -を参照すること。 +BSD は終了コードを標準化しようとしている; \fI\fP を参照すること。 .LP -.\"O After -.\"O .BR exit (), -.\"O the exit status must be transmitted to the -.\"O parent process. -.\"O There are three cases. -.\"O If the parent has set -.\"O .BR SA_NOCLDWAIT , -.\"O or has set the -.\"O .B SIGCHLD -.\"O handler to -.\"O .BR SIG_IGN , -.\"O the status is discarded. -.\"O If the parent was waiting on the child -.\"O it is notified of the exit status. -.\"O In both cases the exiting -.\"O process dies immediately. -.\"O If the parent has not indicated that -.\"O it is not interested in the exit status, but is not waiting, -.\"O the exiting process turns into a "zombie" process -.\"O (which is nothing but a container for the single byte representing -.\"O the exit status) so that the parent can learn the exit status when -.\"O it later calls one of the -.\"O .BR wait (2) -.\"O functions. -.BR exit () -の後、親プロセスに終了ステータスが渡されなければならない。 -終了ステータスの渡し方には 3 つの場合がある。 -親プロセスが -.B SA_NOCLDWAIT -を設定した場合、 -または -.B SIGCHLD -ハンドラを -.B SIG_IGN -に設定した場合、 -ステータスは破棄される。 -親プロセスが子プロセスの終了を待っている場合、 -親プロセスに終了ステータスが伝えられる。 -どちらの場合でも exit のプロセスは直ちに終了する。 -「終了ステータスを関知せず終了も待たない」 -ということを親プロセスが指示していない場合、 -exit プロセスは (終了ステータスを表す 1 バイトのみを保持する) -「ゾンビ」プロセスになる。 -これにより、後から -.BR wait (2) -関数を呼び出すことで、 +\fBexit\fP() の後、親プロセスに終了ステータスが渡されなければならない。 終了ステータスの渡し方には 3 つの場合がある。 親プロセスが +\fBSA_NOCLDWAIT\fP を設定した場合、 または \fBSIGCHLD\fP ハンドラを \fBSIG_IGN\fP に設定した場合、 +ステータスは破棄される。 親プロセスが子プロセスの終了を待っている場合、 親プロセスに終了ステータスが伝えられる。 どちらの場合でも exit +のプロセスは直ちに終了する。 「終了ステータスを関知せず終了も待たない」 ということを親プロセスが指示していない場合、 exit プロセスは +(終了ステータスを表す 1 バイトのみを保持する) 「ゾンビ」プロセスになる。 これにより、後から \fBwait\fP(2) 関数を呼び出すことで、 親プロセスは終了ステータスを知ることができる。 .LP -.\"O If the implementation supports the -.\"O .B SIGCHLD -.\"O signal, this signal -.\"O is sent to the parent. -.\"O If the parent has set -.\"O .BR SA_NOCLDWAIT , -.\"O it is undefined whether a -.\"O .B SIGCHLD -.\"O signal is sent. -.B SIGCHLD -シグナルのサポートが実装されている場合、 -このシグナルは親プロセスに送られる。 -親プロセスが -.B SA_NOCLDWAIT -を設定した場合、 -.B SIGCHLD -シグナルが送られるかどうかは定義されていない。 +\fBSIGCHLD\fP シグナルのサポートが実装されている場合、 このシグナルは親プロセスに送られる。 親プロセスが \fBSA_NOCLDWAIT\fP +を設定した場合、 \fBSIGCHLD\fP シグナルが送られるかどうかは定義されていない。 .LP -.\"O If the process is a session leader and its controlling terminal -.\"O is the controlling terminal of the session, then each process in -.\"O the foreground process group of this controlling terminal -.\"O is sent a -.\"O .B SIGHUP -.\"O signal, and the terminal is disassociated -.\"O from this session, allowing it to be acquired by a new controlling -.\"O process. -そのプロセスがセッションのリーダーで、 -そのプロセスの制御端末がそのセッションの制御端末である場合、 -この制御端末のフォアグラウンドプロセスグループにある -各プロセスに -.B SIGHUP -シグナルが送られ、端末がセッションから切り離される。 +そのプロセスがセッションのリーダーで、 そのプロセスの制御端末がそのセッションの制御端末である場合、 +この制御端末のフォアグラウンドプロセスグループにある 各プロセスに \fBSIGHUP\fP シグナルが送られ、端末がセッションから切り離される。 これにより新しい制御プロセスを取得することができる。 .LP -.\"O If the exit of the process causes a process group to become orphaned, -.\"O and if any member of the newly orphaned process group is stopped, -.\"O then a -.\"O .B SIGHUP -.\"O signal followed by a -.\"O .B SIGCONT -.\"O signal will be -.\"O sent to each process in this process group. -プロセスが終了することにより、プロセスグループが孤立して、 -そのグループのメンバーのうちのどれかが停止した場合、 -プロセスグループの各プロセスに対して -.B SIGHUP -シグナルが送られ、続いて -.B SIGCONT -シグナルが送られる。 -.\"O See -.\"O .BR setpgid (2) -.\"O for an explanation of orphaned process groups. -孤立した (orphaned) プロセスグループの説明は -.BR setpgid (2) -を参照。 -.\"O .SH "SEE ALSO" +プロセスが終了することにより、プロセスグループが孤立して、 そのグループのメンバーのうちのどれかが停止した場合、 プロセスグループの各プロセスに対して +\fBSIGHUP\fP シグナルが送られ、続いて \fBSIGCONT\fP シグナルが送られる。 孤立した (orphaned) プロセスグループの説明は +\fBsetpgid\fP(2) を参照。 .SH 関連項目 -.BR _exit (2), -.BR setpgid (2), -.BR wait (2), -.BR atexit (3), -.BR on_exit (3), -.BR tmpfile (3) +\fB_exit\fP(2), \fBsetpgid\fP(2), \fBwait\fP(2), \fBatexit\fP(3), \fBon_exit\fP(3), +\fBtmpfile\fP(3) diff --git a/draft/man3/exp.3 b/draft/man3/exp.3 index 75461fd3..c2495e0a 100644 --- a/draft/man3/exp.3 +++ b/draft/man3/exp.3 @@ -31,166 +31,66 @@ .\" Modified 2002-07-27 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated Mon Sep 7 23:27:52 JST 2003 -.\" by Akihiro MOTOKI -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH EXP 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH EXP 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O exp, expf, expl \- base-e exponential function exp, expf, expl \- 底が e の指数関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double exp(double " x ); +\fBdouble exp(double \fP\fIx\fP\fB);\fP .br -.BI "float expf(float " x ); +\fBfloat expf(float \fP\fIx\fP\fB);\fP .br -.BI "long double expl(long double " x ); +\fBlong double expl(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR expf (), -.BR expl (): +\fBexpf\fP(), \fBexpl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR exp () -.\"O function returns the value of e (the base of natural -.\"O logarithms) raised to the power of \fIx\fP. -.BR exp () -関数は e の \fIx\fP 乗の値を返す -(e は自然対数の底)。 -.\"O .SH RETURN VALUE +\fBexp\fP() 関数は e の \fIx\fP 乗の値を返す (e は自然対数の底)。 .SH 返り値 -.\"O On success, these functions return the exponential value of -.\"O .IR x . -成功すると、これらの関数は e の -.I x -乗を返す。 +成功すると、これらの関数は e の \fIx\fP 乗を返す。 -.\"O If -.\"O .I x -.\"O is a NaN, -.\"O a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is positive infinity, -.\"O positive infinity is returned. -.I x -が正の無限大の場合、正の無限大が返される。 +\fIx\fP が正の無限大の場合、正の無限大が返される。 -.\"O If -.\"O .I x -.\"O is negative infinity, -.\"O +0 is returned. -.I x -が負の無限大の場合、+0 が返される。 +\fIx\fP が負の無限大の場合、+0 が返される。 -.\"O If the result underflows, -.\"O a range error occurs, -.\"O and zero is returned. -結果がアンダーフローする場合、 -範囲エラー (range error) が発生し、0 が返される。 +結果がアンダーフローする場合、 範囲エラー (range error) が発生し、0 が返される。 -.\"O If the result overflows, -.\"O a range error occurs, -.\"O and the functions return -.\"O .RB + HUGE_VAL , -.\"O .RB + HUGE_VALF , -.\"O or -.\"O .RB + HUGE_VALL , -.\"O respectively. -結果がオーバーフローする場合、範囲エラーが発生し、 -各関数はそれぞれ -.RB + HUGE_VAL , -.RB + HUGE_VALF , -.RB + HUGE_VALL -を返す。 -.\"O .SH ERRORS +結果がオーバーフローする場合、範囲エラーが発生し、 各関数はそれぞれ +\fBHUGE_VAL\fP, +\fBHUGE_VALF\fP, ++\fBHUGE_VALL\fP を返す。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Range error, overflow +.TP 範囲エラー (range error)、オーバーフローの場合 -.\"O .I errno -.\"O is set to -.\"O .BR ERANGE . -.\"O An overflow floating-point exception -.\"O .RB ( FE_OVERFLOW ) -.\"O is raised. -.I errno -に -.B ERANGE -が設定される。 -オーバーフロー浮動小数点例外 -.RB ( FE_OVERFLOW ) -が上がる。 -.TP -.\"O Range error, underflow -範囲エラー、アンダーフローの場合 -.\"O .I errno -.\"O is set to -.\"O .BR ERANGE . -.\"O An underflow floating-point exception -.\"O .RB ( FE_UNDERFLOW ) -.\"O is raised. -.I errno -に -.B ERANGE -が設定される。 -アンダーフロー浮動小数点例外 -.RB ( FE_UNDERFLOW ) -が上がる。 -.\"O .SH "CONFORMING TO" +\fIerrno\fP に \fBERANGE\fP が設定される。 オーバーフロー浮動小数点例外 (\fBFE_OVERFLOW\fP) が上がる。 +.TP +範囲エラー (range error)、アンダーフローの場合 +\fIerrno\fP に \fBERANGE\fP が設定される。 アンダーフロー浮動小数点例外 (\fBFE_UNDERFLOW\fP) が上がる。 .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH 関連項目 -.BR cbrt (3), -.BR cexp (3), -.BR exp10 (3), -.BR exp2 (3), -.BR sqrt (3) +\fBcbrt\fP(3), \fBcexp\fP(3), \fBexp10\fP(3), \fBexp2\fP(3), \fBsqrt\fP(3) diff --git a/draft/man3/exp10.3 b/draft/man3/exp10.3 index 46bfd4f8..8671dd3b 100644 --- a/draft/man3/exp10.3 +++ b/draft/man3/exp10.3 @@ -30,86 +30,43 @@ .\" Modified 1995-08-14 by Arnt Gulbrandsen .\" Modified 2002-07-27 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated Tue Sep 23 20:30:22 JST 2003 -.\" by Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.TH EXP10 3 2008-08-11 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH EXP10 3 2008\-08\-11 GNU "Linux Programmer's Manual" .SH 名前 -.\"O exp10, exp10f, exp10l \- base-10 exponential function exp10, exp10f, exp10l \- 基数が 10 の指数関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ .br -.B #include +\fB#include \fP .sp -.BI "double exp10(double " x ); +\fBdouble exp10(double \fP\fIx\fP\fB);\fP .br -.BI "float exp10f(float " x ); +\fBfloat exp10f(float \fP\fIx\fP\fB);\fP .br -.BI "long double exp10l(long double " x ); +\fBlong double exp10l(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR exp10 () -.\"O function returns the value of 10 -.\"O raised to the power of \fIx\fP. -.BR exp10 () -関数は 10 の \fIx\fP 乗の値を返す。 -.\"O .SH RETURN VALUE +\fBexp10\fP() 関数は 10 の \fIx\fP 乗の値を返す。 .SH 返り値 -.\"O On success, these functions return the base-10 exponential value of -.\"O .IR x . -成功すると、これらの関数は 10 の -.I x -乗を返す。 +成功すると、これらの関数は 10 の \fIx\fP 乗を返す。 -.\"O For various special cases, including the handling of infinity and NaN, -.\"O as well as overflows and underflows, see -.\"O .BR exp (3). -無限大や NaN の扱いや、オーバーフローとアンダーフローなどの -さまざまな特別な状況については、 -.BR exp (3) -を参照のこと。 -.\"O .SH ERRORS +無限大や NaN の扱いや、オーバーフローとアンダーフローなどの さまざまな特別な状況については、 \fBexp\fP(3) を参照のこと。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 -.\"O For a discussion of the errors that can occur for these functions, see -.\"O .BR exp (3). -これらの関数で発生するエラーについては、 -.BR exp (3) -を参照のこと。 .\" FIXME . exp10 doesn't give ERANGE for an underflow, unlike exp() and exp2() .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6787 -.\"O .SH VERSIONS +これらの関数で発生するエラーについては、 \fBexp\fP(3) を参照のこと。 .SH バージョン -.\"O These functions first appeared in glibc in version 2.1. これらの関数は glibc バージョン 2.1 で初めて登場した。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O These functions are GNU extensions. これらの関数は GNU による拡張である。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR cbrt (3), -.BR exp (3), -.BR exp2 (3), -.BR log10 (3), -.BR sqrt (3) +\fBcbrt\fP(3), \fBexp\fP(3), \fBexp2\fP(3), \fBlog10\fP(3), \fBsqrt\fP(3) diff --git a/draft/man3/exp2.3 b/draft/man3/exp2.3 index cbcf0c82..249b7a50 100644 --- a/draft/man3/exp2.3 +++ b/draft/man3/exp2.3 @@ -31,105 +31,52 @@ .\" Modified 2002-07-27 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated Tue Sep 23 20:27:35 JST 2003 -.\" by Akihiro MOTOKI +.\"******************************************************************* .\" -.TH EXP2 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH EXP2 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O exp2, exp2f, exp2l \- base-2 exponential function exp2, exp2f, exp2l \- 底が 2 の指数関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double exp2(double " x ); +\fBdouble exp2(double \fP\fIx\fP\fB);\fP .br -.BI "float exp2f(float " x ); +\fBfloat exp2f(float \fP\fIx\fP\fB);\fP .br -.BI "long double exp2l(long double " x ); +\fBlong double exp2l(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. -\fI-lm\fP でリンクする。 +\fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR exp2 (), -.BR exp2f (), -.BR exp2l (): +\fBexp2\fP(), \fBexp2f\fP(), \fBexp2l\fP(): .RS 4 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR exp2 () -.\"O function returns the value of 2 -.\"O raised to the power of \fIx\fP. -.BR exp2 () -関数は 2 の \fIx\fP 乗の値を返す。 -.\"O .SH RETURN VALUE +\fBexp2\fP() 関数は 2 の \fIx\fP 乗の値を返す。 .SH 返り値 -.\"O On success, these functions return the base-2 exponential value of -.\"O .IR x . -成功すると、これらの関数は 2 の -.I x -乗を返す。 +成功すると、これらの関数は 2 の \fIx\fP 乗を返す。 -.\"O For various special cases, including the handling of infinity and NaN, -.\"O as well as overflows and underflows, see -.\"O .BR exp (3). -無限大や NaN の扱いや、オーバーフローとアンダーフローなどの -さまざまな特別な状況については、 -.BR exp (3) -を参照のこと。 -.\"O .SH ERRORS +無限大や NaN の扱いや、オーバーフローとアンダーフローなどの さまざまな特別な状況については、 \fBexp\fP(3) を参照のこと。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 -.\"O For a discussion of the errors that can occur for these functions, see -.\"O .BR exp (3). -これらの関数で発生するエラーについては、 -.BR exp (3) -を参照のこと。 -.\"O .SH VERSIONS +これらの関数で発生するエラーについては、 \fBexp\fP(3) を参照のこと。 .SH バージョン -.\"O These functions first appeared in glibc in version 2.1. これらの関数は glibc バージョン 2.1 で初めて登場した。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH 関連項目 -.BR cbrt (3), -.BR cexp2 (3), -.BR exp (3), -.BR exp10 (3), -.BR sqrt (3) +\fBcbrt\fP(3), \fBcexp2\fP(3), \fBexp\fP(3), \fBexp10\fP(3), \fBsqrt\fP(3) diff --git a/draft/man3/expm1.3 b/draft/man3/expm1.3 index a806fac5..17339d86 100644 --- a/draft/man3/expm1.3 +++ b/draft/man3/expm1.3 @@ -25,214 +25,101 @@ .\" Modified 2002-07-27 Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. -.\" Translated Mon May 18 1998 by NAKANO Takeo -.\" Update Tue Sep 23 2003 by Akihiro MOTOKI -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH EXPM1 3 2010-09-12 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH EXPM1 3 2010\-09\-12 "" "Linux Programmer's Manual" .SH 名前 -.\"O expm1, expm1f, expm1l \- exponential minus 1 expm1, expm1f, expm1l \- 引き数の指数から 1 を引いた値 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double expm1(double " x ); +\fBdouble expm1(double \fP\fIx\fP\fB);\fP .br -.BI "float expm1f(float " x ); +\fBfloat expm1f(float \fP\fIx\fP\fB);\fP .br -.BI "long double expm1l(long double " x ); +\fBlong double expm1l(long double \fP\fIx\fP\fB);\fP .sp .fi -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR expm1 (): +\fBexpm1\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .br -.BR expm1f (), -.BR expm1l (): +\fBexpm1f\fP(), \fBexpm1l\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O .I expm1(x) -.\"O returns a value equivalent to -.BI expm1( x ) -は以下と等しい値を返す。 +\fBexpm1(\fP\fIx\fP\fB)\fP は以下と等しい値を返す。 .nf exp(x) \- 1 .fi -.\"O It is -.\"O computed in a way that is accurate even if the value of \fIx\fP is near -.\"O zero\(ema case where -.\"O .I "exp(x) \- 1" -.\"O would be inaccurate due to -.\"O subtraction of two numbers that are nearly equal. -.I "exp(x) \- 1" -の計算には、\fIx\fP が 0 の近傍で引き算時の桁落ちのために +\fIexp(x) \- 1\fP の計算には、\fIx\fP が 0 の近傍で引き算時の桁落ちのために 不正確となるような場合でも正確な値が計算できる方法が用いられる。 -.\"O .SH RETURN VALUE .SH 返り値 -.\"O On success, these functions return -.\"O .IR "exp(x)\ \-\ 1" . -成功すると、これらの関数は -.I "exp(x)\ \-\ 1" -を返す。 +成功すると、これらの関数は \fIexp(x)\ \-\ 1\fP を返す。 -.\"O If -.\"O .I x -.\"O is a NaN, -.\"O a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is +0 (\-0), -.\"O +0 (\-0) is returned. -.I x -が +0 (\-0) の場合、+0 (\-0) が返される。 +\fIx\fP が +0 (\-0) の場合、+0 (\-0) が返される。 -.\"O If -.\"O .I x -.\"O is positive infinity, positive infinity is returned. -.I x -が正の無限大の場合、正の無限大が返される。 +\fIx\fP が正の無限大の場合、正の無限大が返される。 -.\"O If -.\"O .I x -.\"O is negative infinity, \-1 is returned. -.I x -が負の無限大の場合、\-1 が返される。 +\fIx\fP が負の無限大の場合、\-1 が返される。 -.\"O If the result overflows, a range error occurs, -.\"O and the functions return -.\"O .RB - HUGE_VAL , -.\"O .RB - HUGE_VALF , -.\"O or -.\"O .RB - HUGE_VALL , -.\"O respectively. -結果がオーバーフローする場合、範囲エラー (range error) が発生し、 -各関数はそれぞれ -.RB - HUGE_VAL , -.RB - HUGE_VALF , -.RB - HUGE_VALL -を返す。 -.\"O .SH ERRORS +結果がオーバーフローする場合、範囲エラー (range error) が発生し、 各関数はそれぞれ \-\fBHUGE_VAL\fP, +\-\fBHUGE_VALF\fP, \-\fBHUGE_VALL\fP を返す。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Range error, overflow +.TP 範囲エラー (range error)、オーバーフローの場合 -.\"O .I errno -.\"O is set to -.\"O .BR ERANGE -.\"O (but see BUGS). -.\"O An overflow floating-point exception -.\"O .RB ( FE_OVERFLOW ) -.\"O is raised. -.I errno -に -.B ERANGE -が設定される (「バグ」の節も参照)。 -オーバーフロー浮動小数点例外 -.RB ( FE_OVERFLOW ) -が上がる。 -.PP .\" .\" POSIX.1 specifies an optional range error (underflow) if .\" x is subnormal. Glibc does not implement this. -.\"O .SH "CONFORMING TO" +\fIerrno\fP に \fBERANGE\fP が設定される (「バグ」の節も参照)。 オーバーフロー浮動小数点例外 (\fBFE_OVERFLOW\fP) +が上がる。 .SH 準拠 -C99, POSIX.1-2001. .\" BSD. -.\"O .SH BUGS +C99, POSIX.1\-2001. .SH バグ -.\"O For some large negative -.\"O .I x -.\"O values (where the function result approaches \-1), -.\"O .BR expm1 () -.\"O raises a bogus underflow floating-point exception. -.I x -が負の大きな値の場合 (この場合には関数の結果は \-1 に近付いていく)、 -.BR expm1 () -は間違ってアンダーフロー浮動小数点例外を上げることがある。 .\" FIXME . .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6778 +\fIx\fP が負の大きな値の場合 (この場合には関数の結果は \-1 に近付いていく)、 \fBexpm1\fP() +は間違ってアンダーフロー浮動小数点例外を上げることがある。 -.\"O For some large positive -.\"O .I x -.\"O values, -.\"O .BR expm1 () -.\"O raises a bogus invalid floating-point exception in addition to the expected -.\"O overflow exception, and returns a NaN instead of positive infinity. -.I x -が正の大きな値の場合、 -.BR expm1 () -は期待通りのオーバーフロー例外だけでなく -間違って不正 (invalid) 浮動小数点例外を上げ、 -正の無限大ではなく NaN を返すことがある。 .\" FIXME . .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6814 .\" e.g., expm1(1e5) through expm1(1.00199970127e5), .\" but not expm1(1.00199970128e5) and beyond. +\fIx\fP が正の大きな値の場合、 \fBexpm1\fP() は期待通りのオーバーフロー例外だけでなく 間違って不正 (invalid) +浮動小数点例外を上げ、 正の無限大ではなく NaN を返すことがある。 -.\"O Before version 2.11, .\" It looks like the fix was in 2.11, or possibly 2.12. .\" I have no test system for 2.11, but 2.12 passes. .\" From the source (sysdeps/i386/fpu/s_expm1.S) it looks .\" like the changes were in 2.11. -.\"O the glibc implementation did not set .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6788 -.\"O .I errno -.\"O to -.\"O .B ERANGE -.\"O when a range error occurred. -バージョン 2.11 より前の glibc の実装では、 -範囲エラーが発生した場合に、 -.I errno -に -.B ERANGE -が設定されなかった。 -.\"O .SH "SEE ALSO" +バージョン 2.11 より前の glibc の実装では、 範囲エラーが発生した場合に、 \fIerrno\fP に \fBERANGE\fP が設定されなかった。 .SH 関連項目 -.BR exp (3), -.BR log (3), -.BR log1p (3) +\fBexp\fP(3), \fBlog\fP(3), \fBlog1p\fP(3) diff --git a/draft/man3/fabs.3 b/draft/man3/fabs.3 index 1586c25b..f062a263 100644 --- a/draft/man3/fabs.3 +++ b/draft/man3/fabs.3 @@ -27,106 +27,53 @@ .\" Modified Sat Jul 24 19:42:04 1993 by Rik Faith (faith@cs.unc.edu) .\" Added fabsl, fabsf, aeb, 2001-06-07 .\" -.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi -.\" all rights reserved. -.\" Translated Mon Jan 20 20:29:27 JST 1997 -.\" by YOSHINO Takashi -.\" Updated & Modified Sun Jul 1 10:59:51 JST 2001 -.\" by Yuichi SATO -.\" Updated & Modified Mon Jan 10 07:44:31 JST 2005 -.\" by Yuichi SATO -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH FABS 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH FABS 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O fabs, fabsf, fabsl \- absolute value of floating-point number fabs, fabsf, fabsl \- 浮動小数点実数の絶対値 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double fabs(double " x ); +\fBdouble fabs(double \fP\fIx\fP\fB);\fP .br -.BI "float fabsf(float " x ); +\fBfloat fabsf(float \fP\fIx\fP\fB);\fP .br -.BI "long double fabsl(long double " x ); +\fBlong double fabsl(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR fabsf (), -.BR fabsl (): +\fBfabsf\fP(), \fBfabsl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR fabs () -.\"O functions return the absolute value of the floating-point -.\"O number \fIx\fP. -.BR fabs () -関数群は浮動小数点実数 \fIx\fP の絶対値を返す。 -.\"O .SH RETURN VALUE +\fBfabs\fP() 関数群は浮動小数点実数 \fIx\fP の絶対値を返す。 .SH 返り値 -.\"O These functions return the absolute value of -.\"O .IR x . -これらの関数は -.I x -の絶対値を返す。 +これらの関数は \fIx\fP の絶対値を返す。 -.\"O If -.\"O .I x -.\"O is a NaN, a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is \-0, +0 is returned. -.I x -が \-0 の場合、+0 が返される。 +\fIx\fP が \-0 の場合、+0 が返される。 -.\"O If -.\"O .I x -.\"O is negative infinity or positive infinity, positive infinity is returned. -.I x -が負の無限大か正の無限大の場合、正の無限大が返される。 -.\"O .SH ERRORS +\fIx\fP が負の無限大か正の無限大の場合、正の無限大が返される。 .SH エラー -.\"O No errors occur. -エラーは起こらない。 -.\"O .SH "CONFORMING TO" +エラーは発生しない。 .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH 関連項目 -.BR abs (3), -.BR cabs (3), -.BR ceil (3), -.BR floor (3), -.BR labs (3), -.BR rint (3) +\fBabs\fP(3), \fBcabs\fP(3), \fBceil\fP(3), \fBfloor\fP(3), \fBlabs\fP(3), \fBrint\fP(3) diff --git a/draft/man3/fdim.3 b/draft/man3/fdim.3 index 4f64168e..7ef9ebe6 100644 --- a/draft/man3/fdim.3 +++ b/draft/man3/fdim.3 @@ -3,123 +3,63 @@ .\" .\" Distributed under GPL. .\" -.\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO -.\" all rights reserved. -.\" Translated Sat Jul 24 10:14:17 JST 2004 -.\" by Yuichi SATO -.\" Updated & Modified Mon Jan 10 08:17:08 JST 2005 by Yuichi SATO -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH FDIM 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH FDIM 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O fdim, fdimf, fdiml \- positive difference fdim, fdimf, fdiml \- 正の差分を計算する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "double fdim(double " x ", double " y ); +\fBdouble fdim(double \fP\fIx\fP\fB, double \fP\fIy\fP\fB);\fP .br -.BI "float fdimf(float " x ", float " y ); +\fBfloat fdimf(float \fP\fIx\fP\fB, float \fP\fIy\fP\fB);\fP .br -.BI "long double fdiml(long double " x ", long double " y ); +\fBlong double fdiml(long double \fP\fIx\fP\fB, long double \fP\fIy\fP\fB);\fP .sp -.\"O Link with \fI\-lm\fP. -\fI-lm\fP でリンクする。 +\fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR fdimf (), -.BR fdiml (): +\fBfdimf\fP(), \fBfdiml\fP(): .RS 4 -_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O These functions return the positive difference, max(\fIx\fP-\fIy\fP,0), -.\"O between their arguments. -これらの関数は、二つの引き数間の正の差分 max(\fIx\fP-\fIy\fP,0) を返す。 -.\"O .SH RETURN VALUE +これらの関数は、二つの引き数間の正の差分 max(\fIx\fP\-\fIy\fP,0) を返す。 .SH 返り値 -.\"O On success, these functions return the positive difference. 成功すると、これらの関数は正の差分を返す。 -.\"O If -.\"O .I x -.\"O or -.\"O .I y -.\"O is a NaN, a NaN is returned. -.I x -か -.I y -が NaN の場合、NaN が返される。 +\fIx\fP か \fIy\fP が NaN の場合、NaN が返される。 -.\"O If the result overflows, -.\"O a range error occurs, -.\"O and the functions return -.\"O .BR HUGE_VAL , -.\"O .BR HUGE_VALF , -.\"O or -.\"O .BR HUGE_VALL , -.\"O respectively. -結果がオーバーフローする場合、範囲エラーが発生し、 -各関数はそれぞれ -.BR HUGE_VAL , -.BR HUGE_VALF , -.B HUGE_VALL -を返す。 -.\"O .SH ERRORS +結果がオーバーフローする場合、範囲エラー (range error) が発生し、 各関数はそれぞれ \fBHUGE_VAL\fP, \fBHUGE_VALF\fP, +\fBHUGE_VALL\fP を返す。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Range error: result overflow -範囲エラー (range error)、オーバーフローの場合 +.TP +範囲エラー (range error): 結果のオーバーフロー .\" .I errno .\" is set to .\" .BR ERANGE . -.\"O An overflow floating-point exception -.\"O .RB ( FE_OVERFLOW ) -.\"O is raised. -オーバーフロー浮動小数点例外 -.RB ( FE_OVERFLOW ) -が上がる。 +オーバーフロー浮動小数点例外 (\fBFE_OVERFLOW\fP) が上がる。 .PP -.\"O These functions do not set -.\"O .IR errno . -これらの関数は -.I errno -を設定しない。 .\" FIXME . Is it intentional that these functions do not set errno? .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6796 -.\"O .SH VERSIONS +これらの関数は \fIerrno\fP を設定しない。 .SH バージョン -.\"O These functions first appeared in glibc in version 2.1. これらの関数は glibc バージョン 2.1 で初めて登場した。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. .SH 関連項目 -.BR fmax (3) +\fBfmax\fP(3) diff --git a/draft/man3/fenv.3 b/draft/man3/fenv.3 index d90ad872..2bae46f9 100644 --- a/draft/man3/fenv.3 +++ b/draft/man3/fenv.3 @@ -23,543 +23,171 @@ .\" 2000-08-14 added GNU additions from Andreas Jaeger .\" 2000-12-05 some changes inspired by acahalan's remarks .\" -.\" Japanese Version Copyright (c) 2000-2001 NAKANO Takeo -.\" and Copyright (c) 2008 Akihiro MOTOKI. -.\" Translated 2001-02-08, NAKANO Takeo -.\" Updated 2003-10-15, Kentaro Shirakata -.\" Updated 2005-02-26, Akihiro MOTOKI -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.\"WORD: (floating-point) exception (浮動小数点) 例外 -.\"WORD: rounding 丸め -.\"WORD: opaque 内部の +.\" This file was generated with po4a. Translate the source file. .\" -.TH FENV 3 2010-10-31 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH FENV 3 2010\-10\-31 Linux "Linux Programmer's Manual" .SH 名前 -.\"O feclearexcept, fegetexceptflag, feraiseexcept, fesetexceptflag, -.\"O fetestexcept, fegetenv, fegetround, feholdexcept, fesetround, -.\"O fesetenv, feupdateenv, feenableexcept, fedisableexcept, -.\"O fegetexcept \- floating-point rounding and exception handling feclearexcept, fegetexceptflag, feraiseexcept, fesetexceptflag, -fetestexcept, fegetenv, fegetround, feholdexcept, fesetround, -fesetenv, feupdateenv, feenableexcept, fedisableexcept, -fegetexcept \- 浮動小数点の丸めと例外の取り扱い -.\"O .SH SYNOPSIS +fetestexcept, fegetenv, fegetround, feholdexcept, fesetround, fesetenv, +feupdateenv, feenableexcept, fedisableexcept, fegetexcept \- 浮動小数点の丸めと例外の取り扱い .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int feclearexcept(int " excepts ); +\fBint feclearexcept(int \fP\fIexcepts\fP\fB);\fP .br -.BI "int fegetexceptflag(fexcept_t *" flagp ", int " excepts ); +\fBint fegetexceptflag(fexcept_t *\fP\fIflagp\fP\fB, int \fP\fIexcepts\fP\fB);\fP .br -.BI "int feraiseexcept(int " excepts ); +\fBint feraiseexcept(int \fP\fIexcepts\fP\fB);\fP .br -.BI "int fesetexceptflag(const fexcept_t *" flagp ", int " excepts ); +\fBint fesetexceptflag(const fexcept_t *\fP\fIflagp\fP\fB, int \fP\fIexcepts\fP\fB);\fP .br -.BI "int fetestexcept(int " excepts ); +\fBint fetestexcept(int \fP\fIexcepts\fP\fB);\fP .sp -.B "int fegetround(void);" +\fBint fegetround(void);\fP .br -.BI "int fesetround(int " rounding_mode ); +\fBint fesetround(int \fP\fIrounding_mode\fP\fB);\fP .sp -.BI "int fegetenv(fenv_t *" envp ); +\fBint fegetenv(fenv_t *\fP\fIenvp\fP\fB);\fP .br -.BI "int feholdexcept(fenv_t *" envp ); +\fBint feholdexcept(fenv_t *\fP\fIenvp\fP\fB);\fP .br -.BI "int fesetenv(const fenv_t *" envp ); +\fBint fesetenv(const fenv_t *\fP\fIenvp\fP\fB);\fP .br -.BI "int feupdateenv(const fenv_t *" envp ); +\fBint feupdateenv(const fenv_t *\fP\fIenvp\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 -.\"O .SH DESCRIPTION .SH 説明 -.\"O These eleven functions were defined in C99, and describe the handling -.\"O of floating-point rounding and exceptions (overflow, zero-divide etc.). -これらの 11 個の関数は C99 で定義されており、 -浮動小数点の丸めと例外 (オーバーフロー、ゼロによる除算など) -の取り扱いを規定する。 -.\"O .SS Exceptions +これらの 11 個の関数は C99 で定義されており、 浮動小数点の丸めと例外 (オーバーフロー、ゼロによる除算など) の取り扱いを規定する。 .SS 例外 -.\"O The -.\"O .I divide-by-zero -.\"O exception occurs when an operation on finite numbers -.\"O produces infinity as exact answer. -.I divide-by-zero -例外は、有限の数値に対する演算が、 -無限大の答えを生成するような場合に起こる。 +\fIdivide\-by\-zero\fP 例外は、有限の数値に対する演算が、 無限大の答えを生成するような場合に起こる。 .LP -.\"O The -.\"O .I overflow -.\"O exception occurs when a result has to be represented as a -.\"O floating-point number, but has (much) larger absolute value than the -.\"O largest (finite) floating-point number that is representable. -.I overflow -例外は、結果が浮動小数点数値で表記されなければならないのに、 -その絶対値が表現可能な浮動小数点数の (有限の) 最大値よりも +\fIoverflow\fP 例外は、結果が浮動小数点数値で表記されなければならないのに、 その絶対値が表現可能な浮動小数点数の (有限の) 最大値よりも (ずっと) 大きくなってしまうような場合に起こる。 .LP -.\"O The -.\"O .I underflow -.\"O exception occurs when a result has to be represented as a -.\"O floating-point number, but has smaller absolute value than the smallest -.\"O positive normalized floating-point number (and would lose much accuracy -.\"O when represented as a denormalized number). -.I underflow -例外は、結果が浮動小数点数値で表記されなければならないのに、 -その絶対値が正の正規化浮動小数点数の最小値よりも -小さくなってしまう -(そして 非正規化数で表現した場合に非常に精度を失ってしまう) -ような場合に起こる。 +\fIunderflow\fP 例外は、結果が浮動小数点数値で表記されなければならないのに、 その絶対値が正の正規化浮動小数点数の最小値よりも +小さくなってしまう (そして 非正規化数で表現した場合に非常に精度を失ってしまう) ような場合に起こる。 .LP -.\"O The -.\"O .I inexact -.\"O exception occurs when the rounded result of an operation -.\"O is not equal to the infinite precision result. -.\"O It may occur whenever -.\"O .I overflow -.\"O or -.\"O .I underflow -.\"O occurs. -.I inexact -例外は、丸め後の演算結果が、 -無限精度の結果と異なるような場合に起こる。 -.I overflow -例外か -.I underflow +\fIinexact\fP 例外は、丸め後の演算結果が、 無限精度の結果と異なるような場合に起こる。 \fIoverflow\fP 例外か \fIunderflow\fP 例外が起きたときには、常にこの例外も起こる。 .LP -.\"O The -.\"O .I invalid -.\"O exception occurs when there is no well-defined result -.\"O for an operation, as for 0/0 or infinity \- infinity or sqrt(\-1). -.I invalid -例外は、演算結果がうまく定義できない結果を生じるような場合に起こる。 -例えば 0/0、無限大 \- 無限大、sqrt(\-1) など。 -.\"O .SS "Exception handling" +\fIinvalid\fP 例外は、演算結果がうまく定義できない結果を生じるような場合に起こる。 例えば 0/0、無限大 \- 無限大、sqrt(\-1) など。 .SS 例外処理 -.\"O Exceptions are represented in two ways: as a single bit -.\"O (exception present/absent), and these bits correspond in some -.\"O implementation-defined way with bit positions in an integer, -.\"O and also as an opaque structure that may contain more information -.\"O about the exception (perhaps the code address where it occurred). -例外の表し方には 2 つの方法がある。 -ひとつは、単一のビットで (例外があったかなかったかを) 表す方法で、 -これらのビットは整数のあるビット位置に対応し、ビットの対応付けは -実装依存である。もう一つは、内部構造体を使って表す方法で、 -この方法の方が例外に関するより多くの情報 -(例えば例外が起こったコードのアドレスなど) が含まれる。 -.LP -.\"O Each of the macros -.\"O .BR FE_DIVBYZERO , -.\"O .BR FE_INEXACT , -.\"O .BR FE_INVALID , -.\"O .BR FE_OVERFLOW , -.\"O .B FE_UNDERFLOW -.\"O is defined when the implementation supports handling -.\"O of the corresponding exception, and if so then -.\"O defines the corresponding bit(s), so that one can call -.\"O exception handling functions, for example, using the integer argument -.\"O .BR FE_OVERFLOW | FE_UNDERFLOW . -.\"O Other exceptions may be supported. -.\"O The macro -.\"O .B FE_ALL_EXCEPT -.\"O is the bitwise OR of all bits corresponding to supported exceptions. -.BR FE_DIVBYZERO , -.BR FE_INEXACT , -.BR FE_INVALID , -.BR FE_OVERFLOW , -.B FE_UNDERFLOW -の各マクロは、それぞれ対応する例外の処理を -実装がサポートしている場合に定義される。 -このとき対応するビットをそれぞれ定義することになるので、 -例外処理関数の呼び出しを、例えば -.BR FE_OVERFLOW | FE_UNDERFLOW -という整数の引き数を用いて行うことができる。 -他の例外もサポートされているかもしれない。 -.B FE_ALL_EXCEPT -マクロは、サポートされている例外に対応するビットが全てセットされている -(サポートされている例外全ての論理和である)。 +例外の表し方には 2 つの方法がある。 ひとつは、単一のビットで (例外があったかなかったかを) 表す方法で、 +これらのビットは整数のあるビット位置に対応し、ビットの対応付けは 実装依存である。もう一つは、内部構造体を使って表す方法で、 +この方法の方が例外に関するより多くの情報 (例えば例外が起こったコードのアドレスなど) が含まれる。 +.LP +\fBFE_DIVBYZERO\fP, \fBFE_INEXACT\fP, \fBFE_INVALID\fP, \fBFE_OVERFLOW\fP, +\fBFE_UNDERFLOW\fP の各マクロは、それぞれ対応する例外の処理を 実装がサポートしている場合に定義される。 +このとき対応するビットをそれぞれ定義することになるので、 例外処理関数の呼び出しを、例えば \fBFE_OVERFLOW\fP|\fBFE_UNDERFLOW\fP +という整数の引き数を用いて行うことができる。 他の例外もサポートされているかもしれない。 \fBFE_ALL_EXCEPT\fP +マクロは、サポートされている例外に対応するビットが全てセットされている (サポートされている例外全ての論理和である)。 .PP -.\"O The -.\"O .BR feclearexcept () -.\"O function clears the supported exceptions represented by the bits -.\"O in its argument. -.BR feclearexcept () -関数は、引き数 -.I excepts -のビット列で指定された例外をクリアする +\fBfeclearexcept\fP() 関数は、引き数 \fIexcepts\fP のビット列で指定された例外をクリアする (処理は実装でサポートされている例外についてのみ行われる)。 .LP -.\"O The -.\"O .BR fegetexceptflag () -.\"O function stores a representation of the state of the exception flags -.\"O represented by the argument -.\"O .I excepts -.\"O in the opaque object -.\"O .IR *flagp . -.BR fegetexceptflag () -関数は、引き数 -.I excepts -で指定された例外フラグの状態を -.I *flagp +\fBfegetexceptflag\fP() 関数は、引き数 \fIexcepts\fP で指定された例外フラグの状態を \fI*flagp\fP が指す内部オブジェクトに保存する。 .LP -.\"O The -.\"O .BR feraiseexcept () -.\"O function raises the supported exceptions represented by the bits in -.\"O .IR excepts . -.BR feraiseexcept () -関数は、 -.I excepts -のビット列で指定された例外のうち、 -実装がサポートしているものを発生させる。 +\fBferaiseexcept\fP() 関数は、 \fIexcepts\fP のビット列で指定された例外のうち、 実装がサポートしているものを発生させる。 .LP -.\"O The -.\"O .BR fesetexceptflag () -.\"O function sets the complete status for the exceptions represented by -.\"O .I excepts -.\"O to the value -.\"O .IR *flagp . -.\"O This value must have been obtained by an earlier call of -.\"O .BR fegetexceptflag () -.\"O with a last argument that contained all bits in -.\"O .IR excepts . -.BR fesetexceptflag () -関数は、 -.I excepts -で指定された例外に対応するフラグの状態を -.I *flagp -の値に設定する。 -.I *flagp -の値は、この関数を呼ぶ前に -.BR fegetexceptflag () -関数を呼び出して取得しておかなければならない -(このとき、 -.BR fegetexceptflag () -の最後の引き数には、 -.BR fesetexceptflag () -に渡す -.I excepts -のすべてのビットを含む値を指定すること)。 +\fBfesetexceptflag\fP() 関数は、 \fIexcepts\fP で指定された例外に対応するフラグの状態を \fI*flagp\fP +の値に設定する。 \fI*flagp\fP の値は、この関数を呼ぶ前に \fBfegetexceptflag\fP() +関数を呼び出して取得しておかなければならない (このとき、 \fBfegetexceptflag\fP() の最後の引き数には、 +\fBfesetexceptflag\fP() に渡す \fIexcepts\fP のすべてのビットを含む値を指定すること)。 .LP -.\"O The -.\"O .BR fetestexcept () -.\"O function returns a word in which the bits are set that were -.\"O set in the argument -.\"O .I excepts -.\"O and for which the corresponding exception is currently set. -.BR fetestexcept () -関数は、 -.I excepts -引き数でセットされているビットのうち、 -現在設定されている例外に対応するビットが 1 になったワードを返す。 -.\"O .SS Rounding mode +\fBfetestexcept\fP() 関数は、 \fIexcepts\fP 引き数でセットされているビットのうち、 現在設定されている例外に対応するビットが +1 になったワードを返す。 .SS 丸めモード -.\"O The rounding mode determines how the result of floating-point operations -.\"O is treated when the result cannot be exactly represented in the significand. -.\"O Various rounding modes may be provided: -.\"O round to nearest (the default), -.\"O round up (toward positive infinity), -.\"O round down (toward negative infinity), and -.\"O round toward zero. -丸めモードは、結果が仮数部だけで正確に表現できない際に、 -浮動小数点操作の結果をどのように扱うかを決めるものである。 -さまざまな丸めモードを提供することができる: -最も近い値に丸める (デフォルト)、 -(正の無限大に向かって) 大きくなる方向に丸める、 -(負の無限大に向かって) 小さくなる方向に丸める、 -0 に向けて丸める、である。 +丸めモードは、結果が仮数部だけで正確に表現できない際に、 浮動小数点操作の結果をどのように扱うかを決めるものである。 +さまざまな丸めモードを提供することができる: 最も近い値に丸める (デフォルト)、 (正の無限大に向かって) 大きくなる方向に丸める、 +(負の無限大に向かって) 小さくなる方向に丸める、 0 に向けて丸める、である。 -.\"O Each of the macros -.\"O .BR FE_TONEAREST , -.\"O .BR FE_UPWARD , -.\"O .BR FE_DOWNWARD , -.\"O and -.\"O .BR FE_TOWARDZERO -.\"O is defined when the implementation supports getting and setting -.\"O the corresponding rounding direction. -.BR FE_TONEAREST , -.BR FE_UPWARD , -.BR FE_DOWNWARD , -.BR FE_TOWARDZERO -の各マクロは、それぞれ対応する丸めの方向を -実装がサポートしている場合に定義される。 +\fBFE_TONEAREST\fP, \fBFE_UPWARD\fP, \fBFE_DOWNWARD\fP, \fBFE_TOWARDZERO\fP +の各マクロは、それぞれ対応する丸めの方向を 実装がサポートしている場合に定義される。 .LP -.\"O The -.\"O .BR fegetround () -.\"O function returns the macro corresponding to the current -.\"O rounding mode. -.BR fegetround () -関数は現在の丸めモードに対応するマクロを返す。 +\fBfegetround\fP() 関数は現在の丸めモードに対応するマクロを返す。 .LP -.\"O The -.\"O .BR fesetround () -.\"O function sets the rounding mode as specified by its argument -.\"O and returns zero when it was successful. -.BR fesetround () -関数は丸めモードを引き数に与えられた値にし、 -成功したらゼロを返す。 +\fBfesetround\fP() 関数は丸めモードを引き数に与えられた値にし、 成功したらゼロを返す。 -.\"O C99 and POSIX.1-2008 specify an identifier, -.\"O .BR FLT_ROUNDS , -.\"O defined in -.\"O .IR , -.\"O which indicates the implementation-defined rounding -.\"O behavior for floating-point addition. -.\"O This identifier has one of the following values: -C99 と POSIX.1-2008 では -.B FLT_ROUNDS -という識別子が規定されており、 -.I -で定義されている。この識別子は -浮動小数点数の加算についての実装定義された丸め動作を表し、 -以下のいずれかの値を持つ。 +C99 と POSIX.1\-2008 では \fBFLT_ROUNDS\fP という識別子が規定されており、 \fI\fP +で定義されている。この識別子は 浮動小数点数の加算についての実装定義された丸め動作を表し、 以下のいずれかの値を持つ。 .IP \-1 -.\"O The rounding mode is not determinable. 丸めモードは決められていない。 .IP 0 -.\"O Rounding is toward 0. 0 に向けて丸める。 .IP 1 -.\"O Rounding is toward nearest number. 最も近い数に丸める。 .IP 2 -.\"O Rounding is toward positive infinity. 正の無限大に向けて丸める。 .IP 3 -.\"O Rounding is toward negative infinity. 負の無限大に向けて丸める。 .PP -.\"O Other values represent machine-dependent, nonstandard rounding modes. 他の値はマシン依存であり、標準的ではない丸めモードである。 .PP -.\"O The value of -.\"O .BR FLT_ROUNDS -.\"O should reflect the current rounding mode as set by -.\"O .BR fesetround () -.\"O (but see BUGS). -.BR FLT_ROUNDS -の値には、 -.BR fesetround () -で設定された現在の丸めモードが反映されるべきである +\fBFLT_ROUNDS\fP の値には、 \fBfesetround\fP() で設定された現在の丸めモードが反映されるべきである (但し、「バグ」の節を参照)。 -.\"O .SS "Floating-point environment" .SS 浮動小数点関連の環境 -.\"O The entire floating-point environment, including -.\"O control modes and status flags, can be handled -.\"O as one opaque object, of type -.\"O .IR fenv_t . -.\"O The default environment is denoted by -.\"O .B FE_DFL_ENV -.\"O (of type -.\"O .IR "const fenv_t *" ). -浮動小数点関連の環境の全体は、 -制御モードや状態フラグも含め、 -.I fenv_t -型の内部オブジェクト一つで取り扱うことができる。 -デフォルトの環境は、 -.RI ( "const fenv_t *" -型の) -.B FE_DFL_ENV -で示されるものである。 -.\"O This is the environment setup at program start and it is defined by -.\"O ISO C to have round to nearest, all exceptions cleared and a nonstop -.\"O (continue on exceptions) mode. -これはプログラムの開始時に構築される環境であり、 -ISO C では、丸めモードを最も近い値への丸め -.RB ( FE_TONEAREST ) -に設定し、すべての例外をクリアし、不停止 (nonstop) -(例外が起きても継続する) モードとするように規定されている。 +浮動小数点関連の環境の全体は、 制御モードや状態フラグも含め、 \fIfenv_t\fP 型の内部オブジェクト一つで取り扱うことができる。 +デフォルトの環境は、 (\fIconst fenv_t *\fP 型の) \fBFE_DFL_ENV\fP で示されるものである。 +これはプログラムの開始時に構築される環境であり、 ISO C では、丸めモードを最も近い値への丸め (\fBFE_TONEAREST\fP) +に設定し、すべての例外をクリアし、不停止 (nonstop) (例外が起きても継続する) モードとするように規定されている。 .LP -.\"O The -.\"O .BR fegetenv () -.\"O function saves the current floating-point environment in the object -.\"O .IR *envp . -.BR fegetenv () -関数は、現在の浮動小数点環境を、オブジェクト -.I *envp -に保存する。 +\fBfegetenv\fP() 関数は、現在の浮動小数点環境を、オブジェクト \fI*envp\fP に保存する。 .LP -.\"O The -.\"O .BR feholdexcept () -.\"O function does the same, then clears all exception flags, -.\"O and sets a nonstop (continue on exceptions) mode, -.\"O if available. -.\"O It returns zero when successful. -.BR feholdexcept () -関数も同じ動作を行い、 -さらに可能であれば、全ての例外フラグをクリアし、 -nonstop (例外時にも実行を継続) モードに設定する。 +\fBfeholdexcept\fP() 関数も同じ動作を行い、 さらに可能であれば、全ての例外フラグをクリアし、 nonstop (例外時にも実行を継続) +モードに設定する。 .LP -.\"O The -.\"O .BR fesetenv () -.\"O function restores the floating-point environment from -.\"O the object -.\"O .IR *envp . -.\"O This object must be known to be valid, for example, the result of a call to -.\"O .BR fegetenv () -.\"O or -.\"O .BR feholdexcept () -.\"O or equal to -.\"O .BR FE_DFL_ENV . -.\"O This call does not raise exceptions. -.BR fesetenv () -関数は、浮動小数点環境を、オブジェクト -.I *envp -から取り出した値に戻す。 -このオブジェクトは、有効であることが事前に分かっていなければならない。 -例えば、 -.BR fegetenv () -や -.BR feholdexcept () -を呼び出した結果であるとか、 -.B FE_DFL_ENV -に等しいとかでなければならない。 -この関数の呼び出しは例外を発生しない。 +\fBfesetenv\fP() 関数は、浮動小数点環境を、オブジェクト \fI*envp\fP から取り出した値に戻す。 +このオブジェクトは、有効であることが事前に分かっていなければならない。 例えば、 \fBfegetenv\fP() や \fBfeholdexcept\fP() +を呼び出した結果であるとか、 \fBFE_DFL_ENV\fP に等しいとかでなければならない。 この関数の呼び出しは例外を発生しない。 .LP -.\"O The -.\"O .BR feupdateenv () -.\"O function installs the floating-point environment represented by -.\"O the object -.\"O .IR *envp , -.\"O except that currently raised exceptions are not cleared. -.\"O After calling this function, the raised exceptions will be a bitwise OR -.\"O of those previously set with those in -.\"O .IR *envp . -.\"O As before, the object -.\"O .I *envp -.\"O must be known to be valid. -.BR feupdateenv () -関数は、オブジェクト -.I *envp -が表現する浮動小数点環境をインストールする。 -ただし、現在発生している例外はクリアされない。 -この関数を呼んだ後に立っている例外は、 -関数を呼ぶ前の値と -.I *envp -の値とのビットごとの OR を取ったものになる。 -上記と同様に、オブジェクト -.I *envp -は、事前に有効であることが分かっていなければならない。 -.\"O .SH "RETURN VALUE" +\fBfeupdateenv\fP() 関数は、オブジェクト \fI*envp\fP が表現する浮動小数点環境をインストールする。 +ただし、現在発生している例外はクリアされない。 この関数を呼んだ後に立っている例外は、 関数を呼ぶ前の値と \fI*envp\fP の値とのビットごとの OR +を取ったものになる。 上記と同様に、オブジェクト \fI*envp\fP は、事前に有効であることが分かっていなければならない。 .SH 返り値 -.\"O These functions return zero on success and nonzero if an error occurred. -.\"O .\" Earlier seven of these functions were listed as returning void. -.\"O .\" This was corrected in Corrigendum 1 (ISO/IEC 9899:1999/Cor.1:2001(E)) -.\"O .\" of the C99 Standard. +.\" Earlier seven of these functions were listed as returning void. +.\" This was corrected in Corrigendum 1 (ISO/IEC 9899:1999/Cor.1:2001(E)) +.\" of the C99 Standard. これらの関数は、成功の場合 0 を返し、エラーが発生すると 0 以外を返す。 -.\" 以前は、これらの関数のうち 7つは void を返すものと書かれていた。 -.\" これは C99 標準の Corrigendum 1 (ISO/IEC 9899:1999/Cor.1:2001(E)) -.\" で修正された。 -.\"O .SH VERSIONS .SH バージョン -.\"O These functions first appeared in glibc in version 2.1. これらの関数は glibc バージョン 2.1 で初めて登場した。 -.\"O .SH "CONFORMING TO" .SH 準拠 -IEC 60559 (IEC 559:1989), ANSI/IEEE 854, C99, POSIX.1-2001. -.\"O .SH NOTES +IEC 60559 (IEC 559:1989), ANSI/IEEE 854, C99, POSIX.1\-2001. .SH 注意 -.\"O .SS Glibc Notes -.SS glibc での注意 -.\"O If possible, the GNU C Library defines a macro -.\"O .B FE_NOMASK_ENV -.\"O which represents an environment where every exception raised causes a -.\"O trap to occur. -.\"O You can test for this macro using -.\"O .BR #ifdef . -.\"O It is only defined if -.\"O .B _GNU_SOURCE -.\"O is defined. -可能な場合には、GNU C Library はマクロ -.B FE_NOMASK_ENV -を定義する。このマクロはすべての例外でトラップが生じるような環境を表す。 -.B #ifdef -を使ってこのマクロをテストできる。これは -.B _GNU_SOURCE -が定義されている場合に限って定義される。 -.\"O The C99 standard does not define a way to set individual bits in the -.\"O floating-point mask, for example, to trap on specific flags. -.\"O Since version 2.2, glibc supports the functions -.\"O .BR feenableexcept () -.\"O and -.\"O .BR fedisableexcept () -.\"O to set individual floating-point traps, and -.\"O .BR fegetexcept () -.\"O to query the state. -C99 標準は浮動小数点マスク (例えば特定のフラグでのトラップなど) -の各ビットの設定方法については定義していない。 -バージョン 2.2 以降の glibc は、 -.BR feenableexcept () -関数と -.BR fedisableexcept () -関数をサポートしており、 -各々の浮動小数点トラップを設定できるようになっている。 -また -.BR fegetexcept () -によって状態の問い合わせもできるようになっている。 +.SS "glibc での注意" +可能な場合には、GNU C Library はマクロ \fBFE_NOMASK_ENV\fP +を定義する。このマクロはすべての例外でトラップが生じるような環境を表す。 \fB#ifdef\fP を使ってこのマクロをテストできる。これは +\fB_GNU_SOURCE\fP が定義されている場合に限って定義される。 C99 標準は浮動小数点マスク (例えば特定のフラグでのトラップなど) +の各ビットの設定方法については定義していない。 バージョン 2.2 以降の glibc は、 \fBfeenableexcept\fP() 関数と +\fBfedisableexcept\fP() 関数をサポートしており、 各々の浮動小数点トラップを設定できるようになっている。 また +\fBfegetexcept\fP() によって状態の問い合わせもできるようになっている。 .sp .nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" -.B "#define _GNU_SOURCE" +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ .br -.B "#include " +\fB#include \fP .sp -.BI "int feenableexcept(int " excepts ); +\fBint feenableexcept(int \fP\fIexcepts\fP\fB);\fP .br -.BI "int fedisableexcept(int " excepts ); +\fBint fedisableexcept(int \fP\fIexcepts\fP\fB);\fP .br -.B "int fegetexcept(void);" +\fBint fegetexcept(void);\fP .br .fi .LP -.\"O The -.\"O .BR feenableexcept () -.\"O and -.\"O .BR fedisableexcept () -.\"O functions enable (disable) traps for each of the exceptions represented by -.\"O .I excepts -.\"O and return the previous set of enabled exceptions when successful, -.\"O and \-1 otherwise. -.\"O The -.\"O .BR fegetexcept () -.\"O function returns the set of all currently enabled exceptions. -.BR feenableexcept () -関数と -.BR fedisableexcept () -関数は -.I excepts -によって表現される各例外のトラップを有効 (無効) にする。 -成功した場合は直前に有効になっていた例外のセットを返す。 -失敗した場合は \-1 を返す。 -.BR fegetexcept () -関数は現在有効になっている例外全てからなるセットを返す。 -.\"O .SH BUGS +\fBfeenableexcept\fP() 関数と \fBfedisableexcept\fP() 関数は \fIexcepts\fP +によって表現される各例外のトラップを有効 (無効) にする。 成功した場合は直前に有効になっていた例外のセットを返す。 失敗した場合は \-1 を返す。 +\fBfegetexcept\fP() 関数は現在有効になっている例外全てからなるセットを返す。 .SH バグ -.\"O C99 specifies that the value of -.\"O .B FLT_ROUNDS -.\"O should reflect changes to the current rounding mode, as set by -.\"O .BR fesetround (). -C99 の規定では、 -.BR FLT_ROUNDS -の値には -.BR fesetround () -で設定された現在の丸めモードが反映されるべきであるとされている。 -.\"O Currently, -現在のところ、 .\" Aug 08, glibc 2.8 -.\"O this does not occur: -.\"O .B FLT_ROUNDS -.\"O always has the value 1. -このようになっておらず、 -.B FLT_ROUNDS -は常に値 1 となる。 .\" See http://gcc.gnu.org/ml/gcc/2002-02/msg01535.html -.\"O .SH "SEE ALSO" +C99 の規定では、 \fBFLT_ROUNDS\fP の値には \fBfesetround\fP() +で設定された現在の丸めモードが反映されるべきであるとされている。 現在のところ、 このようになっておらず、 \fBFLT_ROUNDS\fP は常に値 1 +となる。 .SH 関連項目 -.BR math_error (7) +\fBmath_error\fP(7) diff --git a/draft/man3/fexecve.3 b/draft/man3/fexecve.3 index 7d871f64..95b84b65 100644 --- a/draft/man3/fexecve.3 +++ b/draft/man3/fexecve.3 @@ -22,146 +22,61 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved. -.\" Translated 2006-07-31, Akihiro MOTOKI -.\" Updated 2009-02-23, Akihiro MOTOKI , LDP v3.18 +.\"******************************************************************* .\" -.TH FEXECVE 3 2010-09-15 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH FEXECVE 3 2010\-09\-15 Linux "Linux Programmer's Manual" .SH 名前 -.\"O fexecve \- execute program specified via file descriptor fexecve \- ファイルディスクリプタで指定されたプログラムを実行する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int fexecve(int " fd ", char *const " argv "[], char *const " envp []); +\fBint fexecve(int \fP\fIfd\fP\fB, char *const \fP\fIargv\fP\fB[], char *const \fP\fIenvp\fP\fB[]);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR fexecve (): +\fBfexecve\fP(): .PD 0 .ad l .RS 4 -.TP 4 -.\"O Since glibc 2.10: +.TP 4 glibc 2.10 以降: _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L -.TP -.\"O Before glibc 2.10: +.TP glibc 2.10 より前: _GNU_SOURCE .RE .ad .PD -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR fexecve () -.\"O performs the same task as -.\"O .BR execve (2), -.\"O with the difference that the file to be executed -.\"O is specified via a file descriptor, -.\"O .IR fd , -.\"O rather than via a pathname. -.BR fexecve () -は -.BR execve (2) -と同じ作業を行う。違うのは、 -実行するファイルを、パス名ではなく、 -ファイルディスクリプタ -.I fd -を用いて指定する点である。 -.\"O The file descriptor -.\"O .I fd -.\"O must be opened read-only, -.\"O and the caller must have permission to execute the file that it refers to. -ファイルディスクリプタ -.I fd -は、読み込み専用でオープンされていなければならず、 -呼び出し元はファイルディスクリプタが参照するファイルに対する -実行許可を持っていなければならない。 .\" POSIX.1-2008 specifies the O_EXEC flag for open as an alternative, .\" but Linux doesn't support this flag yet. -.\"O .SH "RETURN VALUE" +\fBfexecve\fP() は \fBexecve\fP(2) と同じ作業を行う。違うのは、 実行するファイルを、パス名ではなく、 ファイルディスクリプタ +\fIfd\fP を用いて指定する点である。 ファイルディスクリプタ \fIfd\fP は、読み込み専用でオープンされていなければならず、 +呼び出し元はファイルディスクリプタが参照するファイルに対する 実行許可を持っていなければならない。 .SH 返り値 -.\"O A successful call to -.\"O .BR fexecve () -.\"O never returns. -.\"O On error, the function returns, with a result value of \-1, and -.\"O .I errno -.\"O is set appropriately. -.BR fexecve () -は呼び出しに成功した場合、戻ることはない。 -エラーの場合、返り値として \-1 が返され、 -.I errno +\fBfexecve\fP() は呼び出しに成功した場合、戻ることはない。 エラーの場合、返り値として \-1 が返され、 \fIerrno\fP が適切に設定される。 -.\"O .SH ERRORS .SH エラー -.\"O Errors are as for -.\"O .BR execve (2), -.\"O with the following additions: -エラーは -.BR execve (2) -と同じだが、以下のエラーが追加になっている: -.TP -.B EINVAL -.\"O .I fd -.\"O is not a valid file descriptor, or -.\"O .I argv -.\"O is NULL, or -.\"O .I envp -.\"O is NULL. -.I fd -が有効なファイルディスクリプタでない。または -.I argv -が NULL である。または -.I envp -が NULL である。 -.TP -.B ENOSYS -.\"O The -.\"O .I /proc -.\"O file system could not be accessed. -.I /proc -ファイルシステムにアクセスできなかった。 -.\"O .SH VERSIONS +エラーは \fBexecve\fP(2) と同じだが、以下のエラーが追加になっている: +.TP +\fBEINVAL\fP +\fIfd\fP が有効なファイルディスクリプタでない。または \fIargv\fP が NULL である。または \fIenvp\fP が NULL である。 +.TP +\fBENOSYS\fP +\fI/proc\fP ファイルシステムにアクセスできなかった。 .SH バージョン -.\"O .BR fexecve () -.\"O is implemented since glibc 2.3.2. -.BR fexecve () -は glibc 2.3.2 以降で実装されている。 -.\"O .SH "CONFORMING TO" +\fBfexecve\fP() は glibc 2.3.2 以降で実装されている。 .SH 準拠 -POSIX.1-2008. -.\"O This function is not specified in POSIX.1-2001, -.\"O and is not widely available on other systems. -この関数は POSIX.1-2001 では規定されておらず、 -他のシステムで広く利用できるわけではない。 -.\"O .SH NOTES +POSIX.1\-2008. この関数は POSIX.1\-2001 では規定されておらず、 他のシステムで広く利用できるわけではない。 .SH 注意 -.\"O On Linux, -.\"O .BR fexecve () -.\"O is implemented using the -.\"O .BR proc (5) -.\"O file system, so -.\"O .I /proc -.\"O needs to be mounted and available at the time of the call. -Linux では、 -.BR fexecve () -は -.BR proc (5) -ファイルシステムを使って実装されている。 -そのため、この関数を呼び出す時点では -.I /proc -がマウントされて利用可能となっている必要がある。 -.\"O .SH "SEE ALSO" +Linux では、 \fBfexecve\fP() は \fBproc\fP(5) ファイルシステムを使って実装されている。 +そのため、この関数を呼び出す時点では \fI/proc\fP がマウントされて利用可能となっている必要がある。 .SH 関連項目 -.BR execve (2) +\fBexecve\fP(2) diff --git a/draft/man3/ffs.3 b/draft/man3/ffs.3 index 1936ae95..e8acf5c5 100644 --- a/draft/man3/ffs.3 +++ b/draft/man3/ffs.3 @@ -28,112 +28,61 @@ .\" .\" Modified 2003 Walter Harms (walter.harms@informatik.uni-oldenburg.de) .\" +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka -.\" all rights reserved. -.\" Translated Thu Dec 18 16:26:22 JST 1997 -.\" by HIROFUMI Nishizuka -.\" Updated Wed Jan 9 JST 2002 by Kentaro Shirakata -.\" Updated Mon Sep 1 JST 2003 by Kentaro Shirakata +.\" This file was generated with po4a. Translate the source file. .\" -.TH FFS 3 2010-09-20 "GNU" "Linux Programmer's Manual" +.\"******************************************************************* +.TH FFS 3 2010\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 -.\"O ffs, ffsl, ffsll \- find first bit set in a word ffs, ffsl, ffsll \- ワードの中で最初にセットされているビットの検出 .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int ffs(int " i ); +\fBint ffs(int \fP\fIi\fP\fB);\fP .sp -.B #include +\fB#include \fP .sp -.BI "int ffsl(long int " i ); +\fBint ffsl(long int \fP\fIi\fP\fB);\fP .sp -.BI "int ffsll(long long int " i ); +\fBint ffsll(long long int \fP\fIi\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .PD 0 .ad l .sp -.BR ffs (): +\fBffs\fP(): .RS 4 -.TP 4 -.\"O Since glibc 2.10: +.TP 4 glibc 2.10 以降: -_SVID_SOURCE || _BSD_SOURCE || -_POSIX_C_SOURCE\ >=\ 200809L || _XOPEN_SOURCE\ >=\ 700 || -.TP -.\"O Before glibc 2.10: +_SVID_SOURCE || _BSD_SOURCE || _POSIX_C_SOURCE\ >=\ 200809L || +_XOPEN_SOURCE\ >=\ 700 || +.TP glibc 2.10 より前: none .RE .PP -.BR ffsl (), -.BR ffsll (): +\fBffsl\fP(), \fBffsll\fP(): .RS 4 _GNU_SOURCE .RE .ad .PD .SH 説明 -.\"O The -.\"O .BR ffs () -.\"O function returns the position of the first -.\"O (least significant) bit set in the word \fIi\fP. -.\"O The least significant bit is position 1 and the -.\"O most significant position is, for example, 32 or 64. -.BR ffs () -関数は、ワード \fIi\fP の中で最初にセットされている -(最下位)ビットの位置を返す。 -最下位ビットの位置は 1、最上位ビットの位置は例えば 32 や 64 である。 -.\"O The functions -.\"O .BR ffsll () -.\"O and -.\"O .BR ffsl () -.\"O do the same but take -.\"O arguments of possibly different size. -.BR ffsll () -関数と -.BR ffsl () -関数も同様だが、 +\fBffs\fP() 関数は、ワード \fIi\fP の中で最初にセットされている (最下位)ビットの位置を返す。 最下位ビットの位置は +1、最上位ビットの位置は例えば 32 や 64 である。 \fBffsll\fP() 関数と \fBffsl\fP() 関数も同様だが、 異なったサイズの引数をとる。 .SH 返り値 -.\"O These functions return the position of the first bit set, -.\"O or 0 if no bits are set in -.\"O .IR i . -これらの関数は、最初にセットされているビットの位置を返し、 -.I i -のどのビットもセットされていなければ 0 を返す。 -.\"O .SH "CONFORMING TO" +これらの関数は、最初にセットされているビットの位置を返し、 \fIi\fP のどのビットもセットされていなければ 0 を返す。 .SH 準拠 -.BR ffs (): -4.3BSD, POSIX.1-2001. +\fBffs\fP(): 4.3BSD, POSIX.1\-2001. -.\"O The -.\"O .BR ffsl () -.\"O and -.\"O .BR ffsll () -.\"O functions are glibc extensions. -関数 -.BR ffsl () -と -.BR ffsll () -は glibc による拡張である。 -.\"O .SH NOTES +関数 \fBffsl\fP() と \fBffsll\fP() は glibc による拡張である。 .SH 注意 -.\"O BSD systems have a prototype in -.\"O .IR . -BSD システムでは -.I -にプロトタイプがある。 -.\"O .SH "SEE ALSO" +BSD システムでは \fI\fP にプロトタイプがある。 .SH 関連項目 -.BR memchr (3) +\fBmemchr\fP(3) diff --git a/draft/man3/finite.3 b/draft/man3/finite.3 index 18bfa2c2..062a7b4c 100644 --- a/draft/man3/finite.3 +++ b/draft/man3/finite.3 @@ -20,152 +20,86 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2005-02-21, Akihiro MOTOKI -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.\"WORD: classification 分類 -.\"WORD: infinite 無限大 -.\"WORD: not-a-number 無効値 -.\"WORD: NaN 無効値 +.\" This file was generated with po4a. Translate the source file. .\" -.TH FINITE 3 2008-08-05 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH FINITE 3 2008\-08\-05 "" "Linux Programmer's Manual" .SH 名前 -.\"O finite, finitef, finitel, isinf, isinff, isinfl, isnan, isnanf, isnanl \- -.\"O BSD floating-point classification functions -finite, finitef, finitel, isinf, isinff, isinfl, isnan, isnanf, isnanl \- -BSD の浮動小数点分類関数 -.\"O .SH SYNOPSIS +finite, finitef, finitel, isinf, isinff, isinfl, isnan, isnanf, isnanl \- BSD +の浮動小数点分類関数 .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int finite(double " x ); +\fBint finite(double \fP\fIx\fP\fB);\fP .br -.BI "int finitef(float " x ); +\fBint finitef(float \fP\fIx\fP\fB);\fP .br -.BI "int finitel(long double " x ); +\fBint finitel(long double \fP\fIx\fP\fB);\fP .sp -.BI "int isinf(double " x ); +\fBint isinf(double \fP\fIx\fP\fB);\fP .br -.BI "int isinff(float " x ); +\fBint isinff(float \fP\fIx\fP\fB);\fP .br -.BI "int isinfl(long double " x ); +\fBint isinfl(long double \fP\fIx\fP\fB);\fP .sp -.BI "int isnan(double " x ); +\fBint isnan(double \fP\fIx\fP\fB);\fP .br -.BI "int isnanf(float " x ); +\fBint isnanf(float \fP\fIx\fP\fB);\fP .br -.BI "int isnanl(long double " x ); +\fBint isnanl(long double \fP\fIx\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR finite (), -.BR finitef (), -.BR finitel (): +\fBfinite\fP(), \fBfinitef\fP(), \fBfinitel\fP(): .RS 4 _BSD_SOURCE || _SVID_SOURCE .RE -.BR isinf (): +\fBisinf\fP(): .RS 4 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .br -.BR isinff (), -.BR isinfl (): +\fBisinff\fP(), \fBisinfl\fP(): .RS 4 _BSD_SOURCE || _SVID_SOURCE .RE -.BR isnan (): +\fBisnan\fP(): .RS 4 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE -.BR isnanf (), -.BR isnanl (): +\fBisnanf\fP(), \fBisnanl\fP(): .RS 4 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR finite () -.\"O functions return a nonzero value if \fIx\fP is neither infinite -.\"O nor a "not-a-number" (NaN) value, and 0 otherwise. -.BR finite () -関数は、 \fIx\fP が無限大や無効値 (NaN) のいずれでもない -場合に 0 以外の値を返し、それ以外の場合は 0 を返す。 +\fBfinite\fP() 関数は、 \fIx\fP が無限大や無効値 (NaN) のいずれでもない 場合に 0 以外の値を返し、それ以外の場合は 0 を返す。 -.\"O The -.\"O .BR isnan () -.\"O functions return a nonzero value if \fIx\fP is a NaN value, -.\"O and 0 otherwise. -.BR isnan () -関数は、 \fIx\fP が NaN の場合 0 以外の値を返し、 -それ以外の場合は 0 を返す。 +\fBisnan\fP() 関数は、 \fIx\fP が NaN の場合 0 以外の値を返し、 それ以外の場合は 0 を返す。 -.\"O The -.\"O .BR isinf () -.\"O functions return 1 if \fIx\fP is positive infinity, \-1 if \fIx\fP -.\"O is negative infinity, and 0 otherwise. -.BR isinf () -関数は、 \fIx\fP が正の無限大であれば 1 を返し、\fIx\fP が負の無限大で -あれば \-1 を返す。それ以外の場合は 0 を返す。 -.\"O .SH NOTES +\fBisinf\fP() 関数は、 \fIx\fP が正の無限大であれば 1 を返し、\fIx\fP が負の無限大で あれば \-1 を返す。それ以外の場合は 0 +を返す。 .SH 注意 -.\"O Note that these functions are obsolete. -.\"O C99 defines macros -.\"O .BR isfinite (), -.\"O .BR isinf (), -.\"O and -.\"O .BR isnan () -.\"O (for all types) replacing them. -.\"O Further note that the C99 -.\"O .BR isinf () -.\"O has weaker guarantees on the return value. -.\"O See -.\"O .BR fpclassify (3). -.\"O .\" -.\"O .\" finite* not on HP-UX; they exist on Tru64. -これらの関数は廃止された点に注意すること。 -C99 では、これらの置き換えとして (どんな型にも適用できる) -.BR isfinite (), -.BR isinf (), -.BR isnan () -というマクロが定義されている。 -さらに C99 の -.BR isinf () -は返り値に関して弱い意味での保証しかないことにも -注意すること。詳細は -.BR fpclassify (3) -を参照。 .\" .\" finite* not on HP-UX; they exist on Tru64. -.\"O .\" .SH HISTORY -.\" .SH 歴史 -.\"O .\" The -.\"O .\" .BR finite () -.\"O .\" function occurs in 4.3BSD. -.\"O .\" see IEEE.3 in the 4.3BSD manual +.\" .SH HISTORY +.\" The .\" .BR finite () -.\" 関数は 4.3BSD で登場した。 -.\" 4.3BSD のマニュアルの IEEE.3 を参照 -.\"O .SH "SEE ALSO" +.\" function occurs in 4.3BSD. +.\" see IEEE.3 in the 4.3BSD manual +これらの関数は廃止された点に注意すること。 C99 では、これらの置き換えとして (どんな型にも適用できる) \fBisfinite\fP(), +\fBisinf\fP(), \fBisnan\fP() というマクロが定義されている。 さらに C99 の \fBisinf\fP() +は返り値に関して弱い意味での保証しかないことにも 注意すること。詳細は \fBfpclassify\fP(3) を参照。 .SH 関連項目 -.BR fpclassify (3) +\fBfpclassify\fP(3) diff --git a/draft/man3/floor.3 b/draft/man3/floor.3 index 871d137e..9835d293 100644 --- a/draft/man3/floor.3 +++ b/draft/man3/floor.3 @@ -22,140 +22,59 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi -.\" and Copyright (c) 2008 Akihiro MOTOKI -.\" Translated Mon Jan 20 18:35:18 JST 1997 -.\" by YOSHINO Takashi -.\" Updated & Modified Fri Jul 6 20:37:36 JST 2001 -.\" by Yuichi SATO -.\" Updated & Modified Mon Jan 10 08:45:45 JST 2005 -.\" by Yuichi SATO -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.\"WORD: mantissa 仮数 +.\" This file was generated with po4a. Translate the source file. .\" -.TH FLOOR 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH FLOOR 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O floor, floorf, floorl \- largest integral value not greater than argument floor, floorf, floorl \- 引き数を越えない最大の整数値 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double floor(double " x ); +\fBdouble floor(double \fP\fIx\fP\fB);\fP .br -.BI "float floorf(float " x ); +\fBfloat floorf(float \fP\fIx\fP\fB);\fP .br -.BI "long double floorl(long double " x ); +\fBlong double floorl(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR floorf (), -.BR floorl (): +\fBfloorf\fP(), \fBfloorl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O These functions return the largest integral value that is not greater than -.\"O .IR x . -これらの関数は -.I x -より大きくない最大の整数値を返す。 +これらの関数は \fIx\fP より大きくない最大の整数値を返す。 -.\"O For example, -.\"O .IR floor(0.5) -.\"O is 0.0, and -.\"O .IR floor(\-0.5) -.\"O is \-1.0. -例えば、 -.I floor(0.5) -は 0.0 で、 -.I floor(\-0.5) -は \-1.0 である。 -.\"O .SH "RETURN VALUE" +例えば、 \fIfloor(0.5)\fP は 0.0 で、 \fIfloor(\-0.5)\fP は \-1.0 である。 .SH 返り値 -.\"O These functions return the floor of -.\"O .IR x . -これらの関数は -.I x -を越えない最小の整数値を返す。 +これらの関数は \fIx\fP を越えない最小の整数値を返す。 -.\"O If \fIx\fP is integral, +0, \-0, NaN, or an infinity, -.\"O \fIx\fP itself is returned. -\fIx\fP が整数、+0、\-0、NaN、無限大のいずれかの場合、 -\fIx\fP そのものが返される。 -.\"O .SH ERRORS +\fIx\fP が整数、+0、\-0、NaN、無限大のいずれかの場合、 \fIx\fP そのものが返される。 .SH エラー -.\"O No errors occur. -エラーは発生しない。 -.\"O POSIX.1-2001 documents a range error for overflows, but see NOTES. -POSIX.1-2001 にはオーバーフローに対して範囲エラーが記載されている。 -「注意」の節を参照。 -.\"O .SH "CONFORMING TO" +エラーは発生しない。 POSIX.1\-2001 にはオーバーフローでの範囲エラー (range error) の 記載がある。「注意」の節を参照のこと。 .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 -.\"O .SH NOTES +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH 注意 -.\"O SUSv2 and POSIX.1-2001 contain text about overflow (which might set -.\"O .I errno -.\"O to -.\"O .BR ERANGE , -.\"O or raise an -.\"O .B FE_OVERFLOW -.\"O exception). -SUSv2 と POSIX.1-2001 にはオーバーフローに関する記述があり、 -オーバーフローの場合には、 -.I errno -を -.B ERANGE -に設定するか、 -.B FE_OVERFLOW -例外を発生することとされている。 -.\"O In practice, the result cannot overflow on any current machine, -.\"O so this error-handling stuff is just nonsense. -実際のところ、現行のマシンでは結果がオーバーフローを起こすことはないので、 -このエラー処理は意味がない。 .\" The POSIX.1-2001 APPLICATION USAGE SECTION discusses this point. -.\"O (More precisely, overflow can happen only when the maximum value -.\"O of the exponent is smaller than the number of mantissa bits. -.\"O For the IEEE-754 standard 32-bit and 64-bit floating-point numbers -.\"O the maximum value of the exponent is 128 (respectively, 1024), -.\"O and the number of mantissa bits is 24 (respectively, 53).) -(より正確に言うと、オーバーフローは指数部の最大値が -仮数部を表すビットの数より小さい場合にしか起こらない。 -IEEE-754 規格の 32 ビットと 64 ビットの浮動小数では、 -指数部の最大値はそれぞれ 128 と 1024 であり、 -仮数部のビット数はそれぞれ 24 と 53 である。) -.\"O .SH "SEE ALSO" +SUSv2 と POSIX.1\-2001 にはオーバーフローに関する記述があり、 オーバーフローの場合には、 \fIerrno\fP を \fBERANGE\fP +に設定するか、 \fBFE_OVERFLOW\fP 例外を発生することとされている。 +実際のところ、どの現行のマシンでも結果がオーバーフローを起こすことはないので、 このエラー処理は意味がない。 +(より正確に言うと、オーバーフローは指数部の最大値が 仮数部を表すビットの数より小さい場合にしか起こらない。 IEEE\-754 規格の 32 ビットと +64 ビットの浮動小数では、 指数部の最大値はそれぞれ 128 と 1024 であり、 仮数部のビット数はそれぞれ 24 と 53 である。) .SH 関連項目 -.BR ceil (3), -.BR lrint (3), -.BR nearbyint (3), -.BR rint (3), -.BR round (3), -.BR trunc (3) +\fBceil\fP(3), \fBlrint\fP(3), \fBnearbyint\fP(3), \fBrint\fP(3), \fBround\fP(3), +\fBtrunc\fP(3) diff --git a/draft/man3/fma.3 b/draft/man3/fma.3 index 1b7d53ed..2983e66a 100644 --- a/draft/man3/fma.3 +++ b/draft/man3/fma.3 @@ -5,236 +5,95 @@ .\" Modified 2004-11-15, Added further text on FLT_ROUNDS .\" as suggested by AEB and Fabian Kreutz .\" -.\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO -.\" and Copyright (c) 2008 Akihiro MOTOKI -.\" Translated Sat Jul 24 10:37:53 JST 2004 -.\" by Yuichi SATO -.\" Updated & Modified Mon Jan 10 09:11:49 JST 2005 by Yuichi SATO -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH FMA 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH FMA 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O fma, fmaf, fmal \- floating-point multiply and add fma, fmaf, fmal \- 浮動小数点数の積と和を計算する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double fma(double " x ", double " y ", double " z ); +\fBdouble fma(double \fP\fIx\fP\fB, double \fP\fIy\fP\fB, double \fP\fIz\fP\fB);\fP .br -.BI "float fmaf(float " x ", float " y ", float " z ); +\fBfloat fmaf(float \fP\fIx\fP\fB, float \fP\fIy\fP\fB, float \fP\fIz\fP\fB);\fP .br -.BI "long double fmal(long double " x ", long double " y ", long double " z ); +\fBlong double fmal(long double \fP\fIx\fP\fB, long double \fP\fIy\fP\fB, long double \fP\fIz\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR fma (), -.BR fmaf (), -.BR fmal (): +\fBfma\fP(), \fBfmaf\fP(), \fBfmal\fP(): .RS 4 -_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR fma () -.\"O function computes -.\"O .IR x " * " y " + " z . -.BR fma () -関数は -.IR x " * " y " + " z -を計算する。 -.\"O The result is rounded as one ternary operation according to the -.\"O current rounding mode (see -.\"O .BR fenv (3)). -結果は、一つの三項演算として現在の丸めモードにしたがって丸められる -.RB ( fenv (3) -参照)。 -.\"O .SH RETURN VALUE +\fBfma\fP() 関数は \fIx\fP * \fIy\fP + \fIz\fP を計算する。 結果は、一つの三項演算として現在の丸めモードにしたがって丸められる +(\fBfenv\fP(3) 参照)。 .SH 返り値 -.\"O These functions return the value of -.\"O .IR x " * " y " + " z , -.\"O rounded as one ternary operation. -これらの関数は -.IR x " * " y " + " z -の、一つの三項演算として丸められた値を返す。 +これらの関数は \fIx\fP * \fIy\fP + \fIz\fP の、一つの三項演算として丸められた値を返す。 -.\"O If -.\"O .I x -.\"O or -.\"O .I y -.\"O is a NaN, a NaN is returned. -.I x -か -.I y -が NaN の場合、NaN が返される。 +\fIx\fP か \fIy\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O times -.\"O .I y -.\"O is an exact infinity, and -.\"O .I z -.\"O is an infinity with the opposite sign, -.\"O a domain error occurs, -.\"O and a NaN is returned. -.I y -の -.I x -倍がちょうど無限大で、 -.I z -がそれとは反対の符号の無限大の場合、 -領域エラー (domain error) が発生し、NaN が返される。 +\fIy\fP の \fIx\fP 倍がちょうど無限大で、 \fIz\fP がそれとは反対の符号の無限大の場合、 領域エラー (domain error) +が発生し、NaN が返される。 .\" POSIX.1-2008 allows some possible differences for the following two .\" domain error cases, but on Linux they are treated the same (AFAICS). .\" Nevertheless, we'll mirror POSIX.1 and describe the two cases .\" separately. -.\"O If one of -.\"O .I x -.\"O or -.\"O .I y -.\"O is an infinity, the other is 0, and -.\"O .I z -.\"O is not a NaN, -.\"O a domain error occurs, and -.\"O a NaN is returned. -.I x -と -.I y -のうち一方が無限大で、もう一方が 0 で、 -.I z -が NaN でない場合、領域エラーが発生し、NaN が返される。 .\" POSIX.1 says that a NaN or an implementation-defined value shall .\" be returned for this case. +\fIx\fP と \fIy\fP のうち一方が無限大で、もう一方が 0 で、 \fIz\fP が NaN でない場合、領域エラーが発生し、NaN が返される。 -.\"O If one of -.\"O .I x -.\"O or -.\"O .I y -.\"O is an infinity, and the other is 0, and -.\"O .I z -.\"O is a NaN, .\" POSIX.1 makes the domain error optional for this case. -.\"O a domain error occurs, and -.\"O a NaN is returned. -.I x -と -.I y -のうち一方が無限大で、もう一方が 0 で、 -.I z -が NaN の場合、領域エラーが発生し、NaN が返される。 +\fIx\fP と \fIy\fP のうち一方が無限大で、もう一方が 0 で、 \fIz\fP が NaN の場合、領域エラーが発生し、NaN が返される。 -.\"O If -.\"O .I x -.\"O times -.\"O .I y -.\"O is not an infinity times zero (or vice versa), and -.\"O .I z -.\"O is a NaN, -.\"O a NaN is returned. -.I y -の -.I x -倍が 0 の無限大倍 (もしくはその逆) ではなく、 -.I z -が NaN の場合、NaN が返される。 +\fIy\fP の \fIx\fP 倍が 0 の無限大倍 (もしくはその逆) ではなく、 \fIz\fP が NaN の場合、NaN が返される。 -.\"O If the result overflows, -.\"O a range error occurs, and -.\"O an infinity with the correct sign is returned. -結果がオーバーフローする場合、範囲エラー (range error) が発生し、 -正しい符号の無限大が返される。 +結果がオーバーフローする場合、範囲エラー (range error) が発生し、 正しい符号の無限大が返される。 -.\"O If the result underflows, -.\"O a range error occurs, and -.\"O a signed 0 is returned. -結果がアンダーフローする場合、 -範囲エラーが発生し、符号付きの 0 が返される。 -.\"O .SH ERRORS +結果がアンダーフローする場合、 範囲エラーが発生し、符号付きの 0 が返される。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Domain error: \fIx\fP * \fIy\fP + \fIz\fP, \ -.\"O or \fIx\fP * \fIy\fP is invalid and \fIz\fP is not a NaN -領域エラー: \fIx\fP * \fIy\fP + \fIz\fP か \ -\fIx\fP * \fIy\fP が無効で、\fIz\fP が NaN ではない +.TP +領域エラー: \fIx\fP * \fIy\fP + \fIz\fP か \fIx\fP * \fIy\fP が無効で、\fIz\fP が NaN ではない .\" .I errno .\" is set to .\" .BR EDOM . -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -不正 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) -が上がる。 -.TP -.\"O Range error: result overflow -範囲エラー: 結果のオーバーフロー +不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 +.TP +範囲エラー (range error): 結果のオーバーフロー .\" .I errno .\" is set to .\" .BR ERANGE . -.\"O An overflow floating-point exception -.\"O .RB ( FE_OVERFLOW ) -.\"O is raised. -オーバーフロー浮動小数点例外 -.RB ( FE_OVERFLOW ) -が上がる。 -.TP -.\"O Range error: result underflow -範囲エラー: 結果のアンダーフロー +オーバーフロー浮動小数点例外 (\fBFE_OVERFLOW\fP) が上がる。 +.TP +範囲エラー (range error): 結果のアンダーフロー .\" .I errno .\" is set to .\" .BR ERANGE . -.\"O An underflow floating-point exception -.\"O .RB ( FE_UNDERFLOW ) -.\"O is raised. -アンダーフロー浮動小数点例外 -.RB ( FE_UNDERFLOW ) -が上がる。 +アンダーフロー浮動小数点例外 (\fBFE_UNDERFLOW\fP) が上がる。 .PP -.\"O These functions do not set -.\"O .IR errno . -これらの関数は -.I errno -を設定しない。 .\" FIXME . Is it intentional that these functions do not set errno? .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6801 -.\"O .SH VERSIONS +これらの関数は \fIerrno\fP を設定しない。 .SH バージョン -.\"O These functions first appeared in glibc in version 2.1. これらの関数は glibc バージョン 2.1 で初めて登場した。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. .SH 関連項目 -.BR remainder (3), -.BR remquo (3) +\fBremainder\fP(3), \fBremquo\fP(3) diff --git a/draft/man3/fmax.3 b/draft/man3/fmax.3 index 2fddad1c..83571e22 100644 --- a/draft/man3/fmax.3 +++ b/draft/man3/fmax.3 @@ -3,90 +3,50 @@ .\" .\" Distributed under GPL .\" -.\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO -.\" all rights reserved. -.\" Translated Sat Jul 24 10:45:05 JST 2004 -.\" by Yuichi SATO -.\" Updated & Modified Mon Jan 10 10:11:00 JST 2005 by Yuichi SATO -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH FMAX 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH FMAX 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O fmax, fmaxf, fmaxl \- determine maximum of two floating-point numbers fmax, fmaxf, fmaxl \- 二つの浮動小数点数の最大値を求める -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "double fmax(double " x ", double " y ); +\fBdouble fmax(double \fP\fIx\fP\fB, double \fP\fIy\fP\fB);\fP .br -.BI "float fmaxf(float " x ", float " y ); +\fBfloat fmaxf(float \fP\fIx\fP\fB, float \fP\fIy\fP\fB);\fP .br -.BI "long double fmaxl(long double " x ", long double " y ); +\fBlong double fmaxl(long double \fP\fIx\fP\fB, long double \fP\fIy\fP\fB);\fP .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR fmax (), -.BR fmaxf (), -.BR fmaxl (): +\fBfmax\fP(), \fBfmaxf\fP(), \fBfmaxl\fP(): .RS 4 -_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O These functions return the larger value of -.\"O .I x -.\"O and -.\"O .IR y . -これらの関数は -.I x -と -.I y -のうち大きい方の値を返す。 -.\"O .SH RETURN VALUE +これらの関数は \fIx\fP と \fIy\fP のうち大きい方の値を返す。 .SH 返り値 -.\"O These functions return the maximum of -.\"O .I x -.\"O and -.\"O .IR y . -これらの関数は -.I x -と -.I y -の最大値を返す。 +これらの関数は \fIx\fP と \fIy\fP の最大値を返す。 -.\"O If one argument is a NaN, the other argument is returned. 一方の引き数が NaN の場合、もう一方の値が返される。 -.\"O If both arguments are NaN, a NaN is returned. 両方の引き数が NaN の場合、NaN が返される。 -.\"O .SH ERRORS .SH エラー -.\"O No errors occur. エラーは発生しない。 -.\"O .SH VERSIONS .SH バージョン -.\"O These functions first appeared in glibc in version 2.1. これらの関数は glibc バージョン 2.1 で初めて登場した。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. .SH 関連項目 -.BR fmin (3) +\fBfmin\fP(3) diff --git a/draft/man3/fmin.3 b/draft/man3/fmin.3 index b020f5ad..ee3b8a5c 100644 --- a/draft/man3/fmin.3 +++ b/draft/man3/fmin.3 @@ -3,90 +3,50 @@ .\" .\" Distributed under GPL .\" -.\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO -.\" all rights reserved. -.\" Translated Sat Jul 24 11:09:37 JST 2004 -.\" by Yuichi SATO -.\" Updated & Modified Mon Jan 10 10:11:00 JST 2005 by Yuichi SATO -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH FMIN 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH FMIN 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O fmin, fminf, fminl \- determine minimum of two floating-point numbers fmin, fminf, fminl \- 二つの浮動小数点数の最小値を求める -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "double fmin(double " x ", double " y ); +\fBdouble fmin(double \fP\fIx\fP\fB, double \fP\fIy\fP\fB);\fP .br -.BI "float fminf(float " x ", float " y ); +\fBfloat fminf(float \fP\fIx\fP\fB, float \fP\fIy\fP\fB);\fP .br -.BI "long double fminl(long double " x ", long double " y ); +\fBlong double fminl(long double \fP\fIx\fP\fB, long double \fP\fIy\fP\fB);\fP .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR fmin (), -.BR fminf (), -.BR fminl (): +\fBfmin\fP(), \fBfminf\fP(), \fBfminl\fP(): .RS 4 -_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O These functions the lesser value of -.\"O .I x -.\"O and -.\"O .IR y . -これらの関数は -.I x -と -.I y -のうち小さい方の値を返す。 -.\"O .SH RETURN VALUE +これらの関数は \fIx\fP と \fIy\fP のうち小さい方の値を返す。 .SH 返り値 -.\"O These functions return the minimum of -.\"O .I x -.\"O and -.\"O .IR y . -これらの関数は -.I x -と -.I y -の最小値を返す。 +これらの関数は \fIx\fP と \fIy\fP の最小値を返す。 -.\"O If one argument is a NaN, the other argument is returned. 一方の引き数が NaN の場合、もう一方の値が返される。 -.\"O If both arguments are NaN, a NaN is returned. 両方の引き数が NaN の場合、NaN が返される。 -.\"O .SH ERRORS .SH エラー -.\"O No errors occur. エラーは発生しない。 -.\"O .SH VERSIONS .SH バージョン -.\"O These functions first appeared in glibc in version 2.1. これらの関数は glibc バージョン 2.1 で初めて登場した。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. .SH 関連項目 -.BR fmax (3) +\fBfmax\fP(3) diff --git a/draft/man3/fmod.3 b/draft/man3/fmod.3 index 24a463c9..d3d99b91 100644 --- a/draft/man3/fmod.3 +++ b/draft/man3/fmod.3 @@ -30,191 +30,71 @@ .\" Modified 2002-07-27 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi -.\" and Copyright (c) 2008 Akihiro MOTOKI -.\" Translated Mon Jan 20 18:39:17 JST 1997 -.\" by YOSHINO Takashi -.\" Updated Wed Oct 15 JST 2003 by Kentaro Shirakata -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.\" WORD: remainder function 剰余関数 +.\" This file was generated with po4a. Translate the source file. .\" -.TH FMOD 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH FMOD 3 2012\-03\-15 "" "Linux Programmer's Manual" .SH 名前 -.\"O fmod, fmodf, fmodl \- floating-point remainder function fmod, fmodf, fmodl \- 浮動小数点剰余関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double fmod(double " x ", double " y ); +\fBdouble fmod(double \fP\fIx\fP\fB, double \fP\fIy\fP\fB);\fP .br -.BI "float fmodf(float " x ", float " y ); +\fBfloat fmodf(float \fP\fIx\fP\fB, float \fP\fIy\fP\fB);\fP .br -.BI "long double fmodl(long double " x ", long double " y ); +\fBlong double fmodl(long double \fP\fIx\fP\fB, long double \fP\fIy\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR fmodf (), -.BR fmodl (): +\fBfmodf\fP(), \fBfmodl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR fmod () -.\"O function computes the floating-point remainder of dividing \fIx\fP by -.\"O \fIy\fP. -.\"O The return value is \fIx\fP \- \fIn\fP * \fIy\fP, where \fIn\fP -.\"O is the quotient of \fIx\fP / \fIy\fP, rounded toward zero to an integer. -.BR fmod () -関数は \fIx\fP を \fIy\fP で割った浮動小数点剰余を計算する。 -返り値は \fIx\fP \- \fIn\fP * \fIy\fP である。 -ここで、\fIn\fP は \fIx\fP / \fIy\fP の商を -ゼロに向かう方向で整数値に丸めたものである。 -.\"O .SH "RETURN VALUE" +\fBfmod\fP() 関数は \fIx\fP を \fIy\fP で割った浮動小数点剰余を計算する。 返り値は \fIx\fP \- \fIn\fP * \fIy\fP である。 +ここで、\fIn\fP は \fIx\fP / \fIy\fP の商を ゼロに向かう方向で整数値に丸めたものである。 .SH 返り値 -.\"O On success, these -.\"O functions return the value \fIx\fP\ \-\ \fIn\fP*\fIy\fP, -.\"O for some integer \fIn\fP, -.\"O such that the returned value has the same sign as -.\"O .I x -.\"O and a magnitude less than the magnitude of -.\"O .IR y . -成功すると、これらの関数は \fIx\fP\ \-\ \fIn\fP*\fIy\fP を返す。 -\fIn\fP は、返り値が -.I x -と同じ符号で、その絶対値が -.I y +成功すると、これらの関数は \fIx\fP\ \-\ \fIn\fP*\fIy\fP を返す。 \fIn\fP は、返り値が \fIx\fP と同じ符号で、その絶対値が \fIy\fP の絶対値よりも小さくなるような整数である。 -.\"O If -.\"O .I x -.\"O or -.\"O .I y -.\"O is a NaN, a NaN is returned. -.I x -か -.I y -が NaN の場合、NaN が返される。 +\fIx\fP か \fIy\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is an infinity, -.\"O a domain error occurs, and -.\"O a NaN is returned. -.I x -が無限大の場合、領域エラー (domain error) が発生し、 -NaN が返される。 +\fIx\fP が無限大の場合、領域エラー (domain error) が発生し、 NaN が返される。 -.\"O If -.\"O .I y -.\"O is zero, -.\"O a domain error occurs, and -.\"O a NaN is returned. -.I y -が 0 の場合、領域エラーが発生し、 -NaN が返される。 +\fIy\fP が 0 の場合、領域エラーが発生し、 NaN が返される。 -.\"O If -.\"O .I x -.\"O is +0 (\-0), and -.\"O .I y -.\"O is not zero, +0 (\-0) is returned. -.I x -が +0 (\-0) で -.I y -が 0 でない場合、+0 (\-0) が返される。 -.\"O .SH ERRORS +\fIx\fP が +0 (\-0) で \fIy\fP が 0 でない場合、+0 (\-0) が返される。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Domain error: \fIx\fP is an infinity -領域エラー: \fIx\fP が無限大 -.\"O .I errno -.\"O is set to -.\"O .BR EDOM -.\"O (but see BUGS). -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -.I errno -に -.B EDOM -が設定される (「バグ」の節も参照)。 -不正 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) +.TP +領域エラー (domain error): \fIx\fP が無限大である +\fIerrno\fP に \fBEDOM\fP が設定される (「バグ」の節も参照)。 不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 -.TP -.\"O Domain error: \fIy\fP is zero +.TP 領域エラー: \fIy\fP がゼロ -.\"O .I errno -.\"O is set to -.\"O .BR EDOM . -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -.I errno -に -.B EDOM -が設定される。 -不正 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) -が上がる。 .\" POSIX.1 documents an optional underflow error, but AFAICT it doesn't .\" (can't?) occur -- mtk, Jul 2008 -.\"O .SH BUGS +\fIerrno\fP に \fBEDOM\fP が設定される。 不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 +.SH 準拠 +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH バグ -.\"O Before version 2.10, the glibc implementation did not set .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6784 -.\"O .I errno -.\"O to -.\"O .B EDOM -.\"O when a domain error occurred for an infinite -.\"O .IR x . -バージョン 2.10 より前の glibc の実装では、 -無限大で領域エラーが発生した際に、 -.I error -に -.B EDOM -が設定されなかった。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 -.\"O .SH "SEE ALSO" +バージョン 2.10 より前の glibc の実装では、 無限大で領域エラーが発生した際に、 \fIerror\fP に \fBEDOM\fP が設定されなかった。 .SH 関連項目 -.BR remainder (3) +\fBremainder\fP(3) diff --git a/draft/man3/fopencookie.3 b/draft/man3/fopencookie.3 new file mode 100644 index 00000000..a544eb03 --- /dev/null +++ b/draft/man3/fopencookie.3 @@ -0,0 +1,362 @@ +.\" Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH FOPENCOOKIE 3 2008\-12\-05 Linux "Linux Programmer's Manual" +.SH 名前 +fopencookie \- opening a custom stream +.SH 書式 +.nf +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP + +\fBFILE *fopencookie(void *\fP\fIcookie\fP\fB, const char *\fP\fImode\fP\fB,\fP +\fB cookie_io_functions_t \fP\fIio_funcs\fP\fB);\fP +.fi +.SH 説明 +The \fBfopencookie\fP() function allows the programmer to create a custom +implementation for a standard I/O stream. This implementation can store the +stream's data at a location of its own choosing; for example, +\fBfopencookie\fP() is used to implement \fBfmemopen\fP(3), which provides a +stream interface to data that is stored in a buffer in memory. + +In order to create a custom stream the programmer must: +.IP * 3 +Implement four "hook" functions that are used internally by the standard I/O +library when performing I/O on the stream. +.IP * +Define a "cookie" data type, a structure that provides bookkeeping +information (e.g., where to store data) used by the aforementioned hook +functions. The standard I/O package knows nothing about the contents of +this cookie (thus it is typed as \fIvoid\ *\fP when passed to +\fBfopencookie\fP()), but automatically supplies the cookie as the first +argument when calling the hook functions. +.IP * +Call \fBfopencookie\fP() to open a new stream and associate the cookie and +hook functions with that stream. +.PP +The \fBfopencookie\fP() function serves a purpose similar to \fBfopen\fP(3): it +opens a new stream and returns a pointer to a \fIFILE\fP object that is used to +operate on that stream. + +The \fIcookie\fP argument is a pointer to the caller's cookie structure that is +to be associated with the new stream. This pointer is supplied as the first +argument when the standard I/O library invokes any of the hook functions +described below. + +The \fImode\fP argument serves the same purpose as for \fBfopen\fP(3). The +following modes are supported: \fIr\fP, \fIw\fP, \fIa\fP, \fIr+\fP, \fIw+\fP, and \fIa+\fP. +See \fBfopen\fP(3) for details. + +The \fIio_funcs\fP argument is a structure that contains four fields pointing +to the programmer\-defined hook functions that are used to implement this +stream. The structure is defined as follows +.in +4n +.nf + +struct cookie_io_functions_t { + cookie_read_function_t *read; + cookie_write_function_t *write; + cookie_seek_function_t *seek; + cookie_close_function_t *close; +}; + +.fi +.in +The four fields are as follows: +.TP +\fIcookie_read_function_t *read\fP +This function implements read operations for the stream. When called, it +receives three arguments: + + ssize_t read(void *cookie, char *buf, size_t size); + +The \fIbuf\fP and \fIsize\fP arguments are, respectively, a buffer into which +input data can be placed and the size of that buffer. As its function +result, the \fIread\fP function should return the number of bytes copied into +\fIbuf\fP, 0 on end of file, or \-1 on error. The \fIread\fP function should +update the stream offset appropriately. + +If \fI*read\fP is a NULL pointer, then reads from the custom stream always +return end of file. +.TP +\fIcookie_write_function_t *write\fP +This function implements write operations for the stream. When called, it +receives three arguments: + + ssize_t write(void *cookie, const char *buf, size_t size); + +The \fIbuf\fP and \fIsize\fP arguments are, respectively, a buffer of data to be +output to the stream and the size of that buffer. As its function result, +the \fIwrite\fP function should return the number of bytes copied from \fIbuf\fP, +or \-1 on error. The \fIwrite\fP function should update the stream offset +appropriately. + +If \fI*write\fP is a NULL pointer, then output to the stream is discarded. +.TP +\fIcookie_seek_function_t *seek\fP +This function implements seek operations on the stream. When called, it +receives three arguments: + + int seek(void *cookie, off64_t *offset, int whence); + +The \fI*offset\fP argument specifies the new file offset depending on which of +the following three values is supplied in \fIwhence\fP: +.RS +.TP 10 +\fBSEEK_SET\fP +The stream offset should be set \fI*offset\fP bytes from the start of the +stream. +.TP +\fBSEEK_CUR\fP +\fI*offset\fP should be added to the current stream offset. +.TP +\fBSEEK_END\fP +The stream offset should be set to the size of the stream plus \fI*offset\fP. +.RE +.IP +Before returning, the \fIseek\fP function should update \fI*offset\fP to indicate +the new stream offset. + +As its function result, the \fIseek\fP function should return 0 on success, and +\-1 on error. + +If \fI*seek\fP is a NULL pointer, then it is not possible to perform seek +operations on the stream. +.TP +\fIcookie_close_function_t *close\fP +This function closes the stream. The hook function can do things such as +freeing buffers allocated for the stream. When called, it receives one +argument: + + int close(void *cookie); + +The \fIcookie\fP argument is the cookie that the programmer supplied when +calling \fBfopencookie\fP(). + +As its function result, the \fIclose\fP function should return 0 on success, +and \fBEOF\fP on error. + +If \fI*close\fP is NULL, then no special action is performed when the stream is +closed. +.SH 返り値 +.\" .SH ERRORS +.\" It's not clear if errno ever gets set... +On success \fBfopencookie\fP() returns a pointer to the new stream. On error, +NULL is returned. +.SH 準拠 +This function is a nonstandard GNU extension. +.SH 例 +The program below implements a custom stream whose functionality is similar +(but not identical) to that available via \fBfmemopen\fP(3). It implements a +stream whose data is stored in a memory buffer. The program writes its +command\-line arguments to the stream, and then seeks through the stream +reading two out of every five characters and writing them to standard +output. The following shell session demonstrates the use of the program: +.in +4n +.nf + +$\fB ./a.out \(aqhello world\(aq\fP +/he/ +/ w/ +/d/ +Reached end of file + +.fi +.in +Note that a more general version of the program below could be improved to +more robustly handle various error situations (e.g., opening a stream with a +cookie that already has an open stream; closing a stream that has already +been closed). +.SS プログラムのソース +\& +.nf +#define _GNU_SOURCE +#include +#include +#include +#include +#include + +#define INIT_BUF_SIZE 4 + +struct memfile_cookie { + char *buf; /* Dynamically sized buffer for data */ + size_t allocated; /* Size of buf */ + size_t endpos; /* Number of characters in buf */ + off_t offset; /* Current file offset in buf */ +}; + +ssize_t +memfile_write(void *c, const char *buf, size_t size) +{ + char *new_buff; + struct memfile_cookie *cookie = c; + + /* Buffer too small? Keep doubling size until big enough */ + + while (size + cookie\->offset > cookie\->allocated) { + new_buff = realloc(cookie\->buf, cookie\->allocated * 2); + if (new_buff == NULL) { + return \-1; + } else { + cookie\->allocated *= 2; + cookie\->buf = new_buff; + } + } + + memcpy(cookie\->buf + cookie\->offset, buf, size); + + cookie\->offset += size; + if (cookie\->offset > cookie\->endpos) + cookie\->endpos = cookie\->offset; + + return size; +} + +ssize_t +memfile_read(void *c, char *buf, size_t size) +{ + ssize_t xbytes; + struct memfile_cookie *cookie = c; + + /* Fetch minimum of bytes requested and bytes available */ + + xbytes = size; + if (cookie\->offset + size > cookie\->endpos) + xbytes = cookie\->endpos \- cookie\->offset; + if (xbytes < 0) /* offset may be past endpos */ + xbytes = 0; + + memcpy(buf, cookie\->buf + cookie\->offset, xbytes); + + cookie\->offset += xbytes; + return xbytes; +} + +int +memfile_seek(void *c, off64_t *offset, int whence) +{ + off64_t new_offset; + struct memfile_cookie *cookie = c; + + if (whence == SEEK_SET) + new_offset = *offset; + else if (whence == SEEK_END) + new_offset = cookie\->endpos + *offset; + else if (whence == SEEK_CUR) + new_offset = cookie\->offset + *offset; + else + return \-1; + + if (new_offset < 0) + return \-1; + + cookie\->offset = new_offset; + *offset = new_offset; + return 0; +} + +int +memfile_close(void *c) +{ + struct memfile_cookie *cookie = c; + + free(cookie\->buf); + cookie\->allocated = 0; + cookie\->buf = NULL; + + return 0; +} + +int +main(int argc, char *argv[]) +{ + cookie_io_functions_t memfile_func = { + .read = memfile_read, + .write = memfile_write, + .seek = memfile_seek, + .close = memfile_close + }; + FILE *fp; + struct memfile_cookie mycookie; + ssize_t nread; + long p; + int j; + char buf[1000]; + + /* Set up the cookie before calling fopencookie() */ + + mycookie.buf = malloc(INIT_BUF_SIZE); + if (mycookie.buf == NULL) { + perror("malloc"); + exit(EXIT_FAILURE); + } + + mycookie.allocated = INIT_BUF_SIZE; + mycookie.offset = 0; + mycookie.endpos = 0; + + fp = fopencookie(&mycookie,"w+", memfile_func); + if (fp == NULL) { + perror("fopencookie"); + exit(EXIT_FAILURE); + } + + /* Write command\-line arguments to our file */ + + for (j = 1; j < argc; j++) + if (fputs(argv[j], fp) == EOF) { + perror("fputs"); + exit(EXIT_FAILURE); + } + + /* Read two bytes out of every five, until EOF */ + + for (p = 0; ; p += 5) { + if (fseek(fp, p, SEEK_SET) == \-1) { + perror("fseek"); + exit(EXIT_FAILURE); + } + nread = fread(buf, 1, 2, fp); + if (nread == \-1) { + perror("fread"); + exit(EXIT_FAILURE); + } + if (nread == 0) { + printf("Reached end of file\en"); + break; + } + + printf("/%.*s/\en", nread, buf); + } + + exit(EXIT_SUCCESS); +} +.fi +.SH 関連項目 +\fBfclose\fP(3), \fBfmemopen\fP(3), \fBfopen\fP(3), \fBfseek\fP(3) diff --git a/draft/man3/fpathconf.3 b/draft/man3/fpathconf.3 index 5f48a9e0..57caf859 100644 --- a/draft/man3/fpathconf.3 +++ b/draft/man3/fpathconf.3 @@ -21,264 +21,79 @@ .\" the source, must acknowledge the copyright and authors of this work. .\" License. .\" Modified Wed Jul 28 11:12:26 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. -.\" Translated Fri Mar 20 1998 by NAKANO Takeo +.\" This file was generated with po4a. Translate the source file. .\" -.TH FPATHCONF 3 1993-04-04 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH FPATHCONF 3 1993\-04\-04 GNU "Linux Programmer's Manual" .SH 名前 -.\"O fpathconf, pathconf \- get configuration values for files fpathconf, pathconf \- ファイルの設定値を取得する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "long fpathconf(int " fd ", int " name ); +\fBlong fpathconf(int \fP\fIfd\fP\fB, int \fP\fIname\fP\fB);\fP .br -.BI "long pathconf(char *" path ", int " name ); +\fBlong pathconf(char *\fP\fIpath\fP\fB, int \fP\fIname\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR fpathconf () -.\"O gets a value for the configuration option -.\"O .I name -.\"O for the open file descriptor -.\"O .IR fd . -.BR fpathconf () -はオープンされているファイルデスクリプター -.I fd -に対して設定されているオプション -.I name +\fBfpathconf\fP() はオープンされているファイルデスクリプター \fIfd\fP に対して設定されているオプション \fIname\fP の値を取得する。 .PP -.\"O .BR pathconf () -.\"O gets a value for configuration option -.\"O .I name -.\"O for the filename -.\"O .IR path . -.BR pathconf () -はファイル名 -.I path -に対して設定されているオプション -.I name -の値を取得する。 +\fBpathconf\fP() はファイル名 \fIpath\fP に対して設定されているオプション \fIname\fP の値を取得する。 .PP -.\"O The corresponding macros defined in -.\"O .I -.\"O are minimum values; if an application wants to take advantage of values -.\"O which may change, a call to -.\"O .BR fpathconf () -.\"O or -.\"O .BR pathconf () -.\"O can be made, which may yield more liberal results. -対応するマクロのうち -.I -で定義されているものは最小値である。アプリケーションによってはこれらの -値を変更してより有利な動作を行おうとするものがある。この場合でも -.BR fpathconf () -または -.BR pathconf () +対応するマクロのうち \fI\fP で定義されているものは最小値である。アプリケーションによってはこれらの +値を変更してより有利な動作を行おうとするものがある。この場合でも \fBfpathconf\fP() または \fBpathconf\fP() は呼び出すことができる。この場合はより大きな値が返ることになろう。 .PP -.\"O Setting -.\"O .I name -.\"O equal to one of the following constants returns the following -.\"O configuration options: -.I name -を以下の定数のどれかにすると、対応する設定オプションが返される。 -.TP -.B _PC_LINK_MAX -.\"O returns the maximum number of links to the file. -.\"O If -.\"O .I fd -.\"O or -.\"O .I path -.\"O refer to a directory, then the value applies to the whole directory. -.\"O The corresponding macro is -.\"O .BR _POSIX_LINK_MAX . -ファイルへのリンクの最大数を返す。 -.I fd -または -.I path -がディレクトリの場合は、この値はディレクトリ全体に適用される。対応する -マクロは -.B _POSIX_LINK_MAX -である。 -.TP -.B _PC_MAX_CANON -.\"O returns the maximum length of a formatted input line, where -.\"O .I fd -.\"O or -.\"O .I path -.\"O must refer to a terminal. -.\"O The corresponding macro is -.\"O .BR _POSIX_MAX_CANON . -フォーマット付き入力行の最大長を返す。このとき -.I fd -または -.I path -は端末を参照していなければならない。 -対応するマクロは -.B _POSIX_MAX_CANON -である。 -.TP -.B _PC_MAX_INPUT -.\"O returns the maximum length of an input line, where -.\"O .I fd -.\"O or -.\"O .I path -.\"O must refer to a terminal. -.\"O The corresponding macro is -.\"O .BR _POSIX_MAX_INPUT . -入力行の最大長を返す。このとき -.I fd -または -.I path -は端末を参照していなければならない。 -対応するマクロは -.B _POSIX_MAX_INPUT -である。 -.TP -.B _PC_NAME_MAX -.\"O returns the maximum length of a filename in the directory -.\"O .I path -.\"O or -.\"O .IR fd -.\"O that the process is allowed to create. -.\"O The corresponding macro is -.\"O .BR _POSIX_NAME_MAX . -ディレクトリ -.I path -または -.I fd -内に、そのプロセスが作成することができるファイル名の最大長を返す。 -対応するマクロは -.B _POSIX_NAME_MAX -である。 -.TP -.B _PC_PATH_MAX -.\"O returns the maximum length of a relative pathname when -.\"O .I path -.\"O or -.\"O .I fd -.\"O is the current working directory. -.\"O The corresponding macro is -.\"O .BR _POSIX_PATH_MAX . -.I path -または -.I fd -がカレントディレクトリの場合、相対パス名の最大長を返す。 -対応するマクロは -.B _POSIX_PATH_MAX -である。 -.TP -.B _PC_PIPE_BUF -.\"O returns the size of the pipe buffer, where -.\"O .I fd -.\"O must refer to a pipe or FIFO and -.\"O .I path -.\"O must refer to a FIFO. -.\"O The corresponding macro is -.\"O .BR _POSIX_PIPE_BUF . -パイプ (pipe) バッファのサイズを返す。このとき -.I fd -はパイプか FIFO を参照していなければならず、 -.I path -は FIFO を参照していなければならない。 -対応するマクロは -.B _POSIX_PIPE_BUF -である。 -.TP -.B _PC_CHOWN_RESTRICTED -.\"O returns nonzero if the -.\"O .BR chown (2) -.\"O call may not be used on this file. -.\"O If -.\"O .I fd -.\"O or -.\"O .I path -.\"O refer to a directory, then this applies to all files in that -.\"O directory. -.\"O The corresponding macro is -.\"O .BR _POSIX_CHOWN_RESTRICTED . -このファイルに対する -.BR chown (2) -の呼び出しが許されていない場合には 0 以外の値を返す。 -.I fd -または -.I path -がディレクトリを参照している場合は、この制限はそのディレクトリのすべて -のファイルに適用される。 -対応するマクロは -.B _POSIX_CHOWN_RESTRICTED -である。 -.TP -.B _PC_NO_TRUNC -.\"O returns nonzero if accessing filenames longer than -.\"O .B _POSIX_NAME_MAX -.\"O generates an error. -.\"O The corresponding macro is -.\"O .BR _POSIX_NO_TRUNC . -アクセス中のファイル名が -.B _POSIX_NAME_MAX -よりも長く、エラーとなる場合には 0 以外の値を返す。 -対応するマクロは -.B _POSIX_NAME_MAX +\fIname\fP を以下の定数のどれかにすると、対応する設定オプションが返される。 +.TP +\fB_PC_LINK_MAX\fP +ファイルへのリンクの最大数を返す。 \fIfd\fP または \fIpath\fP がディレクトリの場合は、この値はディレクトリ全体に適用される。対応する マクロは +\fB_POSIX_LINK_MAX\fP である。 +.TP +\fB_PC_MAX_CANON\fP +フォーマット付き入力行の最大長を返す。このとき \fIfd\fP または \fIpath\fP は端末を参照していなければならない。 対応するマクロは +\fB_POSIX_MAX_CANON\fP である。 +.TP +\fB_PC_MAX_INPUT\fP +入力行の最大長を返す。このとき \fIfd\fP または \fIpath\fP は端末を参照していなければならない。 対応するマクロは +\fB_POSIX_MAX_INPUT\fP である。 +.TP +\fB_PC_NAME_MAX\fP +ディレクトリ \fIpath\fP または \fIfd\fP 内に、そのプロセスが作成することができるファイル名の最大長を返す。 対応するマクロは +\fB_POSIX_NAME_MAX\fP である。 +.TP +\fB_PC_PATH_MAX\fP +\fIpath\fP または \fIfd\fP がカレントディレクトリの場合、相対パス名の最大長を返す。 対応するマクロは \fB_POSIX_PATH_MAX\fP である。 -.TP -.B _PC_VDISABLE -.\"O returns nonzero if special character processing can be disabled, where -.\"O .I fd -.\"O or -.\"O .I path -.\"O must refer to a terminal. -特殊文字 (special character) の処理が許されていない場合は 0 以外の値を -返す。このとき -.I fd -または -.I path +.TP +\fB_PC_PIPE_BUF\fP +パイプ (pipe) バッファのサイズを返す。このとき \fIfd\fP はパイプか FIFO を参照していなければならず、 \fIpath\fP は FIFO +を参照していなければならない。 対応するマクロは \fB_POSIX_PIPE_BUF\fP である。 +.TP +\fB_PC_CHOWN_RESTRICTED\fP +このファイルに対する \fBchown\fP(2) の呼び出しが許されていない場合には 0 以外の値を返す。 \fIfd\fP または \fIpath\fP +がディレクトリを参照している場合は、この制限はそのディレクトリのすべて のファイルに適用される。 対応するマクロは +\fB_POSIX_CHOWN_RESTRICTED\fP である。 +.TP +\fB_PC_NO_TRUNC\fP +アクセス中のファイル名が \fB_POSIX_NAME_MAX\fP よりも長く、エラーとなる場合には 0 以外の値を返す。 対応するマクロは +\fB_POSIX_NAME_MAX\fP である。 +.TP +\fB_PC_VDISABLE\fP +特殊文字 (special character) の処理が許されていない場合は 0 以外の値を 返す。このとき \fIfd\fP または \fIpath\fP は端末を参照していなければならない。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O The limit is returned, if one exists. -.\"O If the system does not have a -.\"O limit for the requested resource, \-1 is returned, and -.\"O .I errno -.\"O is unchanged. -.\"O If there is an error, \-1 is returned, and -.\"O .I errno -.\"O is set to reflect the nature of the error. -(存在していれば) 制限値が返される。要求されたリソースへのシステムの制 -限が存在していなければ \-1 が返され、 -.I errno -は変更されない。エラーが起こった場合には \-1 が返され、 -.I errno -がエラーに対応した値に設定される。 -.\"O .SH "CONFORMING TO" +(存在していれば) 制限値が返される。要求されたリソースへのシステムの制 限が存在していなければ \-1 が返され、 \fIerrno\fP +は変更されない。エラーが起こった場合には \-1 が返され、 \fIerrno\fP がエラーに対応した値に設定される。 .SH 準拠 -POSIX.1-2001. -.\"O .SH NOTES +POSIX.1\-2001. .SH 注意 -.\"O Files with name lengths longer than the value returned for -.\"O .I name -.\"O equal to -.\"O .B _PC_NAME_MAX -.\"O may exist in the given directory. -.I name -に -.B _PC_NAME_MAX -を入れて返された値よりも長いファイル名を持つファイルが、与えられたディ +\fIname\fP に \fB_PC_NAME_MAX\fP を入れて返された値よりも長いファイル名を持つファイルが、与えられたディ レクトリに存在するかもしれない。 .PP -.\"O Some returned values may be huge; they are not suitable for allocating -.\"O memory. -返り値は非常に大きな値になることもある。メモリーの割り当て用の値には大 -きすぎて適さないかも知れない。 -.\"O .SH "SEE ALSO" +いくつかの返り値はとても大きくなることがある。これらを使って メモリの割り当てを行うのは適当ではない。 .SH 関連項目 -.BR getconf (1), -.BR open (2), -.BR statfs (2), -.BR sysconf (3) +\fBgetconf\fP(1), \fBopen\fP(2), \fBstatfs\fP(2), \fBsysconf\fP(3) diff --git a/draft/man3/fpclassify.3 b/draft/man3/fpclassify.3 index 454d60ee..1ced41c3 100644 --- a/draft/man3/fpclassify.3 +++ b/draft/man3/fpclassify.3 @@ -3,188 +3,99 @@ .\" This was done with the help of the glibc manual. .\" .\" 2004-10-31, aeb, corrected +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO -.\" all rights reserved. -.\" Translated 2004-07-27, Yuichi SATO -.\" Updated & Modified 2005-01-10, Yuichi SATO -.\" Updated & Modified 2005-09-04, Akihiro MOTOKI -.\" Updated 2008-09-16, Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.TH FPCLASSIFY 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH FPCLASSIFY 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O fpclassify, isfinite, isnormal, isnan, isinf \- floating-point -.\"O classification macros fpclassify, isfinite, isnormal, isnan, isinf \- 浮動小数点数の分類マクロ -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int fpclassify(" x ); +\fBint fpclassify(\fP\fIx\fP\fB);\fP .sp -.BI "int isfinite(" x ); +\fBint isfinite(\fP\fIx\fP\fB);\fP .sp -.BI "int isnormal(" x ); +\fBint isnormal(\fP\fIx\fP\fB);\fP .sp -.BI "int isnan(" x ); +\fBint isnan(\fP\fIx\fP\fB);\fP .sp -.BI "int isinf(" x ); +\fBint isinf(\fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .\" I haven't fully grokked the source to determine the FTM requirements; .\" in part, the following has been tested by experiment. .ad l -.BR fpclassify (), -.BR isfinite (), -.BR isnormal (): +\fBfpclassify\fP(), \fBisfinite\fP(), \fBisnormal\fP(): .RS 4 -_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE -.BR isnan (): +\fBisnan\fP(): .RS 4 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE -.BR isinf (): +\fBisinf\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O Floating point numbers can have special values, such as -.\"O infinite or NaN. -.\"O With the macro -.\"O .BI fpclassify( x ) -.\"O you can find out what type -.\"O .I x -.\"O is. -.\"O The macro takes any floating-point expression as argument. -浮動小数点数は無限大や NaN のような特別な値を持つことができる。 -マクロ -.BI fpclassify( x ) -で -.I x -がどのような種別かを知ることができる。 -マクロは任意の浮動小数点数表現を引き数としてとることができる。 -.\"O The result is one of the following values: -結果は以下の値のいずれか一つである: -.TP 14 -.B FP_NAN -.\"O .I x -.\"O is "Not a Number". -.I x -が "Not a Number" である (数値ではない)。 -.TP -.B FP_INFINITE -.\"O .I x -.\"O is either positive infinity or negative infinity. -.I x -が正の無限大または負の無限大である。 -.TP -.B FP_ZERO -.\"O .I x -.\"O is zero. -.I x -が 0 である。 -.TP -.B FP_SUBNORMAL -.\"O .I x -.\"O is too small to be represented in normalized format. -.I x -を正規化形式で表現するには小さすぎる。 -.TP -.B FP_NORMAL -.\"O if nothing of the above is correct then it must be a -.\"O normal floating-point number. -上記のどれにも当てはまらない場合であり、 -値は通常の浮動小数点数であるはずだ。 +浮動小数点数は無限大や NaN のような特別な値を持つことができる。 マクロ \fBfpclassify(\fP\fIx\fP\fB)\fP で \fIx\fP +がどのような種別かを知ることができる。 マクロは任意の浮動小数点数表現を引き数としてとることができる。 結果は以下の値のいずれか一つである: +.TP 14 +\fBFP_NAN\fP +\fIx\fP が "Not a Number" である (数値ではない)。 +.TP +\fBFP_INFINITE\fP +\fIx\fP が正の無限大または負の無限大である。 +.TP +\fBFP_ZERO\fP +\fIx\fP が 0 である。 +.TP +\fBFP_SUBNORMAL\fP +\fIx\fP を正規化形式で表現するには小さすぎる。 +.TP +\fBFP_NORMAL\fP +上記のどれにも当てはまらない場合であり、 値は通常の浮動小数点数であるはずだ。 .LP -.\"O The other macros provide a short answer to some standard questions. 他のマクロは、いくつかの標準的な問いに対して、簡単な答えを提供する。 -.TP 14 -.BI isfinite( x ) -.\"O returns a nonzero value if -.\"O .br -.\"O (fpclassify(x) != FP_NAN && fpclassify(x) != FP_INFINITE) +.TP 14 +\fBisfinite(\fP\fIx\fP\fB)\fP +以下の場合に 0 以外の値を返す。 +.br (fpclassify(x) != FP_NAN && fpclassify(x) != FP_INFINITE) -の場合に 0 以外の値を返す。 -.TP -.BI isnormal( x ) -.\"O returns a nonzero value if -.\"O (fpclassify(x) == FP_NORMAL) -(fpclassify(x) == FP_NORMAL) -の場合に 0 以外の値を返す。 -.TP -.BI isnan( x ) -.\"O returns a nonzero value if -.\"O (fpclassify(x) == FP_NAN) -(fpclassify(x) == FP_NAN) -の場合に 0 以外の値を返す。 -.TP -.BI isinf( x ) -.\"O returns 1 if -.\"O .I x -.\"O is positive infinity, and \-1 if -.\"O .I x -.\"O is negative infinity. -.I x -が正の無限大の場合は 1 を、 -負の無限大の場合は \-1 を返す。 -.\"O .SH "CONFORMING TO" +.TP +\fBisnormal(\fP\fIx\fP\fB)\fP +(fpclassify(x) == FP_NORMAL) の場合に 0 以外の値を返す。 +.TP +\fBisnan(\fP\fIx\fP\fB)\fP +(fpclassify(x) == FP_NAN) の場合に 0 以外の値を返す。 +.TP +\fBisinf(\fP\fIx\fP\fB)\fP +\fIx\fP が正の無限大の場合は 1 を、 負の無限大の場合は \-1 を返す。 .SH 準拠 C99, POSIX.1. -.\"O For -.\"O .BR isinf (), -.\"O the standards merely say that the return value is nonzero -.\"O if and only if the argument has an infinite value. -.BR isinf () -に関して、標準規格で定められているのは、 -返り値が 0 以外になるのは引き数が無限大の場合だけということだけである。 -.\"O .SH NOTES +\fBisinf\fP() に関して、標準規格で定められているのは、 返り値が 0 以外になるのは引き数が無限大の場合だけということだけである。 .SH 注意 -.\"O In glibc 2.01 and earlier, -.\"O .BR isinf () -.\"O returns a nonzero value (actually: 1) if -.\"O .I x -.\"O is positive infinity or negative infinity. -.\"O (This is all that C99 requires.) -glibc 2.01 以前では、 -.BR isinf () -は -.I x -が正の無限大か負の無限大の場合、 -0 以外の値 (実際には 1) を返す -(C99 の要求仕様で決まっているのは -0 以外の値を返すということだけである)。 -.\"O .SH "SEE ALSO" +glibc 2.01 以前では、 \fBisinf\fP() は \fIx\fP が正の無限大か負の無限大の場合、 0 以外の値 (実際には 1) を返す +(C99 の要求仕様で決まっているのは 0 以外の値を返すということだけである)。 .SH 関連項目 -.BR finite (3), -.BR INFINITY (3), -.BR isgreater (3), -.BR signbit (3) +\fBfinite\fP(3), \fBINFINITY\fP(3), \fBisgreater\fP(3), \fBsignbit\fP(3) diff --git a/draft/man3/frexp.3 b/draft/man3/frexp.3 index 56fd56fe..86239cf9 100644 --- a/draft/man3/frexp.3 +++ b/draft/man3/frexp.3 @@ -28,130 +28,66 @@ .\" Modified 2002-07-27 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi -.\" all rights reserved. -.\" Translated 1997-01-21, YOSHINO Takashi -.\" Updated 2003-10-15, Kentaro Shirakata -.\" Updated 2005-11-19, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH FREXP 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH FREXP 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O frexp, frexpf, frexpl \- convert floating-point number to fractional -.\"O and integral components frexp, frexpf, frexpl \- 浮動小数点実数を小数成分と整数成分に変換する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double frexp(double " x ", int *" exp ); +\fBdouble frexp(double \fP\fIx\fP\fB, int *\fP\fIexp\fP\fB);\fP .br -.BI "float frexpf(float " x ", int *" exp ); +\fBfloat frexpf(float \fP\fIx\fP\fB, int *\fP\fIexp\fP\fB);\fP .br -.BI "long double frexpl(long double " x ", int *" exp ); +\fBlong double frexpl(long double \fP\fIx\fP\fB, int *\fP\fIexp\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR frexpf (), -.BR frexpl (): +\fBfrexpf\fP(), \fBfrexpl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR frexp () -.\"O function is used to split the number \fIx\fP into a -.\"O normalized fraction and an exponent which is stored in \fIexp\fP. -.BR frexp () -関数は浮動小数点実数 \fIx\fP を正規化小数と指数に分解し、 -指数を *\fIexp\fP に格納する。 -.\"O .SH "RETURN VALUE" +\fBfrexp\fP() 関数は浮動小数点実数 \fIx\fP を正規化小数と指数に分解し、 指数を *\fIexp\fP に格納する。 .SH 返り値 -.\"O The -.\"O .BR frexp () -.\"O function returns the normalized fraction. -.\"O If the argument \fIx\fP is not zero, -.\"O the normalized fraction is \fIx\fP times a power of two, -.\"O and its absolute value is always in the range 1/2 (inclusive) to -.\"O 1 (exclusive), that is, [0.5,1). -.BR frexp () -関数は正規化小数を返す。 -引数 \fIx\fP がゼロでない場合、この正規化小数は -\fIx\fP に 2 の累乗を乗じたものであり、その絶対値は -常に 1/2 以上 1 未満、つまり [0.5,1) となる。 +\fBfrexp\fP() 関数は正規化小数を返す。 引数 \fIx\fP がゼロでない場合、この正規化小数は \fIx\fP に 2 +の累乗を乗じたものであり、その絶対値は 常に 1/2 以上 1 未満、つまり [0.5,1) となる。 -.\"O If \fIx\fP is zero, then the normalized fraction is -.\"O zero and zero is stored in \fIexp\fP. -\fIx\fP がゼロの場合、正規化小数はゼロになり -*\fIexp\fP にはゼロが格納される。 +\fIx\fP がゼロの場合、正規化小数はゼロになり *\fIexp\fP にはゼロが格納される。 -.\"O If -.\"O .I x -.\"O is a NaN, -.\"O a NaN is returned, and the value of -.\"O .I *exp -.\"O is unspecified. -.I x -が NaN の場合、NaN が返される。 -.I *exp -の値は不定である。 +\fIx\fP が NaN の場合、NaN が返される。 \fI*exp\fP の値は不定である。 -.\"O If -.\"O .I x -.\"O is positive infinity (negative infinity), -.\"O positive infinity (negative infinity) is returned, and the value of -.\"O .I *exp -.\"O is unspecified. -.I x -が正の無限大 (負の無限大) の場合、 -正の無限大 (負の無限大) が返される。 -.I *exp -の値は不定である。 -.\"O .SH ERRORS +\fIx\fP が正の無限大 (負の無限大) の場合、 正の無限大 (負の無限大) が返される。 \fI*exp\fP の値は不定である。 .SH エラー -.\"O No errors occur. エラーは発生しない。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 -.\"O .SH EXAMPLE +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH 例 -.\"O The program below produces results such as the following: このプログラムを実行すると以下のような結果となる: .sp .nf .in +4n -.RB "$" " ./a.out 2560" +$\fB ./a.out 2560\fP frexp(2560, &e) = 0.625: 0.625 * 2^12 = 2560 -.RB "$" " ./a.out \-4" +$\fB ./a.out \-4\fP frexp(\-4, &e) = \-0.5: \-0.5 * 2^3 = \-4 .in .fi -.\"O .SS Program source .SS プログラムのソース \& .nf @@ -169,12 +105,10 @@ main(int argc, char *argv[]) x = strtod(argv[1], NULL); r = frexp(x, &exp); - printf("frexp(%g, &e) = %g: %g * %d^%d = %g\\n", + printf("frexp(%g, &e) = %g: %g * %d^%d = %g\en", x, r, r, FLT_RADIX, exp, x); exit(EXIT_SUCCESS); } .fi -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR ldexp (3), -.BR modf (3) +\fBldexp\fP(3), \fBmodf\fP(3) diff --git a/draft/man3/ftime.3 b/draft/man3/ftime.3 index 451ede1b..b762653c 100644 --- a/draft/man3/ftime.3 +++ b/draft/man3/ftime.3 @@ -1,7 +1,7 @@ .\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" Copyright (c) 1993 Michael Haardt -.\" (u31b3hs@pool.informatik.rwth-aachen.de) +.\" (michael@moria.de) .\" Fri Apr 2 11:32:09 MET DST 1993 .\" .\" This is free documentation; you can redistribute it and/or @@ -21,47 +21,28 @@ .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, write to the Free -.\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, .\" USA. .\" .\" Modified Sat Jul 24 14:23:14 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified Sun Oct 18 17:31:43 1998 by Andries Brouwer (aeb@cwi.nl) .\" 2008-06-23, mtk, minor rewrites, added some details .\" -.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka -.\" all rights reserved. -.\" Translated Thu Dec 25 10:53:32 JST 1997 -.\" by HIROFUMI Nishizuka +.\"******************************************************************* .\" -.\" Updated Tue Jul 8 JST 1999 by Kentaro Shirakata -.\" Updated Fri Dec 21 JST 2001 by Kentaro Shirakata -.\" Updated Wed Jul 30 JST 2008 by Kentaro Shirakata +.\" This file was generated with po4a. Translate the source file. .\" -.TH FTIME 3 2010-02-25 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O ftime \- return date and time +.\"******************************************************************* +.TH FTIME 3 2010\-02\-25 GNU "Linux Programmer's Manual" .SH 名前 ftime \- 日付と時間を返す -.\"O .SH SYNOPSIS -.\"O .B "#include " -.\"O .sp -.\"O .BI "int ftime(struct timeb *" tp ); .SH 書式 -.B "#include " +\fB#include \fP .sp -.BI "int ftime(struct timeb *" tp ); -.\"O .SH DESCRIPTION +\fBint ftime(struct timeb *\fP\fItp\fP\fB);\fP .SH 説明 -.\"O This function returns the current time as seconds and milliseconds -.\"O since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). -.\"O The time is returned in -.\"O .IR tp , -.\"O which is declared as follows: -この関数は現在の時刻を、紀元 (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) -からの秒数とミリ秒数で返す。 -時刻は -.I tp -で返され、これは以下のように定義されている: +この関数は現在の時刻を、紀元 (Epoch; 1970\-01\-01 00:00:00 +0000 (UTC)) からの秒数とミリ秒数で返す。 時刻は +\fItp\fP で返され、これは以下のように定義されている: .sp .in +4n .nf @@ -74,78 +55,25 @@ struct timeb { .fi .in .LP -.\"O Here \fItime\fP is the number of seconds since the Epoch, -.\"O and \fImillitm\fP is the number of milliseconds since \fItime\fP -.\"O seconds since the Epoch. -.\"O The \fItimezone\fP field is the local timezone measured in minutes -.\"O of time west of Greenwich (with a negative value indicating minutes -.\"O east of Greenwich). -.\"O The \fIdstflag\fP field -.\"O is a flag that, if nonzero, indicates that Daylight Saving time -.\"O applies locally during the appropriate part of the year. -ここで、\fItime\fP は紀元 (the Epoch) からの秒数、 -\fImillitm\fP は 紀元から \fItime\fP 秒後からのミリ秒数である。 -\fItimezone\fP フィールドはグリニッジから西周りの分で計測される -ローカルタイムゾーンである(負数の場合はグリニッジからの東回りの分を -示す)。 -\fIdstflag\fP フィールドは、もし 0 でなければ一年の一部で夏時間が -存在することを示すフラグである。 +ここで、\fItime\fP は紀元 (the Epoch) からの秒数、 \fImillitm\fP は 紀元から \fItime\fP 秒後からのミリ秒数である。 +\fItimezone\fP フィールドはグリニッジから西周りの分で計測される ローカルタイムゾーンである(負数の場合はグリニッジからの東回りの分を 示す)。 +\fIdstflag\fP フィールドは、もし 0 でなければ一年の一部で夏時間が 存在することを示すフラグである。 .LP -.\"O POSIX.1-2001 says that the contents of the \fItimezone\fP and \fIdstflag\fP -.\"O fields are unspecified; avoid relying on them. -POSIX.1-2001 では、\fItimezone\fP と \fIdstflag\fP の内容は未定義である; -これに頼るのは避けること。 -\"O .SH "RETURN VALUE" +POSIX.1\-2001 では、\fItimezone\fP と \fIdstflag\fP の内容は未定義である; これに頼るのは避けること。 .SH 返り値 -\"O This function always returns 0. -この関数は常に 0 を返す。 -.\"O (POSIX.1-2001 specifies, and some systems document, a \-1 error return.) -(POSIX.1-2001 仕様及びいくつかのシステムのドキュメントでは、 -エラー時に \-1 を返す。) -\"O .SH "CONFORMING TO" +この関数は常に 0 を返す。 (POSIX.1\-2001 仕様及びいくつかのシステムのドキュメントでは、 エラー時に \-1 を返す。) .SH 準拠 -4.2BSD, POSIX.1-2001. -.\"O POSIX.1-2008 removes the specification of -.\"O .BR ftime (). -POSIX.1-2008 では -.BR ftime () -の仕様が削除されている。 +4.2BSD, POSIX.1\-2001. POSIX.1\-2008 では \fBftime\fP() の仕様が削除されている。 -.\"O This function is obsolete. -.\"O Don't use it. -.\"O If the time in seconds -.\"O suffices, -.\"O .BR time (2) -.\"O can be used; -.\"O .BR gettimeofday (2) -.\"O gives microseconds; -.\"O .BR clock_gettime (2) -.\"O gives nanoseconds but is not as widely available. -この関数は古いものである。使ってはならない。 -秒単位の時間で十分なら、 -.BR time (2) -が利用できる。 -.BR gettimeofday (2) -でマイクロ秒が得られる。 -.BR clock_gettime (2) -でナノ秒が得られるが、広く利用可能な訳ではない。 -\"O .SH BUGS +この関数は古いものである。使ってはならない。 秒単位の時間で十分なら、 \fBtime\fP(2) が利用できる。 \fBgettimeofday\fP(2) +でマイクロ秒が得られる。 \fBclock_gettime\fP(2) でナノ秒が得られるが、広く利用可能な訳ではない。 .SH バグ .LP -.\"O Under libc4 and libc5 the \fImillitm\fP field is meaningful. -.\"O But early glibc2 is buggy and returns 0 there; -\"O glibc 2.1.1 is correct again. -\fImillitm\fP フィールドは、libc4 と libc5 では正しく動作する。 -しかし、初期の glibc2 ではバグがあり、常に 0 を返す。 -glibc 2.1.1 から再び正常になった。 -\"O .\" .SH HISTORY -\"O .\" The -\"O .\" .B ftime() -\"O .\" function appeared in 4.2BSD. -.\" .SH 歴史 +.\" .SH HISTORY +.\" The .\" .BR ftime () -.\" 関数は 4.2BSD に現れた。 -\"O .SH "SEE ALSO" +.\" function appeared in 4.2BSD. +\fImillitm\fP フィールドは、libc4 と libc5 では正しく動作する。 しかし、初期の glibc2 ではバグがあり、常に 0 を返す。 +glibc 2.1.1 から再び正常になった。 .SH 関連項目 -.BR gettimeofday (2), -.BR time (2) +\fBgettimeofday\fP(2), \fBtime\fP(2) diff --git a/draft/man3/futimes.3 b/draft/man3/futimes.3 index 41129888..b9316aa7 100644 --- a/draft/man3/futimes.3 +++ b/draft/man3/futimes.3 @@ -22,129 +22,49 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved. -.\" Translated 2006-07-31, Akihiro MOTOKI -.\" Updated 2008-08-07, Akihiro MOTOKI, LDP v3.05 +.\"******************************************************************* .\" -.\"WORD: access time アクセス時刻 -.\"WORD: modification time 修正時刻 +.\" This file was generated with po4a. Translate the source file. .\" -.TH FUTIMES 3 2008-04-07 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH FUTIMES 3 2008\-04\-07 Linux "Linux Programmer's Manual" .SH 名前 -.\"O futimes, lutimes \- change file timestamps futimes, lutimes \- ファイルのタイムスタンプを変更する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP -.BI "int futimes(int " fd ", const struct timeval " tv [2]); +\fBint futimes(int \fP\fIfd\fP\fB, const struct timeval \fP\fItv\fP\fB[2]);\fP -.BI "int lutimes(const char *" filename ", const struct timeval " tv [2]); +\fBint lutimes(const char *\fP\fIfilename\fP\fB, const struct timeval \fP\fItv\fP\fB[2]);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR futimes (), -.BR lutimes (): -_BSD_SOURCE -.\"O .SH DESCRIPTION +\fBfutimes\fP(), \fBlutimes\fP(): _BSD_SOURCE .SH 説明 -.\"O .BR futimes () -.\"O changes the access and modification times of a file in the same way as -.\"O .BR utimes (2), -.\"O with the difference that the file whose timestamps are to be changed -.\"O is specified via a file descriptor, -.\"O .IR fd , -.\"O rather than via a pathname. -.BR futimes () -は -.BR utimes (2) -と同じ方法でファイルのアクセス時刻と修正時刻を変更する。 -違いは、タイムスタンプを変更するファイルを、 -パス名ではなく、ファイルディスクリプタ -.I fd -を用いて指定する点である。 +\fBfutimes\fP() は \fButimes\fP(2) と同じ方法でファイルのアクセス時刻と修正時刻を変更する。 +違いは、タイムスタンプを変更するファイルを、 パス名ではなく、ファイルディスクリプタ \fIfd\fP を用いて指定する点である。 -.\"O .BR lutimes () -.\"O changes the access and modification times of a file in the same way as -.\"O .BR utimes (2), -.\"O with the difference that if -.\"O .I filename -.\"O refers to a symbolic link, then the link is not dereferenced: -.\"O instead, the timestamps of the symbolic link are changed. -.BR lutimes () -は -.BR utimes (2) -と同じ方法でファイルのアクセス時刻と修正時刻を変更する。 -違いは、 -.I filename -がシンボリック・リンクを参照している場合に、リンクの展開を行わず、 -代わりにシンボリック・リンクのタイムスタンプを変更する。 -.\"O .SH "RETURN VALUE" +\fBlutimes\fP() は \fButimes\fP(2) と同じ方法でファイルのアクセス時刻と修正時刻を変更する。 違いは、 \fIfilename\fP +がシンボリック・リンクを参照している場合に、リンクの展開を行わず、 代わりにシンボリック・リンクのタイムスタンプを変更する。 .SH 返り値 -.\"O On success, zero is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功すると 0 を返す。エラーの場合 \-1 を返し、 -.I errno -を適切に設定する。 -.\"O .SH ERRORS +成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.\"O Errors are as for -.\"O .BR utimes (2), -.\"O with the following additions for -.\"O .BR futimes (): -エラーは -.BR utimes (2) -と同じだが、 -.BR futimes () -では以下のエラーが追加になっている: -.TP -.B EBADF -.\"O .I fd -.\"O is not a valid file descriptor. -.I fd -が有効なファイルディスクリプタでない。 -.TP -.B ENOSYS -.\"O The -.\"O .I /proc -.\"O file system could not be accessed. -.I /proc -ファイルシステムにアクセスできなかった。 -.\"O .SH VERSIONS +エラーは \fButimes\fP(2) と同じだが、 \fBfutimes\fP() では以下のエラーが追加になっている: +.TP +\fBEBADF\fP +\fIfd\fP が有効なファイルディスクリプタでない。 +.TP +\fBENOSYS\fP +\fI/proc\fP ファイルシステムにアクセスできなかった。 .SH バージョン -.\"O .BR futimes () -.\"O is available since glibc 2.3. -.BR futimes () -は glibc 2.3 以降で利用可能である。 -.\"O .BR lutimes () -.\"O is available since glibc 2.6, and is implemented using the -.\"O .BR utimensat (2) -.\"O system call, which is supported since kernel 2.6.22. -.BR lutimes () -は glibc 2.6 以降で利用可能であり、 -.BR utimensat (2) -システムコールを使って実装されている。 -.BR utimensat (2) -はカーネル 2.6.22 以降でサポートされている。 -.\"O .SH "CONFORMING TO" +\fBfutimes\fP() は glibc 2.3 以降で利用可能である。 \fBlutimes\fP() は glibc 2.6 以降で利用可能であり、 +\fButimensat\fP(2) システムコールを使って実装されている。 \fButimensat\fP(2) はカーネル 2.6.22 +以降でサポートされている。 .SH 準拠 -.\"O These functions are not specified in any standard. -.\"O Other than Linux, they are only available on the BSDs. -これらの関数はどの標準でも規定されていない。 -Linux 以外では、これらは BSD でのみ利用可能である。 -.\"O .SH "SEE ALSO" +これらの関数はどの標準でも規定されていない。 Linux 以外では、これらは BSD でのみ利用可能である。 .SH 関連項目 -.BR utime (2), -.BR utimensat (2), -.BR symlink (7) +\fButime\fP(2), \fButimensat\fP(2), \fBsymlink\fP(7) diff --git a/draft/man3/gamma.3 b/draft/man3/gamma.3 index eb2142c0..121f4804 100644 --- a/draft/man3/gamma.3 +++ b/draft/man3/gamma.3 @@ -3,172 +3,70 @@ .\" .\" Modified 2003-11-18, aeb: historical remarks .\" -.\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI -.\" all rights reserved. -.\" historical remarks: Japanese Version Copyright (c) 2005 SAITOH Akira -.\" all rights reserved. -.\" Translated Sun Sep 22 08:34:42 2002 -.\" by Akihiro MOTOKI -.\" Updated & Modified Sat Feb 19 05:50:00 2005 -.\" by SAITOH Akira -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH GAMMA 3 2008-08-05 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O gamma, gammaf, gammal \- (logarithm of the) gamma function +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GAMMA 3 2008\-08\-05 GNU "Linux Programmer's Manual" .SH 名前 gamma, gammaf, gammal \- ガンマ関数 (の自然対数) -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "double gamma(double " x ");" +\fBdouble gamma(double \fP\fIx\fP\fB);\fP .br -.BI "float gammaf(float " x ");" +\fBfloat gammaf(float \fP\fIx\fP\fB);\fP .br -.BI "long double gammal(long double " x ");" +\fBlong double gammal(long double \fP\fIx\fP\fB);\fP .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR gamma (): +\fBgamma\fP(): .RS 4 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE .RE -.BR gammaf (), -.BR gammal (): +\fBgammaf\fP(), \fBgammal\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 .\" Also seems to work: -std=c99 -D_XOPEN_SOURCE +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O These functions are deprecated: instead, use either the -.\"O .BR tgamma (3) -.\"O or the -.\"O .BR lgamma (3) -.\"O functions, as appropriate. -これらの関数は非推奨である。その代わり、場面に応じて -.BR tgamma (3) -か -.BR lgamma (3) -を使うこと。 +これらの関数は非推奨である。その代わり、場面に応じて \fBtgamma\fP(3) か \fBlgamma\fP(3) を使うこと。 -.\"O For the definition of the Gamma function, see -.\"O .BR tgamma (3). -ガンマ関数の定義については、 -.BR tgamma (3) -を参照のこと。 -.\"O .SS "*BSD version" +ガンマ関数の定義については、 \fBtgamma\fP(3) を参照のこと。 .SS *BSD版 -.\"O The libm in 4.4BSD and some versions of FreeBSD had a -.\"O .BR gamma () -.\"O function that computes the Gamma function, as one would expect. -4.4BSD の libm と FreeBSD のいくつかのバージョンには、関数 -.BR gamma () +4.4BSD の libm と FreeBSD のいくつかのバージョンには、関数 \fBgamma\fP() が含まれており、期待通りガンマ関数を計算できる。 -.\"O .SS "glibc version" .SS glibc版 -.\"O Glibc has a -.\"O .BR gamma () -.\"O function that is equivalent to -.\"O .BR lgamma (3) -.\"O and computes the natural logarithm of the Gamma function. -Glibcは、関数 -.BR gamma () -を含んでいるが、これは -.BR lgamma (3) -と等価であり、ガンマ関数の自然対数を計算する。 -.\"O .SH RETURN VALUE +Glibcは、関数 \fBgamma\fP() を含んでいるが、これは \fBlgamma\fP(3) と等価であり、ガンマ関数の自然対数を計算する。 .SH 返り値 -.\"O See -.\"O .BR lgamma (3). -.BR lgamma (3) -を参照。 -.\"O .SH ERRORS +\fBlgamma\fP(3) を参照。 .SH エラー -.\"O See -.\"O .BR lgamma (3). -.BR lgamma (3) -を参照。 -.\"O .SH "CONFORMING TO" +\fBlgamma\fP(3) を参照。 .SH 準拠 -.\"O Because of historical variations in behavior across systems, -.\"O this function is not specified in any standard. -システムによって振舞いが異なるという歴史的な経緯のため、 -この関数はどの標準規格でも規定されていない。 -.\"O .SH NOTES +システムによって振舞いが異なるという歴史的な経緯のため、 この関数はどの標準規格でも規定されていない。 .SH 注意 -.\"O .SS History .SS 歴史 -.\"O 4.2BSD had a -.\"O .BR gamma () -.\"O that computed -.\"O .RI ln(|Gamma(| x |)|), -.\"O leaving the sign of -.\"O .RI Gamma(| x |) -.\"O in the external integer -.\"O .IR signgam . -4.2BSDにおいては、関数 -.BR gamma () -が実際に計算するのは -.RI ln(|Gamma(| x |)|) -であり、 -.RI Gamma(| x |) -の符号が extern int \fIsigngam\fP に格納されていた。 -.\"O In 4.3BSD the name was changed to -.\"O .BR lgamma (3), -.\"O and the man page promises -.\"O .sp -.\"O .in +4n -.\"O "At some time in the future the name gamma will be rehabilitated -.\"O and used for the Gamma function" -.\"O .in -.\"O .sp -4.3BSDになって関数名が変更され、 -.BR lgamma (3) -となり、そのマニュアルページでは +4.2BSDにおいては、関数 \fBgamma\fP() が実際に計算するのは ln(|Gamma(|\fIx\fP|)|) であり、 +Gamma(|\fIx\fP|) の符号が extern int \fIsigngam\fP に格納されていた。 4.3BSDになって関数名が変更され、 +\fBlgamma\fP(3) となり、そのマニュアルページでは .sp .in +4n -「いつの日か gamma の名は復活し、ガンマ関数に冠されるであろう」 +"「いつの日か gamma の名は復活し、ガンマ関数に冠されるであろう」" .in .sp -という誓いが述べられていた。 -.\"O This did indeed happen in 4.4BSD, where -.\"O .BR gamma () -.\"O computes the Gamma function (with no effect on -.\"O .IR signgam ). -.\"O However, this came too late, and we now have -.\"O .BR tgamma (3), -.\"O the "true gamma" function. .\" The FreeBSD man page says about gamma() that it is like lgamma() .\" except that is does not set signgam. .\" Also, that 4.4BSD has a gamma() that computes the true gamma function. -これは4.4BSDになって実現され、 -.BR gamma () -はまさにガンマ関数を計算するようになった。 -(もう \fIsigngam\fP には作用しない。) -ところが、これが登場する時期が遅すぎたため、 -.BR tgamma (3) +という誓いが述べられていた。 これは4.4BSDになって実現され、 \fBgamma\fP() はまさにガンマ関数を計算するようになった。 (もう +\fIsigngam\fP には作用しない。) ところが、これが登場する時期が遅すぎたため、 \fBtgamma\fP(3) という「本当のガンマ関数」がすでに存在しているのである。 -.\" FreeBSDのマニュアルによれば、gamma()はsigngamをセットしない -.\" ことを除けばlgamma()と同様だという。 -.\" また、4.4BSDではgamma()は本当のガンマ関数を計算するともいう。 -.\"O .SH "SEE ALSO" -.\"O .BR lgamma (3), -.\"O .BR signgam (3), -.\"O .BR tgamma (3) .SH 関連項目 -.BR lgamma (3), -.BR signgam (3), -.BR tgamma (3) +\fBlgamma\fP(3), \fBsigngam\fP(3), \fBtgamma\fP(3) diff --git a/draft/man3/gcvt.3 b/draft/man3/gcvt.3 index a5634d28..092c4066 100644 --- a/draft/man3/gcvt.3 +++ b/draft/man3/gcvt.3 @@ -25,104 +25,52 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 19:32:25 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 Hiroaki Nagoya -.\" all rights reserved. -.\" Translated Mon Feb 10 1997 by Hiroaki Nagoya -.\" Updated & Modified Wed Feb 16 23:43:45 JST 2005 -.\" by Yuichi SATO -.\" Updated 2008-09-16, Akihiro MOTOKI -.\" Updated 2009-04-24, Akihiro MOTOKI, LDP v3.20 +.\" This file was generated with po4a. Translate the source file. .\" -.TH GCVT 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH GCVT 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O gcvt \- convert a floating-point number to a string gcvt \- 浮動小数点数を文字列へ変換する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "char *gcvt(double " number ", size_t " ndigit ", char *" buf ); +\fBchar *gcvt(double \fP\fInumber\fP\fB, size_t \fP\fIndigit\fP\fB, char *\fP\fIbuf\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR gcvt (): +\fBgcvt\fP(): .ad l .PD 0 .RS 4 -.TP 4 -.\"O Since glibc 2.10: -glibc 2.10 以降: +.TP 4 +glibc 2.12 以降: .nf _SVID_SOURCE || (_XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) && !(_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600) .fi -.TP 4 -.\"O Before glibc 2.10: -glibc 2.10 より前: -_SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED +.TP 4 +glibc 2.12 より前: +_SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE && +_XOPEN_SOURCE_EXTENDED .RE .PD .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR gcvt () -.\"O function converts \fInumber\fP to a minimal length null-terminated -.\"O ASCII string and stores the result in \fIbuf\fP. -.\"O It produces \fIndigit\fP significant digits in either -.\"O .BR printf (3) -.\"O F format or E format. -関数 -.BR gcvt () -は、 \fInumber\fP を、最短の長さの NULL 終端された ASCII -文字列へ変換し、変換後の文字列を \fIbuf\fP に格納する。 -.BR printf (3) -の F フォーマットや E フォーマットのように \fIndigit\fP 桁の -有効数字を生成する。 -.\"O .SH "RETURN VALUE" +関数 \fBgcvt\fP() は、 \fInumber\fP を、最短の長さの NULL 終端された ASCII 文字列へ変換し、変換後の文字列を \fIbuf\fP +に格納する。 \fBprintf\fP(3) の F フォーマットや E フォーマットのように \fIndigit\fP 桁の 有効数字を生成する。 .SH 返り値 -.\"O The -.\"O .BR gcvt () -.\"O function returns the address of the string pointed to -.\"O by \fIbuf\fP. -関数 -.BR gcvt () -は文字列 \fIbuf\fP へのポインタを返す。 -.\"O .SH "CONFORMING TO" +関数 \fBgcvt\fP() は文字列 \fIbuf\fP へのポインタを返す。 .SH 準拠 -.\"O Marked as LEGACY in POSIX.1-2001. -POSIX.1-2001 では、 -この関数は「過去の名残 (LEGACY)」と位置付けられている。 -.\"O POSIX.1-2008 removes the specification of -.\"O .BR gcvt (), -.\"O recommending the use of -.\"O .BR sprintf (3) -.\"O instead (though -.\"O .BR snprintf (3) -.\"O may be preferable). -POSIX.1-2008 では、 -.BR gcvt () -の仕様は削除され、 -代わりに -.BR sprintf (3) -を使用することが推奨されている -.RB ( snprintf (3) +POSIX.1\-2001 では、 この関数は「過去の名残 (LEGACY)」と位置付けられている。 POSIX.1\-2008 では、 \fBgcvt\fP() +の仕様は削除され、 代わりに \fBsprintf\fP(3) を使用することが推奨されている (\fBsnprintf\fP(3) の方が適切かもしれないが)。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR ecvt (3), -.BR fcvt (3), -.BR sprintf (3) +\fBecvt\fP(3), \fBfcvt\fP(3), \fBsprintf\fP(3) diff --git a/draft/man3/getcwd.3 b/draft/man3/getcwd.3 index 30709478..5f537f65 100644 --- a/draft/man3/getcwd.3 +++ b/draft/man3/getcwd.3 @@ -27,406 +27,121 @@ .\" Modified Mon Dec 11 13:32:51 MET 2000 by aeb .\" Modified Thu Apr 22 03:49:15 CEST 2002 by Roger Luethi .\" -.\" Japanese Version Copyright (c) 1997 IMAMURA Nobutaka -.\" all rights reserved. -.\" Translated Fri Feb 14 12:40:22 JST 1997 -.\" by IMAMURA Nobutaka -.\" Modified Thu Dec 8 05:08:44 JST 1999 -.\" by Kentaro Shirakata -.\" Modified Sun Mar 12 21:08:44 JST 2000 -.\" by HANATAKA Shinya -.\" Updated 2001-01-29 by Kentaro Shirakata -.\" Updated 2002-03-23 by Kentaro Shirakata -.\" Updated 2002-10-17 by Kentaro Shirakata -.\" Updated 2007-01-01 by Kentaro Shirakata -.\" Updated 2008-08-21, Akihiro MOTOKI , LDP v3.07 +.\"******************************************************************* .\" -.\" WORD: current working directory カレントワーキングディレクトリ -.\" WORD: LEGACY 「過去の名残(LEGACY)」 +.\" This file was generated with po4a. Translate the source file. .\" -.TH GETCWD 3 2010-09-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH GETCWD 3 2010\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 -.\"O getcwd, getwd, get_current_dir_name \- Get current working directory getcwd, getwd, get_current_dir_name \- カレントワーキングディレクトリ名の取得 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "char *getcwd(char *" buf ", size_t " size ); +\fBchar *getcwd(char *\fP\fIbuf\fP\fB, size_t \fP\fIsize\fP\fB);\fP .sp -.BI "char *getwd(char *" buf ); +\fBchar *getwd(char *\fP\fIbuf\fP\fB);\fP .sp -.B "char *get_current_dir_name(void);" +\fBchar *get_current_dir_name(void);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .sp .in -.BR get_current_dir_name (): +\fBget_current_dir_name\fP(): .RS _GNU_SOURCE .RE .sp -.BR getwd (): +\fBgetwd\fP(): .ad l .RS 4 .PD 0 -.TP 4 -.\"O Since glibc 2.10: -glibc 2.10 以降: +.TP 4 +glibc 2.12 以降: .nf _BSD_SOURCE || (_XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) && !(_POSIX_C_SOURCE\ >=\ 200809L || _XOPEN_SOURCE\ >=\ 700) +.TP 4 .fi -.TP 4 -.\"O Before glibc 2.10: -glibc 2.10 より前: -_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +glibc 2.12 より前: _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .PD .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O These functions return a null-terminated string containing an -.\"O absolute pathname that is the current working directory of -.\"O the calling process. -.\"O The pathname is returned as the function result and via the argument -.\"O .IR buf , -.\"O if present. -これらの関数は、呼び出したプロセスのカレントワーキングディレクトリの -絶対パス名 (absolute pathname) が入った文字列を返す。 -返される文字列は NULL で終端される。 -パス名は関数の結果として返され、引数 -.I buf -がある場合は -.I buf -経由でも返される。 +これらの関数は、呼び出したプロセスのカレントワーキングディレクトリの 絶対パス名 (absolute pathname) が入った文字列を返す。 +返される文字列は NULL で終端される。 パス名は関数の結果として返され、引数 \fIbuf\fP がある場合は \fIbuf\fP 経由でも返される。 -.\"O The -.\"O .BR getcwd () -.\"O function copies an absolute pathname of the current working directory -.\"O to the array pointed to by -.\"O .IR buf , -.\"O which is of length -.\"O .IR size . -.BR getcwd () -関数はカレントワーキングディレクトリの絶対パス名を -.I buf -で示された -.I size -長の配列にコピーする。 +\fBgetcwd\fP() 関数はカレントワーキングディレクトリの絶対パス名を \fIbuf\fP で示された \fIsize\fP 長の配列にコピーする。 .PP -.\"O If the length of the absolute pathname of the current working directory, -.\"O including the terminating null byte, exceeds -.\"O .I size -.\"O bytes, NULL is returned, and -.\"O .I errno -.\"O is set to -.\"O .BR ERANGE ; -.\"O an application should check for this error, and allocate a larger -.\"O buffer if necessary. -終端の NULL バイトも含めた、カレントワーキングディレクトリの -絶対パス名の長さが -.I size -バイトを超えている場合は、返り値として NULL が返り -.I errno -に -.B ERANGE -がセットされる。 -アプリケーションはこのエラーをチェックし、 +終端の NULL バイトも含めた、カレントワーキングディレクトリの 絶対パス名の長さが \fIsize\fP バイトを超えている場合は、返り値として NULL +が返り \fIerrno\fP に \fBERANGE\fP がセットされる。 アプリケーションはこのエラーをチェックし、 必要に応じてより長いバッファを用意すべきである。 .PP -.\"O As an extension to the POSIX.1-2001 standard, Linux (libc4, libc5, glibc) -.\"O .BR getcwd () -.\"O allocates the buffer dynamically using -.\"O .BR malloc (3) -.\"O if -.\"O .I buf -.\"O is NULL. -.\"O In this case, the allocated buffer has the length -.\"O .I size -.\"O unless -.\"O .I size -.\"O is zero, when -.\"O .I buf -.\"O is allocated as big as necessary. -.\"O The caller should -.\"O .BR free (3) -.\"O the returned buffer. -POSIX.1-2001 標準の拡張として、 -Linux (libc4, libc5, glibc) では -.I buf -が NULL の場合、 -.BR getcwd () -は必要なバッファを -.BR malloc (3) -を用いて動的に割り当てる。 -この場合、 -.I size -が 0 の場合を除き、バッファの長さは -.I size -となる。 -.I size -が 0 の場合には必要な大きさが確保される。 -呼び出し側で、返されたバッファを -.BR free (3) -すべきである。 +POSIX.1\-2001 標準の拡張として、 Linux (libc4, libc5, glibc) では \fIbuf\fP が NULL の場合、 +\fBgetcwd\fP() は必要なバッファを \fBmalloc\fP(3) を用いて動的に割り当てる。 この場合、 \fIsize\fP が 0 +の場合を除き、バッファの長さは \fIsize\fP となる。 \fIsize\fP が 0 の場合には必要な大きさが確保される。 呼び出し側で、返されたバッファを +\fBfree\fP(3) すべきである。 -.\"O .BR get_current_dir_name () -.\"O will -.\"O .BR malloc (3) -.\"O an array big enough to hold the absolute pathname of -.\"O the current working directory. -.\"O If the environment -.\"O variable -.\"O .B PWD -.\"O is set, and its value is correct, then that value will be returned. -.BR get_current_dir_name () -はカレントワーキングディレクトリの絶対パス名を収めるのに -十分な大きさの配列を -.BR malloc (3) -で獲得する。環境変数 -.B PWD -が設定されておりその値が正しければ、その値が返される。 -.\"O The caller should -.\"O .BR free (3) -.\"O the returned buffer. -呼び出し側で、返されたバッファを -.BR free (3) -すべきである。 +\fBget_current_dir_name\fP() はカレントワーキングディレクトリの絶対パス名を収めるのに 十分な大きさの配列を +\fBmalloc\fP(3) で獲得する。環境変数 \fBPWD\fP が設定されておりその値が正しければ、その値が返される。 呼び出し側で、返されたバッファを +\fBfree\fP(3) すべきである。 -.\"O .BR getwd () -.\"O does not -.\"O .BR malloc (3) -.\"O any memory. -.\"O The -.\"O .I buf -.\"O argument should be a pointer to an array at least -.\"O .B PATH_MAX -.\"O bytes long. -.\"O If the length of the absolute pathname of the current working directory, -.\"O including the terminating null byte, exceeds -.\"O .B PATH_MAX -.\"O bytes, NULL is returned, and -.\"O .I errno -.\"O is set to -.\"O .BR ENAMETOOLONG . -.BR getwd () -は -.BR malloc (3) -によるメモリ獲得を一切行なわない。 -.I buf -引数は少なくとも -.B PATH_MAX -バイトの長さを持つ配列へのポインタである必要がある。 -終端の NULL バイトも含めた、カレントワーキングディレクトリの -絶対パス名の長さが -.B PATH_MAX -バイトを超えている場合、 -NULL が返され、 -.I errno -に -.B ENAMETOOLONG -が設定される。 -.\"O (Note that on some systems, -.\"O .B PATH_MAX -.\"O may not be a compile-time constant; -.\"O furthermore, its value may depend on the file system, see -.\"O .BR pathconf (3).) -.\"O For portability and security reasons, use of -.\"O .BR getwd () -.\"O is deprecated. -(システムによっては、 -.B PATH_MAX -は必ずしもコンパイル時に決まる定数ではない点に注意すること。 -また、ファイルシステムに依存する場合もある。 -.BR pathconf (3) -を参照。) -移植性とセキュリティ上の理由から、 -.BR getwd () +\fBgetwd\fP() は \fBmalloc\fP(3) によるメモリ獲得を一切行なわない。 \fIbuf\fP 引数は少なくとも \fBPATH_MAX\fP +バイトの長さを持つ配列へのポインタである必要がある。 終端の NULL バイトも含めた、カレントワーキングディレクトリの 絶対パス名の長さが +\fBPATH_MAX\fP バイトを超えている場合、 NULL が返され、 \fIerrno\fP に \fBENAMETOOLONG\fP が設定される。 +(システムによっては、 \fBPATH_MAX\fP は必ずしもコンパイル時に決まる定数ではない点に注意すること。 +また、ファイルシステムに依存する場合もある。 \fBpathconf\fP(3) を参照。) 移植性とセキュリティ上の理由から、 \fBgetwd\fP() の利用は推奨されない。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O On success, these functions return a pointer to a string containing -.\"O the pathname of the current working directory. -.\"O In the case -.\"O .BR getcwd () -.\"O and -.\"O .BR getwd () -.\"O this is the same value as -.\"O .IR buf . -成功すると、これらの関数はカレントワーキングディレクトリの絶対パス名 -が入った文字列へのポインタを返す。 -.BR getcwd () -と -.BR getwd () -の場合、返り値は -.I buf -と同じ値になる。 +成功すると、これらの関数はカレントワーキングディレクトリの絶対パス名 が入った文字列へのポインタを返す。 \fBgetcwd\fP() と +\fBgetwd\fP() の場合、返り値は \fIbuf\fP と同じ値になる。 -.\"O On failure, these functions return NULL, and -.\"O .I errno -.\"O is set to indicate the error. -.\"O The contents of the array pointed to by -.\"O .I buf -.\"O are undefined on error. -失敗した場合、これらの関数は NULL を返し、 -.I errno -にエラーを示す値を設定する。 -.I buf -が指す配列の内容は未定義である。 -.\"O .SH ERRORS +失敗した場合、これらの関数は NULL を返し、 \fIerrno\fP にエラーを示す値を設定する。 \fIbuf\fP が指す配列の内容は未定義である。 .SH エラー -.TP -.B EACCES -.\"O Permission to read or search a component of the filename was denied. +.TP +\fBEACCES\fP ファイル名の構成要素に対する読み込みあるいは検索の権限がない。 -.TP -.B EFAULT -.\"O .I buf -.\"O points to a bad address. -.I buf -が不正なアドレスを指している。 -.TP -.B EINVAL -.\"O The -.\"O .I size -.\"O argument is zero and -.\"O .I buf -.\"O is not a NULL pointer. -.I size -引数が 0 かつ、 -.I buf -引数が NULL ポインタでない。 -.TP -.B EINVAL -.\"O .BR getwd (): -.\"O .I buf -.\"O is NULL. -.BR getwd (): -.I buf -が NULL である。 -.TP -.B ENAMETOOLONG -.\"O .BR getwd (): -.\"O The size of the null-terminated absolute pathname string exceeds -.\"O .B PATH_MAX -.\"O bytes. -.BR getwd (): -絶対パス名が入った NULL 終端された文字列の長さが -.B PATH_MAX -バイトを超えている。 -.TP -.B ENOENT -.\"O The current working directory has been unlinked. +.TP +\fBEFAULT\fP +\fIbuf\fP が不正なアドレスを指している。 +.TP +\fBEINVAL\fP +\fIsize\fP 引数が 0 かつ、 \fIbuf\fP 引数が NULL ポインタでない。 +.TP +\fBEINVAL\fP +\fBgetwd\fP(): \fIbuf\fP が NULL である。 +.TP +\fBENAMETOOLONG\fP +\fBgetwd\fP(): 絶対パス名が入った NULL 終端された文字列の長さが \fBPATH_MAX\fP バイトを超えている。 +.TP +\fBENOENT\fP カレントワーキングディレクトリが削除されている。 -.TP -.B ERANGE -.\"O The -.\"O .I size -.\"O argument is less than the length of the absolute pathname of the -.\"O working directory, including the terminating null byte. -.\"O You need to allocate a bigger array and try again. -.I size -引数の値がワーキングディレクトリの絶対パス名の長さより小さい。 -長さには文字列の終端バイトも含まれる。 +.TP +\fBERANGE\fP +\fIsize\fP 引数の値がワーキングディレクトリの絶対パス名の長さより小さい。 長さには文字列の終端バイトも含まれる。 より大きい配列を確保してもう一度実行する必要がある。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O .BR getcwd () -.\"O conforms to POSIX.1-2001. -.BR getcwd () -は POSIX.1-2001 に準拠している。 -.\"O Note however that POSIX.1-2001 leaves the behavior of -.\"O .BR getcwd () -.\"O unspecified if -.\"O .I buf -.\"O is NULL. -POSIX.1-2001 は、 -.I buf -が NULL の場合の -.BR getcwd () -の動作を規定しないままとしている。 +\fBgetcwd\fP() は POSIX.1\-2001 に準拠している。 POSIX.1\-2001 は、 \fIbuf\fP が NULL の場合の +\fBgetcwd\fP() の動作を規定しないままとしている。 -.\"O .BR getwd () -.\"O is present in POSIX.1-2001, but marked LEGACY. -.BR getwd () -は POSIX.1-2001 に存在しているが、「過去の名残(LEGACY)」とされている。 -.\"O POSIX.1-2008 removes the specification of -.\"O .BR getwd (). -.\"O Use -.\"O .BR getcwd () -.\"O instead. -.\"O POSIX.1-2001 -.\"O does not define any errors for -.\"O .BR getwd (). -POSIX.1-2008 では、 -.BR getwd () -の仕様が削除されている。 -代わりに -.BR getcwd () -を使うこと。 -POSIX.1-2001 は -.BR getwd () +\fBgetwd\fP() は POSIX.1\-2001 に存在しているが、「過去の名残(LEGACY)」とされている。 POSIX.1\-2008 では、 +\fBgetwd\fP() の仕様が削除されている。 代わりに \fBgetcwd\fP() を使うこと。 POSIX.1\-2001 は \fBgetwd\fP() に関するエラーを定義していない。 -.\"O .BR get_current_dir_name () -.\"O is a GNU extension. -.BR get_current_dir_name () -は GNU 拡張である。 -.\"O .SH NOTES +\fBget_current_dir_name\fP() は GNU 拡張である。 .SH 注意 -.\"O Under Linux, the function -.\"O .BR getcwd () -.\"O is a system call (since 2.1.92). -Linux では (2.1.92 以降)、 -.BR getcwd () -はシステムコールである。 -.\"O On older systems it would query -.\"O .IR /proc/self/cwd . -古いシステムでは -.I /proc/self/cwd -を参照する。 -.\"O If both system call and proc file system are missing, a -.\"O generic implementation is called. -.\"O Only in that case can -.\"O these calls fail under Linux with -.\"O .BR EACCES . -システムコールも proc ファイルシステムもない場合、 -一般的な実装が呼び出される。 -この場合においてのみ、(Linux では) この関数は -.B EACCES -で失敗する可能性がある。 +Linux では (2.1.92 以降)、 \fBgetcwd\fP() はシステムコールである。 古いシステムでは \fI/proc/self/cwd\fP +を参照する。 システムコールも proc ファイルシステムもない場合、 一般的な実装が呼び出される。 この場合においてのみ、(Linux では) +この関数は \fBEACCES\fP で失敗する可能性がある。 .LP -.\"O These functions are often used to save the location of the current working -.\"O directory for the purpose of returning to it later. -.\"O Opening the current -.\"O directory (".") and calling -.\"O .BR fchdir (2) -.\"O to return is usually a faster and more reliable alternative when sufficiently -.\"O many file descriptors are available, especially on platforms other than Linux. -これらの関数はしばしばカレントワーキングディレクトリの位置を保存し、 -後で戻ってくるために利用される。 -未使用のファイルディスクリプタが十分ある場合は、 -現在のディレクトリ (".") を開いて -.BR fchdir (2) -を呼び出すほうが普通は高速で信頼性がある。 -特に Linux 以外のプラットフォームの場合はそうである。 -.\"O .SH "SEE ALSO" +これらの関数はしばしばカレントワーキングディレクトリの位置を保存し、 後で戻ってくるために利用される。 未使用のファイルディスクリプタが十分ある場合は、 +現在のディレクトリ (".") を開いて \fBfchdir\fP(2) を呼び出すほうが普通は高速で信頼性がある。 特に Linux +以外のプラットフォームの場合はそうである。 .SH 関連項目 -.BR chdir (2), -.BR fchdir (2), -.BR open (2), -.BR unlink (2), -.BR free (3), -.BR malloc (3) +\fBchdir\fP(2), \fBfchdir\fP(2), \fBopen\fP(2), \fBunlink\fP(2), \fBfree\fP(3), +\fBmalloc\fP(3) diff --git a/draft/man3/getdate.3 b/draft/man3/getdate.3 index 99e29099..10006f5b 100644 --- a/draft/man3/getdate.3 +++ b/draft/man3/getdate.3 @@ -25,343 +25,132 @@ .\" Modified, 2001-12-26, aeb .\" 2008-09-07, mtk, Various rewrites; added an example program. .\" -.\" Japanese Version Copyright (c) 2002 NAKANO Takeo -.\" and Copyright (c) 2008, Akihiro MOTOKI all rights reserved. +.\"******************************************************************* .\" -.\" Translated 2002-01-12, NAKANO Takeo -.\" Updated 2008-09-20, Akihiro MOTOKI , LDP v3.09 +.\" This file was generated with po4a. Translate the source file. .\" -.\"WORD: broken-down time 要素別の時刻 -.\" -.TH GETDATE 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH GETDATE 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O getdate, getdate_r \- convert a date-plus-time string to broken-down time getdate, getdate_r \- 日付と時刻の文字列を要素別の時刻に変換する -.\"O .SH SYNOPSIS .SH 書式 -.B "#include " +\fB#include \fP .sp -.BI "struct tm *getdate(const char *" string ); +\fBstruct tm *getdate(const char *\fP\fIstring\fP\fB);\fP .sp -.B "extern int getdate_err;" +\fBextern int getdate_err;\fP .sp -.B "#include " +\fB#include \fP .sp -.BI "int getdate_r(const char *" string ", struct tm *" res ); +\fBint getdate_r(const char *\fP\fIstring\fP\fB, struct tm *\fP\fIres\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR getdate (): +\fBgetdate\fP(): .ad l .RS 4 -_XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +_XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .RE .br -.BR getdate_r (): +\fBgetdate_r\fP(): .ad l .RS 4 _GNU_SOURCE .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The function -.\"O .BR getdate () -.\"O converts a string representation of a date and time, -.\"O contained in the buffer pointed to by -.\"O .IR string , -.\"O into a broken-down time. -.BR getdate () -関数は、 -.I string -が指すバッファに格納された文字列表現の日付と時刻を、 -要素別の時刻 (broken-down time) に変換する。 -.\"O The broken-down time is stored in a -.\"O .I tm -.\"O structure, and a pointer to this -.\"O structure is returned as the function result. -.\"O This -.\"O .I tm -.\"O structure is allocated in static storage, -.\"O and consequently it will be overwritten by further calls to -.\"O .BR getdate (). -要素別の時刻は -.I tm -構造体に格納され、この構造体へのポインタが関数の結果として返される。 -この -.I tm -構造体は静的なメモリ領域にあり、 -.BR getdate () -のそれ以降の呼び出しで上書きされるかもされない。 -.\"O -.PP -.\"O In contrast to -.\"O .BR strptime (3), -.\"O (which has a -.\"O .I format -.\"O argument), -.\"O .BR getdate () -.\"O uses the formats found in the file -.\"O whose full pathname is given in the environment variable -.\"O .BR DATEMSK . -.\"O The first line in the file that matches the given input string -.\"O is used for the conversion. -.RI ( format -引き数でフォーマットを指定する) -.BR strptime (3) -とは違い、 -.BR getdate () -は環境変数 -.B DATEMSK -で指定されたフルパス名のファイルに書いてあるフォーマットを用いる。 -.\"O -.PP -.\"O The matching is done case insensitively. -.\"O Superfluous whitespace, either in the pattern or in the string to -.\"O be converted, is ignored. -マッチの際には大文字小文字を区別しない。 -パターン中でも変換される文字列中でも、余分な空白文字は無視される。 -.\"O -.PP -.\"O The conversion specifications that a pattern can contain are those given for -.\"O .BR strptime (3). -.\"O One more conversion specification is specified in POSIX.1-2001: -パターンに指定できる変換指定は、 -.BR strptime (3) -のものと同じである。 -POSIX.1-2001 では一つの変換指定が追加で規定されている。 -.TP -.B %Z -.\"O Timezone name. -.\"O This is not implemented in glibc. -タイムゾーンの名前。 -glibc では実装されていない。 +\fBgetdate\fP() 関数は、 \fIstring\fP が指すバッファに格納された文字列表現の日付と時刻を、 要素別の時刻 (broken\-down +time) に変換する。 要素別の時刻は \fItm\fP 構造体に格納され、この構造体へのポインタが関数の結果として返される。 この \fItm\fP +構造体は静的なメモリ領域にあり、 \fBgetdate\fP() のそれ以降の呼び出しで上書きされるかもされない。 + +(\fIformat\fP 引き数でフォーマットを指定する) \fBstrptime\fP(3) とは違い、 \fBgetdate\fP() は環境変数 +\fBDATEMSK\fP で指定されたフルパス名のファイルに書いてあるフォーマットを用いる。 + +マッチの際には大文字小文字を区別しない。 パターン中でも変換される文字列中でも、余分な空白文字は無視される。 + +パターンに指定できる変換指定は、 \fBstrptime\fP(3) のものと同じである。 POSIX.1\-2001 +では一つの変換指定が追加で規定されている。 +.TP +\fB%Z\fP +タイムゾーンの名前。 glibc では実装されていない。 .LP -.\"O When -.\"O .B %Z -.\"O is given, the structure containing the broken-down time -.\"O is initialized with values corresponding to the current -.\"O time in the given timezone. -.\"O Otherwise, the structure is initialized to the broken-down time -.\"O corresponding to the current local time (as by a call to -.\"O .BR localtime (3)). -.B %Z -が指定された場合、要素別の時刻を格納する構造体は、 -指定されたタイムゾーンにおける現在時刻に対応する値で初期化される。 -指定されていない場合、この構造体は現在のローカルタイムに対応する -要素別の時刻で初期化される -.RB ( localtime (3) +\fB%Z\fP が指定された場合、要素別の時刻を格納する構造体は、 指定されたタイムゾーンにおける現在時刻に対応する値で初期化される。 +指定されていない場合、この構造体は現在のローカルタイムに対応する 要素別の時刻で初期化される (\fBlocaltime\fP(3) を呼び出した場合と同じ)。 .LP -.\"O When only the weekday is given, the day is taken to be the first such day -.\"O on or after today. -曜日だけが指定された場合、 -今日または今日以降で、 -その曜日に合致する最初の日が採用される。 +曜日だけが指定された場合、 今日または今日以降で、 その曜日に合致する最初の日が採用される。 .LP -.\"O When only the month is given (and no year), the month is taken to -.\"O be the first such month equal to or after the current month. -.\"O If no day is given, it is the first day of the month. -(年なしで) 月だけが指定された場合、 -今月または今月以降で、 -その月に合致する最初の月が採用される。 +(年なしで) 月だけが指定された場合、 今月または今月以降で、 その月に合致する最初の月が採用される。 .LP -.\"O When no hour, minute and second are given, the current -.\"O hour, minute and second are taken. -時・分・秒がいずれも指定されなかった場合、 -現在の時・分・秒が採用される。 +時・分・秒がいずれも指定されなかった場合、 現在の時・分・秒が採用される。 .LP -.\"O If no date is given, but we know the hour, then that hour is taken -.\"O to be the first such hour equal to or after the current hour. -日付の指定がなかったが、時間 (hour) だけ指定された場合は、 -現在の時間またはそれ以降で、その指定に合致する最初の時間が採用される。 +日付の指定がなかったが、時間 (hour) だけ指定された場合は、 現在の時間またはそれ以降で、その指定に合致する最初の時間が採用される。 -.\"O .BR getdate_r () -.\"O is a GNU extension that provides a reentrant version of -.\"O .BR getdate (). -.\"O Rather than using a global variable to report errors and a static buffer -.\"O to return the broken down time, -.\"O it returns errors via the function result value, -.\"O and returns the resulting broken-down time in the -.\"O caller-allocated buffer pointed to by the argument -.\"O .IR res . -.BR getdate_r () -は GNU 拡張で -.BR getdate () -のリエントラント版を提供している。 -.BR getdate_r () -では、エラーを報告するのにグローバル変数を使用したり、 -要素別の時刻を返すのに静的なバッファを使用したりせず、 -エラーを関数の返り値経由で報告し、要素別の時刻を -引き数 -.I res -が指し示す呼び出し側で割り当てたバッファに格納して返す。 -.\"O .SH "RETURN VALUE" +\fBgetdate_r\fP() は GNU 拡張で \fBgetdate\fP() のリエントラント版を提供している。 \fBgetdate_r\fP() +では、エラーを報告するのにグローバル変数を使用したり、 要素別の時刻を返すのに静的なバッファを使用したりせず、 +エラーを関数の返り値経由で報告し、要素別の時刻を 引き数 \fIres\fP が指し示す呼び出し側で割り当てたバッファに格納して返す。 .SH 返り値 -.\"O When successful, -.\"O .BR getdate () -.\"O returns a pointer to a -.\"O .IR "struct tm" . -.\"O Otherwise, it returns NULL and sets the global variable -.\"O .IR getdate_err -.\"O to one of the error numbers shown below. -.\"O Changes to -.\"O .I errno -.\"O are unspecified. -成功すると、 -.BR getdate () -は -.I struct tm -へのポインタを返す。 -失敗すると NULL を返し、グローバル変数 -.I getdate_err -に以下に示すエラー番号のいずれか一つを設定する。 -.I errno -の変更については規定されていない。 +成功すると、 \fBgetdate\fP() は \fIstruct tm\fP へのポインタを返す。 失敗すると NULL を返し、グローバル変数 +\fIgetdate_err\fP に以下に示すエラー番号のいずれか一つを設定する。 \fIerrno\fP の変更については規定されていない。 -.\"O On success -.\"O .BR getdate_r () -.\"O returns 0; -.\"O on error it returns one of the error numbers shown below. -成功すると、 -.BR getdate_r () -は 0 を返す。 -失敗すると、以下に示すエラー番号のいずれか一つを返す。 -.\"O .SH ERRORS +成功すると、 \fBgetdate_r\fP() は 0 を返す。 失敗すると、以下に示すエラー番号のいずれか一つを返す。 .SH エラー -.\"O The following errors are returned via -.\"O .IR getdate_err -.\"O (for -.\"O .BR getdate ()) -.\"O or as the function result (for -.\"O .BR getdate_r ()): -以下のエラーが、 -.RB ( getdate () -では) -.I getdate_err -経由で返され、 -.RB ( getdate_r () -では) 関数の返り値として返される。 -.TP 4n -.B 1 -.\"O The -.\"O .B DATEMSK -.\"O environment variable is not defined, or its value is an empty string. -環境変数 -.B DATEMASK -が未定義、またはその値が空文字列である。 -.TP -.B 2 -.\"O The template file specified by -.\"O .B DATEMSK -.\"O cannot be opened for reading. -.B DATEMSK -で指定されたテンプレートファイルを読み込み用にオープンできない。 -.TP -.B 3 -.\"O Failed to get file status information. -ファイルのステータス情報が取得できない。 +以下のエラーが、 (\fBgetdate\fP() では) \fIgetdate_err\fP 経由で返され、 (\fBgetdate_r\fP() では) +関数の返り値として返される。 +.TP 4n +\fB1\fP +環境変数 \fBDATEMASK\fP が未定義、またはその値が空文字列である。 +.TP +\fB2\fP +\fBDATEMSK\fP で指定されたテンプレートファイルを読み込み用にオープンできない。 +.TP +\fB3\fP .\" stat() -.TP -.B 4 -.\"O The template file is not a regular file. +ファイルのステータス情報が取得できない。 +.TP +\fB4\fP テンプレートファイルが通常のファイルでない。 -.TP -.B 5 -.\"O An error was encountered while reading the template file. +.TP +\fB5\fP テンプレートファイルの読み込み中にエラーが起こった。 -.TP -.B 6 -.\"O Memory allocation failed (not enough memory available). -.\"O .\" Error 6 doesn't seem to occur in glibc +.TP +\fB6\fP +.\" Error 6 doesn't seem to occur in glibc メモリの割り当てに失敗した (メモリが足りない)。 -.\" エラー 6 は glibc では発生しないように見える。 -.TP -.B 7 -.\"O There is no line in the file that matches the input. +.TP +\fB7\fP 入力にマッチしたファイルに、行が含まれていない。 -.TP -.B 8 -.\"O Invalid input specification. +.TP +\fB8\fP 入力指定が正しくない。 -.\"O .SH ENVIRONMENT .SH 環境変数 -.TP -.B DATEMSK -.\"O File containing format patterns. +.TP +\fBDATEMSK\fP 書式パターンを含むファイル。 -.TP -.BR TZ ", " LC_TIME -.\"O Variables used by -.\"O .BR strptime (3). -.BR strptime (3) -が用いる変数。 -.\"O .SH "CONFORMING TO" +.TP +\fBTZ\fP, \fBLC_TIME\fP +\fBstrptime\fP(3) が用いる変数。 .SH 準拠 -POSIX.1-2001. -.\"O .SH NOTES +POSIX.1\-2001. .SH 注意 -.\"O The POSIX.1-2001 specification for -.\"O .BR strptime (3) -.\"O contains conversion specifications using the -.\"O .B %E -.\"O or -.\"O .B %O -.\"O modifier, while such specifications are not given for -.\"O .BR getdate (). -.\"O In glibc, -.\"O .BR getdate () -.\"O is implemented using -.\"O .BR strptime (3), -.\"O so that precisely the same conversions are supported by both. -POSIX.1-2001 仕様では、 -.BR strptime (3) -については -.B %E -や -.B %O -といった修正子を用いた変換指定を規定しているが、 -.BR getdate () -についてはこのような修飾子の規定はない。 -glibc では、 -.BR getdate () -は -.BR strptime (3) -を用いて実装されており、 -両者では全く同じ変換が両者でサポートされている。 -.\"O .SH EXAMPLE +POSIX.1\-2001 仕様では、 \fBstrptime\fP(3) については \fB%E\fP や \fB%O\fP +といった修正子を用いた変換指定を規定しているが、 \fBgetdate\fP() についてはこのような修飾子の規定はない。 glibc では、 +\fBgetdate\fP() は \fBstrptime\fP(3) を用いて実装されており、 両者では全く同じ変換が両者でサポートされている。 .SH 例 -.\"O The program below calls -.\"O .BR getdate () -.\"O for each of its command-line arguments, -.\"O and for each call displays the values in the fields of the returned -.\"O .I tm -.\"O structure. -.\"O The following shell session demonstrates the operation of the program: -以下のプログラムは、コマンドライン引き数のそれぞれについて -.BR getdate () -を呼び出し、それぞれについて返された -.I tm -構造体のフィールド値を表示する。 -次のシェル・セッションは、プログラムの動作例である。 +以下のプログラムは、コマンドライン引き数のそれぞれについて \fBgetdate\fP() を呼び出し、それぞれについて返された \fItm\fP +構造体のフィールド値を表示する。 次のシェル・セッションは、プログラムの動作例である。 .in +4n .nf -.RB "$" " TFILE=$PWD/tfile" -.RB "$" " echo \(aq%A\(aq > $TFILE " " # Full weekday name" -.RB "$" " echo \(aq%T\(aq >> $TFILE" " # ISO date (YYYY-MM-DD)" -.RB "$" " echo \(aq%F\(aq >> $TFILE" " # Time (HH:MM:SS)" -.RB "$" " date" -.RB "$" " export DATEMSK=$TFILE" -.RB "$" " ./a.out Tuesday \(aq2009-12-28\(aq \(aq12:22:33\(aq" +$\fB TFILE=$PWD/tfile\fP +$\fB echo \(aq%A\(aq > $TFILE \fP # Full weekday name +$\fB echo \(aq%T\(aq >> $TFILE\fP # ISO date (YYYY\-MM\-DD) +$\fB echo \(aq%F\(aq >> $TFILE\fP # Time (HH:MM:SS) +$\fB date\fP +$\fB export DATEMSK=$TFILE\fP +$\fB ./a.out Tuesday \(aq2009\-12\-28\(aq \(aq12:22:33\(aq\fP Sun Sep 7 06:03:36 CEST 2008 Call 1 ("Tuesday") succeeded: tm_sec = 36 @@ -373,7 +162,7 @@ Call 1 ("Tuesday") succeeded: tm_wday = 2 tm_yday = 252 tm_isdst = 1 -Call 2 ("2009-12-28") succeeded: +Call 2 ("2009\-12\-28") succeeded: tm_sec = 36 tm_min = 3 tm_hour = 6 @@ -395,7 +184,6 @@ Call 3 ("12:22:33") succeeded: tm_isdst = 1 .fi .in -.\"O .SS Program source .SS プログラムのソース \& .nf @@ -414,30 +202,25 @@ main(int argc, char *argv[]) tmp = getdate(argv[j]); if (tmp == NULL) { - printf("Call %d failed; getdate_err = %d\\n", + printf("Call %d failed; getdate_err = %d\en", j, getdate_err); continue; } - printf("Call %d (\\"%s\\") succeeded:\\n", j, argv[j]); - printf(" tm_sec = %d\\n", tmp\->tm_sec); - printf(" tm_min = %d\\n", tmp\->tm_min); - printf(" tm_hour = %d\\n", tmp\->tm_hour); - printf(" tm_mday = %d\\n", tmp\->tm_mday); - printf(" tm_mon = %d\\n", tmp\->tm_mon); - printf(" tm_year = %d\\n", tmp\->tm_year); - printf(" tm_wday = %d\\n", tmp\->tm_wday); - printf(" tm_yday = %d\\n", tmp\->tm_yday); - printf(" tm_isdst = %d\\n", tmp\->tm_isdst); + printf("Call %d (\e"%s\e") succeeded:\en", j, argv[j]); + printf(" tm_sec = %d\en", tmp\->tm_sec); + printf(" tm_min = %d\en", tmp\->tm_min); + printf(" tm_hour = %d\en", tmp\->tm_hour); + printf(" tm_mday = %d\en", tmp\->tm_mday); + printf(" tm_mon = %d\en", tmp\->tm_mon); + printf(" tm_year = %d\en", tmp\->tm_year); + printf(" tm_wday = %d\en", tmp\->tm_wday); + printf(" tm_yday = %d\en", tmp\->tm_yday); + printf(" tm_isdst = %d\en", tmp\->tm_isdst); } exit(EXIT_SUCCESS); } .fi -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR time (2), -.BR localtime (3), -.BR setlocale (3), -.BR strftime (3), -.BR strptime (3) +\fBtime\fP(2), \fBlocaltime\fP(3), \fBsetlocale\fP(3), \fBstrftime\fP(3), \fBstrptime\fP(3) diff --git a/draft/man3/getdirentries.3 b/draft/man3/getdirentries.3 index d9e2439e..2295b811 100644 --- a/draft/man3/getdirentries.3 +++ b/draft/man3/getdirentries.3 @@ -24,88 +24,35 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. -.\" Translated Thu Apr 30 1998 by NAKANO Takeo +.\"******************************************************************* .\" -.TH GETDIRENTRIES 3 2007-07-26 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O getdirentries \- get directory entries in a file system-independent format +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GETDIRENTRIES 3 2007\-07\-26 GNU "Linux Programmer's Manual" .SH 名前 getdirentries \- ディレクトリのエントリをファイルシステムに依存しない形式で取得する -.\"O .SH SYNOPSIS .SH 書式 +\fB#include \fP +.sp +\fBssize_t getdirentries(int \fP\fIfd\fP\fB, char *\fP\fIbuf\fP\fB, size_t \fP\fInbytes\fP \fB, +off_t *\fP\fIbasep\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR getdirentries (): -_BSD_SOURCE || _SVID_SOURCE -.B #include -.sp -.BI "ssize_t getdirentries(int " fd ", char *" buf ", size_t " nbytes -.BI ", off_t *" basep ); -.\"O .SH DESCRIPTION +\fBgetdirentries\fP(): _BSD_SOURCE || _SVID_SOURCE .SH 説明 -.\"O Read directory entries from the directory specified by -.\"O .I fd -.\"O into -.\"O .IR buf . -.\"O At most -.\"O .I nbytes -.\"O are read. -.\"O Reading starts at offset -.\"O .IR *basep , -.\"O and -.\"O .I *basep -.\"O is updated with the new position after reading. -.I fd -で指定されたディレクトリからエントリを読み、 -.I buf -に格納する。最大で -.I nbytes -が読み込まれる。読み込みはオフセット -.I *basep -から開始され、読み込み終了時には -.I *basep -は新しい位置に更新される。 -.\"O .SH "RETURN VALUE" +\fIfd\fP で指定されたディレクトリからエントリを読み、 \fIbuf\fP に格納する。最大で \fInbytes\fP が読み込まれる。読み込みはオフセット +\fI*basep\fP から開始され、読み込み終了時には \fI*basep\fP は新しい位置に更新される。 .SH 返り値 -.\"O .BR getdirentries () -.\"O returns the number of bytes read or zero when at the end of the directory. -.\"O If an error occurs, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -.BR getdirentries () -は読み込んだバイト数を返すか、ディレクトリの最後にきた場合は 0 を返す。 -エラーが起こったら \-1 を返し、 -.I errno -をエラーに対応する値にセットする。 -.\"O .SH ERRORS +\fBgetdirentries\fP() は読み込んだバイト数を返すか、ディレクトリの最後にきた場合は 0 を返す。 エラーが起こったら \-1 を返し、 +\fIerrno\fP をエラーに対応する値にセットする。 .SH エラー -.\"O See the Linux library source code for details. 詳細は Linux のライブラリソースコードを読んでほしい。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O Not in POSIX.1-2001. -.\"O Present on the BSDs, and a few other systems. -.\"O Use -.\"O .BR opendir (3) -.\"O and -.\"O .BR readdir (3) -.\"O instead. -POSIX.1-2001 にはない。 -BSD に存在し、他にもいくつかのシステムにもある。 -代わりに -.BR opendir (3) -と -.BR readdir (3) -を使用すること。 -.\"O .SH "SEE ALSO" +POSIX.1\-2001 にはない。 BSD に存在し、他にもいくつかのシステムにもある。 代わりに \fBopendir\fP(3) と +\fBreaddir\fP(3) を使用すること。 .SH 関連項目 -.BR lseek (2), -.BR open (2) +\fBlseek\fP(2), \fBopen\fP(2) diff --git a/draft/man3/getenv.3 b/draft/man3/getenv.3 index 6fec0ce1..a9c647de 100644 --- a/draft/man3/getenv.3 +++ b/draft/man3/getenv.3 @@ -28,97 +28,35 @@ .\" Modified Sat Jul 24 19:30:29 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified Fri Feb 14 21:47:50 1997 by Andries Brouwer (aeb@cwi.nl) .\" -.\" Japanese Version Copyright (c) 1997 Taro Morioka -.\" all rights reserved. -.\" Translated Tue 08 04 06:00:00 JST 1997 -.\" by Tarho Morioka (t-morioka@nri.co.jp) -.\" Modified 2003-09-27 by NAKANO Takeo -.\" Updated 2008-08-07, Akihiro MOTOKI , LDP v3.05 +.\"******************************************************************* .\" -.TH GETENV 3 2008-03-17 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O getenv \- get an environment variable +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GETENV 3 2008\-03\-17 GNU "Linux Programmer's Manual" .SH 名前 getenv \- 環境変数を得る -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "char *getenv(const char *" name ); +\fBchar *getenv(const char *\fP\fIname\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR getenv () -.\"O function searches the environment list to find the -.\"O environment variable -.\"O .IR name , -.\"O and returns a pointer to the corresponding -.\"O .I value -.\"O string. -関数 -.BR getenv () -は、環境リストから名前が -.I name -の環境変数を検索し、対応する -.I value -文字列へのポインタを返す。 -.\"O .SH "RETURN VALUE" +関数 \fBgetenv\fP() は、環境リストから名前が \fIname\fP の環境変数を検索し、対応する \fIvalue\fP 文字列へのポインタを返す。 .SH 返り値 -.\"O The -.\"O .BR getenv () -.\"O function returns a pointer to the value in the -.\"O environment, or NULL if there is no match. -関数 -.BR getenv () -は、環境における値 value へのポインタを返す。 -\fIname\fP にマッチする環境変数が存在しないときには NULL を返す。 -.\"O .SH "CONFORMING TO" +関数 \fBgetenv\fP() は、環境における値 value へのポインタを返す。 \fIname\fP にマッチする環境変数が存在しないときには NULL +を返す。 .SH 準拠 -SVr4, POSIX.1-2001, 4.3BSD, C89, C99. -.\"O .SH NOTES +SVr4, POSIX.1\-2001, 4.3BSD, C89, C99. .SH 注意 -.\"O The strings in the environment list are of the form \fIname=value\fP. 環境リストの文字列は \fIname=value\fP という形式をしている。 -.\"O As typically implemented, -.\"O .BR getenv () -.\"O returns a pointer to a string within the environment list. -.\"O The caller must take care not to modify this string, -.\"O since that would change the environment of the process. -通常の実装では、 -.BR getenv () -は環境リスト内の文字列へのポインタを返す。 -呼び出し元はこの文字列を変更しないように注意しなければならない。 +通常の実装では、 \fBgetenv\fP() は環境リスト内の文字列へのポインタを返す。 呼び出し元はこの文字列を変更しないように注意しなければならない。 この文字列を変更すると、そのプロセスの環境を変化させることになるからである。 -.\"O The implementation of -.\"O .BR getenv () -.\"O is not required to be reentrant. -.\"O The string pointed to by the return value of -.\"O .BR getenv () -.\"O may be statically allocated, -.\"O and can be modified by a subsequent call to -.\"O .BR getenv (), -.\"O .BR putenv (3), -.\"O .BR setenv (3), -.\"O or -.\"O .BR unsetenv (3). -.BR getenv () -の実装はリエントラント (再入可能) であることを要求されていない。 -.BR getenv () -の返り値により参照される文字列は静的に割り当てられてもよく、 -文字列の内容は後続の -.BR getenv (), -.BR putenv (3), -.BR setenv (3), -.BR unsetenv (3) -の呼び出しにより変更されることがある。 -.\"O .SH "SEE ALSO" +\fBgetenv\fP() の実装はリエントラント (再入可能) であることを要求されていない。 \fBgetenv\fP() +の返り値により参照される文字列は静的に割り当てられてもよく、 文字列の内容は後続の \fBgetenv\fP(), \fBputenv\fP(3), +\fBsetenv\fP(3), \fBunsetenv\fP(3) の呼び出しにより変更されることがある。 .SH 関連項目 -.BR clearenv (3), -.BR putenv (3), -.BR setenv (3), -.BR unsetenv (3), -.BR environ (7) +\fBclearenv\fP(3), \fBputenv\fP(3), \fBsetenv\fP(3), \fBunsetenv\fP(3), \fBenviron\fP(7) diff --git a/draft/man3/gethostid.3 b/draft/man3/gethostid.3 index 30968092..8a4ec1d5 100644 --- a/draft/man3/gethostid.3 +++ b/draft/man3/gethostid.3 @@ -26,180 +26,68 @@ .\" Portions Copyright 1993 Mitchum DSouza .\" .\" Modified Tue Oct 22 00:22:35 EDT 1996 by Eric S. Raymond +.\"******************************************************************* .\" -.\" (Previously this file is gethostid.2) -.\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki -.\" all rights reserved. -.\" Translated 1997-06-27, SUTO, Mitsuaki -.\" Modified 1999-05-21, HANATAKA Shinya +.\" This file was generated with po4a. Translate the source file. .\" -.\" (Move to section 3 in LDP v3.16 since the interfaces are purely glibc) -.\" Updated 2009-01-16, Akihiro MOTOKI , LDP v3.16 -.\" -.TH GETHOSTID 3 2010-09-20 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH GETHOSTID 3 2010\-09\-20 Linux "Linux Programmer's Manual" .SH 名前 -.\"O gethostid, sethostid \- get or set the unique identifier of the current host gethostid, sethostid \- 現在のホストの固有の識別子を取得/設定する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.B long gethostid(void); +\fBlong gethostid(void);\fP .br -.BI "int sethostid(long " hostid ); +\fBint sethostid(long \fP\fIhostid\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l .br -.BR gethostid (): +\fBgethostid\fP(): .RS 4 -_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .RE -.BR sethostid (): +\fBsethostid\fP(): .RS 4 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR gethostid () -.\"O and -.\"O .BR sethostid () -.\"O respectively get or set a unique 32-bit identifier for the current machine. -.\"O The 32-bit identifier is intended to be unique among all UNIX systems in -.\"O existence. -.\"O This normally resembles the Internet address for the local -.\"O machine, as returned by -.\"O .BR gethostbyname (3), -.\"O and thus usually never needs to be set. -.BR gethostid () -と -.BR sethostid () -は、それぞれ、現在使用しているホストに固有の 32 ビットの識別子の -取得/設定を行う。 -この 32 ビットの識別子は、現在存在している全ての UNIX システム -の中で唯一になるように決められる。通常は -.BR gethostbyname (3) -により返されるローカルマシンの Internet アドレスが代わりに使用され、 +\fBgethostid\fP() と \fBsethostid\fP() は、それぞれ、現在使用しているホストに固有の 32 ビットの識別子の +取得/設定を行う。 この 32 ビットの識別子は、現在存在している全ての UNIX システム の中で唯一になるように決められる。通常は +\fBgethostbyname\fP(3) により返されるローカルマシンの Internet アドレスが代わりに使用され、 普通は識別子をあえて設定する必要はない。 -.\"O The -.\"O .BR sethostid () -.\"O call is restricted to the superuser. -.BR sethostid () -はスーパーユーザしか使用できない。 -.\"O .SH "RETURN VALUE" +\fBsethostid\fP() はスーパーユーザしか使用できない。 .SH 返り値 -.\"O .BR gethostid () -.\"O returns the 32-bit identifier for the current host as set by -.\"O .BR sethostid (). -.BR gethostid () -は、 -.BR sethostid () -によって設定された、現在使用しているホストの 32 ビットの識別子の値を返す。 +\fBgethostid\fP() は、 \fBsethostid\fP() によって設定された、現在使用しているホストの 32 ビットの識別子の値を返す。 -.\"O On success, -.\"O .BR sethostid () -.\"O returns 0; on error, \-1 is returned, and -.\"O .I errno -.\"O is set to indicate the error. -成功すると、 -.BR sethostid () -は 0 を返す。 -エラーの場合、\-1 を返し、 -.I errno -にエラーを示す値を設定する。 -.\"O .SH ERRORS +成功すると、 \fBsethostid\fP() は 0 を返す。 エラーの場合、\-1 を返し、 \fIerrno\fP にエラーを示す値を設定する。 .SH エラー -.\"O .BR sethostid () -.\"O can fail with the following errors: -.BR sethostid () -は以下のエラーで失敗する可能性がある。 -.TP -.B EACCES -.\"O The caller did not have permission to write to the file used -.\"O to store the host ID. -呼び出し元がホスト ID を保存するのに使用されるファイルへの -書き込み許可を持っていなかった。 -.TP -.B EPERM -.\"O The calling process's effective user or group ID is not the same -.\"O as its corresponding real ID. +\fBsethostid\fP() は以下のエラーで失敗する可能性がある。 +.TP +\fBEACCES\fP +呼び出し元がホスト ID を保存するのに使用されるファイルへの 書き込み許可を持っていなかった。 +.TP +\fBEPERM\fP 呼び出し元プロセスの実効 UID/GID が対応する実 UID/GID と同じではない。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O 4.2BSD; these functions were dropped in 4.4BSD. -.\"O SVr4 includes -.\"O .BR gethostid () -.\"O but not -.\"O .BR sethostid (). -.\"O POSIX.1-2001 specifies -.\"O .BR gethostid () -.\"O but not -.\"O .BR sethostid (). -4.2BSD。4.4BSD ではこれらの関数はなくなった。 -SVr4 には -.BR gethostid () -は含まれているが、 -.BR sethostid () -は含まれていない。 -POSIX.1-2001 では、 -.BR gethostid () -は規定されているが、 -.BR sethostid () -は規定されていない。 -.\"O .SH NOTES +4.2BSD。4.4BSD ではこれらの関数はなくなった。 SVr4 には \fBgethostid\fP() は含まれているが、 +\fBsethostid\fP() は含まれていない。 POSIX.1\-2001 では、 \fBgethostid\fP() は規定されているが、 +\fBsethostid\fP() は規定されていない。 .SH 注意 -.\"O In the glibc implementation, the -.\"O .I hostid -.\"O is stored in the file -.\"O .IR /etc/hostid . -.\"O (In glibc versions before 2.2, the file -.\"O .I /var/adm/hostid -.\"O was used.) -glibc の実装では、 -.I hostid -はファイル -.I /etc/hostid -に保存される -(バージョン 2.2 より前の glibc では、 -.I /var/adm/hostid -が使用されていた)。 .\" libc5 used /etc/hostid; libc4 didn't have these functions +glibc の実装では、 \fIhostid\fP はファイル \fI/etc/hostid\fP に保存される (バージョン 2.2 より前の glibc では、 +\fI/var/adm/hostid\fP が使用されていた)。 -.\"O In the glibc implementation, if -.\"O .BR gethostid () -.\"O cannot open the file containing the host ID, -.\"O then it obtains the hostname using -.\"O .BR gethostname (2), -.\"O passes that hostname to -.\"O .BR gethostbyname_r (3) -.\"O in order to obtain the host's IPv4 address, -.\"O and returns a value obtained by bit-twiddling the IPv4 address. -.\"O (This value may not be unique.) -glibc の実装では、ホスト ID を保存したファイルを -オープンできなかった場合、 -.BR gethostid () -は -.BR gethostname (2) -を使ってホスト名を入手し、そのホスト名を -.BR gethostbyname_r (3) -に渡しホストの IPv4 アドレスを取得して、 -その IPv4 アドレスのビット入れ替えを行った値を返す。 -.\"O .SH BUGS +glibc の実装では、ホスト ID を保存したファイルを オープンできなかった場合、 \fBgethostid\fP() は +\fBgethostname\fP(2) を使ってホスト名を入手し、そのホスト名を \fBgethostbyname_r\fP(3) に渡しホストの IPv4 +アドレスを取得して、 その IPv4 アドレスのビット入れ替えを行った値を返す。 .SH バグ -.\"O It is impossible to ensure that the identifier is globally unique. 識別子が世界中で一意であることを保証することはできない。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR hostid (1), -.BR gethostbyname (3) +\fBhostid\fP(1), \fBgethostbyname\fP(3) diff --git a/draft/man3/getifaddrs.3 b/draft/man3/getifaddrs.3 new file mode 100644 index 00000000..48d9ebec --- /dev/null +++ b/draft/man3/getifaddrs.3 @@ -0,0 +1,219 @@ +.\" Copyright (c) 2008 Petr Baudis +.\" and copyright (c) 2009, Linux Foundation, written by Michael Kerrisk +.\" +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" 2008-12-08 Petr Baudis +.\" Rewrite the BSD manpage in the Linux man pages style and account +.\" for glibc specificities, provide an example. +.\" 2009-01-14 mtk, many edits and changes, rewrote example program. +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GETIFADDRS 3 2010\-10\-06 GNU "Linux Programmer's Manual" +.SH 名前 +getifaddrs, freeifaddrs \- get interface addresses +.SH 書式 +.nf +\fB#include \fP +\fB#include \fP +.sp +\fBint getifaddrs(struct ifaddrs **\fP\fIifap\fP\fB);\fP +.sp +\fBvoid freeifaddrs(struct ifaddrs *\fP\fIifa\fP\fB);\fP +.fi +.SH 説明 +The \fBgetifaddrs\fP() function creates a linked list of structures describing +the network interfaces of the local system, and stores the address of the +first item of the list in \fI*ifap\fP. The list consists of \fIifaddrs\fP +structures, defined as follows: +.sp +.in +4n +.nf +struct ifaddrs { + struct ifaddrs *ifa_next; /* Next item in list */ + char *ifa_name; /* Name of interface */ + unsigned int ifa_flags; /* Flags from SIOCGIFFLAGS */ + struct sockaddr *ifa_addr; /* Address of interface */ + struct sockaddr *ifa_netmask; /* Netmask of interface */ + union { + struct sockaddr *ifu_broadaddr; + /* Broadcast address of interface */ + struct sockaddr *ifu_dstaddr; + /* Point\-to\-point destination address */ + } ifa_ifu; +#define ifa_broadaddr ifa_ifu.ifu_broadaddr +#define ifa_dstaddr ifa_ifu.ifu_dstaddr + void *ifa_data; /* Address\-specific data */ +}; +.fi +.in +.PP +The \fIifa_next\fP field contains a pointer to the next structure on the list, +or NULL if this is the last item of the list. +.PP +.\" The constant +.\" .B IF NAMESIZE +.\" indicates the maximum length of this field. +The \fIifa_name\fP points to the null\-terminated interface name. +.PP +The \fIifa_flags\fP field contains the interface flags, as returned by the +\fBSIOCGIFFLAGS\fP \fBioctl\fP(2) operation (see \fBnetdevice\fP(7) for a list of +these flags). +.PP +The \fIifa_addr\fP field points to a structure containing the interface +address. (The \fIsa_family\fP subfield should be consulted to determine the +format of the address structure.) +.PP +The \fIifa_netmask\fP field points to a structure containing the netmask +associated with \fIifa_addr\fP, if applicable for the address family. +.PP +Depending on whether the bit \fBIFF_BROADCAST\fP or \fBIFF_POINTOPOINT\fP is set +in \fIifa_flags\fP (only one can be set at a time), either \fIifa_broadaddr\fP +will contain the broadcast address associated with \fIifa_addr\fP (if +applicable for the address family) or \fIifa_dstaddr\fP will contain the +destination address of the point\-to\-point interface. +.PP +The \fIifa_data\fP field points to a buffer containing address\-family\-specific +data; this field may be NULL if there is no such data for this interface. +.PP +The data returned by \fBgetifaddrs\fP() is dynamically allocated and should be +freed using \fBfreeifaddrs\fP() when no longer needed. +.SH 返り値 +On success, \fBgetifaddrs\fP() returns zero; on error, \-1 is returned, and +\fIerrno\fP is set appropriately. +.SH エラー +\fBgetifaddrs\fP() may fail and set \fIerrno\fP for any of the errors specified +for \fBsocket\fP(2), \fBbind\fP(2), \fBgetsockname\fP(2), \fBrecvmsg\fP(2), +\fBsendto\fP(2), \fBmalloc\fP(3), or \fBrealloc\fP(3). +.SH バージョン +The \fBgetifaddrs\fP() function first appeared in glibc 2.3, but before glibc +2.3.3, the implementation only supported IPv4 addresses; IPv6 support was +added in glibc 2.3.3. Support of address families other than IPv4 is only +available on kernels that support netlink. +.SH 準拠 +.\" , but the BSD-derived documentation generally +.\" appears to be confused and obsolete on this point. +.\" i.e., commonly it still says one of them will be NULL, even if +.\" the ifa_ifu union is already present +Not in POSIX.1\-2001. This function first appeared in BSDi and is present on +the BSD systems, but with slightly different semantics +documented\(emreturning one entry per interface, not per address. This +means \fIifa_addr\fP and other fields can actually be NULL if the interface has +no address, and no link\-level address is returned if the interface has an IP +address assigned. Also, the way of choosing either \fIifa_broadaddr\fP or +\fIifa_dstaddr\fP differs on various systems. +.SH 注意 +The addresses returned on Linux will usually be the IPv4 and IPv6 addresses +assigned to the interface, but also one \fBAF_PACKET\fP address per interface +containing lower\-level details about the interface and its physical layer. +In this case, the \fIifa_data\fP field may contain a pointer to a \fIstruct +net_device_stats\fP, defined in \fI\fP, which contains +various interface attributes and statistics. +.SH 例 +The program below demonstrates the use of \fBgetifaddrs\fP(), \fBfreeifaddrs\fP(), +and \fBgetnameinfo\fP(3). Here is what we see when running this program on one +system: +.in +4n +.nf + +$ \fB./a.out\fP +lo address family: 17 (AF_PACKET) +eth0 address family: 17 (AF_PACKET) +lo address family: 2 (AF_INET) + address: <127.0.0.1> +eth0 address family: 2 (AF_INET) + address: <10.1.1.4> +lo address family: 10 (AF_INET6) + address: <::1> +eth0 address family: 10 (AF_INET6) + address: +.fi +.in +.SS "Program source" +\& +.nf +#include +#include +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + struct ifaddrs *ifaddr, *ifa; + int family, s; + char host[NI_MAXHOST]; + + if (getifaddrs(&ifaddr) == \-1) { + perror("getifaddrs"); + exit(EXIT_FAILURE); + } + + /* Walk through linked list, maintaining head pointer so we + can free list later */ + + for (ifa = ifaddr; ifa != NULL; ifa = ifa\->ifa_next) { + if (ifa\->ifa_addr == NULL) + continue; + + family = ifa\->ifa_addr\->sa_family; + + /* Display interface name and family (including symbolic + form of the latter for the common families) */ + + printf("%s\t address family: %d%s\en", + ifa\->ifa_name, family, + (family == AF_PACKET) ? " (AF_PACKET)" : + (family == AF_INET) ? " (AF_INET)" : + (family == AF_INET6) ? " (AF_INET6)" : ""); + + /* For an AF_INET* interface address, display the address */ + + if (family == AF_INET || family == AF_INET6) { + s = getnameinfo(ifa\->ifa_addr, + (family == AF_INET) ? sizeof(struct sockaddr_in) : + sizeof(struct sockaddr_in6), + host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST); + if (s != 0) { + printf("getnameinfo() failed: %s\en", gai_strerror(s)); + exit(EXIT_FAILURE); + } + printf("\etaddress: <%s>\en", host); + } + } + + freeifaddrs(ifaddr); + exit(EXIT_SUCCESS); +} +.fi +.SH 関連項目 +\fBbind\fP(2), \fBgetsockname\fP(2), \fBsocket\fP(2), \fBpacket\fP(7), \fBifconfig\fP(8) diff --git a/draft/man3/getloadavg.3 b/draft/man3/getloadavg.3 index 2879462c..2dd8c9d6 100644 --- a/draft/man3/getloadavg.3 +++ b/draft/man3/getloadavg.3 @@ -29,74 +29,36 @@ .\" .\" 2007-12-08, mtk, Converted from mdoc to man macros .\" -.\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved. -.\" Translated Sun 6 Jan 2002 by NAKANO Takeo +.\"******************************************************************* .\" -.\"WORD: load average 負荷平均 +.\" This file was generated with po4a. Translate the source file. .\" -.TH GETLOADAVG 3 2007-12-08 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH GETLOADAVG 3 2007\-12\-08 Linux "Linux Programmer's Manual" .SH 名前 -.\"O getloadavg \- システムの負荷平均を取得する getloadavg \- get system load averages -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .BR "#define _BSD_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _BSD_SOURCE" " /* feature_test_macros(7) 参照 */" -.B #include +\fB#define _BSD_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP .sp -.BI "int getloadavg(double " loadavg[] ", int " nelem ); +\fBint getloadavg(double \fP\fIloadavg[]\fP\fB, int \fP\fInelem\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR getloadavg () -.\"O function returns the number of processes in the system run queue -.\"O averaged over various periods of time. -.\"O Up to -.\"O .I nelem -.\"O samples are retrieved and assigned to successive elements of -.\"O .IR loadavg []. -.\"O The system imposes a maximum of 3 samples, representing averages -.\"O over the last 1, 5, and 15 minutes, respectively. -.BR getloadavg () -関数はシステムの実行キューに入っているプロセスの数を、 -様々な期間について平均した値を返す。 -.I nelem -個までのサンプル値を取得し、 -.IR loadavg [] -の連続する要素に代入する。 -システムが提供するサンプル数は 3 個までで、 -それぞれ最近 1, 5, 15 分の平均を表している。 -.\"O .SH RETURN VALUE +\fBgetloadavg\fP() 関数はシステムの実行キューに入っているプロセスの数を、 様々な期間について平均した値を返す。 \fInelem\fP +個までのサンプル値を取得し、 \fIloadavg\fP[] の連続する要素に代入する。 システムが提供するサンプル数は 3 個までで、 それぞれ最近 1, +5, 15 分の平均を表している。 .SH 返り値 -.\"O If the load average was unobtainable, \-1 is returned; otherwise, -.\"O the number of samples actually retrieved is returned. -負荷平均が取得できないと \-1 を返す。 -取得できた場合は、実際に取得したサンプル値の数を返す。 -.\"O .\" .SH HISTORY -.\" .SH 履歴 -.\"O .\" The -.\"O .\" .BR getloadavg () -.\"O .\" function appeared in -.\"O .\" 4.3BSD Reno. -.\" .BR getloadavg () -.\" 関数は -.\" 4.3BSD Reno -.\" で登場した。 -.\"O .SH VERSIONS +.\" .SH HISTORY +.\" The +.\" BR getloadavg () +.\" function appeared in +.\" 4.3BSD Reno . +負荷平均が取得できないと \-1 を返す。 取得できた場合は、実際に取得したサンプル値の数を返す。 .SH バージョン -.\"O This function is available in glibc since version 2.2. この関数は glibc のバージョン 2.2 以降で利用可能である。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O Not in POSIX.1-2001. -.\"O Present on the BSDs and Solaris. -POSIX.1-2001 にはない。 -BSD 系と Solaris に存在する。 .\" mdoc seems to have a bug - there must be no newline here -.\"O .SH SEE ALSO +POSIX.1\-2001 にはない。 BSD 系と Solaris に存在する。 .SH 関連項目 -.BR uptime (1), -.BR proc (5) +\fBuptime\fP(1), \fBproc\fP(5) diff --git a/draft/man3/getlogin.3 b/draft/man3/getlogin.3 index e416c1b5..ef5152c2 100644 --- a/draft/man3/getlogin.3 +++ b/draft/man3/getlogin.3 @@ -25,295 +25,108 @@ .\" Changed Tue Sep 19 01:49:29 1995, aeb: moved from man2 to man3 .\" added ref to /etc/utmp, added BUGS section, etc. .\" modified 2003 Walter Harms, aeb - added getlogin_r, note on stdin use +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. -.\" Translated 1998-03-01, NAKANO Takeo -.\" Updated & Modified 1999-08-21, NAKANO Takeo -.\" Updated & Modified 2005-03-18, Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.TH GETLOGIN 3 2008-06-29 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O getlogin, getlogin_r, cuserid \- get username +.\"******************************************************************* +.TH GETLOGIN 3 2008\-06\-29 GNU "Linux Programmer's Manual" .SH 名前 getlogin, getlogin_r, cuserid \- ユーザー名を取得する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.B "char *getlogin(void);" +\fBchar *getlogin(void);\fP .br -.BI "int getlogin_r(char *" buf ", size_t " bufsize ); +\fBint getlogin_r(char *\fP\fIbuf\fP\fB, size_t \fP\fIbufsize\fP\fB);\fP .sp -.B #include +\fB#include \fP .sp -.BI "char *cuserid(char *" string ); +\fBchar *cuserid(char *\fP\fIstring\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR getlogin_r (): -_REENTRANT || _POSIX_C_SOURCE\ >=\ 199506L +\fBgetlogin_r\fP(): _REENTRANT || _POSIX_C_SOURCE\ >=\ 199506L .br -.BR cuserid (): -_XOPEN_SOURCE -.\"O .SH DESCRIPTION +\fBcuserid\fP(): _XOPEN_SOURCE .SH 説明 -.\"O .BR getlogin () -.\"O returns a pointer to a string containing the name of -.\"O the user logged in on the controlling terminal of the process, or a -.\"O NULL pointer if this information cannot be determined. -.\"O The string is -.\"O statically allocated and might be overwritten on subsequent calls to -.\"O this function or to -.\"O .BR cuserid (). -.BR getlogin () -は、現在のプロセスの制御端末にログインしているユーザー名の文字列への -ポインタを返す。ユーザー名が決定できない場合は NULL ポインタを返す。 -文字列は静的領域に割り当てられており、この後でこの関数や -.BR cuserid () +\fBgetlogin\fP() は、現在のプロセスの制御端末にログインしているユーザー名の文字列への ポインタを返す。ユーザー名が決定できない場合は +NULL ポインタを返す。 文字列は静的領域に割り当てられており、この後でこの関数や \fBcuserid\fP() が呼び出された際に上書きされることがある。 .PP -.\"O .BR getlogin_r () -.\"O returns this same username in the array -.\"O .I buf -.\"O of size -.\"O .IR bufsize . -.BR getlogin_r () -は、上記の同じユーザ名を、大きさ -.I bufsize -の配列 -.I buf -に入れて返す。 +\fBgetlogin_r\fP() は、上記の同じユーザ名を、大きさ \fIbufsize\fP の配列 \fIbuf\fP に入れて返す。 .PP -.\"O .BR cuserid () -.\"O returns a pointer to a string containing a username -.\"O associated with the effective user ID of the process. -.\"O If \fIstring\fP -.\"O is not a NULL pointer, it should be an array that can hold at least -.\"O \fBL_cuserid\fP characters; the string is returned in this array. -.\"O Otherwise, a pointer to a string in a static area is returned. -.\"O This -.\"O string is statically allocated and might be overwritten on subsequent -.\"O calls to this function or to -.\"O .BR getlogin (). -.BR cuserid () -は、現在のプロセスの実効ユーザーID に対応するユーザー名の -文字列へのポインタを返す。 -\fIstring\fP が NULL ポインタ以外の場合、\fIstring\fP は少なくとも -\fBL_cuserid\fP 文字を保持できる配列でなければならない。 -\fIstring\fP が NULL ポインタの場合には、静的領域に置かれた文字列への -ポインタが返される。この文字列は静的領域に割り当てられており、後で -この関数や -.BR getlogin () -が呼び出された際に上書きされることがある。 +\fBcuserid\fP() は、現在のプロセスの実効ユーザーID に対応するユーザー名の 文字列へのポインタを返す。 \fIstring\fP が NULL +ポインタ以外の場合、\fIstring\fP は少なくとも \fBL_cuserid\fP 文字を保持できる配列でなければならない。 \fIstring\fP が +NULL ポインタの場合には、静的領域に置かれた文字列への ポインタが返される。この文字列は静的領域に割り当てられており、後で この関数や +\fBgetlogin\fP() が呼び出された際に上書きされることがある。 .PP -.\"O The macro \fBL_cuserid\fP is an integer constant that indicates how -.\"O long an array you might need to store a username. \fBL_cuserid\fP is -.\"O declared in \fBstdio.h\fP. -マクロ \fBL_cuserid\fP は integer の定数で、ユーザー名を保持するために -必要な配列の長さを示す。 \fBL_cuserid\fP は \fBstdio.h\fP で宣言されて -いる。 +マクロ \fBL_cuserid\fP は integer の定数で、ユーザー名を保持するために 必要な配列の長さを示す。 \fBL_cuserid\fP は +\fBstdio.h\fP で宣言されて いる。 .PP -.\"O These functions let your program identify positively the user who is -.\"O running -.\"O .RB ( cuserid ()) -.\"O or the user who logged in this session -.\"O .RB ( getlogin ()). -.\"O (These can differ when set-user-ID programs are -.\"O involved.) -これらの関数を使うと、プログラムを実行しているユーザー -.RB ( cuserid ()) -や -このセッションにログインしているユーザー -.RB ( getlogin ()) -を明確に特定することができる -(ただし set-user-ID プログラムでは、状況が違うこともある)。 +これらの関数を使うと、プログラムを実行しているユーザー (\fBcuserid\fP()) や このセッションにログインしているユーザー +(\fBgetlogin\fP()) を明確に特定することができる (ただし set\-user\-ID プログラムでは、状況が違うこともある)。 .PP -.\"O For most purposes, it is more useful to use the environment variable -.\"O \fBLOGNAME\fP to find out who the user is. -.\"O This is more flexible -.\"O precisely because the user can set \fBLOGNAME\fP arbitrarily. -たいていの目的では、ユーザーの特定には環境変数 \fBLOGNAME\fP を調べ -るほうが便利である。LOGNAME 変数はユーザーが自由に設定できるので +たいていの目的では、ユーザーの特定には環境変数 \fBLOGNAME\fP を調べ るほうが便利である。LOGNAME 変数はユーザーが自由に設定できるので より柔軟な対応が可能になる。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O .BR getlogin () -.\"O returns a pointer to the username when successful, -.\"O and NULL on failure. -.\"O .BR getlogin_r () -.\"O returns 0 when successful, and nonzero on failure. -.BR getlogin () -は成功した場合はユーザ名へのポインタを返し、失敗した場合は NULL を返す。 -.BR getlogin_r () +\fBgetlogin\fP() は成功した場合はユーザ名へのポインタを返し、失敗した場合は NULL を返す。 \fBgetlogin_r\fP() は成功すると 0 を返し、失敗すると 0 以外を返す。 -.\"O .SH ERRORS .SH エラー -.\"O POSIX specifies POSIX では以下のエラーが規定されている: -.TP -.B EMFILE -.\"O The calling process already has the maximum allowed number of open files. -呼び出し元プロセスがオープンしているファイル数がすでにプロセスあたりの -上限に達している。 -.TP -.B ENFILE -.\"O The system already has the maximum allowed number of open files. +.TP +\fBEMFILE\fP +呼び出し元プロセスがオープンしているファイル数がすでにプロセスあたりの 上限に達している。 +.TP +\fBENFILE\fP システム全体でオープンしているファイル数がすでに上限に達している。 -.TP -.B ENXIO -.\"O The calling process has no controlling tty. +.TP +\fBENXIO\fP 呼び出し元プロセスには制御端末がない。 -.TP -.B ERANGE -(getlogin_r) -.\"O The length of the username, including the terminating null byte, -.\"O is larger than -.\"O .IR bufsize . -(終端の NULL バイトも含めた) ユーザ名の長さが -.I bufsize -よりも長い。 +.TP +\fBERANGE\fP +(getlogin_r) (終端の NULL バイトも含めた) ユーザ名の長さが \fIbufsize\fP よりも長い。 .LP -.\"O Linux/glibc also has Linux/glibc には以下のエラーもある。 -.TP -.B ENOENT -.\"O There was no corresponding entry in the utmp-file. +.TP +\fBENOENT\fP utmp ファイルに対応するエントリがなかった。 -.TP -.B ENOMEM -.\"O Insufficient memory to allocate passwd structure. +.TP +\fBENOMEM\fP passwd 構造体を割り当てるのに十分なメモリがない。 -.TP -.B ENOTTY -.\"O Standard input didn't refer to a terminal. -.\"O (See BUGS.) +.TP +\fBENOTTY\fP 標準入力が端末を参照していない (「バグ」の節を参照)。 -.\"O .SH FILES .SH ファイル -.TP +.TP \fI/etc/passwd\fP -.\"O password database file パスワードデータベースのファイル -.TP +.TP \fI/var/run/utmp\fP -.\"O (traditionally \fI/etc/utmp\fP; -.\"O some libc versions used \fI/var/adm/utmp\fP) -(伝統的には \fI/etc/utmp\fP が使われている; -libc の中には \fI/var/adm/utmp\fP を使うものもある) -.\"O .SH "CONFORMING TO" +(伝統的には \fI/etc/utmp\fP が使われている; libc の中には \fI/var/adm/utmp\fP を使うものもある) .SH 準拠 -.\"O .BR getlogin () -.\"O and -.\"O .BR getlogin_r () -.\"O specified in POSIX.1-2001. -.BR getlogin () -と -.BR getlogin_r () -は POSIX.1-2001 で規定されている。 +\fBgetlogin\fP() と \fBgetlogin_r\fP() は POSIX.1\-2001 で規定されている。 -.\"O System V has a -.\"O .BR cuserid () -.\"O function which uses the real -.\"O user ID rather than the effective user ID. -.\"O The -.\"O .BR cuserid () -.\"O function -.\"O was included in the 1988 version of POSIX, -.\"O but removed from the 1990 version. -.\"O It was present in SUSv2, but removed in POSIX.1-2001. -System V にも -.BR cuserid () -があるが、 -これは実効ユーザー ID ではなく、実ユーザー ID を使用する。 -.BR cuserid () -関数は 1988 年版の POSIX には含まれていたが、 -1990 年版では削除された。 -SUSv2 に存在したが、POSIX.1-2001 で削除された。 +System V にも \fBcuserid\fP() があるが、 これは実効ユーザー ID ではなく、実ユーザー ID を使用する。 +\fBcuserid\fP() 関数は 1988 年版の POSIX には含まれていたが、 1990 年版では削除された。 SUSv2 +に存在したが、POSIX.1\-2001 で削除された。 .LP -.\"O OpenBSD has -.\"O .BR getlogin () -.\"O and -.\"O .BR setlogin (), -.\"O and a username -.\"O associated with a session, even if it has no controlling tty. -OpenBSD には -.BR getlogin () -と -.BR setlogin () -があり、 -セッションに対応したユーザ名がある。制御端末がない +OpenBSD には \fBgetlogin\fP() と \fBsetlogin\fP() があり、 セッションに対応したユーザ名がある。制御端末がない セッションの場合であっても、対応するユーザ名がある。 -.\"O .SH BUGS .SH バグ -.\"O Unfortunately, it is often rather easy to fool -.\"O .BR getlogin (). -.\"O Sometimes it does not work at all, because some program messed up -.\"O the utmp file. -.\"O Often, it gives only the first 8 characters of -.\"O the login name. -.\"O The user currently logged in on the controlling tty -.\"O of our program need not be the user who started it. -.\"O Avoid -.\"O .BR getlogin () -.\"O for security-related purposes. -残念ながら、 -.BR getlogin () -をだますのはそれほど難しいことではない。別のプログラムが utmp ファイルを -壊してしまうと、全く動作しないこともある。またログイン名の最初の 8 文字 -しか返さないことも多い。またプログラムを制御している tty に -現在ログインしているユーザーは、プログラムを実行した -ユーザーでない場合もある。 -セキュリティの絡む用途には -.BR getlogin () +残念ながら、 \fBgetlogin\fP() をだますのはそれほど難しいことではない。別のプログラムが utmp ファイルを +壊してしまうと、全く動作しないこともある。またログイン名の最初の 8 文字 しか返さないことも多い。またプログラムを制御している tty に +現在ログインしているユーザーは、プログラムを実行した ユーザーでない場合もある。 セキュリティの絡む用途には \fBgetlogin\fP() を用いるべきではない。 .LP -.\"O Note that glibc does not follow the POSIX specification and uses -.\"O .I stdin -.\"O instead of -.\"O .IR /dev/tty . -.\"O A bug. -.\"O (Other recent systems, like SunOS 5.8 and HP-UX 11.11 and FreeBSD 4.8 -.\"O all return the login name also when -.\"O .I stdin -.\"O is redirected.) -glibc は POSIX 仕様には従っておらず、 -.I /dev/tty -ではなく -.I "標準入力 (stdin)" -を使う。これはバグである。 -(SunOS 5.8 や HP-UX 11.11 や FreeBSD 4.8 といった他の最近のシステムはいずれも、 -.I 標準入力 +glibc は POSIX 仕様には従っておらず、 \fI/dev/tty\fP ではなく \fI標準入力 (stdin)\fP を使う。これはバグである。 +(SunOS 5.8 や HP\-UX 11.11 や FreeBSD 4.8 といった他の最近のシステムはいずれも、 \fI標準入力\fP がリダイレクトされた場合でもログイン名を返す。) .LP -.\"O Nobody knows precisely what -.\"O .BR cuserid () -.\"O does; avoid it in portable programs. -.\"O Or avoid it altogether: use -.\"O .I getpwuid(geteuid()) -.\"O instead, if that is -.\"O what you meant. -.\"O .B Do not use -.\"O .BR cuserid (). -.BR cuserid () -が何を行っているのか、実際のところを知っている者は誰もいない; -移植性が求められるプログラムでは -.BR cuserid () -は使うべきではない。 -というかどんなプログラムでも使うべきではない: -代わりに -.I getpwuid(geteuid()) -を用いるべきである -(これが意図していることならば、だが)。 -.BR cuserid () -は「使わない」こと。 -.\"O .SH "SEE ALSO" +\fBcuserid\fP() が何を行っているのか、実際のところを知っている者は誰もいない; 移植性が求められるプログラムでは \fBcuserid\fP() +は使うべきではない。 というかどんなプログラムでも使うべきではない: 代わりに \fIgetpwuid(geteuid())\fP を用いるべきである +(これが意図していることならば、だが)。 \fBcuserid\fP() は「使わない」こと。 .SH 関連項目 -.BR geteuid (2), -.BR getuid (2), -.BR utmp (5) +\fBgeteuid\fP(2), \fBgetuid\fP(2), \fButmp\fP(5) diff --git a/draft/man3/getnetent_r.3 b/draft/man3/getnetent_r.3 new file mode 100644 index 00000000..f40d77b6 --- /dev/null +++ b/draft/man3/getnetent_r.3 @@ -0,0 +1,108 @@ +.\" Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GETNETENT_R 3 2010\-09\-10 GNU "Linux Programmer's Manual" +.SH 名前 +getnetent_r, getnetbyname_r, getnetbyaddr_r \- get network entry (reentrant) +.SH 書式 +.nf +\fB#include \fP +.sp +\fBint getnetent_r(struct netent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP +\fB size_t \fP\fIbuflen\fP\fB, struct netent **\fP\fIresult\fP\fB,\fP +\fB int *\fP\fIh_errnop\fP\fB);\fP +.sp +\fBint getnetbyname_r(const char *\fP\fIname\fP\fB,\fP +\fB struct netent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP +\fB size_t \fP\fIbuflen\fP\fB, struct netent **\fP\fIresult\fP\fB,\fP +\fB int *\fP\fIh_errnop\fP\fB);\fP +.sp +\fBint getnetbyaddr_r(uint32_t \fP\fInet\fP\fB, int \fP\fItype\fP\fB,\fP +\fB struct netent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP +\fB size_t \fP\fIbuflen\fP\fB, struct netent **\fP\fIresult\fP\fB,\fP +\fB int *\fP\fIh_errnop\fP\fB);\fP +.sp +.fi +.in -4n +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.ad l +.in +.sp +\fBgetnetent_r\fP(), \fBgetnetbyname_r\fP(), \fBgetnetbyaddr_r\fP(): +.RS 4 +_BSD_SOURCE || _SVID_SOURCE +.RE +.ad b +.SH 説明 +The \fBgetnetent_r\fP(), \fBgetnetbyname_r\fP(), and \fBgetnetbyaddr_r\fP() +functions are the reentrant equivalents of, respectively, \fBgetnetent\fP(3), +\fBgetnetbyname\fP(3), and \fBgetnetbynumber\fP(3). They differ in the way that +the \fInetent\fP structure is returned, and in the function calling signature +and return value. This manual page describes just the differences from the +nonreentrant functions. + +Instead of returning a pointer to a statically allocated \fInetent\fP structure +as the function result, these functions copy the structure into the location +pointed to by \fIresult_buf\fP. + +.\" I can find no information on the required/recommended buffer size; +.\" the nonreentrant functions use a 1024 byte buffer -- mtk. +The \fIbuf\fP array is used to store the string fields pointed to by the +returned \fInetent\fP structure. (The nonreentrant functions allocate these +strings in static storage.) The size of this array is specified in +\fIbuflen\fP. If \fIbuf\fP is too small, the call fails with the error \fBERANGE\fP, +and the caller must try again with a larger buffer. (A buffer of length +1024 bytes should be sufficient for most applications.) + +If the function call successfully obtains a network record, then \fI*result\fP +is set pointing to \fIresult_buf\fP; otherwise, \fI*result\fP is set to NULL. + +.\" getnetent.3 doesn't document any use of h_errno, but nevertheless +.\" the nonreentrant functions no seem to set h_errno. +The buffer pointed to by \fIh_errnop\fP is used to return the value that would +be stored in the global variable \fIh_errno\fP by the nonreentrant versions of +these functions. +.SH 返り値 +On success, these functions return 0. On error, they return one of the +positive error numbers listed in ERRORS. + +On error, record not found (\fBgetnetbyname_r\fP(), \fBgetnetbyaddr_r\fP()), or +end of input (\fBgetnetent_r\fP()) \fIresult\fP is set to NULL. +.SH エラー +.TP +\fBENOENT\fP +(\fBgetnetent_r\fP()) No more records in database. +.TP +\fBERANGE\fP +\fIbuf\fP is too small. Try again with a larger buffer (and increased +\fIbuflen\fP). +.SH 準拠 +These functions are GNU extensions. Functions with similar names exist on +some other systems, though typically with different calling signatures. +.SH 関連項目 +\fBgetnetent\fP(3), \fBnetworks\fP(5) diff --git a/draft/man3/getopt.3 b/draft/man3/getopt.3 index 42639fb4..50a44da0 100644 --- a/draft/man3/getopt.3 +++ b/draft/man3/getopt.3 @@ -29,343 +29,104 @@ .\" Modified 8 May 1998 by Joseph S. Myers (jsm28@cam.ac.uk) .\" Modified 990715, aeb: changed `EOF' into `-1' since that is what POSIX .\" says; moreover, EOF is not defined in . -.\" Modified 2002-02-16, joey: added information about nonexisting +.\" Modified 2002-02-16, joey: added information about nonexistent .\" option character and colon as first option character .\" Modified 2004-07-28, Michael Kerrisk .\" Added text to explain how to order both '[-+]' and ':' at .\" the start of optstring .\" Modified 2006-12-15, mtk, Added getopt() example program. .\" -.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. -.\" Translated 1998-08-12, NAKANO Takeo -.\" Updated & Modified 1999-08-21, NAKANO Takeo -.\" Updated & Modified 2001-07-01, Yuichi SATO -.\" Updated & Modified 2002-03-23, Yuichi SATO -.\" Updated & Modified 2003-09-07, Yuichi SATO -.\" Updated & Modified 2005-01-10, Yuichi SATO -.\" Updated & Modified 2005-10-28, Akihiro MOTOKI -.\" Updated & Modified 2006-01-18, Akihiro MOTOKI -.\" Updated & Modified 2007-05-01, Akihiro MOTOKI, LDP v2.46 -.\" Updated 2008-08-11, Akihiro MOTOKI, LDP v3.05 +.\"******************************************************************* .\" -.\"WORD: argv-element argv 要素 +.\" This file was generated with po4a. Translate the source file. .\" -.TH GETOPT 3 2010-11-01 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH GETOPT 3 2010\-11\-01 GNU "Linux Programmer's Manual" .SH 名前 -.\"O getopt, getopt_long, getopt_long_only, -.\"O optarg, optind, opterr, optopt \- Parse command-line options -getopt, getopt_long, getopt_long_only, -optarg, optind, opterr, optopt \- コマンドラインオプションを解釈する -.\"O .SH SYNOPSIS +getopt, getopt_long, getopt_long_only, optarg, optind, opterr, optopt \- +コマンドラインオプションを解釈する .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int getopt(int " argc ", char * const " argv[] , -.BI " const char *" optstring ); +\fBint getopt(int \fP\fIargc\fP\fB, char * const \fP\fIargv[]\fP\fB,\fP +\fB const char *\fP\fIoptstring\fP\fB);\fP .sp -.BI "extern char *" optarg ; -.BI "extern int " optind ", " opterr ", " optopt ; +\fBextern char *\fP\fIoptarg\fP\fB;\fP +\fBextern int \fP\fIoptind\fP\fB, \fP\fIopterr\fP\fB, \fP\fIoptopt\fP\fB;\fP .sp -.B #include +\fB#include \fP .sp -.BI "int getopt_long(int " argc ", char * const " argv[] , -.BI " const char *" optstring , -.BI " const struct option *" longopts ", int *" longindex ); +\fBint getopt_long(int \fP\fIargc\fP\fB, char * const \fP\fIargv[]\fP\fB,\fP +\fB const char *\fP\fIoptstring\fP\fB,\fP +\fB const struct option *\fP\fIlongopts\fP\fB, int *\fP\fIlongindex\fP\fB);\fP .sp -.BI "int getopt_long_only(int " argc ", char * const " argv[] , -.BI " const char *" optstring , -.BI " const struct option *" longopts ", int *" longindex ); +\fBint getopt_long_only(int \fP\fIargc\fP\fB, char * const \fP\fIargv[]\fP\fB,\fP +\fB const char *\fP\fIoptstring\fP\fB,\fP +\fB const struct option *\fP\fIlongopts\fP\fB, int *\fP\fIlongindex\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .ad l .in .sp -.BR getopt (): -_POSIX_C_SOURCE\ >=\ 2 || _XOPEN_SOURCE +\fBgetopt\fP(): _POSIX_C_SOURCE\ >=\ 2 || _XOPEN_SOURCE .br -.BR getopt_long (), -.BR getopt_long_only (): -_GNU_SOURCE +\fBgetopt_long\fP(), \fBgetopt_long_only\fP(): _GNU_SOURCE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR getopt () -.\"O function parses the command-line arguments. -.\"O Its arguments -.\"O .I argc -.\"O and -.\"O .I argv -.\"O are the argument count and array as passed to the -.\"O .IR main () -.\"O function on program invocation. -.BR getopt () -関数はコマンドライン引き数を解釈する。 -.BR getopt () -がとる引き数 -.I argc -と -.I argv -は、それぞれプログラムの起動時に -.IR main () -関数に渡された引き数の個数と配列である。 -.\"O An element of \fIargv\fP that starts with \(aq\-\(aq -.\"O (and is not exactly "\-" or "\-\-") -.\"O is an option element. -.\"O The characters of this element -.\"O (aside from the initial \(aq\-\(aq) are option characters. -.\"O If -.\"O .BR getopt () -.\"O is called repeatedly, it returns successively each of the option characters -.\"O from each of the option elements. -\fIargv\fP の要素のうち \(aq\-\(aq で始まるもの -(かつ "\-" 単独や "\-\-" 単独ではないもの) は -オプション要素 (option element) とみなされる。 -この要素から先頭の \(aq\-\(aq を除いた文字は -オプション文字 (option character) とされる。 -.BR getopt () +\fBgetopt\fP() 関数はコマンドライン引き数を解釈する。 \fBgetopt\fP() がとる引き数 \fIargc\fP と \fIargv\fP +は、それぞれプログラムの起動時に \fImain\fP() 関数に渡された引き数の個数と配列である。 \fIargv\fP の要素のうち \(aq\-\(aq +で始まるもの (かつ "\-" 単独や "\-\-" 単独ではないもの) は オプション要素 (option element) とみなされる。 +この要素から先頭の \(aq\-\(aq を除いた文字は オプション文字 (option character) とされる。 \fBgetopt\fP() は、繰り返し呼び出されるごとに、次のオプション文字を返す。 .PP -.\"O The variable -.\"O .I optind -.\"O is the index of the next element to be processed in -.\"O .IR argv . -.\"O The system initializes this value to 1. -.\"O The caller can reset it to 1 to restart scanning of the same -.\"O .IR argv , -.\"O or when scanning a new argument vector. -変数 -.I optind -は、 -.I argv -の次に処理される要素のインデックスである。 -システムによりこの変数の値は 1 に初期化される。 -呼び出し側でこの値を 1 にリセットすることで、同じ -.I argv -のスキャンをやり直したり、新しい引き数ベクトルをスキャンすることができる。 +変数 \fIoptind\fP は、 \fIargv\fP の次に処理される要素のインデックスである。 システムによりこの変数の値は 1 に初期化される。 +呼び出し側でこの値を 1 にリセットすることで、同じ \fIargv\fP のスキャンをやり直したり、新しい引き数ベクトルをスキャンすることができる。 .PP -.\"O If -.\"O .BR getopt () -.\"O finds another option character, it returns that -.\"O character, updating the external variable \fIoptind\fP and a static -.\"O variable \fInextchar\fP so that the next call to -.\"O .BR getopt () -.\"O can -.\"O resume the scan with the following option character or -.\"O \fIargv\fP-element. -新たなオプション文字を見つけると、 -.BR getopt () -はその文字を返し、 -外部変数 \fIoptind\fP とスタティックな変数 \fInextchar\fP を更新する。 -これらによって、 -.BR getopt () -は次回の呼び出しの際に、 -以降のオプション文字や \fIargv\fP 要素のスキャンを継続できる。 +新たなオプション文字を見つけると、 \fBgetopt\fP() はその文字を返し、 外部変数 \fIoptind\fP とスタティックな変数 +\fInextchar\fP を更新する。 これらによって、 \fBgetopt\fP() は次回の呼び出しの際に、 以降のオプション文字や \fIargv\fP +要素のスキャンを継続できる。 .PP -.\"O If there are no more option characters, -.\"O .BR getopt () -.\"O returns \-1. -.\"O Then \fIoptind\fP is the index in \fIargv\fP of the first -.\"O \fIargv\fP-element that is not an option. -オプション文字がそれ以上見つからなくなると、 -.BR getopt () -は -\-1 を返す。そして \fIoptind\fP は、\fIargv\fP の要素のうち、 +オプション文字がそれ以上見つからなくなると、 \fBgetopt\fP() は \-1 を返す。そして \fIoptind\fP は、\fIargv\fP の要素のうち、 オプションでない最初の要素を示すようになる。 .PP -.\"O .I optstring -.\"O is a string containing the legitimate option characters. -.\"O If such a -.\"O character is followed by a colon, the option requires an argument, so -.\"O .BR getopt () -.\"O places a pointer to the following text in the same -.\"O \fIargv\fP-element, or the text of the following \fIargv\fP-element, in -.\"O .IR optarg . -.I optstring -は受け付けるオプション文字からなる文字列である。 -文字のあとにコロン (:) が置かれている場合は、 -オプションには引き数が必要であることを示す。 -このとき -.BR getopt () -は、現在注目している -\fIargv\fP 要素で、オプション文字に引き続くテキストへのポインタか、 -あるいは次の \fIargv\fP 要素のテキストへのポインタを -.I optarg -に代入する。 -.\"O Two colons mean an option takes -.\"O an optional arg; if there is text in the current \fIargv\fP-element -.\"O (i.e., in the same word as the option name itself, for example, "\-oarg"), -.\"O then it is returned in \fIoptarg\fP, otherwise \fIoptarg\fP is set to zero. -.\"O This is a GNU extension. -.\"O If -.\"O .I optstring -.\"O contains -.\"O .B W -.\"O followed by a semicolon, then -.\"O .B \-W foo -.\"O is treated as the long option -.\"O .BR \-\-foo . -2 個連続してコロンが置かれている場合は、 -そのオプションは引き数をとってもとらなくてもよい。 -現在の \fIargv\fP 要素にテキストがあれば -(つまり、"\-oarg" のように、オプション名自身と同じワード内に -テキストがある場合)、それが \fIoptarg\fP に返される。 -なければ \fIoptarg\fP は 0 に設定される。 -これは GNU による拡張である。 -.I optstring -に -.B W -とそれに続くセミコロンが入っていると、 -.B \-W foo -は長いオプション -.B \-\-foo -と同じように扱われる -.\"O (The -.\"O .B \-W -.\"O option is reserved by POSIX.2 for implementation extensions.) -.\"O This behavior is a GNU extension, not available with libraries before -.\"O glibc 2. -(POSIX.2 は -.B \-W -オプションを実装依存の拡張として予約している)。 -この動作は GNU による拡張であり、glibc 2 以前のライブラリでは -利用できない。 +\fIoptstring\fP は受け付けるオプション文字からなる文字列である。 文字のあとにコロン (:) が置かれている場合は、 +オプションには引き数が必要であることを示す。 このとき \fBgetopt\fP() は、現在注目している \fIargv\fP +要素で、オプション文字に引き続くテキストへのポインタか、 あるいは次の \fIargv\fP 要素のテキストへのポインタを \fIoptarg\fP に代入する。 +2 個連続してコロンが置かれている場合は、 そのオプションは引き数をとってもとらなくてもよい。 現在の \fIargv\fP 要素にテキストがあれば +(つまり、"\-oarg" のように、オプション名自身と同じワード内に テキストがある場合)、それが \fIoptarg\fP に返される。 なければ +\fIoptarg\fP は 0 に設定される。 これは GNU による拡張である。 \fIoptstring\fP に \fBW\fP +とそれに続くセミコロンが入っていると、 \fB\-W foo\fP は長いオプション \fB\-\-foo\fP と同じように扱われる (POSIX.2 は \fB\-W\fP +オプションを実装依存の拡張として予約している)。 この動作は GNU による拡張であり、glibc 2 以前のライブラリでは 利用できない。 .PP -.\"O By default, -.\"O .BR getopt () -.\"O permutes the contents of \fIargv\fP as it -.\"O scans, so that eventually all the nonoptions are at the end. -.\"O Two other modes are also implemented. -.\"O If the first character of -.\"O \fIoptstring\fP is \(aq+\(aq or the environment variable -.\"O .B POSIXLY_CORRECT -.\"O is set, then option processing stops as soon as a nonoption argument is -.\"O encountered. -.\"O If the first character of \fIoptstring\fP is \(aq\-\(aq, then -.\"O each nonoption \fIargv\fP-element is handled as if it were the argument of -.\"O an option with character code 1. (This is used by programs that were -.\"O written to expect options and other \fIargv\fP-elements in any order -.\"O and that care about the ordering of the two.) -.\"O The special argument "\-\-" forces an end of option-scanning regardless -.\"O of the scanning mode. -デフォルトでは -.BR getopt () -は \fIargv\fP をスキャンする際に順序を変更し、 -オプション以外の要素を最後に移動する。 -他にも 2 つのモードが実装されている。 -\fIoptstring\fP の先頭文字が \(aq+\(aq であるか、環境変数 -.B POSIXLY_CORRECT -が設定されている場合には、オプションを対象とする動作は、 -非オプションの引き数が現れた段階で終了する。 -\fIoptstring\fP の先頭文字が \(aq\-\(aq である場合には、 -オプションでない \fIargv\fP 要素は、 -文字コード 1 のオプションであるかのように扱われる (これを用いるプログラムは、 -オプションや \fIargv\fP 要素を任意の順序で受け入れ、かつそれらの順序が -意味を持つように書かれている必要がある)。 -"\-\-" は特殊な引き数で、スキャンのモードによらず、 -オプションのスキャンを強制的に終了させる。 +デフォルトでは \fBgetopt\fP() は \fIargv\fP をスキャンする際に順序を変更し、 オプション以外の要素を最後に移動する。 他にも 2 +つのモードが実装されている。 \fIoptstring\fP の先頭文字が \(aq+\(aq であるか、環境変数 \fBPOSIXLY_CORRECT\fP +が設定されている場合には、オプションを対象とする動作は、 非オプションの引き数が現れた段階で終了する。 \fIoptstring\fP の先頭文字が +\(aq\-\(aq である場合には、 オプションでない \fIargv\fP 要素は、 文字コード 1 のオプションであるかのように扱われる +(これを用いるプログラムは、 オプションや \fIargv\fP 要素を任意の順序で受け入れ、かつそれらの順序が 意味を持つように書かれている必要がある)。 +"\-\-" は特殊な引き数で、スキャンのモードによらず、 オプションのスキャンを強制的に終了させる。 .PP -.\"O If -.\"O .BR getopt () -.\"O does not recognize an option character, it prints an -.\"O error message to \fIstderr\fP, stores the character in \fIoptopt\fP, and -.\"O returns \(aq?\(aq. -.\"O The calling program may prevent the error message by -.\"O setting \fIopterr\fP to 0. -認識できないオプション文字があると、 -.BR getopt () -はエラーメッセージを標準エラー出力 \fIstderr\fP に表示し、 -その文字を \fIoptopt\fP に保存して \(aq?\(aq を返す。 -呼び出したプログラムで \fIopterr\fP を 0 にしておけば、 +認識できないオプション文字があると、 \fBgetopt\fP() はエラーメッセージを標準エラー出力 \fIstderr\fP に表示し、 その文字を +\fIoptopt\fP に保存して \(aq?\(aq を返す。 呼び出したプログラムで \fIopterr\fP を 0 にしておけば、 エラーメッセージの表示を抑制できる。 .PP -.\"O If -.\"O .BR getopt () -.\"O finds an option character in \fIargv\fP that was not -.\"O included in \fIoptstring\fP, or if it detects a missing option argument, -.\"O it returns \(aq?\(aq and sets the external variable \fIoptopt\fP to the -.\"O actual option character. -.\"O If the first character -.\"O (following any optional \(aq+\(aq or \(aq\-\(aq described above) -.\"O of \fIoptstring\fP -.\"O is a colon (\(aq:\(aq), then -.\"O .BR getopt () -.\"O returns \(aq:\(aq instead of \(aq?\(aq to -.\"O indicate a missing option argument. -.\"O If an error was detected, and -.\"O the first character of \fIoptstring\fP is not a colon, and -.\"O the external variable \fIopterr\fP is nonzero (which is the default), -.\"O .BR getopt () -.\"O prints an error message. -.BR getopt () -は \fIargv\fP の中に -\fIoptstring\fP にないオプション文字を見つけた場合、 -またはオプション引き数が足りないことが分かった場合、 -\&\(aq?\(aq を返して外部変数 \fIoptopt\fP をそのオプション文字に設定する。 -\fIoptstring\fP の (上で説明したオプションで指定できる -\&\(aq+\(aq または \(aq\-\(aq 後に続く) 最初の文字が -コロン (\(aq:\(aq) のとき、 -.BR getopt () -はオプション引き数が足りない場合に \(aq?\(aq ではなく \(aq:\(aq を返す。 -エラーを見つけた場合で、かつ \fIoptstring\fP の最初の文字がコロンでなく、 -かつ外部変数 \fIopterr\fP が 0 でない場合 (これがデフォルト)、 -.BR getopt () -はエラーメッセージを表示する。 -.\"O .SS getopt_long() and getopt_long_only() -.SS getopt_long() と getopt_long_only() -.\"O The -.\"O .BR getopt_long () -.\"O function works like -.\"O .BR getopt () -.\"O except that it also accepts long options, started with two dashes. -.\"O (If the program accepts only long options, then -.\"O .I optstring -.\"O should be specified as an empty string (""), not NULL.) -.\"O Long option names may be abbreviated if the abbreviation is -.\"O unique or is an exact match for some defined option. -.\"O A long option -.\"O may take a parameter, of the form -.\"O .B \-\-arg=param -.\"O or -.\"O .BR "\-\-arg param" . -.BR getopt_long () -関数は、長いオプション (2 つのダッシュ "\-\-" で始まるオプション) を -受け入れることを除いて -.BR getopt () -と同じように動作する -(プログラムに長いオプションだけが渡された場合、 -.I optstring -は NULL ではなく空文字列 ("") となる)。 -長いオプションの名前は、他と重ならない範囲において短縮できる。 -あるいは定義されたオプションに正確にマッチするものでも (当然) かまわない。 -長いオプションは引き数を取ることができ、 -.B \-\-arg=param -または -.B "\-\-arg param" -と言う形式で指定する。 +\fBgetopt\fP() は \fIargv\fP の中に \fIoptstring\fP にないオプション文字を見つけた場合、 +またはオプション引き数が足りないことが分かった場合、 \&\(aq?\(aq を返して外部変数 \fIoptopt\fP をそのオプション文字に設定する。 +\fIoptstring\fP の (上で説明したオプションで指定できる \&\(aq+\(aq または \(aq\-\(aq 後に続く) 最初の文字が コロン +(\(aq:\(aq) のとき、 \fBgetopt\fP() はオプション引き数が足りない場合に \(aq?\(aq ではなく \(aq:\(aq +を返す。 エラーを見つけた場合で、かつ \fIoptstring\fP の最初の文字がコロンでなく、 かつ外部変数 \fIopterr\fP が 0 でない場合 +(これがデフォルト)、 \fBgetopt\fP() はエラーメッセージを表示する。 +.SS "getopt_long() と getopt_long_only()" +\fBgetopt_long\fP() 関数は、長いオプション (2 つのダッシュ "\-\-" で始まるオプション) を 受け入れることを除いて +\fBgetopt\fP() と同じように動作する (プログラムに長いオプションだけが渡された場合、 \fIoptstring\fP は NULL +ではなく空文字列 ("") となる)。 長いオプションの名前は、他と重ならない範囲において短縮できる。 +あるいは定義されたオプションに正確にマッチするものでも (当然) かまわない。 長いオプションは引き数を取ることができ、 \fB\-\-arg=param\fP +または \fB\-\-arg param\fP と言う形式で指定する。 .PP -.\"O .I longopts -.\"O is a pointer to the first element of an array of -.\"O .I struct option -.\"O declared in -.\"O .I -.\"O as -.I longopts -は -.I struct option -の要素からなる配列の、先頭要素へのポインタである。 -.I struct option -は -.I -で以下のように定義されている。 +\fIlongopts\fP は \fIstruct option\fP の要素からなる配列の、先頭要素へのポインタである。 \fIstruct option\fP は +\fI\fP で以下のように定義されている。 .in +4n .nf .sp @@ -378,290 +139,79 @@ struct option { .fi .in .PP -.\"O The meanings of the different fields are: それぞれのフィールドの意味は以下の通り。 -.TP -.I name -.\"O is the name of the long option. +.TP +\fIname\fP 長いオプションの名前。 -.TP -.I has_arg -.\"O is: -.\"O \fBno_argument\fP (or 0) if the option does not take an argument; -.\"O \fBrequired_argument\fP (or 1) if the option requires an argument; or -.\"O \fBoptional_argument\fP (or 2) if the option takes an optional argument. -\fBno_argument\fP (または 0) なら、オプションは引き数をとらない。 -\fBrequired_argument\fP (または 1) なら、オプションは引き数を必要とする。 -\fBoptional_argument\fP (または 2) なら、オプションは引き数をとっても -とらなくても良い。 -.TP -.I flag -.\"O specifies how results are returned for a long option. -.\"O If \fIflag\fP -.\"O is NULL, then -.\"O .BR getopt_long () -.\"O returns \fIval\fP. (For -.\"O example, the calling program may set \fIval\fP to the equivalent short -.\"O option character.) -.\"O Otherwise, -.\"O .BR getopt_long () -.\"O returns 0, and -.\"O \fIflag\fP points to a variable which is set to \fIval\fP if the -.\"O option is found, but left unchanged if the option is not found. -長いオプションに対する結果の返し方を指定する。\fIflag\fP が -NULL なら -.BR getopt_long () -は \fIval\fP を返す -(例えば呼び出し元のプログラムは、 -\fIval\fP に等価なオプション文字を代入することができる)。 -NULL 以外の場合には、 -.BR getopt_long () -は 0 を返す。 -このときオプションが見つかると \fIflag\fP がポイントする変数に -\fIval\fP が代入される。見つからないとこの変数は変更されない。 -.TP +.TP +\fIhas_arg\fP +\fBno_argument\fP (または 0) なら、オプションは引き数をとらない。 \fBrequired_argument\fP (または 1) +なら、オプションは引き数を必要とする。 \fBoptional_argument\fP (または 2) なら、オプションは引き数をとっても とらなくても良い。 +.TP +\fIflag\fP +長いオプションに対する結果の返し方を指定する。\fIflag\fP が NULL なら \fBgetopt_long\fP() は \fIval\fP を返す +(例えば呼び出し元のプログラムは、 \fIval\fP に等価なオプション文字を代入することができる)。 NULL 以外の場合には、 +\fBgetopt_long\fP() は 0 を返す。 このときオプションが見つかると \fIflag\fP がポイントする変数に \fIval\fP +が代入される。見つからないとこの変数は変更されない。 +.TP \fIval\fP -.\"O is the value to return, or to load into the variable pointed -.\"O to by \fIflag\fP. 返り値、または \fIflag\fP がポイントする変数へロードされる値。 .PP -.\"O The last element of the array has to be filled with zeros. 配列の最後の要素は、全て 0 で埋められていなければならない。 .PP -.\"O If \fIlongindex\fP is not NULL, it -.\"O points to a variable which is set to the index of the long option relative to -.\"O .IR longopts . -\fIlongindex\fP は、NULL でなければ、 -長いオプションのインデックスを -.I longopts +\fIlongindex\fP は、NULL でなければ、 長いオプションのインデックスを \fIlongopts\fP からの相対位置として保持している変数へのポインタとなる。 .PP -.\"O .BR getopt_long_only () -.\"O is like -.\"O .BR getopt_long (), -.\"O but \(aq\-\(aq as well -.\"O as "\-\-" can indicate a long option. -.\"O If an option that starts with \(aq\-\(aq -.\"O (not "\-\-") doesn't match a long option, but does match a short option, -.\"O it is parsed as a short option instead. -.BR getopt_long_only () -は -.BR getopt_long () -と同様の動作をするが、 \(aq\-\(aq も "\-\-" と同様に、 -長いオプションとして扱われる。\(aq\-\(aq で始まる -("\-\-" 以外の) オプションが、長いものにはマッチしないが短いものに +\fBgetopt_long_only\fP() は \fBgetopt_long\fP() と同様の動作をするが、 \(aq\-\(aq も "\-\-" +と同様に、 長いオプションとして扱われる。\(aq\-\(aq で始まる ("\-\-" 以外の) オプションが、長いものにはマッチしないが短いものに マッチする場合においては、それは短いオプションとして解釈される。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O If an option was successfully found, then -.\"O .BR getopt () -.\"O returns the option character. -.\"O If all command-line options have been parsed, then -.\"O .BR getopt () -.\"O returns \-1. -.\"O If -.\"O .BR getopt () -.\"O encounters an option character that was not in -.\"O .IR optstring , -.\"O then \(aq?\(aq is returned. -.\"O If -.\"O .BR getopt () -.\"O encounters an option with a missing argument, -.\"O then the return value depends on the first character in -.\"O .IR optstring : -.\"O if it is \(aq:\(aq, then \(aq:\(aq is returned; otherwise \(aq?\(aq is returned. -オプションが正常に見つかれば -.BR getopt () -はそのオプション文字を返す。 -すべてのコマンドラインオプションの解析が終わったら、 -.BR getopt () -は \-1 を返す。 -.I optstring -に含まれないオプション文字が見つかると、\(aq?\(aq を返す。 -引き数が足りないオプションが見つかった場合、 -返り値は -.I optstring -の最初の文字による異なる: 最初の文字が \(aq:\(aq であれば \(aq:\(aq を返し、 -それ以外の場合は \(aq?\(aq を返す。 +オプションが正常に見つかれば \fBgetopt\fP() はそのオプション文字を返す。 すべてのコマンドラインオプションの解析が終わったら、 +\fBgetopt\fP() は \-1 を返す。 \fIoptstring\fP に含まれないオプション文字が見つかると、\(aq?\(aq を返す。 +引き数が足りないオプションが見つかった場合、 返り値は \fIoptstring\fP の最初の文字による異なる: 最初の文字が \(aq:\(aq であれば +\(aq:\(aq を返し、 それ以外の場合は \(aq?\(aq を返す。 .PP -.\"O .BR getopt_long () -.\"O and -.\"O .BR getopt_long_only () -.\"O also return the option -.\"O character when a short option is recognized. -.\"O For a long option, they -.\"O return \fIval\fP if \fIflag\fP is NULL, and 0 otherwise. -.\"O Error and \-1 returns are the same as for -.\"O .BR getopt (), -.\"O plus \(aq?\(aq for an -.\"O ambiguous match or an extraneous parameter. -.BR getopt_long () -と -.BR getopt_long_only () -も、 -短いオプション文字を認識した場合にはその文字を返す。 -長いオプションに対しては、 -\fIflag\fP が NULL なら \fIval\fP を返し、 -\fIflag\fP が NULL 以外なら 0 を返す。 -エラーと \-1 の返り値は -.BR getopt () -と同じである。 -さらに \(aq?\(aq は、マッチが確定できない場合や余分なパラメーターがある場合にも返る。 -.\"O .SH ENVIRONMENT +\fBgetopt_long\fP() と \fBgetopt_long_only\fP() も、 短いオプション文字を認識した場合にはその文字を返す。 +長いオプションに対しては、 \fIflag\fP が NULL なら \fIval\fP を返し、 \fIflag\fP が NULL 以外なら 0 を返す。 エラーと +\-1 の返り値は \fBgetopt\fP() と同じである。 さらに \(aq?\(aq +は、マッチが確定できない場合や余分なパラメーターがある場合にも返る。 .SH 環境 -.TP -.B POSIXLY_CORRECT -.\"O If this is set, then option processing stops as soon as a nonoption -.\"O argument is encountered. -これが設定されていると、非オプションの引き数に到達した時点でオプション -に対する操作が停止される。 -.TP -.B __GNU_nonoption_argv_flags_ -.\"O This variable was used by -.\"O .BR bash (1) -.\"O 2.0 to communicate to glibc which arguments are the results of -.\"O wildcard expansion and so should not be considered as options. -.\"O This behavior was removed in -.\"O .BR bash (1) -.\"O version 2.01, but the support remains in glibc. -この変数は -.BR bash (1) -2.0 が glibc と通信するために用いられた。 -どの引き数がワイルドカードを展開した結果で、 -したがってオプションとみなすべきでないかを知らせるものである。 -この機能は -.BR bash (1) -のバージョン 2.01 で削除されたが、glibc にはまだ残っている。 -.\"O .SH "CONFORMING TO" +.TP +\fBPOSIXLY_CORRECT\fP +これが設定されていると、非オプションの引き数に到達した時点でオプション に対する操作が停止される。 +.TP +\fB__GNU_nonoption_argv_flags_\fP +この変数は \fBbash\fP(1) 2.0 が glibc と通信するために用いられた。 どの引き数がワイルドカードを展開した結果で、 +したがってオプションとみなすべきでないかを知らせるものである。 この機能は \fBbash\fP(1) のバージョン 2.01 で削除されたが、glibc +にはまだ残っている。 .SH 準拠 -.TP -.BR getopt (): -.\"O POSIX.2 and POSIX.1-2001, -.\"O provided the environment variable -.\"O .B POSIXLY_CORRECT -.\"O is set. -.\"O Otherwise, the elements of \fIargv\fP aren't really const, because we -.\"O permute them. -.\"O We pretend they're const in the prototype to be -.\"O compatible with other systems. -環境変数 -.B POSIXLY_CORRECT -が設定されている場合は POSIX.2 と POSIX.1-2001 に準拠する。 -他の場合は \fIargv\fP の要素は本当の意味での定数にはならない。 -なぜなら順序が変更されてしまうからである。 -ただしそれらは、プロトタイプでは定数であるかのようにしてある。 -これは他のシステムとの互換性のためである。 +.TP +\fBgetopt\fP(): +環境変数 \fBPOSIXLY_CORRECT\fP が設定されている場合は POSIX.2 と POSIX.1\-2001 に準拠する。 他の場合は +\fIargv\fP の要素は本当の意味での定数にはならない。 なぜなら順序が変更されてしまうからである。 +ただしそれらは、プロトタイプでは定数であるかのようにしてある。 これは他のシステムとの互換性のためである。 -.\"O The use of \(aq+\(aq and \(aq\-\(aq in -.\"O .I optstring -.\"O is a GNU extension. -.I optstring -で \(aq+\(aq や \(aq\-\(aq を使うのは GNU による拡張である. +\fIoptstring\fP で \(aq+\(aq や \(aq\-\(aq を使うのは GNU による拡張である. -.\"O On some older implementations, -.\"O .BR getopt () -.\"O was declared in -.\"O .IR . -.\"O SUSv1 permitted the declaration to appear in either -.\"O .I -.\"O or -.\"O .IR . -.\"O POSIX.1-2001 marked the use if -.\"O .I -.\"O for this purpose as LEGACY. -.\"O POSIX.1-2001 does not allow the declaration to appear in -.\"O .IR . -古い実装のいくつかでは、 -.BR getopt () -は -.I -で宣言されていた。 -SUSv1 では、 -.I -か -.I -のどちらかで -宣言してもよかった。 -POSIX.1-2001 では、 -.B getopt -の宣言を -.I -で行うのは「過去の名残」であるとされた。 -POSIX.1-2001 では -.I -で宣言を行うことを認めていない。 -.TP -.\"O .BR getopt_long "() and " getopt_long_only (): -.\"O These functions are GNU extensions. -.BR getopt_long "(), " getopt_long_only (): +古い実装のいくつかでは、 \fBgetopt\fP() は \fI\fP で宣言されていた。 SUSv1 では、 +\fI\fP か \fI\fP のどちらかで 宣言してもよかった。 POSIX.1\-2001 +では、 \fBgetopt\fP の宣言を \fI\fP で行うのは「過去の名残」であるとされた。 POSIX.1\-2001 では +\fI\fP で宣言を行うことを認めていない。 +.TP +\fBgetopt_long\fP(), \fBgetopt_long_only\fP(): これらの関数は GNU による拡張である。 -.\"O .SH NOTES .SH 注意 -.\"O A program that scans multiple argument vectors, -.\"O or rescans the same vector more than once, -.\"O and wants to make use of GNU extensions such as \(aq+\(aq -.\"O and \(aq\-\(aq at the start of -.\"O .IR optstring , -.\"O or changes the value of -.\"O .B POSIXLY_CORRECT -.\"O between scans, -.\"O must reinitialize -.\"O .BR getopt () -.\"O by resetting -.\"O .I optind -.\"O to 0, rather than the traditional value of 1. -.\"O (Resetting to 0 forces the invocation of an internal initialization -.\"O routine that rechecks -.\"O .B POSIXLY_CORRECT -.\"O and checks for GNU extensions in -.\"O .IR optstring .) -複数の引き数ベクトルをスキャンしたり、同じ引き数ベクトルを二回以上 -スキャンするようなプログラムで、 -.I optstring -の先頭で \(aq+\(aq や \(aq\-\(aq といった GNU による拡張機能を使用したり、 -引き数ベクトルの切り替え時に -.B POSIXLY_CORRECT -の値を変更したりする場合には、 -.I optind -を伝統的な 1 ではなく 0 にリセットすることで -.BR getopt () -を再初期化しなければならない -(0 にリセットすることで、 -.B POSIXLY_CORRECT -や -.I optstring +複数の引き数ベクトルをスキャンしたり、同じ引き数ベクトルを二回以上 スキャンするようなプログラムで、 \fIoptstring\fP の先頭で +\(aq+\(aq や \(aq\-\(aq といった GNU による拡張機能を使用したり、 引き数ベクトルの切り替え時に +\fBPOSIXLY_CORRECT\fP の値を変更したりする場合には、 \fIoptind\fP を伝統的な 1 ではなく 0 にリセットすることで +\fBgetopt\fP() を再初期化しなければならない (0 にリセットすることで、 \fBPOSIXLY_CORRECT\fP や \fIoptstring\fP の GNU 拡張機能のチェックを行う内部初期化ルーチンが起動される)。 -.\"O .SH "BUGS" .SH バグ -.\"O The POSIX.2 specification of -.\"O .BR getopt () -.\"O has a technical error described in POSIX.2 Interpretation 150. -.\"O The GNU -.\"O implementation (and probably all other implementations) implements the -.\"O correct behavior rather than that specified. -POSIX.2 における -.BR getopt () -の仕様には技術的な問題があり、 -その内容は POSIX.2 Interpretation 150 に記されている。 -GNU による実装では (おそらく他のすべての実装でも)、 -仕様と異なる正しい動作をするように実装されている。 -.\"O .SH EXAMPLE +POSIX.2 における \fBgetopt\fP() の仕様には技術的な問題があり、 その内容は POSIX.2 Interpretation 150 +に記されている。 GNU による実装では (おそらく他のすべての実装でも)、 仕様と異なる正しい動作をするように実装されている。 .SH 例 -.\"O The following trivial example program uses -.\"O .BR getopt () -.\"O to handle two program options: -.\"O .IR \-n , -.\"O with no associated value; and -.\"O .IR "\-t val" , -.\"O which expects an associated value. -以下に示す簡単なサンプルプログラムでは、 -二種類のプログラムオプションを扱うのに -.BR getopt () -を使用している。一つは値を伴わない -.I \-n -で、もう一つは対応する値が必要な -.I "\-t val" -である。 +以下に示す簡単なサンプルプログラムでは、 二種類のプログラムオプションを扱うのに \fBgetopt\fP() を使用している。一つは値を伴わない +\fI\-n\fP で、もう一つは対応する値が必要な \fI\-t val\fP である。 .nf .sp #include @@ -687,20 +237,20 @@ main(int argc, char *argv[]) tfnd = 1; break; default: /* \(aq?\(aq */ - fprintf(stderr, "Usage: %s [\-t nsecs] [\-n] name\\n", + fprintf(stderr, "Usage: %s [\-t nsecs] [\-n] name\en", argv[0]); exit(EXIT_FAILURE); } } - printf("flags=%d; tfnd=%d; optind=%d\\n", flags, tfnd, optind); + printf("flags=%d; tfnd=%d; optind=%d\en", flags, tfnd, optind); if (optind >= argc) { - fprintf(stderr, "Expected argument after options\\n"); + fprintf(stderr, "Expected argument after options\en"); exit(EXIT_FAILURE); } - printf("name argument = %s\\n", argv[optind]); + printf("name argument = %s\en", argv[optind]); /* Other code omitted */ @@ -708,12 +258,7 @@ main(int argc, char *argv[]) } .fi .PP -.\"O The following example program illustrates the use of -.\"O .BR getopt_long () -.\"O with most of its features. -以下は、 -.BR getopt_long () -の使用法を、ほぼすべての機能について示したプログラムの例である。 +以下は、 \fBgetopt_long\fP() の使用法を、ほぼすべての機能について示したプログラムの例である。 .nf .sp #include /* for printf */ @@ -748,52 +293,51 @@ main(int argc, char **argv) { printf("option %s", long_options[option_index].name); if (optarg) printf(" with arg %s", optarg); - printf("\\n"); + printf("\en"); break; case \(aq0\(aq: case \(aq1\(aq: case \(aq2\(aq: if (digit_optind != 0 && digit_optind != this_option_optind) - printf("digits occur in two different argv\-elements.\\n"); + printf("digits occur in two different argv\-elements.\en"); digit_optind = this_option_optind; - printf("option %c\\n", c); + printf("option %c\en", c); break; case \(aqa\(aq: - printf("option a\\n"); + printf("option a\en"); break; case \(aqb\(aq: - printf("option b\\n"); + printf("option b\en"); break; case \(aqc\(aq: - printf("option c with value \(aq%s\(aq\\n", optarg); + printf("option c with value \(aq%s\(aq\en", optarg); break; case \(aqd\(aq: - printf("option d with value \(aq%s\(aq\\n", optarg); + printf("option d with value \(aq%s\(aq\en", optarg); break; case \(aq?\(aq: break; default: - printf("?? getopt returned character code 0%o ??\\n", c); + printf("?? getopt returned character code 0%o ??\en", c); } } if (optind < argc) { - printf("non-option ARGV\-elements: "); + printf("non\-option ARGV\-elements: "); while (optind < argc) printf("%s ", argv[optind++]); - printf("\\n"); + printf("\en"); } exit(EXIT_SUCCESS); } .fi -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR getsubopt (3) +\fBgetsubopt\fP(3) diff --git a/draft/man3/getprotoent_r.3 b/draft/man3/getprotoent_r.3 new file mode 100644 index 00000000..c4195256 --- /dev/null +++ b/draft/man3/getprotoent_r.3 @@ -0,0 +1,196 @@ +.\" Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GETPROTOENT_R 3 2010\-09\-10 GNU "Linux Programmer's Manual" +.SH 名前 +getprotoent_r, getprotobyname_r, getprotobynumber_r \- get protocol entry +(reentrant) +.SH 書式 +.nf +\fB#include \fP +.sp +\fBint getprotoent_r(struct protoent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP +\fB size_t \fP\fIbuflen\fP\fB, struct protoent **\fP\fIresult\fP\fB);\fP +.sp +\fBint getprotobyname_r(const char *\fP\fIname\fP\fB,\fP +\fB struct protoent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP +\fB size_t \fP\fIbuflen\fP\fB, struct protoent **\fP\fIresult\fP\fB);\fP +.sp +\fBint getprotobynumber_r(int \fP\fIproto\fP\fB,\fP +\fB struct protoent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP +\fB size_t \fP\fIbuflen\fP\fB, struct protoent **\fP\fIresult\fP\fB);\fP +.sp +.fi +.in -4n +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.ad l +.in +.sp +\fBgetprotoent_r\fP(), \fBgetprotobyname_r\fP(), \fBgetprotobynumber_r\fP(): +.RS 4 +_BSD_SOURCE || _SVID_SOURCE +.RE +.ad b +.SH 説明 +The \fBgetprotoent_r\fP(), \fBgetprotobyname_r\fP(), and \fBgetprotobynumber_r\fP() +functions are the reentrant equivalents of, respectively, \fBgetprotoent\fP(3), +\fBgetprotobyname\fP(3), and \fBgetprotobynumber\fP(3). They differ in the way +that the \fIprotoent\fP structure is returned, and in the function calling +signature and return value. This manual page describes just the differences +from the nonreentrant functions. + +Instead of returning a pointer to a statically allocated \fIprotoent\fP +structure as the function result, these functions copy the structure into +the location pointed to by \fIresult_buf\fP. + +.\" I can find no information on the required/recommended buffer size; +.\" the nonreentrant functions use a 1024 byte buffer. +.\" The 1024 byte value is also what the Solaris man page suggests. -- mtk +The \fIbuf\fP array is used to store the string fields pointed to by the +returned \fIprotoent\fP structure. (The nonreentrant functions allocate these +strings in static storage.) The size of this array is specified in +\fIbuflen\fP. If \fIbuf\fP is too small, the call fails with the error \fBERANGE\fP, +and the caller must try again with a larger buffer. (A buffer of length +1024 bytes should be sufficient for most applications.) + +If the function call successfully obtains a protocol record, then \fI*result\fP +is set pointing to \fIresult_buf\fP; otherwise, \fI*result\fP is set to NULL. +.SH 返り値 +On success, these functions return 0. On error, they return one of the +positive error numbers listed in ERRORS. + +On error, record not found (\fBgetprotobyname_r\fP(), \fBgetprotobynumber_r\fP()), +or end of input (\fBgetprotoent_r\fP()) \fIresult\fP is set to NULL. +.SH エラー +.TP +\fBENOENT\fP +(\fBgetprotoent_r\fP()) No more records in database. +.TP +\fBERANGE\fP +\fIbuf\fP is too small. Try again with a larger buffer (and increased +\fIbuflen\fP). +.SH 準拠 +These functions are GNU extensions. Functions with similar names exist on +some other systems, though typically with different calling signatures. +.SH 例 +The program below uses \fBgetprotobyname_r\fP() to retrieve the protocol +record for the protocol named in its first command\-line argument. If a +second (integer) command\-line argument is supplied, it is used as the +initial value for \fIbuflen\fP; if \fBgetprotobyname_r\fP() fails with the error +\fBERANGE\fP, the program retries with larger buffer sizes. The following +shell session shows a couple of sample runs: +.in +4n +.nf + +$\fB ./a.out tcp 1\fP +ERANGE! Retrying with larger buffer +getprotobyname_r() returned: 0 (success) (buflen=78) +p_name=tcp; p_proto=6; aliases=TCP +$\fB ./a.out xxx 1\fP +ERANGE! Retrying with larger buffer +getprotobyname_r() returned: 0 (success) (buflen=100) +Call failed/record not found +.fi +.in +.SS プログラムのソース +\& +.nf +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include + +#define MAX_BUF 10000 + +int +main(int argc, char *argv[]) +{ + int buflen, erange_cnt, s; + struct protoent result_buf; + struct protoent *result; + char buf[MAX_BUF]; + char **p; + + if (argc < 2) { + printf("Usage: %s proto\-name [buflen]\en", argv[0]); + exit(EXIT_FAILURE); + } + + buflen = 1024; + if (argc > 2) + buflen = atoi(argv[2]); + + if (buflen > MAX_BUF) { + printf("Exceeded buffer limit (%d)\en", MAX_BUF); + exit(EXIT_FAILURE); + } + + erange_cnt = 0; + do { + s = getprotobyname_r(argv[1], &result_buf, + buf, buflen, &result); + if (s == ERANGE) { + if (erange_cnt == 0) + printf("ERANGE! Retrying with larger buffer\en"); + erange_cnt++; + + /* Increment a byte at a time so we can see exactly + what size buffer was required */ + + buflen++; + + if (buflen > MAX_BUF) { + printf("Exceeded buffer limit (%d)\en", MAX_BUF); + exit(EXIT_FAILURE); + } + } + } while (s == ERANGE); + + printf("getprotobyname_r() returned: %s (buflen=%d)\en", + (s == 0) ? "0 (success)" : (s == ENOENT) ? "ENOENT" : + strerror(s), buflen); + + if (s != 0 || result == NULL) { + printf("Call failed/record not found\en"); + exit(EXIT_FAILURE); + } + + printf("p_name=%s; p_proto=%d; aliases=", + result_buf.p_name, result_buf.p_proto); + for (p = result_buf.p_aliases; *p != NULL; p++) + printf("%s ", *p); + printf("\en"); + + exit(EXIT_SUCCESS); +} +.fi +.SH 関連項目 +\fBgetprotoent\fP(3), \fBprotocols\fP(5) diff --git a/draft/man3/getrpcent_r.3 b/draft/man3/getrpcent_r.3 new file mode 100644 index 00000000..49862528 --- /dev/null +++ b/draft/man3/getrpcent_r.3 @@ -0,0 +1,99 @@ +.\" Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GETRPCENT_R 3 2010\-09\-10 GNU "Linux Programmer's Manual" +.SH 名前 +getrpcent_r, getrpcbyname_r, getrpcbynumber_r \- get RPC entry (reentrant) +.SH 書式 +.nf +\fB#include \fP +.sp +\fBint getrpcent_r(struct rpcent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP +\fB size_t \fP\fIbuflen\fP\fB, struct rpcent **\fP\fIresult\fP\fB);\fP +.sp +\fBint getrpcbyname_r(const char *\fP\fIname\fP\fB,\fP +\fB struct rpcent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP +\fB size_t \fP\fIbuflen\fP\fB, struct rpcent **\fP\fIresult\fP\fB);\fP +.sp +\fBint getrpcbynumber_r(int \fP\fInumber\fP\fB,\fP +\fB struct rpcent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP +\fB size_t \fP\fIbuflen\fP\fB, struct rpcent **\fP\fIresult\fP\fB);\fP +.sp +.fi +.in -4n +Feature Test Macro Requirements for glibc (see \fBfeature_test_macros\fP(7)): +.ad l +.in +.sp +\fBgetrpcent_r\fP(), \fBgetrpcbyname_r\fP(), \fBgetrpcbynumber_r\fP(): +.RS 4 +_BSD_SOURCE || _SVID_SOURCE +.RE +.ad b +.SH 説明 +The \fBgetrpcent_r\fP(), \fBgetrpcbyname_r\fP(), and \fBgetrpcbynumber_r\fP() +functions are the reentrant equivalents of, respectively, \fBgetrpcent\fP(3), +\fBgetrpcbyname\fP(3), and \fBgetrpcbynumber\fP(3). They differ in the way that +the \fIrpcent\fP structure is returned, and in the function calling signature +and return value. This manual page describes just the differences from the +nonreentrant functions. + +Instead of returning a pointer to a statically allocated \fIrpcent\fP structure +as the function result, these functions copy the structure into the location +pointed to by \fIresult_buf\fP. + +.\" I can find no information on the required/recommended buffer size; +.\" the nonreentrant functions use a 1024 byte buffer -- mtk. +The \fIbuf\fP array is used to store the string fields pointed to by the +returned \fIrpcent\fP structure. (The nonreentrant functions allocate these +strings in static storage.) The size of this array is specified in +\fIbuflen\fP. If \fIbuf\fP is too small, the call fails with the error \fBERANGE\fP, +and the caller must try again with a larger buffer. (A buffer of length +1024 bytes should be sufficient for most applications.) + +If the function call successfully obtains an RPC record, then \fI*result\fP is +set pointing to \fIresult_buf\fP; otherwise, \fI*result\fP is set to NULL. +.SH 返り値 +On success, these functions return 0. On error, they return one of the +positive error numbers listed in ERRORS. + +On error, record not found (\fBgetrpcbyname_r\fP(), \fBgetrpcbynumber_r\fP()), or +end of input (\fBgetrpcent_r\fP()) \fIresult\fP is set to NULL. +.SH エラー +.TP +\fBENOENT\fP +(\fBgetrpcent_r\fP()) No more records in database. +.TP +\fBERANGE\fP +\fIbuf\fP is too small. Try again with a larger buffer (and increased +\fIbuflen\fP). +.SH 準拠 +These functions are GNU extensions. Functions with similar names exist on +some other systems, though typically with different calling signatures. +.SH 関連項目 +\fBgetrpcent\fP(3), \fBrpc\fP(5) diff --git a/draft/man3/getservent_r.3 b/draft/man3/getservent_r.3 new file mode 100644 index 00000000..657480b6 --- /dev/null +++ b/draft/man3/getservent_r.3 @@ -0,0 +1,200 @@ +.\" Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GETSERVENT_R 3 2010\-09\-10 GNU "Linux Programmer's Manual" +.SH 名前 +getservent_r, getservbyname_r, getservbyport_r \- get service entry +(reentrant) +.SH 書式 +.nf +\fB#include \fP +.sp +\fBint getservent_r(struct servent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP +\fB size_t \fP\fIbuflen\fP\fB, struct servent **\fP\fIresult\fP\fB);\fP +.sp +\fBint getservbyname_r(const char *\fP\fIname\fP\fB, const char *\fP\fIproto\fP\fB,\fP +\fB struct servent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP +\fB size_t \fP\fIbuflen\fP\fB, struct servent **\fP\fIresult\fP\fB);\fP +.sp +\fBint getservbyport_r(int \fP\fIport\fP\fB, const char *\fP\fIproto\fP\fB,\fP +\fB struct servent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP +\fB size_t \fP\fIbuflen\fP\fB, struct servent **\fP\fIresult\fP\fB);\fP +.sp +.fi +.in -4n +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.ad l +.in +.sp +\fBgetservent_r\fP(), \fBgetservbyname_r\fP(), \fBgetservbyport_r\fP(): +.RS 4 +_BSD_SOURCE || _SVID_SOURCE +.RE +.ad b +.SH 説明 +The \fBgetservent_r\fP(), \fBgetservbyname_r\fP(), and \fBgetservbyport_r\fP() +functions are the reentrant equivalents of, respectively, \fBgetservent\fP(3), +\fBgetservbyname\fP(3), and \fBgetservbyport\fP(3). They differ in the way that +the \fIservent\fP structure is returned, and in the function calling signature +and return value. This manual page describes just the differences from the +nonreentrant functions. + +Instead of returning a pointer to a statically allocated \fIservent\fP +structure as the function result, these functions copy the structure into +the location pointed to by \fIresult_buf\fP. + +.\" I can find no information on the required/recommended buffer size; +.\" the nonreentrant functions use a 1024 byte buffer -- mtk. +The \fIbuf\fP array is used to store the string fields pointed to by the +returned \fIservent\fP structure. (The nonreentrant functions allocate these +strings in static storage.) The size of this array is specified in +\fIbuflen\fP. If \fIbuf\fP is too small, the call fails with the error \fBERANGE\fP, +and the caller must try again with a larger buffer. (A buffer of length +1024 bytes should be sufficient for most applications.) + +If the function call successfully obtains a service record, then \fI*result\fP +is set pointing to \fIresult_buf\fP; otherwise, \fI*result\fP is set to NULL. +.SH 返り値 +On success, these functions return 0. On error, they return one of the +positive error numbers listed in errors. + +On error, record not found (\fBgetservbyname_r\fP(), \fBgetservbyport_r\fP()), or +end of input (\fBgetservent_r\fP()) \fIresult\fP is set to NULL. +.SH エラー +.TP +\fBENOENT\fP +(\fBgetservent_r\fP()) No more records in database. +.TP +\fBERANGE\fP +\fIbuf\fP is too small. Try again with a larger buffer (and increased +\fIbuflen\fP). +.SH 準拠 +These functions are GNU extensions. Functions with similar names exist on +some other systems, though typically with different calling signatures. +.SH 例 +The program below uses \fBgetservbyport_r\fP() to retrieve the service record +for the port and protocol named in its first command\-line argument. If a +third (integer) command\-line argument is supplied, it is used as the initial +value for \fIbuflen\fP; if \fBgetservbyport_r\fP() fails with the error +\fBERANGE\fP, the program retries with larger buffer sizes. The following +shell session shows a couple of sample runs: +.in +4n +.nf + +$\fB ./a.out 7 tcp 1\fP +ERANGE! Retrying with larger buffer +getservbyport_r() returned: 0 (success) (buflen=87) +s_name=echo; s_proto=tcp; s_port=7; aliases= +$\fB ./a.out 77777 tcp\fP +getservbyport_r() returned: 0 (success) (buflen=1024) +Call failed/record not found +.fi +.in +.SS プログラムのソース +\& +.nf +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include + +#define MAX_BUF 10000 + +int +main(int argc, char *argv[]) +{ + int buflen, erange_cnt, port, s; + struct servent result_buf; + struct servent *result; + char buf[MAX_BUF]; + char *protop; + char **p; + + if (argc < 3) { + printf("Usage: %s port\-num proto\-name [buflen]\en", argv[0]); + exit(EXIT_FAILURE); + } + + port = htons(atoi(argv[1])); + protop = (strcmp(argv[2], "null") == 0 || + strcmp(argv[2], "NULL") == 0) ? NULL : argv[2]; + + buflen = 1024; + if (argc > 3) + buflen = atoi(argv[3]); + + if (buflen > MAX_BUF) { + printf("Exceeded buffer limit (%d)\en", MAX_BUF); + exit(EXIT_FAILURE); + } + + erange_cnt = 0; + do { + s = getservbyport_r(port, protop, &result_buf, + buf, buflen, &result); + if (s == ERANGE) { + if (erange_cnt == 0) + printf("ERANGE! Retrying with larger buffer\en"); + erange_cnt++; + + /* Increment a byte at a time so we can see exactly + what size buffer was required */ + + buflen++; + + if (buflen > MAX_BUF) { + printf("Exceeded buffer limit (%d)\en", MAX_BUF); + exit(EXIT_FAILURE); + } + } + } while (s == ERANGE); + + printf("getservbyport_r() returned: %s (buflen=%d)\en", + (s == 0) ? "0 (success)" : (s == ENOENT) ? "ENOENT" : + strerror(s), buflen); + + if (s != 0 || result == NULL) { + printf("Call failed/record not found\en"); + exit(EXIT_FAILURE); + } + + printf("s_name=%s; s_proto=%s; s_port=%d; aliases=", + result_buf.s_name, result_buf.s_proto, + ntohs(result_buf.s_port)); + for (p = result_buf.s_aliases; *p != NULL; p++) + printf("%s ", *p); + printf("\en"); + + exit(EXIT_SUCCESS); +} +.fi +.SH 関連項目 +\fBgetservent\fP(3), \fBservices\fP(5) diff --git a/draft/man3/getsubopt.3 b/draft/man3/getsubopt.3 index 7e650853..71700461 100644 --- a/draft/man3/getsubopt.3 +++ b/draft/man3/getsubopt.3 @@ -20,215 +20,73 @@ .\" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE .\" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. .\" -.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2007-06-02, Akihiro MOTOKI -.\" -.TH GETSUBOPT 3 2010-09-26 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GETSUBOPT 3 2010\-09\-26 GNU "Linux Programmer's Manual" .SH 名前 -.\"O getsubopt \- parse suboption arguments from a string getsubopt \- 文字列中のサブオプション引き数の解釈を行う -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP -.BI "int getsubopt(char **"optionp ", char * const *" tokens \ -", char **" valuep ); +\fBint getsubopt(char **\fP\fIoptionp\fP\fB, char * const *\fP\fItokens\fP\fB, char +**\fP\fIvaluep\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR getsubopt (): +\fBgetsubopt\fP(): .ad l .RS 4 .PD 0 -_XOPEN_SOURCE\ >= 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +_XOPEN_SOURCE\ >= 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .br || /* Since glibc 2.12: */ _POSIX_C_SOURCE\ >=\ 200809L .PD .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR getsubopt () -.\"O parses the list of comma-separated suboptions provided in -.\"O .IR optionp . -.\"O (Such a suboption list is typically produced when -.\"O .BR getopt (3) -.\"O is used to parse a command line; -.\"O see for example the \fI-o\fP option of -.\"O .BR mount (8).) -.\"O Each suboption may include an associated value, -.\"O which is separated from the suboption name by an equal sign. -.\"O The following is an example of the kind of string -.\"O that might be passed in -.\"O .IR optionp : -.BR getsubopt () -は、 -.I optionp -で与えられたカンマ区切りのサブオプション・リストを解析する。 -(このようなサブオプション・リストは -.BR getopt (3) -を使ってコマンドラインを解釈した場合に現れることが多い。 -例えば、 -.BR mount (8) -の \fI-o\fP オプションを見るとよい。) -それぞれのサブオプションには対応する値を指定することができる。 -サブオプションの名前と対応する値は等号 (\(aq=\(aq) で区切られる。 -例えば、以下のような文字列を -.I optionp -に渡すことができる。 +\fBgetsubopt\fP() は、 \fIoptionp\fP で与えられたカンマ区切りのサブオプション・リストを解析する。 +(このようなサブオプション・リストは \fBgetopt\fP(3) を使ってコマンドラインを解釈した場合に現れることが多い。 例えば、 +\fBmount\fP(8) の \fI\-o\fP オプションを見るとよい。) それぞれのサブオプションには対応する値を指定することができる。 +サブオプションの名前と対応する値は等号 (\(aq=\(aq) で区切られる。 例えば、以下のような文字列を \fIoptionp\fP に渡すことができる。 .sp .in +4n -.B ro,name=xyz +\fBro,name=xyz\fP .in -.\"O The -.\"O .I tokens -.\"O argument is a pointer to a NULL-terminated array of pointers to the tokens that -.\"O .BR getsubopt () -.\"O will look for in -.\"O .IR optionp . -.\"O The tokens should be distinct, null-terminated strings containing at -.\"O least one character, with no embedded equal signs or commas. -.I tokens -引き数はトークンへのポインタの配列へのポインタで、 -配列は NULL で終端される。 -.BR getsubopt () -はこのトークンを -.I optionp -内で探す。 -それぞれのトークンは、NULL 終端された 1文字以上の文字列で、 -他のトークンと区別できる必要がある。 -また、等号とカンマを含んではならない。 +\fItokens\fP 引き数はトークンへのポインタの配列へのポインタで、 配列は NULL で終端される。 \fBgetsubopt\fP() +はこのトークンを \fIoptionp\fP 内で探す。 それぞれのトークンは、NULL 終端された 1文字以上の文字列で、 +他のトークンと区別できる必要がある。 また、等号とカンマを含んではならない。 -.\"O Each call to -.\"O .BR getsubopt () -.\"O returns information about the next unprocessed suboption in -.\"O .IR optionp . -.BR getsubopt () -は呼び出されるたびに、 -.I optionp -中の次の未処理のサブオプションの情報を返す。 -.\"O The first equal sign in a suboption (if any) is interpreted as a -.\"O separator between the name and the value of that suboption. -.\"O The value extends to the next comma, -.\"O or (for the last suboption) to the end of the string. -サブオプション内に等号があった場合、最初の等号は -そのサブオプションの名前と値の区切りと解釈される。 -区切りから次のカンマ (最後のサブオプションの場合、文字列の末尾) -までが、サブオプションの値となる。 -.\"O If the name of the suboption matches a known name from -.\"O .IR tokens , -.\"O and a value string was found, -.\"O .BR getsubopt () -.\"O sets -.\"O .I *valuep -.\"O to the address of that string. -サブオプションの名前が -.I tokens -内の名前と一致し、値を表す文字列が見つかった場合、 -.BR getsubopt () -は -.I *valuep -を値を表す文字列のアドレスに設定する。 -.\"O The first comma in -.\"O .I optionp -.\"O is overwritten with a null byte, so -.\"O .I *valuep -.\"O is precisely the "value string" for that suboption. -.I optionp -中の最初のカンマはヌルバイトで上書きされる。そのため、 -.I *valuep -はそのサブオプションの「値の文字列」そのものとなる。 +\fBgetsubopt\fP() は呼び出されるたびに、 \fIoptionp\fP 中の次の未処理のサブオプションの情報を返す。 +サブオプション内に等号があった場合、最初の等号は そのサブオプションの名前と値の区切りと解釈される。 区切りから次のカンマ +(最後のサブオプションの場合、文字列の末尾) までが、サブオプションの値となる。 サブオプションの名前が \fItokens\fP +内の名前と一致し、値を表す文字列が見つかった場合、 \fBgetsubopt\fP() は \fI*valuep\fP を値を表す文字列のアドレスに設定する。 +\fIoptionp\fP 中の最初のカンマはヌルバイトで上書きされる。そのため、 \fI*valuep\fP はそのサブオプションの「値の文字列」そのものとなる。 -.\"O If the suboption is recognized, but no value string was found, -.\"O .RI * valuep -.\"O is set to NULL. -サブオプションが認識されたが、値を表す文字列が見つからなかった場合、 -.RI * valuep -は NULL に設定される。 +サブオプションが認識されたが、値を表す文字列が見つからなかった場合、 *\fIvaluep\fP は NULL に設定される。 -.\"O When -.\"O .BR getsubopt () -.\"O returns, -.\"O .I optionp -.\"O points to the next suboption, -.\"O or to the null byte (\(aq\\0\(aq) at the end of the -.\"O string if the last suboption was just processed. -.BR getsubopt () -が返る時、 -.I optionp -は次のサブオプションを指している。 -ちょうど最後のサブオプションが処理された場合は、 -文字列末尾のヌルバイト (\(aq\\0\(aq) を指している。 -.\"O .SH RETURN VALUE +\fBgetsubopt\fP() が返る時、 \fIoptionp\fP は次のサブオプションを指している。 ちょうど最後のサブオプションが処理された場合は、 +文字列末尾のヌルバイト (\(aq\e0\(aq) を指している。 .SH 返り値 -.\"O If the first suboption in -.\"O .I optionp -.\"O is recognized, -.\"O .BR getsubopt () -.\"O returns the index of the matching suboption element in -.\"O .IR tokens . -.\"O Otherwise, \-1 is returned and -.\"O .I *valuep -.\"O is the entire -.\"O .IB name [= value ] -.\"O string. -.I optionp -内でサブオプションが見つかった場合、 -.BR getsubopt () -は最初のサブオプションにマッチする -.I tokens -の要素の添字を返す。 -見つからなかった場合、\-1 を返す。この場合、 -.I *valuep -は -.IB name [= value ] +\fIoptionp\fP 内でサブオプションが見つかった場合、 \fBgetsubopt\fP() は最初のサブオプションにマッチする \fItokens\fP +の要素の添字を返す。 見つからなかった場合、\-1 を返す。この場合、 \fI*valuep\fP は \fIname\fP\fB[=\fP\fIvalue\fP\fB]\fP の文字列全体となる。 -.\"O Since -.\"O .I *optionp -.\"O is changed, the first suboption before the call to -.\"O .BR getsubopt () -.\"O is not (necessarily) the same as the first suboption after -.\"O .BR getsubopt (). -.I *optionp -は変更されるので、 -.BR getsubopt () -を呼び出す前の最初のサブオプションは -.BR getsubopt () +\fI*optionp\fP は変更されるので、 \fBgetsubopt\fP() を呼び出す前の最初のサブオプションは \fBgetsubopt\fP() を呼び出し後のサブオプションと必ずしも同じとは限らない。 -.\"O .SH CONFORMING TO .SH 準拠 -POSIX.1-2001. -.\"O .SH NOTES +POSIX.1\-2001. .SH 注意 -.\"O Since -.\"O .BR getsubopt () -.\"O overwrites any commas it finds in the string -.\"O .I *optionp , -.\"O that string must be writable; it cannot be a string constant. -.BR getsubopt () -は、文字列 -.RI * optionp -中に見つけたカンマを上書きするので、文字列 -.I *optionp -は書き込み可能でなければならず、 -文字列定数にすることはできない。 -.\"O .SH EXAMPLE +\fBgetsubopt\fP() は、文字列 *\fIoptionp\fP 中に見つけたカンマを上書きするので、文字列 \fI*optionp\fP +は書き込み可能でなければならず、 文字列定数にすることはできない。 .SH 例 -.\"O The following program expects suboptions following a "\-o" option. -以下のプログラムは "\-o" オプションに続いてサブオプションがあることを -期待している。 +以下のプログラムは "\-o" オプションに続いてサブオプションがあることを 期待している。 .nf #define _XOPEN_SOURCE 500 @@ -262,7 +120,7 @@ int main(int argc, char **argv) switch (opt) { case \(aqo\(aq: subopts = optarg; - while (*subopts != \(aq\\0\(aq && !errfnd) { + while (*subopts != \(aq\e0\(aq && !errfnd) { switch (getsubopt(&subopts, token, &value)) { case RO_OPT: @@ -276,7 +134,7 @@ int main(int argc, char **argv) case NAME_OPT: if (value == NULL) { fprintf(stderr, "Missing value for " - "suboption \(aq%s\(aq\\n", token[NAME_OPT]); + "suboption \(aq%s\(aq\en", token[NAME_OPT]); errfnd = 1; continue; } @@ -286,14 +144,14 @@ int main(int argc, char **argv) default: fprintf(stderr, "No match found " - "for token: /%s/\\n", value); + "for token: /%s/\en", value); errfnd = 1; break; } } if (readwrite && readonly) { fprintf(stderr, "Only one of \(aq%s\(aq and \(aq%s\(aq can be " - "specified\\n", token[RO_OPT], token[RW_OPT]); + "specified\en", token[RO_OPT], token[RW_OPT]); errfnd = 1; } break; @@ -304,9 +162,9 @@ int main(int argc, char **argv) } if (errfnd || argc == 1) { - fprintf(stderr, "\\nUsage: %s \-o \\n", argv[0]); + fprintf(stderr, "\enUsage: %s \-o \en", argv[0]); fprintf(stderr, "suboptions are \(aqro\(aq, \(aqrw\(aq, " - "and \(aqname=\(aq\\n"); + "and \(aqname=\(aq\en"); exit(EXIT_FAILURE); } @@ -315,6 +173,5 @@ int main(int argc, char **argv) exit(EXIT_SUCCESS); } .fi -.\"O .SH SEE ALSO .SH 関連項目 -.BR getopt (3) +\fBgetopt\fP(3) diff --git a/draft/man3/getumask.3 b/draft/man3/getumask.3 index 01b72e81..4309a7f4 100644 --- a/draft/man3/getumask.3 +++ b/draft/man3/getumask.3 @@ -23,32 +23,24 @@ .\" This replaces an earlier man page written by Walter Harms .\" . .\" -.\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI all rights reserved. -.\" Translated Thu 05 Dec 2002 by Akihiro MOTOKI +.\"******************************************************************* .\" -.TH GETUMASK 3 2010-09-10 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GETUMASK 3 2010\-09\-10 GNU "Linux Programmer's Manual" .SH 名前 -.\"O getumask \- get file creation mask getumask \- ファイル作成マスクを取得する -.\"O .SH SYNOPSIS .SH 書式 -.nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ .br -.B "#include " +\fB#include \fP .br -.B "#include " +\fB#include \fP .sp -.B "mode_t getumask(void);" -.fi -.\"O .SH DESCRIPTION +\fBmode_t getumask(void);\fP .SH 説明 -.\"O This function returns the current file creation mask. -この関数は現在のファイル作成マスクを返す。 -.\"O It is equivalent to -基本的には以下と等価である。 +この関数は現在のファイル作成マスクを返す。 基本的には以下と等価である。 .in +4n .nf @@ -61,25 +53,10 @@ mode_t getumask(void) .fi .in -.\"O except that it is documented to be thread-safe (that is, shares -.\"O a lock with the -.\"O .BR umask (2) -.\"O library call). -ドキュメントによると、この関数は -スレッド・セーフである -.RB ( umask (2) -ライブラリ・コールとロックを共有する) -点が異なる。 -.\"O .SH "CONFORMING TO" +ドキュメントによると、この関数は スレッド・セーフである (\fBumask\fP(2) ライブラリ・コールとロックを共有する) 点が異なる。 .SH 準拠 -.\"O This is a vaporware GNU extension. ドキュメントに書いてあるだけの GNU 拡張である。 -.\"O .SH NOTES .SH 注意 -.\"O This function is documented but not implemented yet in glibc, -.\"O as at version 2.9. -バージョン 2.9 時点の glibc では、 -この関数についての記載はあるが、まだ実装されていない。 -.\"O .SH "SEE ALSO" +バージョン 2.9 時点の glibc では、 この関数についての記載はあるが、まだ実装されていない。 .SH 関連項目 -.BR umask (2) +\fBumask\fP(2) diff --git a/draft/man3/getusershell.3 b/draft/man3/getusershell.3 index 55e531af..db6d597f 100644 --- a/draft/man3/getusershell.3 +++ b/draft/man3/getusershell.3 @@ -25,93 +25,51 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 19:17:53 1993 by Rik Faith (faith@cs.unc.edu) -.\" Japanese Version Copyright (c) 1997 ISHIOKA Takashi -.\" all rights reserved. -.\" Translated Mon Sep 8 15:02:18 1997 -.\" by ISHIOKA Takashi -.TH GETUSERSHELL 3 2007-07-26 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GETUSERSHELL 3 2007\-07\-26 GNU "Linux Programmer's Manual" .SH 名前 -.\"O getusershell, setusershell, endusershell \- get permitted user shells getusershell, setusershell, endusershell \- 許可されたユーザシェルを得る -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.B char *getusershell(void); +\fBchar *getusershell(void);\fP .sp -.B void setusershell(void); +\fBvoid setusershell(void);\fP .sp -.B void endusershell(void); +\fBvoid endusershell(void);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR getusershell (), -.BR setusershell (), -.BR endusershell (): +\fBgetusershell\fP(), \fBsetusershell\fP(), \fBendusershell\fP(): .RS 4 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR getusershell () -.\"O function returns the next line from the file -.\"O \fI/etc/shells\fP, opening the file if necessary. -.\"O The line should contain -.\"O the pathname of a valid user shell. -.\"O If \fI/etc/shells\fP does not exist or -.\"O is unreadable, -.\"O .BR getusershell () -.\"O behaves as if \fI/bin/sh\fP and -.\"O \fI/bin/csh\fP were listed in the file. -.BR getusershell () -関数は \fI/etc/shells\fP ファイルから -(開く必要があればこのファイルを開いてから) 現在行の次の一行を返す。 -返された行の中身は有効なユーザシェルのうちの一つのパス名である。 -(訳注. 一行に付き一つのシェルのパス名が書かれている。) -もし \fI/etc/shells\fP が存在しないか、読み込み不可の場合には、 -.BR getusershell () -は \fI/bin/sh\fP と \fI/bin/csh\fP -がファイルに記されているかのようにふるまう。 +\fBgetusershell\fP() 関数は \fI/etc/shells\fP ファイルから (開く必要があればこのファイルを開いてから) +現在行の次の一行を返す。 返された行の中身は有効なユーザシェルのうちの一つのパス名である。 (訳注. 一行に付き一つのシェルのパス名が書かれている。) +もし \fI/etc/shells\fP が存在しないか、読み込み不可の場合には、 \fBgetusershell\fP() は \fI/bin/sh\fP と +\fI/bin/csh\fP がファイルに記されているかのようにふるまう。 .PP -.\"O The -.\"O .BR setusershell () -.\"O function rewinds \fI/etc/shells\fP. -.BR setusershell () -関数は \fI/etc/shells\fP ファイルの -ファイルポインタを先頭に戻す。 +\fBsetusershell\fP() 関数は \fI/etc/shells\fP ファイルの ファイルポインタを先頭に戻す。 .PP -.\"O The -.\"O .BR endusershell () -.\"O function closes \fI/etc/shells\fP. -.BR endusershell () -関数は \fI/etc/shells\fP ファイルを閉じる。 -.\"O .SH "RETURN VALUE" +\fBendusershell\fP() 関数は \fI/etc/shells\fP ファイルを閉じる。 .SH 返り値 -.\"O The -.\"O .BR getusershell () -.\"O function returns a NULL pointer on end-of-file. -.BR getusershell () -関数はファイルの終端ではNULL ポインタを返す。 -.\"O .SH FILES +\fBgetusershell\fP() 関数はファイルの終端ではNULL ポインタを返す。 .SH ファイル .nf /etc/shells .fi -.\"O .SH "CONFORMING TO" .SH 準拠 4.3BSD. -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR shells (5) +\fBshells\fP(5) diff --git a/draft/man3/getutmp.3 b/draft/man3/getutmp.3 new file mode 100644 index 00000000..c8cf10e2 --- /dev/null +++ b/draft/man3/getutmp.3 @@ -0,0 +1,59 @@ +.\" Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GETUTMP 3 2010\-09\-10 Linux "Linux Programmer's Manual" +.SH 名前 +getutmp, getutmpx \- copy utmp structure to utmpx, and vice versa +.SH 書式 +.nf +\fB#define _GNU_SOURCE\fP /* See feature_test_macros(7) */ +\fB#include \fP + +\fB void getutmp(const struct utmpx *\fP\fIux\fP\fB, struct utmp *\fP\fIu\fP\fB);\fP +\fB void getutmpx(const struct utmp *\fP\fIu\fP\fB, struct utmpx *\fP\fIux\fP\fB);\fP +.fi +.SH 説明 +The \fBgetutmp\fP() function copies the fields of the \fIutmpx\fP structure +pointed to by \fIux\fP to the corresponding fields of the \fIutmp\fP structure +pointed to by \fIu\fP. The \fBgetutmpx\fP() function performs the converse +operation. +.SH 返り値 +These functions do not return a value. +.SH VERSIONS +These functions first appeared in glibc in version 2.1.1. +.SH 準拠 +These functions are nonstandard, but appear on a few other systems, such as +Solaris and NetBSD. +.SH 注意 +.\" e.g., on Solaris, the utmpx structure is rather larger than utmp. +These functions exist primarily for compatibility with other systems where +the \fIutmp\fP and \fIutmpx\fP structures contain different fields, or the size of +corresponding fields differs. On Linux, the two structures contain the same +fields, and the fields have the same sizes. +.SH 関連項目 +\fBgetutent\fP(3), \fButmp\fP(5) diff --git a/draft/man3/hypot.3 b/draft/man3/hypot.3 index defd2157..34cfc0e4 100644 --- a/draft/man3/hypot.3 +++ b/draft/man3/hypot.3 @@ -28,218 +28,87 @@ .\" Modified 2002-07-27 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 1996 Kenji Kajiwara -.\" all rights reserved. -.\" Translated Mon Jul 15 18:20:00 JST 1996 -.\" by Kenji Kajiwara -.\" Proof Reading: Takashi Yoshino -.\" Updated & Modified Sun Jun 6 05:30:45 JST 2004 -.\" by Yuichi SATO -.\" Updated & Modified Sat Jan 15 02:32:55 JST 2005 by Yuichi SATO -.\" Updated 2008-09-18, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH HYPOT 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH HYPOT 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O hypot, hypotf, hypotl \- Euclidean distance function hypot, hypotf, hypotl \- ユークリッド距離関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double hypot(double " x ", double " y ); +\fBdouble hypot(double \fP\fIx\fP\fB, double \fP\fIy\fP\fB);\fP .br -.BI "float hypotf(float " x ", float " y ); +\fBfloat hypotf(float \fP\fIx\fP\fB, float \fP\fIy\fP\fB);\fP .br -.BI "long double hypotl(long double " x ", long double " y ); +\fBlong double hypotl(long double \fP\fIx\fP\fB, long double \fP\fIy\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR hypot (): +\fBhypot\fP(): .RS 4 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .br -.BR hypotf (), -.BR hypotl (): +\fBhypotf\fP(), \fBhypotl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR hypot () -.\"O function returns -.\"O .RI sqrt( x * x + y * y ). -.BR hypot () -関数は -.RI sqrt( x * x + y * y ) -の値を返す。 -.\"O This is the length of the hypotenuse of a right-angled triangle -.\"O with sides of length -.\"O .I x -.\"O and -.\"O .IR y , -.\"O or the distance of the point -.\"O .RI ( x , y ) -.\"O from the origin. -これは -直角を挟む 2 辺の長さが -.I x -と -.I y -である直角三角形の斜辺の長さ、 -すなわち、原点と点 -.RI ( x , y ) -との距離である。 +\fBhypot\fP() 関数は sqrt(\fIx\fP*\fIx\fP+\fIy\fP*\fIy\fP) の値を返す。 これは 直角を挟む 2 辺の長さが \fIx\fP と +\fIy\fP である直角三角形の斜辺の長さ、 すなわち、原点と点 (\fIx\fP,\fIy\fP) との距離である。 -.\"O The calculation is performed without undue overflow or underflow -.\"O during the intermediate steps of the calculation. -計算の中間ステップでは、必要以上のオーバーフローやアンダーフローが -起きないようにして計算が実行される。 .\" e.g., hypot(DBL_MIN, DBL_MIN) does the right thing, as does, say .\" hypot(DBL_MAX/2.0, DBL_MAX/2.0). -.\"O .SH RETURN VALUE +計算の中間ステップでは、必要以上のオーバーフローやアンダーフローが 起きないようにして計算が実行される。 .SH 返り値 -.\"O On success, these functions return the length of a right-angled triangle -.\"O with sides of length -.\"O .I x -.\"O and -.\"O .IR y . -成功すると、これらの関数は、 -直角を挟む 2 辺の長さが -.I x -と -.I y -である直角三角形の斜辺の長さを返す。 +成功すると、これらの関数は、 直角を挟む 2 辺の長さが \fIx\fP と \fIy\fP である直角三角形の斜辺の長さを返す。 -.\"O If -.\"O .I x -.\"O or -.\"O .I y -.\"O is an infinity, -.\"O positive infinity is returned. -.I x -か -.I y -が無限大の場合、正の無限大が返される。 +\fIx\fP か \fIy\fP が無限大の場合、正の無限大が返される。 -.\"O If -.\"O .I x -.\"O or -.\"O .I y -.\"O is a NaN, -.\"O and the other argument is not an infinity, -.\"O a NaN is returned. -.I x -か -.I y -の一方が NaN で、もう一方が無限大でない場合、 -NaN が返される。 +\fIx\fP か \fIy\fP の一方が NaN で、もう一方が無限大でない場合、 NaN が返される。 -.\"O If the result overflows, -.\"O a range error occurs, -.\"O and the functions return -.\"O .BR HUGE_VAL , -.\"O .BR HUGE_VALF , -.\"O or -.\"O .BR HUGE_VALL , -.\"O respectively. -結果がオーバーフローする場合、範囲エラー (range error) が発生し、 -各関数はそれぞれ -.BR HUGE_VAL , -.BR HUGE_VALF , -.B HUGE_VALL -を返す。 +結果がオーバーフローする場合、範囲エラー (range error) が発生し、 各関数はそれぞれ \fBHUGE_VAL\fP, \fBHUGE_VALF\fP, +\fBHUGE_VALL\fP を返す。 -.\"O If both arguments are subnormal, and the result is subnormal, -両方の引き数が非正規化数 (subnormal) で、結果も非正規化数 (subnormal) の場合、 .\" Actually, could the result not be subnormal if both arguments .\" are subnormal? I think not -- mtk, Jul 2008 -.\"O a range error occurs, -.\"O and the correct result is returned. -範囲エラーが発生し、正しい結果が返される。 -.\"O .SH ERRORS +両方の引き数が非正規化数 (subnormal) で、結果も非正規化数 (subnormal) の場合、 範囲エラーが発生し、正しい結果が返される。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Range error: result overflow -範囲エラー: 結果のオーバーフロー -.\"O .I errno -.\"O is set to -.\"O .BR ERANGE . -.\"O An overflow floating-point exception -.\"O .RB ( FE_OVERFLOW ) -.\"O is raised. -.I errno -に -.B ERANGE -が設定される。 -オーバーフロー浮動小数点例外 -.RB ( FE_OVERFLOW ) -が上がる。 -.TP -.\"O Range error: result underflow -範囲エラー: 結果のアンダーフロー +.TP +範囲エラー (range error): 結果のオーバーフロー +\fIerrno\fP に \fBERANGE\fP が設定される。 オーバーフロー浮動小数点例外 (\fBFE_OVERFLOW\fP) が上がる。 +.TP +範囲エラー (range error): 結果のアンダーフロー .\" .I errno .\" is set to .\" .BR ERANGE . -.\"O An underflow floating-point exception -.\"O .RB ( FE_UNDERFLOW ) -.\"O is raised. -アンダーフロー浮動小数点例外 -.RB ( FE_UNDERFLOW ) -が上がる。 +アンダーフロー浮動小数点例外 (\fBFE_UNDERFLOW\fP) が上がる。 .IP -.\"O These functions do not set -.\"O .IR errno -.\"O for this case. -この場合、これらの関数は -.I errno -を設定しない。 .\" FIXME . Is it intentional that these functions do not set errno? .\" They do set errno for the overflow case. .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6795 -.\"O .SH "CONFORMING TO" +これらの関数は、この場合に \fIerrno\fP を設定しない。 .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD. -.I double -版の関数は SVr4, 4.3BSD にも準拠している。 -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD にも準拠している。 .SH 関連項目 -.BR cabs (3), -.BR sqrt (3) +\fBcabs\fP(3), \fBsqrt\fP(3) diff --git a/draft/man3/ilogb.3 b/draft/man3/ilogb.3 index c93496ba..214514da 100644 --- a/draft/man3/ilogb.3 +++ b/draft/man3/ilogb.3 @@ -24,117 +24,60 @@ .\" .\" Inspired by a page by Walter Harms created 2002-08-10 .\" -.\" Japanese Version Copyright (c) 2005 Yuichi SATO -.\" and Copyright (c) 2008 Akihiro MOTOKI -.\" Translated Sat Jan 29 05:17:36 JST 2005 -.\" by Yuichi SATO -.\" Updated 2008-09-18, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH ILOGB 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ILOGB 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O ilogb, ilogbf, ilogbl \- get integer exponent of a floating-point value ilogb, ilogbf, ilogbl \- 浮動小数点数の指数部を整数として取得する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int ilogb(double " x ); +\fBint ilogb(double \fP\fIx\fP\fB);\fP .br -.BI "int ilogbf(float " x ); +\fBint ilogbf(float \fP\fIx\fP\fB);\fP .br -.BI "int ilogbl(long double " x ); +\fBint ilogbl(long double \fP\fIx\fP\fB);\fP .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR ilogb (): +\fBilogb\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || -_ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .br -.BR ilogbf (), -.BR ilogbl (): +\fBilogbf\fP(), \fBilogbl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O These functions return the exponent part of their argument -.\"O as a signed integer. -.\"O When no error occurs, these functions -.\"O are equivalent to the corresponding -.\"O .BR logb (3) -.\"O functions, cast to -.\"O .IR int . -これらの関数は引き数の指数部を符号付き整数として返す。 -エラーが起らなかった場合、これらの関数は、対応する -.BR logb (3) -関数を -.I int +これらの関数は引き数の指数部を符号付き整数として返す。 エラーが起らなかった場合、これらの関数は、対応する \fBlogb\fP(3) 関数を \fIint\fP でキャストしたものと等価である。 -.\"O .SH RETURN VALUE .SH 返り値 -.\"O On success, these functions return the exponent of -.\"O .IR x , -.\"O as a signed integer. -成功すると、これらの関数は -.I x -の指数部を符号付き整数として返す。 +成功すると、これらの関数は \fIx\fP の指数部を符号付き整数として返す。 -.\"O If -.\"O .I x -.\"O is zero, then a domain error occurs, and the functions return .\" the POSIX.1 spec for logb() says logb() gives pole error for this .\" case, but for ilogb() it says domain error. -.\"O .BR FP_ILOGB0 . .\" glibc: The numeric value is either `INT_MIN' or `-INT_MAX'. -.I x -がゼロの場合、領域エラー (domain error) が発生し、 -.B FP_ILOGB0 -が返される。 +\fIx\fP がゼロの場合、領域エラー (domain error) が発生し、 \fBFP_ILOGB0\fP が返される。 -.\"O If -.\"O .I x -.\"O is a NaN, then a domain error occurs, and the functions return -.\"O .BR FP_ILOGBNAN . .\" glibc: The numeric value is either `INT_MIN' or `INT_MAX'. .\" On i386, FP_ILOGB0 and FP_ILOGBNAN have the same value. -.I x -が NaN の場合、領域エラー (domain error) が発生し、 -.B FP_ILOGBNAN -が返される。 +\fIx\fP が NaN の場合、領域エラー (domain error) が発生し、 \fBFP_ILOGBNAN\fP が返される。 -.\"O If -.\"O .I x -.\"O is negative infinity or positive infinity, then -.\"O a domain error occurs, and the functions return -.\"O .BR INT_MAX . -.I x -が負の無限大か正の無限大の場合、 -領域エラー (domain error) が発生し、 -.B INT_MAX -が返される。 .\" .\" POSIX.1-2001 also says: .\" If the correct value is greater than {INT_MAX}, {INT_MAX} @@ -142,41 +85,22 @@ or .\" .\" If the correct value is less than {INT_MIN}, {INT_MIN} .\" shall be returned and a domain error shall occur. -.\"O .SH ERRORS +\fIx\fP が負の無限大か正の無限大の場合、 領域エラー (domain error) が発生し、 \fBINT_MAX\fP が返される。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Domain error: \fIx\fP is 0 or a NaN +.TP 領域エラー: \fIx\fP が 0 か NaN .\" .I errno .\" is set to .\" .BR EDOM . -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -不正 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) -が上がる。 +不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 .IP -.\"O These functions do not set -.\"O .IR errno -.\"O for this case. -これらの関数は、この状況で -.I errno -を設定しない。 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6794 -.TP -.\"O Domain error: \fIx\fP is an infinity -領域エラー: \fIx\fP が無限大 +これらの関数は、この場合に \fIerrno\fP を設定しない。 +.TP +領域エラー (domain error): \fIx\fP が無限大である .\" .I errno .\" is set to .\" .BR EDOM . @@ -184,21 +108,12 @@ or .\" .RB ( FE_INVALID ) .\" is raised. .IP -.\"O These functions do not set -.\"O .IR errno -.\"O or raise an exception for this case. -これらの関数は、この状況で -.I errno -を設定せず、例外も上げない。 .\" FIXME . Is it intentional that these functions do not set errno, .\" or raise an exception? .\" log(), log2(), log10() do set errno .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6794 -.\"O .SH "CONFORMING TO" +これらの関数は、この状況で \fIerrno\fP を設定せず、例外も上げない。 .SH 準拠 -C99, POSIX.1-2001. -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. .SH 関連項目 -.BR log (3), -.BR logb (3), -.BR significand (3) +\fBlog\fP(3), \fBlogb\fP(3), \fBsignificand\fP(3) diff --git a/draft/man3/index.3 b/draft/man3/index.3 index 6edc7ef1..571e6874 100644 --- a/draft/man3/index.3 +++ b/draft/man3/index.3 @@ -26,92 +26,34 @@ .\" 386BSD man pages .\" Modified Mon Apr 12 12:54:34 1993, David Metcalfe .\" Modified Sat Jul 24 19:13:52 1993, Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka -.\" all rights reserved. -.\" Translated Fri Dec 12 12:41:35 JST 1997 -.\" by HIROFUMI Nishizuka +.\" This file was generated with po4a. Translate the source file. .\" -.TH INDEX 3 2011-09-21 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH INDEX 3 2011\-09\-21 GNU "Linux Programmer's Manual" .SH 名前 -.\"O index, rindex \- locate character in string index, rindex \- 文字列中の文字の位置を示す -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "char *index(const char *" s ", int " c ); +\fBchar *index(const char *\fP\fIs\fP\fB, int \fP\fIc\fP\fB);\fP .sp -.BI "char *rindex(const char *" s ", int " c ); +\fBchar *rindex(const char *\fP\fIs\fP\fB, int \fP\fIc\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR index () -.\"O function returns a pointer to the first occurrence -.\"O of the character \fIc\fP in the string \fIs\fP. -.BR index () -関数は、文字列 \fIs\fP 中に最初に文字 \fIc\fP が -現れた位置へのポインタを返す。 +\fBindex\fP() 関数は、文字列 \fIs\fP 中に最初に文字 \fIc\fP が 現れた位置へのポインタを返す。 .PP -.\"O The -.\"O .BR rindex () -.\"O function returns a pointer to the last occurrence -.\"O of the character \fIc\fP in the string \fIs\fP. -.BR rindex () -関数は、文字列 \fIs\fP 中に最後に文字 \fIc\fP が -現れた位置へのポインタを返す。 +\fBrindex\fP() 関数は、文字列 \fIs\fP 中に最後に文字 \fIc\fP が 現れた位置へのポインタを返す。 .PP -.\"O The terminating null byte (\(aq\\0\(aq) is considered to be a part of the -.\"O strings. -文字列を終端する NULL バイト (\(aq\\0\(aq) は、文字列の一部とみなされる。 -.\"O .SH "RETURN VALUE" +文字列を終端する NULL バイト (\(aq\e0\(aq) は、文字列の一部とみなされる。 .SH 返り値 -.\"O The -.\"O .BR index () -.\"O and -.\"O .BR rindex () -.\"O functions return a pointer to -.\"O the matched character or NULL if the character is not found. -.BR index () -と -.BR rindex () -関数は、一致した文字へのポインタか、 -もし文字が見つからない場合は NULL を返す。 -.\"O .SH "CONFORMING TO" +\fBindex\fP() と \fBrindex\fP() 関数は、一致した文字へのポインタか、 もし文字が見つからない場合は NULL を返す。 .SH 準拠 -.\"O 4.3BSD; marked as LEGACY in POSIX.1-2001. -4.3BSD; -POSIX.1-2001 では「過去の名残 (LEGACY)」と位置付けられている。 -.\"O POSIX.1-2008 removes the specifications of -.\"O .BR index () -.\"O and -.\"O .BR rindex (), -.\"O recommending -.\"O .BR strchr (3) -.\"O and -.\"O .BR strrchr (3) -.\"O instead. -POSIX.1-2008 では -.BR index () -と -.BR rindex () -の仕様が削除されている。 -代わりに、 -.BR strchr (3) -と -.BR strrchr (3) +4.3BSD; POSIX.1\-2001 では「過去の名残 (LEGACY)」と位置付けられている。 POSIX.1\-2008 では +\fBindex\fP() と \fBrindex\fP() の仕様が削除されている。 代わりに、 \fBstrchr\fP(3) と \fBstrrchr\fP(3) の使用が推奨されている。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR memchr (3), -.BR strchr (3), -.BR string (3), -.BR strpbrk (3), -.BR strrchr (3), -.BR strsep (3), -.BR strspn (3), -.BR strstr (3), -.BR strtok (3) +\fBmemchr\fP(3), \fBstrchr\fP(3), \fBstring\fP(3), \fBstrpbrk\fP(3), \fBstrrchr\fP(3), +\fBstrsep\fP(3), \fBstrspn\fP(3), \fBstrstr\fP(3), \fBstrtok\fP(3) diff --git a/draft/man3/infnan.3 b/draft/man3/infnan.3 index 4e6683f9..25c40182 100644 --- a/draft/man3/infnan.3 +++ b/draft/man3/infnan.3 @@ -28,82 +28,39 @@ .\" Modified 2004-11-12 as per suggestion by Fabian Kreutz/AEB .\" to note that this function is not available in glibc2. .\" -.\" Japanese Version Copyright (c) 1998 ISHIOKA Takashi -.\" all rights reserved. -.\" Translated Mon May 25 10:45:50 1998 -.\" by ISHIOKA Takashi -.\" Updated & Modified Thu Feb 17 00:01:20 JST 2005 -.\" by Yuichi SATO +.\"******************************************************************* .\" -.TH INFNAN 3 1993-06-02 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH INFNAN 3 1993\-06\-02 GNU "Linux Programmer's Manual" .SH 名前 -.\"O infnan \- deal with infinite or not-a-number (NaN) result infnan \- 無限大と無効値 (NaN) を取扱う -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include -.B #include +\fB#include \fP .sp -.BI "double infnan(int " error ); +\fBdouble infnan(int \fP\fIerror\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR infnan () -.\"O function returns a suitable value for infinity and -.\"O "not-a-number" (NaN) results. -.\"O The value of \fIerror\fP can be -.\"O .B ERANGE -.\"O to represent infinity or anything else to represent NaN. -.\"O \fIerrno\fP -.\"O is also set. -関数 -.BR infnan () -は無限大と無効値 (NaN) の結果に対する適切な値を返す。 -\fIerror\fP の値は、無限大を表す -.B ERANGE -か NaN を表すそれ以外の値である。 -\fIerrno\fP も同様に設定される。 -.\"O .SH "RETURN VALUE" +関数 \fBinfnan\fP() は無限大と無効値 (NaN) の結果に対する適切な値を返す。 \fIerror\fP の値は、無限大を表す \fBERANGE\fP +か NaN を表すそれ以外の値である。 \fIerrno\fP も同様に設定される。 .SH 返り値 -.\"O If \fIerror\fP is -.\"O .B ERANGE -.\"O (Infinity), -.\"O .B HUGE_VAL -.\"O is returned. -\fIerror\fP が -.B ERANGE -(無限大) の場合、 -.B HUGE_VAL -が返される。 +\fIerror\fP が \fBERANGE\fP (無限大) の場合、 \fBHUGE_VAL\fP が返される。 .PP -.\"O If \fIerror\fP is \-\fBERANGE\fP (\-Infinity), \-\fBHUGE_VAL\fP is returned. -\fIerror\fP が \-\fBERANGE\fP (負の無限大) の場合、 -\-\fBHUGE_VAL\fP が返される。 +\fIerror\fP が \-\fBERANGE\fP (負の無限大) の場合、 \-\fBHUGE_VAL\fP が返される。 .PP -.\"O If \fIerror\fP is anything else, NAN is returned. \fIerror\fP がそれ以外の値の場合、NaN が返される。 -.\"O .SH ERRORS .SH エラー -.TP -.B EDOM -.\"O The value of \fIerror\fP is "not-a-number" (NaN). +.TP +\fBEDOM\fP \fIerror\fP の値が無効値 (NaN) である。 -.TP -.B ERANGE -.\"O The value of \fIerror\fP is positive infinity or negative infinity. +.TP +\fBERANGE\fP \fIerror\fP の値が正の無限大もしくは負の無限大である。 -.\"O .SH "CONFORMING TO" .SH 準拠 4.3BSD. -.\"O .SH NOTES .SH 注意 -.\"O This obsolete function was provided in -.\"O libc4 and libc5, but is not available in glibc2. -この廃止された (obsolete) 関数は、 -libc4 と libc5 で提供されていたが、 glibc2 では提供されていない。 +この廃止された (obsolete) 関数は、 libc4 と libc5 で提供されていたが、 glibc2 では提供されていない。 diff --git a/draft/man3/intro.3 b/draft/man3/intro.3 index dd1e8985..35b4f4b6 100644 --- a/draft/man3/intro.3 +++ b/draft/man3/intro.3 @@ -21,148 +21,59 @@ .\" the source, must acknowledge the copyright and authors of this work. .\" .\" 2007-10-23 mtk, Nearly a complete rewrite of the earlier page. +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2008-02-10, Akihiro MOTOKI -.\" -.TH INTRO 3 2010-11-11 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O intro \- Introduction to library functions +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH INTRO 3 2010\-11\-11 Linux "Linux Programmer's Manual" .SH 名前 intro \- ライブラリ関数の紹介 -.\"O .SH DESCRIPTION .SH 説明 -.\"O Section 3 of the manual describes all library functions excluding the library -.\"O functions (system call wrappers) described in section 2, -.\"O which implement system calls. -マニュアルの 3 章では、システムコールを実装した 2 章で説明された -ライブラリ関数 (システムコールのラッパー) を除いた +マニュアルの 3 章では、システムコールを実装した 2 章で説明された ライブラリ関数 (システムコールのラッパー) を除いた 全てのライブラリ関数について説明している。 -.\"O Many of the functions described in the section are part of the -.\"O Standard C Library -.\"O .RI ( libc ). -.\"O Some functions are part of other libraries (e.g., -.\"O the math library, -.\"O .IR libm , -.\"O or the real-time library, -.\"O .IR librt ) -.\"O in which case the manual page will indicate the linker -.\"O option needed to link against the required library -.\"O (e.g., -.\"O .I \-lm -.\"O and -.\"O .IR \-lrt , -.\"O respectively, -.\"O for the aforementioned libraries). -この章で説明している関数の多くは標準 C ライブラリ -.RI ( libc ) -のものである。 -また、いくつかの関数は、他のライブラリ (例えば、数学ライブラリの -.I libm -やリアルタイムライブラリ -.I librt ) -のものである。後者の場合は、マニュアルページに、 -必要なライブラリとリンクするために必要なリンカオプションが -示されている (例えば、前述のライブラリの場合はそれぞれ -.I \-lm -や -.I \-lrt +この章で説明している関数の多くは標準 C ライブラリ (\fIlibc\fP) のものである。 また、いくつかの関数は、他のライブラリ +(例えば、数学ライブラリの \fIlibm\fP やリアルタイムライブラリ \fIlibrt )\fP のものである。後者の場合は、マニュアルページに、 +必要なライブラリとリンクするために必要なリンカオプションが 示されている (例えば、前述のライブラリの場合はそれぞれ \fI\-lm\fP や \fI\-lrt\fP である)。 -.\"O In some cases, -.\"O the programmer must define a feature test macro in order to obtain -.\"O the declaration of a function from the header file specified -.\"O in the man page SYNOPSIS section. -.\"O (Where required, these feature test macros must be defined before including -.\"O .I any -.\"O header files.) -.\"O In such cases, the required macro is described in the man page. -.\"O For further information on feature test macros, see -.\"O .BR feature_test_macros (7). -マニュアルページの「書式」の節に規定されたヘッダファイルから関数の定義を -得るために、プログラマが機能検査マクロを定義しなければならない場合がある。 -このような場合には、必要なマクロがマニュアルページで説明されている。 -(機能検査マクロの定義が必要な場合、これらの機能検査マクロの定義は -「どの」ヘッダファイルのインクルードよりも前で行われなければならない)。 -機能検査マクロのさらなる情報については、 -.BR feature_test_macros (7) -を参照のこと。 .\" -.\"O .\" There -.\"O .\" are various function groups which can be identified by a letter which -.\"O .\" is appended to the chapter number: -.\" 章番号に付け加えられている文字によって識別できる様々な関数のグループがある: +.\" There +.\" are various function groups which can be identified by a letter which +.\" is appended to the chapter number: .\" .IP (3C) -.\"O .\" These functions, the functions from chapter 2 and from chapter 3S are -.\"O .\" contained in the C standard library libc, which will be used by -.\"O .\" .BR cc (1) -.\"O .\" by default. -.\" これら2章と3S章からの関数は標準Cライブラリ libc 中に含まれるものであり、 -.\" デフォルトで +.\" These functions, the functions from chapter 2 and from chapter 3S are +.\" contained in the C standard library libc, which will be used by .\" .BR cc (1) -.\" によって使用されるであろう。 +.\" by default. .\" .IP (3S) -.\"O .\" These functions are parts of the -.\"O .\" .BR stdio (3) -.\"O .\" library. They are contained in the standard C library libc. -.\" これらの関数は +.\" These functions are parts of the .\" .BR stdio (3) -.\" ライブラリの一部である。標準Cライブラリ libc に含まれる。 +.\" library. They are contained in the standard C library libc. .\" .IP (3M) -.\"O .\" These functions are contained in the arithmetic library libm. They are -.\"O .\" used by the -.\"O .\" .BR f77 (1) -.\"O .\" FORTRAN compiler by default, but not by the -.\"O .\" .BR cc (1) -.\"O .\" C compiler, which needs the option \fI\-lm\fP. -.\" これらの関数は数学関数ライブラリ libm に含まれる。これらは -.\" デフォルトで +.\" These functions are contained in the arithmetic library libm. They are +.\" used by the .\" .BR f77 (1) -.\" フォートランコンパイラによって使用される、しかし +.\" FORTRAN compiler by default, but not by the .\" .BR cc (1) -.\" Cコンパイラで使用するときは、\fI\-lm\fP オプションが必要となる。 +.\" C compiler, which needs the option \fI\-lm\fP. .\" .IP (3F) -.\"O .\" These functions are part of the FORTRAN library libF77. There are no -.\"O .\" special compiler flags needed to use these functions. -.\" これらの関数はフォートランライブラリ libF77 の一部である。 -.\" これらの関数を使用するために特別なコンパイラフラグは必要ない。 +.\" These functions are part of the FORTRAN library libF77. There are no +.\" special compiler flags needed to use these functions. .\" .IP (3X) -.\"O .\" Various special libraries. The manual pages documenting their functions -.\"O .\" specify the library names. -.\" 様々な特別なライブラリである。これらの関数を文書化したマニュアルページは -.\" ライブラリ名を指定する。 -.\"O .SH "CONFORMING TO" +.\" Various special libraries. The manual pages documenting their functions +.\" specify the library names. +マニュアルページの「書式」の節に規定されたヘッダファイルから関数の定義を 得るために、プログラマが機能検査マクロを定義しなければならない場合がある。 +このような場合には、必要なマクロがマニュアルページで説明されている。 (機能検査マクロの定義が必要な場合、これらの機能検査マクロの定義は +「どの」ヘッダファイルのインクルードよりも前で行われなければならない)。 機能検査マクロのさらなる情報については、 +\fBfeature_test_macros\fP(7) を参照のこと。 .SH 準拠 -.\"O Certain terms and abbreviations are used to indicate UNIX variants -.\"O and standards to which calls in this section conform. -.\"O See -.\"O .BR standards (7). -この章の関数が準拠する UNIX システムや標準を示すのにいくつかの単語や略号が -使用されている。 -.BR standards (7) -を参照のこと。 -.\"O .SH NOTES -.SH 備考 -.\"O .SS Authors and Copyright Conditions +この章の関数が準拠する UNIX システムや標準を示すのにいくつかの単語や略号が 使用されている。 \fBstandards\fP(7) を参照のこと。 +.SH 注意 .SS 著者と著作権 -.\"O Look at the header of the manual page source for the author(s) and copyright -.\"O conditions. -.\"O Note that these can be different from page to page! -著者と著作権の状態はマニュアルページのヘッダを見ること。 -これらはページ毎に異なる可能性があることに注意。 -.\"O .SH "SEE ALSO" +著者と著作権に関しては各マニュアルページのソースのヘッダを参照すること。 これらはページごとに異なる可能性があることに注意してほしい。 .SH 関連項目 -.BR intro (2), -.BR errno (3), -.BR capabilities (7), -.BR credentials (7), -.BR feature_test_macros (7), -.BR libc (7), -.BR math_error (7), -.BR environ (7), -.BR path_resolution (7), -.BR pthreads (7), -.BR signal (7), -.BR standards (7) +\fBintro\fP(2), \fBerrno\fP(3), \fBcapabilities\fP(7), \fBcredentials\fP(7), +\fBenviron\fP(7), \fBfeature_test_macros\fP(7), \fBlibc\fP(7), \fBmath_error\fP(7), +\fBpath_resolution\fP(7), \fBpthreads\fP(7), \fBsignal\fP(7), \fBstandards\fP(7) diff --git a/draft/man3/isgreater.3 b/draft/man3/isgreater.3 index b615b983..29944315 100644 --- a/draft/man3/isgreater.3 +++ b/draft/man3/isgreater.3 @@ -3,149 +3,80 @@ .\" 2002-07-27 Walter Harms .\" this was done with the help of the glibc manual .\" -.\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO -.\" all rights reserved. -.\" Translated Fri Aug 20 04:03:26 JST 2004 -.\" by Yuichi SATO -.\" Updated & Modified Sat Jan 15 02:32:55 JST 2005 by Yuichi SATO -.\" Updated 2008-09-18, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH ISGREATER 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ISGREATER 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O isgreater, isgreaterequal, isless, islessequal, islessgreater, -.\"O isunordered \- floating-point relational tests without exception for NaN isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered \- NaN に対して例外を発生せずに、浮動小数点数の大小関係の判定を行う -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int isgreater(" x ", " y ); +\fBint isgreater(\fP\fIx\fP\fB, \fP\fIy\fP\fB);\fP .sp -.BI "int isgreaterequal(" x ", " y ); +\fBint isgreaterequal(\fP\fIx\fP\fB, \fP\fIy\fP\fB);\fP .sp -.BI "int isless(" x ", " y ); +\fBint isless(\fP\fIx\fP\fB, \fP\fIy\fP\fB);\fP .sp -.BI "int islessequal(" x ", " y ); +\fBint islessequal(\fP\fIx\fP\fB, \fP\fIy\fP\fB);\fP .sp -.BI "int islessgreater(" x ", " y ); +\fBint islessgreater(\fP\fIx\fP\fB, \fP\fIy\fP\fB);\fP .sp -.BI "int isunordered(" x ", " y ); +\fBint isunordered(\fP\fIx\fP\fB, \fP\fIy\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.\"O All functions described here: ここで説明する全ての関数: .RS -_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The normal relation operations (like \fB<\fP, "less than") -.\"O will fail if one of the operands is NaN. -.\"O This will cause an exception. -.\"O To avoid this, C99 defines these macros. -.\"O The macros are guaranteed to evaluate their operands only once. -.\"O The operands can be of any real floating-point type. -(\fB<\fP、「小なり」のような) 通常の関係操作 (relation operations) は、 -オペランドの一方が NaN の場合には失敗する。 -これは例外の原因になる。 -これを避けるため、C99 では次のようなマクロを定義している。 -これらのマクロはオペランドを 1 回だけ評価することが保証されている。 -オペランドには任意の実数の浮動小数点数型を指定できる。 -.TP -.BR isgreater () -.\"O determines \fI(x)\ >\ (y)\fP without an exception -.\"O if \fIx\fP or \fIy\fP is NaN. -\fI(x)\ >\ (y)\fP を決定する。 -\fIx\fP または \fIy\fP が NaN でも例外を発生しない。 -.TP -.BR isgreaterequal () -.\"O determines \fI(x)\ >=\ (y)\fP without an exception -.\"O if \fIx\fP or \fIy\fP is NaN. -\fI(x)\ >=\ (y)\fP を決定する。 -\fIx\fP または \fIy\fP が NaN でも例外を発生しない。 -.TP -.BR isless () -.\"O determines \fI(x)\ <\ (y)\fP without an exception -.\"O if \fIx\fP or \fIy\fP is NaN. -\fI(x)\ <\ (y)\fP を決定する。 -\fIx\fP または \fIy\fP が NaN でも例外を発生しない。 -.TP -.BR islessequal () -.\"O determines \fI(x)\ <=\ (y)\fP without an exception -.\"O if \fIx\fP or \fIy\fP is NaN. -\fI(x)\ <=\ (y)\fP を決定する。 -\fIx\fP または \fIy\fP が NaN でも例外を発生しない。 -.TP -.BR islessgreater () -.\"O determines \fI(x)\ < (y) || (x) >\ (y)\fP -.\"O without an exception if \fIx\fP or \fIy\fP is NaN. -.\"O This macro is not equivalent to \fIx\ !=\ y\fP because that expression is -.\"O true if \fIx\fP or \fIy\fP is NaN. -\fI(x)\ < (y) || (x) >\ (y)\fP を決定する。 -\fIx\fP または \fIy\fP が NaN でも例外を発生しない。 -このマクロは \fIx\ !=\ y\fP と等価ではない。 -なぜなら、この評価式は \fIx\fP または \fIy\fP が NaN の場合に -true となるためである。 -.TP -.BR isunordered () -.\"O determines whether its arguments are unordered, that is, whether -.\"O at least one of the arguments is a NaN. -引き数が unordered かどうか、つまり引き数の少なくとも一方が NaN かどうか -を判定する。 -.\"O .SH RETURN VALUE +(\fB<\fP、「小なり」のような) 通常の関係操作 (relation operations) は、 オペランドの一方が NaN +の場合には失敗する。 これは例外の原因になる。 これを避けるため、C99 では次のようなマクロを定義している。 これらのマクロはオペランドを 1 +回だけ評価することが保証されている。 オペランドには任意の実数の浮動小数点数型を指定できる。 +.TP +\fBisgreater\fP() +\fI(x)\ >\ (y)\fP を決定する。 \fIx\fP または \fIy\fP が NaN でも例外を発生しない。 +.TP +\fBisgreaterequal\fP() +\fI(x)\ >=\ (y)\fP を決定する。 \fIx\fP または \fIy\fP が NaN でも例外を発生しない。 +.TP +\fBisless\fP() +\fI(x)\ <\ (y)\fP を決定する。 \fIx\fP または \fIy\fP が NaN でも例外を発生しない。 +.TP +\fBislessequal\fP() +\fI(x)\ <=\ (y)\fP を決定する。 \fIx\fP または \fIy\fP が NaN でも例外を発生しない。 +.TP +\fBislessgreater\fP() +\fI(x)\ < (y) || (x) >\ (y)\fP を決定する。 \fIx\fP または \fIy\fP が NaN でも例外を発生しない。 +このマクロは \fIx\ !=\ y\fP と等価ではない。 なぜなら、この評価式は \fIx\fP または \fIy\fP が NaN の場合に true +となるためである。 +.TP +\fBisunordered\fP() +引き数が unordered かどうか、つまり引き数の少なくとも一方が NaN かどうか を判定する。 .SH 返り値 -.\"O The macros other than -.\"O .BR isunordered () -.\"O return the result of the relational comparison; -.\"O these macros return 0 if either argument is a NaN. -.BR isunordered () -以外のマクロは関係操作の結果を返す。 -一方の引き数が NaN の場合、これらのマクロは 0 を返す。 +\fBisunordered\fP() 以外のマクロは関係操作の結果を返す。 一方の引き数が NaN の場合、これらのマクロは 0 を返す。 -.\"O .BR isunordered () -.\"O returns 1 if \fIx\fP or \fIy\fP is NaN and 0 otherwise. -.BR isunordered () -は \fIx\fP か \fIy\fP が NaN の場合 1 を、 -それ以外の場合 0 を返す。 -.\"O .SH ERRORS +\fBisunordered\fP() は \fIx\fP か \fIy\fP が NaN の場合 1 を、 それ以外の場合 0 を返す。 .SH エラー -.\"O No errors occur. エラーは発生しない。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O .SH NOTES +C99, POSIX.1\-2001. .SH 注意 -.\"O Not all hardware supports these functions, -.\"O and where hardware support isn't provided, they will be emulated by macros. -.\"O This will result in a performance penalty. -これらの関数は全てのハードウェアでサポートされているわけではない。 -サポートされていない場合は、マクロでエミュレートされる。 -エミュレートされる場合は、性能上での不利となる。 -.\"O Don't use these functions if NaN is of no concern for you. -NaN について心配しなくて構わない場合は、 -これらの関数を使わないこと。 -.\"O .SH "SEE ALSO" +これらの関数は全てのハードウェアでサポートされているわけではない。 サポートされていない場合は、マクロでエミュレートされる。 +エミュレートされる場合は、性能上での不利となる。 NaN について心配しなくて構わない場合は、 これらの関数を使わないこと。 .SH 関連項目 -.BR fpclassify (3), -.BR isnan (3) +\fBfpclassify\fP(3), \fBisnan\fP(3) diff --git a/draft/man3/j0.3 b/draft/man3/j0.3 index 65bb207e..d169b1e6 100644 --- a/draft/man3/j0.3 +++ b/draft/man3/j0.3 @@ -31,193 +31,85 @@ .\" Modified 2004-11-12 as per suggestion by Fabian Kreutz/AEB .\" 2008-07-24, mtk, moved yxx() material into separate y0.3 page .\" -.\" Japanese Version Copyright (c) 1998 Ishii Tatsuo all rights reserved. -.\" Translated Sun May 24 1998 by Ishii Tatsuo -.\" Updated 2002-09-24 by Akihiro MOTOKI -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH J0 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH J0 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O j0, j0f, j0l, j1, j1f, j1l, jn, jnf, jnl \- -.\"O Bessel functions of the first kind j0, j0f, j0l, j1, j1f, j1l, jn, jnf, jnl \- 第一種ベッセル関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp .fi -.BI "double j0(double " x ); +\fBdouble j0(double \fP\fIx\fP\fB);\fP .br -.BI "double j1(double " x ); +\fBdouble j1(double \fP\fIx\fP\fB);\fP .br -.BI "double jn(int " n ", double " x ); +\fBdouble jn(int \fP\fIn\fP\fB, double \fP\fIx\fP\fB);\fP .sp -.BI "float j0f(float " x ); +\fBfloat j0f(float \fP\fIx\fP\fB);\fP .br -.BI "float j1f(float " x ); +\fBfloat j1f(float \fP\fIx\fP\fB);\fP .br -.BI "float jnf(int " n ", float " x ); +\fBfloat jnf(int \fP\fIn\fP\fB, float \fP\fIx\fP\fB);\fP .sp -.BI "long double j0l(long double " x ); +\fBlong double j0l(long double \fP\fIx\fP\fB);\fP .br -.BI "long double j1l(long double " x ); +\fBlong double j1l(long double \fP\fIx\fP\fB);\fP .br -.BI "long double jnl(int " n ", long double " x ); -.fi +\fBlong double jnl(int \fP\fIn\fP\fB, long double \fP\fIx\fP\fB);\fP .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR j0 (), -.BR j1 (), -.BR jn (): +\fBj0\fP(), \fBj1\fP(), \fBjn\fP(): .RS 4 _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE .RE .br -.BR j0f (), -.BR j0l (), -.BR j1f (), -.BR j1l (), -.BR jnf (), -.BR jnl (): +\fBj0f\fP(), \fBj0l\fP(), \fBj1f\fP(), \fBj1l\fP(), \fBjnf\fP(), \fBjnl\fP(): .RS 4 -_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 600 .\" Also seems to work: -std=c99 -D_XOPEN_SOURCE +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 600 .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR j0 () -.\"O and -.\"O .BR j1 () -.\"O functions return Bessel functions of \fIx\fP -.\"O of the first kind of orders 0 and 1, respectively. -.\"O The -.\"O .BR jn () -.\"O function -.\"O returns the Bessel function of \fIx\fP of the first kind of order \fIn\fP. -関数 -.BR j0 (), -.BR j1 () -はそれぞれ \fIx\fP の0次、1次の -第一種ベッセル関数の値を返す。 -関数 -.BR jn () -は \fIx\fP の \fIn\fP 次の -第一種ベッセル関数の値を返す。 +関数 \fBj0\fP(), \fBj1\fP() はそれぞれ \fIx\fP の0次、1次の 第一種ベッセル関数の値を返す。 関数 \fBjn\fP() は \fIx\fP の +\fIn\fP 次の 第一種ベッセル関数の値を返す。 .PP -.\"O The -.\"O .BR j0f () -.\"O etc. and -.\"O .BR j0l () -.\"O etc. functions are versions that take and return -.\"O .I float -.\"O and -.\"O .I "long double" -.\"O values, respectively. -.BR j0f () -群の関数、 -.BR j0l () -群の関数は、それぞれ -.I float -型、 -.I "long double" -型の返り値を返す。 -.\"O .SH RETURN VALUE +\fBj0f\fP() 群の関数、 \fBj0l\fP() 群の関数は、それぞれ \fIfloat\fP 型、 \fIlong double\fP 型の返り値を返す。 .SH 返り値 -.\"O On success, these functions return the appropriate -.\"O Bessel value of the first kind for -.\"O .IR x . -成功すると、これらの関数は -.I x -に対する第一種ベッセル関数の値を返す。 +成功すると、これらの関数は \fIx\fP に対する第一種ベッセル関数の値を返す。 -.\"O If -.\"O .I x -.\"O is a NaN, a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is too large in magnitude, -.\"O or the result underflows, -.\"O a range error occurs, -.\"O and the return value is 0. -.I x -の絶対値が大き過ぎる場合や結果がアンダーフローする場合、 -範囲エラー (range error) が発生し、返り値が 0 となる。 -.\"O .SH ERRORS +\fIx\fP の絶対値が大き過ぎる場合や結果がアンダーフローする場合、 範囲エラー (range error) が発生し、返り値が 0 となる。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Range error: result underflow, or \fIx\fP is too large in magnitude +.TP 範囲エラー: 結果のアンダーフローや、\fIx\fP の絶対値が大き過ぎる -.\"O .I errno -.\"O is set to -.\"O .BR ERANGE . -.I errno -に -.B ERANGE -が設定される。 .\" An underflow floating-point exception .\" .RB ( FE_UNDERFLOW ) .\" is raised. +\fIerrno\fP に \fBERANGE\fP が設定される。 .PP -.\"O These functions do not raise exceptions for -.\"O .BR fetestexcept (3). -これらの関数は、 -.BR fetestexcept (3) -でチェックできる例外を上げない。 .\" FIXME . Is it intentional that these functions do not raise exceptions? .\" e.g., j0(1.5e16) .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6805 -.\"O .SH "CONFORMING TO" +これらの関数は、 \fBfetestexcept\fP(3) でチェックできる例外を上げない。 .SH 準拠 -.\"O The functions returning -.\"O .I double -.\"O conform to SVr4, 4.3BSD, -.\"O POSIX.1-2001. -.I double -型の値を返す関数は、SVr4, 4.3BSD, POSIX.1-2001 -に準拠する。 -.\"O The others are nonstandard functions that also exist on the BSDs. -それ以外は非標準の関数で、BSD にも存在する。 -.\"O .SH BUGS +\fIdouble\fP 型の値を返す関数は、SVr4, 4.3BSD, POSIX.1\-2001 に準拠する。 それ以外は非標準の関数で、BSD +にも存在する。 .SH バグ -.\"O There are errors of up to 2e\-16 in the values returned by -.\"O .BR j0 (), -.\"O .BR j1 () -.\"O and -.\"O .BR jn () -.\"O for values of \fIx\fP between \-8 and 8. -\-8 から 8 までの \fIx\fP の値について -.BR j0 (), -.BR j1 (), -.BR jn () -が返す値には、最大で 2e\-16 の誤差がある。 -.\"O .SH SEE ALSO +\-8 から 8 までの \fIx\fP の値について \fBj0\fP(), \fBj1\fP(), \fBjn\fP() が返す値には、最大で 2e\-16 の誤差がある。 .SH 関連項目 -.BR y0 (3) +\fBy0\fP(3) diff --git a/draft/man3/ldexp.3 b/draft/man3/ldexp.3 index b1eefe53..cf128cce 100644 --- a/draft/man3/ldexp.3 +++ b/draft/man3/ldexp.3 @@ -29,179 +29,66 @@ .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) .\" Modified 2004-10-31 by aeb .\" -.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi -.\" all rights reserved. -.\" Translated Thu Feb 13 23:14:00 JST 1997 -.\" by YOSHINO Takashi -.\" Updated & Modified Sun Jun 6 10:35:26 JST 2004 -.\" by Yuichi SATO -.\" Updated & Modified Sat Jan 15 05:40:56 JST 2005 by Yuichi SATO -.\" Updated 2008-09-18, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH LDEXP 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH LDEXP 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O ldexp, ldexpf, ldexpl \- multiply floating-point number by integral power of 2 ldexp, ldexpf, ldexpl \- 浮動小数点実数と 2 の整数乗との積を計算する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double ldexp(double " x ", int " exp ); +\fBdouble ldexp(double \fP\fIx\fP\fB, int \fP\fIexp\fP\fB);\fP .br -.BI "float ldexpf(float " x ", int " exp ); +\fBfloat ldexpf(float \fP\fIx\fP\fB, int \fP\fIexp\fP\fB);\fP .br -.BI "long double ldexpl(long double " x ", int " exp ); +\fBlong double ldexpl(long double \fP\fIx\fP\fB, int \fP\fIexp\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR ldexpf (), -.BR ldexpl (): +\fBldexpf\fP(), \fBldexpl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR ldexp () -.\"O function returns the result of multiplying the floating-point number -.\"O .I x -.\"O by 2 raised to the power -.\"O .IR exp . -.BR ldexp () -関数は、浮動小数点実数 -.I x -と 2 の -.I exp -乗との積を返す。 -.\"O .SH RETURN VALUE +\fBldexp\fP() 関数は、浮動小数点実数 \fIx\fP と 2 の \fIexp\fP 乗との積を返す。 .SH 返り値 -.\"O On success, these functions return -.\"O .IR "x * (2^exp)" . -成功すると、これらの関数は -.I "x * (2^exp)" -を返す。 +成功すると、これらの関数は \fIx * (2^exp)\fP を返す。 -.\"O If -.\"O .I exp -.\"O is zero, then -.\"O .I x -.\"O is returned. -.I exp -がゼロの場合、 -.I x -が返される。 +\fIexp\fP がゼロの場合、 \fIx\fP が返される。 -.\"O If -.\"O .I x -.\"O is a NaN, -.\"O a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is positive infinity (negative infinity), -.\"O positive infinity (negative infinity) is returned. -.I x -が正の無限大 (負の無限大) の場合、 -正の無限大 (負の無限大) が返される。 +\fIx\fP が正の無限大 (負の無限大) の場合、正の無限大 (負の無限大) が返される。 -.\"O If the result underflows, -.\"O a range error occurs, -.\"O and zero is returned. -結果がアンダーフローする場合、 -範囲エラー (range error) が発生し、ゼロが返される。 +結果がアンダーフローする場合、 範囲エラー (range error) が発生し、0 が返される。 -.\"O If the result overflows, -.\"O a range error occurs, -.\"O and the functions return -.\"O .BR HUGE_VAL , -.\"O .BR HUGE_VALF , -.\"O or -.\"O .BR HUGE_VALL , -.\"O respectively, with a sign the same as -.\"O .IR x . -結果がオーバーフローする場合、範囲エラーが発生し、 -各関数はそれぞれ -.BR HUGE_VAL , -.BR HUGE_VALF , -.B HUGE_VALL -を返す。返り値の符号は -.I x -と同じとなる。 -.\"O .SH ERRORS +結果がオーバーフローする場合、 範囲エラー (range error) が発生し、 各関数はそれぞれ \fBHUGE_VAL\fP, +\fBHUGE_VALF\fP, \fBHUGE_VALL\fP を返す。符号は \fIx\fP と同じになる。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Range error, overflow -範囲エラー: 結果のオーバーフロー -.\"O .I errno -.\"O is set to -.\"O .BR ERANGE . -.\"O An overflow floating-point exception -.\"O .RB ( FE_OVERFLOW ) -.\"O is raised. -.I errno -に -.B ERANGE -が設定される。 -オーバーフロー浮動小数点例外 -.RB ( FE_OVERFLOW ) -が上がる。 -.TP -.\"O Range error, underflow -範囲エラー: 結果のアンダーフロー -.\"O .I errno -.\"O is set to -.\"O .BR ERANGE . -.\"O An underflow floating-point exception -.\"O .RB ( FE_UNDERFLOW ) -.\"O is raised. -.I errno -に -.B ERANGE -が設定される。 -アンダーフロー浮動小数点例外 -.RB ( FE_UNDERFLOW ) -が上がる。 -.\"O .SH "CONFORMING TO" +.TP +範囲エラー (range error)、オーバーフローの場合 +\fIerrno\fP に \fBERANGE\fP が設定される。 オーバーフロー浮動小数点例外 (\fBFE_OVERFLOW\fP) が上がる。 +.TP +範囲エラー (range error)、アンダーフローの場合 +\fIerrno\fP に \fBERANGE\fP が設定される。 アンダーフロー浮動小数点例外 (\fBFE_UNDERFLOW\fP) が上がる。 .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH 関連項目 -.BR frexp (3), -.BR modf (3), -.BR scalbln (3) +\fBfrexp\fP(3), \fBmodf\fP(3), \fBscalbln\fP(3) diff --git a/draft/man3/lgamma.3 b/draft/man3/lgamma.3 index 78ef0a7b..f824e5f0 100644 --- a/draft/man3/lgamma.3 +++ b/draft/man3/lgamma.3 @@ -4,271 +4,108 @@ .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk .\" .\" -.\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated Sun Sep 22 08:44:32 2002 -.\" by Akihiro MOTOKI -.\" Updated & Modified Sat Feb 12 12:40:00 2005 -.\" by SAITOH Akira -.\" Updated 2008-09-18, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH LGAMMA 3 2010-09-11 "" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O lgamma, lgammaf, lgammal, lgamma_r, lgammaf_r, lgammal_r, signgam \- -.\"O log gamma function +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH LGAMMA 3 2010\-09\-11 "" "Linux Programmer's Manual" .SH 名前 lgamma, lgammaf, lgammal, lgamma_r, lgammaf_r, lgammal_r, signgam \- ガンマ関数の対数を計算する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double lgamma(double " x ); +\fBdouble lgamma(double \fP\fIx\fP\fB);\fP .br -.BI "float lgammaf(float " x ); +\fBfloat lgammaf(float \fP\fIx\fP\fB);\fP .br -.BI "long double lgammal(long double " x ); +\fBlong double lgammal(long double \fP\fIx\fP\fB);\fP .sp -.BI "double lgamma_r(double " x ", int *" signp ); +\fBdouble lgamma_r(double \fP\fIx\fP\fB, int *\fP\fIsignp\fP\fB);\fP .br -.BI "float lgammaf_r(float " x ", int *" signp ); +\fBfloat lgammaf_r(float \fP\fIx\fP\fB, int *\fP\fIsignp\fP\fB);\fP .br -.BI "long double lgammal_r(long double " x ", int *" signp ); +\fBlong double lgammal_r(long double \fP\fIx\fP\fB, int *\fP\fIsignp\fP\fB);\fP .sp -.BI "extern int " signgam ; +\fBextern int \fP\fIsigngam\fP\fB;\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR lgamma (): +\fBlgamma\fP(): .RS 4 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .br -.BR lgammaf (), -.BR lgammal (): +\fBlgammaf\fP(), \fBlgammal\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE -.BR lgamma_r (), -.BR lgammaf_r (), -.BR lgammal_r (): +\fBlgamma_r\fP(), \fBlgammaf_r\fP(), \fBlgammal_r\fP(): .RS 4 _BSD_SOURCE || _SVID_SOURCE .RE -.IR signgam : +\fIsigngam\fP: .RS 4 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE .RE .ad b -.\"O .SH DESCRIPTION -.\"O For the definition of the Gamma function, see -.\"O .BR tgamma (3). -.\"O .PP .SH 説明 -ガンマ関数の定義については、 -.BR tgamma (3) -を参照のこと。 +ガンマ関数の定義については、 \fBtgamma\fP(3) を参照のこと。 .PP -.\"O The -.\"O .BR lgamma () -.\"O function returns the natural logarithm of -.\"O the absolute value of the Gamma function. -.\"O The sign of the Gamma function is returned in the -.\"O external integer \fIsigngam\fP declared in -.\"O .IR . -.\"O It is 1 when the Gamma function is positive or zero, \-1 -.\"O when it is negative. -.\"O .PP -関数 -.BR lgamma () -は、ガンマ関数の絶対値の自然対数を返す。 -ガンマ関数の符号は、 -.I -で宣言されている extern int \fIsigngam\fP に格納される。 -格納される値は、ガンマ関数が正または 0 の場合 1、 -負の場合 \-1 である。 +関数 \fBlgamma\fP() は、ガンマ関数の絶対値の自然対数を返す。 ガンマ関数の符号は、 \fI\fP で宣言されている +extern int \fIsigngam\fP に格納される。 格納される値は、ガンマ関数が正または 0 の場合 1、 負の場合 \-1 である。 .PP -.\"O Since using a constant location -.\"O .I signgam -.\"O is not thread-safe, the functions -.\"O .BR lgamma_r () -.\"O etc. have -.\"O been introduced; they return the sign via the argument -.\"O .IR signp . -.I signgam -という固定された場所を使うことはスレッドセーフではないので、 -関数 -.BR lgamma_r () -などが導入されている。 -これらの関数では、符号は引き数 -.I signp -経由で返される。 -.\"O .SH RETURN VALUE +\fIsigngam\fP という固定された場所を使うことはスレッドセーフではないので、 関数 \fBlgamma_r\fP() などが導入されている。 +これらの関数では、符号は引き数 \fIsignp\fP 経由で返される。 .SH 返り値 -.\"O On success, these functions return the natural logarithm of Gamma(x). 成功すると、これらの関数は Gamma(x) の自然対数を返す。 -.\"O If -.\"O .I x -.\"O is a NaN, a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is 1 or 2, +0 is returned. -.I x -が 1 か 2 の場合、+0 が返される。 +\fIx\fP が 1 か 2 の場合、+0 が返される。 -.\"O If -.\"O .I x -.\"O is positive infinity or negative infinity, -.\"O positive infinity is returned. -.I x -が正の無限大か負の無限大の場合、 -正の無限大が返される。 +\fIx\fP が正の無限大か負の無限大の場合、正の無限大が返される。 -.\"O If -.\"O .I x -.\"O is a nonpositive integer, -.\"O a pole error occurs, -.\"O and the functions return -.\"O .RB + HUGE_VAL , -.\"O .RB + HUGE_VALF , -.\"O or -.\"O .RB + HUGE_VALL , -.\"O respectively. -.I x -が正でない整数の場合、極エラー (pole error) が発生し、 -各関数はそれぞれ -.RB + HUGE_VAL , -.RB + HUGE_VALF , -.RB + HUGE_VALL -を返す。 +\fIx\fP が正でない整数の場合、極エラー (pole error) が発生し、 各関数はそれぞれ +\fBHUGE_VAL\fP, ++\fBHUGE_VALF\fP, +\fBHUGE_VALL\fP を返す。 -.\"O If the result overflows, -.\"O a range error occurs, .\" e.g., lgamma(DBL_MAX) -.\"O and the functions return -.\"O .BR HUGE_VAL , -.\"O .BR HUGE_VALF , -.\"O or -.\"O .BR HUGE_VALL , -.\"O respectively, with the correct mathematical sign. -結果がオーバーフローする場合、範囲エラーが発生し、 -各関数はそれぞれ -.BR HUGE_VAL , -.BR HUGE_VALF , -.B HUGE_VALL -を返す。返り値には数学的に正しい符号が付与される。 -.\"O .SH ERRORS +結果がオーバーフローする場合、範囲エラー (range error) が発生し、 各関数はそれぞれ \fBHUGE_VAL\fP, \fBHUGE_VALF\fP, +\fBHUGE_VALL\fP, を返す。この際、数学的に正しい符号が付与される。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Pole error: \fIx\fP is a nonpositive integer +.TP 極エラー: \fIx\fP が正でない整数 -.\"O .I errno -.\"O is set to -.\"O .BR ERANGE -.\"O (but see BUGS). -.\"O A divide-by-zero floating-point exception -.\"O .RB ( FE_DIVBYZERO ) -.\"O is raised. -.I errno -に -.B ERANGE -が設定される (「バグ」の節を参照)。 -0 による除算 (divide-by-zero) 浮動小数点例外 -.RB ( FE_DIVBYZERO ) -が上がる。 -.TP -.\"O Range error: result overflow -範囲エラー: 結果のオーバーフロー -.\"O .I errno -.\"O is set to -.\"O .BR ERANGE . -.\"O An overflow floating-point exception -.\"O .RB ( FE_OVERFLOW ) -.\"O is raised. -.I errno -に -.B ERANGE -が設定される。 -オーバーフロー浮動小数点例外 -.RB ( FE_OVERFLOW ) -が上がる。 +\fIerrno\fP に \fBERANGE\fP が設定される (「バグ」の節も参照)。 0 による除算 (divide\-by\-zero) 浮動小数点例外 +(\fBFE_DIVBYZERO\fP) が上がる。 +.TP +範囲エラー (range error): 結果のオーバーフロー .\" glibc (as at 2.8) also supports an inexact .\" exception for various cases. -.\"O .SH "CONFORMING TO" +\fIerrno\fP に \fBERANGE\fP が設定される。 オーバーフロー浮動小数点例外 (\fBFE_OVERFLOW\fP) が上がる。 .SH 準拠 -.\"O The -.\"O .BR lgamma () -.\"O functions are specified in C99 and POSIX.1-2001. -.\"O .I signgam -.\"O is specified in POSIX.1-2001, but not in C99. -.\"O The -.\"O .BR lgamma_r () -.\"O functions are nonstandard, but present on several other systems. -関数 -.BR lgamma () -は C99 と POSIX.1-2001 で規定されている。 -.I signgam -は POSIX.1-2001 で規定されているが、C99 にはない。 -関数 -.BR lgamma_r () -は非標準だが、いくつかの他のシステムにも存在する。 -.\"O .SH BUGS +関数 \fBlgamma\fP() は C99 と POSIX.1\-2001 で規定されている。 \fIsigngam\fP は POSIX.1\-2001 +で規定されているが、C99 にはない。 関数 \fBlgamma_r\fP() は非標準だが、いくつかの他のシステムにも存在する。 .SH バグ -.\"O In glibc 2.9 and earlier, .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6777 -.\"O when a pole error occurs, -.\"O .I errno -.\"O is set to -.\"O .BR EDOM ; -.\"O instead of the POSIX-mandated -.\"O .BR ERANGE . -.\"O Since version 2.10, glibc does the right thing. -glibc 2.9 とそれ以前のバージョンでは、 -極エラーが発生した場合、POSIX で要求されている -.B ERANGE -ではなく -.B EDOM -が -.I errno -に設定される。 -POSIX.1 では、 -.B ERANGE -が設定されるべきとされている。 -バージョン 2.10 以降の glibc では、正しい動作をする。 -.\"O .SH "SEE ALSO" +glibc 2.9 とそれ以前のバージョンでは、 極エラーが発生した場合、POSIX で要求されている \fBERANGE\fP ではなく \fBEDOM\fP が +\fIerrno\fP に設定される。 POSIX.1 では、 \fBERANGE\fP が設定されるべきとされている。 バージョン 2.10 以降の glibc +では、正しい動作をする。 .SH 関連項目 -.BR tgamma (3) +\fBtgamma\fP(3) diff --git a/draft/man3/lockf.3 b/draft/man3/lockf.3 index cbbdaec7..80455de5 100644 --- a/draft/man3/lockf.3 +++ b/draft/man3/lockf.3 @@ -1,4 +1,4 @@ -.\" Copyright 1997 Nicolas Lichtmaier +.\" Copyright 1997 Nicolás Lichtmaier .\" Created Thu Aug 7 00:44:00 ART 1997 .\" .\" This is free documentation; you can redistribute it and/or @@ -19,284 +19,85 @@ .\" Added section stuff, aeb, 2002-04-22. .\" Corrected include file, drepper, 2003-06-15. .\" -.\" Japanese Version Copyright (c) 2000-2002 Yuichi SATO -.\" all rights reserved. -.\" Translated Tue Jul 11 19:02:58 JST 2000 -.\" by Yuichi SATO -.\" Updated & Modified Mon Jul 15 02:10:29 JST 2002 by Yuichi SATO -.\" Updated 2010-04-18, Akihiro MOTOKI , LDP v3.24 +.\"******************************************************************* .\" -.\"WORD: apply 適用 -.\"WORD: remove 解除 -.\"WORD: exclusive 排他 -.\"WORD: descriptor ディスクリプタ -.\"WORD: +.\" This file was generated with po4a. Translate the source file. .\" -.TH LOCKF 3 2011-09-11 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH LOCKF 3 2011\-09\-11 GNU "Linux Programmer's Manual" .SH 名前 -.\"O lockf \- apply, test or remove a POSIX lock on an open file lockf \- オープンされたファイルに対する POSIX ロックの適用・テスト・解除を行う -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int lockf(int " fd ", int " cmd ", off_t " len ); +\fBint lockf(int \fP\fIfd\fP\fB, int \fP\fIcmd\fP\fB, off_t \fP\fIlen\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR lockf (): +\fBlockf\fP(): .ad l .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O Apply, test or remove a POSIX lock on a section of an open file. -オープンされたファイルのセクションに対して、 -POSIX ロックの適用・テスト・解除をする。 -.\"O The file is specified by -.\"O .IR fd , -.\"O a file descriptor open for writing, the action by -.\"O .IR cmd , -ファイルは -.I fd -で指定される。 -.I fd -は書き込みのためにオープンしたファイルディスクリプタである。 -アクションは -.I cmd -で指定される。 -.\"O and the section consists of byte positions -.\"O .IR pos .. pos + len \-1 -.\"O if -.\"O .I len -.\"O is positive, and -.\"O .IR pos - len .. pos \-1 -.\"O if -.\"O .I len -.\"O is negative, where -.\"O .I pos -.\"O is the current file position, and if -.I pos -を現在のファイル位置とすると、 -.I len -が正の場合、セクションはバイト位置 -.IR pos .. pos + len \-1 -となり、 -.I len -が負の場合、セクションはバイト位置 -.IR pos - len .. pos \-1 -となる。 -.\"O .I len -.\"O is zero, the section extends from the current file position to -.\"O infinity, encompassing the present and future end-of-file positions. -.I len -が 0 の場合、セクションは現在のファイル位置から無限大までとなる -(つまり現在の、あるいは変更された場合は将来の、ファイル終端位置まで)。 -.\"O In all cases, the section may extend past current end-of-file. +オープンされたファイルのセクションに対して、 POSIX ロックの適用・テスト・解除をする。 ファイルは \fIfd\fP で指定される。 \fIfd\fP +は書き込みのためにオープンしたファイルディスクリプタである。 アクションは \fIcmd\fP で指定される。 \fIpos\fP を現在のファイル位置とすると、 +\fIlen\fP が正の場合、セクションはバイト位置 \fIpos\fP..\fIpos\fP+\fIlen\fP\-1 となり、 \fIlen\fP +が負の場合、セクションはバイト位置 \fIpos\fP\-\fIlen\fP..\fIpos\fP\-1 となる。 \fIlen\fP が 0 +の場合、セクションは現在のファイル位置から無限大までとなる (つまり現在の、あるいは変更された場合は将来の、ファイル終端位置まで)。 どの場合においても、セクションは以前のファイル終端よりも拡大されうる。 .LP -.\"O On Linux, -.\"O .BR lockf () -.\"O is just an interface on top of -.\"O .BR fcntl (2) -.\"O locking. -Linux では、 -.BR lockf () -は単に -.BR fcntl (2) -のロックへのインターフェースである。 -.\"O Many other systems implement -.\"O .BR lockf () -.\"O in this way, but note that POSIX.1-2001 leaves the relationship between -.\"O .BR lockf () -.\"O and -.\"O .BR fcntl (2) -.\"O locks unspecified. -.\"O A portable application should probably avoid mixing calls -.\"O to these interfaces. -多くの他のシステムで -.BR lockf () -はこのように実装されているが、 -POSIX.1-2001 では -.BR lockf () -と -.BR fcntl (2) -のロックとの関係は規定されていない。 -おそらく、移植性が必要なアプリケーションでは、 -.BR lockf () -と -.BR fcntl (2) +Linux では、 \fBlockf\fP() は単に \fBfcntl\fP(2) のロックへのインターフェースである。 多くの他のシステムで +\fBlockf\fP() はこのように実装されているが、 POSIX.1\-2001 では \fBlockf\fP() と \fBfcntl\fP(2) +のロックとの関係は規定されていない。 おそらく、移植性が必要なアプリケーションでは、 \fBlockf\fP() と \fBfcntl\fP(2) のロックを混ぜて呼び出すのは避けるべきであろう。 .LP -.\"O Valid operations are given below: 有効なオプションを以下に挙げる。 -.TP -.B F_LOCK -.\"O Set an exclusive lock on the specified section of the file. -.\"O If (part of) this section is already locked, the call -.\"O blocks until the previous lock is released. -ファイルの指定されたセクションに排他ロックを設定する。 -そのセクション (の一部) が既にロックされていた場合、 -前のロックが解除されるまで関数の呼び出しがブロックされる。 -.\"O If this section overlaps an earlier locked section, -.\"O both are merged. -このセクションが前にロックされているセクションと重なった場合、 -2 つのセクションは結合される。 -.\"O File locks are released as soon as the process holding the locks -.\"O closes some file descriptor for the file. -.\"O A child process does not -.\"O inherit these locks. -ロックを保持しているプロセスが、 -そのファイルのファイルディスクリプタをクローズすると、 -ファイルロックは解放される。 +.TP +\fBF_LOCK\fP +ファイルの指定されたセクションに排他ロックを設定する。 そのセクション (の一部) が既にロックされていた場合、 +前のロックが解除されるまで関数の呼び出しがブロックされる。 このセクションが前にロックされているセクションと重なった場合、 2 +つのセクションは結合される。 ロックを保持しているプロセスが、 そのファイルのファイルディスクリプタをクローズすると、 ファイルロックは解放される。 子プロセスはロックを継承しない。 -.TP -.B F_TLOCK -.\"O Same as -.\"O .B F_LOCK -.\"O but the call never blocks and returns an error instead if the file is -.\"O already locked. -.B F_LOCK -と同様であるが、ファイルが既にロックされている場合、 -関数の呼び出しはブロックを行わずにエラーを返す。 -.TP -.B F_ULOCK -.\"O Unlock the indicated section of the file. -.\"O This may cause a locked section to be split into two locked sections. -ファイルの指定されたセクションのロックを解除する。 -これによりロックされたセクションが 2 つに分割されるかもしれない。 -.TP -.B F_TEST -.\"O Test the lock: return 0 if the specified section -.\"O is unlocked or locked by this process; return \-1, set -.\"O .I errno -.\"O to -.\"O .B EAGAIN -.\"O .RB ( EACCES -.\"O on some other systems), -.\"O if another process holds a lock. -次のようにロックのテストをする。 -指定されたセクションがロックされていないか、 -このプロセスによりロックされている場合、0 を返す。 -他のプロセスがロックを保持している場合、\-1 を返し、 -.I errno -を -.B EAGAIN -(いくつかの他のシステムでは -.BR EACCES ) +.TP +\fBF_TLOCK\fP +\fBF_LOCK\fP と同様であるが、ファイルが既にロックされている場合、 関数の呼び出しはブロックを行わずにエラーを返す。 +.TP +\fBF_ULOCK\fP +ファイルの指定されたセクションのロックを解除する。 これによりロックされたセクションが 2 つに分割されるかもしれない。 +.TP +\fBF_TEST\fP +次のようにロックのテストをする。 指定されたセクションがロックされていないか、 このプロセスによりロックされている場合、0 を返す。 +他のプロセスがロックを保持している場合、\-1 を返し、 \fIerrno\fP を \fBEAGAIN\fP (いくつかの他のシステムでは \fBEACCES\fP) に設定する。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O On success, zero is returned. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合、0 が返される。 -エラーの場合、\-1 が返され、 -.I errno -がエラーに対応した値に設定される。 -.\"O .SH ERRORS +成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP -.\"O .BR EACCES " or " EAGAIN -.BR EACCES " もしくは " EAGAIN -.\"O The file is locked and -.\"O .B F_TLOCK -.\"O or -.\"O .B F_TEST -.\"O was specified, or the operation is prohibited because the file has -.\"O been memory-mapped by another process. -ロックされたファイルに対して、 -.B F_TLOCK -または -.B F_TEST -が指定されている。 -または、ファイルが他のプロセスによりメモリーマップされており、 -指定された操作が禁止されている。 -.TP -.B EBADF -.\"O .I fd -.\"O is not an open file descriptor; or -.\"O .I cmd -.\"O is -.\"O .B F_LOCK -.\"O or -.\"O .BR F_TLOCK -.\"O and -.\"O .I fd -.\"O is not a writable file descriptor. -.I fd -がオープンされたファイルのディスクリプタではない。 -または、 -.I cmd -が -.B F_LOCK -か -.B F_TLOCK -で、 -.I fd -が書き込み可能なファイルディスクリプタでない。 -.TP -.B EDEADLK -.\"O The command was -.\"O .B T_LOCK -.\"O and this lock operation would cause a deadlock. -コマンドが -.B T_LOCK -であり、このロック操作を行うとデッドロックが発生してしまう。 -.TP -.B EINVAL -.\"O An invalid operation was specified in -.\"O .IR fd . -.I fd -に無効な操作が指定された。 -.TP -.B ENOLCK -.\"O Too many segment locks open, lock table is full. +.TP +\fBEACCES\fP か \fBEAGAIN\fP +ロックされたファイルに対して、 \fBF_TLOCK\fP または \fBF_TEST\fP が指定されている。 +または、ファイルが他のプロセスによりメモリーマップされており、 指定された操作が禁止されている。 +.TP +\fBEBADF\fP +\fIfd\fP がオープンされたファイルのディスクリプタではない。 または、 \fIcmd\fP が \fBF_LOCK\fP か \fBF_TLOCK\fP で、 +\fIfd\fP が書き込み可能なファイルディスクリプタでない。 +.TP +\fBEDEADLK\fP +コマンドが \fBT_LOCK\fP であり、このロック操作を行うとデッドロックが発生してしまう。 +.TP +\fBEINVAL\fP +\fIfd\fP に無効な操作が指定された。 +.TP +\fBENOLCK\fP 非常に多くのセグメントロックが開かれ、ロックテーブルが一杯である。 -.\"O .SH CONFORMING TO .SH 準拠 -SVr4, POSIX.1-2001. -.\"O .SH "SEE ALSO" +SVr4, POSIX.1\-2001. .SH 関連項目 -.\"O .BR fcntl (2), -.\"O .BR flock (2) -.\"O .br -.\"O There are also -.\"O .I locks.txt -.\"O and -.\"O .I mandatory-locking.txt -.\"O in the kernel source directory -.\"O .IR Documentation/filesystems . -.\"O (On older kernels, these files are directly under the -.\"O .I Documentation/ -.\"O directory, and -.\"O .I mandatory-locking.txt -.\"O is called -.\"O .IR mandatory.txt .) -.BR fcntl (2), -.BR flock (2) +\fBfcntl\fP(2), \fBflock\fP(2) .br -カーネルソースの -.I Documentation/filesystems -ディレクトリにある -.I locks.txt -と -.I mandatory-locking.txt -(以前のカーネルでは、これらのファイルは -.I Documentation -ディレクトリ直下にあり、 -.I mandatory-locking.txt -は -.I mandatory.txt -という名前であった。) +カーネルソースの \fIDocumentation/filesystems\fP ディレクトリにある \fIlocks.txt\fP と +\fImandatory\-locking.txt\fP (以前のカーネルでは、これらのファイルは \fIDocumentation\fP ディレクトリ直下にあり、 +\fImandatory\-locking.txt\fP は \fImandatory.txt\fP という名前であった。) diff --git a/draft/man3/log.3 b/draft/man3/log.3 index 600e6139..9fed2033 100644 --- a/draft/man3/log.3 +++ b/draft/man3/log.3 @@ -31,182 +31,70 @@ .\" Modified 2002-07-27 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated Wed Aug 6 00:35:20 JST 2003 -.\" by Akihiro MOTOKI -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH LOG 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O log, logf, logl \- natural logarithmic function +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH LOG 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 log, logf, logl \- 自然対数関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double log(double " x ); +\fBdouble log(double \fP\fIx\fP\fB);\fP .br -.BI "float logf(float " x ); +\fBfloat logf(float \fP\fIx\fP\fB);\fP .br -.BI "long double logl(long double " x ); +\fBlong double logl(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR logf (), -.BR logl (): +\fBlogf\fP(), \fBlogl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR log () -.\"O function returns the natural logarithm of \fIx\fP. -.BR log () -関数は \fIx\fP の自然対数を返す。 -.\"O .SH RETURN VALUE +\fBlog\fP() 関数は \fIx\fP の自然対数を返す。 .SH 返り値 -.\"O On success, these functions return the natural logarithm of -.\"O .IR x . -成功すると、これらの関数は -.I x -の自然対数を返す。 +成功すると、これらの関数は \fIx\fP の自然対数を返す。 -.\"O If -.\"O .I x -.\"O is a NaN, -.\"O a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is 1, the result is +0. -.I x -が 1 の場合、+0 が返される。 +\fIx\fP が 1 の場合、+0 が返される。 -.\"O If -.\"O .I x -.\"O is positive infinity, -.\"O positive infinity is returned. -.I x -が正の無限大の場合、正の無限大が返される。 +\fIx\fP が正の無限大の場合、正の無限大が返される。 -.\"O If -.\"O .I x -.\"O is zero, -.\"O then a pole error occurs, and the functions return -.\"O .RB - HUGE_VAL , -.\"O .RB - HUGE_VALF , -.\"O or -.\"O .RB - HUGE_VALL , -.\"O respectively. -.I x -が 0 の場合、極エラー (pole error) が発生し、 -各関数はそれぞれ -.RB - HUGE_VAL , -.RB - HUGE_VALF , -.RB - HUGE_VALL -を返す。 +\fIx\fP が 0 の場合、極エラー (pole error) が発生し、 各関数はそれぞれ \-\fBHUGE_VAL\fP, \-\fBHUGE_VALF\fP, +\-\fBHUGE_VALL\fP を返す。 -.\"O If -.\"O .I x -.\"O is negative (including negative infinity), then -.\"O a domain error occurs, and a NaN (not a number) is returned. -.I x -が負の場合 (負の無限大も含む)、領域エラー (domain error) が発生し、 -NaN (not a number) が返される。 -.\"O .SH ERRORS +\fIx\fP が負の場合 (負の無限大も含む)、領域エラー (domain error) が発生し、 NaN (not a number) が返される。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Domain error: \fIx\fP is negative +.TP 領域エラー (domain error): \fIx\fP が負である -.\"O .I errno -.\"O is set to -.\"O .BR EDOM . -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -.I errno -に -.B EDOM -が設定される。 -不正 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) -が上がる。 -.TP -.\"O Pole error: \fIx\fP is zero +\fIerrno\fP に \fBEDOM\fP が設定される。 不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 +.TP 極エラー (pole error): \fIx\fP が 0 である -.\"O .I errno -.\"O is set to -.\"O .BR ERANGE . -.\"O A divide-by-zero floating-point exception -.\"O .RB ( FE_DIVBYZERO ) -.\"O is raised. -.I errno -に -.B ERANGE -が設定される。 -0 による除算 (divide-by-zero) 浮動小数点例外 -.RB ( FE_DIVBYZERO ) -が上がる。 -.\"O .SH "CONFORMING TO" +\fIerrno\fP に \fBERANGE\fP が設定される。 0 による除算 (divide\-by\-zero) 浮動小数点例外 +(\fBFE_DIVBYZERO\fP) が上がる。 .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 -.\"O .SH BUGS +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH バグ -.\"O In glibc 2.5 and earlier, -.\"O taking the -.\"O .BR log () -.\"O of a NaN produces a bogus invalid floating-point -.\"O .RB ( FE_INVALID ) -.\"O exception. -glibc 2.5 以前では、 -NaN に対して -.BR log () -をとると、間違って不正浮動小数点例外 -.RB ( FE_INVALID ) +glibc 2.5 以前では、 NaN に対して \fBlog\fP() をとると、間違って不正浮動小数点例外 (\fBFE_INVALID\fP) が発生していた。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR cbrt (3), -.BR clog (3), -.BR log10 (3), -.BR log1p (3), -.BR log2 (3), -.BR sqrt (3) +\fBcbrt\fP(3), \fBclog\fP(3), \fBlog10\fP(3), \fBlog1p\fP(3), \fBlog2\fP(3), \fBsqrt\fP(3) diff --git a/draft/man3/log10.3 b/draft/man3/log10.3 index 20c750ab..c83b2299 100644 --- a/draft/man3/log10.3 +++ b/draft/man3/log10.3 @@ -31,103 +31,51 @@ .\" Modified 2002-07-27 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated Wed Aug 6 00:35:20 JST 2003 -.\" by Akihiro MOTOKI -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH LOG10 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH LOG10 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O log10, log10f, log10l \- base-10 logarithmic function -log10, log10f, log10l \- 底が 10 の対数関数 -.\"O .SH SYNOPSIS +log10, log10f, log10l \- 底が 10 の対数関数 .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double log10(double " x ); +\fBdouble log10(double \fP\fIx\fP\fB);\fP .br -.BI "float log10f(float " x ); +\fBfloat log10f(float \fP\fIx\fP\fB);\fP .br -.BI "long double log10l(long double " x ); +\fBlong double log10l(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR log10f (), -.BR log10l (): +\fBlog10f\fP(), \fBlog10l\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR log10 () -.\"O function returns the base 10 logarithm of \fIx\fP. -.BR log10 () -関数は \fIx\fP の常用対数 (底が 10 の対数) を返す。 -.\"O .SH RETURN VALUE +\fBlog10\fP() 関数は \fIx\fP の常用対数 (底が 10 の対数) を返す。 .SH 返り値 -.\"O On success, these functions return the base 10 logarithm of -.\"O .IR x . -成功すると、これらの関数は -.I x -の常用対数 (底が 10 の対数) を返す。 +成功すると、これらの関数は \fIx\fP の常用対数 (底が 10 の対数) を返す。 -.\"O For special cases, including where -.\"O .I x -.\"O is 0, 1, negative, infinity, or NaN, see -.\"O .BR log (3). -.I x -が 0、1、負、無限大、NaN などのさまざまな特別な状況については、 -.BR log (3) -を参照のこと。 -.\"O .SH ERRORS +\fIx\fP が 0、1、負、無限大、NaN などのさまざまな特別な状況については、 \fBlog\fP(3) を参照のこと。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 -.\"O For a discussion of the errors that can occur for these functions, see -.\"O .BR log (3). -これらの関数で発生するエラーについては、 -.BR log (3) -を参照のこと。 -.\"O .SH "CONFORMING TO" +これらの関数で発生するエラーについては、 \fBlog\fP(3) を参照のこと。 .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH 関連項目 -.BR cbrt (3), -.BR clog10 (3), -.BR exp10 (3), -.BR log (3), -.BR log2 (3), -.BR sqrt (3) +\fBcbrt\fP(3), \fBclog10\fP(3), \fBexp10\fP(3), \fBlog\fP(3), \fBlog2\fP(3), \fBsqrt\fP(3) diff --git a/draft/man3/log1p.3 b/draft/man3/log1p.3 index 138595d4..ad53fa22 100644 --- a/draft/man3/log1p.3 +++ b/draft/man3/log1p.3 @@ -24,176 +24,92 @@ .\" .\" Modified 2002-07-27 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated Wed Aug 6 00:35:20 JST 2003 -.\" by Akihiro MOTOKI -.\" Updated 2008-09-16, Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.TH LOG1P 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH LOG1P 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O log1p, log1pf, log1pl \- logarithm of 1 plus argument -log1p, log1pf, log1pl \- 引き数に 1 を加えた値の対数 -.\"O .SH SYNOPSIS +log1p, log1pf, log1pl \- 引き数に 1 を加えた値の対数 .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double log1p(double " x ); +\fBdouble log1p(double \fP\fIx\fP\fB);\fP .br -.BI "float log1pf(float " x ); +\fBfloat log1pf(float \fP\fIx\fP\fB);\fP .br -.BI "long double log1pl(long double " x ); +\fBlong double log1pl(long double \fP\fIx\fP\fB);\fP .sp .fi -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR log1p (): +\fBlog1p\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .br -.BR log1pf (), -.BR log1pl (): +\fBlog1pf\fP(), \fBlog1pl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O .I log1p(x) -.\"O returns a value equivalent to -.I log1p(x) -は以下と等価な値を返す。 +\fIlog1p(x)\fP は以下と等価な値を返す。 .nf log (1 + \fIx\fP) .fi -.\"O It is computed in a way -.\"O that is accurate even if the value of \fIx\fP is near zero. \fIx\fP の値が 0 に近い場合でも正確に計算できる方法が用いられる。 -.\"O .SH RETURN VALUE .SH 返り値 -.\"O On success, these functions return the natural logarithm of -.\"O .IR "(1\ +\ x)" . -成功すると、これらの関数は -.I "(1\ +\ x)" -の自然対数を返す。 +成功すると、これらの関数は \fI(1\ +\ x)\fP の自然対数を返す。 -.\"O If -.\"O .I x -.\"O is a NaN, -.\"O a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is positive infinity, positive infinity is returned. -.I x -が正の無限大の場合、正の無限大が返される。 +\fIx\fP が正の無限大の場合、正の無限大が返される。 -.\"O If -.\"O .I x -.\"O is \-1, a pole error occurs, -.\"O and the functions return -.\"O .RB - HUGE_VAL , -.\"O .RB - HUGE_VALF , -.\"O or -.\"O .RB - HUGE_VALL , -.\"O respectively. -.I x -が \-1 の場合、極エラー (pole error) が発生し、 -各関数はそれぞれ -.RB - HUGE_VAL , -.RB - HUGE_VALF , -.RB - HUGE_VALL -を返す。 +\fIx\fP が \-1 の場合、極エラー (pole error) が発生し、 各関数はそれぞれ \-\fBHUGE_VAL\fP, \-\fBHUGE_VALF\fP, +\-\fBHUGE_VALL\fP を返す。 -.\"O If -.\"O .I x -.\"O is less than \-1 (including negative infinity), -.\"O a domain error occurs, -.\"O and a NaN (not a number) is returned. -.I x -が \-1 より小さい場合 (負の無限大も含む)、 -領域エラー (domain error) が発生し、 -NaN (not a number) が返される。 .\" POSIX.1 specifies a possible range error if x is subnormal .\" glibc 2.8 doesn't do this -.\"O .SH ERRORS +\fIx\fP が \-1 より小さい場合 (負の無限大も含む)、 領域エラー (domain error) が発生し、 NaN (not a number) +が返される。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Domain error: \fIx\fP is less than \-1 +.TP 領域エラー (domain error): \fIx\fP が \-1 より小さい .\" .I errno .\" is set to .\" .BR EDOM . -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -不正 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) -が上がる。 -.TP -.\"O Pole error: \fIx\fP is \-1 +不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 +.TP 極エラー (pole error): \fIx\fP が \-1 である .\" .I errno .\" is set to .\" .BR ERANGE . -.\"O A divide-by-zero floating-point exception -.\"O .RB ( FE_DIVBYZERO ) -.\"O is raised. -0 による除算 (divide-by-zero) 浮動小数点例外 -.RB ( FE_DIVBYZERO ) -が上がる。 +0 による除算 (divide\-by\-zero) 浮動小数点例外 (\fBFE_DIVBYZERO\fP) が上がる。 .PP -.\"O These functions do not set -.\"O .IR errno . -これらの関数は -.I errno -を設定しない。 .\" FIXME . Is it intentional that these functions do not set errno? .\" log(), log2(), log10() do set errno .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6792 -.\"O .SH "CONFORMING TO" +これらの関数は \fIerrno\fP を設定しない。 .SH 準拠 -C99, POSIX.1-2001. .\" BSD -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. .SH 関連項目 -.BR exp (3), -.BR expm1 (3), -.BR log (3) +\fBexp\fP(3), \fBexpm1\fP(3), \fBlog\fP(3) diff --git a/draft/man3/log2.3 b/draft/man3/log2.3 index 7c9d2a9d..d339ab79 100644 --- a/draft/man3/log2.3 +++ b/draft/man3/log2.3 @@ -31,107 +31,52 @@ .\" Modified 2002-07-27 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO -.\" all rights reserved. -.\" Translated 2004-08-20, Yuichi SATO -.\" Updated & Modified 2005-01-16, Yuichi SATO -.\" Updated & Modified 2005-09-06, Akihiro MOTOKI -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH LOG2 3 2010-09-12 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH LOG2 3 2010\-09\-12 "" "Linux Programmer's Manual" .SH 名前 -.\"O log2, log2f, log2l \- base-2 logarithmic function log2, log2f, log2l \- 底が 2 の対数関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double log2(double " x ); +\fBdouble log2(double \fP\fIx\fP\fB);\fP .br -.BI "float log2f(float " x ); +\fBfloat log2f(float \fP\fIx\fP\fB);\fP .br -.BI "long double log2l(long double " x ); +\fBlong double log2l(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR log2 (), -.BR log2f (), -.BR log2l (): +\fBlog2\fP(), \fBlog2f\fP(), \fBlog2l\fP(): .RS 4 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR log2 () -.\"O function returns the base 2 logarithm of \fIx\fP. -.BR log2 () -関数は底を 2 とする \fIx\fP の対数を返す。 -.\"O .SH RETURN VALUE +\fBlog2\fP() 関数は底を 2 とする \fIx\fP の対数を返す。 .SH 返り値 -.\"O On success, these functions return the base 2 logarithm of -.\"O .IR x . -成功すると、これらの関数は -.I x -の底を 2 とする対数を返す。 +成功すると、これらの関数は \fIx\fP の底を 2 とする対数を返す。 -.\"O For special cases, including where -.\"O .I x -.\"O is 0, 1, negative, infinity, or NaN, see -.\"O .BR log (3). -.I x -が 0、1、負、無限大、NaN などのさまざまな特別な状況については、 -.BR log (3) -を参照のこと。 -.\"O .SH ERRORS +\fIx\fP が 0、1、負、無限大、NaN などのさまざまな特別な状況については、 \fBlog\fP(3) を参照のこと。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 -.\"O For a discussion of the errors that can occur for these functions, see -.\"O .BR log (3). -これらの関数で発生するエラーについては、 -.BR log (3) -を参照のこと。 -.\"O .SH VERSIONS +これらの関数で発生するエラーについては、 \fBlog\fP(3) を参照のこと。 .SH バージョン -.\"O These functions first appeared in glibc in version 2.1. これらの関数は glibc バージョン 2.1 で初めて登場した。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD. -.I double -版の関数は SVr4, 4.3BSD にも準拠している。 -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD にも準拠している。 .SH 関連項目 -.BR cbrt (3), -.BR clog2 (3), -.BR log (3), -.BR log10 (3), -.BR sqrt (3) +\fBcbrt\fP(3), \fBclog2\fP(3), \fBlog\fP(3), \fBlog10\fP(3), \fBsqrt\fP(3) diff --git a/draft/man3/logb.3 b/draft/man3/logb.3 index 39e2defb..67dcbc59 100644 --- a/draft/man3/logb.3 +++ b/draft/man3/logb.3 @@ -24,196 +24,82 @@ .\" .\" Inspired by a page by Walter Harms created 2002-08-10 .\" -.\" Japanese Version Copyright (c) 2005 Yuichi SATO -.\" all rights reserved. -.\" Translated Sat Jan 29 06:47:42 JST 2005 -.\" by Yuichi SATO -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.\"WORD: exponent 指数部 -.\"WORD: radix 基数 -.\"WORD: subnormal 非正規化の +.\" This file was generated with po4a. Translate the source file. .\" -.TH LOGB 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH LOGB 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O logb, logbf, logbl \- get exponent of a floating-point value logb, logbf, logbl \- 浮動小数点数の指数を取得する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "double logb(double " x ); +\fBdouble logb(double \fP\fIx\fP\fB);\fP .br -.BI "float logbf(float " x ); +\fBfloat logbf(float \fP\fIx\fP\fB);\fP .br -.BI "long double logbl(long double " x ); +\fBlong double logbl(long double \fP\fIx\fP\fB);\fP .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR logb (): +\fBlogb\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .br -.BR logbf (), -.BR logbl (): +\fBlogbf\fP(), \fBlogbl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O These functions extract the exponent from the -.\"O internal floating-point representation of -.\"O .I x -.\"O and return it as a floating-point value. -これらの関数は、 -.I x -の浮動小数点の内部表現から指数部を抽出し、浮動小数点数値として返す。 -.\"O The integer constant -.\"O .BR FLT_RADIX , -.\"O defined in -.\"O .IR , -.\"O indicates the radix used for the system's floating-point representation. -.I -で定義されている整数定数 -.B FLT_RADIX -は、システムの浮動小数点表現で使用されている基数を表す。 -.\"O If -.\"O .B FLT_RADIX -.\"O is 2, -.\"O .BI logb( x ) -.\"O is equal to -.\"O .BI floor(log2( x ))\fR, -.\"O except that is probably faster. -.B FLT_RADIX -が 2 の場合、 -.BI logb( x ) -は -.BI floor(log2( x ))\fR -と等しいが、後者の方がたぶん高速である。 +これらの関数は、 \fIx\fP の浮動小数点の内部表現から指数部を抽出し、浮動小数点数値として返す。 \fI\fP +で定義されている整数定数 \fBFLT_RADIX\fP は、システムの浮動小数点表現で使用されている基数を表す。 \fBFLT_RADIX\fP が 2 の場合、 +\fBlogb(\fP\fIx\fP\fB)\fP は \fBfloor(log2(\fP\fIx\fP\fB))\fP と等しいが、後者の方がたぶん高速である。 .LP -.\"O If -.\"O .I x -.\"O is subnormal, -.\"O .BR logb () -.\"O returns the exponent -.\"O .I x -.\"O would have if it were normalized. -.I x -が非正規化数の場合、 -.BR logb () -は -.I x -が正規化された場合の指数を返す。 -.\"O .SH RETURN VALUE +\fIx\fP が非正規化数の場合、 \fBlogb\fP() は \fIx\fP が正規化された場合の指数を返す。 .SH 返り値 -.\"O On success, these functions return the exponent of -.\"O .IR x . -成功すると、これらの関数は -.I x -の指数部を返す。 +成功すると、これらの関数は \fIx\fP の指数部を返す。 -.\"O If -.\"O .I x -.\"O is a NaN, -.\"O a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is zero, then a pole error occurs, and the functions return -.\"O .RB - HUGE_VAL , -.\"O .RB - HUGE_VALF , -.\"O or -.\"O .RB - HUGE_VALL , -.\"O respectively. -.I x -が 0 の場合、極エラー (pole error) が発生し、 -各関数はそれぞれ -.RB - HUGE_VAL , -.RB - HUGE_VALF , -.RB - HUGE_VALL -を返す。 +\fIx\fP が 0 の場合、極エラー (pole error) が発生し、 各関数はそれぞれ \-\fBHUGE_VAL\fP, \-\fBHUGE_VALF\fP, +\-\fBHUGE_VALL\fP を返す。 -.\"O If -.\"O .I x -.\"O is negative infinity or positive infinity, then -.\"O positive infinity is returned. -.I x -が負の無限大か正の無限大の場合、正の無限大が返される。 -.\"O .\" .SH "RETURN VALUE" -.\"O .\" These functions return the exponent part of their argument. -.\" .SH 返り値 -.\" これらの関数は引き数の指数部を返す。 -.\"O .SH ERRORS +\fIx\fP が負の無限大か正の無限大の場合、正の無限大が返される。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Pole error: \fIx\fP is 0 +.TP 極エラー (pole error): \fIx\fP が 0 である .\" .I errno .\" is set to .\" .BR ERANGE . -.\"O A divide-by-zero floating-point exception -.\"O .RB ( FE_DIVBYZERO ) -.\"O is raised. -0 による除算 (divide-by-zero) 浮動小数点例外 -.RB ( FE_DIVBYZERO ) -が上がる。 +0 による除算 (divide\-by\-zero) 浮動小数点例外 (\fBFE_DIVBYZERO\fP) が上がる。 .PP -.\"O These functions do not set -.\"O .IR errno . -これらの関数は -.I errno -を設定しない。 .\" FIXME . Is it intentional that these functions do not set errno? .\" log(), log2(), log10() do set errno .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6793 .\" -.\"O .\" .SH HISTORY -.\" .SH 履歴 -.\"O .\" The -.\"O .\" .BR logb () -.\"O .\" function occurs in 4.3BSD. -.\"O .\" see IEEE.3 in the 4.3BSD manual +.\" .SH HISTORY +.\" The .\" .BR logb () -.\" 関数は 4.3BSD で導入された。 -.\" 4.3BSD マニュアルの IEEE.3 を参照すること。 -.\"O .SH "CONFORMING TO" +.\" function occurs in 4.3BSD. +.\" see IEEE.3 in the 4.3BSD manual +これらの関数は \fIerrno\fP を設定しない。 .SH 準拠 -C99, POSIX.1-2001. -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. .SH 関連項目 -.BR ilogb (3), -.BR log (3) +\fBilogb\fP(3), \fBlog\fP(3) diff --git a/draft/man3/lrint.3 b/draft/man3/lrint.3 index 9b92d8f1..295f7d66 100644 --- a/draft/man3/lrint.3 +++ b/draft/man3/lrint.3 @@ -22,143 +22,73 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2001, 2005 Yuichi SATO -.\" all rights reserved. -.\" Translated Sun Jul 8 11:59:22 JST 2001 -.\" by Yuichi SATO -.\" Updated & Modified Sat Jan 15 22:39:05 JST 2005 -.\" by Yuichi SATO -.\" Updated 2008-09-18, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH LRINT 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH LRINT 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O lrint, lrintf, lrintl, llrint, llrintf, llrintl \- round to nearest integer lrint, lrintf, lrintl, llrint, llrintf, llrintl \- 最も近い整数値に丸める -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "long int lrint(double " x ); +\fBlong int lrint(double \fP\fIx\fP\fB);\fP .br -.BI "long int lrintf(float " x ); +\fBlong int lrintf(float \fP\fIx\fP\fB);\fP .br -.BI "long int lrintl(long double " x ); +\fBlong int lrintl(long double \fP\fIx\fP\fB);\fP .sp -.BI "long long int llrint(double " x ); +\fBlong long int llrint(double \fP\fIx\fP\fB);\fP .br -.BI "long long int llrintf(float " x ); +\fBlong long int llrintf(float \fP\fIx\fP\fB);\fP .br -.BI "long long int llrintl(long double " x ); +\fBlong long int llrintl(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.\"O All functions shown above: 上記の全ての関数: .RS 4 -_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O These functions round their argument to the nearest integer value, -.\"O using the current rounding direction (see -.\"O .BR fesetround (3)). -これらの関数は、現在の丸め方向に基づき、最も近い整数に引き数を丸める -(現在の丸め方向については -.BR fesetround (3) -を参照)。 +これらの関数は、現在の丸め方向に基づき、最も近い整数に引き数を丸める (現在の丸め方向については \fBfesetround\fP(3) を参照)。 -.\"O Note that unlike -.\"O .BR rint (3), -.\"O etc., the return type of these functions differs from -.\"O that of their arguments. -.BR rint (3) -と違い、これらの関数の返り値の型は引き数の型と異なる点に注意すること。 -.\"O .SH "RETURN VALUE" +\fBrint\fP(3) と違い、これらの関数の返り値の型は引き数の型と異なる点に注意すること。 .SH 返り値 -.\"O These functions return the rounded integer value. これらの関数は丸めた整数値を返す。 -.\"O If -.\"O .I x -.\"O is a NaN or an infinity, -.\"O or the rounded value is too large to be stored in a -.\"O .I long -.\"O .RI ( "long long" -.\"O in the case of the -.\"O .B ll* -.\"O functions) -.\"O then a domain error occurs, and the return value is unspecified. -.I x -が NaN か無限大の場合、もしくは丸めた値が大き過ぎて -.I long -.RB ( ll* -関数の場合には -.IR "long long" ) -に格納できない場合、 -領域エラー (domain error) が発生し、返り値は不定となる。 .\" The return value is -(LONG_MAX - 1) or -(LLONG_MAX -1) -.\"O .SH ERRORS +\fIx\fP が NaN か無限大の場合、もしくは丸めた値が大き過ぎて \fIlong\fP (\fBll*\fP 関数の場合には \fIlong long\fP) +に格納できない場合、 領域エラー (domain error) が発生し、返り値は不定となる。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Domain error: \fIx\fP is a NaN or infinite, or the rounded value is too large -領域エラー: \fIx\fP が NaN か無限大、もしくは丸めた値が大き過ぎる +.TP +領域エラー (domain error): \fIx\fP が NaN か無限大、もしくは丸めた値が大き過ぎる .\" .I errno .\" is set to .\" .BR EDOM . -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -不正 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) -が上がる。 +不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 .PP -.\"O These functions do not set -.\"O .IR errno . -これらの関数は -.I errno -を設定しない。 .\" FIXME . Is it intentional that these functions do not set errno? .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6798 -.\"O .SH VERSIONS +これらの関数は \fIerrno\fP を設定しない。 .SH バージョン -.\"O These functions first appeared in glibc in version 2.1. これらの関数は glibc バージョン 2.1 で初めて登場した。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. .SH 関連項目 -.BR ceil (3), -.BR floor (3), -.BR lround (3), -.BR nearbyint (3), -.BR rint (3), -.BR round (3) +\fBceil\fP(3), \fBfloor\fP(3), \fBlround\fP(3), \fBnearbyint\fP(3), \fBrint\fP(3), +\fBround\fP(3) diff --git a/draft/man3/lround.3 b/draft/man3/lround.3 index 7119589b..61550334 100644 --- a/draft/man3/lround.3 +++ b/draft/man3/lround.3 @@ -22,149 +22,75 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2001, 2005 Yuichi SATO -.\" all rights reserved. -.\" Translated Sat Jul 14 11:21:46 JST 2001 -.\" by Yuichi SATO -.\" Updated & Modified Sun Jan 16 06:26:19 JST 2005 -.\" by Yuichi SATO -.\" Updated 2008-09-18, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH LROUND 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH LROUND 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O lround, lroundf, lroundl, llround, llroundf, llroundl \- round to -.\"O nearest integer, away from zero -lround, lroundf, lroundl, llround, llroundf, llroundl \- -(0 から遠い方の) 最も近い整数値に丸める -.\"O .SH SYNOPSIS +lround, lroundf, lroundl, llround, llroundf, llroundl \- (0 から遠い方の) +最も近い整数値に丸める +.SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "long int lround(double " x ); +\fBlong int lround(double \fP\fIx\fP\fB);\fP .br -.BI "long int lroundf(float " x ); +\fBlong int lroundf(float \fP\fIx\fP\fB);\fP .br -.BI "long int lroundl(long double " x ); +\fBlong int lroundl(long double \fP\fIx\fP\fB);\fP .sp -.BI "long long int llround(double " x ); +\fBlong long int llround(double \fP\fIx\fP\fB);\fP .br -.BI "long long int llroundf(float " x ); +\fBlong long int llroundf(float \fP\fIx\fP\fB);\fP .br -.BI "long long int llroundl(long double " x ); +\fBlong long int llroundl(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.\"O All functions shown above: -ここに記載されている全ての関数: +上記の全ての関数: .RS 4 -_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -\"O .SH DESCRIPTION .SH 説明 -.\"O These functions round their argument to the nearest integer value, -.\"O rounding away from zero, -.\"O regardless of the current rounding direction (see -.\"O .BR fenv (3)). -これらの関数は最も近い整数に引き数を丸める。 -現在の丸め方向に関係なく、 -0 から遠い方の最も近い整数に引き数は丸められる -(現在の丸め方向については -.BR fenv (3) -参照)。 +これらの関数は最も近い整数に引き数を丸める。 現在の丸め方向に関係なく、 0 から遠い方の最も近い整数に引き数は丸められる (現在の丸め方向については +\fBfenv\fP(3) 参照)。 -.\"O Note that unlike -.\"O .BR round (3), -.\"O .BR ceil (3), -.\"O etc., the return type of these functions differs from -.\"O that of their arguments. -.BR round (3), -.BR ceil (3) -などと違い、これらの関数の返り値の型は引き数の型と異なる点に注意すること。 -.\"O .SH "RETURN VALUE" +\fBround\fP(3), \fBceil\fP(3) などと違い、これらの関数の返り値の型は引き数の型と異なる点に注意すること。 .SH 返り値 -.\"O These functions return the rounded integer value. これらの関数は丸めた整数値を返す。 -.\"O If -.\"O .I x -.\"O is a NaN or an infinity, -.\"O or the rounded value is too large to be stored in a -.\"O .I long -.\"O .RI ( "long long" -.\"O in the case of the -.\"O .B ll* -.\"O functions) -.\"O then a domain error occurs, and the return value is unspecified. -.I x -が NaN か無限大の場合、もしくは丸めた値が大き過ぎて -.I long -.RB ( ll* -関数の場合には -.IR "long long" ) -に格納できない場合、 -領域エラー (domain error) が発生し、返り値は不定となる。 .\" The return value is -(LONG_MAX - 1) or -(LLONG_MAX -1) -.\"O .SH ERRORS +\fIx\fP が NaN か無限大の場合、もしくは丸めた値が大き過ぎて \fIlong\fP (\fBll*\fP 関数の場合には \fIlong long\fP) +に格納できない場合、 領域エラー (domain error) が発生し、返り値は不定となる。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Domain error: \fIx\fP is a NaN or infinite, or the rounded value is too large +.TP 領域エラー (domain error): \fIx\fP が NaN か無限大、もしくは丸めた値が大き過ぎる .\" .I errno .\" is set to .\" .BR EDOM . -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -不正 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) -が上がる。 +不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 .PP -.\"O These functions do not set -.\"O .IR errno . -これらの関数は -.I errno -を設定しない。 .\" FIXME . Is it intentional that these functions do not set errno? .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6797 -.\"O .SH VERSIONS +これらの関数は \fIerrno\fP を設定しない。 .SH バージョン -.\"O These functions first appeared in glibc in version 2.1. これらの関数は glibc バージョン 2.1 で初めて登場した。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. .SH 関連項目 -.BR ceil (3), -.BR floor (3), -.BR lrint (3), -.BR nearbyint (3), -.BR rint (3), -.BR round (3) +\fBceil\fP(3), \fBfloor\fP(3), \fBlrint\fP(3), \fBnearbyint\fP(3), \fBrint\fP(3), +\fBround\fP(3) diff --git a/draft/man3/makecontext.3 b/draft/man3/makecontext.3 index 12b657a7..91624a1e 100644 --- a/draft/man3/makecontext.3 +++ b/draft/man3/makecontext.3 @@ -1,3 +1,4 @@ + .\" Copyright (C) 2001 Andries Brouwer (aeb@cwi.nl) .\" and Copyright (C) 2006 Michael Kerrisk .\" @@ -22,235 +23,73 @@ .\" the source, must acknowledge the copyright and authors of this work. .\" 2006-08-02, mtk, Added example program .\" -.\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved. -.\" Translated Sat Dec 15 2001 by NAKANO Takeo -.\" Updated 2008-12-24, Akihiro MOTOKI , LDP v3.15 +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. .\" -.TH MAKECONTEXT 3 2009-03-31 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O makecontext, swapcontext \- manipulate user context +.\"******************************************************************* +.TH MAKECONTEXT 3 2009\-03\-31 GNU "Linux Programmer's Manual" .SH 名前 makecontext, swapcontext \- ユーザコンテキストを操作する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "void makecontext(ucontext_t *" ucp ", void (*" func )(), -.BI "int " argc ", ...);" +\fBvoid makecontext(ucontext_t *\fP\fIucp\fP\fB, void (*\fP\fIfunc\fP\fB)(),\fP \fBint +\fP\fIargc\fP\fB, ...);\fP .sp -.BI "int swapcontext(ucontext_t *" oucp ", ucontext_t *" ucp ); -.\"O .SH DESCRIPTION +\fBint swapcontext(ucontext_t *\fP\fIoucp\fP\fB, ucontext_t *\fP\fIucp\fP\fB);\fP .SH 説明 -.\"O In a System V-like environment, one has the type \fIucontext_t\fP defined in -.\"O .I -.\"O and the four functions -.\"O .BR getcontext (2), -.\"O .BR setcontext (2), -.\"O .BR makecontext () -.\"O and -.\"O .BR swapcontext () -.\"O that allow user-level context switching -.\"O between multiple threads of control within a process. -System V 的な環境では、 -\fBmcontext_t\fP および \fBucontext_t\fP という 2 つの型と、 -.BR getcontext (2), -.BR setcontext (2), -.BR makecontext (), -.BR swapcontext () -という 4 つの関数が -.I -で定義されており、あるプロセス内部で制御下にある複数のスレッド間で、 +System V 的な環境では、 \fBmcontext_t\fP および \fBucontext_t\fP という 2 つの型と、 +\fBgetcontext\fP(2), \fBsetcontext\fP(2), \fBmakecontext\fP(), \fBswapcontext\fP() という +4 つの関数が \fI\fP で定義されており、あるプロセス内部で制御下にある複数のスレッド間で、 ユーザレベルのコンテキスト切替えができるようになっている。 .LP -.\"O For the type and the first two functions, see -.\"O .BR getcontext (2). -これらの型と、最初の 2 つの関数については、 -.BR getcontext (2) -を参照のこと。 +これらの型と、最初の 2 つの関数については、 \fBgetcontext\fP(2) を参照のこと。 .LP -.\"O The -.\"O .BR makecontext () -.\"O function modifies the context pointed to -.\"O by \fIucp\fP (which was obtained from a call to -.\"O .BR getcontext (2)). -.\"O Before invoking -.\"O .BR makecontext (), -.\"O the caller must allocate a new stack -.\"O for this context and assign its address to \fIucp\->uc_stack\fP, -.\"O and define a successor context and -.\"O assign its address to \fIucp\->uc_link\fP. -.BR makecontext () -関数は、ポインタ \fIucp\fP が指すコンテキストを変更する -(\fIucp\fP は以前の -.BR getcontext (2) -呼び出しで得られたものである)。 -.BR makecontext () -を起動する前には、呼び出し者は、このコンテキスト用に -新しいスタックを確保し、そのアドレスを \fIucp\->uc_stack\fP に代入し、 -さらに後継のコンテキストを定義し、そのアドレスを \fIucp\->uc_link\fP に -代入しなければならない。 +\fBmakecontext\fP() 関数は、ポインタ \fIucp\fP が指すコンテキストを変更する (\fIucp\fP は以前の +\fBgetcontext\fP(2) 呼び出しで得られたものである)。 \fBmakecontext\fP() +を起動する前には、呼び出し者は、このコンテキスト用に 新しいスタックを確保し、そのアドレスを \fIucp\->uc_stack\fP に代入し、 +さらに後継のコンテキストを定義し、そのアドレスを \fIucp\->uc_link\fP に 代入しなければならない。 -.\"O When this context is later activated (using -.\"O .BR setcontext (2) -.\"O or -.\"O .BR swapcontext ()) -.\"O the function \fIfunc\fP is called, -.\"O and passed the series of integer -.\"O .RI ( int ) -.\"O arguments that follow -.\"O .IR argc ; -.\"O the caller must specify the number of these arguments in -.\"O .IR argc . -.\"O When this function returns, the successor context is activated. -.\"O If the successor context pointer is NULL, the thread exits. -このコンテキストが将来 -.RB ( setcontext (2) -または -.BR swapcontext () -によって) -有効にされると、関数 \fIfunc\fP が呼ばれ、 -引き数として -.I argc -以降の整数 -.RI ( int ) -引き数の列が渡される。 -呼び出し者は -.I argc -にこれらの引き数の個数を指定しなければならない。 -この関数が戻ると、後継のコンテキストが有効になる。 -後継コンテキストのポインタが NULL の場合、そのスレッドが終了する。 +このコンテキストが将来 (\fBsetcontext\fP(2) または \fBswapcontext\fP() によって) 有効にされると、関数 +\fIfunc\fP が呼ばれ、 引き数として \fIargc\fP 以降の整数 (\fIint\fP) 引き数の列が渡される。 呼び出し者は \fIargc\fP +にこれらの引き数の個数を指定しなければならない。 この関数が戻ると、後継のコンテキストが有効になる。 後継コンテキストのポインタが NULL +の場合、そのスレッドが終了する。 .LP -.\"O The -.\"O .BR swapcontext () -.\"O function saves the current context in -.\"O the structure pointed to by \fIoucp\fP, and then activates the -.\"O context pointed to by \fIucp\fP. -.BR swapcontext () -関数は現在のコンテキストを -ポインタ \fIoucp\fP が指す構造体に保存し、 -ポインタ \fIucp\fP が指すコンテキストを有効にする。 -.\"O .SH "RETURN VALUE" +\fBswapcontext\fP() 関数は現在のコンテキストを ポインタ \fIoucp\fP が指す構造体に保存し、 ポインタ \fIucp\fP +が指すコンテキストを有効にする。 .SH 返り値 -.\"O When successful, -.\"O .BR swapcontext () -.\"O does not return. -.\"O (But we may return later, in case \fIoucp\fP is -.\"O activated, in which case it looks like -.\"O .BR swapcontext () -.\"O returns 0.) -.\"O On error, -.\"O .BR swapcontext () -.\"O returns \-1 and -.\"O sets \fIerrno\fP appropriately. -成功すると、 -.BR swapcontext () -は返らない -(しかし後に \fIoucp\fP が有効になった場合には返ることがある。 -このときには -.BR swapcontext () -は 0 を返すように見える。) -失敗すると、 -.BR swapcontext () -は \-1 を返し、 +成功すると、 \fBswapcontext\fP() は返らない (しかし後に \fIoucp\fP が有効になった場合には返ることがある。 このときには +\fBswapcontext\fP() は 0 を返すように見える。) 失敗すると、 \fBswapcontext\fP() は \-1 を返し、 \fIerrno\fP をエラーに応じて設定する。 -.\"O .SH ERRORS .SH エラー -.TP -.B ENOMEM -.\"O Insufficient stack space left. +.TP +\fBENOMEM\fP スタックに割り当てる空間が残っていない。 -.\"O .SH VERSIONS .SH バージョン -.\"O .BR makecontext () -.\"O and -.\"O .BR swapcontext () -.\"O are provided in glibc since version 2.1. -.BR makecontext () -と -.BR swapcontext () -は、バージョン 2.1 以降の glibc で提供されている。 -.\"O .SH "CONFORMING TO" +\fBmakecontext\fP() と \fBswapcontext\fP() は、バージョン 2.1 以降の glibc で提供されている。 .SH 準拠 -SUSv2, POSIX.1-2001. -.\"O POSIX.1-2008 removes the specifications of -.\"O .BR makecontext () -.\"O and -.\"O .BR swapcontext (), -.\"O citing portability issues, and -.\"O recommending that applications be rewritten to use POSIX threads instead. -POSIX.1-2008 では、移植性の問題から -.BR makecontext () -と -.BR swapcontext () -の仕様が削除されている。 -代わりに、アプリケーションを POSIX スレッドを使って書き直すことが -推奨されている。 -.\"O .SH NOTES +SUSv2, POSIX.1\-2001. POSIX.1\-2008 では、移植性の問題から \fBmakecontext\fP() と +\fBswapcontext\fP() の仕様が削除されている。 代わりに、アプリケーションを POSIX スレッドを使って書き直すことが 推奨されている。 .SH 注意 -.\"O The interpretation of \fIucp\->uc_stack\fP is just as in -.\"O .BR sigaltstack (2), -.\"O namely, this struct contains the start and length of a memory area -.\"O to be used as the stack, regardless of the direction of growth of -.\"O the stack. -.\"O Thus, it is not necessary for the user program to -.\"O worry about this direction. -\fIucp\->uc_stack\fP の解釈は -.BR sigaltstack (2) -の場合と同じである。 -すなわちこの構造体には、 -スタックとして用いられるメモリ領域の開始アドレスと長さが含まれ、 -これはスタックが伸びる方向がどちらであるかには関係しない。 +\fIucp\->uc_stack\fP の解釈は \fBsigaltstack\fP(2) の場合と同じである。 すなわちこの構造体には、 +スタックとして用いられるメモリ領域の開始アドレスと長さが含まれ、 これはスタックが伸びる方向がどちらであるかには関係しない。 したがって、ユーザプログラムはこの件については心配しなくてよい。 -.\"O On architectures where -.\"O .I int -.\"O and pointer types are the same size -.\"O (e.g., x86-32, where both types are 32 bits), -.\"O you may be able to get away with passing pointers as arguments to -.\"O .BR makecontext () -.\"O following -.\"O .IR argc . -.\"O However, doing this is not guaranteed to be portable, -.\"O is undefined according to the standards, -.\"O and won't work on architectures where pointers are larger than -.\"O .IR int s. -.\"O Nevertheless, starting with version 2.8, glibc makes some changes to -.\"O .BR makecontext (), -.\"O to permit this on some 64-bit architectures (e.g., x86-64). -.I int -とポインタ型が同じ大きさであるアーキテクチャでは -(x86-32 はその例であり、両方の型とも 32 ビットである)、 -.BR makecontext () -の -.I argc -以降の引き数としてポインタを渡してもうまく動くかもしれない。 -しかしながら、このようにすると、移植性は保証されず、 -標準に従えば動作は未定義であり、ポインタが -.I int -よりも大きいアーキテクチャでは正しく動作しないことだろう。 -それにも関わらず、バージョン 2.8 以降の glibc では、 -.BR makecontext () -に変更が行われ、(x86-64 などの) いくつかの 64 ビットアーキテクチャで +\fIint\fP とポインタ型が同じ大きさであるアーキテクチャでは (x86\-32 はその例であり、両方の型とも 32 ビットである)、 +\fBmakecontext\fP() の \fIargc\fP 以降の引き数としてポインタを渡してもうまく動くかもしれない。 +しかしながら、このようにすると、移植性は保証されず、 標準に従えば動作は未定義であり、ポインタが \fIint\fP +よりも大きいアーキテクチャでは正しく動作しないことだろう。 それにも関わらず、バージョン 2.8 以降の glibc では、 +\fBmakecontext\fP() に変更が行われ、(x86\-64 などの) いくつかの 64 ビットアーキテクチャで 引き数としてポインタを渡すことができるようになっている。 -.\"O .SH EXAMPLE .SH 例 .PP -.\"O The example program below demonstrates the use of -.\"O .BR getcontext (2), -.\"O .BR makecontext (), -.\"O and -.\"O .BR swapcontext (). -.\"O Running the program produces the following output: -以下のサンプル・プログラムは、 -.BR getcontext (2), -.BR makecontext (), -.BR swapcontext () -の使用方法の例を示すものである。 -このプログラムを実行すると、以下のような出力が得られる: +以下のサンプル・プログラムは、 \fBgetcontext\fP(2), \fBmakecontext\fP(), \fBswapcontext\fP() +の使用方法の例を示すものである。 このプログラムを実行すると、以下のような出力が得られる: .in +4n .nf -.RB "$" " ./a.out" +$\fB ./a.out\fP main: swapcontext(&uctx_main, &uctx_func2) func2: started func2: swapcontext(&uctx_func2, &uctx_func1) @@ -261,7 +100,6 @@ func1: returning main: exiting .fi .in -.\"O .SS Program source .SS プログラムのソース \& .nf @@ -271,27 +109,27 @@ main: exiting static ucontext_t uctx_main, uctx_func1, uctx_func2; -#define handle_error(msg) \\ +#define handle_error(msg) \e do { perror(msg); exit(EXIT_FAILURE); } while (0) static void func1(void) { - printf("func1: started\\n"); - printf("func1: swapcontext(&uctx_func1, &uctx_func2)\\n"); + printf("func1: started\en"); + printf("func1: swapcontext(&uctx_func1, &uctx_func2)\en"); if (swapcontext(&uctx_func1, &uctx_func2) == \-1) handle_error("swapcontext"); - printf("func1: returning\\n"); + printf("func1: returning\en"); } static void func2(void) { - printf("func2: started\\n"); - printf("func2: swapcontext(&uctx_func2, &uctx_func1)\\n"); + printf("func2: started\en"); + printf("func2: swapcontext(&uctx_func2, &uctx_func1)\en"); if (swapcontext(&uctx_func2, &uctx_func1) == \-1) handle_error("swapcontext"); - printf("func2: returning\\n"); + printf("func2: returning\en"); } int @@ -315,18 +153,14 @@ main(int argc, char *argv[]) uctx_func2.uc_link = (argc > 1) ? NULL : &uctx_func1; makecontext(&uctx_func2, func2, 0); - printf("main: swapcontext(&uctx_main, &uctx_func2)\\n"); + printf("main: swapcontext(&uctx_main, &uctx_func2)\en"); if (swapcontext(&uctx_main, &uctx_func2) == \-1) handle_error("swapcontext"); - printf("main: exiting\\n"); + printf("main: exiting\en"); exit(EXIT_SUCCESS); } .fi -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR getcontext (2), -.BR sigaction (2), -.BR sigaltstack (2), -.BR sigprocmask (2), -.BR sigsetjmp (3) +\fBgetcontext\fP(2), \fBsigaction\fP(2), \fBsigaltstack\fP(2), \fBsigprocmask\fP(2), +\fBsigsetjmp\fP(3) diff --git a/draft/man3/makedev.3 b/draft/man3/makedev.3 new file mode 100644 index 00000000..094a350f --- /dev/null +++ b/draft/man3/makedev.3 @@ -0,0 +1,66 @@ +.\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk +.\" +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH MAKEDEV 3 2010\-09\-10 Linux "Linux Programmer's Manual" +.SH 名前 +makedev, major, minor \- manage a device number +.SH 書式 +.nf +\fB#define _BSD_SOURCE\fP /* See feature_test_macros(7) */ +\fB#include \fP + +\fBdev_t makedev(int \fP\fImaj\fP\fB, int \fP\fImin\fP\fB);\fP + +\fBint major(dev_t \fP\fIdev\fP\fB);\fP +\fBint minor(dev_t \fP\fIdev\fP\fB);\fP + +.fi +.SH 説明 +A device ID consists of two parts: a major ID, identifying the class of the +device, and a minor ID, identifying a specific instance of a device in that +class. A device ID is represented using the type \fIdev_t\fP. + +Given major and minor device IDs, \fBmakedev\fP() combines these to produce a +device ID, returned as the function result. This device ID can be given to +\fBmknod\fP(2), for example. + +The \fBmajor\fP() and \fBminor\fP() functions perform the converse task: given a +device ID, they return, respectively, the major and minor components. These +macros can be useful to, for example, decompose the device IDs in the +structure returned by \fBstat\fP(2). +.SH 準拠 +.\" The BSDs, HP-UX, Solaris, AIX, Irix +The \fBmakedev\fP(), \fBmajor\fP(), and \fBminor\fP() functions are not specified in +POSIX.1, but are present on many other systems. +.SH 注意 +These interfaces are defined as macros. Since glibc 2.3.3, they have been +aliases for three GNU\-specific functions: \fBgnu_dev_makedev\fP(), +\fBgnu_dev_major\fP(), and \fBgnu_dev_minor\fP(). The latter names are exported, +but the traditional names are more portable. +.SH 関連項目 +\fBmknod\fP(2), \fBstat\fP(2) diff --git a/draft/man3/malloc.3 b/draft/man3/malloc.3 deleted file mode 100644 index 8dadc83b..00000000 --- a/draft/man3/malloc.3 +++ /dev/null @@ -1,484 +0,0 @@ -.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" License. -.\" Modified Sat Jul 24 19:00:59 1993 by Rik Faith (faith@cs.unc.edu) -.\" Clarification concerning realloc, iwj10@cus.cam.ac.uk (Ian Jackson), 950701 -.\" Documented MALLOC_CHECK_, Wolfram Gloger (wmglo@dent.med.uni-muenchen.de) -.\" 2007-09-15 mtk: added notes on malloc()'s use of sbrk() and mmap(). -.\" -.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. -.\" Translated 1998-08-12, NAKANO Takeo -.\" Modified 1998-12-18, NAKANO Takeo -.\" Modified 2000-08-23, NAKANO Takeo -.\" Modified 2001-05-19, Kentaro Shirakata -.\" Modified 2001-12-13, Kentaro Shirakata -.\" Modified 2005-03-15, Akihiro MOTOKI -.\" Modified 2007-10-12, Akihiro MOTOKI, LDP v2.66 -.\" -.\" WORD: OOM killer メモリ不足解決器 -.\" -.TH MALLOC 3 2009-01-13 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O calloc, malloc, free, realloc \- Allocate and free dynamic memory -.SH 名前 -calloc, malloc, free, realloc \- 動的なメモリの割り当てと解放を行う -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.B #include -.sp -.BI "void *calloc(size_t " "nmemb" ", size_t " "size" ); -.br -.BI "void *malloc(size_t " "size" ); -.br -.BI "void free(void " "*ptr" ); -.br -.BI "void *realloc(void " "*ptr" ", size_t " "size" ); -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O .BR calloc () -.\"O allocates memory for an array of -.\"O .I nmemb -.\"O elements of -.\"O .I size -.\"O bytes each and returns a pointer to the allocated memory. -.\"O The memory is set to zero. -.BR calloc () -は -.I size -バイトの要素 -.I nmemb -個からなる配列にメモリを割り当て、 -割り当てられたメモリに対するポインタを返す。 -メモリの内容は数値ゼロ (全ビットがゼロのバイト) にセットされる。 -.\"O If -.\"O .I nmemb -.\"O or -.\"O .I size -.\"O is 0, then -.\"O .BR calloc () -.\"O returns either NULL, -.\"O .\" glibc does this: -.\"O or a unique pointer value that can later be successfully passed to -.\"O .BR free (). -.I nmemb -か -.I size -が 0 の場合、 -.BR calloc () -は NULL -.\" glibc はこちら -または -.BR free () -に後で渡しても問題の起こらない一意なポインタ値を返す。 -.PP -.\"O .BR malloc () -.\"O allocates -.\"O .I size -.\"O bytes and returns a pointer to the allocated memory. -.\"O The memory is not cleared. -.BR malloc () -は -.I size -バイトを割り当て、 -割り当てられたメモリに対するポインタを返す。 -メモリの内容はクリアされない。 -.\"O If -.\"O .I size -.\"O is 0, then -.\"O .BR malloc () -.\"O returns either NULL, -.\"O .\" glibc does this: -.\"O or a unique pointer value that can later be successfully passed to -.\"O .BR free (). -.I size -が 0 の場合、 -.BR malloc () -は NULL -.\" glibc はこちら -または -.BR free () -に後で渡しても問題の起こらない一意なポインタ値を返す。 -.PP -.\"O .BR free () -.\"O frees the memory space pointed to by -.\"O .IR ptr , -.\"O which must have been returned by a previous call to -.\"O .BR malloc (), -.\"O .BR calloc () -.\"O or -.\"O .BR realloc (). -.\"O Otherwise, or if -.\"O .I free(ptr) -.\"O has already been called before, undefined behavior occurs. -.\"O If -.\"O .I ptr -.\"O is NULL, no operation is performed. -.BR free () -はポインタ -.I ptr -が指すメモリ空間を解放する。このポインタは、以前に呼び出された -.BR malloc (), -.BR calloc (), -.BR realloc () -のいずれかが返した値でなければならない。 -これ以外のポインタを指定したり、すでに -.I free(ptr) -が実行されていたりした場合の動作は定義されていない。 -.I ptr -が NULL の場合には、なんの動作も行われない。 -.PP -.\"O .BR realloc () -.\"O changes the size of the memory block pointed to by -.\"O .I ptr -.\"O to -.\"O .I size -.\"O bytes. -.BR realloc () -は、ポインタ -.I ptr -が示すメモリブロックのサイズを変更して -.I size -バイトにする。 -.\"O The contents will be unchanged to the minimum of the old and new sizes; -.\"O newly allocated memory will be uninitialized. -新旧のサイズのうち、小さいほうのブロックに含まれる内容は変更されない。 -新しく割り当てられたメモリの内容は初期化されない。 -.\"O If -.\"O .I ptr -.\"O is NULL, then the call is equivalent to -.\"O .IR malloc(size) , -.\"O for all values of -.\"O .IR size ; -.\"O if -.\"O .I size -.\"O is equal to zero, -.\"O and -.\"O .I ptr -.\"O is not NULL, then the call is equivalent to -.\"O .IR free(ptr) . -.I size -がどの値であっても、 -.I ptr -が NULL の場合には -.I malloc(size) -と等価である。 -.I size -が 0 で -.I ptr -が NULL でない場合には、 -.I free(ptr) -と等価である。 -.\"O Unless -.\"O .I ptr -.\"O is NULL, it must have been returned by an earlier call to -.\"O .BR malloc (), -.\"O .BR calloc () -.\"O or -.\"O .BR realloc (). -.I ptr -が NULL 以外の場合、 -.I ptr -は以前に呼び出された -.BR malloc (), -.BR calloc (), -.BR realloc () -のいずれかが返した値でなければならない。 -.\"O If the area pointed to was moved, a -.\"O .I free(ptr) -.\"O is done. -.I ptr -が指す領域が移動されていた場合は -.I free(ptr) -が実行される。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O For -.\"O .BR calloc () -.\"O and -.\"O .BR malloc (), -.\"O return a pointer to the allocated memory, which is suitably -.\"O aligned for any kind of variable. -.\"O On error, these functions return NULL. -.\"O NULL may also be returned by a successful call to -.\"O .BR malloc () -.\"O with a -.\"O .I size -.\"O of zero, -.\"O or by a successful call to -.\"O .BR calloc () -.\"O with -.\"O .I nmemb -.\"O or -.\"O .I size -.\"O equal to zero. -.BR calloc () -と -.BR malloc () -は、割り当てられたメモリへのポインタを返す。 -割り当てられたメモリは、あらゆる種類の変数に対応できるように -アラインメントされている。 -エラーの場合、これらの関数は NULL を返す。 -.I size -が 0 で呼び出した -.BR malloc () -や、 -.I nmemb -か -.I size -が 0 で呼び出した -.BR calloc () -が成功した場合にも NULL が返される。 -.PP -.\"O .BR free () -.\"O returns no value. -.BR free () -は値を返さない。 -.PP -.\"O .BR realloc () -.\"O returns a pointer to the newly allocated memory, which is suitably -.\"O aligned for any kind of variable and may be different from -.\"O .IR ptr , -.\"O or NULL if the request fails. -.\"O If -.\"O .I size -.\"O was equal to 0, either NULL or a pointer suitable to be passed to -.\"O .BR free () -.\"O is returned. -.\"O If -.\"O .BR realloc () -.\"O fails the original block is left untouched; it is not freed or moved. -.BR realloc () -は新たに割り当てられたメモリへのポインタを返す。 -これはあらゆる種類の変数に対応できるようにアラインメントされており、 -.I ptr -とは異なることもある。 -割り当て要求に失敗した場合は NULL が返る。 -.I size -が 0 の場合には、NULL もしくは -.BR free () -に渡すことができるポインタが返る。 -.BR realloc () -が失敗した場合には、元のブロックは変更されない。 -つまり、解放されたり移動されたりはしない。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -C89, C99. -.\"O .SH NOTES -.SH 注意 -.\"O Normally, -.\"O .BR malloc () -.\"O allocates memory from the heap, and adjusts the size of the heap -.\"O as required, using -.\"O .BR sbrk (2). -通常、 -.BR malloc () -は、ヒープからメモリを割り当て、必要に応じてヒープのサイズを -.BR sbrk (2) -を使って調節する。 -.\"O When allocating blocks of memory larger than -.\"O .B MMAP_THRESHOLD -.\"O bytes, the glibc -.\"O .BR malloc () -.\"O implementation allocates the memory as a private anonymous mapping using -.\"O .BR mmap (2). -.\"O .B MMAP_THRESHOLD -.\"O is 128 kB by default, but is adjustable using -.\"O .BR mallopt (3). -.B MMAP_THRESHOLD -バイトよりも大きなメモリブロックを割り当てる場合、 -glibc の -.BR malloc () -実装は -.BR mmap (2) -を使ってプライベートな無名マッピング (anonymous mapping) として -メモリを割り当てる。 -デフォルトでは -.B MMAP_THRESHOLD -は 128 kB だが、 -.BR mallopt (3) -を使って調整できる。 -.\" FIXME . there is no mallopt(3) man page yet. -.\"O Allocations performed using -.\"O .BR mmap (2) -.\"O are unaffected by the -.\"O .B RLIMIT_DATA -.\"O resource limit (see -.\"O .BR getrlimit (2)). -.BR mmap (2) -を使って行われたメモリ割り当ては -.B RLIMIT_DATA -リソース上限の影響を受けない -.RB ( getrlimit (2) -参照)。 - -.\"O The Unix98 standard requires -.\"O .BR malloc (), -.\"O .BR calloc (), -.\"O and -.\"O .BR realloc () -.\"O to set -.\"O .I errno -.\"O to -.\"O .B ENOMEM -.\"O upon failure. -.\"O Glibc assumes that this is done -.\"O (and the glibc versions of these routines do this); if you -.\"O use a private malloc implementation that does not set -.\"O .IR errno , -.\"O then certain library routines may fail without having -.\"O a reason in -.\"O .IR errno . -Unix98 標準では、 -.BR malloc (), -.BR calloc (), -.BR realloc () -は実行に失敗したときに -.I errno -を -.B ENOMEM -に設定することになっている。 -Glibc ではこれが守られていることを仮定している -(またこれらのルーチンの glibc バージョンはこのことを守っている)。 -個人的に別の malloc の実装を使っていて、その malloc が -.I errno -を設定しない場合には、失敗した際に -.I errno -にエラーの理由を設定しないライブラリルーチンがあるかもしれない。 -.LP -.\"O Crashes in -.\"O .BR malloc (), -.\"O .BR calloc (), -.\"O .BR realloc (), -.\"O or -.\"O .BR free () -.\"O are almost always related to heap corruption, such as overflowing -.\"O an allocated chunk or freeing the same pointer twice. -.BR malloc (), -.BR calloc (), -.BR realloc (), -.BR free () -における事故は、 -ほとんどの場合はヒープの破壊 (corruption) が原因である。 -例えば、割り当てられた領域をオーバーフローする、 -同じポインタに二度 free する、などがこれにあたる。 -.PP -.\"O Recent versions of Linux libc (later than 5.4.23) and glibc (2.x) -.\"O include a -.\"O .BR malloc () -.\"O implementation which is tunable via environment variables. -.\"O When -.\"O .B MALLOC_CHECK_ -.\"O is set, a special (less efficient) implementation is used which -.\"O is designed to be tolerant against simple errors, such as double -.\"O calls of -.\"O .BR free () -.\"O with the same argument, or overruns of a single byte (off-by-one -.\"O bugs). -.\"O Not all such errors can be protected against, however, and -.\"O memory leaks can result. -最近のバージョンの Linux libc (5.4.23 以降) と glibc (2.x) では、 -.BR malloc () -の動作を環境変数によって制御できるような実装がされている。 -.B MALLOC_CHECK_ -が設定されていると、特殊な実装が用いられ、 -単純なエラーには耐えることができるようになる (効率は悪くなる)。例えば、 -.BR free () -を同じ引き数で二度呼び出してしまう、 -1 バイトだけ行きすぎてしまう (off-by-one バグ) などがこれに当たる。 -しかし、これらのエラーの全てを防ぐことができるわけではなく、 -その場合にはメモリリークが起こってしまう。 -.\"O If -.\"O .B MALLOC_CHECK_ -.\"O is set to 0, any detected heap corruption is silently ignored; -.\"O if set to 1, a diagnostic is printed on \fIstderr\fP; -.\"O if set to 2, -.\"O .BR abort (3) -.\"O is called immediately; -.\"O if set to 3, a diagnostic message is printed on \fIstderr\fP -.\"O and the program is aborted. -.\"O Using a nonzero -.\"O .B MALLOC_CHECK_ -.\"O value can be useful because otherwise -.\"O a crash may happen much later, and the true cause for the problem -.\"O is then very hard to track down. -.B MALLOC_CHECK_ -が 0 にセットされていると、ヒープの破壊を黙って無視する。 -1 にセットされていると、診断メッセージが標準エラー出力に表示される。 -2 にセットされていると、ただちに -.BR abort (3) -が呼び出される。 -3 にセットされていると、診断メッセージが標準エラー出力に表示され、 -プログラムは強制終了 (abort) される。 -.B MALLOC_CHECK_ -に 0 以外の値をセットして役に立つ状況としては、 -実際のプロセスのクラッシュがずっと後に起こり、 -本当の原因を探し出すのが非常に困難な場合などが挙げられるだろう。 -.\"O .SH BUGS -.SH バグ -.\"O By default, Linux follows an optimistic memory allocation strategy. -デフォルトでは、Linux は楽観的メモリ配置戦略を用いている。 -.\"O This means that when -.\"O .BR malloc () -.\"O returns non-NULL there is no guarantee that the memory really -.\"O is available. -.\"O This is a really bad bug. -.\"O In case it turns out that the system is out of memory, -.\"O one or more processes will be killed by the infamous OOM killer. -つまり、 -.BR malloc () -が NULL でない値を返しても、そのメモリが実際に利用可能であることが -保証されない。これは本当にまずいバグである。 -システムがメモリ不足状態になったとき、悪名高いメモリ不足解決器 (OOM killer) -によって一つまたは複数のプロセスが削除される。 -.\"O In case Linux is employed under circumstances where it would be -.\"O less desirable to suddenly lose some randomly picked processes, -.\"O and moreover the kernel version is sufficiently recent, -.\"O one can switch off this overcommitting behavior using a command like: -突然あるプロセスが削除されるのが望ましくない状況で使用されていて、 -しかもカーネルのバージョンが十分に最近のものであれば、このメモリを -割り当て過ぎる動作 (overcommitting behavior) を以下のコマンドで -無効にできる。 -.in +4n -.sp -.nf -.RB "#" " echo 2 > /proc/sys/vm/overcommit_memory" - -.fi -.in -.\"O See also the kernel Documentation directory, files -.\"O .I vm/overcommit-accounting -.\"O and -.\"O .IR sysctl/vm.txt . -カーネルの付属文書の -.I vm/overcommit-accounting -と -.I sysctl/vm.txt -も参照のこと。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR brk (2), -.BR posix_memalign (3) -.\" .BR mallopt (3), -.BR mmap (2), -.BR alloca (3), diff --git a/draft/man3/malloc_hook.3 b/draft/man3/malloc_hook.3 deleted file mode 100644 index a42b1f89..00000000 --- a/draft/man3/malloc_hook.3 +++ /dev/null @@ -1,195 +0,0 @@ -.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) -.\" Distributed under GPL -.\" Heavily based on glibc documentation -.\" Polished, added docs, removed glibc doc bug, 2002-07-20, aeb -.\" -.\" FIXME -.\" According to a Fedora downstream patch, malloc hooks are deprecated -.\" https://bugzilla.redhat.com/show_bug.cgi?id=450187 -.\" Integrate this upstream? -.\" -.\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI all rights reserved. -.\" Translated Thu 05 Dec 2002 by Akihiro MOTOKI -.\" -.TH MALLOC_HOOK 3 2002-07-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O __malloc_hook, __malloc_initialize_hook, -.\"O __memalign_hook, __free_hook, __realloc_hook, -.\"O __after_morecore_hook \- malloc debugging variables -__malloc_hook, __malloc_initialize_hook, -__memalign_hook, __free_hook, __realloc_hook, -__after_morecore_hook \- malloc デバッグ用の変数 -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.B "#include " -.sp -.BI "void *(*__malloc_hook)(size_t " size ", const void *" caller ); -.sp -.BI "void *(*__realloc_hook)(void *" ptr ", size_t " size \ -", const void *" caller ); -.sp -.BI "void *(*__memalign_hook)(size_t " alignment ", size_t " size , -.BI " const void *" caller ); -.sp -.BI "void (*__free_hook)(void *" ptr ", const void *" caller ); -.sp -.B "void (*__malloc_initialize_hook)(void);" -.sp -.B "void (*__after_morecore_hook)(void);" -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The GNU C library lets you modify the behavior of -.\"O .BR malloc (3), -.\"O .BR realloc (3), -.\"O and -.\"O .BR free (3) -.\"O by specifying appropriate hook functions. -.\"O You can use these hooks -.\"O to help you debug programs that use dynamic memory allocation, -.\"O for example. -GNU C ライブラリでは、適切なフック関数 (hook function) を指定することで -.BR malloc (3), -.BR realloc (3), -.BR free (3) -の動作を変更することができる。例えば、動的にメモリ割り当てを行う -プログラムのデバッグにこれらのフックを使うことができる。 -.LP -.\"O The variable -.\"O .B __malloc_initialize_hook -.\"O points at a function that is called once when the malloc implementation -.\"O is initialized. -.\"O This is a weak variable, so it can be overridden in -.\"O the application with a definition like the following: -変数 -.B __malloc_initialize_hook -は malloc の実装が初期化される際に一度だけ呼ばれる関数へのポインタである。 -この変数は書き換え可能 (weak) であり、アプリケーション内で -以下のような定義で上書きできる: - -.nf - void (*__malloc_initialize_hook)(void) = my_init_hook; -.fi - -.\"O Now the function -.\"O .IR my_init_hook () -.\"O can do the initialization of all hooks. -なお、関数 -.IR my_init_hook () -で全てのフックの初期化をすることができる。 -.LP -.\"O The four functions pointed to by -.\"O .BR __malloc_hook , -.\"O .BR __realloc_hook , -.\"O .BR __memalign_hook , -.\"O .B __free_hook -.\"O have a prototype like the functions -.\"O .BR malloc (3), -.\"O .BR realloc (3), -.\"O .BR memalign (3), -.\"O .BR free (3), -.\"O respectively, except that they have a final argument -.\"O .I caller -.\"O that gives the address of the caller of -.\"O .BR malloc (3), -.\"O etc. -.BR __malloc_hook , -.BR __realloc_hook , -.BR __memalign_hook , -.B __free_hook -で指される 4 つの関数は、各々 -.BR malloc (3), -.BR realloc (3), -.BR memalign (3), -.BR free (3) -とよく似たプロトタイプを持っているが、 -一番最後の引き数 -.I caller -をとる点が異なる。 -引き数 -.I caller -には、 -.BR malloc (3) -などの呼び出し元 (caller) のアドレスが格納される。 -.LP -.\"O The variable -.\"O .B __after_morecore_hook -.\"O points at a function that is called each time after -.\"O .BR sbrk (2) -.\"O was asked for more memory. -変数 -.B __after_morecore_hook -は、領域の追加要求があり -.BR sbrk (2) -が呼ばれた後で毎回呼び出される関数へのポインタである。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -.\"O These functions are GNU extensions. -これらの関数は GNU による拡張である。 -.\"O .SH "EXAMPLE" -.SH 例 -.\"O Here is a short example of how to use these variables. -これらの変数の使い方の簡単な例を以下に示す。 -.sp -.nf -#include -#include - -.\"O /* Prototypes for our hooks. */ -/* 使おうとするフックのプロトタイプ宣言 */ -static void my_init_hook(void); -static void *my_malloc_hook(size_t, const void *); - -.\"O /* Variables to save original hooks. */ -/* 元々のフックを保存するための変数 */ -static void *(*old_malloc_hook)(size_t, const void *); - -.\"O /* Override initializing hook from the C library. */ -/* C ライブラリから呼ばれる初期化フックを上書きする */ -void (*__malloc_initialize_hook) (void) = my_init_hook; - -static void -my_init_hook(void) -{ - old_malloc_hook = __malloc_hook; - __malloc_hook = my_malloc_hook; -} - -static void * -my_malloc_hook(size_t size, const void *caller) -{ - void *result; - -.\"O /* Restore all old hooks */ - /* 元々のフックを全て戻す */ - __malloc_hook = old_malloc_hook; - -.\"O /* Call recursively */ - /* malloc の再帰的呼び出し */ - result = malloc(size); - -.\"O /* Save underlying hooks */ - /* 現在設定されているフック (underlying hook) を保存する */ - old_malloc_hook = __malloc_hook; - -.\"O /* printf() might call malloc(), so protect it too. */ - /* printf() は malloc() を呼び出す可能性があるので - ここでもガードを行う (元々のフックのままにしておく) */ - printf("malloc(%u) called from %p returns %p\\n", - (unsigned int) size, caller, result); - -.\"O /* Restore our own hooks */ - /* ユーザが使おうとするフックを再設定する */ - __malloc_hook = my_malloc_hook; - - return result; -} -.fi -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR mallinfo (3), -.BR malloc (3), -.BR mcheck (3), -.BR mtrace (3) diff --git a/draft/man3/matherr.3 b/draft/man3/matherr.3 new file mode 100644 index 00000000..c8bd13b1 --- /dev/null +++ b/draft/man3/matherr.3 @@ -0,0 +1,346 @@ +.\" t +.\" Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH MATHERR 3 2010\-09\-10 Linux "Linux Programmer's Manual" +.SH 名前 +matherr \- SVID math library exception handling +.SH 書式 +.nf +\fB#define _SVID_SOURCE\fP /* See feature_test_macros(7) */ +\fB#include \fP + +\fBint matherr(struct exception *\fP\fIexc\fP\fB);\fP + +\fBextern _LIB_VERSION_TYPE _LIB_VERSION;\fP +.fi +.sp +\fI\-lm\fP でリンクする。 +.SH 説明 +The System V Interface Definition (SVID) specifies that various math +functions should invoke a function called \fBmatherr\fP() if a math exception +is detected. This function is called before the math function returns; +after \fBmatherr\fP() returns, the system then returns to the math function, +which in turn returns to the caller. + +The \fBmatherr\fP() mechanism is supported by glibc, but is now obsolete: new +applications should use the techniques described in \fBmath_error\fP(7) and +\fBfenv\fP(3). This page documents the glibc \fBmatherr\fP() mechanism as an aid +for maintaining and porting older applications. + +To employ \fBmatherr\fP(), the programmer must define the \fB_SVID_SOURCE\fP +feature test macro (before including \fIany\fP header files), and assign the +value \fB_SVID_\fP to the external variable \fB_LIB_VERSION\fP. + +The system provides a default version of \fBmatherr\fP(). This version does +nothing, and returns zero (see below for the significance of this). The +default \fBmatherr\fP() can be overridden by a programmer\-defined version, +which will be invoked when an exception occurs. The function is invoked +with one argument, a pointer to an \fIexception\fP structure, defined as +follows: + +.in +4n +.nf +struct exception { + int type; /* Exception type */ + char *name; /* Name of function causing exception */ + double arg1; /* 1st argument to function */ + double arg2; /* 2nd argument to function */ + double retval; /* Function return value */ +} +.fi +.in +.PP +The \fItype\fP field has one of the following values: +.TP 12 +\fBDOMAIN\fP +A domain error occurred (the function argument was outside the range for +which the function is defined). The return value depends on the function; +\fIerrno\fP is set to \fBEDOM\fP. +.TP +\fBSING\fP +A pole error occurred (the function result is an infinity). The return +value in most cases is \fBHUGE\fP (the largest single precision floating\-point +number), appropriately signed. In most cases, \fIerrno\fP is set to \fBEDOM\fP. +.TP +\fBOVERFLOW\fP +An overflow occurred. In most cases, the value \fBHUGE\fP is returned, and +\fIerrno\fP is set to \fBERANGE\fP. +.TP +\fBUNDERFLOW\fP +An underflow occurred. 0.0 is returned, and \fIerrno\fP is set to \fBERANGE\fP. +.TP +\fBTLOSS\fP +Total loss of significance. 0.0 is returned, and \fIerrno\fP is set to +\fBERANGE\fP. +.TP +\fBPLOSS\fP +Partial loss of significance. This value is unused on glibc (and many other +systems). +.PP +The \fIarg1\fP and \fIarg2\fP fields are the arguments supplied to the function +(\fIarg2\fP is undefined for functions that take only one argument). + +The \fIretval\fP field specifies the return value that the math function will +return to its caller. The programmer\-defined \fBmatherr\fP() can modify this +field to change the return value of the math function. + +If the \fBmatherr\fP() function returns zero, then the system sets \fIerrno\fP as +described above, and may print an error message on standard error (see +below). + +If the \fBmatherr\fP() function returns a nonzero value, then the system does +not set \fIerrno\fP, and doesn't print an error message. +.SS "Math functions that employ matherr()" +The table below lists the functions and circumstances in which \fBmatherr\fP() +is called. The "Type" column indicates the value assigned to +\fIexc\->type\fP when calling \fBmatherr\fP(). The "Result" column is the +default return value assigned to \fIexc\->retval\fP. + +The "Msg?" and "errno" columns describe the default behavior if \fBmatherr\fP() +returns zero. If the "Msg?" columns contains "y", then the system prints an +error message on standard error. + +The table uses the following notations and abbreviations: +.RS +.nf + +x first argument to function +y second argument to function +fin finite value for argument +neg negative value for argument +int integral value for argument +o/f result overflowed +u/f result underflowed +|x| absolute value of x +X_TLOSS is a constant defined in \fI\fP +.fi +.RE +.\" Details below from glibc 2.8's sysdeps/ieee754/k_standard.c +.\" A subset of cases were test by experimental programs. +.TS +lB lB lB cB lB +l l l c l. +Function Type Result Msg? errno +acos(|x|>1) DOMAIN HUGE y EDOM +asin(|x|>1) DOMAIN HUGE y EDOM +atan2(0,0) DOMAIN HUGE y EDOM +.\" retval is 0.0/0.0 +acosh(x<1) DOMAIN NAN y EDOM +.\" retval is 0.0/0.0 +atanh(|x|>1) DOMAIN NAN y EDOM +.\" retval is x/0.0 +atanh(|x|==1) SING (x>0.0)? y EDOM +\ \ HUGE_VAL : +\ \ \-HUGE_VAL +cosh(fin) o/f OVERFLOW HUGE n ERANGE +sinh(fin) o/f OVERFLOW (x>0.0) ? n ERANGE +\ \ HUGE : \-HUGE +sqrt(x<0) DOMAIN 0.0 y EDOM +hypot(fin,fin) o/f OVERFLOW HUGE n ERANGE +exp(fin) o/f OVERFLOW HUGE n ERANGE +exp(fin) u/f UNDERFLOW 0.0 n ERANGE +exp2(fin) o/f OVERFLOW HUGE n ERANGE +exp2(fin) u/f UNDERFLOW 0.0 n ERANGE +exp10(fin) o/f OVERFLOW HUGE n ERANGE +exp10(fin) u/f UNDERFLOW 0.0 n ERANGE +j0(|x|>X_TLOSS) TLOSS 0.0 y ERANGE +j1(|x|>X_TLOSS) TLOSS 0.0 y ERANGE +jn(|x|>X_TLOSS) TLOSS 0.0 y ERANGE +y0(x>X_TLOSS) TLOSS 0.0 y ERANGE +y1(x>X_TLOSS) TLOSS 0.0 y ERANGE +yn(x>X_TLOSS) TLOSS 0.0 y ERANGE +y0(0) DOMAIN \-HUGE y EDOM +y0(x<0) DOMAIN \-HUGE y EDOM +y1(0) DOMAIN \-HUGE y EDOM +y1(x<0) DOMAIN \-HUGE y EDOM +yn(n,0) DOMAIN \-HUGE y EDOM +yn(x<0) DOMAIN \-HUGE y EDOM +lgamma(fin) o/f OVERFLOW HUGE n ERANGE +lgamma(\-int) or SING HUGE y EDOM +\ \ lgamma(0) +tgamma(fin) o/f OVERFLOW HUGE_VAL n ERANGE +tgamma(\-int) SING NAN y EDOM +tgamma(0) SING copysign( y ERANGE +\ \ HUGE_VAL,x) +log(0) SING \-HUGE y EDOM +log(x<0) DOMAIN \-HUGE y EDOM +.\" different from log() +log2(0) SING \-HUGE n EDOM +.\" different from log() +log2(x<0) DOMAIN \-HUGE n EDOM +log10(0) SING \-HUGE y EDOM +log10(x<0) DOMAIN \-HUGE y EDOM +pow(0.0,0.0) DOMAIN 0.0 y EDOM +pow(x,y) o/f OVERFLOW HUGE n ERANGE +pow(x,y) u/f UNDERFLOW 0.0 n ERANGE +pow(NaN,0.0) DOMAIN x n EDOM +.\" +0 and -0 +0**neg DOMAIN 0.0 y EDOM +neg**non\-int DOMAIN 0.0 y EDOM +scalb() o/f OVERFLOW (x>0.0) ? n ERANGE +\ \ HUGE_VAL : +\ \ \-HUGE_VAL +scalb() u/f UNDERFLOW copysign( n ERANGE +\ \ \ \ 0.0,x) +fmod(x,0) DOMAIN x y EDOM +.\" retval is 0.0/0.0 +remainder(x,0) DOMAIN NAN y EDOM +.TE +.SH 例 +The example program demonstrates the use of \fBmatherr\fP() when calling +\fBlog\fP(3). The program takes up to three command\-line arguments. The first +argument is the floating\-point number to be given to \fBlog\fP(3). If the +optional second argument is provided, then \fB_LIB_VERSION\fP is set to +\fB_SVID_\fP so that \fBmatherr\fP() is called, and the integer supplied in the +command\-line argument is used as the return value from \fBmatherr\fP(). If the +optional third command\-line argument is supplied, then it specifies an +alternative return value that \fBmatherr\fP() should assign as the return +value of the math function. + +The following example run, where \fBlog\fP(3) is given an argument of 0.0, +does not use \fBmatherr\fP(): + +.in +4n +.nf +$\fB ./a.out 0.0\fP +errno: Numerical result out of range +x=\-inf +.fi +.in + +In the following run, \fBmatherr\fP() is called, and returns 0: + +.in +4n +.nf +$\fB ./a.out 0.0 0\fP +matherr SING exception in log() function + args: 0.000000, 0.000000 + retval: \-340282346638528859811704183484516925440.000000 +log: SING error +errno: Numerical argument out of domain +x=\-340282346638528859811704183484516925440.000000 +.fi +.in + +The message "log: SING error" was printed by the C library. + +In the following run, \fBmatherr\fP() is called, and returns a nonzero value: + +.in +4n +.nf +$\fB ./a.out 0.0 1\fP +matherr SING exception in log() function + args: 0.000000, 0.000000 + retval: \-340282346638528859811704183484516925440.000000 +x=\-340282346638528859811704183484516925440.000000 +.fi +.in + +In this case, the C library did not print a message, and \fIerrno\fP was not +set. + +In the following run, \fBmatherr\fP() is called, changes the return value of +the math function, and returns a nonzero value: + +.in +4n +.nf +$\fB ./a.out 0.0 1 12345.0\fP +matherr SING exception in log() function + args: 0.000000, 0.000000 + retval: \-340282346638528859811704183484516925440.000000 +x=12345.000000 +.fi +.in +.SS プログラムのソース +\& +.nf +#define _SVID_SOURCE +#include +#include +#include +#include + +static int matherr_ret = 0; /* Value that matherr() + should return */ +static int change_retval = 0; /* Should matherr() change + function\(aqs return value? */ +static double new_retval; /* New function return value */ + +int +matherr(struct exception *exc) +{ + fprintf(stderr, "matherr %s exception in %s() function\en", + (exc\->type == DOMAIN) ? "DOMAIN" : + (exc\->type == OVERFLOW) ? "OVERFLOW" : + (exc\->type == UNDERFLOW) ? "UNDERFLOW" : + (exc\->type == SING) ? "SING" : + (exc\->type == TLOSS) ? "TLOSS" : + (exc\->type == PLOSS) ? "PLOSS" : "???", + exc\->name); + fprintf(stderr, " args: %f, %f\en", + exc\->arg1, exc\->arg2); + fprintf(stderr, " retval: %f\en", exc\->retval); + + if (change_retval) + exc\->retval = new_retval; + + return matherr_ret; +} + +int +main(int argc, char *argv[]) +{ + double x; + + if (argc < 2) { + fprintf(stderr, "Usage: %s " + " [ []]\en", argv[0]); + exit(EXIT_FAILURE); + } + + if (argc > 2) { + _LIB_VERSION = _SVID_; + matherr_ret = atoi(argv[2]); + } + + if (argc > 3) { + change_retval = 1; + new_retval = atof(argv[3]); + } + + x = log(atof(argv[1])); + if (errno != 0) + perror("errno"); + + printf("x=%f\en", x); + exit(EXIT_SUCCESS); +} +.fi +.SH 関連項目 +\fBfenv\fP(3), \fBmath_error\fP(7), \fBstandards\fP(7) diff --git a/draft/man3/mblen.3 b/draft/man3/mblen.3 index 744f50d3..c9674d61 100644 --- a/draft/man3/mblen.3 +++ b/draft/man3/mblen.3 @@ -11,122 +11,43 @@ .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html .\" ISO/IEC 9899:1999 .\" -.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Tue Jan 11 00:56:22 JST 2000 -.\" by HANATAKA Shinya +.\"******************************************************************* .\" +.\" This file was generated with po4a. Translate the source file. .\" -.TH MBLEN 3 1999-07-25 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH MBLEN 3 1999\-07\-25 GNU "Linux Programmer's Manual" .SH 名前 -.\"O mblen \- determine number of bytes in next multibyte character mblen \- 次のマルチバイト文字のバイト数を返す -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int mblen(const char *" s ", size_t " n ); +\fBint mblen(const char *\fP\fIs\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O If \fIs\fP is not a NULL pointer, the -.\"O .BR mblen () -.\"O function inspects at most -.\"O \fIn\fP bytes of the multibyte string starting at \fIs\fP and extracts the -.\"O next complete multibyte character. -.\"O It uses a static anonymous shift state only -.\"O known to the -.\"O .BR mblen () -.\"O function. -.\"O If the multibyte character is not the null wide -.\"O character, it returns the number of bytes that were consumed from \fIs\fP. -.\"O If the multibyte character is the null wide character, it returns 0. -\fIs\fP が NULL ポインターでなければ、 -.BR mblen () -関数は \fIs\fP から始まる最大 \fIn\fP バイトのマルチバイト文字列を検査して、 -次の完全なマルチバイト文字を取り出す。これには -.BR mblen () -関数のみが使用する静的で名前のないシフト状態が使用される。 -マルチバイト文字がナルワイド文字でなければ \fIs\fP から消費される +\fIs\fP が NULL ポインターでなければ、 \fBmblen\fP() 関数は \fIs\fP から始まる最大 \fIn\fP +バイトのマルチバイト文字列を検査して、 次の完全なマルチバイト文字を取り出す。これには \fBmblen\fP() +関数のみが使用する静的で名前のないシフト状態が使用される。 マルチバイト文字がナルワイド文字でなければ \fIs\fP から消費される バイト数を返す。マルチバイト文字がナルワイド文字ならば 0 を返す。 .PP -.\"O If the \fIn\fP bytes starting at \fIs\fP do not contain a complete multibyte -.\"O character, -.\"O .BR mblen () -.\"O returns \-1. -.\"O This can happen even if -.\"O \fIn\fP is greater than or equal to \fIMB_CUR_MAX\fP, -.\"O if the multibyte string contains redundant shift sequences. -\fIs\fP から始まる \fIn\fP バイトが完全なマルチバイト文字を含んで -いなければ、 -.BR mblen () -は \-1 を返す。マルチバイト文字列 -に冗長なシフトシーケンスが含まれていると、 -\fIn\fP が \fIMB_CUR_MAX\fP 以上の場合にも -このようなことが起こりえる。 +\fIs\fP から始まる \fIn\fP バイトが完全なマルチバイト文字を含んで いなければ、 \fBmblen\fP() は \-1 を返す。マルチバイト文字列 +に冗長なシフトシーケンスが含まれていると、 \fIn\fP が \fIMB_CUR_MAX\fP 以上の場合にも このようなことが起こりえる。 .PP -.\"O If the multibyte string starting at \fIs\fP contains an invalid multibyte -.\"O sequence before the next complete character, -.\"O .BR mblen () -.\"O also returns \-1. -\fIs\fP から始まるマルチバイト文字列が次の完全な文字の前に -不正なマルチバイト列を含んでいる場合にも、 -.BR mblen () -は \-1 を返す。 +\fIs\fP から始まるマルチバイト文字列が次の完全な文字の前に 不正なマルチバイト列を含んでいる場合にも、 \fBmblen\fP() は \-1 を返す。 .PP -.\"O If \fIs\fP is a NULL pointer, the -.\"O .BR mblen () -.\"O function .\" The Dinkumware doc and the Single UNIX specification say this, but .\" glibc doesn't implement this. -.\"O resets the shift state, only known to this function, to the initial state, and -.\"O returns nonzero if the encoding has nontrivial shift state, or zero if the -.\"O encoding is stateless. -\fIs\fP が NULL ポインターならば、 -.BR mblen () -関数はこの関数のみが -使用するシフト状態を初期化状態に戻し、シフト状態を使用した文字符号の場合に -はゼロ以外を、文字符号がシフト状態を持たない場合にはゼロを返す。 -.\"O .SH "RETURN VALUE" +\fIs\fP が NULL ポインターならば、 \fBmblen\fP() 関数はこの関数のみが +使用するシフト状態を初期化状態に戻し、シフト状態を使用した文字符号の場合に はゼロ以外を、文字符号がシフト状態を持たない場合にはゼロを返す。 .SH 返り値 -.\"O The -.\"O .BR mblen () -.\"O function returns the number of -.\"O bytes parsed from the multibyte -.\"O sequence starting at \fIs\fP, if a non-null wide character was recognized. -.\"O It returns 0, if a null wide character was recognized. -.\"O It returns \-1, if an -.\"O invalid multibyte sequence was encountered or if it couldn't parse a complete -.\"O multibyte character. -.BR mblen () -関数は \fIs\fP から始まるマルチバイト列を検査して -ナルワイド文字以外を確認した場合にはそのバイト数を返す。 -ナルワイド文字を確認した場合にはゼロを返す。不正なマルチバイト列に -遭遇した場合や完全なマルチバイト文字を解析できなかった場合には \-1 を返す。 -.\"O .SH "CONFORMING TO" +\fBmblen\fP() 関数は \fIs\fP から始まるマルチバイト列を検査して ナルワイド文字以外を確認した場合にはそのバイト数を返す。 +ナルワイド文字を確認した場合にはゼロを返す。不正なマルチバイト列に 遭遇した場合や完全なマルチバイト文字を解析できなかった場合には \-1 を返す。 .SH 準拠 C99. -.\"O .SH NOTES .SH 注意 -.\"O The behavior of -.\"O .BR mblen () -.\"O depends on the -.\"O .B LC_CTYPE -.\"O category of the -.\"O \"O current locale. -.BR mblen () -の動作は現在のロケールの -.B LC_CTYPE -カテゴリに依存している。 +\fBmblen\fP() の動作は現在のロケールの \fBLC_CTYPE\fP カテゴリに依存している。 .PP -.\"O The function -.\"O .BR mbrlen (3) -.\"O provides a better interface to the same -.\"O functionality. -.BR mbrlen (3) -関数は同じ機能のより良いインタフェースを提供する。 -.\"O .SH "SEE ALSO" +\fBmbrlen\fP(3) 関数は同じ機能のより良いインタフェースを提供する。 .SH 関連項目 -.BR mbrlen (3) +\fBmbrlen\fP(3) diff --git a/draft/man3/mbstowcs.3 b/draft/man3/mbstowcs.3 index 08d3ad6c..4a815531 100644 --- a/draft/man3/mbstowcs.3 +++ b/draft/man3/mbstowcs.3 @@ -11,121 +11,47 @@ .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html .\" ISO/IEC 9899:1999 .\" -.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Tue Jan 11 00:56:04 JST 2000 -.\" by HANATAKA Shinya +.\"******************************************************************* .\" -.TH MBSTOWCS 3 2011-09-28 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH MBSTOWCS 3 2011\-09\-28 GNU "Linux Programmer's Manual" .SH 名前 -.\"O mbstowcs \- convert a multibyte string to a wide-character string mbstowcs \- マルチバイト文字列をワイド文字列に変換する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "size_t mbstowcs(wchar_t *" dest ", const char *" src ", size_t " n ); +\fBsize_t mbstowcs(wchar_t *\fP\fIdest\fP\fB, const char *\fP\fIsrc\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O If \fIdest\fP is not a NULL pointer, the -.\"O .BR mbstowcs () -.\"O function converts the -.\"O multibyte string \fIsrc\fP to a wide-character string starting at \fIdest\fP. -.\"O At most \fIn\fP wide characters are written to \fIdest\fP. -.\"O The conversion starts -.\"O in the initial state. -.\"O The conversion can stop for three reasons: -\fIdest\fP が NULL ポインターでなければ -.BR mbstowcs () -関数は -マルチバイト文字列 \fI*src\fP を \fIdest\fP から始まるワイド文字列に -変換する。\fIdest\fP には最大で \fIn\fP 文字のワイド文字が -書き込まれる。変換は初期状態で開始され、 +\fIdest\fP が NULL ポインターでなければ \fBmbstowcs\fP() 関数は マルチバイト文字列 \fI*src\fP を \fIdest\fP +から始まるワイド文字列に 変換する。\fIdest\fP には最大で \fIn\fP 文字のワイド文字が 書き込まれる。変換は初期状態で開始され、 以下の三つのいずれかの条件で停止する: .IP 1. 3 -.\"O An invalid multibyte sequence has been encountered. -.\"O In this case -.\"O .I (size_t)\ \-1 -.\"O is returned. -不正なマルチバイト列に遭遇した。この場合には -.I (size_t)\ \-1 -を返す。 +不正なマルチバイト列に遭遇した。この場合には \fI(size_t)\ \-1\fP を返す。 .IP 2. -.\"O \fIn\fP non-L\(aq\\0\(aq wide characters have been stored at \fIdest\fP. -.\"O In this -.\"O case the number of wide characters written to \fIdest\fP is returned, but the -.\"O shift state at this point is lost. -\fIn\fP 文字の L\(aq\\0\(aq 以外のワイド文字を \fIdest\fP に格納した場合。 -この場合は \fI*src\fP が次に変換されるマルチバイト列を指すようにして、 -\fIdest\fP に書き込まれたワイド文字の数を返す。しかしこの指している -場所のシフト状態は失われる。 +\fIn\fP 文字の L\(aq\e0\(aq 以外のワイド文字を \fIdest\fP に格納した場合。 この場合は \fI*src\fP +が次に変換されるマルチバイト列を指すようにして、 \fIdest\fP に書き込まれたワイド文字の数を返す。しかしこの指している 場所のシフト状態は失われる。 .IP 3. -.\"O The multibyte string has been completely converted, including the -.\"O terminating null wide character (\(aq\\0\(aq). -.\"O In this case the number of wide characters written to -.\"O \fIdest\fP, excluding the terminating null wide character, is returned. -マルチバイト文字列が終端の NULL ワイド文字 (\(aq\\0\(aq) まで含めて完全に -変換された場合。この場合は終端の NULL ワイド文字を除いて -\fIdest\fP に書き込まれた文字数を返す。 +マルチバイト文字列が終端の NULL ワイド文字 (\(aq\e0\(aq) まで含めて完全に 変換された場合。この場合は終端の NULL +ワイド文字を除いて \fIdest\fP に書き込まれた文字数を返す。 .PP -.\"O The programmer must ensure that there is room for at least \fIn\fP wide -.\"O characters at \fIdest\fP. -プログラマーは \fIdest\fP に最低でも \fIn\fP ワイド文字を書き込むこ -とができる空間があることを保証しなければならない。 +プログラマーは \fIdest\fP に最低でも \fIn\fP ワイド文字を書き込むこ とができる空間があることを保証しなければならない。 .PP -.\"O If \fIdest\fP is NULL, \fIn\fP is ignored, and the conversion proceeds as -.\"O above, except that the converted wide characters are not written out to memory, -.\"O and that no length limit exists. -\fIdest\fP が NULL の場合、\fIn\fP は無視され、上記と同様の変換が -行われるが、変換されたワイド文字はメモリに書き込まれず、変換先の上限 +\fIdest\fP が NULL の場合、\fIn\fP は無視され、上記と同様の変換が 行われるが、変換されたワイド文字はメモリに書き込まれず、変換先の上限 が存在しない。 .PP -.\"O In order to avoid the case 2 above, the programmer should make sure \fIn\fP is -.\"O greater or equal to \fImbstowcs(NULL,src,0)+1\fP. -上記の 2. の場合を避けるためにプログラマーは \fIn\fP が -\fImbstowcs(NULL,src,0)+1\fP 以上であることを保証すべきである。 -.\"O .SH "RETURN VALUE" +上記の 2. の場合を避けるためにプログラマーは \fIn\fP が \fImbstowcs(NULL,src,0)+1\fP 以上であることを保証すべきである。 .SH 返り値 -.\"O The -.\"O .BR mbstowcs () -.\"O function returns the number of wide characters that make -.\"O up the converted part of the wide-character string, not including the -.\"O terminating null wide character. -.\"O If an invalid multibyte sequence was -.\"O encountered, -.\"O .I (size_t)\ \-1 -.\"O is returned. -.BR mbstowcs () -関数はワイド文字列に変換完了したワイド文字の数を返す。 -終端のナルワイド文字は含まない。不正なマルチバイト列に遭遇した場合には -.I (size_t)\ \-1 -を返す。 -.\"O .SH "CONFORMING TO" +\fBmbstowcs\fP() 関数はワイド文字列に変換完了したワイド文字の数を返す。 +終端のナルワイド文字は含まない。不正なマルチバイト列に遭遇した場合には \fI(size_t)\ \-1\fP を返す。 .SH 準拠 C99. -.\"O .SH NOTES .SH 注意 -.\"O The behavior of -.\"O .BR mbstowcs () -.\"O depends on the -.\"O .B LC_CTYPE -.\"O category of the -.\"O current locale. -.BR mbstowcs () -の動作は現在のロケールの -.B LC_CTYPE -カテゴリに依存している。 +\fBmbstowcs\fP() の動作は現在のロケールの \fBLC_CTYPE\fP カテゴリに依存している。 .PP -.\"O The function -.\"O .BR mbsrtowcs (3) -.\"O provides a better interface to the same -.\"O functionality. -.BR mbsrtowcs (3) -関数は同じ機能のより良いインターフェースを提供する。 -.\"O .SH "SEE ALSO" +\fBmbsrtowcs\fP(3) 関数は同じ機能のより良いインターフェースを提供する。 .SH 関連項目 -.BR mbsrtowcs (3), -.BR wcstombs(3) +\fBmbsrtowcs\fP(3), \fBwcstombs(3)\fP diff --git a/draft/man3/mbtowc.3 b/draft/man3/mbtowc.3 index a35dbc65..aa55ace7 100644 --- a/draft/man3/mbtowc.3 +++ b/draft/man3/mbtowc.3 @@ -11,140 +11,47 @@ .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html .\" ISO/IEC 9899:1999 .\" -.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Tue Jan 11 00:56:02 JST 2000 -.\" by HANATAKA Shinya +.\"******************************************************************* .\" -.TH MBTOWC 3 2011-09-28 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH MBTOWC 3 2011\-09\-28 GNU "Linux Programmer's Manual" .SH 名前 -.\"O mbtowc \- convert a multibyte sequence to a wide character mbtowc \- マルチバイト列をワイド文字に変換する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int mbtowc(wchar_t *" pwc ", const char *" s ", size_t " n ); +\fBint mbtowc(wchar_t *\fP\fIpwc\fP\fB, const char *\fP\fIs\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The main case for this function is when \fIs\fP is not NULL and \fIpwc\fP is -.\"O not NULL. -.\"O In this case, the -.\"O .BR mbtowc () -.\"O function inspects at most \fIn\fP -.\"O bytes of the multibyte string starting at \fIs\fP, -.\"O extracts the next complete -.\"O multibyte character, converts it to a wide character and stores it at -.\"O \fI*pwc\fP. -.\"O It updates an internal shift state only known to the mbtowc -.\"O function. -.\"O If \fIs\fP does not point to a null byte (\(aq\\0\(aq), it returns the number -.\"O of bytes that were consumed from \fIs\fP, otherwise it returns 0. -この関数が用いられる場合、通常 \fIs\fP が NULL でなく \fIpwc\fP も NULL -でない。この場合は -.BR mbtowc () -関数は \fIs\fP から始まる -最大 \fIn\fP バイトのマルチバイト文字列を検査して、次の完全なマルチバイト -文字を取り出し、それをワイド文字に変換して \fI*pwc\fP に格納する。 -同時に mbtowc 関数のみが使用する内部状態を更新する。\fIs\fP が NULL バイト -(\(aq\\0\(aq) 以外を指している場合は、\fIs\fP から消費するバイト数を返す。 -\fIs\fP が NULL バイトを指している場合には 0 を返す。 +この関数が用いられる場合、通常 \fIs\fP が NULL でなく \fIpwc\fP も NULL でない。この場合は \fBmbtowc\fP() 関数は +\fIs\fP から始まる 最大 \fIn\fP バイトのマルチバイト文字列を検査して、次の完全なマルチバイト 文字を取り出し、それをワイド文字に変換して +\fI*pwc\fP に格納する。 同時に mbtowc 関数のみが使用する内部状態を更新する。\fIs\fP が NULL バイト (\(aq\e0\(aq) +以外を指している場合は、\fIs\fP から消費するバイト数を返す。 \fIs\fP が NULL バイトを指している場合には 0 を返す。 .PP -.\"O If the \fIn\fP bytes starting at \fIs\fP do not contain a complete multibyte -.\"O character, or if they contain an invalid multibyte sequence, -.\"O .BR mbtowc () -.\"O returns \-1. -.\"O This can happen even if \fIn\fP >= \fIMB_CUR_MAX\fP, -.\"O if the multibyte string contains redundant shift sequences. -\fIs\fP から始まる \fIn\fP バイトが完全なマルチバイト文字を含んで -いない場合や不正なマルチバイト列を含んでいる場合には -.BR mbtowc () -は -\-1 を返す。マルチバイト文字列に冗長なシフトシーケンスが -含まれていると \fIn\fP >= \fIMB_CUR_MAX\fP の場合もこのようなことが -起こりえる。 +\fIs\fP から始まる \fIn\fP バイトが完全なマルチバイト文字を含んで いない場合や不正なマルチバイト列を含んでいる場合には \fBmbtowc\fP() +は \-1 を返す。マルチバイト文字列に冗長なシフトシーケンスが 含まれていると \fIn\fP >= \fIMB_CUR_MAX\fP +の場合もこのようなことが 起こりえる。 .PP -.\"O A different case is when \fIs\fP is not NULL but \fIpwc\fP is NULL. -.\"O In this -.\"O case the -.\"O .BR mbtowc () -.\"O function behaves as above, except that it does not -.\"O store the converted wide character in memory. -\fIs\fP が NULL でなく \fIpwc\fP が NULL の場合は -.BR mbtowc () -関数は +\fIs\fP が NULL でなく \fIpwc\fP が NULL の場合は \fBmbtowc\fP() 関数は 上記と同様に動作するが、変換したワイド文字はメモリには書き込まれない。 .PP -.\"O A third case is when \fIs\fP is NULL. -.\"O In this case, \fIpwc\fP and \fIn\fP are -.\"O ignored. -.\"O The -.\"O .BR mbtowc () -.\"O function .\" The Dinkumware doc and the Single UNIX specification say this, but .\" glibc doesn't implement this. -.\"O resets the shift state, only known to this function, -.\"O to the initial state, and -.\"O returns nonzero if the encoding has nontrivial shift state, or zero if the -.\"O encoding is stateless. -三番目の場合として \fIs\fP が NULL の場合は \fIpwc\fP と \fIn\fP は -無視される。 -.BR mbtowc () -関数のみが使用するシフト状態は初期状態に -戻される。そして文字符号がシフト状態に依存するならばゼロ以外を、文字符号が -状態によらないならばゼロを返す。 -.\"O .SH "RETURN VALUE" +三番目の場合として \fIs\fP が NULL の場合は \fIpwc\fP と \fIn\fP は 無視される。 \fBmbtowc\fP() +関数のみが使用するシフト状態は初期状態に 戻される。そして文字符号がシフト状態に依存するならばゼロ以外を、文字符号が 状態によらないならばゼロを返す。 .SH 返り値 -.\"O If \fIs\fP is not NULL, the -.\"O .BR mbtowc () -.\"O function returns the number of -.\"O consumed bytes starting at \fIs\fP, or 0 if \fIs\fP points to a null byte, -.\"O or \-1 upon failure. -\fIs\fP が NULL でなければ -.BR mbtowc () -関数は \fIs\fP から消費した -バイト数を、\fIs\fP がナル文字を指している場合はゼロを、 +\fIs\fP が NULL でなければ \fBmbtowc\fP() 関数は \fIs\fP から消費した バイト数を、\fIs\fP がナル文字を指している場合はゼロを、 変換に失敗した場合は \-1 を返す。 .PP -.\"O If \fIs\fP is NULL, the -.\"O .BR mbtowc () -.\"O function -.\"O returns nonzero if the encoding -.\"O has nontrivial shift state, or zero if the encoding is stateless. -\fIs\fP が NULL ならば -.BR mbtowc () -関数は文字符号がシフト状態に依存 -していればゼロ以外を、状態によらなければゼロを返す。 -.\"O .SH "CONFORMING TO" +\fIs\fP が NULL ならば \fBmbtowc\fP() 関数は文字符号がシフト状態に依存 していればゼロ以外を、状態によらなければゼロを返す。 .SH 準拠 C99. -.\"O .SH NOTES .SH 注意 -.\"O The behavior of -.\"O .BR mbtowc () -.\"O depends on the -.\"O .B LC_CTYPE -.\"O category of the -.\"O current locale. -.BR mbtowc () -の動作は現在のロケールの -.B LC_CTYPE -カテゴリに依存している。 +\fBmbtowc\fP() の動作は現在のロケールの \fBLC_CTYPE\fP カテゴリに依存している。 .PP -.\"O This function is not multithread safe. -.\"O The function -.\"O .BR mbrtowc (3) -.\"O provides -.\"O a better interface to the same functionality. -この関数はマルチスレッドでは安全ではない。 -.BR mbrtowc (3) -関数は -同じ機能のより良いインターフェースを提供する。 -.\"O .SH "SEE ALSO" +この関数はマルチスレッドでは安全ではない。 \fBmbrtowc\fP(3) 関数は 同じ機能のより良いインターフェースを提供する。 .SH 関連項目 -.BR MB_CUR_MAX (3), -.BR mbrtowc (3), -.BR mbstowcs (3) +\fBMB_CUR_MAX\fP(3), \fBmbrtowc\fP(3), \fBmbstowcs\fP(3) diff --git a/draft/man3/memccpy.3 b/draft/man3/memccpy.3 index 26073fa7..42646630 100644 --- a/draft/man3/memccpy.3 +++ b/draft/man3/memccpy.3 @@ -25,57 +25,29 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 18:57:24 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 Ueyama Rui -.\" all rights reserved. -.\" Translated Tue Feb 21 0:48:30 JST 1997 -.\" by Ueyama Rui -.TH MEMCCPY 3 1993-04-10 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH MEMCCPY 3 1993\-04\-10 GNU "Linux Programmer's Manual" .SH 名前 -.\"O memccpy \- copy memory area memccpy \- メモリ領域をコピーする -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "void *memccpy(void *" dest ", const void *" src ", int " c ", size_t " n ); +\fBvoid *memccpy(void *\fP\fIdest\fP\fB, const void *\fP\fIsrc\fP\fB, int \fP\fIc\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR memccpy () -.\"O function copies no more than \fIn\fP bytes from -.\"O memory area \fIsrc\fP to memory area \fIdest\fP, stopping when the -.\"O character \fIc\fP is found. -.BR memccpy () -は、メモリ領域 \fIsrc\fP からメモリ領域 \fIdest\fP に -最大で \fIn\fP バイトのコピーを行う。 -\fIn\fP バイトコピーする前に文字 \fIc\fP が見つかると、 -そこでコピーを中止する。 +\fBmemccpy\fP() は、メモリ領域 \fIsrc\fP からメモリ領域 \fIdest\fP に 最大で \fIn\fP バイトのコピーを行う。 \fIn\fP +バイトコピーする前に文字 \fIc\fP が見つかると、 そこでコピーを中止する。 -.\"O If the memory areas overlap, the results are undefined. -コピー元とコピー先のメモリ領域が重なっている場合、 -結果は不定である。 -.\"O .SH "RETURN VALUE" +コピー元とコピー先のメモリ領域が重なっている場合、 結果は不定である。 .SH 返り値 -.\"O The -.\"O .BR memccpy () -.\"O function returns a pointer to the next character -.\"O in \fIdest\fP after \fIc\fP, or NULL if \fIc\fP was not found in the -.\"O first \fIn\fP characters of \fIsrc\fP. -.BR memccpy () -は、\fIdest\fP 中に見つかった \fIc\fP の -次にあるキャラクター型の変数を指すポインタを返す。 +\fBmemccpy\fP() は、\fIdest\fP 中に見つかった \fIc\fP の 次にあるキャラクター型の変数を指すポインタを返す。 見つからなかった場合、NULL を返す。 -.\"O .SH "CONFORMING TO" .SH 準拠 -SVr4, 4.3BSD, POSIX.1-2001. -.\"O .SH "SEE ALSO" +SVr4, 4.3BSD, POSIX.1\-2001. .SH 関連項目 -.BR bcopy (3), -.BR memcpy (3), -.BR memmove (3), -.BR strcpy (3), -.BR strncpy (3) +\fBbcopy\fP(3), \fBmemcpy\fP(3), \fBmemmove\fP(3), \fBstrcpy\fP(3), \fBstrncpy\fP(3) diff --git a/draft/man3/memchr.3 b/draft/man3/memchr.3 index b50d32e4..b25ad22f 100644 --- a/draft/man3/memchr.3 +++ b/draft/man3/memchr.3 @@ -27,187 +27,65 @@ .\" Modified Wed Feb 20 21:09:36 2002, Ian Redfern (redferni@logica.com) .\" 2008-07-09, mtk, add rawmemchr() .\" -.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka -.\" all rights reserved. -.\" Translated 1997-12-16, HIROFUMI Nishizuka -.\" Updated & Modified 2002-03-24, Yuichi SATO -.\" Updated & Modified 2003-11-27, Yuichi SATO -.\" Updated 2008-08-11, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH MEMCHR 3 2009-12-04 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH MEMCHR 3 2012\-04\-16 "" "Linux Programmer's Manual" .SH 名前 -.\"O memchr, memrchr, rawmemchr \- scan memory for a character memchr, memrchr, rawmemchr \- 文字を探すためにメモリをスキャンする -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP -.BI "void *memchr(const void *" s ", int " c ", size_t " n ); +\fBvoid *memchr(const void *\fP\fIs\fP\fB, int \fP\fIc\fP\fB, size_t \fP\fIn\fP\fB);\fP -.BI "void *memrchr(const void *" s ", int " c ", size_t " n ); +\fBvoid *memrchr(const void *\fP\fIs\fP\fB, int \fP\fIc\fP\fB, size_t \fP\fIn\fP\fB);\fP -.BI "void *rawmemchr(const void *" s ", int " c ); +\fBvoid *rawmemchr(const void *\fP\fIs\fP\fB, int \fP\fIc\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR memrchr (): -.BR rawmemchr (): -_GNU_SOURCE -.\"O .SH DESCRIPTION +\fBmemrchr\fP(): \fBrawmemchr\fP(): _GNU_SOURCE .SH 説明 -.\"O The -.\"O .BR memchr () -.\"O function scans the first \fIn\fP bytes of the memory -.\"O area pointed to by \fIs\fP for the character \fIc\fP. -.\"O The first byte to -.\"O match \fIc\fP (interpreted as an unsigned character) stops the operation. -.BR memchr () -関数は、ポインタ \fIs\fP が指し示すメモリブロックの -先頭の \fIn\fP バイトから文字 \fIc\fP を探す。 -最初に \fIc\fP (unsigned char と解釈される) が見つかった時点で動作が停止する。 +\fBmemchr\fP() 関数は、ポインタ \fIs\fP が指し示すメモリブロックの 先頭の \fIn\fP バイトから文字 \fIc\fP を探す。 最初に \fIc\fP +(unsigned char と解釈される) が見つかった時点で動作が停止する。 .PP -.\"O The -.\"O .BR memrchr () -.\"O function is like the -.\"O .BR memchr () -.\"O function, -.\"O except that it searches backward from the end of the \fIn\fP bytes -.\"O pointed to by \fIs\fP instead of forward from the beginning. -.BR memrchr () -関数は -.BR memchr () -関数に似ているが、 -先頭から順方向に探すのではなく、 -ポインタ \fIs\fP が指し示す \fIn\fP バイトのメモリブロックの -末尾から逆向きに探す。 +\fBmemrchr\fP() 関数は \fBmemchr\fP() 関数に似ているが、 先頭から順方向に探すのではなく、 ポインタ \fIs\fP が指し示す +\fIn\fP バイトのメモリブロックの 末尾から逆向きに探す。 -.\"O The -.\"O .BR rawmemchr () -.\"O function is similar to -.\"O .BR memchr (): -.\"O it assumes (i.e., the programmer knows for certain) -.\"O that the character -.\"O .I c -.\"O lies somewhere in the string -.\"O .IR s , -.\"O and so performs an optimized search -.\"O for the character -.\"O .IR c -.\"O (i.e., no checking for the terminating null byte, or use of an argument, -.\"O .IR n , -.\"O to limit the range of the search). -.BR rawmemchr () -関数は -.BR memchr () -と同様だが、 -文字 -.I c -が文字列 -.I s -内のどこかにあることを前提にして -(つまり、プログラマはそのことを知っている)、 -最適化した方法で文字 -.I c -の検索を実行する -(すなわち、終端の NULL バイトのチェックも行われないし、 -検索範囲の上限を示す引き数 -.I n -も使用されない)。 -.\"O If the character -.\"O .I c -.\"O is not in the string -.\"O .IR s , -.\"O then -.\"O .BR rawmemchr () -.\"O may proceed to search beyond the end of the string, -.\"O and the result is unspecified. -文字 -.I c -が文字列 -.I s -内にない場合、 -.BR rawmemchr () +\fBrawmemchr\fP() 関数は \fBmemchr\fP() と同様だが、文字 \fIc\fP が文字列 \fIs\fP 内の +どこかにあることを前提にして (つまり、プログラマはそのことを知っている)、 +最適化した方法で文字 \fIc\fP の検索を実行する (すなわち、検索範囲の上限を示す +引き数も使用されない)。文字 \fIc\fP が文字列 \fIs\fP 内にない場合、 \fBrawmemchr\fP() は文字列末尾を越えて検索を実行するかもしれず、結果は不定である。 -.\"O The following call is a fast means of locating a string's -.\"O terminating null byte: -次に示す呼び出しは、文字列終端の NULL バイトの位置を特定する -高速な手段である。 +次に示す呼び出しは、文字列終端のNULL バイトの位置を特定する 高速な手段である。 .in +4n .nf -char *p = rawmemchr(s,\ \(aq\\0\(aq); +char *p = rawmemchr(s,\ \(aq\e0\(aq); .fi .in -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O The -.\"O .BR memchr () -.\"O and -.\"O .BR memrchr () -.\"O functions return a pointer -.\"O to the matching byte or NULL if the character does not occur in -.\"O the given memory area. -.BR memchr () -関数と -.BR memrchr () -関数は一致する文字へのポインタを返し、 -もし文字が指定メモリ領域に現れない場合は NULL を返す。 +\fBmemchr\fP() 関数と \fBmemrchr\fP() 関数は一致する文字へのポインタを返し、 もし文字が指定メモリ領域に現れない場合は NULL +を返す。 -.\"O The -.\"O .BR rawmemchr () -.\"O function returns a pointer to the matching byte, if one is found. -.\"O If no matching byte is found, the result is unspecified. -.BR rawmemchr () -関数はマッチするバイトが見つかった場合はマッチしたバイトへのポインタを返す。 +\fBrawmemchr\fP() 関数はマッチするバイトが見つかった場合はマッチしたバイトへのポインタを返す。 マッチするバイトが見つからなかった場合、結果は不定である。 -.\"O .SH VERSIONS .SH バージョン -.\"O .BR rawmemchr () -.\"O first appeared in glibc in version 2.1. -.BR rawmemchr () -は glibc バージョン 2.1 で初めて登場した。 +\fBrawmemchr\fP() は glibc バージョン 2.1 で初めて登場した。 -.\"O .BR memrchr () -.\"O first appeared in glibc in version 2.2. -.BR memrchr () -は glibc バージョン 2.2 で初めて登場した。 -.\"O .SH "CONFORMING TO" +\fBmemrchr\fP() は glibc バージョン 2.2 で初めて登場した。 .SH 準拠 -.\"O The -.\"O .BR memchr () -.\"O function conforms to SVr4, 4.3BSD, C89, C99, POSIX.1-2001. -.BR memchr () -関数は SVr4, 4.3BSD, C89, C99, POSIX.1-2001 に準拠する。 +\fBmemchr\fP() 関数は SVr4, 4.3BSD, C89, C99, POSIX.1\-2001 に準拠する。 -.\"O The -.\"O .BR memrchr () -.\"O function is a GNU extension, available since glibc 2.1.91. -.BR memrchr () -関数は GNU 拡張であり、glibc 2.1.91 から使用可能である。 +\fBmemrchr\fP() 関数は GNU 拡張であり、glibc 2.1.91 から使用可能である。 -.\"O The -.\"O .BR rawmemchr () -.\"O function is a GNU extension, available since glibc 2.1. -.BR rawmemchr () -関数は GNU 拡張であり、glibc 2.1 から使用可能である。 -.\"O .SH "SEE ALSO" +\fBrawmemchr\fP() 関数は GNU 拡張であり、glibc 2.1 から使用可能である。 .SH 関連項目 -.BR ffs (3), -.BR index (3), -.BR rindex (3), -.BR strchr (3), -.BR strpbrk (3), -.BR strrchr (3), -.BR strsep (3), -.BR strspn (3), -.BR strstr (3), -.BR wmemchr (3) +\fBffs\fP(3), \fBindex\fP(3), \fBrindex\fP(3), \fBstrchr\fP(3), \fBstrpbrk\fP(3), +\fBstrrchr\fP(3), \fBstrsep\fP(3), \fBstrspn\fP(3), \fBstrstr\fP(3), \fBwmemchr\fP(3) diff --git a/draft/man3/memcmp.3 b/draft/man3/memcmp.3 index e4193982..9465981d 100644 --- a/draft/man3/memcmp.3 +++ b/draft/man3/memcmp.3 @@ -25,63 +25,28 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 18:55:27 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka -.\" all rights reserved. -.\" Translated Wed Dec 17 12:12:15 JST 1997 -.\" by HIROFUMI Nishizuka +.\" This file was generated with po4a. Translate the source file. .\" -.TH MEMCMP 3 2011-09-14 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH MEMCMP 3 2011\-09\-14 "" "Linux Programmer's Manual" .SH 名前 -.\"O memcmp \- compare memory areas memcmp \- メモリ領域を比較する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int memcmp(const void *" s1 ", const void *" s2 ", size_t " n ); +\fBint memcmp(const void *\fP\fIs1\fP\fB, const void *\fP\fIs2\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR memcmp () -.\"O function compares the first \fIn\fP bytes (each interpreted as -.\"O .IR "unsigned char" ) -.\"O of the memory areas \fIs1\fP and \fIs2\fP. -.\"O It returns an integer less than, -.\"O equal to, or greater than zero if \fIs1\fP is found, respectively, to -.\"O be less than, to match, or be greater than \fIs2\fP. -.BR memcmp () -関数は、メモリ領域 \fIs1\fP と\fIs2\fP の最初の \fIn\fP -バイトを比較する (各バイトは -.I "unsigned char" -として解釈される)。 -\fIs1\fP が \fIs2\fP より小さいか、同じか、あるいは大きいかによって -それぞれ、負の整数、0、正の整数を返す。 -.\"O .SH "RETURN VALUE" +\fBmemcmp\fP() 関数は、メモリ領域 \fIs1\fP と\fIs2\fP の最初の \fIn\fP バイトを比較する (各バイトは \fIunsigned +char\fP として解釈される)。 \fIs1\fP が \fIs2\fP より小さいか、同じか、あるいは大きいかによって それぞれ、負の整数、0、正の整数を返す。 .SH 返り値 -.\"O The -.\"O .BR memcmp () -.\"O function returns an integer less than, equal to, or -.\"O greater than zero if the first \fIn\fP bytes of \fIs1\fP is found, -.\"O respectively, to be less than, to match, or be greater than the first -.\"O \fIn\fP bytes of \fIs2\fP. -.BR memcmp () -関数は、\fIs1\fP の最初の \fIn\fP バイトが -\fIs2\fP の最初の \fIn\fP バイトよりも -小さいか、同じか、あるいは大きいかによってそれぞれ、負の整数、0、 -正の整数を返す。 -.\"O .SH "CONFORMING TO" +\fBmemcmp\fP() 関数は、\fIs1\fP の最初の \fIn\fP バイトが \fIs2\fP の最初の \fIn\fP バイトよりも +小さいか、同じか、あるいは大きいかによってそれぞれ、負の整数、0、 正の整数を返す。 .SH 準拠 -SVr4, 4.3BSD, C89, C99, POSIX.1-2001. -.\"O .SH "SEE ALSO" +SVr4, 4.3BSD, C89, C99, POSIX.1\-2001. .SH 関連項目 -.BR bcmp (3), -.BR strcasecmp (3), -.BR strcmp (3), -.BR strcoll (3), -.BR strncasecmp (3), -.BR strncmp (3), -.BR wmemcmp (3) +\fBbcmp\fP(3), \fBstrcasecmp\fP(3), \fBstrcmp\fP(3), \fBstrcoll\fP(3), +\fBstrncasecmp\fP(3), \fBstrncmp\fP(3), \fBwmemcmp\fP(3) diff --git a/draft/man3/memcpy.3 b/draft/man3/memcpy.3 index 220ec6f0..0e1e14f0 100644 --- a/draft/man3/memcpy.3 +++ b/draft/man3/memcpy.3 @@ -25,56 +25,27 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sun Jul 25 10:41:09 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 Ueyama Rui -.\" all rights reserved. -.\" Translated Tue Feb 21 0:49:30 JST 1997 -.\" by Ueyama Rui +.\" This file was generated with po4a. Translate the source file. .\" -.TH MEMCPY 3 2010-11-15 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH MEMCPY 3 2010\-11\-15 "" "Linux Programmer's Manual" .SH 名前 -.\"O memcpy \- copy memory area memcpy \- メモリ領域をコピーする。 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "void *memcpy(void *" dest ", const void *" src ", size_t " n ); +\fBvoid *memcpy(void *\fP\fIdest\fP\fB, const void *\fP\fIsrc\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR memcpy () -.\"O function copies \fIn\fP bytes from memory area -.\"O \fIsrc\fP to memory area \fIdest\fP. -.\"O The memory areas must not overlap. -.\"O Use -.\"O .BR memmove (3) -.\"O if the memory areas do overlap. -.BR memcpy () -はメモリ領域 \fIsrc\fP の先頭 \fPn\fP バイトを -メモリ領域 \fIdest\fP にコピーする。コピー元の領域と -コピー先の領域が重なってはならない。重なっている場合は -.BR memmove (3) -を使うこと。 -.\"O .SH "RETURN VALUE" +\fBmemcpy\fP() はメモリ領域 \fIsrc\fP の先頭 \fIn\fP バイトを メモリ領域 \fIdest\fP にコピーする。コピー元の領域と +コピー先の領域が重なってはならない。重なっている場合は \fBmemmove\fP(3) を使うこと。 .SH 返り値 -.\"O The -.\"O .BR memcpy () -.\"O function returns a pointer to \fIdest\fP. -.BR memcpy () -は \fIdest\fP へのポインタを返す。 -.\"O .SH "CONFORMING TO" +\fBmemcpy\fP() は \fIdest\fP へのポインタを返す。 .SH 準拠 -SVr4, 4.3BSD, C89, C99, POSIX.1-2001. -.\"O .SH "SEE ALSO" +SVr4, 4.3BSD, C89, C99, POSIX.1\-2001. .SH 関連項目 -.BR bcopy (3), -.BR memccpy (3), -.BR memmove (3), -.BR mempcpy (3), -.BR strcpy (3), -.BR strncpy (3), -.BR wmemcpy (3) +\fBbcopy\fP(3), \fBmemccpy\fP(3), \fBmemmove\fP(3), \fBmempcpy\fP(3), \fBstrcpy\fP(3), +\fBstrncpy\fP(3), \fBwmemcpy\fP(3) diff --git a/draft/man3/memfrob.3 b/draft/man3/memfrob.3 index e732a490..f9319b33 100644 --- a/draft/man3/memfrob.3 +++ b/draft/man3/memfrob.3 @@ -25,65 +25,31 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 18:54:45 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1998 -.\" ISHIKAWA Mutsumi, all rights reserved. -.\" Translated Sat May 23 15:22:35 JST 1998 -.\" by ISHIKAWA Mutsumi +.\" This file was generated with po4a. Translate the source file. .\" -.TH MEMFROB 3 2010-09-10 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O memfrob \- frobnicate (encrypt) a memory area +.\"******************************************************************* +.TH MEMFROB 3 2010\-09\-10 GNU "Linux Programmer's Manual" .SH 名前 memfrob \- メモリエリアの操作 (暗号化) -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" -.B #include +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP .sp -.BI "void *memfrob(void *" s ", size_t " n ); +\fBvoid *memfrob(void *\fP\fIs\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR memfrob () -.\"O function encrypts the first \fIn\fP bytes of the -.\"O memory area \fIs\fP by exclusive-ORing each character with the number -.\"O 42. -.\"O The effect can be reversed by using -.\"O .BR memfrob () -.\"O on the -.\"O encrypted memory area. -.BR memfrob () -関数は、メモリエリア \fIs\fP の最初の \fIn\fP バイトの -それぞれの文字を 42 との排他的論理をとることによって暗号化する。 -変換後のデータは、暗号化されているメモリエリアに (再度) -.BR memfrob () +\fBmemfrob\fP() 関数は、メモリエリア \fIs\fP の最初の \fIn\fP バイトの それぞれの文字を 42 +との排他的論理をとることによって暗号化する。 変換後のデータは、暗号化されているメモリエリアに (再度) \fBmemfrob\fP() 関数を施すことで、元に戻すことができる。 .PP -.\"O Note that this function is not a proper encryption routine as the XOR -.\"O constant is fixed, and is only suitable for hiding strings. -この関数は妥当な暗号化ルーチンであるとは言えないことに注意して欲しい。 -XOR をとる定数を固定しているので、せいぜい、文字列を隠す程度の用法にし +この関数は妥当な暗号化ルーチンであるとは言えないことに注意して欲しい。 XOR をとる定数を固定しているので、せいぜい、文字列を隠す程度の用法にし か向いていない。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O The -.\"O .BR memfrob () -.\"O function returns a pointer to the encrypted memory -.\"O area. -.BR memfrob () -関数は、暗号化されたメモリエリアへのポインタを返す。 -.\"O .SH "CONFORMING TO" +\fBmemfrob\fP() 関数は、暗号化されたメモリエリアへのポインタを返す。 .SH 準拠 -.\"O The -.\"O .BR memfrob () -.\"O function is unique to the -.\"O GNU C Library. -.BR memfrob () -関数は GNU C ライブラリに固有である。 -.\"O .SH "SEE ALSO" +\fBmemfrob\fP() 関数は GNU C ライブラリに固有である。 .SH 関連項目 -.BR strfry (3) +\fBstrfry\fP(3) diff --git a/draft/man3/memmem.3 b/draft/man3/memmem.3 index 8a831fd9..30b5ba45 100644 --- a/draft/man3/memmem.3 +++ b/draft/man3/memmem.3 @@ -25,75 +25,36 @@ .\" 386BSD man pages .\" Modified Sat Jul 24 18:50:48 1993 by Rik Faith (faith@cs.unc.edu) .\" Interchanged 'needle' and 'haystack'; added history, aeb, 980113. +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka -.\" all rights reserved. -.\" Translated Wed Dec 17 12:11:20 JST 1997 -.\" by HIROFUMI Nishizuka +.\" This file was generated with po4a. Translate the source file. .\" -.TH MEMMEM 3 2008-12-05 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH MEMMEM 3 2008\-12\-05 GNU "Linux Programmer's Manual" .SH 名前 -.\"O memmem \- locate a substring memmem \- 部分文字列の位置を示す -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" -.B #include +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP .sp -.BI "void *memmem(const void *" haystack ", size_t " haystacklen , -.BI " const void *" needle ", size_t " needlelen ); +\fBvoid *memmem(const void *\fP\fIhaystack\fP\fB, size_t \fP\fIhaystacklen\fP\fB,\fP +\fB const void *\fP\fIneedle\fP\fB, size_t \fP\fIneedlelen\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR memmem () -.\"O function finds the start of the first occurrence -.\"O of the substring \fIneedle\fP of length \fIneedlelen\fP in the memory -.\"O area \fIhaystack\fP of length \fIhaystacklen\fP. -.BR memmem () -関数は、 -\fIhaystacklen\fP の大きさを持つメモリ領域 \fIhaystack\fP の中で -\fIneedlelen\fP の大きさを持つ部分文字列 \fIneedle\fP が -最初に現れる位置を見つける。 -.\"O .SH "RETURN VALUE" +\fBmemmem\fP() 関数は、 \fIhaystacklen\fP の大きさを持つメモリ領域 \fIhaystack\fP の中で \fIneedlelen\fP +の大きさを持つ部分文字列 \fIneedle\fP が 最初に現れる位置を見つける。 .SH 返り値 -.\"O The -.\"O .BR memmem () -.\"O function returns a pointer to the beginning of the -.\"O substring, or NULL if the substring is not found. -.BR memmem () -関数は、部分文字列の開始を指すポインタを返し、もし部分文字列が -見つからない場合は NULL を返す。 -.\"O .SH "CONFORMING TO" +\fBmemmem\fP() 関数は、部分文字列の開始を指すポインタを返し、もし部分文字列が 見つからない場合は NULL を返す。 .SH 準拠 -.\"O This function is a GNU extension. -この関数は GNU extension である。 -.\"O .SH BUGS +この関数は GNU による拡張である。 .SH バグ -.\"O This function was broken in Linux libraries up to and including libc 5.0.9; -.\"O there the \fIneedle\fP and \fIhaystack\fP arguments were interchanged, -.\"O and a pointer to the end of the first occurrence of \fIneedle\fP -.\"O was returned. -Linux のライブラリに関していうと、 libc 5.0.9 と -それ以前のすべてのバージョンで、この関数は壊れている。 -それらのライブラリでは \fIneedle\fP と \fIhaystack\fP 引数が -入れ替わっており、 \fIneedle\fP が最初に出現する部分の最後を +Linux のライブラリに関していうと、 libc 5.0.9 と それ以前のすべてのバージョンで、この関数は壊れている。 それらのライブラリでは +\fIneedle\fP と \fIhaystack\fP 引数が 入れ替わっており、 \fIneedle\fP が最初に出現する部分の最後を 示すポインタが返されていたのである。 -.\"O Both old and new libc's have the bug that if \fIneedle\fP is empty, -.\"O \fIhaystack-1\fP\ (instead of \fIhaystack\fP) is returned. -新旧両方の libc ライブラリが、 -\fIneedle\fP が空の場合 (\fIhaystack\fP のかわりに) \fIhaystack-1\fP\ が -返されるというバグを持っている。 -.\"O And glibc 2.0 makes it worse, returning a pointer to the -.\"O last byte of \fIhaystack\fP. -.\"O This is fixed in glibc 2.1. -そして、glibc 2.0 ではさらに悪くなっており、 -\fIhaystack\fP の最後のバイトへのポインタを返す。 +新旧両方の libc ライブラリが、 \fIneedle\fP が空の場合 (\fIhaystack\fP のかわりに) \fIhaystack\-1\fP\ が +返されるというバグを持っている。 そして、glibc 2.0 ではさらに悪くなっており、 \fIhaystack\fP の最後のバイトへのポインタを返す。 これは glibc 2.1 で修正された。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR strstr (3) +\fBstrstr\fP(3) diff --git a/draft/man3/memmove.3 b/draft/man3/memmove.3 index 97d4fc43..1a0602e2 100644 --- a/draft/man3/memmove.3 +++ b/draft/man3/memmove.3 @@ -25,68 +25,28 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 18:49:59 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 Ueyama Rui -.\" all rights reserved. -.\" Translated Tue Feb 21 0:50:30 JST 1997 -.\" by Ueyama Rui -.\" Updated 2007-06-13, Akihiro MOTOKI , LDP v2.55 +.\" This file was generated with po4a. Translate the source file. .\" -.TH MEMMOVE 3 1993-04-10 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH MEMMOVE 3 1993\-04\-10 GNU "Linux Programmer's Manual" .SH 名前 -.\"O memmove \- copy memory area memmove \- メモリ領域をコピーする -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "void *memmove(void *" dest ", const void *" src ", size_t " n ); +\fBvoid *memmove(void *\fP\fIdest\fP\fB, const void *\fP\fIsrc\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR memmove () -.\"O function copies \fIn\fP bytes from memory area -.\"O \fIsrc\fP to memory area \fIdest\fP. -.\"O The memory areas may overlap: copying takes place as though -.\"O the bytes in -.\"O .I src -.\"O are first copied into a temporary array that does not overlap -.\"O .I src -.\"O or -.\"O .IR dest , -.\"O and the bytes are then copied from the temporary array to -.\"O .IR dest . -.BR memmove () -は、メモリ領域 \fIsrc\fP の先頭 \fIn\fP バイトを -メモリ領域 \fIdest\fP にコピーする。コピー元とコピー先の -領域が重なっていてもよい。 -最初に -.I src -のバイトが -.I src -とも -.I dest -とも重ならない一時的な配列にコピーされてから、一時的な配列から -.I dest -にバイトのコピーが行われたかのように、コピーが行われる。 -.\"O .SH "RETURN VALUE" +\fBmemmove\fP() は、メモリ領域 \fIsrc\fP の先頭 \fIn\fP バイトを メモリ領域 \fIdest\fP にコピーする。コピー元とコピー先の +領域が重なっていてもよい。 最初に \fIsrc\fP のバイトが \fIsrc\fP とも \fIdest\fP +とも重ならない一時的な配列にコピーされてから、一時的な配列から \fIdest\fP にバイトのコピーが行われたかのように、コピーが行われる。 .SH 返り値 -.\"O The -.\"O .BR memmove () -.\"O function returns a pointer to \fIdest\fP. -.BR memmove () -は \fIdest\fP へのポインタを返す。 -.\"O .SH "CONFORMING TO" +\fBmemmove\fP() は \fIdest\fP へのポインタを返す。 .SH 準拠 -SVr4, 4.3BSD, C89, C99, POSIX.1-2001. -.\"O .SH "SEE ALSO" +SVr4, 4.3BSD, C89, C99, POSIX.1\-2001. .SH 関連項目 -.BR bcopy (3), -.BR memccpy (3), -.BR memcpy (3), -.BR strcpy (3), -.BR strncpy (3), -.BR wmemmove (3) +\fBbcopy\fP(3), \fBmemccpy\fP(3), \fBmemcpy\fP(3), \fBstrcpy\fP(3), \fBstrncpy\fP(3), +\fBwmemmove\fP(3) diff --git a/draft/man3/mempcpy.3 b/draft/man3/mempcpy.3 index d04a12f1..17e7a3fd 100644 --- a/draft/man3/mempcpy.3 +++ b/draft/man3/mempcpy.3 @@ -3,98 +3,42 @@ .\" Heavily based on glibc infopages, copyright Free Software Foundation .\" .\" aeb, 2003, polished a little +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 2004 Yuichi SATO -.\" all rights reserved. -.\" Translated Sat Aug 28 07:40:33 JST 2004 -.\" by Yuichi SATO +.\" This file was generated with po4a. Translate the source file. .\" -.TH MEMPCPY 3 2008-08-11 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH MEMPCPY 3 2008\-08\-11 GNU "Linux Programmer's Manual" .SH 名前 -.\"O mempcpy, wmempcpy \- copy memory area -mempcpy, wmempcpy \- メモリ領域をコピーする -.\"O .SH SYNOPSIS +mempcpy, wmempcpy \- メモリ領域をコピーする .SH 書式 .nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ .br -.B #include +\fB#include \fP .sp -.BI "void *mempcpy(void *" dest ", const void *" src ", size_t " n ); +\fBvoid *mempcpy(void *\fP\fIdest\fP\fB, const void *\fP\fIsrc\fP\fB, size_t \fP\fIn\fP\fB);\fP .sp -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ .br -.B #include +\fB#include \fP .sp -.BI "wchar_t *wmempcpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n ); +\fBwchar_t *wmempcpy(wchar_t *\fP\fIdest\fP\fB, const wchar_t *\fP\fIsrc\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR mempcpy () -.\"O function is nearly identical to the -.\"O .BR memcpy (3) -.\"O function. -.BR mempcpy () -関数は -.BR memcpy (3) -関数とほぼ同一である。 -.\"O It copies -.\"O .I n -.\"O bytes from the object beginning at -.\"O .I src -.\"O into the object pointed to by -.\"O .IR dest . -この関数は、 -.I src -で始まるオブジェクトから -.I n -バイトを、 -.I dest -で指されるオブジェクトにコピーする。 -.\"O But instead of returning the value of -.\"O .I dest -.\"O it returns a pointer to the byte following the last written byte. -ただし -.I dest -の値を返すのではなく、 +\fBmempcpy\fP() 関数は \fBmemcpy\fP(3) 関数とほぼ同一である。 この関数は、 \fIsrc\fP で始まるオブジェクトから \fIn\fP +バイトを、 \fIdest\fP で指されるオブジェクトにコピーする。 ただし \fIdest\fP の値を返すのではなく、 最後に書き込まれたバイトの後に続くバイトへのポインタを返す。 .PP -.\"O This function is useful in situations where a number of objects -.\"O shall be copied to consecutive memory positions. -この関数はいくつかのオブジェクトが -連続的なメモリの場所にコピーされるような状況で役に立つ。 +この関数はいくつかのオブジェクトが 連続的なメモリの場所にコピーされるような状況で役に立つ。 .PP -.\"O The -.\"O .BR wmempcpy () -.\"O function is identical but takes -.\"O .I wchar_t -.\"O type arguments and copies -.\"O .I n -.\"O wide characters. -.BR wmempcpy () -関数はこの関数と同じであるが、 -.I wchar_t -型の引き数をとり、 -.I n -ワイド文字列をコピーする。 -.\"O .SH "RETURN VALUE" +\fBwmempcpy\fP() 関数はこの関数と同じであるが、 \fIwchar_t\fP 型の引き数をとり、 \fIn\fP ワイド文字列をコピーする。 .SH 返り値 \fIdest\fP + \fIn\fP. -.\"O .SH VERSIONS .SH バージョン -.\"O .BR mempcpy () -.\"O first appeared in glibc in version 2.1. -.BR mempcpy () -は glibc バージョン 2.1 で初めて登場した。 -.\"O .SH "CONFORMING TO" +\fBmempcpy\fP() は glibc バージョン 2.1 で初めて登場した。 .SH 準拠 -.\"O This function is a GNU extension. -この関数は GNU における拡張である。 -.\"O .SH "EXAMPLE" +この関数は GNU による拡張である。 .SH 例 .nf void * @@ -104,11 +48,6 @@ combine (void *o1, size_t s1, void *o2, size_t s2) if (result != NULL) mempcpy(mempcpy(result, o1, s1), o2, s2); return result; - .fi -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR memccpy (3), -.BR memcpy (3), -.BR memmove (3), -.BR wmemcpy (3) +\fBmemccpy\fP(3), \fBmemcpy\fP(3), \fBmemmove\fP(3), \fBwmemcpy\fP(3) diff --git a/draft/man3/memset.3 b/draft/man3/memset.3 index c0c90f5a..e4333a39 100644 --- a/draft/man3/memset.3 +++ b/draft/man3/memset.3 @@ -25,31 +25,25 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 18:49:23 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 Ueyama Rui -.\" all rights reserved. -.\" Translated Tue Feb 21 0:51:30 JST 1997 -.\" by Ueyama Rui +.\" This file was generated with po4a. Translate the source file. .\" -.TH MEMSET 3 1993-04-11 "GNU" "Linux Programmer's Manual" +.\"******************************************************************* +.TH MEMSET 3 1993\-04\-11 GNU "Linux Programmer's Manual" .SH 名前 memset \- ある一定のバイトでメモリ領域を埋める。 .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "void *memset(void *" s ", int " c ", size_t " n ); +\fBvoid *memset(void *\fP\fIs\fP\fB, int \fP\fIc\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi .SH 説明 -.BR memset () -は \fIs\fP で示されるメモリ領域の先頭から \fIn\fP バイトを -\fIc\fP で埋める。 +\fBmemset\fP() は \fIs\fP で示されるメモリ領域の先頭から \fIn\fP バイトを \fIc\fP で埋める。 .SH 返り値 -.BR memset () -は \fIs\fP へのポインタを返す。 +\fBmemset\fP() は \fIs\fP へのポインタを返す。 .SH 準拠 -SVr4, 4.3BSD, C89, C99, POSIX.1-2001. +SVr4, 4.3BSD, C89, C99, POSIX.1\-2001. .SH 関連項目 -.BR bzero (3), -.BR swab (3), -.BR wmemset (3) +\fBbzero\fP(3), \fBswab\fP(3), \fBwmemset\fP(3) diff --git a/draft/man3/mkdtemp.3 b/draft/man3/mkdtemp.3 index da574efe..7ed20854 100644 --- a/draft/man3/mkdtemp.3 +++ b/draft/man3/mkdtemp.3 @@ -21,34 +21,26 @@ .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 2001 Yuichi SATO -.\" all rights reserved. -.\" Translated Sun Oct 21 03:28:34 JST 2001 -.\" by Yuichi SATO +.\" This file was generated with po4a. Translate the source file. .\" -.TH MKDTEMP 3 2010-09-26 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH MKDTEMP 3 2010\-09\-26 GNU "Linux Programmer's Manual" .SH 名前 -.\"O mkdtemp \- create a unique temporary directory mkdtemp \- 他と重ならない一時的なディレクトリを作成する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "char *mkdtemp(char *" template ); +\fBchar *mkdtemp(char *\fP\fItemplate\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR mkdtemp (): +\fBmkdtemp\fP(): .br .ad l .RS 4 @@ -61,77 +53,26 @@ _BSD_SOURCE .ad .PD .RE -.\"O .SH DESCRIPTION +.RE .SH 説明 -.\"O The -.\"O .BR mkdtemp () -.\"O function generates a uniquely named temporary -.\"O directory from \fItemplate\fP. -.\"O The last six characters of \fItemplate\fP -.\"O must be XXXXXX and these are replaced with a string that makes the -.\"O directory name unique. -.\"O The directory is then created with -.\"O permissions 0700. -.BR mkdtemp () -関数は、他と重ならない名前の一時的なディレクトリを -\fItemplate\fP から作成する。 -\fItemplate\fP の後から 6 文字は XXXXXX でなければならない。 -この部分はディレクトリ名を他と重ならなくするための -文字列で置き換えられる。 -ディレクトリは許可属性を 0700 として作成される。 -.\"O Since it will be modified, -.\"O .I template -.\"O must not be a string constant, but should be declared as a character array. -.I template -は変更されるので、文字列定数にしてはならず、文字配列にすべきである。 -.\"O .SH "RETURN VALUE" +\fBmkdtemp\fP() 関数は、他と重ならない名前の一時的なディレクトリを \fItemplate\fP から作成する。 \fItemplate\fP の後から +6 文字は XXXXXX でなければならない。 この部分はディレクトリ名を他と重ならなくするための 文字列で置き換えられる。 ディレクトリは許可属性を +0700 として作成される。 \fItemplate\fP は変更されるので、文字列定数にしてはならず、文字配列にすべきである。 .SH 返り値 -.\"O The -.\"O .BR mkdtemp () -.\"O function returns a pointer to the modified template -.\"O string on success, and NULL on failure, in which case -.\"O .I errno -.\"O is set appropriately. -成功した場合、 -.BR mkdtemp () -関数は -変更された template 文字列へのポインタを返す。 -失敗した場合は、NULL を返して、 -.I errno -を適切に設定する。 -.\"O .SH ERRORS +成功した場合、 \fBmkdtemp\fP() 関数は 変更された template 文字列へのポインタを返す。 失敗した場合は、NULL を返して、 +\fIerrno\fP を適切に設定する。 .SH エラー -.TP -.B EINVAL -.\"O The last six characters of \fItemplate\fP were not XXXXXX. -.\"O Now \fItemplate\fP is unchanged. -\fItemplate\fP の後ろから 6 文字が XXXXXX でない。 -この場合、\fItemplate\fP は変更されない。 +.TP +\fBEINVAL\fP +\fItemplate\fP の最後の 6 文字が XXXXXX でない。この場合、\fItemplate\fP は変更されない。 .PP -.\"O Also see -.\"O .BR mkdir (2) -.\"O for other possible values for \fIerrno\fP. -\fIerrno\fP に設定される他の値については、 -.BR mkdir (2) -を参照すること。 -.\"O .SH VERSIONS +\fIerrno\fP に設定される他の値については、 \fBmkdir\fP(2) を参照すること。 .SH バージョン -.\"O Available since glibc 2.1.91. OpenBSD 2.2 で導入された。 -.\"O .SH "CONFORMING TO" .SH 準拠 -POSIX.1-2008. -.\"O This function is present on the BSDs. -.\"O .\" As at 2006, this function is being considered for a revision of POSIX.1 -.\"O .\" Also in NetBSD 1.4. -この関数は BSD に存在する。 -.\" 2006 年時点では、この関数は POSIX.1 に入れるか検討中である。 -.\" NetBSD 1.4 にもある。 -.\"O .SH "SEE ALSO" +.\" As at 2006, this function is being considered for a revision of POSIX.1 +.\" Also in NetBSD 1.4. +POSIX.1\-2008. この関数は BSD に存在する。 .SH 関連項目 -.BR mkdir (2), -.BR mkstemp (3), -.BR mktemp (3), -.BR tempnam (3), -.BR tmpfile (3), -.BR tmpnam (3) +\fBmkdir\fP(2), \fBmkstemp\fP(3), \fBmktemp\fP(3), \fBtempnam\fP(3), \fBtmpfile\fP(3), +\fBtmpnam\fP(3) diff --git a/draft/man3/mkfifoat.3 b/draft/man3/mkfifoat.3 index 0551eb77..3a59f708 100644 --- a/draft/man3/mkfifoat.3 +++ b/draft/man3/mkfifoat.3 @@ -22,183 +22,69 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2006 Yuichi SATO -.\" all rights reserved. -.\" Translated 2006-08-04 by Yuichi SATO , LDP v2.36 .\" -.TH MKFIFOAT 3 2009-12-13 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH MKFIFOAT 3 2009\-12\-13 Linux "Linux Programmer's Manual" .SH 名前 -.\"O mkfifoat \- make a FIFO (named pipe) relative to a directory file descriptor mkfifoat \- ディレクトリファイルディスクリプタからの相対位置に FIFO (名前付きパイプ) を作る -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .B #include /* Definition of AT_* constants */ -.B #include /* AT_* 定数の定義 */ -.B #include +\fB#include /* AT_* 定数の定義 */\fP +\fB#include \fP .sp -.BI "int mkfifoat(int " dirfd ", const char *" pathname ", mode_t " mode ); +\fBint mkfifoat(int \fP\fIdirfd\fP\fB, const char *\fP\fIpathname\fP\fB, mode_t \fP\fImode\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR mkfifoat (): +\fBmkfifoat\fP(): .PD 0 .ad l .RS 4 -.TP 4 -.\"O Since glibc 2.10: -.\"O _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L +.TP 4 glibc 2.10 以降: _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L -.TP -.\"O Before glibc 2.10: +.TP glibc 2.10 より前: _ATFILE_SOURCE .RE .ad .PD -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR mkfifoat () -.\"O system call operates in exactly the same way as -.\"O .BR mkfifo (3), -.\"O except for the differences described in this manual page. -.BR mkfifoat () -システムコールは、この man ページで説明している違いがある以外は、 -.BR mkfifo (3) +\fBmkfifoat\fP() システムコールは、この man ページで説明している違いがある以外は、 \fBmkfifo\fP(3) と全く同じように動作する。 -.\"O If the pathname given in -.\"O .I pathname -.\"O is relative, then it is interpreted relative to the directory -.\"O referred to by the file descriptor -.\"O .I dirfd -.\"O (rather than relative to the current working directory of -.\"O the calling process, as is done by -.\"O .BR mkfifo (3) -.\"O for a relative pathname). -.I pathname -で指定されるパス名が相対パス名である場合、 -ファイルディスクリプタ -.I dirfd -で参照されるディレクトリからの相対パス名として解釈される -.RB ( mkfifo (3) -では、相対パスは呼び出し元プロセスの +\fIpathname\fP で指定されるパス名が相対パス名である場合、 ファイルディスクリプタ \fIdirfd\fP +で参照されるディレクトリからの相対パス名として解釈される (\fBmkfifo\fP(3) では、相対パスは呼び出し元プロセスの カレントワーキングディレクトリからの相対パスとなる)。 -.\"O If -.\"O .I pathname -.\"O is relative and -.\"O .I dirfd -.\"O is the special value -.\"O .BR AT_FDCWD , -.\"O then -.\"O .I pathname -.\"O is interpreted relative to the current working -.\"O directory of the calling process (like -.\"O .BR mkfifo (3)). -.I pathname -が相対パスであり、かつ -.I dirfd -が特別な値 -.B AT_FDCWD -である場合、 -.I pathname -は -.RB ( mkfifo (3) -と同じように) 呼び出し元プロセスの -カレントワーキングディレクトリからの相対パス名として解釈される。 +\fIpathname\fP が相対パスであり、かつ \fIdirfd\fP が特別な値 \fBAT_FDCWD\fP である場合、 \fIpathname\fP は +(\fBmkfifo\fP(3) と同じように) 呼び出し元プロセスの カレントワーキングディレクトリからの相対パス名として解釈される。 -.\"O If -.\"O .I pathname -.\"O is absolute, then -.\"O .I dirfd -.\"O is ignored. -.I pathname -が絶対パスである場合、 -.I dirfd -は無視される。 -.\"O .SH "RETURN VALUE" +\fIpathname\fP が絶対パスである場合、 \fIdirfd\fP は無視される。 .SH 返り値 -.\"O On success, -.\"O .BR mkfifoat () -.\"O returns 0. -成功した場合、 -.BR mkfifoat () -は 0 を返す。 -.\"O On error, \-1 is returned and -.\"O .I errno -.\"O is set to indicate the error. -エラーの場合、\-1 が返されて、 -.I errno -にはエラーを示す値が設定される。 -.\"O .SH ERRORS +成功した場合、 \fBmkfifoat\fP() は 0 を返す。 エラーの場合、\-1 が返されて、 \fIerrno\fP にはエラーを示す値が設定される。 .SH エラー -.\"O The same errors that occur for -.\"O .BR mkfifo (3) -.\"O can also occur for -.\"O .BR mkfifoat (). -.BR mkfifo (3) -と同じエラーが -.BR mkfifoat () -でも起こる。 -.\"O The following additional errors can occur for -.\"O .BR mkfifoat (): -.BR mkfifoat () +\fBmkfifo\fP(3) と同じエラーが \fBmkfifoat\fP() でも起こる。 \fBmkfifoat\fP() では、その他に以下のエラーが起こる: -.TP -.B EBADF -.\"O .I dirfd -.\"O is not a valid file descriptor. -.I dirfd -が有効なファイルディスクリプタでない。 -.TP -.B ENOTDIR -.\"O .I pathname -.\"O is a relative path and -.\"O .I dirfd -.\"O is a file descriptor referring to a file other than a directory. -.I pathname -が相対パスで、かつ -.I dirfd -がディレクトリ以外のファイルを参照するファイルディスクリプタである。 -.\"O .SH VERSIONS +.TP +\fBEBADF\fP +\fIdirfd\fP が有効なファイルディスクリプタでない。 +.TP +\fBENOTDIR\fP +\fIpathname\fP が相対パスで、かつ \fIdirfd\fP がディレクトリ以外のファイルを参照するファイルディスクリプタである。 .SH バージョン -.\"O .BR mkfifoat () -.\"O was added to glibc in version 2.4. -.BR mkfifoat () -は glibc のバージョン 2.4 で追加された。 -.\"O It is implemented using -.\"O .BR mknod (2), -.\"O available on Linux since kernel 2.6.16. -このシステムコールは、 -カーネル 2.6.16 以降の Linux で利用できるようになった -.BR mknod (2) -を使って実装されている。 -.\"O .SH "CONFORMING TO" +\fBmkfifoat\fP() は glibc のバージョン 2.4 で追加された。 このシステムコールは、 カーネル 2.6.16 以降の Linux +で利用できるようになった \fBmknod\fP(2) を使って実装されている。 .SH 準拠 -POSIX.1-2008. -.\"O .SH NOTES +POSIX.1\-2008. .SH 注意 -.\"O See -.\"O .BR openat (2) -.\"O for an explanation of the need for -.\"O .BR mkfifoat (). -.BR mkfifoat () -が必要な理由については、 -.BR openat (2) -を参照すること。 -.\"O .SH "SEE ALSO" +\fBmkfifoat\fP() が必要な理由については、 \fBopenat\fP(2) を参照すること。 .SH 関連項目 -.BR openat (2), -.BR mkfifo (3), -.BR path_resolution (7) +\fBopenat\fP(2), \fBmkfifo\fP(3), \fBpath_resolution\fP(7) diff --git a/draft/man3/mkstemp.3 b/draft/man3/mkstemp.3 deleted file mode 100644 index 0b449b6f..00000000 --- a/draft/man3/mkstemp.3 +++ /dev/null @@ -1,243 +0,0 @@ -.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) -.\" and Copyright (C) 2008, Michael Kerrisk -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" References consulted: -.\" Linux libc source code -.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) -.\" 386BSD man pages -.\" Modified Sat Jul 24 18:48:48 1993 by Rik Faith (faith@cs.unc.edu) -.\" Modified 980310, aeb -.\" Modified 990328, aeb -.\" 2008-06-19, mtk, Added mkostemp(); various other changes -.\" -.\" Japanese Version Copyright (c) 1997 Kazuyuki Tanisako -.\" all rights reserved. -.\" Translated 1997-05-17, Kazuyuki Tanisako -.\" Modified 1997-05-27, Kazuyuki Tanisako -.\" Modified 1998-02-05, Kazuyuki Tanisako -.\" Modified 1998-09-27, Kazuyuki Tanisako -.\" Modified 1999-04-10, Kazuyuki Tanisako -.\" Updated 2001-01-17, Kentaro Shirakata -.\" Updated 2005-02-26, Akihiro MOTOKI -.\" Updated 2008-08-10, Akihiro MOTOKI, LDP v3.05 -.\" -.\"WORD: temporary file 一時ファイル -.\"WORD: read/write リード/ライト -.\"WORD: permissions 許可 -.\" -.TH MKSTEMP 3 2008-06-19 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O mkstemp, mkostemp \- create a unique temporary file -mkstemp, mkostemp \- 他と重ならない名前を持つ一時ファイルを作成する -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.B #include -.sp -.BI "int mkstemp(char *" template ); -.sp -.BI "int mkostemp (char *" template ", int " flags ); -.fi -.sp -.in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): -.in -.sp -.BR mkstemp (): -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 -.br -.BR mkostemp (): -_GNU_SOURCE -\"O .SH DESCRIPTION -.SH 説明 -.\"O The -.\"O .BR mkstemp () -.\"O function generates a unique temporary filename from -.\"O .IR template , -.\"O creates and opens the file, -.\"O and returns an open file descriptor for the file. -関数 -.BR mkstemp () -は引数 -.I template -から他と重ならない一時ファイル名を生成し、 -そのファイルの作成とオープンを行い、 -そのファイルに対するオープン済みのファイルディスクリプタを返す。 - -.\"O The last six characters of -.\"O .I template -.\"O must be "XXXXXX" and these are replaced with a string that makes the -.\"O filename unique. -引数 -.I template -で指示する文字列の後ろの 6 文字は XXXXXX である必要がある。 -この部分がファイル名を他と重ならないようにする文字で置き換えられる。 -.\"O Since it will be modified, -.\"O .I template -.\"O must not be a string constant, but should be declared as a character array. -.I template -は書き換えられるため、文字列定数ではなく文字配列として -宣言するようにしなければならない。 - -.\"O The file is created with -.\"O permissions 0600, that is, read plus write for owner only. -.\"O (In glibc versions 2.06 and earlier, the file is created with permissions 0666, -.\"O that is, read and write for all users.) -.\"O The returned file descriptor provides both read and write access to the file. -.\"O The file is opened with the -.\"O .BR open (2) -.\"O .B O_EXCL -.\"O flag, guaranteeing that the caller is the process that creates the file. -ファイルは許可モード 0600 で作成され、所有者のみが読み書き可能である -(glibc バージョン 2.06 以前では、ファイルは許可モード 0666 で作成され、 -全てのユーザが読み書き可能であった)。 -返されるファイルディスクリプタで、このファイルへの読み書き両方のアクセスが -可能である。 -呼び出し者がそのファイルを作成するプロセスであることを保証するために、 -ファイルは -.BR open (2) -の -.B O_EXCL -フラグ付きでオープンされる。 - -.\"O .BR mkostemp () -.\"O is like -.\"O .BR mkstemp (), -.\"O with the difference that flags as for -.\"O .BR open (2) -.\"O may be specified in -.\"O .IR flags -.\"O (e.g., -.\"O .BR O_APPEND , -.\"O .BR O_SYNC ). -.BR mkostemp () -は -.BR mkstemp () -と同様だが、 -.BR open (2) -に渡されるフラグ -.RB O_APPEND , -.B O_SYNC -など) を -.I flags -で指定できる点が異なる -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O On success, these functions return the file descriptor -.\"O of the temporary file. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功すると、これらの関数は一時ファイルのファイルディスクリプタを返す。 -エラーの場合は、\-1 を返し、 -.I errno -を適切に設定する。 -.\"O .SH ERRORS -.SH エラー -.TP -.B EEXIST -.\"O Could not create a unique temporary filename. -.\"O Now the contents of \fItemplate\fP are undefined. -すでに同じ名前を持つファイルが存在した。 -\fItemplate\fP の内容は不定である。 -.TP -.B EINVAL -.\"O The last six characters of \fItemplate\fP were not XXXXXX. -.\"O Now \fItemplate\fP is unchanged. -引数 \fItemplate\fP で指示された文字配列の後ろの 6 文字が XXXXXX でない。 -\fItemplate\fP の内容は変化しない。 -.PP -.\"O These functions may also fail with any of the errors described for -.\"O .BR open (2). -これらの関数は -.BR open (2) -に書かわれているエラーのいずれかで失敗することもある。 -.\"O .SH VERSIONS -.SH バージョン -.\"O .BR mkostemp () -.\"O is available since glibc 2.7. -.BR mkostemp () -は glibc 2.7 以降で利用可能である。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -.BR mkstemp (): -4.3BSD, POSIX.1-2001. -.BR mkostemp (): -.\"O is a glibc extension. -glibc による拡張。 -.\"O .SH NOTES -.SH 注意 -.\"O The old behavior of creating a file with mode 0666 may be -.\"O a security risk, especially since other Unix flavors use 0600, -.\"O and somebody might overlook this detail when porting programs. -許可モード 0666 でファイルを作成するという古い動作は、 -セキュリティ上のリスクになる場合がある。 -特に他の Unix では許可モードとして 0600 を使うため、 -プログラムを移植する際、この細かな違いを見落とす可能性が -あるからだ。 - -.\"O More generally, the POSIX specification of -.\"O .BR mkstemp () -.\"O does not say anything -.\"O about file modes, so the application should make sure its -.\"O file mode creation mask (see -.\"O .BR umask (2)) -.\"O is set appropriately before calling -.\"O .BR mkstemp () -.\"O (and -.\"O .BR mkostemp ()). -より一般的には、 -.BR mkstemp () -の POSIX 規定ではファイルモードについて何も述べていない。 -従って、アプリケーションは -.BR mkstemp () -(や -.BR mkostemp ()) -を呼び出す前にファイルモード生成マスク -.RB ( umask (2) -参照) が適切に設定されているか確認するべきである。 - -.\"O The prototype for -.\"O .BR mktemp () -.\"O is in -.\"O .I -.\"O for libc4, libc5, glibc1; glibc2 follows POSIX.1 and has the prototype in -.\"O .IR . -.BR mktemp () -のプロトタイプ宣言は、libc4, libc5, glibc1 では -.I -に含まれる; glibc2 では POSIX.1 に準拠し -.I -に含まれている。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR mkdtemp (3), -.BR mktemp (3), -.BR tempnam (3), -.BR tmpfile (3), -.BR tmpnam (3) diff --git a/draft/man3/mktemp.3 b/draft/man3/mktemp.3 index c9c72635..a9e06ba9 100644 --- a/draft/man3/mktemp.3 +++ b/draft/man3/mktemp.3 @@ -29,149 +29,62 @@ .\" (prompted by Scott Burkett ) .\" Modified Sun Mar 28 23:44:38 1999 by Andries Brouwer (aeb@cwi.nl) .\" -.\" Japanese Version Copyright (c) 1997 Kazuyuki Tanisako -.\" all rights reserved. -.\" Translated Sat Apr 10 02:12:40 JST 1999 -.\" by Kazuyuki Tanisako +.\"******************************************************************* .\" -.\"WORD: temporary file テンポラリファイル -.\"WORD: filename ファイル名 -.\"WORD: pointer ポインター -.\"WORD: function 関数 +.\" This file was generated with po4a. Translate the source file. .\" -.TH MKTEMP 3 2010-09-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH MKTEMP 3 2010\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 -.\"O mktemp \- make a unique temporary filename mktemp \- 他と重ならないテンポラリファイル名を作成する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "char *mktemp(char *" template ); +\fBchar *mktemp(char *\fP\fItemplate\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR mktemp (): +\fBmktemp\fP(): .ad l .PD 0 .RS 4 -.TP 4 -.\"O Since glibc 2.12: +.TP 4 glibc 2.12 以降: _BSD_SOURCE || _SVID_SOURCE || (_XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) && !(_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600) -.TP -.\"O Before glibc 2.12: +.TP glibc 2.12 より前: -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .RE .PD .ad b -\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR mktemp () -.\"O function generates a unique temporary filename -.\"O from \fItemplate\fP. -.\"O The last six characters of \fItemplate\fP must -.\"O be XXXXXX and these are replaced with a string that makes the -.\"O filename unique. -.\"O Since it will be modified, -.\"O .I template -.\"O must not be a string constant, but should be declared as a character array. -関数 -.BR mktemp () -は引数 \fItemplate\fP から他と重ならない -テンポラリファイル名を作成する。引数 \fItemplate\fP で指示する文字配列 -の後6文字は XXXXXX である必要がある。この部分がファイル名を他と -重ならないにするような文字で置き換えられる。 -.I template -は書き換えられるため、文字列定数ではなく文字配列として宣言するように -しなければならない。 -.\"O .SH "RETURN VALUE" +関数 \fBmktemp\fP() は引数 \fItemplate\fP から他と重ならない テンポラリファイル名を作成する。引数 \fItemplate\fP +で指示する文字配列 の後6文字は XXXXXX である必要がある。この部分がファイル名を他と 重ならないにするような文字で置き換えられる。 +\fItemplate\fP は書き換えられるため、文字列定数ではなく文字配列として宣言するように しなければならない。 .SH 返り値 -.\"O The -.\"O .BR mktemp () -.\"O function always returns \fItemplate\fP. -.\"O If a unique name was created, the last six bytes of \fItemplate\fP will -.\"O have been modified in such a way that the resulting name is unique -.\"O (i.e., does not exist already) -.\"O If a unique name could not be created, -.\"O \fItemplate\fP is made an empty string. -関数 -.BR mktemp () -は常に \fItemplate\fP を戻す。 -一意な名前が作成された場合、 -\fItemplate\fP の最後の 6 バイトに -他と重ならない名前 (それまでに出ていない名前) になるような値が格納される。 -一意な名前が作成できなかった場合には、 -\fItemplate\fP には空文字列がセットされる。 -.\"O .SH ERRORS +関数 \fBmktemp\fP() は常に \fItemplate\fP を戻す。 一意な名前が作成された場合、 \fItemplate\fP の最後の 6 バイトに +他と重ならない名前 (それまでに出ていない名前) になるような値が格納される。 一意な名前が作成できなかった場合には、 \fItemplate\fP +には空文字列がセットされる。 .SH エラー -.TP -.B EINVAL -.\"O The last six characters of \fItemplate\fP were not XXXXXX. +.TP +\fBEINVAL\fP 引数 \fItemplate\fP で指示された文字列の後6文字が XXXXXX でない。 -.\"O .SH "CONFORMING TO" .SH 準拠 -4.3BSD, POSIX.1-2001. -.\"O POSIX.1-2008 removes the specification of -.\"O .BR mktemp (). -POSIX.1-2008 では -.BR mktemp () -の仕様が削除されている。 -.\"O .SH NOTES +4.3BSD, POSIX.1\-2001. POSIX.1\-2008 では \fBmktemp\fP() の仕様が削除されている。 .SH 注意 -.\"O The prototype is in -.\"O .I -.\"O for libc4, libc5, glibc1; glibc2 follows the Single UNIX Specification -.\"O and has the prototype in -.\"O .IR . -libc4, libc5, glibc1 でのプロトタイプ宣言は -.I -に含まれる; glibc2 では Single UNIX Specification に従って -.I -に含まれている。 -.\"O .SH BUGS +libc4, libc5, glibc1 でのプロトタイプ宣言は \fI\fP に含まれる; glibc2 では +Single UNIX Specification に従って \fI\fP に含まれている。 .SH バグ -.\"O Never use -.\"O .BR mktemp (). -.\"O Some implementations follow 4.3BSD -.\"O and replace XXXXXX by the current process ID and a single letter, -.\"O so that at most 26 different names can be returned. -.BR mktemp () -を決して使わないこと。4.3BSD 系の実装や XXXXXX を -プロセス ID と1文字により置き換える方式ではせいぜい26の名前を返す -ことができるにすぎない。 -.\"O Since on the one hand the names are easy to guess, and on the other -.\"O hand there is a race between testing whether the name exists and -.\"O opening the file, every use of -.\"O .BR mktemp () -.\"O is a security risk. -.\"O The race is avoided by -.\"O .BR mkstemp (3). -この名前は簡単に推測できることや、その名前がすでに存在しているかどうか -テストして、そのファイルをオープンする間に競合がある事から、 -.BR mktemp () -を使うのは毎回セキュリティリスクをおかすことになる。 -この競合は -.BR mkstemp (3) -を使うことで避けられる。 -.\"O .SH "SEE ALSO" +\fBmktemp\fP() を決して使わないこと。4.3BSD 系の実装や XXXXXX を プロセス ID +と1文字により置き換える方式ではせいぜい26の名前を返す ことができるにすぎない。 +この名前は簡単に推測できることや、その名前がすでに存在しているかどうか テストして、そのファイルをオープンする間に競合がある事から、 +\fBmktemp\fP() を使うのは毎回セキュリティリスクをおかすことになる。 この競合は \fBmkstemp\fP(3) を使うことで避けられる。 .SH 関連項目 -.BR mkstemp (3), -.BR tempnam (3), -.BR tmpfile (3), -.BR tmpnam (3) +\fBmkstemp\fP(3), \fBtempnam\fP(3), \fBtmpfile\fP(3), \fBtmpnam\fP(3) diff --git a/draft/man3/modf.3 b/draft/man3/modf.3 index a3f4f9ac..625a2600 100644 --- a/draft/man3/modf.3 +++ b/draft/man3/modf.3 @@ -28,103 +28,52 @@ .\" Modified 2002-07-27 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi -.\" all rights reserved. -.\" Translated Tue Feb 17 11:01:38 JST 1998 -.\" by YOSHINO Takashi -.\" Updated Sun Sep 14 JST 2003 by Kentaro Shirakata -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH MODF 3 2010-09-20 "" "Linux Programmer's Manual" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH MODF 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O modf, modff, modfl \- extract signed integral and fractional values from -.\"O floating-point number modf, modff, modfl \- 浮動小数点実数から、符号付き整数と小数部分を取り出す関数 .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double modf(double " x ", double *" iptr ); +\fBdouble modf(double \fP\fIx\fP\fB, double *\fP\fIiptr\fP\fB);\fP .br -.BI "float modff(float " x ", float *" iptr ); +\fBfloat modff(float \fP\fIx\fP\fB, float *\fP\fIiptr\fP\fB);\fP .br -.BI "long double modfl(long double " x ", long double *" iptr ); +\fBlong double modfl(long double \fP\fIx\fP\fB, long double *\fP\fIiptr\fP\fB);\fP .fi -.\"O Link with \fI\-lm\fP. +.sp \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR modf (), -.BR modfl (): +\fBmodf\fP(), \fBmodfl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR modf () -.\"O function breaks the argument \fIx\fP into an integral -.\"O part and a fractional part, each of which has the same sign as \fIx\fP. -.\"O The integral part is stored in the location pointed to by \fIiptr\fP. -.BR modf () -関数は、引数 \fIx\fP を整数部分と小数部分に分割する。 -このとき、ふたつの値はともに \fIx\fP と同じ符号を持つ。 -整数部分は \fIiptr\fP が指す場所に格納される。 -.\"O .SH "RETURN VALUE" +\fBmodf\fP() 関数は、引数 \fIx\fP を整数部分と小数部分に分割する。 このとき、ふたつの値はともに \fIx\fP と同じ符号を持つ。 整数部分は +\fIiptr\fP が指す場所に格納される。 .SH 返り値 -.\"O The -.\"O .BR modf () -.\"O function returns the fractional part of \fIx\fP. -.BR modf () -関数は \fIx\fP の小数部分を返す。 +\fBmodf\fP() 関数は \fIx\fP の小数部分を返す。 -.\"O If -.\"O .I x -.\"O is a NaN, a NaN is returned, and -.\"O .IR *iptr -.\"O is set to a NaN. -.I x -が NaN の場合、NaN が返され、 -.IR *iptr -に NaN が設定される。 +\fIx\fP が NaN の場合、NaN が返され、 \fI*iptr\fP に NaN が設定される。 -.\"O If -.\"O .I x -.\"O is positive infinity (negative infinity), +0 (\-0) is returned, and -.\"O .IR *iptr -.\"O is set to positive infinity (negative infinity). -.I x -が正の無限大 (負の無限大) の場合、 -+0 (\-0) が返され、 -.IR *iptr -に正の無限大 (負の無限大) が設定される。 -.\"O .SH ERRORS +\fIx\fP が正の無限大 (負の無限大) の場合、 +0 (\-0) が返され、 \fI*iptr\fP に正の無限大 (負の無限大) が設定される。 .SH エラー -.\"O No errors occur. エラーは発生しない。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH 関連項目 -.BR frexp (3), -.BR ldexp (3) +\fBfrexp\fP(3), \fBldexp\fP(3) diff --git a/draft/man3/mtrace.3 b/draft/man3/mtrace.3 deleted file mode 100644 index 3a58d1c5..00000000 --- a/draft/man3/mtrace.3 +++ /dev/null @@ -1,81 +0,0 @@ -.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) -.\" Distributed under GPL -.\" the glibc-info pages are very helpful here -.\" -.\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI all rights reserved. -.\" Translated Thu 05 Dec 2002 by Akihiro MOTOKI -.\" -.TH MTRACE 3 2002-07-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O mtrace, muntrace \- malloc debugging -.SH 名前 -mtrace, muntrace \- malloc debugging -.\"O .SH SYNOPSIS -.SH 書式 -.B "#include " -.sp -.B "void mtrace(void);" -.sp -.B "void muntrace(void);" -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The function -.\"O .BR mtrace () -.\"O installs handlers for -.\"O .BR malloc (3), -.\"O .BR realloc (3) -.\"O and -.\"O .BR free (3). -.\"O The function -.\"O .BR muntrace () -.\"O disables these handlers. -関数 -.BR mtrace () -は、 -.BR malloc (3), -.BR realloc (3), -.BR free (3) -のハンドラを組み込む。 -関数 -.BR muntrace () -はこれらのハンドラを解除する。 -.br -.\"O The environment variable -.\"O .B MALLOC_TRACE -.\"O defines a file where -.\"O .BR mtrace () -.\"O writes its output. -環境変数 -.B MALLOC_TRACE -は -.BR mtrace () -が出力を書き出すファイルを指定する。 -.\"O This file must be writable to the user or -.\"O .BR mtrace () -.\"O will do nothing. -ユーザが書き込み権限を持つファイルを指定しなければならない。 -書き込み権限がない場合、 -.BR mtrace () -は何もしない。 -.\"O If the file is not empty it will be truncated. -.\" motoki: truncate って「後ろを切ってしまう」ような意味のはずだけど -.\" motoki: 実際に試してみると、元のファイルを上書きするようです・・・ -ファイルが空でない場合、ファイルの元の内容を上書きする。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -.\"O These are GNU extensions. -この関数は GNU 拡張である。 -.\"O .SH NOTES -.SH 注意 -.\"O The output of -.\"O .BR mtrace () -.\"O will be ASCII but not in a friendly format. -.\"O So glibc comes with a perl-script called mtrace to make sense of it. -.BR mtrace () -の出力は ASCII 形式だが、人が読みやすいフォーマットではない。 -そこで、glibc には mtrace 出力を分かりやすい形式に変換する -perl スクリプトが付属している。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR malloc (3), -.BR malloc_hook (3) diff --git a/draft/man3/nan.3 b/draft/man3/nan.3 index 746a2ba6..87875903 100644 --- a/draft/man3/nan.3 +++ b/draft/man3/nan.3 @@ -3,127 +3,55 @@ .\" Based on glibc infopages .\" .\" Corrections by aeb +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI all rights reserved. -.\" Translated Thu 05 Dec 2002 by Akihiro MOTOKI -.\" Updated 2008-09-16, Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.\"WORD: NaN 無効値 -.\"WORD: quiet NaN SIGFPE シグナルなしの無効値 -.\" -.TH NAN 3 2010-09-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O nan, nanf, nanl \- return 'Not a Number' +.\"******************************************************************* +.TH NAN 3 2010\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 nan, nanf, nanl \- 無効値 ('Not a Number') を返す -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "double nan(const char *" tagp ); +\fBdouble nan(const char *\fP\fItagp\fP\fB);\fP .br -.BI "float nanf(const char *" tagp ); +\fBfloat nanf(const char *\fP\fItagp\fP\fB);\fP .br -.BI "long double nanl(const char *" tagp ); +\fBlong double nanl(const char *\fP\fItagp\fP\fB);\fP .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR nan (), -.BR nanf (), -.BR nanl (): +\fBnan\fP(), \fBnanf\fP(), \fBnanl\fP(): .RS 4 -_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O These functions return a representation (determined by -.\"O .IR tagp ) -.\"O of a quiet NaN. -.\"O If the implementation does not support -.\"O quiet NaNs, these functions return zero. -.\" motoki: quiet NaN とは何だろう? -これらの関数は、SIGFPE シグナルなしの無効値 (NaN) を示す表現を返す -(どの表現を使用するかは -.I tagp -で指定する)。SIGFPE シグナルなしの NaN をサポートしていない実装では 0 を返す。 +これらの関数は、SIGFPE シグナルなしの無効値 (NaN) を示す表現を返す (どの表現を使用するかは \fItagp\fP で指定する)。SIGFPE +シグナルなしの NaN をサポートしていない実装では 0 を返す。 .LP -.\"O The call -.\"O .I nan("char-sequence") -.\"O is equivalent to: -.\"O .nf -.\"O -.\"O strtod("NAN(char-sequence)", NULL); -.\"O .fi -.I nan("char-sequence") -を呼び出すのは、 +\fInan("char\-sequence")\fP を呼び出すのは、以下と等価である。 .nf - strtod("NAN(char-sequence)", NULL); - + strtod("NAN(char\-sequence)", NULL); .fi -と等価である。 .PP -.\"O Similarly, calls to -.\"O .BR nanf () -.\"O and -.\"O .BR nanl () -.\"O are equivalent to analogous calls to -.\"O .BR strtof (3) -.\"O and -.\"O .BR strtold (3). -同様に、 -.BR nanf () -や -.BR nanl () -を呼び出すのは、 -.BR strtof () -や -.BR strtold () +同様に、 \fBnanf\fP() や \fBnanl\fP() を呼び出すのは、 \fBstrtof\fP() や \fBstrtold\fP() を呼ぶのと同じである。 .PP -.\"O The argument -.\"O .I tagp -.\"O is used in an unspecified manner. -.\"O On IEEE 754 systems, there are -.\"O many representations of NaN, and -.\"O .I tagp -.\"O selects one. -.\"O On other systems it may do nothing. -引き数 -.I tagp -の使い方は規定されていない。 -IEEE 754 準拠のシステムでは、NaN にも複数の表現が存在し、 -.I tagp -はその選択に使用される。 -他のシステムでは、何の意味もないかもしれない。 -.\"O .SH VERSIONS +引き数 \fItagp\fP の使い方は規定されていない。 IEEE 754 準拠のシステムでは、NaN にも複数の表現が存在し、 \fItagp\fP +はその選択に使用される。 他のシステムでは、何の意味もないかもしれない。 .SH バージョン -.\"O These functions first appeared in glibc in version 2.1. これらの関数は glibc バージョン 2.1 で初めて登場した。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O See also IEC 559 and the appendix with -.\"O recommended functions in IEEE 754/IEEE 854. -IEC 559 や推奨関数になっている IEEE 754/IEEE 854 -の付録も参照すること。 -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. IEC 559 や推奨関数になっている IEEE 754/IEEE 854 の付録も参照すること。 .SH 関連項目 -.BR isnan (3), -.BR strtod (3), -.BR math_error (7) +\fBisnan\fP(3), \fBstrtod\fP(3), \fBmath_error\fP(7) diff --git a/draft/man3/netlink.3 b/draft/man3/netlink.3 index 4b428cfd..eb903750 100644 --- a/draft/man3/netlink.3 +++ b/draft/man3/netlink.3 @@ -1,140 +1,71 @@ .\" This manpage copyright 1998 by Andi Kleen. Subject to the GPL. .\" Based on the original comments from Alexey Kuznetsov -.\" $Id: netlink.3,v 1.4 2000/09/07 07:21:43 hanataka Exp $ +.\" $Id: netlink.3,v 1.1 1999/05/14 17:17:24 freitag Exp $ +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1999 Shouichi Saito -.\" all rights reserved. -.\" Translated Mon Jul 26 12:18:39 JST 1999 -.\" by Shouichi Saito -.\" Proofed Fri Aug 20 1999 by NAKANO Takeo +.\" This file was generated with po4a. Translate the source file. .\" -.\"WORD: payload 格納領域 -.\"WORD: lvalue 左辺値 -.\" -.TH NETLINK 3 1999-05-14 "GNU" "Linux Programmer's Manual" +.\"******************************************************************* +.TH NETLINK 3 1999\-05\-14 GNU "Linux Programmer's Manual" .SH 名前 -.\"O netlink \- Netlink macros netlink \- netlink マクロ .SH 書式 .nf .\" FIXME . what will glibc 2.1 use here? .\" May 2007: glibc 2.5, things look to be unchanged -- the header file .\" is still linux/netlink.h -- mtk -.B #include +\fB#include \fP .br -.B #include +\fB#include \fP .sp -.BI "int NLMSG_ALIGN(size_t " len ); +\fBint NLMSG_ALIGN(size_t \fP\fIlen\fP\fB);\fP .br -.BI "int NLMSG_LENGTH(size_t " len ); +\fBint NLMSG_LENGTH(size_t \fP\fIlen\fP\fB);\fP .br -.BI "int NLMSG_SPACE(size_t " len ); +\fBint NLMSG_SPACE(size_t \fP\fIlen\fP\fB);\fP .br -.BI "void *NLMSG_DATA(struct nlmsghdr *" nlh ); +\fBvoid *NLMSG_DATA(struct nlmsghdr *\fP\fInlh\fP\fB);\fP .br -.BI "struct nlmsghdr *NLMSG_NEXT(struct nlmsghdr *" nlh ", int " len ); +\fBstruct nlmsghdr *NLMSG_NEXT(struct nlmsghdr *\fP\fInlh\fP\fB, int \fP\fIlen\fP\fB);\fP .br -.BI "int NLMSG_OK(struct nlmsghdr *" nlh ", int " len ); +\fBint NLMSG_OK(struct nlmsghdr *\fP\fInlh\fP\fB, int \fP\fIlen\fP\fB);\fP .br -.BI "int NLMSG_PAYLOAD(struct nlmsghdr *" nlh ", int " len ); +\fBint NLMSG_PAYLOAD(struct nlmsghdr *\fP\fInlh\fP\fB, int \fP\fIlen\fP\fB);\fP .fi .SH 説明 -.\"O .I -.\"O defines several standard macros to access or create a netlink datagram. -.\"O They are similar in spirit to the macros defined in -.\"O .BR cmsg (3) -.\"O for auxiliary data. -.\"O The buffer passed to and from a netlink socket should -.\"O only be accessed using these macros. -.I -では、 netlink データグラムにアクセスしたり、これを作成するための -標準マクロがいくつか定義されている。 -これらは -.BR cmsg (3) -で定義されている補助データ (auxiliary data) 用のマクロと、 -その精神において似ているものである。 -netlink ソケットに対してやりとりされるバッファには、 -必ずこれらのマクロを使ってアクセスすべきである。 -.TP -.B NLMSG_ALIGN -.\"O Round the length of a netlink message up to align it properly. +\fI\fP では、 netlink データグラムにアクセスしたり、これを作成するための +標準マクロがいくつか定義されている。 これらは \fBcmsg\fP(3) で定義されている補助データ (auxiliary data) 用のマクロと、 +その精神において似ているものである。 netlink ソケットに対してやりとりされるバッファには、 必ずこれらのマクロを使ってアクセスすべきである。 +.TP +\fBNLMSG_ALIGN\fP netlink メッセージの長さを丸めて正しく揃える。 -.TP -.B NLMSG_LENGTH -.\"O Given the payload length, -.\"O .IR len , -.\"O this macro returns the aligned length to store in the -.\"O .I nlmsg_len -.\"O field of the -.\"O .IR nlmsghdr . -格納領域 (payload) の長さ -.I len -を引数にとり、 -.I nlmsghdr -の -.I nlmsg_len -フィールドに代入できる +.TP +\fBNLMSG_LENGTH\fP +格納領域 (payload) の長さ \fIlen\fP を引数にとり、 \fInlmsghdr\fP の \fInlmsg_len\fP フィールドに代入できる 揃えられた長さ (aligned length) を返す。 -.TP -.B NLMSG_SPACE -.\"O Return the number of bytes that a netlink message with payload of -.\"O .I len -.\"O would occupy. -ペイロードの長さが -.I len -の netlink メッセージのバイト数を返す。 -.TP -.B NLMSG_DATA -.\"O Return a pointer to the payload associated with the passed -.\"O .IR nlmsghdr . -与えた -.I nlmsghdr -に関連づけられた格納領域へのポインタを返す。 -.TP +.TP +\fBNLMSG_SPACE\fP +ペイロードの長さが \fIlen\fP の netlink メッセージのバイト数を返す。 +.TP +\fBNLMSG_DATA\fP +与えた \fInlmsghdr\fP に関連づけられた格納領域へのポインタを返す。 +.TP .\" this is bizarre, maybe the interface should be fixed. -.B NLMSG_NEXT -.\"O Get the next -.\"O .I nlmsghdr -.\"O in a multipart message. -.\"O The caller must check if the current nlmsghdr didn't have the NLMSG_DONE -.\"O set\(emthis function doesn't return NULL on end. -.\"O The -.\"O .I len -.\"O argument is an lvalue containing the remaining length -.\"O of the message buffer. -.\"O This macro decrements it by the length of the message header. -マルチパートメッセージにおいて、次の -.I nlmsghdr -を入手する。これを呼び出すときには、 -現在の nlmsghdr で NLMSG_DONE がセットされていないことを -確認しなければならない。この関数は終端で NULL を返さないからである。 -.I len -引数はメッセージバッファの残り長さが入った左辺値である。 -このマクロはこの引数からメッセージヘッダの長さ分を差し引く。 -.TP -.B NLMSG_OK -.\"O Return true if the netlink message is not truncated and -.\"O is in a form suitable for parsing. +\fBNLMSG_NEXT\fP +マルチパートメッセージにおいて、次の \fInlmsghdr\fP を入手する。これを呼び出すときには、 現在の nlmsghdr で NLMSG_DONE +がセットされていないことを 確認しなければならない。この関数は終端で NULL を返さないからである。 \fIlen\fP +引数はメッセージバッファの残り長さが入った左辺値である。 このマクロはこの引数からメッセージヘッダの長さ分を差し引く。 +.TP +\fBNLMSG_OK\fP Netlink メッセージが途切れておらず、かつ解釈可能な形の場合であれば真を返す。 -.TP -.B NLMSG_PAYLOAD -.\"O Return the length of the payload associated with the -.\"O .IR nlmsghdr . -.I nlmsghdr -に関連づけられた格納領域の長さを返す。 -.\"O .SH CONFORMING TO +.TP +\fBNLMSG_PAYLOAD\fP +\fInlmsghdr\fP に関連づけられた格納領域の長さを返す。 .SH 準拠 -.\"O These macros are nonstandard Linux extensions. -これらのマクロは非標準で Linux での拡張である。 +これらのマクロは非標準で、Linux での拡張である。 .SH 注意 -.\"O It is often better to use netlink via -.\"O .I libnetlink -.\"O than via the low-level kernel interface. -通常はカーネルの低レベルインターフェイスよりも、 -.I libnetlink -経由で netlink を用いるほうが良い。 +通常はカーネルの低レベルインターフェイスよりも、 \fIlibnetlink\fP 経由で netlink を用いるほうが良い。 .SH 関連項目 -.BR netlink (7) +\fBnetlink\fP(7) .br -.\"O and ftp://ftp.inr.ac.ru/ip-routing/iproute2* for libnetlink -および libnetlink に関しては ftp://ftp.inr.ac.ru/ip-routing/iproute2* +および libnetlink に関しては ftp://ftp.inr.ac.ru/ip\-routing/iproute2* diff --git a/draft/man3/nextafter.3 b/draft/man3/nextafter.3 index da8eb477..565bc26c 100644 --- a/draft/man3/nextafter.3 +++ b/draft/man3/nextafter.3 @@ -3,259 +3,107 @@ .\" .\" Distributed under GPL .\" Based on glibc infopages +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI all rights reserved. -.\" Translated Mon Jan 27 2003 by Akihiro MOTOKI -.\" Updated 2008-09-18, Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.\"WORD: mantissa 仮数部 -.\"WORD: normalized 正規化された -.\"WORD: subnormal 非正規化の -.\" -.TH NEXTAFTER 3 2010-09-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O nextafter, nextafterf, nextafterl, nexttoward, nexttowardf, nexttowardl \- -.\"O floating-point number manipulation +.\"******************************************************************* +.TH NEXTAFTER 3 2010\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 nextafter, nextafterf, nextafterl, nexttoward, nexttowardf, nexttowardl \- 浮動小数点数の操作 -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "double nextafter(double " x ", double " y ); +\fBdouble nextafter(double \fP\fIx\fP\fB, double \fP\fIy\fP\fB);\fP .br -.BI "float nextafterf(float " x ", float " y ); +\fBfloat nextafterf(float \fP\fIx\fP\fB, float \fP\fIy\fP\fB);\fP .br -.BI "long double nextafterl(long double " x ", long double " y ); +\fBlong double nextafterl(long double \fP\fIx\fP\fB, long double \fP\fIy\fP\fB);\fP .sp -.BI "double nexttoward(double " x ", long double " y ); +\fBdouble nexttoward(double \fP\fIx\fP\fB, long double \fP\fIy\fP\fB);\fP .br -.BI "float nexttowardf(float " x ", long double " y ); +\fBfloat nexttowardf(float \fP\fIx\fP\fB, long double \fP\fIy\fP\fB);\fP .br -.BI "long double nexttowardl(long double " x ", long double " y ); +\fBlong double nexttowardl(long double \fP\fIx\fP\fB, long double \fP\fIy\fP\fB);\fP .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR nextafter (): +\fBnextafter\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || -_ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .br -.BR nextafterf (), -.BR nextafterl (): +\fBnextafterf\fP(), \fBnextafterl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .br -.BR nexttoward (), -.BR nexttowardf (), -.BR nexttowardl (): +\fBnexttoward\fP(), \fBnexttowardf\fP(), \fBnexttowardl\fP(): .RS 4 -_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR nextafter () -.\"O functions return the next representable floating-point value following -.\"O .I x -.\"O in the direction of -.\"O .IR y . -.\"O If -.\"O .I y -.\"O is less than -.\"O .IR x , -.\"O these functions will return the largest representable number less than -.\"O .IR x . -.BR nextafter () -関数群は、\fIy\fP に向かう方向で \fIx\fP のすぐ次の浮動小数点数表現を返す。 -.I y -が -.I x -より小さい場合、 -.I x -より小さい最大の浮動小数点表現の値を返す。 +\fBnextafter\fP() 関数群は、\fIy\fP に向かう方向で \fIx\fP のすぐ次の浮動小数点数表現を返す。 \fIy\fP が \fIx\fP +より小さい場合、 \fIx\fP より小さい最大の浮動小数点表現の値を返す。 -.\"O If \fIx\fP equals \fIy\fP, the functions return \fIy\fP. \fIx\fP が \fIy\fP と等しい場合、\fIy\fP が返される。 -.\"O The -.\"O .BR nexttoward () -.\"O functions do the same as the -.\"O .BR nextafter () -.\"O functions, except that they have a -.\"O .I "long double" -.\"O second argument. -.BR nexttoward () -関数群は、2 番目の引き数が -.I long double -型である点以外、 -.BR nextafter () +\fBnexttoward\fP() 関数群は、2 番目の引き数が \fIlong double\fP 型である点以外、 \fBnextafter\fP() 関数群と同じはたらきをする。 -.\"O .SH RETURN VALUE .SH 返り値 -.\"O On success, -.\"O these functions return the next representable floating-point value after -.\"O .I x -.\"O in the direction of -.\"O .IR y . -成功すると、これらの関数は \fIy\fP に向かう方向で \fIx\fP の -すぐ次の浮動小数点数表現を返す。 +成功すると、これらの関数は \fIy\fP に向かう方向で \fIx\fP の すぐ次の浮動小数点数表現を返す。 -.\"O If -.\"O .I x -.\"O equals -.\"O .IR y , -.\"O then -.\"O .I y -.\"O (cast to the same type as -.\"O .IR x ) -.\"O is returned. -.I x -が -.I y -と等しい場合、 -.RI ( x -と同じ型にキャストされた) -.I y -が返される。 +\fIx\fP が \fIy\fP と等しい場合、 (\fIx\fP と同じ型にキャストされた) \fIy\fP が返される。 -.\"O If -.\"O .I x -.\"O or -.\"O .I y -.\"O is a NaN, -.\"O a NaN is returned. -.I x -か -.I y -が NaN の場合、NaN が返される。 +\fIx\fP か \fIy\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is finite, -.I x -が有限値で .\" e.g., DBL_MAX -.\"O and the result would overflow, -.\"O a range error occurs, -.\"O and the functions return -.\"O .BR HUGE_VAL , -.\"O .BR HUGE_VALF , -.\"O or -.\"O .BR HUGE_VALL , -.\"O respectively, with the correct mathematical sign. -結果がオーバーフローする場合、 -範囲エラー (range error) が発生し、 -各関数はそれぞれ -.BR HUGE_VAL , -.BR HUGE_VALF , -.B HUGE_VALL -を返す。返り値には数学的に正しい符号が付与される。 +\fIx\fP が有限値で 結果がオーバーフローする場合、 範囲エラー (range error) が発生し、 各関数はそれぞれ \fBHUGE_VAL\fP, +\fBHUGE_VALF\fP, \fBHUGE_VALL\fP を返す。返り値には数学的に正しい符号が付与される。 -.\"O If -.\"O .I x -.\"O is not equal to -.\"O .IR y , -.\"O and the correct function result would be subnormal, zero, or underflow, -.\"O a range error occurs, -.\"O and either the correct value (if it can be represented), -.\"O or 0.0, is returned. -.I x -が -.I y -と同じではなく、正しい関数の結果が非正規化数かゼロかアンダーフローの場合、 -範囲エラーが発生し、 -(表現可能な場合には) 正しい値が、(そうでない場合には) 0.0 が返される。 -.\"O .SH ERRORS +\fIx\fP が \fIy\fP と同じではなく、正しい関数の結果が非正規化数かゼロかアンダーフローの場合、 範囲エラーが発生し、 (表現可能な場合には) +正しい値が、(そうでない場合には) 0.0 が返される。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Range error: result overflow -範囲エラー: 結果のオーバーフロー +.TP +範囲エラー (range error): 結果のオーバーフロー .\" e.g., nextafter(DBL_MAX, HUGE_VAL); .\" .I errno .\" is set to .\" .BR ERANGE . -.\"O An overflow floating-point exception -.\"O .RB ( FE_OVERFLOW ) -.\"O is raised. -オーバーフロー浮動小数点例外 -.RB ( FE_OVERFLOW ) -が上がる。 -.TP -.\"O Range error: result is subnormal or underflows +オーバーフロー浮動小数点例外 (\fBFE_OVERFLOW\fP) が上がる。 +.TP 範囲エラー: 結果が非正規化数かアンダーフロー .\" e.g., nextafter(DBL_MIN, 0.0); .\" .I errno .\" is set to .\" .BR ERANGE . -.\"O An underflow floating-point exception -.\"O .RB ( FE_UNDERFLOW ) -.\"O is raised. -アンダーフロー浮動小数点例外 -.RB ( FE_UNDERFLOW ) -が上がる。 +アンダーフロー浮動小数点例外 (\fBFE_UNDERFLOW\fP) が上がる。 .PP -.\"O These functions do not set -.\"O .IR errno . -これらの関数は -.I errno -を設定しない。 .\" FIXME . Is it intentional that these functions do not set errno? .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6799 -.\"O .SH "CONFORMING TO" +これらの関数は \fIerrno\fP を設定しない。 .SH 準拠 -C99, POSIX.1-2001. -.\"O This function is defined in IEC 559 (and the appendix with -.\"O recommended functions in IEEE 754/IEEE 854). -この関数は IEC 559 で定義されている。 -(また IEEE 754/IEEE 854 では付録で推奨関数として定義されている) -.\"O .SH BUGS +C99, POSIX.1\-2001. この関数は IEC 559 で定義されている (また IEEE 754/IEEE 854 +では付録で推奨関数として定義されている)。 .SH バグ -.\"O In glibc version 2.5 and earlier, these functions do not raise an underflow -.\"O floating-point -.\"O .RB ( FE_UNDERFLOW ) -.\"O exception when an underflow occurs. -glibc バージョン 2.5 以前では、アンダーフローが発生した際に、 -これらの関数はアンダーフロー浮動小数点例外 -.RB ( FE_UNDERFLOW ) +glibc バージョン 2.5 以前では、アンダーフローが発生した際に、 これらの関数はアンダーフロー浮動小数点例外 (\fBFE_UNDERFLOW\fP) を上がない。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR nearbyint (3) +\fBnearbyint\fP(3) diff --git a/draft/man3/on_exit.3 b/draft/man3/on_exit.3 index 86426c53..48160bdf 100644 --- a/draft/man3/on_exit.3 +++ b/draft/man3/on_exit.3 @@ -26,99 +26,40 @@ .\" 386BSD man pages .\" Modified 1993-04-02, David Metcalfe .\" Modified 1993-07-25, Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 Seiichi Yoshida -.\" all rights reserved. -.\" Translated 1997-02-14, Seiichi Yoshida -.\" Updated 2002-09-27, Kentaro Shirakata -.\" Updated 2005-02-26, Akihiro MOTOKI -.\" Updated 2008-12-26, Akihiro MOTOKI, LDP v3.15 +.\" This file was generated with po4a. Translate the source file. .\" -.TH ON_EXIT 3 2008-12-05 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH ON_EXIT 3 2008\-12\-05 GNU "Linux Programmer's Manual" .SH 名前 -.\"O on_exit \- register a function to be called at normal process termination on_exit \- プロセスが正常に終了した際に呼ばれる関数を登録する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int on_exit(void (*" function ")(int , void *), void *" arg ); +\fBint on_exit(void (*\fP\fIfunction\fP\fB)(int , void *), void *\fP\fIarg\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR on_exit (): -_BSD_SOURCE || _SVID_SOURCE -.\"O .SH DESCRIPTION +\fBon_exit\fP(): _BSD_SOURCE || _SVID_SOURCE .SH 説明 -.\"O The -.\"O .BR on_exit () -.\"O function registers the given \fIfunction\fP to be -.\"O called at normal process termination, whether via -.\"O .BR exit (3) -.\"O or via return from the program's \fImain\fP(). -.\"O The \fIfunction\fP is passed the status argument given to the last call to -.\"O .BR exit (3) -.\"O and the \fIarg\fP argument from -.\"O .BR on_exit (). -.BR on_exit () -関数は、指定された関数 \fIfunction\fP を、プロセスが -正常に終了した際に呼ばれる関数として登録する。正常な終了とは、 -.BR exit (3) -またはプログラムの \fImain\fP() -関数の中の return 命令による終了である。 -関数 \fIfunction\fP には、直近の -.BR exit (3) -の呼び出しで渡された status 引数と -.BR on_exit () -の \fIarg\fP 引数が渡される。 +\fBon_exit\fP() 関数は、指定された関数 \fIfunction\fP を、プロセスが +正常に終了した際に呼ばれる関数として登録する。正常な終了とは、 \fBexit\fP(3) またはプログラムの \fImain\fP() 関数の中の +return 命令による終了である。 関数 \fIfunction\fP には、直近の \fBexit\fP(3) の呼び出しで渡された status 引数と +\fBon_exit\fP() の \fIarg\fP 引数が渡される。 -.\"O The same function may be registered multiple times: -.\"O it is called once for each registration. -同じ関数を複数回登録してもよい。 -登録された関数は登録 1 回につき 1 回呼び出される。 +同じ関数を複数回登録してもよい。 登録された関数は登録 1 回につき 1 回呼び出される。 -.\"O When a child process is created via -.\"O .BR fork (2), -.\"O it inherits copies of its parent's registrations. -.\"O Upon a successful call to one of the -.\"O .BR exec (3) -.\"O functions, all registrations are removed. -.BR fork (2) -経由で作成された子プロセスは、親プロセスの登録のコピーを継承する。 -.BR exec (3) -群の関数の呼び出しに成功すると、全ての登録が削除される。 -.\"O .SH "RETURN VALUE" +\fBfork\fP(2) で作成された場合、子プロセスは親プロセスの登録のコピーを継承する。 +\fBexec\fP(3) ファミリーの関数の場合、呼び出しに成功すると、 全ての登録が削除される。 .SH 返り値 -.\"O The -.\"O .BR on_exit () -.\"O function returns the value 0 if successful; otherwise -.\"O it returns a nonzero value. -.BR on_exit () -関数は、成功したら 0 を、そうでなければ 0 以外を返す。 -.\"O .SH "CONFORMING TO" +\fBon_exit\fP() 関数は、成功したら 0 を、そうでなければ 0 以外を返す。 .SH 準拠 -.\"O This function comes from SunOS 4, but is also present in -.\"O libc4, libc5 and glibc. -.\"O It no longer occurs in Solaris (SunOS 5). -.\"O Avoid this function, and use the standard -.\"O .BR atexit (3) -.\"O instead. -この関数は SunOS 4 由来であるが、libc4, libc5, glibc にも存在する。 -Solaris (SunOS 5) にはもはや存在しない。 -この関数の使用は避け、代わりに標準の -.BR atexit (3) -を使うこと。 -.\"O .SH "SEE ALSO" +この関数は SunOS 4 由来であるが、libc4, libc5, glibc にも存在する。 Solaris (SunOS 5) +にはもはや存在しない。 この関数の使用は避け、代わりに標準の \fBatexit\fP(3) を使うこと。 .SH 関連項目 -.BR _exit (2), -.BR atexit (3), -.BR exit (3) +\fB_exit\fP(2), \fBatexit\fP(3), \fBexit\fP(3) diff --git a/draft/man3/opendir.3 b/draft/man3/opendir.3 index b5a97dd0..3719b203 100644 --- a/draft/man3/opendir.3 +++ b/draft/man3/opendir.3 @@ -25,204 +25,87 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 18:46:01 1993 by Rik Faith (faith@cs.unc.edu) -.\" Modified 11 June 1995 by Andries Brouwer (aeb@cwi.nl). +.\" Modified 11 June 1995 by Andries Brouwer (aeb@cwi.nl) .\" 2007-07-30 Ulrich Drepper : document fdopendir(). +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 Seiichi Yoshida -.\" all rights reserved. -.\" Translated Fri Feb 14 14:53:20 JST 1997 -.\" by Seiichi Yoshida -.\" Updated & Modified Thu Feb 17 00:37:46 JST 2005 -.\" by Yuichi SATO +.\" This file was generated with po4a. Translate the source file. .\" -.\"WORD: directory stream ディレクトリストリーム -.\"WORD: entry エントリ -.\"WORD: Permission denied アクセス権限がない -.\"WORD: file descriptor ファイルディスクリプタ -.\" -.TH OPENDIR 3 2010-06-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH OPENDIR 3 2010\-06\-20 GNU "Linux Programmer's Manual" .SH 名前 -.\"O opendir, fdopendir \- open a directory opendir, fdopendir \- ディレクトリをオープンする -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .br -.B #include +\fB#include \fP .sp -.BI "DIR *opendir(const char *" name ); -.BI "DIR *fdopendir(int " fd ); +\fBDIR *opendir(const char *\fP\fIname\fP\fB);\fP +\fBDIR *fdopendir(int \fP\fIfd\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR fdopendir (): +\fBfdopendir\fP(): .PD 0 .ad l .RS 4 -.TP 4 -.\"O Since glibc 2.10: +.TP 4 glibc 2.10 以降: _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L -.TP -.\"O Before glibc 2.10: +.TP glibc 2.10 より前: _GNU_SOURCE .RE .ad .PD -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR opendir () -.\"O function opens a directory stream corresponding to the -.\"O directory \fIname\fP, and returns a pointer to the directory stream. -.\"O The stream is positioned at the first entry in the directory. -.BR opendir () -関数はディレクトリ \fIname\fP に対応する -ディレクトリストリームをオープンし、そのストリームへのポインタを返す。 +\fBopendir\fP() 関数はディレクトリ \fIname\fP に対応する ディレクトリストリームをオープンし、そのストリームへのポインタを返す。 ストリームの位置はディレクトリの先頭のエントリに設定される。 -.\"O The -.\"O .BR fdopendir () -.\"O function -.\"O is like -.\"O .BR opendir (), -.\"O but returns a directory stream for the directory referred -.\"O to by the open file descriptor -.\"O .IR fd . -.\"O After a successful call to -.\"O .BR fdopendir (), -.\"O .I fd -.\"O is used internally by the implementation, -.\"O and should not otherwise be used by the application. -.BR fdopendir () -関数は -.BR opendir () -と同様だが、オープン済みのファイルディスクリプタ -.I fd -により参照されるディレクトリに対する -ディレクトリストリームを返す。 -.BR fdopendir () -の呼び出しが成功した後は、 -.I fd -は実装の内部で使用される。アプリケーションは -.I fd -を他の場面で使用すべきではない。 -.\"O .SH "RETURN VALUE" +\fBfdopendir\fP() 関数は \fBopendir\fP() と同様だが、オープン済みのファイルディスクリプタ \fIfd\fP +により参照されるディレクトリに対する ディレクトリストリームを返す。 \fBfdopendir\fP() の呼び出しが成功した後は、 \fIfd\fP +は実装の内部で使用される。アプリケーションは \fIfd\fP を他の場面で使用すべきではない。 .SH 返り値 -.\"O The -.\"O .BR opendir () -.\"O and -.\"O .BR fdopendir () -.\"O functions return a pointer to the directory stream. -.\"O On error, NULL is returned, and -.\"O .I errno -.\"O is set appropriately. -関数 -.BR opendir () -と -.BR fdopendir () -はディレクトリストリームへのポインタを返す。 -エラーの場合は、NULL が返されて、 -.I errno -が適切に設定される。 -.\"O .SH ERRORS +関数 \fBopendir\fP() と \fBfdopendir\fP() はディレクトリストリームへのポインタを返す。 エラーの場合は、NULL +が返されて、 \fIerrno\fP が適切に設定される。 .SH エラー -.TP -.B EACCES -.\"O Permission denied. +.TP +\fBEACCES\fP アクセス権限がない。 -.TP -.B EBADF -.\"O .I fd -.\"O is not a valid file descriptor opened for reading. -.I fd -が読み出し用にオープンされた、有効なファイルディスクリプタではない。 -.TP -.B EMFILE -.\"O Too many file descriptors in use by process. +.TP +\fBEBADF\fP +\fIfd\fP が読み出し用にオープンされた、有効なファイルディスクリプタではない。 +.TP +\fBEMFILE\fP プロセスが使用中のファイルディスクリプタが多すぎる。 -.TP -.B ENFILE -.\"O Too many files are currently open in the system. +.TP +\fBENFILE\fP システムでオープンされているファイルが多すぎる。 -.TP -.B ENOENT -.\"O Directory does not exist, or \fIname\fP is an empty string. +.TP +\fBENOENT\fP ディレクトリが存在しないか、または \fIname\fP が空文字列である。 -.TP -.B ENOMEM -.\"O Insufficient memory to complete the operation. -命令を実行するのに充分なメモリがない。 -.TP -.B ENOTDIR -.\"O \fIname\fP is not a directory. +.TP +\fBENOMEM\fP +操作を完了するのに十分なメモリがない。 +.TP +\fBENOTDIR\fP \fIname\fP はディレクトリではない。 -.\"O .SH VERSIONS .SH バージョン -.\"O .BR fdopendir () -.\"O is available in glibc since version 2.4. -.BR fdopendir () -は glibc 2.4 以降で利用可能である。 -.\"O .SH "CONFORMING TO" +\fBfdopendir\fP() は glibc 2.4 以降で利用可能である。 .SH 準拠 -.\"O .BR opendir () -.\"O is present on SVr4, 4.3BSD, and specified in POSIX.1-2001. -.BR opendir () -は SVr4 と 4.3BSD に存在し、 -POSIX.1-2001 で規定されている。 -.\"O .BR fdopendir () -.\"O is specified in POSIX.1-2008. -.BR fdopendir () -は POSIX.1-2008 で規定されている。 -.\"O .SH NOTES +\fBopendir\fP() は SVr4 と 4.3BSD に存在し、 POSIX.1\-2001 で規定されている。 \fBfdopendir\fP() は +POSIX.1\-2008 で規定されている。 .SH 注意 -.\"O The underlying file descriptor of the directory stream can be obtained using -.\"O .BR dirfd (3). -ディレクトリストリームに対応するファイルディスクリプタは -.BR dirfd (3) -を使用して得ることができる。 +ディレクトリストリームに対応するファイルディスクリプタは \fBdirfd\fP(3) を使用して得ることができる。 -.\"O The -.\"O .BR opendir () -.\"O function sets the close-on-exec flag for the file descriptor underlying the -.\"O .IR "DIR *" . -.\"O The -.\"O .BR fdopendir () -.\"O function leaves the setting of the close-on-exec -.\"O flag unchanged for the file descriptor, -.\"O .IR fd . -.BR opendir () -関数は、 -.I "DIR *" -の背後にあるファイルディスクリプタの close-on-exec フラグを設定する。 -.BR fdopendir () -関数は、ファイルディスクリプタの close-on-exec フラグの設定を変更しない。 -.\"O POSIX.1-200x leaves it unspecified whether a successful call to -.\"O .BR fdopendir () -.\"O will set the close-on-exec flag for the file descriptor, -.\"O .IR fd . -.BR fdopendir () -の呼び出しが成功した際に、ファイルディスクリプタ -.I fd -の close-on-exec を設定するかどうかは、 -POSIX.1-200x では規定されていない。 -.\"O .SH "SEE ALSO" +\fBopendir\fP() 関数は、 \fIDIR *\fP の背後にあるファイルディスクリプタの close\-on\-exec フラグを設定する。 +\fBfdopendir\fP() 関数は、ファイルディスクリプタの close\-on\-exec フラグの設定を変更しない。 \fBfdopendir\fP() +の呼び出しが成功した際に、ファイルディスクリプタ \fIfd\fP の close\-on\-exec を設定するかどうかは、 POSIX.1\-200x +では規定されていない。 .SH 関連項目 -.BR open (2), -.BR closedir (3), -.BR dirfd (3), -.BR readdir (3), -.BR rewinddir (3), -.BR scandir (3), -.BR seekdir (3), -.BR telldir (3) +\fBopen\fP(2), \fBclosedir\fP(3), \fBdirfd\fP(3), \fBreaddir\fP(3), \fBrewinddir\fP(3), +\fBscandir\fP(3), \fBseekdir\fP(3), \fBtelldir\fP(3) diff --git a/draft/man3/posix_fallocate.3 b/draft/man3/posix_fallocate.3 index 9ba24b9a..c0253eca 100644 --- a/draft/man3/posix_fallocate.3 +++ b/draft/man3/posix_fallocate.3 @@ -20,184 +20,67 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2006 Yuichi SATO -.\" all rights reserved. -.\" Translated 2006-07-13, Yuichi SATO . LDP v2.29 -.\" Updated 2010-04-11, Akihiro MOTOKI , LDP v3.24 +.\"******************************************************************* .\" -.TH POSIX_FALLOCATE 3 2010-09-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH POSIX_FALLOCATE 3 2010\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 -.\"O posix_fallocate \- allocate file space posix_fallocate \- ファイルのスペースを確保する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int posix_fallocate(int " fd ", off_t " offset ", off_t " len ); +\fBint posix_fallocate(int \fP\fIfd\fP\fB, off_t \fP\fIoffset\fP\fB, off_t \fP\fIlen\fP\fB);\fP .fi .sp .ad l .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR posix_fallocate (): +\fBposix_fallocate\fP(): .RS 4 _XOPEN_SOURCE\ >=\ 600 || _POSIX_C_SOURCE\ >=\ 200112L .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The function -.\"O .BR posix_fallocate () -.\"O ensures that disk space is allocated for the file referred to by the -.\"O descriptor -.\"O .I fd -.\"O for the bytes in the range starting at -.\"O .I offset -.\"O and continuing for -.\"O .I len -.\"O bytes. -関数 -.BR posix_fallocate () -は、ディスクリプタ -.I fd -で参照されるファイルに対して、ディスクスペースを確実に確保する。 -ディスクスペースは -.I offset -から始まる -.I len -バイトの範囲のバイトである。 -.\"O After a successful call to -.\"O .BR posix_fallocate (), -.\"O subsequent writes to bytes in the specified range are -.\"O guaranteed not to fail because of lack of disk space. -.BR posix_fallocate () -の呼び出しが成功した後、指定された範囲のバイトに対する書き込みは、 -ディスクスペースの不足で失敗しないことが保証される。 +関数 \fBposix_fallocate\fP() は、ディスクリプタ \fIfd\fP で参照されるファイルに対して、ディスクスペースを確実に確保する。 +ディスクスペースは \fIoffset\fP から始まる \fIlen\fP バイトの範囲のバイトである。 \fBposix_fallocate\fP() +の呼び出しが成功した後、指定された範囲のバイトに対する書き込みは、 ディスクスペースの不足で失敗しないことが保証される。 -.\"O If the size of the file is less than -.\"O .IR offset + len , -.\"O then the file is increased to this size; -.\"O otherwise the file size is left unchanged. -ファイルのサイズが -.IR offset + len -より小さい場合、ファイルはこのサイズになるように拡大される。 +ファイルのサイズが \fIoffset\fP+\fIlen\fP より小さい場合、ファイルはこのサイズになるように拡大される。 それ以外の場合、ファイルサイズは変わらない。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O .BR posix_fallocate () -.\"O returns zero on success, or an error number on failure. -.BR posix_fallocate () -は成功した場合、0 を返す。 -失敗した場合、エラー番号を返す。 -.\"O Note that -.\"O .I errno -.\"O is not set. -.I errno +\fBposix_fallocate\fP() は成功した場合、0 を返す。 失敗した場合、エラー番号を返す。 \fIerrno\fP が設定されない点に注意すること。 -.\"O .SH "ERRORS" .SH エラー -.TP -.B EBADF -.\"O .I fd -.\"O is not a valid file descriptor, or is not opened for writing. -.I fd -が有効なディスクリプタでない。 -または書き込み用にオープンされていない。 -.TP -.B EFBIG -.\"O .I offset+len -.\"O exceeds the maximum file size. -.I offset+len -が最大ファイルサイズを超えている。 -.TP -.B EINVAL -.\"O .I offset -.\"O was less than 0, or -.\"O .I len -.\"O was less than or equal to 0. -.I offset -が 0 未満だったか、 -.I len -が 0 以下だった。 -.TP -.B ENODEV -.\"O .I fd -.\"O does not refer to a regular file. -.I fd -が通常のファイルとして参照されていない。 -.TP -.B ENOSPC -.\"O There is not enough space left on the device containing the file -.\"O referred to by -.\"O .IR fd . -.I fd -で参照されるファイルが存在するデバイスに、十分なスペースが残っていない。 -.TP -.B ESPIPE -.\"O .I fd -.\"O refers to a pipe. -.I fd -がパイプを参照している。 -.\"O .SH VERSIONS +.TP +\fBEBADF\fP +\fIfd\fP が有効なファイルディスクリプタでないか、 書き込み用としてオープンされていない。 +.TP +\fBEFBIG\fP +\fIoffset+len\fP が最大ファイルサイズを超えている。 +.TP +\fBEINVAL\fP +\fIoffset\fP が 0 未満だったか、 \fIlen\fP が 0 以下だった。 +.TP +\fBENODEV\fP +\fIfd\fP が通常のファイルとして参照されていない。 +.TP +\fBENOSPC\fP +\fIfd\fP が参照するファイルを含むデバイスに十分な空き領域がない。 +.TP +\fBESPIPE\fP +\fIfd\fP がパイプを参照している。 .SH バージョン -.\"O .BR posix_fallocate () -.\"O is available since glibc 2.1.94. -.BR posix_fallocate () -は glibc 2.1.94 以降で利用可能である。 -.\"O .SH "CONFORMING TO" +\fBposix_fallocate\fP() は glibc 2.1.94 以降で利用可能である。 .SH 準拠 -POSIX.1-2001. +POSIX.1\-2001. -.\"O POSIX.1-2008 says that an implementation -.\"O .I shall -.\"O give the -.\"O .B EINVAL -.\"O error if -.\"O .I len -.\"O was 0, or -.\"O .I offset -.\"O was less than 0. -POSIX.1-2008 では、 -.I len -が 0 の場合、もしくは -.I offset -が 0 未満の場合、 -.B EINVAL -エラーを返すものとされている。 -.\"O POSIX.1-2001 says that an implementation -.\"O .I shall -.\"O give the -.\"O .B EINVAL -.\"O error if -.\"O .I len -.\"O is less than 0, or -.\"O .I offset -.\"O was less than 0, and -.\"O .I may -.\"O give the error if -.\"O .I len -.\"O equals zero. -POSIX.1-2001 では、 -.I len -が 0 未満の場合、もしくは -.I offset -が 0 未満の場合、 -.B EINVAL -エラーを返すものとされている。また、 -.I len -が 0 の場合、 -.B EINVAL -エラーを返してもよいとされている。 -.\"O .SH "SEE ALSO" +POSIX.1\-2008 では、 \fIlen\fP が 0 の場合、もしくは \fIoffset\fP が 0 未満の場合、 \fBEINVAL\fP +エラーを返すものとされている。 POSIX.1\-2001 では、 \fIlen\fP が 0 未満の場合、もしくは \fIoffset\fP が 0 未満の場合、 +\fBEINVAL\fP エラーを返すものとされている。また、 \fIlen\fP が 0 の場合、 \fBEINVAL\fP エラーを返してもよいとされている。 .SH 関連項目 -.BR fallocate (2), -.BR lseek (2), -.BR posix_fadvise (2) +\fBfallocate\fP(2), \fBlseek\fP(2), \fBposix_fadvise\fP(2) diff --git a/draft/man3/posix_memalign.3 b/draft/man3/posix_memalign.3 deleted file mode 100644 index bd23ea97..00000000 --- a/draft/man3/posix_memalign.3 +++ /dev/null @@ -1,412 +0,0 @@ -.\" Copyright (c) 2001 by John Levon -.\" Based in part on GNU libc documentation. -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" License. -.\" -.\" 2001-10-11, 2003-08-22, aeb, added some details -.\" -.\" Japanese Version Copyright (c) 2001 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2001-11-05, Akihiro MOTOKI -.\" Updated 2003-09-05, Akihiro MOTOKI, catch up to v1.60 -.\" Updated 2005-11-19, Akihiro MOTOKI -.\" Updated 2010-04-18, Akihiro MOTOKI, LDP v3.24 -.\" -.\"WORD: obsolete 廃止された -.\"WORD: a multiple of 〜の倍数 -.\"WORD: a power of two 2 のべき乗 -.\" -.TH POSIX_MEMALIGN 3 2010-09-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O posix_memalign, memalign, valloc \- Allocate aligned memory -posix_memalign, memalign, valloc \- アラインメントされたメモリの割り当てを行う -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.B #include -.sp -.BI "int posix_memalign(void **" memptr ", size_t " alignment ", size_t " size ); -.sp -.B #include -.sp -.BI "void *valloc(size_t " size ); -.BI "void *memalign(size_t " boundary ", size_t " size ); -.fi -.sp -.in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): -.in -.sp -.ad l -.BR posix_memalign (): -.RS 4 -_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 -.RE -.sp -.BR valloc (): -.br -.PD 0 -.RS 4 -.TP 4 -.\"O Since glibc 2.12: -glibc 2.12 以降: -.nf -_BSD_SOURCE || - (_XOPEN_SOURCE\ >=\ 500 || - _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) && - !(_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600) -.br -.fi -.TP -.\"O Before glibc 2.12: -glibc 2.12 より前: -_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED -.RE -.PD -.ad b -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The function -.\"O .BR posix_memalign () -.\"O allocates -.\"O .I size -.\"O bytes and places the address of the allocated memory in -.\"O .IR "*memptr" . -.\"O The address of the allocated memory will be a multiple of -.\"O .IR "alignment" , -.\"O which must be a power of two and a multiple of -.\"O .IR "sizeof(void *)". -関数 -.BR posix_memalign () -は、 -.I size -バイトのメモリを割り当て、割り当てられたメモリのアドレスを -.I "*memptr" -に設定する。 -割り当てられたメモリのアドレスは -.I "alignment" -の倍数になっているはずである。 -.I "alignment" -は 2 のべき乗で、かつ -.IR "sizeof(void *)" -の倍数でなければならない。 -.\"O If -.\"O .I size -.\"O is 0, then -.\"O .BR posix_memalign () -.\"O returns either NULL, -.\"O .\" glibc does this: -.\"O or a unique pointer value that can later be successfully passed to -.\"O .BR free (3). -.I size -が 0 の場合、 -.BR posix_memalign () -は NULL か一意なポインタ値を返す。 -このポインタ値は、後で -.BR free (3) -に問題なく渡すことができる。 - -.\"O The obsolete function -.\"O .BR memalign () -.\"O allocates -.\"O .I size -.\"O bytes and returns a pointer to the allocated memory. -.\"O The memory address will be a multiple of -.\"O .IR "boundary" , -.\"O which must be a power of two. -廃止された関数である -.BR memalign () -は、 -.I size -バイトのメモリを割り当て、割り当てられたメモリへのポインタを返す。 -メモリのアドレスは -.I "boundary" -の倍数になっているはずである。 -.I "boundary" -は 2 のべき乗でなければならない。 -.\" The behavior of memalign() for size==0 is as for posix_memalign() -.\" but no standards govern this. - -.\"O The obsolete function -.\"O .BR valloc () -.\"O allocates -.\"O .I size -.\"O bytes and returns a pointer to the allocated memory. -.\"O The memory address will be a multiple of the page size. -.\"O It is equivalent to -.\"O .IR "memalign(sysconf(_SC_PAGESIZE),size)" . -廃止された関数である -.BR valloc () -は -.I size -バイトのメモリを割り当て、割り当てられたメモリへのポインタを返す。 -メモリのアドレスはページサイズの倍数になっているはずである。 -これは -.I "memalign(sysconf(_SC_PAGESIZE),size)" -と等価である。 - -.\"O For all three routines, the memory is not zeroed. -.\" motoki: be not zeroed ってどういう意味? -3 つの関数はいずれもメモリのゼロクリアを行わない。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O .BR memalign () -.\"O and -.\"O .BR valloc () -.\"O return the pointer to the allocated memory, or NULL if the request fails. -.BR memalign () -と -.BR valloc () -は割り当てられたメモリへのポインタを返す。 -割り当てに失敗した場合は NULL を返す。 - -.\"O .BR posix_memalign () -.\"O returns zero on success, or one of the error values listed in the -.\"O next section on failure. -.\"O Note that -.\"O .I errno -.\"O is not set. -.BR posix_memalign () -は成功した場合は 0 を返し、 -失敗した場合は次のセクションに記載されたエラー値のいずれかを返す。 -.I errno -はセットされないことに注意すること。 -.\"O .SH "ERRORS" -.SH エラー -.TP -.B EINVAL -.\"O The -.\"O .I alignment -.\"O argument was not a power of two, or was not a multiple of -.\"O .IR "sizeof(void *)" . -.I alignment -引き数が 2 のべき乗でなかったか、 -.IR "sizeof(void *)" -の倍数でなかった。 -.TP -.B ENOMEM -.\"O There was insufficient memory to fulfill the allocation request. -割り当て要求を満たすのに十分なメモリがなかった。 -.\"O .SH VERSIONS -.SH バージョン -.\"O The functions -.\"O .BR memalign () -.\"O and -.\"O .BR valloc () -.\"O have been available in all Linux libc libraries. -.BR memalign () -と -.BR valloc () -はすべての Linux libc ライブラリで使用可能である。 -.\"O The function -.\"O .BR posix_memalign () -.\"O is available since glibc 2.1.91. -.BR posix_memalign () -は glibc 2.1.91 以降で使用可能である。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -.\"O The function -.\"O .BR valloc () -.\"O appeared in 3.0BSD. -.\"O It is documented as being obsolete in 4.3BSD, -.\"O and as legacy in SUSv2. -.\"O It does not appear in POSIX.1-2001. -関数 -.BR valloc () -は 3.0BSD で登場した。4.3BSD では廃止されたと記載されており、 -SUSv2 では過去の名残だと記載されている。 -POSIX.1-2001 にはもはや存在しない。 -.\"O The function -.\"O .BR memalign () -.\"O appears in SunOS 4.1.3 but not in 4.4BSD. -関数 -.BR memalign () -は SunOS 4.1.3 で登場したが、4.4BSD にはない。 -.\"O The function -.\"O .BR posix_memalign () -.\"O comes from POSIX.1d. -関数 -.BR posix_memalign () -は POSIX.1d に由来する。 -.\"O .SS Headers -.SS ヘッダ -.\"O Everybody agrees that -.\"O .BR posix_memalign () -.\"O is declared in \fI\fP. -.BR posix_memalign () -の宣言を \fI\fP で行うことに関しては、 -皆の意見が一致している。 - -.\"O On some systems -.\"O .BR memalign () -.\"O is declared in \fI\fP instead of \fI\fP. -いくつかのシステムでは、 -.BR memalign () -は \fI\fP ではなく \fI\fP で宣言されている。 - -.\"O According to SUSv2, -.\"O .BR valloc () -.\"O is declared in \fI\fP. -.\"O Libc4,5 and glibc declare it in \fI\fP and perhaps also in -.\"O \fI\fP -.\"O (namely, if -.\"O .B _GNU_SOURCE -.\"O is defined, or -.\"O .B _BSD_SOURCE -.\"O is defined, or, -.\"O for glibc, if -.\"O .B _XOPEN_SOURCE_EXTENDED -.\"O is defined, or, equivalently, -.\"O .B _XOPEN_SOURCE -.\"O is defined to a value not less than 500). -SUSv2 によると、 -.BR valloc () -は -.I -で宣言される。 -libc4,5 や glibc では -.I -で宣言されており、 -さらに -.I -でも宣言されることもある -(具体的には以下のいずれかの場合: -.B _GNU_SOURCE -が定義されている、 -.B _BSD_SOURCE -が定義されている、 -glibc で -.B _XOPEN_SOURCE_EXTENDED -が定義されている、 -glibc で -.B _XOPEN_SOURCE -が 500 より小さくない値に定義されている)。 -.\"O .SH NOTES -.SH 注意 -.\"O On many systems there are alignment restrictions, for example, on buffers -.\"O used for direct block device I/O. -.\"O POSIX specifies the -.\"O .I "pathconf(path,_PC_REC_XFER_ALIGN)" -.\"O call that tells what alignment is needed. -.\"O Now one can use -.\"O .BR posix_memalign () -.\"O to satisfy this requirement. -多くのシステムでは、アラインメントに関して制限がある。例えば、 -ブロックデバイスに対するダイレクト I/O に使用するバッファには -アラインメントに関する制限がある。 -POSIX では、どんなアラインメントが必要かを知るために -.I "pathconf(path,_PC_REC_XFER_ALIGN)" -コールを規定している。ここで -.BR posix_memalign () -を使うと、この必要条件を満たすことができる。 - -.\"O .BR posix_memalign () -.\"O verifies that -.\"O .I alignment -.\"O matches the requirements detailed above. -.BR posix_memalign () -は -.I alignment -が上で詳細に述べた必要条件を満たすかどうかを確かめる。 -.\"O .BR memalign () -.\"O may not check that the -.\"O .I boundary -.\"O argument is correct. -.BR memalign () -は -.I boundary -引き数が正しいかどうかの確認を行わないかもしれない。 - -.\"O POSIX requires that memory obtained from -.\"O .BR posix_memalign () -.\"O can be freed using -.\"O .BR free (3). -POSIX では -.BR posix_memalign () -によって獲得したメモリは -.BR free (3) -を使って解放することができる必要がある。 -.\"O Some systems provide no way to reclaim memory allocated with -.\"O .BR memalign () -.\"O or -.\"O .BR valloc () -いくつかのシステムでは -.BR memalign () -や -.BR valloc () -で割り当てられたメモリを再利用する手段が提供されていない。 -.\"O (because one can only pass to -.\"O .BR free (3) -.\"O a pointer gotten from -.\"O .BR malloc (3), -.\"O while, for example, -.\"O .BR memalign () -.\"O would call -.\"O .BR malloc (3) -.\"O and then align the obtained value). -.\" motoki: while の前後のつながりはこれでいい? -(なぜなら -.BR free (3) -に渡すことができるのは -.BR malloc (3) -から受け取ったポインタだけだが、 -例えば -.BR memalign () -は -.BR malloc (3) -を呼び出し、得た値をアラインメントしてしまうからである) -.\" Other systems allow passing the result of -.\" .BR valloc () -.\" to -.\" .BR free (3), -.\" but not to -.\" .BR realloc (3). -.\"O The glibc implementation -.\"O allows memory obtained from any of these three routines to be -.\"O reclaimed with -.\"O .BR free (3). -glibc の実装では、 -ここに述べた 3 つの関数のいずれで獲得したメモリも -.BR free (3) -で再利用することができる。 - -.\"O glibc -.\"O .BR malloc (3) -.\"O always returns 8-byte aligned memory addresses, so these routines are only -.\"O needed if you require larger alignment values. -glibc の -.BR malloc (3) -は常に 8 バイトにアラインメントされたメモリアドレスを返すので、 -ここで述べた関数が必要になるのは -8 バイトよりも大きなアラインメントが必要な場合だけである。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR brk (2), -.BR getpagesize (2), -.BR free (3), -.BR malloc (3) diff --git a/draft/man3/pow.3 b/draft/man3/pow.3 index 7f18c9fa..ed42f7d9 100644 --- a/draft/man3/pow.3 +++ b/draft/man3/pow.3 @@ -30,348 +30,95 @@ .\" Modified 1995-08-14 by Arnt Gulbrandsen .\" Modified 2002-07-27 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 2003, 2008 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated Mon Sep 7 23:27:52 JST 2003 -.\" by Akihiro MOTOKI -.\" Updated 2008-09-18, Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.TH POW 3 2010-09-12 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH POW 3 2010\-09\-12 "" "Linux Programmer's Manual" .SH 名前 -.\"O pow, powf, powl \- power functions pow, powf, powl \- 累乗関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double pow(double " x ", double " y ); +\fBdouble pow(double \fP\fIx\fP\fB, double \fP\fIy\fP\fB);\fP .br -.BI "float powf(float " x ", float " y ); +\fBfloat powf(float \fP\fIx\fP\fB, float \fP\fIy\fP\fB);\fP .br -.BI "long double powl(long double " x ", long double " y ); +\fBlong double powl(long double \fP\fIx\fP\fB, long double \fP\fIy\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR powf (), -.BR powl (): +\fBpowf\fP(), \fBpowl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR pow () -.\"O function returns the value of \fIx\fP raised to the -.\"O power of \fIy\fP. -.BR pow () -関数は \fIx\fP の \fIy\fP 乗の値を返す。 -.\"O .SH RETURN VALUE +\fBpow\fP() 関数は \fIx\fP の \fIy\fP 乗の値を返す。 .SH 返り値 -.\"O On success, these functions return the value of -.\"O .I x -.\"O to the power of -.\"O .IR y . -成功すると、これらの関数は -.I x -の -.I y -乗の値を返す。 +成功すると、これらの関数は \fIx\fP の \fIy\fP 乗の値を返す。 -.\"O If -.\"O .I x -.\"O is a finite value less than 0, and -.\"O .I y -.\"O is a finite noninteger, a domain error occurs, -.I x -が 0 未満の有限値で -.I y -が整数でない有限値の場合、領域エラー (domain error) が発生し、 .\" The domain error is generated at least as far back as glibc 2.4 -.\"O and a NaN is returned. -NaN が返される。 +\fIx\fP が 0 未満の有限値で \fIy\fP が整数でない有限値の場合、領域エラー (domain error) が発生し、 NaN が返される。 -.\"O If the result overflows, -.\"O a range error occurs, -結果がオーバーフローする場合、 -範囲エラー (range error) が発生し、 .\" The range error is generated at least as far back as glibc 2.4 -.\"O and the functions return -.\"O .BR HUGE_VAL , -.\"O .BR HUGE_VALF , -.\"O or -.\"O .BR HUGE_VALL , -.\"O respectively, with the mathematically correct sign. -各関数はそれぞれ -.BR HUGE_VAL , -.BR HUGE_VALF , -.BR HUGE_VALL -を返す。返り値には数学的に正しい符号が付与される。 +結果がオーバーフローする場合、 範囲エラー (range error) が発生し、 各関数はそれぞれ \fBHUGE_VAL\fP, +\fBHUGE_VALF\fP, \fBHUGE_VALL\fP を返す。返り値には数学的に正しい符号が付与される。 -.\"O If result underflows, and is not representable, -.\"O a range error occurs, -.\"O and 0.0 is returned. -結果がアンダーフローし、その値が表現可能でない場合、 -範囲エラーが発生し、 0.0 が返される。 .\" POSIX.1 does not specify the sign of the zero, .\" but http://sources.redhat.com/bugzilla/show_bug.cgi?id=2678 .\" points out that the zero has the wrong sign in some cases. +結果がアンダーフローし、その値が表現可能でない場合、 範囲エラーが発生し、 0.0 が返される。 -.\"O Except as specified below, if -.\"O .I x -.\"O or -.\"O .I y -.\"O is a NaN, the result is a NaN. -以下で規定されていない場合で、 -.I x -か -.I y -が NaN の場合、返り値は NaN となる。 +以下で規定されていない場合で、 \fIx\fP か \fIy\fP が NaN の場合、返り値は NaN となる。 -.\"O If -.\"O .I x -.\"O is +1, the result is 1.0 (even if -.\"O .I y -.\"O is a NaN). -.I x -が +1 の場合、 -.RI ( y -が NaN であったとしても) 返り値は 1.0 となる。 +\fIx\fP が +1 の場合、 (\fIy\fP が NaN であったとしても) 返り値は 1.0 となる。 -.\"O If -.\"O .I y -.\"O is 0, the result is 1.0 (even if -.\"O .I x -.\"O is a NaN). -.I y -が 0 のå ´åˆã€ -.RI ( x -が NaN であったとしても) 返り値は 1.0 となる。 +\fIy\fP が 0 の場合、 (\fIx\fP が NaN であったとしても) 返り値は 1.0 となる。 -.\"O If -.\"O .I x -.\"O is +0 (\-0), -.\"O and -.\"O .I y -.\"O is an odd integer greater than 0, -.\"O the result is +0 (\-0). -.I x -が +0 (\-0) で -.I y -が 0 より大きな奇数の場合、返り値は +0 (\-0) となる。 +\fIx\fP が +0 (\-0) で \fIy\fP が 0 より大きな奇数の場合、返り値は +0 (\-0) となる。 -.\"O If -.\"O .I x -.\"O is 0, -.\"O and -.\"O .I y -.\"O greater than 0 and not an odd integer, -.\"O the result is +0. -.I x -が 0 で、 -.I y -が 0 より大きく奇数でない場合、返り値は +0 となる。 +\fIx\fP が 0 で、 \fIy\fP が 0 より大きく奇数でない場合、返り値は +0 となる。 -.\"O If -.\"O .I x -.\"O is \-1, -.\"O and -.\"O .I y -.\"O is positive infinity or negative infinity, -.\"O the result is 1.0. -.I x -が \-1 で、 -.I y -が正の無限大か負の無限大の場合、返り値は 1.0 となる。 +\fIx\fP が \-1 で、 \fIy\fP が正の無限大か負の無限大の場合、返り値は 1.0 となる。 -.\"O If the absolute value of -.\"O .I x -.\"O is less than 1, -.\"O and -.\"O .I y -.\"O is negative infinity, -.\"O the result is positive infinity. -.I x -の絶対値が 1 未満で、 -.I y -が負の無限大の場合、返り値は正の無限大となる。 +\fIx\fP の絶対値が 1 未満で、 \fIy\fP が負の無限大の場合、返り値は正の無限大となる。 -.\"O If the absolute value of -.\"O .I x -.\"O is greater than 1, -.\"O and -.\"O .I y -.\"O is negative infinity, -.\"O the result is +0. -.I x -絶対値が 1 より大きく、 -.I y -が負の無限大の場合、返り値は +0 となる。 +\fIx\fP 絶対値が 1 より大きく、 \fIy\fP が負の無限大の場合、返り値は +0 となる。 -.\"O If the absolute value of -.\"O .I x -.\"O is less than 1, -.\"O and -.\"O .I y -.\"O is positive infinity, -.\"O the result is +0. -.I x -の絶対値が 1 未満で、 -.I y -が正の無限大の場合、返り値は +0 となる。 +\fIx\fP の絶対値が 1 未満で、 \fIy\fP が正の無限大の場合、返り値は +0 となる。 -.\"O If the absolute value of -.\"O .I x -.\"O is greater than 1, -.\"O and -.\"O .I y -.\"O is positive infinity, -.\"O the result is positive infinity. -.I x -の絶対値が 1 より大きく、 -.I y -が正の無限大の場合、返り値は正の無限大となる。 +\fIx\fP の絶対値が 1 より大きく、 \fIy\fP が正の無限大の場合、返り値は正の無限大となる。 -.\"O If -.\"O .I x -.\"O is negative infinity, -.\"O and -.\"O .I y -.\"O is an odd integer less than 0, -.\"O the result is \-0. -.I x -が負の無限大で、 -.I y -が 0 より小さい奇数の場合、返り値は \-0 となる。 +\fIx\fP が負の無限大で、 \fIy\fP が 0 より小さい奇数の場合、返り値は \-0 となる。 -.\"O If -.\"O .I x -.\"O is negative infinity, -.\"O and -.\"O .I y -.\"O less than 0 and not an odd integer, -.\"O the result is +0. -.I x -が負の無限大で、 -.I y -が 0 より小さく奇数でない場合、返り値は +0 となる。 +\fIx\fP が負の無限大で、 \fIy\fP が 0 より小さく奇数でない場合、返り値は +0 となる。 -.\"O If -.\"O .I x -.\"O is negative infinity, -.\"O and -.\"O .I y -.\"O is an odd integer greater than 0, -.\"O the result is negative infinity. -.I x -が負の無限大で、 -.I y -が 0 より大きい奇数の場合、返り値は負の無限大となる。 +\fIx\fP が負の無限大で、 \fIy\fP が 0 より大きい奇数の場合、返り値は負の無限大となる。 -.\"O If -.\"O .I x -.\"O is negative infinity, -.\"O and -.\"O .I y -.\"O greater than 0 and not an odd integer, -.\"O the result is positive infinity. -.I x -が負の無限大で、 -.I y -が 0 より大きく奇数でない場合、返り値は正の無限大となる。 +\fIx\fP が負の無限大で、 \fIy\fP が 0 より大きく奇数でない場合、返り値は正の無限大となる。 -.\"O If -.\"O .I x -.\"O is positive infinity, -.\"O and -.\"O .I y -.\"O less than 0, -.\"O the result is +0. -.I x -が正の無限大で、 -.I y -が 0 未満の場合、返り値は +0 となる。 +\fIx\fP が正の無限大で、 \fIy\fP が 0 未満の場合、返り値は +0 となる。 -.\"O If -.\"O .I x -.\"O is positive infinity, -.\"O and -.\"O .I y -.\"O greater than 0, -.\"O the result is positive infinity. -.I x -が正の無限大で、 -.I y -が 0 より大きい場合、返り値は正の無限大となる。 +\fIx\fP が正の無限大で、 \fIy\fP が 0 より大きい場合、返り値は正の無限大となる。 -.\"O If -.\"O .I x -.\"O is +0 or \-0, -.\"O and -.\"O .I y -.\"O is an odd integer less than 0, -.\"O a pole error occurs and -.\"O .BR HUGE_VAL , -.\"O .BR HUGE_VALF , -.\"O or -.\"O .BR HUGE_VALL , -.\"O is returned, -.\"O with the same sign as -.\"O .IR x . -.I x -が +0 か \-0 で、 -.I y -が 0 より小さい奇数の場合、 -極エラー (pole error) が発生し、返り値は -.BR HUGE_VAL , -.BR HUGE_VALF , -.BR HUGE_VALL -となる。 -.I x -と同じ符号が付与される。 +\fIx\fP が +0 か \-0 で、 \fIy\fP が 0 より小さい奇数の場合、 極エラー (pole error) が発生し、返り値は +\fBHUGE_VAL\fP, \fBHUGE_VALF\fP, \fBHUGE_VALL\fP となる。 \fIx\fP と同じ符号が付与される。 -.\"O If -.\"O .I x -.\"O is +0 or \-0, -.\"O and -.\"O .I y -.\"O is less than 0 and not an odd integer, -.\"O a pole error occurs and -.I x -が +0 か \-0 で、 -.I y -が 0 より小さく奇数でない場合、 -極エラーが発生し、 .\" The pole error is generated at least as far back as glibc 2.4 -.\"O .RB + HUGE_VAL , -.\"O .RB + HUGE_VALF , -.\"O or -.\"O .RB + HUGE_VALL , -.\"O is returned. -返り値は -.BR + HUGE_VAL , -.BR + HUGE_VALF , -.BR + HUGE_VALL -となる。 -.\"O .SH ERRORS +\fIx\fP が +0 か \-0 で、 \fIy\fP が 0 より小さく奇数でない場合、 極エラーが発生し、 返り値は \fB+\fPHUGE_VAL\fB,\fP +\fB+\fPHUGE_VALF\fB,\fP \fB+\fPHUGE_VALL となる。 .SH エラー .\" FIXME . review status of this error .\" longstanding bug report for glibc: @@ -393,169 +140,41 @@ NaN が返される。 .\" pow(-1.5,DBL_MAX)=nan .\" EDOM FE_INVALID nan; fail-errno fail-except fail-result; .\" FAIL (expected: range-error-overflow (ERANGE, FE_OVERFLOW); +INF) -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Domain error: \fIx\fP is negative, and \fIy\fP is a finite noninteger +.TP 領域エラー: \fIx\fP が負で、\fIy\fP が整数でない有限値 -.\"O .I errno -.\"O is set to -.\"O .BR EDOM . -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -.I errno -に -.B EDOM -が設定される。 -不正 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) -が上がる。 -.TP -.\"O Pole error: \fIx\fP is zero, and \fIy\fP is negative +\fIerrno\fP に \fBEDOM\fP が設定される。 不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 +.TP 極エラー: \fIx\fP がゼロで、\fIy\fP が負 -.\"O .I errno -.\"O is set to -.\"O .BR ERANGE -.\"O (but see BUGS). -.I errno -に -.B ERANGE -が設定される。 -.\"O A divide-by-zero floating-point exception -.\"O .RB ( FE_DIVBYZERO ) -.\"O is raised. -0 による除算 (divide-by-zero) 浮動小数点例外 -.RB ( FE_DIVBYZERO ) -が上がる。 -.TP -.\"O Range error: the result overflows +\fIerrno\fP に \fBERANGE\fP が設定される (「バグ」の節も参照)。 0 による除算 (divide\-by\-zero) 浮動小数点例外 +(\fBFE_DIVBYZERO\fP) が上がる。 +.TP 範囲エラー: 結果がオーバーフロー -.\"O .I errno -.\"O is set to -.\"O .BR ERANGE . -.\"O An overflow floating-point exception -.\"O .RB ( FE_OVERFLOW ) -.\"O is raised. -.I errno -に -.B ERANGE -が設定される。 -オーバーフロー浮動小数点例外 -.RB ( FE_OVERFLOW ) -が上がる。 -.TP -.\"O Range error: the result underflows +\fIerrno\fP に \fBERANGE\fP が設定される。 オーバーフロー浮動小数点例外 (\fBFE_OVERFLOW\fP) が上がる。 +.TP 範囲エラー: 結果がアンダーフロー -.\"O .I errno -.\"O is set to -.\"O .BR ERANGE . -.\"O An underflow floating-point exception -.\"O .RB ( FE_UNDERFLOW ) -.\"O is raised. -.I errno -に -.B ERANGE -が設定される。 -アンダーフロー浮動小数点例外 -.RB ( FE_UNDERFLOW ) -が上がる。 -.\"O .SH "CONFORMING TO" +\fIerrno\fP に \fBERANGE\fP が設定される。 アンダーフロー浮動小数点例外 (\fBFE_UNDERFLOW\fP) が上がる。 .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 -.\"O .SH BUGS +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH バグ -.\"O In glibc 2.9 and earlier, .\" .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6776 -.\"O when a pole error occurs, -.\"O .I errno -.\"O is set to -.\"O .BR EDOM -.\"O instead of the POSIX-mandated -.\"O .BR ERANGE . -.\"O Since version 2.10, .\" or possibly 2.9, I haven't found the source code change .\" and I don't have a 2.9 system to test -.\"O glibc does the right thing. -glibc 2.9 とそれ以前のバージョンでは、 -極エラーが発生した場合、POSIX で要求されている -.B ERANGE -ではなく -.B EDOM -が -.I errno -に設定される。 -バージョン 2.10 以降の glibc では、正しい動作をする。 +glibc 2.9 とそれ以前のバージョンでは、 極エラーが発生した場合、POSIX で要求されている \fBERANGE\fP ではなく \fBEDOM\fP が +\fIerrno\fP に設定される。 バージョン 2.10 以降の glibc では、正しい動作をする。 -.\"O If -.\"O .I x -.\"O is negative, -.\"O then large negative or positive -.\"O .I y -.\"O values yield a NaN as the function result, with -.\"O .I errno -.\"O set to -.\"O .BR EDOM , -.\"O and an invalid -.\"O .RB ( FE_INVALID ) -.\"O floating-point exception. -.I x -が負の場合、大きな正負の値の -.I y -が与えられると、関数の結果が NaN となり、 -.I errno -に -.B EDOM -が設定され、 -不正浮動小数点例外 -.RB ( FE_INVALID ) -が発生する。 -.\"O For example, with -.\"O .BR pow (), -.\"O one sees this behavior when the absolute value of -.\"O .I y -.\"O is greater than about 9.223373e18. -例えば、 -.BR pow () -では、 -.I y -の絶対値が約 9.223373e18 より大きい場合にこの状況となる。 .\" see bug http://sources.redhat.com/bugzilla/show_bug.cgi?id=3866 .\" and http://sources.redhat.com/bugzilla/show_bug.cgi?id=369 +\fIx\fP が負の場合、大きな正負の値の \fIy\fP が与えられると、関数の結果が NaN となり、 \fIerrno\fP に \fBEDOM\fP が設定され、 +不正浮動小数点例外 (\fBFE_INVALID\fP) が発生する。 例えば、 \fBpow\fP() では、 \fIy\fP の絶対値が約 9.223373e18 +より大きい場合にこの状況となる。 -.\"O In version 2.3.2 and earlier, -glibc バージョン 2.3.2 以前では、 .\" FIXME . Actually, 2.3.2 is the earliest test result I have; so yet .\" to confirm if this error occurs only in 2.3.2. -.\"O when an overflow or underflow error occurs, glibc's -.\"O .BR pow () -.\"O generates a bogus invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O in addition to the overflow or underflow exception. -アンダーフローやアンダーフローのエラーが発生する場合、 -glibc の -.BR pow () -は、オーバーフロー例外やアンダーフロー例外を上げるだけでなく、 -不正浮動小数点例外 -.RB ( FE_INVALID ) -を間違って発生する。 -.\"O .SH "SEE ALSO" +glibc バージョン 2.3.2 以前では、 アンダーフローやアンダーフローのエラーが発生する場合、 glibc の \fBpow\fP() +は、オーバーフロー例外やアンダーフロー例外を上げるだけでなく、 不正浮動小数点例外 (\fBFE_INVALID\fP) を間違って発生する。 .SH 関連項目 -.BR cbrt (3), -.BR cpow (3), -.BR sqrt (3) +\fBcbrt\fP(3), \fBcpow\fP(3), \fBsqrt\fP(3) diff --git a/draft/man3/pow10.3 b/draft/man3/pow10.3 index 9e74d2cc..2b95f11d 100644 --- a/draft/man3/pow10.3 +++ b/draft/man3/pow10.3 @@ -20,56 +20,34 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2005 Yuichi SATO -.\" all rights reserved. -.\" Translated Sun Jan 30 14:07:37 JST 2005 -.\" by Yuichi SATO +.\"******************************************************************* .\" -.TH POW10 3 2008-08-11 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH POW10 3 2008\-08\-11 "" "Linux Programmer's Manual" .SH 名前 -.\"O pow10, pow10f, pow10l \- base-10 power functions pow10, pow10f, pow10l \- 底が 10 の累乗関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" -.B #include +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP .sp -.BI "double pow10(double " x ); +\fBdouble pow10(double \fP\fIx\fP\fB);\fP .br -.BI "float pow10f(float " x ); +\fBfloat pow10f(float \fP\fIx\fP\fB);\fP .br -.BI "long double pow10l(long double " x ); +\fBlong double pow10l(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR pow10 () -.\"O function returns the value of 10 raised to the -.\"O power \fIx\fP. -.BR pow10 () -関数は 10 の \fIx\fP 乗の値を返す。 -.\"O .SH VERSIONS +\fBpow10\fP() 関数は 10 の \fIx\fP 乗の値を返す。 .SH バージョン -.\"O These functions first appeared in glibc in version 2.1. これらの関数は glibc バージョン 2.1 で初めて登場した。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O This is a GNU extension. これは GNU による拡張である。 -.\"O .SH NOTES .SH 注意 -.\"O These functions are identical to the functions listed under -.\"O .BR exp10 (3). -これらの関数は -.BR exp10 (3) -でリストされている関数と同一である。 -.\"O .SH "SEE ALSO" +これらの関数は \fBexp10\fP(3) でリストされている関数と同一である。 .SH 関連項目 -.BR exp10 (3), -.BR pow (3) +\fBexp10\fP(3), \fBpow\fP(3) diff --git a/draft/man3/putenv.3 b/draft/man3/putenv.3 index e0d85da7..f25ea74c 100644 --- a/draft/man3/putenv.3 +++ b/draft/man3/putenv.3 @@ -31,146 +31,57 @@ .\" Modified Mon Oct 11 11:11:11 1999 by Andries Brouwer (aeb@cwi.nl) .\" Modified Wed Nov 10 00:02:26 1999 by Andries Brouwer (aeb@cwi.nl) .\" Modified Sun May 20 22:17:20 2001 by Andries Brouwer (aeb@cwi.nl) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka -.\" all rights reserved. -.\" Translated 1997-12-19, HIROFUMI Nishizuka -.\" Updated 2000-06-18, Kentaro Shirakata -.\" Updated 2005-11-19, Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.TH PUTENV 3 2007-07-26 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH PUTENV 3 2007\-07\-26 GNU "Linux Programmer's Manual" .SH 名前 -.\"O putenv \- change or add an environment variable putenv \- 環境変数の変更または追加 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int putenv(char *" string ); .\" Not: const char * +\fBint putenv(char *\fP\fIstring\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR putenv (): -_SVID_SOURCE || _XOPEN_SOURCE -\"O .SH DESCRIPTION +\fBputenv\fP(): _SVID_SOURCE || _XOPEN_SOURCE .SH 説明 -.\"O The -.\"O .BR putenv () -.\"O function adds or changes the value of environment -.\"O variables. -.\"O The argument \fIstring\fP is of the form \fIname\fP=\fIvalue\fP. -.BR putenv () -関数は、環境変数の追加または値の変更を行う。 -引数 \fIstring\fP は \fIname\fP=\fIvalue\fP という形式を取る。 -.\"O If \fIname\fP does not already exist in the environment, then -.\"O \fIstring\fP is added to the environment. -.\"O If \fIname\fP does exist, -.\"O then the value of \fIname\fP in the environment is changed to -.\"O \fIvalue\fP. -\fIname\fP が環境に存在しない場合は \fIstring\fP が環境に追加される。 -\fIname\fP が環境に存在する場合は \fIname\fP の値は \fIvalue\fP に変更される。 -.\"O The string pointed to by \fIstring\fP becomes part of the environment, -.\"O so altering the string changes the environment. -\fIstring\fP が指している文字列は環境の一部となるので、 +\fBputenv\fP() 関数は、環境変数の追加または値の変更を行う。 引数 \fIstring\fP は \fIname\fP=\fIvalue\fP +という形式を取る。 \fIname\fP が環境に存在しない場合は \fIstring\fP が環境に追加される。 \fIname\fP が環境に存在する場合は +\fIname\fP の値は \fIvalue\fP に変更される。 \fIstring\fP が指している文字列は環境の一部となるので、 文字列を変更すると環境も変更される。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O The -.\"O .BR putenv () -.\"O function returns zero on success, -.\"O or nonzero if an error occurs. -.BR putenv () -関数は、成功した場合 0 を、 -エラーが発生した場合 0 以外を返す。 -.\"O .SH ERRORS +\fBputenv\fP() 関数は、成功した場合 0 を、 エラーが発生した場合 0 以外を返す。 .SH エラー -.TP -.B ENOMEM -.\"O Insufficient space to allocate new environment. +.TP +\fBENOMEM\fP 新しい環境を割り当てるのに十分な空きがない。 .SH 準拠 -SVr4, POSIX.1-2001, 4.3BSD. -.\"O .SH NOTES +SVr4, POSIX.1\-2001, 4.3BSD. .SH 注意 -.\"O The -.\"O .BR putenv () -.\"O function is not required to be reentrant, and the -.\"O one in libc4, libc5 and glibc 2.0 is not, but the glibc 2.1 version is. -.BR putenv () -はリエントラントであることを求められていない。 -libc4, libc5, glibc 2.0 ではリエントラントではない。 +\fBputenv\fP() はリエントラントであることを求められていない。 libc4, libc5, glibc 2.0 ではリエントラントではない。 glibc 2.1 ではリエントラントである。 .LP -.\"O Description for libc4, libc5, glibc: -libc4, libc5, glibc に関する説明: -.\"O If the argument \fIstring\fP is of the form \fIname\fP, -.\"O and does not contain an \(aq=\(aq character, then the variable \fIname\fP -.\"O is removed from the environment. -もし引数 \fIstring\fP が \fIname\fP 単独で、 -\(aq=\(aq 文字を含んでいない場合、環境変数 \fIname\fP は環境から除去される。 -.\"O If -.\"O .BR putenv () -.\"O has to allocate a new array \fIenviron\fP, -.\"O and the previous array was also allocated by -.\"O .BR putenv (), -.\"O then it will be freed. -.\"O In no case will the old storage associated -.\"O to the environment variable itself be freed. -もし -.BR putenv () -が新しい \fIenviron\fP 配列を確保しなければならない時、 -以前の \fIenviron\fP 配列も -.BR putenv () -によって確保されたものならば、 -それは解放される。 +libc4, libc5, glibc に関する説明: もし引数 \fIstring\fP が \fIname\fP 単独で、 \(aq=\(aq +文字を含んでいない場合、環境変数 \fIname\fP は環境から除去される。 もし \fBputenv\fP() が新しい \fIenviron\fP +配列を確保しなければならない時、 以前の \fIenviron\fP 配列も \fBputenv\fP() によって確保されたものならば、 それは解放される。 環境変数そのものに割り当てられた古い記憶領域が解放されることはない。 .LP -.\"O The libc4 and libc5 and glibc 2.1.2 versions conform to SUSv2: -.\"O the pointer \fIstring\fP given to -.\"O .BR putenv () -.\"O is used. -libc4 と libc5 と glibc 2.1.2 では SUSv2 に準拠している。 -.BR putenv () -で与えられたポインタ \fIstring\fP が使われる。 -.\"O In particular, this string becomes part of the environment; -.\"O changing it later will change the environment. -この文字列は環境の一部となり、後で変更すると環境も変わる。 -.\"O (Thus, it is an error is to call -.\"O .BR putenv () -.\"O with an automatic variable -.\"O as the argument, then return from the calling function while \fIstring\fP -.\"O is still part of the environment.) -(従って、 -.BR putenv () -を自動変数を引数として呼び出し、 -\fIstring\fPが環境の一部のままで呼び出した関数から return するとエラーになる) -.\"O However, glibc 2.0-2.1.1 differs: a copy of the string is used. -.\"O On the one hand this causes a memory leak, and on the other hand -.\"O it violates SUSv2. -.\"O This has been fixed in glibc2.1.2. -しかし、glibc 2.0-2.1.1 では異なり、文字列のコピーが使われる。 -これはメモリリークを引き起こすだけでなく、 SUSv2 に違反している。 -これは glibc2.1.2 で修正された。 +libc4 と libc5 と glibc 2.1.2 では SUSv2 に準拠している。 \fBputenv\fP() で与えられたポインタ +\fIstring\fP が使われる。 この文字列は環境の一部となり、後で変更すると環境も変わる。 (従って、 \fBputenv\fP() +を自動変数を引数として呼び出し、 \fIstring\fPが環境の一部のままで呼び出した関数から return するとエラーになる) しかし、glibc +2.0\-2.1.1 では異なり、文字列のコピーが使われる。 これはメモリリークを引き起こすだけでなく、 SUSv2 に違反している。 これは +glibc2.1.2 で修正された。 .LP -.\"O The 4.4BSD version, like glibc 2.0, uses a copy. 4.4BSD バージョンでは、glibc 2.0 と同様にコピーを使う。 .LP -.\"O SUSv2 removes the \fIconst\fP from the prototype, and so does glibc 2.1.3. -SUSv2 ではプロトタイプから \fIconst\fP が取り除かれており、 -glibc 2.1.3 もそのようになっている。 +SUSv2 ではプロトタイプから \fIconst\fP が取り除かれており、 glibc 2.1.3 もそのようになっている。 .SH 関連項目 -.BR clearenv (3), -.BR getenv (3), -.BR setenv (3), -.BR unsetenv (3), -.BR environ (7) +\fBclearenv\fP(3), \fBgetenv\fP(3), \fBsetenv\fP(3), \fBunsetenv\fP(3), \fBenviron\fP(7) diff --git a/draft/man3/qecvt.3 b/draft/man3/qecvt.3 index 8a45f5df..f6d26abe 100644 --- a/draft/man3/qecvt.3 +++ b/draft/man3/qecvt.3 @@ -23,98 +23,39 @@ .\" This replaces an earlier man page written by Walter Harms .\" . .\" -.\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated Sun Sep 22 10:42:23 2002 -.\" by Akihiro MOTOKI +.\"******************************************************************* .\" -.TH QECVT 3 2010-09-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH QECVT 3 2010\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 -.\"O qecvt, qfcvt, qgcvt \- convert a floating-point number to a string qecvt, qfcvt, qgcvt \- 浮動小数点数の文字列への変換 -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "char *qecvt(long double " number ", int " ndigits ", int *" decpt , -.BI "int *" sign ); +\fBchar *qecvt(long double \fP\fInumber\fP\fB, int \fP\fIndigits\fP\fB, int +*\fP\fIdecpt\fP\fB,\fP \fBint *\fP\fIsign\fP\fB);\fP .sp -.BI "char *qfcvt(long double " number ", int " ndigits ", int *" decpt , -.BI "int *" sign ); +\fBchar *qfcvt(long double \fP\fInumber\fP\fB, int \fP\fIndigits\fP\fB, int +*\fP\fIdecpt\fP\fB,\fP \fBint *\fP\fIsign\fP\fB);\fP .sp -.BI "char *qgcvt(long double " number ", int " ndigit ", char *" buf ); +\fBchar *qgcvt(long double \fP\fInumber\fP\fB, int \fP\fIndigit\fP\fB, char *\fP\fIbuf\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR qecvt (), -.BR qfcvt (), -.BR qgcvt (): -_SVID_SOURCE +\fBqecvt\fP(), \fBqfcvt\fP(), \fBqgcvt\fP(): _SVID_SOURCE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The functions -.\"O .BR qecvt (), -.\"O .BR qfcvt () -.\"O and -.\"O .BR qgcvt () -.\"O are identical to -.\"O .BR ecvt (3), -.\"O .BR fcvt (3) -.\"O and -.\"O .BR gcvt (3) -.\"O respectively, except that they use a -.\"O .I "long double" -.\"O argument -.\"O .IR number . -.\"O See -.\"O .BR ecvt (3) -.\"O and -.\"O .BR gcvt (3). -関数 -.BR qecvt (), -.BR qfcvt (), -.BR qgcvt () -は、それぞれ -.BR ecvt (3), -.BR fcvt (3), -.BR gcvt (3) -と同じである。 -引き数 -.I number -が -.I "long double" -型である点だけが異なる。 -.\"O .SH "CONFORMING TO" +関数 \fBqecvt\fP(), \fBqfcvt\fP(), \fBqgcvt\fP() は、それぞれ \fBecvt\fP(3), \fBfcvt\fP(3), +\fBgcvt\fP(3) と同じである。 引き数 \fInumber\fP が \fIlong double\fP 型である点だけが異なる。 .SH 準拠 -SVr4. -.\"O Not seen in most common UNIX implementations, -.\"O but occurs in SunOS. -.\"O Not supported by libc4 and libc5. -.\"O Supported by glibc. -多くの一般的な UNIX には実装されていないが、SunOS には実装されている。 -libc4 と libc5 ではサポートされていないが、 -glibc ではサポートされている。 -.\"O .SH NOTES +SVr4. 多くの一般的な UNIX には実装されていないが、SunOS には実装されている。 libc4 と libc5 +ではサポートされていないが、 glibc ではサポートされている。 .SH 注意 -.\"O These functions are obsolete. -.\"O Instead, -.\"O .BR sprintf (3) -.\"O is recommended. -これらの関数は廃止された。代わりに -.BR sprintf (3) -の使用を推奨する。 -.\"O .SH "SEE ALSO" +これらの関数は廃止された。代わりに \fBsprintf\fP(3) の使用を推奨する。 .SH 関連項目 -.BR ecvt (3), -.BR ecvt_r (3), -.BR gcvt (3), -.BR sprintf (3) +\fBecvt\fP(3), \fBecvt_r\fP(3), \fBgcvt\fP(3), \fBsprintf\fP(3) diff --git a/draft/man3/rand.3 b/draft/man3/rand.3 deleted file mode 100644 index 027d318d..00000000 --- a/draft/man3/rand.3 +++ /dev/null @@ -1,260 +0,0 @@ -.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" References consulted: -.\" Linux libc source code -.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) -.\" 386BSD man pages -.\" -.\" Modified 1993-03-29, David Metcalfe -.\" Modified 1993-04-28, Lars Wirzenius -.\" Modified 1993-07-24, Rik Faith (faith@cs.unc.edu) -.\" Modified 1995-05-18, Rik Faith (faith@cs.unc.edu) to add -.\" better discussion of problems with rand on other systems. -.\" (Thanks to Esa Hyyti{ (ehyytia@snakemail.hut.fi).) -.\" Modified 1998-04-10, Nicola'O^ Lichtmaier -.\" with contribution from Francesco Potorti -.\" Modified 2003-11-15, aeb, added rand_r -.\" -.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi all rights reserved. -.\" Translated 1997-01-21, YOSHINO Takashi -.\" Updated 2000-09-24, Kentaro Shirakata -.\" Updated 2005-03-15, Akihiro MOTOKI -.\" Updated 2008-08-08, Akihiro MOTOKI , LDP v3.05 -.\" -.TH RAND 3 2008-08-29 "" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O rand, srand \- random number generator. -rand, srand \- 乱数を生成する関数 -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.B #include -.sp -.B int rand(void); -.sp -.BI "int rand_r(unsigned int *" seedp ); -.sp -.BI "void srand(unsigned int " seed ); -.fi -.sp -.in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): -.in -.sp -.BR rand_r (): -_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The -.\"O .BR rand () -.\"O function returns a pseudo-random integer in -.\"O the range [0,\ \fBRAND_MAX\fR]. -.BR rand () -関数は [0,\ \fBRAND_MAX\fR] の範囲の疑似乱数整数を返す。 -.PP -.\"O The -.\"O .BR srand () -.\"O function sets its argument as the seed for a new -.\"O sequence of pseudo-random integers to be returned by -.\"O .BR rand (). -.BR srand () -関数は、 -.BR rand () -関数で作られる疑似乱数整数系列の新しい種として、 -その引き数の値を使用する。 -.\"O These sequences are repeatable by calling -.\"O .BR srand () -.\"O with the same -.\"O seed value. -これらの関数を使用して作られた疑似乱数系列は、 -同じ値を引き数として -.BR srand () -を呼ぶことで、 -再現することが可能である。 -.PP -.\"O If no seed value is provided, the -.\"O .BR rand () -.\"O function is automatically -.\"O seeded with a value of 1. -種の値が与えられない場合には、 -.BR rand () -関数は -自動的に 1 を種とする。 -.PP -.\"O The function -.\"O .BR rand () -.\"O is not reentrant or thread-safe, since it -.\"O uses hidden state that is modified on each call. -.\"O This might just be -.\"O the seed value to be used by the next call, or it might be something -.\"O more elaborate. -.\"O In order to get reproducible behavior in a threaded -.\"O application, this state must be made explicit. -.\"O The function -.\"O .BR rand_r () -.\"O is supplied with a pointer to an -.\"O .IR "unsigned int" , -.\"O to be used as state. -.BR rand () -関数は再入可能 (reentrant) ではない、つまりスレッド・セーフではない。 -なぜなら、この関数は隠し状態を持っており、呼び出される度に変更するからである。 -ちょうどこの隠し状態が次の呼び出し時の乱数の種として使われるようなものである。 -実際にはもう少し複雑かもしれないが。スレッドを使用するアプリケーションで -再現可能な動作をさせたい場合には、この隠し状態が原因で再現性がなくなる。 -.BR rand_r () -関数は -.I unsigned int -型の変数へのポインタを引き数にとり、 -この変数を状態格納用に使用する。 -.\"O This is a very small amount of state, so this function will be a weak -.\"O pseudo-random generator. -.\"O Try -.\"O .BR drand48_r (3) -.\"O instead. -状態数が非常に小さいので、この関数はあまりよい擬似乱数生成器とは言えないだろう。 -代わりに -.BR drand48_r (3) -を使うとよい。 -.\"O .SH "RETURN VALUE" -.SH 返り値 -.\"O The -.\"O .BR rand () -.\"O and -.\"O .BR rand_r () -.\"O functions return a value -.\"O between 0 and -.\"O .BR RAND_MAX . -.\"O The -.\"O .BR srand () -.\"O function returns no value. -.BR rand () -と -.BR rand_r () -関数は 0 と -.B RAND_MAX -の間の数を返す。 -.BR srand () -関数は値を返さない。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -.\"O The functions -.\"O .BR rand () -.\"O and -.\"O .BR srand () -.\"O conform to SVr4, 4.3BSD, C89, C99, POSIX.1-2001. -.\"O The function -.\"O .BR rand_r () -.\"O is from POSIX.1-2001. -関数 -.BR rand () -と -.BR srand () -は SVr4, 4.3BSD, C89, C99, POSIX.1-2001 に準拠している。 -関数 -.BR rand_r () -は POSIX.1-2001 に由来する。 -.\"O POSIX.1-2008 marks -.\"O .BR rand_r () -.\"O as obsolete. -POSIX.1-2008 は、 -.BR rand_r () -を廃止予定としている。 -.\"O .SH NOTES -.SH 注意 -.\"O The versions of -.\"O .BR rand () -.\"O and -.\"O .BR srand () -.\"O in the Linux C Library use -.\"O the same random number generator as -.\"O .BR random (3) -.\"O and -.\"O .BR srandom (3), -.\"O so -.\"O the lower-order bits should be as random as the higher-order bits. -.BR rand () -と -.BR srand () -の Linux C Library 版は、 -.BR random (3) -と -.BR srandom (3) -の両関数と同じ乱数生成 -アルゴリズムを使用している。そのため、下位のビットは上位のビットと -同じくらいにランダムである。 -.\"O However, on older -.\"O .BR rand () -.\"O implementations, and on current implementations on different systems, -.\"O the lower-order bits are much less random than the higher-order bits. -.\"O Do not use this function in applications intended to be portable -.\"O when good randomness is needed. -.\"O (Use -.\"O .BR random (3) -.\"O instead.) -しかし、旧版の -.BR rand () -の実装や、他のシステムの現在の実装では、下位のビットが上位のビットほど -ランダムになっていない。移植性を高める場合でも、精度の高い乱数が必要な -アプリケーションではこの関数は使用してはいけない -(代わりに -.BR random (3) -を使うこと)。 -.\"O .SH EXAMPLE -.SH 例 -.\"O POSIX.1-2001 gives the following example of an implementation of -.\"O .BR rand () -.\"O and -.\"O .BR srand (), -.\"O possibly useful when one needs the same sequence on two different machines. -POSIX 1003.1-2003 では、 -.BR rand () -と -.BR srand () -の実装例として以下を挙げている。これは、異なる2つのマシンで同じ乱数系列が -必要な場合には便利であろう。 -.sp -.in +4n -.nf -static unsigned long next = 1; - -.\"O /* RAND_MAX assumed to be 32767 */ -/* RAND_MAX を 32767 と仮定 */ -int myrand(void) { - next = next * 1103515245 + 12345; - return((unsigned)(next/65536) % 32768); -} - -void mysrand(unsigned seed) { - next = seed; -} -.fi -.in -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR drand48 (3), -.BR random (3) diff --git a/draft/man3/random.3 b/draft/man3/random.3 index ff191c52..84ec76ae 100644 --- a/draft/man3/random.3 +++ b/draft/man3/random.3 @@ -28,247 +28,77 @@ .\" Modified Sat Jul 24 18:13:39 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified Sun Aug 20 21:47:07 2000, aeb .\" -.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi -.\" all rights reserved. -.\" Translated 1997-01-21, YOSHINO Takashi -.\" Updated 2008-08-08, Akihiro MOTOKI +.\"******************************************************************* .\" -.\" WORD: nonlinear additive feedback 非線形加法フィードバック -.\" WORD: state array 状態配列 +.\" This file was generated with po4a. Translate the source file. .\" -.TH RANDOM 3 2010-09-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH RANDOM 3 2010\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 -.\"O random, srandom, initstate, setstate \- random number generator random, srandom, initstate, setstate \- 乱数を生成する関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.B long int random(void); -.br -.BI "void srandom(unsigned int " seed ); +\fBlong int random(void);\fP -.BI "char *initstate(unsigned int " seed ", char *" state ", size_t " n ); +\fBvoid srandom(unsigned int \fP\fIseed\fP\fB);\fP -.BI "char *setstate(char *" state ); +\fBchar *initstate(unsigned int \fP\fIseed\fP\fB, char *\fP\fIstate\fP\fB, size_t \fP\fIn\fP\fB);\fP +.br +\fBchar *setstate(char *\fP\fIstate\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR random (), -.BR srandom (), -.BR initstate (), -.BR setstate (): +\fBrandom\fP(), \fBsrandom\fP(), \fBinitstate\fP(), \fBsetstate\fP(): .RS 4 -_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR random () -.\"O function uses a nonlinear additive feedback random -.\"O number generator employing a default table of size 31 long integers to -.\"O return successive pseudo-random numbers in -.\"O the range from 0 to \fBRAND_MAX\fR. -.\"O The period of this random number generator is very large, approximately -.\"O .IR "16\ *\ ((2^31)\ \-\ 1)" . -.BR random () -関数は、非線形加法フィードバックを用いた乱数生成関数である。 -この関数は、0 から \fBRAND_MAX\fR までの疑似乱数を返す。 -そのために 31 個のロング整数からなるデフォルトの表を使用する。 -この乱数を生成する関数の周期はとても長く、およそ -.I "16\ *\ ((2^31)\ \-\ 1)" -である。 +\fBrandom\fP() 関数は、非線形加法フィードバックを用いた乱数生成関数である。 この関数は、0 から \fBRAND_MAX\fP +までの疑似乱数を返す。 そのために 31 個のロング整数からなるデフォルトの表を使用する。 この乱数を生成する関数の周期はとても長く、およそ \fI16\ *\ ((2^31)\ \-\ 1)\fP である。 .PP -.\"O The -.\"O .BR srandom () -.\"O function sets its argument as the seed for a new -.\"O sequence of pseudo-random integers to be returned by -.\"O .BR random (). -.\"O These sequences are repeatable by calling -.\"O .BR srandom () -.\"O with the same -.\"O seed value. -.\"O If no seed value is provided, the -.\"O .BR random () -.\"O function -.\"O is automatically seeded with a value of 1. -.BR srandom () -関数は、 -.BR random () -で返される疑似乱数整数系列の種を設定する。 -そのためには新しい種を引数にして -.BR srandom () -を呼べばよい。 -.BR random () -で生成される系列は、 -引数に同じ種の値を用いて -.BR srandom () -を呼ぶことで再現可能である。 -種の値が与えられない場合には -.BR random () -関数は、自動的に 1 を種に設定する。 +\fBsrandom\fP() 関数は、 \fBrandom\fP() で返される疑似乱数整数系列の種を設定する。 そのためには新しい種を引数にして +\fBsrandom\fP() を呼べばよい。 \fBrandom\fP() で生成される系列は、 引数に同じ種の値を用いて \fBsrandom\fP() +を呼ぶことで再現可能である。 種の値が与えられない場合には \fBrandom\fP() 関数は、自動的に 1 を種に設定する。 .PP -.\"O The -.\"O .BR initstate () -.\"O function allows a state array \fIstate\fP to -.\"O be initialized for use by -.\"O .BR random (). -.\"O The size of the state array -.\"O \fIn\fP is used by -.\"O .BR initstate () -.\"O to decide how sophisticated a -.\"O random number generator it should use\(emthe larger the state array, -.\"O the better the random numbers will be. -.\"O \fIseed\fP is the seed for the -.\"O initialization, which specifies a starting point for the random number -.\"O sequence, and provides for restarting at the same point. -.BR initstate () -関数は、 -.BR random () -で使用される状態配列 -\fIstate\fP を初期化する。 -.BR initstate () -では、状態配列の大きさ \fIn\fP は -使用する関数の乱数生成の性能の程度を決定するために使用される -\(em 状態配列が大きい程、乱数の性能はよくなる。 -\fIseed\fP は初期化のための種である。 -これは乱数系列の開始位置を決定するものであり、 -この値を指定することで同一の開始位置から乱数の生成を +\fBinitstate\fP() 関数は、 \fBrandom\fP() で使用される状態配列 \fIstate\fP を初期化する。 \fBinitstate\fP() +では、状態配列の大きさ \fIn\fP は 使用する関数の乱数生成の性能の程度を決定するために使用される \(em 状態配列が大きい程、乱数の性能はよくなる。 +\fIseed\fP は初期化のための種である。 これは乱数系列の開始位置を決定するものであり、 この値を指定することで同一の開始位置から乱数の生成を 再開することができる。 .PP -.\"O The -.\"O .BR setstate () -.\"O function changes the state array used by the -.\"O .BR random () -.\"O function. -.\"O The state array \fIstate\fP is used for -.\"O random number generation until the next call to -.\"O .BR initstate () -.\"O or -.\"O .BR setstate (). -.\"O \fIstate\fP must first have been initialized -.\"O using -.\"O .BR initstate () -.\"O or be the result of a previous call of -.\"O .BR setstate (). -.BR setstate () -関数は、 -.BR random () -で使用される状態配列を変更する。 -状態配列 \fIstate\fP は、 -.BR initstate () -または -.BR setstate () -が -次に呼び出されるまで、乱数の生成に使用される。 -\fIstate\fP は -.BR initstate () -を用いて最初に初期化されているか、 -以前に呼び出した -.BR setstate () -の結果でなければならない。 -.\"O .SH "RETURN VALUE" +\fBsetstate\fP() 関数は、 \fBrandom\fP() で使用される状態配列を変更する。 状態配列 \fIstate\fP は、 +\fBinitstate\fP() または \fBsetstate\fP() が 次に呼び出されるまで、乱数の生成に使用される。 \fIstate\fP は +\fBinitstate\fP() を用いて最初に初期化されているか、 以前に呼び出した \fBsetstate\fP() の結果でなければならない。 .SH 返り値 -.\"O The -.\"O .BR random () -.\"O function returns a value between 0 and -.\"O .BR RAND_MAX . -.\"O The -.\"O .BR srandom () -.\"O function returns no value. -.\"O The -.\"O .BR initstate () -.\"O function returns a pointer to the previous state array. -.\"O The -.\"O .BR setstate () -.\"O function returns a pointer to the previous state array, or NULL on error. -.BR random () -関数は 0 と -.B RAND_MAX -の間の値を返す。 -.BR srandom () -関数は値を返さない。 -.BR initstate () -関数は直前の状態配列へのポインタを返す。 -.BR setstate () -関数は直前の状態配列へのポインタを返し、 +\fBrandom\fP() 関数は 0 と \fBRAND_MAX\fP の間の値を返す。 \fBsrandom\fP() 関数は値を返さない。 +\fBinitstate\fP() 関数は直前の状態配列へのポインタを返す。 \fBsetstate\fP() 関数は直前の状態配列へのポインタを返し、 エラーの場合は NULL を返す。 -.\"O .SH ERRORS .SH エラー -.TP -.B EINVAL -.\"O A state array of less than 8 bytes was specified to -.\"O .BR initstate (). -.BR initstate () -で8バイトよりも小さい状態配列を指定した。 -.\"O .SH "CONFORMING TO" -.\"O 4.3BSD +.TP +\fBEINVAL\fP +\fBinitstate\fP() で8バイトよりも小さい状態配列を指定した。 .SH 準拠 -4.3BSD, POSIX.1-2001. -.\"O .SH NOTES +4.3BSD, POSIX.1\-2001. .SH 注意 -.\"O Current "optimal" values for the size of the state array \fIn\fP are -.\"O 8, 32, 64, 128, and 256 bytes; other amounts will be rounded down to -.\"O the nearest known amount. -.\"O Using less than 8 bytes will cause an -.\"O error. -状態配列 \fIn\fP の大きさの現在の「最適」値は -8、32、64、128、256 バイトである。 -その他の量を指定した場合には、指定した量を越えない上述の値に -最も近い値になる。 -8 バイト未満の量を指定した場合にはエラーの原因となる。 - -.\"O This function should not be used in cases where multiple threads use -.\"O .BR random () -.\"O and the behavior should be reproducible. -.\"O Use -.\"O .BR random_r (3) -.\"O for that purpose. -複数のスレッドが -.BR random () -を使うような状況では、この関数を使用すべきではない。 -その場合には -.BR random_r (3) +状態配列 \fIn\fP の大きさの現在の「最適」値は 8、32、64、128、256 バイトである。 +その他の量を指定した場合には、指定した量を越えない上述の値に 最も近い値になる。 8 バイト未満の量を指定した場合にはエラーの原因となる。 +.PP +複数のスレッドが \fBrandom\fP() を使うような状況では、この関数を使用すべきではない。 その場合には \fBrandom_r\fP(3) を使うこと。 - -.\"O Random-number generation is a complex topic. -.\"O .I Numerical Recipes in C: The Art of Scientific Computing -.\"O (William H. Press, Brian P. Flannery, Saul A. Teukolsky, William -.\"O T. Vetterling; New York: Cambridge University Press, 2007, 3rd ed.) -.\"O provides an excellent discussion of practical random-number generation -.\"O issues in Chapter 7 (Random Numbers). -乱数の生成は複雑な話題である。 -.I Numerical Recipes in C: The Art of Scientific Computing +.PP +乱数の生成は複雑な話題である。 \fINumerical Recipes in C: The Art of Scientific Computing\fP (William H. Press, Brian P. Flannery, Saul A. Teukolsky, William T. Vetterling; New York: Cambridge University Press, 2007, 3rd ed.) では実用的な乱数生成を論点とした優れた議論が第 7 ç«  (乱数) で展開されている。 - -.\"O For a more theoretical discussion which also covers many practical issues -.\"O in depth, see Chapter 3 (Random Numbers) in Donald E. Knuth's -.\"O .IR "The Art of Computer Programming" , -.\"O volume 2 (Seminumerical Algorithms), 2nd ed.; Reading, Massachusetts: -.\"O Addison-Wesley Publishing Company, 1981. -より理論的な議論については Donald E. Knuth の -.IR "The Art of Computer Programming" , -volume 2 (Seminumerical Algorithms), 2nd ed.; Reading, Massachusetts: -Addison-Wesley Publishing Company, 1981 -の第 3 ç«  (乱数) を見よ。ここでは、 -たくさんの実用的な話題についても深く網羅されている。 -.\"O .SH "SEE ALSO" +.PP +より理論的な議論については Donald E. Knuth の \fIThe Art of Computer Programming\fP, volume 2 +(Seminumerical Algorithms), 2nd ed.; Reading, Massachusetts: Addison\-Wesley +Publishing Company, 1981 の第 3 ç«  (乱数) を見よ。ここでは、 たくさんの実用的な話題についても深く網羅されている。 .SH 関連項目 -.BR drand48 (3), -.BR rand (3), -.BR random_r (3), -.BR srand (3) +\fBdrand48\fP(3), \fBrand\fP(3), \fBrandom_r\fP(3), \fBsrand\fP(3) diff --git a/draft/man3/random_r.3 b/draft/man3/random_r.3 index 8a0152da..eab76f8a 100644 --- a/draft/man3/random_r.3 +++ b/draft/man3/random_r.3 @@ -20,180 +20,70 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2008-08-21, Akihiro MOTOKI , LDP v3.04 -.\" .\" -.TH RANDOM_R 3 2008-03-07 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH RANDOM_R 3 2008\-03\-07 GNU "Linux Programmer's Manual" .SH 名前 -.\"O random_r, srandom_r, initstate_r, setstate_r \- reentrant -.\"O random number generator -random_r, srandom_r, initstate_r, setstate_r \- リエントラントな -乱数生成器 -.\"O .SH SYNOPSIS +random_r, srandom_r, initstate_r, setstate_r \- リエントラントな 乱数生成器 .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int random_r(struct random_data *" buf ", int32_t *" result ); +\fBint random_r(struct random_data *\fP\fIbuf\fP\fB, int32_t *\fP\fIresult\fP\fB);\fP -.BI "int srandom_r(unsigned int " seed ", struct random_data *" buf ); +\fBint srandom_r(unsigned int \fP\fIseed\fP\fB, struct random_data *\fP\fIbuf\fP\fB);\fP -.BI "int initstate_r(unsigned int " seed ", char *" statebuf , -.BI " size_t " statelen ", struct random_data *" buf ); +\fBint initstate_r(unsigned int \fP\fIseed\fP\fB, char *\fP\fIstatebuf\fP\fB,\fP +\fB size_t \fP\fIstatelen\fP\fB, struct random_data *\fP\fIbuf\fP\fB);\fP .br -.BI "int setstate_r(char *" statebuf ", struct random_data *" buf ); +\fBint setstate_r(char *\fP\fIstatebuf\fP\fB, struct random_data *\fP\fIbuf\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR random_r (), -.BR srandom_r (), -.BR initstate_r (), -.BR setstate_r (): +\fBrandom_r\fP(), \fBsrandom_r\fP(), \fBinitstate_r\fP(), \fBsetstate_r\fP(): .RS 4 _SVID_SOURCE || _BSD_SOURCE .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O These functions are the reentrant equivalents -.\"O of the functions described in -.\"O .BR random (3). -.\"O They are suitable for use in multithreaded programs where each thread -.\"O needs to obtain an independent, reproducible sequence of random numbers. -これらの関数は、 -.BR random (3) -で説明されている関数のリエントラント版で、等価な機能を持つ。 -これらは、独立した再現可能な乱数列を各スレッドが得る必要があるような -マルチスレッド・プログラムでの使用に適している。 +これらの関数は、 \fBrandom\fP(3) で説明されている関数のリエントラント版で、等価な機能を持つ。 +これらは、独立した再現可能な乱数列を各スレッドが得る必要があるような マルチスレッド・プログラムでの使用に適している。 -.\"O The -.\"O .BR random_r () -.\"O function is like -.\"O .BR random (3), -.\"O except that instead of using state information maintained -.\"O in a global variable, -.\"O it uses the state information in the argument pointed to by -.\"O .IR buf . -.\"O The generated random number is returned in the argument -.\"O .IR result . -.BR random_r () -関数は -.BR random (3) -と同様だが、 -大域変数 (global variable) で管理される状態情報を使うのではなく、 -.I buf -が指す引き数に格納された状態情報を使う。 -生成された乱数は引き数 -.I result +\fBrandom_r\fP() 関数は \fBrandom\fP(3) と同様だが、 大域変数 (global variable) +で管理される状態情報を使うのではなく、 \fIbuf\fP が指す引き数に格納された状態情報を使う。 生成された乱数は引き数 \fIresult\fP に格納されて返される。 -.\"O The -.\"O .BR srandom_r () -.\"O function is like -.\"O .BR srandom (3), -.\"O except that it initializes the seed for the random number generator -.\"O whose state is maintained in the object pointed to by -.\"O .IR buf , -.\"O instead of the seed associated with the global state variable. -.BR srandom_r () -関数は -.BR srandom (3) -と同様だが、 -大域変数で管理される状態に対応する乱数生成器の種ではなく、 -.I buf -が指すオブジェクトで管理される状態に対応する乱数生成器の種を -初期化する。 +\fBsrandom_r\fP() 関数は \fBsrandom\fP(3) と同様だが、 大域変数で管理される状態に対応する乱数生成器の種ではなく、 +\fIbuf\fP が指すオブジェクトで管理される状態に対応する乱数生成器の種を 初期化する。 -.\"O The -.\"O .BR initstate_r () -.\"O function is like -.\"O .BR initstate (3) -.\"O except that it initializes the state in the object pointed to by -.\"O .IR buf , -.\"O rather than initializing the global state variable. -.BR initstate_r () -関数は -.BR initstate (3) -と同様だが、大域変数で管理される状態を初期化するのではなく、 -.I buf +\fBinitstate_r\fP() 関数は \fBinitstate\fP(3) と同様だが、大域変数で管理される状態を初期化するのではなく、 \fIbuf\fP が指すオブジェクト内の状態を初期化する。 -.\"O The -.\"O .BR setstate_r () -.\"O function is like -.\"O .BR setstate (3) -.\"O except that it modifies the state in the object pointer to by -.\"O .IR buf , -.\"O rather than modifying the global state variable. -.BR setstate_r () -関数は -.BR setstate (3) -と同様だが、大域変数で管理される状態を変更するのではなく、 -.I buf +\fBsetstate_r\fP() 関数は \fBsetstate\fP(3) と同様だが、大域変数で管理される状態を変更するのではなく、 \fIbuf\fP が指すオブジェクト内の状態を変更する。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O All of these functions return 0 on success, or \-1 on error. -これらの関数は、成功すると 0 を返し、 -エラーの場合は \-1 を返す。 -.\"O .SH ERRORS +これらの関数は、成功すると 0 を返し、 エラーの場合は \-1 を返す。 .SH エラー -.TP -.B EINVAL -.\"O A state array of less than 8 bytes was specified to -.\"O .BR initstate_r (). -8 バイトより小さい状態配列が -.BR initstate_r () -に指定された。 -.TP -.B EINVAL -.\"O The -.\"O .I statebuf -.\"O or -.\"O .I buf -.\"O argument to -.\"O .BR setstate_r () -.\"O was NULL. -.BR setstate_r () -の引き数 -.I statebuf -か -.I buf -が NULL であった。 -.TP -.B EINVAL -.\"O The -.\"O .I buf -.\"O or -.\"O .I result -.\"O argument to -.\"O .BR random_r () -.\"O was NULL. -.BR random_r () -の引き数 -.I buf -か -.I result -が NULL であった。 -.\"O .SH "CONFORMING TO" +.TP +\fBEINVAL\fP +8 バイトより小さい状態配列が \fBinitstate_r\fP() に指定された。 +.TP +\fBEINVAL\fP +\fBsetstate_r\fP() の引き数 \fIstatebuf\fP か \fIbuf\fP が NULL であった。 +.TP +\fBEINVAL\fP +\fBrandom_r\fP() の引き数 \fIbuf\fP か \fIresult\fP が NULL であった。 .SH 準拠 -.\"O These functions are nonstandard glibc extensions. -これらの関数は非標準で glibc による拡張である。 .\" These functions appear to be on Tru64, but don't seem to be on .\" Solaris, HP-UX, or FreeBSD. -.\"O .SH "SEE ALSO" +これらの関数は非標準で glibc による拡張である。 .SH 関連項目 -.BR drand48 (3), -.BR rand (3), -.BR random (3) +\fBdrand48\fP(3), \fBrand\fP(3), \fBrandom\fP(3) diff --git a/draft/man3/readdir.3 b/draft/man3/readdir.3 index 18940c1f..95dd0b5d 100644 --- a/draft/man3/readdir.3 +++ b/draft/man3/readdir.3 @@ -31,76 +31,43 @@ .\" Rework discussion of nonstandard structure fields. .\" 2008-09-11, mtk, Document readdir_r(). .\" -.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka -.\" all rights reserved. -.\" Translated 1997-12-24, HIROFUMI Nishizuka -.\" Updated & Modified 2002-03-24, Yuichi SATO -.\" Updated & Modified 2005-01-16, Yuichi SATO -.\" Updated & Modified 2005-09-06, Akihiro MOTOKI -.\" Updated 2008-08-11, Akihiro MOTOKI , LDP v3.05 +.\"******************************************************************* .\" -.TH READDIR 3 2010-09-10 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH READDIR 3 2010\-09\-10 "" "Linux Programmer's Manual" .SH 名前 -.\"O readdir, readdir_r \- read a directory readdir, readdir_r \- ディレクトリを読み込む -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "struct dirent *readdir(DIR *" dirp ); +\fBstruct dirent *readdir(DIR *\fP\fIdirp\fP\fB);\fP .sp -.BI "int readdir_r(DIR *" dirp ", struct dirent *" entry \ -", struct dirent **" result ); +\fBint readdir_r(DIR *\fP\fIdirp\fP\fB, struct dirent *\fP\fIentry\fP\fB, struct dirent **\fP\fIresult\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .ad l .in .sp -.BR readdir_r (): +\fBreaddir_r\fP(): .RS 4 -_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || -_SVID_SOURCE || _POSIX_SOURCE +_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE +|| _POSIX_SOURCE .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR readdir () -.\"O function returns a pointer to a \fIdirent\fP structure -.\"O representing the next directory entry in the directory stream pointed -.\"O to by \fIdirp\fP. -.\"O It returns NULL on reaching the end of the directory stream or if -.\"O an error occurred. -.BR readdir () -関数は、\fIdirp\fP が指すディレクトリストリームの中で、 -次のディレクトリエントリを表す \fIdirent\fP 構造体へのポインタを返す。 -ディレクトリストリームの末尾に達した場合や、 -エラーが発生した場合は、 NULL を返す。 +\fBreaddir\fP() 関数は、\fIdirp\fP が指すディレクトリストリームの中で、 次のディレクトリエントリを表す \fIdirent\fP +構造体へのポインタを返す。 ディレクトリストリームの末尾に達した場合や、 エラーが発生した場合は、 NULL を返す。 .PP -.\"O On Linux, the -.\"O .I dirent -.\"O structure is defined as follows: -Linux では -.I dirent -構造体は以下のように定義されている。 +Linux では \fIdirent\fP 構造体は以下のように定義されている。 .PP .in +4n .nf struct dirent { -.\"O ino_t d_ino; /* inode number */ -.\"O off_t d_off; /* offset to the next dirent */ -.\"O unsigned short d_reclen; /* length of this record */ -.\"O unsigned char d_type; /* type of file; not supported -.\"O by all file system types */ -.\"O char d_name[256]; /* filename */ ino_t d_ino; /* inode 番号 */ off_t d_off; /* 次の dirent へのオフセット */ unsigned short d_reclen; /* このレコードの長さ */ @@ -111,270 +78,78 @@ struct dirent { .fi .in .PP -.\"O The only fields in the -.\"O .I dirent -.\"O structure that are mandated by POSIX.1 are: -.\"O .IR d_name [], -.\"O of unspecified size, with at most -.\"O .B NAME_MAX -.\"O characters preceding the terminating null byte; -.\"O and (as an XSI extension) -.\"O .IR d_ino . -.I dirent -構造体のフィールドで POSIX.1 で要求されているのは、 -.IR d_name [] -と (XSI 拡張での) -.I d_ino -だけである。 -.IR d_name [] -はその大きさも規定されておらず、 -このフィールドには最大で -.B NAME_MAX -個の文字と、それに続く終端の NULL バイトが格納される。 -.\"O The other fields are unstandardized, and not present on all systems; -.\"O see NOTES below for some further details. -他のフィールドは非標準であり、全てのシステムに存在するわけではない。 -詳細については、下記の「注意」を参照のこと。 +\fIdirent\fP 構造体のフィールドで POSIX.1 で要求されているのは、 \fId_name\fP[] と (XSI 拡張での) \fId_ino\fP +だけである。 \fId_name\fP[] はその大きさも規定されておらず、 このフィールドには最大で \fBNAME_MAX\fP 個の文字と、それに続く終端の +NULL バイトが格納される。 他のフィールドは非標準であり、全てのシステムに存在するわけではない。 詳細については、下記の「注意」を参照のこと。 .PP -.\"O The data returned by -.\"O .BR readdir () -.\"O may be overwritten by subsequent calls to -.\"O .BR readdir () -.\"O for the same directory stream. -.BR readdir () -によって返されるデータは、それ以降の同じストリームに対する -.BR readdir () +\fBreaddir\fP() によって返されるデータは、それ以降の同じストリームに対する \fBreaddir\fP() の呼び出しによって上書きされる可能性がある。 -.\"O The -.\"O .BR readdir_r () -.\"O function is a reentrant version of -.\"O .BR readdir (). -.\"O It reads the next directory entry from the directory stream -.\"O .IR dirp , -.\"O and returns it in the caller-allocated buffer pointed to by -.\"O .IR entry . -.\"O (See NOTES for information on allocating this buffer.) -.\"O A pointer to the returned item is placed in -.\"O .IR *result ; -.\"O if the end of the directory stream was encountered, -.\"O then NULL is instead returned in -.\"O .IR *result . -.BR readdir_r () -関数は -.BR readdir () -のリエントラント版である。 -この関数はディレクトリストリーム -.I dirp -から次のディレクトリエントリを読み込み、 -.I entry -が指す呼び出し元が割り当てたバッファにそのエントリを格納して返す -(このバッファの割り当てについては「注意」の節を参照のこと)。 -返されるエントリへのポインタが -.I *result -に格納される。ディレクトリストリームの末尾に達した場合は、 -NULL が -.I *result -に格納される。 -.\"O .SH "RETURN VALUE" +\fBreaddir_r\fP() 関数は \fBreaddir\fP() のリエントラント版である。 この関数はディレクトリストリーム \fIdirp\fP +から次のディレクトリエントリを読み込み、 \fIentry\fP が指す呼び出し元が割り当てたバッファにそのエントリを格納して返す +(このバッファの割り当てについては「注意」の節を参照のこと)。 返されるエントリへのポインタが \fI*result\fP +に格納される。ディレクトリストリームの末尾に達した場合は、 NULL が \fI*result\fP に格納される。 .SH 返り値 -.\"O On success, -.\"O .BR readdir () -.\"O returns a pointer to a -.\"O .I dirent -.\"O structure. -.\"O (This structure may be statically allocated; do not attempt to -.\"O .BR free (3) -.\"O it.) -.\"O If the end of the directory stream is reached, NULL is returned and -.\"O .I errno -.\"O is not changed. -成功すると、 -.BR readdir () -は -.I dirent -構造体へのポインタを返す。 -(この構造体は静的に割り当てられているかもしれない。 -このポインタを -.BR free (3) -しようとしないこと。) -ディレクトリストリームの末尾に達した場合には、NULL が返され、 -.I errno -は変化しない。 -.\"O If an error occurs, NULL is returned and -.\"O .I errno -.\"O is set appropriately. -エラーが発生した場合、NULL が返され、 -.I errno -が適切に設定される。 +成功すると、 \fBreaddir\fP() は \fIdirent\fP 構造体へのポインタを返す。 (この構造体は静的に割り当てられているかもしれない。 +このポインタを \fBfree\fP(3) しようとしないこと。) ディレクトリストリームの末尾に達した場合には、NULL が返され、 \fIerrno\fP +は変化しない。 エラーが発生した場合、NULL が返され、 \fIerrno\fP が適切に設定される。 -.\"O The -.\"O .BR readdir_r () -.\"O function returns 0 on success. -.\"O On error, it returns a positive error number (listed under ERRORS). -.\"O If the end of the directory stream is reached, -.\"O .BR readdir_r () -.\"O returns 0, and returns NULL in -.\"O .IR *result . -成功すると、 -.BR readdir_r () -関数は 0 を返す。 -エラーの場合、(「エラー」の節のリストに載っている) 正のエラー番号を返す。 -ディレクトリストリームの末尾に達した場合、 -.BR readdir_r () -は返り値として 0 を返し、 -.I *result -に NULL を格納する。 -.\"O .SH ERRORS +成功すると、 \fBreaddir_r\fP() 関数は 0 を返す。 エラーの場合、(「エラー」の節のリストに載っている) 正のエラー番号を返す。 +ディレクトリストリームの末尾に達した場合、 \fBreaddir_r\fP() は返り値として 0 を返し、 \fI*result\fP に NULL +を格納する。 .SH エラー -.TP -.B EBADF -.\"O Invalid directory stream descriptor \fIdirp\fP. -ディレクトリストリームディスクリプタ \fIdirp\fP が無効。 -.\"O .SH "CONFORMING TO" +.TP +\fBEBADF\fP +ディレクトリストリームディスクリプタ \fIdirp\fP が無効である。 .SH 準拠 -SVr4, 4.3BSD, POSIX.1-2001. -.\"O .SH NOTES +SVr4, 4.3BSD, POSIX.1\-2001. .SH 注意 -.\"O Only the fields -.\"O .I d_name -.\"O and -.\"O .I d_ino -.\"O are specified in POSIX.1-2001. -.\"O The remaining fields are available on many, but not all systems. -.\"O Under glibc, -.\"O programs can check for the availability of the fields not defined -.\"O in POSIX.1 by testing whether the macros -.\"O .BR _DIRENT_HAVE_D_NAMLEN , -.\"O .BR _DIRENT_HAVE_D_RECLEN , -.\"O .BR _DIRENT_HAVE_D_OFF , -.\"O or -.\"O .B _DIRENT_HAVE_D_TYPE -.\"O are defined. -フィールド -.I d_name -と -.I d_ino -だけが POSIX.1-2001 で規定されている。 -残りのフィールドは多くのシステムに存在するが、全てのシステムに -存在するわけではない。 -glibc では、プログラムが POSIX.1 で定義されていないフィールドが -利用できるかをチェックすることができる。 -チェックするには、マクロ -.BR _DIRENT_HAVE_D_NAMLEN , -.BR _DIRENT_HAVE_D_RECLEN , -.BR _DIRENT_HAVE_D_OFF , -.B _DIRENT_HAVE_D_TYPE +フィールド \fId_name\fP と \fId_ino\fP だけが POSIX.1\-2001 で規定されている。 +残りのフィールドは多くのシステムに存在するが、全てのシステムに 存在するわけではない。 glibc では、プログラムが POSIX.1 +で定義されていないフィールドが 利用できるかをチェックすることができる。 チェックするには、マクロ \fB_DIRENT_HAVE_D_NAMLEN\fP, +\fB_DIRENT_HAVE_D_RECLEN\fP, \fB_DIRENT_HAVE_D_OFF\fP, \fB_DIRENT_HAVE_D_TYPE\fP が定義されているかをテストすればよい。 -.\"O Other than Linux, the -.\"O .I d_type -.\"O field is available mainly only on BSD systems. -.I d_type -フィールドは、Linux 以外では、 -主に BSD 系のシステムにだけ存在する。 -.\"O This field makes it possible to avoid the expense of calling -.\"O .BR lstat (2) -.\"O if further actions depend on the type of the file. -このフィールドを使うと、 -その後の動作がファイルの種別により決まる場合に、 -.BR lstat (2) -を呼び出すコストを避けることができる。 -.\"O If the -.\"O .B _BSD_SOURCE -.\"O feature test macro is defined, -.\"O then glibc defines the following macro constants -.\"O for the value returned in -.\"O .IR d_type : -機能検査マクロ -.B _BSD_SOURCE -が定義された場合、glibc は -.I d_type -で返される値として以下のマクロ定数を定義する。 -.TP 12 -.B DT_BLK -.\"O This is a block device. -ブロック・デバイスである。 -.TP -.B DT_CHR -.\"O This is a character device. -キャラクタ・デバイスである。 -.TP -.B DT_DIR -.\"O This is a directory. +\fId_type\fP フィールドは、Linux 以外では、 主に BSD 系のシステムにだけ存在する。 このフィールドを使うと、 +その後の動作がファイルの種別により決まる場合に、 \fBlstat\fP(2) を呼び出すコストを避けることができる。 機能検査マクロ +\fB_BSD_SOURCE\fP が定義された場合、glibc は \fId_type\fP で返される値として以下のマクロ定数を定義する。 +.TP 12 +\fBDT_BLK\fP +ブロックデバイスである。 +.TP +\fBDT_CHR\fP +キャラクタデバイスである。 +.TP +\fBDT_DIR\fP ディレクトリである。 -.TP -.B DT_FIFO -.\"O This is a named pipe (FIFO). +.TP +\fBDT_FIFO\fP 名前付きパイプ (FIFO) である。 -.TP -.B DT_LNK -.\"O This is a symbolic link. -シンボリック・リンクである。 -.TP -.B DT_REG -.\"O This is a regular file. +.TP +\fBDT_LNK\fP +シンボリックリンクである。 +.TP +\fBDT_REG\fP 通常のファイルである。 -.TP -.B DT_SOCK -.\"O This is a UNIX domain socket. +.TP +\fBDT_SOCK\fP UNIX ドメインソケットである。 -.TP -.B DT_UNKNOWN -.\"O The file type is unknown. -ファイルタイプが不明である。 +.TP +\fBDT_UNKNOWN\fP .\" The glibc manual says that on some systems this is the only .\" value returned +ファイルタイプが不明である。 .PP -.\"O If the file type could not be determined, the value -.\"O .B DT_UNKNOWN -.\"O is returned in -.\"O .IR d_type . -ファイル種別を決定できなかった場合には、 -.I d_type -に -.B DT_UNKNOWN -が入る。 +ファイル種別を決定できなかった場合には、 \fId_type\fP に \fBDT_UNKNOWN\fP が入る。 -.\"O Currently, -.\"O .\" kernel 2.6.27 -.\"O .\" The same sentence is in readdir.2 -.\"O only some file systems (among them: Btrfs, ext2, etx3, and ext4) -.\"O have full support returning the file type in -.\"O .IR d_type . -.\"O All applications must properly handle a return of -.\"O .BR DT_UNKNOWN . -現在のところ、 -.\" カーネル 2.6.27 -.\" 同じ説明文が readdir.2 にもある。 -.I d_type -でファイルタイプを返す機能が完全にサポートされているのは、 -いくつかのファイルシステムにおいてのみである -(Btrfs, ext2, ext3, ext4 はサポートしている)。 -どのアプリケーションも、 -.B DT_UNKNOWN +.\" kernel 2.6.27 +.\" The same sentence is in getdents.2 +現在のところ、 \fId_type\fP でファイルタイプを返す機能が完全にサポートされているのは、 いくつかのファイルシステムにおいてのみである +(Btrfs, ext2, ext3, ext4 はサポートしている)。 どのアプリケーションも、 \fBDT_UNKNOWN\fP が返された際に適切に処理できなければならない。 -.\"O Since POSIX.1 does not specify the size of the -.\"O .I d_name -.\"O field, and other nonstandard fields may precede that field within the -.\"O .I dirent -.\"O structure, portable applications that use -.\"O .BR readdir_r () -.\"O should allocate the buffer whose address is passed in -.\"O .IR entry -.\"O as follows: -POSIX.1 では -.I d_name -フィールドのサイズは規定されておらず、 -.I dirent -構造体の -.I d_name -の後ろに他の非標準のフィールドがあるかもしれないので、 -移植性が必要なアプリケーションで -.BR readdir_r () -を使う場合は -.I entry +POSIX.1 では \fId_name\fP フィールドのサイズは規定されておらず、 \fIdirent\fP 構造体の \fId_name\fP +の後ろに他の非標準のフィールドがあるかもしれないので、 移植性が必要なアプリケーションで \fBreaddir_r\fP() を使う場合は \fIentry\fP に渡すバッファを次のようにして割り当てるべきである。 .in +4n .nf @@ -385,25 +160,8 @@ entryp = malloc(len); .fi .in -.\"O (POSIX.1 requires that -.\"O .I d_name -.\"O is the last field in a -.\"O .IR "struct dirent" .) -(POSIX.1 では -.I "struct dirent" -の最後のフィールドが -.I d_name -であることを要求している。) -.\"O .SH "SEE ALSO" +(POSIX.1 では \fIstruct dirent\fP の最後のフィールドが \fId_name\fP であることを要求している。) .SH 関連項目 -.BR getdents (2), -.BR read (2), -.BR closedir (3), -.BR dirfd (3), -.BR ftw (3), -.BR offsetof (3), -.BR opendir (3), -.BR rewinddir (3), -.BR scandir (3), -.BR seekdir (3), -.BR telldir (3) +\fBgetdents\fP(2), \fBread\fP(2), \fBclosedir\fP(3), \fBdirfd\fP(3), \fBftw\fP(3), +\fBoffsetof\fP(3), \fBopendir\fP(3), \fBrewinddir\fP(3), \fBscandir\fP(3), +\fBseekdir\fP(3), \fBtelldir\fP(3) diff --git a/draft/man3/remainder.3 b/draft/man3/remainder.3 index 214172c9..df734554 100644 --- a/draft/man3/remainder.3 +++ b/draft/man3/remainder.3 @@ -32,293 +32,110 @@ .\" (walter.harms@informatik.uni-oldenburg.de) .\" Modified 2003-11-18, 2004-10-05 aeb .\" -.\" Japanese Version Copyright (c) 2004 Yuichi SATO -.\" and Copyright (c) 2008 Akihiro MOTOKI -.\" Translated 2004-09-02, Yuichi SATO -.\" Updated 2005-02-26, Akihiro MOTOKI -.\" Modified 2005-02-26, Yuichi SATO -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH REMAINDER 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH REMAINDER 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O drem, dremf, dreml, remainder, remainderf, remainderl \- \ -.\"O floating-point remainder function drem, dremf, dreml, remainder, remainderf, remainderl \- 浮動小数点剰余関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.\"O /* The C99 versions */ /* C99 版 */ -.BI "double remainder(double " x ", double " y ); -.BI "float remainderf(float " x ", float " y ); -.BI "long double remainderl(long double " x ", long double " y ); +\fBdouble remainder(double \fP\fIx\fP\fB, double \fP\fIy\fP\fB);\fP +\fBfloat remainderf(float \fP\fIx\fP\fB, float \fP\fIy\fP\fB);\fP +\fBlong double remainderl(long double \fP\fIx\fP\fB, long double \fP\fIy\fP\fB);\fP .sp -.\"O /* Obsolete synonyms */ /* 廃止された別名 */ -.BI "double drem(double " x ", double " y ); -.BI "float dremf(float " x ", float " y ); -.BI "long double dreml(long double " x ", long double " y ); +\fBdouble drem(double \fP\fIx\fP\fB, double \fP\fIy\fP\fB);\fP +\fBfloat dremf(float \fP\fIx\fP\fB, float \fP\fIy\fP\fB);\fP +\fBlong double dreml(long double \fP\fIx\fP\fB, long double \fP\fIy\fP\fB);\fP .sp .fi -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR remainder (): +\fBremainder\fP(): .RS 4 -_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || -_ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .br -.BR remainderf (), -.BR remainderl (): +\fBremainderf\fP(), \fBremainderl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .br -.BR drem (), -.BR dremf (), -.BR dreml (): +\fBdrem\fP(), \fBdremf\fP(), \fBdreml\fP(): .RS 4 _SVID_SOURCE || _BSD_SOURCE .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR remainder () -.\"O function computes the remainder of dividing -.\"O .I x -.\"O by -.\"O .IR y . -.BR remainder () -関数は -.I x -を -.I y -で割った余りを計算する。 -.\"O The return value is -.\"O \fIx\fP\-\fIn\fP*\fIy\fP, -.\"O where -.\"O .I n -.\"O is the value -.\"O .IR "x\ /\ y" , -.\"O rounded to the nearest integer. -返り値は -\fIx\fP\-\fIn\fP*\fIy\fP -である。 -ここで -.I n -は -.I "x\ /\ y" -の値を最も近い整数に丸めたものである。 -.\"O If the absolute value of -.\"O \fIx\fP\-\fIn\fP*\fIy\fP -.\"O is 0.5, -.\"O .I n -.\"O is chosen to be even. -\fIx\fP\-\fIn\fP*\fIy\fP -の絶対値が 0.5 の場合、偶数になるように -.I n -が選ばれる。 +\fBremainder\fP() 関数は \fIx\fP を \fIy\fP で割った余りを計算する。 返り値は \fIx\fP\-\fIn\fP*\fIy\fP である。 ここで +\fIn\fP は \fIx\ /\ y\fP の値を最も近い整数に丸めたものである。 \fIx\fP\-\fIn\fP*\fIy\fP の絶対値が 0.5 の場合、偶数になるように +\fIn\fP が選ばれる。 -.\"O These functions are unaffected by the current rounding mode (see -.\"O .BR fenv (3)). -これらの関数は、現在の丸めモードの影響を受けない (丸めモードについては -.BR fenv (3) -を参照)。 +これらの関数は、現在の丸めモードの影響を受けない (丸めモードについては \fBfenv\fP(3) を参照)。 .LP -.\"O The -.\"O .BR drem () -.\"O function does precisely the same thing. -.BR drem () -関数はこれと全く同じ動作をする。 -.\"O .SH "RETURN VALUE" +\fBdrem\fP() 関数はこれと全く同じ動作をする。 .SH 返り値 -.\"O On success, these -.\"O functions return the floating-point remainder, -.\"O \fIx\fP\-\fIn\fP*\fIy\fP. -.\"O If the return value is 0, it has the sign of -.\"O .IR x . -成功すると、これらの関数は浮動小数点の剰余 \fIx\fP\-\fIn\fP*\fIy\fP を返す。 -返り値が 0 の場合、その符号は -.I x -と同じになる。 +成功すると、これらの関数は浮動小数点の剰余 \fIx\fP\-\fIn\fP*\fIy\fP を返す。 返り値が 0 の場合、その符号は \fIx\fP と同じになる。 -.\"O If -.\"O .I x -.\"O or -.\"O .I y -.\"O is a NaN, a NaN is returned. -.I x -か -.I y -が NaN の場合、NaN が返される。 +\fIx\fP か \fIy\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is an infinity, -.\"O and -.\"O .I y -.\"O is not a NaN, -.\"O a domain error occurs, and -.\"O a NaN is returned. -.I x -が無限大で -.I y -が NaN でない場合、 -領域エラー (domain error) が発生し、NaN が返される。 +\fIx\fP が無限大で \fIy\fP が NaN でない場合、 領域エラー (domain error) が発生し、NaN が返される。 -.\"O If -.\"O .I y -.\"O is zero, .\" FIXME . Instead, glibc gives a domain error even if x is a NaN -.\"O and -.\"O .I x -.\"O is not a NaN, .\" Interestingly, remquo(3) does not have the same problem. -.\"O a domain error occurs, and -.\"O a NaN is returned. -.I y -がゼロで -.I x -が NaN でない場合、 -領域エラーが発生し、NaN が返される。 -.\"O .SH ERRORS +\fIy\fP がゼロで \fIx\fP が NaN でない場合、 領域エラー (domain error) が発生し、NaN が返される。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Domain error: \fIx\fP is an infinity and \fIy\fP is not a NaN +.TP 領域エラー (domain error): \fIx\fP が無限大で \fIy\fP が NaN ではない .\" .I errno .\" is set to .\" .BR EDOM . -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -不正 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) -が上がる。 +不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 .IP -.\"O These functions do not set -.\"O .IR errno -.\"O for this case. -これらの関数は、この場合に -.I errno -を設定しない。 .\" FIXME . Is it intentional that these functions do not set errno? .\" They do set errno for the y == 0 case, below. .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6783 -.TP -.\"O Domain error: \fIy\fP is zero\" [XXX see bug above] and \fIx\fP is not a NaN -領域エラー: \fIy\fP がゼロで \fIx\fP が NaN ではない (下記の「バグ」参照) -.\"O .I errno -.\"O is set to -.\"O .BR EDOM . -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -.I errno -に -.B EDOM -が設定される。 -不正 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) -が上がる。 -.\"O .SH "CONFORMING TO" +これらの関数は、この場合に \fIerrno\fP を設定しない。 +.TP +.\" [XXX see bug above] and \fIx\fP is not a NaN +領域エラー: \fIy\fP がゼロ +\fIerrno\fP に \fBEDOM\fP が設定される。 不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 .SH 準拠 .\" IEC 60559. -.\"O The functions -.\"O .BR remainder (), -.\"O .BR remainderf (), -.\"O and -.\"O .BR remainderl () -.\"O are specified in C99 and POSIX.1-2001. -関数 -.BR remainder (), -.BR remainderf (), -.BR remainderl () -は C99 と POSIX.1-2001 で規定されている。 +関数 \fBremainder\fP(), \fBremainderf\fP(), \fBremainderl\fP() は C99 と POSIX.1\-2001 +で規定されている。 -.\"O The function -.\"O .BR drem () -.\"O is from 4.3BSD. -.\"O The -.\"O .I float -.\"O and -.\"O .I "long double" -.\"O variants -.\"O .BR dremf () -.\"O and -.\"O .BR dreml () -.\"O exist on some systems, such as Tru64 and glibc2. -.\"O Avoid the use of these functions in favor of -.\"O .BR remainder () -.\"O etc. -関数 -.BR drem () -は 4.3BSD に由来する。 -.I float -と -.I "long double" -版の -.BR dremf () -と -.BR dreml () -は、Tru64 や glibc2 のようないくつかのシステムに存在する。 -これらの関数の使用は避けて、 -.BR remainder () -などを使用すること。 -.\"O .SH BUGS +関数 \fBdrem\fP() は 4.3BSD に由来する。 \fIfloat\fP と \fIlong double\fP 版の \fBdremf\fP() と +\fBdreml\fP() は、Tru64 や glibc2 のようないくつかのシステムに存在する。 これらの関数の使用は避けて、 +\fBremainder\fP() などを使用すること。 .SH バグ -.\"O The call -.\"O -.\"O remainder(nan(""), 0); -.\"O -.\"O returns a NaN, as expected, but wrongly causes a domain error; -.\"O it should yield a silent NaN. +呼び出し remainder(nan(""), 0); -の呼び出しを行うと、期待通り Nan が返るが、誤って領域エラーが発生する。 -正しくはエラーなしの Nan となるべきである。 .\" FIXME . this bug occurs as at glibc 2.8. .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6779 -.\"O .SH EXAMPLE +を行うと、期待通り Nan が返るが、誤って領域エラーが発生する。 正しくはエラーなしの Nan となるべきである。 .SH 例 -.\"O The call "remainder(29.0, 3.0)" returns \-1. "remainder(29.0, 3.0)" を呼び出すと \-1 を返す。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR div (3), -.BR fmod (3), -.BR remquo (3) +\fBdiv\fP(3), \fBfmod\fP(3), \fBremquo\fP(3) diff --git a/draft/man3/remquo.3 b/draft/man3/remquo.3 index 5da4eb31..79af4ba6 100644 --- a/draft/man3/remquo.3 +++ b/draft/man3/remquo.3 @@ -4,195 +4,79 @@ .\" Distributed under GPL .\" based on glibc infopages .\" polished, aeb +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 2005 Yuichi SATO -.\" and Copyright (c) 2008 Akihiro MOTOKI -.\" Translated Tue Feb 1 06:39:08 JST 2005 -.\" by Yuichi SATO -.\" Updated 2008-09-16, Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.TH REMQUO 3 2010-09-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH REMQUO 3 2010\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 -.\"O remquo, remquof, remquol \- remainder and part of quotient remquo, remquof, remquol \- 商の一部と剰余を求める -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double remquo(double " x ", double " y ", int *" quo ); +\fBdouble remquo(double \fP\fIx\fP\fB, double \fP\fIy\fP\fB, int *\fP\fIquo\fP\fB);\fP .br -.BI "float remquof(float " x ", float " y ", int *" quo ); +\fBfloat remquof(float \fP\fIx\fP\fB, float \fP\fIy\fP\fB, int *\fP\fIquo\fP\fB);\fP .br -.BI "long double remquol(long double " x ", long double " y ", int *" quo ); +\fBlong double remquol(long double \fP\fIx\fP\fB, long double \fP\fIy\fP\fB, int *\fP\fIquo\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR remquo (), -.BR remquof (), -.BR remquol (): +\fBremquo\fP(), \fBremquof\fP(), \fBremquol\fP(): .RS 4 -_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O These functions compute the remainder and part of the quotient -.\"O upon division of -.\"O .I x -.\"O by -.\"O .IR y . -これらの関数は -.I x -を -.I y -で割ったときの商の一部と剰余を計算する。 -.\"O A few bits of the quotient are stored via the -.\"O .I quo -.\"O pointer. -.\"O The remainder is returned as the function result. -商のいくつかのビットが -.I quo -ポインタを使って格納される。 +これらの関数は \fIx\fP を \fIy\fP で割ったときの商の一部と剰余を計算する。 商のいくつかのビットが \fIquo\fP ポインタを使って格納される。 剰余は関数の結果として返される。 -.\"O The value of the remainder is the same as that computed by the -.\"O .BR remainder (3) -.\"O function. -剰余の値は -.BR remainder (3) -関数で計算されるものと同じである。 +剰余の値は \fBremainder\fP(3) 関数で計算されるものと同じである。 -.\"O The value stored via the -.\"O .I quo -.\"O pointer has the sign of -.\"O .IR "x\ /\ y" -.\"O and agrees with the quotient in at least the low order 3 bits. -.I quo -ポインタを使って格納される値には、 -.I "x\ /\ y" -の符号と最低でも商の下位 3 ビットが含まれる。 +\fIquo\fP ポインタを使って格納される値には、 \fIx\ /\ y\fP の符号と最低でも商の下位 3 ビットが含まれる。 -.\"O For example, \fIremquo(29.0,\ 3.0)\fP returns \-1.0 and might store 2. -.\"O Note that the actual quotient might not fit in an integer. -たとえば \fIremquo(29.0,\ 3.0)\fP は \-1.0 を返し、 -(訳注: quo の指しているものには) 2 が格納される。 -実際の商が整数値にならない点に注意すること。 -.\"O .\" A possible application of this function might be the computation -.\"O .\" of sin(x). Compute remquo(x, pi/2, &quo) or so. -.\" この関数を利用するアプリケーションとしては、 -.\" sin(x) の計算などがあるかもしれない。 -.\" sin(x) では remquo(x, pi/2, &quo) などを計算する。 +.\" A possible application of this function might be the computation +.\" of sin(x). Compute remquo(x, pi/2, &quo) or so. .\" -.\"O .\" glibc, UnixWare: return 3 bits -.\"O .\" MacOS 10: return 7 bits -.\" glibc, UnixWare: 3 ビットを返す。 -.\" MacOS 10: 7 ビットを返す。 -.\"O .SH RETURN VALUE +.\" glibc, UnixWare: return 3 bits +.\" MacOS 10: return 7 bits +たとえば \fIremquo(29.0,\ 3.0)\fP は \-1.0 を返し、 (訳注: quo の指しているものには) 2 が格納される。 +実際の商が整数値にならない点に注意すること。 .SH 返り値 -.\"O On success, these functions return the same value as -.\"O the analogous functions described in -.\"O .BR remainder (3). -成功すると、これらの関数は -.BR remainder (3) -に書かれている同様の関数と同じ値を返す。 +成功すると、これらの関数は \fBremainder\fP(3) に書かれている同様の関数と同じ値を返す。 -.\"O If -.\"O .I x -.\"O or -.\"O .I y -.\"O is a NaN, a NaN is returned. -.I x -か -.I y -が NaN の場合、NaN が返される。 +\fIx\fP か \fIy\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is an infinity, -.\"O and -.\"O .I y -.\"O is not a NaN, -.\"O a domain error occurs, and -.\"O a NaN is returned. -.I x -が無限大で -.I y -が NaN でない場合、 -領域エラー (domain error) が発生し、NaN が返される。 +\fIx\fP が無限大で \fIy\fP が NaN でない場合、 領域エラー (domain error) が発生し、NaN が返される。 -.\"O If -.\"O .I y -.\"O is zero, -.\"O and -.\"O .I x -.\"O is not a NaN, -.\"O a domain error occurs, and -.\"O a NaN is returned. -.I y -がゼロで -.I x -が NaN でない場合、 -領域エラー (domain error) が発生し、NaN が返される。 -.\"O .SH ERRORS +\fIy\fP がゼロで \fIx\fP が NaN でない場合、 領域エラー (domain error) が発生し、NaN が返される。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Domain error: \fIx\fP is an infinity or \fIy\fP is 0, \ -.\"O and the other argument is not a NaN -領域エラー (domain error): \fIx\fP が無限大か \fIy\fP が 0 で、 \ -他の引き数が NaN でない +.TP +領域エラー (domain error): \fIx\fP が無限大か \fIy\fP が 0 で、 他の引き数が NaN でない .\" .I errno .\" is set to .\" .BR EDOM . -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -不正 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) -が上がる。 +不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 .PP -.\"O These functions do not set -.\"O .IR errno . -これらの関数は -.I errno -を設定しない。 .\" FIXME . Is it intentional that these functions do not set errno? .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6802 -.\"O .SH VERSIONS +これらの関数は \fIerrno\fP を設定しない。 .SH バージョン -.\"O These functions first appeared in glibc in version 2.1. これらの関数は glibc バージョン 2.1 で初めて登場した。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. .SH 関連項目 -.BR fmod (3), -.BR logb (3), -.BR remainder (3) +\fBfmod\fP(3), \fBlogb\fP(3), \fBremainder\fP(3) diff --git a/draft/man3/rewinddir.3 b/draft/man3/rewinddir.3 index d5632114..da7ca571 100644 --- a/draft/man3/rewinddir.3 +++ b/draft/man3/rewinddir.3 @@ -26,50 +26,28 @@ .\" 386BSD man pages .\" Modified Sat Jul 24 18:29:11 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified 11 June 1995 by Andries Brouwer (aeb@cwi.nl) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka -.\" all rights reserved. -.\" Translated Wed Dec 24 12:34:00 JST 1997 -.\" by HIROFUMI Nishizuka +.\" This file was generated with po4a. Translate the source file. .\" -.TH REWINDDIR 3 1995-06-11 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH REWINDDIR 3 1995\-06\-11 "" "Linux Programmer's Manual" .SH 名前 -.\"O rewinddir \- reset directory stream rewinddir \- ディレクトリストリームの初期化 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.B #include +\fB#include \fP .sp -.BI "void rewinddir(DIR *" dirp ); +\fBvoid rewinddir(DIR *\fP\fIdirp\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR rewinddir () -.\"O function resets the position of the directory -.\"O stream \fIdirp\fP to the beginning of the directory. -.BR rewinddir () -関数は、ディレクトリストリーム \fIdirp\fP の位置を -ディレクトリの先頭に初期化する。 -.\"O .SH "RETURN VALUE" +\fBrewinddir\fP() 関数は、ディレクトリストリーム \fIdirp\fP の位置を ディレクトリの先頭に初期化する。 .SH 返り値 -.\"O The -.\"O .BR rewinddir () -.\"O function returns no value. -.BR rewinddir () -関数は、値を返さない。 -.\"O .SH "CONFORMING TO" +\fBrewinddir\fP() 関数は、値を返さない。 .SH 準拠 -SVr4, 4.3BSD, POSIX.1-2001. -.\"O .SH "SEE ALSO" +SVr4, 4.3BSD, POSIX.1\-2001. .SH 関連項目 -.BR closedir (3), -.BR opendir (3), -.BR readdir (3), -.BR scandir (3), -.BR seekdir (3), -.BR telldir (3) +\fBclosedir\fP(3), \fBopendir\fP(3), \fBreaddir\fP(3), \fBscandir\fP(3), \fBseekdir\fP(3), +\fBtelldir\fP(3) diff --git a/draft/man3/rint.3 b/draft/man3/rint.3 index 2d2b5030..d93a1f6d 100644 --- a/draft/man3/rint.3 +++ b/draft/man3/rint.3 @@ -22,181 +22,82 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi -.\" and Copyright (c) 2008 Akihiro MOTOKI -.\" Translated Tue Jan 21 20:52:09 JST 1997 -.\" by YOSHINO Takashi -.\" Updated & Modified Fri Jul 6 20:42:59 JST 2001 -.\" by Yuichi SATO -.\" Updated & Modified Sun Jan 16 07:40:37 JST 2005 -.\" by Yuichi SATO -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.\"WORD: mantissa 仮数 +.\" This file was generated with po4a. Translate the source file. .\" -.TH RINT 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH RINT 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O nearbyint, nearbyintf, nearbyintl, rint, rintf, rintl \- round -.\"O to nearest integer nearbyint, nearbyintf, nearbyintl, rint, rintf, rintl \- 最も近い整数に丸める -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double nearbyint(double " x ); +\fBdouble nearbyint(double \fP\fIx\fP\fB);\fP .br -.BI "float nearbyintf(float " x ); +\fBfloat nearbyintf(float \fP\fIx\fP\fB);\fP .br -.BI "long double nearbyintl(long double " x ); +\fBlong double nearbyintl(long double \fP\fIx\fP\fB);\fP .sp -.BI "double rint(double " x ); +\fBdouble rint(double \fP\fIx\fP\fB);\fP .br -.BI "float rintf(float " x ); +\fBfloat rintf(float \fP\fIx\fP\fB);\fP .br -.BI "long double rintl(long double " x ); +\fBlong double rintl(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR nearbyint (), -.BR nearbyintf (), -.BR nearbyintl (): +\fBnearbyint\fP(), \fBnearbyintf\fP(), \fBnearbyintl\fP(): .RS 4 -_XOPEN_SOURCE\ >=\ 600 || _POSIX_C_SOURCE\ >=\ 200112L || _ISOC99_SOURCE; +_XOPEN_SOURCE\ >=\ 600 || _POSIX_C_SOURCE\ >=\ 200112L || +_ISOC99_SOURCE; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .br -.BR rint (): +\fBrint\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .br -.BR rintf (), -.BR rintl (): +\fBrintf\fP(), \fBrintl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR nearbyint () -.\"O functions round their argument to an integer value in floating-point -.\"O format, using the current rounding direction (see -.\"O .BR fesetround (3)) -.\"O and without raising the -.\"O .I inexact -.\"O exception. -.BR nearbyint () -関数群は、現在の丸め方向 -.RB ( fesetround (3) -参照) で引き数を浮動小数点形式の整数に丸める。 -.I inexact -例外を出さない。 +\fBnearbyint\fP() 関数群は、現在の丸め方向 (\fBfesetround\fP(3) 参照) で引き数を浮動小数点形式の整数に丸める。 +\fIinexact\fP 例外を出さない。 .LP -.\"O The -.\"O .BR rint () -.\"O functions do the same, but will raise the -.\"O .I inexact -.\"O exception -.\"O .RB ( FE_INEXACT , -.\"O checkable via -.\"O .BR fetestexcept (3)) -.\"O when the result differs in value from the argument. -.BR rint () -関数群も同じような動作をするが、 -結果が引き数と異なる場合に -.I inexact -例外 -.RB ( FE_INEXACT ) -を出す (この例外は -.BR fetestexcept (3) -経由で確認可能)。 -.\"O .SH "RETURN VALUE" +\fBrint\fP() 関数群も同じような動作をするが、 結果が引き数と異なる場合に \fIinexact\fP 例外 (\fBFE_INEXACT\fP) を出す +(この例外は \fBfetestexcept\fP(3) 経由で確認可能)。 .SH 返り値 -.\"O These functions return the rounded integer value. これらの関数は丸めた整数値を返す。 -.\"O If \fIx\fP is integral, +0, \-0, NaN, or infinite, -.\"O \fIx\fP itself is returned. -\fIx\fP が整数、+0、\-0、NaN、無限大のいずれかの場合、 -\fIx\fP そのものを返す。 -.\"O .SH ERRORS +\fIx\fP が整数、+0、\-0、NaN、無限のいずれかの場合、 \fIx\fP そのものが返される。 .SH エラー -.\"O No errors occur. -エラーは発生しない。 -.\"O POSIX.1-2001 documents a range error for overflows, but see NOTES. -POSIX.1-2001 にはオーバーフローでの範囲エラー (range error) の -記載がある。「注意」の節を参照のこと。 -.\"O .SH "CONFORMING TO" +エラーは発生しない。 POSIX.1\-2001 にはオーバーフローでの範囲エラー (range error) の 記載がある。「注意」の節を参照のこと。 .SH 準拠 -C99, POSIX.1-2001. -.\"O .SH NOTES +C99, POSIX.1\-2001. .SH 注意 -.\"O SUSv2 and POSIX.1-2001 contain text about overflow (which might set -.\"O .I errno -.\"O to -.\"O .BR ERANGE , -.\"O or raise an -.\"O .B FE_OVERFLOW -.\"O exception). -SUSv2 と POSIX.1-2001 にはオーバーフローに関する記述があり、 -オーバーフローの場合には、 -.I errno -を -.B ERANGE -に設定するか、 -.B FE_OVERFLOW -例外を発生することとされている。 -.\"O In practice, the result cannot overflow on any current machine, -.\"O so this error-handling stuff is just nonsense. -実際のところ、どの現行のマシンでも結果がオーバーフローを起こすことはないので、 -このエラー処理は意味がない。 -.\"O (More precisely, overflow can happen only when the maximum value -.\"O of the exponent is smaller than the number of mantissa bits. -.\"O For the IEEE-754 standard 32-bit and 64-bit floating-point numbers -.\"O the maximum value of the exponent is 128 (respectively, 1024), -.\"O and the number of mantissa bits is 24 (respectively, 53).) -(より正確に言うと、オーバーフローは指数部の最大値が -仮数部を表すビットの数より小さい場合にしか起こらない。 -IEEE-754 規格の 32 ビットと 64 ビットの浮動小数では、 -指数部の最大値はそれぞれ 128 と 1024 であり、 -仮数部のビット数はそれぞれ 24 と 53 である。) +SUSv2 と POSIX.1\-2001 にはオーバーフローに関する記述があり、 オーバーフローの場合には、 \fIerrno\fP を \fBERANGE\fP +に設定するか、 \fBFE_OVERFLOW\fP 例外を発生することとされている。 +実際のところ、どの現行のマシンでも結果がオーバーフローを起こすことはないので、 このエラー処理は意味がない。 +(より正確に言うと、オーバーフローは指数部の最大値が 仮数部を表すビットの数より小さい場合にしか起こらない。 IEEE\-754 規格の 32 ビットと +64 ビットの浮動小数では、 指数部の最大値はそれぞれ 128 と 1024 であり、 仮数部のビット数はそれぞれ 24 と 53 である。) -.\"O If you want to store the rounded value in an integer type, -.\"O you probably want to use one of the functions described in -.\"O .BR lrint (3) -.\"O instead. -丸めた値を整数型に格納した場合には、おそらくこの関数ではなく -.BR lrint (3) -に載っている関数のどれかを使いたいのだろう。 -.\"O .SH "SEE ALSO" +丸めた値を整数型に格納した場合には、おそらくこの関数ではなく \fBlrint\fP(3) に載っている関数のどれかを使いたいのだろう。 .SH 関連項目 -.BR ceil (3), -.BR floor (3), -.BR lrint (3), -.BR round (3), -.BR trunc (3) +\fBceil\fP(3), \fBfloor\fP(3), \fBlrint\fP(3), \fBround\fP(3), \fBtrunc\fP(3) diff --git a/draft/man3/round.3 b/draft/man3/round.3 index 94cfeaa2..b46c0060 100644 --- a/draft/man3/round.3 +++ b/draft/man3/round.3 @@ -22,151 +22,63 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2001, 2005 Yuichi SATO -.\" and Copyright (c) 2008 Akihiro MOTOKI -.\" Translated Fri Jul 13 20:33:41 JST 2001 -.\" by Yuichi SATO -.\" Updated & Modified Sun Jan 16 07:59:12 JST 2005 -.\" by Yuichi SATO -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.\"WORD: mantissa 仮数 +.\" This file was generated with po4a. Translate the source file. .\" -.TH ROUND 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH ROUND 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O round, roundf, roundl \- round to nearest integer, away from zero round, roundf, roundl \- 最も近い整数値に丸める (2 つの整数の中間値の場合は 0 から遠い方に丸める) -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double round(double " x ); +\fBdouble round(double \fP\fIx\fP\fB);\fP .br -.BI "float roundf(float " x ); +\fBfloat roundf(float \fP\fIx\fP\fB);\fP .br -.BI "long double roundl(long double " x ); +\fBlong double roundl(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR round (), -.BR roundf (), -.BR roundl (): +\fBround\fP(), \fBroundf\fP(), \fBroundl\fP(): .RS 4 -_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O These functions round \fIx\fP to the nearest integer, but -.\"O round halfway cases away from zero (regardless of the current rounding -.\"O direction, see -.\"O .BR fenv (3)), -.\"O instead of to the nearest even integer like -.\"O .BR rint (3). -これらの関数は \fIx\fP を最も近い整数値に丸める。 -2 つの整数の中間値の場合は、 -.BR rint (3) -のように最も近い偶数に丸めたりせずに、 -(現在の丸め方向に関係なく) 0 から遠い方に丸める -(丸め方向については -.BR fenv (3) -を参照)。 +これらの関数は \fIx\fP を最も近い整数値に丸める。 2 つの整数の中間値の場合は、 \fBrint\fP(3) のように最も近い偶数に丸めたりせずに、 +(現在の丸め方向に関係なく) 0 から遠い方に丸める (丸め方向については \fBfenv\fP(3) を参照)。 -.\"O For example, -.\"O .IR round(0.5) -.\"O is 1.0, and -.\"O .IR round(\-0.5) -.\"O is \-1.0. -例えば、 -.I round(0.5) -は 1.0 で、 -.I round(\-0.5) -は \-1.0 である。 -.\"O .SH "RETURN VALUE" +例えば、 \fIround(0.5)\fP は 1.0 で、 \fIround(\-0.5)\fP は \-1.0 である。 .SH 返り値 -.\"O These functions return the rounded integer value. これらの関数は丸めた整数値を返す。 -.\"O If \fIx\fP is integral, +0, \-0, NaN, or infinite, -.\"O \fIx\fP itself is returned. -\fIx\fP が整数、+0、\-0、NaN、無限のいずれかの場合、 -\fIx\fP そのものが返される。 -.\"O .SH ERRORS +\fIx\fP が整数、+0、\-0、NaN、無限のいずれかの場合、 \fIx\fP そのものが返される。 .SH エラー -.\"O No errors occur. -エラーは発生しない。 -.\"O POSIX.1-2001 documents a range error for overflows, but see NOTES. -POSIX.1-2001 にはオーバーフローでの範囲エラー (range error) の -記載がある。「注意」の節を参照のこと。 -.\"O .SH VERSIONS +エラーは発生しない。 POSIX.1\-2001 にはオーバーフローでの範囲エラー (range error) の 記載がある。「注意」の節を参照のこと。 .SH バージョン -.\"O These functions first appeared in glibc in version 2.1. これらの関数は glibc バージョン 2.1 で初めて登場した。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O .SH NOTES +C99, POSIX.1\-2001. .SH 注意 -.\"O POSIX.1-2001 contains text about overflow (which might set -.\"O .I errno -.\"O to -.\"O .BR ERANGE , -.\"O or raise an -.\"O .B FE_OVERFLOW -.\"O exception). -POSIX.1-2001 にはオーバーフローに関する記述があり、 -オーバーフローの場合には、 -.I errno -を -.B ERANGE -に設定するか、 -.B FE_OVERFLOW -例外を発生することとされている。 -.\"O In practice, the result cannot overflow on any current machine, -.\"O so this error-handling stuff is just nonsense. -実際のところ、どの現行のマシンでは結果がオーバーフローを起こすことはないので、 -このエラー処理は意味がない。 .\" The POSIX.1-2001 APPLICATION USAGE SECTION discusses this point. -.\"O (More precisely, overflow can happen only when the maximum value -.\"O of the exponent is smaller than the number of mantissa bits. -.\"O For the IEEE-754 standard 32-bit and 64-bit floating-point numbers -.\"O the maximum value of the exponent is 128 (respectively, 1024), -.\"O and the number of mantissa bits is 24 (respectively, 53).) -(より正確に言うと、オーバーフローは指数部の最大値が -仮数部を表すビットの数より小さい場合にしか起こらない。 -IEEE-754 規格の 32 ビットと 64 ビットの浮動小数では、 -指数部の最大値はそれぞれ 128 と 1024 であり、 +POSIX.1\-2001 にはオーバーフローに関する記述があり、 オーバーフローの場合には、 \fIerrno\fP を \fBERANGE\fP に設定するか、 +\fBFE_OVERFLOW\fP 例外を発生することとされている。 実際のところ、どの現行のマシンでは結果がオーバーフローを起こすことはないので、 +このエラー処理は意味がない。 (より正確に言うと、オーバーフローは指数部の最大値が 仮数部を表すビットの数より小さい場合にしか起こらない。 +IEEE\-754 規格の 32 ビットと 64 ビットの浮動小数では、 指数部の最大値はそれぞれ 128 と 1024 であり、 仮数部のビット数はそれぞれ 24 と 53 である。) -.\"O If you want to store the rounded value in an integer type, -.\"O you probably want to use one of the functions described in -.\"O .BR lround (3) -.\"O instead. -丸めた値を整数型に格納した場合には、おそらくこの関数ではなく -.BR lround (3) -に載っている関数のどれかを使いたいのだろう。 -.\"O .SH "SEE ALSO" +丸めた値を整数型に格納した場合には、おそらくこの関数ではなく \fBlround\fP(3) に載っている関数のどれかを使いたいのだろう。 .SH 関連項目 -.BR ceil (3), -.BR floor (3), -.BR lround (3), -.BR nearbyint (3), -.BR rint (3), -.BR trunc (3) +\fBceil\fP(3), \fBfloor\fP(3), \fBlround\fP(3), \fBnearbyint\fP(3), \fBrint\fP(3), +\fBtrunc\fP(3) diff --git a/draft/man3/rpmatch.3 b/draft/man3/rpmatch.3 index 2296e7e4..a828a057 100644 --- a/draft/man3/rpmatch.3 +++ b/draft/man3/rpmatch.3 @@ -24,161 +24,56 @@ .\" .\" 2006-05-19, mtk, various edits and example program .\" -.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved. -.\" Translated 2006-07-31, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH RPMATCH 3 2007-07-26 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH RPMATCH 3 2007\-07\-26 GNU "Linux Programmer's Manual" .SH 名前 -.\"O rpmatch \- determine if the answer to a question is affirmative or negative rpmatch \- 質問への応答が肯定か否定かを判定する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP -.BI "int rpmatch(const char *" response ); +\fBint rpmatch(const char *\fP\fIresponse\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR rpmatch (): -_SVID_SOURCE -.\"O .SH DESCRIPTION +\fBrpmatch\fP(): _SVID_SOURCE .SH 説明 -.\"O .BR rpmatch () -.\"O handles a user response to yes or no questions, with -.\"O support for internationalization. -.BR rpmatch () -は yes/no の質問に対するユーザからの応答を処理する。 -国際化 (I18N) に対応している。 +\fBrpmatch\fP() は yes/no の質問に対するユーザからの応答を処理する。 国際化 (I18N) に対応している。 -.\"O \fIresponse\fP should be a null-terminated string containing a -.\"O user-supplied response, perhaps obtained with -.\"O .BR fgets (3) -.\"O or -.\"O .BR getline (3). -.I response -にはユーザからの応答を格納した NULL 終端文字列が入っている必要がある。 -たいていは、 -.BR fgets (3) -や -.BR getline (3) -で取り込んだものであろう。 +\fIresponse\fP にはユーザからの応答を格納した NULL 終端文字列が入っている必要がある。 たいていは、 \fBfgets\fP(3) や +\fBgetline\fP(3) で取り込んだものであろう。 -.\"O The user's language preference is taken into account per the -.\"O environment variables \fBLANG\fP, \fBLC_MESSAGES\fP, and \fBLC_ALL\fP, -.\"O if the program has called -.\"O .BR setlocale (3) -.\"O to effect their changes. -プログラムが -.BR setlocale (3) -を呼び出して環境変数の変更を有効にした場合、 -環境変数 \fBLANG\fP, \fBLC_MESSAGES\fP, \fBLC_ALL\fP が -ユーザの言語設定として考慮される。 +プログラムが \fBsetlocale\fP(3) を呼び出して環境変数の変更を有効にした場合、 環境変数 \fBLANG\fP, \fBLC_MESSAGES\fP, +\fBLC_ALL\fP が ユーザの言語設定として考慮される。 -.\"O Regardless of the locale, responses matching \fB^[Yy]\fP are always -.\"O accepted as affirmative, and those matching \fB^[Nn]\fP are always -.\"O accepted as negative. -ロケールに関わらず、\fB^[Yy]\fP にマッチする応答は常に肯定だと解釈され、 -\fB^[Nn]\fP にマッチする応答は常に否定だと解釈される。 -.\"O .SH "RETURN VALUE" +ロケールに関わらず、\fB^[Yy]\fP にマッチする応答は常に肯定だと解釈され、 \fB^[Nn]\fP にマッチする応答は常に否定だと解釈される。 .SH 返り値 -.\"O After examining -.\"O .IR response , -.\"O .BR rpmatch () -.\"O returns 0 for a recognized negative response ("no"), 1 -.\"O for a recognized positive response ("yes"), and \-1 when the value -.\"O of \fIresponse\fP is unrecognized. -.I response -を検査した後、 -.BR rpmatch () -は否定的な応答 ("no") と認識した場合は 0 を返し、 -肯定的な応答 ("yes") と認識した場合は 1 を返す。 -.I response -の値を解釈できなかった場合は \-1 を返す。 -.\"O .SH ERRORS +\fIresponse\fP を検査した後、 \fBrpmatch\fP() は否定的な応答 ("no") と認識した場合は 0 を返し、 肯定的な応答 +("yes") と認識した場合は 1 を返す。 \fIresponse\fP の値を解釈できなかった場合は \-1 を返す。 .SH エラー -.\"O A return value of \-1 may indicate either an invalid input, or some -.\"O other error. -.\"O It is incorrect to only test if the return value is nonzero. -返り値 \-1 が返った場合、入力が不正であったか、他の何らかのエラーが -あったことを意味する。返り値が 0 以外かどうかを確認するだけでは +返り値 \-1 が返った場合、入力が不正であったか、他の何らかのエラーが あったことを意味する。返り値が 0 以外かどうかを確認するだけでは 十分ではない。 -.\"O .BR rpmatch () -.\"O can fail for any of the reasons that -.\"O .BR regcomp (3) -.\"O or -.\"O .BR regexec (3) -.\"O can fail; the cause of the error -.\"O is not available from \fIerrno\fP or anywhere else, but indicates a -.\"O failure of the regex engine (but this case is indistinguishable from -.\"O that of an unrecognized value of \fIresponse\fP). -.BR rpmatch () -は、 -.BR regcomp (3) -や -.BR regexec (3) -が失敗する理由のどれかで失敗することがある。 -エラーの原因を -.I errno -や他の何かで知ることはできないが、 -.I errno -は正規表現エンジンの失敗の原因を示している -(但し、このケースと -.I response -の値を認識できずに失敗した場合を区別することはできない)。 -.\"O .SH "CONFORMING TO" +\fBrpmatch\fP() は、 \fBregcomp\fP(3) や \fBregexec\fP(3) が失敗する理由のどれかで失敗することがある。 +エラーの原因を \fIerrno\fP や他の何かで知ることはできないが、 \fIerrno\fP は正規表現エンジンの失敗の原因を示している (但し、このケースと +\fIresponse\fP の値を認識できずに失敗した場合を区別することはできない)。 .SH 準拠 -.\"O .BR rpmatch () -.\"O is not required by any standard, but -.\"O is available on a few other systems. -.BR rpmatch () -はどの標準でも必須となっていないが、 -Linux 以外にも利用できるシステムもいくつかは存在する。 -.\"O .\" It is available on at least AIX 5.1 and FreeBSD 6.0. -.\" 少なくとも AIX 5.1 と FreeBSD 6.0 では利用できる。 -.\"O .SH BUGS +.\" It is available on at least AIX 5.1 and FreeBSD 6.0. +\fBrpmatch\fP() はどの標準でも必須となっていないが、 Linux 以外にも利用できるシステムもいくつかは存在する。 .SH バグ -.\"O The -.\"O .BR rpmatch () -.\"O implementation looks at only the first character -.\"O of \fIresponse\fP. -.\"O As a consequence, "nyes" returns 0, and -.\"O "ynever; not in a million years" returns 1. -.\"O It would be preferable to accept input strings much more -.\"O strictly, for example (using the extended regular -.\"O expression notation described in -.\"O .BR regex (7)): -.\"O \fB^([yY]|yes|YES)$\fP and \fB^([nN]|no|NO)$\fP. -.BR rpmatch () -の実装は -.I response -の最初の 1 文字だけを見ているようである。その結果、 -"nyes" は 0 を返し、 -"ynever; not in a million years" は 1 を返すことになる。 -入力文字列をもっと厳密に解釈した方がよいだろう。 -例えば、 -.RB ( regex (7) -で説明されている拡張正規表現を使って) -.BR ^([yY]|yes|YES)$ " や " ^([nN]|no|NO)$ +\fBrpmatch\fP() の実装は \fIresponse\fP の最初の 1 文字だけを見ているようである。その結果、 "nyes" は 0 を返し、 +"ynever; not in a million years" は 1 を返すことになる。 入力文字列をもっと厳密に解釈した方がよいだろう。 例えば、 +(\fBregex\fP(7) で説明されている拡張正規表現を使って) \fB^([yY]|yes|YES)$\fP や \fB^([nN]|no|NO)$\fP で解釈するなど。 -.\"O .SH EXAMPLE .SH 例 -.\"O The following program displays the results when -.\"O .BR rpmatch () -.\"O is applied to the string given in the program's command-line argument. -以下のプログラムは、コマンドライン引き数で -指定された文字列を -.BR rpmatch () -に渡した場合の結果を表示する。 +以下のプログラムは、コマンドライン引き数で 指定された文字列を \fBrpmatch\fP() に渡した場合の結果を表示する。 .nf #define _SVID_SOURCE @@ -191,19 +86,15 @@ int main(int argc, char *argv[]) { if (argc != 2 || strcmp(argv[1], "\-\-help") == 0) { - fprintf(stderr, "%s response\\n", argv[0]); + fprintf(stderr, "%s response\en", argv[0]); exit(EXIT_FAILURE); } setlocale(LC_ALL, ""); - printf("rpmatch() returns: %d\\n", rpmatch(argv[1])); + printf("rpmatch() returns: %d\en", rpmatch(argv[1])); exit(EXIT_SUCCESS); } .fi -.\"O .SH SEE ALSO .SH 関連項目 -.BR fgets (3), -.BR getline (3), -.BR nl_langinfo (3), -.BR regcomp (3), -.BR setlocale (3) +\fBfgets\fP(3), \fBgetline\fP(3), \fBnl_langinfo\fP(3), \fBregcomp\fP(3), +\fBsetlocale\fP(3) diff --git a/draft/man3/rtnetlink.3 b/draft/man3/rtnetlink.3 index a8a40133..5999af46 100644 --- a/draft/man3/rtnetlink.3 +++ b/draft/man3/rtnetlink.3 @@ -3,137 +3,64 @@ .\" of this page provided the header is included verbatim, .\" and in case of nontrivial modification author and date .\" of the modification is added to the header. -.\" $Id: rtnetlink.3,v 1.3 1999/08/20 04:10:17 nakano Exp $ +.\" $Id: rtnetlink.3,v 1.2 1999/05/18 10:35:10 freitag Exp $ +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1999 Shouichi Saito -.\" all rights reserved. -.\" Translated Mon Jul 26 12:18:39 JST 1999 -.\" by Shouichi Saito -.\" Proofed Fri Aug 20 1999 by NAKANO Takeo +.\" This file was generated with po4a. Translate the source file. .\" -.\"WORD: running length 実動時の長さ -.\" -.TH RTNETLINK 3 2010-01-11 "GNU" "Linux Programmer's Manual" +.\"******************************************************************* +.TH RTNETLINK 3 2012\-03\-24 GNU "Linux Programmer's Manual" .SH 名前 -.\"O rtnetlink \- macros to manipulate rtnetlink messages rtnetlink \- rtnetlink メッセージを操作するマクロ -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .br -.B #include +\fB#include \fP .br -.B #include +\fB#include \fP .br -.B #include +\fB#include \fP -.BI "rtnetlink_socket = socket(AF_NETLINK, int " socket_type \ -", NETLINK_ROUTE);" +\fBrtnetlink_socket = socket(AF_NETLINK, int \fP\fIsocket_type\fP\fB, +NETLINK_ROUTE);\fP .sp -.BI "int RTA_OK(struct rtattr *" rta ", int " rtabuflen ); +\fBint RTA_OK(struct rtattr *\fP\fIrta\fP\fB, int \fP\fIrtabuflen\fP\fB);\fP .sp -.BI "void *RTA_DATA(struct rtattr *" rta ); +\fBvoid *RTA_DATA(struct rtattr *\fP\fIrta\fP\fB);\fP .sp -.BI "unsigned int RTA_PAYLOAD(struct rtattr *" rta ); +\fBunsigned int RTA_PAYLOAD(struct rtattr *\fP\fIrta\fP\fB);\fP .sp -.BI "struct rtattr *RTA_NEXT(struct rtattr *" rta \ -", unsigned int " rtabuflen ); +\fBstruct rtattr *RTA_NEXT(struct rtattr *\fP\fIrta\fP\fB, unsigned int +\fP\fIrtabuflen\fP\fB);\fP .sp -.BI "unsigned int RTA_LENGTH(unsigned int " length ); +\fBunsigned int RTA_LENGTH(unsigned int \fP\fIlength\fP\fB);\fP .sp -.BI "unsigned int RTA_SPACE(unsigned int "length ); +\fBunsigned int RTA_SPACE(unsigned int \fP\fIlength\fP\fB);\fP .SH 説明 -.\"O All -.\"O .BR rtnetlink (7) -.\"O messages consist of a -.\"O .BR netlink (7) -.\"O message header and appended attributes. -.\"O The attributes should be only -.\"O manipulated using the macros provided here. -全ての -.BR rtnetlink (7) -メッセージは -.BR netlink (7) -メッセージヘッダと追加属性からなる。 +全ての \fBrtnetlink\fP(7) メッセージは \fBnetlink\fP(7) メッセージヘッダと追加属性からなる。 属性の操作は、必ずここに挙げたマクロを通して行うべきである。 .PP -.\"O .BI RTA_OK( rta ", " attrlen ) -.\"O returns true if -.\"O .I rta -.\"O points to a valid routing attribute; -.\"O .I attrlen -.\"O is the running length of the attribute buffer. -.BI RTA_OK( rta ", " attrlen ) -は -.I rta -が有効なルーティング属性へのポインタであれば真を返す。 -.I attrlen -は属性バッファの実働時の長さ (running length) である。 -.\"O When not true then you must assume there are no more attributes in the -.\"O message, even if -.\"O .I attrlen -.\"O is nonzero. -真でなければ、例え -.I attrlen -がゼロでなくても、 -メッセージ中にはもうそれ以上属性は無いと考えなければならない。 +\fBRTA_OK(\fP\fIrta\fP\fB, \fP\fIattrlen\fP\fB)\fP は \fIrta\fP が有効なルーティング属性へのポインタであれば真を返す。 +\fIattrlen\fP は属性バッファの実働時の長さ (running length) である。 真でなければ、例え \fIattrlen\fP +がゼロでなくても、 メッセージ中にはもうそれ以上属性は無いと考えなければならない。 .PP -.\"O .BI RTA_DATA( rta ) -.\"O returns a pointer to the start of this attribute's data. -.BI RTA_DATA( rta ) -はこの属性データの先頭へのポインタを返す。 +\fBRTA_DATA(\fP\fIrta\fP\fB)\fP はこの属性データの先頭へのポインタを返す。 .PP -.\"O .BI RTA_PAYLOAD( rta ) -.\"O returns the length of this attribute's data. -.BI RTA_PAYLOAD( rta ) -はこの属性データの長さを返す。 +\fBRTA_PAYLOAD(\fP\fIrta\fP\fB)\fP はこの属性データの長さを返す。 .PP -.\"O .BI RTA_NEXT( rta ", " attrlen ) -.\"O gets the next attribute after -.\"O .IR rta . -.BI RTA_NEXT( rta ", " attrlen ) -は -.I rta -の次にある属性を取得する。 -.\"O Calling this macro will update -.\"O .IR attrlen . -.\"O You should use -.\"O .B RTA_OK -.\"O to check the validity of the returned pointer. -このマクロを呼ぶと -.I attrlen -が更新される。 -.B RTA_OK -を使って、返されたポインタが正しいかをチェックすべきである。 +\fBRTA_NEXT(\fP\fIrta\fP\fB, \fP\fIattrlen\fP\fB)\fP は \fIrta\fP の次にある属性を取得する。 このマクロを呼ぶと +\fIattrlen\fP が更新される。 \fBRTA_OK\fP を使って、返されたポインタが正しいかをチェックすべきである。 .PP -.\"O .BI RTA_LENGTH( len ) -.\"O returns the length which is required for -.\"O .I len -.\"O bytes of data plus the header. -.BI RTA_LENGTH( len ) -は -.I len -バイトのデータ + ヘッダに必要な長さを返す。 +\fBRTA_LENGTH(\fP\fIlen\fP\fB)\fP は \fIlen\fP バイトのデータ + ヘッダに必要な長さを返す。 .PP -.\"O .BI RTA_SPACE( len ) -.\"O returns the amount of space which will be needed in a message with -.\"O .I len -.\"O bytes of data. -.BI RTA_SPACE( len ) -は -.I len -バイトのデータを持つメッセージに必要とされる容量を返す。 -.\"O .SH CONFORMING TO +\fBRTA_SPACE(\fP\fIlen\fP\fB)\fP は \fIlen\fP バイトのデータを持つメッセージに必要とされる容量を返す。 .SH 準拠 -.\"O These macros are nonstandard Linux extensions. これらのマクロは非標準で、Linux での拡張である。 .SH バグ -.\"O This manual page is incomplete. このマニュアルは完全ではない。 .SH 例 + .\" FIXME ? would be better to use libnetlink in the EXAMPLE code here -.\"O -.\"O Creating a rtnetlink message to set the MTU of a device. デバイスの MTU をセットする rtnetlink メッセージを生成する .nf #include @@ -161,13 +88,11 @@ rtnetlink \- rtnetlink メッセージを操作するマクロ rta = (struct rtattr *)(((char *) &req) + NLMSG_ALIGN(req.nh.nlmsg_len)); rta\->rta_type = IFLA_MTU; - rta\->rta_len = sizeof(unsigned int); + rta\->rta_len = RTA_LENGTH(sizeof(unsigned int)); req.n.nlmsg_len = NLMSG_ALIGN(req.nh.nlmsg_len) + RTA_LENGTH(sizeof(mtu)); memcpy(RTA_DATA(rta), &mtu, sizeof(mtu)); send(rtnetlink_sk, &req, req.nh.nlmsg_len); .fi .SH 関連項目 -.BR netlink (3), -.BR netlink (7), -.BR rtnetlink (7) +\fBnetlink\fP(3), \fBnetlink\fP(7), \fBrtnetlink\fP(7) diff --git a/draft/man3/scalb.3 b/draft/man3/scalb.3 index 75eafa12..8ee6e592 100644 --- a/draft/man3/scalb.3 +++ b/draft/man3/scalb.3 @@ -22,282 +22,102 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2005 Yuichi SATO all rights reserved. -.\" and Copyright (c) 2008 Akihiro MOTOKI -.\" Translated Tue Feb 1 07:25:51 JST 2005 -.\" by Yuichi SATO -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH SCALB 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH SCALB 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O scalb, scalbf, scalbl \- multiply floating-point number -.\"O by integral power of radix (OBSOLETE) scalb, scalbf, scalbl \- 浮動小数点数に整数である基数の累乗を掛ける (廃止予定) -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "double scalb(double " x ", double " exp ); +\fBdouble scalb(double \fP\fIx\fP\fB, double \fP\fIexp\fP\fB);\fP .br -.BI "float scalbf(float " x ", double " exp ); +\fBfloat scalbf(float \fP\fIx\fP\fB, double \fP\fIexp\fP\fB);\fP .br -.BI "long double scalbl(long double " x ", double " exp ); +\fBlong double scalbl(long double \fP\fIx\fP\fB, double \fP\fIexp\fP\fB);\fP .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR scalb (): +\fBscalb\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .RE .br -.BR scalbf (), -.BR scalbl (): +\fBscalbf\fP(), \fBscalbl\fP(): .RS 4 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O These functions multiply their first argument -.\"O .I x -.\"O by -.\"O .B FLT_RADIX -.\"O (probably 2) -.\"O to the power of -.\"O .IR exp , -.\"O that is: -これらの関数は最初の引き数 -.I x -に -.B FLT_RADIX -の -.I exp -乗を掛ける -.RB ( FLT_RADIX -はおそらく 2 である)。つまり、以下の式の値を返す。 +これらの関数は最初の引き数 \fIx\fP に \fBFLT_RADIX\fP の \fIexp\fP 乗を掛ける (\fBFLT_RADIX\fP はおそらく 2 +である)。つまり、以下の式の値を返す。 .nf x * FLT_RADIX ** exp .fi -.\"O The definition of -.\"O .B FLT_RADIX -.\"O can be obtained by including -.\"O .I . -.B FLT_RADIX -の定義は -.I -をインクルードすることで得られる。 -.\"O .\" not in /usr/include but in a gcc lib -.\" /usr/include ではなく、gcc の lib にある。 -.\"O .SH RETURN VALUE +.\" not in /usr/include but in a gcc lib +\fBFLT_RADIX\fP の定義は \fI\fP をインクルードすることで得られる。 .SH 返り値 -.\"O On success, these functions return \fIx\fP * \fBFLT_RADIX\fP ** \fIexp\fP. 成功すると、これらの関数は \fIx\fP * \fBFLT_RADIX\fP ** \fIexp\fP を返す。 -.\"O If -.\"O .I x -.\"O or -.\"O .I exp -.\"O is a NaN, a NaN is returned. -.I x -か -.I exp -が NaN の場合、NaN が返される。 +\fIx\fP か \fIexp\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is positive infinity (negative infinity), -.\"O and -.\"O .I exp -.\"O is not negative infinity, -.\"O positive infinity (negative infinity) is returned. -.I x -が正の無限大 (負の無限大) で -.I exp -が負の無限大でない場合、正の無限大 (負の無限大) が返される。 +\fIx\fP が正の無限大 (負の無限大) で \fIexp\fP が負の無限大でない場合、正の無限大 (負の無限大) が返される。 -.\"O If -.\"O .I x -.\"O is +0 (\-0), and -.\"O .I exp -.\"O is not positive infinity, +0 (\-0) is returned. -.I x -が +0 (\-0) で -.I exp -が正の無限大でない場合、+0 (\-0) が返される。 +\fIx\fP が +0 (\-0) で \fIexp\fP が正の無限大でない場合、+0 (\-0) が返される。 -.\"O If -.\"O .I x -.\"O is zero, and -.\"O .I exp -.\"O is positive infinity, -.\"O a domain error occurs, and -.\"O a NaN is returned. -.I x -がゼロで -.I exp -が正の無限大の場合、領域エラー (domain error) が発生し、 -NaN が返される。 +\fIx\fP がゼロで \fIexp\fP が正の無限大の場合、領域エラー (domain error) が発生し、 NaN が返される。 -.\"O If -.\"O .I x -.\"O is an infinity, -.\"O and -.\"O .I exp -.\"O is negative infinity, -.\"O a domain error occurs, and -.\"O a NaN is returned. -.I x -が無限大で -.I exp -が負の無限大の場合、領域エラー (domain error) が発生し、 -NaN が返される。 +\fIx\fP が無限大で \fIexp\fP が負の無限大の場合、領域エラー (domain error) が発生し、 NaN が返される。 -.\"O If the result overflows, -.\"O a range error occurs, -.\"O and the functions return -.\"O .BR HUGE_VAL , -.\"O .BR HUGE_VALF , -.\"O or -.\"O .BR HUGE_VALL , -.\"O respectively, with a sign the same as -.\"O .IR x . -結果がオーバーフローする場合、 -範囲エラー (range error) が発生し、 -各関数はそれぞれ -.BR HUGE_VAL , -.BR HUGE_VALF , -.BR HUGE_VALL -を返す。符号は -.I x -と同じになる。 +結果がオーバーフローする場合、 範囲エラー (range error) が発生し、 各関数はそれぞれ \fBHUGE_VAL\fP, +\fBHUGE_VALF\fP, \fBHUGE_VALL\fP を返す。符号は \fIx\fP と同じになる。 -.\"O If the result underflows, -.\"O a range error occurs, -.\"O and the functions return zero, with a sign the same as -.\"O .IR x . -結果がアンダーフローする場合、範囲エラーが発生し、 -各関数は 0 を返す。符号は -.I x -と同じになる。 -.\"O .SH ERRORS +結果がアンダーフローする場合、範囲エラーが発生し、 各関数は 0 を返す。符号は \fIx\fP と同じになる。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Domain error: \fIx\fP is 0, and \fIexp\fP is positive infinity, \ -.\"O or \fIx\fP is positive infinity and \fIexp\fP is negative infinity \ -.\"O and the other argument is not a NaN -.\"Omotoki: 引き数は x, exp の二つで両方とも条件に含まれているので、 -.\"Omotoki: 他の引き数に関する記述は意味がないと思われる。和訳では省略する。 -領域エラー (domain error): \fIx\fP が 0 で \fIexp\fP が正の無限大、\ -または \fIx\fP が正の無限大で \fIexp\fP が負の無限大 +.TP +領域エラー (domain error): \fIx\fP が 0 で \fIexp\fP が正の無限大、または \fIx\fP が正の無限大で \fIexp\fP が負の無限大 .\" .I errno .\" is set to .\" .BR EDOM . -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -不正 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) -が上がる。 -.TP -.\"O Range error, overflow -範囲エラー (range error)、オーバーフロー +不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 +.TP +範囲エラー (range error)、オーバーフローの場合 .\" .I errno .\" is set to .\" .BR ERANGE . -.\"O An overflow floating-point exception -.\"O .RB ( FE_OVERFLOW ) -.\"O is raised. -オーバーフロー浮動小数点例外 -.RB ( FE_OVERFLOW ) -が上がる。 -.TP -.\"O Range error, underflow -範囲エラー (range error)、アンダーフロー +オーバーフロー浮動小数点例外 (\fBFE_OVERFLOW\fP) が上がる。 +.TP +範囲エラー (range error)、アンダーフローの場合 .\" .I errno .\" is set to .\" .BR ERANGE . -.\"O An underflow floating-point exception -.\"O .RB ( FE_UNDERFLOW ) -.\"O is raised. -アンダーフロー浮動小数点例外 -.RB ( FE_UNDERFLOW ) -が上がる。 +アンダーフロー浮動小数点例外 (\fBFE_UNDERFLOW\fP) が上がる。 .PP -.\"O These functions do not set -.\"O .IR errno . -これらの関数は -.I errno -を設定しない。 .\" FIXME . Is it intentional that these functions do not set errno? .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6803 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6804 -.\"O .SH "CONFORMING TO" +これらの関数は \fIerrno\fP を設定しない。 .SH 準拠 -.\"O .BR scalb () -.\"O is specified in POSIX.1-2001, but marked obsolescent. -.\"O POSIX.1-2008 removes the specification of -.\"O .BR scalb (), -.\"O recommending the use of -.\"O .BR scalbln (3), -.\"O .BR scalblnf (3), -.\"O or -.\"O .BR scalblnl (3) -.\"O instead. -.\"O The -.\"O .BR scalb () -.\"O function is from 4.3BSD. -.BR scalb () -は POSIX.1-2001 で規定されているが、廃止予定とされている。 -POSIX.1-2008 では -.BR scalb () -の仕様は削除されており、代わりに -.BR scalbln (3), -.BR scalblnf (3), -.BR scalblnl (3) -の使用が推奨されている。 -.BR scalb () -関数は 4.3BSD に由来する。 +\fBscalb\fP() は POSIX.1\-2001 で規定されているが、廃止予定とされている。 POSIX.1\-2008 では \fBscalb\fP() +の仕様は削除されており、代わりに \fBscalbln\fP(3), \fBscalblnf\fP(3), \fBscalblnl\fP(3) の使用が推奨されている。 +\fBscalb\fP() 関数は 4.3BSD に由来する。 -.\"O .BR scalbf () -.\"O and -.\"O .BR scalbl () -.\"O are unstandardized; -.\"O .BR scalbf () -.\"O is nevertheless present on several other systems -.BR scalbf () -と -.BR scalbl () -は標準化されていない。 -それにも関わらず、 -.BR scalbf () -はいくつかの他のシステムに存在する。 .\" Looking at header files: scalbf() is present on the .\" BSDs, Tru64, HP-UX 11, Irix 6.5; scalbl() is on HP-UX 11 and Tru64. -.\"O .SH "SEE ALSO" +\fBscalbf\fP() と \fBscalbl\fP() は標準化されていない。 それにも関わらず、 \fBscalbf\fP() +はいくつかの他のシステムに存在する。 .SH 関連項目 -.BR ldexp (3), -.BR scalbln (3) +\fBldexp\fP(3), \fBscalbln\fP(3) diff --git a/draft/man3/scalbln.3 b/draft/man3/scalbln.3 new file mode 100644 index 00000000..fb57a165 --- /dev/null +++ b/draft/man3/scalbln.3 @@ -0,0 +1,127 @@ +.\" Copyright 2004 Andries Brouwer . +.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH SCALBLN 3 2010\-09\-20 "" "Linux Programmer's Manual" +.SH 名前 +scalbn, scalbnf, scalbnl, scalbln, scalblnf, scalblnl \- multiply +floating\-point number by integral power of radix +.SH 書式 +\fB#include \fP +.sp +\fBdouble scalbln(double \fP\fIx\fP\fB, long int \fP\fIexp\fP\fB);\fP +.br +\fBfloat scalblnf(float \fP\fIx\fP\fB, long int \fP\fIexp\fP\fB);\fP +.br +\fBlong double scalblnl(long double \fP\fIx\fP\fB, long int \fP\fIexp\fP\fB);\fP +.sp +\fBdouble scalbn(double \fP\fIx\fP\fB, int \fP\fIexp\fP\fB);\fP +.br +\fBfloat scalbnf(float \fP\fIx\fP\fB, int \fP\fIexp\fP\fB);\fP +.br +\fBlong double scalbnl(long double \fP\fIx\fP\fB, int \fP\fIexp\fP\fB);\fP +.sp +\fI\-lm\fP でリンクする。 +.sp +.in -4n +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): +.in +.sp +.ad l +\fBscalbln\fP(), \fBscalblnf\fP(), \fBscalblnl\fP(): +.RS +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; +.br +or \fIcc\ \-std=c99\fP +.RE +.br +\fBscalbn\fP(), \fBscalbnf\fP(), \fBscalbnl\fP(): +.RS +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; +.br +or \fIcc\ \-std=c99\fP +.RE +.ad b +.SH 説明 +これらの関数は最初の引き数 \fIx\fP に \fBFLT_RADIX\fP の \fIexp\fP 乗を掛ける (\fBFLT_RADIX\fP はおそらく 2 +である)。つまり、以下の式の値を返す。 +.nf + + x * FLT_RADIX ** exp +.fi + +.\" not in /usr/include but in a gcc lib +\fBFLT_RADIX\fP の定義は \fI\fP をインクルードすることで得られる。 +.SH 返り値 +成功すると、これらの関数は \fIx\fP * \fBFLT_RADIX\fP ** \fIexp\fP を返す。 + +\fIx\fP が NaN の場合、NaN が返される。 + +\fIx\fP が正の無限大 (負の無限大) の場合、正の無限大 (負の無限大) が返される。 + +\fIx\fP が +0 (\-0) の場合、+0 (\-0) が返される。 + +結果がオーバーフローする場合、 範囲エラー (range error) が発生し、 各関数はそれぞれ \fBHUGE_VAL\fP, +\fBHUGE_VALF\fP, \fBHUGE_VALL\fP を返す。符号は \fIx\fP と同じになる。 + +結果がアンダーフローする場合、範囲エラーが発生し、 各関数は 0 を返す。符号は \fIx\fP と同じになる。 +.SH エラー +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 +.PP +以下のエラーが発生する可能性がある。 +.TP +範囲エラー (range error)、オーバーフローの場合 +.\" .I errno +.\" is set to +.\" .BR ERANGE . +オーバーフロー浮動小数点例外 (\fBFE_OVERFLOW\fP) が上がる。 +.TP +範囲エラー (range error)、アンダーフローの場合 +.\" .I errno +.\" is set to +.\" .BR ERANGE . +アンダーフロー浮動小数点例外 (\fBFE_UNDERFLOW\fP) が上がる。 +.PP +.\" FIXME . Is it intentional that these functions do not set errno? +.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6803 +これらの関数は \fIerrno\fP を設定しない。 +.SH バージョン +これらの関数は glibc バージョン 2.1 で初めて登場した。 +.SH 準拠 +C99, POSIX.1\-2001. +.SH 注意 +These functions differ from the obsolete functions described in \fBscalb\fP(3) +in the type of their second argument. The functions described on this page +have a second argument of an integral type, while those in \fBscalb\fP(3) have +a second argument of type \fIdouble\fP. + +If \fBFLT_RADIX\fP equals 2 (which is usual), then \fBscalbn\fP() is equivalent +to \fBldexp\fP(3). +.SH 関連項目 +\fBldexp\fP(3), \fBscalb\fP(3) diff --git a/draft/man3/scandir.3 b/draft/man3/scandir.3 index ca8aa73e..028d2420 100644 --- a/draft/man3/scandir.3 +++ b/draft/man3/scandir.3 @@ -31,219 +31,83 @@ .\" Modified Sun Sep 24 20:15:46 2000 by aeb, following Petter Reinholdtsen. .\" Modified 2001-12-26 by aeb, following Joey. Added versionsort. .\" -.\" FIXME glibc 2.15 adds scandirat() +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1998 Hiroaki Nagoya all rights reserved. -.\" Translated Thu May 28 1998 by Hiroaki Nagoya -.\" Updated & Modified Sat Jan 19 18:22:21 JST 2002 -.\" by Yuichi SATO -.\" Updated & Modified Sun Jan 16 08:12:04 JST 2005 -.\" by Yuichi SATO +.\" This file was generated with po4a. Translate the source file. .\" -.TH SCANDIR 3 2011-09-08 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH SCANDIR 3 2012\-03\-20 GNU "Linux Programmer's Manual" .SH 名前 -.\"O scandir, alphasort, versionsort \- scan a directory for matching entries scandir, alphasort, versionsort \- ディレクトリを走査する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int scandir(const char *" dirp ", struct dirent ***" namelist , +\fBint scandir(const char *\fP\fIdirp\fP\fB, struct dirent ***\fP\fInamelist\fP\fB,\fP .RS -.BI "int (*" filter ")(const struct dirent *)," -.BI "int (*" compar ")(const struct dirent **, const struct dirent **));" +\fBint (*\fP\fIfilter\fP\fB)(const struct dirent *),\fP +\fBint (*\fP\fIcompar\fP\fB)(const struct dirent **, const struct dirent **));\fP .RE .sp -.BI "int alphasort(const void *" a ", const void *" b ); +\fBint alphasort(const void *\fP\fIa\fP\fB, const void *\fP\fIb\fP\fB);\fP .sp -.BI "int versionsort(const void *" a ", const void *" b ); +\fBint versionsort(const void *\fP\fIa\fP\fB, const void *\fP\fIb\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR scandir (), -.BR alphasort (): -_BSD_SOURCE || _SVID_SOURCE +\fBscandir\fP(), \fBalphasort\fP(): _BSD_SOURCE || _SVID_SOURCE .br -.BR versionsort (): -_GNU_SOURCE -.\"O .SH DESCRIPTION +\fBversionsort\fP(): _GNU_SOURCE .SH 説明 -.\"O The -.\"O .BR scandir () -.\"O function scans the directory \fIdirp\fP, calling -.\"O \fIfilter\fP() on each directory entry. -.\"O Entries for which -.\"O \fIfilter\fP() returns nonzero are stored in strings allocated via -.\"O .BR malloc (3), -.\"O sorted using -.\"O .BR qsort (3) -.\"O with the comparison -.\"O function \fIcompar\fP() and collected in array \fInamelist\fP -.\"O which is allocated via -.\"O .BR malloc (3). -.\"O If \fIfilter\fP is NULL, all entries are selected. -関数 -.BR scandir () -はディレクトリ \fIdirp\fP を走査し、 -ディレクトリの各エントリを引き数として -.BR filter () -を呼び出す。 -.BR filter () -が 0 以外の値を返すエントリは -.BR malloc (3) -によって -確保された文字列に保存され、比較関数 -.BR compar () -を用いて -.BR qsort (3) -によりソートされ、 -.BR malloc (3) -により確保された配列 -\fInamelist\fP にまとめられる。 -\fIfilter\fP が NULL ならば、すべてのエントリが選択される。 +関数 \fBscandir\fP() はディレクトリ \fIdirp\fP を走査し、 ディレクトリの各エントリを引き数として \fBfilter\fP() +を呼び出す。 \fBfilter\fP() が 0 以外の値を返すエントリは \fBmalloc\fP(3) によって 確保された文字列に保存され、比較関数 +\fBcompar\fP() を用いて \fBqsort\fP(3) によりソートされ、 \fBmalloc\fP(3) により確保された配列 +\fInamelist\fP にまとめられる。 \fIfilter\fP が NULL ならば、すべてのエントリが選択される。 .LP -.\"O The -.\"O .BR alphasort () -.\"O and -.\"O .BR versionsort () -.\"O functions can be used as the comparison function -.\"O .IR compar (). -比較関数 -.IR compar () -には -.BR alphasort () -関数と -.BR versionsort () -関数を使うことができる。 -.\"O The former sorts directory entries using -.\"O .BR strcoll (3), -.\"O the latter using -.\"O .BR strverscmp (3) -.\"O on the strings \fI(*a)\->d_name\fP and \fI(*b)\->d_name\fP. -.BR alphasort () -は -.BR strcoll (3) -を用いてディレクトリエントリをソートし、 -.BR versionsort () -は文字列 \fI(*a)\->d_name\fP と \fI(*b)\->d_name\fP に対して -.BR strverscmp (3) -を用いる。 -.\"O .SH "RETURN VALUE" +比較関数 \fIcompar\fP() には \fBalphasort\fP() 関数と \fBversionsort\fP() 関数を使うことができる。 +\fBalphasort\fP() は \fBstrcoll\fP(3) を用いてディレクトリエントリをソートし、 \fBversionsort\fP() は文字列 +\fI(*a)\->d_name\fP と \fI(*b)\->d_name\fP に対して \fBstrverscmp\fP(3) を用いる。 .SH 返り値 -.\"O The -.\"O .BR scandir () -.\"O function returns the number of directory entries -.\"O selected or \-1 if an error occurs. -関数 -.BR scandir () -は選択されたエントリの数か、 -(エラーが発生した場合) \-1 を返す。 +関数 \fBscandir\fP() は選択されたエントリの数か、 (エラーが発生した場合) \-1 を返す。 .PP -.\"O The -.\"O .BR alphasort () -.\"O and -.\"O .BR versionsort () -.\"O functions return an integer less than, equal to, -.\"O or greater than zero if the first argument is considered to be -.\"O respectively less than, equal to, or greater than the second. -関数 -.BR alphasort () -と -.BR versionsort () -は 1 番目の引き数が 2 番目の引き数に対して、 +関数 \fBalphasort\fP() と \fBversionsort\fP() は 1 番目の引き数が 2 番目の引き数に対して、 [小さい/等しい/大きい] かに応じて、0 より [小さい/等しい/大きい] 値を返す。 -.\"O .SH ERRORS .SH エラー -.TP -.B ENOENT -.\"O The path in \fIdirp\fR does not exist. -\fIdirp\fR で指定されたパスが存在しない。 -.TP -.B ENOMEM -.\"O Insufficient memory to complete the operation. -動作を完遂するにはメモリが足りない。 -.TP -.B ENOTDIR -.\"O The path in \fIdirp\fR is not a directory. -\fIdirp\fR で指定されたパスがディレクトリではない。 -.\"O .SH VERSIONS +.TP +\fBENOENT\fP +\fIdirp\fP で指定されたパスが存在しない。 +.TP +\fBENOMEM\fP +操作を完了するのに十分なメモリがない。 +.TP +\fBENOTDIR\fP +\fIdirp\fP で指定されたパスがディレクトリではない。 .SH バージョン -.\"O .BR versionsort () -.\"O was added to glibc in version 2.1. -.BR versionsort () -は、glibc バージョン 2.1 で追加された。 -.\"O .SH "CONFORMING TO" +\fBversionsort\fP() は、glibc バージョン 2.1 で追加された。 .SH 準拠 -.\"O .BR alphasort () -.\"O and -.\"O .BR scandir () -.\"O are specified in POSIX.1-2008, and are widely available. -.\"O .BR versionsort () -.\"O is a GNU extension. -.BR alphasort () -と -.BR scandir () -は POSIX.1-2008 で規定されており、広く利用可能である。 -.BR versionsort () -は GNU 拡張である。 +\fBalphasort\fP() と \fBscandir\fP() は POSIX.1\-2008 で規定されており、広く利用可能である。 +\fBversionsort\fP() は GNU 拡張である。 .LP -.\"O The functions -.\"O .BR scandir () -.\"O and -.\"O .BR alphasort () -.\"O are from 4.3BSD, and have been available under Linux since libc4. -関数 -.BR scandir () -と -.BR alphasort () -は 4.3BSD から取り入れられ、Linux では libc4 から使用可能になった。 -.\"O Libc4 and libc5 use the more precise prototype -libc4 と libc5 では以下のようなもっと詳細なプロトタイプを使っている。 +関数 \fBscandir\fP() と \fBalphasort\fP() は 4.3BSD から取り入れられ、Linux では libc4 +から使用可能になった。 libc4 と libc5 では以下のようなもっと詳細なプロトタイプを使っている。 .sp .nf int alphasort(const struct dirent ** a, const struct dirent **b); .fi .sp -.\"O but glibc 2.0 returns to the imprecise BSD prototype. しかし glibc 2.0 では不正確な BSD のプロトタイプに戻った。 .LP -.\"O The function -.\"O .BR versionsort () -.\"O is a GNU extension, available since glibc 2.1. -関数 -.BR versionsort () -は GNU の拡張であり、glibc 2.1 以降で使用可能である。 +関数 \fBversionsort\fP() は GNU の拡張であり、glibc 2.1 以降で使用可能である。 .LP -.\"O Since glibc 2.1, -.\"O .BR alphasort () -.\"O calls -.\"O .BR strcoll (3); -.\"O earlier it used -.\"O .BR strcmp (3). -glibc 2.1 以降では -.BR alphasort () -は -.BR strcoll (3) -を呼び出す。 -.BR alphasort () -は以前は -.BR strcmp (3) -を使っていた。 -.\"O .SH EXAMPLE +glibc 2.1 以降では \fBalphasort\fP() は \fBstrcoll\fP(3) を呼び出す。 \fBalphasort\fP() は以前は +\fBstrcmp\fP(3) を使っていた。 .SH 例 .nf #define _SVID_SOURCE -.\"O /* print files in current directory in reverse order */ /* カレントディレクトリのファイルを逆順に出力する */ #include @@ -265,15 +129,7 @@ main(void) } } .fi -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR closedir (3), -.BR fnmatch (3), -.BR opendir (3), -.BR readdir (3), -.BR rewinddir (3), -.BR seekdir (3), -.BR strcmp (3), -.BR strcoll (3), -.BR strverscmp (3), -.BR telldir (3) +\fBclosedir\fP(3), \fBfnmatch\fP(3), \fBopendir\fP(3), \fBreaddir\fP(3), +\fBrewinddir\fP(3), \fBscandirat\fP(3), \fBseekdir\fP(3), \fBstrcmp\fP(3), +\fBstrcoll\fP(3), \fBstrverscmp\fP(3), \fBtelldir\fP(3) diff --git a/draft/man3/sched_getcpu.3 b/draft/man3/sched_getcpu.3 index ded7405b..3ccbf6ba 100644 --- a/draft/man3/sched_getcpu.3 +++ b/draft/man3/sched_getcpu.3 @@ -21,67 +21,37 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2008-08-21, Akihiro MOTOKI , LDP v3.04 -.\" -.TH SCHED_GETCPU 3 2010-10-31 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH SCHED_GETCPU 3 2010\-10\-31 Linux "Linux Programmer's Manual" .SH 名前 -.\"O sched_getcpu \- determine CPU on which the calling thread is running sched_getcpu \- 呼び出したスレッドが実行されている CPU を知る -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" .\" Really:_BSD_SOURCE || _SVID_SOURCE -.B #include +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP -.B int sched_getcpu(void); +\fBint sched_getcpu(void);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR sched_getcpu () -.\"O returns the number of the CPU on which the calling thread is currently executing. -.BR sched_getcpu () -は、呼び出したスレッドが現在実行されている CPU の番号を返す。 -.\"O .SH RETURN VALUE +\fBsched_getcpu\fP() は、呼び出したスレッドが現在実行されている CPU の番号を返す。 .SH 返り値 -.\"O On success, -.\"O .BR sched_getcpu () -.\"O returns a nonnegative CPU number. -.\"O On error, \-1 is returned and -.\"O .I errno -.\"O is set to indicate the error. -成功すると、 -.BR sched_getcpu () -は非負の CPU 番号を返す。 -エラーの場合、\-1 を返し、 -.I errno +成功すると、 \fBsched_getcpu\fP() は非負の CPU 番号を返す。 エラーの場合、\-1 を返し、 \fIerrno\fP にエラーを示す値を設定する。 -.\"O .SH ERRORS .SH エラー -.TP -.B ENOSYS -.\"O This kernel does not implement -.\"O .BR getcpu (2). -このカーネルでは -.BR getcpu (2) -が実装されていない。 -.\"O .SH VERSIONS +.TP +\fBENOSYS\fP +このカーネルでは \fBgetcpu\fP(2) が実装されていない。 .SH バージョン -.\"O This function is available since glibc 2.6. この関数は glibc 2.6 以降で利用可能である。 -.\"O .SH CONFORMING TO .SH 準拠 -.\"O .BR sched_getcpu () -.\"O is glibc specific. -.BR sched_getcpu () -は glibc 固有である。 -.\"O .SH NOTES +\fBsched_getcpu\fP() は glibc 固有である。 .SH 注意 -.\"O The call +呼び出し .in +4n .nf @@ -89,12 +59,7 @@ cpu = sched_getcpu(); .fi .in -.\"O is equivalent to the following -.\"O .BR getcpu (2) -.\"O call: -は、以下の -.BR getcpu (2) -の呼び出しと等価である。 +は、以下の \fBgetcpu\fP(2) 呼び出しと等価である。 .in +4n .nf @@ -103,6 +68,5 @@ s = getcpu(&c, NULL, NULL); cpu = (s == \-1) ? s : c; .fi .in -.\"O .SH SEE ALSO .SH 関連項目 -.BR getcpu (2) +\fBgetcpu\fP(2) diff --git a/draft/man3/seekdir.3 b/draft/man3/seekdir.3 index f72f9646..86c4aa41 100644 --- a/draft/man3/seekdir.3 +++ b/draft/man3/seekdir.3 @@ -7,7 +7,7 @@ .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one +.\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no @@ -25,97 +25,36 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 18:25:21 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka -.\" all rights reserved. -.\" Translated Wed Dec 24 12:34:12 JST 1997 -.\" by HIROFUMI Nishizuka -.\" Updated 2009-04-24, Akihiro MOTOKI , LDP v3.20 +.\" This file was generated with po4a. Translate the source file. .\" -.TH SEEKDIR 3 2009-03-11 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH SEEKDIR 3 2009\-03\-11 "" "Linux Programmer's Manual" .SH 名前 -.\"O seekdir \- set the position of the next readdir() call in the directory -.\"O stream. -seekdir \- 次の readdir() 呼び出しのために、ディレクトリストリーム中の位置を -設定する -.\"O .SH SYNOPSIS +seekdir \- 次の readdir() 呼び出しのために、ディレクトリストリーム中の位置を 設定する .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "void seekdir(DIR *" dirp ", long " offset ); +\fBvoid seekdir(DIR *\fP\fIdirp\fP\fB, long \fP\fIoffset\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR seekdir (): -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE -.\"O .SH DESCRIPTION +\fBseekdir\fP(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE .SH 説明 -.\"O The -.\"O .BR seekdir () -.\"O function sets the location in the directory stream -.\"O from which the next -.\"O .BR readdir (2) -.\"O call will start. -.BR seekdir () -関数は、次の -.BR readdir (3) -呼び出しの開始位置である、 -ディレクトリストリームの中での位置を設定する。 -.\"O .BR seekdir () -.\"O should be used with an -.\"O .I offset -.\"O returned by -.\"O .BR telldir (3). -.BR seekdir () -は -.BR telldir (3) -によって返される -.I offset -とともに使用されるべきである。 -.\"O .SH "RETURN VALUE" +\fBseekdir\fP() 関数は、次の \fBreaddir\fP(3) 呼び出しの開始位置である、 ディレクトリストリームの中での位置を設定する。 +\fBseekdir\fP() は \fBtelldir\fP(3) によって返される \fIoffset\fP とともに使用されるべきである。 .SH 返り値 -.\"O The -.\"O .BR seekdir () -.\"O function returns no value. -.BR seekdir () -関数は、値を返さない。 -.\"O .SH "CONFORMING TO" +\fBseekdir\fP() 関数は、値を返さない。 .SH 準拠 -4.3BSD, POSIX.1-2001. -.\"O .SH NOTES +4.3BSD, POSIX.1\-2001. .SH 注意 -.\"O In glibc up to version 2.1.1, the type of the -.\"O .I offset -.\"O argument was -.\"O .IR off_t . -.\"O POSIX.1-2001 specifies -.\"O .IR long , -.\"O and this is the type used since glibc 2.1.2. -バージョン 2.1.1 以前の glibc では、 -.I offset -引き数の型は -.I off_t -であった。 -POSIX.1-2001 では -.I long -と規定されており、glibc 2.1.2 以降では -.I long -になっている。 -.\"O .SH "SEE ALSO" +バージョン 2.1.1 以前の glibc では、 \fIoffset\fP 引き数の型は \fIoff_t\fP であった。 POSIX.1\-2001 では +\fIlong\fP と規定されており、glibc 2.1.2 以降では \fIlong\fP になっている。 .SH 関連項目 -.BR lseek (2), -.BR closedir (3), -.BR opendir (3), -.BR readdir (3), -.BR rewinddir (3), -.BR scandir (3), -.BR telldir (3) +\fBlseek\fP(2), \fBclosedir\fP(3), \fBopendir\fP(3), \fBreaddir\fP(3), \fBrewinddir\fP(3), +\fBscandir\fP(3), \fBtelldir\fP(3) diff --git a/draft/man3/setenv.3 b/draft/man3/setenv.3 index befb61ab..957888d4 100644 --- a/draft/man3/setenv.3 +++ b/draft/man3/setenv.3 @@ -32,176 +32,62 @@ .\" Noted nonstandard behavior of setenv() if name contains '=' .\" 2005-08-12, mtk, glibc 2.3.4 fixed the "name contains '='" bug .\" -.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka -.\" all rights reserved. -.\" Translated 1997-12-19, HIROFUMI Nishizuka -.\" Updated & Modified 2005-02-17, Yuichi SATO -.\" Updated & Modified 2005-10-02, Akihiro MOTOKI -.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 -.\" Updated 2010-04-10, Akihiro MOTOKI, LDP v3.24 +.\"******************************************************************* .\" -.TH SETENV 3 2009-09-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH SETENV 3 2009\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 -.\"O setenv \- change or add an environment variable setenv \- 環境変数を変更または追加する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int setenv(const char *" name ", const char *" value ", int " overwrite ); +\fBint setenv(const char *\fP\fIname\fP\fB, const char *\fP\fIvalue\fP\fB, int \fP\fIoverwrite\fP\fB);\fP .sp -.BI "int unsetenv(const char *" name ); +\fBint unsetenv(const char *\fP\fIname\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR setenv (), -.BR unsetenv (): +\fBsetenv\fP(), \fBunsetenv\fP(): .RS 4 _BSD_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR setenv () -.\"O function adds the variable \fIname\fP to the -.\"O environment with the value \fIvalue\fP, if \fIname\fP does not -.\"O already exist. -.\"O If \fIname\fP does exist in the environment, then -.\"O its value is changed to \fIvalue\fP if \fIoverwrite\fP is nonzero; -.\"O if \fIoverwrite\fP is zero, then the value of \fIname\fP is not -.\"O changed. -.BR setenv () -関数は、\fIname\fP が存在しない場合 -環境変数 \fIname\fP に値 \fIvalue\fP を設定し、環境に追加する。 -\fIname\fP が環境に存在する場合、\fIoverwrite\fP が 0 以外ならば -その値を \fIvalue\fP に変更し、\fIoverwrite\fP が 0 ならば -\fIname\fP の値を変更しない。 -.\"O This function makes copies of the strings pointed to by -.\"O .I name -.\"O and -.\"O .I value -.\"O (by contrast with -.\"O .BR putenv (3)). -この関数は、 -.RB ( putenv (3) -と違い) -.I name -と -.I value +\fBsetenv\fP() 関数は、\fIname\fP が存在しない場合 環境変数 \fIname\fP に値 \fIvalue\fP を設定し、環境に追加する。 +\fIname\fP が環境に存在する場合、\fIoverwrite\fP が 0 以外ならば その値を \fIvalue\fP に変更し、\fIoverwrite\fP が +0 ならば \fIname\fP の値を変更しない。 この関数は、 (\fBputenv\fP(3) と違い) \fIname\fP と \fIvalue\fP により参照される文字列のコピーを行う。 .PP -.\"O The -.\"O .BR unsetenv () -.\"O function deletes the variable \fIname\fP from -.\"O the environment. -.BR unsetenv () -関数は、変数 \fIname\fP を環境から削除する。 -.\"O If -.\"O .I name -.\"O does not exist in the environment, -.\"O then the function succeeds, and the environment is unchanged. -.I name +\fBunsetenv\fP() 関数は、変数 \fIname\fP を環境から削除する。 \fIname\fP が環境にない場合、この関数は成功し、環境は変更されない。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O The -.\"O .BR setenv () -.\"O function returns zero on success, -.\"O or \-1 on error, with -.\"O .I errno -.\"O set to indicate the cause of the error. -.BR setenv () -関数は、成功すると 0 を返す。 -エラーの場合、\-1 を返し、 -.I errno -にエラーの原因を示す値がセットされる。 +\fBsetenv\fP() 関数は、成功すると 0 を返す。 エラーの場合、\-1 を返し、 \fIerrno\fP にエラーの原因を示す値がセットされる。 -.\"O The -.\"O .BR unsetenv () -.\"O function returns zero on success, -.\"O or \-1 on error, with -.\"O .I errno -.\"O set to indicate the cause of the error. -.BR unsetenv () -関数は、成功すると 0 を返す。 -エラーの場合は \-1 を返し、 -.I errno -を設定してエラーの原因を示す。 -.\"O .SH "ERRORS" +\fBunsetenv\fP() 関数は、成功すると 0 を返す。 エラーの場合は \-1 を返し、 \fIerrno\fP を設定してエラーの原因を示す。 .SH エラー -.TP -.B EINVAL -.\"O .I name -.\"O is NULL, points to a string of length 0, -.\"O or contains an \(aq=\(aq character. -.I name -が NULL であるか、長さが 0 の文字列を指しているか、 -\(aq=\(aq 文字が含まれている。 -.TP -.B ENOMEM -.\"O Insufficient memory to add a new variable to the environment. +.TP +\fBEINVAL\fP +\fIname\fP が NULL であるか、長さが 0 の文字列を指しているか、 \(aq=\(aq 文字が含まれている。 +.TP +\fBENOMEM\fP 環境に新しい変数を追加するのに十分なメモリがない。 -.\"O .SH "CONFORMING TO" .SH 準拠 -4.3BSD, POSIX.1-2001. -.\"O .SH "NOTES" +4.3BSD, POSIX.1\-2001. .SH 注意 -.\"O POSIX.1-2001 does not require -.\"O .BR setenv () -.\"O or -.\"O .BR unsetenv () -.\"O to be reentrant. -POSIX.1-2001 は、 -.BR setenv () -や -.BR unsetenv () -がリエントラント (再入可能) であることを要求していない。 +POSIX.1\-2001 は、 \fBsetenv\fP() や \fBunsetenv\fP() がリエントラント (再入可能) であることを要求していない。 -.\"O Prior to glibc 2.2.2, -.\"O .BR unsetenv () -.\"O was prototyped -.\"O as returning \fIvoid\fP; more recent glibc versions follow the -.\"O POSIX.1-2001-compliant prototype shown in the SYNOPSIS. -glibc 2.2.2 以前では、 -.BR unsetenv () -は -返り値が \fIvoid\fP のプロトタイプであった。 -もっと最近の glibc 版は、「書式」セクションで示しているように -POSIX.1-2001 互換のプロトタイプである。 -.\"O .SH BUGS +glibc 2.2.2 以前では、 \fBunsetenv\fP() は 返り値が \fIvoid\fP のプロトタイプであった。 もっと最近の glibc +版は、「書式」セクションで示しているように POSIX.1\-2001 互換のプロトタイプである。 .SH バグ -.\"O POSIX.1-2001 specifies that if -.\"O .I name -.\"O contains an \(aq=\(aq character, then -.\"O .BR setenv () -.\"O should fail with the error -.\"O .BR EINVAL ; -POSIX.1-2001 では -.RI 「 name -に \(aq=\(aq 文字が含まれる場合、 -.BR setenv () -はエラー -.B EINVAL -で失敗すべきである」と述べられている。 -.\"O however, versions of glibc before 2.3.4 allowed an \(aq=\(aq sign in -.\"O .IR name . -しかし 2.3.4 より前のバージョンの glibc では、 -.I name -に \(aq=\(aq 文字が含まれるのを許している。 -.\"O .SH "SEE ALSO" +POSIX.1\-2001 では 「\fIname\fP に \(aq=\(aq 文字が含まれる場合、 \fBsetenv\fP() はエラー \fBEINVAL\fP +で失敗すべきである」と述べられている。 しかし 2.3.4 より前のバージョンの glibc では、 \fIname\fP に \(aq=\(aq +文字が含まれるのを許している。 .SH 関連項目 -.BR clearenv (3), -.BR getenv (3), -.BR putenv (3), -.BR environ (7) +\fBclearenv\fP(3), \fBgetenv\fP(3), \fBputenv\fP(3), \fBenviron\fP(7) diff --git a/draft/man3/shm_open.3 b/draft/man3/shm_open.3 index 46563409..bb8869a1 100644 --- a/draft/man3/shm_open.3 +++ b/draft/man3/shm_open.3 @@ -23,455 +23,137 @@ .\" the source, must acknowledge the copyright and authors of this work. .\" .\" FIXME . Add an example to this page +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI, all rights reserved. -.\" Translated Mon Feb 2 2003 by Akihiro MOTOKI -.\" Updated 2009-02-23, Akihiro MOTOKI , LDP v3.19 +.\" This file was generated with po4a. Translate the source file. .\" -.TH SHM_OPEN 3 2009-02-25 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH SHM_OPEN 3 2009\-02\-25 Linux "Linux Programmer's Manual" .SH 名前 -.\"O shm_open, shm_unlink \- Create/open or unlink POSIX shared memory objects -shm_open, shm_unlink \- POSIX 共有メモリ・オブジェクトの作成/オープン、 -削除を行う -.\"O .SH SYNOPSIS +shm_open, shm_unlink \- POSIX 共有メモリ・オブジェクトの作成/オープン、 削除を行う .SH 書式 -.B #include +\fB#include \fP .br -.\"O .BR "#include " " /* For mode constants */" -.BR "#include " " /* mode 定数用 */" +\fB#include \fP /* mode 定数用 */ .br -.\"O .BR "#include " " /* For O_* constants */" -.BR "#include " " /* O_* 定数の定義用 */" +\fB#include \fP /* O_* 定数の定義用 */ .sp -.BI "void * shm_open(const char *" name ", int " oflag ", mode_t " mode ); +\fBvoid * shm_open(const char *\fP\fIname\fP\fB, int \fP\fIoflag\fP\fB, mode_t +\fP\fImode\fP\fB);\fP .sp -.BI "int shm_unlink(const char *" name ); +\fBint shm_unlink(const char *\fP\fIname\fP\fB);\fP .sp -.\"O Link with \fI\-lrt\fP. \fI\-lrt\fP でリンクする。 -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR shm_open () -.\"O creates and opens a new, or opens an existing, POSIX shared memory object. -.\"O A POSIX shared memory object is in effect a handle which can -.\"O be used by unrelated processes to -.\"O .BR mmap (2) -.\"O the same region of shared memory. -.BR shm_open () -は、POSIX 共有メモリ・オブジェクトを新規に作成/オープンしたり、 -すでに存在するオブジェクトをオープンしたりする。 -POSIX 共有メモリ・オブジェクトは、実際には、関係のないプロセスが -共有メモリの同じ領域を -.BR mmap (2) -するために使用することができる手段である。 -.\"O The -.\"O .BR shm_unlink () -.\"O function performs the converse operation, -.\"O removing an object previously created by -.\"O .BR shm_open (). -.BR shm_unlink () -は、逆の操作、つまり以前に -.BR shm_open () +\fBshm_open\fP() は、POSIX 共有メモリ・オブジェクトを新規に作成/オープンしたり、 すでに存在するオブジェクトをオープンしたりする。 +POSIX 共有メモリ・オブジェクトは、実際には、関係のないプロセスが 共有メモリの同じ領域を \fBmmap\fP(2) +するために使用することができる手段である。 \fBshm_unlink\fP() は、逆の操作、つまり以前に \fBshm_open\fP() で作成されたオブジェクトの削除を行う。 .LP -.\"O The operation of -.\"O .BR shm_open () -.\"O is analogous to that of -.\"O .BR open (2). -.BR shm_open () -の動作は -.BR open (2) -とよく似ている。 -.\"O .I name -.\"O specifies the shared memory object to be created or opened. -.\"O For portable use, -.\"O a shared memory object should be identified by a name of the form -.\"O .IR /somename ; -.\"O that is, a null-terminated string of up to -.\"O .BI NAME_MAX -.\"O (i.e., 255) characters consisting of an initial slash, -.I name -で作成したりオープンしたりする共有メモリ・オブジェクトを指定する。 -移植性を持たせるためには、共有メモリ・オブジェクトは -.I /somename -という形式の名前で識別し、 -その名前は、最大で -.B NAME_MAX -(すなわち 255) 文字の NULL 終端された文字列で、 .\" glibc allows the initial slash to be omitted, and makes .\" multiple initial slashes equivalent to a single slash. .\" This differs from the implementation of POSIX message queues. -.\"O followed by one or more characters, none of which are slashes. -スラッシュで始まり、スラッシュ以外の文字が 1 文字以上続く形式 -にすべきである。 .\" glibc allows subdirectory components in the name, in which .\" case the subdirectory must exist under /dev/shm, and allow the .\" required permissions if a user wants to create a shared memory .\" object in that subdirectory. +\fBshm_open\fP() の動作は \fBopen\fP(2) とよく似ている。 \fIname\fP +で作成したりオープンしたりする共有メモリ・オブジェクトを指定する。 移植性を持たせるためには、共有メモリ・オブジェクトは \fI/somename\fP +という形式の名前で識別し、 その名前は、最大で \fBNAME_MAX\fP (すなわち 255) 文字の NULL 終端された文字列で、 +スラッシュで始まり、スラッシュ以外の文字が 1 文字以上続く形式 にすべきである。 .LP -.\"O .I oflag -.\"O is a bit mask created by ORing together exactly one of -.\"O .B O_RDONLY -.\"O or -.\"O .B O_RDWR -.\"O and any of the other flags listed here: -.I oflag -はビットマスクで、 -.B O_RDONLY -と -.B O_RDWR -のいずれか一方と、以下に述べる他のフラグの論理和をとったもの +\fIoflag\fP はビットマスクで、 \fBO_RDONLY\fP と \fBO_RDWR\fP のいずれか一方と、以下に述べる他のフラグの論理和をとったもの を指定する。 -.TP 1.1i -.B O_RDONLY -.\"O Open the object for read access. -.\"O A shared memory object opened in this way can only be -.\"O .BR mmap (2)ed -.\"O for read (\fBPROT_READ\fP) access. -読み出しアクセス用にオブジェクトをオープンする。 -このフラグを指定してオープンされた共有メモリ・オブジェクトは、 -読み出し (\fBPROT_READ\fP) アクセスでのみ -.BR mmap (2) -することができる。 -.TP -.B O_RDWR -.\"O Open the object for read-write access. +.TP 1.1i +\fBO_RDONLY\fP +読み出しアクセス用にオブジェクトをオープンする。 このフラグを指定してオープンされた共有メモリ・オブジェクトは、 読み出し (\fBPROT_READ\fP) +アクセスでのみ \fBmmap\fP(2) することができる。 +.TP +\fBO_RDWR\fP 読み書きアクセス用にオブジェクトをオープンする。 -.TP -.B O_CREAT -.\"O Create the shared memory object if it does not exist. -存在しない場合、共有メモリ・オブジェクトを作成する。 -.\"O The user and group ownership of the object are taken -.\"O from the corresponding effective IDs of the calling process, -.\"O .\" In truth it is actually the file system IDs on Linux, but these -.\"O .\" are nearly always the same as the effective IDs. (MTK, Jul 05) -.\"O and the object's -.\"O permission bits are set according to the low-order 9 bits of -.\"O .IR mode , -.\"O except that those bits set in the process file mode -.\"O creation mask (see -.\"O .BR umask (2)) -.\"O are cleared for the new object. -オブジェクトのユーザとグループの所有権は、 -呼び出し元プロセスの対応する実効 ID が使われ、 -.\" 本当は、Linux ではファイルシステム ID が使われるのだが、 -.\" その値はほとんどいつも実効 ID と同じである。 (MTK, Jul 05) -オブジェクトの許可ビットは -.I mode -の下位 9 ビットに基づいて設定される。ただし、 -ファイルモード作成マスク -.RB ( umask (2) -参照) に設定されている値は、新規オブジェクトに関してはクリアされる。 -.\"O A set of macro constants which can be used to define -.\"O .I mode -.\"O is listed in -.\"O .BR open (2). -.\"O (Symbolic definitions of these constants can be obtained by including -.\"O .IR .) -.I mode -を定義するために使用できるマクロ定数(群)は -.BR open (2) -に記載されている -(これらの定数のシンボル定義は -.I +.TP +\fBO_CREAT\fP +.\" In truth it is actually the file system IDs on Linux, but these +.\" are nearly always the same as the effective IDs. (MTK, Jul 05) +存在しない場合、共有メモリ・オブジェクトを作成する。 オブジェクトのユーザとグループの所有権は、 呼び出し元プロセスの対応する実効 ID が使われ、 +オブジェクトの許可ビットは \fImode\fP の下位 9 ビットに基づいて設定される。ただし、 ファイルモード作成マスク (\fBumask\fP(2) +参照) に設定されている値は、新規オブジェクトに関してはクリアされる。 \fImode\fP を定義するために使用できるマクロ定数(群)は +\fBopen\fP(2) に記載されている (これらの定数のシンボル定義は \fI\fP のインクルードにより得られる)。 .sp -.\"O A new shared memory object initially has zero length\(emthe size of the -.\"O object can be set using -.\"O .BR ftruncate (2). -.\"O The newly-allocated bytes of a shared memory -.\"O object are automatically initialized to 0. -新規に作成された共有メモリ・オブジェクトは長さ 0 で初期化される。 -オブジェクトの大きさは -.BR ftruncate (2) -を使って設定できる。 -共有メモリ・オブジェクトとして新規に確保されたバイトは自動的に -0 に初期化される。 -.TP -.B O_EXCL -.\"O If -.\"O .B O_CREAT -.\"O was also specified, and a shared memory object with the given -.\"O .I name -.\"O already exists, return an error. -.\"O The check for the existence of the object, and its creation if it -.\"O does not exist, are performed atomically. -.B O_CREAT -が一緒に指定されており、 -.I name -で指定された共有メモリ・オブジェクトが既に存在した場合、 -エラーを返す。 -オブジェクトの存在確認と、存在しなかった場合のオブジェクト作成は、 -必ず一連の操作として実行される (performed atomically)。 -.TP -.B O_TRUNC -.\"O If the shared memory object already exists, truncate it to zero bytes. -共有メモリ・オブジェクトがすでに存在した場合、 -そのオブジェクトを 0 バイトに切り詰める。 +新規に作成された共有メモリ・オブジェクトは長さ 0 で初期化される。 オブジェクトの大きさは \fBftruncate\fP(2) を使って設定できる。 +共有メモリ・オブジェクトとして新規に確保されたバイトは自動的に 0 に初期化される。 +.TP +\fBO_EXCL\fP +\fBO_CREAT\fP が一緒に指定されており、 \fIname\fP で指定された共有メモリ・オブジェクトが既に存在した場合、 エラーを返す。 +オブジェクトの存在確認と、存在しなかった場合のオブジェクト作成は、 必ず一連の操作として実行される (performed atomically)。 +.TP +\fBO_TRUNC\fP +共有メモリ・オブジェクトがすでに存在した場合、 そのオブジェクトを 0 バイトに切り詰める。 .LP -.\"O Definitions of these flag values can be obtained by including -.\"O .IR . -これらのフラグ値の定義は -.I -のインクルードにより得られる。 +これらのフラグ値の定義は \fI\fP のインクルードにより得られる。 .LP -.\"O On successful completion -.\"O .BR shm_open () -.\"O returns a new file descriptor referring to the shared memory object. -.\"O This file descriptor is guaranteed to be the lowest-numbered file descriptor -.\"O not previously opened within the process. -.\"O The -.\"O .B FD_CLOEXEC -.\"O flag (see -.\"O .BR fcntl (2)) -.\"O is set for the file descriptor. -成功して完了した場合、 -.BR shm_open () -は共有メモリ・オブジェクトを参照する新しいファイル・ディスクリプタを返す。 -このファイル・ディスクリプタは、そのプロセス内で過去にオープンされていない -ファイル・ディスクリプタの中で最も小さな数になることが保証される。 -.B FD_CLOEXEC -フラグ -.RB ( fcntl (2) -を参照) が、このファイル・ディスクリプタに設定される。 -.PP -.\"O The file descriptor is normally used in subsequent calls -.\"O to -.\"O .BR ftruncate (2) -.\"O (for a newly created object) and -.\"O .BR mmap (2). -.\"O After a call to -.\"O .BR mmap (2) -.\"O the file descriptor may be closed without affecting the memory mapping. -通常、これらのファイル・ディスクリプタは、この後続けて実行される -.BR ftruncate (2) -(新規に作成されたオブジェクトの場合のみ) と -.BR mmap (2) -の呼び出しに使用される。 -.BR mmap (2) -を呼び出した後は、ファイル・ディスクリプタをクローズしてもよく、 +成功して完了した場合、 \fBshm_open\fP() は共有メモリ・オブジェクトを参照する新しいファイル・ディスクリプタを返す。 +このファイル・ディスクリプタは、そのプロセス内で過去にオープンされていない ファイル・ディスクリプタの中で最も小さな数になることが保証される。 +\fBFD_CLOEXEC\fP フラグ (\fBfcntl\fP(2) を参照) が、このファイル・ディスクリプタに設定される。 + +通常、これらのファイル・ディスクリプタは、この後続けて実行される \fBftruncate\fP(2) (新規に作成されたオブジェクトの場合のみ) と +\fBmmap\fP(2) の呼び出しに使用される。 \fBmmap\fP(2) を呼び出した後は、ファイル・ディスクリプタをクローズしてもよく、 クローズしてもメモリ・マッピングに影響を与えることはない。 -.PP -.\"O The operation -.\"O of -.\"O .BR shm_unlink () -.\"O is analogous to -.\"O .BR unlink (2): -.\"O it removes a shared memory object name, and, once all processes -.\"O have unmapped the object, de-allocates and -.\"O destroys the contents of the associated memory region. -.BR shm_unlink () -の動作は -.BR unlink (2) -とよく似ている: -共有メモリ・オブジェクト名を削除し、すべてのプロセスが処理対象の -オブジェクトをアンマップした時点でオブジェクトの割り当てを解除し、 -対応するメモリ領域の内容を破棄する。 -.\"O After a successful -.\"O .BR shm_unlink (), -.\"O attempts to -.\"O .BR shm_open () -.\"O an object with the same -.\"O .I name -.\"O will fail (unless -.\"O .B O_CREAT -.\"O was specified, in which case a new, distinct object is created). -.BR shm_unlink () -が成功した後で、同じ -.I name -を持つオブジェクトに対して -.BR shm_open () -を行うと、 -.RB ( O_CREAT -が指定されていない場合) 失敗する。 -.RB ( O_CREAT + +\fBshm_unlink\fP() の動作は \fBunlink\fP(2) とよく似ている: +共有メモリ・オブジェクト名を削除し、すべてのプロセスが処理対象の オブジェクトをアンマップした時点でオブジェクトの割り当てを解除し、 +対応するメモリ領域の内容を破棄する。 \fBshm_unlink\fP() が成功した後で、同じ \fIname\fP を持つオブジェクトに対して +\fBshm_open\fP() を行うと、 (\fBO_CREAT\fP が指定されていない場合) 失敗する。 (\fBO_CREAT\fP が指定されている場合、新しく別のオブジェクトが作成される)。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O On success, -.\"O .BR shm_open () -.\"O returns a nonnegative file descriptor. -.\"O On failure, -.\"O .B shm_open () -.\"O returns \-1. -.\"O .BR shm_unlink () -.\"O returns 0 on success, or \-1 on error. -成功した場合、 -.BR shm_open () -は非負のファイル・ディスクリプタを返す。 -失敗した場合、 -.BR shm_open () -は \-1 を返す。 -.BR shm_unlink () -は、成功した場合 0 を、エラーが起こった場合 \-1 を返す。 -.\"O .SH ERRORS +成功した場合、 \fBshm_open\fP() は非負のファイル・ディスクリプタを返す。 失敗した場合、 \fBshm_open\fP() は \-1 を返す。 +\fBshm_unlink\fP() は、成功した場合 0 を、エラーが起こった場合 \-1 を返す。 .SH エラー -.\"O On failure, -.\"O .I errno -.\"O is set to indicate the cause of the error. -.\"O Values which may appear in -.\"O .I errno -.\"O include the following: -失敗した場合、エラーの原因を示すため -.I errno -が設定される。 -.I errno -に設定される値は以下の通りである: -.TP -.B EACCES -.\"O Permission to -.\"O .BR shm_unlink () -.\"O the shared memory object was denied. -共有メモリオブジェクトを -.BR shm_unlink () -する権限がなかった。 -.TP -.B EACCES -.\"O Permission was denied to -.\"O .BR shm_open () -.\"O .I name -.\"O in the specified -.\"O .IR mode , -.\"O or -.\"O .B O_TRUNC -.\"O was specified and the caller does not have write permission on the object. -指定された -.I mode -で -.I name -を -.BR shm_open () -する権限がなかった。もしくは、 -.B O_TRUNC -が指定されたが、呼び出し元にはそのオブジェクトに対する書き込み権限が -なかった。 -.TP -.B EEXIST -.\"O Both -.\"O .B O_CREAT -.\"O and -.\"O .B O_EXCL -.\"O were specified to -.\"O .BR shm_open () -.\"O and the shared memory object specified by -.\"O .I name -.\"O already exists. -.B O_CREAT -と -.B O_EXCL -の両方が -.BR shm_open () -に指定されたが、 -.I name +失敗した場合、エラーの原因を示すため \fIerrno\fP が設定される。 \fIerrno\fP に設定される値は以下の通りである: +.TP +\fBEACCES\fP +共有メモリオブジェクトを \fBshm_unlink\fP() する権限がなかった。 +.TP +\fBEACCES\fP +指定された \fImode\fP で \fIname\fP を \fBshm_open\fP() する権限がなかった。もしくは、 \fBO_TRUNC\fP +が指定されたが、呼び出し元にはそのオブジェクトに対する書き込み権限が なかった。 +.TP +\fBEEXIST\fP +\fBO_CREAT\fP と \fBO_EXCL\fP の両方が \fBshm_open\fP() に指定されたが、 \fIname\fP で指定された共有メモリ・オブジェクトが既に存在した。 -.TP -.B EINVAL -.\"O The -.\"O .I name -.\"O argument to -.\"O .BR shm_open () -.\"O was invalid. -.BR shm_open () -に与えられた -.I name -引き数が不正であった。 -.TP -.B EMFILE -.\"O The process already has the maximum number of files open. +.TP +\fBEINVAL\fP +\fBshm_open\fP() に与えられた \fIname\fP 引き数が不正であった。 +.TP +\fBEMFILE\fP プロセスがオープン可能なファイル数の上限にすでに達していた。 -.TP -.B ENAMETOOLONG -.\"O The length of -.\"O .I name -.\"O exceeds -.\"O .BR PATH_MAX . -.I name -の長さが -.B PATH_MAX -を越えている。 -.TP -.B ENFILE -.\"O The limit on the total number of files open on the system has been -.\"O reached. +.TP +\fBENAMETOOLONG\fP +\fIname\fP の長さが \fBPATH_MAX\fP を越えている。 +.TP +\fBENFILE\fP ファイルシステムでオープンできるファイル数の上限に達した。 -.TP -.B ENOENT -.\"O An attempt was made to -.\"O .BR shm_open () -.\"O a -.\"O .I name -.\"O that did not exist, and -.\"O .B O_CREAT -.\"O was not specified. -存在していない -.I name -のオブジェクトを -.BR shm_open () -しようとしたが、 -.B O_CREAT -が指定されていなかった。 -.TP -.B ENOENT -.\"O An attempt was to made to -.\"O .BR shm_unlink () -.\"O a -.\"O .I name -.\"O that does not exist. -存在しない -.I name -のオブジェクトを -.BR shm_unlink () -しようとした。 -.\"O .SH VERSIONS +.TP +\fBENOENT\fP +存在していない \fIname\fP のオブジェクトを \fBshm_open\fP() しようとしたが、 \fBO_CREAT\fP が指定されていなかった。 +.TP +\fBENOENT\fP +存在しない \fIname\fP のオブジェクトを \fBshm_unlink\fP() しようとした。 .SH バージョン -.\"O These functions are provided in glibc 2.2 and later. これらの関数は glibc 2.2 以降で提供されている。 -.\"O .SH "CONFORMING TO" .SH 準拠 -POSIX.1-2001. +POSIX.1\-2001. .LP -.\"O POSIX.1-2001 says that the group ownership of a newly created shared -.\"O memory object is set to either the calling process's effective group ID -.\"O or "a system default group ID". -POSIX.1-2001 には、新規に作成される共有メモリオブジェクトのグループ所有権は、 -呼び出し元プロセスの実効グループ ID か 「システムのデフォルトのグループ ID」 -のどちらかに設定される、と書かれている。 -.\"O .SH "NOTES" +POSIX.1\-2001 には、新規に作成される共有メモリオブジェクトのグループ所有権は、 呼び出し元プロセスの実効グループ ID か +「システムのデフォルトのグループ ID」 のどちらかに設定される、と書かれている。 .SH 注意 .LP -.\"O POSIX leaves the behavior of the combination of -.\"O .B O_RDONLY -.\"O and -.\"O .B O_TRUNC -.\"O unspecified. -.\"O On Linux, this will successfully truncate an existing -.\"O shared memory object\(emthis may not be so on other UNIX systems. -POSIX は -.B O_RDONLY -と -.B O_TRUNC -が一緒に指定された場合の動作を未定義にしている。Linux では、 -既存の共有メモリ・オブジェクトに対する切り詰め (truncate) は成功する。 -しかし、他の UNIX システムでも同じであるとは限らない。 +POSIX は \fBO_RDONLY\fP と \fBO_TRUNC\fP が一緒に指定された場合の動作を未定義にしている。Linux では、 +既存の共有メモリ・オブジェクトに対する切り詰め (truncate) は成功する。 しかし、他の UNIX システムでも同じであるとは限らない。 .LP -.\"O The POSIX shared memory object implementation on Linux 2.4 makes use -.\"O of a dedicated file system, which is normally -.\"O mounted under -.\"O .IR /dev/shm . -Linux 2.4 における POSIX 共有メモリ・オブジェクトの実装は -専用のファイルシステムを使用する。そのファイルシステムは通常 -.I /dev/shm -にマウントされる。 -.\"O .SH "SEE ALSO" +Linux 2.4 における POSIX 共有メモリ・オブジェクトの実装は 専用のファイルシステムを使用する。そのファイルシステムは通常 +\fI/dev/shm\fP にマウントされる。 .SH 関連項目 -.BR close (2), -.BR fchmod (2), -.BR fchown (2), -.BR fcntl (2), -.BR fstat (2), -.BR ftruncate (2), -.BR mmap (2), -.BR open (2), -.BR umask (2), -.BR shm_overview (7) +\fBclose\fP(2), \fBfchmod\fP(2), \fBfchown\fP(2), \fBfcntl\fP(2), \fBfstat\fP(2), +\fBftruncate\fP(2), \fBmmap\fP(2), \fBopen\fP(2), \fBumask\fP(2), \fBshm_overview\fP(7) diff --git a/draft/man3/signbit.3 b/draft/man3/signbit.3 index 7e444233..3896af9f 100644 --- a/draft/man3/signbit.3 +++ b/draft/man3/signbit.3 @@ -3,99 +3,47 @@ .\" .\" Distributed under GPL .\" Based on glibc infopages, copyright Free Software Foundation +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated Sun Sep 22 09:46:55 2002 -.\" by Akihiro MOTOKI -.\" Updated 2008-09-16, Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.TH SIGNBIT 3 2010-09-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH SIGNBIT 3 2010\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 -.\"O signbit \- test sign of a real floating-point number signbit \- 浮動小数点実数の符号 (sign) を調べる -.\"O .SH SYNOPSIS .SH 書式 -.B "#include " +\fB#include \fP .sp -.BI "int signbit(" x ");" +\fBint signbit(\fP\fIx\fP\fB);\fP .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR signbit (): +\fBsignbit\fP(): .RS 4 -_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR signbit () -.\"O is a generic macro which can work on all real floating-point types. -.\"O It returns a nonzero value if the value of -.\"O .I x -.\"O has its sign bit set. -.BR signbit () -は、あらゆる種類の浮動小数点実数に対して -適用可能な汎用的なマクロである。 -.I x +\fBsignbit\fP() は、あらゆる種類の浮動小数点実数に対して 適用可能な汎用的なマクロである。 \fIx\fP の値の符号ビットがセットされている場合、非 0 の値を返す。 .PP -.\"O This is not the same as -.\"O .IR "x < 0.0" , -.\"O because IEEE 754 floating point allows zero to be signed. -.\"O The comparison -.\"O .IR "-0.0 < 0.0" -.\"O is false, but -.\"O .IR "signbit(\-0.0)" -.\"O will return a nonzero value. -このマクロは -.I "x < 0.0" -と全く同じではない。 -なぜなら、IEEE 754 の浮動小数点表現では 0 も符号を持つからである。 -.I "-0.0 < 0.0" -という比較結果は偽 (false) だが、 -.IR "signbit (\-0.0)" -は 非 0 の値を返す。 +このマクロは \fIx < 0.0\fP と全く同じではない。 なぜなら、IEEE 754 の浮動小数点表現では 0 も符号を持つからである。 +\fI\-0.0 < 0.0\fP という比較結果は偽 (false) だが、 \fIsignbit (\-0.0)\fP は 非 0 の値を返す。 -.\"O NaNs and infinities have a sign bit. NaN と無限大には符号ビットがある。 -.\"O .SH RETURN VALUE .SH 返り値 -.\"O The -.\"O .BR signbit () -.\"O macro returns nonzero if the sign of -.\"O .I x -.\"O is negative; otherwise it returns zero. -.BR signbit () -マクロは -.I x -の符号が負の場合 0 以外を返し、そうでない場合 0 を返す。 -.\"O .SH ERRORS +\fBsignbit\fP() マクロは \fIx\fP の符号が負の場合 0 以外を返し、そうでない場合 0 を返す。 .SH エラー -.\"O No errors occur. エラーは発生しない。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O This function is defined in IEC 559 (and the appendix with -.\"O recommended functions in IEEE 754/IEEE 854). -この関数は IEC 559 で定義されている -(また IEEE 754/IEEE 854 では付録で推奨関数として定義されている)。 -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. この関数は IEC 559 で定義されている (また IEEE 754/IEEE 854 +では付録で推奨関数として定義されている)。 .SH 関連項目 -.BR copysign (3) +\fBcopysign\fP(3) diff --git a/draft/man3/significand.3 b/draft/man3/significand.3 index 975f6fa5..68aea224 100644 --- a/draft/man3/significand.3 +++ b/draft/man3/significand.3 @@ -1,81 +1,46 @@ .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) .\" Distributed under GPL .\" heavily based on glibc infopages, copyright Free Software Foundation +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 2005 Yuichi SATO -.\" all rights reserved. -.\" Translated Tue Feb 1 07:40:41 JST 2005 -.\" by Yuichi SATO +.\" This file was generated with po4a. Translate the source file. .\" -.TH SIGNIFICAND 3 2009-02-04 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH SIGNIFICAND 3 2009\-02\-04 GNU "Linux Programmer's Manual" .SH 名前 -.\"O significand, significandf, significandl \- -.\"O get mantissa of floating-point number significand, significandf, significandl \- 浮動小数点数の仮数 (mantissa) を取得する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "double significand(double " x ); +\fBdouble significand(double \fP\fIx\fP\fB);\fP .br -.BI "float significandf(float " x ); +\fBfloat significandf(float \fP\fIx\fP\fB);\fP .br -.BI "long double significandl(long double " x ); +\fBlong double significandl(long double \fP\fIx\fP\fB);\fP .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR significand (), -.BR significandf (), -.BR significandl (): +\fBsignificand\fP(), \fBsignificandf\fP(), \fBsignificandl\fP(): .RS 4 _SVID_SOURCE || _BSD_SOURCE .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR significand () -.\"O function returns the mantissa of -.\"O .I x -.\"O scaled to the range [1,2). -.BR significand () -関数は -.I x -の仮数を [1,2) の範囲にして返す。 -.\"O It is equivalent to -これは、以下と等しい。 +\fBsignificand\fP() 関数は \fIx\fP の仮数を [1,2) の範囲にして返す。 これは、以下と等しい。 .sp .in +4n scalb(x, (double) \-ilogb(x)) .in .PP -.\"O This function exists mainly for use in certain standardized tests -.\"O for IEEE 754 conformance. この関数は主に IEEE 754 への準拠を調べる標準テストで使われる。 -.\"O .SH CONFORMING TO .SH 準拠 -.\"O These functions are nonstandard; the -.\"O .I double -.\"O version is available on a number of other systems. -これらの関数は非標準である。。 -.I double -版は他の多くのシステムでも利用可能である。 -.\"O .\" .SH HISTORY -.\" .SH 履歴 -.\"O .\" This function came from BSD. -.\" この関数は BSD に由来する。 -.\"O .SH "SEE ALSO" +.\" .SH HISTORY +.\" This function came from BSD. +これらの関数は非標準である。。 \fIdouble\fP 版は他の多くのシステムでも利用可能である。 .SH 関連項目 -.BR ilogb (3), -.BR scalb (3) +\fBilogb\fP(3), \fBscalb\fP(3) diff --git a/draft/man3/sin.3 b/draft/man3/sin.3 index 468d31bd..d7e8ef8e 100644 --- a/draft/man3/sin.3 +++ b/draft/man3/sin.3 @@ -28,150 +28,66 @@ .\" 386BSD man pages .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) .\" Modified 2002-07-27 by Walter Harms -.\" (walter.harms@informatik.uni-oldenburg.de) +.\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 1996 Kenji Kajiwara and Kentaro Ogawa -.\" all rights reserved. -.\" Translated Sat, 13 Jul 1996 17:42:24 JST -.\" by Kenji Kajiwara and Kentaro Ogawa -.\" Proof Reading: Takashi Yoshino -.\" Updated & Modified Thu Feb 17 22:27:53 JST 2005 -.\" by Yuichi SATO -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH SIN 3 2010-09-11 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH SIN 3 2010\-09\-11 "" "Linux Programmer's Manual" .SH 名前 -.\"O sin, sinf, sinl \- sine function sin, sinf, sinl \- 正弦 (サイン) 関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double sin(double " x ); +\fBdouble sin(double \fP\fIx\fP\fB);\fP .br -.BI "float sinf(float " x ); +\fBfloat sinf(float \fP\fIx\fP\fB);\fP .br -.BI "long double sinl(long double " x ); +\fBlong double sinl(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR sinf (), -.BR sinl (): +\fBsinf\fP(), \fBsinl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR sin () -.\"O function returns the sine of \fIx\fP, where \fIx\fP is -.\"O given in radians. -.BR sin () -関数は \fIx\fP の正弦 (サイン) の値を返す。 -\fIx\fP はラジアン単位で指定する。 -.\"O .SH RETURN VALUE +\fBsin\fP() 関数は \fIx\fP の正弦 (サイン) の値を返す。 \fIx\fP はラジアン単位で指定する。 .SH 返り値 -.\"O On success, these functions return the sine of -.\"O .IR x . -成功すると、これらの関数は -.I x -の正弦を返す。 +成功すると、これらの関数は \fIx\fP の正弦を返す。 -.\"O If -.\"O .I x -.\"O is a NaN, a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is positive infinity or negative infinity, -.\"O a domain error occurs, -.\"O and a NaN is returned. -.I x -が正の無限大か負の無限大の場合、 -領域エラー (domain error) が発生し、NaN が返される。 .\" .\" POSIX.1 allows an optional range error for subnormal x .\" glibc 2.8 doesn't do this -.\"O .SH ERRORS +\fIx\fP が正の無限大か負の無限大の場合、 領域エラー (domain error) が発生し、NaN が返される。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Domain error: \fIx\fP is an infinity -領域エラー (domain error): \fIx\fP が無限大 -.\"O .I errno -.\"O is set to -.\"O .BR EDOM -.\"O (but see BUGS). -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -.I errno -に -.B EDOM -が設定される (「バグ」の節も参照)。 -不正 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) +.TP +領域エラー (domain error): \fIx\fP が無限大である +\fIerrno\fP に \fBEDOM\fP が設定される (「バグ」の節も参照)。 不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 -.PP -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 -.\"O .SH BUGS +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH バグ -.\"O Before version 2.10, the glibc implementation did not set .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6781 -.\"O .I errno -.\"O to -.\"O .B EDOM -.\"O when a domain error occurred. -バージョン 2.10 より前の glibc の実装では、 -領域エラーが発生した際に、 -.I error -に -.B EDOM -が設定されなかった。 -.\"O .SH "SEE ALSO" +バージョン 2.10 より前の glibc の実装では、 領域エラーが発生した際に、 \fIerror\fP に \fBEDOM\fP が設定されなかった。 .SH 関連項目 -.BR acos (3), -.BR asin (3), -.BR atan (3), -.BR atan2 (3), -.BR cos (3), -.BR csin (3), -.BR sincos (3), -.BR tan (3) +\fBacos\fP(3), \fBasin\fP(3), \fBatan\fP(3), \fBatan2\fP(3), \fBcos\fP(3), \fBcsin\fP(3), +\fBsincos\fP(3), \fBtan\fP(3) diff --git a/draft/man3/sincos.3 b/draft/man3/sincos.3 index e1baab07..66d44abf 100644 --- a/draft/man3/sincos.3 +++ b/draft/man3/sincos.3 @@ -3,129 +3,55 @@ .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk .\" .\" -.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated Tue Sep 9 04:06:20 JST 2003 -.\" by Akihiro MOTOKI -.\" Updated 2008-09-16, Akihiro MOTOKI -.\" -.TH SINCOS 3 2008-08-11 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH SINCOS 3 2008\-08\-11 GNU "Linux Programmer's Manual" .SH 名前 -.\"O sincos, sincosf, sincosl \- calculate sin and cos simultaneously sincos, sincosf, sincosl \- 正弦と余弦を同時に計算する -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" -.B #include +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP .sp -.BI "void sincos(double " x ", double *" sin ", double *" cos ); +\fBvoid sincos(double \fP\fIx\fP\fB, double *\fP\fIsin\fP\fB, double *\fP\fIcos\fP\fB);\fP .br -.BI "void sincosf(float " x ", float *" sin ", float *" cos ); +\fBvoid sincosf(float \fP\fIx\fP\fB, float *\fP\fIsin\fP\fB, float *\fP\fIcos\fP\fB);\fP .br -.BI "void sincosl(long double " x ", long double *" sin ", long double *" cos ); +\fBvoid sincosl(long double \fP\fIx\fP\fB, long double *\fP\fIsin\fP\fB, long double *\fP\fIcos\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 -.\"O .SH DESCRIPTION .SH 説明 -.\"O Several applications need sine and cosine of the same angle -.\"O .IR x . -.\"O This function computes both at the same time, and stores the results in -.\"O .I *sin -.\"O and -.\"O .IR *cos . -アプリケーションの中には、同じ角度 -.I x -について正弦と余弦の両方の計算が必要なものがある。 -この関数は両者を同時に計算し、その結果を -.I *sin -と -.I *cos -に格納する。 +アプリケーションの中には、同じ角度 \fIx\fP について正弦と余弦の両方の計算が必要なものがある。 この関数は両者を同時に計算し、その結果を +\fI*sin\fP と \fI*cos\fP に格納する。 -.\"O If -.\"O .I x -.\"O is a NaN, -.\"O a NaN is returned in -.\"O .I *sin -.\"O and -.\"O .IR *cos . -.I x -が NaN の場合、 -.I *sin -と -.I *cos -に NaN が返される。 +\fIx\fP が NaN の場合、 \fI*sin\fP と \fI*cos\fP に NaN が返される。 -.\"O If -.\"O .I x -.\"O is positive infinity or negative infinity, -.\"O a domain error occurs, and -.\"O a NaN is returned in -.\"O .I *sin -.\"O and -.\"O .IR *cos . -.I x -が正の無限大か負の無限大の場合、 -領域エラー (domain error) が発生し、 -.I *sin -と -.I *cos -に NaN が返される。 -.\"O .SH RETURN VALUE +\fIx\fP が正の無限大か負の無限大の場合、 領域エラー (domain error) が発生し、 \fI*sin\fP と \fI*cos\fP に NaN +が返される。 .SH 返り値 -.\"O These functions return -.\"O .IR void . -これらの関数は -.I void -を返す。 -.\"O .SH ERRORS +これらの関数は \fIvoid\fP を返す。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Domain error: \fIx\fP is an infinity -領域エラー (domain error): \fIx\fp が無限大 +.TP +領域エラー (domain error): \fIx\fP が無限大である .\" .I errno .\" is set to .\" .BR EDOM . -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -不正 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) -が上がる。 +不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 .PP -.\"O These functions do not set -.\"O .IR errno . -これらの関数は -.I errno -を設定しない。 .\" FIXME . Is it intentional that these functions do not set errno? .\" sin() and cos() also don't set errno; bugs have been raised for .\" those functions. -.\"O .SH VERSIONS +これらの関数は \fIerrno\fP を設定しない。 .SH バージョン -.\"O These functions first appeared in glibc in version 2.1. これらの関数は glibc バージョン 2.1 で初めて登場した。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O This function is a GNU extension. この関数は GNU による拡張である。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR cos (3), -.BR sin (3), -.BR tan (3) +\fBcos\fP(3), \fBsin\fP(3), \fBtan\fP(3) diff --git a/draft/man3/sinh.3 b/draft/man3/sinh.3 index 5b1108e1..ef267f09 100644 --- a/draft/man3/sinh.3 +++ b/draft/man3/sinh.3 @@ -29,159 +29,71 @@ .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) .\" Modified 1996-06-08 by aeb .\" Modified 2002-07-27 by Walter Harms -.\" (walter.harms@informatik.uni-oldenburg.de) +.\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 1996 Kenji Kajiwara and Kentaro Ogawa -.\" all rights reserved. -.\" Translated Sat, 13 Jul 1996 17:54:30 JST -.\" by Kenji Kajiwara and Kentaro Ogawa -.\" Updated & Modified Thu Feb 17 22:50:25 JST 2005 -.\" by Yuichi SATO -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH SINH 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH SINH 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O sinh, sinhf, sinhl \- hyperbolic sine function sinh, sinhf, sinhl \- 双曲線正弦 (ハイパボリックサイン) 関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double sinh(double " x ); +\fBdouble sinh(double \fP\fIx\fP\fB);\fP .br -.BI "float sinhf(float " x ); +\fBfloat sinhf(float \fP\fIx\fP\fB);\fP .br -.BI "long double sinhl(long double " x ); +\fBlong double sinhl(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR sinhf (), -.BR sinhl (): +\fBsinhf\fP(), \fBsinhl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR sinh () -.\"O function returns the hyperbolic sine of \fIx\fP, which -.\"O is defined mathematically as: -.BR sinh () -関数は双曲線正弦 (ハイパボリックサイン) 関数の値を返す。 -数学的には以下のように定義されている。 +\fBsinh\fP() 関数は双曲線正弦 (ハイパボリックサイン) 関数の値を返す。 数学的には以下のように定義されている。 .nf sinh(x) = (exp(x) \- exp(\-x)) / 2 .fi -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O On success, these functions return the hyperbolic sine of -.\"O .IR x . -成功すると、これらの関数は -.I x -の双曲線正弦を返す。 +成功すると、これらの関数は \fIx\fP の双曲線正弦を返す。 -.\"O If -.\"O .I x -.\"O is a NaN, a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is +0 (\-0), +0 (\-0) is returned. -.I x -が +0 (\-0) の場合、+0 (\-0) が返される。 +\fIx\fP が +0 (\-0) の場合、+0 (\-0) が返される。 -.\"O If -.\"O .I x -.\"O is positive infinity (negative infinity), -.\"O positive infinity (negative infinity) is returned. -.I x -が正の無限大 (負の無限大) の場合、正の無限大 (負の無限大) が返される。 +\fIx\fP が正の無限大 (負の無限大) の場合、正の無限大 (負の無限大) が返される。 -.\"O If the result overflows, -.\"O a range error occurs, -.\"O and the functions return -.\"O .BR HUGE_VAL , -.\"O .BR HUGE_VALF , -.\"O or -.\"O .BR HUGE_VALL , -.\"O respectively, with the same sign as -.\"O .IR x . -結果がオーバーフローする場合、 -範囲エラー (range error) が発生し、 -各関数はそれぞれ -.BR HUGE_VAL , -.BR HUGE_VALF , -.BR HUGE_VALL -を返す。符号は -.I x -と同じになる。 .\" .\" POSIX.1-2001 documents an optional range error (underflow) .\" for subnormal x; .\" glibc 2.8 does not do this. -.\"O .SH ERRORS +結果がオーバーフローする場合、 範囲エラー (range error) が発生し、 各関数はそれぞれ \fBHUGE_VAL\fP, +\fBHUGE_VALF\fP, \fBHUGE_VALL\fP を返す。符号は \fIx\fP と同じになる。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Range error: result overflow +.TP 範囲エラー (range error): 結果のオーバーフロー -.\"O .I errno -.\"O is set to -.\"O .BR ERANGE . -.\"O An overflow floating-point exception -.\"O .RB ( FE_OVERFLOW ) -.\"O is raised. -.I errno -に -.B ERANGE -が設定される。 -オーバーフロー浮動小数点例外 -.RB ( FE_OVERFLOW ) -が上がる。 -.\"O .SH "CONFORMING TO" +\fIerrno\fP に \fBERANGE\fP が設定される。 オーバーフロー浮動小数点例外 (\fBFE_OVERFLOW\fP) が上がる。 .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH 関連項目 -.BR acosh (3), -.BR asinh (3), -.BR atanh (3), -.BR cosh (3), -.BR csinh (3), -.BR tanh (3) +\fBacosh\fP(3), \fBasinh\fP(3), \fBatanh\fP(3), \fBcosh\fP(3), \fBcsinh\fP(3), \fBtanh\fP(3) diff --git a/draft/man3/sleep.3 b/draft/man3/sleep.3 index 97239826..e99cb09c 100644 --- a/draft/man3/sleep.3 +++ b/draft/man3/sleep.3 @@ -21,74 +21,31 @@ .\" the source, must acknowledge the copyright and authors of this work. .\" License. .\" Modified Sat Jul 24 18:16:02 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi -.\" all rights reserved. -.\" Translated Tue Jan 21 20:46:24 JST 1997 -.\" by YOSHINO Takashi +.\" This file was generated with po4a. Translate the source file. .\" -.\" WORD: signal handler シグナルハンドラー -.\" -.TH SLEEP 3 2010-02-03 "GNU" "Linux Programmer's Manual" +.\"******************************************************************* +.TH SLEEP 3 2010\-02\-03 GNU "Linux Programmer's Manual" .SH 名前 sleep \- 指定の秒数の間だけ休止する .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "unsigned int sleep(unsigned int " "seconds" ); +\fBunsigned int sleep(unsigned int \fP\fIseconds\fP\fB);\fP .fi .SH 説明 -.\"O .BR sleep () -.\"O makes the calling thread sleep until -.\"O .I seconds -.\"O seconds have elapsed or a signal arrives which is not ignored. -.BR sleep () -は、呼び出したスレッドを -.I seconds -秒間または無視されないシグナルが到着するまで休止する。 +\fBsleep\fP() は、呼び出したスレッドを \fIseconds\fP 秒間または無視されないシグナルが到着するまで休止する。 .SH 返り値 -.\"O Zero if the requested time has elapsed, -.\"O or the number of seconds left to sleep, -.\"O if the call was interrupted by a signal handler. -要求された時間が過ぎた場合はゼロを返す。 -呼び出しがシグナルハンドラーに割り込まれた場合は、 -休止の残り時間を返す。 -.\"O .SH "CONFORMING TO" +要求された時間が過ぎた場合はゼロを返す。 呼び出しがシグナルハンドラーに割り込まれた場合は、 休止の残り時間を返す。 .SH 準拠 -POSIX.1-2001. -.\"O .SH BUGS +POSIX.1\-2001. .SH バグ -.\"O .BR sleep () -.\"O may be implemented using -.\"O .BR SIGALRM ; -.\"O mixing calls to -.\"O .BR alarm (2) -.\"O and -.\"O .BR sleep () -.\"O is a bad idea. -.BR sleep () -は -.B SIGALRM -を用いて実装されている。そのため、 -.BR alarm (2) -と -.BR sleep () +\fBsleep\fP() は \fBSIGALRM\fP を用いて実装されている。そのため、 \fBalarm\fP(2) と \fBsleep\fP() を混ぜて使用するのは、まずい考えである。 .PP -.\"O Using -.\"O .BR longjmp (3) -.\"O from a signal handler or modifying the handling of -.\"O .B SIGALRM -.\"O while sleeping will cause undefined results. -休止中にシグナルハンドラーから -.BR longjmp (3) -を使用することや -.B SIGALRM +休止中にシグナルハンドラーから \fBlongjmp\fP(3) を使用することや \fBSIGALRM\fP のハンドリングを変更することは、定義されていない結果を生む。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR alarm (2), -.BR nanosleep (2), -.BR signal (2), -.BR signal (7) +\fBalarm\fP(2), \fBnanosleep\fP(2), \fBsignal\fP(2), \fBsignal\fP(7) diff --git a/draft/man3/sockatmark.3 b/draft/man3/sockatmark.3 index 24e16672..9105b086 100644 --- a/draft/man3/sockatmark.3 +++ b/draft/man3/sockatmark.3 @@ -20,143 +20,57 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2006 Yuichi SATO -.\" all rights reserved. -.\" Translated 2006-08-01 by Yuichi SATO , LDP v2.36 +.\"******************************************************************* .\" -.TH SOCKATMARK 3 2008-12-03 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH SOCKATMARK 3 2008\-12\-03 Linux "Linux Programmer's Manual" .SH 名前 -.\"O sockatmark \- determine whether socket is at out-of-band mark -sockatmark \- どのソケットに帯域外 (out-of-band) マークが付けられているかを調べる -.\"O .SH SYNOPSIS +sockatmark \- どのソケットに帯域外 (out\-of\-band) マークが付けられているかを調べる .SH 書式 -.B #include +\fB#include \fP .sp -.BI "int sockatmark(int " sockfd ); +\fBint sockatmark(int \fP\fIsockfd\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR sockatmark (): -_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 +\fBsockatmark\fP(): _POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600 .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR sockatmark () -.\"O returns a value indicating whether or not the socket referred -.\"O to by the file descriptor -.\"O .I sockfd -.\"O is at the out-of-band mark. -.BR sockatmark () -はファイルディスクリプタ -.I sockfd -で参照されるソケットに帯域外マークが付けられているか否かを返す。 -.\"O If the socket is at the mark, then 1 is returned; -.\"O if the socket is not at the mark, 0 is returned. -.\"O This function does not remove the out-of-band mark. -ソケットにマークが付けられている場合は、1 が返される。 -ソケットにマークが付けられていない場合は、0 が返される。 +\fBsockatmark\fP() はファイルディスクリプタ \fIsockfd\fP で参照されるソケットに帯域外マークが付けられているか否かを返す。 +ソケットにマークが付けられている場合は、1 が返される。 ソケットにマークが付けられていない場合は、0 が返される。 この関数は帯域外マークを削除しない。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O A successful call to -.\"O .BR sockatmark () -.\"O returns 1 if the socket is at the out-of-band mark, or 0 if it is not. -.\"O On error, \-1 is returned and \fIerrno\fP is set to indicate the error. -.BR sockatmark () -の呼び出しが成功した場合、ソケットに帯域外マークが -付けられていれば 1 を返し、付けられていなければ 0 を返す。 +\fBsockatmark\fP() の呼び出しが成功した場合、ソケットに帯域外マークが 付けられていれば 1 を返し、付けられていなければ 0 を返す。 エラーの場合は \-1 が返され、エラーを表す \fIerrno\fP が設定される。 -.\"O .SH ERRORS .SH エラー -.TP -.B EBADF -.\"O .I sockfd -.\"O is not a valid file descriptor. -.I sockfd -が有効なファイルディスクリプタでない。 -.TP -.B EINVAL +.TP +\fBEBADF\fP +\fIsockfd\fP が有効なファイルディスクリプタでない。 +.TP +\fBEINVAL\fP .\" POSIX.1 says ENOTTY for this case -.\"O .I sockfd -.\"O is not a file descriptor to which -.\"O .BR sockatmark () -.\"O can be applied. -.I sockfd -は -.BR sockatmark () -が適用できないファイルディスクリプタである。 -.\"O .SH VERSIONS +\fIsockfd\fP は \fBsockatmark\fP() が適用できないファイルディスクリプタである。 .SH バージョン -.\"O .BR sockatmark () -.\"O was added to glibc in version 2.2.4. -.BR sockatmark () -は glibc バージョン 2.2.4 で追加された。 -.\"O .SH "CONFORMING TO" +\fBsockatmark\fP() は glibc バージョン 2.2.4 で追加された。 .SH 準拠 -POSIX.1-2001. -.\"O .SH NOTES +POSIX.1\-2001. .SH 注意 -.\"O If -.\"O .BR sockatmark () -.\"O returns 1, then the out-of-band data can be read using the -.\"O .B MSG_OOB -.\"O flag of -.\"O .BR recv (2). -.BR sockatmark () -が 1 を返す場合、帯域外データは -.B MSG_OOB -を指定した -.BR recv (2) -で読み込むことができる。 +\fBsockatmark\fP() が 1 を返す場合、帯域外データは \fBMSG_OOB\fP を指定した \fBrecv\fP(2) で読み込むことができる。 -.\"O Out-of-band data is only supported on some stream socket protocols. -帯域外データは、いくつかのストリームソケットプロトコルでしか -サポートされていない。 +帯域外データは、いくつかのストリームソケットプロトコルでしか サポートされていない。 -.\"O .BR sockatmark () -.\"O can safely be called from a handler for the -.\"O .B SIGURG -.\"O signal. -.BR sockatmark () -は -.B SIGURG -シグナルのハンドラから安全に呼び出すことができる。 +\fBsockatmark\fP() は \fBSIGURG\fP シグナルのハンドラから安全に呼び出すことができる。 -.\"O .BR sockatmark () -.\"O is implemented using the -.\"O .B SIOCATMARK -.\"O .BR ioctl (2) -.\"O operation. -.BR sockatmark () -は -.B SIOCATMARK -.BR ioctl (2) -操作を使って実装されている。 -.\"O .SH BUGS +\fBsockatmark\fP() は \fBSIOCATMARK\fP \fBioctl\fP(2) 操作を使って実装されている。 .SH バグ -.\"O Prior to glibc 2.4, -.\"O .BR sockatmark () -.\"O did not work. -glibc 2.4 より前のバージョンでは、 -.BR sockatmark () -は動作しない。 -.\"O .SH EXAMPLE +glibc 2.4 より前のバージョンでは、 \fBsockatmark\fP() は動作しない。 .SH 例 -.\"O The following code can be used after receipt of a -.\"O .B SIGURG -.\"O signal to read (and discard) all data up to the mark, -.\"O and then read the byte of data at the mark: -以下のコードは、 -.B SIGURG -シグナルを受け取った後にマークまでの全てのデータを読み込んで (破棄し)、 +以下のコードは、 \fBSIGURG\fP シグナルを受け取った後にマークまでの全てのデータを読み込んで (破棄し)、 マークされたデータのバイトを読み込むのに使用できる。 .nf @@ -188,9 +102,5 @@ glibc 2.4 より前のバージョンでは、 } } .fi -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR fcntl (2), -.BR recv (2), -.BR send (2), -.BR tcp (7) +\fBfcntl\fP(2), \fBrecv\fP(2), \fBsend\fP(2), \fBtcp\fP(7) diff --git a/draft/man3/sqrt.3 b/draft/man3/sqrt.3 index 46d88a70..eda602a0 100644 --- a/draft/man3/sqrt.3 +++ b/draft/man3/sqrt.3 @@ -29,130 +29,60 @@ .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) .\" Modified 2002-07-27 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1996 Kenji Kajiwara -.\" all rights reserved. -.\" Translated Mon Jul 15 18:40:00 JST 1996 -.\" by Kenji Kajiwara -.\" Proof Reading: Takashi Yoshino -.\" Updated Sun Sep 14 JST 2003 by Kentaro Shirakata -.\" Updated 2008-09-16, Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.TH SQRT 3 2010-09-20 "" "Linux Programmer's Manual" +.\"******************************************************************* +.TH SQRT 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 sqrt, sqrtf, sqrtl \- 平方根関数 .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double sqrt(double " x ); +\fBdouble sqrt(double \fP\fIx\fP\fB);\fP .br -.BI "float sqrtf(float " x ); +\fBfloat sqrtf(float \fP\fIx\fP\fB);\fP .br -.BI "long double sqrtl(long double " x ); +\fBlong double sqrtl(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR sqrtf (), -.BR sqrtl (): +\fBsqrtf\fP(), \fBsqrtl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR sqrt () -.\"O function returns the nonnegative square root of \fIx\fP. -.BR sqrt () -関数は \fIx\fP の平方根のうち負でない方の値を返す。 -.\"O .SH "RETURN VALUE" +\fBsqrt\fP() 関数は \fIx\fP の平方根のうち負でない方の値を返す。 .SH 返り値 -.\"O On success, these functions return the square root of -.\"O .IR x . -成功すると、これらの関数は -.I x -の平方根を返す。 +成功すると、これらの関数は \fIx\fP の平方根を返す。 -.\"O If -.\"O .I x -.\"O is a NaN, a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is +0 (\-0), +0 (\-0) is returned. -.I x -が +0 (\-0) の場合、+0 (\-0) が返される。 - -.\"O If -.\"O .I x -.\"O is positive infinity, positive infinity is returned. -.I x -が正の無限大の場合、正の無限大が返される。 +\fIx\fP が +0 (\-0) の場合、+0 (\-0) が返される。 -.\"O If -.\"O .I x -.\"O is less than \-0, -.\"O a domain error occurs, -.\"O and a NaN is returned. -.I x -が 0 未満の場合、領域エラー (domain error) が発生し、 -NaN が返される。 -.\"O .SH ERRORS +\fIx\fP が正の無限大の場合、正の無限大が返される。 + +\fIx\fP が 0 未満の場合、領域エラー (domain error) が発生し、 NaN が返される。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Domain error: \fIx\fP less than \-0 +.TP 領域エラー (domain error): \fIx\fP が 0 未満 -.\"O .I errno -.\"O is set to -.\"O .BR EDOM . -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -.I errno -に -.B EDOM -が設定される。 -不正 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) -が上がる。 -.\"O .SH "CONFORMING TO" +\fIerrno\fP に \fBEDOM\fP が設定される。 不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH 関連項目 -.BR cbrt (3), -.BR csqrt (3), -.BR hypot (3) +\fBcbrt\fP(3), \fBcsqrt\fP(3), \fBhypot\fP(3) diff --git a/draft/man3/stpcpy.3 b/draft/man3/stpcpy.3 index 0634e72d..c8b67a5f 100644 --- a/draft/man3/stpcpy.3 +++ b/draft/man3/stpcpy.3 @@ -2,11 +2,6 @@ .\" .\" Copyright 1995 James R. Van Zandt .\" -.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka -.\" all rights reserved. -.\" Translated Fri Dec 26 13:14:47 JST 1997 -.\" by HIROFUMI Nishizuka -.\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. @@ -27,86 +22,53 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.TH STPCPY 3 2011-09-28 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH STPCPY 3 2012\-03\-15 GNU "Linux Programmer's Manual" .SH 名前 -.\"O stpcpy \- copy a string returning a pointer to its end stpcpy \- 文字列をコピーし、コピーした文字列の終りへのポインタを返す -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "char *stpcpy(char *" dest ", const char *" src ); +\fBchar *stpcpy(char *\fP\fIdest\fP\fB, const char *\fP\fIsrc\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR stpcpy (): +\fBstpcpy\fP(): .PD 0 .ad l .RS 4 -.TP 4 -.\"O Since glibc 2.10: +.TP 4 glibc 2.10 以降: _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L -.TP -.\"O Before glibc 2.10: +.TP glibc 2.10 より前: _GNU_SOURCE .RE .ad .PD -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR stpcpy () -.\"O function copies the string pointed to by \fIsrc\fP -.\"O (including the terminating null byte (\(aq\\0\(aq)) to the array pointed to by -.\"O \fIdest\fP. -.\"O The strings may not overlap, and the destination string -.\"O \fIdest\fP must be large enough to receive the copy. -.BR stpcpy () -関数は、\fIsrc\fP で指された文字列を (文字列を終端する NULL バイト -(\(aq\\0\(aq) を含めて) \fIdest\fP で指された配列にコピーする。 -文字列は重複してはならず、コピー先の文字列 \fIdest\fP はコピーを受け取る +\fBstpcpy\fP() 関数は、\fIsrc\fP で指された文字列を (文字列を終端する NULL バイト (\(aq\e0\(aq) を含めて) +\fIdest\fP で指された配列にコピーする。 文字列は重複してはならず、コピー先の文字列 \fIdest\fP はコピーを受け取る のに十分大きくなくてはならない。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O .BR stpcpy () -.\"O returns a pointer to the \fBend\fP of the string -.\"O \fIdest\fP (that is, the address of the terminating null byte) -.\"O rather than the beginning. -.BR stpcpy () -は、文字列 \fIdest\fP の始まりではなく -\fB終り\fPを指すポインタ (すなわち、文字列を終端する NULL バイト) を返す。 -.\"O .SH "CONFORMING TO" +\fBstpcpy\fP() は、文字列 \fIdest\fP の始まりではなく \fB終り\fPを指すポインタ (すなわち、文字列を終端する NULL バイト) +を返す。 .SH 準拠 -.\"O This function was added to POSIX.1-2008. Before that, it was not part of -.\"O the C or POSIX.1 standards, nor customary on UNIX systems, but was not a -.\"O GNU invention either. Perhaps it came from MS-DOS. It is also present on -.\"O the BSDs. -この関数は POSIX.1-2008 に追加された。 -それ以前は、この関数は C や POSIX.1 標準の一部でも -UNIX システムの慣習的なものでもなかったが、 -GNU の発明というわけでもなかった。 -ひょっとしたら MS-DOS 由来のものかもしれない。 -この関数は BSD 系にも存在する。 -.\"O .SH EXAMPLE +この関数は POSIX.1\-2008 に追加された。 それ以前は、この関数は C や POSIX.1 標準の一部でも UNIX +システムの慣習的なものでもなかったが、 GNU の発明というわけでもなかった。 ひょっとしたら MS\-DOS 由来のものかもしれない。 この関数は +BSD 系にも存在する。 +.SH バグ +この関数はバッファ \fIdest\fP の範囲を行き過ぎてしまう可能性がある。 .SH 例 -.\"O For example, this program uses -.\"O .BR stpcpy () -.\"O to concatenate \fBfoo\fP and -.\"O \fBbar\fP to produce \fBfoobar\fP, which it then prints. -例として、このプログラムは \fBfoo\fP と \fBbar\fP を連結して \fBfoobar\fP -を作るために -.BR stpcpy () +例として、このプログラムは \fBfoo\fP と \fBbar\fP を連結して \fBfoobar\fP を作るために \fBstpcpy\fP() を使用し、その後表示する。 .in +4n .nf @@ -123,24 +85,10 @@ main(void) to = stpcpy(to, "foo"); to = stpcpy(to, "bar"); - printf("%s\\n", buffer); + printf("%s\en", buffer); } .fi .in -.\"O .SH BUGS -.SH バグ -.\"O This function may overrun the buffer -.\"O .IR dest . -この関数はバッファ -.I dest -の範囲を行き過ぎてしまう可能性がある。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR bcopy (3), -.BR memccpy (3), -.BR memcpy (3), -.BR memmove (3), -.BR stpncpy (3), -.BR strcpy (3), -.BR string (3), -.BR wcpcpy (3) +\fBbcopy\fP(3), \fBmemccpy\fP(3), \fBmemcpy\fP(3), \fBmemmove\fP(3), \fBstpncpy\fP(3), +\fBstrcpy\fP(3), \fBstring\fP(3), \fBwcpcpy\fP(3) diff --git a/draft/man3/stpncpy.3 b/draft/man3/stpncpy.3 index 9f8c8c3f..c5ba47bd 100644 --- a/draft/man3/stpncpy.3 +++ b/draft/man3/stpncpy.3 @@ -9,93 +9,51 @@ .\" GNU glibc-2 source code and manual .\" .\" Corrected, aeb, 990824 +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Tue Jan 11 00:55:50 JST 2000 -.\" by HANATAKA Shinya +.\" This file was generated with po4a. Translate the source file. .\" -.TH STPNCPY 3 2011-09-28 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH STPNCPY 3 2011\-09\-28 GNU "Linux Programmer's Manual" .SH 名前 -.\"O stpncpy \- copy a fixed-size string, returning a pointer to its end stpncpy \- 固定長の文字列をコピーして、その最後へのポインターを返す -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "char *stpncpy(char *" dest ", const char *" src ", size_t " n ); +\fBchar *stpncpy(char *\fP\fIdest\fP\fB, const char *\fP\fIsrc\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR stpncpy (): +\fBstpncpy\fP(): .PD 0 .ad l .RS 4 -.TP 4 -.\"O Since glibc 2.10: +.TP 4 glibc 2.10 以降: _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L -.TP -.\"O Before glibc 2.10: +.TP glibc 2.10 より前: _GNU_SOURCE .RE .ad .PD -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR stpncpy () -.\"O function copies at most \fIn\fP characters from the string -.\"O pointed to by \fIsrc\fP, including the terminating null byte (\(aq\\0\(aq), -.\"O to the array pointed to by \fIdest\fP. -.\"O Exactly \fIn\fP characters are written at -.\"O \fIdest\fP. -.\"O If the length \fIstrlen(src)\fP is smaller than \fIn\fP, the -.\"O remaining characters in the array pointed to by \fIdest\fP are filled -.\"O with null bytes (\(aq\\0\(aq), -.\"O If the length \fIstrlen(src)\fP is greater or equal to -.\"O \fIn\fP, the string pointed to by \fIdest\fP will -.\"O not be null-terminated. -.BR stpncpy () -関数は \fIsrc\fP が指している文字列から終端の NULL バイト (\(aq\\0\(aq) -を含めて最大 \fIn\fP バイトを \fIdest\fP にコピーする。長さ -\fIstrlen(src)\fP が \fIn\fP より小さい場合には \fIdest\fP の残りの -部分には NULL バイト (\(aq\\0\(aq) 文字が埋められる。 -長さ \fIstrlen(src)\fP が \fIn\fP 以上ならば、 -\fIdest\fP が指す文字列は NULL で終端されていない。 +\fBstpncpy\fP() 関数は \fIsrc\fP が指している文字列から終端の NULL バイト (\(aq\e0\(aq) を含めて最大 \fIn\fP +バイトを \fIdest\fP にコピーする。長さ \fIstrlen(src)\fP が \fIn\fP より小さい場合には \fIdest\fP の残りの 部分には +NULL バイト (\(aq\e0\(aq) 文字が埋められる。 長さ \fIstrlen(src)\fP が \fIn\fP 以上ならば、 \fIdest\fP +が指す文字列は NULL で終端されていない。 .PP -.\"O The strings may not overlap. 二つの文字列は重なってはならない。 .PP -.\"O The programmer must ensure that there is room for at least \fIn\fP characters -.\"O at \fIdest\fP. -プログラマーは \fIdest\fP に少なくとも \fIn\fP バイトの空きがあることを -保証しなければならない。 -.\"O .SH "RETURN VALUE" +プログラマーは \fIdest\fP に少なくとも \fIn\fP バイトの空きがあることを 保証しなければならない。 .SH 返り値 -.\"O .BR stpncpy () -.\"O returns a pointer to the terminating null byte -.\"O in \fIdest\fP, or, if \fIdest\fP is not null-terminated, -.\"O \fIdest + n\fP. -.BR stpncpy () -は \fIdest\fP の終端の NULL バイトを指すポインターを返すか、 -\fIdest\fP が NULL バイトで終端されていない場合には \fIdest + n\fP を返す。 -.\"O .SH "CONFORMING TO" +\fBstpncpy\fP() は \fIdest\fP の終端の NULL バイトを指すポインターを返すか、 \fIdest\fP が NULL +バイトで終端されていない場合には \fIdest + n\fP を返す。 .SH 準拠 -.\"O This function was added to POSIX.1-2008. Before that, it was a GNU extension. -この関数は POSIX.1-2008 に追加された。 -それ以前は GNU による拡張であった。 -.\"O .SH "SEE ALSO" +この関数は POSIX.1\-2008 に追加された。 それ以前は GNU による拡張であった。 .SH 関連項目 -.BR strncpy (3), -.BR wcpncpy (3) +\fBstrncpy\fP(3), \fBwcpncpy\fP(3) diff --git a/draft/man3/strcasecmp.3 b/draft/man3/strcasecmp.3 index 8f0c9e72..8bb54bdf 100644 --- a/draft/man3/strcasecmp.3 +++ b/draft/man3/strcasecmp.3 @@ -25,74 +25,32 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 18:12:45 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka -.\" all rights reserved. -.\" Translated Thu Dec 25 10:54:13 JST 1997 -.\" by HIROFUMI Nishizuka +.\" This file was generated with po4a. Translate the source file. .\" -.TH STRCASECMP 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH STRCASECMP 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O strcasecmp, strncasecmp \- compare two strings ignoring case strcasecmp, strncasecmp \- 二つの文字列を大文字小文字を区別せず比較する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int strcasecmp(const char *" s1 ", const char *" s2 ); +\fBint strcasecmp(const char *\fP\fIs1\fP\fB, const char *\fP\fIs2\fP\fB);\fP .sp -.BI "int strncasecmp(const char *" s1 ", const char *" s2 ", size_t " n ); +\fBint strncasecmp(const char *\fP\fIs1\fP\fB, const char *\fP\fIs2\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR strcasecmp () -.\"O function compares the two strings \fIs1\fP and -.\"O \fIs2\fP, ignoring the case of the characters. -.\"O It returns an integer -.\"O less than, equal to, or greater than zero if \fIs1\fP is found, -.\"O respectively, to be less than, to match, or be greater than \fIs2\fP. -.BR strcasecmp () -関数は、二つの文字列 \fIs1\fP と \fIs2\fP を、 -大文字小文字を区別せずに比較する。 -\fIs1\fP が \fIs2\fP よりも小さいか、同じか、大きいかによってそれぞれ -負の整数、0、正の整数を返す。 +\fBstrcasecmp\fP() 関数は、二つの文字列 \fIs1\fP と \fIs2\fP を、 大文字小文字を区別せずに比較する。 \fIs1\fP が \fIs2\fP +よりも小さいか、同じか、大きいかによってそれぞれ 負の整数、0、正の整数を返す。 .PP -.\"O The -.\"O .BR strncasecmp () -.\"O function is similar, except it only compares -.\"O the first \fIn\fP characters of \fIs1\fP. -.BR strncasecmp () -関数も同様であるが、 -\fIs1\fP の最初の \fIn\fP 文字だけを比較する点だけが異なる。 -.\"O .SH "RETURN VALUE" +\fBstrncasecmp\fP() 関数も同様であるが、 \fIs1\fP の最初の \fIn\fP 文字だけを比較する点だけが異なる。 .SH 返り値 -.\"O The -.\"O .BR strcasecmp () -.\"O and -.\"O .BR strncasecmp () -.\"O functions return -.\"O an integer less than, equal to, or greater than zero if \fIs1\fP -.\"O (or the first \fIn\fP bytes thereof) is found, respectively, to be -.\"O less than, to match, or be greater than \fIs2\fP. -.BR strcasecmp () -と -.BR strncasecmp () -関数は、\fIs1\fP -(または、その最初の \fIn\fP バイト)が \fIs2\fP よりも小さいか、 -同じか、大きいかにより、それぞれ負の整数、0、正の整数を返す。 -.\"O .SH "CONFORMING TO" +\fBstrcasecmp\fP() と \fBstrncasecmp\fP() 関数は、\fIs1\fP (または、その最初の \fIn\fP バイト)が \fIs2\fP +よりも小さいか、 同じか、大きいかにより、それぞれ負の整数、0、正の整数を返す。 .SH 準拠 -4.4BSD, POSIX.1-2001. -.\"O .SH "SEE ALSO" +4.4BSD, POSIX.1\-2001. .SH 関連項目 -.BR bcmp (3), -.BR memcmp (3), -.BR strcmp (3), -.BR strcoll (3), -.BR string (3), -.BR strncmp (3), -.BR wcscasecmp (3), -.BR wcsncasecmp (3) +\fBbcmp\fP(3), \fBmemcmp\fP(3), \fBstrcmp\fP(3), \fBstrcoll\fP(3), \fBstring\fP(3), +\fBstrncmp\fP(3), \fBwcscasecmp\fP(3), \fBwcsncasecmp\fP(3) diff --git a/draft/man3/strcat.3 b/draft/man3/strcat.3 index 91d1e636..15fff2f1 100644 --- a/draft/man3/strcat.3 +++ b/draft/man3/strcat.3 @@ -27,88 +27,40 @@ .\" Modified Sat Jul 24 18:11:47 1993 by Rik Faith (faith@cs.unc.edu) .\" 2007-06-15, Marc Boyer + mtk .\" Improve discussion of strncat(). +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi -.\" all rights reserved. -.\" Translated Mon Jan 20 22:47:14 JST 1997 -.\" by YOSHINO Takashi -.\" Updated & Modified Fri Feb 18 00:30:00 JST 2005 -.\" by Yuichi SATO -.\" Updated 2007-07-04, Akihiro MOTOKI , LDP v2.58 +.\" This file was generated with po4a. Translate the source file. .\" -.TH STRCAT 3 2011-09-28 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH STRCAT 3 2011\-09\-28 GNU "Linux Programmer's Manual" .SH 名前 -.\"O strcat, strncat \- concatenate two strings strcat, strncat \- 二つの文字列を連結する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "char *strcat(char *" dest ", const char *" src ); +\fBchar *strcat(char *\fP\fIdest\fP\fB, const char *\fP\fIsrc\fP\fB);\fP .sp -.BI "char *strncat(char *" dest ", const char *" src ", size_t " n ); +\fBchar *strncat(char *\fP\fIdest\fP\fB, const char *\fP\fIsrc\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR strcat () -.\"O function appends the \fIsrc\fP string to the -.\"O- \fIdest\fP string, overwriting the null byte (\(aq\\0\(aq) at the end of -.\"O+ \fIdest\fP string, -.\"O+ overwriting the terminating null byte (\(aq\\0\(aq) at the end of -.\"O \fIdest\fP, and then adds a terminating null byte. -.\"O The strings may not overlap, and the \fIdest\fP string must have -.\"O enough space for the result. -.BR strcat () -関数は、\fIdest\fP 文字列の後に \fIsrc\fP 文字列を付け加える。 -その際に、\fIdest\fP の最後にある終端の NULL バイト (\(aq\\0\(aq) -は上書きされ、新たに生成された文字列の末尾に終端の NULL バイトが付与される。 -二つの文字列 \fIsrc\fP と \fIdest\fP は重なってはならない。 -また、文字列 \fIdest\fP は、連結後の結果を格納するのに -十分な大きさでなければならない。 +\fBstrcat\fP() 関数は、\fIdest\fP 文字列の後に \fIsrc\fP 文字列を付け加える。 その際に、\fIdest\fP の最後にある終端の +NULL バイト (\(aq\e0\(aq) は上書きされ、新たに生成された文字列の末尾に終端の NULL バイトが付与される。 二つの文字列 +\fIsrc\fP と \fIdest\fP は重なってはならない。 また、文字列 \fIdest\fP は、連結後の結果を格納するのに 十分な大きさでなければならない。 .PP -.\"O The -.\"O .BR strncat () -.\"O function is similar, except that -.\"O .IP * 3 -.\"O it will use at most \fIn\fP characters from \fIsrc\fP; and -.\"O .IP * -.\"O \fIsrc\fP does not need to be null-terminated if it contains -.\"O \fIn\fP or more characters. -.BR strncat () -も同様だが、以下の点が異なる。 +\fBstrncat\fP() も同様だが、以下の点が異なる。 .IP * 3 \fIsrc\fP のうち最大 \fIn\fP 文字が使用される。 .IP * -\fIsrc\fP が \fIn\fP 文字以上の場合、 -\fIsrc\fP は NULL 終端されている必要はない。 +\fIsrc\fP が \fIn\fP 文字以上の場合、 \fIsrc\fP は NULL 終端されている必要はない。 .PP -.\"O As with -.\"O .BR strcat (), -.\"O the resulting string in \fIdest\fP is always null-terminated. -.BR strcat () -と同じく、\fIdest\fP に格納される結果の文字列は常に NULL 終端される。 +\fBstrcat\fP() と同じく、\fIdest\fP に格納される結果の文字列は常に NULL 終端される。 .PP -.\"O If \fIsrc\fP contains \fIn\fP or more characters, -.\"O .BR strncat () -.\"O writes \fIn+1\fP characters to \fIdest\fP (\fIn\fP -.\"O from \fIsrc\fP plus the terminating null byte). -.\"O Therefore, the size of \fIdest\fP must be at least -.\"O \fIstrlen(dest)+n+1\fP. -\fIsrc\fP が \fIn\fP 文字以上の場合、 -.BR strncat () -は \fIdest\fP に \fIn+1\fP 文字を書き込む -(\fIsrc\fP からの \fIn\fP 文字と終端の NULL バイトである)。 -したがって、\fIdest\fP の大きさは最低でも -\fIstrlen(dest)+n+1\fP でなければならない。 +\fIsrc\fP が \fIn\fP 文字以上の場合、 \fBstrncat\fP() は \fIdest\fP に \fIn+1\fP 文字を書き込む (\fIsrc\fP からの +\fIn\fP 文字と終端の NULL バイトである)。 したがって、\fIdest\fP の大きさは最低でも \fIstrlen(dest)+n+1\fP +でなければならない。 -.\"O A simple implementation of -.\"O .BR strncat () -.\"O might be: -.BR strncat () -の簡単な実装は以下のような感じであろう: +\fBstrncat\fP() の簡単な実装は以下のような感じであろう: .in +4n .nf @@ -118,36 +70,18 @@ strncat(char *dest, const char *src, size_t n) size_t dest_len = strlen(dest); size_t i; - for (i = 0 ; i < n && src[i] != \(aq\\0\(aq ; i++) + for (i = 0 ; i < n && src[i] != \(aq\e0\(aq ; i++) dest[dest_len + i] = src[i]; - dest[dest_len + i] = \(aq\\0\(aq; + dest[dest_len + i] = \(aq\e0\(aq; return dest; } .fi .in -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O The -.\"O .BR strcat () -.\"O and -.\"O .BR strncat () -.\"O functions return a pointer to the resulting string \fIdest\fP. -.BR strcat () -関数と -.BR strncat () -関数は、結果としてできる文字列 -\fIdest\fP へのポインタを返す。 -.\"O .SH "CONFORMING TO" +\fBstrcat\fP() 関数と \fBstrncat\fP() 関数は、結果としてできる文字列 \fIdest\fP へのポインタを返す。 .SH 準拠 SVr4, 4.3BSD, C89, C99. -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR bcopy (3), -.BR memccpy (3), -.BR memcpy (3), -.BR strcpy (3), -.BR string (3), -.BR strncpy (3), -.BR wcscat (3), -.BR wcsncat (3) +\fBbcopy\fP(3), \fBmemccpy\fP(3), \fBmemcpy\fP(3), \fBstrcpy\fP(3), \fBstring\fP(3), +\fBstrncpy\fP(3), \fBwcscat\fP(3), \fBwcsncat\fP(3) diff --git a/draft/man3/strchr.3 b/draft/man3/strchr.3 index 124acb43..e5357ff5 100644 --- a/draft/man3/strchr.3 +++ b/draft/man3/strchr.3 @@ -28,124 +28,47 @@ .\" 2006-05-19, Justin Pryzby .\" Document strchrnul(3). .\" +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka -.\" all rights reserved. -.\" Translated Tue Dec 16 10:29:05 JST 1997 -.\" by HIROFUMI Nishizuka -.\" Updated & Modified 2001-10-16, Yuichi SATO -.\" Updated 2006-07-20, Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.TH STRCHR 3 2010-09-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH STRCHR 3 2010\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 -.\"O strchr, strrchr, strchrnul \- locate character in string strchr, strrchr, strchrnul \- 文字列中の文字の位置を特定する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "char *strchr(const char *" s ", int " c ); +\fBchar *strchr(const char *\fP\fIs\fP\fB, int \fP\fIc\fP\fB);\fP .sp -.BI "char *strrchr(const char *" s ", int " c ); +\fBchar *strrchr(const char *\fP\fIs\fP\fB, int \fP\fIc\fP\fB);\fP .sp -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" -.B #include +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP .sp -.BI "char *strchrnul(const char *" s ", int " c ); +\fBchar *strchrnul(const char *\fP\fIs\fP\fB, int \fP\fIc\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR strchr () -.\"O function returns a pointer to the first occurrence -.\"O of the character \fIc\fP in the string \fIs\fP. -.BR strchr () -関数は、文字列 \fIs\fP 中に最初に文字 \fIc\fP -が現れた位置へのポインタを返す。 +\fBstrchr\fP() 関数は、文字列 \fIs\fP 中に最初に文字 \fIc\fP が現れた位置へのポインタを返す。 .PP -.\"O The -.\"O .BR strrchr () -.\"O function returns a pointer to the last occurrence -.\"O of the character \fIc\fP in the string \fIs\fP. -.BR strrchr () -関数は、文字列 \fIs\fP 中に最後に文字 \fIc\fP -が現れた位置へのポインタを返す。 +\fBstrrchr\fP() 関数は、文字列 \fIs\fP 中に最後に文字 \fIc\fP が現れた位置へのポインタを返す。 .PP -.\"O The \fBstrchrnul\fP() function is like -.\"O .BR strchr () -.\"O except that if \fIc\fP is not found in \fIs\fP, -.\"O then it returns a pointer to the null byte -.\"O at the end of \fIs\fP, rather than NULL. -.BR strchrnul () -関数は -.BR strchr () -と同様だが、 -\fIc\fP が \fIs\fP 中に見つからなかった場合に、返り値として +\fBstrchrnul\fP() 関数は \fBstrchr\fP() と同様だが、 \fIc\fP が \fIs\fP 中に見つからなかった場合に、返り値として NULL でなく、\fIs\fP の末尾のヌルバイトへのポインタを返す点が異なる。 .PP -.\"O Here "character" means "byte"; these functions do not work with -.\"O wide or multibyte characters. -ここでいう「文字」は「バイト」の意味なので、 -これらの関数はワイド文字やマルチバイト文字では動作しない。 -.\"O .SH "RETURN VALUE" +ここでいう「文字」は「バイト」の意味なので、 これらの関数はワイド文字やマルチバイト文字では動作しない。 .SH 返り値 -.\"O The -.\"O .BR strchr () -.\"O and -.\"O .BR strrchr () -.\"O functions return a pointer to -.\"O the matched character or NULL if the character is not found. -.BR strchr () -と -.BR strrchr () -関数は一致した文字へのポインタを -返し、もし文字が見つからない場合は NULL を返す。 +\fBstrchr\fP() と \fBstrrchr\fP() 関数は一致した文字へのポインタを 返し、もし文字が見つからない場合は NULL を返す。 -.\"O The -.\"O .BR strchrnul () -.\"O function returns a pointer to -.\"O the matched character, -.\"O or a pointer to the null -.\"O byte at the end of \fIs\fP (i.e., \fIs+strlen(s)\fP) -.\"O if the character is not found. -.BR strchrnul () -関数は一致した文字へのポインタを返す。 -文字が見つからない場合は、\fIs\fP の末尾のヌルバイトへの -ポインタ (つまり \fIs+strlen(s)\fP) を返す。 -.\"O .SH VERSIONS +\fBstrchrnul\fP() 関数は一致した文字へのポインタを返す。 文字が見つからない場合は、\fIs\fP の末尾のヌルバイトへの ポインタ (つまり +\fIs+strlen(s)\fP) を返す。 .SH バージョン -.\"O .BR strchrnul () -.\"O first appeared in glibc in version 2.1.1. -.BR strchrnul () -は glibc バージョン 2.1.1 で初めて登場した。 -.\"O .SH "CONFORMING TO" +\fBstrchrnul\fP() は glibc バージョン 2.1.1 で初めて登場した。 .SH 準拠 -.\"O .BR strchr () -.\"O and -.\"O .BR strrchr () -.\"O are in SVr4, 4.3BSD, C89, C99. -.\"O .BR strchrnul () -.\"O is a GNU extension. -.BR strchr () -と -.BR strrchr () -は SVr4, 4.3BSD, C89, C99 に準拠している。 -.BR strchrnul () -は GNU 拡張である。 -.\"O .SH "SEE ALSO" +\fBstrchr\fP() と \fBstrrchr\fP() は SVr4, 4.3BSD, C89, C99 に準拠している。 +\fBstrchrnul\fP() は GNU 拡張である。 .SH 関連項目 -.BR index (3), -.BR memchr (3), -.BR rindex (3), -.BR string (3), -.BR strlen (3), -.BR strpbrk (3), -.BR strsep (3), -.BR strspn (3), -.BR strstr (3), -.BR strtok (3), -.BR wcschr (3), -.BR wcsrchr (3) +\fBindex\fP(3), \fBmemchr\fP(3), \fBrindex\fP(3), \fBstring\fP(3), \fBstrlen\fP(3), +\fBstrpbrk\fP(3), \fBstrsep\fP(3), \fBstrspn\fP(3), \fBstrstr\fP(3), \fBstrtok\fP(3), +\fBwcschr\fP(3), \fBwcsrchr\fP(3) diff --git a/draft/man3/strcmp.3 b/draft/man3/strcmp.3 index e384c249..175cf198 100644 --- a/draft/man3/strcmp.3 +++ b/draft/man3/strcmp.3 @@ -27,76 +27,33 @@ .\" Modified Sat Jul 24 18:08:52 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified 2001-08-31, aeb .\" -.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi -.\" all rights reserved. -.\" Translated Mon Jan 20 22:42:02 JST 1997 -.\" by YOSHINO Takashi -.\" Updated Fri Oct 12 JST 2001 by Akihiro MOTOKI +.\"******************************************************************* .\" -.TH STRCMP 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O strcmp, strncmp \- compare two strings +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH STRCMP 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 strcmp, strncmp \- 二つの文字列を比べる -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int strcmp(const char *" s1 ", const char *" s2 ); +\fBint strcmp(const char *\fP\fIs1\fP\fB, const char *\fP\fIs2\fP\fB);\fP .sp -.BI "int strncmp(const char *" s1 ", const char *" s2 ", size_t " n ); +\fBint strncmp(const char *\fP\fIs1\fP\fB, const char *\fP\fIs2\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR strcmp () -.\"O function compares the two strings \fIs1\fP and -.\"O \fIs2\fP. -.\"O It returns an integer less than, equal to, or greater -.\"O than zero if \fIs1\fP is found, respectively, to be less than, -.\"O to match, or be greater than \fIs2\fP. -.BR strcmp () -関数は二つの文字列 \fIs1\fP と \fIs2\fP を較べる。 -この関数は、 -\fIs1\fP が \fIs2\fP に較べて 1)小さい、2)等しい、3)大きい場合に、 -ゼロよりも 1)小さい、2)等しい、3)大きい整数を返す。 +\fBstrcmp\fP() 関数は二つの文字列 \fIs1\fP と \fIs2\fP を較べる。 この関数は、 \fIs1\fP が \fIs2\fP に較べて +1)小さい、2)等しい、3)大きい場合に、 ゼロよりも 1)小さい、2)等しい、3)大きい整数を返す。 .PP -.\"O The -.\"O .BR strncmp () -.\"O function is similar, except it only compares -.\"O the first (at most) \fIn\fP characters of \fIs1\fP and \fIs2\fP. -.BR strncmp () -関数は、\fIs1\fP と \fIs2\fP の最初の -\fIn\fP 文字だけを比較することを除けば、strcmp()と同様である。 -.\"O .SH "RETURN VALUE" -.\"O The -.\"O .BR strcmp () -.\"O and -.\"O .BR strncmp () -.\"O functions return an integer -.\"O less than, equal to, or greater than zero if \fIs1\fP (or the first -.\"O \fIn\fP bytes thereof) is found, respectively, to be less than, to -.\"O match, or be greater than \fIs2\fP. +\fBstrncmp\fP() 関数は、\fIs1\fP と \fIs2\fP の最初の \fIn\fP 文字だけを比較することを除けば、strcmp()と同様である。 .SH 返り値 -.BR strcmp () -関数と -.BR strncmp () -関数は整数を返す。 -この整数は、ゼロよりも、1)小さい、2)等しい、3)大きいのいずれかである。 -それぞれは、\fIs1\fP(または、この文字列の最初の \fIn\fP バイト)が +\fBstrcmp\fP() 関数と \fBstrncmp\fP() 関数は整数を返す。 +この整数は、ゼロよりも、1)小さい、2)等しい、3)大きいのいずれかである。 それぞれは、\fIs1\fP(または、この文字列の最初の \fIn\fP バイト)が \fIs2\fP よりも、1)小さい、2)等しい、3)大きいに対応している。 -.\"O .SH "CONFORMING TO" .SH 準拠 SVr4, 4.3BSD, C89, C99. -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR bcmp (3), -.BR memcmp (3), -.BR strcasecmp (3), -.BR strcoll (3), -.BR string (3), -.BR strncasecmp (3), -.BR strverscmp (3), -.BR wcscmp (3), -.BR wcsncmp (3) +\fBbcmp\fP(3), \fBmemcmp\fP(3), \fBstrcasecmp\fP(3), \fBstrcoll\fP(3), \fBstring\fP(3), +\fBstrncasecmp\fP(3), \fBstrverscmp\fP(3), \fBwcscmp\fP(3), \fBwcsncmp\fP(3) diff --git a/draft/man3/strcoll.3 b/draft/man3/strcoll.3 index f4dbcb78..3f72a8a9 100644 --- a/draft/man3/strcoll.3 +++ b/draft/man3/strcoll.3 @@ -25,76 +25,31 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sun Jul 25 10:40:44 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka -.\" all rights reserved. -.\" Translated 1997-12-26, HIROFUMI Nishizuka -.\" Modified 2007-05-28, Akihiro MOTOKI , LDP v2.48 +.\" This file was generated with po4a. Translate the source file. .\" -.TH STRCOLL 3 2010-09-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH STRCOLL 3 2010\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 -.\"O strcoll \- compare two strings using the current locale strcoll \- 現在のロケールを使用して二つの文字列を比較する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int strcoll(const char *" s1 ", const char *" s2 ); +\fBint strcoll(const char *\fP\fIs1\fP\fB, const char *\fP\fIs2\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR strcoll () -.\"O function compares the two strings \fIs1\fP and -.\"O \fIs2\fP. -\fbstrcoll\fP() 関数は二つの文字列 \fIs1\fP と \fIs2\fP を比較する。 -.\"O It returns an integer less than, equal to, or greater -.\"O than zero if \fIs1\fP is found, respectively, to be less than, -.\"O to match, or be greater than \fIs2\fP. -この関数は、\fIs1\fP が \fIs2\fP よりも小さいか、等しいか、大きいかによって -それぞれ負の整数、0、正の整数を返す。 -.\"O The comparison is based on -.\"O strings interpreted as appropriate for the program's current locale -.\"O for category \fBLC_COLLATE\fP. (See -.\"O .BR setlocale (3).) -比較は、プログラムの現在のロケールの \fBLC_COLLATE\fP カテゴリに応じて -解釈された文字列に基づいて行われる -.RB ( setlocale (3) -参照)。 -.\"O .SH "RETURN VALUE" +\fBstrcoll\fP() 関数は二つの文字列 \fIs1\fP と \fIs2\fP を比較する。 この関数は、\fIs1\fP が \fIs2\fP +よりも小さいか、等しいか、大きいかによって それぞれ負の整数、0、正の整数を返す。 比較は、プログラムの現在のロケールの \fBLC_COLLATE\fP +カテゴリに応じて 解釈された文字列に基づいて行われる (\fBsetlocale\fP(3) 参照)。 .SH 返り値 -.\"O The -.\"O .BR strcoll () -.\"O function returns an integer less than, equal to, -.\"O or greater than zero if \fIs1\fP is found, respectively, to be less -.\"O than, to match, or be greater than \fIs2\fP, when both are interpreted -.\"O as appropriate for the current locale. -.BR strcoll () -関数は、\fIs1\fP が \fIs2\fP よりも小さいか、等しいか、 -大きいかによって、それぞれ負の整数、0、正の整数を返す。 +\fBstrcoll\fP() 関数は、\fIs1\fP が \fIs2\fP よりも小さいか、等しいか、 大きいかによって、それぞれ負の整数、0、正の整数を返す。 どちらの文字列も現在のロケールに応じて解釈されたものが使用される。 -.\"O .SH "CONFORMING TO" .SH 準拠 SVr4, 4.3BSD, C89, C99. -.\"O .SH NOTES .SH 注意 -.\"O In the \fI"POSIX"\fP or \fI"C"\fP locales -.\"O .BR strcoll () -.\"O is equivalent to -.\"O .BR strcmp (3). -\fI"POSIX"\fP および \fI"C"\fP ロケールにおいては、 -.BR strcoll () -は -.BR strcmp (3) -と等価である。 -.\"O .SH "SEE ALSO" +\fI"POSIX"\fP および \fI"C"\fP ロケールにおいては、 \fBstrcoll\fP() は \fBstrcmp\fP(3) と等価である。 .SH 関連項目 -.BR bcmp (3), -.BR memcmp (3), -.BR setlocale (3), -.BR strcasecmp (3), -.BR strcmp (3), -.BR string (3), -.BR strxfrm (3) +\fBbcmp\fP(3), \fBmemcmp\fP(3), \fBsetlocale\fP(3), \fBstrcasecmp\fP(3), \fBstrcmp\fP(3), +\fBstring\fP(3), \fBstrxfrm\fP(3) diff --git a/draft/man3/strcpy.3 b/draft/man3/strcpy.3 index 234349cd..cc1df555 100644 --- a/draft/man3/strcpy.3 +++ b/draft/man3/strcpy.3 @@ -30,84 +30,32 @@ .\" 2007-06-15, Marc Boyer + mtk .\" Improve discussion of strncpy(). .\" -.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi -.\" all rights reserved. -.\" Translated Mon Jan 20 22:35:40 JST 1997 -.\" by YOSHINO Takashi +.\"******************************************************************* .\" -.\" Japanese Version Last Modified Sun Sep 5 01:48:52 1999 -.\" by Kentaro Shirakata -.\" Modified for 'null/NUL translation' Sat 5 Jan 2002 -.\" by NAKANO Takeo , LDP v2.58 +.\" This file was generated with po4a. Translate the source file. .\" -.TH STRCPY 3 2010-09-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH STRCPY 3 2010\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 -.\"O strcpy, strncpy \- copy a string strcpy, strncpy \- 文字列をコピーする -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "char *strcpy(char *" dest ", const char *" src ); +\fBchar *strcpy(char *\fP\fIdest\fP\fB, const char *\fP\fIsrc\fP\fB);\fP .sp -.BI "char *strncpy(char *" dest ", const char *" src ", size_t " n ); +\fBchar *strncpy(char *\fP\fIdest\fP\fB, const char *\fP\fIsrc\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR strcpy () -.\"O function copies the string pointed to by \fIsrc\fP, -.\"O including the terminating null byte (\(aq\\0\(aq), -.\"O to the buffer pointed to by \fIdest\fP. -.BR strcpy () -関数は -\fIsrc\fP が指す文字列を末尾のヌルバイト (\(aq\\0\(aq) も含めて -\fIdest\fP が指すバッファにコピーする。 -.\"O The strings may not overlap, and the destination string -.\"O \fIdest\fP must be large enough to receive the copy. -二つの文字列は重なってはならない。受け側の文字列 \fIdest\fP は -コピーを受け取るのに十分な大きさでなければならない。 +\fBstrcpy\fP() 関数は \fIsrc\fP が指す文字列を末尾のヌルバイト (\(aq\e0\(aq) も含めて \fIdest\fP +が指すバッファにコピーする。 二つの文字列は重なってはならない。受け側の文字列 \fIdest\fP は コピーを受け取るのに十分な大きさでなければならない。 .PP -.\"O The -.\"O .BR strncpy () -.\"O function is similar, except that at most -.\"O \fIn\fP bytes of \fIsrc\fP are copied. -.BR strncpy () -関数も同様だが、 -\fIsrc\fP のうち最大でも \fIn\fP バイトしかコピーされない点が異なる。 -.\"O .BR Warning : -.\"O If there is no null byte -.\"O among the first \fIn\fP bytes of \fIsrc\fP, -.\"O the string placed in \fIdest\fP will not be null-terminated. -.BR 警告 : -\fIsrc\fP の最初の \fIn\fP バイトの中にヌルバイトがない場合、 -\fIdest\fP に格納される文字列はヌルで終端されないことになる。 +\fBstrncpy\fP() 関数も同様だが、 \fIsrc\fP のうち最大でも \fIn\fP バイトしかコピーされない点が異なる。 \fB警告\fP: \fIsrc\fP +の最初の \fIn\fP バイトの中にヌルバイトがない場合、 \fIdest\fP に格納される文字列はヌルで終端されないことになる。 .PP -.\"O If the length of -.\"O .I src -.\"O is less than -.\"O .IR n , -.\"O .BR strncpy () -.\"O pads the remainder of -.\"O .I dest -.\"O with null bytes. -.I src -の長さが -.I n -よりも短い場合、 -.BR strncpy () -は -.I dest -の残りをヌルバイトで埋める。 +\fIsrc\fP の長さが \fIn\fP よりも短い場合、 \fBstrncpy\fP() は \fIdest\fP の残りをヌルバイトで埋める。 .PP -.\"O A simple implementation of -.\"O .BR strncpy () -.\"O might be: -.BR strncpy () -の簡単な実装は以下のような感じであろう: +\fBstrncpy\fP() の簡単な実装は以下のような感じであろう: .in +4n .nf @@ -116,99 +64,39 @@ strncpy(char *dest, const char *src, size_t n) { size_t i; - for (i = 0; i < n && src[i] != \(aq\\0\(aq; i++) + for (i = 0; i < n && src[i] != \(aq\e0\(aq; i++) dest[i] = src[i]; for ( ; i < n; i++) - dest[i] = \(aq\\0\(aq; + dest[i] = \(aq\e0\(aq; return dest; } .fi .in -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O The -.\"O .BR strcpy () -.\"O and -.\"O .BR strncpy () -.\"O functions return a pointer to -.\"O the destination string \fIdest\fP. -.BR strcpy () -関数と -.BR strncpy () -関数は -受け側の文字列\fIdest\fPへのポインタを返す。 -.\"O .SH "CONFORMING TO" +\fBstrcpy\fP() 関数と \fBstrncpy\fP() 関数は 受け側の文字列\fIdest\fPへのポインタを返す。 .SH 準拠 SVr4, 4.3BSD, C89, C99. -.\"O .SH NOTES .SH 注意 -.\"O Some programmers consider -.\"O .BR strncpy () -.\"O to be inefficient and error prone. -.\"O If the programmer knows (i.e., includes code to test!) -.\"O that the size of \fIdest\fP is greater than -.\"O the length of \fIsrc\fP, then -.\"O .BR strcpy () -.\"O can be used. -.BR strncpy () -は効率的でなく間違いを起こしやすいと考えるプログラマもいるだろう。 -プログラマが \fIdest\fP の大きさが \fIsrc\fP の長さよりも -大きいことを知っている (つまり、そのことをチェックするコードを -書いている) 場合は、 -.B strcpy() -を使うことができる。 +\fBstrncpy\fP() は効率的でなく間違いを起こしやすいと考えるプログラマもいるだろう。 プログラマが \fIdest\fP の大きさが \fIsrc\fP +の長さよりも 大きいことを知っている (つまり、そのことをチェックするコードを 書いている) 場合は、 \fBstrcpy()\fP を使うことができる。 -.\"O If there is no terminating null byte in the first \fIn\fP -.\"O characters of \fIsrc\fP, -.\"O .BR strncpy () -.\"O produces an unterminated string in \fIdest\fP. -.\"O Programmers often prevent this mistake by forcing termination -.\"O as follows: -\fIsrc\fP の最初の \fIn\fP 文字に終端のヌルバイトがない場合、 -.BR strncpy () -は \fIdest\fP に終端されていない文字列を生成する。 -プログラマは間違いを防止するために、 -以下のように強制的に終端を行うことがよくある。 +\fIsrc\fP の最初の \fIn\fP 文字に終端のヌルバイトがない場合、 \fBstrncpy\fP() は \fIdest\fP +に終端されていない文字列を生成する。 プログラマは間違いを防止するために、 以下のように強制的に終端を行うことがよくある。 .in +4n .nf strncpy(buf, str, n); if (n > 0) - buf[n \- 1]= \(aq\\0\(aq; + buf[n \- 1]= \(aq\e0\(aq; .fi .in -.\"O .SH BUGS .SH バグ -.\"O If the destination string of a -.\"O .BR strcpy () -.\"O is not large enough, then anything might happen. -.\"O Overflowing fixed-length string buffers is a favorite cracker technique -.\"O for taking complete control of the machine. -.\"O Any time a program reads or copies data into a buffer, -.\"O the program first needs to check that there's enough space. -.\"O This may be unnecessary if you can show that overflow is impossible, -.\"O but be careful: programs can get changed over time, -.\"O in ways that may make the impossible possible. -.BR strcpy () -の受け側の文字列が十分な大きさでない場合、何が起こるかわからない。 -固定長文字列を溢れさせるのは、マシンの制御を掌中に収めるために -クラッカーが好んで使うテクニックである。 -プログラムでデータをバッファに読み込んだりコピーしたりする場合には、 -必ずまず最初に十分な大きさがあるかどうかをチェックする必要がある。 -プログラマがオーバーフローが不可能だと示せる場合には -このチェックは不要かもしれないが、十分注意すること。 -長い間には、不可能だったことが可能になるような方法でプログラムが -変更されることもあるからだ。 -.\"O .SH "SEE ALSO" +\fBstrcpy\fP() の受け側の文字列が十分な大きさでない場合、何が起こるかわからない。 +固定長文字列を溢れさせるのは、マシンの制御を掌中に収めるために クラッカーが好んで使うテクニックである。 +プログラムでデータをバッファに読み込んだりコピーしたりする場合には、 必ずまず最初に十分な大きさがあるかどうかをチェックする必要がある。 +プログラマがオーバーフローが不可能だと示せる場合には このチェックは不要かもしれないが、十分注意すること。 +長い間には、不可能だったことが可能になるような方法でプログラムが 変更されることもあるからだ。 .SH 関連項目 -.BR bcopy (3), -.BR memccpy (3), -.BR memcpy (3), -.BR memmove (3), -.BR stpcpy (3), -.BR stpncpy (3), -.BR strdup (3), -.BR string (3), -.BR wcscpy (3), -.BR wcsncpy (3) +\fBbcopy\fP(3), \fBmemccpy\fP(3), \fBmemcpy\fP(3), \fBmemmove\fP(3), \fBstpcpy\fP(3), +\fBstpncpy\fP(3), \fBstrdup\fP(3), \fBstring\fP(3), \fBwcscpy\fP(3), \fBwcsncpy\fP(3) diff --git a/draft/man3/strdup.3 b/draft/man3/strdup.3 index 1686ba38..50cdbe35 100644 --- a/draft/man3/strdup.3 +++ b/draft/man3/strdup.3 @@ -26,138 +26,72 @@ .\" 386BSD man pages .\" Modified Sun Jul 25 10:41:34 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified Wed Oct 17 01:12:26 2001 by John Levon +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi -.\" all rights reserved. -.\" Translated Mon Jan 20 22:31:05 JST 1997 -.\" by YOSHINO Takashi -.\" Updated Fri Nov 2 JST 2001 by Kentaro Shirakata +.\" This file was generated with po4a. Translate the source file. .\" -.TH STRDUP 3 2011-10-01 "GNU" "Linux Programmer's Manual" +.\"******************************************************************* +.TH STRDUP 3 2011\-10\-01 GNU "Linux Programmer's Manual" .SH 名前 -.\"O strdup, strndup, strdupa, strndupa \- duplicate a string strdup, strndup, strdupa, strndupa \- 文字列を複製する .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "char *strdup(const char *" s ); +\fBchar *strdup(const char *\fP\fIs\fP\fB);\fP .sp -.BI "char *strndup(const char *" s ", size_t " n ); +\fBchar *strndup(const char *\fP\fIs\fP\fB, size_t \fP\fIn\fP\fB);\fP .br -.BI "char *strdupa(const char *" s ); +\fBchar *strdupa(const char *\fP\fIs\fP\fB);\fP .br -.BI "char *strndupa(const char *" s ", size_t " n ); +\fBchar *strndupa(const char *\fP\fIs\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .PD 0 .ad l .sp -.BR strdup (): +\fBstrdup\fP(): .RS 4 -_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .br || /* Since glibc 2.12: */ _POSIX_C_SOURCE\ >=\ 200809L .RE .PP -.BR strndup (): +\fBstrndup\fP(): .RS 4 -.TP 4 -.\"O Since glibc 2.10: +.TP 4 glibc 2.10 以降: POSIX_C_SOURCE\ >=\ 200809L || _XOPEN_SOURCE\ >=\ 700 -.TP -.\"O Before glibc 2.10: +.TP glibc 2.10 より前: _GNU_SOURCE .RE .PP -.BR strdupa (), -.BR strndupa (): -_GNU_SOURCE +\fBstrdupa\fP(), \fBstrndupa\fP(): _GNU_SOURCE .ad .PD .SH 説明 -.\"O The -.\"O .BR strdup () -.\"O function returns a pointer to a new string which -.\"O is a duplicate of the string \fIs\fP. -.\"O Memory for the new string is -.\"O obtained with \fBmalloc\fP(3), and can be freed with -.\"O .BR free (3). -.BR strdup () -関数は、文字列 \fIs\fPの複製である -新しい文字列へのポインタを返す。 -新しい文字列のためのメモリは -.BR malloc (3) -で得ている。 -そして、 -.BR free (3) -で解放することができる。 +\fBstrdup\fP() 関数は、文字列 \fIs\fPの複製である 新しい文字列へのポインタを返す。 新しい文字列のためのメモリは \fBmalloc\fP(3) +で得ている。 そして、 \fBfree\fP(3) で解放することができる。 -.\"O The -.\"O .BR strndup () -.\"O function is similar, but only copies at most -.\"O \fIn\fP characters. -.\"O If \fIs\fP is longer than \fIn\fP, only \fIn\fP -.\"O characters are copied, and a terminating null byte (\(aq\\0\(aq) is added. -.BR strndup () -関数は同様であるが、最大で \fIn\fP 文字だけを複製する。 -\fIs\fP が \fIn\fP よりも長い場合、\fIn\fP 文字だけが複製され、 -終端の NULL バイト (\(aq\\0\(aq)) が追加される。 +\fBstrndup\fP() 関数は同様であるが、最大で \fIn\fP 文字だけを複製する。 \fIs\fP が \fIn\fP よりも長い場合、\fIn\fP +文字だけが複製され、 終端の NULL バイト (\(aq\e0\(aq)) が追加される。 -.\"O .BR strdupa () -.\"O and -.\"O .BR strndupa () -.\"O are similar, but use \fBalloca(3)\fP -.\"O to allocate the buffer. -.\"O They are only available when using the GNU -.\"O GCC suite, and suffer from the same limitations described in \fBalloca(3)\fP. -.BR strdupa () -と -.BR strndupa () -関数は同様であるが、 -バッファを割り当てるのに \fBalloca(3)\fP を用いる。 -これらの関数は GNU GCC を用いた場合にのみ有効で、 -\fBalloca(3)\fP で記述されているのと同様の制限を受ける。 +\fBstrdupa\fP() と \fBstrndupa\fP() 関数は同様であるが、 バッファを割り当てるのに \fBalloca(3)\fP を用いる。 +これらの関数は GNU GCC を用いた場合にのみ有効で、 \fBalloca(3)\fP で記述されているのと同様の制限を受ける。 .SH 返り値 -.BR strdup () -関数は複製された文字列へのポインタ、または -十分なメモリが確保できなかった場合にはNULLを返す。 +\fBstrdup\fP() 関数は複製された文字列へのポインタ、または 十分なメモリが確保できなかった場合にはNULLを返す。 .SH エラー -.TP -.B ENOMEM +.TP +\fBENOMEM\fP 複製された文字列を割り当てる十分なメモリが確保できなかった。 .SH 準拠 .\" 4.3BSD-Reno, not (first) 4.3BSD. -.\"O .BR strdup () -.\"O conforms to SVr4, 4.3BSD, POSIX.1-2001. -.BR strdup () -は SVr4, 4.3BSD, POSIX.1-2001 準拠である。 -.\"O .BR strndup () -.\"O conforms to POSIX.1-2008. -.BR strndup () -は POSIX.1-2008 準拠である。 -.\"O .BR strdupa () -.\"O and -.\"O .BR strndupa () -.\"O are GNU extensions. -.BR strdupa (), -.BR strndupa () -は GNU 拡張である。 +\fBstrdup\fP() は SVr4, 4.3BSD, POSIX.1\-2001 準拠である。 \fBstrndup\fP() は +POSIX.1\-2008 準拠である。 \fBstrdupa\fP(), \fBstrndupa\fP() は GNU 拡張である。 .SH 関連項目 -.BR alloca (3), -.BR calloc (3), -.BR free (3), -.BR malloc (3), -.BR realloc (3), -.BR string (3), -.BR wcsdup (3) +\fBalloca\fP(3), \fBcalloc\fP(3), \fBfree\fP(3), \fBmalloc\fP(3), \fBrealloc\fP(3), +\fBstring\fP(3), \fBwcsdup\fP(3) diff --git a/draft/man3/strerror.3 b/draft/man3/strerror.3 index 5b68e84d..db2000de 100644 --- a/draft/man3/strerror.3 +++ b/draft/man3/strerror.3 @@ -34,269 +34,80 @@ .\" 2005-12-13, mtk, Substantial rewrite of strerror_r() description .\" Addition of extra material on portability and standards. .\" -.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi -.\" all rights reserved. -.\" Translated 1997-01-20, YOSHINO Takashi -.\" Updated & Modified 2001-11-03, Yuichi SATO -.\" Updated 2005-12-26, Akihiro MOTOKI -.\" Updated 2007-09-06, Akihiro MOTOKI , LDP v2.64 +.\"******************************************************************* .\" -.\"WORD GNU-specific GNU 仕様の -.\"WORD XSI-compliant XSI 準拠の +.\" This file was generated with po4a. Translate the source file. .\" -.TH STRERROR 3 2009-03-30 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH STRERROR 3 2009\-03\-30 "" "Linux Programmer's Manual" .SH 名前 -.\"O strerror, strerror_r \- return string describing error number strerror, strerror_r \- エラー番号を説明する文字列を返す。 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "char *strerror(int " errnum ); +\fBchar *strerror(int \fP\fIerrnum\fP\fB);\fP .sp -.BI "char *strerror_r(int " errnum ", char *" buf ", size_t " buflen ); +\fBint strerror_r(int \fP\fIerrnum\fP\fB, char *\fP\fIbuf\fP\fB, size_t \fP\fIbuflen\fP\fB);\fP + /* XSI\-compliant */ +.sp +\fBchar *strerror_r(int \fP\fIerrnum\fP\fB, char *\fP\fIbuf\fP\fB, size_t \fP\fIbuflen\fP\fB);\fP + /* GNU\-specific */ .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.\"O The XSI-compliant version of -.\"O .BR strerror_r () -.\"O is provided if: -次の場合には -XSI 準拠のバージョンの -.BR strerror_r () -が提供される: +次の場合には XSI 準拠のバージョンの \fBstrerror_r\fP() が提供される: .br (_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600) && !\ _GNU_SOURCE -.fi -.\"O .SH DESCRIPTION -.\"O The -.\"O .BR strerror () -.\"O function returns a pointer to a string that describes the error -.\"O code passed in the argument \fIerrnum\fP, possibly using the -.\"O .B LC_MESSAGES -.\"O part of the current locale to select the appropriate language. -.\"O This string must not be modified by the application, but may be -.\"O modified by a subsequent call to \fBperror\fP(3) or -.\"O .BR strerror (). -.\"O No library function will modify this string. +.br +それ以外の場合、GNU バージョンが提供される。 .SH 説明 -.BR strerror () -関数は、引き数 \fIerrnum\fP で渡されたエラーコードについての -説明が入った文字列へのポインタを返す。 -可能であるならば、適切な言語を選択するために、 -現在のロケールの -.B LC_MESSAGES -を使う。 -この文字列は、アプリケーションで変更してはならないが、 -その後に起こる -.BR perror (3) -や -.BR strerror () -の呼び出しで -変更されても構わない。 -この文字列を変更するライブラリ関数はない。 +\fBstrerror\fP() 関数は、引き数 \fIerrnum\fP で渡されたエラーコードについての 説明が入った文字列へのポインタを返す。 +可能であるならば、適切な言語を選択するために、 現在のロケールの \fBLC_MESSAGES\fP を使う。 +この文字列は、アプリケーションで変更してはならないが、 その後に起こる \fBperror\fP(3) や \fBstrerror\fP() の呼び出しで +変更されても構わない。 この文字列を変更するライブラリ関数はない。 -.\"O The -.\"O .BR strerror_r () -.\"O function is similar to -.\"O .BR strerror (), -.\"O but is -.\"O thread safe. -.\"O This function is available in two versions: -.\"O an XSI-compliant version specified in POSIX.1-2001 -.\"O (available since glibc 2.3.4), -.\"O and a GNU-specific version (available since glibc 2.0). -.\"O The XSI-compliant version is provided with the feature test macros -.\"O settings shown in the SYNOPSIS; -.\"O otherwise the GNU-specific version is provided. -.BR strerror_r () -関数は -.BR strerror () -と似ているが、 -スレッドセーフである。 -この関数には二種類のバージョンが存在し、 -POSIX.1-2001 で規定された XSI 準拠のバージョン -(glibc 2.3.4 以降で利用可能) と、 -GNU 仕様のバージョン (glibc 2.0 以降で利用可能) である。 -「書式」の節に記載された機能検査マクロの場合には、 -XSI 準拠のバージョンが提供される。 -それ以外の場合には GNU 仕様のバージョンが提供される。 -.\"O If no feature test macros are explicitly defined, -.\"O then (since glibc 2.4) -.\"O .B _POSIX_SOURCE -.\"O is defined by default with the value -.\"O 200112L, so that the XSI-compliant version of -.\"O .BR strerror_r () -.\"O is provided by default. -機能検査マクロが一つも明示的に定義されない場合、 -(glibc 2.4 以降では) デフォルトで -.B _POSIX_SOURCE -は値 200112l で定義され、その結果 -XSI 準拠のバージョンの -.BR strerror_r () +\fBstrerror_r\fP() 関数は \fBstrerror\fP() と似ているが、 スレッドセーフである。 この関数には二種類のバージョンが存在し、 +POSIX.1\-2001 で規定された XSI 準拠のバージョン (glibc 2.3.4 以降で利用可能) と、 GNU 仕様のバージョン +(glibc 2.0 以降で利用可能) である。 「書式」の節に記載された機能検査マクロの場合には、 XSI 準拠のバージョンが提供される。 +それ以外の場合には GNU 仕様のバージョンが提供される。 機能検査マクロが一つも明示的に定義されない場合、 (glibc 2.4 以降では) +デフォルトで \fB_POSIX_SOURCE\fP は値 200112l で定義され、その結果 XSI 準拠のバージョンの \fBstrerror_r\fP() がデフォルトで提供される。 -.\"O The XSI-compliant -.\"O .BR strerror_r () -.\"O is preferred for portable applications. -.\"O It returns the error string in the user-supplied buffer -.\"O .I buf -.\"O of length -.\"O .IR buflen . -移植性が必要なアプリケーションでは、 -XSI 準拠の -.BR strerror_r () -を使う方がよい。 -この関数は、ユーザーから提供される長さ -.I buflen -のバッファ -.I buf -にエラー文字列を返す。 +移植性が必要なアプリケーションでは、 XSI 準拠の \fBstrerror_r\fP() を使う方がよい。 この関数は、ユーザーから提供される長さ +\fIbuflen\fP のバッファ \fIbuf\fP にエラー文字列を返す。 -.\"O The GNU-specific -.\"O .BR strerror_r () -.\"O returns a pointer to a string containing the error message. -.\"O This may be either a pointer to a string that the function stores in -.\"O .IR buf , -.\"O or a pointer to some (immutable) static string -.\"O (in which case -.\"O .I buf -.\"O is unused). -.\"O If the function stores a string in -.\"O .IR buf , -.\"O then at most -.\"O .I buflen -.\"O bytes are stored (the string may be truncated if -.\"O .I buflen -.\"O is too small) and the string always includes a terminating null byte. -GNU 仕様の -.BR strerror_r () -は、エラーメッセージを格納した文字列へのポインタを返す。 -返り値は、この関数が -.I buf -に格納した文字列へのポインタか、 -何らかの (不変な) 静的な文字列へのポインタ、のいずれかとなる -(後者の場合は -.I buf -は使用されない)。 -.I buf -に文字列が格納される場合は、 -最大で -.I buflen -バイトが格納され -.RI ( buflen -が小さ過ぎたときには文字列は切り詰められる)、 -文字列には必ず終端ヌル文字が含まれる。 -.\"O .SH "RETURN VALUE" +GNU 仕様の \fBstrerror_r\fP() は、エラーメッセージを格納した文字列へのポインタを返す。 返り値は、この関数が \fIbuf\fP +に格納した文字列へのポインタか、 何らかの (不変な) 静的な文字列へのポインタ、のいずれかとなる (後者の場合は \fIbuf\fP は使用されない)。 +\fIbuf\fP に文字列が格納される場合は、 最大で \fIbuflen\fP バイトが格納され (\fIbuflen\fP +が小さ過ぎたときには文字列は切り詰められる)、 文字列には必ず終端ヌル文字が含まれる。 .SH 返り値 -.\"O The -.\"O .BR strerror () -.\"O and -.\"O .BR strerror_r () -.\"O functions return -.\"O the appropriate error description string, -.\"O or an "Unknown error nnn" message if the error number is unknown. -.BR strerror () -と -.BR strerror_r () -はエラー内容を説明する -文字列を返す。エラー番号が未知の場合は "Unknown error nnn" という -メッセージを返す。 +\fBstrerror\fP() と \fBstrerror_r\fP() はエラー内容を説明する 文字列を返す。エラー番号が未知の場合は "Unknown +error nnn" という メッセージを返す。 -.\"O The XSI-compliant -.\"O .BR strerror_r () -.\"O function returns 0 on success; -.\"O on error, \-1 is returned and -.\"O .I errno -.\"O is set to indicate the error. -XSI 準拠の -.BR strerror_r () -関数は成功すると 0 を返す。 -エラーの場合には、 \-1 を返し、 -.I errno +XSI 準拠の \fBstrerror_r\fP() 関数は成功すると 0 を返す。 エラーの場合には、 \-1 を返し、 \fIerrno\fP にエラー内容を示す値をセットする。 -.\"O .SH ERRORS .SH エラー -.TP -.B EINVAL -.\"O The value of -.\"O .I errnum -.\"O is not a valid error number. -.I errnum -の値が有効なエラー番号ではない。 -.TP -.B ERANGE -.\"O Insufficient storage was supplied to contain the error description string. +.TP +\fBEINVAL\fP +\fIerrnum\fP の値が有効なエラー番号ではない。 +.TP +\fBERANGE\fP エラーコードを説明する文字列のために、充分な領域が確保できなかった。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O .BR strerror () -.\"O is specified by POSIX.1-2001, C89, C99. -.\"O .BR strerror_r () -.\"O is specified by POSIX.1-2001. -.BR strerror () -は POSIX.1-2001, C89, C99 で規定されている。 -.BR strerror_r () -は POSIX.1-2001 で規定されている。 +\fBstrerror\fP() は POSIX.1\-2001, C89, C99 で規定されている。 \fBstrerror_r\fP() は +POSIX.1\-2001 で規定されている。 -.\"O The GNU-specific -.\"O .BR strerror_r () -.\"O function is a nonstandard extension. -GNU 仕様の -.BR strerror_r () -関数は非標準の拡張である。 +GNU 仕様の \fBstrerror_r\fP() 関数は非標準の拡張である。 -.\"O POSIX.1-2001 permits -.\"O .BR strerror () -.\"O to set -.\"O .I errno -.\"O if the call encounters an error, but does not specify what -.\"O value should be returned as the function result in the event of an error. -.\"O On some systems, -.\"O .\" e.g., Solaris 8, HP-UX 11 -.\"O .BR strerror () -.\"O returns NULL if the error number is unknown. -.\"O On other systems, -.\"O .\" e.g., FreeBSD 5.4, Tru64 5.1B -.\"O .BR strerror () -.\"O returns a string something like "Error nnn occurred" and sets -.\"O .I errno -.\"O to -.\"O .B EINVAL -.\"O if the error number is unknown. -POSIX.1-2001 は、 -.BR strerror () -がエラーに遭遇した場合に -.I errno -をセットすることを認めているが、エラー発生時に関数の結果として -どんな値を返すべきかを規定してない。 -あるシステムでは、 -.\" 例えば Solaris 8, HP-UX 11 -エラー番号が未知の場合、 -.BR strerror () -は NULL を返す。 -他のシステムでは、 -.\" 例えば FreeBSD 5.4, Tru64 5.1B -エラー番号が未知の場合、 -.BR strerror () -は "Error nnn occurred" といった文字列を返し、 -.I errno -に -.B EINVAL -をセットする。 -.\"O .SH "SEE ALSO" +.\" e.g., Solaris 8, HP-UX 11 +.\" e.g., FreeBSD 5.4, Tru64 5.1B +POSIX.1\-2001 は、 \fBstrerror\fP() がエラーに遭遇した場合に \fIerrno\fP +をセットすることを認めているが、エラー発生時に関数の結果として どんな値を返すべきかを規定してない。 あるシステムでは、 エラー番号が未知の場合、 +\fBstrerror\fP() は NULL を返す。 他のシステムでは、 エラー番号が未知の場合、 \fBstrerror\fP() は "Error +nnn occurred" といった文字列を返し、 \fIerrno\fP に \fBEINVAL\fP をセットする。 .SH 関連項目 -.BR err (3), -.BR errno (3), -.BR error (3), -.BR perror (3), -.BR strsignal (3) +\fBerr\fP(3), \fBerrno\fP(3), \fBerror\fP(3), \fBperror\fP(3), \fBstrsignal\fP(3) diff --git a/draft/man3/strfry.3 b/draft/man3/strfry.3 index a0cc788d..97fc4b28 100644 --- a/draft/man3/strfry.3 +++ b/draft/man3/strfry.3 @@ -25,57 +25,28 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sun Jul 25 10:39:43 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1998 Akihiro Motoki all rights reserved. -.\" Translated Mon May 25 1998 by Akihiro Motoki +.\" This file was generated with po4a. Translate the source file. .\" -.TH STRFRY 3 2010-09-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH STRFRY 3 2010\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 -.\"O strfry \- randomize a string strfry \- 文字列をランダムに並べ変える -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ .br -.B #include +\fB#include \fP .sp -.BI "char *strfry(char *" string ); +\fBchar *strfry(char *\fP\fIstring\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR strfry () -.\"O function randomizes the contents of \fIstring\fP by -.\"O using -.\"O .BR rand (3) -.\"O to randomly swap characters in the string. -.\"O The result is an anagram of \fIstring\fP. -.BR strfry () -関数は、文字列 \fIstring\fP の内容をランダムに並び換える。 -並び換えは、 -.BR rand (3) -関数を用いて、文字列中の各文字を無作為に -交換することで実現される。結果は、文字列 \fIstring\fP のアナグラムである。 -.\"O .SH "RETURN VALUE" +\fBstrfry\fP() 関数は、文字列 \fIstring\fP の内容をランダムに並び換える。 並び換えは、 \fBrand\fP(3) +関数を用いて、文字列中の各文字を無作為に 交換することで実現される。結果は、文字列 \fIstring\fP のアナグラムである。 .SH 返り値 -.\"O The -.\"O .BR strfry () -.\"O functions returns a pointer to the randomized -.\"O string. -.BR strfry () -関数は、ランダムに並び換えられた文字列へのポインタを返す。 -.\"O .SH "CONFORMING TO" +\fBstrfry\fP() 関数は、ランダムに並び換えられた文字列へのポインタを返す。 .SH 準拠 -.\"O The -.\"O .BR strfry () -.\"O function is unique to the -.\"O GNU C Library. -.BR strfry () -関数は GNU C ライブラリに特有である。 -.\"O .SH "SEE ALSO" +\fBstrfry\fP() 関数は GNU C ライブラリに特有である。 .SH 関連項目 -.BR memfrob (3), -.BR string (3) +\fBmemfrob\fP(3), \fBstring\fP(3) diff --git a/draft/man3/strftime.3 b/draft/man3/strftime.3 index 799f35bb..d2cd99fc 100644 --- a/draft/man3/strftime.3 +++ b/draft/man3/strftime.3 @@ -32,688 +32,242 @@ .\" 2005-11-22 mtk, added Glibc Notes covering optional 'flag' and .\" 'width' components of conversion specifications. .\" -.\" Japanese Version Copyright (c) 2000 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 2000-10-10, HANATAKA Shinya -.\" Updated 2002-01-09, Kentaro Shirakata -.\" Updated 2002-01-14, Akihiro MOTOKI -.\" Updated 2005-02-26, Akihiro MOTOKI -.\" Updated 2005-04-17, Akihiro MOTOKI -.\" Updated 2005-12-05, Akihiro MOTOKI, LDP v2.16 -.\" Updated 2010-04-18, Akihiro MOTOKI, LDP v3.24 +.\"******************************************************************* .\" -.\"WORD: conversion specifier 変換指定文字 -.\"WORD: conversion specification 変換指定 -.\"WORD: modifier 修飾子 -.\"WORD: broken-down time 要素別の(時刻) -.\"WORD: Single UNIX Specification 統一 UNIX 規格 -.\"WORD: ISO\ 8601 week-based ISO\ 8601 の週単位表記 +.\" This file was generated with po4a. Translate the source file. .\" -.TH STRFTIME 3 2010-01-17 "GNU" "Linux Programmer's Manual" +.\"******************************************************************* +.TH STRFTIME 3 2010\-01\-17 GNU "Linux Programmer's Manual" .SH 名前 -.\"O strftime \- format date and time strftime \- 日付および時刻の文字列への変換 .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "size_t strftime(char *" s ", size_t " max ", const char *" format , -.BI " const struct tm *" tm ); +\fBsize_t strftime(char *\fP\fIs\fP\fB, size_t \fP\fImax\fP\fB, const char *\fP\fIformat\fP\fB,\fP +\fB const struct tm *\fP\fItm\fP\fB);\fP .fi .SH 説明 -.\"O The -.\"O .BR strftime () -.\"O function formats the broken-down time \fItm\fP -.\"O according to the format specification \fIformat\fP and places the -.\"O result in the character array \fIs\fP of size \fImax\fP. -.BR strftime () -関数 は、要素別の時刻 \fItm\fP の内容を -\fIformat\fP で指定された書式指定にしたがって変換し、 -長さ \fImax\fP の文字列 \fIs\fP に書き込む。 .\" FIXME POSIX says: Local timezone information is used as though .\" strftime() called tzset(). But this doesn't appear to be the case +\fBstrftime\fP() 関数 は、要素別の時刻 \fItm\fP の内容を \fIformat\fP で指定された書式指定にしたがって変換し、 長さ +\fImax\fP の文字列 \fIs\fP に書き込む。 .PP -.\"O The format specification is a null-terminated string and may contain -.\"O special character sequences called -.\"O .IR "conversion specifications", -.\"O each of which is introduced by a \(aq%\(aq character and terminated by -.\"O some other character known as a -.\"O .IR "conversion specifier character". -.\"O All other character sequences are -.\"O .IR "ordinary character sequences". -書式指定は NULL 終端された文字列であり、 -「変換指定 (conversion specification)」と呼ばれる特別な文字列を -含まることができる。 -各々の変換指定は \(aq%\(aq 文字で始まり、 -「変換指定文字 (conversion specifier character)」と呼ばれる -何らか他の文字で終端される。上記以外の全ての文字列は -「通常の文字列 (ordinary character sequence)」となる。 +書式指定は NULL 終端された文字列であり、 「変換指定 (conversion specification)」と呼ばれる特別な文字列を +含まることができる。 各々の変換指定は \(aq%\(aq 文字で始まり、 「変換指定文字 (conversion specifier +character)」と呼ばれる 何らか他の文字で終端される。上記以外の全ての文字列は 「通常の文字列 (ordinary character +sequence)」となる。 .PP -.\"O The characters of ordinary character sequences (including the null byte) -.\"O are copied verbatim from \fIformat\fP to \fIs\fP. However, the characters -.\"O of conversion specifications are replaced as follows: -(NULL バイトも含む) 通常の文字列内の文字は、 -そのまま \fIformat\fP から \fIs\fP にコピーされる。 +(NULL バイトも含む) 通常の文字列内の文字は、 そのまま \fIformat\fP から \fIs\fP にコピーされる。 一方、変換指定の文字は以下のように置換される。 -.TP -.B %a -.\"O The abbreviated weekday name according to the current locale. +.TP +\fB%a\fP 現在のロケールにおける曜日の省略名。 -.TP -.B %A -.\"O The full weekday name according to the current locale. +.TP +\fB%A\fP 現在のロケールにおける曜日の完全な名前。 -.TP -.B %b -.\"O The abbreviated month name according to the current locale. +.TP +\fB%b\fP 現在のロケールにおける月の省略名。 -.TP -.B %B -.\"O The full month name according to the current locale. +.TP +\fB%B\fP 現在のロケールにおける月の完全な名前。 -.TP -.B %c -.\"O The preferred date and time representation for the current locale. +.TP +\fB%c\fP 現在のロケールにおいて一般的な日付・時刻の表記。 -.TP -.B %C -.\"O The century number (year/100) as a 2-digit integer. (SU) +.TP +\fB%C\fP 世紀 (西暦年の上 2 桁)。 (SU) -.TP -.B %d -.\"O The day of the month as a decimal number (range 01 to 31). -月内通算日 (10 進数表記) (01-31)。 -.TP -.B %D -.\"O Equivalent to -.\"O .BR %m/%d/%y . -.\"O (Yecch\(emfor Americans only. -.\"O Americans should note that in other countries -.\"O .B %d/%m/%y -.\"O is rather common. -.\"O ambiguous and should not be used.) (SU) -.B %m/%d/%y -と等価。(うえっ、アメリカ専用だ。アメリカ以外の国では -.B %d/%m/%y +.TP +\fB%d\fP +月内通算日 (10 進数表記) (01\-31)。 +.TP +\fB%D\fP +\fB%m/%d/%y\fP と等価。(うえっ、アメリカ専用だ。アメリカ以外の国では \fB%d/%m/%y\fP の方が一般的だ。紛らわしいので、使用すべきではない。) (SU) -.TP -.B %e -.\"O Like -.\"O .BR %d , -.\"O the day of the month as a decimal number, but a leading -.\"O zero is replaced by a space. (SU) -.B %d -と同様に月内通算日を 10 進数で表現するが、 -1 桁の場合 10 の位にゼロを置かずスペースを置く。(SU) -.TP -.B %E -.\"O Modifier: use alternative format, see below. (SU) +.TP +\fB%e\fP +\fB%d\fP と同様に月内通算日を 10 進数で表現するが、 1 桁の場合 10 の位にゼロを置かずスペースを置く。(SU) +.TP +\fB%E\fP 別形式を使用する際の修飾子。下記参照。 (SU) -.TP -.B %F -.\"O Equivalent to -.\"O .B %Y-%m-%d -.\"O (the ISO\ 8601 date format). (C99) -.B %Y-%m-%d -と等価 (ISO\ 8601 形式の日付フォーマット)。 (C99) -.TP -.B %G -.\"O The ISO\ 8601 week-based year (see NOTES) with century as a decimal number. -.\"O The 4-digit year corresponding to the ISO week number (see -.\"O .BR %V ). -.\"O This has the same format and value as -.\"O .BR %Y , -.\"O except that if the ISO week number belongs to the previous or next year, -.\"O that year is used instead. (TZ) -ISO\ 8601 週単位表記の年 (week-based year; 「注意」の節を参照)。 -世紀も 10 進数で表す。 -ISO 週番号 -.RB ( %V -を参照) に対応した 4 桁の西暦年。 -これは基本的には -.B %Y -と同じ形式だが、ISO 週数が前年や翌年になる +.TP +\fB%F\fP +\fB%Y\-%m\-%d\fP と等価 (ISO\ 8601 形式の日付フォーマット)。 (C99) +.TP +\fB%G\fP +ISO\ 8601 週単位表記の年 (week\-based year; 「注意」の節を参照)。 世紀も 10 進数で表す。 ISO 週番号 (\fB%V\fP +を参照) に対応した 4 桁の西暦年。 これは基本的には \fB%Y\fP と同じ形式だが、ISO 週数が前年や翌年になる 場合にはその年が使用される点が異なる。(TZ) -.TP -.B %g -.\"O Like -.\"O .BR %G , -.\"O but without century, that is, with a 2-digit year (00-99). (TZ) -.B %G -と同様。但し、世紀を含まず下 2 桁のみを表示 (00-99)。 (TZ) -.TP -.B %h -.\"O Equivalent to -.\"O .BR %b . -.\"O (SU) -.B %b -と等価 (SU) -.TP -.B %H -.\"O The hour as a decimal number using a 24-hour clock (range 00 to 23). -24 時間表記での時 (hour)。 (00-23) -.TP -.B %I -.\"O The hour as a decimal number using a 12-hour clock (range 01 to 12). -12 時間表記での時 (hour)。 (01-12) -.TP -.B %j -.\"O The day of the year as a decimal number (range 001 to 366). -年の初めから通算の日数。 (001-366) -.TP -.B %k -.\"O The hour (24-hour clock) as a decimal number (range 0 to 23); -.\"O single digits are preceded by a blank. -.\"O (See also -.\"O .BR %H .) -.\"O (TZ) -24 時間表記での時 (0-23)。 -1 桁の場合には前にゼロでなくスペースが置かれる。 -.RB ( %H -も参照) (TZ) -.TP -.B %l -.\"O The hour (12-hour clock) as a decimal number (range 1 to 12); -.\"O single digits are preceded by a blank. -.\"O (See also -.\"O .BR %I .) -.\"O (TZ) -12 時間表記での時 (0-12)。 -1 桁の場合には前にゼロでなくスペースが置かれる。 -.RB ( %I -も参照) (TZ) -.TP -.B %m -.\"O The month as a decimal number (range 01 to 12). -月 (10 進数表記)。 (01-12) -.TP -.B %M -.\"O The minute as a decimal number (range 00 to 59). -分 (10 進数表記) (00-59) -.TP -.B %n -.\"O A newline character. (SU) +.TP +\fB%g\fP +\fB%G\fP と同様。但し、世紀を含まず下 2 桁のみを表示 (00\-99)。 (TZ) +.TP +\fB%h\fP +\fB%b\fP と等価 (SU) +.TP +\fB%H\fP +24 時間表記での時 (hour)。 (00\-23) +.TP +\fB%I\fP +12 時間表記での時 (hour)。 (01\-12) +.TP +\fB%j\fP +年の初めから通算の日数。 (001\-366) +.TP +\fB%k\fP +24 時間表記での時 (0\-23)。 1 桁の場合には前にゼロでなくスペースが置かれる。 (\fB%H\fP も参照) (TZ) +.TP +\fB%l\fP +12 時間表記での時 (0\-12)。 1 桁の場合には前にゼロでなくスペースが置かれる。 (\fB%I\fP も参照) (TZ) +.TP +\fB%m\fP +月 (10 進数表記)。 (01\-12) +.TP +\fB%M\fP +分 (10 進数表記) (00\-59) +.TP +\fB%n\fP 改行。 (SU) -.TP -.B %O -.\"O Modifier: use alternative format, see below. (SU) -別形式を使用する際の修飾子。以下を参照。(SU) -.TP -.B %p -.\"O Either "AM" or "PM" according to the given time value, or the -.\"O corresponding strings for the current locale. -.\"O Noon is treated as "PM" and midnight as "AM". -現在のロケールにおける「午前」「午後」に相当する文字列。 -英語の場合には "AM" または "PM" となる。 +.TP +\fB%O\fP +別形式を使用する際の修飾子。下記参照。 (SU) +.TP +\fB%p\fP +現在のロケールにおける「午前」「午後」に相当する文字列。 英語の場合には "AM" または "PM" となる。 正午は「午後」、真夜中は「午前」として扱われる。 -.TP -.B %P -.\"O Like -.\"O .B %p -.\"O but in lowercase: "am" or "pm" or a corresponding -.\"O string for the current locale. (GNU) -.B %p -と同様であるが小文字が使用される。 -英語の場合には "am" や "pm" となる。(GNU) -.TP -.B %r -.\"O The time in a.m. or p.m. notation. -.\"O In the POSIX locale this is equivalent to -.\"O .BR "%I:%M:%S %p" . -.\"O (SU) -午前・午後形式での時刻。 -POSIX ロケールでは -.B "%I:%M:%S %p" -と等価である。(SU) -.TP -.B %R -.\"O The time in 24-hour notation (\fB%H:%M\fP). (SU) -.\"O For a version including the seconds, see -.\"O .B %T -.\"O below. -24 時間表記での時刻、秒は表示しない -.RB ( %H:%M )。 -秒を含んだものは以下の -.B %T -を参照すること。(SU) -.TP -.B %s -.\"O The number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). (TZ) -紀元 (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) からの秒数。 (TZ) -.TP -.B %S -.\"O The second as a decimal number (range 00 to 60). -.\"O (The range is up to 60 to allow for occasional leap seconds.) -秒 (10 進数表記) (00-60) -(時々ある閏秒に対応するため、値の範囲は 60 までとなっている) -.TP -.B %t -.\"O A tab character. (SU) +.TP +\fB%P\fP +\fB%p\fP と同様であるが小文字が使用される。 英語の場合には "am" や "pm" となる。(GNU) +.TP +\fB%r\fP +午前・午後形式での時刻。 POSIX ロケールでは \fB%I:%M:%S %p\fP と等価である。(SU) +.TP +\fB%R\fP +24 時間表記での時刻、秒は表示しない (\fB%H:%M\fP)。 秒を含んだものは以下の \fB%T\fP を参照すること。(SU) +.TP +\fB%s\fP +紀元 (Epoch; 1970\-01\-01 00:00:00 +0000 (UTC)) からの秒数。 (TZ) +.TP +\fB%S\fP +秒 (10 進数表記) (00\-60) (時々ある閏秒に対応するため、値の範囲は 60 までとなっている) +.TP +\fB%t\fP タブ文字 (SU) -.TP -.B %T -.\"O The time in 24-hour notation (\fB%H:%M:%S\fP). (SU) +.TP +\fB%T\fP 24 時間表記の時間 (\fB%H:%M:%S\fP) (SU) -.TP -.B %u -.\"O The day of the week as a decimal, range 1 to 7, Monday being 1. -.\"O See also -.\"O .BR %w . -.\"O (SU) -週の何番目の日 (10 進数表記) か。月曜日を 1 とする (1-7)。 -.B %w -も参照。(SU) -.TP -.B %U -.\"O The week number of the current year as a decimal number, -.\"O range 00 to 53, starting with the first Sunday as the first day -.\"O of week 01. -.\"O See also -.\"O .B %V -.\"O and -.\"O .BR %W . -年の初めからの通算の週番号 (10 進数表記) (00-53)。 -その年の最初の日曜日を、第 1 週の始まりとして計算する。 -.B %V -と -.B %W +.TP +\fB%u\fP +週の何番目の日 (10 進数表記) か。月曜日を 1 とする (1\-7)。 \fB%w\fP も参照。(SU) +.TP +\fB%U\fP +年の初めからの通算の週番号 (10 進数表記) (00\-53)。 その年の最初の日曜日を、第 1 週の始まりとして計算する。 \fB%V\fP と \fB%W\fP も参照すること。 -.TP -.B %V -.\"O The ISO\ 8601 week number (see NOTES) of the current year as a decimal number, -.\"O range 01 to 53, where week 1 is the first week that has at least -.\"O 4 days in the new year. -.\"O See also -.\"O .B %U -.\"O and -.\"O .BR %W . -.\"O (SU) -ISO\ 8601 形式での年の始めからの週番号 (「注意」の節を参照)。 -10 進数表記で、01 から 53 の値となる。週番号は、 -新しい年が少なくとも 4 日以上含まれる最初の週を 1 として計算する。 -.B %U -と -.B %W -も参照のこと。(SU) -.TP -.B %w -.\"O The day of the week as a decimal, range 0 to 6, Sunday being 0. -.\"O See also -.\"O .BR %u . -週の何番目の日 (10 進数表記) か。日曜日を 0 とする。(0-6)。 -.B %u -も参照。(SU) -.TP -.B %W -.\"O The week number of the current year as a decimal number, -.\"O range 00 to 53, starting with the first Monday as the first day of week 01. -年の初めからの通算の週番号 (10 進数表記) (00-53)。 -その年の最初の月曜日を、第 1 週の始まりとして計算する。 -.TP -.B %x -.\"O The preferred date representation for the current locale without the time. +.TP +\fB%V\fP +ISO\ 8601 形式での年の始めからの週番号 (「注意」の節を参照)。 10 進数表記で、01 から 53 の値となる。週番号は、 +新しい年が少なくとも 4 日以上含まれる最初の週を 1 として計算する。 \fB%U\fP と \fB%W\fP も参照のこと。(SU) +.TP +\fB%w\fP +週の何番目の日 (10 進数表記) か。日曜日を 0 とする。(0\-6)。 \fB%u\fP も参照。(SU) +.TP +\fB%W\fP +年の初めからの通算の週番号 (10 進数表記) (00\-53)。 その年の最初の月曜日を、第 1 週の始まりとして計算する。 +.TP +\fB%x\fP 現在のロケールで一般的な日付表記。時刻は含まない。 -.TP -.B %X -.\"O The preferred time representation for the current locale without the date. +.TP +\fB%X\fP 現在のロケールで一般的な時刻表記。日付は含まない。 -.TP -.B %y -.\"O The year as a decimal number without a century (range 00 to 99). -西暦の下2桁 (世紀部分を含まない年) (00-99)。 -.TP -.B %Y -.\"O The year as a decimal number including the century. +.TP +\fB%y\fP +西暦の下2桁 (世紀部分を含まない年) (00\-99)。 +.TP +\fB%Y\fP 世紀部分を含めた ( 4 桁の) 西暦年。 -.TP -.B %z -.\"O The -.\"O .I +hhmm -.\"O or -.\"O .I -hhmm -.\"O numeric timezone (that is, the hour and minute offset from UTC). (SU) -.I +hhmm -や -.I -hhmm -の形式のタイムゾーン (UTC へのオフセット時間)。(SU) -.TP -.B %Z -.\"O The timezone or name or abbreviation. +.TP +\fB%z\fP +\fI+hhmm\fP や \fI\-hhmm\fP の形式のタイムゾーン (UTC へのオフセット時間)。(SU) +.TP +\fB%Z\fP タイムゾーンまたはゾーン名または省略名。 -.TP -.B %+ +.TP +\fB%+\fP .\" Nov 05 -- Not in Linux/glibc, but is in some BSDs (according to .\" their man pages) -.\"O The date and time in -.\"O .BR date (1) -.\"O format. (TZ) -.\"O (Not supported in glibc2.) -.BR date (1) -形式での日時。(TZ) -(glibc2 ではサポートされていない) -.TP -.B %% -.\"O A literal \(aq%\(aq character. +\fBdate\fP(1) 形式での日時。(TZ) (glibc2 ではサポートされていない) +.TP +\fB%%\fP \(aq%\(aq 文字。 .PP -.\"O Some conversion specifications can be modified by preceding the -.\"O conversion specifier character by the -.\"O .B E -.\"O or -.\"O .B O -.\"O .I modifier -.\"O to indicate that an alternative format should be used. -いくつかの変換指定では、変換指定文字の前に -.B E -や -.B O -「修飾子」を置くことによって別書式を使用するように指定することができる。 -.\"O If the alternative format or specification does not exist for -.\"O the current locale, the behavior will be as if the unmodified -.\"O conversion specification were used. (SU) -現在のロケールにおいて別書式が存在しない場合には、 -通常の変換指定が使用されたかのように動作する (SU)。 -.\"O The Single UNIX Specification mentions -.\"O .BR %Ec , -.\"O .BR %EC , -.\"O .BR %Ex , -.\"O .BR %EX , -.\"O .BR %Ey , -.\"O .BR %EY , -.\"O .BR %Od , -.\"O .BR %Oe , -.\"O .BR %OH , -.\"O .BR %OI , -.\"O .BR %Om , -.\"O .BR %OM , -.\"O .BR %OS , -.\"O .BR %Ou , -.\"O .BR %OU , -.\"O .BR %OV , -.\"O .BR %Ow , -.\"O .BR %OW , -.\"O .BR %Oy , -.\"O where the effect of the -.\"O .B O -.\"O modifier is to use -.\"O alternative numeric symbols (say, roman numerals), and that of the -.\"O E modifier is to use a locale-dependent alternative representation. -統一 UNIX 規格 (Single UNIX Specification) では -.BR %Ec , -.BR %EC , -.BR %Ex , -.BR %EX , -.BR %Ey , -.BR %EY , -.BR %Od , -.BR %Oe , -.BR %OH , -.BR %OI , -.BR %Om , -.BR %OM , -.BR %OS , -.BR %Ou , -.BR %OU , -.BR %OV , -.BR %Ow , -.BR %OW , -.BR %Oy , -について記述がある。ここで -.B O -修飾子は別形式の数値 (ローマ数字とか) を指定するために使用する。 -.B E -修飾子はロケール依存の別表現を指定するのに使用する。 -(訳注: -.B E -修飾子は日本で使用されている「昭和」「平成」 -などの元号による年表記を指定する。glibc 2.2 以降でのみ有効) +いくつかの変換指定では、変換指定文字の前に \fBE\fP や \fBO\fP 「修飾子」を置くことによって別書式を使用するように指定することができる。 +現在のロケールにおいて別書式が存在しない場合には、 通常の変換指定が使用されたかのように動作する (SU)。 統一 UNIX 規格 (Single +UNIX Specification) では \fB%Ec\fP, \fB%EC\fP, \fB%Ex\fP, \fB%EX\fP, \fB%Ey\fP, \fB%EY\fP, +\fB%Od\fP, \fB%Oe\fP, \fB%OH\fP, \fB%OI\fP, \fB%Om\fP, \fB%OM\fP, \fB%OS\fP, \fB%Ou\fP, \fB%OU\fP, +\fB%OV\fP, \fB%Ow\fP, \fB%OW\fP, \fB%Oy\fP, について記述がある。ここで \fBO\fP 修飾子は別形式の数値 (ローマ数字とか) +を指定するために使用する。 \fBE\fP 修飾子はロケール依存の別表現を指定するのに使用する。 (訳注: \fBE\fP +修飾子は日本で使用されている「昭和」「平成」 などの元号による年表記を指定する。glibc 2.2 以降でのみ有効) .PP -.\"O The broken-down time structure \fItm\fP is defined in \fI\fP. -.\"O See also -.\"O .BR ctime (3). -要素別の時刻構造体 \fItm\fP の詳細は \fI\fP に定義されている。 -.BR ctime (3) -も参照すること。 -.\"O .SH "RETURN VALUE" +要素別の時刻構造体 \fItm\fP の詳細は \fI\fP に定義されている。 \fBctime\fP(3) も参照すること。 .SH 返り値 -.\"O The -.\"O .BR strftime () -.\"O function returns the number of characters placed -.\"O in the array \fIs\fP, not including the terminating null byte, -.\"O provided the string, including the terminating null byte, fits. -.BR strftime () -関数は文字列 \fIs\fP に格納された文字数を返す。 -この文字数に終端の NULL バイトは含まない。 -終端の NULL バイトを格納できるだけの大きさを持った文字列を渡すこと。 -.\"O Otherwise, it returns 0, and the contents of the array is undefined. -.\"O (This behavior applies since at least libc 4.4.4; -.\"O very old versions of libc, such as libc 4.4.1, -.\"O would return \fImax\fP if the array was too small.) -それ以外の場合は 0 を返し、文字列の内容は修正されない。 -(libc 4.4.4 以降でこの挙動が適用されている。 -libc 4.4.1 などの非常に古いバージョンの libc では -文字列が短か過ぎた場合には \fImax\fP が返される。) +\fBstrftime\fP() 関数は文字列 \fIs\fP に格納された文字数を返す。 この文字数に終端の NULL バイトは含まない。 終端の NULL +バイトを格納できるだけの大きさを持った文字列を渡すこと。 それ以外の場合は 0 を返し、文字列の内容は修正されない。 (libc 4.4.4 +以降でこの挙動が適用されている。 libc 4.4.1 などの非常に古いバージョンの libc では 文字列が短か過ぎた場合には \fImax\fP +が返される。) .LP -.\"O Note that the return value 0 does not necessarily indicate an error; -.\"O for example, in many locales -.\"O .B %p -.\"O yields an empty string. -返り値 0 は必ずしもエラーを意味している訳ではないので注意すること。 -例えば、多くのロケールでは -.B %p -は空文字列を返す。 -.\"O .SH ENVIRONMENT +返り値 0 は必ずしもエラーを意味している訳ではないので注意すること。 例えば、多くのロケールでは \fB%p\fP は空文字列を返す。 .SH 環境変数 -.\"O The environment variables -.\"O .B TZ -.\"O and -.\"O .B LC_TIME -.\"O are used. -環境変数 -.B TZ -と -.B LC_TIME -が使用される。 -(訳注: -.B LC_ALL -が設定されている場合には -.B LC_TIME -よりもそちらが優先される。 -.B LC_TIME -も -.B LC_ALL -も設定されていない場合には -.B LANG -が使用される。) -.\"O .SH "CONFORMING TO" +環境変数 \fBTZ\fP と \fBLC_TIME\fP が使用される。 (訳注: \fBLC_ALL\fP が設定されている場合には \fBLC_TIME\fP +よりもそちらが優先される。 \fBLC_TIME\fP も \fBLC_ALL\fP も設定されていない場合には \fBLANG\fP が使用される。) .SH 準拠 -SVr4, C89, C99. -.\"O There are strict inclusions between the set of conversions -.\"O given in ANSI C (unmarked), those given in the Single UNIX Specification -.\"O (marked SU), those given in Olson's timezone package (marked TZ), -.\"O and those given in glibc (marked GNU), except that -.\"O .B %+ -.\"O is not supported in glibc2. -.\"O On the other hand glibc2 has several more extensions. -.\"O POSIX.1 only refers to ANSI C; POSIX.2 describes under -.\"O .BR date (1) -.\"O several extensions that could apply to -.\"O .BR strftime () -.\"O as well. -個々の変換が厳密にどの規格に含まれるかは、 -ANSI C (印なし)、統一 UNIX 規格 (SU印)、Olson の timezone パッケージ (TZ印)、 -glibc 独自 (GNU印) で示している。glibc2 では -.B %+ -はサポートされていないが、 -いくつかの拡張が行われている。POSIX.1 では ANSI C のみを参照している。 -POSIX.2 の -.BR date (1) -のところに記述されている幾つかの拡張は -.BR strftime () -にも適用できるだろう。 -.\"O The -.\"O .B %F -.\"O conversion is in C99 and POSIX.1-2001. -.B %F -変換は C99 と POSIX.1-2001 にある。 +SVr4, C89, C99. 個々の変換が厳密にどの規格に含まれるかは、 ANSI C (印なし)、統一 UNIX 規格 (SU印)、Olson の +timezone パッケージ (TZ印)、 glibc 独自 (GNU印) で示している。glibc2 では \fB%+\fP はサポートされていないが、 +いくつかの拡張が行われている。POSIX.1 では ANSI C のみを参照している。 POSIX.2 の \fBdate\fP(1) +のところに記述されている幾つかの拡張は \fBstrftime\fP() にも適用できるだろう。 \fB%F\fP 変換は C99 と POSIX.1\-2001 +にある。 -.\"O In SUSv2, the -.\"O .B %S -.\"O specifier allowed a range of 00 to 61, -.\"O to allow for the theoretical possibility of a minute that -.\"O included a double leap second -.\"O (there never has been such a minute). -SUSv2 では、 -.B %S -は 00 から 61 の範囲をとると規定されている。 -これは、1分間のうち閏秒が 2つ入る可能性が理論的にはあることを -考慮してのものである (実際には、このような状況はこれまで一度も -起こっていない)。 -.\"O .SH NOTES +SUSv2 では、 \fB%S\fP は 00 から 61 の範囲をとると規定されている。 これは、1分間のうち閏秒が 2つ入る可能性が理論的にはあることを +考慮してのものである (実際には、このような状況はこれまで一度も 起こっていない)。 .SH 注意 -.\"O .SS ISO 8601 Week Dates -.SS ISO\ 8601 の週・曜日表記 (Week Dates) -.\"O .BR %G , -.\"O .BR %g , -.\"O and -.\"O .BR %V -.\"O yield values calculated from the week-based year defined by the -.\"O ISO\ 8601 standard. -.BR %G , -.BR %g , -.BR %V -は、ISO\ 8601 標準により定義された週単位表記の年により -計算される値を出力する。 -.\"O In this system, weeks start on a Monday, and are numbered from 01, -.\"O for the first week, up to 52 or 53, for the last week. -.\"O Week 1 is the first week where four or more days fall within the -.\"O new year (or, synonymously, week 01 is: -.\"O the first week of the year that contains a Thursday; -.\"O or, the week that has 4 January in it). -ISO\ 8601 標準の週単位表記では、週は月曜日から開始され、 -週番号は、年の最初の週が 01 となり、最後の週は 52 か 53 となる。 -週 01 は、新しい年が 4 日以上含まれる最初の週である。 -言い換えると、週 01 は、その年の木曜日を含む最初の週、 -つまり 1 月 4 日を含む週ということである。 -.\"O When three of fewer days of the first calendar week of the new year fall -.\"O within that year, -.\"O then the ISO 8601 week-based system counts those days as part of week 53 -.\"O of the preceding year. -新しい年のカレンダー上の最初の週に新しい年が 3 日以下しか含まれない場合、 -ISO\ 8601 の週単位表記では、これらの日を前の年の週 53 の一部とみなす。 -.\"O For example, 1 January 2010 is a Friday, -.\"O meaning that just three days of that calendar week fall in 2010. -.\"O Thus, the ISO\ 8601 week-based system considers these days to be part of -.\"O week 53 (\fB%V\fP) of the year 2009 (\fB%G\fP) ; -.\"O week 01 of ISO\ 8601 year 2010 starts on Monday, 4 January 2010. -例えば、2010 å¹´ 1 月 1 日は金曜日であり、 -その週には 2010 年の日が 3 日しか含まれない。 -したがって、ISO\ 8601 の週単位表記では、これらの日は 2009 å¹´ (\fB%G\fP) -の週 53 (\fB%V\fP) の一部となる。 -ISO\ 8601 の 2010 年の週 01 は 2010 å¹´ 1 月 4 日の月曜日から始まる。 -.\"O .SS Glibc Notes -.SS glibc での注意 -.\"O Glibc provides some extensions for conversion specifications. -.\"O (These extensions are not specified in POSIX.1-2001, but a few other -.\"O systems provide similar features.) -.\"O .\" HP-UX and Tru64 also have features like this. -.\"O Between the \(aq%\(aq character and the conversion specifier character, -.\"O an optional -.\"O .I flag -.\"O and field -.\"O .I width -.\"O may be specified. -.\"O (These precede the -.\"O .B E -.\"O or -.\"O .B O -.\"O modifiers, if present.) -glibc では変換指定にいくつか拡張を行っている -(これらの拡張は POSIX.1-2001 には規定されていないが、 -他のいくつかのシステムで同様の機能が提供されている)。 -.\" HP-UX と Tru64 にも同様の機能がある。 -\(aq%\(aq 文字と変換指定文字の間に、オプションとして -.I flag -とフィールドの -.I 幅 -を指定できる (これらを指定する場合には -.B E -や -.B O -修飾子の前に置く)。 +.SS "ISO\ 8601 の週・曜日表記 (Week Dates)" +\fB%G\fP, \fB%g\fP, \fB%V\fP は、ISO\ 8601 標準により定義された週単位表記の年により 計算される値を出力する。 ISO\ 8601 +標準の週単位表記では、週は月曜日から開始され、 週番号は、年の最初の週が 01 となり、最後の週は 52 か 53 となる。 週 01 は、新しい年が +4 日以上含まれる最初の週である。 言い換えると、週 01 は、その年の木曜日を含む最初の週、 つまり 1 月 4 日を含む週ということである。 +新しい年のカレンダー上の最初の週に新しい年が 3 日以下しか含まれない場合、 ISO\ 8601 の週単位表記では、これらの日を前の年の週 53 +の一部とみなす。 例えば、2010 å¹´ 1 月 1 日は金曜日であり、 その週には 2010 年の日が 3 日しか含まれない。 したがって、ISO\ 8601 の週単位表記では、これらの日は 2009 å¹´ (\fB%G\fP) の週 53 (\fB%V\fP) の一部となる。 ISO\ 8601 の 2010 +年の週 01 は 2010 å¹´ 1 月 4 日の月曜日から始まる。 +.SS "glibc での注意" +.\" HP-UX and Tru64 also have features like this. +glibc では変換指定にいくつか拡張を行っている (これらの拡張は POSIX.1\-2001 には規定されていないが、 +他のいくつかのシステムで同様の機能が提供されている)。 \(aq%\(aq 文字と変換指定文字の間に、オプションとして \fIflag\fP とフィールドの +\fI幅\fP を指定できる (これらを指定する場合には \fBE\fP や \fBO\fP 修飾子の前に置く)。 -.\"O The following flag characters are permitted: 以下のフラグ文字が使用できる: -.TP -.B _ -.\"O (underscore) -.\"O Pad a numeric result string with spaces. -(下線) -数値の結果文字列のパディング (穴埋め) をスペース (空白文字) で行う。 -.TP -.B \- -.\"O (dash) -.\"O Do not pad a numeric result string. -(ダッシュ) -数値の結果文字列に対するパディングを行わない。 -.TP -.B 0 -.\"O Pad a numeric result string with zeros even if the conversion -.\"O specifier character uses space-padding by default. -変換指定文字がデフォルトではスペースでパディングを行う場合でも、 -数値の結果文字列へのパディングを 0 で行う。 -.TP -.B ^ -.\"O Convert alphabetic characters in result string to upper case. +.TP +\fB_\fP +(下線) 数値の結果文字列のパディング (穴埋め) をスペース (空白文字) で行う。 +.TP +\fB\-\fP +(ダッシュ) 数値の結果文字列に対するパディングを行わない。 +.TP +\fB0\fP +変換指定文字がデフォルトではスペースでパディングを行う場合でも、 数値の結果文字列へのパディングを 0 で行う。 +.TP +\fB^\fP 結果文字列中のアルファベット文字を大文字に変換する。 -.TP -.B # -.\"O Swap the case of the result string. -.\"O (This flag only works with certain conversion specifier characters, -.\"O and of these, it is only really useful with -.\"O .BR %Z .) -結果文字列の大文字・小文字を入れ替える -(このフラグは特定の変換指定文字でしか機能しない。その中でも -本当に有用なのは -.B %Z -の場合だけである)。 +.TP +\fB#\fP +結果文字列の大文字・小文字を入れ替える (このフラグは特定の変換指定文字でしか機能しない。その中でも 本当に有用なのは \fB%Z\fP の場合だけである)。 .PP -.\"O An optional decimal width specifier may follow the (possibly absent) flag. -.\"O If the natural size of the field is smaller than this width, -.\"O then the result string is padded (on the left) to the specified width. -オプションの10進数の幅指定子はフラグの後ろに置くことができる -(フラグはなくてもよい)。フィールドの本来の大きさが指定された幅よりも +オプションの10進数の幅指定子はフラグの後ろに置くことができる (フラグはなくてもよい)。フィールドの本来の大きさが指定された幅よりも 小さい場合、結果文字列の左側は指定された幅までパディングされる。 -.\"O .SH BUGS .SH バグ -.\"O Some buggy versions of -.\"O .BR gcc (1) -.\"O complain about the use of -.\"O .BR %c : -.\"O .IR "warning: `%c' yields only last 2 digits of year in some locales" . -.BR gcc (1) -のいくつかのバージョンにはおかしなところがあり、 -.B %c -の使用法について以下のような警告を出す: -.I "warning: `%c' yields only last 2 digits of year in some locales" -.RI ( 警告: いくつかのロケールでは `%c' は年の下2桁しか出力しない )。 -.\"O Of course programmers are encouraged to use -.\"O .BR %c , -.\"O it gives the preferred date and time representation. -.\"O One meets all kinds of strange obfuscations -.\"O to circumvent this -.\"O .BR gcc (1) -.\"O problem. -.\"O A relatively clean one is to add an -.\"O intermediate function -もちろんプログラマが -.B %c -を使うのはお薦めできることである。 -.B %c -を使うと適切な日付と時刻の表記を得ることができるからである。 -.BR gcc (1) -のこの問題を回避しようとすると、何かすっきりしない気分になるだろう。 -比較的きれいな解決方法は以下のような中間関数を追加することである。 +\fBgcc\fP(1) のいくつかのバージョンにはおかしなところがあり、 \fB%c\fP の使用法について以下のような警告を出す: \fIwarning: +`%c' yields only last 2 digits of year in some locales\fP +(\fI警告:\fPいくつかのロケールでは\fI`%c'\fPは年の下2桁しか出力しない\fI)。\fP もちろんプログラマが \fB%c\fP +を使うのはお薦めできることである。 \fB%c\fP を使うと適切な日付と時刻の表記を得ることができるからである。 \fBgcc\fP(1) +のこの問題を回避しようとすると、何かすっきりしない気分になるだろう。 比較的きれいな解決方法は以下のような中間関数を追加することである。 .in +4n .nf @@ -725,59 +279,35 @@ my_strftime(char *s, size_t max, const char *fmt, } .fi .in -.RE -.\"O Nowadays, -.\"O .BR gcc (1) -.\"O provides the \fI\-Wno\-format\-y2k\fP option to prevent the warning, -.\"O so that the above workaround is no longer required. -現在では、 -.BR gcc (1) -はこの警告を抑えるための \fI\-Wno\-format\-y2k\fP オプションを +現在では、 \fBgcc\fP(1) はこの警告を抑えるための \fI\-Wno\-format\-y2k\fP オプションを 提供しており、上記の回避策はもはや必要ない。 -.\"O .SH EXAMPLES .SH 例 -.\"O .BR "RFC\ 2822-compliant date format" -.\"O (with an English locale for %a and %b) -.B "RFC\ 2822 準拠の日付形式" -(%a と %b は英語ロケール) +\fBRFC\ 2822 準拠の日付形式\fP (%a と %b は英語ロケール) .PP .in +2n "%a,\ %d\ %b\ %Y\ %T\ %z" .PP -.\"O .BR "RFC\ 822-compliant date format" -.\"O (with an English locale for %a and %b) -.B "RFC\ 822 準拠の日付形式" -(%a と %b は英語ロケール) +\fBRFC\ 822 準拠の日付形式\fP (%a と %b は英語ロケール) .PP .in +2n "%a,\ %d\ %b\ %y\ %T\ %z" -.\"O .SS Example Program .SS サンプルプログラム -.\"O The program below can be used to experiment with -.\"O .BR strftime (). -以下のプログラムを使うと -.BR strftime () -の実験ができる。 +以下のプログラムを使うと \fBstrftime\fP() の実験ができる。 .PP -.\"O Some examples of the result string produced by the glibc implementation of -.\"O .BR strftime () -.\"O are as follows: -以下に、 -.BR strftime () -の glibc 実装が生成する結果の例をいくつか示す: +以下に、 \fBstrftime\fP() の glibc 実装が生成する結果の例をいくつか示す: +.in +4n .nf -.RB "$" " ./a.out \(aq%m\(aq" +$\fB ./a.out \(aq%m\(aq\fP Result string is "11" -.RB "$" " ./a.out \(aq%5m\(aq" +$\fB ./a.out \(aq%5m\(aq\fP Result string is "00011" -.RB "$" " ./a.out \(aq%_5m\(aq" +$\fB ./a.out \(aq%_5m\(aq\fP Result string is " 11" .fi .in .PP -.\"O Here's the program source: プログラムのソースは以下の通り: .nf @@ -789,22 +319,6 @@ int main(int argc, char *argv[]) { char outstr[200]; -.PP -.\"O Some examples of the result string produced by the glibc implementation of -.\"O .BR strftime () -.\"O are as follows: -以下に、 -.BR strftime () -の glibc 実装が生成する結果の例をいくつか示す: -.nf - -$ ./a.out "%m" -Result string is "11" -$ ./a.out "%5m" -Result string is "00011" -$ ./a.out "%_5m" -Result string is " 11" -.fi time_t t; struct tm *tmp; @@ -820,15 +334,10 @@ Result string is " 11" exit(EXIT_FAILURE); } - printf("Result string is \\"%s\\"\\n", outstr); + printf("Result string is \e"%s\e"\en", outstr); exit(EXIT_SUCCESS); } .fi -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR date (1), -.BR time (2), -.BR ctime (3), -.BR setlocale (3), -.BR sprintf (3), -.BR strptime (3) +\fBdate\fP(1), \fBtime\fP(2), \fBctime\fP(3), \fBsetlocale\fP(3), \fBsprintf\fP(3), +\fBstrptime\fP(3) diff --git a/draft/man3/string.3 b/draft/man3/string.3 index 20c59dc9..5a8e1215 100644 --- a/draft/man3/string.3 +++ b/draft/man3/string.3 @@ -25,106 +25,75 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sun Jul 25 10:54:31 1993, Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi -.\" all rights reserved. -.\" Translated Mon Jan 20 18:57:06 JST 1997 -.\" by YOSHINO Takashi +.\" This file was generated with po4a. Translate the source file. .\" -.TH STRING 3 2010-02-25 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH STRING 3 2010\-02\-25 "" "Linux Programmer's Manual" .SH 名前 stpcpy, strcasecmp, strcat, strchr, strcmp, strcoll, strcpy, strcspn, strdup, strfry, strlen, strncat, strncmp, strncpy, strncasecmp, strpbrk, -strrchr, strsep, strspn, strstr, strtok, strxfrm, index, rindex -.\"O \- string operations -\- 文字列を操作する関数 -.\"O .SH SYNOPSIS +strrchr, strsep, strspn, strstr, strtok, strxfrm, index, rindex \- 文字列を操作する関数 .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int strcasecmp(const char *" s1 ", const char *" s2 ); +\fBint strcasecmp(const char *\fP\fIs1\fP\fB, const char *\fP\fIs2\fP\fB);\fP .sp -.BI "int strncasecmp(const char *" s1 ", const char *" s2 ", size_t " n ); +\fBint strncasecmp(const char *\fP\fIs1\fP\fB, const char *\fP\fIs2\fP\fB, size_t \fP\fIn\fP\fB);\fP .sp -.BI "char *index(const char *" s ", int " c ); +\fBchar *index(const char *\fP\fIs\fP\fB, int \fP\fIc\fP\fB);\fP .sp -.BI "char *rindex(const char *" s ", int " c ); +\fBchar *rindex(const char *\fP\fIs\fP\fB, int \fP\fIc\fP\fB);\fP .sp -.B #include +\fB#include \fP .sp -.BI "char *stpcpy(char *" dest ", const char *" src ); +\fBchar *stpcpy(char *\fP\fIdest\fP\fB, const char *\fP\fIsrc\fP\fB);\fP .sp -.BI "char *strcat(char *" dest ", const char *" src ); +\fBchar *strcat(char *\fP\fIdest\fP\fB, const char *\fP\fIsrc\fP\fB);\fP .sp -.BI "char *strchr(const char *" s ", int " c ); +\fBchar *strchr(const char *\fP\fIs\fP\fB, int \fP\fIc\fP\fB);\fP .sp -.BI "int strcmp(const char *" s1 ", const char *" s2 ); +\fBint strcmp(const char *\fP\fIs1\fP\fB, const char *\fP\fIs2\fP\fB);\fP .sp -.BI "int strcoll(const char *" s1 ", const char *" s2 ); +\fBint strcoll(const char *\fP\fIs1\fP\fB, const char *\fP\fIs2\fP\fB);\fP .sp -.BI "char *strcpy(char *" dest ", const char *" src ); +\fBchar *strcpy(char *\fP\fIdest\fP\fB, const char *\fP\fIsrc\fP\fB);\fP .sp -.BI "size_t strcspn(const char *" s ", const char *" reject ); +\fBsize_t strcspn(const char *\fP\fIs\fP\fB, const char *\fP\fIreject\fP\fB);\fP .sp -.BI "char *strdup(const char *" s ); +\fBchar *strdup(const char *\fP\fIs\fP\fB);\fP .sp -.BI "char *strfry(char *" string ); +\fBchar *strfry(char *\fP\fIstring\fP\fB);\fP .sp -.BI "size_t strlen(const char *" s ); +\fBsize_t strlen(const char *\fP\fIs\fP\fB);\fP .sp -.BI "char *strncat(char *" dest ", const char *" src ", size_t " n ); +\fBchar *strncat(char *\fP\fIdest\fP\fB, const char *\fP\fIsrc\fP\fB, size_t \fP\fIn\fP\fB);\fP .sp -.BI "int strncmp(const char *" s1 ", const char *" s2 ", size_t " n ); +\fBint strncmp(const char *\fP\fIs1\fP\fB, const char *\fP\fIs2\fP\fB, size_t \fP\fIn\fP\fB);\fP .sp -.BI "char *strncpy(char *" dest ", const char *" src ", size_t " n ); +\fBchar *strncpy(char *\fP\fIdest\fP\fB, const char *\fP\fIsrc\fP\fB, size_t \fP\fIn\fP\fB);\fP .sp -.BI "char *strpbrk(const char *" s ", const char *" accept ); +\fBchar *strpbrk(const char *\fP\fIs\fP\fB, const char *\fP\fIaccept\fP\fB);\fP .sp -.BI "char *strrchr(const char *" s ", int " c ); +\fBchar *strrchr(const char *\fP\fIs\fP\fB, int \fP\fIc\fP\fB);\fP .sp -.BI "char *strsep(char **" stringp ", const char *" delim ); +\fBchar *strsep(char **\fP\fIstringp\fP\fB, const char *\fP\fIdelim\fP\fB);\fP .sp -.BI "size_t strspn(const char *" s ", const char *" accept ); +\fBsize_t strspn(const char *\fP\fIs\fP\fB, const char *\fP\fIaccept\fP\fB);\fP .sp -.BI "char *strstr(const char *" haystack ", const char *" needle ); +\fBchar *strstr(const char *\fP\fIhaystack\fP\fB, const char *\fP\fIneedle\fP\fB);\fP .sp -.BI "char *strtok(char *" s ", const char *" delim ); +\fBchar *strtok(char *\fP\fIs\fP\fB, const char *\fP\fIdelim\fP\fB);\fP .sp -.BI "size_t strxfrm(char *" dest ", const char *" src ", size_t " n ); +\fBsize_t strxfrm(char *\fP\fIdest\fP\fB, const char *\fP\fIsrc\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The string functions perform string operations on null-terminated -.\"O strings. -文字列関数は、NULL 終端された文字列に -対して、文字列操作を実行する。 -.\"O See the individual man pages for descriptions of each function. -それぞれの関数の説明については個々のmanページを見よ。 -.\"O .SH "SEE ALSO" +文字列関数は、NULL 終端された文字列に 対して、文字列操作を実行する。 それぞれの関数の説明については個々のmanページを見よ。 .SH 関連項目 -.BR index (3), -.BR rindex (3), -.BR stpcpy (3), -.BR strcasecmp (3), -.BR strcat (3), -.BR strchr (3), -.BR strcmp (3), -.BR strcoll (3), -.BR strcpy (3), -.BR strcspn (3), -.BR strdup (3), -.BR strfry (3), -.BR strlen (3), -.BR strncasecmp (3), -.BR strncat (3), -.BR strncmp (3), -.BR strncpy (3), -.BR strpbrk (3), -.BR strrchr (3), -.BR strsep (3), -.BR strspn (3), -.BR strstr (3), -.BR strtok (3), -.BR strxfrm (3) +\fBindex\fP(3), \fBrindex\fP(3), \fBstpcpy\fP(3), \fBstrcasecmp\fP(3), \fBstrcat\fP(3), +\fBstrchr\fP(3), \fBstrcmp\fP(3), \fBstrcoll\fP(3), \fBstrcpy\fP(3), \fBstrcspn\fP(3), +\fBstrdup\fP(3), \fBstrfry\fP(3), \fBstrlen\fP(3), \fBstrncasecmp\fP(3), \fBstrncat\fP(3), +\fBstrncmp\fP(3), \fBstrncpy\fP(3), \fBstrpbrk\fP(3), \fBstrrchr\fP(3), \fBstrsep\fP(3), +\fBstrspn\fP(3), \fBstrstr\fP(3), \fBstrtok\fP(3), \fBstrxfrm\fP(3) diff --git a/draft/man3/strlen.3 b/draft/man3/strlen.3 index 96d79b16..4ce57f97 100644 --- a/draft/man3/strlen.3 +++ b/draft/man3/strlen.3 @@ -25,36 +25,25 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 18:02:26 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi -.\" all rights reserved. -.\" Translated Mon Jan 20 18:51:38 JST 1997 -.\" by YOSHINO Takashi +.\" This file was generated with po4a. Translate the source file. .\" -.TH STRLEN 3 2011-09-28 "GNU" "Linux Programmer's Manual" +.\"******************************************************************* +.TH STRLEN 3 2011\-09\-28 GNU "Linux Programmer's Manual" .SH 名前 strlen \- 文字列の長さを計算する .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "size_t strlen(const char *" s ); +\fBsize_t strlen(const char *\fP\fIs\fP\fB);\fP .fi .SH 説明 -.\"O The -.\"O .BR strlen () -.\"O function calculates the length of the string -.\"O \fIs\fP, excluding the terminating null byte (\(aq\\0\(aq). -.BR strlen () -関数は文字列 \fIs\fP の長さを計算する。 -このとき、終端 NULL バイト (\(aq\\0\(aq) は計算に含まれない。 +\fBstrlen\fP() 関数は文字列 \fIs\fP の長さを計算する。 このとき、終端 NULL バイト (\(aq\e0\(aq) は計算に含まれない。 .SH 返り値 -.BR strlen () -関数は \fIs\fP の中の文字数を返す。 +\fBstrlen\fP() 関数は \fIs\fP の中の文字数を返す。 .SH 準拠 SVr4, 4.3BSD, C89, C99. .SH 関連項目 -.BR string (3), -.BR strnlen (3), -.BR wcslen (3), -.BR wcsnlen (3) +\fBstring\fP(3), \fBstrnlen\fP(3), \fBwcslen\fP(3), \fBwcsnlen\fP(3) diff --git a/draft/man3/strnlen.3 b/draft/man3/strnlen.3 index 084a93f7..0a10c797 100644 --- a/draft/man3/strnlen.3 +++ b/draft/man3/strnlen.3 @@ -8,81 +8,46 @@ .\" References consulted: .\" GNU glibc-2 source code and manual .\" -.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Tue Jan 11 00:55:48 JST 2000 -.\" by HANATAKA Shinya +.\"******************************************************************* .\" -.TH STRNLEN 3 2011-09-28 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH STRNLEN 3 2011\-09\-28 GNU "Linux Programmer's Manual" .SH 名前 -.\"O strnlen \- determine the length of a fixed-size string strnlen \- 固定長の文字列の長さを調べる -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "size_t strnlen(const char *" s ", size_t " maxlen ); +\fBsize_t strnlen(const char *\fP\fIs\fP\fB, size_t \fP\fImaxlen\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR strnlen (): +\fBstrnlen\fP(): .PD 0 .ad l .RS 4 -.TP 4 -.\"O Since glibc 2.10: +.TP 4 glibc 2.10 以降: _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L -.TP -.\"O Before glibc 2.10: +.TP glibc 2.10 より前: _GNU_SOURCE .RE .ad .PD -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR strnlen () -.\"O function returns the number of characters in the string -.\"O- pointed to by \fIs\fP, not including the terminating \(aq\\0\(aq character, -.\"O+ pointed to by \fIs\fP, excluding the terminating null bye (\(aq\\0\(aq), -.\"O but at most \fImaxlen\fP. -.\"O In doing this, -.\"O .BR strnlen () -.\"O looks only at the first -.\"O \fImaxlen\fP characters at \fIs\fP and never beyond \fIs+maxlen\fP. -.BR strnlen () -関数は \fIs\fP が指す文字列の長さをバイト数で返す。 -長さには終端の NULL バイト (\(aq\\0\(aq) は含まない。 -また長さは最大で \fImaxlen\fP までであり、 -.BR strnlen () -は \fIs\fP の最初の \fImaxlen\fP バイトのみを検査し -\fIs+maxlen\fP より先を検査することはない。 -.\"O .SH "RETURN VALUE" +\fBstrnlen\fP() 関数は \fIs\fP が指す文字列の長さをバイト数で返す。 長さには終端の NULL バイト (\(aq\e0\(aq) +は含まない。 また長さは最大で \fImaxlen\fP までであり、 \fBstrnlen\fP() は \fIs\fP の最初の \fImaxlen\fP +バイトのみを検査し \fIs+maxlen\fP より先を検査することはない。 .SH 返り値 -.\"O The -.\"O .BR strnlen () -.\"O function returns \fIstrlen(s)\fP, if that is less than -.\"O \fImaxlen\fP, or \fImaxlen\fP -.\"O if there is no null byte (\(aq\\0\(aq) among the first -.\"O \fImaxlen\fP characters pointed to by \fIs\fP. -.BR strnlen () -関数は \fImaxlen\fP 以下ならば \fIstrlen(s)\fP と同じ -値を返す。\fIs\fP の指す文字列が最大 \fImaxlen\fP バイトまでに -NULL バイト (\(aq\\0\(aq) 文字を含まない場合には \fImaxlen\fP を返す。 -.\"O .SH "CONFORMING TO" +\fBstrnlen\fP() 関数は \fImaxlen\fP 以下ならば \fIstrlen(s)\fP と同じ 値を返す。\fIs\fP の指す文字列が最大 +\fImaxlen\fP バイトまでに NULL バイト (\(aq\e0\(aq) 文字を含まない場合には \fImaxlen\fP を返す。 .SH 準拠 -POSIX.1-2008. -.\"O .SH "SEE ALSO" +POSIX.1\-2008. .SH 関連項目 -.BR strlen (3) +\fBstrlen\fP(3) diff --git a/draft/man3/strpbrk.3 b/draft/man3/strpbrk.3 index 48e3d201..b446093b 100644 --- a/draft/man3/strpbrk.3 +++ b/draft/man3/strpbrk.3 @@ -25,59 +25,27 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 18:01:24 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanease Version Copyright (c) 1998 Ito Hiromi -.\" all rights reserved. -.\" Translated Wed May 27 22:13:35 JST 1998 -.\" by Ito Hiromi (hiromi@marimo.or.jp) -.\" Updated Sat Dec 11 00:44:56 JST 1999 -.\" by Kentaro Shirakata -.TH STRPBRK 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH STRPBRK 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O strpbrk \- search a string for any of a set of characters strpbrk \- 文字セット中の文字を文字列から検出する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "char *strpbrk(const char *" s ", const char *" accept ); +\fBchar *strpbrk(const char *\fP\fIs\fP\fB, const char *\fP\fIaccept\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR strpbrk () -.\"O function locates the first occurrence in the -.\"O string \fIs\fP of any of the characters in the string \fIaccept\fP. -.BR strpbrk () -関数は文字列 \fIaccept\fP に含まれる文字が文字列 \fIs\fP に -おいて最初に現れる位置を捜し出す。 -.\"O .SH "RETURN VALUE" +\fBstrpbrk\fP() 関数は文字列 \fIaccept\fP に含まれる文字が文字列 \fIs\fP に おいて最初に現れる位置を捜し出す。 .SH 返り値 -.\"O The -.\"O .BR strpbrk () -.\"O function returns a pointer to the character in -.\"O \fIs\fP that matches one of the characters in \fIaccept\fP. -.\"O \fIs\fP that matches one of the characters in \fIaccept\fP, or NULL -.\"O if no such character is found. -.BR strpbrk () -関数は、 \fIs\fP に含まれる文字のうち、 -\fIaccept\fP に含まれる文字のどれかに一致したものへの -ポインタを返す。 +\fBstrpbrk\fP() 関数は、 \fIs\fP に含まれる文字のうち、 \fIaccept\fP に含まれる文字のどれかに一致したものへの ポインタを返す。 そのような文字が見つからなかった場合は NULL を返す。 -.\"O .SH "CONFORMING TO" .SH 準拠 SVr4, 4.3BSD, C89, C99. -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR index (3), -.BR memchr (3), -.BR rindex (3), -.BR strchr (3), -.BR string (3), -.BR strsep (3), -.BR strspn (3), -.BR strstr (3), -.BR strtok (3), -.BR wcspbrk (3) +\fBindex\fP(3), \fBmemchr\fP(3), \fBrindex\fP(3), \fBstrchr\fP(3), \fBstring\fP(3), +\fBstrsep\fP(3), \fBstrspn\fP(3), \fBstrstr\fP(3), \fBstrtok\fP(3), \fBwcspbrk\fP(3) diff --git a/draft/man3/strptime.3 b/draft/man3/strptime.3 index 39760f23..8cfb4dcf 100644 --- a/draft/man3/strptime.3 +++ b/draft/man3/strptime.3 @@ -26,397 +26,175 @@ .\" Modified, aeb, 2001-08-31 .\" Modified, wharms 2001-11-12, remark on white space and example .\" -.\" Japanese Version Copyright (c) 1998 SHOJI Yasushi all rights reserved. -.\" Translated Fri Jun 26 1998 by SHOJI Yasushi -.\" Updated & Modefied Sun Mar 7 1999 by Shouichi Saito -.\" Updated Tue Oct 10 22:29:13 JST 2000 -.\" by Yuichi SATO -.\" Updated Tue Apr 3 20:49:00 JST 2001 -.\" by Yuichi SATO -.\" Updated Thu Oct 11 10:05:36 JST 2001 by Yuichi SATO -.\" Updated Fri Dec 14 16:34:23 JST 2001 by Yuichi SATO -.\" Updated Sat Jan 5 22:17:34 JST 2002 by Yuichi SATO -.\" Updated Wed Jan 14 23:21:57 JST 2002 by Akihiro MOTOKI +.\"******************************************************************* .\" -.\"WORD: modifier 修正子 -.\"WORD: broken-down time 要素別の時刻 +.\" This file was generated with po4a. Translate the source file. .\" -.TH STRPTIME 3 2009-12-05 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH STRPTIME 3 2009\-12\-05 GNU "Linux Programmer's Manual" .SH 名前 -.\"O strptime \- convert a string representation of time to a time tm structure strptime \- 文字列であらわされている時間を tm 構造体の時間に変換する -.\"O .SH SYNOPSIS .SH 書式 -.\"O .BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _XOPEN_SOURCE" " /* feature_test_macros(7) 参照 */" +\fB#define _XOPEN_SOURCE\fP /* feature_test_macros(7) 参照 */ .br -.B #include +\fB#include \fP .sp -.BI "char *strptime(const char *" s ", const char *" format , -.BI "struct tm *" tm ); -.\"O .SH DESCRIPTION +\fBchar *strptime(const char *\fP\fIs\fP\fB, const char *\fP\fIformat\fP\fB,\fP \fBstruct tm +*\fP\fItm\fP\fB);\fP .SH 説明 -.\"O The -.\"O .BR strptime () -.\"O function is the converse function to -.\"O .BR strftime (3) -.\"O and converts the character string pointed to by -.\"O .I s -.\"O to values which are stored in the -.\"O .I tm -.\"O structure pointed to by -.\"O .IR tm , -.\"O using the format specified by -.\"O .IR format . -.BR strptime () -関数は -.BR strftime (3) -の逆関数であり、ポインタ -.I s -が指す文字列を時間に変換する。 -変換の際には -.I format -で指定したフォーマットを用い、値はポインタ -.I tm -が指す -.I tm -構造体に収められる。 -.\"O Here -.\"O .I format -.\"O is a character string that consists of field descriptors and text characters, -.\"O reminiscent of -.\"O .BR scanf (3). -.\"O Each field descriptor consists of a -.\"O .B % -.\"O character followed by another character that specifies the replacement -.\"O for the field descriptor. -.I format -は、 -.BR scanf (3) -で使われているような、 -フィールドディスクリプターとテキスト文字で構成されている文字列である。 -個々のフィールドディスクリプターは -.B % -とそれに続く文字からなり、 -後者にフィールドディスクリプターを置き換える内容を指定する。 -.\"O All other characters in the -.\"O .I format -.\"O string must have a matching character in the input string, -.\"O except for whitespace, which matches zero or more -.\"O whitespace characters in the input string. -.\"O There should be white\%space or other alphanumeric characters -.\"O between any two field descriptors. -.I format -文字列中の他の全ての文字には、入力文字列にマッチする文字がなければならない。 -フォーマット文字列中にある空白は例外であり、 -入力文字列中の 0 個以上の空白とマッチする。 -2 つのフィールドディスクリプターの間には、 -空白・英字・数字がなければならない。 +\fBstrptime\fP() 関数は \fBstrftime\fP(3) の逆関数であり、ポインタ \fIs\fP が指す文字列を時間に変換する。 変換の際には +\fIformat\fP で指定したフォーマットを用い、値はポインタ \fItm\fP が指す \fItm\fP 構造体に収められる。 \fIformat\fP は、 +\fBscanf\fP(3) で使われているような、 フィールドディスクリプターとテキスト文字で構成されている文字列である。 +個々のフィールドディスクリプターは \fB%\fP とそれに続く文字からなり、 後者にフィールドディスクリプターを置き換える内容を指定する。 +\fIformat\fP 文字列中の他の全ての文字には、入力文字列にマッチする文字がなければならない。 フォーマット文字列中にある空白は例外であり、 +入力文字列中の 0 個以上の空白とマッチする。 2 つのフィールドディスクリプターの間には、 空白・英字・数字がなければならない。 .PP -.\"O The -.\"O .BR strptime () -.\"O function processes the input string from left -.\"O to right. -.\"O Each of the three possible input elements (whitespace, -.\"O literal, or format) are handled one after the other. -.\"O If the input cannot be matched to the format string the function stops. -.\"O The remainder of the format and input strings are not processed. -.BR strptime () -関数は、入力文字列を左から右へ処理する。 -入力された 3 つの要素 (空白・文字・フォーマット) は、順に処理される。 -入力がフォーマット文字列とマッチできない場合、関数は停止する。 -残りのフォーマット文字列と入力文字列は処理されない。 +\fBstrptime\fP() 関数は、入力文字列を左から右へ処理する。 入力された 3 つの要素 (空白・文字・フォーマット) は、順に処理される。 +入力がフォーマット文字列とマッチできない場合、関数は停止する。 残りのフォーマット文字列と入力文字列は処理されない。 .PP -.\"O The supported input field descriptors are listed below. -.\"O In case a text string (such as a weekday or month name) -.\"O is to be matched, the comparison is case insensitive. -.\"O In case a number is to be matched, leading zeros are -.\"O permitted but not required. -使用可能なフィールドディスクリプターを以下に挙げる。 -(曜日や月の名前といった) 文字列をマッチさせる場合、 -大文字と小文字は区別せずに比較する。 +使用可能なフィールドディスクリプターを以下に挙げる。 (曜日や月の名前といった) 文字列をマッチさせる場合、 大文字と小文字は区別せずに比較する。 数をマッチさせる場合、前に 0 をつけても構わないが必ずしも必要ではない。 -.TP -.B %% -.\"O The -.\"O .B % -.\"O character. -文字としての -.BR % 。 -.TP -.\"O .BR %a " or " %A -.BR %a " または " %A -.\"O The weekday name according to the current locale, -.\"O in abbreviated form or the full name. +.TP +\fB%%\fP +文字としての \fB%\fP。 +.TP +\fB%a\fP または \fB%A\fP 現在のロケールでの曜日名 (省略名または完全な名前)。 -.TP -.\"O .BR %b " or " %B " or " %h -.BR %b " または " %B " または " %h -.\"O The month name according to the current locale, -.\"O in abbreviated form or the full name. +.TP +\fB%b\fP または \fB%B\fP または \fB%h\fP 現在のロケールでの月名 (省略名または完全な名前)。 -.TP -.B %c -.\"O The date and time representation for the current locale. +.TP +\fB%c\fP 現在のロケールでの日付と時刻の表現。 -.TP -.B %C -.\"O The century number (0-99). -1 世紀中の年 (0-99)。 -.TP -.\"O .BR %d " or " %e -.BR %d " または " %e -.\"O The day of month (1-31). -月内の日付 (1-31)。 -.TP -.B %D -.\"O Equivalent to -.\"O .BR %m/%d/%y . -.\"O (This is the American style date, very confusing -.\"O to non-Americans, especially since -.\"O .B %d/%m/%y -.\"O is widely used in Europe. -.\"O The ISO 8601 standard format is -.\"O .BR %Y-%m-%d .) -日付。 -.B %m/%d/%y -と同じ。 -(これはアメリカ式の日付形式で、 -ヨーロッパでは特に -.B %d/%m/%y -という形式が広く使われているために、 -アメリカ人以外には紛らわしく感じられる。 -ISO 8601 規格では -.B %Y-%m-%d -という形式である。) -.TP -.B %H -.\"O The hour (0-23). -時間 (0-23)。 -.TP -.B %I -.\"O The hour on a 12-hour clock (1-12). -12 時間制での時間 (1-12)。 -.TP -.B %j -.\"O The day number in the year (1-366). -年の初めからの通算の日付 (1-366)。 -.TP -.B %m -.\"O The month number (1-12). -数字表現の月 (1-12)。 -.TP -.B %M -.\"O The minute (0-59). -分 (0-59)。 -.TP -.B %n -.\"O Arbitrary whitespace. +.TP +\fB%C\fP +1 世紀中の年 (0\-99)。 +.TP +\fB%d\fP または \fB%e\fP +月内の日付 (1\-31)。 +.TP +\fB%D\fP +日付。 \fB%m/%d/%y\fP と同じ。 (これはアメリカ式の日付形式で、 ヨーロッパでは特に \fB%d/%m/%y\fP +という形式が広く使われているために、 アメリカ人以外には紛らわしく感じられる。 ISO 8601 規格では \fB%Y\-%m\-%d\fP という形式である。) +.TP +\fB%H\fP +時間 (0\-23)。 +.TP +\fB%I\fP +12 時間制での時間 (1\-12)。 +.TP +\fB%j\fP +年の初めからの通算の日付 (1\-366)。 +.TP +\fB%m\fP +数字表現の月 (1\-12)。 +.TP +\fB%M\fP +分 (0\-59)。 +.TP +\fB%n\fP 任意の空白。 -.TP -.B %p -.\"O The locale's equivalent of AM or PM. -.\"O (Note: there may be none.) -ロケールの AM (午前) と PM (午後) に対応するもの。 -(注意: 対応するものがないかもしれない。) -.TP -.B %r -.\"O The 12-hour clock time (using the locale's AM or PM). -.\"O In the POSIX locale equivalent to -.\"O .BR "%I:%M:%S %p" . -.\"O If \fIt_fmt_ampm\fP is empty in the -.\"O .B LC_TIME -.\"O part of the current locale -.\"O then the behavior is undefined. -(ロケールの AM と PM を使った) 12 時間制の時間。 -POSIX ロケールでは -.B %I:%M:%S %p -と同じ。 -現在のロケールにおいて -.B LC_TIME -パートの -\fIt_fmt_ampm\fP が定義されていない場合、 -動作は未定義である。 -.TP -.B %R -.\"O Equivalent to -.\"O .BR %H:%M . -.B %H:%M -と同じ。 -.TP -.B %S -.\"O The second (0-60; 60 may occur for leap seconds; -.\"O earlier also 61 was allowed). -秒 (0-60; 60 は閏秒を示す。以前は 61 も指定できた)。 -.TP -.B %t -.\"O Arbitrary whitespace. +.TP +\fB%p\fP +ロケールの AM (午前) と PM (午後) に対応するもの。 (注意: 対応するものがないかもしれない。) +.TP +\fB%r\fP +(ロケールの AM と PM を使った) 12 時間制の時間。 POSIX ロケールでは \fB%I:%M:%S %p\fP と同じ。 現在のロケールにおいて +\fBLC_TIME\fP パートの \fIt_fmt_ampm\fP が定義されていない場合、 動作は未定義である。 +.TP +\fB%R\fP +\fB%H:%M\fP と同じ。 +.TP +\fB%S\fP +秒 (0\-60; 60 は閏秒を示す。以前は 61 も指定できた)。 +.TP +\fB%t\fP 任意の空白。 -.TP -.B %T -.\"O Equivalent to -.\"O .BR %H:%M:%S . -.B %H:%M:%S -と同じ。 -.TP -.B %U -.\"O The week number with Sunday the first day of the week (0-53). -.\"O The first Sunday of January is the first day of week 1. -日曜日を週の始まりとした年通算での週数 (0-53)。 -1 月の最初の日曜日を第 1 週目の最初の日する。 -.TP -.B %w -.\"O The weekday number (0-6) with Sunday = 0. -日曜日を 0 とした数字表記の曜日 (0-6)。 -.TP -.B %W -.\"O The week number with Monday the first day of the week (0-53). -.\"O The first Monday of January is the first day of week 1. -月曜日を週の始まりとした年通算での週数 (0-53)。 -1 月の最初の月曜日を第 1 週目の最初の日する。 -.TP -.B %x -.\"O The date, using the locale's date format. +.TP +\fB%T\fP +\fB%H:%M:%S\fP と同じ。 +.TP +\fB%U\fP +日曜日を週の始まりとした年通算での週数 (0\-53)。 1 月の最初の日曜日を第 1 週目の最初の日する。 +.TP +\fB%w\fP +日曜日を 0 とした数字表記の曜日 (0\-6)。 +.TP +\fB%W\fP +月曜日を週の始まりとした年通算での週数 (0\-53)。 1 月の最初の月曜日を第 1 週目の最初の日する。 +.TP +\fB%x\fP 日付。ロケールの日付フォーマットを使う。 -.TP -.B %X -.\"O The time, using the locale's time format. +.TP +\fB%X\fP 時刻。ロケールの時刻フォーマットを使う。 -.TP -.B %y -.\"O The year within century (0-99). -.\"O When a century is not otherwise specified, values in the range 69-99 refer -.\"O to years in the twentieth century (1969-1999); values in the -.\"O range 00-68 refer to years in the twenty-first century (2000-2068). -1 世紀中の年 (0-99)。 -世紀が指定されない場合、 -値が 69-99 の範囲のときは 20 世紀の年 (1969-1999)、 -値が 00-68 の範囲のときは 21 世紀の年 (2000-2068) とする。 -.TP -.B %Y -.\"O The year, including century (for example, 1991). +.TP +\fB%y\fP +1 世紀中の年 (0\-99)。 世紀が指定されない場合、 値が 69\-99 の範囲のときは 20 世紀の年 (1969\-1999)、 値が 00\-68 +の範囲のときは 21 世紀の年 (2000\-2068) とする。 +.TP +\fB%Y\fP 年。世紀の部分を含む (例: 1991)。 .LP -.\"O Some field descriptors can be modified by the E or O modifier characters -.\"O to indicate that an alternative format or specification should be used. -.\"O If the -.\"O alternative format or specification does not exist in the current locale, the -.\"O unmodified field descriptor is used. -E や O という修正子を使うことで変更できるフィールドディスクリプタもある。 -これらの修正子は、別のフォーマットや仕様を使うことを指示する。 -別のフォーマットや仕様が現在のロケールに存在しないときは、 -変更していないフィールドディスクリプタが使われる。 +E や O という修正子を使うことで変更できるフィールドディスクリプタもある。 これらの修正子は、別のフォーマットや仕様を使うことを指示する。 +別のフォーマットや仕様が現在のロケールに存在しないときは、 変更していないフィールドディスクリプタが使われる。 .LP -.\"O The E modifier specifies that the input string may contain -.\"O alternative locale-dependent versions of the date and time representation: -E 修正子は、ロケールに依存した日付と時刻の別の表現形式が -入力文字列に含まれていることを指定する。 -.TP -.B %Ec -.\"O The locale's alternative date and time representation. +E 修正子は、ロケールに依存した日付と時刻の別の表現形式が 入力文字列に含まれていることを指定する。 +.TP +\fB%Ec\fP 日付と時刻。ロケールに依存した別の表現形式を使う。 -.TP -.B %EC -.\"O The name of the base year (period) in the locale's alternative representation. +.TP +\fB%EC\fP 基準年 (期間) の名前。ロケールに依存した別の表現形式を使う。 -.TP -.B %Ex -.\"O The locale's alternative date representation. +.TP +\fB%Ex\fP 日付。ロケールに依存した別の表現形式を使う。 -.TP -.B %EX -.\"O The locale's alternative time representation. +.TP +\fB%EX\fP 時刻。ロケールに依存した別の表現形式を使う。 -.TP -.B %Ey -.\"O The offset from -.\"O .B %EC -.\"O (year only) in the locale's alternative representation. -.B %EC -(年のみ) からのオフセット。ロケールに依存した別の表現形式を使う。 -.TP -.B %EY -.\"O The full alternative year representation. +.TP +\fB%Ey\fP +\fB%EC\fP (年のみ) からのオフセット。ロケールに依存した別の表現形式を使う。 +.TP +\fB%EY\fP 完全な形式の年。別の表現型式を使う。 .LP -.\"O The O modifier specifies that the numerical input may be in an -.\"O alternative locale-dependent format: -O 修正子は、ロケールに依存した別のフォーマットの中に -数値の入力があることを指定する。 -.TP -.\"O .BR %Od " or " %Oe -.BR %Od " または " %Oe -.\"O The day of the month using the locale's alternative numeric symbols; -.\"O leading zeros are permitted but not required. -月の初めからの通算の日付。ロケールに依存した別の数値シンボルを使う。 -0 を頭につけてもよいが、必須ではない。 -.TP -.B %OH -.\"O The hour (24-hour clock) using the locale's alternative numeric symbols. +O 修正子は、ロケールに依存した別のフォーマットの中に 数値の入力があることを指定する。 +.TP +\fB%Od\fP または \fB%Oe\fP +月の初めからの通算の日付。ロケールに依存した別の数値シンボルを使う。 0 を頭につけてもよいが、必須ではない。 +.TP +\fB%OH\fP 時間 (24 時間制)。ロケールに依存した別の数値シンボルを使う。 -.TP -.B %OI -.\"O The hour (12-hour clock) using the locale's alternative numeric symbols. +.TP +\fB%OI\fP 時間 (12 時間制)。ロケールに依存した別の数値シンボルを使う。 -.TP -.B %Om -.\"O The month using the locale's alternative numeric symbols. +.TP +\fB%Om\fP 月。ロケールに依存した別の数値シンボルを使う。 -.TP -.B %OM -.\"O The minutes using the locale's alternative numeric symbols. +.TP +\fB%OM\fP 分。ロケールに依存した別の数値シンボルを使う。 -.TP -.B %OS -.\"O The seconds using the locale's alternative numeric symbols. +.TP +\fB%OS\fP 秒。ロケールに依存した別の数値シンボルを使う。 -.TP -.B %OU -.\"O The week number of the year (Sunday as the first day of the week) -.\"O using the locale's alternative numeric symbols. -年の初めからの通算の週数 (日曜日を週の始めとする)。 -ロケールに依存した別の数値シンボルを使う。 -.TP -.B %Ow -.\"O The number of the weekday (Sunday=0) using the locale's alternative -.\"O numeric symbols. -数値表記の曜日 (日曜日を 0 とする)。 -ロケールに依存した別の数値シンボルを使う。 -.TP -.B %OW -.\"O The week number of the year (Monday as the first day of the week) -.\"O using the locale's alternative numeric symbols. -年の初めからの通算の週数 (月曜日を週の始めとする)。 -ロケールに依存した別の数値シンボルを使う。 -.TP -.B %Oy -.\"O The year (offset from %C) using the locale's alternative numeric symbols. -.\"O The year (offset from -.\"O .BR %C ) -.\"O using the locale's alternative numeric symbols. -å¹´ -.RB ( %C -からのオフセット)。ロケールに依存した別の数値シンボルを使う。 +.TP +\fB%OU\fP +年の初めからの通算の週数 (日曜日を週の始めとする)。 ロケールに依存した別の数値シンボルを使う。 +.TP +\fB%Ow\fP +数値表記の曜日 (日曜日を 0 とする)。 ロケールに依存した別の数値シンボルを使う。 +.TP +\fB%OW\fP +年の初めからの通算の週数 (月曜日を週の始めとする)。 ロケールに依存した別の数値シンボルを使う。 +.TP +\fB%Oy\fP +å¹´ (\fB%C\fP からのオフセット)。ロケールに依存した別の数値シンボルを使う。 .LP -.\"O The broken-down time structure \fItm\fP is defined in \fI\fP -.\"O as follows: -要素別の時刻構造体 \fItm\fP は -\fI\fP 内で以下の様に定義されている。 +要素別の時刻構造体 \fItm\fP は \fI\fP 内で以下の様に定義されている。 .sp .in +4n .nf -.\"O struct tm { -.\"O int tm_sec; /* seconds */ -.\"O int tm_min; /* minutes */ -.\"O int tm_hour; /* hours */ -.\"O int tm_mday; /* day of the month */ -.\"O int tm_mon; /* month */ -.\"O int tm_year; /* year */ -.\"O int tm_wday; /* day of the week */ -.\"O int tm_yday; /* day in the year */ -.\"O int tm_isdst; /* daylight saving time */ -.\"O }; struct tm { int tm_sec; /* 秒 */ int tm_min; /* 分 */ @@ -430,202 +208,67 @@ struct tm { }; .fi .in -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O The return value of the function is a pointer to the first character -.\"O not processed in this function call. -.\"O In case the input string -.\"O contains more characters than required by the format string the return -.\"O value points right after the last consumed input character. -.\"O In case -.\"O the whole input string is consumed the return value points to the null -.\"O byte at the end of the string. -.\"O If -.\"O .BR strptime () -.\"O fails to match all -.\"O of the format string and therefore an error occurred the function -.\"O returns NULL. -この関数の返り値は、関数の中で処理されなかった最初の文字へのポインタである。 -フォーマット文字列が必要する以上の文字が入力文字列に含まれている場合、 -返り値は最後に処理された入力文字の次の文字を指す。 -すべての入力文字列が処理された場合、 -返り値は文字列末尾の NULL バイトを指す。 -.BR strptime () -がフォーマット文字列のすべての比較に失敗し、 -エラーが起こった場合、関数は NULL ポインタを返す。 -.\"O .SH "CONFORMING TO" +この関数の返り値は、関数の中で処理されなかった最初の文字へのポインタである。 フォーマット文字列が必要する以上の文字が入力文字列に含まれている場合、 +返り値は最後に処理された入力文字の次の文字を指す。 すべての入力文字列が処理された場合、 返り値は文字列末尾の NULL バイトを指す。 +\fBstrptime\fP() がフォーマット文字列のすべての比較に失敗し、 エラーが起こった場合、関数は NULL ポインタを返す。 .SH 準拠 -SUSv2, POSIX.1-2001. -.\"O .SH NOTES +SUSv2, POSIX.1\-2001. .SH 注意 .LP -.\"O In principle, this function does not initialize \fItm\fP but -.\"O only stores the values specified. -.\"O This means that \fItm\fP should be initialized before the call. -.\"O Details differ a bit between different UNIX systems. -.\"O The glibc implementation does not touch those fields which are not -.\"O explicitly specified, except that it recomputes the -.\"O .I tm_wday -.\"O and -.\"O .I tm_yday -.\"O field if any of the year, month, or day elements changed. -原則として、この関数は \fItm\fP の初期化はせずに、 -指定された値のみを入れる。 -つまり、この関数の呼び出しの前に \fItm\fP を初期化しなければならない。 -他の UNIX システムとは、細かい点で異なる。 -glibc の実装では、明示的に指定されないフィールドは変更されない。 -例外として、年・月・日のいずれかの要素が変更された場合に -.I tm_wday -と -.I tm_yday -が再計算される。 +原則として、この関数は \fItm\fP の初期化はせずに、 指定された値のみを入れる。 つまり、この関数の呼び出しの前に \fItm\fP +を初期化しなければならない。 他の UNIX システムとは、細かい点で異なる。 glibc の実装では、明示的に指定されないフィールドは変更されない。 +例外として、年・月・日のいずれかの要素が変更された場合に \fItm_wday\fP と \fItm_yday\fP が再計算される。 .PP -.\"O This function is available since libc 4.6.8. -.\"O Linux libc4 and libc5 includes define the prototype unconditionally; -.\"O glibc2 includes provide a prototype only when -.\"O .B _XOPEN_SOURCE -.\"O or -.\"O .B _GNU_SOURCE -.\"O are defined. -この関数は、libc 4.6.8 以降で使用できる。 -Linux の libc4 と libc5 のインクルードファイルは、 -この関数のプロトタイプを常に定義する。 -glibc2 のインクルードファイルは、 -.B _XOPEN_SOURCE -または -.B _GNU_SOURCE -が定義された場合のみ、 -この関数のプロトタイプを提供する。 +この関数は、libc 4.6.8 以降で使用できる。 Linux の libc4 と libc5 のインクルードファイルは、 +この関数のプロトタイプを常に定義する。 glibc2 のインクルードファイルは、 \fB_XOPEN_SOURCE\fP または \fB_GNU_SOURCE\fP +が定義された場合のみ、 この関数のプロトタイプを提供する。 .PP -.\"O Before libc 5.4.13 whitespace -.\"O (and the \(aqn\(aq and \(aqt\(aq specifications) was not handled, -.\"O no \(aqE\(aq and \(aqO\(aq locale modifier characters were accepted, -.\"O and the \(aqC\(aq specification was a synonym for the \(aqc\(aq specification. -libc 5.4.13 より前では、空白 (と \(aqn\(aq または \(aqt\(aq 指定) は扱われなかった。 -ロケールの修正子 \(aqE\(aq と \(aqO\(aq は受け付けられなかった。 -また、\(aqC\(aq の指定は \(aqc\(aq の指定と同じ意味で扱われた。 +libc 5.4.13 より前では、空白 (と \(aqn\(aq または \(aqt\(aq 指定) は扱われなかった。 ロケールの修正子 +\(aqE\(aq と \(aqO\(aq は受け付けられなかった。 また、\(aqC\(aq の指定は \(aqc\(aq +の指定と同じ意味で扱われた。 .PP -.\"O The \(aqy\(aq (year in century) specification is taken to specify a year -.\"O in the 20th century by libc4 and libc5. -.\"O It is taken to be a year -.\"O in the range 1950-2049 by glibc 2.0. -.\"O It is taken to be a year in -.\"O 1969-2068 since glibc 2.1. -\(aqy\(aq (1 世紀中の年) の指定は、libc4 と libc5 では 20 世紀の年として解釈される。 -glibc 2.0 では 1950-2049 の範囲として解釈される。 -glibc 2.1 からは 1969-2068 の範囲として解釈される。 -.\"O .\" In libc4 and libc5 the code for %I is broken (fixed in glibc; -.\"O .\" %OI was fixed in glibc 2.2.4). -.\" libc4 と libc5 では %I 用のコードが壊れている (glibc で修正された; -.\" %OI は glibc 2.2.4 で修正された)。 -.\"O .SS Glibc Notes -.SS glibc での注意 -.\"O For reasons of symmetry, glibc tries to support for -.\"O .BR strptime () -.\"O the same format characters as for -.\"O .BR strftime (3). -対象性のために、glibc では -.BR strptime () -に -.BR strftime (3) -と同じフォーマット文字をサポートさせようとしている。 -.\"O In most cases the corresponding fields are parsed, but no field in \fItm\fP -.\"O is changed.) -.\"O This leads to -多くの場合、対応するフィールドが解釈されるが、 -\fItm\fP フィールドは変更されない。 -使用可能なフォーマット文字を以下に示す。 -.TP -.B %F -.\"O Equivalent to \fB%Y-%m-%d\fP, the ISO 8601 date format. -\fB%Y-%m-%d\fP と同じ。ISO 8601 の日付形式。 -.TP -.B %g -.\"O The year corresponding to the ISO week number, but without the century -.\"O (0-99). -ISO 週数に対応した西暦年。世紀は含まず (0-99) の範囲。 -.TP -.B %G -.\"O The year corresponding to the ISO week number. -.\"O (For example, 1991.) +.\" In libc4 and libc5 the code for %I is broken (fixed in glibc; +.\" %OI was fixed in glibc 2.2.4). +\(aqy\(aq (1 世紀中の年) の指定は、libc4 と libc5 では 20 世紀の年として解釈される。 glibc 2.0 では +1950\-2049 の範囲として解釈される。 glibc 2.1 からは 1969\-2068 の範囲として解釈される。 +.SS "glibc での注意" +対象性のために、glibc では \fBstrptime\fP() に \fBstrftime\fP(3) と同じフォーマット文字をサポートさせようとしている。 +多くの場合、対応するフィールドが解釈されるが、 \fItm\fP フィールドは変更されない。 使用可能なフォーマット文字を以下に示す。 +.TP +\fB%F\fP +\fB%Y\-%m\-%d\fP と同じ。ISO 8601 の日付形式。 +.TP +\fB%g\fP +ISO 週数に対応した西暦年。世紀は含まず (0\-99) の範囲。 +.TP +\fB%G\fP ISO 週数に対応した西暦年 (例えば 1991)。 -.TP -.B %u -.\"O The day of the week as a decimal number (1-7, where Monday = 1). -10 進数表記の曜日 (1-7 で月曜日を 1 とする)。 -.TP -.B %V -.\"O The ISO 8601:1988 week number as a decimal number (1-53). -.\"O If the week (starting on Monday) containing 1 January has four or more days -.\"O in the new year, then it is considered week 1. -.\"O Otherwise, it is the last week -.\"O of the previous year, and the next week is week 1. -ISO 8601:1988 形式での年通算の 10 進数表記での週数 (1-53)。 -1 月 1 日を含む (月曜日から始まる) 週に 4 日以上が含まれている場合は、 -その週を第 1 週とする。 -3 日以下しか含まれていない場合は、1 月 1 日を含む週を前年の最終の週として、 -次の週を第 1 週とする。 -.TP -.B %z -.\"O An RFC-822/ISO 8601 standard timezone specification. -RFC-822/ISO 8601 標準タイムゾーンを指定する。 -.TP -.B %Z -.\"O The timezone name. +.TP +\fB%u\fP +10 進数表記の曜日 (1\-7 で月曜日を 1 とする)。 +.TP +\fB%V\fP +ISO 8601:1988 形式での年通算の 10 進数表記での週数 (1\-53)。 1 月 1 日を含む (月曜日から始まる) 週に 4 +日以上が含まれている場合は、 その週を第 1 週とする。 3 日以下しか含まれていない場合は、1 月 1 日を含む週を前年の最終の週として、 次の週を第 +1 週とする。 +.TP +\fB%z\fP +RFC\-822/ISO 8601 標準タイムゾーンを指定する。 +.TP +\fB%Z\fP タイムゾーン名。 .LP -.\"O Similarly, because of GNU extensions to -.\"O .BR strftime (3), -.\"O .B %k -.\"O is accepted as a synonym for -.\"O .BR %H , -.\"O and -.\"O .B %l -.\"O should be accepted -.\"O as a synonym for -.\"O .BR %I , -.\"O and -.\"O .B %P -.\"O is accepted as a synonym for -.\"O .BR %p . -同様に、 -.BR strftime (3) -の GNU 版での拡張に対応するために、 -.B %k -は -.B %H、 -.B %P -は -.B %p -と等価に扱われる。また、 -.B %l -は -.B %I -と等価に扱われるようになるはずである。 - -.\"O Finally -さらに以下も定義されている。 -.TP -.B %s -.\"O The number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). -.\"O Leap seconds are not counted unless leap second support is available. -紀元 (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) からの通算の秒数。 +同様に、 \fBstrftime\fP(3) の GNU 版での拡張に対応するために、 \fB%k\fP は \fB%H、\fP \fB%P\fP は \fB%p\fP +と等価に扱われる。また、 \fB%l\fP は \fB%I\fP と等価に扱われるようになるはずである。 さらに以下も定義されている。 +.TP +\fB%s\fP +紀元 (Epoch; 1970\-01\-01 00:00:00 +0000 (UTC)) からの通算の秒数。 閏秒がサポートされていない限り、閏秒はカウントしない。 .LP -.\"O The glibc implementation does not require whitespace between -.\"O two field descriptors. glibc における実装では、2 つのフィールド間の空白は必要ない。 -.\"O .SH EXAMPLE .SH 例 -.\"O The following example demonstrates the use of -.\"O .BR strptime () -.\"O and -.\"O .BR strftime (3). -以下の例は -.BR strptime () -と -.BR strftime (3) -の使用法を示している。 +以下の例は \fBstrptime\fP() と \fBstrftime\fP(3) の使用法を示している。 .sp .nf #define _XOPEN_SOURCE @@ -647,10 +290,5 @@ main(void) exit(EXIT_SUCCESS); } .fi -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR time (2), -.BR getdate (3), -.BR scanf (3), -.BR setlocale (3), -.BR strftime (3) +\fBtime\fP(2), \fBgetdate\fP(3), \fBscanf\fP(3), \fBsetlocale\fP(3), \fBstrftime\fP(3) diff --git a/draft/man3/strsep.3 b/draft/man3/strsep.3 index 6316a853..812458d3 100644 --- a/draft/man3/strsep.3 +++ b/draft/man3/strsep.3 @@ -28,116 +28,46 @@ .\" Modified Mon Jan 20 12:04:18 1997 by Andries Brouwer (aeb@cwi.nl) .\" Modified Tue Jan 23 20:23:07 2001 by Andries Brouwer (aeb@cwi.nl) .\" -.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka -.\" all rights reserved. -.\" Translated Tue Dec 16 10:06:16 JST 1997 -.\" by HIROFUMI Nishizuka -.\" Updated Tue Apr 10 11:19:58 JST 2001 by Kentaro Shirakata -.\" Updated 2009-02-12 by Kentaro Shirakata +.\"******************************************************************* .\" -.\" WORD: delimiter 区切り文字 +.\" This file was generated with po4a. Translate the source file. .\" -.TH STRSEP 3 2011-09-28 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH STRSEP 3 2011\-09\-28 GNU "Linux Programmer's Manual" .SH 名前 -.\"O strsep \- extract token from string strsep \- 文字列からトークンを取り出す -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "char *strsep(char **" stringp ", const char *" delim ); +\fBchar *strsep(char **\fP\fIstringp\fP\fB, const char *\fP\fIdelim\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR strsep (): -_BSD_SOURCE -.\"O .SH DESCRIPTION +\fBstrsep\fP(): _BSD_SOURCE .SH 説明 -.\"O If \fI*stringp\fP is NULL, the -.\"O .BR strsep () -.\"O function returns NULL -.\"O and does nothing else. -.\"O Otherwise, this function finds the first token -.\"O in the string \fI*stringp\fP, where tokens -.\"O are delimited by symbols in the string \fIdelim\fP. -\fI*stringp\fP が NULL の場合、 -.BR strsep () -関数は何もせずに NULL を返す。 -さもなければ、文字列 \fIstringp\fP を -\fIdelim\fP に含まれる文字で区切った -トークンのうち最初のものを返す。 -.\"O This token is terminated by overwriting the delimiter -.\"O with a null byte (\(aq\\0\(aq) -.\"O and \fI*stringp\fP is updated to point past the token. -トークンは、区切り文字を NULL バイト (\(aq\\0\(aq) で上書きすることで -終端される。 -\fI*stringp\fP は切り出されたトークンの次の位置を示すように更新される。 -.\"O In case no delimiter was found, the token is taken to be -.\"O the entire string \fI*stringp\fP, and \fI*stringp\fP is made NULL. -区切り文字が見つからない場合、\fI*stringp\fP 文字列全体がトークンとして -扱われ、\fI*stringp\fP は NULL となる。 -.\"O .SH "RETURN VALUE" +\fI*stringp\fP が NULL の場合、 \fBstrsep\fP() 関数は何もせずに NULL を返す。 さもなければ、文字列 +\fIstringp\fP を \fIdelim\fP に含まれる文字で区切った トークンのうち最初のものを返す。 トークンは、区切り文字を NULL バイト +(\(aq\e0\(aq) で上書きすることで 終端される。 \fI*stringp\fP は切り出されたトークンの次の位置を示すように更新される。 +区切り文字が見つからない場合、\fI*stringp\fP 文字列全体がトークンとして 扱われ、\fI*stringp\fP は NULL となる。 .SH 返り値 -.\"O The -.\"O .BR strsep () -.\"O function returns a pointer to the token, -.\"O that is, it returns the original value of \fI*stringp\fP. -.BR strsep () -関数は、トークンへのポインタを返す。 -つまり、元の \fI*stringp\fP の値を返す。 -.\"O .SH "CONFORMING TO" +\fBstrsep\fP() 関数は、トークンへのポインタを返す。 つまり、元の \fI*stringp\fP の値を返す。 .SH 準拠 4.4BSD. -.\"O .SH NOTES .SH 注意 -.\"O The -.\"O .BR strsep () -.\"O function was introduced as a replacement for -.\"O .BR strtok (3), -.\"O since the latter cannot handle empty fields. -.BR strsep () -関数は、 -.BR strtok (3) -関数が空のフィールドを -扱えないために、その代替品として導入された。 -.\"O However, -.\"O .BR strtok (3) -.\"O conforms to C89/C99 and hence is more portable. -しかしながら、 -.BR strtok (3) -関数は C89/C99 に準拠しており、より移植性がある。 -.\"O .SH BUGS +\fBstrsep\fP() 関数は、 \fBstrtok\fP(3) 関数が空のフィールドを 扱えないために、その代替品として導入された。 しかしながら、 +\fBstrtok\fP(3) 関数は C89/C99 に準拠しており、より移植性がある。 .SH バグ -.\"O Be cautious when using this function. -.\"O If you do use it, note that: -この関数を使う時は注意すること。 -もし使うなら、以下のことに注意すること。 +この関数を使う時は注意すること。 もし使うなら、以下のことに注意すること。 .IP * 2 -.\"O This function modifies its first argument. この関数は最初の引数を変更する。 .IP * -.\"O This function cannot be used on constant strings. この関数は定数文字列には使えない。 .IP * -.\"O The identity of the delimiting character is lost. -区切り文字が何であったか分からなくなる。 -.\"O .SH "SEE ALSO" +区切り文字自体は失われてしまう。 .SH 関連項目 -.BR index (3), -.BR memchr (3), -.BR rindex (3), -.BR strchr (3), -.BR string (3), -.BR strpbrk (3), -.BR strspn (3), -.BR strstr (3), -.BR strtok (3) +\fBindex\fP(3), \fBmemchr\fP(3), \fBrindex\fP(3), \fBstrchr\fP(3), \fBstring\fP(3), +\fBstrpbrk\fP(3), \fBstrspn\fP(3), \fBstrstr\fP(3), \fBstrtok\fP(3) diff --git a/draft/man3/strsignal.3 b/draft/man3/strsignal.3 index fcaa9727..d5c890ed 100644 --- a/draft/man3/strsignal.3 +++ b/draft/man3/strsignal.3 @@ -25,88 +25,50 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 17:59:03 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka -.\" all rights reserved. -.\" Translated Fri Dec 26 13:13:20 JST 1997 -.\" by HIROFUMI Nishizuka -.\" Modified Thu Dec 8 05:09:52 JST 1999 -.\" by Kentaro Shirakata +.\" This file was generated with po4a. Translate the source file. .\" -.TH STRSIGNAL 3 2010-09-15 "GNU" "Linux Programmer's Manual" +.\"******************************************************************* +.TH STRSIGNAL 3 2010\-09\-15 GNU "Linux Programmer's Manual" .SH 名前 strsignal \- シグナルを説明する文字列を返す .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "char *strsignal(int " sig ); +\fBchar *strsignal(int \fP\fIsig\fP\fB);\fP .sp -.BI "extern const char * const " sys_siglist []; +\fBextern const char * const \fP\fIsys_siglist\fP\fB[];\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR strsignal (): +\fBstrsignal\fP(): .PD 0 .ad l .RS 4 -.TP 4 -.\"O Since glibc 2.10: +.TP 4 glibc 2.10 以降: _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L -.TP -.\"O Before glibc 2.10: +.TP glibc 2.10 より前: _GNU_SOURCE .RE .ad .PD -.\"O .SH DESCRIPTION .SH 説明 -.BR strsignal () -関数は、引数 \fIsig\fP で渡されたシグナル番号を -説明する文字列を返す。 -文字列は、次の -.BR strsignal () -が呼ばれるまでの間だけ使用できる。 +\fBstrsignal\fP() 関数は、引数 \fIsig\fP で渡されたシグナル番号を 説明する文字列を返す。 文字列は、次の +\fBstrsignal\fP() が呼ばれるまでの間だけ使用できる。 .PP -.\"O The array \fIsys_siglist\fP holds the signal description strings -.\"O indexed by signal number. -.\"O The -.\"O .BR strsignal () -.\"O function should be -.\"O used if possible instead of this array. -配列 \fIsys_siglist\fP はシグナルを説明する文字列を保持しており、 -配列へのアクセスにはシグナル番号を添え字として用いる事ができる。 -出来るだけこの配列の代わりに -.BR strsignal () -関数を -使うべきである。 +配列 \fIsys_siglist\fP はシグナルを説明する文字列を保持しており、 配列へのアクセスにはシグナル番号を添え字として用いる事ができる。 +出来るだけこの配列の代わりに \fBstrsignal\fP() 関数を 使うべきである。 .SH 返り値 -.\"O The -.\"O .BR strsignal () -.\"O function returns the appropriate description -.\"O string, or an unknown signal message if the signal number is invalid. -.\"O On some systems (but not on Linux), a NULL pointer may be -.\"O returned instead for an invalid signal number. -.BR strsignal () -関数は、シグナルの適切な説明を返す。 -もしシグナル番号が不正な場合は、未知のシグナル(unknown signal)を示す -メッセージを返す。 -(Linux はそうではないが)不正なシグナル番号に対して、 NULL ポインタを -返すシステムもある。 -.\"O .SH "CONFORMING TO" +\fBstrsignal\fP() 関数は、シグナルの適切な説明を返す。 もしシグナル番号が不正な場合は、未知のシグナル(unknown +signal)を示す メッセージを返す。 (Linux はそうではないが)不正なシグナル番号に対して、 NULL ポインタを 返すシステムもある。 .SH 準拠 -POSIX.1-2008. -.\"O Present on Solaris and the BSDs. -Solaris と BSD 系にも存在する。 +POSIX.1\-2008. Solaris と BSD 系にも存在する。 .SH 関連項目 -.BR psignal (3), -.BR strerror (3) +\fBpsignal\fP(3), \fBstrerror\fP(3) diff --git a/draft/man3/strspn.3 b/draft/man3/strspn.3 index 213c33ff..635c7d50 100644 --- a/draft/man3/strspn.3 +++ b/draft/man3/strspn.3 @@ -25,50 +25,33 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 17:57:50 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka -.\" all rights reserved. -.\" Translated Tue Dec 16 10:04:31 JST 1997 -.\" by HIROFUMI Nishizuka +.\" This file was generated with po4a. Translate the source file. .\" -.TH STRSPN 3 2010-09-20 "" "Linux Programmer's Manual" +.\"******************************************************************* +.TH STRSPN 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 strspn, strcspn \- 文字列から文字のセットを探す .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "size_t strspn(const char *" s ", const char *" accept ); +\fBsize_t strspn(const char *\fP\fIs\fP\fB, const char *\fP\fIaccept\fP\fB);\fP .sp -.BI "size_t strcspn(const char *" s ", const char *" reject ); +\fBsize_t strcspn(const char *\fP\fIs\fP\fB, const char *\fP\fIreject\fP\fB);\fP .fi .SH 説明 -.BR strspn () -関数は、\fIaccept\fP に含まれる文字だけで構成される文字列 -を \fIs\fP から探し、その最初の部分の長さを計算する。 +\fBstrspn\fP() 関数は、\fIaccept\fP に含まれる文字だけで構成される文字列 を \fIs\fP から探し、その最初の部分の長さを計算する。 .PP -.BR strcspn () -関数は、\fIreject\fP に含まれない文字だけで構成される文字列 -を \fIs\fP から探し、その最初の部分の長さを計算する。 +\fBstrcspn\fP() 関数は、\fIreject\fP に含まれない文字だけで構成される文字列 を \fIs\fP から探し、その最初の部分の長さを計算する。 .SH 返り値 -.BR strspn () -関数は、\fIaccept\fP からの文字だけで構成される \fIs\fP の -最初の部分の文字の数を返す。 +\fBstrspn\fP() 関数は、\fIaccept\fP からの文字だけで構成される \fIs\fP の 最初の部分の文字の数を返す。 .PP -.BR strcspn () -関数は、\fIs\fP の最初の部分で、文字列 \fIreject\fP に -含まれない文字の数を返す。 +\fBstrcspn\fP() 関数は、\fIs\fP の最初の部分で、文字列 \fIreject\fP に 含まれない文字の数を返す。 .SH 準拠 SVr4, 4.3BSD, C89, C99. .SH 関連項目 -.BR index (3), -.BR memchr (3), -.BR rindex (3), -.BR strchr (3), -.BR string (3), -.BR strpbrk (3), -.BR strsep (3), -.BR strstr (3), -.BR strtok (3), -.BR wcscspn (3), -.BR wcsspn (3) +\fBindex\fP(3), \fBmemchr\fP(3), \fBrindex\fP(3), \fBstrchr\fP(3), \fBstring\fP(3), +\fBstrpbrk\fP(3), \fBstrsep\fP(3), \fBstrstr\fP(3), \fBstrtok\fP(3), \fBwcscspn\fP(3), +\fBwcsspn\fP(3) diff --git a/draft/man3/strstr.3 b/draft/man3/strstr.3 index f0a5e698..d250e8ea 100644 --- a/draft/man3/strstr.3 +++ b/draft/man3/strstr.3 @@ -28,93 +28,39 @@ .\" Added history, aeb, 980113. .\" 2005-05-05 mtk: added strcasestr() .\" -.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka -.\" all rights reserved. -.\" Translated Tue Dec 16 10:06:54 JST 1997 -.\" by HIROFUMI Nishizuka -.\" Updated Sun Sep 5 JST 1999 by by Kentaro Shirakata -.\" Updated Wed Apr 20 JST 2005 by by Kentaro Shirakata +.\"******************************************************************* .\" -.TH STRSTR 3 2011-09-28 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH STRSTR 3 2011\-09\-28 GNU "Linux Programmer's Manual" .SH 名前 -.\"O strstr, strcasestr \- locate a substring strstr, strcasestr \- 部分文字列の位置を示す -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "char *strstr(const char *" haystack ", const char *" needle ); +\fBchar *strstr(const char *\fP\fIhaystack\fP\fB, const char *\fP\fIneedle\fP\fB);\fP .sp -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ .sp -.B #include +\fB#include \fP .sp -.BI "char *strcasestr(const char *" haystack ", const char *" needle ); +\fBchar *strcasestr(const char *\fP\fIhaystack\fP\fB, const char *\fP\fIneedle\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR strstr () -.\"O function finds the first occurrence of the substring -.\"O \fIneedle\fP in the string \fIhaystack\fP. -.\"O The terminating null bytes (\(aq\\0\(aq) are not compared. -.BR strstr () -関数は、部分文字列 \fIneedle\fP が文字列 \fIhaystack\fP 中 -で最初に現れる位置を見つける。 -文字列を終端 NULL バイト (\(aq\\0\(aq) は比較されない。 +\fBstrstr\fP() 関数は、部分文字列 \fIneedle\fP が文字列 \fIhaystack\fP 中 で最初に現れる位置を見つける。 文字列を終端 +NULL バイト (\(aq\e0\(aq) は比較されない。 -.\"O The -.\"O .BR strcasestr () -.\"O function is like -.\"O .BR strstr (), -.\"O but ignores the case of both arguments. -.BR strcasestr () -関数は -.BR strstr () -関数と同様だが、 -両方の引数に対して大文字小文字を無視する。 -.\"O .SH "RETURN VALUE" +\fBstrcasestr\fP() 関数は \fBstrstr\fP() 関数と同様だが、 両方の引数に対して大文字小文字を無視する。 .SH 返り値 -.\"O These functions return a pointer to the beginning of the -.\"O substring, or NULL if the substring is not found. -これらの関数は、部分文字列の開始を指すポインタを返し、 -もし部分文字列が見つからない場合は NULL を返す。 -.\"O .SH "CONFORMING TO" +これらの関数は、部分文字列の開始を指すポインタを返し、 もし部分文字列が見つからない場合は NULL を返す。 .SH 準拠 -.\"O The -.\"O .BR strstr () -.\"O function conforms to C89 and C99. -.\"O The -.\"O .BR strcasestr () -.\"O function is a nonstandard extension. -.BR strstr () -関数は C89 と C99 に準拠している。 -.BR strcasestr () -関数は非標準拡張である。 -.\"O .SH BUGS +\fBstrstr\fP() 関数は C89 と C99 に準拠している。 \fBstrcasestr\fP() 関数は非標準拡張である。 .SH バグ -.\"O Early versions of Linux libc (like 4.5.26) would not allow -.\"O an empty \fIneedle\fP argument for -.\"O .BR strstr (). -.\"O Later versions (like 4.6.27) work correctly, -.\"O and return \fIhaystack\fP when \fIneedle\fP is empty. -Linux libc の初期のバージョン(4.5.26 まで)は -.BR strstr () -関数の \fIneedle\fP 引数に空文字列を指定できない。 -最近のバージョン(4.6.27 以降)は正しく動作し、 -\fIneedle\fP が空の時は \fIhaystack\fP を返す。 +Linux libc の初期のバージョン(4.5.26 まで)は \fBstrstr\fP() 関数の \fIneedle\fP 引数に空文字列を指定できない。 +最近のバージョン(4.6.27 以降)は正しく動作し、 \fIneedle\fP が空の時は \fIhaystack\fP を返す。 .SH 関連項目 -.BR index (3), -.BR memchr (3), -.BR rindex (3), -.BR strcasecmp (3), -.BR strchr (3), -.BR string (3), -.BR strpbrk (3), -.BR strsep (3), -.BR strspn (3), -.BR strtok (3), -.BR wcsstr (3) +\fBindex\fP(3), \fBmemchr\fP(3), \fBrindex\fP(3), \fBstrcasecmp\fP(3), \fBstrchr\fP(3), +\fBstring\fP(3), \fBstrpbrk\fP(3), \fBstrsep\fP(3), \fBstrspn\fP(3), \fBstrtok\fP(3), +\fBwcsstr\fP(3) diff --git a/draft/man3/strtod.3 b/draft/man3/strtod.3 index 1b3a52fe..ef8d1ff7 100644 --- a/draft/man3/strtod.3 +++ b/draft/man3/strtod.3 @@ -40,244 +40,82 @@ .\" (michael@cantor.informatik.rwth-aachen.de) .\" Added strof, strtold, aeb, 2001-06-07 .\" -.\" Japanese Version Copyright (c) 1998-1999 -.\" Michihide Hotta and NAKANO Takeo all rights reserved. -.\" Translated Fri Jun 26 1998 by Yasushi Shoji -.\" Updated & Modified Sun Mar 14 1999 by NAKANO Takeo -.\" Updated & Modified Sun Jul 1 16:59:53 JST 2001 -.\" by Yuichi SATO -.\" Updated & Modified 2006-07-20, -.\" Akihiro MOTOKI , LDP v2.36 +.\"******************************************************************* .\" -.TH STRTOD 3 2010-00-20 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O strtod, strtof, strtold \- convert ASCII string to floating-point number +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH STRTOD 3 2010\-09\-20 Linux "Linux Programmer's Manual" .SH 名前 strtod, strtof, strtold \- ASCII 文字列を浮動小数点実数に変換する -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "double strtod(const char *" nptr ", char **" endptr ); +\fBdouble strtod(const char *\fP\fInptr\fP\fB, char **\fP\fIendptr\fP\fB);\fP .br -.BI "float strtof(const char *" nptr ", char **" endptr ); +\fBfloat strtof(const char *\fP\fInptr\fP\fB, char **\fP\fIendptr\fP\fB);\fP .br -.BI "long double strtold(const char *" nptr ", char **" endptr ); +\fBlong double strtold(const char *\fP\fInptr\fP\fB, char **\fP\fIendptr\fP\fB);\fP .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .ad l .sp -.BR strtof (), -.BR strtold (): +\fBstrtof\fP(), \fBstrtold\fP(): .RS 4 -_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +または \fIcc\ \-std=c99\fP .RE .ad l -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR strtod (), -.\"O .BR strtof (), -.\"O and -.\"O .BR strtold () -.\"O functions convert the initial portion of the string pointed to by -.\"O .I nptr -.\"O to -.\"O .IR double , -.\"O .IR float , -.\"O and -.\"O .I long double -.\"O representation, respectively. -.BR strtod (), -.BR strtof (), -.BR strtold () -関数は、 -.I nptr -が指し示す文字列のはじめの部分を -.IR double , -.IR float , -.I long double -型の値にそれぞれ変換する。 +\fBstrtod\fP(), \fBstrtof\fP(), \fBstrtold\fP() 関数は、 \fInptr\fP が指し示す文字列のはじめの部分を +\fIdouble\fP, \fIfloat\fP, \fIlong double\fP 型の値にそれぞれ変換する。 -.\"O The expected form of the (initial portion of the) string is -.\"O optional leading white space as recognized by -.\"O .BR isspace (3), -.\"O an optional plus (\(aq+\(aq) or minus sign (\(aq\-\(aq) and then either -.\"O (i) a decimal number, or (ii) a hexadecimal number, -.\"O or (iii) an infinity, or (iv) a NAN (not-a-number). -入力する文字列 (の先頭部分) は以下の形式が期待されている。 -先頭にホワイトスペース、 -次にプラス (\(aq+\(aq) またはマイナス (\(aq\-\(aq) の記号、 -その後に (i) 10 進数、(ii) 16 進数、(iii) 無限、 -(iv) NAN (計算できない数、not-a-number) のいずれかがある -(ホワイトスペース、符号は省略可能。 -ホワイトスペースは -.BR isspace (3) +入力する文字列 (の先頭部分) は以下の形式が期待されている。 先頭にホワイトスペース、 次にプラス (\(aq+\(aq) またはマイナス +(\(aq\-\(aq) の記号、 その後に (i) 10 進数、(ii) 16 進数、(iii) 無限、 (iv) NAN +(計算できない数、not\-a\-number) のいずれかがある (ホワイトスペース、符号は省略可能。 ホワイトスペースは \fBisspace\fP(3) で識別される)。 .LP -.\"O A -.\"O .I "decimal number" -.\"O consists of a nonempty sequence of decimal digits -.\"O possibly containing a radix character (decimal point, locale-dependent, -.\"O usually \(aq.\(aq), optionally followed by a decimal exponent. -.\"O A decimal exponent consists of an \(aqE\(aq or \(aqe\(aq, followed by an -.\"O optional plus or minus sign, followed by a nonempty sequence of -.\"O decimal digits, and indicates multiplication by a power of 10. -.I "10 進数" -は 1 文字以上の 10 進の数字の列からなり、 -基を表す文字 (radix charater) -(小数点。ロケールに依存するが、通常は \(aq.\(aq) が含まれることもある。 -この後に 10 進の指数部が続いても良い。 -10 進の指数部は \(aqE\(aq または \(aqe\(aq と、その後に置かれる正負記号 (省略可)、 -およびその後に続く 1 文字以上の 10 進の数字の列からなり、 -10 の何乗であるかを表す。 +\fI10 進数\fP は 1 文字以上の 10 進の数字の列からなり、 基を表す文字 (radix charater) +(小数点。ロケールに依存するが、通常は \(aq.\(aq) が含まれることもある。 この後に 10 進の指数部が続いても良い。 10 進の指数部は +\(aqE\(aq または \(aqe\(aq と、その後に置かれる正負記号 (省略可)、 およびその後に続く 1 文字以上の 10 +進の数字の列からなり、 10 の何乗であるかを表す。 .LP -.\"O A -.\"O .I "hexadecimal number" -.\"O consists of a "0x" or "0X" followed by a nonempty sequence of -.\"O hexadecimal digits possibly containing a radix character, -.\"O optionally followed by a binary exponent. -.\"O A binary exponent -.\"O consists of a \(aqP\(aq or \(aqp\(aq, followed by an optional -.\"O plus or minus sign, followed by a nonempty sequence of -.\"O decimal digits, and indicates multiplication by a power of 2. -.\"O At least one of radix character and binary exponent must be present. -.I "16 進数" -は、"0x" または "0X" とその後に続く 1 文字以上の 16 進の数字の列からなり、 -基を表す文字が含まれることもある。 -この後に 2 進の指数部が続いても良い。 -2 進の指数部は \(aqP\(aq または \(aqp\(aq と、その後に置かれる正負記号 (省略可)、 -およびその後に続く 1 文字以上の 10 進の数字の列から構成され、 -2 の何乗であるかを表す。 -基を表す文字と 2 進の指数部は、どちらか一方しか存在してはならない。 +\fI16 進数\fP は、"0x" または "0X" とその後に続く 1 文字以上の 16 進の数字の列からなり、 基を表す文字が含まれることもある。 +この後に 2 進の指数部が続いても良い。 2 進の指数部は \(aqP\(aq または \(aqp\(aq と、その後に置かれる正負記号 (省略可)、 +およびその後に続く 1 文字以上の 10 進の数字の列から構成され、 2 の何乗であるかを表す。 基を表す文字と 2 +進の指数部は、どちらか一方しか存在してはならない。 .LP -.\"O An -.\"O .I infinity -.\"O is either "INF" or "INFINITY", disregarding case. -.I 無限 -は "INF" または "INFINITY" で表され、大文字小文字は区別されない。 +\fI無限\fP は "INF" または "INFINITY" で表され、大文字小文字は区別されない。 .LP -.\"O A -.\"O .I NAN -.\"O is "NAN" (disregarding case) optionally followed by \(aq(\(aq, -.\"O a sequence of characters, followed by \(aq)\(aq. -.\"O The character string specifies in an implementation-dependent -.\"O way the type of NAN. -.I NAN -は "NAN" (大文字小文字は区別されない) で表され、 -その後に \(aq(\(aq 文字列 \(aq)\(aq が続く場合もある。 -この文字列は実装に依存する NAN を指定する。 .\" From glibc 2.8's stdlib/strtod_l.c: .\" We expect it to be a number which is put in the .\" mantissa of the number. -.\"O .SH "RETURN VALUES" +\fINAN\fP は "NAN" (大文字小文字は区別されない) で表され、 その後に \(aq(\(aq 文字列 \(aq)\(aq が続く場合もある。 +この文字列は実装に依存する NAN を指定する。 .SH 返り値 -.\"O These functions return the converted value, if any. これらの関数は、変換された値があれば、それを返す。 -.\"O If -.\"O .I endptr -.\"O is not NULL, -.\"O a pointer to the character after the last character used in the conversion -.\"O is stored in the location referenced by -.\"O .IR endptr . -.I endptr -が NULL でないときは、変換に使われた最終文字の次の文字へのポインターが -.I endptr -で参照される場所へ保存される。 +\fIendptr\fP が NULL でないときは、変換に使われた最終文字の次の文字へのポインターが \fIendptr\fP で参照される場所へ保存される。 -.\"O If no conversion is performed, zero is returned and the value of -.\"O .I nptr -.\"O is stored in the location referenced by -.\"O .IR endptr . -変換が行われなかったときには 0 が返る。そして -.I endptr -が参照している場所に -.I nptr -の値 (変換対象である文字列の開始アドレス) が保存される。 +変換が行われなかったときには 0 が返る。そして \fIendptr\fP が参照している場所に \fInptr\fP の値 (変換対象である文字列の開始アドレス) +が保存される。 -.\"O If the correct value would cause overflow, plus or minus -.\"O .B HUGE_VAL -.\"O .RB ( HUGE_VALF , -.\"O .BR HUGE_VALL ) -.\"O is returned (according to the sign of the value), and -.\"O .B ERANGE -.\"O is stored in -.\"O .IR errno . -.\"O If the correct value would cause underflow, zero is -.\"O returned and -.\"O .B ERANGE -.\"O is stored in -.\"O .IR errno . -正しい形式の数値文字列であるが、変換結果がオーバーフローを起こした場合 -には、プラスまたはマイナスの -.B HUGE_VAL -.RB ( HUGE_VALF , -.BR HUGE_VALL ) -が返り (値の符号による)、 -.B ERANGE -が -.I errno -に代入される。変換結果がアンダーフローを起こした場合には 0 が返り、 -.B ERANGE -が -.I errno -に代入される。 -.\"O .SH ERRORS +正しい形式の数値文字列であるが、変換結果がオーバーフローを起こした場合 には、プラスまたはマイナスの \fBHUGE_VAL\fP +(\fBHUGE_VALF\fP, \fBHUGE_VALL\fP) が返り (値の符号による)、 \fBERANGE\fP が \fIerrno\fP +に代入される。変換結果がアンダーフローを起こした場合には 0 が返り、 \fBERANGE\fP が \fIerrno\fP に代入される。 .SH エラー -.TP -.B ERANGE -.\"O Overflow or underflow occurred. +.TP +\fBERANGE\fP オーバーフローまたはアンダーフローが起こった。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O C89 describes -.\"O .BR strtod (), -.\"O C99 -.\"O describes the other two functions. -C89 では -.BR strtod () -が、C99 では残りの 2 つの関数が記述されている。 -.\"O .SH NOTES +C89 では \fBstrtod\fP() が、C99 では残りの 2 つの関数が記述されている。 .SH 注意 -.\"O Since -.\"O 0 can legitimately be returned -.\"O on both success and failure, the calling program should set -.\"O .I errno -.\"O to 0 before the call, -.\"O and then determine if an error occurred by checking whether -.\"O .I errno -.\"O has a nonzero value after the call. -成功、失敗どちらの場合でも 0 を返す可能性があるので、 -プログラムは呼び出す前に -.I errno -を 0 に設定し、呼び出し後に -.I errno -が 0 以外の値かどうかを確認しエラーが発生したかどうかを判断する -必要がある。 -.\"O .SH EXAMPLE +成功、失敗どちらの場合でも 0 を返す可能性があるので、 プログラムは呼び出す前に \fIerrno\fP を 0 に設定し、呼び出し後に \fIerrno\fP +が 0 以外の値かどうかを確認しエラーが発生したかどうかを判断する 必要がある。 .SH 例 -.\"O See the example on the -.\"O .BR strtol (3) -.\"O manual page; -.\"O the use of the functions described in this manual page is similar. -.BR strtol (3) -のマニュアルページの例を参照。 -このページで説明した関数の使用方法も同様である。 -.\"O .SH "SEE ALSO" +\fBstrtol\fP(3) のマニュアルページの例を参照。 このページで説明した関数の使用方法も同様である。 .SH 関連項目 -.BR atof (3), -.BR atoi (3), -.BR atol (3), -.BR strtol (3), -.BR strtoul (3) +\fBatof\fP(3), \fBatoi\fP(3), \fBatol\fP(3), \fBstrtol\fP(3), \fBstrtoul\fP(3) diff --git a/draft/man3/strtoimax.3 b/draft/man3/strtoimax.3 index db9a3300..22253f8a 100644 --- a/draft/man3/strtoimax.3 +++ b/draft/man3/strtoimax.3 @@ -20,79 +20,30 @@ .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, .\" USA. .\" -.\" Japanese Version Copyright (c) 2004 Yuichi SATO -.\" all rights reserved. -.\" Translated Sun Sep 5 21:02:09 JST 2004 -.\" by Yuichi SATO +.\"******************************************************************* .\" -.TH STRTOIMAX 3 2003-11-28 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH STRTOIMAX 3 2003\-11\-28 "" "Linux Programmer's Manual" .SH 名前 -.\"O strtoimax, strtoumax \- convert string to integer strtoimax, strtoumax \- 文字列を整数に変換する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "intmax_t strtoimax(const char *" nptr ", char **" endptr ", int " base ); +\fBintmax_t strtoimax(const char *\fP\fInptr\fP\fB, char **\fP\fIendptr\fP\fB, int \fP\fIbase\fP\fB);\fP .br -.BI "uintmax_t strtoumax(const char *" nptr ", char **" endptr ", int " base ); +\fBuintmax_t strtoumax(const char *\fP\fInptr\fP\fB, char **\fP\fIendptr\fP\fB, int \fP\fIbase\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O These functions are just like -.\"O .BR strtol (3) -.\"O and -.\"O .BR strtoul (3), -.\"O except that they return a value of type -.\"O .I intmax_t -.\"O and -.\"O .IR uintmax_t , -.\"O respectively. -これらの関数はちょうど -.BR strtol (3) -と -.BR strtoul (3) -に似ているが、それぞれ -.I intmax_t -と -.I uintmax_t -型の値を返す。 -.\"O .SH "RETURN VALUE" +これらの関数はちょうど \fBstrtol\fP(3) と \fBstrtoul\fP(3) に似ているが、それぞれ \fIintmax_t\fP と +\fIuintmax_t\fP 型の値を返す。 .SH 返り値 -.\"O On success, the converted value is returned. -.\"O If nothing was found to convert, zero is returned. -成功した場合、変換された値が返される。 -変換するものが見つからなかった場合、0 が返される。 -.\"O On overflow or underflow -.\"O .B INTMAX_MAX -.\"O or -.\"O .B INTMAX_MIN -.\"O or -.\"O .B UINTMAX_MAX -.\"O is returned, and -.\"O .I errno -.\"O is set to -.\"O .BR ERANGE . -オーバーフローまたはアンダーフローの場合、 -.B INTMAX_MAX -または -.B INTMAX_MIN -または -.B UINTMAX_MAX -が返され、 -.I errno -が -.B ERANGE -に設定される。 -.\"O .SH "CONFORMING TO" +成功した場合、変換された値が返される。 変換するものが見つからなかった場合、0 が返される。 オーバーフローまたはアンダーフローの場合、 +\fBINTMAX_MAX\fP または \fBINTMAX_MIN\fP または \fBUINTMAX_MAX\fP が返され、 \fIerrno\fP が +\fBERANGE\fP に設定される。 .SH 準拠 -C99, POSIX.1-2001. -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. .SH 関連項目 -.BR imaxabs (3), -.BR imaxdiv (3), -.BR strtol (3), -.BR strtoul (3), -.BR wcstoimax (3) +\fBimaxabs\fP(3), \fBimaxdiv\fP(3), \fBstrtol\fP(3), \fBstrtoul\fP(3), \fBwcstoimax\fP(3) diff --git a/draft/man3/strtok.3 b/draft/man3/strtok.3 index d7c73d42..54545e4e 100644 --- a/draft/man3/strtok.3 +++ b/draft/man3/strtok.3 @@ -22,216 +22,86 @@ .\" the source, must acknowledge the copyright and authors of this work. .\" .\" Rewritten old page, 960210, aeb@cwi.nl -.\" Updated, added strtok_r. 2000-02-13 Nicolas Lichtmaier +.\" Updated, added strtok_r. 2000-02-13 Nicolás Lichtmaier .\" 2005-11-17, mtk: Substantial parts rewritten .\" -.\" Japanese Version Copyright (c) 1998 Ishii Tatsuo all rights reserved. -.\" Translated 1998-03-27, Ishii Tatsuo -.\" Updated 2000-04-05, Kentaro Shirakata -.\" Updated 2000-09-21, Kentaro Shirakata -.\" Updated 2002-03-28, Kentaro Shirakata -.\" Updated 2005-11-19, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH STRTOK 3 2010-09-27 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O strtok, strtok_r \- extract tokens from strings +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH STRTOK 3 2010\-09\-27 GNU "Linux Programmer's Manual" .SH 名前 strtok, strtok_r \- 文字列からトークンを取り出す -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "char *strtok(char *" str ", const char *" delim ); +\fBchar *strtok(char *\fP\fIstr\fP\fB, const char *\fP\fIdelim\fP\fB);\fP .sp -.BI "char *strtok_r(char *" str ", const char *" delim ", char **" saveptr ); +\fBchar *strtok_r(char *\fP\fIstr\fP\fB, const char *\fP\fIdelim\fP\fB, char **\fP\fIsaveptr\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR strtok_r (): -_SVID_SOURCE || _BSD_SOURCE || _POSIX_C_SOURCE\ >=\ 1 || +\fBstrtok_r\fP(): _SVID_SOURCE || _BSD_SOURCE || _POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR strtok () -.\"O function parses a string into a sequence of tokens. -.\"O On the first call to -.\"O .BR strtok () -.\"O the string to be parsed should be -.\"O specified in \fIstr\fP. -.\"O In each subsequent call that should parse the same string, -.\"O \fIstr\fP should be NULL. -.BR strtok () -関数は文字列を解析してトークンに分割する。 -.BR strtok () -を最初に呼び出す際には、解析対象の文字列を \fIstr\fP に -指定する。同じ文字列の解析を行うその後の呼び出しでは、 -\fIstr\fP には NULL を指定する。 +\fBstrtok\fP() 関数は文字列を解析してトークンに分割する。 \fBstrtok\fP() を最初に呼び出す際には、解析対象の文字列を \fIstr\fP +に 指定する。同じ文字列の解析を行うその後の呼び出しでは、 \fIstr\fP には NULL を指定する。 -.\"O The \fIdelim\fP argument specifies a set of characters that -.\"O delimit the tokens in the parsed string. -.\"O The caller may specify different strings in \fIdelim\fP in successive -.\"O calls that parse the same string. -\fIdelim\fP 引き数には、解析する文字列をトークンに区切る文字集合を -指定する。同じ文字列を解析する一連の呼び出しにおいて、 -\fIdelim\fP に違う文字列を指定してもよい。 +\fIdelim\fP 引き数には、解析する文字列をトークンに区切る文字集合を 指定する。同じ文字列を解析する一連の呼び出しにおいて、 \fIdelim\fP +に違う文字列を指定してもよい。 -.\"O Each call to -.\"O .BR strtok () -.\"O returns a pointer to a -.\"O null-terminated string containing the next token. -.\"O This string does not include the delimiting character. -.\"O If no more tokens are found, -.\"O .BR strtok () -.\"O returns NULL. -.BR strtok () -のそれぞれの呼び出しでは、次のトークンを -格納した NULL 終端された文字列へのポインタが返される。 -この文字列には区切り文字は含まれない。 -これ以上トークンが見つからなかった場合には、NULL が返される。 +\fBstrtok\fP() のそれぞれの呼び出しでは、次のトークンを 格納した NULL 終端された文字列へのポインタが返される。 +この文字列には区切り文字は含まれない。 これ以上トークンが見つからなかった場合には、NULL が返される。 -.\"O A sequence of two or more contiguous delimiter characters in -.\"O the parsed string is considered to be a single delimiter. -.\"O Delimiter characters at the start or end of the string are ignored. -.\"O Put another way: the tokens returned by -.\"O .BR strtok () -.\"O are always nonempty strings. -解析対象の文字列に2つ以上の区切り文字が連続している場合には、 -一つの区切り文字とみなされる。 -文字列の先頭や末尾にある区切り文字は無視される。言い換えると、 -.BR strtok () -が返すトークンは常に空でない文字列となる。 +解析対象の文字列に2つ以上の区切り文字が連続している場合には、 一つの区切り文字とみなされる。 +文字列の先頭や末尾にある区切り文字は無視される。言い換えると、 \fBstrtok\fP() が返すトークンは常に空でない文字列となる。 -.\"O The -.\"O .BR strtok_r () -.\"O function is a reentrant version -.\"O .BR strtok (). -.\"O The \fIsaveptr\fP argument is a pointer to a -.\"O \fIchar *\fP variable that is used internally by -.\"O .BR strtok_r () -.\"O in order to maintain context between successive calls that parse the -.\"O same string. -.BR strtok_r () -関数は -.BR strtok () -のリエントラント版である。 -\fIsaveptr\fP 引き数は \fIchar *\fP 変数へのポインタであり、 -同じ文字列の解析を行う -.BR strtok_r () -の呼び出し間で処理状況を保存するために -.BR strtok_r () +\fBstrtok_r\fP() 関数は \fBstrtok\fP() のリエントラント版である。 \fIsaveptr\fP 引き数は \fIchar *\fP +変数へのポインタであり、 同じ文字列の解析を行う \fBstrtok_r\fP() の呼び出し間で処理状況を保存するために \fBstrtok_r\fP() 内部で使用される。 -.\"O On the first call to -.\"O .BR strtok_r (), -.\"O .I str -.\"O should point to the string to be parsed, and the value of -.\"O .I saveptr -.\"O is ignored. -.\"O In subsequent calls, \fIstr\fP should be NULL, and -.\"O \fIsaveptr\fP should be unchanged since the previous call. -.BR strtok_r () -を最初に呼び出す際には、 -.I str -は解析対象の文字列を指していなければならず、 -.I saveptr -の値は無視される。それ以降の呼び出しでは、 -.I str -は NULL とし、 -.I saveptr +\fBstrtok_r\fP() を最初に呼び出す際には、 \fIstr\fP は解析対象の文字列を指していなければならず、 \fIsaveptr\fP +の値は無視される。それ以降の呼び出しでは、 \fIstr\fP は NULL とし、 \fIsaveptr\fP は前回の呼び出し以降変更しないようにしなければならない。 -.\"O Different strings may be parsed concurrently using sequences of calls to -.\"O .BR strtok_r () -.\"O that specify different \fIsaveptr\fP arguments. -.BR strtok_r () -の呼び出し時に異なる \fIsaveptr\fP 引き数を指定することで、 -異なる文字列の解析を同時に行うことができる。 -.\"O .SH "RETURN VALUE" +\fBstrtok_r\fP() の呼び出し時に異なる \fIsaveptr\fP 引き数を指定することで、 異なる文字列の解析を同時に行うことができる。 .SH 返り値 -.\"O The -.\"O .BR strtok () -.\"O and -.\"O .BR strtok_r () -.\"O functions return a pointer to -.\"O the next token, or NULL if there are no more tokens. -.BR strtok () -と -.BR strtok_r () -は次のトークンへのポインタか、 -トークンがなければ NULL を返す。 -.\"O .SH "CONFORMING TO" +\fBstrtok\fP() と \fBstrtok_r\fP() は次のトークンへのポインタか、 トークンがなければ NULL を返す。 .SH 準拠 -.TP -.BR strtok () -SVr4, POSIX.1-2001, 4.3BSD, C89, C99. -.TP -.BR strtok_r () -POSIX.1-2001. -.\"O .SH "BUGS" +.TP +\fBstrtok\fP() +SVr4, POSIX.1\-2001, 4.3BSD, C89, C99. +.TP +\fBstrtok_r\fP() +POSIX.1\-2001. .SH バグ -.\"O Be cautious when using these functions. -.\"O If you do use them, note that: -これらの関数を使うのは慎重に吟味すること。 -使用する場合は、以下の点に注意が必要である。 +これらの関数を使うのは慎重に吟味すること。 使用する場合は、以下の点に注意が必要である。 .IP * 2 -.\"O These functions modify their first argument. これらの関数はその最初の引数を変更する。 .IP * -.\"O These functions cannot be used on constant strings. これらの関数は const な文字列では使えない。 .IP * -.\"O The identity of the delimiting character is lost. 区切り文字自体は失われてしまう。 .IP * -.\"O The -.\"O .BR strtok () -.\"O function uses a static buffer while parsing, so it's not thread safe. -.\"O Use -.\"O .BR strtok_r () -.\"O if this matters to you. -.BR strtok () -関数は文字列の解析に静的バッファを用いるので、スレッドセーフでない。 -これが問題になる場合は -.BR strtok_r () +\fBstrtok\fP() 関数は文字列の解析に静的バッファを用いるので、スレッドセーフでない。 これが問題になる場合は \fBstrtok_r\fP() を用いること。 -.\"O .SH EXAMPLE .SH 例 -.\"O The program below uses nested loops that employ -.\"O .BR strtok_r () -.\"O to break a string into a two-level hierarchy of tokens. -.\"O The first command-line argument specifies the string to be parsed. -.\"O The second argument specifies the delimiter character(s) -.\"O to be used to separate that string into "major" tokens. -.\"O The third argument specifies the delimiter character(s) -.\"O to be used to separate the "major" tokens into subtokens. -以下のプログラムは、 -.BR strtok_r () -を利用するループを入れ子にして使用し、 -文字列を2階層のトークンに分割するものである。 -1番目のコマンドライン引き数には、解析対象の文字列を指定する。 -2番目の引き数には、文字列を「大きな」トークンに分割するために -使用する区切り文字を指定する。 -3番目の引き数には、「大きな」トークンを細かく分割するために -使用する区切り文字を指定する。 -.PP +以下のプログラムは、 \fBstrtok_r\fP() を利用するループを入れ子にして使用し、 文字列を2階層のトークンに分割するものである。 +1番目のコマンドライン引き数には、解析対象の文字列を指定する。 2番目の引き数には、文字列を「大きな」トークンに分割するために +使用する区切り文字を指定する。 3番目の引き数には、「大きな」トークンを細かく分割するために 使用する区切り文字を指定する。 .PP -.\"O An example of the output produced by this program is the following: このプログラムの出力例を以下に示す。 .PP .in +4n .nf -.RB "$" " ./a.out \(aqa/bbb///cc;xxx:yyy:\(aq \(aq:;\(aq \(aq/\(aq" +$\fB ./a.out \(aqa/bbb///cc;xxx:yyy:\(aq \(aq:;\(aq \(aq/\(aq\fP 1: a/bbb///cc \-\-> a \-\-> bbb @@ -242,7 +112,6 @@ POSIX.1-2001. \-\-> yyy .fi .in -.\"O .SS Program source .SS プログラムのソース \& .nf @@ -258,7 +127,7 @@ main(int argc, char *argv[]) int j; if (argc != 4) { - fprintf(stderr, "Usage: %s string delim subdelim\\n", + fprintf(stderr, "Usage: %s string delim subdelim\en", argv[0]); exit(EXIT_FAILURE); } @@ -267,13 +136,13 @@ main(int argc, char *argv[]) token = strtok_r(str1, argv[2], &saveptr1); if (token == NULL) break; - printf("%d: %s\\n", j, token); + printf("%d: %s\en", j, token); for (str2 = token; ; str2 = NULL) { subtoken = strtok_r(str2, argv[3], &saveptr2); if (subtoken == NULL) break; - printf("\t \-\-> %s\\n", subtoken); + printf("\t \-\-> %s\en", subtoken); } } @@ -281,23 +150,7 @@ main(int argc, char *argv[]) } .fi .PP -.\"O Another example program using -.\"O .BR strtok () -.\"O can be found in -.\"O .BR getaddrinfo_a (3). -.BR strtok () -を使った別のプログラム例が -.BR getaddrinfo_a (3) -にある。 -.\"O .SH "SEE ALSO" +\fBstrtok\fP() を使った別のプログラム例が \fBgetaddrinfo_a\fP(3) にある。 .SH 関連項目 -.BR index (3), -.BR memchr (3), -.BR rindex (3), -.BR strchr (3), -.BR string (3), -.BR strpbrk (3), -.BR strsep (3), -.BR strspn (3), -.BR strstr (3), -.BR wcstok (3) +\fBindex\fP(3), \fBmemchr\fP(3), \fBrindex\fP(3), \fBstrchr\fP(3), \fBstring\fP(3), +\fBstrpbrk\fP(3), \fBstrsep\fP(3), \fBstrspn\fP(3), \fBstrstr\fP(3), \fBwcstok\fP(3) diff --git a/draft/man3/strtol.3 b/draft/man3/strtol.3 index 178afc1e..b05956a4 100644 --- a/draft/man3/strtol.3 +++ b/draft/man3/strtol.3 @@ -26,316 +26,113 @@ .\" 386BSD man pages .\" Modified Sun Jul 25 10:53:39 1993 by Rik Faith (faith@cs.unc.edu) .\" Added correction due to nsd@bbc.com (Nick Duffek) - aeb, 950610 +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1999 AKAMATSU, Kazuo -.\" all rights reserved. -.\" Translated Thu Jan 9 21:00:00 JST 1999 -.\" by AKAMATSU, Kazuo -.\" Updated Sun Apr 8 JST 2001 by Kentaro Shirakata -.\" Updated Sat Mar 23 JST 2002 by Kentaro Shirakata -.\" Updated & Modified 2006-07-20, -.\" Akihiro MOTOKI , LDP v2.36 +.\" This file was generated with po4a. Translate the source file. .\" -.\" WORD: base 基数 -.\" -.TH STRTOL 3 2010-09-20 "GNU" "Linux Programmer's Manual" +.\"******************************************************************* +.TH STRTOL 3 2010\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 -.\"O strtol, strtoll, strtoq \- convert a string to a long integer strtol, strtoll, strtoq \- 文字列を long int に変換する .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "long int strtol(const char *" nptr ", char **" endptr ", int " base ); +\fBlong int strtol(const char *\fP\fInptr\fP\fB, char **\fP\fIendptr\fP\fB, int \fP\fIbase\fP\fB);\fP .sp -.BI "long long int strtoll(const char *" nptr ", char **" endptr \ -", int " base ); +\fBlong long int strtoll(const char *\fP\fInptr\fP\fB, char **\fP\fIendptr\fP\fB, int \fP\fIbase\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR strtoll (): +\fBstrtoll\fP(): .RS 4 -XOPEN_SOURCE\ >=\ 600 || _BSD_SOURCE || _SVID_SOURCE || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +XOPEN_SOURCE\ >=\ 600 || _BSD_SOURCE || _SVID_SOURCE || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +または \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR strtol () -.\"O function converts the initial part of the string -.\"O in \fInptr\fP to a long integer value according to the given \fIbase\fP, -.\"O which must be between 2 and 36 inclusive, or be the special value 0. -.BR strtol () -関数は、 \fInptr\fP の文字列の最初の部分を、 -\fIbase\fP を基数として long int に変換する。 -この \fIbase\fP は 2 から 36 までの値 -あるいは特別な意味を持つ値 0 でなければならない。 +\fBstrtol\fP() 関数は、 \fInptr\fP の文字列の最初の部分を、 \fIbase\fP を基数として long int に変換する。 この +\fIbase\fP は 2 から 36 までの値 あるいは特別な意味を持つ値 0 でなければならない。 .PP -.\"O The string may begin with an arbitrary amount of white space (as -.\"O determined by -.\"O .BR isspace (3)) -.\"O followed by a single optional \(aq+\(aq or \(aq\-\(aq sign. -.\"O If \fIbase\fP is zero or 16, the string may then include a -.\"O "0x" prefix, and the number will be read in base 16; otherwise, a -.\"O zero \fIbase\fP is taken as 10 (decimal) unless the next character -.\"O is \(aq0\(aq, in which case it is taken as 8 (octal). -文字列の先頭には、任意の数の空白があってもよく (空白は -.BR isspace (3) -で判定される)、また数字の直前には \(aq+\(aq か \(aq\-\(aq の -符号があってもよい。 -\fIbase\fP が 0 または 16 の場合には、文字列の先頭に "0x" を置くことが -でき、その場合には文字列は 16進数として扱われる。 -これ以外の文字列で \fIbase\fP が 0 の場合は、 -文字列が \(aq0\(aq で始まるときは 8進数として、 -それ以外のときは 10進数として扱われる。 +文字列の先頭には、任意の数の空白があってもよく (空白は \fBisspace\fP(3) で判定される)、また数字の直前には \(aq+\(aq か +\(aq\-\(aq の 符号があってもよい。 \fIbase\fP が 0 または 16 の場合には、文字列の先頭に "0x" を置くことが +でき、その場合には文字列は 16進数として扱われる。 これ以外の文字列で \fIbase\fP が 0 の場合は、 文字列が \(aq0\(aq +で始まるときは 8進数として、 それ以外のときは 10進数として扱われる。 .PP -.\"O The remainder of the string is converted to a -.\"O .I long int -.\"O value -.\"O in the obvious manner, stopping at the first character which is not a -.\"O valid digit in the given base. -.\"O (In bases above 10, the letter \(aqA\(aq in -.\"O either upper or lower case represents 10, \(aqB\(aq represents 11, and so -.\"O forth, with \(aqZ\(aq representing 35.) -数字を表す文字列は -.I long int -に変換されるが、基数に対して -有効でない数字が現れた時点で変換は終了する。(11進数以上では \(aqA\(aq は -大文字・小文字に関わらず 10 を表し、 \(aqB\(aq は 11 を表現し、 -以下同様に、 \(aqZ\(aq は 35 を表す。) +数字を表す文字列は \fIlong int\fP に変換されるが、基数に対して 有効でない数字が現れた時点で変換は終了する。(11進数以上では +\(aqA\(aq は 大文字・小文字に関わらず 10 を表し、 \(aqB\(aq は 11 を表現し、 以下同様に、 \(aqZ\(aq は 35 +を表す。) .PP -.\"O If \fIendptr\fP is not NULL, -.\"O .BR strtol () -.\"O stores the address of the -.\"O first invalid character in \fI*endptr\fP. -.\"O If there were no digits at -.\"O all, -.\"O .BR strtol () -.\"O stores the original value of \fInptr\fP in -.\"O \fI*endptr\fP (and returns 0). -\fIendptr\fP がヌル値 (NULL) でない場合は、最初に現れた不正な文字が -.BR strtol () -によって \fI*endptr\fP に保存されている。 -文字列に有効な数字がひとつもなければ、 -.BR strtol () -は \fInptr\fP -の元の値を \fI*endptr\fP に代入する (そして 0 を返す)。 -.\"O In particular, if \fI*nptr\fP is not \(aq\\0\(aq but \fI**endptr\fP -.\"O is \(aq\\0\(aq on return, the entire string is valid. -特に、\fI*nptr\fP が \(aq\\0\(aq 以外で、返された \fI**endptr\fP が -\(aq\\0\(aq ならば、文字列全体が有効だったことになる。 +\fIendptr\fP がヌル値 (NULL) でない場合は、最初に現れた不正な文字が \fBstrtol\fP() によって \fI*endptr\fP +に保存されている。 文字列に有効な数字がひとつもなければ、 \fBstrtol\fP() は \fInptr\fP の元の値を \fI*endptr\fP に代入する +(そして 0 を返す)。 特に、\fI*nptr\fP が \(aq\e0\(aq 以外で、返された \fI**endptr\fP が \(aq\e0\(aq +ならば、文字列全体が有効だったことになる。 .PP -.\"O The -.\"O .BR strtoll () -.\"O function works just like the -.\"O .BR strtol () -.\"O function but returns a long long integer value. -.BR strtoll () -関数は -.BR strtol () -と同様だが、long long int 型の値を返す。 +\fBstrtoll\fP() 関数は \fBstrtol\fP() と同様だが、long long int 型の値を返す。 .SH 返り値 -.\"O The -.\"O .BR strtol () -.\"O function returns the result of the conversion, -.\"O unless the value would underflow or overflow. -.\"O If an underflow occurs, -.\"O .BR strtol () -.\"O returns -.\"O .BR LONG_MIN . -.\"O If an overflow occurs, -.\"O .BR strtol () -.\"O returns -.\"O .BR LONG_MAX . -.\"O In both cases, \fIerrno\fP is set to -.\"O .BR ERANGE . -アンダーフローもオーバーフローも起きなかった場合、 -.BR strtol () -関数は -変換された値を返す。オーバーフローした場合には -.B LONG_MAX -が返り、 -アンダーフローした場合には -.B LONG_MIN -が返る。オーバーフロー、 -アンダーフローのいずれの場合にも -大域変数 \fIerrno\fP には -.B ERANGE -が設定される。 -.\"O Precisely the same holds for -.\"O .BR strtoll () -.\"O (with -.\"O .B LLONG_MIN -.\"O and -.\"O .B LLONG_MAX -.\"O instead of -.\"O .B LONG_MIN -.\"O and -.\"O .BR LONG_MAX ). -.BR strtoll () -も同様であるが、 -.B LONG_MIN -と -.B LONG_MAX -の代わりに -.B LLONG_MIN -と -.B LLONG_MAX -が返される。 +アンダーフローもオーバーフローも起きなかった場合、 \fBstrtol\fP() 関数は 変換された値を返す。オーバーフローした場合には +\fBLONG_MAX\fP が返り、 アンダーフローした場合には \fBLONG_MIN\fP が返る。オーバーフロー、 アンダーフローのいずれの場合にも +大域変数 \fIerrno\fP には \fBERANGE\fP が設定される。 \fBstrtoll\fP() も同様であるが、 \fBLONG_MIN\fP と +\fBLONG_MAX\fP の代わりに \fBLLONG_MIN\fP と \fBLLONG_MAX\fP が返される。 .SH エラー -.TP -.B EINVAL -.\"O (not in C99) -.\"O The given -.\"O .I base -.\"O contains an unsupported value. -(C99 にはない) -.I base -が対応していない値である。 -.TP -.B ERANGE -.\"O The resulting value was out of range. +.TP +\fBEINVAL\fP +(C99 にはない) 指定された \fIbase\fP がサポートされていない値である。 +.TP +\fBERANGE\fP 結果の値が範囲外である。 .LP -.\"O The implementation may also set \fIerrno\fP to \fBEINVAL\fP in case -.\"O no conversion was performed (no digits seen, and 0 returned). -実装によっては、変換が行われなかった場合 (数字がなく、0 を返した場合)、 -\fIerrno\fP に \fBEINVAL\fP が設定される場合がある。 +実装によっては、変換が行われなかった場合 (数字がなく、0 を返した場合)、 \fIerrno\fP に \fBEINVAL\fP が設定される場合がある。 .SH 準拠 -.\"O .BR strtol () -.\"O conforms to SVr4, 4.3BSD, C89, C99 and POSIX.1-2001, and -.\"O .BR strtoll () -.\"O to C99 and POSIX.1-2001. -.BR strtol () -は SVr4, 4.3BSD, C89, C99 と POSIX.1-2001 に準拠している。 -.BR strtoll () -は C99 と POSIX.1-2001 に準拠している。 -.\"O .SH NOTES +\fBstrtol\fP() は SVr4, 4.3BSD, C89, C99 と POSIX.1\-2001 に準拠している。 \fBstrtoll\fP() +は C99 と POSIX.1\-2001 に準拠している。 .SH 注意 -.\"O Since -.\"O .BR strtol () -.\"O can legitimately return 0, -.\"O .BR LONG_MAX , -.\"O or -.\"O .B LONG_MIN -.\"O .RB ( LLONG_MAX -.\"O or -.\"O .B LLONG_MIN -.\"O for -.\"O .BR strtoll ()) -.\"O on both success and failure, the calling program should set -.\"O .I errno -.\"O to 0 before the call, -.\"O and then determine if an error occurred by checking whether -.\"O .I errno -.\"O has a nonzero value after the call. -.B strtol () -からは成功、失敗どちらの場合でも -0, -.BR LONG_MAX , -.B LONG_MIN -.RB ( strtoll () -では -.BR LLONG_MAX , -.BR LLONG_MIN ) -が返る可能性があるので、 -プログラムは関数を呼び出す前に -.I errno -を 0 に設定し、呼び出し後に -.I errno -が 0 以外の値かどうかを確認しエラーが発生したかどうかを判断する -必要がある。 +\fBstrtol ()\fP からは成功、失敗どちらの場合でも 0, \fBLONG_MAX\fP, \fBLONG_MIN\fP (\fBstrtoll\fP() では +\fBLLONG_MAX\fP, \fBLLONG_MIN\fP) が返る可能性があるので、 プログラムは関数を呼び出す前に \fIerrno\fP を 0 +に設定し、呼び出し後に \fIerrno\fP が 0 以外の値かどうかを確認しエラーが発生したかどうかを判断する 必要がある。 -.\"O In locales other than the "C" locale, other strings may also be accepted. -.\"O (For example, the thousands separator of the current locale may be -.\"O supported.) -"C" 以外のロケールの場合、その他の文字列も受け付けられるかもしれない。 -(例えば、現在のロケールの 1000 毎の区切り文字がサポートされているかもしれない。) +"C" 以外のロケールの場合、その他の文字列も受け付けられるかもしれない。 (例えば、現在のロケールの 1000 +毎の区切り文字がサポートされているかもしれない。) .LP -.\"O BSD also has BSD には、 .sp .in +4n .nf -.BI "quad_t strtoq(const char *" nptr ", char **" endptr ", int " base ); +\fBquad_t strtoq(const char *\fP\fInptr\fP\fB, char **\fP\fIendptr\fP\fB, int \fP\fIbase\fP\fB);\fP .sp .in .fi -.\"O with completely analogous definition. -という完全に同様の定義を持つ関数がある。 -.\"O Depending on the wordsize of the current architecture, this -.\"O may be equivalent to -.\"O .BR strtoll () -.\"O or to -.\"O .BR strtol (). -使用中のアーキテクチャのワード長次第であるが、この関数は -.BR strtoll () -か -.BR strtol () -と等価となることもある。 -.\"O .SH EXAMPLE +という完全に同様の定義を持つ関数がある。 使用中のアーキテクチャのワード長次第であるが、この関数は \fBstrtoll\fP() か +\fBstrtol\fP() と等価となることもある。 .SH 例 -.\"O The program shown below demonstrates the use of -.\"O .BR strtol (). -.\"O The first command-line argument specifies a string from which -.\"O .BR strtol () -.\"O should parse a number. -.\"O The second (optional) argument specifies the base to be used for -.\"O the conversion. -.\"O (This argument is converted to numeric form using -.\"O .BR atoi (3), -.\"O a function that performs no error checking and -.\"O has a simpler interface than -.\"O .BR strtol ().) -以下のプログラムは -.BR strtol () -の使用例である。 -最初のコマンドライン引き数には -.BR strtol () -が数字として解釈する文字列を指定する。 -(省略可能な) 二番目の引き数には -変換に使用される基数を指定する -(この引き数は -.BR atoi (3) -を使って数値に変換される。 -.BR atoi (3) -は -.BR strtol () -よりも簡単なインタフェースを持つ関数で、 -その中ではエラーチェックは行われない)。 -.\"O Some examples of the results produced by this program are the following: -このプログラムの実行例をいくつか以下に示す: +以下のプログラムは \fBstrtol\fP() の使用例である。 最初のコマンドライン引き数には \fBstrtol\fP() +が数字として解釈する文字列を指定する。 (省略可能な) 二番目の引き数には 変換に使用される基数を指定する (この引き数は \fBatoi\fP(3) +を使って数値に変換される。 \fBatoi\fP(3) は \fBstrtol\fP() よりも簡単なインタフェースを持つ関数で、 +その中ではエラーチェックは行われない)。 このプログラムの実行例をいくつか以下に示す: .in +4n .nf -.RB "$" " ./a.out 123" +$\fB ./a.out 123\fP strtol() returned 123 -.RB "$" " ./a.out \(aq 123\(aq" +$\fB ./a.out \(aq 123\(aq\fP strtol() returned 123 -.RB "$" " ./a.out 123abc" +$\fB ./a.out 123abc\fP strtol() returned 123 Further characters after number: abc -.RB "$" " ./a.out 123abc 55" +$\fB ./a.out 123abc 55\fP strtol: Invalid argument -.RB "$" " ./a.out \(aq\(aq" +$\fB ./a.out \(aq\(aq\fP No digits were found -.RB "$" " ./a.out 4000000000" +$\fB ./a.out 4000000000\fP strtol: Numerical result out of range .fi .in -.\"O .SS Program source .SS プログラムのソース \& .nf @@ -352,7 +149,7 @@ main(int argc, char *argv[]) long val; if (argc < 2) { - fprintf(stderr, "Usage: %s str [base]\\n", argv[0]); + fprintf(stderr, "Usage: %s str [base]\en", argv[0]); exit(EXIT_FAILURE); } @@ -371,24 +168,19 @@ main(int argc, char *argv[]) } if (endptr == str) { - fprintf(stderr, "No digits were found\\n"); + fprintf(stderr, "No digits were found\en"); exit(EXIT_FAILURE); } /* If we got here, strtol() successfully parsed a number */ - printf("strtol() returned %ld\\n", val); + printf("strtol() returned %ld\en", val); - if (*endptr != \(aq\\0\(aq) /* Not necessarily an error... */ - printf("Further characters after number: %s\\n", endptr); + if (*endptr != \(aq\e0\(aq) /* Not necessarily an error... */ + printf("Further characters after number: %s\en", endptr); exit(EXIT_SUCCESS); } .fi -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR atof (3), -.BR atoi (3), -.BR atol (3), -.BR strtod (3), -.BR strtoul (3) +\fBatof\fP(3), \fBatoi\fP(3), \fBatol\fP(3), \fBstrtod\fP(3), \fBstrtoul\fP(3) diff --git a/draft/man3/strtoul.3 b/draft/man3/strtoul.3 index 7549c449..136bb900 100644 --- a/draft/man3/strtoul.3 +++ b/draft/man3/strtoul.3 @@ -28,280 +28,94 @@ .\" Fixed typo, aeb, 950823 .\" 2002-02-22, joey, mihtjel: Added strtoull() .\" -.\" Japanese Version Copyright (c) 1999 AKAMATSU, Kazuo -.\" and 2006 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated Thu Jan 31 18:00:00 JST 1999 -.\" by AKAMATSU, Kazuo -.\" Updated & Modified 2006-07-20, -.\" Akihiro MOTOKI , LDP v2.36 +.\"******************************************************************* .\" -.\" WORD: base 基数 +.\" This file was generated with po4a. Translate the source file. .\" -.TH STRTOUL 3 2011-09-15 "GNU" "Linux Programmer's Manual" +.\"******************************************************************* +.TH STRTOUL 3 2011\-09\-15 GNU "Linux Programmer's Manual" .SH 名前 -.\"O strtoul, strtoull, strtouq \- convert a string to an unsigned long integer strtoul, strtoull, strtouq \- 文字列を unsigned long int に変換する .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "unsigned long int strtoul(const char *" nptr ", char **" endptr \ -", int " base ); +\fBunsigned long int strtoul(const char *\fP\fInptr\fP\fB, char **\fP\fIendptr\fP\fB, int \fP\fIbase\fP\fB);\fP .sp -.BI "unsigned long long int strtoull(const char *" nptr ", char **" endptr , -.BI " int " base ); +\fBunsigned long long int strtoull(const char *\fP\fInptr\fP\fB, char **\fP\fIendptr\fP\fB,\fP +\fB int \fP\fIbase\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR strtoull (): +\fBstrtoull\fP(): .RS 4 -XOPEN_SOURCE\ >=\ 600 || _BSD_SOURCE || _SVID_SOURCE || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +XOPEN_SOURCE\ >=\ 600 || _BSD_SOURCE || _SVID_SOURCE || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +または \fIcc\ \-std=c99\fP .RE .ad .SH 説明 -.\"O The -.\"O .BR strtoul () -.\"O function converts the initial part of the string -.\"O in \fInptr\fP to an -.\"O .I "unsigned long int" -.\"O value according to the -.\"O given \fIbase\fP, which must be between 2 and 36 inclusive, or be -.\"O the special value 0. -.BR strtoul () -関数は、 \fInptr\fP の文字列の最初の部分を、 -\fIbase\fP を基数として -.I "unsigned long int" -に変換する。 -この \fIbase\fP は 2 から 36 までの値 -あるいは特別な意味を持つ値 0 でなければならない。 +\fBstrtoul\fP() 関数は、 \fInptr\fP の文字列の最初の部分を、 \fIbase\fP を基数として \fIunsigned long int\fP +に変換する。 この \fIbase\fP は 2 から 36 までの値 あるいは特別な意味を持つ値 0 でなければならない。 .PP -.\"O The string may begin with an arbitrary amount of white space (as -.\"O determined by -.\"O .BR isspace (3)) -.\"O followed by a single optional \(aq+\(aq or \(aq\-\(aq -.\"O sign. -.\"O If \fIbase\fP is zero or 16, the string may then include a -.\"O "0x" prefix, and the number will be read in base 16; otherwise, a -.\"O zero \fIbase\fP is taken as 10 (decimal) unless the next character -.\"O is \(aq0\(aq, in which case it is taken as 8 (octal). -文字列の先頭には、任意の数の空白があってもよく (空白は -.BR ( isspace (3) -で判定される) 、また数字の直前には \(aq+\(aq か \(aq\-\(aq の -符号があってもよい。 -\fIbase\fP が 0 または 16 の場合には、 文字列の先頭に "0x" を置くことが -でき、その場合には文字列は 16進数として扱われる。 -これ以外の文字列で \fIbase\fP が 0 の場合は、 -文字列が \(aq0\(aq で始まるときは 8進数として、 -それ以外のときは 10進数として扱われる。 +文字列の先頭には、任意の数の空白があってもよく (空白は \fBisspace\fP(3) で判定される)、また数字の直前には \(aq+\(aq か +\(aq\-\(aq の 符号があってもよい。 \fIbase\fP が 0 または 16 の場合には、文字列の先頭に "0x" を置くことが +でき、その場合には文字列は 16進数として扱われる。 これ以外の文字列で \fIbase\fP が 0 の場合は、 文字列が \(aq0\(aq +で始まるときは 8進数として、 それ以外のときは 10進数として扱われる。 .PP -.\"O The remainder of the string is converted to an -.\"O .I "unsigned long int" -.\"O value in the obvious manner, -.\"O stopping at the first character which is not a -.\"O valid digit in the given base. -.\"O (In bases above 10, the letter \(aqA\(aq in -.\"O either upper or lower case represents 10, \(aqB\(aq represents 11, and so -.\"O forth, with \(aqZ\(aq representing 35.) -文字列の残りの部分は -.I "unsigned long int" -に変換されるが、基数に対して -有効でない数字が現れた時点で変換は終了する。(11進数以上では \(aqA\(aq は -大文字・小文字に関わらず 10 を表し、 \(aqB\(aq は 11 を表現し, -以下同様に、 \(aqZ\(aq は 35 を表す。) +文字列の残りの部分は \fIunsigned long int\fP に変換されるが、基数に対して +有効でない数字が現れた時点で変換は終了する。(11進数以上では \(aqA\(aq は 大文字・小文字に関わらず 10 を表し、 \(aqB\(aq は +11 を表現し, 以下同様に、 \(aqZ\(aq は 35 を表す。) .PP -.\"O If \fIendptr\fP is not NULL, -.\"O .BR strtoul () -.\"O stores the address of the -.\"O first invalid character in \fI*endptr\fP. -.\"O If there were no digits at -.\"O all, -.\"O .BR strtoul () -.\"O stores the original value of \fInptr\fP in -.\"O \fI*endptr\fP (and returns 0). -.\"O In particular, if \fI*nptr\fP is not \(aq\\0\(aq but \fI**endptr\fP -.\"O is \(aq\\0\(aq on return, the entire string is valid. -\fIendptr\fP がヌル値 (NULL) でない場合、 -.BR strtoul () -は最初に不正な文字が現れたアドレスを -\fI*endptr\fP に格納している。 -文字列に有効な数字がひとつもなければ、 -.BR strtoul () -は \fInptr\fP -の元の値を \fI*endptr\fP に代入する(そして 0 を返す)。 -特に、 \fI*nptr\fP が \(aq\\0\(aq 以外で、返された \fI**endptr\fP が -\(aq\\0\(aq ならば、文字列全体が有効だったことになる。 +\fIendptr\fP がヌル値 (NULL) でない場合、 \fBstrtoul\fP() は最初に不正な文字が現れたアドレスを \fI*endptr\fP +に格納している。 文字列に有効な数字がひとつもなければ、 \fBstrtoul\fP() は \fInptr\fP の元の値を \fI*endptr\fP +に代入する(そして 0 を返す)。 特に、 \fI*nptr\fP が \(aq\e0\(aq 以外で、返された \fI**endptr\fP が +\(aq\e0\(aq ならば、文字列全体が有効だったことになる。 .PP -.\"O The -.\"O .BR strtoull () -.\"O function works just like the -.\"O .BR strtoul () -.\"O function but returns an -.\"O .I "unsigned long long int" -.\"O value. -.BR strtoull () -関数は -.BR strtoul () -関数と同様だが、 -.I "unsigned long long int" -型の値を返す。 +\fBstrtoull\fP() 関数は \fBstrtoul\fP() 関数と同様だが、 \fIunsigned long long int\fP 型の値を返す。 .SH 返り値 -.\"O The -.\"O .BR strtoul () -.\"O function returns either the result of the conversion -.\"O or, if there was a leading minus sign, the negation of the result of the -.\"O conversion represented as an unsigned value, -.\"O unless the original (nonnegated) value would overflow; in -.\"O the latter case, -.\"O .BR strtoul () -.\"O returns -.\"O .B ULONG_MAX -.\"O and sets \fIerrno\fP to -.\"O .BR ERANGE . -.BR strtoul () -関数は変換結果を返す。文字列がマイナス符号から始まっていた場 -合は、(符号反転前の値がオーバーフローしていなければ) 変換結果を符号反転した -値を unsigned 型で返す。変換でオーバーフローが発生した場合は -.B ULONG_MAX -を返し、 -.I errno -に -.B ERANGE -を設定する。 -.\"O Precisely the same holds for -.\"O .BR strtoull () -.\"O (with -.\"O .B ULLONG_MAX -.\"O instead of -.\"O .BR ULONG_MAX ). -.RB ( ULONG_MAX -を -.B ULLONG_MAX -と読み替えれば) -.BR strtoull () -は -.BR strtoul () -と全く同じである。 +\fBstrtoul\fP() 関数は変換結果を返す。文字列がマイナス符号から始まっていた場 合は、(符号反転前の値がオーバーフローしていなければ) +変換結果を符号反転した 値を unsigned 型で返す。変換でオーバーフローが発生した場合は \fBULONG_MAX\fP を返し、 \fIerrno\fP に +\fBERANGE\fP を設定する。 (\fBULONG_MAX\fP を \fBULLONG_MAX\fP と読み替えれば) \fBstrtoull\fP() は +\fBstrtoul\fP() と全く同じである。 .SH エラー -.TP -.B EINVAL -.\"O (not in C99) -.\"O The given -.\"O .I base -.\"O contains an unsupported value. -(C99 にはない) -与えられた -.I base -がサポートされていない値である。 -.TP -.B ERANGE -.\"O The resulting value was out of range. -文字列が数値の表現範囲外である。 +.TP +\fBEINVAL\fP +(C99 にはない) 指定された \fIbase\fP がサポートされていない値である。 +.TP +\fBERANGE\fP +結果の値が範囲外である。 .LP -.\"O The implementation may also set \fIerrno\fP to \fBEINVAL\fP in case -.\"O no conversion was performed (no digits seen, and 0 returned). -実装によっては、全く変換が行われなかった場合(全く数字が現れず、 -0 が返される)、\fIerrno\fP に \fBEINVAL\fP がセットされるかもしれない。 -.\"O .SH "CONFORMING TO" +実装によっては、変換が行われなかった場合 (数字がなく、0 を返した場合)、 \fIerrno\fP に \fBEINVAL\fP が設定される場合がある。 .SH 準拠 -.\"O .BR strtoul () -.\"O conforms to SVr4, C89, C99 and POSIX-2001, and -.\"O .BR strtoull () -.\"O to C99 and POSIX.1-2001. -.BR strtoul () -は SVr4, C89, C99 と POSIX-2001 に準拠している。 -.BR strtoull () -は C99 と POSIX.1-2001 に準拠している。 -.\"O .SH NOTES +\fBstrtoul\fP() は SVr4, C89, C99 と POSIX\-2001 に準拠している。 \fBstrtoull\fP() は C99 と +POSIX.1\-2001 に準拠している。 .SH 注意 -.\"O Since -.\"O .BR strtoul () -.\"O can legitimately return 0 or -.\"O .B ULONG_MAX -.\"O .RB ( ULLONG_MAX -.\"O for -.\"O .BR strtoull ()) -.\"O on both success and failure, the calling program should set -.\"O .I errno -.\"O to 0 before the call, -.\"O and then determine if an error occurred by checking whether -.\"O .I errno -.\"O has a nonzero value after the call. -.B strtoul () -からは成功、失敗どちらの場合でも 0 や -.B ULONG_MAX -.RB ( strtoull () -では -.BR ULLONG_MAX ) -が返る可能性があるので、 -プログラムは関数を呼び出す前に -.I errno -を 0 に設定し、呼び出し後に -.I errno -が 0 以外の値かどうかを確認しエラーが発生したかどうかを判断する -必要がある。 +\fBstrtoul ()\fP からは成功、失敗どちらの場合でも 0 や \fBULONG_MAX\fP (\fBstrtoull\fP() では +\fBULLONG_MAX\fP) が返る可能性があるので、 プログラムは関数を呼び出す前に \fIerrno\fP を 0 に設定し、呼び出し後に +\fIerrno\fP が 0 以外の値かどうかを確認しエラーが発生したかどうかを判断する 必要がある。 -.\"O In locales other than the "C" locale, other strings may be accepted. -"C" 以外のロケールの場合、その他の文字列も受け付けられるかもしれない。 -.\"O (For example, the thousands separator of the current locale may be -.\"O supported.) -(例えば、現在のロケールの 1000 毎の区切り文字に対応しているかもしれない。) +"C" 以外のロケールの場合、その他の文字列も受け付けられるかもしれない。 (例えば、現在のロケールの 1000 +毎の区切り文字に対応しているかもしれない。) .LP -.\"O BSD also has BSD には、 .sp .in +4n .nf -.BI "u_quad_t strtouq(const char *" nptr ", char **" endptr ", int " base ); +\fBu_quad_t strtouq(const char *\fP\fInptr\fP\fB, char **\fP\fIendptr\fP\fB, int \fP\fIbase\fP\fB);\fP .sp .in -4n .fi -.\"O with completely analogous definition. -という完全に同様の定義を持つ関数がある。 -.\"O Depending on the wordsize of the current architecture, this -.\"O may be equivalent to -.\"O .BR strtoull () -.\"O or to -.\"O .BR strtoul (). -使用中のアーキテクチャのワード長次第であるが、この関数は -.BR strtoull () -や -.BR stroul () -と等価な場合もありえる。 +という完全に同様の定義を持つ関数がある。 使用中のアーキテクチャのワード長次第であるが、この関数は \fBstrtoull\fP() や +\fBstroul\fP() と等価な場合もありえる。 -.\"O Negative values are considered valid input and are -.\"O silently converted to the equivalent -.\"O .I "unsigned long int" -.\"O value. -負の値も正当な入力とみなされ、エラーもなく、 -対応する -.I "unsigned long int" -型の値に変換される。 -.\"O .SH EXAMPLE +負の値も正当な入力とみなされ、エラーもなく、 対応する \fIunsigned long int\fP 型の値に変換される。 .SH 例 -.\"O See the example on the -.\"O .BR strtol (3) -.\"O manual page; -.\"O the use of the functions described in this manual page is similar. -.BR strtol (3) -のマニュアルページの例を参照。 -このページで説明した関数の使用方法も同様である。 -.\"O .SH "SEE ALSO" +\fBstrtol\fP(3) のマニュアルページの例を参照。 このページで説明した関数の使用方法も同様である。 .SH 関連項目 -.BR atof (3), -.BR atoi (3), -.BR atol (3), -.BR strtod (3), -.BR strtol (3) +\fBatof\fP(3), \fBatoi\fP(3), \fBatol\fP(3), \fBstrtod\fP(3), \fBstrtol\fP(3) diff --git a/draft/man3/strverscmp.3 b/draft/man3/strverscmp.3 index a1ebecb7..307d2b03 100644 --- a/draft/man3/strverscmp.3 +++ b/draft/man3/strverscmp.3 @@ -20,138 +20,45 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated Sat Sep 21 08:34:42 2002 -.\" by Akihiro MOTOKI +.\"******************************************************************* .\" -.TH STRVERSCMP 3 2001-12-19 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH STRVERSCMP 3 2001\-12\-19 GNU "Linux Programmer's Manual" .SH 名前 -.\"O strverscmp \- compare two version strings strverscmp \- 2つのバージョン文字列を比較する -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" +\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */ .br -.B #include +\fB#include \fP .sp -.BI "int strverscmp(const char *" s1 ", const char *" s2 ); +\fBint strverscmp(const char *\fP\fIs1\fP\fB, const char *\fP\fIs2\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O Often one has files -.\"O .IR jan1 ", " jan2 ", ..., " jan9 ", " jan10 ", ..." -.\"O and it feels wrong when -.\"O .BR ls (1) -.\"O orders them -.\"O .IR jan1 ", " jan10 ", ..., " jan2 ", ..., " jan9 . -.IR jan1 ", " jan2 ", ..., " jan9 ", " jan10 ", ..." -といった名前のファイルがある状況はよくあるが、 -.BR ls (1) -を実行したときに -.IR jan1 ", " jan10 ", ..., " jan2 ", ..., " jan9 -の順番で表示されるのには違和感がある。 -.\"O .\" classical solution: "rename jan jan0 jan?" -.\" これまでの解決方法: "rename jan jan0 jan?" -.\"O In order to rectify this, GNU introduced the -.\"O .I \-v -.\"O option to -.\"O .BR ls (1), -.\"O which is implemented using -.\"O .BR versionsort (3), -.\"O which again uses -.\"O .BR strverscmp (). -これを修正するために、GNU は -.BR ls (1) -に -.I \-v -オプションを導入した。 -この機能は -.BR versionsort (3) -を使って実装されているが、この中で -.BR strverscmp () -が使用されている。 +.\" classical solution: "rename jan jan0 jan?" +\fIjan1\fP, \fIjan2\fP, ..., \fIjan9\fP, \fIjan10\fP, ... といった名前のファイルがある状況はよくあるが、 +\fBls\fP(1) を実行したときに \fIjan1\fP, \fIjan10\fP, ..., \fIjan2\fP, ..., \fIjan9\fP +の順番で表示されるのには違和感がある。 これを修正するために、GNU は \fBls\fP(1) に \fI\-v\fP オプションを導入した。 この機能は +\fBversionsort\fP(3) を使って実装されているが、この中で \fBstrverscmp\fP() が使用されている。 -.\"O Thus, the task of -.\"O .BR strverscmp () -.\"O is to compare two strings and find the "right" order, while -.\"O .BR strcmp (3) -.\"O only finds the lexicographic order. -.\"O This function does not use -.\"O the locale category -.\"O .BR LC_COLLATE , -.\"O so is meant mostly for situations -.\"O where the strings are expected to be in ASCII. -このように -.BR strverscmp () -の役目は2つの文字列を比較して「正しい」順序を探すことである。 -これに対して -.BR strcmp (3) -は辞書順で比較した結果を返すだけである。 -関数 -.BR strverscmp () -はロケールのカテゴリである -.B LC_COLLATE -を使用しない。 -このことから、この関数が主にアスキー文字から成る文字列を -想定していることが分かる。 +このように \fBstrverscmp\fP() の役目は2つの文字列を比較して「正しい」順序を探すことである。 これに対して \fBstrcmp\fP(3) +は辞書順で比較した結果を返すだけである。 関数 \fBstrverscmp\fP() はロケールのカテゴリである \fBLC_COLLATE\fP を使用しない。 +このことから、この関数が主にアスキー文字から成る文字列を 想定していることが分かる。 -.\"O What this function does is the following. -この関数の動作は以下の通りである。 -.\"O If both strings are equal, return 0. -.\"O Otherwise find the position -.\"O between two bytes with the property that before it both strings are equal, -.\"O while directly after it there is a difference. -両方の文字列が等しい場合、0 を返す。 -それ以外の場合、その直前までは両方の文字列が等しく、 -その直後のバイトで両者に違いがあるような、バイトの境界を探す。 -.\"O Find the largest consecutive digit strings containing (or starting at, -.\"O or ending at) this position. -.\"O If one or both of these is empty, -見つかったバイト境界を含む数字列(数字だけの文字列)の最長一致検索を行う。 -(数字列は境界から始まっていても、境界で終わっていてもよい)。 -.\"O then return what -.\"O .BR strcmp (3) -.\"O would have returned (numerical ordering of byte values). -2つの文字列から得られた数字列の一方または両方が空であれば、 -.BR strcmp (3) -が返した結果を関数の返り値として返す。 -すなわち、バイト値を比較した結果を返す。 -.\"O Otherwise, compare both digit strings numerically, where digit strings with -.\"O one or more leading zeros are interpreted as if they have a decimal point -.\"O in front (so that in particular digit strings with more leading zeros -.\"O come before digit strings with fewer leading zeros). -それ以外の(数字列が両方とも空でない)場合、両方の数字列を数字順で比較する。 -このとき、1つ以上の 0 が先頭にある数字列は、前に小数点がついているものと -解釈される。(先頭に 0 が多くある数字列ほど前に来ることになる) -.\"O Thus, the ordering is -.\"O .IR 000 ", " 00 ", " 01 ", " 010 ", " 09 ", " 0 ", " 1 ", " 9 ", " 10 . -この結果、順序は次のようになる: -.IR 000 ", " 00 ", " 01 ", " 010 ", " 09 ", " 0 ", " 1 ", " 9 ", " 10 -.\"O .SH "RETURN VALUE" +この関数の動作は以下の通りである。 両方の文字列が等しい場合、0 を返す。 それ以外の場合、その直前までは両方の文字列が等しく、 +その直後のバイトで両者に違いがあるような、バイトの境界を探す。 見つかったバイト境界を含む数字列(数字だけの文字列)の最長一致検索を行う。 +(数字列は境界から始まっていても、境界で終わっていてもよい)。 2つの文字列から得られた数字列の一方または両方が空であれば、 \fBstrcmp\fP(3) +が返した結果を関数の返り値として返す。 すなわち、バイト値を比較した結果を返す。 +それ以外の(数字列が両方とも空でない)場合、両方の数字列を数字順で比較する。 このとき、1つ以上の 0 +が先頭にある数字列は、前に小数点がついているものと 解釈される。(先頭に 0 が多くある数字列ほど前に来ることになる) +この結果、順序は次のようになる: \fI000\fP, \fI00\fP, \fI01\fP, \fI010\fP, \fI09\fP, \fI0\fP, \fI1\fP, \fI9\fP, +\fI10\fP .SH 返り値 -.\"O The -.\"O .BR strverscmp () -.\"O function returns an integer -.\"O less than, equal to, or greater than zero if \fIs1\fP -.\"O is found, respectively, to be earlier than, equal to, -.\"O or later than \fIs2\fP. -関数 -.BR strverscmp () -は、ゼロよりも -1)小さい、2)等しい、3)大きいのいずれかの整数を返す。 -それぞれは、\fIs1\fP が \fIs2\fP よりも、 -1)小さい、2)等しい、3)大きい ことを示す。 -.\"O .SH "CONFORMING TO" +関数 \fBstrverscmp\fP() は、ゼロよりも 1)小さい、2)等しい、3)大きいのいずれかの整数を返す。 それぞれは、\fIs1\fP が +\fIs2\fP よりも、 1)小さい、2)等しい、3)大きい ことを示す。 .SH 準拠 -.\"O This function is a GNU extension. この関数は GNU による拡張である。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR rename (1), -.BR strcasecmp (3), -.BR strcmp (3), -.BR strcoll (3) +\fBrename\fP(1), \fBstrcasecmp\fP(3), \fBstrcmp\fP(3), \fBstrcoll\fP(3) diff --git a/draft/man3/strxfrm.3 b/draft/man3/strxfrm.3 index 8e4011c3..bcaa3bad 100644 --- a/draft/man3/strxfrm.3 +++ b/draft/man3/strxfrm.3 @@ -25,91 +25,33 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sun Jul 25 10:41:28 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1998 SHOJI Yasushi all rights reserved. -.\" Translated Fri Jun 26 1998 by SHOJI Yasushi -.\" Updated & Modefied Sun Mar 7 1999 by Shouichi Saito +.\" This file was generated with po4a. Translate the source file. .\" -.TH STRXFRM 3 2011-09-28 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O strxfrm \- string transformation +.\"******************************************************************* +.TH STRXFRM 3 2011\-09\-28 GNU "Linux Programmer's Manual" .SH 名前 strxfrm \- 文字列の変換 .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "size_t strxfrm(char *" dest ", const char *" src ", size_t " n ); +\fBsize_t strxfrm(char *\fP\fIdest\fP\fB, const char *\fP\fIsrc\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi -.\"O .SH DESCRIPTION -.\"O The -.\"O .BR strxfrm () -.\"O function transforms the \fIsrc\fP string into a -.\"O form such that the result of -.\"O .BR strcmp (3) -.\"O on two strings that have -.\"O been transformed with -.\"O .BR strxfrm () -.\"O is the same as the result of -.\"O .BR strcoll (3) -.\"O on the two strings before their transformation. -.\"O The first \fIn\fP characters of the transformed string are placed in -.\"O \fIdest\fP. -.\"O The transformation is based on the program's current -.\"O locale for category \fBLC_COLLATE\fP. (See -.\"O .BR setlocale (3)). .SH 説明 -.BR strxfrm () -関数は文字列 \fIsrc\fP に対して、次の条件を満たすよう -な変換をする: 「ある二つの文字列に対して、それぞれを -.BR strxfrm () -で変換してから -.BR strcmp (3) -した結果と、 -.BR strxfrm () -による変換 -を行わずに -.BR strcoll (3) -した結果と同じ」 -変換した文字列の先頭から \fIn\fP 文字分が \fIdest\fP に代入される。 -変換は、カテゴリ \fBLC_COLLATE\fP に対する、プログラムの現在のロケール -に基づいて行われる -.RB ( setlocale (3) -を参照のこと)。 -.\"O .SH "RETURN VALUE" -.\"O The -.\"O .BR strxfrm () -.\"O function returns the number of bytes required to -.\"O store the transformed string in \fIdest\fP excluding the -.\"O terminating null byte (\(aq\\0\(aq). -.\"O If the value returned is \fIn\fP or more, the -.\"O contents of \fIdest\fP are indeterminate. +\fBstrxfrm\fP() 関数は文字列 \fIsrc\fP に対して、次の条件を満たすよう な変換をする: 「ある二つの文字列に対して、それぞれを +\fBstrxfrm\fP() で変換してから \fBstrcmp\fP(3) した結果と、 \fBstrxfrm\fP() による変換 を行わずに +\fBstrcoll\fP(3) した結果と同じ」 変換した文字列の先頭から \fIn\fP 文字分が \fIdest\fP に代入される。 変換は、カテゴリ +\fBLC_COLLATE\fP に対する、プログラムの現在のロケール に基づいて行われる (\fBsetlocale\fP(3) を参照のこと)。 .SH 返り値 -.BR strxfrm () -関数は、変換された文字列を \fIdest\fP に代入するときに -必要なバイト数から、終端の NULL バイト (\(aq\\0\(aq) の分を -引いたものを返す。もし返り値が \fIn\fP 以上の場合、 -\fIdest\fP の内容は不定となる。 +\fBstrxfrm\fP() 関数は、変換された文字列を \fIdest\fP に代入するときに 必要なバイト数から、終端の NULL バイト +(\(aq\e0\(aq) の分を 引いたものを返す。もし返り値が \fIn\fP 以上の場合、 \fIdest\fP の内容は不定となる。 .SH 準拠 SVr4, 4.3BSD, C89, C99. -.\"O .SH NOTES -.\"O In the \fI"POSIX"\fP or \fI"C"\fP locales -.\"O .BR strxfrm () -.\"O is equivalent to -.\"O copying the string with -.\"O .BR strncpy (3). .SH 注意 -\fI"POSIX"\fP または \fI"C"\fP ロケールでは、関数 -.BR strxfrm () -は、 -関数 -.BR strncpy (3) +\fI"POSIX"\fP または \fI"C"\fP ロケールでは、関数 \fBstrxfrm\fP() は、 関数 \fBstrncpy\fP(3) を使って文字列をコピーするのと同じである。 .SH 関連項目 -.BR bcmp (3), -.BR memcmp (3), -.BR setlocale (3), -.BR strcasecmp (3), -.BR strcmp (3), -.BR strcoll (3), -.BR string (3) +\fBbcmp\fP(3), \fBmemcmp\fP(3), \fBsetlocale\fP(3), \fBstrcasecmp\fP(3), \fBstrcmp\fP(3), +\fBstrcoll\fP(3), \fBstring\fP(3) diff --git a/draft/man3/swab.3 b/draft/man3/swab.3 index 0f5e2e7b..3851c654 100644 --- a/draft/man3/swab.3 +++ b/draft/man3/swab.3 @@ -26,60 +26,30 @@ .\" 386BSD man pages .\" Modified Sat Jul 24 17:52:15 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified 2001-12-15, aeb +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka -.\" all rights reserved. -.\" Translated Fri Dec 19 13:24:02 JST 1997 -.\" by HIROFUMI Nishizuka -.\" Updated Fri Dec 21 JST 2001 by Kentaro Shirakata +.\" This file was generated with po4a. Translate the source file. .\" -.TH SWAB 3 2001-12-15 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH SWAB 3 2001\-12\-15 "" "Linux Programmer's Manual" .SH 名前 -.\"O swab \- swap adjacent bytes swab \- 隣接するバイトを交換する -.\"O .SH SYNOPSIS .SH 書式 .nf -.\"O .BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */" -.BR "#define _XOPEN_SOURCE" " /* feature_test_macros(7) 参照 */" -.B #include +\fB#define _XOPEN_SOURCE\fP /* feature_test_macros(7) 参照 */ +\fB#include \fP .sp -.BI "void swab(const void *" from ", void *" to ", ssize_t " n ); +\fBvoid swab(const void *\fP\fIfrom\fP\fB, void *\fP\fIto\fP\fB, ssize_t \fP\fIn\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR swab () -.\"O function copies \fIn\fP bytes from the array pointed -.\"O to by \fIfrom\fP to the array pointed to by \fIto\fP, exchanging -.\"O adjacent even and odd bytes. -.\"O This function is used to exchange data -.\"O between machines that have different low/high byte ordering. -.BR swab () -関数は、\fIfrom\fP で指された配列から \fIn\fP バイトを -\fIto\fP で指された配列に、隣接した偶数/奇数バイトを交換しながらコピーする。 -この関数は異なるバイトオーダーを持つマシン間でのデータ交換に -使用される。 +\fBswab\fP() 関数は、\fIfrom\fP で指された配列から \fIn\fP バイトを \fIto\fP +で指された配列に、隣接した偶数/奇数バイトを交換しながらコピーする。 この関数は異なるバイトオーダーを持つマシン間でのデータ交換に 使用される。 .LP -.\"O This function does nothing when \fIn\fP is negative. -.\"O When \fIn\fP is positive and odd, it handles \fIn\-1\fP bytes -.\"O as above, and does something unspecified with the last byte. -.\"O (In other words, \fIn\fP should be even.) -\fIn\fP が負の数の場合、この関数は何もしない。 -\fIn\fP が正でかつ奇数の場合、\fIn\-1\fP バイトは上記の通り扱い、 -最後のバイトについては未規定の動作をする -(言い換えれば、\fIn\fP は偶数にするべきである)。 -.\"O .SH "RETURN VALUE" +\fIn\fP が負の数の場合、この関数は何もしない。 \fIn\fP が正でかつ奇数の場合、\fIn\-1\fP バイトは上記の通り扱い、 +最後のバイトについては未規定の動作をする (言い換えれば、\fIn\fP は偶数にするべきである)。 .SH 返り値 -.\"O The -.\"O .BR swab () -.\"O function returns no value. -.BR swab () -関数は、値を返さない。 -.\"O .SH "CONFORMING TO" +\fBswab\fP() 関数は、値を返さない。 .SH 準拠 -SVr4, 4.3BSD, POSIX.1-2001. -.\"O .SH "SEE ALSO" +SVr4, 4.3BSD, POSIX.1\-2001. .SH 関連項目 -.BR bstring (3) +\fBbstring\fP(3) diff --git a/draft/man3/sysconf.3 b/draft/man3/sysconf.3 index 349effe7..260557c1 100644 --- a/draft/man3/sysconf.3 +++ b/draft/man3/sysconf.3 @@ -22,521 +22,186 @@ .\" License. .\" Modified Sat Jul 24 17:51:42 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified Tue Aug 17 11:42:20 1999 by Ariel Scolnicov (ariels@compugen.co.il) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1998 ISHIKAWA Mutsumi, all rights reserved. -.\" Translated 1998-06-03, ISHIKAWA Mutsumi -.\" Updated 1999-12-08, Kentaro Shirakata -.\" Updated 2002-10-16, Kentaro Shirakata -.\" Updated 2005-03-15, Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.TH SYSCONF 3 2007-12-12 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O sysconf \- Get configuration information at runtime +.\"******************************************************************* +.TH SYSCONF 3 2012\-04\-15 GNU "Linux Programmer's Manual" .SH 名前 sysconf \- 動作中に設定情報を取得する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "long sysconf(int " "name" ); +\fBlong sysconf(int \fP\fIname\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O POSIX allows an application to test at compile or run time -.\"O whether certain options are supported, or what the value is -.\"O of certain configurable constants or limits. -POSIX では、アプリケーションがコンパイル時や実行時に、 -特定のオプションがサポートされているかや、 +POSIX では、アプリケーションがコンパイル時や実行時に、 特定のオプションがサポートされているかや、 設定可能な特定の定数や制限がどんな値かをテストすることができる。 .LP -.\"O At compile time this is done by including -.\"O .I -.\"O and/or -.\"O .I -.\"O and testing the value of certain macros. -コンパイル時に行うには、 -.I -と -.I -の両方もしくは一方をインクルードし、 -特定のマクロの値を確認する。 +コンパイル時に行うには、 \fI\fP と \fI\fP +の両方もしくは一方をインクルードし、 特定のマクロの値を確認する。 .LP -.\"O At run time, one can ask for numerical values using the present function -.\"O .BR sysconf (). -.\"O One can ask for numerical values that may depend -.\"O on the file system a file is in using the calls -.\"O .BR fpathconf (3) -.\"O and -.\"O .BR pathconf (3). -.\"O One can ask for string values using -.\"O .BR confstr (3). -実行時には、ここで説明する関数 -.BR sysconf () -を使って数値を問い合わせることができる。 -ファイルが存在するファイルシステムに関する数値は、 -.BR fpathconf (3) -と -.BR pathconf (3) -を使って確認できる。 -文字列の値は -.BR confstr (3) +実行時には、ここで説明する関数 \fBsysconf\fP() を使って数値を問い合わせることができる。 ファイルが存在するファイルシステムに関する数値は、 +\fBfpathconf\fP(3) と \fBpathconf\fP(3) を使って確認できる。 文字列の値は \fBconfstr\fP(3) を使って確認できる。 .LP -.\"O The values obtained from these functions are system configuration constants. -.\"O They do not change during the lifetime of a process. -.\"O .\" except that sysconf(_SC_OPEN_MAX) may change answer after a call -.\"O .\" to setrlimit( ) which changes the RLIMIT_NOFILE soft limit -これらの関数で取得される値は設定可能なシステム定数である。 -これらはプロセスの生存期間の間は変化しない。 -.\" 但し RLIMIT_NOFILE ソフト・リミットを変更する setrlimit() が呼び出した -.\" 後では、 sysconf(_SC_OPEN_MAX) が返す値は変化するかもしれない。 +.\" except that sysconf(_SC_OPEN_MAX) may change answer after a call +.\" to setrlimit( ) which changes the RLIMIT_NOFILE soft limit +これらの関数で取得される値は設定可能なシステム定数である。 これらはプロセスの生存期間の間は変化しない。 .LP -.\"O For options, typically, there is a constant -.\"O .B _POSIX_FOO -.\"O that may be defined in -.\"O .IR . -.\"O If it is undefined, one should ask at run time. -.\"O If it is defined to \-1, then the option is not supported. -.\"O If it is defined to 0, then relevant functions and headers exist, -.\"O but one has to ask at runtime what degree of support is available. -.\"O If it is defined to a value other than \-1 or 0, then the option is -.\"O supported. -.\"O Usually the value (such as 200112L) indicates the year and month -.\"O of the POSIX revision describing the option. -.\"O Glibc uses the value 1 -.\"O to indicate support as long as the POSIX revision has not been published yet. -オプションを確認できるように、たいていは -.I -で定数 -.B _POSIX_FOO -が定義されている。 -定義されていないときは、実行時に問い合わせを行う必要がある。 -その値が \-1 に定義されているときは、そのオプションはサポートされていない。 -0 に定義されているときは、関連する関数やヘッダファイルが存在するが、 -どの程度サポートされているかは実行時に確認しなければならない。 -\-1 でも 0 でもない値に定義されているときは、そのオプションがサポート -されている。通常は、そのオプションについて記載した POSIX の改訂年月 -を示す値になっている (例えば 200112L)。 -glibc では 1 が設定されていると、そのオプションはサポートされているが、 -POSIX の改訂版がまだ発行されていないことを示す。 -.\"O .\" and 999 to indicate support for options no longer present in the latest -.\"O .\" standard. (?) -.\" 999 は、そのオプションはサポートされているが、 -.\" 最新の標準にはもはや存在しないことを示す。(?) -.\"O The -.\"O .BR sysconf () -.\"O argument will be -.\"O .BR _SC_FOO . -.\"O For a list of options, see -.\"O .BR posixoptions (7). -.BR sysconf () -の引き数には -.B _SC_FOO -を指定する。 -オプションのリストについては -.BR posixoptions (7) -を参照のこと。 +.\" and 999 to indicate support for options no longer present in the latest +.\" standard. (?) +オプションを確認できるように、たいていは \fI\fP で定数 \fB_POSIX_FOO\fP が定義されている。 +定義されていないときは、実行時に問い合わせを行う必要がある。 その値が \-1 に定義されているときは、そのオプションはサポートされていない。 0 +に定義されているときは、関連する関数やヘッダファイルが存在するが、 どの程度サポートされているかは実行時に確認しなければならない。 \-1 でも 0 +でもない値に定義されているときは、そのオプションがサポート されている。通常は、そのオプションについて記載した POSIX の改訂年月 +を示す値になっている (例えば 200112L)。 glibc では 1 が設定されていると、そのオプションはサポートされているが、 POSIX +の改訂版がまだ発行されていないことを示す。 \fBsysconf\fP() の引き数には \fB_SC_FOO\fP を指定する。 オプションのリストについては +\fBposixoptions\fP(7) を参照のこと。 .LP -.\"O For variables or limits, typically, there is a constant -.\"O .BR _FOO , -.\"O maybe defined in -.\"O .IR , -.\"O or -.\"O .BR _POSIX_FOO , -.\"O maybe defined in -.\"O .IR . -変数や制限を確認できるように、たいていは、 -.I -で定数 -.B _FOO -が、 -.I -で -.B _POSIX_FOO -が定義されている。 -.\"O The constant will not be defined if the limit is unspecified. -.\"O If the constant is defined, it gives a guaranteed value, and -.\"O a greater value might actually be supported. -.\"O If an application wants to take advantage of values which may change -.\"O between systems, a call to -.\"O .BR sysconf () -.\"O can be made. -制限が規定されていない場合は定数は定義されない。 -定数が定義されているときには、その定数は保証できる値であり、 -実際にはもっと大きな値がサポートされていることもある。 -アプリケーションがシステム毎に変化する値を利用したい場合には、 -.BR sysconf () -を呼び出すことで実現できる。 -.\"O The -.\"O .BR sysconf () -.\"O argument will be -.\"O .BR _SC_FOO . -.BR sysconf () -の引き数には -.B _SC_FOO -を指定する。 -.\"O .SS "POSIX.1 Variables" +変数や制限を確認できるように、たいていは、 \fI\fP で定数 \fB_FOO\fP が、 +\fI\fP で \fB_POSIX_FOO\fP が定義されている。 制限が規定されていない場合は定数は定義されない。 +定数が定義されているときには、その定数は保証できる値であり、 実際にはもっと大きな値がサポートされていることもある。 +アプリケーションがシステム毎に変化する値を利用したい場合には、 \fBsysconf\fP() を呼び出すことで実現できる。 \fBsysconf\fP() +の引き数には \fB_SC_FOO\fP を指定する。 .SS "POSIX.1 変数" -.\"O We give the name of the variable, the name of the -.\"O .BR sysconf () -.\"O argument used to inquire about its value, -.\"O and a short description. -変数名、その値を取得するのに使われる -.BR sysconf () -のパラメータ名、簡単な説明を以下に示す。 +変数名、その値を取得するのに使われる \fBsysconf\fP() のパラメータ名、簡単な説明を以下に示す。 .LP -.\"O First, the POSIX.1 compatible values. +.\" [for the moment: only the things that are unconditionally present] +.\" .TP +.\" .BR AIO_LISTIO_MAX " - " _SC_AIO_LISTIO_MAX +.\" (if _POSIX_ASYNCHRONOUS_IO) +.\" Maximum number of I/O operations in a single list I/O call. +.\" Must not be less than _POSIX_AIO_LISTIO_MAX. +.\" .TP +.\" .BR AIO_MAX " - " _SC_AIO_MAX +.\" (if _POSIX_ASYNCHRONOUS_IO) +.\" Maximum number of outstanding asynchronous I/O operations. +.\" Must not be less than _POSIX_AIO_MAX. +.\" .TP +.\" .BR AIO_PRIO_DELTA_MAX " - " _SC_AIO_PRIO_DELTA_MAX +.\" (if _POSIX_ASYNCHRONOUS_IO) +.\" The maximum amount by which a process can decrease its +.\" asynchronous I/O priority level from its own scheduling priority. +.\" Must be nonnegative. まず POSIX.1 互換の変数を示す。 -.\"O .\" [for the moment: only the things that are unconditionally present] -.\"O .\" .TP -.\"O .\" .BR AIO_LISTIO_MAX " - " _SC_AIO_LISTIO_MAX -.\"O .\" (if _POSIX_ASYNCHRONOUS_IO) -.\"O .\" Maximum number of I/O operations in a single list I/O call. -.\"O .\" Must not be less than _POSIX_AIO_LISTIO_MAX. -.\"O .\" .TP -.\"O .\" .BR AIO_MAX " - " _SC_AIO_MAX -.\"O .\" (if _POSIX_ASYNCHRONOUS_IO) -.\"O .\" Maximum number of outstanding asynchronous I/O operations. -.\"O .\" Must not be less than _POSIX_AIO_MAX. -.\"O .\" .TP -.\"O .\" .BR AIO_PRIO_DELTA_MAX " - " _SC_AIO_PRIO_DELTA_MAX -.\"O .\" (if _POSIX_ASYNCHRONOUS_IO) -.\"O .\" The maximum amount by which a process can decrease its -.\"O .\" asynchronous I/O priority level from its own scheduling priority. -.\"O .\" Must be nonnegative. -.TP -.BR ARG_MAX " - " _SC_ARG_MAX -.\"O The maximum length of the arguments to the -.\"O .BR exec (3) -.\"O family of functions. -.\"O Must not be less than -.\"O .B _POSIX_ARG_MAX -.\"O (4096). -.BR exec (3) -関数群の引き数の最大長。 -.B _POSIX_ARG_MAX -(4096) 未満であってはならない。 -.TP -.BR CHILD_MAX " - " _SC_CHILD_MAX -.\"O The max number of simultaneous processes per user ID. -.\"O Must not be less than -.\"O .B _POSIX_CHILD_MAX -.\"O (25). -ユーザID あたりの同時に存在できるプロセスの最大数。 -.B _POSIX_CHILD_MAX -(25) 未満であってはならない。 -.TP -.BR HOST_NAME_MAX " - " _SC_HOST_NAME_MAX -.\"O Max length of a hostname, not including the terminating null byte, -.\"O as returned by -.\"O .BR gethostname (2). -.\"O Must not be less than -.\"O .B _POSIX_HOST_NAME_MAX -.\"O (255). -.BR gethostname (2) -で返されるホスト名の最大長。末尾の NULL バイトは長さに含まれない。 -.B _POSIX_HOST_NAME_MAX -(255) 未満であってはならない。 -.TP -.BR LOGIN_NAME_MAX " - " _SC_LOGIN_NAME_MAX -.\"O Maximum length of a login name, including the terminating null byte. -.\"O Must not be less than -.\"O .B _POSIX_LOGIN_NAME_MAX -.\"O (9). -ログイン名の長さの最大値。末尾の NULL バイトも長さに含まれる。 -.B _POSIX_LOGIN_NAME_MAX -(9) 未満であってはならない。 -.TP -.BR "" "clock ticks - " _SC_CLK_TCK -.\"O The number of clock ticks per second. -.\"O The corresponding variable is obsolete. -.\"O It was of course called -.\"O .BR CLK_TCK . -.\"O (Note: the macro -.\"O .B CLOCKS_PER_SEC -.\"O does not give information: it must equal 1000000.) -1秒あたりのクロック・ティック数。 -対応する変数は廃止された。この変数は当然ながら -.B CLK_TCK -と呼ばれていた。 -(注意: マクロ -.B CLOCKS_PER_SEC -からは情報は得られない: この値は 1000000 でなければならない) -.TP -.BR OPEN_MAX " - " _SC_OPEN_MAX -.\"O The maximum number of files that a process can have open at any time. -.\"O Must not be less than -.\"O .B _POSIX_OPEN_MAX -.\"O (20). -一つのプロセスが同時にオープンできるファイル数の上限。 -.B _POSIX_OPEN_MAX -(20) 未満であってはならない。 -.TP -.BR PAGESIZE " - " _SC_PAGESIZE -.\"O Size of a page in bytes. -.\"O Must not be less than 1. -.\"O (Some systems use PAGE_SIZE instead.) -バイト単位でのページサイズ。 -1 より小さくなってはならない。 -(この代わりに PAGE_SIZE を使うシステムもある) -.TP -.BR RE_DUP_MAX " - " _SC_RE_DUP_MAX -.\"O The number of repeated occurrences of a BRE permitted by -.\"O .BR regexec (3) -.\"O and -.\"O .BR regcomp (3). -.\"O Must not be less than -.\"O .B _POSIX2_RE_DUP_MAX -.\"O (255). -.BR regexec (3) -と -.BR regcomp (3) -で許容されている BRE (Basic Regular Expression; 基本正規表現) -の繰り返し出現回数の最大値。 -.B _POSIX2_RE_DUP_MAX -(255) 未満であってはならない。 -.TP -.BR STREAM_MAX " - " _SC_STREAM_MAX -.\"O The maximum number of streams that a process can have open at any -.\"O time. -.\"O If defined, it has the same value as the standard C macro -.\"O .BR FOPEN_MAX . -.\"O Must not be less than -.\"O .B _POSIX_STREAM_MAX -.\"O (8). -一つのプロセスが同時にオープンできるストリーム数の上限。 -定義されていた場合には、この値は標準 C マクロの -.B FOPEN_MAX -と同じである。 -.B _POSIX_STREAM_MAX -(8) 未満であってはならない。 -.TP -.B SYMLOOP_MAX -.\"O The maximum number of symbolic links seen in a pathname before resolution -.\"O returns -.\"O .BR ELOOP . -.\"O Must not be less than -.\"O .B _POSIX_SYMLOOP_MAX -.\"O (8). -パス名の解決時に現れてもよいシンボリック・リンクの最大数。 -この数を超えると、パス名解決時に -.B ELOOP -が返される。 -.B _POSIX_SYMLOOP_MAX -(8) 未満であってはならない。 -.TP -.BR TTY_NAME_MAX " - " _SC_TTY_NAME_MAX -.\"O The maximum length of terminal device name, -.\"O including the terminating null byte. -.\"O Must not be less than -.\"O .B _POSIX_TTY_NAME_MAX -.\"O (9). -端末デバイス名の最大長。長さには末尾の NULL バイトも含まれる。 -.B _POSIX_TTY_NAME_MAX -(9) 未満であってはならない。 -.TP -.BR TZNAME_MAX " - " _SC_TZNAME_MAX -.\"O The maximum number of bytes in a timezone name. -.\"O Must not be less than -.\"O .B _POSIX_TZNAME_MAX -.\"O (6). -タイムゾーン名として使えるバイト数の最大値。 -.B _POSIX_TZNAME_MAX -(6) 未満であってはならない。 -.TP -.BR _POSIX_VERSION " - " _SC_VERSION -.\"O indicates the year and month the POSIX.1 standard was approved in the -.\"O format -.\"O .BR YYYYMML ; -.\"O the value -.\"O .B 199009L -.\"O indicates the Sept. 1990 revision. -POSIX.1 標準が承認された年月。 -.B YYYYMML -という書式である。 -.B 199009L -という値は、1990å¹´ 9月 改訂であることを示す。 -.\"O .SS "POSIX.2 Variables" +.TP +\fBARG_MAX\fP \- \fB_SC_ARG_MAX\fP +\fBexec\fP(3) 関数群の引き数の最大長。 \fB_POSIX_ARG_MAX\fP (4096) 未満であってはならない。 +.TP +\fBCHILD_MAX\fP \- \fB_SC_CHILD_MAX\fP +ユーザID あたりの同時に存在できるプロセスの最大数。 \fB_POSIX_CHILD_MAX\fP (25) 未満であってはならない。 +.TP +\fBHOST_NAME_MAX\fP \- \fB_SC_HOST_NAME_MAX\fP +\fBgethostname\fP(2) で返されるホスト名の最大長。末尾の NULL バイトは長さに含まれない。 +\fB_POSIX_HOST_NAME_MAX\fP (255) 未満であってはならない。 +.TP +\fBLOGIN_NAME_MAX\fP \- \fB_SC_LOGIN_NAME_MAX\fP +ログイン名の長さの最大値。末尾の NULL バイトも長さに含まれる。 \fB_POSIX_LOGIN_NAME_MAX\fP (9) 未満であってはならない。 +.TP +clock ticks \- \fB_SC_CLK_TCK\fP +1秒あたりのクロック・ティック数。 対応する変数は廃止された。この変数は当然ながら \fBCLK_TCK\fP と呼ばれていた。 (注意: マクロ +\fBCLOCKS_PER_SEC\fP からは情報は得られない: この値は 1000000 でなければならない) +.TP +\fBOPEN_MAX\fP \- \fB_SC_OPEN_MAX\fP +一つのプロセスが同時にオープンできるファイル数の上限。 \fB_POSIX_OPEN_MAX\fP (20) 未満であってはならない。 +.TP +\fBPAGESIZE\fP \- \fB_SC_PAGESIZE\fP +バイト単位でのページサイズ。 1 より小さくなってはならない。 (この代わりに PAGE_SIZE を使うシステムもある) +.TP +\fBRE_DUP_MAX\fP \- \fB_SC_RE_DUP_MAX\fP +\fBregexec\fP(3) と \fBregcomp\fP(3) で許容されている BRE (Basic Regular Expression; +基本正規表現) の繰り返し出現回数の最大値。 \fB_POSIX2_RE_DUP_MAX\fP (255) 未満であってはならない。 +.TP +\fBSTREAM_MAX\fP \- \fB_SC_STREAM_MAX\fP +一つのプロセスが同時にオープンできるストリーム数の上限。 定義されていた場合には、この値は標準 C マクロの \fBFOPEN_MAX\fP と同じである。 +\fB_POSIX_STREAM_MAX\fP (8) 未満であってはならない。 +.TP +\fBSYMLOOP_MAX\fP \- \fB_SC_SYMLOOP_MAX\fP +パス名の解決時に現れてもよいシンボリック・リンクの最大数。 この数を超えると、パス名解決時に \fBELOOP\fP が返される。 +\fB_POSIX_SYMLOOP_MAX\fP (8) 未満であってはならない。 +.TP +\fBTTY_NAME_MAX\fP \- \fB_SC_TTY_NAME_MAX\fP +端末デバイス名の最大長。長さには末尾の NULL バイトも含まれる。 \fB_POSIX_TTY_NAME_MAX\fP (9) 未満であってはならない。 +.TP +\fBTZNAME_MAX\fP \- \fB_SC_TZNAME_MAX\fP +タイムゾーン名として使えるバイト数の最大値。 \fB_POSIX_TZNAME_MAX\fP (6) 未満であってはならない。 +.TP +\fB_POSIX_VERSION\fP \- \fB_SC_VERSION\fP +POSIX.1 標準が承認された年月。 \fBYYYYMML\fP という書式である。 \fB199009L\fP という値は、1990å¹´ 9月 +改訂であることを示す。 .SS "POSIX.2 変数" -.\"O Next, the POSIX.2 values, giving limits for utilities. -次に、POSIX.2 の値を示す。 -これらは各ユーティリティに対する制限を指定する。 -.TP -.BR BC_BASE_MAX " - " _SC_BC_BASE_MAX -.\"O indicates the maximum -.\"O .I obase -.\"O value accepted by the -.\"O .BR bc (1) -.\"O utility. -.BR bc (1) -ユーティリティで許容される -.I obase -の最大値。 -.TP -.BR BC_DIM_MAX " - " _SC_BC_DIM_MAX -.\"O indicates the maximum value of elements permitted in an array by -.\"O .BR bc (1). -.BR bc (1) -で許容される一つの配列中の要素数の最大値。 -.TP -.BR BC_SCALE_MAX " - " _SC_BC_SCALE_MAX -.\"O indicates the maximum -.\"O .I scale -.\"O value allowed by -.\"O .BR bc (1). -.BR bc (1) -で許される -.I scale -の最大値。 -.TP -.BR BC_STRING_MAX " - " _SC_BC_STRING_MAX -.\"O indicates the maximum length of a string accepted by -.\"O .BR bc (1). -.BR bc (1) -で許容される文字列の最大長。 -.TP -.BR COLL_WEIGHTS_MAX " - " _SC_COLL_WEIGHTS_MAX -.\"O indicates the maximum numbers of weights that can be assigned to an -.\"O entry of the -.\"O .B LC_COLLATE order -.\"O keyword in the locale definition file, -ロケール定義ファイル中の -.B LC_COLLATE order -キーワードのエントリに割り当て可能な重みの最大値。 -.TP -.BR EXPR_NEST_MAX " - " _SC_EXPR_NEST_MAX -.\"O is the maximum number of expressions which can be nested within -.\"O parentheses by -.\"O .BR expr (1). -.BR expr (1) -において、括弧で入れ子にできる式の最大数。 -.TP -.BR LINE_MAX " - " _SC_LINE_MAX -.\"O The maximum length of a utility's input line, either from -.\"O standard input or from a file. -.\"O This includes space for a trailing -.\"O newline. -ユーティリティの入力行の最大長。標準入力だけでなく、ファイルからの入力にも -適用される。長さには行の末尾の改行文字も含まれる。 -.TP -.BR RE_DUP_MAX " - " _SC_RE_DUP_MAX -.\"O The maximum number of repeated occurrences of a regular expression when -.\"O the interval notation -.\"O .B \e{m,n\e} -.\"O is used. -正規表現で区間表記 (interval notation) -.B \e{m,n\e} -が使用されたときに許容される繰り返し出現回数の最大値。 -.TP -.BR POSIX2_VERSION " - " _SC_2_VERSION -.\"O indicates the version of the POSIX.2 standard in the format of -.\"O YYYYMML. +次に、POSIX.2 の値を示す。 これらは各ユーティリティに対する制限を指定する。 +.TP +\fBBC_BASE_MAX\fP \- \fB_SC_BC_BASE_MAX\fP +\fBbc\fP(1) ユーティリティで許容される \fIobase\fP の最大値。 +.TP +\fBBC_DIM_MAX\fP \- \fB_SC_BC_DIM_MAX\fP +\fBbc\fP(1) で許容される一つの配列中の要素数の最大値。 +.TP +\fBBC_SCALE_MAX\fP \- \fB_SC_BC_SCALE_MAX\fP +\fBbc\fP(1) で許される \fIscale\fP の最大値。 +.TP +\fBBC_STRING_MAX\fP \- \fB_SC_BC_STRING_MAX\fP +\fBbc\fP(1) で許容される文字列の最大長。 +.TP +\fBCOLL_WEIGHTS_MAX\fP \- \fB_SC_COLL_WEIGHTS_MAX\fP +ロケール定義ファイル中の \fBLC_COLLATE order\fP キーワードのエントリに割り当て可能な重みの最大値。 +.TP +\fBEXPR_NEST_MAX\fP \- \fB_SC_EXPR_NEST_MAX\fP +\fBexpr\fP(1) において、括弧で入れ子にできる式の最大数。 +.TP +\fBLINE_MAX\fP \- \fB_SC_LINE_MAX\fP +ユーティリティの入力行の最大長。標準入力だけでなく、ファイルからの入力にも 適用される。長さには行の末尾の改行文字も含まれる。 +.TP +\fBRE_DUP_MAX\fP \- \fB_SC_RE_DUP_MAX\fP +正規表現で区間表記 (interval notation) \fB\e{m,n\e}\fP が使用されたときに許容される繰り返し出現回数の最大値。 +.TP +\fBPOSIX2_VERSION\fP \- \fB_SC_2_VERSION\fP POSIX.2 標準のバージョン。YYYYMML という書式で表記される。 -.TP -.BR POSIX2_C_DEV " - " _SC_2_C_DEV -.\"O indicates whether the POSIX.2 C language development facilities are -.\"O supported. +.TP +\fBPOSIX2_C_DEV\fP \- \fB_SC_2_C_DEV\fP POSIX.2 の C 言語開発機能がサポートされているかを示す。 -.TP -.BR POSIX2_FORT_DEV " - " _SC_2_FORT_DEV -.\"O indicates whether the POSIX.2 FORTRAN development utilities are -.\"O supported. +.TP +\fBPOSIX2_FORT_DEV\fP \- \fB_SC_2_FORT_DEV\fP POSIX.2 の FORTRAN 開発ユーティリティがサポートされているかを示す。 -.TP -.BR POSIX2_FORT_RUN " - " _SC_2_FORT_RUN -.\"O indicates whether the POSIX.2 FORTRAN runtime utilities are supported. +.TP +\fBPOSIX2_FORT_RUN\fP \- \fB_SC_2_FORT_RUN\fP POSIX.2 の FORTRAN ランタイムユーティリティがサポートされているかを示す。 -.TP -.BR _POSIX2_LOCALEDEF " - " _SC_2_LOCALEDEF -.\"O indicates whether the POSIX.2 creation of locates via -.\"O .BR localedef (1) -.\"O is supported. -.BR localedef (1) -を使った、POSIX.2 のロケールの作成をサポートしているかを示す。 -.TP -.BR POSIX2_SW_DEV " - " _SC_2_SW_DEV -.\"O indicates whether the POSIX.2 software development utilities option is -.\"O supported. +.TP +\fB_POSIX2_LOCALEDEF\fP \- \fB_SC_2_LOCALEDEF\fP +\fBlocaledef\fP(1) を使った、POSIX.2 のロケールの作成をサポートしているかを示す。 +.TP +\fBPOSIX2_SW_DEV\fP \- \fB_SC_2_SW_DEV\fP POSIX.2 ソフトウェア開発ユーティリティオプションがサポートされているかを示す。 .PP -.\"O These values also exist, but may not be standard. 以下の値も存在するが、標準には含まれていない。 -.TP -.BR "" " - " _SC_PHYS_PAGES -.\"O The number of pages of physical memory. -.\"O Note that it is possible -.\"O for the product of this value and the value of -.\"O .B _SC_PAGE_SIZE -.\"O to overflow. -物理メモリのページ数。 -この値と -.B _SC_PAGE_SIZE -値の積は桁溢れする可能性があるので注意すること。 -.TP -.BR "" " - " _SC_AVPHYS_PAGES -.\"O The number of currently available pages of physical memory. +.TP + \- \fB_SC_PHYS_PAGES\fP +物理メモリのページ数。 この値と \fB_SC_PAGE_SIZE\fP 値の積は桁溢れする可能性があるので注意すること。 +.TP + \- \fB_SC_AVPHYS_PAGES\fP 現在利用可能な物理メモリのページ数。 -.TP -.BR "" " - " _SC_NPROCESSORS_CONF -.\"O The number of processors configured. +.TP + \- \fB_SC_NPROCESSORS_CONF\fP 設定されたプロセッサ数。 -.TP -.BR "" " - " _SC_NPROCESSORS_ONLN -.\"O The number of processors currently online (available). +.TP + \- \fB_SC_NPROCESSORS_ONLN\fP 現在オンラインの (利用可能な) プロセッサ数。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O If -.\"O .I name -.\"O is invalid, \-1 is returned, and -.\"O .I errno -.\"O is set to -.\"O .BR EINVAL . -.I name -が不正な場合、\-1 が返され、 -.I errno -に -.B EINVAL -が設定される。 -.\"O Otherwise, the value returned is the value of the system resource and -.\"O .I errno -.\"O is not changed. -.\"O In the case of options, a positive value is returned if a queried option -.\"O is available, and \-1 if it is not. -.\"O In the case of limits, \-1 means that there is no definite limit. -それ以外の場合、システムリソースの値が返り値として返され、 -.I errno -は変更されない。問い合わせがオプションについてであれば、 -そのオプションが利用できるときは正の値が返され、 -利用できないときは \-1 が返される。問い合わせが -制限について場合は、制限が設定されていないときに \-1 が返される。 -.\"O .SH "CONFORMING TO" +\fIname\fP が不正な場合、\-1 が返され、 \fIerrno\fP に \fBEINVAL\fP が設定される。 +それ以外の場合、システムリソースの値が返り値として返され、 \fIerrno\fP は変更されない。問い合わせがオプションについてであれば、 +そのオプションが利用できるときは正の値が返され、 利用できないときは \-1 が返される。問い合わせが 制限について場合は、制限が設定されていないときに +\-1 が返される。 .SH 準拠 -POSIX.1-2001. -.\"O .SH "BUGS" +POSIX.1\-2001. .SH バグ -.\"O It is difficult to use -.\"O .B ARG_MAX -.\"O because it is not specified how much of the argument space for -.\"O .BR exec (3) -.\"O is consumed by the user's environment variables. -.B ARG_MAX -を使うのは難しい、なぜなら、 -.BR exec (3) -の引き数領域 (argument space) のうちどれくらいが +\fBARG_MAX\fP を使うのは難しい、なぜなら、 \fBexec\fP(3) の引き数領域 (argument space) のうちどれくらいが ユーザの環境変数によって使われるかは分からないからである。 .PP -.\"O Some returned values may be huge; they are not suitable for allocating -.\"O memory. -いくつかの返り値はとても大きくなるだろう。これらを使って -メモリの割り当てを行うのは適当ではない。 -.\"O .SH "SEE ALSO" +いくつかの返り値はとても大きくなることがある。これらを使って メモリの割り当てを行うのは適当ではない。 .SH 関連項目 -.BR bc (1), -.BR expr (1), -.BR getconf (1), -.BR locale (1), -.BR fpathconf (3), -.BR pathconf (3), -.BR posixoptions (7) +\fBbc\fP(1), \fBexpr\fP(1), \fBgetconf\fP(1), \fBlocale\fP(1), \fBfpathconf\fP(3), +\fBpathconf\fP(3), \fBposixoptions\fP(7) diff --git a/draft/man3/system.3 b/draft/man3/system.3 index d9c6b450..1892cc05 100644 --- a/draft/man3/system.3 +++ b/draft/man3/system.3 @@ -25,153 +25,43 @@ .\" Modified 14 May 2001, 23 Sep 2001 by aeb .\" 2004-12-20, mtk .\" -.\" Japanese Version Copyright (c) 1996 Shoichi OZAWA -.\" all right reserved. -.\" Translated 1996-09-01, Shoichi OZAWA -.\" Updated 2001-03-19, Kentaro Shirakata -.\" Updated 2001-10-16, Kentaro Shirakata -.\" Updated 2005-02-27, Akihiro MOTOKI +.\"******************************************************************* .\" -.\"WORD: feature test macro 機能検査マクロ +.\" This file was generated with po4a. Translate the source file. .\" -.TH SYSTEM 3 2010-09-10 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH SYSTEM 3 2010\-09\-10 "" "Linux Programmer's Manual" .SH 名前 -.\"O system \- execute a shell command system \- シェルコマンドの実行 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int system(const char *" "command" ); +\fBint system(const char *\fP\fIcommand\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O .BR system () -.\"O executes a command specified in -.\"O .I command -.\"O by calling -.\"O .BR "/bin/sh \-c" -.\"O .IR command , -.\"O and returns after the command has been completed. -.BR system () -は -.I command -で指定したコマンドを -.B "/bin/sh \-c" -.I command -の形で実行する。指定したコマンドが終了すればこの関数も終了する。 -.\"O During execution of the command, -.\"O .B SIGCHLD -.\"O will be blocked, and -.\"O .B SIGINT -.\"O and -.\"O .B SIGQUIT -.\"O will be ignored. -コマンド実行中は、 -.B SIGCHLD -はブロックされ、 -.B SIGINT -と -.B SIGQUIT -は無視される。 -.\"O .SH "RETURN VALUE" +\fBsystem\fP() は \fIcommand\fP で指定したコマンドを \fB/bin/sh \-c\fP \fIcommand\fP +の形で実行する。指定したコマンドが終了すればこの関数も終了する。 コマンド実行中は、 \fBSIGCHLD\fP はブロックされ、 \fBSIGINT\fP と +\fBSIGQUIT\fP は無視される。 .SH 返り値 -.\"O The value returned is \-1 on error (e.g. -.\"O .BR fork (2) -.\"O failed), -.\"O and the return status of the command otherwise. -エラーが発生した場合 -.RB ( fork (2) -に失敗した場合など)、\-1 を返す。 -そうでなければ、コマンドのステータスを返す。 -.\"O This latter return status is in the format -.\"O specified in -.\"O .BR wait (2). -後者の場合、ステータスは -.BR wait (2) -で定義されているフォーマットで返ってくる。 -.\"O Thus, the exit code of the command will be -.\"O .IR WEXITSTATUS(status) . -従って、コマンドの終了コードは -.I WEXITSTATUS(status) -で得ることが出来る。 -.\"O In case -.\"O .I "/bin/sh" -.\"O could not be executed, the exit status will be that of -.\"O a command that does -.\"O .IR exit(127) . -.I /bin/sh -が実行出来なかった場合、 -終了ステータスはコマンドが -.I exit(127) -を実行した場合と同じになる。 +エラーが発生した場合 (\fBfork\fP(2) に失敗した場合など)、\-1 を返す。 そうでなければ、コマンドのステータスを返す。 +後者の場合、ステータスは \fBwait\fP(2) で定義されているフォーマットで返ってくる。 従って、コマンドの終了コードは +\fIWEXITSTATUS(status)\fP で得ることが出来る。 \fI/bin/sh\fP が実行出来なかった場合、 終了ステータスはコマンドが +\fIexit(127)\fP を実行した場合と同じになる。 .PP -.\"O If the value of -.\"O .I command -.\"O is NULL, -.\"O .BR system () -.\"O returns nonzero if the shell is available, and zero if not. -.I command -の値が NULL のときは、 -.BR system () -はシェルが利用可能ならゼロ以外の値を返し、利用不可ならゼロを返す。 +\fIcommand\fP の値が NULL のときは、 \fBsystem\fP() はシェルが利用可能ならゼロ以外の値を返し、利用不可ならゼロを返す。 .PP -.\"O .BR system () -.\"O does not affect the wait status of any other children. -.BR system () -は他の子プロセスのウエイトステータスには影響を与えない。 -.\"O .SH "CONFORMING TO" +\fBsystem\fP() は他の子プロセスのウエイトステータスには影響を与えない。 .SH 準拠 -C89, C99, POSIX.1-2001. -.\"O .SH NOTES +C89, C99, POSIX.1\-2001. .SH 注意 .PP -.\"O If the -.\"O .B _XOPEN_SOURCE -.\"O feature test macro is defined -.\"O (before including -.\"O .I any -.\"O header files), -.\"O then the macros described in -.\"O .BR wait (2) -.\"O .RB ( WEXITSTATUS (), -.\"O etc.) are made available when including -.\"O .IR . -(「どの」ヘッダファイルをインクルードするよりも前に) -機能検査マクロ -.B _XOPEN_SOURCE -が定義された場合には、 -.BR wait (2) -で説明されているマクロ群 -.RB ( WEXITSTATUS () -等) が -.I +(「どの」ヘッダファイルをインクルードするよりも前に) 機能検査マクロ \fB_XOPEN_SOURCE\fP が定義された場合には、 \fBwait\fP(2) +で説明されているマクロ群 (\fBWEXITSTATUS\fP() 等) が \fI\fP をインクルードすると利用可能になる。 .PP -.\"O As mentioned, -.\"O .BR system () -.\"O ignores -.\"O .B SIGINT -.\"O and -.\"O .BR SIGQUIT . -.\"O This may make programs that call it -.\"O from a loop uninterruptible, unless they take care themselves -.\"O to check the exit status of the child. -.\"O E.g. -既に述べたように、 -.BR system () -は -.B SIGINT -と -.B SIGQUIT -を無視する。 -よってループから -.BR system () -を呼ぶプログラムは、 -以下の例のように子プロセスの終了状態を自分でチェックしておかないと、 -中断できなくなるかもしれない。 +既に述べたように、 \fBsystem\fP() は \fBSIGINT\fP と \fBSIGQUIT\fP を無視する。 よってループから \fBsystem\fP() +を呼ぶプログラムは、 以下の例のように子プロセスの終了状態を自分でチェックしておかないと、 中断できなくなるかもしれない。 .br .nf @@ -184,87 +74,20 @@ C89, C99, POSIX.1-2001. } .fi .PP -.\"O Do not use -.\"O .BR system () -.\"O from a program with set-user-ID or set-group-ID privileges, -.\"O because strange values for some environment variables -.\"O might be used to subvert system integrity. -.\"O Use the -.\"O .BR exec (3) -.\"O family of functions instead, but not -.\"O .BR execlp (3) -.\"O or -.\"O .BR execvp (3). -set-user-ID や set-group-ID の特権をもつプログラムの中では -.BR system () -を使ってはいけない。なぜなら、ある環境変数の未知の値によって -システムの安全が損なわれるからである。代わりに -.BR exec (3) -関連の関数群の中で -.BR execlp (3) -と -.BR execvp (3) -以外の関数を使用すべきである。 -.\"O .BR system () -.\"O will not, in fact, work properly from programs with set-user-ID or -.\"O set-group-ID privileges on systems on which -.\"O .I /bin/sh -.\"O is bash version 2, since bash 2 drops privileges on startup. -.\"O (Debian uses a modified bash which does not do this when invoked as -.\"O .BR sh .) -実際のところ、 -.BR system () -は -.I /bin/sh -が bash バージョン 2 であるシステムでは、 -set-user-ID や set-group-ID の特権を持つプログラムからは正しく動作しない。 -なぜなら、bash バージョン 2 はスタートアップ時に特権を落とすからである。 -(Debian では、sh として起動された時にはこのような動作を行なわないように -修正された bash を用いている) +set\-user\-ID や set\-group\-ID の特権をもつプログラムの中では \fBsystem\fP() +を使ってはいけない。なぜなら、ある環境変数の未知の値によって システムの安全が損なわれるからである。代わりに \fBexec\fP(3) 関連の関数群の中で +\fBexeclp\fP(3) と \fBexecvp\fP(3) 以外の関数を使用すべきである。 実際のところ、 \fBsystem\fP() は +\fI/bin/sh\fP が bash バージョン 2 であるシステムでは、 set\-user\-ID や set\-group\-ID +の特権を持つプログラムからは正しく動作しない。 なぜなら、bash バージョン 2 はスタートアップ時に特権を落とすからである。 (Debian +では、sh として起動された時にはこのような動作を行なわないように 修正された bash を用いている) .PP -.\"O In versions of glibc before 2.1.3, the check for the availability of -.\"O .I /bin/sh -.\"O was not actually performed if -.\"O .I command -.\"O was NULL; instead it was always assumed to be available, and -.\"O .BR system () -.\"O always returned 1 in this case. -glibc 2.1.3 より前のバージョンでは、 -.I command -が NULL の場合に -.I /bin/sh -が利用可能かどうかのチェックは実際には行わず、 -いつでも利用可能であるとみなしていた。 -.BR system () -はこの場合に常に 1 を返していた。 -.\"O Since glibc 2.1.3, this check is performed because, even though -.\"O POSIX.1-2001 requires a conforming implementation to provide -.\"O a shell, that shell may not be available or executable if -.\"O the calling program has previously called -.\"O .BR chroot (2) -.\"O (which is not specified by POSIX.1-2001). -POSIX.1-2001 ではシェルが提供されているという標準に準拠した実装を -要求しているが、glibc 2.1.3 以降ではシェルのチェックを実行している。 -なぜなら、呼び出し元のプログラムが -.BR system () -を呼び出すより前に (POSIX.1-2001 では規定されていない) -.BR chroot (2) -を呼び出していた時には、シェルが利用可能でない場合や実行可能ファイル -でない場合があるからである。 +glibc 2.1.3 より前のバージョンでは、 \fIcommand\fP が NULL の場合に \fI/bin/sh\fP +が利用可能かどうかのチェックは実際には行わず、 いつでも利用可能であるとみなしていた。 \fBsystem\fP() はこの場合に常に 1 を返していた。 +POSIX.1\-2001 ではシェルが提供されているという標準に準拠した実装を 要求しているが、glibc 2.1.3 +以降ではシェルのチェックを実行している。 なぜなら、呼び出し元のプログラムが \fBsystem\fP() を呼び出すより前に (POSIX.1\-2001 +では規定されていない) \fBchroot\fP(2) を呼び出していた時には、シェルが利用可能でない場合や実行可能ファイル でない場合があるからである。 .PP -.\"O It is possible for the shell command to return 127, so that code is not -.\"O a sure indication that the -.\"O .BR execve (2) -.\"O call failed. -実行したシェルコマンドが 127 -.RB ( /bin/sh -の呼び出しに失敗した時に返す値) を返すことも考えられる。 -そのため、プログラムは (リターンコードを見るだけでは) -.BR execve (2) -の呼び出しが失敗したことを確実に知ることはできない。 -.\"O .SH "SEE ALSO" +実行したシェルコマンドが 127 (\fB/bin/sh\fP の呼び出しに失敗した時に返す値) を返すことも考えられる。 そのため、プログラムは +(リターンコードを見るだけでは) \fBexecve\fP(2) の呼び出しが失敗したことを確実に知ることはできない。 .SH 関連項目 -.BR sh (1), -.BR signal (2), -.BR wait (2), -.BR exec (3) +\fBsh\fP(1), \fBsignal\fP(2), \fBwait\fP(2), \fBexec\fP(3) diff --git a/draft/man3/tan.3 b/draft/man3/tan.3 index 8649b91f..11ce4ac7 100644 --- a/draft/man3/tan.3 +++ b/draft/man3/tan.3 @@ -28,90 +28,51 @@ .\" 386BSD man pages .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) .\" Modified 2002-07-27 by Walter Harms -.\" (walter.harms@informatik.uni-oldenburg.de) +.\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 1996 Kenji Kajiwara and Kentaro Ogawa -.\" all rights reserved. -.\" Translated Sat, 13 Jul 1996 17:42:24 JST -.\" by Kenji Kajiwara and Kentaro Ogawa -.\" Proof Reading: Takashi Yoshino -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH TAN 3 2010-09-11 "" "Linux Programmer's Manual" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH TAN 3 2010\-09\-11 "" "Linux Programmer's Manual" .SH 名前 tan, tanf, tanl \- 正接(タンジェント)関数 .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double tan(double " x ); +\fBdouble tan(double \fP\fIx\fP\fB);\fP .br -.BI "float tanf(float " x ); +\fBfloat tanf(float \fP\fIx\fP\fB);\fP .br -.BI "long double tanl(long double " x ); +\fBlong double tanl(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -Feature Test Macro Requirements for glibc (see -.BR feature_test_macros (7)): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR tanf (), -.BR tanl (): +\fBtanf\fP(), \fBtanl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.BR tan () -関数は \fIx\fP の正接(タンジェント)の値を返す。 -\fIx\fP はラジアン単位で指定する。 -.\"O .SH RETURN VALUE +\fBtan\fP() 関数は \fIx\fP の正接(タンジェント)の値を返す。 \fIx\fP はラジアン単位で指定する。 .SH 返り値 -.\"O On success, these functions return the tangent of -.\"O .IR x . -成功すると、これらの関数は -.I x -の正接 (タンジェント) を返す。 +成功すると、これらの関数は \fIx\fP の正接 (タンジェント) を返す。 -.\"O If -.\"O .I x -.\"O is a NaN, a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is positive infinity or negative infinity, -.\"O a domain error occurs, -.\"O and a NaN is returned. -.I x -が正の無限大か負の無限大の場合、 -領域エラー (domain error) が発生し、NaN が返される。 +\fIx\fP が正の無限大か負の無限大の場合、 領域エラー (domain error) が発生し、NaN が返される。 -.\"O If the correct result would overflow, -.\"O a range error occurs, -.\"O and the functions return -.\"O .BR HUGE_VAL , -.\"O .BR HUGE_VALF , -.\"O or -.\"O .BR HUGE_VALL , -.\"O respectively, with the mathematically correct sign. -結果がオーバーフローする場合、範囲エラー (range error) が発生し、 -各関数はそれぞれ -.BR HUGE_VAL , -.BR HUGE_VALF , -.B HUGE_VALL -を返す。 .\" I think overflow can't occur, because the closest floating-point .\" representation of pi/2 is still not close enough to pi/2 to .\" produce a large enough value to overflow. @@ -121,77 +82,29 @@ or .\" glibc 2.8 doesn't do this .\" POSIX.1 an optional range error for subnormal x; .\" glibc 2.8 doesn't do this -.\"O .SH ERRORS +結果がオーバーフローする場合、範囲エラー (range error) が発生し、 各関数はそれぞれ \fBHUGE_VAL\fP, \fBHUGE_VALF\fP, +\fBHUGE_VALL\fP を返す。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Domain error: \fIx\fP is an infinity -領域エラー (domain error): \fIx\fP は無限大である -.\"O .I errno -.\"O is set to -.\"O .BR EDOM -.\"O (but see BUGS). -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -.I errno -に -.B EDOM -が設定される (「バグ」の節も参照)。 -不正 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) +.TP +領域エラー (domain error): \fIx\fP が無限大である +\fIerrno\fP に \fBEDOM\fP が設定される (「バグ」の節も参照)。 不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 -.TP -.\"O Range error: result overflow +.TP 範囲エラー (range error): 結果のオーバーフロー .\" Unable to test this case, since the best approximation of .\" pi/2 in double precision only yields a tan() value of 1.633e16. .\" .I errno .\" is set to .\" .BR ERANGE . -.\"O An overflow floating-point exception -.\"O .RB ( FE_OVERFLOW ) -.\"O is raised. -オーバーフロー浮動小数点例外 -.RB ( FE_OVERFLOW ) -が上がる。 -.\"O .SH BUGS +オーバーフロー浮動小数点例外 (\fBFE_OVERFLOW\fP) が上がる。 +.SH 準拠 +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH バグ -.\"O Before version 2.10, the glibc implementation did not set .\" http://sourceware.org/bugzilla/show_bug.cgi?id=6782 -.\"O .I errno -.\"O to -.\"O .B EDOM -.\"O when a domain error occurred. -バージョン 2.10 より前の glibc の実装では、 -領域エラーが発生した際に、 -.I error -に -.B EDOM -が設定されなかった。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 +バージョン 2.10 より前の glibc の実装では、 領域エラーが発生した際に、 \fIerror\fP に \fBEDOM\fP が設定されなかった。 .SH 関連項目 -.BR acos (3), -.BR asin (3), -.BR atan (3), -.BR atan2 (3), -.BR cos (3), -.BR ctan (3), -.BR sin (3) +\fBacos\fP(3), \fBasin\fP(3), \fBatan\fP(3), \fBatan2\fP(3), \fBcos\fP(3), \fBctan\fP(3), +\fBsin\fP(3) diff --git a/draft/man3/tanh.3 b/draft/man3/tanh.3 index 1c8a1426..453e6c13 100644 --- a/draft/man3/tanh.3 +++ b/draft/man3/tanh.3 @@ -28,114 +28,63 @@ .\" 386BSD man pages .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) .\" Modified 2002-07-27 by Walter Harms -.\" (walter.harms@informatik.uni-oldenburg.de) +.\" (walter.harms@informatik.uni-oldenburg.de) .\" -.\" Japanese Version Copyright (c) 1996 Kenji Kajiwara and Kentaro Ogawa -.\" all rights reserved. -.\" Translated Sat, 13 Jul 1996 17:54:30 JST -.\" by Kenji Kajiwara and Kentaro Ogawa -.\" Updated 2008-09-16, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH TANH 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH TANH 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O tanh, tanhf, tanhl \- hyperbolic tangent function tanh, tanhf, tanhl \- 双曲線正接 (hyperbolic tangent) 関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double tanh(double " x ); +\fBdouble tanh(double \fP\fIx\fP\fB);\fP .br -.BI "float tanhf(float " x ); +\fBfloat tanhf(float \fP\fIx\fP\fB);\fP .br -.BI "long double tanhl(long double " x ); +\fBlong double tanhl(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR tanhf (), -.BR tanhl (): +\fBtanhf\fP(), \fBtanhl\fP(): .RS 4 -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE +|| _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR tanh () -.\"O function returns the hyperbolic tangent of \fIx\fP, which -.\"O is defined mathematically as: -.BR tanh () -関数は \fIx\fP の双曲線正接 (hyperbolic tangent) 関数を返す。 -数学的には以下のように定義されている. +\fBtanh\fP() 関数は \fIx\fP の双曲線正接 (hyperbolic tangent) 関数を返す。 数学的には以下のように定義されている. .nf tanh(x) = sinh(x) / cosh(x) .fi -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O On success, these functions return the hyperbolic tangent of -.\"O .IR x . -成功すると、これらの関数は -.I x -の双曲線正接を返す。 +成功すると、これらの関数は \fIx\fP の双曲線正接を返す。 -.\"O If -.\"O .I x -.\"O is a NaN, a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is +0 (\-0), +0 (\-0) is returned. -.I x -が +0 (\-0) の場合、+0 (\-0) が返される。 +\fIx\fP が +0 (\-0) の場合、+0 (\-0) が返される。 -.\"O If -.\"O .I x -.\"O is positive infinity (negative infinity), -.\"O +1 (\-1) is returned. -.I x -が正の無限大 (負の無限大) の場合、+1 (\-1) が返される。 .\" .\" POSIX.1-2001 documents an optional range error (underflow) .\" for subnormal x; .\" glibc 2.8 does not do this. -.\"O .SH ERRORS +\fIx\fP が正の無限大 (負の無限大) の場合、+1 (\-1) が返される。 .SH エラー -.\"O No errors occur. エラーは発生しない。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O The variant returning -.\"O .I double -.\"O also conforms to -.\"O SVr4, 4.3BSD, C89. -.I double -版の関数は SVr4, 4.3BSD, C89 にも準拠している。 -.\"O .SH "SEE ALSO" +C99, POSIX.1\-2001. \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .SH 関連項目 -.BR acosh (3), -.BR asinh (3), -.BR atanh (3), -.BR cosh (3), -.BR ctanh (3), -.BR sinh (3) +\fBacosh\fP(3), \fBasinh\fP(3), \fBatanh\fP(3), \fBcosh\fP(3), \fBctanh\fP(3), \fBsinh\fP(3) diff --git a/draft/man3/tcgetpgrp.3 b/draft/man3/tcgetpgrp.3 index f9a321dc..15fcc40e 100644 --- a/draft/man3/tcgetpgrp.3 +++ b/draft/man3/tcgetpgrp.3 @@ -20,185 +20,60 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated Sat Jul 19 03:06:26 JST 2003 -.\" by Akihiro MOTOKI +.\"******************************************************************* .\" -.TH TCGETPGRP 3 2003-01-28 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O tcgetpgrp, tcsetpgrp \- get and set terminal foreground process group +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH TCGETPGRP 3 2003\-01\-28 GNU "Linux Programmer's Manual" .SH 名前 -tcgetpgrp, tcsetpgrp \- 端末のフォアグラウンド・プロセス・グループの -取得/設定を行う -.\"O .SH SYNOPSIS +tcgetpgrp, tcsetpgrp \- 端末のフォアグラウンド・プロセス・グループの 取得/設定を行う .SH 書式 -.B "#include " +\fB#include \fP .sp -.BI "pid_t tcgetpgrp(int " fd ); +\fBpid_t tcgetpgrp(int \fP\fIfd\fP\fB);\fP .sp -.BI "int tcsetpgrp(int " fd ", pid_t " pgrp ); -.\"O .SH DESCRIPTION +\fBint tcsetpgrp(int \fP\fIfd\fP\fB, pid_t \fP\fIpgrp\fP\fB);\fP .SH 説明 -.\"O The function -.\"O .BR tcgetpgrp () -.\"O returns the process group ID of the foreground process group on the -.\"O terminal associated to -.\"O .IR fd , -.\"O which must be the controlling terminal of the calling process. -.\"O .\" The process itself may be a background process. -関数 -.BR tcgetpgrp () -は、 -.I fd -に対応する端末のフォアグラウンド・プロセス・グループの -プロセス・グループ ID を返す。 -.I fd -で指定された端末は、呼び出しを行うプロセスの制御端末でなければならない。 -.\" プロセス自体はバックグラウンド・プロセスであってもよい。 +.\" The process itself may be a background process. +関数 \fBtcgetpgrp\fP() は、 \fIfd\fP に対応する端末のフォアグラウンド・プロセス・グループの プロセス・グループ ID を返す。 +\fIfd\fP で指定された端末は、呼び出しを行うプロセスの制御端末でなければならない。 .LP -.\"O The function -.\"O .BR tcsetpgrp () -.\"O makes the process group with process group ID \fIpgrp\fP -.\"O the foreground process group on the terminal associated to -.\"O .IR fd , -.\"O which must be the controlling terminal of the calling process, -.\"O and still be associated with its session. -.\"O Moreover, \fIpgrp\fP must be a (nonempty) process group belonging to -.\"O the same session as the calling process. -関数 -.BR tcsetpgrp () -は、プロセス・グループID が \fIpgrp\fP のプロセス・グループを -.I fd -に対応する端末のフォアグラウンド・プロセス・グループにする。 -このとき、 -.I fd -は -.BR tcsetpgrp () -を呼び出すプロセスの制御端末でなければならない。 -さらに、 \fIpgrp\fP は、呼び出しを行うプロセスと同じセッションに -属する (メンバが空でない) プロセス・グループでなければならない。 +関数 \fBtcsetpgrp\fP() は、プロセス・グループID が \fIpgrp\fP のプロセス・グループを \fIfd\fP +に対応する端末のフォアグラウンド・プロセス・グループにする。 このとき、 \fIfd\fP は \fBtcsetpgrp\fP() +を呼び出すプロセスの制御端末でなければならない。 さらに、 \fIpgrp\fP は、呼び出しを行うプロセスと同じセッションに 属する (メンバが空でない) +プロセス・グループでなければならない。 .LP -.\"O If -.\"O .BR tcsetpgrp () -.\"O is called by a member of a background process group in its session, -.\"O and the calling process is not blocking or ignoring -.\"O .BR SIGTTOU , -.\"O a -.\"O .B SIGTTOU -.\"O signal is sent to all members of this background process group. -.BR tcsetpgrp () -がセッションに属するバックグラウンド・グループ・プロセスのメンバから -呼び出され、かつ呼び出しを行うプロセスが -.B SIGTTOU -をブロックしたり -無視したりするようになっていない場合、 -.B SIGTTOU -シグナルは +\fBtcsetpgrp\fP() がセッションに属するバックグラウンド・グループ・プロセスのメンバから 呼び出され、かつ呼び出しを行うプロセスが +\fBSIGTTOU\fP をブロックしたり 無視したりするようになっていない場合、 \fBSIGTTOU\fP シグナルは バックグラウンド・プロセス・グループの全てのメンバに送られる。 -.\"O .SH "RETURN VALUE" .SH 返り値 -.\"O When -.\"O .I fd -.\"O refers to the controlling terminal of the calling process, -.\"O the function -.\"O .BR tcgetpgrp () -.\"O will return the foreground process group ID of that terminal -.\"O if there is one, and some value larger than 1 that is not -.\"O presently a process group ID otherwise. -.I fd -が呼び出しを行ったプロセスの制御端末を参照している場合、関数 -.BR tcgetpgrp () -は、その制御端末のフォアグラウンド・プロセス・グループがあれば -そのプロセス・グループの ID を返す。 -そのようなプロセス・グループがなければ、現在プロセス・グループ ID -として使用されていない、1より大きな何らかの値が返される。 -.\"O When -.\"O .I fd -.\"O does not refer to the controlling terminal of the calling process, -.\"O \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -.I fd -が呼び出しを行ったプロセスの制御端末を参照していない場合、 -\-1 が返され、 -.I errno -が適切に設定される。 +\fIfd\fP が呼び出しを行ったプロセスの制御端末を参照している場合、関数 \fBtcgetpgrp\fP() +は、その制御端末のフォアグラウンド・プロセス・グループがあれば そのプロセス・グループの ID を返す。 +そのようなプロセス・グループがなければ、現在プロセス・グループ ID として使用されていない、1より大きな何らかの値が返される。 \fIfd\fP +が呼び出しを行ったプロセスの制御端末を参照していない場合、 \-1 が返され、 \fIerrno\fP が適切に設定される。 .LP -.\"O When successful, -.\"O .BR tcsetpgrp () -.\"O returns 0. -.\"O Otherwise, it returns \-1, and -.\"O .I errno -.\"O is set appropriately. -成功した場合、 -.BR tcsetpgrp () -は 0 を返す。そうでない場合、 \-1 を返し、 -.I errno -を適切に設定する。 -.\"O .SH ERRORS +成功した場合、 \fBtcsetpgrp\fP() は 0 を返す。そうでない場合、 \-1 を返し、 \fIerrno\fP を適切に設定する。 .SH エラー -.TP -.B EBADF -.\"O .I fd -.\"O is not a valid file descriptor. -.I fd -は有効なファイル記述子でない。 -.TP -.B EINVAL -.\"O .I pgrp -.\"O has an unsupported value. -.I pgrp -が無効な値である。 -.TP -.B ENOTTY -.\"O The calling process does not have a controlling terminal, or -.\"O it has one but it is not described by -.\"O .IR fd , -.\"O or, for -.\"O .BR tcsetpgrp (), -.\"O this controlling terminal is no longer associated with the session -.\"O of the calling process. -呼び出しを行ったプロセスが制御端末を持っていない、もしくは -制御端末を持っているが -.I fd -で参照されるものとは異なる、 -.BR tcsetpgrp () -の場合は、 -.I fd -で指定された制御端末がすでに呼び出しを行ったプロセスのセッション +.TP +\fBEBADF\fP +\fIfd\fP が適切なファイル・ディスクリプターでない。 +.TP +\fBEINVAL\fP +\fIpgrp\fP が無効な値である。 +.TP +\fBENOTTY\fP +呼び出しを行ったプロセスが制御端末を持っていない、もしくは 制御端末を持っているが \fIfd\fP で参照されるものとは異なる、 +\fBtcsetpgrp\fP() の場合は、 \fIfd\fP で指定された制御端末がすでに呼び出しを行ったプロセスのセッション と関係のないものになっている際にも、このエラーとなる。 -.TP -.B EPERM -.\"O .I pgrp -.\"O has a supported value, but is not the process group ID of a -.\"O process in the same session as the calling process. -.I pgrp -が有効な値だが、呼び出しを行ったプロセスと同じセッションに属する -プロセスのプロセス・グループ ID には該当するものがない。 -.\"O .SH "CONFORMING TO" +.TP +\fBEPERM\fP +\fIpgrp\fP が有効な値だが、呼び出しを行ったプロセスと同じセッションに属する プロセスのプロセス・グループ ID には該当するものがない。 .SH 準拠 -POSIX.1-2001. -.\"O .SH NOTES +POSIX.1\-2001. .SH 注意 -.\"O These functions are implemented via the -.\"O .B TIOCGPGRP -.\"O and -.\"O .B TIOCSPGRP -.\"O ioctls. -この関数は -.B TIOCGPGRP -と -.B TIOCGSID -の ioctl 経由で実現されている。 -.\"O .SS History +この関数は \fBTIOCGPGRP\fP と \fBTIOCGSID\fP の ioctl 経由で実現されている。 .SS 歴史 -.\"O The ioctls appeared in 4.2BSD. -.\"O The functions are POSIX inventions. -これらの ioctl は 4.2BSD で登場した。 -これらの関数は POSIX で考案されたものである。 -.\"O .SH "SEE ALSO" +これらの ioctl は 4.2BSD で登場した。 これらの関数は POSIX で考案されたものである。 .SH 関連項目 -.BR setpgid (2), -.BR setsid (2), -.BR credentials (7) +\fBsetpgid\fP(2), \fBsetsid\fP(2), \fBcredentials\fP(7) diff --git a/draft/man3/telldir.3 b/draft/man3/telldir.3 index 496d66ec..9a6a9478 100644 --- a/draft/man3/telldir.3 +++ b/draft/man3/telldir.3 @@ -7,7 +7,6 @@ .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this @@ -26,93 +25,40 @@ .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 17:48:42 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka -.\" all rights reserved. -.\" Translated 1997-12-24, HIROFUMI Nishizuka -.\" Updated & Modified 2005-02-19, Yuichi SATO -.\" Updated 2009-04-24, Akihiro MOTOKI , LDP v3.20 +.\" This file was generated with po4a. Translate the source file. .\" -.TH TELLDIR 3 2009-03-11 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH TELLDIR 3 2009\-03\-11 "" "Linux Programmer's Manual" .SH 名前 -.\"O telldir \- return current location in directory stream telldir \- ディレクトリストリーム中の現在位置を返す -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "long telldir(DIR *" dirp ); +\fBlong telldir(DIR *\fP\fIdirp\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR telldir (): -_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE -.\"O .SH DESCRIPTION +\fBtelldir\fP(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE .SH 説明 -.\"O The -.\"O .BR telldir () -.\"O function returns the current location associated with -.\"O the directory stream \fIdirp\fP. -.BR telldir () -関数は、ディレクトリストリーム \fIdirp\fP に結びつけられた -現在位置を返す。 -.\"O .SH "RETURN VALUE" +\fBtelldir\fP() 関数は、ディレクトリストリーム \fIdirp\fP に結びつけられた 現在位置を返す。 .SH 返り値 -.\"O On success, the -.\"O .BR telldir () -.\"O function returns the current location -.\"O in the directory stream. -.\"O On error, \-1 is returned, and -.\"O .I errno -.\"O is set appropriately. -成功した場合、 -.BR telldir () -関数はディレクトリストリーム中の現在位置を返す。 -エラーの場合、\-1 が返されて、 -.I errno +成功した場合、 \fBtelldir\fP() 関数はディレクトリストリーム中の現在位置を返す。 エラーの場合、\-1 が返されて、 \fIerrno\fP が適切に設定される。 -.\"O .SH ERRORS .SH エラー -.TP -.B EBADF -.\"O Invalid directory stream descriptor \fIdirp\fP. +.TP +\fBEBADF\fP ディレクトリストリームディスクリプタ \fIdirp\fP が無効である。 -.\"O .SH "CONFORMING TO" .SH 準拠 -4.3BSD, POSIX.1-2001. -.\"O .SH NOTES +4.3BSD, POSIX.1\-2001. .SH 注意 -.\"O In glibc up to version 2.1.1, the return type of -.\"O .BR telldir () -.\"O was -.\"O .IR off_t . -.\"O POSIX.1-2001 specifies -.\"O .IR long , -.\"O and this is the type used since glibc 2.1.2. -バージョン 2.1.1 以前の glibc では、 -.BR telldir ()9 -の返り値の型は -.I off_t -であった。 -POSIX.1-2001 では -.I long -と規定されており、glibc 2.1.2 以降では -.I long -になっている。 -.\"O .SH "SEE ALSO" +バージョン 2.1.1 以前の glibc では、 \fBtelldir\fP()9 の返り値の型は \fIoff_t\fP であった。 POSIX.1\-2001 +では \fIlong\fP と規定されており、glibc 2.1.2 以降では \fIlong\fP になっている。 .SH 関連項目 -.BR closedir (3), -.BR opendir (3), -.BR readdir (3), -.BR rewinddir (3), -.BR scandir (3), -.BR seekdir (3) +\fBclosedir\fP(3), \fBopendir\fP(3), \fBreaddir\fP(3), \fBrewinddir\fP(3), +\fBscandir\fP(3), \fBseekdir\fP(3) diff --git a/draft/man3/tgamma.3 b/draft/man3/tgamma.3 index 251ebcc1..c2c6547b 100644 --- a/draft/man3/tgamma.3 +++ b/draft/man3/tgamma.3 @@ -5,79 +5,43 @@ .\" .\" Modified 2004-11-15, fixed error noted by Fabian Kreutz .\" +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated Sun Sep 22 09:31:52 2002 -.\" by Akihiro MOTOKI -.\" Updated & Modified Sat Feb 12 12:00:00 2005 -.\" by SAITOH Akira -.\" Updated 2008-09-16, Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.TH TGAMMA 3 2010-09-20 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH TGAMMA 3 2010\-09\-20 GNU "Linux Programmer's Manual" .SH 名前 -.\"O tgamma, tgammaf, tgammal \- true gamma function tgamma, tgammaf, tgammal \- 本当のガンマ関数 -.\"O .SH SYNOPSIS .SH 書式 -.B #include +\fB#include \fP .sp -.BI "double tgamma(double " x ); +\fBdouble tgamma(double \fP\fIx\fP\fB);\fP .br -.BI "float tgammaf(float " x ); +\fBfloat tgammaf(float \fP\fIx\fP\fB);\fP .br -.BI "long double tgammal(long double " x ); +\fBlong double tgammal(long double \fP\fIx\fP\fB);\fP .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR tgamma (), -.BR tgammaf (), -.BR tgammal (): +\fBtgamma\fP(), \fBtgammaf\fP(), \fBtgammal\fP(): .RS 4 -_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O The Gamma function is defined by -.\"O .sp -.\"O Gamma(x) = integral from 0 to infinity of t^(x\-1) e^\-t dt -.\"O .sp -.\"O It is defined for every real number except for nonpositive integers. ガンマ関数は以下のように定義される: .sp Gamma(x) = t^(x\-1) e^\-t dt の 0 から無限大までの積分 .sp -この関数は正でない整数を除くすべての実数に対して定義されている。 -.\"O For nonnegative integral \fIm\fP one has -.\"O .sp -.\"O Gamma(m+1) = m! -.\"O .sp -.\"O and, more generally, for all \fIx\fP: -.\"O .sp -.\"O Gamma(x+1) = x * Gamma(x) -.\"O .sp -.\"O Furthermore, the following is valid for all values of \fIx\fP -.\"O outside the poles: -.\"O .sp -.\"O Gamma(x) * Gamma(1 \- x) = PI / sin(PI * x) -.\"O .PP -非負の整数 \fIm\fP に関して、以下が成立する: +この関数は正でない整数を除くすべての実数に対して定義されている。 非負の整数 \fIm\fP に関して、以下が成立する: .sp Gamma(m+1) = m! .sp @@ -89,218 +53,67 @@ or .sp Gamma(x) * Gamma(1 \- x) = PI / sin(PI * x) .PP -.\"O .SH RETURN VALUE .SH 返り値 -.\"O On success, these functions return Gamma(x). 成功すると、これらの関数は Gamma(x) を返す。 -.\"O If -.\"O .I x -.\"O is a NaN, a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is positive infinity, positive infinity is returned. -.I x -が正の無限大の場合、正の無限大が返される。 +\fIx\fP が正の無限大の場合、正の無限大が返される。 -.\"O If -.\"O .I x -.\"O is a negative integer, or is negative infinity, -.\"O a domain error occurs, -.\"O and a NaN is returned. -.I x -が負の整数か負の無限大の場合、領域エラー (domain error) が発生し、 -NaN が返される。 +\fIx\fP が負の整数か負の無限大の場合、領域エラー (domain error) が発生し、 NaN が返される。 -.\"O If the result overflows, -.\"O a range error occurs, -.\"O and the functions return -.\"O .BR HUGE_VAL , -.\"O .BR HUGE_VALF , -.\"O or -.\"O .BR HUGE_VALL , -.\"O respectively, with the correct mathematical sign. -結果がオーバーフローする場合、範囲エラー (range error) が発生し、 -各関数はそれぞれ -.BR HUGE_VAL , -.BR HUGE_VALF , -.BR HUGE_VALL , -を返す。この際、数学的に正しい符号が付与される。 +結果がオーバーフローする場合、範囲エラー (range error) が発生し、 各関数はそれぞれ \fBHUGE_VAL\fP, \fBHUGE_VALF\fP, +\fBHUGE_VALL\fP, を返す。この際、数学的に正しい符号が付与される。 -.\"O If the result underflows, -.\"O a range error occurs, -.\"O and the functions return 0, with the correct mathematical sign. -結果がアンダーフローする場合、範囲エラー (range error) が発生し、 -関数は 0 をを返す。この際、数学的に正しい符号が付与される。 +結果がアンダーフローする場合、範囲エラー (range error) が発生し、 関数は 0 をを返す。この際、数学的に正しい符号が付与される。 -.\"O If -.\"O .I x -.\"O is \-0 or +0, -.\"O a pole error occurs, -.\"O and the functions return -.\"O .BR HUGE_VAL , -.\"O .BR HUGE_VALF , -.\"O or -.\"O .BR HUGE_VALL , -.\"O respectively, with the same sign as the 0. -.I x -が \-0 か +0 の場合、極エラー (pole error) が発生し、 -各関数はそれぞれ -.BR HUGE_VAL , -.BR HUGE_VALF , -.BR HUGE_VALL , -を返す。 -0 と同じ符号が付与される。 -.\"O .SH ERRORS +\fIx\fP が \-0 か +0 の場合、極エラー (pole error) が発生し、 各関数はそれぞれ \fBHUGE_VAL\fP, +\fBHUGE_VALF\fP, \fBHUGE_VALL\fP, を返す。 0 と同じ符号が付与される。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Domain error: \fIx\fP is a negative integer, or negative infinity +.TP 領域エラー: \fIx\fP が負の整数か負の無限大 .\" FIXME . errno is not set to EDOM for x == -inf .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6809 -.\"O .I errno -.\"O is set to -.\"O .BR EDOM . -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised (but see BUGS). -.I errno -に -.B EDOM -が設定される。 -不正 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) -が上がる (「バグ」の節を参照)。 -.TP -.\"O Pole error: \fIx\fP is +0 or \-0 +\fIerrno\fP に \fBEDOM\fP が設定される。 不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる +(「バグ」の節を参照)。 +.TP 極エラー (pole error): \fIx\fP が +0 か \-0 -.\"O .I errno -.\"O is set to -.\"O .BR ERANGE . -.\"O A divide-by-zero floating-point exception -.\"O .RB ( FE_DIVBYZERO ) -.\"O is raised. -.I errno -に -.B ERANGE -が設定される。 -0 による除算 (divide-by-zero) 浮動小数点例外 -.RB ( FE_DIVBYZERO ) -が上がる。 -.TP -.\"O Range error: result overflow +\fIerrno\fP に \fBERANGE\fP が設定される。 0 による除算 (divide\-by\-zero) 浮動小数点例外 +(\fBFE_DIVBYZERO\fP) が上がる。 +.TP 範囲エラー (range error): 結果のオーバーフロー -.\"O .I errno -.\"O is set to -.\"O .BR ERANGE . -.\"O An overflow floating-point exception -.\"O .RB ( FE_OVERFLOW ) -.\"O is raised. -.I errno -に -.B ERANGE -が設定される。 -オーバーフロー浮動小数点例外 -.RB ( FE_OVERFLOW ) -が上がる。 +\fIerrno\fP に \fBERANGE\fP が設定される。 オーバーフロー浮動小数点例外 (\fBFE_OVERFLOW\fP) が上がる。 .PP -.\"O glibc also gives the following error which is not specified -.\"O in C99 or POSIX.1-2001. -glibc では、C99 や POSIX.1-2001 で規定されていない以下のエラーも -起こり得る。 -.TP -.\"O Range error: result underflow +glibc では、C99 や POSIX.1\-2001 で規定されていない以下のエラーも 起こり得る。 +.TP 範囲エラー (range error): 結果のアンダーフロー .\" e.g., tgamma(-172.5) on glibc 2.8/x86-32 .\" .I errno .\" is set to .\" .BR ERANGE . -.\"O An underflow floating-point exception -.\"O .RB ( FE_UNDERFLOW ) -.\"O is raised. -.\"O .IP -.\"O .I errno -.\"O is not set for this case. -アンダーフロー浮動小数点例外 -.RB ( FE_UNDERFLOW ) -が上がる。 -この場合は -.I errno -は設定されない。 +アンダーフロー浮動小数点例外 (\fBFE_UNDERFLOW\fP) が上がる。 +.IP .\" FIXME . Is it intentional that errno is not set: .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6810 .\" .\" glibc (as at 2.8) also supports and an inexact .\" exception for various cases. -.\"O .SH VERSIONS +この場合は \fIerrno\fP は設定されない。 .SH バージョン -.\"O These functions first appeared in glibc in version 2.1. これらの関数は glibc バージョン 2.1 で初めて登場した。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O .SH NOTES +C99, POSIX.1\-2001. .SH 注意 -.\"O This function had to be called "true gamma function" -.\"O since there is already a function -.\"O .BR gamma (3) -.\"O that returns something else (see -.\"O .BR gamma (3) -.\"O for details). -この関数を「本当の (true) ガンマ関数」と呼ばなければならなかった。 -なぜなら、他の値を返す -.BR gamma (3) -という関数がすでに存在するからである (詳細については -.BR gamma (3) -を参照)。 -.\"O .SH BUGS +この関数を「本当の (true) ガンマ関数」と呼ばなければならなかった。 なぜなら、他の値を返す \fBgamma\fP(3) +という関数がすでに存在するからである (詳細については \fBgamma\fP(3) を参照)。 .SH バグ -.\"O If -.\"O .I x -.\"O is negative infinity, -.\"O .I errno -.\"O is not set (it should be set to -.\"O .BR EDOM ). -.I x -が負の無限大の場合、 -.I errno -は設定されない -.RB ( EDOM -が設定されるべきである)。 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6809 +\fIx\fP が負の無限大の場合、 \fIerrno\fP は設定されない (\fBEDOM\fP が設定されるべきである)。 -.\"O In glibc versions 2.3.3 and earlier, -.\"O an argument of +0 or \-0 incorrectly produced a domain error -.\"O .RI ( errno -.\"O set to -.\"O .B EDOM -.\"O and an -.\"O .B FE_INVALID -.\"O exception raised), rather than a pole error. -glibc バージョン 2.3.3 以前では、 -引き数に +0 や \-0 を渡すと、極エラーではなく、 -領域エラーを間違って発生していた -(領域エラーの場合、 -.I errno -に -.B EDOM -を設定され、 -.B FE_INVALID -例外が発生する)。 -.\"O .SH "SEE ALSO" +glibc バージョン 2.3.3 以前では、 引き数に +0 や \-0 を渡すと、極エラーではなく、 領域エラーを間違って発生していた +(領域エラーの場合、 \fIerrno\fP に \fBEDOM\fP を設定され、 \fBFE_INVALID\fP 例外が発生する)。 .SH 関連項目 -.BR gamma (3), -.BR lgamma (3) +\fBgamma\fP(3), \fBlgamma\fP(3) diff --git a/draft/man3/timegm.3 b/draft/man3/timegm.3 index 22c0292a..6f1e2f70 100644 --- a/draft/man3/timegm.3 +++ b/draft/man3/timegm.3 @@ -20,94 +20,39 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved. -.\" Translated Thu 3 Jan 2002 by NAKANO Takeo +.\"******************************************************************* .\" -.TH TIMEGM 3 2007-07-26 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O timegm, timelocal \- inverses of gmtime and localtime +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH TIMEGM 3 2007\-07\-26 GNU "Linux Programmer's Manual" .SH 名前 timegm, timelocal \- gmtime と localtime の逆関数 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "time_t timelocal(struct tm *" tm ); +\fBtime_t timelocal(struct tm *\fP\fItm\fP\fB);\fP .sp -.BI "time_t timegm(struct tm *" tm ); +\fBtime_t timegm(struct tm *\fP\fItm\fP\fB);\fP .sp .fi .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR timelocal (), -.BR timegm (): -_BSD_SOURCE || _SVID_SOURCE -.\"O .SH DESCRIPTION +\fBtimelocal\fP(), \fBtimegm\fP(): _BSD_SOURCE || _SVID_SOURCE .SH 説明 -.\"O The functions -.\"O .BR timelocal () -.\"O and -.\"O .BR timegm () -.\"O are the inverses of -.\"O .BR localtime (3) -.\"O and -.\"O .BR gmtime (3). -.BR timelocal () -関数と -.BR timegm () -関数は、それぞれ -.BR localtime (3) -関数と -.BR gmtime (3) +\fBtimelocal\fP() 関数と \fBtimegm\fP() 関数は、それぞれ \fBlocaltime\fP(3) 関数と \fBgmtime\fP(3) 関数の逆関数である。 -.\"O .SH "CONFORMING TO" .SH 準拠 -.\"O These functions are nonstandard GNU extensions -.\"O that are also present on the BSDs. -.\"O Avoid their use; see NOTES. -これらの関数は非標準で GNU の拡張である。 -BSD 系にも存在する。 -これらの使用は避けること。「注意」参照。 -.\"O .SH NOTES +これらの関数は非標準で GNU の拡張である。 BSD 系にも存在する。 これらの使用は避けること。「注意」参照。 .SH 注意 -.\"O The -.\"O .BR timelocal () -.\"O function is equivalent to the POSIX standard function -.\"O .BR mktime (3). -.\"O There is no reason to ever use it. -.BR timelocal () -関数は POSIX の標準関数 -.BR mktime (3) -と同じものである。 -ので、これを使う理由はないはずである。 +\fBtimelocal\fP() 関数は POSIX の標準関数 \fBmktime\fP(3) と同じものである。 ので、これを使う理由はないはずである。 .LP -.\"O For a portable version of -.\"O .BR timegm (), -.\"O set the -.\"O .B TZ -.\"O environment variable to UTC, call -.\"O .BR mktime (3) -.\"O and restore the value of -.\"O .BR TZ . -.\"O Something like -.BR timegm () -を移植性があるようなかたちで実現するには、 -.B TZ -環境変数を UTC に設定してから -.BR mktime (3) -を呼んで、 -.B TZ -の値を取得すればよい。 -例えば次のようになるだろう。 -.\"O -.sp +\fBtimegm\fP() を移植性があるようなかたちで実現するには、 \fBTZ\fP 環境変数を UTC に設定してから \fBmktime\fP(3) +を呼んで、 \fBTZ\fP の値を取得すればよい。 例えば次のようになるだろう。 + .in +4n .nf #include @@ -131,9 +76,5 @@ time_t my_timegm (struct tm *tm) } .fi .in -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR gmtime (3), -.BR localtime (3), -.BR mktime (3), -.BR tzset (3) +\fBgmtime\fP(3), \fBlocaltime\fP(3), \fBmktime\fP(3), \fBtzset\fP(3) diff --git a/draft/man3/timeradd.3 b/draft/man3/timeradd.3 index 164e40c1..da17b3a4 100644 --- a/draft/man3/timeradd.3 +++ b/draft/man3/timeradd.3 @@ -22,226 +22,78 @@ .\" .\" 2007-07-31, mtk, Created .\" -.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2007-10-16, Akihiro MOTOKI , LDP v2.66 -.\" Updated 2009-04-24, Akihiro MOTOKI , LDP v3.20 -.\" -.TH TIMERADD 3 2010-02-25 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH TIMERADD 3 2010\-02\-25 Linux "Linux Programmer's Manual" .SH 名前 -.\"O timeradd, timersub, timercmp, timerclear, timerisset \- timeval operations timeradd, timersub, timercmp, timerclear, timerisset \- timeval の操作 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP -.BI "void timeradd(struct timeval *" a ", struct timeval *" b , -.BI " struct timeval *" res ); +\fBvoid timeradd(struct timeval *\fP\fIa\fP\fB, struct timeval *\fP\fIb\fP\fB,\fP +\fB struct timeval *\fP\fIres\fP\fB);\fP -.BI "void timersub(struct timeval *" a ", struct timeval *" b , -.BI " struct timeval *" res ); +\fBvoid timersub(struct timeval *\fP\fIa\fP\fB, struct timeval *\fP\fIb\fP\fB,\fP +\fB struct timeval *\fP\fIres\fP\fB);\fP -.BI "void timerclear(struct timeval *" tvp ); +\fBvoid timerclear(struct timeval *\fP\fItvp\fP\fB);\fP -.BI "int timerisset(struct timeval *" tvp ); +\fBint timerisset(struct timeval *\fP\fItvp\fP\fB);\fP -.BI "int timercmp(struct timeval *" a ", struct timeval *" b ", " CMP ); +\fBint timercmp(struct timeval *\fP\fIa\fP\fB, struct timeval *\fP\fIb\fP\fB, \fP\fICMP\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.\"O All functions shown above: -上記の全ての関数: -_BSD_SOURCE -.\"O .SH DESCRIPTION +上記の全ての関数: _BSD_SOURCE .SH 説明 -.\"O The macros are provided to operate on -.\"O .I timeval -.\"O structures, defined in -.\"O .I -.\"O as: -.I timeval -構造体を操作するためのマクロが提供されている。 -.I timeval -構造体は -.I +\fItimeval\fP 構造体を操作するためのマクロが提供されている。 \fItimeval\fP 構造体は \fI\fP で以下のように定義されている。 .sp .in +4n .nf struct timeval { -.\"O time_t tv_sec; /* seconds */ -.\"O suseconds_t tv_usec; /* microseconds */ time_t tv_sec; /* 秒 */ suseconds_t tv_usec; /* マイクロ秒 */ }; .fi .in .PP -.\"O .BR timeradd () -.\"O adds the time values in -.\"O .I a -.\"O and -.\"O .IR b , -.\"O and places the sum in the -.\"O .I timeval -.\"O pointed to by -.\"O .IR res . -.\"O The result is normalized such that -.\"O .I res\->tv_usec -.\"O has a value in the range 0 to 999,999. -.BR timeradd () -は、 -.I a -と -.I b -の時刻値を加算し、その合計を -.I res -により参照される -.I timeval -構造体に格納する。結果は、 -.I res\->tv_usec -の値が 0 から 999,999 の範囲に入るように正規化される。 +\fBtimeradd\fP() は、 \fIa\fP と \fIb\fP の時刻値を加算し、その合計を \fIres\fP により参照される \fItimeval\fP +構造体に格納する。結果は、 \fIres\->tv_usec\fP の値が 0 から 999,999 の範囲に入るように正規化される。 -.\"O .BR timersub () -.\"O subtracts the time value in -.\"O .I b -.\"O from the time value in -.\"O .IR a , -.\"O and places the result in the -.\"O .I timeval -.\"O pointed to by -.\"O .IR res . -.\"O The result is normalized such that -.\"O .I res\->tv_usec -.\"O has a value in the range 0 to 999,999. -.BR timersub () -は、 -.I a -の時刻値から -.I b -の時刻値を減算し、その結果を -.I res -により参照される -.I timeval -構造体に格納する。結果は、 -.I res\->tv_usec -の値が 0 から 999,999 の範囲に入るように正規化される。 +\fBtimersub\fP() は、 \fIa\fP の時刻値から \fIb\fP の時刻値を減算し、その結果を \fIres\fP により参照される \fItimeval\fP +構造体に格納する。結果は、 \fIres\->tv_usec\fP の値が 0 から 999,999 の範囲に入るように正規化される。 -.\"O .BR timerclear () -.\"O zeros out the -.\"O .I timeval -.\"O structure pointed to by -.\"O .IR tvp , -.\"O so that it represents the Epoch: 1970-01-01 00:00:00 +0000 (UTC). -.BR timerclear () -は -.I tvp -により参照される -.I timeval -構造体を 0 で埋める。 -0 で埋められた -.I timeval -構造体は、時刻紀元 (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) を表す。 +\fBtimerclear\fP() は \fItvp\fP により参照される \fItimeval\fP 構造体を 0 で埋める。 0 で埋められた +\fItimeval\fP 構造体は、時刻紀元 (Epoch; 1970\-01\-01 00:00:00 +0000 (UTC)) を表す。 -.\"O .BR timerisset () -.\"O returns true (nonzero) if either field of the -.\"O .I timeval -.\"O structure pointed to by -.\"O .I tvp -.\"O contains a nonzero value. -.BR timerisset () -は、 -.I tvp -により参照される -.I timeval -構造体のいずれか一方のフィールドに 0 以外の値が入っていれば、 -真 (0 以外) を返す。 +\fBtimerisset\fP() は、 \fItvp\fP により参照される \fItimeval\fP 構造体のいずれか一方のフィールドに 0 +以外の値が入っていれば、 真 (0 以外) を返す。 -.\"O .BR timercmp () -.\"O compares the timer values in -.\"O .I a -.\"O and -.\"O .I b -.\"O using the comparison operator -.\"O .IR CMP , -.\"O and returns true (nonzero) or false (0) depending on -.\"O the result of the comparison. -.BR timercmp () -は -.I a -と -.I b -の時刻値を比較演算子 -.I CMP -を使って比較し、比較結果に基づき、真 (0 以外) か偽 (0) を返す。 -.\"O Some systems (but not Linux/glibc), -.\"O have a broken -.\"O .BR timercmp () -.\"O implementation, -.\"O .\" HP-UX, Tru64, Irix have a definition like: -.\"O .\"#define timercmp(tvp, uvp, cmp) \ -.\"O .\" ((tvp)->tv_sec cmp (uvp)->tv_sec || \ -.\"O .\" (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec) -.\"O in which -.\"O .I CMP -.\"O of -.\"O .IR >= , -.\"O .IR <= , -.\"O and -.\"O .I == -.\"O do not work; -(Linux/glibc はそうではないが) -いくつかのシステムでは、 -.BRr timercmp () -の実装がおかしく、 -.\" HP-UX, Tru64, Irix では以下のように定義されている。 +.\" HP-UX, Tru64, Irix have a definition like: .\"#define timercmp(tvp, uvp, cmp) \ .\" ((tvp)->tv_sec cmp (uvp)->tv_sec || \ .\" (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec) -.I CMP -に -.IR >= , -.IR <= , -.I == -を指定すると正しく動作しない。 -.\"O portable applications can instead use -移植性が必要なアプリケーションでは、 +\fBtimercmp\fP() は \fIa\fP と \fIb\fP の時刻値を比較演算子 \fICMP\fP を使って比較し、比較結果に基づき、真 (0 以外) か偽 +(0) を返す。 (Linux/glibc はそうではないが) いくつかのシステムでは、 \fBtimercmp\fP() の実装がおかしく、 +\fICMP\fP に \fI>=\fP, \fI<=\fP, \fI==\fP を指定すると正しく動作しない。 移植性が必要なアプリケーションでは、 代わりに以下を使うこと。 !timercmp(..., <) !timercmp(..., >) !timercmp(..., !=) -.\"O .SH RETURN VALUE .SH 返り値 -.\"O .BR timerisset () -.\"O and -.\"O .BR timercmp () -.\"O return true (nonzero) or false (0). -.BR timerisset () -と -.BR timercmp () -は、真 (0 以外) か偽 (0) を返す。 -.BR -.\"O .SH ERRORS +\fBtimerisset\fP() と \fBtimercmp\fP() は、真 (0 以外) か偽 (0) を返す。 .SH エラー -.\"O No errors are defined. エラーは定義されていない。 -.\"O .SH CONFORMING TO .SH 準拠 -.\"O Not in POSIX.1-2001. -.\"O Present on most BSD derivatives. -POSIX.1-2001 にはない。 -ほとんどの BSD 由来のシステムには存在する。 -.\"O .SH "SEE ALSO" +POSIX.1\-2001 にはない。 ほとんどの BSD 由来のシステムには存在する。 .SH 関連項目 -.BR gettimeofday (2), -.BR time (7) +\fBgettimeofday\fP(2), \fBtime\fP(7) diff --git a/draft/man3/trunc.3 b/draft/man3/trunc.3 index 57bb3d39..51da34f5 100644 --- a/draft/man3/trunc.3 +++ b/draft/man3/trunc.3 @@ -20,99 +20,55 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2001, 2005 Yuichi SATO -.\" all rights reserved. -.\" Translated Sun Jul 8 10:40:20 JST 2001 -.\" by Yuichi SATO -.\" Updated & Modified Sun Jan 16 08:20:45 JST 2005 -.\" by Yuichi SATO +.\"******************************************************************* .\" -.TH TRUNC 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH TRUNC 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O trunc, truncf, truncl \- round to integer, towards zero trunc, truncf, truncl \- 0 に近い方の整数値に丸める -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double trunc(double " x ); +\fBdouble trunc(double \fP\fIx\fP\fB);\fP .br -.BI "float truncf(float " x ); +\fBfloat truncf(float \fP\fIx\fP\fB);\fP .br -.BI "long double truncl(long double " x ); +\fBlong double truncl(long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR trunc (), -.BR truncf (), -.BR truncl (): +\fBtrunc\fP(), \fBtruncf\fP(), \fBtruncl\fP(): .RS 4 -_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || -_POSIX_C_SOURCE\ >=\ 200112L; +_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br -or -.I cc\ -std=c99 +or \fIcc\ \-std=c99\fP .RE .ad -.\"O .SH DESCRIPTION .SH 説明 -.\"O These functions round \fIx\fP to the nearest integer -.\"O not larger in absolute value. -これらの関数は絶対値が \fIx\fP より小さい -一番近い整数値に \fIx\fP を丸める。 -.\"O .SH "RETURN VALUE" +これらの関数は絶対値が \fIx\fP より小さい 一番近い整数値に \fIx\fP を丸める。 .SH 返り値 -.\"O These functions return the rounded integer value. -これらの関数は丸められた整数値を返す。 +これらの関数は丸めた整数値を返す。 -.\"O If \fIx\fP is integral, infinite, or NaN, \fIx\fP itself is returned. \fIx\fP が整数、無限大、NaN の場合、\fIx\fP 自身が返される。 -.\"O .SH ERRORS .SH エラー -.\"O No errors occur. エラーは発生しない。 -.\"O .SH VERSIONS .SH バージョン -.\"O These functions first appeared in glibc in version 2.1. これらの関数は glibc バージョン 2.1 で初めて登場した。 -.\"O .SH "CONFORMING TO" .SH 準拠 -C99, POSIX.1-2001. -.\"O .SH NOTES +C99, POSIX.1\-2001. .SH 注意 -.\"O The integral value returned by these functions may be too large -.\"O to store in an integer type -.\"O .RI ( int , -.\"O .IR long , -.\"O etc.). -.\"O To avoid an overflow, which will produce undefined results, -.\"O an application should perform a range check on the returned value -.\"O before assigning it to an integer type. -これらの関数が返す整数値は整数型 -.RI ( int , -.I long -など) に格納するには大き過ぎるかもしれない。 -オーバーフローが起こった場合の結果は分からないので、 -オーバーフローを避けるため、アプリケーションでは整数型に代入する前に +これらの関数が返す整数値は整数型 (\fIint\fP, \fIlong\fP など) に格納するには大き過ぎるかもしれない。 +オーバーフローが起こった場合の結果は分からないので、 オーバーフローを避けるため、アプリケーションでは整数型に代入する前に 返された値の範囲確認を実行すべきである。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR ceil (3), -.BR floor (3), -.BR lrint (3), -.BR nearbyint (3), -.BR rint (3), -.BR round (3) +\fBceil\fP(3), \fBfloor\fP(3), \fBlrint\fP(3), \fBnearbyint\fP(3), \fBrint\fP(3), +\fBround\fP(3) diff --git a/draft/man3/tzset.3 b/draft/man3/tzset.3 index faab3d5f..72653bbe 100644 --- a/draft/man3/tzset.3 +++ b/draft/man3/tzset.3 @@ -28,356 +28,143 @@ .\" Modified 2001-11-13, aeb .\" Modified 2004-12-01 mtk and Martin Schulze .\" -.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. -.\" Translated 1998-03-23, NAKANO Takeo -.\" Updated 2000-09-14, Kentaro Shirakata -.\" Updated 2002-01-06, NAKANO Takeo -.\" Updated 2007-01-07, Akihiro MOTOKI, catch up to LDP v2.43 +.\"******************************************************************* .\" -.\" WORD: Wall Clock Time 壁時計時刻 -.\" WORD: Coordinated Universal Time 協定世界時 -.\" WORD: daylight saving time サマータイム -.\" WORD: Prime Meridian グリニッジ子午線 +.\" This file was generated with po4a. Translate the source file. .\" -.TH TZSET 3 2010-02-25 "" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O tzset, tzname, timezone, daylight \- initialize time conversion information +.\"******************************************************************* +.TH TZSET 3 2012\-03\-25 "" "Linux Programmer's Manual" .SH 名前 tzset, tzname, timezone, daylight \- 時刻の変換情報を初期化する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.B void tzset (void); +\fBvoid tzset (void);\fP .sp -.BI "extern char *" tzname [2]; -.BI "extern long " timezone ; -.BI "extern int " daylight ; +\fBextern char *\fP\fItzname\fP\fB[2];\fP +\fBextern long \fP\fItimezone\fP\fB;\fP +\fBextern int \fP\fIdaylight\fP\fB;\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR tzset (): -_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +\fBtzset\fP(): _POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE .br -.IR tzname : -_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE +\fItzname\fP: _POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE .br -.IR timezone : -_SVID_SOURCE || _XOPEN_SOURCE +\fItimezone\fP: _SVID_SOURCE || _XOPEN_SOURCE .br -.IR daylight : -_SVID_SOURCE || _XOPEN_SOURCE -.\"O .SH DESCRIPTION +\fIdaylight\fP: _SVID_SOURCE || _XOPEN_SOURCE .SH 説明 -.\"O The -.\"O .BR tzset () -.\"O function initializes the \fItzname\fP variable from the -.\"O .B TZ -.\"O environment variable. -.\"O This function is automatically called by the -.\"O other time conversion functions that depend on the timezone. -.\"O In a System-V-like environment, it will also set the variables \fItimezone\fP -.\"O (seconds West of UTC) and \fIdaylight\fP (to 0 if this timezone does not -.\"O have any daylight saving time rules, or to nonzero if there is a time during -.\"O the year when daylight saving time applies). -.BR tzset () -関数は -.B TZ -環境変数を用いて \fItzname\fP 変数を初期化する。 -この関数は、タイムゾーンに依存する他の時刻変換関数から自動的に呼び出される。 -System V 的な環境では、この関数は変数 \fItimezone\fP (UTC からの西向きの秒数) と -\fIdaylight\fP (このタイムゾーンにサマータイムに関するルールがなければ 0、 +\fBtzset\fP() 関数は \fBTZ\fP 環境変数を用いて \fItzname\fP 変数を初期化する。 +この関数は、タイムゾーンに依存する他の時刻変換関数から自動的に呼び出される。 System V 的な環境では、この関数は変数 \fItimezone\fP +(UTC からの西向きの秒数) と \fIdaylight\fP (このタイムゾーンにサマータイムに関するルールがなければ 0、 サマータイム期間が一年のどこかにあれば 0 以外) も設定する。 .PP -.\"O If the -.\"O .B TZ -.\"O variable does not appear in the environment, the \fItzname\fP -.\"O variable is initialized with the best approximation of local wall clock -.\"O time, as specified by the -.\"O .BR tzfile (5)-format -.\"O file \fIlocaltime\fP -.\"O found in the system timezone directory (see below). -.B TZ -環境変数が設定されていない場合には、 -\fItzname\fP 変数はローカルな壁時計時刻 (wall clock time) に -最も近い値に初期化される。 -このローカルな壁時計時刻としては、 -システムのタイムゾーンディレクトリ (後述) にある -.BR tzfile (5) -形式のファイル \fIlocaltime\fP で指定されている値が用いられる。 -.\"O (One also often sees -.\"O .I /etc/localtime -.\"O used here, a symlink to the right file in the system timezone directory.) -(この際には -.I /etc/localtime -もよく用いられる。 -これはシステムのタイムゾーンディレクトリにある -適切なファイルへのシンボリックリンクになっている。) +\fBTZ\fP 環境変数が設定されていない場合には、 \fItzname\fP 変数はローカルな壁時計時刻 (wall clock time) に +最も近い値に初期化される。 このローカルな壁時計時刻としては、 システムのタイムゾーンディレクトリ (後述) にある \fBtzfile\fP(5) +形式のファイル \fIlocaltime\fP で指定されている値が用いられる。 (この際には \fI/etc/localtime\fP もよく用いられる。 +これはシステムのタイムゾーンディレクトリにある 適切なファイルへのシンボリックリンクになっている。) .PP -.\"O If the -.\"O .B TZ -.\"O variable does appear in the environment but its value is empty -.\"O or its value cannot be interpreted using any of the formats specified -.\"O below, Coordinated Universal Time (UTC) is used. -.B TZ -環境変数が存在しているが、その値が空だったり、 -以下に示す形式のどれにもあてはまらない場合は、 -協定世界時 (Coordinated Universal Time: UTC) が用いられる。 +\fBTZ\fP 環境変数が存在しているが、その値が空だったり、 以下に示す形式のどれにもあてはまらない場合は、 協定世界時 (Coordinated +Universal Time: UTC) が用いられる。 .PP -.\"O The value of -.\"O .B TZ -.\"O can be one of three formats. -.\"O The first format is used -.\"O when there is no daylight saving time in the local timezone: -.B TZ -の値は以下の 3 つの形式のいずれかを取ることができる。 -最初の形式はサマータイム (daylight saving time) +\fBTZ\fP の値は以下の 3 つの形式のいずれかを取ることができる。 最初の形式はサマータイム (daylight saving time) を持たないローカルタイムゾーンに対して用いる。 .sp .RS -.I std offset +\fIstd offset\fP .RE .sp -.\"O The \fIstd\fP string specifies the name of the timezone and must be -.\"O three or more alphabetic characters. -.\"O The \fIoffset\fP string immediately -.\"O follows \fIstd\fP and specifies the time value to be added to the local -.\"O time to get Coordinated Universal Time (UTC). -.\"O The \fIoffset\fP is positive -.\"O if the local timezone is west of the Prime Meridian and negative if it is -.\"O east. -.\"O The hour must be between 0 and 24, and the minutes and seconds -.\"O 0 and 59. -\fIstd\fP 文字列はタイムゾーンの名前を指定する。 -アルファベットからなる 3 文字以上の文字列でなければならない。 -\fIoffset\fP 文字列は \fIstd\fP の直後に続き、 -協定世界時 (UTC) を得るために -ローカルな時刻に加えなければならない時間を指定する。 -.I offset -は、ローカルタイムゾーンがグリニッジ子午線 (Prime Meridian) -の西なら正の値、東なら負の値を取る。 -時間 (hour) は 0 から 24 の間でなければならない。 -分 (minute) と秒 (second) は 0 から 59 の間でなければならない。 +\fIstd\fP 文字列はタイムゾーンの名前を指定する。 アルファベットからなる 3 文字以上の文字列でなければならない。 \fIoffset\fP 文字列は +\fIstd\fP の直後に続き、 協定世界時 (UTC) を得るために ローカルな時刻に加えなければならない時間を指定する。 \fIoffset\fP +は、ローカルタイムゾーンがグリニッジ子午線 (Prime Meridian) の西なら正の値、東なら負の値を取る。 時間 (hour) は 0 から +24 の間でなければならない。 分 (minute) と秒 (second) は 0 から 59 の間でなければならない。 .PP -.\"O The second format is used when there is daylight saving time: 2 番目の形式はサマータイムがある場合に用いられる。 .sp .RS -.I std offset dst [offset],start[/time],end[/time] +\fIstd offset dst [offset],start[/time],end[/time]\fP .RE .sp -.\"O There are no spaces in the specification. -.\"O The initial \fIstd\fP and -.\"O \fIoffset\fP specify the standard timezone, as described above. -.\"O The \fIdst\fP string and \fIoffset\fP specify the name and offset for the -.\"O corresponding daylight saving timezone. -.\"O If the offset is omitted, -.\"O it default to one hour ahead of standard time. -指定にはスペースを含めてはならない。 -先頭の \fIstd\fP と \fIoffset\fP は 1 番目の形式と同じで、 -標準のタイムゾーンを指定する。 -\fIdst\fP 文字列と \fIoffset\fP は、 -対応するサマータイムゾーンの名前とオフセットを指定する。 +指定にはスペースを含めてはならない。 先頭の \fIstd\fP と \fIoffset\fP は 1 番目の形式と同じで、 標準のタイムゾーンを指定する。 +\fIdst\fP 文字列と \fIoffset\fP は、 対応するサマータイムゾーンの名前とオフセットを指定する。 オフセットが省略されると、デフォルトでは標準の一時間前となる。 .PP -.\"O The \fIstart\fP field specifies when daylight saving time goes into -.\"O effect and the \fIend\fP field specifies when the change is made back to -.\"O standard time. -.\"O These fields may have the following formats: -\fIstart\fP フィールドはサマータイムが有効になる時刻、 -\fIend\fP フィールドは標準に戻る時刻である。 +\fIstart\fP フィールドはサマータイムが有効になる時刻、 \fIend\fP フィールドは標準に戻る時刻である。 これらのフィールドは以下の形式で指定する。 -.TP +.TP J\fIn\fP -.\"O This specifies the Julian day with \fIn\fP between 1 and 365. -.\"O February 29 is never counted even in leap years. +年の通日 (Julian day) で日にちを指定する。 +\fIn\fP は 1 から 365 の間の数値。閏日は計算に入らない。 +この形式では、2 月 29 日を表現することはできず、 +2 月 28 日が第 59 日で、3 月 1 日が常に第 60 日となる。 +.TP +\fIn\fP 年の通日 (Julian day) で日にちを指定する。 \fIn\fP は 1 から 365 の間の数値。 -うるう年の場合でも 2 月 29 日はカウントされない。 -.TP -.I n -.\"O This specifies the Julian day with \fIn\fP between 1 and 365. -.\"O February 29 is counted in leap years. -年の通日で日にちを指定する。 -\fIn\fP は 1 から 365 の間の数値。 -うるう年の場合には 2 月 29 日がカウントされる。 -.TP +閏年の場合も、2 月 29 日も日にちの計算に含められる。 +.TP M\fIm\fP.\fIw\fP.\fId\fP -.\"O This specifies day \fId\fP (0 <= \fId\fP <= 6) of week \fIw\fP -.\"O (1 <= \fIw\fP <= 5) of month \fIm\fP (1 <= \fIm\fP <= 12). -.\"O Week 1 is -.\"O the first week in which day \fId\fP occurs and week 5 is the last week -.\"O in which day \fId\fP occurs. -.\"O Day 0 is a Sunday. -\fIm\fP は月 (1 <= \fIm\fP <= 12) を、 -\fIw\fP は月のうちの週 (1 <= \fIw\fP <= 5) を、 -\fId\fP は週のうちの日にち (0 <= \fId\fP <= 6) を示す。 -\fIw\fP = 1 は所属する \fId\fP が存在する最初の週、 -\fIw\fP = 5 は最後の週である。 -\fId\fP = 0 は日曜日である。 +\fIm\fP は月 (1 <= \fIm\fP <= 12) を、 \fIw\fP は月のうちの週 (1 <= \fIw\fP <= 5) +を、 \fId\fP は週のうちの日にち (0 <= \fId\fP <= 6) を示す。 \fIw\fP = 1 は所属する \fId\fP +が存在する最初の週、 \fIw\fP = 5 は最後の週である。 \fId\fP = 0 は日曜日である。 .PP -.\"O The \fItime\fP fields specify when, in the local time currently in effect, -.\"O the change to the other time occurs. -.\"O If omitted, the default is 02:00:00. -\fItime\fP フィールドは、ローカルタイムを切り替える時刻を、 -変更前のローカルタイムで表したものである。 -省略された場合のデフォルトは 02:00:00 である。 +\fItime\fP フィールドは、ローカルタイムを切り替える時刻を、 変更前のローカルタイムで表したものである。 省略された場合のデフォルトは +02:00:00 である。 -.\"O Here is an example for New Zealand, -.\"O where the standard time (NZST) is 12 hours ahead of UTC, -.\"O and daylight saving time (NZDT), 13 hours ahead of UTC, -.\"O runs from the first Sunday in October to the third Sunday in March, -.\"O and the changeovers happen at the default time of 02:00:00: -ニュージーランドの例である。 -ニュージーランドでは、標準のタイムゾーン (NZST) は UTC より 12時間進んでおり、 -サマータイム (NZDT) は UTC の 13時間進んでいる。 -サマータイムは 10月の第一日曜から 3月の第三日曜までであり、 -ローカルタイムの切り替えはデフォルトの 02:00:00 に行われる。 +ニュージーランドの例である。 ニュージーランドでは、標準のタイムゾーン (NZST) は UTC より 12時間進んでおり、 サマータイム (NZDT) +は UTC の 13時間進んでいる。 サマータイムは 10月の第一日曜から 3月の第三日曜までであり、 ローカルタイムの切り替えはデフォルトの +02:00:00 に行われる。 .nf - TZ="NZST-12:00:00NZDT-13:00:00,M10.1.0,M3.3.0" + TZ="NZST\-12:00:00NZDT\-13:00:00,M10.1.0,M3.3.0" .fi .PP -.\"O The third format specifies that the timezone information should be read -.\"O from a file: 3 番目の形式は、タイムゾーンの情報をファイルから読み込むように指定する。 .sp .RS :[filespec] .RE .sp -.\"O If the file specification \fIfilespec\fP is omitted, the timezone -.\"O information is read from the file -.\"O .I localtime -.\"O in the system timezone directory, which nowadays usually is -.\"O .IR /usr/share/zoneinfo . -ファイルの指定 \fIfilespec\fP が省略された場合は、 -タイムゾーンの情報はシステムタイムゾーンディレクトリの -.I localtime -ファイルから読まれる。 -最近ではシステムタイムゾーンディレクトリは普通 -.I /usr/share/zoneinfo/localtime -である。 -.\"O This file is in -.\"O .BR tzfile (5) -.\"O format. -.\"O If \fIfilespec\fP is given, it specifies another -.\"O .BR tzfile (5)-format -.\"O file to read the timezone information from. -.\"O If \fIfilespec\fP does not begin with a \(aq/\(aq, the file specification is -.\"O relative to the system timezone directory. -このファイルは -.BR tzfile (5) -形式で書かれている。 -\fIfilespec\fP が与えられた場合は、 -タイムゾーンの情報をそのファイルから読み込む。このファイルも -.BR tzfile (5) -形式で書かれている必要がある。 -\fIfilespec\fP が \(aq/\(aq で始まらなかった場合には、 -システムタイムゾーンディレクトリからの相対パスで -ファイルが指定されたことになる。 +ファイルの指定 \fIfilespec\fP が省略された場合は、 タイムゾーンの情報はシステムタイムゾーンディレクトリの \fIlocaltime\fP +ファイルから読まれる。 最近ではシステムタイムゾーンディレクトリは普通 \fI/usr/share/zoneinfo/localtime\fP である。 +このファイルは \fBtzfile\fP(5) 形式で書かれている。 \fIfilespec\fP が与えられた場合は、 +タイムゾーンの情報をそのファイルから読み込む。このファイルも \fBtzfile\fP(5) 形式で書かれている必要がある。 \fIfilespec\fP が +\(aq/\(aq で始まらなかった場合には、 システムタイムゾーンディレクトリからの相対パスで ファイルが指定されたことになる。 .PP -.\"O Here's an example, once more for New Zealand: 例を挙げておく。もう一度ニュージーランドの例である。 .nf TZ=":Pacific/Auckland" .fi -.\"O .SH FILES .SH ファイル -.\"O The system timezone directory used depends on the (g)libc version. -用いられるシステムタイムゾーンディレクトリは (g)libc のバージョンに依存する。 -.\"O Libc4 and libc5 use -.\"O .IR /usr/lib/zoneinfo , -.\"O and, since libc-5.4.6, -.\"O when this doesn't work, will try -.\"O .IR /usr/share/zoneinfo . -libc4 と libc5 は -.I /usr/lib/zoneinfo -を用いる。libc-5.4.6 以降では、これが使えなかった場合には -.I /usr/share/zoneinfo -を使おうとする。 -.\"O Glibc2 will use the environment variable -.\"O .BR TZDIR , -.\"O when that exists. -glibc2 では環境変数 -.B TZDIR -が存在すればそれを用いる。 -.\"O Its default depends on how it was installed, but normally is -.\"O .IR /usr/share/zoneinfo . -このデフォルトはどのようにインストールされたかによるが、 -普通は -.I /usr/share/zoneinfo -である。 +用いられるシステムタイムゾーンディレクトリは (g)libc のバージョンに依存する。 libc4 と libc5 は +\fI/usr/lib/zoneinfo\fP を用いる。libc\-5.4.6 以降では、これが使えなかった場合には +\fI/usr/share/zoneinfo\fP を使おうとする。 glibc2 では環境変数 \fBTZDIR\fP が存在すればそれを用いる。 +このデフォルトはどのようにインストールされたかによるが、 普通は \fI/usr/share/zoneinfo\fP である。 .LP -.\"O This timezone directory contains the files このタイムゾーンディレクトリには以下のファイルが含まれる。 -.sp .nf -.\"O localtime local timezone file -.\"O posixrules rules for POSIX-style TZ's localtime ローカルタイムゾーンのファイル posixrules POSIX 式の TZ 書式ルール .fi .LP -.\"O Often -.\"O .I /etc/localtime -.\"O is a symlink to the file -.\"O .I localtime -.\"O or to the correct timezone file in the system timezone directory. -.I /etc/localtime -は、 -.I localtime -ファイルや、 -システムのタイムゾーンディレクトリ中の適切なタイムゾーンファイルへの +\fI/etc/localtime\fP は、 \fIlocaltime\fP ファイルや、 システムのタイムゾーンディレクトリ中の適切なタイムゾーンファイルへの シンボリックリンクであることが多い。 -.\"O .SH "CONFORMING TO" .SH 準拠 -SVr4, POSIX.1-2001, 4.3BSD. -.\"O .SH NOTES +SVr4, POSIX.1\-2001, 4.3BSD. .SH 注意 -.\"O Note that the variable \fIdaylight\fP does not indicate that daylight -.\"O saving time applies right now. -.\"O It used to give the number of some -.\"O algorithm (see the variable \fItz_dsttime\fP in -.\"O .BR gettimeofday (2)). -.\"O It has been obsolete for many years but is required by SUSv2. -.I daylight -変数は、現在がサマータイムであるかどうかを示しているのではない。 -これはいくつかあるアルゴリズムのうちの番号を与える -(アルゴリズムについては -.BR gettimeofday (2) -の -.I tz_dsttime -変数を見よ)。 +\fIdaylight\fP 変数は、現在がサマータイムであるかどうかを示しているのではない。 これはいくつかあるアルゴリズムのうちの番号を与える +(アルゴリズムについては \fBgettimeofday\fP(2) の \fItz_dsttime\fP 変数を見よ)。 これはもう何年も使われていないが、SUSv2 では必要とされている。 .LP -.\"O 4.3BSD had a function -.\"O .BI "char *timezone(" zone ", " dst ) -.\"O that returned the -.\"O name of the timezone corresponding to its first argument (minutes -.\"O West of UTC). -.\"O If the second argument was 0, the standard name was used, -.\"O otherwise the daylight saving time version. -4.3BSD には -.BI "char *timezone(" zone ", " dst ) -というルーチンがあり、これは -最初の引数 (UTC からの西向きの分数) に対応するタイムゾーンの名前を返す。 -二番目の引数が 0 の場合は標準の名前が用いられ、 +4.3BSD には \fBchar *timezone(\fP\fIzone\fP\fB, \fP\fIdst\fP\fB)\fP というルーチンがあり、これは 最初の引数 (UTC +からの西向きの分数) に対応するタイムゾーンの名前を返す。 二番目の引数が 0 の場合は標準の名前が用いられ、 それ以外はサマータイム版の名前が用いられる。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR date (1), -.BR gettimeofday (2), -.BR time (2), -.BR ctime (3), -.BR getenv (3), -.BR tzfile (5) +\fBdate\fP(1), \fBgettimeofday\fP(2), \fBtime\fP(2), \fBctime\fP(3), \fBgetenv\fP(3), +\fBtzfile\fP(5) diff --git a/draft/man3/ualarm.3 b/draft/man3/ualarm.3 index 20a6ba82..d6226a1b 100644 --- a/draft/man3/ualarm.3 +++ b/draft/man3/ualarm.3 @@ -20,193 +20,75 @@ .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, .\" USA. .\" -.\" Japanese Version Copyright (c) 2004 Yuichi SATO -.\" all rights reserved. -.\" Translated Sat Sep 11 07:32:05 JST 2004 -.\" by Yuichi SATO -.\" Updated 2007-05-04, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH UALARM 3 2010-09-20 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH UALARM 3 2010\-09\-20 "" "Linux Programmer's Manual" .SH 名前 -.\"O ualarm \- schedule signal after given number of microseconds ualarm \- 指定したマイクロ秒後にシグナルを送る予定をする -.\"O .SH SYNOPSIS .SH 書式 .nf -.B "#include " +\fB#include \fP .sp -.BI "useconds_t ualarm(useconds_t " usecs ", useconds_t " interval ); +\fBuseconds_t ualarm(useconds_t \fP\fIusecs\fP\fB, useconds_t \fP\fIinterval\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR ualarm (): +\fBualarm\fP(): .ad l .RS 4 .PD 0 -.TP 4 -.\"O Since glibc 2.12: +.TP 4 glibc 2.12 以降: .nf _BSD_SOURCE || (_XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) && !(_POSIX_C_SOURCE\ >=\ 200809L || _XOPEN_SOURCE\ >=\ 700) -.TP 4 +.TP 4 .fi -.\"O Before glibc 2.12: -glibc 2.12 より前: -_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +glibc 2.12 より前: _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .PD .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR ualarm () -.\"O function causes the signal -.\"O .B SIGALRM -.\"O to be sent to the invoking process after (not less than) -.\"O .I usecs -.\"O microseconds. -.BR ualarm () -関数は、呼び出し元のプロセスに対して -.I usecs -マイクロ秒 (以上) 後に -.B SIGALRM -シグナルを送る。 -.\"O The delay may be lengthened slightly by any system activity -.\"O or by the time spent processing the call or by the -.\"O granularity of system timers. -遅れはシステムの活性度・呼び出しの処理時間・ -システムタイマーの粒度によって長くなるかもしれない。 +\fBualarm\fP() 関数は、呼び出し元のプロセスに対して \fIusecs\fP マイクロ秒 (以上) 後に \fBSIGALRM\fP シグナルを送る。 +遅れはシステムの活性度・呼び出しの処理時間・ システムタイマーの粒度によって長くなるかもしれない。 .LP -.\"O Unless caught or ignored, the -.\"O .B SIGALRM -.\"O signal will terminate the process. -捕捉または無視されない限り、 -.B SIGALRM -シグナルはプロセスを終了させる。 +捕捉または無視されない限り、 \fBSIGALRM\fP シグナルはプロセスを終了させる。 .LP -.\"O If the -.\"O .I interval -.\"O argument is nonzero, further -.\"O .B SIGALRM -.\"O signals will be sent every -.\"O .I interval -.\"O microseconds after the first. -.I interval -引き数が 0 でない場合、最初の -.B SIGALRM -シグナルの後、 -さらに -.I interval -マイクロ秒毎に SIGALRM シグナルが送られる。 -.\"O .SH "RETURN VALUE" +\fIinterval\fP 引き数が 0 でない場合、最初の \fBSIGALRM\fP シグナルの後、 さらに \fIinterval\fP マイクロ秒毎に +SIGALRM シグナルが送られる。 .SH 返り値 -.\"O This function returns the number of microseconds remaining for -.\"O any alarm that was previously set, or 0 if no alarm was pending. -この関数は、過去に設定された alarm の残りマイクロ秒数を返す。 -実行中の alarm がない場合は 0 を返す。 -.\"O .SH ERRORS +この関数は、過去に設定された alarm の残りマイクロ秒数を返す。 実行中の alarm がない場合は 0 を返す。 .SH エラー -.TP -.B EINTR -.\"O Interrupted by a signal. +.TP +\fBEINTR\fP シグナルによって割り込まれた。 -.TP -.B EINVAL -.\"O \fIusecs\fP or \fIinterval\fP is not smaller than 1000000. -.\"O (On systems where that is considered an error.) -\fIusecs\fP または \fIinterval\fP が 1000000 未満でない -(これがエラーとして扱われるシステムの場合)。 -.\"O .SH "CONFORMING TO" +.TP +\fBEINVAL\fP +\fIusecs\fP または \fIinterval\fP が 1000000 未満でない (これがエラーとして扱われるシステムの場合)。 .SH 準拠 -4.3BSD, POSIX.1-2001. -.\"O POSIX.1-2001 marks -.\"O .BR ualarm () -.\"O as obsolete. -POSIX.1-2001 では -.BR ualarm () -は過去のものとされている。 -.\"O POSIX.1-2008 removes the specification of -.\"O .BR ualarm (). -POSIX.1-2008 では、 -.BR ualarm () -の仕様が削除されている。 -.\"O 4.3BSD, SUSv2, and POSIX do not define any errors. -4.3BSD, SUSv2, POSIX はエラーを定義していない。 -.\"O .SH NOTES +4.3BSD, POSIX.1\-2001. POSIX.1\-2001 では \fBualarm\fP() は過去のものとされている。 +POSIX.1\-2008 では、 \fBualarm\fP() の仕様が削除されている。 4.3BSD, SUSv2, POSIX +はエラーを定義していない。 .SH 注意 -.\"O The type -.\"O .I useconds_t -.\"O is an unsigned integer type capable of holding integers -.\"O in the range [0,1000000]. -.I useconds_t -型は [0,1000000] の範囲の整数を保持できる符号なし整数型である。 -.\"O On the original BSD implementation, and in glibc before version 2.1, -.\"O the arguments to -.\"O .BR ualarm () -.\"O were instead typed as -.\"O .IR "unsigned int" . -もともとの BSD での実装や、バージョン 2.1 より前の glibc では、 -.BR ualarm () -の引き数の型は -.I "unsigned int" -であった。 -.\"O Programs will be more portable if they never mention -.\"O .I useconds_t -.\"O explicitly. -プログラム中に明示的に -.I useconds_t -と書かない方が、移植性が高くなる。 -.\"Osato: -.\"Osato: mention が訳しづらい。 -.\"Osato: +\fIuseconds_t\fP 型は [0,1000000] の範囲の整数を保持できる符号なし整数型である。 もともとの BSD での実装や、バージョン +2.1 より前の glibc では、 \fBualarm\fP() の引き数の型は \fIunsigned int\fP であった。 プログラム中に明示的に +\fIuseconds_t\fP と書かない方が、移植性が高くなる。 .LP -.\"O The interaction of this function with -.\"O other timer functions such as -この関数と -.BR alarm (2), -.BR sleep (3), -.BR nanosleep (2), -.BR setitimer (2), -.BR timer_create (2), -.BR timer_delete (2), -.BR timer_getoverrun (2), -.BR timer_gettime (2), -.BR timer_settime (2), -.BR usleep (3) -.\"O is unspecified. +この関数と \fBalarm\fP(2), \fBsleep\fP(3), \fBnanosleep\fP(2), \fBsetitimer\fP(2), +\fBtimer_create\fP(2), \fBtimer_delete\fP(2), \fBtimer_getoverrun\fP(2), +\fBtimer_gettime\fP(2), \fBtimer_settime\fP(2), \fBusleep\fP(3) のような他のタイマー関数との相互作用は規定されていない。 .LP -.\"O This function is obsolete. -.\"O Use -.\"O .BR setitimer (2) -.\"O or POSIX interval timers -.\"O .RB ( timer_create (2), -.\"O etc.) -.\"O instead. -この関数は廃止予定である。 -代わりに -.BR setitimer (2) -もしくは POSIX インターバルタイマ -.RB ( timer_create (2) +この関数は廃止予定である。 代わりに \fBsetitimer\fP(2) もしくは POSIX インターバルタイマ (\fBtimer_create\fP(2) など) を使うこと。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR alarm (2), -.BR getitimer (2), -.BR nanosleep (2), -.BR select (2), -.BR setitimer (2), -.BR usleep (3), -.BR time (7) +\fBalarm\fP(2), \fBgetitimer\fP(2), \fBnanosleep\fP(2), \fBselect\fP(2), +\fBsetitimer\fP(2), \fBusleep\fP(3), \fBtime\fP(7) diff --git a/draft/man3/undocumented.3 b/draft/man3/undocumented.3 index 973d164b..a9c40401 100644 --- a/draft/man3/undocumented.3 +++ b/draft/man3/undocumented.3 @@ -26,186 +26,67 @@ .\" 1996-11-08, meem@sherilyn.wustl.edu, corrections .\" 2004-10-31, aeb, changed maintainer address, updated list .\" -.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. -.\" Translated 1999-01-07, NAKANO Takeo -.\" Updated 2001-10-16, Kentaro Shirakata -.\" Updated 2005-02-21, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH UNDOCUMENTED 3 2010-02-10 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH UNDOCUMENTED 3 2010\-02\-10 Linux "Linux Programmer's Manual" .SH 名前 -.\"O none \- undocumented library functions -none \- ドキュメントがないライブラリ関数 (library functions) -.\"O .SH SYNOPSIS +none \- ドキュメントがないライブラリ関数 .SH 書式 -.\"O Undocumented library functions ドキュメントがないライブラリ関数 -.\"O .SH DESCRIPTION .SH 説明 -.\"O This man page mentions those library functions which are implemented in -.\"O the standard libraries but not yet documented in man pages. -この man ページでは、 -標準ライブラリに実装されているが、 -まだ man ページが存在しないライブラリ関数を紹介する。 -.\"O .SS Solicitation +この man ページでは、 標準ライブラリに実装されているが、 まだ man ページが存在しないライブラリ関数を紹介する。 .SS 勧誘 -.\"O If you have information about these functions, -.\"O please look in the source code, write a man page (using a style -.\"O similar to that of the other Linux section 3 man pages), and send it to -.\"O .B mtk.manpages@gmail.com -.\"O for inclusion in the next man page release. -これらの関数について情報があったら、 -ソースコードを見て man ページを (他の Linux セクション 3 の -man ページに似たスタイルで) 書き、そのページを -.B mtk.manpages@gmail.com -まで送ってほしい。 -次の man ページのリリースで採用したい。 -.\"O .SS "THE LIST" +これらの関数について情報があったら、 ソースコードを見て man ページを (他の Linux セクション 3 の man ページに似たスタイルで) +書き、そのページを \fBmtk.manpages@gmail.com\fP まで送ってほしい。 次の man ページのリリースで採用したい。 .SS リスト -.BR authdes_create (3), -.BR authdes_getucred (3), -.BR authdes_pk_create (3), .\" .BR chflags (3), -.BR clntunix_create (3), -.BR creat64 (3), -.BR dn_skipname (3), .\" .BR fattach (3), .\" .BR fchflags (3), .\" .BR fclean (3), -.BR fcrypt (3), .\" .BR fdetach (3), -.BR fp_nquery (3), -.BR fp_query (3), -.BR fp_resstat (3), -.BR freading (3), -.BR freopen64 (3), -.BR fseeko64 (3), -.BR ftello64 (3), -.BR ftw64 (3), -.BR fwscanf (3), -.BR get_avphys_pages (3), -.BR getdirentries64 (3), -.BR getmsg (3), -.BR getnetname (3), -.BR get_nprocs (3), -.BR get_nprocs_conf (3), -.BR get_phys_pages (3), -.BR getpublickey (3), -.BR getsecretkey (3), -.BR h_errlist (3), -.BR host2netname (3), -.BR hostalias (3), -.BR if_freenameindex (3), -.BR if_indextoname (3), -.BR if_nameindex (3), -.BR if_nametoindex (3), -.BR inet_nsap_addr (3), -.BR inet_nsap_ntoa (3), -.BR init_des (3), -.BR libc_nls_init (3), -.BR lio_listio (3), -.BR mallinfo (3), -.BR mallopt (3), -.BR mcheck (3), -.BR mprobe (3), -.BR mstats (3), -.BR netname2host (3), -.BR netname2user (3), -.BR nlist (3), -.BR obstack_free (3), .\" .BR obstack stuff (3), -.BR parse_printf_format (3), -.BR p_cdname (3), -.BR p_cdnname (3), -.BR p_class (3), -.BR p_fqname (3), -.BR p_option (3), -.BR p_query (3), -.BR printf_size (3), -.BR printf_size_info (3), -.BR p_rr (3), -.BR p_time (3), -.BR p_type (3), -.BR putlong (3), -.BR putshort (3), -.BR re_compile_fastmap (3), -.BR re_compile_pattern (3), -.BR register_printf_function (3), -.BR re_match (3), -.BR re_match_2 (3), -.BR re_rx_search (3), -.BR re_search (3), -.BR re_search_2 (3), -.BR re_set_registers (3), -.BR re_set_syntax (3), -.BR res_send_setqhook (3), -.BR res_send_setrhook (3), -.BR ruserpass (3), -.BR setfileno (3), -.BR sethostfile (3), -.BR svc_exit (3), -.BR svcudp_enablecache (3), -.BR tell (3), -.BR tr_break (3), -.BR tzsetwall (3), -.BR ufc_dofinalperm (3), -.BR ufc_doit (3), -.BR user2netname (3), -.BR vlimit (3), -.BR vtimes (3), -.BR wcschrnul (3), -.BR wcsftime (3), -.BR wscanf (3), -.BR xdr_authdes_cred (3), -.BR xdr_authdes_verf (3), -.BR xdr_cryptkeyarg (3), -.BR xdr_cryptkeyres (3), -.BR xdr_datum (3), -.BR xdr_des_block (3), -.BR xdr_domainname (3), -.BR xdr_getcredres (3), -.BR xdr_keybuf (3), -.BR xdr_keystatus (3), -.BR xdr_mapname (3), -.BR xdr_netnamestr (3), -.BR xdr_netobj (3), -.BR xdr_passwd (3), -.BR xdr_peername (3), -.BR xdr_rmtcall_args (3), -.BR xdr_rmtcallres (3), -.BR xdr_unixcred (3), -.BR xdr_yp_buf (3), -.BR xdr_yp_inaddr (3), -.BR xdr_ypbind_binding (3), -.BR xdr_ypbind_resp (3), -.BR xdr_ypbind_resptype (3), -.BR xdr_ypbind_setdom (3), -.BR xdr_ypdelete_args (3), -.BR xdr_ypmaplist (3), -.BR xdr_ypmaplist_str (3), -.BR xdr_yppasswd (3), -.BR xdr_ypreq_key (3), -.BR xdr_ypreq_nokey (3), -.BR xdr_ypresp_all (3), -.BR xdr_ypresp_all_seq (3), -.BR xdr_ypresp_key_val (3), -.BR xdr_ypresp_maplist (3), -.BR xdr_ypresp_master (3), -.BR xdr_ypresp_order (3), -.BR xdr_ypresp_val (3), -.BR xdr_ypstat (3), -.BR xdr_ypupdate_args (3), -.BR yp_all (3), -.BR yp_bind (3), -.BR yperr_string (3), -.BR yp_first (3), -.BR yp_get_default_domain (3), -.BR yp_maplist (3), -.BR yp_master (3), -.BR yp_match (3), -.BR yp_next (3), -.BR yp_order (3), -.BR ypprot_err (3), -.BR yp_unbind (3), -.BR yp_update (3) +\fBauthdes_create\fP(3), \fBauthdes_getucred\fP(3), \fBauthdes_pk_create\fP(3), +\fBclntunix_create\fP(3), \fBcreat64\fP(3), \fBdn_skipname\fP(3), \fBfcrypt\fP(3), +\fBfp_nquery\fP(3), \fBfp_query\fP(3), \fBfp_resstat\fP(3), \fBfreading\fP(3), +\fBfreopen64\fP(3), \fBfseeko64\fP(3), \fBftello64\fP(3), \fBftw64\fP(3), \fBfwscanf\fP(3), +\fBget_avphys_pages\fP(3), \fBgetdirentries64\fP(3), \fBgetmsg\fP(3), +\fBgetnetname\fP(3), \fBget_nprocs\fP(3), \fBget_nprocs_conf\fP(3), +\fBget_phys_pages\fP(3), \fBgetpublickey\fP(3), \fBgetsecretkey\fP(3), +\fBh_errlist\fP(3), \fBhost2netname\fP(3), \fBhostalias\fP(3), +\fBif_freenameindex\fP(3), \fBif_indextoname\fP(3), \fBif_nameindex\fP(3), +\fBif_nametoindex\fP(3), \fBinet_nsap_addr\fP(3), \fBinet_nsap_ntoa\fP(3), +\fBinit_des\fP(3), \fBlibc_nls_init\fP(3), \fBlio_listio\fP(3), \fBmallinfo\fP(3), +\fBmallopt\fP(3), \fBmcheck\fP(3), \fBmprobe\fP(3), \fBmstats\fP(3), \fBnetname2host\fP(3), +\fBnetname2user\fP(3), \fBnlist\fP(3), \fBobstack_free\fP(3), +\fBparse_printf_format\fP(3), \fBp_cdname\fP(3), \fBp_cdnname\fP(3), \fBp_class\fP(3), +\fBp_fqname\fP(3), \fBp_option\fP(3), \fBp_query\fP(3), \fBprintf_size\fP(3), +\fBprintf_size_info\fP(3), \fBp_rr\fP(3), \fBp_time\fP(3), \fBp_type\fP(3), +\fBputlong\fP(3), \fBputshort\fP(3), \fBre_compile_fastmap\fP(3), +\fBre_compile_pattern\fP(3), \fBregister_printf_function\fP(3), \fBre_match\fP(3), +\fBre_match_2\fP(3), \fBre_rx_search\fP(3), \fBre_search\fP(3), \fBre_search_2\fP(3), +\fBre_set_registers\fP(3), \fBre_set_syntax\fP(3), \fBres_send_setqhook\fP(3), +\fBres_send_setrhook\fP(3), \fBruserpass\fP(3), \fBsetfileno\fP(3), +\fBsethostfile\fP(3), \fBsvc_exit\fP(3), \fBsvcudp_enablecache\fP(3), \fBtell\fP(3), +\fBtr_break\fP(3), \fBtzsetwall\fP(3), \fBufc_dofinalperm\fP(3), \fBufc_doit\fP(3), +\fBuser2netname\fP(3), \fBvlimit\fP(3), \fBvtimes\fP(3), \fBwcschrnul\fP(3), +\fBwcsftime\fP(3), \fBwscanf\fP(3), \fBxdr_authdes_cred\fP(3), +\fBxdr_authdes_verf\fP(3), \fBxdr_cryptkeyarg\fP(3), \fBxdr_cryptkeyres\fP(3), +\fBxdr_datum\fP(3), \fBxdr_des_block\fP(3), \fBxdr_domainname\fP(3), +\fBxdr_getcredres\fP(3), \fBxdr_keybuf\fP(3), \fBxdr_keystatus\fP(3), +\fBxdr_mapname\fP(3), \fBxdr_netnamestr\fP(3), \fBxdr_netobj\fP(3), \fBxdr_passwd\fP(3), +\fBxdr_peername\fP(3), \fBxdr_rmtcall_args\fP(3), \fBxdr_rmtcallres\fP(3), +\fBxdr_unixcred\fP(3), \fBxdr_yp_buf\fP(3), \fBxdr_yp_inaddr\fP(3), +\fBxdr_ypbind_binding\fP(3), \fBxdr_ypbind_resp\fP(3), \fBxdr_ypbind_resptype\fP(3), +\fBxdr_ypbind_setdom\fP(3), \fBxdr_ypdelete_args\fP(3), \fBxdr_ypmaplist\fP(3), +\fBxdr_ypmaplist_str\fP(3), \fBxdr_yppasswd\fP(3), \fBxdr_ypreq_key\fP(3), +\fBxdr_ypreq_nokey\fP(3), \fBxdr_ypresp_all\fP(3), \fBxdr_ypresp_all_seq\fP(3), +\fBxdr_ypresp_key_val\fP(3), \fBxdr_ypresp_maplist\fP(3), \fBxdr_ypresp_master\fP(3), +\fBxdr_ypresp_order\fP(3), \fBxdr_ypresp_val\fP(3), \fBxdr_ypstat\fP(3), +\fBxdr_ypupdate_args\fP(3), \fByp_all\fP(3), \fByp_bind\fP(3), \fByperr_string\fP(3), +\fByp_first\fP(3), \fByp_get_default_domain\fP(3), \fByp_maplist\fP(3), +\fByp_master\fP(3), \fByp_match\fP(3), \fByp_next\fP(3), \fByp_order\fP(3), +\fBypprot_err\fP(3), \fByp_unbind\fP(3), \fByp_update\fP(3) diff --git a/draft/man3/usleep.3 b/draft/man3/usleep.3 index e1522d1d..0d04bc53 100644 --- a/draft/man3/usleep.3 +++ b/draft/man3/usleep.3 @@ -28,141 +28,65 @@ .\" Modified 2001-04-01 by aeb .\" Modified 2003-07-23 by aeb .\" -.\" Japanese Version Copyright (c) 1997 YOSHINO Takashi -.\" all rights reserved. -.\" Translated Mon Jan 20 18:47:50 JST 1997 -.\" by YOSHINO Takashi -.\" Updated Sat May 19 JST 2001 by Kentaro Shirakata -.\" Updated Mon Sep 1 JST 2003 by Kentaro Shirakata -.\" Updated 2007-05-04, Akihiro MOTOKI , LDP v2.44 +.\"******************************************************************* .\" -.TH USLEEP 3 2010-12-03 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH USLEEP 3 2010\-12\-03 "" "Linux Programmer's Manual" .SH 名前 -.\"O usleep \- suspend execution for interval of microseconds usleep \- マイクロ秒単位で実行を延期する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B "#include " +\fB#include \fP .sp -.BI "int usleep(useconds_t " usec ); +\fBint usleep(useconds_t \fP\fIusec\fP\fB);\fP .fi .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp -.BR usleep (): +\fBusleep\fP(): .ad l .RS 4 .PD 0 -.TP 4 -.\"O Since glibc 2.12: +.TP 4 glibc 2.12 以降: .nf _BSD_SOURCE || (_XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) && !(_POSIX_C_SOURCE\ >=\ 200809L || _XOPEN_SOURCE\ >=\ 700) -.TP 4 +.TP 4 .fi -.\"O Before glibc 2.12: -glibc 2.12 より前: -_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || -_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED +glibc 2.12 より前: _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .PD .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 -.\"O The -.\"O .BR usleep () -.\"O function suspends execution of the calling thread for -.\"O (at least) \fIusec\fP microseconds. -.\"O The sleep may be lengthened slightly -.\"O by any system activity or by the time spent processing the call or by the -.\"O granularity of system timers. -.BR usleep () -関数は -(少なくとも) \fIusec\fPマイクロ秒の間、 -呼び出し元スレッドの実行を延期する。 -システムの動作状況や呼び出しによる時間の消費やシステムタイマの粒度によって、 -停止時間は設定した値よりも少し延ばされるかもしれない。 -.\"O .SH "RETURN VALUE" +\fBusleep\fP() 関数は (少なくとも) \fIusec\fPマイクロ秒の間、 呼び出し元スレッドの実行を延期する。 +システムの動作状況や呼び出しによる時間の消費やシステムタイマの粒度によって、 停止時間は設定した値よりも少し延ばされるかもしれない。 .SH 返り値 -.\"O 0 on success, \-1 on error. 成功すると 0、エラーの場合 \-1 を返す。 -.\"O .SH ERRORS .SH エラー -.TP -.B EINTR -.\"O Interrupted by a signal; see -.\"O .BR signal (7). -シグナルによって中断された。 -.BR signal (7) -参照。 -.TP -.B EINVAL -.\"O \fIusec\fP is not smaller than 1000000. -.\"O (On systems where that is considered an error.) -\fIusec\fP が 1000000 以上だった。 -(これをエラーとみなすシステムのみ) -.\"O .SH "CONFORMING TO" +.TP +\fBEINTR\fP +シグナルによって中断された。 \fBsignal\fP(7) 参照。 +.TP +\fBEINVAL\fP +\fIusec\fP が 1000000 以上だった。 (これをエラーとみなすシステムのみ) .SH 準拠 -4.3BSD, POSIX.1-2001. -.\"O POSIX.1-2001 declares this function obsolete; use -.\"O .BR nanosleep (2) -.\"O instead. -POSIX.1-2001 では、この関数は過去のものと宣言されている。 -代わりに -.BR nanosleep (2) -を使うこと。 -.\"O POSIX.1-2008 removes the specification of -.\"O .BR usleep (). -POSIX.1-2008 では、 -.BR usleep () -の規定が削除されている。 +4.3BSD, POSIX.1\-2001. POSIX.1\-2001 では、この関数は過去のものと宣言されている。 代わりに +\fBnanosleep\fP(2) を使うこと。 POSIX.1\-2008 では、 \fBusleep\fP() の規定が削除されている。 -.\"O On the original BSD implementation, -.\"O and in glibc before version 2.2.2, the return type of this function is -.\"O .IR void . -.\"O The POSIX version returns -.\"O .IR int , -.\"O and this is also the prototype used since glibc 2.2.2. -もともとの BSD の実装や、バージョン 2.2.2 より前の glibc では、 -この関数の返り値の型は -.I void -である。 -POSIX 版は -.I int -を返し、このプロトタイプは glibc 2.2.2 以降で使用されている。 +もともとの BSD の実装や、バージョン 2.2.2 より前の glibc では、 この関数の返り値の型は \fIvoid\fP である。 POSIX 版は +\fIint\fP を返し、このプロトタイプは glibc 2.2.2 以降で使用されている。 -.\"O Only the -.\"O .B EINVAL -.\"O error return is documented by SUSv2 and POSIX.1-2001. -エラーとして -.B EINVAL -を返すというのは -SUSv2 と POSIX.1-2001 でのみ文書化されている。 -.\"O .SH NOTES +エラーとして \fBEINVAL\fP を返すというのは SUSv2 と POSIX.1\-2001 でのみ文書化されている。 .SH 注意 -.\"O The type -.\"O .I useconds_t -.\"O is an unsigned integer type capable of holding integers -.\"O in the range [0,1000000]. -.\"O Programs will be more portable -.\"O if they never mention this type explicitly. -.\"O Use -.I useconds_t -型は [0,1000000] の範囲の整数を扱うことができる -符号なし整数型である。 -明示的にこの型を使わないことでプログラムの移植性がより高まる。 -以下のように使うこと。 +\fIuseconds_t\fP 型は [0,1000000] の範囲の整数を扱うことができる 符号なし整数型である。 +明示的にこの型を使わないことでプログラムの移植性がより高まる。 以下のように使うこと。 .in +4n .nf .sp @@ -174,41 +98,10 @@ SUSv2 と POSIX.1-2001 でのみ文書化されている。 .fi .in .LP -.\"O The interaction of this function with the -.\"O .B SIGALRM -.\"O signal, and with other timer functions such as -.\"O .BR alarm (2), -.\"O .BR sleep (3), -.\"O .BR nanosleep (2), -.\"O .BR setitimer (2), -.\"O .BR timer_create (2), -.\"O .BR timer_delete (2), -.\"O .BR timer_getoverrun (2), -.\"O .BR timer_gettime (2), -.\"O .BR timer_settime (2), -.\"O .BR ualarm (3) -.\"O is unspecified. -この関数と、 -.B SIGALRM -シグナルあるいは -.BR alarm (2), -.BR sleep (3), -.BR nanosleep (2), -.BR setitimer (2), -.BR timer_create (2), -.BR timer_delete (2), -.BR timer_getoverrun (2), -.BR timer_gettime (2), -.BR timer_settime (2), -.BR ualarm (3) -といったその他のタイマー関数を同時に使った場合の動作は未定義である。 -.\"O .SH "SEE ALSO" +この関数と、 \fBSIGALRM\fP シグナルあるいは \fBalarm\fP(2), \fBsleep\fP(3), \fBnanosleep\fP(2), +\fBsetitimer\fP(2), \fBtimer_create\fP(2), \fBtimer_delete\fP(2), +\fBtimer_getoverrun\fP(2), \fBtimer_gettime\fP(2), \fBtimer_settime\fP(2), +\fBualarm\fP(3) といったその他のタイマー関数を同時に使った場合の動作は未定義である。 .SH 関連項目 -.BR alarm (2), -.BR getitimer (2), -.BR nanosleep (2), -.BR select (2), -.BR setitimer (2), -.BR sleep (3), -.BR ualarm (3), -.BR time (7) +\fBalarm\fP(2), \fBgetitimer\fP(2), \fBnanosleep\fP(2), \fBselect\fP(2), +\fBsetitimer\fP(2), \fBsleep\fP(3), \fBualarm\fP(3), \fBtime\fP(7) diff --git a/draft/man3/wcstombs.3 b/draft/man3/wcstombs.3 index d4e55770..ef5784a1 100644 --- a/draft/man3/wcstombs.3 +++ b/draft/man3/wcstombs.3 @@ -11,121 +11,48 @@ .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html .\" ISO/IEC 9899:1999 .\" -.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Tue Jan 11 00:55:41 JST 2000 -.\" by HANATAKA Shinya +.\"******************************************************************* .\" -.TH WCSTOMBS 3 2011-09-28 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH WCSTOMBS 3 2011\-10\-16 GNU "Linux Programmer's Manual" .SH 名前 -.\"O wcstombs \- convert a wide-character string to a multibyte string wcstombs \- ワイド文字列をマルチバイト文字列に変換する -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "size_t wcstombs(char *" dest ", const wchar_t *" src ", size_t " n ); +\fBsize_t wcstombs(char *\fP\fIdest\fP\fB, const wchar_t *\fP\fIsrc\fP\fB, size_t \fP\fIn\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O If \fIdest\fP is not a NULL pointer, the -.\"O .BR wcstombs () -.\"O function converts -.\"O the wide-character string \fIsrc\fP to a multibyte string starting at -.\"O \fIdest\fP. -.\"O At most \fIn\fP bytes are written to \fIdest\fP. -.\"O The conversion -.\"O starts in the initial state. -.\"O The conversion can stop for three reasons: -\fIdest\fP が NULL ポインタでない場合、 -.BR wcstombs () -関数は -ワイド文字列 \fIsrc\fP を \fIdest\fP から始まるマルチバイト文字列に -変換する。\fIdest\fP には最大で \fIn\fP バイトが書き込まれる。 +\fIdest\fP が NULL ポインタでない場合、 \fBwcstombs\fP() 関数は ワイド文字列 \fIsrc\fP を \fIdest\fP +から始まるマルチバイト文字列に 変換する。\fIdest\fP には最大で \fIn\fP バイトが書き込まれる。 変換は初期状態で開始される。変換は以下の3つの理由により停止する。 .PP -.\"O 1. A wide character has been encountered that can not be represented as a -.\"O multibyte sequence (according to the current locale). -.\"O In this case -.\"O .I (size_t)\ \-1 -.\"O is returned. -1. (現在のロケールにおける)マルチバイト列で表現できないワイド文字に -遭遇した場合。この場合には -.I (size_t)\ \-1 -が返される。 +1. (現在のロケールにおける)マルチバイト列で表現できないワイド文字に 遭遇した場合。この場合には \fI(size_t)\ \-1\fP が返される。 .PP -.\"O 2. The length limit forces a stop. -.\"O In this case the number of bytes written to -.\"O \fIdest\fP is returned, but the shift state at this point is lost. -2. 長さ制限によって強制停止させられた場合。この場合には \fIdest\fP に -書き込まれたバイト数が返される。しかしこの時点でのシフト状態は失われる。 +2. 長さ制限によって強制停止させられた場合。この場合には \fIdest\fP に 書き込まれたバイト数が返される。しかしこの時点でのシフト状態は失われる。 .PP -.\"O 3. The wide-character string has been completely converted, including the -.\"O terminating null wide character (L\(aq\\0\(aq). -.\"O In this case the conversion ends in the initial state. -.\"O The number of bytes written to \fIdest\fP, -.\"O excluding the terminating null, is returned. -3. ワイド文字列が終端の NULL ワイド文字 (L\(aq\\0\(aq) を含めて -完全に変換された場合。この場合には変換は初期状態で終り、 -\fIdest\fP に書き込まれたバイト数 (終端の NULL は含まれない) を返す。 +3. ワイド文字列が終端の NULL ワイド文字 (L\(aq\e0\(aq) を含めて完全に変換された場合。 +この場合には変換は初期状態で終了し、 \fIdest\fP に書き込まれたバイト数を返す +(終端の NULL バイト (\(aq\e0\(aq) は含まれない)。 .PP -.\"O The programmer must ensure that there is room for at least \fIn\fP bytes -.\"O at \fIdest\fP. -プログラマーは \fIdest\fP に最低でも \fIn\fP バイトの空きがあることを -保証しなければならない。 +プログラマーは \fIdest\fP に最低でも \fIn\fP バイトの空きがあることを 保証しなければならない。 .PP -.\"O If \fIdest\fP is NULL, \fIn\fP is ignored, and the conversion proceeds as -.\"O above, except that the converted bytes are not written out to memory, -.\"O and that no length limit exists. -\fIdest\fP が NULL の場合、\fIn\fP は無視される。上記と同様に変換が行 -なわれるが変換結果のバイト列はメモリには書き込まれない。 +\fIdest\fP が NULL の場合、\fIn\fP は無視される。上記と同様に変換が行 なわれるが変換結果のバイト列はメモリには書き込まれない。 また長さの上限が存在しない。 .PP -.\"O In order to avoid the case 2 above, the programmer should make sure \fIn\fP -.\"O is greater or equal to \fIwcstombs(NULL,src,0)+1\fP. -上記の 2. の場合を避けるために、プログラマーは \fIn\fP が -\fIwcstombs(NULL,src,0)+1\fP 以上であることを保証しなければならない。 -.\"O .SH "RETURN VALUE" +上記の 2. の場合を避けるために、プログラマーは \fIn\fP が \fIwcstombs(NULL,src,0)+1\fP +以上であることを保証しなければならない。 .SH 返り値 -.\"O The -.\"O .BR wcstombs () -.\"O function returns the number of bytes that make up the -.\"O converted part of multibyte sequence, not including the terminating null byte. -.\"O If a wide character was encountered which could not be -.\"O converted, -.\"O .I (size_t)\ \-1 -.\"O is returned. -.BR wcstombs () -関数は生成したマルチバイト列のバイト数を返す。終端の -ナル文字は含まない。もし変換できないワイド文字に遭遇した場合には -.I (size_t)\ \-1 -を返す。 -.\"O .SH "CONFORMING TO" +\fBwcstombs\fP() 関数は生成したマルチバイト列のバイト数を返す。終端の ナル文字は含まない。もし変換できないワイド文字に遭遇した場合には +\fI(size_t)\ \-1\fP を返す。 .SH 準拠 C99. -.\"O .SH NOTES .SH 注意 -.\"O The behavior of -.\"O .BR wcstombs () -.\"O depends on the -.\"O .B LC_CTYPE -.\"O category of the -.\"O current locale. -.BR wcstombs () -の動作は現在のロケールの -.B LC_CTYPE -カテゴリに依存している。 +\fBwcstombs\fP() の動作は現在のロケールの \fBLC_CTYPE\fP カテゴリに依存している。 .PP -.\"O The function -.\"O .BR wcsrtombs () -.\"O provides a thread safe interface to -.\"O the same functionality. -.BR wcsrtombs () -関数は同じ機能のためのスレッド・セーフな -インターフェースを提供する。 -.\"O .SH "SEE ALSO" +\fBwcsrtombs\fP() 関数は同じ機能のためのスレッド・セーフな インターフェースを提供する。 .SH 関連項目 -.BR mbstowcs (3), -.BR wcsrtombs (3) +\fBmbstowcs\fP(3), \fBwcsrtombs\fP(3) diff --git a/draft/man3/wctomb.3 b/draft/man3/wctomb.3 index 14b92524..9863db11 100644 --- a/draft/man3/wctomb.3 +++ b/draft/man3/wctomb.3 @@ -11,114 +11,42 @@ .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html .\" ISO/IEC 9899:1999 .\" -.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Tue Jan 11 00:55:39 JST 2000 -.\" by HANATAKA Shinya +.\"******************************************************************* .\" -.TH WCTOMB 3 1999-07-25 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH WCTOMB 3 1999\-07\-25 GNU "Linux Programmer's Manual" .SH 名前 -.\"O wctomb \- convert a wide character to a multibyte sequence wctomb \- ワイド文字をマルチバイト列に変換する。 -.\"O .SH SYNOPSIS .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "int wctomb(char *" s ", wchar_t " wc ); +\fBint wctomb(char *\fP\fIs\fP\fB, wchar_t \fP\fIwc\fP\fB);\fP .fi -.\"O .SH DESCRIPTION .SH 説明 -.\"O If \fIs\fP is not NULL, -.\"O the -.\"O .BR wctomb () -.\"O function converts the wide character -.\"O \fIwc\fP to its multibyte representation and stores it at the beginning of -.\"O the character array pointed to by \fIs\fP. -.\"O It updates the shift state, which -.\"O is stored in a static anonymous variable -.\"O only known to the wctomb function, -.\"O and returns the length of said multibyte representation, -.\"O that is, the number of -.\"O bytes written at \fIs\fP. +\fIs\fP が NULL でなければ、 \fBwctomb\fP() 関数はワイド文字 \fIwc\fP を マルチバイト表現に変換して \fIs\fP +の指す文字配列に格納する。 同時に wctomb 関数のみが使用する静的で名前のないシフト状態を更新する。 この関数はマルチバイト表現の長さ、すなわち +\fIs\fP に書き込まれた バイト数を返す。 .PP -.\"O The programmer must ensure that there is -.\"O room for at least \fBMB_CUR_MAX\fP -.\"O bytes at \fIs\fP. -\fIs\fP が NULL でなければ、 -.BR wctomb () -関数はワイド文字 \fIwc\fP を -マルチバイト表現に変換して \fIs\fP の指す文字配列に格納する。 -同時に wctomb 関数のみが使用する静的で名前のないシフト状態を更新する。 -この関数はマルチバイト表現の長さ、すなわち \fIs\fP に書き込まれた -バイト数を返す。プログラマーは \fIs\fP に少なくとも \fBMB_CUR_MAX\fP -バイトの空きがあることを保証しなければならない。 +プログラマーは \fIs\fP に少なくとも \fBMB_CUR_MAX\fP バイトの空きがあることを保証しなければならない。 .PP -.\"O If \fIs\fP is NULL, the -.\"O .BR wctomb () -.\"O function -.\"O .\" The Dinkumware doc and the Single UNIX specification say this, but -.\"O .\" glibc doesn't implement this. -.\"O resets the shift state, only known to this function, -.\"O to the initial state, and -.\"O returns nonzero if the encoding has nontrivial shift state, -.\"O or zero if the encoding is stateless. -\fIs\fP が NULL ならば、 -.BR wctomb () -関数は自分のみが使用するシフト状態を -初期状態に戻して、文字符号がシフト状態に依存しているならばゼロ以外を -シフト状態に依存しない場合にはゼロを返す。 -.\"O .SH "RETURN VALUE" +.\" The Dinkumware doc and the Single UNIX specification say this, but +.\" glibc doesn't implement this. +\fIs\fP が NULL ならば、 \fBwctomb\fP() 関数は自分のみが使用するシフト状態を +初期状態に戻して、文字符号がシフト状態に依存しているならばゼロ以外を シフト状態に依存しない場合にはゼロを返す。 .SH 返り値 -.\"O If \fIs\fP is not NULL, the -.\"O .BR wctomb () -.\"O function -.\"O returns the number of bytes -.\"O that have been written to the byte array at \fIs\fP. -.\"O If \fIwc\fP can not be -.\"O represented as a multibyte sequence (according -.\"O to the current locale), \-1 is returned. -\fIs\fP が NULL でない場合 -.BR wctomb () -関数はバイト配列 \fIs\fP に -書き込まれたバイト数を返す。\fIwc\fP が(現在のロケールにおいて) -マルチバイト列で表現できない場合には \-1 を返す。 +\fIs\fP が NULL でない場合 \fBwctomb\fP() 関数はバイト配列 \fIs\fP に 書き込まれたバイト数を返す。\fIwc\fP +が(現在のロケールにおいて) マルチバイト列で表現できない場合には \-1 を返す。 .PP -.\"O If \fIs\fP is NULL, the -.\"O .BR wctomb () -.\"O function returns nonzero if the -.\"O encoding has nontrivial shift state, or zero if the encoding is stateless. -\fIs\fP が NULL の場合 -.BR wctomb () -関数は文字符号がシフト状態に +\fIs\fP が NULL の場合 \fBwctomb\fP() 関数は文字符号がシフト状態に 依存している場合にはゼロ以外、シフト状態に依存しない場合はゼロを返す。 -.\"O .SH "CONFORMING TO" .SH 準拠 C99. -.\"O .SH NOTES .SH 注意 -.\"O The behavior of -.\"O .BR wctomb () -.\"O depends on the -.\"O .B LC_CTYPE -.\"O category of the -.\"O current locale. -.BR wctomb () -関数の動作は現在のロケールの -.B LC_CTYPE -カテゴリに依存している。 +\fBwctomb\fP() 関数の動作は現在のロケールの \fBLC_CTYPE\fP カテゴリに依存している。 .PP -.\"O This function is not multithread safe. -.\"O The function -.\"O .BR wcrtomb (3) -.\"O provides -.\"O a better interface to the same functionality. -この関数はマルチスレッドでは安全ではない。 -.BR wcrtomb (3) -関数は -同じ機能のより良いインターフェースを提供する。 +この関数はマルチスレッドでは安全ではない。 \fBwcrtomb\fP(3) 関数は 同じ機能のより良いインターフェースを提供する。 .SH 関連項目 -.BR MB_CUR_MAX (3), -.BR wcrtomb (3), -.BR wcstombs (3) +\fBMB_CUR_MAX\fP(3), \fBwcrtomb\fP(3), \fBwcstombs\fP(3) diff --git a/draft/man3/y0.3 b/draft/man3/y0.3 index 43a41125..6135c8ec 100644 --- a/draft/man3/y0.3 +++ b/draft/man3/y0.3 @@ -31,330 +31,124 @@ .\" Modified 2004-11-12 as per suggestion by Fabian Kreutz/AEB .\" 2008-07-24, mtk, created this page, based on material from j0.3. .\" -.\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2008-09-19, Akihiro MOTOKI , LDP v3.07 -.\" -.TH Y0 3 2008-08-10 "" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH Y0 3 2008\-08\-10 "" "Linux Programmer's Manual" .SH 名前 -.\"O y0, y0f, y0l, y1, y1f, y1l, yn, ynf, ynl \- -.\"O Bessel functions of the second kind -y0, y0f, y0l, y1, y1f, y1l, yn, ynf, ynl \- -第二種ベッセル関数 -.\"O .SH SYNOPSIS +y0, y0f, y0l, y1, y1f, y1l, yn, ynf, ynl \- 第二種ベッセル関数 .SH 書式 .nf -.B #include +\fB#include \fP .sp -.BI "double y0(double " x ); +\fBdouble y0(double \fP\fIx\fP\fB);\fP .br -.BI "double y1(double " x ); +\fBdouble y1(double \fP\fIx\fP\fB);\fP .br -.BI "double yn(int " n ", double " x ); +\fBdouble yn(int \fP\fIn\fP\fB, double \fP\fIx\fP\fB);\fP .sp -.BI "float y0f(float " x ); +\fBfloat y0f(float \fP\fIx\fP\fB);\fP .br -.BI "float y1f(float " x ); +\fBfloat y1f(float \fP\fIx\fP\fB);\fP .br -.BI "float ynf(int " n ", float " x ); +\fBfloat ynf(int \fP\fIn\fP\fB, float \fP\fIx\fP\fB);\fP .sp -.BI "long double y0l(long double " x ); +\fBlong double y0l(long double \fP\fIx\fP\fB);\fP .br -.BI "long double y1l(long double " x ); +\fBlong double y1l(long double \fP\fIx\fP\fB);\fP .br -.BI "long double ynl(int " n ", long double " x ); +\fBlong double ynl(int \fP\fIn\fP\fB, long double \fP\fIx\fP\fB);\fP .fi .sp -.\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): +glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l -.BR y0 (), -.BR y1 (), -.BR yn (): +\fBy0\fP(), \fBy1\fP(), \fByn\fP(): .RS 4 _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE .RE .br -.BR y0f (), -.BR y0l (), -.BR y1f (), -.BR y1l (), -.BR ynf (), -.BR ynl (): +\fBy0f\fP(), \fBy0l\fP(), \fBy1f\fP(), \fBy1l\fP(), \fBynf\fP(), \fBynl\fP(): .RS 4 -_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 600 .\" Also seems to work: -std=c99 -D_XOPEN_SOURCE +_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 600 .RE .ad b -.\"O .SH DESCRIPTION .SH 説明 .PP -.\"O The -.\"O .BR y0 () -.\"O and -.\"O .BR y1 () -.\"O functions return Bessel functions of \fIx\fP -.\"O of the second kind of orders 0 and 1, respectively. -.\"O The -.\"O .BR yn () -.\"O function -.\"O returns the Bessel function of \fIx\fP of the second kind of order \fIn\fP. -関数 -.BR y0 () -と -.BR y1 () -はそれぞれ \fIx\fP の 0 次、1 次の -第二種ベッセル関数の値を返す。 -関数 -.BR yn () -は \fIx\fP の \fIn\fP 次の -第二種ベッセル関数の値を返す。 +関数 \fBy0\fP() と \fBy1\fP() はそれぞれ \fIx\fP の 0 次、1 次の 第二種ベッセル関数の値を返す。 関数 \fByn\fP() は +\fIx\fP の \fIn\fP 次の 第二種ベッセル関数の値を返す。 .PP -.\"O The value of \fIx\fP must be positive. \fIx\fP は正の値でなければならない。 .PP -.\"O The -.\"O .BR y0f () -.\"O etc. and -.\"O .BR y0l () -.\"O etc. functions are versions that take and return -.\"O .I float -.\"O and -.\"O .I "long double" -.\"O values, respectively. -.BR y0f () -群の関数、 -.BR y0l () -群の関数は、それぞれ -.I float -型、 -.I "long double" -型の返り値を返す。 -.\"O .SH RETURN VALUE +\fBy0f\fP() 群の関数、 \fBy0l\fP() 群の関数は、それぞれ \fIfloat\fP 型、 \fIlong double\fP 型の返り値を返す。 .SH 返り値 -.\"O On success, these functions return the appropriate -.\"O Bessel value of the second kind for -.\"O .IR x . -成功すると、これらの関数は -.I x -に対する第二種ベッセル関数の値を返す。 +成功すると、これらの関数は \fIx\fP に対する第二種ベッセル関数の値を返す。 -.\"O If -.\"O .I x -.\"O is a NaN, a NaN is returned. -.I x -が NaN の場合、NaN が返される。 +\fIx\fP が NaN の場合、NaN が返される。 -.\"O If -.\"O .I x -.\"O is negative, -.\"O a domain error occurs, -.\"O and the functions return -.\"O .RB - HUGE_VAL , -.\"O .RB - HUGE_VALF , -.\"O or -.\"O .RB - HUGE_VALL , -.\"O respectively. -.\"O (POSIX.1-2001 also allows a NaN return for this case.) -.I x -が負の場合、領域エラー (domain error) が発生し、 -各関数はそれぞれ -.RB - HUGE_VAL , -.RB - HUGE_VALF , -.RB - HUGE_VALL -を返す (POSIX.1-2001 ではこの場合に NaN を返すことも認めている)。 +\fIx\fP が負の場合、領域エラー (domain error) が発生し、 各関数はそれぞれ \-\fBHUGE_VAL\fP, \-\fBHUGE_VALF\fP, +\-\fBHUGE_VALL\fP を返す (POSIX.1\-2001 ではこの場合に NaN を返すことも認めている)。 -.\"O If -.\"O .I x -.\"O is 0.0, -.\"O a pole error occurs, -.\"O and the functions return -.\"O .RB - HUGE_VAL , -.\"O .RB - HUGE_VALF , -.\"O or -.\"O .RB - HUGE_VALL , -.\"O respectively. -.I x -が 0.0 の場合、極エラー (pole error) が発生し、 -各関数はそれぞれ -.RB - HUGE_VAL , -.RB - HUGE_VALF , -.RB - HUGE_VALL -を返す。 +\fIx\fP が 0.0 の場合、極エラー (pole error) が発生し、 各関数はそれぞれ \-\fBHUGE_VAL\fP, \-\fBHUGE_VALF\fP, +\-\fBHUGE_VALL\fP を返す。 -.\"O If the result underflows, -.\"O a range error occurs, -.\"O and the functions return 0.0 -結果がアンダーフローする場合、 -範囲エラー (range error) が発生し、 -各関数は 0.0 を返す。 +結果がアンダーフローする場合、 範囲エラー (range error) が発生し、 各関数は 0.0 を返す。 -.\"O If the result overflows, -.\"O a range error occurs, -.\"O and the functions return -.\"O .RB - HUGE_VAL , -.\"O .RB - HUGE_VALF , -.\"O or -.\"O .RB - HUGE_VALL , -.\"O respectively. -.\"O (POSIX.1-2001 also allows a 0.0 return for this case.) -結果がオーバーフローする場合、範囲エラーが発生し、 -各関数はそれぞれ -.RB - HUGE_VAL , -.RB - HUGE_VALF , -.RB - HUGE_VALL -を返す (POSIX.1-2001 ではこの場合に 0.0 を返すことも認めている)。 -.\"O .SH ERRORS +結果がオーバーフローする場合、範囲エラーが発生し、 各関数はそれぞれ \-\fBHUGE_VAL\fP, \-\fBHUGE_VALF\fP, +\-\fBHUGE_VALL\fP を返す (POSIX.1\-2001 ではこの場合に 0.0 を返すことも認めている)。 .SH エラー -.\"O See -.\"O .BR math_error (7) -.\"O for information on how to determine whether an error has occurred -.\"O when calling these functions. -これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は -.BR math_error (7) -を参照のこと。 +これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP -.\"O The following errors can occur: 以下のエラーが発生する可能性がある。 -.TP -.\"O Domain error: \fIx\fP is negative -領域エラー: \fIx\fP が負 -.\"O .I errno -.\"O is set to -.\"O .BR EDOM . -.\"O An invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O is raised. -.I errno -に -.B EDOM -が設定される。 -不正 (invalid) 浮動小数点例外 -.RB ( FE_INVALID ) -が上がる。 -.TP -.\"O Pole error: \fIx\fP is 0.0 +.TP +領域エラー (domain error): \fIx\fP が負である +\fIerrno\fP に \fBEDOM\fP が設定される。 不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 +.TP 極エラー: \fIx\fP が 0.0 .\" Before POSIX.1-2001 TC2, this was (inconsistently) specified .\" as a range error. -.\"O .I errno -.\"O is set to .\" FIXME . y0(0.0) gives EDOM -.\"O .BR ERANGE -.\"O (but see BUGS). -.\"O No -.\"O .B FE_DIVBYZERO -.\"O exception is returned by -.\"O .BR fetestexcept (3) -.\"O for this case. -.I errno -に -.B ERANGE -が設定される (「バグ」の節を参照のこと)。 -このエラーの場合、 -.BR fetestexcept (3) -は -.B FE_DIVBYZERO -例外を返さない。 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6808 -.TP -.\"O Range error: result underflow -範囲エラー: 結果のアンダーフロー +\fIerrno\fP に \fBERANGE\fP が設定される (「バグ」の節を参照のこと)。 このエラーの場合、 \fBfetestexcept\fP(3) は +\fBFE_DIVBYZERO\fP 例外を返さない。 +.TP +範囲エラー (range error): 結果のアンダーフロー .\" e.g., y0(1e33) on glibc 2.8/x86-32 -.\"O .I errno -.\"O is set to -.\"O .BR ERANGE . -.I errno -に -.B ERANGE -が設定される。 .\" An underflow floating-point exception .\" .RB ( FE_UNDERFLOW ) .\" is raised. .\" FIXME . Is it intentional that these functions do not use FE_*? .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6806 -.\"O No -.\"O .B FE_UNDERFLOW -.\"O exception is returned by -.\"O .BR fetestexcept (3) -.\"O for this case. -このエラーの場合、 -.BR fetestexcept (3) -は -.B FE_UNDERFLOW +\fIerrno\fP に \fBERANGE\fP が設定される。 このエラーの場合、 \fBfetestexcept\fP(3) は \fBFE_UNDERFLOW\fP 例外を返さない。 -.TP -.\"O Range error: result overflow -範囲エラー: 結果のオーバーフロー +.TP +範囲エラー (range error): 結果のオーバーフロー .\" e.g., yn(10, 1e-40) on glibc 2.8/x86-32 .\" .I errno .\" is set to .\" .BR ERANGE . -.\"O .I errno -.\"O is not set for this case. -この場合、 -.I errno -は設定されない。 .\" FIXME . Is it intentional that errno is not set? .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6808 -.\"O An overflow floating-point exception -.\"O .RB ( FE_OVERFLOW ) -.\"O is raised. -オーバーフロー浮動小数点例外 -.RB ( FE_OVERFLOW ) -が上がる。 -.\"O .SH "CONFORMING TO" +この場合、 \fIerrno\fP は設定されない。 オーバーフロー浮動小数点例外 (\fBFE_OVERFLOW\fP) が上がる。 .SH 準拠 -.\"O The functions returning -.\"O .I double -.\"O conform to SVr4, 4.3BSD, -.\"O POSIX.1-2001. -.I double -型の値を返す関数は、SVr4, 4.3BSD, POSIX.1-2001 -に準拠する。 -.\"O The others are nonstandard functions that also exist on the BSDs. -それ以外は非標準の関数で、BSD にも存在する。 -.\"O .SH BUGS +\fIdouble\fP 型の値を返す関数は、SVr4, 4.3BSD, POSIX.1\-2001 に準拠する。 それ以外は非標準の関数で、BSD +にも存在する。 .SH バグ -.\"O On a pole error, these functions set -.\"O .I errno -.\"O to -.\"O .BR EDOM , -.\"O instead of -.\"O .BR ERANGE -.\"O as POSIX.1-2004 requires. -極エラーの場合、これらの関数は -.I errno -に -.B EDOM -を設定するが、 -POSIX.1-2004 では -.B ERANGE -を設定することが要求されている。 .\" FIXME . .\" Bug raised: http://sourceware.org/bugzilla/show_bug.cgi?id=6807 +極エラーの場合、これらの関数は \fIerrno\fP に \fBEDOM\fP を設定するが、 POSIX.1\-2004 では \fBERANGE\fP +を設定することが要求されている。 -.\"O In glibc version 2.3.2 and earlier, -glibc バージョン 2.3.2 以前では、 .\" FIXME . Actually, 2.3.2 is the earliest test result I have; so yet .\" to confirm if this error occurs only in 2.3.2. -.\"O these functions do not raise an invalid floating-point exception -.\"O .RB ( FE_INVALID ) -.\"O when a domain error occurs. -領域エラーが発生した場合に、これらの関数は -不正浮動小数点例外 -.RB ( FE_INVALID ) +glibc バージョン 2.3.2 以前では、 領域エラーが発生した場合に、これらの関数は 不正浮動小数点例外 (\fBFE_INVALID\fP) を上げない。 -.\"O .SH SEE ALSO .SH 関連項目 -.BR j0 (3) +\fBj0\fP(3) diff --git a/draft/man4/cpuid.4 b/draft/man4/cpuid.4 new file mode 100644 index 00000000..5fe409f4 --- /dev/null +++ b/draft/man4/cpuid.4 @@ -0,0 +1,73 @@ +.\" Copyright (c) 2009 Intel Corporation, Author Andi Kleen +.\" Description based on comments in arch/x86/kernel/cpuid.c +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH CPUID 4 2009\-03\-31 Linux "Linux Programmer's Manual" +.SH 名前 +cpuid \- x86 CPUID access device +.SH 説明 +CPUID provides an interface for querying information about the x86 CPU. + +This device is accessed by \fBlseek (2)\fP or \fBpread (2)\fP to the appropriate +CPUID level and reading in chunks of 16 bytes. A larger read size means +multiple reads of consecutive levels. + +The lower 32 bits of the file position is used as the incoming \fI%eax\fP, and +the upper 32 bits of the file position as the incoming \fI%ecx\fP, the latter +intended for "counting" \fIeax\fP levels like \fIeax=4\fP. + +This driver uses \fI/dev/cpu/CPUNUM/cpuid\fP, where \fICPUNUM\fP is the minor +number, and on an SMP box will direct the access to CPU \fICPUNUM\fP as listed +in \fI/proc/cpuinfo\fP. + +This file is protected so that it can only be read by the user \fIroot\fP, or +members of the group \fIroot\fP. +.SH 注意 +The CPUID instruction can be directly executed by a program using inline +assembler. However this device allows convenient access to all CPUs without +changing process affinity. + +Most of the information in \fIcpuid\fP is reported by the kernel in cooked form +either in \fI/proc/cpuinfo\fP or through subdirectories in +\fI/sys/devices/system/cpu\fP. Direct CPUID access through this device should +only be used in exceptional cases. + +The \fIcpuid\fP driver is not auto\-loaded. On modular kernels you might need +to use the following command to load it explicitly before use: + + $ \fImodprobe cpuid\fP + +There is no support for CPUID functions that require additional input +registers. + +Very old x86 CPUs don't support CPUID. +.SH 関連項目 +Intel Corporation, Intel 64 and IA\-32 Architectures Software Developer's +Manual Volume 2A: Instruction Set Reference, A\-M, 3\-180 CPUID reference. + +Intel Corporation, Intel Processor Identification and the CPUID Instruction, +Application note 485. diff --git a/draft/man4/intro.4 b/draft/man4/intro.4 index 7bcaa9a5..bcb7ea35 100644 --- a/draft/man4/intro.4 +++ b/draft/man4/intro.4 @@ -22,39 +22,20 @@ .\" USA. .\" .\" Modified Sat Jul 24 16:57:14 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1996,1997,1998 ISHIKAWA Mutsumi -.\" all rights reserved. +.\" This file was generated with po4a. Translate the source file. .\" -.\" Translated Thu Feb 6 16:39:55 1997 -.\" by Mutsumi Ishikawa -.\" Modified Sun Jan 11 03:39:10 JST 1998 -.\" by ISHIKAWA Mutsumi -.\" -.\" WORD: introduction 序文 -.TH INTRO 4 2007-10-23 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH INTRO 4 2007\-10\-23 Linux "Linux Programmer's Manual" .SH 名前 -.\"O intro \- Introduction to special files intro \- スペシャルファイルに関する序文 -.\"O .SH DESCRIPTION .SH 説明 -.\"O Section 4 of the manual describes special files (devices). マニュアルの 4 章は、スペシャルファイル (デバイス) について説明している。 -.\"O .SH FILES .SH ファイル -.\"O /dev/* \(em device files /dev/* \(em デバイスファイル -.\"O .SH NOTES -.SH 備考 -.\"O .SS Authors and Copyright Conditions +.SH 注意 .SS 著者と著作権 -.\"O Look at the header of the manual page source for the author(s) and copyright -.\"O conditions. -.\"O Note that these can be different from page to page! -著者および copyright の条件については各マニュアルページのソースの -ヘッダ部分を参照してください。条件はそれぞれのページごとに異なっ -ていることにご注意願います。 -.\"O .SH "SEE ALSO" +著者と著作権に関しては各マニュアルページのソースのヘッダを参照すること。 これらはページごとに異なる可能性があることに注意してほしい。 .SH 関連項目 -.BR standards (7) +\fBstandards\fP(7) diff --git a/draft/man4/msr.4 b/draft/man4/msr.4 new file mode 100644 index 00000000..80831818 --- /dev/null +++ b/draft/man4/msr.4 @@ -0,0 +1,51 @@ +.\" Copyright (c) 2009 Intel Corporation, Author Andi Kleen +.\" Some sentences copied from comments in arch/x86/kernel/msr.c +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH MSR 4 2009\-03\-31 Linux "Linux Programmer's Manual" +.SH 名前 +msr \- x86 CPU MSR access device +.SH 説明 +\fI/dev/cpu/CPUNUM/msr\fP provides an interface to read and write the +model\-specific registers (MSRs) of an x86 CPU. \fICPUNUM\fP is the number of +the CPU to access as listed in \fI/proc/cpuinfo\fP. + +The register access is done by opening the file and seeking to the MSR +number as offset in the file, and then reading or writing in chunks of 8 +bytes. An I/O transfer of more than 8 bytes means multiple reads or writes +of the same register. + +This file is protected so that it can only be read and written by the user +\fIroot\fP, or members of the group \fIroot\fP. +.SH 注意 +The \fImsr\fP driver is not auto\-loaded. On modular kernels you might need to +use the following command to load it explicitly before use: + + $ \fImodprobe msr\fP +.SH 関連項目 +Intel Corporation Intel 64 and IA\-32 Architectures Software Developer's +Manual Volume 3B Appendix B for an overview of the Intel CPU MSRs. diff --git a/draft/man4/rtc.4 b/draft/man4/rtc.4 index 05c4aa9f..7866d805 100644 --- a/draft/man4/rtc.4 +++ b/draft/man4/rtc.4 @@ -26,191 +26,67 @@ .\" 2006-02-08 Various additions by mtk .\" 2006-11-26 cleanup, cover the generic rtc framework; David Brownell .\" -.\" Japanese Version Copyright (c) 2006-2007 Yuichi SATO -.\" all rights reserved. -.\" Translated 2006-07-12 by Yuichi SATO . LDP v2.29 -.\" Updated & Modified 2007-01-08 by Yuichi SATO. LDP v2.43 +.\"******************************************************************* .\" -.TH RTC 4 2010-02-25 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH RTC 4 2010\-02\-25 Linux "Linux Programmer's Manual" .SH 名前 -.\"O rtc \- real-time clock rtc \- リアルタイムクロック -.\"O .SH SYNOPSIS .SH 書式 #include .sp -.BI "int ioctl(" fd ", RTC_" request ", " param ");" -.\"O .SH DESCRIPTION +\fBint ioctl(\fP\fIfd\fP\fB, RTC_\fP\fIrequest\fP\fB, \fP\fIparam\fP\fB);\fP .SH 説明 -.\"O This is the interface to drivers for real-time clocks (RTCs). これはリアルタイムクロック (RTC) のドライバのインタフェースである。 -.\"O Most computers have one or more hardware clocks which record the -.\"O current "wall clock" time. -.\"O These are called "Real Time Clocks" (RTCs). -.\"O One of these usually has battery backup power so that it tracks the time -.\"O even while the computer is turned off. -.\"O RTCs often provide alarms and other interrupts. -多くのコンピュータは、現在の「壁時計」時刻 ("wall clock" time) を記録する、 -ハードウェアクロックを 1 個以上持っている。 -これらは「リアルタイムクロック」(RTC) と呼ばれる。 -これらの時計のうち 1 つは、通常は電池でバックアップして駆動されるので、 -コンピュータのスイッチを切っても、時刻を保持できる。 -多くの場合、RTC はアラームやその他の割り込みの機能を提供する。 - -.\"O All i386 PCs, and ACPI-based systems, have an RTC that is compatible with -.\"O the Motorola MC146818 chip on the original PC/AT. -.\"O Today such an RTC is usually integrated into the mainboard's chipset -.\"O (south bridge), and uses a replaceable coin-sized backup battery. -全ての i386 PC と ACPI ベースのシステムには RTC がある。 -この RTC は、元々の PC/AT に存在した -Motorola MC146818 チップと互換性がある。 -このような RTC は、今日ではマザーボードの -チップセット (サウスブリッジ) 内で実装されていることが多く、 -交換可能な硬貨くらいの大きさのバックアップ電池を使っている。 +多くのコンピュータは、現在の「壁時計」時刻 ("wall clock" time) を記録する、 ハードウェアクロックを 1 個以上持っている。 +これらは「リアルタイムクロック」(RTC) と呼ばれる。 これらの時計のうち 1 つは、通常は電池でバックアップして駆動されるので、 +コンピュータのスイッチを切っても、時刻を保持できる。 多くの場合、RTC はアラームやその他の割り込みの機能を提供する。 -.\"O Non-PC systems, such as embedded systems built around system-on-chip -.\"O processors, use other implementations. -.\"O They usually won't offer the same functionality as the RTC from a PC/AT. -システムオンチップ (system-on-chip) プロセッサを使って作られた -組み込みシステムといった、PC 以外のシステムでは、別な実装を用いている。 -このようなシステムでは、PC/AT の RTC と同じ機能を提供していない場合が多い。 +全ての i386 PC と ACPI ベースのシステムには RTC がある。 この RTC は、元々の PC/AT に存在した Motorola +MC146818 チップと互換性がある。 このような RTC は、今日ではマザーボードの チップセット (サウスブリッジ) +内で実装されていることが多く、 交換可能な硬貨くらいの大きさのバックアップ電池を使っている。 -.\"O .SS RTC vs System Clock -.SS RTC とシステムクロックの違い -.\"O RTCs should not be confused with the system clock, which is -.\"O a software clock maintained by the kernel and used to implement -.\"O .BR gettimeofday (2) -.\"O and -.\"O .BR time (2), -.\"O as well as setting timestamps on files, etc. -RTC をシステムクロックと混同すべきではない。 -システムクロックは、カーネルに管理されるソフトウェアクロックであり、 -ファイルによるタイムスタンプ設定などとともに、 -.BR gettimeofday (2) -や -.BR time (2) -を実装するのに使用されている。 -.\"O The system clock reports seconds and microseconds since a start point, -.\"O defined to be the POSIX Epoch: 1970-01-01 00:00:00 +0000 (UTC). -システムクロックは、POSIX における紀元 -(Epoch; 1970-01-01 00:00:00 +0000 (UTC)) からの秒とミリ秒を表す。 -.\"O (One common implementation counts timer interrupts, once -.\"O per "jiffy", at a frequency of 100, 250, or 1000 Hz.) -.\"O That is, it is supposed to report wall clock time, which RTCs also do. -1 つの一般的な実装ではタイマー割り込みを、"jiffy" 毎に 1 回、 -100, 250, 1000 Hz という周波数でカウントする。 +システムオンチップ (system\-on\-chip) プロセッサを使って作られた 組み込みシステムといった、PC +以外のシステムでは、別な実装を用いている。 このようなシステムでは、PC/AT の RTC と同じ機能を提供していない場合が多い。 +.SS "RTC とシステムクロックの違い" +RTC をシステムクロックと混同すべきではない。 システムクロックは、カーネルに管理されるソフトウェアクロックであり、 +ファイルによるタイムスタンプ設定などとともに、 \fBgettimeofday\fP(2) や \fBtime\fP(2) を実装するのに使用されている。 +システムクロックは、POSIX における紀元 (Epoch; 1970\-01\-01 00:00:00 +0000 (UTC)) からの秒とミリ秒を表す。 +1 つの一般的な実装ではタイマー割り込みを、"jiffy" 毎に 1 回、 100, 250, 1000 Hz という周波数でカウントする。 -.\"O A key difference between an RTC and the system clock is that RTCs -.\"O run even when the system is in a low power state (including "off"), -.\"O and the system clock can't. -RTC とシステムクロックの重要な違いは、 -RTC はシステムが低電力状態 (「オフ」の場合も含む) でも動作するのに対し、 -システムクロックは動作しない点である。 -.\"O Until it is initialized, the system clock can only report time since -.\"O system boot ... not since the POSIX Epoch. -システムクロックは、初期化が行われるまでは、 -POSIX 紀元からではなくシステムのブート時からの時刻しか返せない。 -.\"O So at boot time, and after resuming from a system low power state, the -.\"O system clock will often be set to the current wall clock time using an RTC. -そのため、ブート時やシステムの低電力状態からの復帰 (resume) 後には、 -システムクロックは RTC を使って現在の壁時計時刻に設定される場合が多い。 -.\"O Systems without an RTC need to set the system clock using another clock, -.\"O maybe across the network or by entering that data manually. -RTC を持たないシステムでは、 -他の時計を使ってシステムクロックを設定する必要があり、 -ネットワークにアクセスしたり、(時刻) データを手動で入力したりするだろう。 -.\"O .SS RTC functionality -.SS RTC の機能 -.\"O RTCs can be read and written with -.\"O .BR hwclock (8), -.\"O or directly with the ioctl requests listed below. -RTC は -.BR hwclock (8) -または下記の ioctl リクエストで読み書きができる。 +RTC とシステムクロックの重要な違いは、 RTC はシステムが低電力状態 (「オフ」の場合も含む) でも動作するのに対し、 +システムクロックは動作しない点である。 システムクロックは、初期化が行われるまでは、 POSIX +紀元からではなくシステムのブート時からの時刻しか返せない。 そのため、ブート時やシステムの低電力状態からの復帰 (resume) 後には、 +システムクロックは RTC を使って現在の壁時計時刻に設定される場合が多い。 RTC を持たないシステムでは、 +他の時計を使ってシステムクロックを設定する必要があり、 ネットワークにアクセスしたり、(時刻) データを手動で入力したりするだろう。 +.SS "RTC の機能" +RTC は \fBhwclock\fP(8) または下記の ioctl リクエストで読み書きができる。 -.\"O Besides tracking the date and time, many RTCs can also generate -.\"O interrupts -日付と時間をカウントするのに加えて、 -多くの RTC は以下のように割り込みを発生できる。 +日付と時間をカウントするのに加えて、 多くの RTC は以下のように割り込みを発生できる。 .IP * 3 -.\"O on every clock update (i.e., once per second); クロックの更新毎 (つまり 1 秒毎)。 .IP * -.\"O at periodic intervals with a frequency that can be set to -.\"O any power-of-2 multiple in the range 2 Hz to 8192 Hz; 2 Hz から 8192 Hz までの 2 の乗数の周波数で、定期的な間隔。 .IP * -.\"O on reaching a previously specified alarm time. 前もって指定したアラーム時刻に達した時。 .PP -.\"O Each of those interrupt sources can be enabled or disabled separately. -これらの割り込み元は、個別に有効にしたり無効にしたりできる。 -.\"O On many systems, the alarm interrupt can be configured as a system wakeup -.\"O event, which can resume the system from a low power state such as -.\"O Suspend-to-RAM (STR, called S3 in ACPI systems), -.\"O Hibernation (called S4 in ACPI systems), -.\"O or even "off" (called S5 in ACPI systems). -多くのシステムでは、アラーム割り込みをシステムの -ウェイクアップイベントとして設定できる。 -このイベントは、RAM へのサスペンド (STR, ACPI システムで S3 と呼ばれる) や -ハイバーネーション (ACPI システムで S4 と呼ばれる) といった低電力状態や、 -「オフ」(ACPI システムで S5 と呼ばれる) からでも、システムを復帰できる。 -.\"O On some systems, the battery backed RTC can't issue -.\"O interrupts, but another one can. -電池でバックアップされた RTC が割り込みを発生できるシステムと、 -できないシステムがある。 +これらの割り込み元は、個別に有効にしたり無効にしたりできる。 多くのシステムでは、アラーム割り込みをシステムの ウェイクアップイベントとして設定できる。 +このイベントは、RAM へのサスペンド (STR, ACPI システムで S3 と呼ばれる) や ハイバーネーション (ACPI システムで S4 +と呼ばれる) といった低電力状態や、 「オフ」(ACPI システムで S5 と呼ばれる) からでも、システムを復帰できる。 電池でバックアップされた +RTC が割り込みを発生できるシステムと、 できないシステムがある。 -.\"O The -.\"O .I /dev/rtc -.\"O (or -.\"O .IR /dev/rtc0 , -.\"O .IR /dev/rtc1 , -.\"O etc.) -.\"O device can be opened only once (until it is closed) and it is read-only. -.I /dev/rtc -(または -.IR /dev/rtc0 , -.I /dev/rtc1 -などの) -デバイスは (クローズされるまで) 1 回しかオープンすることができず、 -読み込み専用である。 -.\"O On -.\"O .BR read (2) -.\"O and -.\"O .BR select (2) -.\"O the calling process is blocked until the next interrupt from that RTC -.\"O is received. -.BR read (2) -と -.BR select (2) -を呼び出したプロセスは、 -RTC からの割り込みを受け取るまで停止 (block) される。 -.\"O Following the interrupt, the process can read a long integer, of which -.\"O the least significant byte contains a bit mask encoding -.\"O the types of interrupt that occurred, -.\"O while the remaining 3 bytes contain the number of interrupts since the -.\"O last -.\"O .BR read (2). -割り込みの後、プロセスは long 型整数を読み出すことができる。 -この整数の最下位バイトは発生した割り込みの種別を -コード化したビットマスクであり、 -残りの 3 バイトは最後の -.BR read (2) +\fI/dev/rtc\fP (または \fI/dev/rtc0\fP, \fI/dev/rtc1\fP などの) デバイスは (クローズされるまで) 1 +回しかオープンすることができず、 読み込み専用である。 \fBread\fP(2) と \fBselect\fP(2) を呼び出したプロセスは、 RTC +からの割り込みを受け取るまで停止 (block) される。 割り込みの後、プロセスは long 型整数を読み出すことができる。 +この整数の最下位バイトは発生した割り込みの種別を コード化したビットマスクであり、 残りの 3 バイトは最後の \fBread\fP(2) 以降に発生した割り込みの回数である。 -.\"O .SS ioctl(2) interface -.SS ioctl(2) インタフェース -.\"O The following -.\"O .BR ioctl (2) -.\"O requests are defined on file descriptors connected to RTC devices: -以下の -.BR ioctl (2) -リクエストが RTC デバイスの接続された -ファイルディスクリプタに対して定義されている: -.TP -.B RTC_RD_TIME -.\"O Returns this RTC's time in the following structure: +.SS "ioctl(2) インタフェース" +以下の \fBioctl\fP(2) リクエストが RTC デバイスの接続された ファイルディスクリプタに対して定義されている: +.TP +\fBRTC_RD_TIME\fP RTC の時刻を以下の構造体で返す: .IP .in +4n @@ -222,207 +98,57 @@ struct rtc_time { int tm_mday; int tm_mon; int tm_year; -.\"O int tm_wday; /* unused */ int tm_wday; /* 未使用 */ -.\"O int tm_yday; /* unused */ int tm_yday; /* 未使用 */ -.\"O int tm_isdst; /* unused */ int tm_isdst; /* 未使用 */ }; .fi .in .IP -.\"O The fields in this structure have the same meaning and ranges as for the -.\"O .I tm -.\"O structure described in -.\"O .BR gmtime (3). -この構造体のフィールドは -.BR gmtime (3) -で説明されている -.I tm -構造体のフィールドと同じ意味で同じ範囲である。 -.\"O A pointer to this structure should be passed as the third -.\"O .BR ioctl (2) -.\"O argument. -この構造体へのポインタを -.BR ioctl (2) -の第 3 引き数として渡す。 -.TP -.B RTC_SET_TIME -.\"O Sets this RTC's time to the time specified by the -.\"O .I rtc_time -.\"O structure pointed to by the third -.\"O .BR ioctl (2) -.\"O argument. -.BR ioctl (2) -の第 3 引き数が指す -.I rtc_time -構造体の値を RTC 時刻に設定する。 -.\"O To set the -.\"O RTC's time the process must be privileged (i.e., have the -.\"O .B CAP_SYS_TIME -.\"O capability). -RTC 時刻の設定する場合、プロセスは特権 -(つまり -.B CAP_SYS_TIME -ケーパビリティ) を持たなければならない。 -.TP -.BR RTC_ALM_READ ", " RTC_ALM_SET -.\"O Read and set the alarm time, for RTCs that support alarms. -アラームがサポートされている RTC に対して、 -アラーム時刻の読み込みと設定を行う。 -.\"O The alarm interrupt must be separately enabled or disabled using the -.\"O .BR RTC_AIE_ON ", " RTC_AIE_OFF -.\"O requests. -アラーム割り込みは、 -.BR RTC_AIE_ON ", " RTC_AIE_OFF -を使って、これとは別に有効または無効にしなければならない。 -.\"O The third -.\"O .BR ioctl (2) -.\"O argument is a pointer to an -.\"O .I rtc_time -.\"O structure. -\fBioctl\fP(2) の第 3 引き数は、 -.I rtc_time -構造体へのポインタでなければならない。 -.\"O Only the -.\"O .IR tm_sec , -.\"O .IR tm_min , -.\"O and -.\"O .I tm_hour -.\"O fields of this structure are used. -この構造体の -.IR tm_sec , -.IR tm_min , -.I tm_hour +この構造体のフィールドは \fBgmtime\fP(3) で説明されている \fItm\fP 構造体のフィールドと同じ意味で同じ範囲である。 +この構造体へのポインタを \fBioctl\fP(2) の第 3 引き数として渡す。 +.TP +\fBRTC_SET_TIME\fP +\fBioctl\fP(2) の第 3 引き数が指す \fIrtc_time\fP 構造体の値を RTC 時刻に設定する。 RTC +時刻の設定する場合、プロセスは特権 (つまり \fBCAP_SYS_TIME\fP ケーパビリティ) を持たなければならない。 +.TP +\fBRTC_ALM_READ\fP, \fBRTC_ALM_SET\fP +アラームがサポートされている RTC に対して、 アラーム時刻の読み込みと設定を行う。 アラーム割り込みは、 \fBRTC_AIE_ON\fP, +\fBRTC_AIE_OFF\fP を使って、これとは別に有効または無効にしなければならない。 \fBioctl\fP(2) の第 3 引き数は、 +\fIrtc_time\fP 構造体へのポインタでなければならない。 この構造体の \fItm_sec\fP, \fItm_min\fP, \fItm_hour\fP フィールドのみが使用される。 -.TP -.BR RTC_IRQP_READ ", " RTC_IRQP_SET -.\"O Read and set the frequency for periodic interrupts, -.\"O for RTCs that support periodic interrupts. -周期的な割り込みがサポートされている RTC に対して、 -周期的な割り込みの周波数の読み込みと設定を行う。 -.\"O The periodic interrupt must be separately enabled or disabled using the -.\"O .BR RTC_PIE_ON ", " RTC_PIE_OFF -.\"O requests. -周期的な割り込みは、 -.BR RTC_PIE_ON ", " RTC_PIE_OFF -を使って、これとは別に有効または無効にしなければならない。 -.\"O The third -.\"O .BR ioctl (2) -.\"O argument is an -.\"O .I "unsigned long\ *" -.\"O or an -.\"O .IR "unsigned long" , -.\"O respectively. -\fBioctl\fP(2) の第 3 引き数は、それぞれ -.I "unsigned long\ *" -と -.I "unsigned long" -である。 -.\"O The value is the frequency in interrupts per second. -.\"O The set of allowable frequencies is the multiples of two -.\"O in the range 2 to 8192. -この値は 1 秒当たりの割り込みの回数である。 -指定可能な周波数は、2 の乗数で 2 から 8192 の範囲である。 -.\"O Only a privileged process (i.e., one having the -.\"O .B CAP_SYS_RESOURCE -.\"O capability) can set frequencies above the value specified in -.\"O .IR /proc/sys/dev/rtc/max-user-freq . -特権プロセス (つまり -.B CAP_SYS_RESOURCE -ケーパビリティを持つプロセス) のみが、 -.I /proc/sys/dev/rtc/max-user-freq -に書かれた上記の周波数を設定できる。 -.\"O (This file contains the value 64 by default.) -(このファイルにはデフォルトで 64 という値が書かれている)。 -.TP -.BR RTC_AIE_ON ", " RTC_AIE_OFF -.\"O Enable or disable the alarm interrupt, for RTCs that support alarms. -.\"O The third -.\"O .BR ioctl (2) -.\"O argument is ignored. -アラームがサポートされている RTC に対して、 -アラーム割り込みを有効または無効にする。 -\fBioctl\fP(2) の第 3 引き数は無視される。 -.TP -.BR RTC_UIE_ON ", " RTC_UIE_OFF -.\"O Enable or disable the interrupt on every clock update, -.\"O for RTCs that support this once-per-second interrupt. -.\"O The third -.\"O .BR ioctl (2) -.\"O argument is ignored. -1 秒毎の割り込みがサポートされている RTC に対して、 -クロック更新毎の割り込みを有効または無効にする。 -\fBioctl\fP(2) の第 3 引き数は無視される。 -.TP -.BR RTC_PIE_ON ", " RTC_PIE_OFF -.\"O Enable or disable the periodic interrupt, -.\"O for RTCs that support these periodic interrupts. -.\"O The third -.\"O .BR ioctl (2) -.\"O argument is ignored. -周期的な割り込みがサポートされている RTC に対して、 -周期的な割り込みを有効または無効にする。 -\fBioctl\fP(2) の第 3 引き数は無視される。 -.\"O Only a privileged process (i.e., one having the -.\"O .B CAP_SYS_RESOURCE -.\"O capability) can enable the periodic interrupt if the frequency is -.\"O currently set above the value specified in -.\"O .IR /proc/sys/dev/rtc/max-user-freq . -特権プロセス (つまり -.B CAP_SYS_RESOURCE -ケーパビリティを持つプロセス) のみが、 -その時点で -.I /proc/sys/dev/rtc/max-user-freq -に周期が上記の値に指定されている場合に、 -周期的な割り込みを有効にできる。 -.TP -.BR RTC_EPOCH_READ ", " RTC_EPOCH_SET -.\"O Many RTCs encode the year in an 8-bit register which is either -.\"O interpreted as an 8-bit binary number or as a BCD number. -.\"O In both cases, -.\"O the number is interpreted relative to this RTC's Epoch. -多くの RTC は年を 8 ビットのレジスタにコード化する。 -年は 8 ビットのバイナリ数または BCD 数に変換される。 -どちらの場合でも、その数値は RTC の紀元から相対値に変換される。 -.\"O The RTC's Epoch is -.\"O initialized to 1900 on most systems but on Alpha and MIPS it might -.\"O also be initialized to 1952, 1980, or 2000, depending on the value of -.\"O an RTC register for the year. -多くのシステムでは RTC の紀元は 1900 に初期化されるが、 -Alpha と MIPS では、RTC レジスタの年の値に応じて、 -1952, 1980, 2000 の何れかに初期化される。 -.\"O With some RTCs, -.\"O these operations can be used to read or to set the RTC's Epoch, -.\"O respectively. -これらの操作でそれぞれ RTC の紀元の読み込みと設定が可能な RTC もある。 -.\"O The third -.\"O .BR ioctl (2) -.\"O argument is a -.\"O .I "unsigned long\ *" -.\"O or a -.\"O .IR "unsigned long" , -.\"O respectively, and the value returned (or assigned) is the Epoch. -\fBioctl\fP(2) の第 3 引き数は、それぞれ -.I "unsigned long\ *" -と -.I "unsigned long" -である。 -返される値 (または指定される値) は紀元である。 -.\"O To set the RTC's Epoch the process must be privileged (i.e., have the -.\"O .B CAP_SYS_TIME -.\"O capability). -RTC の紀元を設定する場合、プロセスは特権 (つまり -.B CAP_SYS_TIME +.TP +\fBRTC_IRQP_READ\fP, \fBRTC_IRQP_SET\fP +周期的な割り込みがサポートされている RTC に対して、 周期的な割り込みの周波数の読み込みと設定を行う。 周期的な割り込みは、 +\fBRTC_PIE_ON\fP, \fBRTC_PIE_OFF\fP を使って、これとは別に有効または無効にしなければならない。 \fBioctl\fP(2) の第 3 +引き数は、それぞれ \fIunsigned long\ *\fP と \fIunsigned long\fP である。 この値は 1 +秒当たりの割り込みの回数である。 指定可能な周波数は、2 の乗数で 2 から 8192 の範囲である。 特権プロセス (つまり +\fBCAP_SYS_RESOURCE\fP ケーパビリティを持つプロセス) のみが、 \fI/proc/sys/dev/rtc/max\-user\-freq\fP +に書かれた上記の周波数を設定できる。 (このファイルにはデフォルトで 64 という値が書かれている)。 +.TP +\fBRTC_AIE_ON\fP, \fBRTC_AIE_OFF\fP +アラームがサポートされている RTC に対して、 アラーム割り込みを有効または無効にする。 \fBioctl\fP(2) の第 3 引き数は無視される。 +.TP +\fBRTC_UIE_ON\fP, \fBRTC_UIE_OFF\fP +1 秒毎の割り込みがサポートされている RTC に対して、 クロック更新毎の割り込みを有効または無効にする。 \fBioctl\fP(2) の第 3 +引き数は無視される。 +.TP +\fBRTC_PIE_ON\fP, \fBRTC_PIE_OFF\fP +周期的な割り込みがサポートされている RTC に対して、 周期的な割り込みを有効または無効にする。 \fBioctl\fP(2) の第 3 +引き数は無視される。 特権プロセス (つまり \fBCAP_SYS_RESOURCE\fP ケーパビリティを持つプロセス) のみが、 その時点で +\fI/proc/sys/dev/rtc/max\-user\-freq\fP に周期が上記の値に指定されている場合に、 周期的な割り込みを有効にできる。 +.TP +\fBRTC_EPOCH_READ\fP, \fBRTC_EPOCH_SET\fP +多くの RTC は年を 8 ビットのレジスタにコード化する。 年は 8 ビットのバイナリ数または BCD 数に変換される。 どちらの場合でも、その数値は +RTC の紀元から相対値に変換される。 多くのシステムでは RTC の紀元は 1900 に初期化されるが、 Alpha と MIPS では、RTC +レジスタの年の値に応じて、 1952, 1980, 2000 の何れかに初期化される。 これらの操作でそれぞれ RTC の紀元の読み込みと設定が可能な +RTC もある。 \fBioctl\fP(2) の第 3 引き数は、それぞれ \fIunsigned long\ *\fP と \fIunsigned long\fP +である。 返される値 (または指定される値) は紀元である。 RTC の紀元を設定する場合、プロセスは特権 (つまり \fBCAP_SYS_TIME\fP ケーパビリティ) を持たなければならない。 -.TP -.BR RTC_WKALM_RD ", " RTC_WKALM_SET -.\"O Some RTCs support a more powerful alarm interface, using these ioctls -.\"O to read or write the RTC's alarm time (respectively) with this structure: -RTC の中にはより強力なアラームインタフェースをサポートするものもあり、 -これらの ioctl を使うことで、以下のような構造体で -RTC のアラーム時刻を (それぞれ) 読み書きできる: +.TP +\fBRTC_WKALM_RD\fP, \fBRTC_WKALM_SET\fP +RTC の中にはより強力なアラームインタフェースをサポートするものもあり、 これらの ioctl を使うことで、以下のような構造体で RTC +のアラーム時刻を (それぞれ) 読み書きできる: .PP .RS .in +4n @@ -436,134 +162,32 @@ struct rtc_wkalrm { .in .RE .IP -.\"O The -.\"O .I enabled -.\"O flag is used to enable or disable the alarm interrupt, -.\"O or to read its current status; when using these calls, -.\"O .BR RTC_AIE_ON " and " RTC_AIE_OFF -.\"O are not used. -.\"O The -.\"O .I pending -.\"O flag is used by -.\"O .B RTC_WKALM_RD -.\"O to report a pending interrupt -.\"O (so it's mostly useless on Linux, except when talking -.\"O to the RTC managed by EFI firmware). -.I enabled -フラグはアラーム割り込みを有効または無効したり、 -現在の状態を読み込むのに使用される。 -これらのフラグを使う場合、 -.BR RTC_AIE_ON " と " RTC_AIE_OFF -は使用されない。 -.I pending -フラグは -.B RTC_WKALM_RD -で使用され、処理待ちの割り込みを表示する -(EFI ファームウェアで管理される RTC と通信するとき以外、 -Linux ではほとんど役に立たない)。 -.\"O The -.\"O .I time -.\"O field is as used with -.\"O .B RTC_ALM_READ -.\"O and -.\"O .B RTC_ALM_SET -.\"O except that the -.\"O .IR tm_mday , -.\"O .IR tm_mon , -.\"O and -.\"O .I tm_year -.\"O fields are also valid. -.I time -フィールドは -.B RTC_ALM_READ -や -.B RTC_ALM_SET -の場合と同じように使用されるが、 -.IR tm_mday , -.IR tm_mon , -.I tm_year -フィールドも有効であるという点が異なる。 -.\"O A pointer to this structure should be passed as the third -.\"O .BR ioctl (2) -.\"O argument. -この構造体へのポインタを -.BR ioctl (2) -の第 3 引き数として渡さなければならない。 -.\"O .SH FILES +\fIenabled\fP フラグはアラーム割り込みを有効または無効したり、 現在の状態を読み込むのに使用される。 これらのフラグを使う場合、 +\fBRTC_AIE_ON\fP と \fBRTC_AIE_OFF\fP は使用されない。 \fIpending\fP フラグは \fBRTC_WKALM_RD\fP +で使用され、処理待ちの割り込みを表示する (EFI ファームウェアで管理される RTC と通信するとき以外、 Linux ではほとんど役に立たない)。 +\fItime\fP フィールドは \fBRTC_ALM_READ\fP や \fBRTC_ALM_SET\fP の場合と同じように使用されるが、 \fItm_mday\fP, +\fItm_mon\fP, \fItm_year\fP フィールドも有効であるという点が異なる。 この構造体へのポインタを \fBioctl\fP(2) の第 3 +引き数として渡さなければならない。 .SH ファイル -.IR /dev/rtc ", " -.IR /dev/rtc0 ", " -.\"O .IR /dev/rtc1 ", " -.I /dev/rtc1 -.\"O etc: RTC special character device files. -など: -RTC 特殊キャラクターデバイスファイル +\fI/dev/rtc\fP, \fI/dev/rtc0\fP, \fI/dev/rtc1\fP など: RTC 特殊キャラクターデバイスファイル -.IR /proc/driver/rtc : -.\"O status of the (first) RTC. -(1 つ目の) RTC の状態 -.\"O .SH NOTES +\fI/proc/driver/rtc\fP: (1 つ目の) RTC の状態 .SH 注意 -.\"O When the kernel's system time is synchronized with an external -.\"O reference using -.\"O .BR adjtimex (2) -.\"O it will update a designated RTC periodically every 11 minutes. -.\"O To do so, the kernel has to briefly turn off periodic interrupts; -.\"O this might affect programs using that RTC. -カーネルのシステムクロックを -.BR adjtimex (2) -を使って外部参照で同期させる場合、 -.BR adjtimex (2) -は指定された RTC を 11 分毎に定期的に更新する。 -これを行うためカーネルは周期的な割り込みを短期間無効にする必要がある。 -これは RTC を使うプログラムに影響を与える。 +カーネルのシステムクロックを \fBadjtimex\fP(2) を使って外部参照で同期させる場合、 \fBadjtimex\fP(2) は指定された RTC +を 11 分毎に定期的に更新する。 これを行うためカーネルは周期的な割り込みを短期間無効にする必要がある。 これは RTC +を使うプログラムに影響を与える。 -.\"O An RTC's Epoch has nothing to do with the POSIX Epoch which is only -.\"O used for the system clock. -RTC の紀元は、システムクロックでのみ使用される -POSIX の紀元とは何の関係もない。 +RTC の紀元は、システムクロックでのみ使用される POSIX の紀元とは何の関係もない。 -.\"O If the year according to the RTC's Epoch and the year register is -.\"O less than 1970 it is assumed to be 100 years later, that is, between 2000 -.\"O and 2069. -RTC の紀元と年のレジスタに基づく年が 1970 未満である場合、 -100 年後、つまり 2000 から 2069 であると仮定される。 +RTC の紀元と年のレジスタに基づく年が 1970 未満である場合、 100 年後、つまり 2000 から 2069 であると仮定される。 -.\"O Some RTCs support "wildcard" values in alarm fields, to support -.\"O scenarios like periodic alarms at fifteen minutes after every hour, -.\"O or on the first day of each month. -.\"O Such usage is nonportable; -.\"O portable user space code only expects a single alarm interrupt, and -.\"O will either disable or reinitialize the alarm after receiving it. -RTC の中にはアラームフィールドに -「ワイルドカード」の値をサポートするものもあり、 -毎時 15 分や各月の初日など、定期的なアラームを行うシナリオをサポートする。 -このような使い方は移植性がない。 -移植性の高いユーザ空間コードでは、単独のアラーム割り込みだけを想定し、 -割り込みの受信後にアラームを無効または再初期化すべきである。 +RTC の中にはアラームフィールドに 「ワイルドカード」の値をサポートするものもあり、 毎時 15 +分や各月の初日など、定期的なアラームを行うシナリオをサポートする。 このような使い方は移植性がない。 +移植性の高いユーザ空間コードでは、単独のアラーム割り込みだけを想定し、 割り込みの受信後にアラームを無効または再初期化すべきである。 -.\"O Some RTCs support periodic interrupts with periods that are multiples -.\"O of a second rather than fractions of a second; -.\"O multiple alarms; -.\"O programmable output clock signals; -.\"O nonvolatile memory; -.\"O and other hardware -.\"O capabilities that are not currently exposed by this API. -以下の機能をサポートする RTC もある。 -1 秒の分数ではなく、1 秒の倍数を周期とする周期的な割り込み。 -複数のアラーム。 -プログラム可能な出力クロックシグナル。 -不揮発性 (nonvolatile) メモリ。 -この API で現在提供していない、その他のハードウェア機能。 -.\"O .SH "SEE ALSO" +以下の機能をサポートする RTC もある。 1 秒の分数ではなく、1 秒の倍数を周期とする周期的な割り込み。 複数のアラーム。 +プログラム可能な出力クロックシグナル。 不揮発性 (nonvolatile) メモリ。 この API で現在提供していない、その他のハードウェア機能。 .SH 関連項目 -.BR date (1), -.BR adjtimex (2), -.BR gettimeofday (2), -.BR settimeofday (2), -.BR stime (2), -.BR time (2), -.BR gmtime (3), -.BR time (7), -.BR hwclock (8), +\fBdate\fP(1), \fBadjtimex\fP(2), \fBgettimeofday\fP(2), \fBsettimeofday\fP(2), +\fBstime\fP(2), \fBtime\fP(2), \fBgmtime\fP(3), \fBtime\fP(7), \fBhwclock\fP(8), /usr/src/linux/Documentation/rtc.txt diff --git a/draft/man5/dir_colors.5 b/draft/man5/dir_colors.5 index 51e7f154..5636d7d9 100644 --- a/draft/man5/dir_colors.5 +++ b/draft/man5/dir_colors.5 @@ -8,361 +8,118 @@ .\" .\" Modified Sat Dec 22 22:25:33 2001 by Martin Schulze .\" -.\" Japanese Version Copyright (c) 2000-2002 Yuichi SATO -.\" all rights reserved. -.\" Translated Tue Jul 4 18:44:50 JST 2000 -.\" by Yuichi SATO -.\" Updated & Modified Tue Apr 24 21:49:43 JST 2001 -.\" by Yuichi SATO -.\" Updated & Modified Sat Jan 5 22:25:30 JST 2002 by Yuichi SATO +.\"******************************************************************* .\" -.\"WORD: configuration 設定 -.\"WORD: terminal 端末 -.\"WORD: orphan 孤立 -.\"WORD: caret キャレット +.\" This file was generated with po4a. Translate the source file. .\" -.TH DIR_COLORS 5 2001-12-26 "GNU" "Linux User Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH DIR_COLORS 5 2001\-12\-26 GNU "Linux User Manual" .SH 名前 -.\"O dir_colors \- configuration file for dircolors(1) dir_colors \- dircolors(1) の設定ファイル -.\"O .SH DESCRIPTION .SH 説明 -.\"O The program -.\"O .BR ls (1) -.\"O uses the environment variable -.\"O .B LS_COLORS -.\"O to determine the colors in which the filenames are to be displayed. -プログラム -.BR ls (1) -は、環境変数 -.B LS_COLORS -を使い、ファイル名を何色で表示するかを決定する。 -.\"O This environment variable is usually set by a command like -.\"O -.\"O .RS -.\"O eval \`dircolors some_path/dir_colors\` -.\"O .RE -.\"O -.\"O found in a system default shell initialization file, like -.\"O .I /etc/profile -.\"O or -.\"O .IR /etc/csh.cshrc . -.\"O (See also -.\"O .BR dircolors (1).) -この環境変数は、通常 +プログラム \fBls\fP(1) は、環境変数 \fBLS_COLORS\fP を使い、ファイル名を何色で表示するかを決定する。 この環境変数は、通常 .RS eval \`dircolors some_path/dir_colors\` .RE -のようなコマンドで設定される。 -このコマンドは -.I /etc/profile -や -.I /etc/csh.cshrc -といったシステムのシェル初期化ファイルにある。 -.RB ( dircolors (1) -を参照すること。) -.\"O Usually, the file used here is -.\"O .I /etc/DIR_COLORS -.\"O and can be overridden by a -.\"O .I .dir_colors -.\"O file in one's home directory. -通常、ここで使われるファイルは -.I /etc/DIR_COLORS -であるが、ホームディレクトリの -.I .dir_colors -ファイルで上書きすることができる。 +のようなコマンドで設定される。 このコマンドは \fI/etc/profile\fP や \fI/etc/csh.cshrc\fP +といったシステムのシェル初期化ファイルにある。 (\fBdircolors\fP(1) を参照すること。) 通常、ここで使われるファイルは +\fI/etc/DIR_COLORS\fP であるが、ホームディレクトリの \fI.dir_colors\fP ファイルで上書きすることができる。 .PP -.\"O This configuration file consists of several statements, one per line. -.\"O Anything right of a hash mark (#) is treated as a comment, if the -.\"O hash mark is at the beginning of a line or is preceded by at least one -.\"O whitespace. -.\"O Blank lines are ignored. -設定ファイルは 1 行毎に書かれたステートメントで構成される。 -ハッシュマーク (#) が行の始めにある場合や、 -ハッシュマークの前に少なくとも 1 つの空白がある場合、 -ハッシュマークの後ろはコメントとして扱われる。 -空行は無視される。 +設定ファイルは 1 行毎に書かれたステートメントで構成される。 ハッシュマーク (#) が行の始めにある場合や、 ハッシュマークの前に少なくとも 1 +つの空白がある場合、 ハッシュマークの後ろはコメントとして扱われる。 空行は無視される。 .PP -.\"O The -.\"O .I global -.\"O section of the file consists of any statement before the first -.\"O .B TERM -.\"O statement. -.\"O Any statement in the global section of the file is -.\"O considered valid for all terminal types. -.\"O Following the global section -.\"O is one or more -.\"O .I terminal-specific -.\"O sections, preceded by one or more -.\"O .B TERM -.\"O statements which specify the terminal types (as given by the -.\"O .B TERM -.\"O environment variable) the following declarations apply to. -.\"O It is always possible to override a global declaration by a subsequent -.\"O terminal-specific one. -このファイルの -.I グローバル -セクションは、 -最初の -.B TERM -ステートメントより前にある任意のステートメントからなる。 -グローバルセクションにあるステートメントは、 -すべての端末タイプについて有効であるとみなされる。 -グローバルセクションの次には、 -.I 端末固有 -セクションが続く。 -各端末固有セクションの先頭には、1 つ以上の -.B TERM -ステートメントが置かれる。 -.B TERM -ステートメントは、その後に続く宣言が適用される (環境変数 -.B TERM -で与えられる) 端末タイプを指定する。 +このファイルの \fIグローバル\fP セクションは、 最初の \fBTERM\fP ステートメントより前にある任意のステートメントからなる。 +グローバルセクションにあるステートメントは、 すべての端末タイプについて有効であるとみなされる。 グローバルセクションの次には、 \fI端末固有\fP +セクションが続く。 各端末固有セクションの先頭には、1 つ以上の \fBTERM\fP ステートメントが置かれる。 \fBTERM\fP +ステートメントは、その後に続く宣言が適用される (環境変数 \fBTERM\fP で与えられる) 端末タイプを指定する。 グローバル宣言をその後に続く端末固有の宣言で上書きすることが常に可能である。 .PP -.\"O The following statements are recognized; case is insignificant: 次のステートメントが認識される。大文字と小文字は区別されない。 -.TP -.B TERM \fIterminal-type\fR -.\"O Starts a terminal-specific section and specifies which terminal it -.\"O applies to. -.\"O Multiple -.\"O .B TERM -.\"O statements can be used to create a section which applies for several -.\"O terminal types. -端末固有セクションを開始し、どの端末に適用するかを指定する。 -複数の端末タイプに適用するため、複数の -.B TERM -ステートメントを使うことができる。 -.TP -.B COLOR yes|all|no|none|tty -.\"O (Slackware only; ignored by GNU -.\"O .BR dircolors (1).) -(Slackware のみ; GNU -.BR dircolors (1) -では無視される。) -.\"O Specifies that colorization should always be enabled (\fIyes\fR or -.\"O \fIall\fR), never enabled (\fIno\fR or \fInone\fR), or enabled only if -.\"O the output is a terminal (\fItty\fR). -.\"O The default is \fIno\fR. -カラー表示を常に有効にするのか (\fIyes\fR または \fIall\fR)、 -常に無効にするのか (\fIno\fR または \fInone\fR)、 -出力先が端末の場合にのみ有効にするのか (\fItty\fR) を指定する。 -デフォルトは \fIno\fR である。 -.TP -.B EIGHTBIT yes|no -.\"O (Slackware only; ignored by GNU -.\"O .BR dircolors (1).) -(Slackware のみ; GNU -.BR dircolors (1) -では無視される。) -.\"O Specifies that eight-bit ISO 8859 characters should be enabled by -.\"O default. -.\"O For compatibility reasons, this can also be specified as 1 for -.\"O \fIyes\fR or 0 for \fIno\fR. -.\"O The default is \fIno\fR. -デフォルトで 8 ビットの ISO 8859 文字を有効にするかを指定する。 -互換性のため、1 で \fIyes\fR を、0 で \fIno\fR を指定することができる。 -デフォルトは \fIno\fR である。 -.TP -.B OPTIONS \fIoptions\fR -.\"O (Slackware only; ignored by GNU -.\"O .BR dircolors (1).) -(Slackware のみ; GNU -.BR dircolors (1) -では無視される。) -.\"O Adds command-line options to the default -.\"O .B ls -.\"O command line. -.\"O The options can be any valid -.\"O .B ls -.\"O command-line options, and should include the leading minus sign. -.\"O Note that -.\"O .B dircolors -.\"O does not verify the validity of these options. -コマンドラインオプションをデフォルトの -.B ls -コマンドラインに追加する。 -このオプションには、すべての有効な -.B ls -のコマンドラインオプションを指定できる。 -オプションの前にはマイナス記号を置かなければならない。 -.B dircolors -がオプションの有効性を検証しない点に注意すること。 -.TP -.B NORMAL \fIcolor-sequence\fR -.\"O Specifies the color used for normal (nonfilename) text. +.TP +\fBTERM \fP\fIterminal\-type\fP +端末固有セクションを開始し、どの端末に適用するかを指定する。 複数の端末タイプに適用するため、複数の \fBTERM\fP ステートメントを使うことができる。 +.TP +\fBCOLOR yes|all|no|none|tty\fP +(Slackware のみ; GNU \fBdircolors\fP(1) では無視される。) カラー表示を常に有効にするのか (\fIyes\fP または +\fIall\fP)、 常に無効にするのか (\fIno\fP または \fInone\fP)、 出力先が端末の場合にのみ有効にするのか (\fItty\fP) を指定する。 +デフォルトは \fIno\fP である。 +.TP +\fBEIGHTBIT yes|no\fP +(Slackware のみ; GNU \fBdircolors\fP(1) では無視される。) デフォルトで 8 ビットの ISO 8859 +文字を有効にするかを指定する。 互換性のため、1 で \fIyes\fP を、0 で \fIno\fP を指定することができる。 デフォルトは \fIno\fP である。 +.TP +\fBOPTIONS \fP\fIoptions\fP +(Slackware のみ; GNU \fBdircolors\fP(1) では無視される。) コマンドラインオプションをデフォルトの \fBls\fP +コマンドラインに追加する。 このオプションには、すべての有効な \fBls\fP のコマンドラインオプションを指定できる。 +オプションの前にはマイナス記号を置かなければならない。 \fBdircolors\fP がオプションの有効性を検証しない点に注意すること。 +.TP +\fBNORMAL \fP\fIcolor\-sequence\fP (ファイル名でない) 通常のテキストに使われる色を指定する。 -.TP -.B FILE \fIcolor-sequence\fR -.\"O Specifies the color used for a regular file. +.TP +\fBFILE \fP\fIcolor\-sequence\fP 通常のファイルに使われる色を指定する。 -.TP -.B DIR \fIcolor-sequence\fR -.\"O Specifies the color used for directories. +.TP +\fBDIR \fP\fIcolor\-sequence\fP ディレクトリに使われる色を指定する。 -.TP -.B LINK \fIcolor-sequence\fR -.\"O Specifies the color used for a symbolic link. +.TP +\fBLINK \fP\fIcolor\-sequence\fP シンボリックリンクに使われる色を指定する。 -.TP -.B ORPHAN \fIcolor-sequence\fR -.\"O Specifies the color used for an orphaned symbolic link (one which -.\"O points to a nonexistent file). -.\"O If this is unspecified, -.\"O .B ls -.\"O will use the -.\"O .B LINK -.\"O color instead. -孤立した (存在しないファイルを指している) -シンボリックリンクに使われる色を指定する。 -指定されない場合、 -.B ls -は -.B LINK -の色を代わりに使う。 -.TP -.B MISSING \fIcolor-sequence\fR -.\"O Specifies the color used for a missing file (a nonexistent file which -.\"O nevertheless has a symbolic link pointing to it). -.\"O If this is unspecified, -.\"O .B ls -.\"O will use the -.\"O .B FILE -.\"O color instead. -行方不明のファイル (存在しないにもかかわらず -シンボリックリンクが指しているファイル) に使われる色を指定する。 -指定されない場合、 -.B ls -は -.B FILE +.TP +\fBORPHAN \fP\fIcolor\-sequence\fP +孤立した (存在しないファイルを指している) シンボリックリンクに使われる色を指定する。 指定されない場合、 \fBls\fP は \fBLINK\fP の色を代わりに使う。 -.TP -.B FIFO \fIcolor-sequence\fR -.\"O Specifies the color used for a FIFO (named pipe). +.TP +\fBMISSING \fP\fIcolor\-sequence\fP +行方不明のファイル (存在しないにもかかわらず シンボリックリンクが指しているファイル) に使われる色を指定する。 指定されない場合、 \fBls\fP は +\fBFILE\fP の色を代わりに使う。 +.TP +\fBFIFO \fP\fIcolor\-sequence\fP FIFO (名前付きパイプ) に使われる色を指定する。 -.TP -.B SOCK \fIcolor-sequence\fR -.\"O Specifies the color used for a socket. +.TP +\fBSOCK \fP\fIcolor\-sequence\fP ソケットに使われる色を指定する。 -.TP -.B DOOR \fIcolor-sequence\fR -.\"O (Supported since fileutils 4.1) -.\"O Specifies the color used for a door (Solaris 2.5 and later). -(fileutils 4.1 以降でサポートされる) -door (Solaris 2.5 以降) で使われる色を指定する。 -.TP -.B BLK \fIcolor-sequence\fR -.\"O Specifies the color used for a block device special file. +.TP +\fBDOOR \fP\fIcolor\-sequence\fP +(fileutils 4.1 以降でサポートされる) door (Solaris 2.5 以降) で使われる色を指定する。 +.TP +\fBBLK \fP\fIcolor\-sequence\fP ブロックデバイススペシャルファイルに使われる色を指定する。 -.TP -.B CHR \fIcolor-sequence\fR -.\"O Specifies the color used for a character device special file. +.TP +\fBCHR \fP\fIcolor\-sequence\fP キャラクターデバイススペシャルファイルに使われる色を指定する。 -.TP -.B EXEC \fIcolor-sequence\fR -.\"O Specifies the color used for a file with the executable attribute set. +.TP +\fBEXEC \fP\fIcolor\-sequence\fP 実行属性が設定されているファイルに使われる色を設定する。 -.TP -.B LEFTCODE \fIcolor-sequence\fR -.\"O Specifies the -.\"O .I "left code" -.\"O for non-ISO\ 6429 terminals (see below). -ISO\ 6429 端末 (下記参照) 以外で -.I "left code" -に使われる色を指定する。 -.TP -.B RIGHTCODE \fIcolor-sequence\fR -.\"O Specifies the -.\"O .I "right code" -.\"O for non-ISO\ 6429 terminals (see below). -ISO\ 6429 端末 (下記参照) 以外で -.I "right code" -に使われる色を指定する。 -.TP -.B ENDCODE \fIcolor-sequence\fR -.\"O Specifies the -.\"O .I "end code" -.\"O for non-ISO\ 6429 terminals (see below). -ISO\ 6429 端末 (下記参照) 以外で -.I "end code" -に使われる色を指定する。 -.TP -\fB*\fIextension\fR \fIcolor-sequence\fR -.\"O Specifies the color used for any file that ends in \fIextension\fR. -\fIextension\fR で終るすべてのファイルに使われる色を指定する。 -.TP -\fB .\fIextension\fR \fIcolor-sequence\fR -.\"O Same as \fB*\fR.\fIextension\fR. -.\"O Specifies the color used for any file that -.\"O ends in .\fIextension\fR. -.\"O Note that the period is included in the -.\"O extension, which makes it impossible to specify an extension not -.\"O starting with a period, such as -.\"O .B ~ -.\"O for -.\"O .B emacs -.\"O backup files. -.\"O This form should be considered obsolete. -\fB*\fR.\fIextension\fR と同じ。 -\fIextension\fR で終るすべてのファイルに使われる色を指定する。 -ピリオドは拡張子に含まれ、 -.B emacs -のバックアップファイル -.B ~ -のようなピリオドで始まらない拡張子を指定することができない点に注意すること。 +.TP +\fBLEFTCODE \fP\fIcolor\-sequence\fP +ISO\ 6429 端末 (下記参照) 以外で \fIleft code\fP に使われる色を指定する。 +.TP +\fBRIGHTCODE \fP\fIcolor\-sequence\fP +ISO\ 6429 端末 (下記参照) 以外で \fIright code\fP に使われる色を指定する。 +.TP +\fBENDCODE \fP\fIcolor\-sequence\fP +ISO\ 6429 端末 (下記参照) 以外で \fIend code\fP に使われる色を指定する。 +.TP +\fB*\fP\fIextension\fP \fIcolor\-sequence\fP +\fIextension\fP で終るすべてのファイルに使われる色を指定する。 +.TP + \fB.\fP\fIextension\fP \fIcolor\-sequence\fP +\fB*\fP.\fIextension\fP と同じ。 \fIextension\fP で終るすべてのファイルに使われる色を指定する。 ピリオドは拡張子に含まれ、 +\fBemacs\fP のバックアップファイル \fB~\fP のようなピリオドで始まらない拡張子を指定することができない点に注意すること。 この形式は古いものと考えられている。 -.\"O .SS "ISO 6429 (ANSI) Color Sequences" .SS "ISO 6429 (ANSI) カラーシーケンス" -.\"O Most color-capable ASCII terminals today use ISO 6429 (ANSI) color sequences, -.\"O and many common terminals without color capability, including -.\"O .B xterm -.\"O and the widely used and cloned DEC VT100, will recognize ISO 6429 color -.\"O codes and harmlessly eliminate them from the output or emulate them. -.\"O .B ls -.\"O uses ISO 6429 codes by default, assuming colorization is enabled. -.\"O -.\"O ISO 6429 color sequences are composed of sequences of numbers -.\"O separated by semicolons. -.\"O The most common codes are: -最近のカラー表示可能な ASCII 端末の大部分は、 -ISO 6429 (ANSI) カラーシーケンスを用いる。 -.B xterm -や広く使われている DEC VT100 クローンを含む -カラー表示できない一般的な端末の多くは、 -ISO 6429 カラーコードを認識し、出力から実害なく削除するか、エミュレートする。 -.B ls -は、カラー表示が有効であることを仮定し、ISO 6429 コードをデフォルトで使う。 +最近のカラー表示可能な ASCII 端末の大部分は、 ISO 6429 (ANSI) カラーシーケンスを用いる。 \fBxterm\fP や広く使われている +DEC VT100 クローンを含む カラー表示できない一般的な端末の多くは、 ISO 6429 +カラーコードを認識し、出力から実害なく削除するか、エミュレートする。 \fBls\fP は、カラー表示が有効であることを仮定し、ISO 6429 +コードをデフォルトで使う。 -ISO 6429 カラーシーケンスは、セミコロンで区切られた数字のシーケンスで作られる。 -最も一般的なコードを示す。 +ISO 6429 カラーシーケンスは、セミコロンで区切られた数字のシーケンスで作られる。 最も一般的なコードを示す。 .sp .RS +.2i .ta 1.0i .nf -.\"O 0 to restore default color -.\"O 1 for brighter colors -.\"O 4 for underlined text -.\"O 5 for flashing text -.\"O 30 for black foreground -.\"O 31 for red foreground -.\"O 32 for green foreground -.\"O 33 for yellow (or brown) foreground -.\"O 34 for blue foreground -.\"O 35 for purple foreground -.\"O 36 for cyan foreground -.\"O 37 for white (or gray) foreground -.\"O 40 for black background -.\"O 41 for red background -.\"O 42 for green background -.\"O 43 for yellow (or brown) background -.\"O 44 for blue background -.\"O 45 for purple background -.\"O 46 for cyan background -.\"O 47 for white (or gray) background 0 デフォルトカラーを保存 1 明るい色 4 アンダーラインされたテキスト @@ -386,247 +143,90 @@ ISO 6429 カラーシーケンスは、セミコロンで区切られた数字 .fi .RE .sp -.\"O Not all commands will work on all systems or display devices. システムと表示デバイスによっては、動作しないコマンドもある。 .PP -.\"O .B ls -.\"O uses the following defaults: -.B ls -は以下をデフォルトとして使う。 +\fBls\fP は以下をデフォルトとして使う。 .sp .RS +.2i .ta 1.0i 2.5i .nf -.\"O \fBNORMAL\fR 0 Normal (nonfilename) text -.\"O \fBFILE\fR 0 Regular file -.\"O \fBDIR\fR 32 Directory -.\"O \fBLINK\fR 36 Symbolic link -.\"O \fBORPHAN\fR undefined Orphaned symbolic link -.\"O \fBMISSING\fR undefined Missing file -.\"O \fBFIFO\fR 31 Named pipe (FIFO) -.\"O \fBSOCK\fR 33 Socket -.\"O \fBBLK\fR 44;37 Block device -.\"O \fBCHR\fR 44;37 Character device -.\"O \fBEXEC\fR 35 Executable file -\fBNORMAL\fR 0 (ファイル名でない) 通常のテキスト -\fBFILE\fR 0 通常のファイル -\fBDIR\fR 32 ディレクトリ -\fBLINK\fR 36 シンボリックリンク -\fBORPHAN\fR 未定義 孤立したシンボリックリンク -\fBMISSING\fR 未定義 行方不明のファイル -\fBFIFO\fR 31 名前付きパイプ (FIFO) -\fBSOCK\fR 33 ソケット -\fBBLK\fR 44;37 ブロックデバイス -\fBCHR\fR 44;37 キャラクターデバイス -\fBEXEC\fR 35 実行ファイル +\fBNORMAL\fP 0 (ファイル名でない) 通常のテキスト +\fBFILE\fP 0 通常のファイル +\fBDIR\fP 32 ディレクトリ +\fBLINK\fP 36 シンボリックリンク +\fBORPHAN\fP 未定義 孤立したシンボリックリンク +\fBMISSING\fP 未定義 行方不明のファイル +\fBFIFO\fP 31 名前付きパイプ (FIFO) +\fBSOCK\fP 33 ソケット +\fBBLK\fP 44;37 ブロックデバイス +\fBCHR\fP 44;37 キャラクターデバイス +\fBEXEC\fP 35 実行ファイル .fi .RE .sp -.\"O A few terminal programs do not recognize the default -.\"O properly. -.\"O If all text gets colorized after you do a directory -.\"O listing, change the -.\"O .B NORMAL -.\"O and -.\"O .B FILE -.\"O codes to the numerical codes for your normal foreground and background -.\"O colors. -デフォルトの設定を完全に認識できない端末プログラムも少数存在する。 -ディレクトリをリストした後にすべてのテキストがカラー表示されたなら、 -.B NORMAL -と -.B FILE -のコードを通常の前景色と背景色のための数値コードに変更すること。 -.\"O .SS "Other Terminal Types (Advanced Configuration)" +デフォルトの設定を完全に認識できない端末プログラムも少数存在する。 ディレクトリをリストした後にすべてのテキストがカラー表示されたなら、 +\fBNORMAL\fP と \fBFILE\fP のコードを通常の前景色と背景色のための数値コードに変更すること。 .SS "その他の端末タイプ (高度な設定)" -.\"O If you have a color-capable (or otherwise highlighting) terminal (or -.\"O printer!) which uses a different set of codes, you can still generate -.\"O a suitable setup. -.\"O To do so, you will have to use the -.\"O .BR LEFTCODE , -.\"O .BR RIGHTCODE , -.\"O and -.\"O .B ENDCODE -.\"O definitions. -カラー表示可能 (またはハイライト表示可能) だが、 -異なるコードセットを使う端末 (あるいはプリンター!) を持っている場合でも、 -それに適した設定を作ることができる。 -そのためには、 -.BR LEFTCODE , -.BR RIGHTCODE , -.B ENDCODE -定義を使う必要がある。 +カラー表示可能 (またはハイライト表示可能) だが、 異なるコードセットを使う端末 (あるいはプリンター!) を持っている場合でも、 +それに適した設定を作ることができる。 そのためには、 \fBLEFTCODE\fP, \fBRIGHTCODE\fP, \fBENDCODE\fP 定義を使う必要がある。 .PP -.\"O When writing out a filename, -.\"O .B ls -.\"O generates the following output sequence: -.\"O .B LEFTCODE -.\"O .I typecode -.\"O .B RIGHTCODE -.\"O .I filename -.\"O .BR ENDCODE , -.\"O where the -.\"O .I typecode -.\"O is the color sequence that depends on the type or name of file. -.\"O If the -.\"O .B ENDCODE -.\"O is undefined, the sequence -.\"O .B "LEFTCODE NORMAL RIGHTCODE" -.\"O will be used instead. -.\"O The purpose of the left- and rightcodes is -.\"O merely to reduce the amount of typing necessary (and to hide ugly -.\"O escape codes away from the user). -.\"O If they are not appropriate for -.\"O your terminal, you can eliminate them by specifying the respective -.\"O keyword on a line by itself. -ファイル名を出力する場合、 -.B ls -は " -.B LEFTCODE -.I typecode -.B RIGHTCODE -.I filename -.B ENDCODE -" という出力シーケンスを生成する。 -ここで、 -.I typecode -はファイルのタイプや名前に依存したカラーシーケンスである。 -.B ENDCODE -が未定義の場合、シーケンス -.B "LEFTCODE NORMAL RIGHTCODE" -が代わりに使われる。 -leftcode と rightcode の目的は、単に必要な打ち込む回数を減らす -(さらに、見苦しいエスケープコードをユーザーに隠す) ことにある。 -シーケンスがその端末にとって適切でない場合、 -行内のそれぞれのキーワード自身を指定して削除することができる。 +ファイル名を出力する場合、 \fBls\fP は " \fBLEFTCODE\fP \fItypecode\fP \fBRIGHTCODE\fP \fIfilename\fP +\fBENDCODE\fP " という出力シーケンスを生成する。 ここで、 \fItypecode\fP はファイルのタイプや名前に依存したカラーシーケンスである。 +\fBENDCODE\fP が未定義の場合、シーケンス \fBLEFTCODE NORMAL RIGHTCODE\fP が代わりに使われる。 leftcode と +rightcode の目的は、単に必要な打ち込む回数を減らす (さらに、見苦しいエスケープコードをユーザーに隠す) ことにある。 +シーケンスがその端末にとって適切でない場合、 行内のそれぞれのキーワード自身を指定して削除することができる。 .PP -.\"O .B NOTE: -.\"O If the -.\"O .B ENDCODE -.\"O is defined in the global section of the setup file, it -.\"O .I cannot -.\"O be undefined in a terminal-specific section of the file. -.\"O This means any -.\"O .B NORMAL -.\"O definition will have no effect. -.\"O A different -.\"O .B ENDCODE -.\"O can, however, be specified, which would have the same effect. -.B 注意: -.B ENDCODE -が設定ファイルのグローバルセクションで定義されている場合、 -ファイルの端末固有セクションで未定義にすることは -.IR できない 。 -これは、 -.B NORMAL -の定義が何も影響を及ぼさないことを意味する。 -しかし、異なった -.B ENDCODE +\fB注意:\fP \fBENDCODE\fP が設定ファイルのグローバルセクションで定義されている場合、 ファイルの端末固有セクションで未定義にすることは +\fIできない\fP。 これは、 \fBNORMAL\fP の定義が何も影響を及ぼさないことを意味する。 しかし、異なった \fBENDCODE\fP を指定することで同じ効果を得ることができる。 -.\"O .SS "Escape Sequences" .SS エスケープシーケンス -.\"O To specify control- or blank characters in the color sequences or -.\"O filename extensions, either C-style \e-escaped notation or -.\"O .BR stty \-style -.\"O ^-notation can be used. -.\"O The C-style notation -.\"O includes the following characters: -カラーシーケンスやファイル名の拡張子で制御文字やブランク文字を指定するために、 -C 言語スタイルの \e エスケープ表記と -.B stty -スタイルの ^ 表記の両方を使うことができる。 -C 言語スタイルの表記には以下の文字が含まれる。 +カラーシーケンスやファイル名の拡張子で制御文字やブランク文字を指定するために、 C 言語スタイルの \e エスケープ表記と \fBstty\fP スタイルの +^ 表記の両方を使うことができる。 C 言語スタイルの表記には以下の文字が含まれる。 .sp .RS +.2i .ta 1.0i .nf -.\"O \fB\ea\fR Bell (ASCII 7) -.\"O \fB\eb\fR Backspace (ASCII 8) -.\"O \fB\ee\fR Escape (ASCII 27) -.\"O \fB\ef\fR Form feed (ASCII 12) -.\"O \fB\en\fR Newline (ASCII 10) -.\"O \fB\er\fR Carriage Return (ASCII 13) -.\"O \fB\et\fR Tab (ASCII 9) -.\"O \fB\ev\fR Vertical Tab (ASCII 11) -.\"O \fB\e?\fR Delete (ASCII 127) -.\"O \fB\e\fInnn\fR Any character (octal notation) -.\"O \fB\ex\fInnn\fR Any character (hexadecimal notation) -.\"O \fB\e_\fR Space -.\"O .\"O \fB\e\e\fR Backslash (\e) -.\"O \fB\e^\fR Caret (^) -.\"O \fB\e#\fR Hash mark (#) -\fB\ea\fR ベル (ASCII 7) -\fB\eb\fR バックスペース (ASCII 8) -\fB\ee\fR エスケープ (ASCII 27) -\fB\ef\fR フォームフィード (ASCII 12) -\fB\en\fR 改行 (ASCII 10) -\fB\er\fR キャリッジリターン (ASCII 13) -\fB\et\fR タブ (ASCII 9) -\fB\ev\fR 垂直タブ (ASCII 11) -\fB\e?\fR デリート (ASCII 127) -\fB\e\fInnn\fR (8 進数表記の) 任意の文字 -\fB\ex\fInnn\fR (16 進数表記の) 任意の文字 -\fB\e_\fR スペース -\fB\e\e\fR バックスラッシュ (\e) -\fB\e^\fR キャレット (^) -\fB\e#\fR ハッシュマーク (#) +\fB\ea\fP ベル (ASCII 7) +\fB\eb\fP バックスペース (ASCII 8) +\fB\ee\fP エスケープ (ASCII 27) +\fB\ef\fP フォームフィード (ASCII 12) +\fB\en\fP 改行 (ASCII 10) +\fB\er\fP キャリッジリターン (ASCII 13) +\fB\et\fP タブ (ASCII 9) +\fB\ev\fP 垂直タブ (ASCII 11) +\fB\e?\fP デリート (ASCII 127) +\fB\e\fP\fInnn\fP (8 進数表記の) 任意の文字 +\fB\ex\fP\fInnn\fP (16 進数表記の) 任意の文字 +\fB\e_\fP スペース +\fB\e\e\fP バックスラッシュ (\e) +\fB\e^\fP キャレット (^) +\fB\e#\fP ハッシュマーク (#) .fi .RE .sp -.\"O Please note that escapes are necessary to enter a space, backslash, -.\"O caret, or any control character anywhere in the string, as well as a -.\"O hash mark as the first character. -ハッシュマークを始めの文字として入力するときと同様に、 -スペース・バックスラッシュ・キャレット・制御文字を文字列の任意の部分に +ハッシュマークを始めの文字として入力するときと同様に、 スペース・バックスラッシュ・キャレット・制御文字を文字列の任意の部分に 入力するためには、エスケープが必要であることに注意すること。 -.\"O .SH FILES .SH ファイル -.TP -.I /etc/DIR_COLORS -.\"O System-wide configuration file. +.TP +\fI/etc/DIR_COLORS\fP システム全体の設定ファイル。 -.TP -.I ~/.dir_colors -.\"O Per-user configuration file. +.TP +\fI~/.dir_colors\fP ユーザー毎の設定ファイル。 -.\"O .SH NOTES -.SH 注意 -.\"O This page describes the -.\"O .B dir_colors -.\"O file format as used in the fileutils-4.1 package; -.\"O other versions may differ slightly. -このページは fileutils-4.1 パッケージで使われている -.B dir_colors -のファイル形式について説明している。 -その他のバージョンでは少し違いがあるかも知れない。 .PP -.\"O The default -.\"O .B LEFTCODE -.\"O and -.\"O .B RIGHTCODE -.\"O definitions, which are used by ISO 6429 terminals are: -ISO 6429 端末で使われる -.B LEFTCODE -と -.B RIGHTCODE -のデフォルトの定義は、次のようになっている。 +このページは fileutils\-4.1 パッケージで使われている \fBdir_colors\fP のファイル形式について説明している。 +その他のバージョンでは少し違いがあるかも知れない。 +.SH 注意 +ISO 6429 端末で使われる \fBLEFTCODE\fP と \fBRIGHTCODE\fP のデフォルトの定義は、次のようになっている。 .sp .RS +.2i .ta 1.0i .nf -\fBLEFTCODE\fR \ee[ -\fBRIGHTCODE\fR m +\fBLEFTCODE\fP \ee[ +\fBRIGHTCODE\fP m .fi .RE .sp -.\"O The default -.\"O .B ENDCODE -.\"O is undefined. -.B ENDCODE -のデフォルトは定義されていない。 -.\"O .SH "SEE ALSO" +\fBENDCODE\fP のデフォルトは定義されていない。 .SH 関連項目 -.BR dircolors (1), -.BR ls (1), -.BR stty (1), -.BR xterm (1) +\fBdircolors\fP(1), \fBls\fP(1), \fBstty\fP(1), \fBxterm\fP(1) diff --git a/draft/man5/elf.5 b/draft/man5/elf.5 deleted file mode 100644 index ec8b4fd3..00000000 --- a/draft/man5/elf.5 +++ /dev/null @@ -1,2879 +0,0 @@ -.\" $OpenBSD: elf.5,v 1.12 2003/10/27 20:23:58 jmc Exp $ -.\"Copyright (c) 1999 Jeroen Ruigrok van der Werven -.\"All rights reserved. -.\" -.\"Redistribution and use in source and binary forms, with or without -.\"modification, are permitted provided that the following conditions -.\"are met: -.\"1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\"2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\"THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\"ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\"IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\"ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\"FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\"DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\"OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\"HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\"LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\"OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\"SUCH DAMAGE. -.\" -.\" $FreeBSD: src/share/man/man5/elf.5,v 1.21 2001/10/01 16:09:23 ru Exp $ -.\" -.\" Slightly adapted - aeb, 2004-01-01 -.\" 2005-07-15, Mike Frysinger , various fixes -.\" 2007-10-11, Mike Frysinger , various fixes -.\" 2007-12-08, mtk, Converted from mdoc to man macros -.\" -.\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO -.\" all rights reserved. -.\" Translated Thu Dec 16 02:17:58 JST 2004 -.\" by Yuichi SATO -.\" Updated & Modified Sat Sep 10 02:29:40 JST 2005 by Yuichi SATO -.\" Updated 2008-02-12, Akihiro MOTOKI , LDP v2.77 -.\" -.TH ELF 5 2007-12-28 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O elf \- format of Executable and Linking Format (ELF) files -.SH 名前 -elf \- 実行可能リンクフォーマット (ELF) ファイルのフォーマット -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.\" .B #include -.B #include -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The header file -.\"O .I -.\"O defines the format of ELF executable binary files. -ヘッダファイル -.I -は ELF 実行可能バイナリファイルのフォーマットを定義する。 -.\"O Amongst these files are -.\"O normal executable files, relocatable object files, core files and shared -.\"O libraries. -これらのファイルとしては、通常の実行可能ファイル・ -再配置可能オブジェクトファイル・コアファイル・共有ライブラリがある。 -.PP -.\"O An executable file using the ELF file format consists of an ELF header, -.\"O followed by a program header table or a section header table, or both. -ELF ファイルフォーマットを使う実行可能ファイルは、 -ELF ヘッダの後にプログラムヘッダテーブルまたは -セクションヘッダテーブル (またはその両方) が続く構成である。 -.\"O The ELF header is always at offset zero of the file. -ELF ヘッダは常にファイルのオフセット 0 にある。 -.\"O The program header -.\"O table and the section header table's offset in the file are defined in the -.\"O ELF header. -プログラムヘッダテーブルとセクションヘッダテーブルの -ファイル内でのオフセットは、ELF ヘッダに定義されている。 -.\"O The two tables describe the rest of the particularities of -.\"O the file. -この 2 つのテーブルはファイルの残りの部分の詳細を記述する。 -.PP -.\"O .\" Applications which wish to process ELF binary files for their native -.\"O .\" architecture only should include -.\"O .\" .I -.\"O .\" in their source code. -.\" ネイティブなアーキテクチャの ELF バイナリファイルを処理したい -.\" アプリケーションは、ソースコードに -.\" .I -.\" を含めるだけでよい。 -.\"O .\" These applications should need to refer to -.\"O .\" all the types and structures by their generic names -.\"O .\" "Elf_xxx" -.\"O .\" and to the macros by -.\"O .\" "ELF_xxx". -.\" これらのアプリケーションは、ジェネリック名 -.\" all the types and structures by their generic names -.\" "Elf_xxx" -.\" によって全ての型と構造体を参照したり、 -.\" "ELF_xxx" -.\" によってマクロを参照したりするすべきである。 -.\"O .\" Applications written this way can be compiled on any architecture, -.\"O .\" regardless of whether the host is 32-bit or 64-bit. -.\" このようにして書かれたアプリケーションは、 -.\" ホストが 32 ビットか 64 ビットかに関わらず、 -.\" どのアーキテクチャ上でもコンパイルできる。 -.\" .PP -.\"O .\" Should an application need to process ELF files of an unknown -.\"O .\" architecture, then the application needs to explicitly use either -.\"O .\" "Elf32_xxx" -.\"O .\" or -.\"O .\" "Elf64_xxx" -.\"O .\" type and structure names. -.\" アプリケーションが未知のアーキテクチャの ELF ファイルを -.\" 処理する必要がある場合、そのアプリケーションは明示的に -.\" "Elf32_xxx" -.\" または -.\" "Elf64_xxx" -.\" という型名と構造体名を使う必要がある。 -.\"O .\" Likewise, the macros need to be identified by -.\"O .\" "ELF32_xxx" -.\"O .\" or -.\"O .\" "ELF64_xxx". -.\" 同様に、マクロは -.\" "ELF32_xxx" -.\" または -.\" "ELF64_xxx" -.\" で識別される必要がある。 -.\" .PP -.\"O This header file describes the above mentioned headers as C structures -.\"O and also includes structures for dynamic sections, relocation sections and -.\"O symbol tables. -このヘッダファイルは上記のヘッダを C 言語の構造体で記述し、 -また動的セクション・再配置可能セクション・シンボルテーブルの構造体も -含んでいる。 -.PP -.\"O The following types are used for N-bit architectures (N=32,64, -.\"O .I ElfN -.\"O stands for -.\"O .I Elf32 -.\"O or -.\"O .IR Elf64 , -.\"O .I uintN_t -.\"O stands for -.\"O .I uint32_t -.\"O or -.\"O .IR uint64_t ): -以下の型は N ビットアーキテクチャで使われる (N=32,64 であり -.I ElfN -は -.I Elf32 -または -.I Elf64 -を表し、 -.I uintN_t -は -.I uint32_t -または -.I uint64_t -を表す): -.in +4n -.nf - -.\"O ElfN_Addr Unsigned program address, uintN_t -ElfN_Addr 符号なしのプログラムアドレス, uintN_t -.\"O ElfN_Off Unsigned file offset, uintN_t -ElfN_Off 符号なしのファイルオフセット, uintN_t -.\"O ElfN_Section Unsigned section index, uint16_t -ElfN_Section 符号なしのセクションインデックス, uint16_t -.\"O ElfN_Versym Unsigned version symbol information, uint16_t -ElfN_Versym 符号なしのバージョンシンボル情報, uint16_t -Elf_Byte unsigned char -ElfN_Half uint16_t -ElfN_Sword int32_t -ElfN_Word uint32_t -ElfN_Sxword int64_t -ElfN_Xword uint64_t -.\"O .\" Elf32_Size Unsigned object size -.\" Elf32_Size 符号なしのオブジェクトサイズ -.fi -.in -.PP -.\"O (Note: The *BSD terminology is a bit different. -.\"O There -.\"O .I Elf64_Half -.\"O is -.\"O twice as large as -.\"O .IR Elf32_Half , -.\"O and -.\"O .I Elf64Quarter -.\"O is used for -.\"O .IR uint16_t . -.\"O In order to avoid confusion these types are replaced by explicit ones -.\"O in the below.) -(注意: *BSD での用語は少し異なる。 -.I Elf64_Half -は -.I Elf32_Half -の 2 倍であり、 -.I Elf64Quarter -が -.I uint16_t -に用いられる。 -混乱を避けるため、以下では、これらの型はサイズが自明な型に置き換えてある。) -.PP -.\"O All data structures that the file format defines follow the -.\"O "natural" -.\"O size and alignment guidelines for the relevant class. -このファイルフォーマットが定義する全てのデータ構造体は、 -関連するクラスの -"自然な" -サイズと配置の指針に従う。 -.\"O If necessary, -.\"O data structures contain explicit padding to ensure 4-byte alignment -.\"O for 4-byte objects, to force structure sizes to a multiple of 4, etc. -必要な場合、データ構造体では明示的なパディング (padding, 詰め込み) -が行なわれる。これは 4 バイトオブジェクトに対する -4 バイト配置を保証するためや、 -構造体のサイズを 4 の倍数にするためなどである。 -.PP -.\"O The ELF header is described by the type -.\"O .I Elf32_Ehdr -.\"O or -.\"O .IR Elf64_Ehdr : -ELF ヘッダは型 -.I Elf32_Ehdr -または -.I Elf64_Ehdr -で記述される: -.in +4n -.nf - -#define EI_NIDENT 16 - -typedef struct { - unsigned char e_ident[EI_NIDENT]; - uint16_t e_type; - uint16_t e_machine; - uint32_t e_version; - ElfN_Addr e_entry; - ElfN_Off e_phoff; - ElfN_Off e_shoff; - uint32_t e_flags; - uint16_t e_ehsize; - uint16_t e_phentsize; - uint16_t e_phnum; - uint16_t e_shentsize; - uint16_t e_shnum; - uint16_t e_shstrndx; -} ElfN_Ehdr; -.fi -.in -.PP -.\"O The fields have the following meanings: -フィールドは以下の意味を持つ: -.\" .Bl -tag -width "e_phentsize" -.TP 12 -.IR e_ident -.\"O This array of bytes specifies to interpret the file, -.\"O independent of the processor or the file's remaining contents. -このバイト配列は、プロセッサやファイルの他の部分には依存せずに、 -ファイルを解釈 (interpret) するために指定される。 -.\"O Within this array everything is named by macros, which start with -.\"O the prefix -.\"O .BR EI_ -.\"O and may contain values which start with the prefix -.\"O .BR ELF . -この配列内のすべてのものは、接頭辞 -.BR EI_ -で始まるマクロの名前が付き、接頭辞 -.BR ELF -で始まる値を持つ。 -.\"O The following macros are defined: -以下のマクロが定義されている: -.RS 12 -.\" .Bl -tag -width "EI_VERSION" \" EI_ABIVERSION -.TP 12 -.BR EI_MAG0 -.\"O The first byte of the magic number. -.\"O It must be filled with -.\"O .BR ELFMAG0 . -マジックナンバーの第 1 バイト。 -.BR ELFMAG0 -で埋めなければならない。 -(0: 0x7f) -.TP -.BR EI_MAG1 -.\"O The second byte of the magic number. -.\"O It must be filled with -.\"O .BR ELFMAG1 . -マジックナンバーの第 2 バイト。 -.BR ELFMAG1 -で埋めなければならない。 -(1: \(aqE\(aq) -.TP -.BR EI_MAG2 -.\"O The third byte of the magic number. -.\"O It must be filled with -.\"O .BR ELFMAG2 . -マジックナンバーの第 3 バイト。 -.BR ELFMAG2 -で埋めなければならない。 -(2: \(aqL\(aq) -.TP -.BR EI_MAG3 -.\"O The fourth byte of the magic number. -.\"O It must be filled with -.\"O .BR ELFMAG3 . -マジックナンバーの第 4 バイト。 -.BR ELFMAG3 -で埋めなければならない。 -(3: \(aqF\(aq) -.TP -.BR EI_CLASS -.\"O The fifth byte identifies the architecture for this binary: -第 5 バイトは、このバイナリのアーキテクチャを示す: -.RS 12 -.\" .Bl -tag -width "ELFCLASSNONE" -compact -.TP 14 -.PD 0 -.BR ELFCLASSNONE -.\"O This class is invalid. -このクラスは不正である。 -.TP -.BR ELFCLASS32 -.\"O This defines the 32-bit architecture. -32 ビットアーキテクチャを定義する。 -.\"O It supports machines with files -.\"O and virtual address spaces up to 4 Gigabytes. -ファイルと仮想アドレス空間が 4 ギガバイトまでのマシンをサポートする。 -.TP -.BR ELFCLASS64 -.\"O This defines the 64-bit architecture. -64 ビットアーキテクチャを定義する。 -.PD -.RE -.\" .El -.TP -.BR EI_DATA -.\"O The sixth byte specifies the data encoding of the processor-specific -.\"O data in the file. -.\"O Currently these encodings are supported: -第 6 バイトはファイル内のプロセッサ固有データの -データエンコーディングを指定する。 -現在のところ以下のエンコーディングがサポートされている: -.\" .Bl -tag -width "ELFDATA2LSB" -compact -.RS 12 -.TP 14 -.PD 0 -.BR ELFDATANONE -.\"O Unknown data format. -不明なデータフォーマット。 -.TP -.BR ELFDATA2LSB -.\"O Two's complement, little-endian. -2 の補数、リトルエンディアン。 -.TP -.BR ELFDATA2MSB -.\"O Two's complement, big-endian. -2 の補数、ビッグエンディアン。 -.PD -.RE -.\" .El -.TP -.PD 0 -.BR EI_VERSION -.\"O The version number of the ELF specification: -ELF 仕様のバージョン番号: -.\" .Bl -tag -width "EV_CURRENT" -compact -.RS 12 -.TP 14 -.BR EV_NONE -.\"O Invalid version. -不正なバージョン。 -.TP -.BR EV_CURRENT -.\"O Current version. -現在のバージョン。 -.PD -.RE -.\".El -.TP -.BR EI_OSABI -.\"O This byte identifies the operating system -.\"O and ABI to which the object is targeted. -このバイトはオブジェクトのターゲットとなる -オペレーティングシステムと ABI を示す。 -.\"O Some fields in other ELF structures have flags -.\"O and values that have platform-specific meanings; -他の ELF 構造体のフィールドには、 -プラットフォーム固有の意味を持つフラグや値を持つものもある; -.\"O the interpretation of those fields is determined by the value of this byte. -.\"O E.g.: -これらのフィールドの解釈は、このバイトの値によって決定される。 -例えば: -.\" .Bl -tag -width "ELFOSABI_STANDALONE" -compact -.RS 12 -.TP 20 -.PD 0 -.BR ELFOSABI_NONE -.\"O Same as ELFOSABI_SYSV -ELFOSABI_SYSV と同じ。 -.\" 0 -.TP -.BR ELFOSABI_SYSV -UNIX System V ABI. -.\" 0 -.\" synonym: ELFOSABI_NONE -.TP -.BR ELFOSABI_HPUX -HP-UX ABI. -.\" 1 -.TP -.BR ELFOSABI_NETBSD -NetBSD ABI. -.\" 2 -.TP -.BR ELFOSABI_LINUX -Linux ABI. -.\" 3 -.\" .TP -.\" .BR ELFOSABI_HURD -.\" Hurd ABI. -.\" 4 -.\" .TP -.\" .BR ELFOSABI_86OPEN -.\" 86Open Common IA32 ABI. -.\" 5 -.TP -.BR ELFOSABI_SOLARIS -Solaris ABI. -.\" 6 -.\" .It Dv ELFOSABI_MONTEREY -.\" Monterey project ABI. -.\"O Now replaced by -.\" ELFOSABI_AIX -.\" 7 -.TP -.BR ELFOSABI_IRIX -IRIX ABI. -.\" 8 -.TP -.BR ELFOSABI_FREEBSD -FreeBSD ABI. -.\" 9 -.TP -.BR ELFOSABI_TRU64 -TRU64 UNIX ABI. -.\" 10 -.\" ELFOSABI_MODESTO -.\" 11 -.\" ELFOSABI_OPENBSD -.\" 12 -.TP -.BR ELFOSABI_ARM -.\"O ARM architecture ABI. -ARM アーキテクチャ ABI. -.\" 97 -.TP -.BR ELFOSABI_STANDALONE -.\"O Stand-alone (embedded) ABI. -スタンドアロン (組み込み) ABI. -.\" 255 -.\" .El -.PD -.RE -.TP -.BR EI_ABIVERSION -.\"O This byte identifies the version of the ABI -.\"O to which the object is targeted. -このバイトはオブジェクトがターゲットとしている ABI のバージョンを示す。 -.\"O This field is used to distinguish among incompatible versions of an ABI. -このフィールドは互換性のない ABI のバージョンを区別するために使われる。 -.\"O The interpretation of this version number -.\"O is dependent on the ABI identified by the -.\"O .B EI_OSABI -.\"O field. -このバージョン番号の解釈は、 -.B EI_OSABI -フィールドで識別される ABI に依存する。 -.\"O Applications conforming to this specification use the value 0. -この仕様に準拠するアプリケーションは、値 0 を使う。 -.TP -.BR EI_PAD -.\"O Start of padding. -.\"O These bytes are reserved and set to zero. -.\"O Programs -.\"O which read them should ignore them. -.\"O The value for -.\"O .B EI_PAD -.\"O will change in -.\"O the future if currently unused bytes are given meanings. -パディングの開始。 -これらのバイトは予約されており、0 に設定されている。 -これらを読み込むプログラムは、これらのバイトを無視すべきである。 -現在使われていないバイトに意味が与えられる場合、 -.B EI_PAD -の値は将来変更されるかもしれない。 -.TP -.BR EI_BRAND -.\"O Start of architecture identification. -アーキテクチャ ID の開始。 -.TP -.BR EI_NIDENT -.\"O The size of the -.\"O .I e_ident -.\"O array. -.I e_ident -配列のサイズ。 -.\" .El -.RE -.TP -.IR e_type -.\"O This member of the structure identifies the object file type: -この構造体のメンバはオブジェクトファイルタイプを示す: -.RS 12 -.\" .Bl -tag -width "ET_NONE" -compact -.TP 12 -.PD 0 -.BR ET_NONE -.\"O An unknown type. -不明なタイプ。 -.TP -.BR ET_REL -.\"O A relocatable file. -再配置可能ファイル。 -.TP -.BR ET_EXEC -.\"O An executable file. -実行可能ファイル。 -.TP -.BR ET_DYN -.\"O A shared object. -共有オブジェクト。 -.TP -.BR ET_CORE -.\"O A core file. -コアファイル。 -.PD -.RE -.\" .El -.TP -.IR e_machine -.\"O This member specifies the required architecture for an individual file. -.\"O E.g.: -このメンバは個々のファイルに必要とされるアーキテクチャを指定する。 -例: -.RS 12 -.\" .Bl -tag -width "EM_MIPS_RS4_BE" -compact -.TP 12 -.PD 0 -.BR EM_NONE -.\"O An unknown machine. -不明なマシン。 -.\" 0 -.TP -.BR EM_M32 -AT&T WE 32100. -.\" 1 -.TP -.BR EM_SPARC -Sun Microsystems SPARC. -.\" 2 -.TP -.BR EM_386 -Intel 80386. -.\" 3 -.TP -.BR EM_68K -Motorola 68000. -.\" 4 -.TP -.BR EM_88K -Motorola 88000. -.\" 5 -.\" .It Dv EM_486 -.\" Intel 80486. -.\" 6 -.TP -.BR EM_860 -Intel 80860. -.\" 7 -.TP -.BR EM_MIPS -.\"O MIPS RS3000 (big-endian only). -MIPS RS3000 (ビッグエンディアンのみ)。 -.\" 8 -.\" EM_S370 -.\" 9 -.\" .It Dv EM_MIPS_RS4_BE -.\"O .\" MIPS RS4000 (big-endian only). Deprecated. -.\" MIPS RS4000 (ビッグエンディアンのみ)。非推奨。 -.\" 10 -.\"O .\" EM_MIPS_RS3_LE (MIPS R3000 little-endian) -.\" EM_MIPS_RS3_LE (MIPS R3000 リトルエンディアン)。 -.\" 10 -.TP -.BR EM_PARISC -HP/PA. -.\" 15 -.TP -.BR EM_SPARC32PLUS -.\"O SPARC with enhanced instruction set. -拡張命令セット付き SPARC。 -.\" 18 -.TP -.BR EM_PPC -PowerPC. -.\" 20 -.TP -.BR EM_PPC64 -PowerPC 64-bit. -.\" 21 -.TP -.BR EM_S390 -IBM S/390 -.\" 22 -.TP -.BR EM_ARM -Advanced RISC Machines -.\" 40 -.TP -.BR EM_SH -Renesas SuperH -.\" 42 -.TP -.BR EM_SPARCV9 -SPARC v9 64-bit. -.\" 43 -.TP -.BR EM_IA_64 -Intel Itanium -.\" 50 -.TP -.BR EM_X86_64 -AMD x86-64 -.\" 62 -.TP -.BR EM_VAX -DEC Vax. -.\" 75 -.\" EM_CRIS -.\" 76 -.\" .It Dv EM_ALPHA -.\" Compaq [DEC] Alpha. -.\" .It Dv EM_ALPHA_EXP -.\"O .\" Compaq [DEC] Alpha with enhanced instruction set. -.\" 拡張命令セット付き Compaq [DEC] Alpha。 -.PD -.RE -.\" .El -.TP -.IR e_version -.\"O This member identifies the file version: -このメンバはファイルバージョンを示す: -.\" .Bl -tag -width "EV_CURRENT" -compact -.RS 12 -.TP 12 -.PD 0 -.BR EV_NONE -.\"O Invalid version. -不正なバージョン。 -.TP -.BR EV_CURRENT -.\"O Current version. -現在のバージョン。 -.\" .El -.PD -.RE -.TP -.IR e_entry -.\"O This member gives the virtual address to which the system first transfers -.\"O control, thus starting the process. -このメンバは、システムが最初に制御を渡す、 -つまりプロセスを開始する仮想アドレスを指定する。 -.\"O If the file has no associated entry -.\"O point, this member holds zero. -ファイルにエントリポイントが関連付けられていない場合、 -このメンバには 0 が入る。 -.TP -.IR e_phoff -.\"O This member holds the program header table's file offset in bytes. -.\"O If -.\"O the file has no program header table, this member holds zero. -このメンバはプログラムヘッダテーブルの -ファイルオフセット (バイト単位) を保持する。 -ファイルにプログラムヘッダテーブルがない場合、 -このメンバには 0 が入る。 -.TP -.IR e_shoff -.\"O This member holds the section header table's file offset in bytes. -.\"O If the -.\"O file has no section header table this member holds zero. -このメンバはセクションヘッダテーブルの -ファイルオフセット (バイト単位) を保持する。 -ファイルにセクションヘッダテーブルがない場合、 -このメンバには 0 が入る。 -.TP -.IR e_flags -.\"O This member holds processor-specific flags associated with the file. -.\"O Flag names take the form EF_`machine_flag'. -.\"O Currently no flags have been defined. -このメンバはファイルに関連付けられたプロセッサ固有のフラグを保持する。 -フラグの名前は EF_`machine_flag' という形式である。 -現在のところフラグは定義されていない。 -.TP -.IR e_ehsize -.\"O This member holds the ELF header's size in bytes. -このメンバは ELF ヘッダサイズ (バイト単位) を保持する。 -.TP -.IR e_phentsize -.\"O This member holds the size in bytes of one entry in the file's program header -.\"O table; all entries are the same size. -このメンバはこのファイルのプログラムヘッダテーブルの -1 エントリあたりのサイズ (バイト単位) を保持する; -全てのエントリは同じサイズである。 -.TP -.IR e_phnum -.\"O This member holds the number of entries in the program header -.\"O table. -このメンバはプログラムヘッダテーブルにあるエントリの数を保持する。 -.\"O Thus the product of -.\"O .IR e_phentsize -.\"O and -.\"O .IR e_phnum -.\"O gives the table's size -.\"O in bytes. -よって -.IR e_phentsize -と -.IR e_phnum -の積がテーブルサイズ (バイト単位) になる。 -.\"O If a file has no program header, -.\"O .IR e_phnum -.\"O holds the value zero. -ファイルにプログラムヘッダがない場合、 -.IR e_phnum -は値 0 を保持する。 -.TP -.IR e_shentsize -.\"O This member holds a sections header's size in bytes. -.\"O A section header is one -.\"O entry in the section header table; all entries are the same size. -このメンバはセクションヘッダのサイズ (バイト単位) を保持する。 -セクションヘッダはセクションヘッダテーブルの 1 つのエントリである; -全てのエントリは同じサイズである。 -.TP -.IR e_shnum -.\"O This member holds the number of entries in the section header table. -このメンバはセクションヘッダテーブルにあるエントリの数を保持する。 -.\"O Thus -.\"O the product of -.\"O .IR e_shentsize -.\"O and -.\"O .IR e_shnum -.\"O gives the section header table's size in bytes. -よって -.IR e_shentsize -と -.IR e_shnum -の積はセクションヘッダテーブルのサイズ (バイト単位) になる。 -.\"O If a file has no section -.\"O header table, -.\"O .IR e_shnum -.\"O holds the value of zero. -ファイルにセクションヘッダテーブルがない場合、 -.IR e_shnum -は値 0 を保持する。 -.TP -.IR e_shstrndx -.\"O This member holds the section header table index of the entry associated -.\"O with the section name string table. -このメンバはセクション名文字列テーブルに関連付けられたエントリの -セクションヘッダテーブルインデックスを保持する。 -.\"O If the file has no section name string -.\"O table, this member holds the value -.\"O .BR SHN_UNDEF . -ファイルにセクション名文字列テーブルがない場合、 -このメンバは値 -.BR SHN_UNDEF -を保持する。 -.BR SHN_UNDEF . -.RS 12 -.\" .Bl -tag -width "SHN_LORESERVE" -.TP 14 -.BR SHN_UNDEF -.\"O This value marks an undefined, missing, irrelevant, or otherwise meaningless -.\"O section reference. -この値は未定義・存在しない・無関係その他、 -意味のないセクションの参照であることを表す。 -.\"O For example, a symbol -.\"O "defined" -.\"O relative to section number -.\"O .BR SHN_UNDEF -.\"O is an undefined symbol. -例えば、セクション番号 -.BR SHN_UNDEF -に関連づけて「定義」されたシンボルは、「未定義」なシンボルである。 -.\"nakano ここの "defined" は通常の文の一部では? -.TP -.BR SHN_LORESERVE -.\"O This value specifies the lower bound of the range of reserved indices. -この値は予約済みのインデックス範囲の下限を指定する。 -.TP -.BR SHN_LOPROC -.\"O Values greater than or equal to -.\"O .BR SHN_HIPROC -.\"O are reserved for processor-specific semantics. -この値以上で -.BR SHN_HIPROC -以下の値は、プロセッサ固有の意味に予約されている。 -.TP -.BR SHN_HIPROC -.\"O Values less than or equal to -.\"O .BR SHN_LOPROC -.\"O are reserved for processor-specific semantics. -この値以下で -.BR SHN_LOPROC -以上の値は、プロセッサ固有の意味に予約されている。 -.\"sato: SHN_{HI,LO}PROC の説明は、原文の間違いらしい。 -.TP -.BR SHN_ABS -.\"O This value specifies absolute values for the corresponding reference. -.\"O For -.\"O example, symbols defined relative to section number -.\"O .BR SHN_ABS -.\"O have absolute values and are not affected by relocation. -この値は対応する参照の絶対値を指定する。 -例えば、セクション番号 -.BR SHN_ABS -に関連づけられたシンボルは絶対値を保持し、再配置に影響されない。 -.TP -.BR SHN_COMMON -.\"O Symbols defined relative to this section are common symbols, such as Fortran -.\"O COMMON or unallocated C external variables. -このセクションに関連して定義されたシンボルは、 -Fortran の COMMON や C の未割り当て external 変数のような、 -共通シンボルである。 -.TP -.BR SHN_HIRESERVE -.\"O This value specifies the upper bound of the range of reserved -.\"O indices between -.\"O .BR SHN_LORESERVE -.\"O and -.\"O .BR SHN_HIRESERVE , -.\"O inclusive; the values do -.\"O not reference the section header table. -この値は予約されたインデックスの範囲の上限を指定する。 -.BR SHN_LORESERVE -と -.BR SHN_HIRESERVE -は含まれる。 -この値はセクションヘッダテーブルを参照しない。 -.\"O That is, the section header table -.\"O does -.\"O .I not -.\"O contain entries for the reserved indices. -つまり、セクションヘッダテーブルは -予約されたインデックスのエントリを -.I 含まない 。 -.RE -.\" .El -.\" .El -.PP -.\"O An executable or shared object file's program header table is an array of -.\"O structures, each describing a segment or other information the system needs -.\"O to prepare the program for execution. -実行可能ファイルまたは共有オブジェクトファイルのプログラムヘッダテーブルは、 -システムによるプログラム実行準備に必要な、 -セグメント等の情報を記述する構造体の配列である。 -.\"O An object file -.\"O .IR segment -.\"O contains one or more -.\"O .IR sections . -オブジェクトファイルの -.IR セグメント -には 1 つ以上の -.IR セクション -が含まれる。 -.\"O Program headers are meaningful only for executable and shared object files. -プログラムヘッダは実行可能ファイルと共有オブジェクトファイルでのみ意味を持つ。 -.\"O A file specifies its own program header size with the ELF header's -.\"O .IR e_phentsize -.\"O and -.\"O .IR e_phnum -.\"O members. -ファイルは自身のプログラムヘッダサイズを ELF ヘッダの -.IR e_phentsize -メンバと -.IR e_phnum -メンバで指定する。 -.\"O The ELF program header is described by the type -.\"O .I Elf32_Phdr -.\"O or -.\"O .I Elf64_Phdr -.\"O depending on the architecture: -ELF プログラムヘッダは -.I Elf32_Phdr -型または -.I Elf64_Phdr -型で記述される -(どちらになるかはアーキテクチャ依存): -.in +4n -.nf - -typedef struct { - uint32_t p_type; - Elf32_Off p_offset; - Elf32_Addr p_vaddr; - Elf32_Addr p_paddr; - uint32_t p_filesz; - uint32_t p_memsz; - uint32_t p_flags; - uint32_t p_align; -} Elf32_Phdr; -.fi -.in -.in +4n -.nf - -typedef struct { - uint32_t p_type; - uint32_t p_flags; - Elf64_Off p_offset; - Elf64_Addr p_vaddr; - Elf64_Addr p_paddr; - uint64_t p_filesz; - uint64_t p_memsz; - uint64_t p_align; -} Elf64_Phdr; -.fi -.in -.PP -.\"O The main difference between the 32-bit and the 64-bit program header lies -.\"O in the location of the -.\"O .IR p_flags -.\"O member in the total struct. -32 ビットと 64 ビットのプログラムヘッダの主な違いは、構造体における -.IR p_flags -メンバの位置にある。 -.\" .Bl -tag -width "p_offset" -.TP 12 -.IR p_type -.\"O This member of the Phdr struct tells what kind of segment this array -.\"O element describes or how to interpret the array element's information. -Phdr 構造体のこのメンバは、 -この配列要素がどのような種類のセグメントを記述しているか、 -またはこの配列要素の情報をどのように解釈するか、を表す。 -.\" .Bl -tag -width "PT_DYNAMIC" -.RS 12 -.TP 12 -.BR PT_NULL -.\"O The array element is unused and the other members' values are undefined. -.\"O This lets the program header have ignored entries. -この配列要素は使用されておらず、その他のメンバの値は未定義である。 -これにより、このプログラムヘッダのエントリは無視される。 -.TP -.BR PT_LOAD -.\"O The array element specifies a loadable segment, described by -.\"O .IR p_filesz -.\"O and -.\"O .IR p_memsz . -この配列要素は -.IR p_filesz -と -.IR p_memsz -で記述されるロード可能セグメントを指定する。 -.\"O The bytes from the file are mapped to the beginning of the memory -.\"O segment. -このファイルからのバイトデータが、このメモリセグメントの先頭からマップされる。 -.\"Osato: -.\"Osato: この訳は自身なし。少し意訳気味かもしれない。 -.\"Osato: -.\"O If the segment's memory size -.\"O .IR Sy p_memsz -.\"O is larger than the file size -.\"O .IR Sy p_filesz , -.\"O the -.\"O "extra" -.\"O bytes are defined to hold the value 0 and to follow the segment's -.\"O initialized area. -セグメントのメモリサイズ -.IR Sy p_memsz -がファイルサイズ -.IR Sy p_filesz -より大きい場合、 -「余った」バイトは値 0 となり、 -そのセグメント初期化データの後ろに置かれると定められている。 -.\"O The file size may not be larger than the memory size. -ファイルサイズはメモリサイズより大きくてはいけない。 -.\"O Loadable segment entries in the program header table appear in ascending -.\"O order, sorted on the -.\"O .IR p_vaddr -.\"O member. -プログラムヘッダテーブルのロード可能セグメントエントリは、 -.IR p_vaddr -メンバの昇順にソートされて出現する。 -.TP -.BR PT_DYNAMIC -.\"O The array element specifies dynamic linking information. -この配列要素は動的リンク情報を指定する。 -.TP -.BR PT_INTERP -.\"O The array element specifies the location and size of a null-terminated -.\"O pathname to invoke as an interpreter. -この配列要素は、インタプリタとして起動されるパス名 (NULL 文字終端) -の位置とサイズを指定する。 -.\"O This segment type is meaningful -.\"O only for executable files (though it may occur for shared objects). -このセグメント型は (共有オブジェクトにもあるかも知れないが) -実行可能ファイルでのみ意味を持つ。 -.\"O However it may not occur more than once in a file. -ただし、このセグメント型は 1 つのファイルに 2 回以上出現してはならない。 -.\"O If it is present, it must precede any loadable segment entry. -もし存在する場合、このセグメント型は -全てのロード可能セグメントエントリより前になければならない。 -.TP -.BR PT_NOTE -.\"O The array element specifies the location and size for auxiliary information. -この配列要素は補足情報 (auxiliary information) の位置とサイズを指定する。 -.TP -.BR PT_SHLIB -.\"O This segment type is reserved but has unspecified semantics. -.\"O Programs that -.\"O contain an array element of this type do not conform to the ABI. -このセグメント型は予約されているが、意味は指定されていない。 -この型の配列要素を保持するプログラムは ABI に準拠しない。 -.TP -.BR PT_PHDR -.\"O The array element, if present, specifies the location and size of the program -.\"O header table itself, both in the file and in the memory image of the program. -この配列要素は、もし存在しているならば、 -ファイルおよびプログラムのメモリイメージ双方における -プログラムヘッダテーブル自身の位置とサイズを指定する。 -.\"O This segment type may not occur more than once in a file. -このセグメント型は 1 つのファイルに 2 回以上出現してはならない。 -.\"O Moreover, it may -.\"O only occur if the program header table is part of the memory image of the -.\"O program. -さらに、このセグメント型が存在してもよいのは、プログラムヘッダテーブルが -プログラムのメモリイメージの一部である場合のみである。 -.\"O If it is present, it must precede any loadable segment entry. -もし存在する場合、これは全てのロード可能セグメントエントリより -前になければならない。 -.TP -.BR PT_LOPROC -.\"O Values greater than or equal to -.\"O .BR PT_HIPROC -.\"O are reserved for processor-specific semantics. -この値以上で -.BR PT_HIPROC -以下の値はプロセッサ固有の意味に予約されている。 -.TP -.BR PT_HIPROC -.\"O Values less than or equal to -.\"O .BR PT_LOPROC -.\"O are reserved for processor-specific semantics. -この値以下で -.BR PT_LOPROC -以上の値はプロセッサ固有の意味に予約されている。 -.\"sato: PT_{HI,LO}PROC の説明は、原文の間違いらしい。 -.TP -.BR PT_GNU_STACK -.\"O GNU extension which is used by the Linux kernel to control the state of the -.\"O stack via the flags set in the -.\"O .IR p_flags -.\"O member. -GNU 拡張であり、Linux カーネルが -.I p_flags -のメンバーにセットされたフラグ経由でスタックの状態を制御するために使用する。 -.\" .El -.RE -.TP -.IR p_offset -.\"O This member holds the offset from the beginning of the file at which -.\"O the first byte of the segment resides. -このメンバは、セグメントの先頭バイトがある -(ファイル先頭からの) オフセットを保持する。 -.TP -.IR p_vaddr -.\"O This member holds the virtual address at which the first byte of the -.\"O segment resides in memory. -このメンバは、セグメントの先頭バイトがある -メモリの仮想アドレスを保持する。 -.TP -.IR p_paddr -.\"O On systems for which physical addressing is relevant, this member is -.\"O reserved for the segment's physical address. -物理アドレスが意味をもつシステムでは、 -このメンバはセグメントの物理アドレスとして予約されている。 -.\"O Under -.\"O BSD -.\"O this member is -.\"O not used and must be zero. -BSD ではこのメンバは使用されない。0 でなければならない。 -.TP -.IR p_filesz -.\"O This member holds the number of bytes in the file image of the segment. -.\"O It may be zero. -このメンバはセグメントのファイルイメージのバイト数を保持する。 -これは 0 でもよい。 -.TP -.IR p_memsz -.\"O This member holds the number of bytes in the memory image of the segment. -.\"O It may be zero. -このメンバはセグメントのメモリイメージのバイト数を保持する。 -これは 0 でもよい。 -.TP -.IR p_flags -.\"O This member holds a bitmask of flags relevant to the segment: -このメンバはセグメントに関連するフラグのビットマップを保持する: -.\" .Bl -tag -width "PF_X" -compact -.RS 12 -.TP -.PD 0 -.BR PF_X -.\"O An executable segment. -実行可能セグメント。 -.TP -.BR PF_W -.\"O A writable segment. -書き込み可能セグメント. -.TP -.BR PF_R -.\"O A readable segment. -読み込み可能セグメント。 -.PD -.RE -.\" .El -.IP -.\"O A text segment commonly has the flags -.\"O .BR PF_X -.\"O and -.\"O .BR PF_R . -テキストセグメントは一般にフラグ -.BR PF_X -と -.BR PF_R -を持つ。 -.\"O A data segment commonly has -.\"O .BR PF_X , -.\"O .BR PF_W -.\"O and -.\"O .BR PF_R . -データセグメントは一般に -.BR PF_X , -.BR PF_W , -.BR PF_R -を持つ。 -.TP -.IR p_align -.\"O This member holds the value to which the segments are aligned in memory -.\"O and in the file. -このメンバは、セグメントがメモリおよびファイルにおいて配置 (align) -される値を保持する。 -.\"nakano align の定訳はありましたっけ? -.\"O Loadable process segments must have congruent values for -.\"O .IR p_vaddr -.\"O and -.\"O .IR p_offset , -.\"O modulo the page size. -ロード可能プロセスセグメントは、ページサイズを法として -.IR p_vaddr -と -.IR p_offset -と合同でなければならない -(訳注:「p_vaddr mod ページサイズ = p_offset mod ページサイズ」 -でなければならない)。。 -.\"nakano こういう場合は普通 congruent "with" だけど… -.\"O Values of zero and one mean no alignment is required. -0 と 1 という値は配置が必要ないことを意味する。 -.\"O Otherwise, -.\"O .IR p_align -.\"O should be a positive, integral power of two, and -.\"O .IR p_vaddr -.\"O should equal -.\"O .IR p_offset , -.\"O modulo -.\"O .IR p_align . -それ以外の場合、 -.IR p_align -は正で 2 の整数乗でなければならず、 -.IR p_vaddr -は -.IR p_align -を法として -.IR p_offset -と合同でなければならない -(訳注:「p_vaddr mod p_align = p_offset mod p_align」でなければならない)。 -.\" .El -.PP -.\"O A file's section header table lets one locate all the file's sections. -ファイルのセクションヘッダテーブルには、 -全てのファイルセクションの場所が記述されている。 -.\"Osato: -.\"Osato: let が訳しづらいので意訳気味にする。 -.\"Osato: -.\"O The -.\"O section header table is an array of -.\"O .I Elf32_Shdr -.\"O or -.\"O .I Elf64_Shdr -.\"O structures. -セクションヘッダテーブルは -.I Elf32_Shdr -構造体または -.I Elf64_Shdr -構造体の配列である。 -.\"O The -.\"O ELF header's -.\"O .IR e_shoff -.\"O member gives the byte offset from the beginning of the file to the section -.\"O header table. -ELF ヘッダの -.IR e_shoff -メンバはファイルの先頭から -セクションヘッダテーブルへのバイトオフセットである。 -.\"O .IR e_shnum -.\"O holds the number of entries the section header table contains. -.\"O .IR e_shentsize -.\"O holds the size in bytes of each entry. -.IR e_shnum -はセクションヘッダテーブルに含まれるエントリの数を保持する。 -.IR e_shentsize -は各エントリのサイズ (バイト単位) を保持する。 -.PP -.\"O A section header table index is a subscript into this array. -.\"O Some section -.\"O header table indices are reserved. -.\"O An object file does not have sections for -.\"O these special indices: -セクションヘッダテーブルインデックスは、この配列の要素を指定する。 -いくつかのセクションヘッダテーブルインデックスは予約されている。 -オブジェクトファイルは、これらの特別なインデックスに対応する -セクションを持たない: -.\" .Bl -tag -width "SHN_LORESERVE" -.TP 14 -.BR SHN_UNDEF -.\"O This value marks an undefined, missing, irrelevant or otherwise meaningless -.\"O section reference. -この値は未定義・不明・無関係・無意味なセクション参照の印となる。 -.TP -.BR SHN_LORESERVE -.\"O This value specifies the lower bound of the range of reserved indices. -この値は予約済みのインデックス領域の下限を指定する。 -.TP -.BR SHN_LOPROC -.\"O Values greater than or equal to -.\"O .BR SHN_HIPROC -.\"O are reserved for processor-specific semantics. -この値以上で -.BR SHN_HIPROC -以下の値はプロセッサ固有の意味に予約されている。 -.TP -.BR SHN_HIPROC -.\"O Values less than or equal to -.\"O .BR SHN_LOPROC -.\"O are reserved for processor-specific semantics. -この値以下で -.BR SHN_HIPROC -以上の値はプロセッサ固有の意味に予約されている。 -.\"sato: SHN_{HI,LO}PROC の説明は、原文の間違いらしい。 -.TP -.BR SHN_ABS -.\"O This value specifies the absolute value for the corresponding reference. -この値は対応する参照の絶対値を指定する。 -.\"O For -.\"O example, a symbol defined relative to section number -.\"O .BR SHN_ABS -.\"O has an absolute value and is not affected by relocation. -例えば、セクション番号 -.BR SHN_ABS -に関連して定義されているシンボルは、 -絶対値を保持しているので、再配置に影響されない。 -.\"nakano "relative to" がちょっと訳しにくい。 -.\"nakano 要するに SHN_ABS のセクションには絶対値が store される、 -.\"nakano 後述の SHN_COMMON には global 変数が store される、 -.\"nakano ということなのでしょうが。 -.TP -.BR SHN_COMMON -.\"O Symbols defined relative to this section are common symbols, such as FORTRAN -.\"O COMMON or unallocated C external variables. -このセクションに関連して定義されているシンボルは、 -FORTRAN の COMMON や C の未割り当て外部変数のような共通シンボルである。 -.TP -.BR SHN_HIRESERVE -.\"O This value specifies the upper bound of the range of reserved indices. -この値は予約済みのインデックス領域の上限を指定する。 -.\"O The -.\"O system reserves indices between -.\"O .BR SHN_LORESERVE -.\"O and -.\"O .BR SHN_HIRESERVE , -.\"O inclusive. -システムは -.BR SHN_LORESERVE -と -.BR SHN_HIRESERVE -を含む範囲を予約する。 -.\"O The section header table does not contain entries for the -.\"O reserved indices. -セクションヘッダテーブルは予約されたインデックスに対応するエントリを持たない。 -.\" .El -.PP -.\"O The section header has the following structure: -セクションヘッダは以下の構造体を持つ: -.in +4n -.nf - -typedef struct { - uint32_t sh_name; - uint32_t sh_type; - uint32_t sh_flags; - Elf32_Addr sh_addr; - Elf32_Off sh_offset; - uint32_t sh_size; - uint32_t sh_link; - uint32_t sh_info; - uint32_t sh_addralign; - uint32_t sh_entsize; -} Elf32_Shdr; -.fi -.in -.in +4n -.nf - -typedef struct { - uint32_t sh_name; - uint32_t sh_type; - uint64_t sh_flags; - Elf64_Addr sh_addr; - Elf64_Off sh_offset; - uint64_t sh_size; - uint32_t sh_link; - uint32_t sh_info; - uint64_t sh_addralign; - uint64_t sh_entsize; -} Elf64_Shdr; -.fi -.in -.PP -.\"O No real differences exist between the 32-bit and 64-bit section headers. -32 ビットと 64 ビットのセクションヘッダには実際の違いはない。 -.\" .Bl -tag -width "sh_addralign" -.TP 10 -.IR sh_name -.\"O This member specifies the name of the section. -このメンバはセクション名を定める。 -.\"O Its value is an index -.\"O into the section header string table section, giving the location of -.\"O a null-terminated string. -この値はセクションヘッダ文字列テーブルセクションのインデックスであり、 -NULL 文字で終端された文字列の場所を示す。 -.TP -.IR sh_type -.\"O This member categorizes the section's contents and semantics. -このメンバはセクションの内容と意味が含まれるカテゴリを示す。 -.\" .Bl -tag -width "SHT_PROGBITS" -.RS 10 -.TP 15 -.BR SHT_NULL -.\"O This value marks the section header as inactive. -この値はセクションヘッダが不活性であることを示す。 -.\"O It does not -.\"O have an associated section. -これは関連するセクションを持たない。 -.\"O Other members of the section header -.\"O have undefined values. -このセクションヘッダの他のメンバは、未定義の値を持つ。 -.TP -.BR SHT_PROGBITS -.\"O This section holds information defined by the program, whose -.\"O format and meaning are determined solely by the program. -このセクションはプログラムにより定義される情報を保持する。 -この情報の形式と意味は、ひとえにプログラムによって決定される。 -.TP -.BR SHT_SYMTAB -.\"O This section holds a symbol table. -このセクションはシンボルテーブルを保持する。 -.\"O Typically, -.\"O .BR SHT_SYMTAB -.\"O provides symbols for link editing, though it may also be used -.\"O for dynamic linking. -一般には -.BR SHT_SYMTAB -はリンク編集のためのシンボルを提供するが、 -動的リンクにも使われる。 -.\"O As a complete symbol table, it may contain -.\"O many symbols unnecessary for dynamic linking. -完全なシンボルテーブルとして、動的リンクには不要な -多くのシンボルを保持できる。 -.\"O An object file can -.\"O also contain a -.\"O .BR SHT_DYNSYM -.\"O section. -オブジェクトファイルも -.BR SHT_DYNSYM -セクションを持つことができる。 -.TP -.BR SHT_STRTAB -.\"O This section holds a string table. -.\"O An object file may have multiple -.\"O string table sections. -このセクションは文字列テーブルを保持する。 -オブジェクトファイルは複数の文字列テーブルセクションを持つことができる。 -.TP -.BR SHT_RELA -.\"O This section holds relocation entries with explicit addends, such -.\"O as type -.\"O .IR Elf32_Rela -.\"O for the 32-bit class of object files. -このセクションは明示的な加数 (addend) を持つ再配置エントリを保持する。 -再配置エントリの型は、オブジェクトファイルの 32 ビットクラスでは -.IR Elf32_Rela -である。 -.\"O An object may have multiple -.\"O relocation sections. -オブジェクトファイルは複数の再配置セクションを持つことができる。 -.TP -.BR SHT_HASH -.\"O This section holds a symbol hash table. -このセクションはシンボルハッシュテーブルを保持する。 -.\"O An object participating in -.\"O dynamic linking must contain a symbol hash table. -動的リンクされるオブジェクトは、 -シンボルハッシュテーブルを含んでいなければならない。 -.\"O An object file may -.\"O have only one hash table. -オブジェクトファイルは 1 つのハッシュテーブルのみを持つことができる。 -.TP -.BR SHT_DYNAMIC -.\"O This section holds information for dynamic linking. -このセクションは動的リンクの情報を保持する。 -.\"O An object file may -.\"O have only one dynamic section. -オブジェクトファイルは 1 つの動的セクションのみを持つことができる。 -.TP -.BR SHT_NOTE -.\"O This section holds information that marks the file in some way. -このセクションはファイルに何らかの印を付ける情報を保持する。 -.TP -.BR SHT_NOBITS -.\"O A section of this type occupies no space in the file but otherwise -.\"O resembles -.\"O .BR SHT_PROGBITS . -このタイプのセクションはファイルの領域を使わないという以外は、 -.BR SHT_PROGBITS -と似ている。 -.\"O Although this section contains no bytes, the -.\"O .IR sh_offset -.\"O member contains the conceptual file offset. -このセクションは 1 バイトも含まないが、 -.IR sh_offset -メンバは概念的なファイルオフセットを持つ。 -.TP -.BR SHT_REL -.\"O This section holds relocation offsets without explicit addends, such -.\"O as type -.\"O .IR Elf32_Rel -.\"O for the 32-bit class of object files. -このセクションは明示的な加数を持たない再配置オフセットを保持する。 -再配置オフセットの型は、オブジェクトファイルの 32 ビットクラスでは -.IR Elf32_Rel -である。 -.\"O An object file may have multiple -.\"O relocation sections. -オブジェクトファイルは複数の再配置セクションを持つことができる。 -.TP -.BR SHT_SHLIB -.\"O This section is reserved but has unspecified semantics. -このセクションは予約されているが、意味は指定されていない。 -.TP -.BR SHT_DYNSYM -.\"O This section holds a minimal set of dynamic linking symbols. -このセクションは動的リンクシンボルの最小セットを保持する。 -.\"O An -.\"O object file can also contain a -.\"O .BR SHT_SYMTAB -.\"O section. -オブジェクトファイルは -.BR SHT_SYMTAB -セクションも含むことができる。 -.TP -.BR SHT_LOPROC -.\"O This value up to and including -.\"O .BR SHT_HIPROC -.\"O is reserved for processor-specific semantics. -この値以上で -.BR SHT_HIPROC -以下の範囲はプロセッサ固有の意味に予約されている。 -.TP -.BR SHT_HIPROC -.\"O This value down to and including -.\"O .BR SHT_LOPROC -.\"O is reserved for processor-specific semantics. -この値以下で -.BR SHT_LOPROC -以上の範囲はプロセッサ固有の意味に予約されている。 -.TP -.BR SHT_LOUSER -.\"O This value specifies the lower bound of the range of indices reserved for -.\"O application programs. -この値はアプリケーションプログラムのために予約される -インデックス範囲の下限を指定する。 -.TP -.BR SHT_HIUSER -.\"O This value specifies the upper bound of the range of indices reserved for -.\"O application programs. -この値はアプリケーションプログラムのために予約される -インデックス範囲の上限を指定する。 -.\"O Section types between -.\"O .BR SHT_LOUSER -.\"O and -.\"O .BR SHT_HIUSER -.\"O may be used by the application, without conflicting with current or future -.\"O system-defined section types. -.BR SHT_LOUSER -から -.BR SHT_HIUSER -の間のセクションタイプは、 -現在または将来のシステム定義セクションタイプと衝突することなく、 -アプリケーションで使用することができる。 -.\" .El -.RE -.TP -.IR sh_flags -.\"O Sections support one-bit flags that describe miscellaneous attributes. -様々な属性を記述するための 1 ビットのフラグをサポートするセクション。 -.\"O If a flag bit is set in -.\"O .IR sh_flags , -.\"O the attribute is -.\"O "on" -.\"O for the section. -フラグビットが -.IR sh_flags -に設定された場合、そのセクションについての属性は -"オン" -になる。 -.\"O Otherwise, the attribute is -.\"O "off" -.\"O or does not apply. -それ以外の場合、属性が -"オフ" -であるか属性が適用されない。 -.\"O Undefined attributes are set to zero. -未定義の属性は 0 に設定される。 -.\" .Bl -tag -width "SHF_EXECINSTR" -compact -.RS 10 -.TP 15 -.BR SHF_WRITE -.\"O This section contains data that should be writable during process -.\"O execution. -このセクションはプロセス実行中に書き込み可能なデータを含む。 -.TP -.BR SHF_ALLOC -.\"O This section occupies memory during process execution. -このセクションはプロセス実行中にメモリを使用する。 -.\"O Some control -.\"O sections do not reside in the memory image of an object file. -制御セクションの中には、オブジェクトファイルのメモリイメージには -存在しないものもある。 -.\"O This -.\"O attribute is off for those sections. -そうしたセクションの場合、この属性はオフである。 -.TP -.BR SHF_EXECINSTR -.\"O This section contains executable machine instructions. -このセクションは実行可能なマシン命令を含む。 -.TP -.BR SHF_MASKPROC -.\"O All bits included in this mask are reserved for processor-specific -.\"O semantics. -このマスクに含まれる全てのビットはプロセッサ固有の意味に予約されている。 -.RE -.\" .El -.TP -.IR sh_addr -.\"O If this section appears in the memory image of a process, this member -.\"O holds the address at which the section's first byte should reside. -.\"O Otherwise, the member contains zero. -このセクションがプロセスのメモリイメージにある場合、 -このメンバはセクションの最初のバイトが存在するアドレスを保持する。 -それ以外の場合、このメンバは 0 である。 -.TP -.IR sh_offset -.\"O This member's value holds the byte offset from the beginning of the file -.\"O to the first byte in the section. -このメンバの値は、ファイルの先頭からセクションの最初のバイトへの -バイトオフセットを保持する。 -.\"O One section type, -.\"O .BR SHT_NOBITS , -.\"O occupies no space in the file, and its -.\"O .BR sh_offset -.\"O member locates the conceptual placement in the file. -セクションタイプ -.BR SHT_NOBITS -はファイルの領域を全く使用せず、このタイプの -.IR sh_offset -メンバはファイルの概念的な位置を示す。 -.\"nakano conceptual placement とは? -.TP -.IR sh_size -.\"O This member holds the section's size in bytes. -このメンバはセクションのサイズ (バイト単位) を保持する。 -.\"O Unless the section type -.\"O is -.\"O .BR SHT_NOBITS , -.\"O the section occupies -.\"O .IR sh_size -.\"O bytes in the file. -セクションタイプが -.BR SHT_NOBITS -でない限り、そのセクションはファイル中の -.IR sh_size -バイトを使用する。 -.\"O A section of type -.\"O .BR SHT_NOBITS -.\"O may have a nonzero size, but it occupies no space in the file. -タイプが -.BR SHT_NOBITS -のセクションはサイズが 0 でないが、ファイルの領域を使用しない。 -.TP -.IR sh_link -.\"O This member holds a section header table index link, whose interpretation -.\"O depends on the section type. -このメンバは、セクションヘッダテーブルインデックスリンクを保持する。 -この解釈はセクションタイプに依存する。 -.TP -.IR sh_info -.\"O This member holds extra information, whose interpretation depends on the -.\"O section type. -このメンバは追加情報を保持する。 -この解釈はセクションタイプに依存する。 -.TP -.IR sh_addralign -.\"O Some sections have address alignment constraints. -アドレス配置に制約があるセクションもある。 -.\"O If a section holds a -.\"O doubleword, the system must ensure doubleword alignment for the entire -.\"O section. -セクションが倍長語 (doubleword) を保持する場合、 -システムは全てのセクションについて倍長語の配置を保証しなければならない。 -.\"O That is, the value of -.\"O .IR sh_addr -.\"O must be congruent to zero, modulo the value of -.\"O .BR sh_addralign . -つまり、 -.IR sh_addr -の値は -.IR sh_addralign -の値を法として 0 と合同でなければならない -(訳注:「sh_addr mod sh_addralign = 0 でなければならない)。 -.\"O Only zero and positive integral powers of two are allowed. -2 の 0 乗と正の整数乗のみが許可される。 -.\"O Values of zero -.\"O or one mean the section has no alignment constraints. -0 または 1 はセクションの配置に制約がないことを意味する。 -.TP -.IR sh_entsize -.\"O Some sections hold a table of fixed-sized entries, such as a symbol table. -シンボルテーブルのような固定サイズエントリのテーブルを保持する -セクションもある。 -.\"O For such a section, this member gives the size in bytes for each entry. -このようなセクションでは、 -このメンバは各エントリのサイズ (バイト単位) を表す。 -.\"O This member contains zero if the section does not hold a table of -.\"O fixed-size entries. -このメンバが 0 の場合、 -そのセクションは固定サイズエントリのテーブルを保持しない。 -.\" .El -.PP -.\"O Various sections hold program and control information: -さまざまなセクションにプログラム情報・制御情報が保持される: -.\" .Bl -tag -width ".shstrtab" -.TP 10 -.IR .bss -.\"O This section holds uninitialized data that contributes to the program's -.\"O memory image. -.\"Osato: -.\"Osato: contribute がうまく訳せない。 -.\"Osato: -このセクションはプログラムのメモリイメージに配置される -非初期化データを保持する。 -.\"O By definition, the system initializes the data with zeros -.\"O when the program begins to run. -定義上、システムはプログラムの実行開始時に、データを 0 で初期化する。 -.\"O This section is of type -.\"O .BR SHT_NOBITS . -このセクションのタイプは -.BR SHT_NOBITS -である。 -.\"O The attribute types are -.\"O .BR SHF_ALLOC -.\"O and -.\"O .BR SHF_WRITE . -属性タイプは -.BR SHF_ALLOC -と -.BR SHF_WRITE -である。 -.TP -.IR .comment -.\"O This section holds version control information. -このセクションはバージョン制御情報を保持する。 -.\"O This section is of type -.\"O .BR SHT_PROGBITS . -このセクションのタイプは -.BR SHT_PROGBITS -である。 -.\"O No attribute types are used. -属性タイプは使用されない。 -.TP -.IR .ctors -.\"O This section holds initialized pointers to the C++ constructor functions. -このセクションは C++ コンストラクタ関数への初期化されたポインタを保持する。 -.\"O This section is of type -.\"O .BR SHT_PROGBITS . -このセクションのタイプは -.BR SHT_PROGBITS -である。 -.\"O The attribute types are -.\"O .BR SHF_ALLOC -.\"O and -.\"O .BR SHF_WRITE . -属性タイプは -.BR SHF_ALLOC -と -.BR SHF_WRITE -である。 -.TP -.IR .data -.\"O This section holds initialized data that contribute to the program's -.\"O memory image. -このセクションはプログラムのメモリイメージに配置される -初期化済みデータを保持する。 -.\"O This section is of type -.\"O .BR SHT_PROGBITS . -このセクションのタイプは -.BR SHT_PROGBITS -である。 -.\"O The attribute types are -.\"O .BR SHF_ALLOC -.\"O and -.\"O .BR SHF_WRITE . -属性タイプは -.BR SHF_ALLOC -と -.BR SHF_WRITE -である。 -.TP -.IR .data1 -.\"O This section holds initialized data that contribute to the program's -.\"O memory image. -このセクションはプログラムのメモリイメージに配置される -初期化済みデータを保持する。 -.\"O This section is of type -.\"O .BR SHT_PROGBITS . -このセクションのタイプは -.BR SHT_PROGBITS -である。 -.\"O The attribute types are -.\"O .BR SHF_ALLOC -.\"O and -.\"O .BR SHF_WRITE . -属性タイプは -.BR SHF_ALLOC -と -.BR SHF_WRITE -である。 -.TP -.IR .debug -.\"O This section holds information for symbolic debugging. -このセクションはシンボリックデバッグ用の情報を保持する。 -.\"O The contents -.\"O are unspecified. -その内容は指定されていない。 -.\"O This section is of type -.\"O .BR SHT_PROGBITS . -このセクションのタイプは -.BR SHT_PROGBITS -である。 -.\"O No attribute types are used. -属性タイプは使用されない。 -.TP -.IR .dtors -.\"O This section holds initialized pointers to the C++ destructor functions. -このセクションは C++ デストラクタ関数への初期化されたポインタを保持する。 -.\"O This section is of type -.\"O .BR SHT_PROGBITS . -このセクションのタイプは -.BR SHT_PROGBITS -である。 -.\"O The attribute types are -.\"O .BR SHF_ALLOC -.\"O and -.\"O .BR SHF_WRITE . -属性タイプは -.BR SHF_ALLOC -と -.BR SHF_WRITE -である。 -.TP -.IR .dynamic -.\"O This section holds dynamic linking information. -このセクションは動的リンク情報を保持する。 -.\"O The section's attributes -.\"O will include the -.\"O .BR SHF_ALLOC -.\"O bit. -このセクションの属性は -.BR SHF_ALLOC -ビットを含む。 -.\"O Whether the -.\"O .BR SHF_WRITE -.\"O bit is set is processor-specific. -.BR SHF_WRITE -ビットが設定されるか否かはプロセッサによる。 -.\"O This section is of type -.\"O .BR SHT_DYNAMIC . -このセクションのタイプは -.BR SHT_DYNAMIC -である。 -.\"O See the attributes above. -上記の属性を参照すること。 -.TP -.IR .dynstr -.\"O This section holds strings needed for dynamic linking, most commonly -.\"O the strings that represent the names associated with symbol table entries. -このセクションは動的リンクに必要な文字列を保持する。 -最も一般的には、この文字列はシンボルテーブルエントリと -関連づけられた名前を表す。 -.\"O This section is of type -.\"O .BR SHT_STRTAB . -このセクションのタイプは -.BR SHT_STRTAB -である。 -.\"O The attribute type used is -.\"O .BR SHF_ALLOC . -使用される属性タイプは -.BR SHF_ALLOC -である。 -.TP -.IR .dynsym -.\"O This section holds the dynamic linking symbol table. -このセクションは動的リンクシンボルテーブルを保持する。 -.\"O This section is of type -.\"O .BR SHT_DYNSYM . -このセクションのタイプは -.BR SHT_DYNSYM -である。 -.\"O The attribute used is -.\"O .BR SHF_ALLOC . -使用される属性タイプは -.BR SHF_ALLOC -である。 -.TP -.IR .fini -.\"O This section holds executable instructions that contribute to the process -.\"O termination code. -このセクションはプロセス終了コードに置かれる実行可能命令を保持する。 -.\"O When a program exits normally the system arranges to -.\"O execute the code in this section. -プロセスが正常に終了した場合、システムはこのセクションにある -コードを配置して実行する。 -.\"O This section is of type -.\"O .BR SHT_PROGBITS . -このセクションのタイプは -.BR SHT_PROGBITS -である。 -.\"O The attributes used are -.\"O .BR SHF_ALLOC -.\"O and -.\"O .BR SHF_EXECINSTR . -使用される属性タイプは -.BR SHF_ALLOC -と -.BR SHF_EXECINSTR -である。 -.TP -.IR .gnu.version -.\"O This section holds the version symbol table, an array of -.\"O .I ElfN_Half -.\"O elements. -.\"O This section is of type -.\"O .BR SHT_GNU_versym . -.\"O The attribute type used is -.\"O .BR SHF_ALLOC . -このセクションはバージョン・シンボル・テーブルを保持する。 -その内容は -.I ElfN_Half -要素の配列である。 -このセクションのタイプは -.B SHT_GNU_versym -である。 -使用される属性タイプは -.B SHF_ALLOC -である。 -.TP -.IR .gnu.version_d -.\"O This section holds the version symbol definitions, a table of -.\"O .I ElfN_Verdef -.\"O structures. -.\"O This section is of type -.\"O .BR SHT_GNU_verdef . -.\"O The attribute type used is -.\"O .BR SHF_ALLOC . -このセクションはバージョンシンボルの定義を保持する。 -その内容は -.I ElfN_Verdef -構造体のテーブルである。 -このセクションのタイプは -.B SHT_GNU_verdef -である。 -使用される属性タイプは -.B SHF_ALLOC -である。 -.TP -.IR .gnu.version_r -.\"O This section holds the version symbol needed elements, a table of -.\"O .I ElfN_Verneed -.\"O structures. -.\"O This section is of -.\"O type -.\"O .BR SHT_GNU_versym . -.\"O The attribute type used is -.\"O .BR SHF_ALLOC . -このセクションはバージョンシンボルが必要とする要素を保持する。 -その内容は -.I ElfN_Verneed -構造体のテーブルである。 -このセクションのタイプは -.B SHT_GNU_versym -である。 -使用される属性タイプは -.B shf_alloc -である。 -.TP -.IR .got -.\"O This section holds the global offset table. -.\"O This section is of type -.\"O .BR SHT_PROGBITS . -.\"O The attributes are processor-specific. -このセクションはグローバルオフセットテーブルを保持する。 -このセクションのタイプは -.BR SHT_PROGBITS -である。 -属性はプロセッサ毎に異なる。 -.TP -.IR .hash -.\"O This section holds a symbol hash table. -.\"O This section is of type -.\"O .BR SHT_HASH . -.\"O The attribute used is -.\"O .BR SHF_ALLOC . -このセクションはシンボルハッシュテーブルを保持する。 -セクションのタイプは -.BR SHT_HASH -である。 -使用される属性は -.BR SHF_ALLOC -である。 -.TP -.IR .init -.\"O This section holds executable instructions that contribute to the process -.\"O initialization code. -このセクションはプロセス初期化コードに配置される実行可能命令を保持する。 -.\"O When a program starts to run the system arranges to -.\"O execute the code in this section before calling the main program entry point. -プログラムが実行を開始すると、 -システムはメインプログラムエントリポイントを呼び出す前に、 -このセクションにあるコードを配置して実行する。 -.\"O This section is of type -.\"O .BR SHT_PROGBITS . -このセクションはのタイプは -.BR SHT_PROGBITS -である。 -.\"O The attributes used are -.\"O .BR SHF_ALLOC -.\"O and -.\"O .BR SHF_EXECINSTR . -使用される属性は -.BR SHF_ALLOC -と -.BR SHF_EXECINSTR -である。 -.TP -.IR .interp -.\"O This section holds the pathname of a program interpreter. -このセクションはプログラムインタプリタのパス名を保持する。 -.\"O If the file has -.\"O a loadable segment that includes the section, the section's attributes will -.\"O include the -.\"O .BR SHF_ALLOC -.\"O bit. -ファイルにこのセクションを含むロード可能セグメントがある場合、 -そのセクションの属性には -.BR SHF_ALLOC -ビットが含まれる。 -.\"O Otherwise, that bit will be off. -それ以外の場合このビットはオフになる。 -.\"O This section is of type -.\"O .BR SHT_PROGBITS . -このセクションのタイプは -.BR SHT_PROGBITS -である。 -.TP -.IR .line -.\"O This section holds line number information for symbolic debugging, which -.\"O describes the correspondence between the program source and the machine code. -このセクションはシンボリックデバッグのための行番号情報を保持する。 -ここにはプログラムソースコードとマシンコードの対応関係が記述される。 -.\"O The contents are unspecified. -内容は指定されていない。 -.\"O This section is of type -.\"O .BR SHT_PROGBITS . -このセクションのタイプは -.BR SHT_PROGBITS -である。 -.\"O No attribute types are used. -属性タイプは使用されない。 -.TP -.IR .note -.\"O This section holds information in the -.\"O "Note Section" -.\"O format described below. -このセクションは以下に記述されている -"Note Section" -形式で情報を保持する。 -.\"O This section is of type -.\"O .BR SHT_NOTE . -このセクションのタイプは -.BR SHT_NOTE -である。 -.\"O No attribute types are used. -属性タイプは使用されない。 -.\"O OpenBSD -.\"O native executables usually contain a -.\"O .IR .note.openbsd.ident -.\"O section to identify themselves, for the kernel to bypass any compatibility -.\"O ELF binary emulation tests when loading the file. -通常 -OpenBSD -ネイティブ実行可能ファイルは自身を識別するために -.IR .note.openbsd.ident -セクションを持つ。 -これによりカーネルは、ファイルをロードする際に -互換 ELF バイナリエミュレーションテストを回避できる。 -.TP -.IR .note.GNU-stack -.\"O This section is used in Linux object files for declaring stack attributes. -.\"O This section is of type -.\"O .BR SHT_PROGBITS . -.\"O The only attribute used is -.\"O .BR SHF_EXECINSTR . -.\"O This indicates to the GNU linker that the object file requires an -.\"O executable stack. -このセクションは Linux のオブジェクトファイルで -スタック属性を宣言するのに使用される。 -セクションのタイプは -.B SHT_PROGBITS -である。使用される属性は -.B SHF_EXECINSTR -だけである。この属性は GNU リンカに対して -オブジェクトファイルが実行可能なスタック (executable stack) を必要とする -示すものである。 -.TP -.IR .plt -.\"O This section holds the procedure linkage table. -このセクションは手続き (procedure) リンクテーブルを保持する。 -.\"O This section is of type -.\"O .BR SHT_PROGBITS . -このセクションのタイプは -.BR SHT_PROGBITS -である。 -.\"O The attributes are processor-specific. -属性はプロセッサ毎に異なる。 -.TP -.IR .relNAME -.\"O This section holds relocation information as described below. -このセクションは以下に記述される再配置情報を保持する。 -.\"O If the file -.\"O has a loadable segment that includes relocation, the section's attributes -.\"O will include the -.\"O .BR SHF_ALLOC -.\"O bit. -ファイルが再配置を含むロード可能セグメントを持っている場合、 -このセクションの属性は -.BR SHF_ALLOC -ビットを含む。 -.\"O Otherwise the bit will be off. -それ以外の場合、そのビットはオフである。 -.\"O By convention, -.\"O "NAME" -.\"O is supplied by the section to which the relocations apply. -慣例として、 -"NAME" -は再配置が適用されるセクションが指定される。 -.\"O Thus a relocation -.\"O section for -.\"O .BR .text -.\"O normally would have the name -.\"O .BR .rel.text . -よって -.BR .text -についての再配置セクションは、通常は -.BR .rel.text -という名前を持つ。 -.\"O This section is of type -.\"O .BR SHT_REL . -このセクションのタイプは -.BR SHT_REL -である。 -.TP -.IR .relaNAME -.\"O This section holds relocation information as described below. -このセクションは以下に記述される再配置情報を保持する。 -.\"O If the file -.\"O has a loadable segment that includes relocation, the section's attributes -.\"O will include the -.\"O .BR SHF_ALLOC -.\"O bit. -ファイルが再配置を含むロード可能セグメントを持っている場合、 -このセクションの属性は -.BR SHF_ALLOC -ビットを含む。 -.\"O Otherwise the bit will be off. -それ以外の場合、そのビットはオフである。 -.\"O By convention, -.\"O "NAME" -.\"O is supplied by the section to which the relocations apply. -慣例として、 -"NAME" -は再配置が適用されるセクションが指定される。 -.\"O Thus a relocation -.\"O section for -.\"O .BR .text -.\"O normally would have the name -.\"O .BR .rela.text . -よって -.BR .text -についての再配置セクションは、通常は -.BR .rela.text -という名前を持つ。 -.\"O This section is of type -.\"O .BR SHT_RELA . -このセクションのタイプは -.BR SHT_RELA -である。 -.TP -.IR .rodata -.\"O This section holds read-only data that typically contributes to a -.\"O nonwritable segment in the process image. -このセクションはリードオンリーのデータを保持する。 -このデータはプロセスイメージにおける書き込み不可能なセグメントに置かれる。 -.\"O This section is of type -.\"O .BR SHT_PROGBITS . -このセクションのタイプは -.BR SHT_PROGBITS -である。 -.\"O The attribute used is -.\"O .BR SHF_ALLOC . -使用される属性は -.BR SHF_ALLOC -である。 -.TP -.IR .rodata1 -.\"O This section holds read-only data that typically contributes to a -.\"O nonwritable segment in the process image. -このセクションはリードオンリーのデータを保持する。 -このデータはプロセスイメージにおける書き込み不可能なセグメントに置かれる。 -.\"O This section is of type -.\"O .BR SHT_PROGBITS . -このセクションのタイプは -.BR SHT_PROGBITS -である。 -.\"O The attribute used is -.\"O .BR SHF_ALLOC . -使用される属性は -.BR SHF_ALLOC -である。 -.TP -.IR .shstrtab -.\"O This section holds section names. -このセクションはセクション名を保持する。 -.\"O This section is of type -.\"O .BR SHT_STRTAB . -このセクションのタイプは -.BR SHT_STRTAB -である。 -.\"O No attribute types are used. -属性タイプは使用されない。 -.TP -.IR .strtab -.\"O This section holds strings, most commonly the strings that represent the -.\"O names associated with symbol table entries. -このセクションは文字列を保持する。 -最も一般的なのは、シンボルテーブルエントリに関連づけられた -名前を表す文字列である。 -.\"O If the file has a loadable -.\"O segment that includes the symbol string table, the section's attributes -.\"O will include the -.\"O .BR SHF_ALLOC -.\"O bit. -ファイルがシンボル文字列テーブルを含むロード可能セグメントを持つ場合、 -セクションの属性は -.BR SHF_ALLOC -ビットを含む。 -.\"O Otherwise the bit will be off. -それ以外の場合、そのビットはオフである。 -.\"O This section is of type -.\"O .BR SHT_STRTAB . -このセクションのタイプは -.BR SHT_STRTAB -である。 -.TP -.IR .symtab -.\"O This section holds a symbol table. -このセクションはシンボルテーブルを保持する。 -.\"O If the file has a loadable segment -.\"O that includes the symbol table, the section's attributes will include -.\"O the -.\"O .BR SHF_ALLOC -.\"O bit. -ファイルがシンボルテーブルを含むロード可能セグメントを持つ場合、 -セクションの属性は -.BR SHF_ALLOC -ビットを含む。 -.\"O Otherwise the bit will be off. -それ以外の場合、ビットはオフである。 -.\"O This section is of type -.\"O .BR SHT_SYMTAB . -このセクションのタイプは -.BR SHT_SYMTAB -である。 -.TP -.IR .text -.\"O This section holds the -.\"O "text", -.\"O or executable instructions, of a program. -このセクションはプログラムの -"テキスト" -または実行可能命令を保持する。 -.\"O This section is of type -.\"O .BR SHT_PROGBITS . -セクションのタイプは -.BR SHT_PROGBITS -である。 -.\"O The attributes used are -.\"O .BR SHF_ALLOC -.\"O and -.\"O .BR SHF_EXECINSTR . -使用される属性は -.BR SHF_ALLOC -と -.BR SHF_EXECINSTR -である。 -.\" .El -.PP -.\"O String table sections hold null-terminated character sequences, commonly -.\"O called strings. -文字列テーブルセクションは NULL 文字で終端されたキャラクタ配列 -(通常文字列と呼ばれるもの) を保持する。 -.\"O The object file uses these strings to represent symbol -.\"O and section names. -オブジェクトファイルはこれらの文字列を -シンボル名とセクション名を表すために使う。 -.\"O One references a string as an index into the string -.\"O table section. -文字列は、文字列テーブルセクションへのインデックスとして参照される。 -.\"O The first byte, which is index zero, is defined to hold -.\"O a null byte (\(aq\\0\(aq). -インデックス 0 の最初のバイトは、NULL バイト (\(aq\\0\(aq) を -保持すると定義されている。 -.\"O Similarly, a string table's last byte is defined to -.\"O hold a null byte, ensuring null termination for all strings. -同様に文字列テーブルの最後のバイトも NULL 文字を保持すると定義されている。 -これは全ての文字列が NULL バイトで終端されていることを保証するためである。 -.PP -.\"O An object file's symbol table holds information needed to locate and -.\"O relocate a program's symbolic definitions and references. -.\"O A symbol table -.\"O index is a subscript into this array. -オブジェクトファイルのシンボルテーブルは、 -プログラムのシンボル定義と参照を配置または再配置するのに -必要な情報を保持する。 -.in +4n -.nf - -typedef struct { - uint32_t st_name; - Elf32_Addr st_value; - uint32_t st_size; - unsigned char st_info; - unsigned char st_other; - uint16_t st_shndx; -} Elf32_Sym; -.fi -.in -.in +4n -.nf - -typedef struct { - uint32_t st_name; - unsigned char st_info; - unsigned char st_other; - uint16_t st_shndx; - Elf64_Addr st_value; - uint64_t st_size; -} Elf64_Sym; -.fi -.in -.PP -.\"O The 32-bit and 64-bit versions have the same members, just in a different -.\"O order. -32 ビット版と 64 ビット版は同じメンバを持ち、単に順番が異なるだけである。 -.\" .Bl -tag -width "st_value" -.TP 10 -.IR st_name -.\"O This member holds an index into the object file's symbol string table, -.\"O which holds character representations of the symbol names. -このメンバはオブジェクトファイルのシンボル文字列テーブルの -インデックスを保持する。 -シンボル文字列テーブルはシンボル名の文字表現を保持する。 -.\"O If the value -.\"O is nonzero, it represents a string table index that gives the symbol -.\"O name. -この値が 0 でない場合、シンボル名を得るための文字テーブルインデックスを表す。 -.\"O Otherwise, the symbol table has no name. -それ以外の場合、シンボルテーブルは名前を持たない。 -.TP -.IR st_value -.\"O This member gives the value of the associated symbol. -このメンバは関連づけられたシンボルの値を表す。 -.TP -.IR st_size -.\"O Many symbols have associated sizes. -.\"O This member holds zero if the symbol -.\"O has no size or an unknown size. -多くのシンボルにはそれに関連づけられたサイズがある。 -シンボルがサイズを持たない場合、またはサイズが不明な場合、 -このメンバは 0 である。 -.TP -.IR st_info -.\"O This member specifies the symbol's type and binding attributes: -このメンバはシンボルのタイプとバインディング (binding) 属性を指定する: -.RS 10 -.TP 12 -.BR STT_NOTYPE -.\"O The symbol's type is not defined. -シンボルのタイプが定義されていない。 -.TP -.BR STT_OBJECT -.\"O The symbol is associated with a data object. -シンボルはデータオブジェクトに関連づけられている。 -.TP -.BR STT_FUNC -.\"O The symbol is associated with a function or other executable code. -シンボルは関数またはその他の実行コードに関連づけられている。 -.TP -.BR STT_SECTION -.\"O The symbol is associated with a section. -シンボルはセクションに関連づけられている。 -.\"O Symbol table entries of -.\"O this type exist primarily for relocation and normally have -.\"O .BR STB_LOCAL -.\"O bindings. -このタイプのシンボルテーブルエントリは、 -主として再配置のために存在し、通常は -.BR STB_LOCAL -バインディングを持つ。 -.TP -.BR STT_FILE -.\"O By convention, the symbol's name gives the name of the source file -.\"O associated with the object file. -慣例として、シンボルの名前は -オブジェクトファイルに関連づけられたソースファイルの名前を指定する。 -.\"O A file symbol has -.\"O .BR STB_LOCAL -.\"O bindings, its section index is -.\"O .BR SHN_ABS , -.\"O and it precedes the other -.\"O .BR STB_LOCAL -.\"O symbols of the file, if it is present. -ファイルシンボルは -.BR STB_LOCAL -バインディングを持ち、そのセクションインデックスは -.BR SHN_ABS -である。 -ファイルシンボルは、ファイルに他の -.BR STB_LOCAL -シンボルがある場合は、それよりも先に来る。 -.TP -.BR STT_LOPROC -.\"O This value up to and including -.\"O .BR STT_HIPROC -.\"O is reserved for processor-specific semantics. -この値以上で -.BR STT_HIPROC -以下の範囲はプロセッサ固有の意味に予約されている。 -.TP -.BR STT_HIPROC -.\"O This value down to and including -.\"O .BR STT_LOPROC -.\"O is reserved for processor-specific semantics. -この値以下で -.BR STT_LOPROC -以上の範囲はプロセッサ固有の意味に予約されている。 -.\" .El -.\" .Bl -tag -width "STB_GLOBAL" -.TP -.BR STB_LOCAL -.\"O Local symbols are not visible outside the object file containing their -.\"O definition. -局所的シンボルはその定義を含むオブジェクトファイルの外からは見えない。 -.\"O Local symbols of the same name may exist in multiple files -.\"O without interfering with each other. -同じ名前の局所的シンボルは、お互いに影響を受けることなく、 -複数のファイルに存在できる。 -.TP -.BR STB_GLOBAL -.\"O Global symbols are visible to all object files being combined. -.\"O One file's -.\"O definition of a global symbol will satisfy another file's undefined -.\"O reference to the same symbol. -大域的シンボルは結びつけられている全てのオブジェクトファイルから見える。 -1 つのファイルで大域的シンボルが定義されていたら、 -他のファイルでは同じシンボルへの参照は未定義でなければならない。 -.TP -.BR STB_WEAK -.\"O Weak symbols resemble global symbols, but their definitions have lower -.\"O precedence. -弱シンボルは大域的シンボルに似ているが、その定義は優先度が低い。 -.TP -.BR STB_LOPROC -.\"O This value up to and including -.\"O .BR STB_HIPROC -.\"O is reserved for processor-specific semantics. -この値以上で -.BR STB_HIPROC -以下の範囲はプロセッサ固有の意味に予約されている。 -.TP -.BR STB_HIPROC -.\"O This value down to and including -.\"O .BR STB_LOPROC -.\"O is reserved for processor-specific semantics. -この値以下で -.BR STB_LOPROC -以上の範囲はプロセッサ固有の意味に予約されている。 -.IP -.\"O There are macros for packing and unpacking the binding and type fields: -バインディングとタイプフィールドを -パックしたりアンパックしたりするマクロがある: -.IP -.BR ELF32_ST_BIND (info) -.\"O or -または -.BR ELF64_ST_BIND (info) -.\"O extract a binding from an -.\"O .I st_info -.\"O value. -.I st_info -の値からバインディングを取り出す。 -.IP -.BR ELF32_ST_TYPE (info) -.\"O or -または -.BR ELF64_ST_TYPE (info) -.br -.\"O extract a type from an -.\"O .I st_info -.\"O value. -.I st_info -の値からタイプを取り出す。 -.IP -.BR ELF32_ST_INFO "(bind, type)" -.\"O or -または -.BR ELF64_ST_INFO "(bind, type)" -.br -.\"O convert a binding and a type into an -.\"O .I st_info -.\"O value. -バインディングとタイプを -.I st_info -の値に変換する。 -.RE -.\" .El -.TP -.IR st_other -.\"O This member defines the symbol visibility. -このメンバはシンボルの visibility (見える範囲) を規定する。 -.\" .Bl -tag -width "STV_PROTECTED" -.RS 10 -.TP 16 -.PD 0 -.BR STV_DEFAULT -.\"O Default symbol visibility rules. -デフォルトのシンボル visibility ルール。 -.TP -.BR STV_INTERNAL -.\"O Processor-specific hidden class. -プロセッサ固有の隠しクラス。 -.TP -.BR STV_HIDDEN -.\"O Symbol is unavailable in other modules. -シンボルは他のモジュールからは利用できない。 -.TP -.BR STV_PROTECTED -.\"O Not preemptible, not exported. -横取りできず (not preemptible)、公開されない。 -.PD -.PP -.\"O There are macros for extracting the visibility type: -visibility 種別を抽出するためのマクロがある。 -.PP -.\"O .BR ELF32_ST_VISIBILITY (other) -.\"O or -.\"O .BR ELF64_ST_VISIBILITY (other) -.BR ELF32_ST_VISIBILITY (other) -または -.BR ELF64_ST_VISIBILITY (other) -.RE -.\" .El -.TP -.IR st_shndx -.\"O Every symbol table entry is -.\"O "defined" -.\"O in relation to some section. -各シンボルテーブルエントリは、いくつかのセクションに関連して -"定義されている"。 -.\"O This member holds the relevant section -.\"O header table index. -このメンバは関連するセクションヘッダテーブルインデックスを保持する。 -.\" .El -.PP -.\"O Relocation is the process of connecting symbolic references with -.\"O symbolic definitions. -再配置はシンボル参照とシンボル定義を結合するプロセスである。 -.\"O Relocatable files must have information that -.\"O describes how to modify their section contents, thus allowing executable -.\"O and shared object files to hold the right information for a process's -.\"O program image. -再配置可能ファイルはセクションの内容をどのように修正するかに関する -情報を持たなければならない。 -これにより、実行可能ファイルと共有オブジェクトファイルは -プロセスのプログラムイメージについての正しい情報を持つことができる。 -.\"O Relocation entries are these data. -再配置エントリは以下のようなデータである。 -.PP -.\"O Relocation structures that do not need an addend: -加数を必要としない再配置構造体。 -.in +4n -.nf - -typedef struct { - Elf32_Addr r_offset; - uint32_t r_info; -} Elf32_Rel; -.fi -.in -.in +4n -.nf - -typedef struct { - Elf64_Addr r_offset; - uint64_t r_info; -} Elf64_Rel; -.fi -.in -.PP -.\"O Relocation structures that need an addend: -加数を必要とする再配置構造体。 -.in +4n -.nf - -typedef struct { - Elf32_Addr r_offset; - uint32_t r_info; - int32_t r_addend; -} Elf32_Rela; -.fi -.in -.in +4n -.nf - -typedef struct { - Elf64_Addr r_offset; - uint64_t r_info; - int64_t r_addend; -} Elf64_Rela; -.fi -.in -.\" .Bl -tag -width "r_offset" -.TP 12 -.IR r_offset -.\"O This member gives the location at which to apply the relocation action. -このメンバは再配置動作が適用される位置を与える。 -.\"O For a relocatable file, the value is the byte offset from the beginning -.\"O of the section to the storage unit affected by the relocation. -再配置可能ファイルの場合、この値はセクションの先頭から -再配置で影響を受ける格納単位 (storage unit) までのバイトオフセットである。 -.\"O For an -.\"O executable file or shared object, the value is the virtual address of -.\"O the storage unit affected by the relocation. -実行可能ファイルまたは共有オブジェクトの場合、 -この値は再配置で影響を受ける格納単位の仮想アドレスである。 -.TP -.IR r_info -.\"O This member gives both the symbol table index with respect to which the -.\"O relocation must be made and the type of relocation to apply. -このメンバは、再配置が行われなければならないシンボルテーブルインデックスと、 -適用される再配置のタイプの両方を与える。 -.\"O Relocation -.\"O types are processor specific. -再配置タイプはプロセッサ毎に異なる。 -.\"O When the text refers to a relocation -.\"O entry's relocation type or symbol table index, it means the result of -.\"O applying -.\"O .BR ELF_[32|64]_R_TYPE -.\"O or -.\"O .BR ELF[32|64]_R_SYM , -.\"O respectively, to the entry's -.\"O .IR r_info -.\"O member. -テキストが再配置エントリの再配置タイプ -またはシンボルテーブルインデックスを参照している場合、 -それぞれエントリの -.IR r_info -メンバに対して、それぞれ -.BR ELF_[32|64]_R_TYPE -と -.BR ELF[32|64]_R_SYM -を適用した結果を意味する。 -.TP -.IR r_addend -.\"O This member specifies a constant addend used to compute the value to be -.\"O stored into the relocatable field. -このメンバは定数の加数を指定する。 -この加数は再配置可能フィールドに格納される値を計算するために使われる。 -.\" .El -.PP -.\"O The .dynamic section contains a series of structures that hold relevant -.\"O dynamic linking information. -.\"O The d_tag member controls the interpretation -.\"O of d_un. -\&.dynamic セクションは、関連する動的リンク情報を保持している -一連の構造体を保持する。 -d_tag メンバは d_un の解釈を制御する。 -.in +4n -.nf - -typedef struct { - Elf32_Sword d_tag; - union { - Elf32_Word d_val; - Elf32_Addr d_ptr; - } d_un; -} Elf32_Dyn; -extern Elf32_Dyn _DYNAMIC[]; -.fi -.in -.in +4n -.nf - -typedef struct { - Elf64_Sxword d_tag; - union { - Elf64_Xword d_val; - Elf64_Addr d_ptr; - } d_un; -} Elf64_Dyn; -extern Elf64_Dyn _DYNAMIC[]; -.fi -.in -.\" .Bl -tag -width "d_tag" -.TP 10 -.IR d_tag -.\"O This member may have any of the following values: -このメンバは以下の値を持つことができる: -.\" .Bl -tag -width "DT_SYMBOLIC" -.RS 10 -.TP 12 -.BR DT_NULL -.\"O Marks end of dynamic section -動的セクションの終りのマーク -.TP -.BR DT_NEEDED -.\"O String table offset to name of a needed library -必要なライブラリの名前への文字列テーブルオフセット -.TP -.BR DT_PLTRELSZ -.\"O Size in bytes of PLT relocs -PLT 再配置 (reloc) テーブルのサイズ (バイト単位) -.TP -.BR DT_PLTGOT -.\"O Address of PLT and/or GOT -PLT と GOT (または何れか一方) のアドレス -.TP -.BR DT_HASH -.\"O Address of symbol hash table -シンボルハッシュテーブルのアドレス -.TP -.BR DT_STRTAB -.\"O Address of string table -文字列テーブルのアドレス -.TP -.BR DT_SYMTAB -.\"O Address of symbol table -シンボルテーブルのアドレス -.TP -.BR DT_RELA -.\"O Address of Rela relocs table -Rela 再配置テーブルのアドレス -.TP -.BR DT_RELASZ -.\"O Size in bytes of Rela table -Rela テーブルのサイズ (バイト単位) -.TP -.BR DT_RELAENT -.\"O Size in bytes of a Rela table entry -Rela テーブルエントリのサイズ (バイト単位) -.TP -.BR DT_STRSZ -.\"O Size in bytes of string table -文字列テーブルのサイズ (バイト単位) -.TP -.BR DT_SYMENT -.\"O Size in bytes of a symbol table entry -シンボルテーブルエントリのサイズ (バイト単位) -.TP -.BR DT_INIT -.\"O Address of the initialization function -初期化関数のアドレス -.TP -.BR DT_FINI -.\"O Address of the termination function -終了関数のアドレス -.TP -.BR DT_SONAME -.\"O String table offset to name of shared object -共有オブジェクトの名前への文字列テーブルオフセット -.TP -.BR DT_RPATH -.\"O String table offset to library search path (deprecated) -ライブラリ検索パスへの文字列テーブルオフセット (推奨されない) -.TP -.BR DT_SYMBOLIC -.\"O Alert linker to search this shared object before the executable for symbols -リンカがシンボルの実行可能ファイルより前に -この共有オブジェクトを検索した場合は、警告を出す。 -.TP -.BR DT_REL -.\"O Address of Rel relocs table -Rel 再配置テーブルのアドレス -.TP -.BR DT_RELSZ -.\"O Size in bytes of Rel table -Rel テーブルのサイズ (バイト単位) -.TP -.BR DT_RELENT -.\"O Size in bytes of a Rel table entry -Rel テーブルエントリのサイズ (バイト単位) -.TP -.BR DT_PLTREL -.\"O Type of reloc the PLT refers (Rela or Rel) -PLT が参照する再配置テーブルのタイプ (Rela または Rel) -.TP -.BR DT_DEBUG -.\"O Undefined use for debugging -デバッグのために使用されている。内容は定義されていない。 -.TP -.BR DT_TEXTREL -.\"O Absence of this indicates no relocs should apply to a nonwritable segment -これが指定されていない場合、 -書き込み不可のセグメントには再配置は適用されない。 -.TP -.BR DT_JMPREL -.\"O Address of reloc entries solely for the PLT -PLT 専用の再配置エントリのアドレス -.TP -.BR DT_BIND_NOW -.\"O Instruct dynamic linker to process all relocs before transferring control to -.\"O the executable -実行可能ファイルに制御を譲る前に、 -全ての再配置を処理するように動的リンカに指示する。 -.TP -.BR DT_RUNPATH -.\"O String table offset to library search path -ライブラリ検索パスへの文字列テーブルオフセット -.TP -.BR DT_LOPROC -.\"O Start of processor-specific semantics -プロセッサ固有の意味の開始 -.TP -.BR DT_HIPROC -.\"O End of processor-specific semantics -プロセッサ固有の意味の終了 -.RE -.\" .El -.TP -.IR d_val -.\"O This member represents integer values with various interpretations. -このメンバは様々な意味に解釈される整数値である。 -.TP -.IR d_ptr -.\"O This member represents program virtual addresses. -.\"O When interpreting -.\"O these addresses, the actual address should be computed based on the -.\"O original file value and memory base address. -.\"O Files do not contain -.\"O relocation entries to fixup these addresses. -このメンバはプログラムの仮想アドレスを表す。 -これらのアドレスを解釈する際に、 -実際のアドレスは元々のファイルの値と -メモリの基底アドレスから計算される。 -ファイルにはこれらのアドレスを修正するための -再配置エントリを含めてはならない。 -.TP -.IR _DYNAMIC -.\"O Array containing all the dynamic structures in the .dynamic section. -.\"O This is automatically populated by the linker. -\&.dynamic セクションにある全ての動的構造体を含む配列。 -これは自動的にリンカに渡される。 -.\" .El -.\"O .SH NOTES -.SH 備考 -.\"O .\" OpenBSD -.\"O .\" ELF support first appeared in -.\"O .\" OpenBSD 1.2 , -.\"O .\" although not all supported platforms use it as the native -.\"O .\" binary file format. -.\" OpenBSD -.\" ELF のサポートは -.\" OpenBSD 1.2 -.\" で初めて登場した。 -.\" しかし、これをサポートするプラットフォームの全てが -.\" ネイティブバイナリファイルフォーマットとして使っていた訳ではない。 -.\"O ELF first appeared in -.\"O System V. -ELF は System V で初めて登場した。 -.\"O ELF in itself first appeared in -.\"O System V. -ELF 自体は -System V -で初めて登場した。 -.\"O The ELF format is an adopted standard. -ELF フォーマットは採択された標準である。 -.\"O .\" .SH AUTHORS -.\" .SH 著者 -.\"O .\" The original version of this manual page was written by -.\"O .\" .An Jeroen Ruigrok van der Werven -.\"O .\" .Aq asmodai@FreeBSD.org -.\"O .\" with inspiration from BSDi's -.\"O .\" .Bsx -.\"O .\" .Nm elf -.\"O .\" man page. -.\" この man ページの元々のバージョンは、BSDi の -.\" .Bsx -.\" .Nm elf -.\" man ページに刺激を受けて -.\" .An Jeroen Ruigrok van der Werven -.\" .Aq asmodai@FreeBSD.org -.\" が書いた。 -.\"O .SH SEE ALSO -.SH 関連項目 -.BR as (1), -.BR gdb (1), -.BR ld (1), -.BR objdump (1), -.BR execve (2), -.BR core (5) -.PP -Hewlett-Packard, -.IR "Elf-64 Object File Format" . -.PP -Santa Cruz Operation, -.IR "System V Application Binary Interface" . -.PP -Unix System Laboratories, -"Object Files", -.IR "Executable and Linking Format (ELF)" . diff --git a/draft/man5/intro.5 b/draft/man5/intro.5 index b0a74631..dbf772da 100644 --- a/draft/man5/intro.5 +++ b/draft/man5/intro.5 @@ -23,30 +23,18 @@ .\" .\" Modified Sat Jul 24 17:06:52 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified Sun Jan 14 00:34:09 1996 by Andries Brouwer (aeb@cwi.nl) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. -.\" Translated Tue 13 Oct 1998 by NAKANO Takeo +.\" This file was generated with po4a. Translate the source file. .\" -.TH INTRO 5 2007-10-23 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH INTRO 5 2007\-10\-23 Linux "Linux Programmer's Manual" .SH 名前 -.\"O intro \- Introduction to file formats intro \- ファイルフォーマットの紹介 -.\"O .SH DESCRIPTION .SH 説明 -.\"O Section 5 of the manual describes various file formats and protocols, -.\"O and the corresponding C structures, if any. -マニュアルの 5 章は、各種のファイルフォーマット、プロトコル、 -(もしあれば) 対応する C の構造体について記載している。 -.\"O .SH NOTES -.SH 備考 -.\"O .SS Authors and Copyright Conditions +マニュアルの 5 章は、各種のファイルフォーマット、プロトコル、 (もしあれば) 対応する C の構造体について記載している。 +.SH 注意 .SS 著者と著作権 -.\"O Look at the header of the manual page source for the author(s) and copyright -.\"O conditions. -.\"O Note that these can be different from page to page! -著作者と権利条件に関しては、マニュアルページのソースのヘッダを見よ。 -これらはページごとに異なる場合があるので注意すること。 -.\"O .SH "SEE ALSO" +著者と著作権に関しては各マニュアルページのソースのヘッダを参照すること。 これらはページごとに異なる可能性があることに注意してほしい。 .SH 関連項目 -.BR standards (7) +\fBstandards\fP(7) diff --git a/draft/man5/issue.5 b/draft/man5/issue.5 index 164cdfc7..1370454d 100644 --- a/draft/man5/issue.5 +++ b/draft/man5/issue.5 @@ -23,38 +23,19 @@ .\" .\" Modified Sun Jul 25 11:06:22 1993 by Rik Faith .\" Modified Mon Oct 21 17:47:19 EDT 1996 by Eric S. Raymond +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1996, 1998 -.\" Taro Morioka and NAKANO Takeo, all rights reserved. -.\" Translated 29 Jun 1996 by Taro Morioka -.\" Modified Sat 25 Jul 1998 by NAKANO Takeo +.\" This file was generated with po4a. Translate the source file. .\" -.TH ISSUE 5 1993-07-24 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH ISSUE 5 1993\-07\-24 Linux "Linux Programmer's Manual" .SH 名前 -.\"O issue \- prelogin message and identification file issue \- ログイン前に表示されるメッセージとシステム情報のファイル -.\"O .SH DESCRIPTION .SH 説明 -.\"O The file \fI/etc/issue\fP is a text file which contains a message or -.\"O system identification to be printed before the login prompt. -.\"O It may contain various \fB@\fP\fIchar\fP and \fB\e\fP\fIchar\fP -.\"O sequences, if -.\"O supported by the -.\"O .BR getty -type -.\"O program employed on the system. -\fI/etc/issue\fPファイルは、ログインプロンプトに先だって表示される、 -メッセージやシステムの情報が書かれたテキストファイルである。 -システムで採用されている -.BR getty 系の -プログラムによってサポートされている場合、 -このファイルには \fB@\fP\fIchar\fP や \fB\e\fP\fIchar\fP などの -シーケンスが含まれていることもある。 -.\"O .SH FILES +\fI/etc/issue\fPファイルは、ログインプロンプトに先だって表示される、 メッセージやシステムの情報が書かれたテキストファイルである。 +システムで採用されている \fBgetty\fP系の プログラムによってサポートされている場合、 このファイルには \fB@\fP\fIchar\fP や +\fB\e\fP\fIchar\fP などの シーケンスが含まれていることもある。 .SH ファイル /etc/issue -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR motd (5), -.BR agetty (8), -.BR mingetty (8) +\fBmotd\fP(5), \fBagetty\fP(8), \fBmingetty\fP(8) diff --git a/draft/man5/motd.5 b/draft/man5/motd.5 index c1d3f0ca..9959eb20 100644 --- a/draft/man5/motd.5 +++ b/draft/man5/motd.5 @@ -20,38 +20,23 @@ .\" License along with this manual; if not, write to the Free .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, .\" USA. -.\" +.\" .\" Modified Sat Jul 24 17:08:16 1993 by Rik Faith .\" Modified Mon Oct 21 17:47:19 EDT 1996 by Eric S. Raymond -.\" -.\" Japanese Version Copyright (c) 1998 Hiroaki Nagoya all rights reserved. -.\" Translated Wed Feb 4 1998 by Hiroaki Nagoya +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. .\" -.TH MOTD 5 1992-12-29 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH MOTD 5 1992\-12\-29 Linux "Linux Programmer's Manual" .SH 名前 -.\"O motd \- message of the day motd \- 今日のお知らせ(message of the day) -.\"O .SH DESCRIPTION .SH 説明 -.\"O The contents of \fI/etc/motd\fP are displayed by -.\"O .BR login (1) -.\"O after a successful login but just before it executes the login shell. -\fI/etc/motd\fP の内容は -.BR login (1) -によってログインが成功したあとで、ログインシェルが起動される前に -表示される。 +\fI/etc/motd\fP の内容は \fBlogin\fP(1) によってログインが成功したあとで、ログインシェルが起動される前に 表示される。 -.\"O The abbreviation "motd" stands for "message of the day", and this file -.\"O has been traditionally used for exactly that (it requires much less disk -.\"O space than mail to all users). -略語 "motd" は "message of the day" をあらわしていて、このファイルは伝統的 -にその名のとおりに使われている +略語 "motd" は "message of the day" をあらわしていて、このファイルは伝統的 にその名のとおりに使われている (すべてのユーザーにメイルを送るよりも少ないディスク容量しか必要としない)。 -.\"O .SH FILES .SH ファイル /etc/motd -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR login (1), -.BR issue (5) +\fBlogin\fP(1), \fBissue\fP(5) diff --git a/draft/man5/networks.5 b/draft/man5/networks.5 new file mode 100644 index 00000000..0fa68a54 --- /dev/null +++ b/draft/man5/networks.5 @@ -0,0 +1,71 @@ +.\" Copyright (c) 2001 Martin Schulze +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, +.\" USA. +.\" 2008-09-04, mtk, taken from Debian downstream, with a few light edits +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH NETWORKS 5 2008\-09\-04 GNU/Linux "Linux System Administration" +.SH 名前 +networks \- network name information +.SH 説明 +The file \fI/etc/networks\fP is a plain ASCII file that describes known DARPA +networks and symbolic names for these networks. Each line represents a +network and has the following structure: + +.RS +\fIname number aliases ...\fP +.RE + +where the fields are delimited by spaces or tabs. Empty lines are ignored. +The hash character (\fB#\fP) indicates the start of a comment: this character, +and the remaining characters up to the end of the current line, are ignored +by library functions that process the file. + +フィールドの説明は以下のとおり。 + +.TP +\fIname\fP +The symbolic name for the network. Network names can contain any printable +characters execept white\-space characters or the comment character. +.TP +\fInumber\fP +The official number for this network in numbers\-and\-dots notation (see +\fBinet\fP(3)). The trailing ".0" (for the host component of the network +address) may be omitted. +.TP +\fIaliases\fP +Optional aliases for the network. +.LP + +This file is read by the \fBroute\fP(8) and \fBnetstat\fP(8) utilities. Only +Class A, B or C networks are supported, partitioned networks (i.e., +network/26 or network/28) are not supported by this facility. +.SH ファイル +.TP +\fI/etc/networks\fP +The networks definition file. +.SH 関連項目 +\fBgetnetbyaddr\fP(3), \fBgetnetbyname\fP(3), \fBgetnetent\fP(3), \fBnetstat\fP(8), +\fBroute\fP(8) diff --git a/draft/man5/nologin.5 b/draft/man5/nologin.5 index 5b461fe8..aedfb62c 100644 --- a/draft/man5/nologin.5 +++ b/draft/man5/nologin.5 @@ -23,32 +23,19 @@ .\" .\" Modified Sun Jul 25 11:06:34 1993 by Rik Faith (faith@cs.unc.edu) .\" Corrected Mon Oct 21 17:47:19 EDT 1996 by Eric S. Raymond (esr@thyrsus.com) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 Ueyama Rui -.\" all rights reserved. -.\" Translated Mon Aug 25 14:30:24 JST 1997 -.\" by Ueyama Rui +.\" This file was generated with po4a. Translate the source file. .\" -.TH NOLOGIN 5 1992-12-29 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH NOLOGIN 5 2012\-04\-16 Linux "Linux Programmer's Manual" .SH 名前 -.\"O nologin \- prevent unprivileged users from logging into the system nologin \- 非特権ユーザのログインを禁止する -.\"O .SH DESCRIPTION .SH 説明 -.\"O If the file \fI/etc/nologin\fP exists, -.\"O .BR login (1) -.\"O will allow access only to root. -.\"O Other users will -.\"O be shown the contents of this file and their logins will be refused. -\fI/etc/nologin\fP というファイルがあると -.BR login (1) -はルートのみにアクセスを許可するようになる。他のユーザーがログインしようと -しても拒否し、そのときこのファイルの内容を表示する。 -.\"O .SH FILES +\fI/etc/nologin\fP というファイルが存在し、かつそのファイルが読み込み専用の場合、 +\fBlogin\fP(1) はルートのみにアクセスを許可するようになる。 +他のユーザーがログインしようとしても拒否し、そのときこのファイルの内容を表示する。 .SH ファイル /etc/nologin -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR login (1), -.BR shutdown (8) +\fBlogin\fP(1), \fBshutdown\fP(8) diff --git a/draft/man5/proc.5 b/draft/man5/proc.5 deleted file mode 100644 index 4537c99c..00000000 --- a/draft/man5/proc.5 +++ /dev/null @@ -1,4337 +0,0 @@ -.\" Copyright (C) 1994, 1995 by Daniel Quinlan (quinlan@yggdrasil.com) -.\" and Copyright (C) 2002-2008 Michael Kerrisk -.\" with networking additions from Alan Cox (A.Cox@swansea.ac.uk) -.\" and scsi additions from Michael Neuffer (neuffer@mail.uni-mainz.de) -.\" and sysctl additions from Andries Brouwer (aeb@cwi.nl) -.\" and System V IPC (as well as various other) additions from -.\" Michael Kerrisk -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; without even the implied warranty of -.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -.\" GNU General Public License for more details. -.\" -.\" You should have received a copy of the GNU General Public -.\" License along with this manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.\" -.\" Modified 1995-05-17 by faith@cs.unc.edu -.\" Minor changes by aeb and Marty Leisner (leisner@sdsp.mc.xerox.com). -.\" Modified 1996-04-13, 1996-07-22 by aeb@cwi.nl -.\" Modified 2001-12-16 by rwhron@earthlink.net -.\" Modified 2002-07-13 by jbelton@shaw.ca -.\" Modified 2002-07-22, 2003-05-27, 2004-04-06, 2004-05-25 -.\" by Michael Kerrisk -.\" 2004-11-17, mtk -- updated notes on /proc/loadavg -.\" 2004-12-01, mtk, rtsig-max and rtsig-nr went away in 2.6.8 -.\" 2004-12-14, mtk, updated 'statm', and fixed error in order of list -.\" 2005-05-12, mtk, updated 'stat' -.\" 2005-07-13, mtk, added /proc/sys/fs/mqueue/* -.\" 2005-09-16, mtk, Added /proc/sys/fs/suid_dumpable -.\" 2005-09-19, mtk, added /proc/zoneinfo -.\" 2005-03-01, mtk, moved /proc/sys/fs/mqueue/* material to mq_overview.7. -.\" 2008-06-05, mtk, Added /proc/[pid]/oom_score, /proc/[pid]/oom_adj, -.\" /proc/[pid]/limits, /proc/[pid]/mountinfo, /proc/[pid]/mountstats, -.\" and /proc/[pid]/fdinfo/*. -.\" 2008-06-19, mtk, Documented /proc/[pid]/status. -.\" 2008-07-15, mtk, added /proc/config.gz -.\" -.\" FIXME 2.6.13 seems to have /proc/vmcore implemented -.\" in the source code, but there is no option available under -.\" 'make xconfig'; eventually this should be fixed, and then info -.\" from the patch-2.6.13 and change log could be used to write an -.\" entry in this man page. -.\" Needs CONFIG_VMCORE -.\" -.\" FIXME cross check against Documentation/filesystems/proc.txt -.\" to see what information could be imported from that file -.\" into this file. -.\" -.\" Japanese Version Copyright (c) 1998,1999 Hiroaki Nagoya, -.\" Copyright (c) 2001-2005 Yuichi SATO, -.\" and Copyright (c) 2005-2008 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 1998-07-09, Hiroaki Nagoya -.\" Proofreaded 1998-07-24, Hiroaki Nagoya , -.\" Nakano Takeo and -.\" Shinya Hanataka . -.\" Matched with man-pages-1.22 1999-01-21, Hiroaki Nagoya -.\" Updated 1999-12-04, Kentaro Shirakata -.\" Updated 2001-04-24, Yuichi SATO -.\" Updated 2002-01-14, Yuichi SATO -.\" Updated 2002-11-04, Yuichi SATO -.\" Updated 2003-03-01, Yuichi SATO -.\" Updated 2003-10-18, Yuichi SATO -.\" Updated 2003-11-27, Yuichi SATO -.\" Updated 2005-01-22, Yuichi SATO -.\" Updated 2005-09-14, Akihiro MOTOKI -.\" Updated 2005-11-19, Akihiro MOTOKI, LDP v2.14 -.\" Updated 2006-01-18, Akihiro MOTOKI, LDP v2.21 -.\" Updated 2006-02-15, Akihiro MOTOKI, LDP v2.23 -.\" Updated 2006-03-05, Akihiro MOTOKI, LDP v2.25 -.\" Updated 2006-04-15, Akihiro MOTOKI, LDP v2.29 -.\" Updated 2007-01-05, Akihiro MOTOKI, LDP v2.43 -.\" Updated 2007-07-04, Akihiro MOTOKI, LDP v2.58 -.\" Updated 2007-09-03, Akihiro MOTOKI, LDP v2.64 -.\" Updated 2007-10-11, Akihiro MOTOKI, LDP v2.65 -.\" Updated 2008-02-06, Akihiro MOTOKI, LDP v2.76 -.\" Updated 2008-09-21, Akihiro MOTOKI, LDP v3.09 -.\" Updated 2009-03-03, Akihiro MOTOKI, LDP v3.19 -.\" Updated 2009-03-13, Akihiro MOTOKI, LDP v3.20 -.\" -.\"WORD: pseudo-filesystem 擬似ファイルシステム -.\"WORD: major メジャーデバイス番号 -.\"WORD: minor マイナーデバイス番号 -.\"WORD: inode iノード番号 -.\"WORD: executable 実行形式 -.\"WORD: file descriptor ファイルディスクリプタ -.\"WORD: swap in/out スワップイン/アウト -.\"WORD: page in/out ページイン/アウト -.\"WORD: minor/major fault マイナー/メジャーフォールト -.\"WORD: demand-loaded in 要求時ロードイン -.\"WORD: channels チャネル -.\"WORD: core file コアファイル -.\"WORD: loadable module ローダブルモジュール -.\"WORD: hotplugged 活線挿抜 -.\"WORD: context switches コンテクスト・スイッチ -.\" -.TH PROC 5 2009-09-30 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O proc \- process information pseudo-file system -proc \- プロセスの情報を含む擬似ファイルシステム -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The -.\"O .I proc -.\"O file system is a pseudo-file system which is used as an interface to -.\"O kernel data structures. -.\"O It is commonly mounted at -.\"O .IR /proc . -.\"O Most of it is read-only, but some files allow kernel variables to be -.\"O changed. -.I proc -ファイルシステムは擬似的なファイルシステムであり、 -カーネル内のデータへのインターフェースとして使用される。 -一般的には -.I /proc -にマウントされる。 -大部分のファイルは読み出し専用 (read-only) であるが、 -いくつかのファイルは書き込み可能であり、 -そのファイルに書き込めばカーネルの内部変数を変更できる。 -.LP -.\"O The following outline gives a quick tour through the -.\"O .I /proc -.\"O hierarchy. -以下は -.I /proc -階層の簡単なあらましである。 -.PD 1 -.TP -.I /proc/[pid] -.\"O There is a numerical subdirectory for each running process; the -.\"O subdirectory is named by the process ID. -.\"O Each such subdirectory contains the following -.\"O pseudo-files and directories. -実行中のプロセスについてのサブディレクトリ。 -サブディレクトリ名は (そのプロセスの) プロセス ID である。 -各サブディレクトリは、以下の擬似ファイルとディレクトリを含む。 -.\" FIXME Describe /proc/[pid]/attr and -.\" /proc/[pid]/task/[tid]/attr -.\" This is a directory -.\" Added in ??? -.\" CONFIG_SECURITY -.\" -.TP -.\"O .IR /proc/[pid]/auxv " (since 2.6.0-test7)" -.IR /proc/[number]/auxv " (カーネル 2.6.0-test7 以降)" -.\"O This contains the contents of the ELF interpreter information passed -.\"O to the process at exec time. -.\"O The format is one \fIunsigned long\fP ID -.\"O plus one \fIunsigned long\fP value for each entry. -.\"O The last entry contains two zeros. -実行時にプロセスに渡された ELF インタプリタ情報が格納されている。 -個々のエントリは、\fIunsigned long\fP 型の ID 1 個に -\fIunsigned long\fP 型の値 1 個が続くフォーマットである。 -最後のエントリには 0 が 2 個入っている。 -.\" FIXME Describe /proc/[pid]/cgroup and -.\" /proc/[pid]/task/[tid]/cgroup -.\" Info in Documentation/cgroups.txt -.\" Added in 2.6.24 -.\" CONFIG_CGROUPS -.\" -.\" FIXME Describe /proc/[pid]/clear_refs -.\" Added in 2.6.22 -.\" "Clears page referenced bits shown in smaps output" -.\" write-only -.\" CONFIG_PROC_PAGE_MONITOR -.TP -.I /proc/[pid]/cmdline -.\"O This holds the complete command line for the process, -.\"O unless the process is a zombie. -.\"O .\" In 2.3.26, this also used to be true if the process was swapped out. -.\"O In the latter case, there is nothing in this file: -.\"O that is, a read on this file will return 0 characters. -.\"O The command-line arguments appear in this file as a set of -.\"O null-separated strings, -.\"O with a further null byte (\(aq\\0\(aq) after the last string. -プロセスの完全なコマンド行を保持する。 -ただし、そのプロセスがゾンビプロセスの場合は、このファイルは空となる。 -.\" Linux 2.3.26 では、プロセスがスワップアウトされている場合も、 -.\" このファイルは空となっていた。 -つまり、このファイルを読み出しても一文字も返らない。 -このファイルではコマンドライン引き数が、 -ヌル文字で区切られた文字列として書かれており、 -最後の文字列の後にヌルバイト (\(aq\\0\(aq) が一つ置かれる。 -.TP -.\"O .IR /proc/[pid]/coredump_filter " (since kernel 2.6.23)" -.IR /proc/[pid]/coredump_filter " (kernel 2.6.23 以降)" -.\"O See -.\"O .BR core (5). -.BR core (5) -参照。 -.TP -.\"O .IR /proc/[pid]/cpuset " (since kernel 2.6.12)" -.IR /proc/[pid]/cpuset " (kernel 2.6.12 以降)" -.\" and/proc/[pid]/task/[tid]/cpuset -.\"O See -.\"O .BR cpuset (7). -.BR cpuset (7) -参照。 -.TP -.I /proc/[pid]/cwd -.\"O This is a symbolic link to the current working directory of the process. -.\"O To find out the current working directory of process 20, -.\"O for instance, you can do this: -プロセスのカレントワーキングディレクトリへのシンボリックリンク。 -例えば、プロセス 20 のカレントワーキングディレクトリを見つけるためには、 -次のようにすればよい。 - -.in +4n -.nf -.RB "$" " cd /proc/20/cwd; /bin/pwd" -.fi -.in - -.\"O Note that the -.\"O .I pwd -.\"O command is often a shell built-in, and might -.\"O not work properly. -.\"O In -.\"O .BR bash (1), -.\"O you may use -.\"O .IR "pwd\ \-P" . -.I pwd -コマンドはシェルの内部コマンドのことがよくあり、 -うまく動作しないかもしれない。 -.BR bash (1) -では -.I "pwd \-P" -を使ってもよい。 - -.\"O .\" The following was still true as at kernel 2.6.13 -.\" 以下の内容は カーネル 2.6.13 ではまだ正しい。 -.\"O In a multithreaded process, the contents of this symbolic link -.\"O are not available if the main thread has already terminated -.\"O (typically by calling -.\"O .BR pthread_exit (3)). -マルチスレッドプロセスでは、メインスレッドがすでに終了している場合、 -このシンボリックリンクの内容は参照できない -(スレッドの終了は通常 -.BR pthread_exit (3) -を呼び出しにより行われる)。 -.TP -.I /proc/[pid]/environ -.\"O This file contains the environment for the process. -.\"O The entries are separated by null bytes (\(aq\\0\(aq), -.\"O and there may be a null byte at the end. -.\"O Thus, to print out the environment of process 1, you would do: -このファイルはプロセスの環境変数を含んでいる。 -各エントリは NULL バイト (\(aq\\0\(aq) で区切られていて、 -末尾に NULL バイトがあるかもしれない。 -したがって、プロセス 1 の環境変数を表示するためには -次のようにすればよい。 -.in +4n -.nf - -.ft CW -.RB "$" " (cat /proc/1/environ; echo) | tr \(aq\e000\(aq \(aq\en\(aq" -.fi -.ft P -.in -.TP -.I /proc/[pid]/exe -.\"O Under Linux 2.2 and later, this file is a symbolic link -.\"O containing the actual pathname of the executed command. -Linux 2.2 以降では、このファイルはシンボリックリンクで、 -実行可能コマンドの実際のパス名を格納している。 -.\"O This symbolic link can be dereferenced normally; attempting to open -.\"O it will open the executable. -.\"O You can even type -.\"O .I /proc/[pid]/exe -.\"O to run another copy of the same executable as is being run by -.\"O process [pid]. -このシンボリックリンクは通常のように辿ることができる; -これをオープンすると実行可能ファイルがオープンされる。 -(コマンドラインで) -.I /proc/[pid]/exe -と入力すると、プロセス番号 [pid] で実行されている -実行可能ファイルをもう一つ実行することができる。 -.\"O .\" The following was still true as at kernel 2.6.13 -.\" 以下の内容は カーネル 2.6.13 ではまだ正しい。 -.\"O In a multithreaded process, the contents of this symbolic link -.\"O are not available if the main thread has already terminated -.\"O (typically by calling -.\"O .BR pthread_exit (3)). -マルチスレッドプロセスでは、メインスレッドがすでに終了している場合、 -このシンボリックリンクの内容は参照できない -(スレッドの終了は通常 -.BR pthread_exit (3) -を呼び出しにより行われる)。 - -.\"O Under Linux 2.0 and earlier -.\"O .I /proc/[pid]/exe -.\"O is a pointer to the binary which was executed, -.\"O and appears as a symbolic link. -.\"O A -.\"O .BR readlink (2) -.\"O call on this file under Linux 2.0 returns a string in the format: -.\"O -.\"O [device]:inode -.\"O -Linux 2.0 以前では、 -.I /proc/[pid]/exe -は実行されたバイナリへのポインタで、シンボリックリンクのように見える。 -Linux 2.0 以前では、このファイルに対して -.BR readlink (2) -を実行すると、 - - [デバイス番号]:iノード番号 - -というフォーマットの文字列が返る。 - -.\"O For example, [0301]:1502 would be inode 1502 on device major 03 (IDE, -.\"O MFM, etc. drives) minor 01 (first partition on the first drive). -たとえば、[0301]:1502 はメジャーデバイス番号 03 (IDE, MFM などのドライブ) -マイナーデバイス番号 01 (最初のドライブの最初のパーティション) の -デバイス上の iノード番号 1502 である。 - -.\"O .BR find (1) -.\"O with the -.\"O .I \-inum -.\"O option can be used to locate the file. -.I \-inum -オプションをつけて -.BR find (1) -を使うと、このファイルの所在を探すことができる。 -.TP -.I /proc/[pid]/fd -.\"O This is a subdirectory containing one entry for each file which the -.\"O process has open, named by its file descriptor, and which is a -.\"O symbolic link to the actual file. -.\"O Thus, 0 is standard input, 1 standard output, 2 standard error, etc. -プロセスがオープンしたファイル各々に対するエントリを含むサブディレクトリ。 -ファイルディスクリプタがファイル名で、 -実際のファイルへのシンボリックリンクになっている。 -したがって 0 は標準入力、1 は標準出力、2 は標準エラー出力、などとなる。 - -.\"O .\" The following was still true as at kernel 2.6.13 -.\" 以下の内容は カーネル 2.6.13 ではまだ正しい。 -.\"O In a multithreaded process, the contents of this directory -.\"O are not available if the main thread has already terminated -.\"O (typically by calling -.\"O .BR pthread_exit (3)). -マルチスレッドプロセスでは、メインスレッドがすでに終了している場合、 -このディレクトリの内容は参照できない -(スレッドの終了は通常 -.BR pthread_exit (3) -を呼び出しにより行われる)。 - -.\"O Programs that will take a filename as a command-line argument, -.\"O but will not take input from standard input if no argument is supplied, -.\"O or that write to a file named as a command-line argument, -.\"O but will not send their output to standard output -.\"O if no argument is supplied, can nevertheless be made to use -.\"O standard input or standard out using -.\"O .IR /proc/[pid]/fd . -.\"O For example, assuming that -.\"O .I \-i -.\"O is the flag designating an input file and -.\"O .I \-o -.\"O is the flag designating an output file: -コマンドライン引き数としてファイル名を受け取るが、引き数が -渡されなかった場合に標準入力から入力を受け取らないようなプログラムや、 -コマンドライン引き数として書き込みファイルを受け取るが、引き数が -渡されなかった場合に標準出力に出力を行わないようなプログラムであっても、 -.I /proc/[pid]/fd -を使うことで標準入力や標準出力を使用できるようになる。 -例えば、 -.I \-i -を入力ファイルを指定するフラグ、 -.I \-o -を出力ファイルを指定するフラグと仮定すると、以下のコマンドを -実行することにより、フィルタとして動作させることができる。 -.in +4n -.nf - -.RB "$" " foobar \-i /proc/self/fd/0 \-o /proc/self/fd/1 ..." -.fi -.in - -.\"O and you have a working filter. -.\"O motoki: 対応する訳はコマンドの上側にある。 -.\"O .\" The following is not true in my tests (MTK): -.\"O .\" Note that this will not work for -.\"O .\" programs that seek on their files, as the files in the fd directory -.\"O .\" are not seekable. -.\" 私のテストでは、以下は正しくなかった (MTK): -.\" ただし fd ディレクトリ内のファイルはシーク (seek) できないので、 -.\" この方法はファイルをシークするようなプログラムではうまく働かない。 - -.\"O .I /proc/self/fd/N -.\"O is approximately the same as -.\"O .I /dev/fd/N -.\"O in some Unix and Unix-like systems. -.\"O Most Linux MAKEDEV scripts symbolically link -.\"O .I /dev/fd -.\"O to -.\"O .IR /proc/self/fd , -.\"O in fact. -.I /proc/self/fd/N -は、ある種の Unix や Unix 風のシステムにある -.I /dev/fd/N -とだいたい同じである。 -事実 Linux のたいていの MAKEDEV スクリプトは、 -.I /dev/fd -を -.I /proc/self/fd -へのシンボリックリンクにしている。 - -.\"O Most systems provide symbolic links -.\"O .IR /dev/stdin , -.\"O .IR /dev/stdout , -.\"O and -.\"O .IR /dev/stderr , -.\"O which respectively link to the files -.\"O .IR 0 , -.\"O .IR 1 , -.\"O and -.\"O .IR 2 -.\"O in -.\"O .IR /proc/self/fd . -ほとんどのシステムでは、シンボリックリンク -.IR /dev/stdin , -.IR /dev/stdout , -.IR /dev/stderr -が提供されており、それぞれ -.I /proc/self/fd -内のファイル -.IR 0 , -.IR 1 , -.IR 2 -にリンクされている。 -.\"O Thus the example command above could be written as: -したがって、上述のサンプルコマンドは次のようにも書くことができる。 -.in +4n -.nf - -.RB "$" " foobar \-i /dev/stdin \-o /dev/stdout ..." -.fi -.in -.\" FIXME Describe /proc/[pid]/loginuid -.\" Added in 2.6.11; updating requires CAP_AUDIT_CONTROL -.\" CONFIG_AUDITSYSCALL -.TP -.\"O .IR /proc/[pid]/fdinfo/ " (since kernel 2.6.22)" -.IR /proc/[pid]/fdinfo/ " (kernel 2.6.22 以降)" -.\"O This is a subdirectory containing one entry for each file which the -.\"O process has open, named by its file descriptor. -.\"O The contents of each file can be read to obtain information -.\"O about the corresponding file descriptor, for example: -このサブディレクトリには、そのプロセスがオープンしているファイル毎の -エントリが入っており、ファイルディスクリプタがファイル名となっている。 -各ファイルの内容を読み出すことで、対応するファイルディスクリプタに関する -情報を得ることができる。以下に例を示す。 -.in +4n -.nf - -.RB "$" " cat /proc/12015/fdinfo/4" -pos: 1000 -flags: 01002002 -.fi -.in - -.\"O The -.\"O .I pos -.\"O field is a decimal number showing the current file offset. -.\"O The -.\"O .I flags -.\"O field is an octal number that displays the -.\"O file access mode and file status flags (see -.\"O .BR open (2)). -.I pos -フィールドは 10 進数で、現在のファイルオフセットを示す。 -.I flags -フィールドは 8 進数で、 -ファイルのアクセスモードとファイル状態フラグを示す -.RB ( open (2) -参照)。 - -.\"O The files in this directory are readable only by the owner of the process. -このディレクトリのファイルは、プロセスの所有者だけが読み出すことができる。 -.\" FIXME document /proc/[pid]/io -.\" .TP -.\" .IR /proc/[pid]/io " (since kernel 2.6.20)" -.TP -.\"O .IR /proc/[pid]/limits " (since kernel 2.6.24)" -.IR /proc/[pid]/limits " (kernel 2.6.24 以降)" -.\"O This file displays the soft limit, hard limit, and units of measurement -.\"O for each of the process's resource limits (see -.\"O .BR getrlimit (2)). -.\"O The file is protected to only allow reading by the real UID of the process. -このファイルは、そのプロセスの各リソース制限について、 -ソフト・リミット、ハード・リミット、計測単位を表示する -.RB ( getrlimit (2) -参照)。 -このファイルは、プロセスの実 UID を持つものだけが読み出すことができる。 -.TP -.I /proc/[pid]/maps -.\"O A file containing the currently mapped memory regions and their access -.\"O permissions. -現在マップされているメモリ領域とそのアクセスパーミッションを含む。 - -.\"O The format is: -フォーマットは以下のとおり: - -.nf -.ft CW -address perms offset dev inode pathname -08048000-08056000 r-xp 00000000 03:0c 64593 /usr/sbin/gpm -08056000-08058000 rw-p 0000d000 03:0c 64593 /usr/sbin/gpm -08058000-0805b000 rwxp 00000000 00:00 0 -40000000-40013000 r-xp 00000000 03:0c 4165 /lib/ld-2.2.4.so -40013000-40015000 rw-p 00012000 03:0c 4165 /lib/ld-2.2.4.so -4001f000-40135000 r-xp 00000000 03:0c 45494 /lib/libc-2.2.4.so -40135000-4013e000 rw-p 00115000 03:0c 45494 /lib/libc-2.2.4.so -4013e000-40142000 rw-p 00000000 00:00 0 -bffff000-c0000000 rwxp 00000000 00:00 0 -.ft -.fi - -.\"O where "address" is the address space in the process that it occupies, -.\"O "perms" is a set of permissions: -ここで "address" はプロセスのアドレス空間でそのメモリ領域が占めている -アドレスで、"perms" はパーミッションのセットである。 - -.nf -.in +5 -r = read -w = write -x = execute -s = shared -p = private (copy on write) -.fi -.in - -.\"O "offset" is the offset into the file/whatever, "dev" is the device -.\"O (major:minor), and "inode" is the inode on that device. -.\"O 0 indicates that no inode is associated with the memory region, -.\"O as the case would be with BSS (uninitialized data). -\&"offset" はファイル (などの) 中でのオフセット、 -\&"dev" はデバイス (メジャーデバイス番号:マイナーデバイス番号)、 -\&"inode" はそのデバイスの i ノード番号である。 -これが 0 のときは、bss (初期化されていないデータ領域) の場合のように -このメモリ領域にはどの i ノードも割り当てられていないことを意味している。 - -.\"O Under Linux 2.0 there is no field giving pathname. -Linux 2.0 ではパス名を書いたフィールドがない。 -.TP -.I /proc/[pid]/mem -.\"O This file can be used to access the pages of a process's memory through -.\"O .BR open (2), -.\"O .BR read (2), -.\"O and -.\"O .BR lseek (2). -このファイルは、 -.BR open (2), -.BR read (2), -.BR lseek (2) -を通して、プロセスのメモリのページにアクセスするために使われる。 -.TP -.\"O .IR /proc/[pid]/mountinfo " (since Linux 2.6.26)" -.IR /proc/[pid]/mountinfo " (Linux 2.6.26 以降)" -.\" This info adapted from Documentation/filesystems/proc.txt -.\"O This file contains information about mount points. -.\"O It contains lines of the form: -このファイルには、マウントポイントについての情報が入っている。 -以下のような形式の行から構成される。 -.nf -.ft CW - -36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue -(1)(2)(3) (4) (5) (6) (7) (8) (9) (10) (11) -.ft -.fi -.IP -.\"O The numbers in parentheses are labels for the descriptions below: -括弧付きの数字は、以下の説明のためのものである。 -.RS 7 -.TP 5 -(1) -.\"O mount ID: unique identifier of the mount (may be reused after -.\"O .BR umount (2)). -マウント ID: マウントの一意な識別子 -.RB ( umount (2) -の後は再利用されるかもしれない)。 -.TP -(2) -.\"O parent ID: ID of parent mount (or of self for the top of the mount tree). -parent ID: 親マウントの ID -(マウントツリーの最上位の場合は自分自身の ID となる)。 -.TP -(3) -.\"O major:minor: value of -.\"O .I st_dev -.\"O for files on file system (see -.\"O .BR stat (2)). -major:minor: ファイルシステム上のファイルの -.I st_dev -の値 -.RB ( stat (2) -参照)。 -.TP -(4) -.\"O root: root of the mount within the file system. -ルート: そのファイルシステム内のマウントのルート。 -.TP -(5) -.\"O mount point: mount point relative to the process's root. -マウントポイント: マウントポイントのそのプロセスのルートからの相対パス。 -.TP -(6) -.\"O mount options: per-mount options. -マウントオプション: 各マウントのオプション。 -.TP -(7) -.\"O optional fields: zero or more fields of the form "tag[:value]". -オプションフィールド: "tag[:value]" 形式のフィールドが 0 個以上並ぶ。 -.TP -(8) -.\"O separator: marks the end of the optional fields. -セパレータ: オプションフィールドの終わりを示す。 -.TP -(9) -.\"O file system type: name of file system in the form "type[.subtype]". -ファイルシステム種別: ファイルシステムの名前。 -"type[.subtype]" という形式となる。 -.TP -(10) -.\"O mount source: file system-specific information or "none". -マウント元: ファイルシステム固有の情報。ない場合は "none" となる。 -.TP -(11) -.\"O super options: per-super block options. -super options: スーパーブロック単位のオプション。 -.RE -.IP -.\"O Parsers should ignore all unrecognized optional fields. -.\"O Currently the possible optional fields are: -解釈する側は認識できないオプションフィールドは全て無視すべきである。 -現在のところ、オプションフィールドとしては以下のようなものがある。 -.RS 12 -.TP 18 -shared:X -.\"O mount is shared in peer group X -マウントはピアグループ (peer group) X で共有されている。 -.TP -master:X -.\"O mount is slave to peer group X -マウントはピアグループ (peer group) X のスレーブである。 -.TP -propagate_from:X -.\"O mount is slave and receives propagation from peer group X (*) -マウントはスレーブであり、ピアグループ X (*) から -mount propagation を受信する。 -.TP -unbindable -.\"O mount is unbindable -マウントは unbind できない。 -.RE -.IP -.\"O (*) X is the closest dominant peer group under the process's root. -.\"O If X is the immediate master of the mount, -.\"O or if there is no dominant peer group under the same root, -.\"O then only the "master:X" field is present -.\"O and not the "propagate_from:X" field. -(*) X は、プロセスの root で直近の dominant peer group である。 -X がマウントの直接のマスターである場合や、 -同じ root に dominant peer group がない場合は、 -"master:X" フィールドだけが存在し、 -"propagate_from:X" フィールドは存在しない。 - -.\"O For more information on mount propagation see: -.\"O .I Documentation/filesystems/sharedsubtree.txt -.\"O in the kernel source tree. -mount propagation の詳細については、カーネルソースツリー内の -.I Documentation/filesystems/sharedsubtree.txt -を参照。 -.TP -.\"O .IR /proc/[pid]/mounts " (since Linux 2.4.19)" -.IR /proc/[pid]/mounts " (Linux 2.4.19 以降)" -.\"O This is a list of all the file systems currently mounted in the -.\"O process's mount namespace. -.\"O The format of this file is documented in -.\"O .BR fstab (5). -そのプロセスのマウント名前空間に現在マウントされている -全ファイルシステムのリスト。 -このファイルのフォーマットは -.BR fstab (5) -に載っている。 -.\"O Since kernel version 2.6.15, this file is pollable: -.\"O after opening the file for reading, a change in this file -.\"O (i.e., a file system mount or unmount) causes -.\"O .BR select (2) -.\"O to mark the file descriptor as readable, and -.\"O .BR poll (2) -.\"O and -.\"O .BR epoll_wait (2) -.\"O mark the file as having an error condition. -カーネル 2.6.15 以降では、このファイルを監視することができる (pollable)。 -このファイルを読み出し用にオープンした後で、このファイルに変更があると -(つまりファイルシステムのマウントやアンマウントがあると)、 -.BR select (2) -ではそのファイルディスクリプタは読み出し可能となり、 -.BR poll (2) -と -.BR epoll_wait (2) -ではそのファイルはエラー状態として通知される。 -.TP -.\"O .IR /proc/[pid]/mountstats " (since Linux 2.6.17)" -.IR /proc/[pid]/mountstats " (Linux 2.6.17 以降)" -.\"O This file exports information (statistics, configuration information) -.\"O about the mount points in the process's name space. -.\"O Lines in this file have the form: -このファイルを通じて、そのプロセスの名前空間内のマウントポイントに関する -各種情報 (統計、設定情報) を参照できる。 -ファイルの各行は以下のフォーマットである。 -.nf - -device /dev/sda7 mounted on /home with fstype ext3 [statistics] -( 1 ) ( 2 ) (3 ) (4) -.fi -.IP -.\"O The fields in each line are: -各行のフィールドは以下の通りである。 -.RS 7 -.TP 5 -(1) -.\"O The name of the mounted device -.\"O (or "nodevice" if there is no corresponding device). -マウントされているデバイス名 -(対応するデバイスがない場合は "nodevice" となる)。 -.TP -(2) -.\"O The mount point within the file system tree. -マウントポイントのファイルシステムツリーにおけるパス名。 -.TP -(3) -.\"O The file system type. -ファイルシステム種別。 -.TP -(4) -.\"O Optional statistics and configuration information. -.\"O Currently (as at Linux 2.6.26), only NFS file systems export -.\"O information via this field. -追加の統計や設定情報。 -現在のところ (Linux 2.6.26 時点では)、 -このフィールドで情報が提供されているのは NFS ファイルシステムだけである。 -.RE -.IP -.\"O This file is only readable by the owner of the process. -このファイルはプロセスの所有者だけが読み出すことができる。 -.TP -.\"O .IR /proc/[pid]/numa_maps " (since Linux 2.6.14)" -.IR /proc/[pid]/numa_maps " (Linux 2.6.14 以降)" -.\"O See -.\"O .BR numa (7). -.BR numa (7) -を参照。 -.TP -.\"O .IR /proc/[pid]/oom_adj " (since Linux 2.6.11)" -.IR /proc/[pid]/oom_adj " (Linux 2.6.11 以降)" -.\"O This file can be used to adjust the score used to select which process -.\"O should be killed in an out-of-memory (OOM) situation. -このファイルは、メモリ不足 (OOM) の状況下で -どのプロセスを殺すべきかを選択するのに使用されるスコアを -調整するのに使用される。 -.\"O The kernel uses this value for a bit-shift operation of the process's -.\"O .IR oom_score -.\"O value: -.\"O valid values are in the range \-16 to +15, -.\"O plus the special value \-17, -.\"O which disables OOM-killing altogether for this process. -カーネルは、プロセスの -.I oom_score -値のビットシフト操作に、この値を使用する。 -この値として有効な値は \-16 から +15 までと、 -特別な意味を持つ \-17 である。 -\-17 はそのプロセスに対する OOM-killing を完全に無効にすることを意味する。 -.\"O A positive score increases the likelihood of this -.\"O process being killed by the OOM-killer; -.\"O a negative score decreases the likelihood. -正の値ほど、そのプロセスが OOM-killer により殺される可能性が高くなり、 -負の値ほど可能性が低くなる。 -.\"O The default value for this file is 0; -.\"O a new process inherits its parent's -.\"O .I oom_adj -.\"O setting. -このファイルのデフォルト値は 0 である。 -新しいプロセスは親プロセスの -.I oom_adj -の設定を継承する。 -.\"O A process must be privileged -.\"O .RB ( CAP_SYS_RESOURCE ) -.\"O to update this file. -このファイルを変更するためには、プロセスは特権 -.RB ( CAP_SYS_RESOURCE ) -を持っていなければならない。 -.TP -.\"O .IR /proc/[pid]/oom_score " (since Linux 2.6.11)" -.IR /proc/[pid]/oom_score " (Linux 2.6.11 以降)" -.\" See mm/oom_kill.c::badness() in the 2.6.25 sources -.\"O This file displays the current score that the kernel gives to -.\"O this process for the purpose of selecting a process -.\"O for the OOM-killer. -.\"O A higher score means that the process is more likely to be -.\"O selected by the OOM-killer. -.\"O The basis for this score is the amount of memory used by the process, -.\"O with increases (+) or decreases (\-) for factors including: -このファイルは、OOM-killer のプロセス選択用として、カーネルが -このプロセスに対して与えた現在のスコアを表示する。 -高いスコアは、そのプロセスが OOM-killer により選択される -可能性が高いことを意味する。 -このスコアの基本はそのプロセスが使用しているメモリ量であり、 -以下の要因により加算 (+) 減算 (\-) が行われる。 -.\" See mm/oom_kill.c::badness() in the 2.6.25 sources -.RS -.IP * 2 -.\"O whether the process creates a lot of children using -.\"O .BR fork (2) -.\"O (+); -そのプロセスが多くの子プロセスを -.BR fork (2) -を使って作成しているか (+)。 -.IP * -.\"O whether the process has been running a long time, -.\"O or has used a lot of CPU time (\-); -そのプロセスが長時間実行されて来たか、もしくは -多くの CPU 時間を使用しているか (\-)。 -.IP * -.\"O whether the process has a low nice value (i.e., > 0) (+); -そのプロセスが低い nice 値 (> 0) を持っているか (+)。 -.IP * -.\"O whether the process is privileged (\-); and -.\"O .\" More precisely, if it has CAP_SYS_ADMIN or CAP_SYS_RESOURCE -そのプロセスが特権を持っているか (\-)。 -.\" より正確には、CAP_SYS_ADMIN か CAP_SYS_RESOURCE を持っているか。 -.IP * -.\"O whether the process is making direct hardware access (\-). -.\"O .\" More precisely, if it has CAP_SYS_RAWIO -そのプロセスが direct hardware access を行っているか (\-)。 -.\" より正確には、CAP_SYS_RAWIO を持っているか。 -.RE -.IP -.\"O The -.\"O .I oom_score -.\"O also reflects the bit-shift adjustment specified by the -.\"O .I oom_adj -.\"O setting for the process. -.I oom_score -は、そのプロセスの -.I oom_adj -設定で規定されるビットシフト調整にも影響を与える。 -.\" FIXME Describe /proc/[pid]/pagemap -.\" Added in 2.6.25 -.\" CONFIG_PROC_PAGE_MONITOR -.TP -.I /proc/[pid]/root -.\"O Unix and Linux support the idea of a per-process root of the -.\"O file system, set by the -.\"O .BR chroot (2) -.\"O system call. -.\"O This file is a symbolic link that points to the process's -.\"O root directory, and behaves as exe, fd/*, etc. do. -Unix と Linux では、 -ファイルシステムのルート (/) をプロセスごとに別々にできる。 -これはシステムコール -.BR chroot (2) -によって設定する。 -このファイルはプロセスのルートディレクトリを指すシンボリックリンクで、 -exe や fd/* などと同じような動作をする。 - -.\"O .\" The following was still true as at kernel 2.6.13 -.\" 以下の内容は カーネル 2.6.13 ではまだ正しい。 -.\"O In a multithreaded process, the contents of this symbolic link -.\"O are not available if the main thread has already terminated -.\"O (typically by calling -.\"O .BR pthread_exit (3)). -マルチスレッドプロセスでは、メインスレッドがすでに終了している場合、 -このシンボリックリンクの内容は参照できない -(スレッドの終了は通常 -.BR pthread_exit (3) -を呼び出しにより行われる)。 -.\" FIXME Describe /proc/[pid]/seccomp -.\" Added in 2.6.12 -.\" FIXME Describe /proc/[pid]/sessionid -.\" Added in 2.6.25; read-only; only readable by real UID -.\" CONFIG_AUDITSYSCALL -.\" FIXME Describe /proc/[pid]/sched -.\" Added in 2.6.23 -.\" CONFIG_SCHED_DEBUG, and additional fields if CONFIG_SCHEDSTATS -.\" Displays various scheduling parameters -.\" This file can be written, to reset stats -.\" FIXME Describe /proc/[pid]/schedstats and -.\" /proc/[pid]/task/[tid]/schedstats -.\" Added in 2.6.9 -.\" CONFIG_SCHEDSTATS -.TP -.\"O .IR /proc/[pid]/smaps " (since Linux 2.6.14)" -.IR /proc/[pid]/smaps " (Linux 2.6.14 以降)" -.\" CONFIG_PROC_PAGE_MONITOR -.\"O This file shows memory consumption for each of the process's mappings. -.\"O For each of mappings there is a series of lines such as the following: -このファイルは、そのプロセスの各マッピングのメモリ消費量を表示する。 -マッピングのそれぞれについて、以下のような内容が表示される。 -.in +4n -.nf - -08048000-080bc000 r-xp 00000000 03:02 13130 /bin/bash -Size: 464 kB -Rss: 424 kB -Shared_Clean: 424 kB -Shared_Dirty: 0 kB -Private_Clean: 0 kB -Private_Dirty: 0 kB - -.fi -.in -.\"O The first of these lines shows the same information as is displayed -.\"O for the mapping in -.\"O .IR /proc/[pid]/maps . -.\"O The remaining lines show the size of the mapping, -.\"O the amount of the mapping that is currently resident in RAM, -.\"O the number of clean and dirty shared pages in the mapping, -.\"O and the number of clean and dirty private pages in the mapping. -最初の行には、 -.I /proc/[pid]/maps -で表示されるマッピングと同じ情報が表示される。 -残りの行には、マッピングのサイズ、現在 RAM 上に存在するマッピングの量、 -マッピング内の共有ページのうちクリーンなページ数、ダーティなページ数、 -マッピング内のプライベートページのうちクリーンなページ数、 -ダーティなページ数、を示す。 - -.\"O This file is only present if the -.\"O .B CONFIG_MMU -.\"O kernel configuration -.\"O option is enabled. -このファイルが存在するのは、カーネルのコンフィギュレーション・オプション -.B CONFIG_MMU -を有効にした場合だけである。 -.TP -.I /proc/[pid]/stat -.\"O Status information about the process. -.\"O This is used by -.\"O .BR ps (1). -.\"O It is defined in -.\"O .IR /usr/src/linux/fs/proc/array.c "." -プロセスの状態についての情報。 -これは -.BR ps (1) -で使われ、 -.I /usr/src/linux/fs/proc/array.c -で定義されている。 - -.\"O The fields, in order, with their proper -.\"O .BR scanf (3) -.\"O format specifiers, are: -各フィールドを順番に、 -.BR scanf (3) -のフォーマット指定子付きで以下に示す。 -.RS -.TP 12 -\fIpid\fP %d -.\"O The process ID. -プロセス ID。 -.TP -\fIcomm\fP %s -.\"O The filename of the executable, in parentheses. -.\"O This is visible whether or not the executable is swapped out. -括弧でくくられた実行形式のファイル名。 -実行形式がスワップアウトされているかどうかによらず、見ることができる。 -.TP -\fIstate\fP %c -.\"O One character from the string "RSDZTW" where R is running, S is -.\"O sleeping in an interruptible wait, D is waiting in uninterruptible -.\"O disk sleep, Z is zombie, T is traced or stopped (on a signal), -.\"O and W is paging. -"RSDZTW" のどれか 1 文字。 -R は実行中 (running)、 -S は割り込み可能な休眠状態 (sleeping in an interruptible wait)、 -D は割り込み不可能なディスクスリープの待機状態 -(waiting in uninterruptible disk sleep)、 -Z はゾンビ状態 (zombie)、 -T はトレースされている (traced) か -(シグナルにより) 停止している状態 (stopped)、 -W はページング中 (paging) を表している。 -.TP -\fIppid\fP %d -.\"O The PID of the parent. -親プロセスの PID。 -.TP -\fIpgrp\fP %d -.\"O The process group ID of the process. -プロセスのプロセスグループ ID。 -.TP -\fIsession\fP %d -.\"O The session ID of the process. -プロセスのセッション ID。 -.TP -\fItty_nr\fP %d -.\"O The controlling terminal of the process. -.\"O (The minor device number is contained in the combination of bits -.\"O 31 to 20 and 7 to 0; -.\"O the major device number is in bits 15 t0 8.) -プロセスの制御端末 -(マイナー・デバイス番号はビット 31〜20 と 7〜0 にまたがって格納され、 -メジャー・デバイス番号はビット 15〜8 に格納される)。 -.TP -\fItpgid\fP %d -.\"O .\" This field and following, up to and including wchan added 0.99.1 -.\" このフィールドから wchan までは 0.99.1 で追加された。 -.\"O The ID of the foreground process group of the controlling -.\"O terminal of the process. -プロセスの制御端末のフォアグランド・プロセス・グループの ID。 -.TP -.\"O \fIflags\fP %u (%lu before Linux 2.6.22) -\fIflags\fP %u (Linux 2.6.22 より前は %lu) -.\"O The kernel flags word of the process. -.\"O For bit meanings, -.\"O see the PF_* defines in -.\"O .IR . -.\"O Details depend on the kernel version. -プロセスのカーネルフラグワード。 -ビットの意味は、 -.I -で定義されている PF_* を参照すること。 -詳細はカーネルのバージョンに依存する。 -.TP -\fIminflt\fP %lu -.\"O The number of minor faults the process has made which have not -.\"O required loading a memory page from disk. -プロセスが引き起こしたマイナーフォールト (minor fault、ディスクから -メモリページへのロードを必要としないフォールト) の回数。 -.TP -.\" field 11 -\fIcminflt\fP %lu -.\"O The number of minor faults that the process's -.\"O waited-for children have made. -(そのプロセスが終了を待っている) -子プロセスが引き起こしたマイナーフォールトの回数。 -.TP -\fImajflt\fP %lu -.\"O The number of major faults the process has made which have -.\"O required loading a memory page from disk. -プロセスが引き起こしたメジャーフォールト (major fault、ディスクから -メモリページへのロードを必要とするフォールト) の回数。 -.TP -\fIcmajflt\fP %lu -.\"O The number of major faults that the process's -.\"O waited-for children have made. -(そのプロセスが終了を待っている) -子プロセスが引き起こしたメジャーフォールトの回数。 -.TP -\fIutime\fP %lu -.\"O Amount of time that this process has been scheduled in user mode, -.\"O measured in clock ticks (divide by -.\"O .IR sysconf(_SC_CLK_TCK) . -.\"O This includes guest time, \fIguest_time\fP -.\"O (time spent running a virtual CPU, see below), -.\"O so that applications that are not aware of the guest time field -.\"O do not lose that time from their calculations. -このプロセスがユーザーモードでスケジューリングされた時間の合計。 -clock tick 単位で計測される -.RI ( sysconf(_SC_CLK_TCK) -で割った値が表示される)。 -この値にはゲスト時間 \fIguest_time\fP (仮想 CPU の実行に消費された時間) -も含まれる。これは、ゲスト時間のフィールドを認識しないアプリケーション -において、ゲスト時間分を計算に入れ損ねないようにするためである。 -.TP -\fIstime\fP %lu -.\"O Amount of time that this process has been scheduled in kernel mode, -.\"O measured in clock ticks (divide by -.\"O .IR sysconf(_SC_CLK_TCK) . -プロセスのカーネルモードでの実行時間 (単位 jiffies)。 -このプロセスがカーネルモードでスケジューリングされた時間の合計。 -clock tick 単位で計測される -.RI ( sysconf(_SC_CLK_TCK) -で割った値が表示される)。 -.TP -\fIcutime\fP %ld -.\"O Amount of time that this process's -.\"O waited-for children have been scheduled in user mode, -.\"O measured in clock ticks (divide by -.\"O .IR sysconf(_SC_CLK_TCK) . -.\"O (See also -.\"O .BR times (2).) -.\"O This includes guest time, \fIcguest_time\fP -.\"O (time spent running a virtual CPU, see below). -.\"O motoki: waited-for children の訳に自信なし。 -このプロセスの子プロセスで、終了待ち (waited-for) のプロセスが、 -ユーザモードでスケジューリングされた時間の合計。 -clock tick 単位で計測される -.RI ( sysconf(_SC_CLK_TCK) -で割った値が表示される)。 -.RB ( times (2) -も参照すること。) -この値にはゲスト時間 \fIcguest_time\fP -(仮想 CPU を実行するのに消費した時間、下記参照) も含まれる。 -.TP -\fIcstime\fP %ld -.\"O Amount of time that this process's -.\"O waited-for children have been scheduled in kernel mode, -.\"O measured in clock ticks (divide by -.\"O .IR sysconf(_SC_CLK_TCK) . -.\"O motoki: waited-for children の訳に自信なし。 -このプロセスの子プロセスで、終了待ち (waited-for) のプロセスが、 -カーネルモードでスケジューリングされた時間の合計。 -clock tick 単位で計測される -.RI ( sysconf(_SC_CLK_TCK) -で割った値が表示される)。 -.TP -\fIpriority\fP %ld -.\"O (Explanation for Linux 2.6) -(Linux 2.6 の場合の説明) -.\"O For processes running a real-time scheduling policy -.\"O .RI ( policy -.\"O below; see -.\"O .BR sched_setscheduler (2)), -.\"O this is the negated scheduling priority, minus one; -.\"O that is, a number in the range \-2 to \-100, -.\"O corresponding to real-time priorities 1 to 99. -リアルタイム・スケジューリングポリシー -(下記の -.I policy ; -.BR sched_setscheduler (2) -参照) で動作しているプロセスでは、 -この値はスケジューリング優先度を反転した値 (スケジューリング優先度を -マイナスにした値) となる。値は \-2 から \-100 までの範囲の数値で、 -それぞれリアルタイム優先度の 1 から 9 に対応する。 -.\"O For processes running under a non-real-time scheduling policy, -.\"O this is the raw nice value -.\"O .RB ( setpriority (2)) -.\"O as represented in the kernel. -.\"O The kernel stores nice values as numbers -.\"O in the range 0 (high) to 39 (low), -.\"O corresponding to the user-visible nice range of \-20 to 19. -リアルタイム以外のスケジューリングポリシーで動作しているプロセスでは、 -この値はカーネル内で管理されている nice 値そのもの -.RB ( setpriority (2)) -となる。 -カーネルは nice 値を 0 (高) から 39 (低) の範囲の値として保持しており、 -それぞれユーザに見える nice 値の \-20 から 19 に対応する。 - -.\"O Before Linux 2.6, this was a scaled value based on -.\"O the scheduler weighting given to this process. -Linux 2.6 より前では、このプロセスに割り当てられたスケジューリング -重みを変換した値が表示されていた。 -.\" And back in kernel 1.2 days things were different again. -.TP -\fInice\fP %ld -.\"O The nice value (see -.\"O .BR setpriority (2)), -.\"O a value in the range 19 (low priority) to \-20 (high priority). -nice 値 -.RB ( setpriority (2) -参照)。 -19 (最低優先) から \-20 (最高優先) の範囲の値である。 -.\" Back in kernel 1.2 days things were different. -.TP -.\" .TP -.\" \fIcounter\fP %ld -.\"O .\" The current maximum size in jiffies of the process's next timeslice, -.\"O .\" or what is currently left of its current timeslice, if it is the -.\"O .\" currently running process. -.\" このプロセスが現在実行中である場合、 -.\" 次のタイムスライスにおける現時点でのプロセスの最大使用時間 (単位 jiffies)、 -.\" または現在のタイムスライスにおける残り時間を表す。 -.\" .TP -.\" \fItimeout\fP %u -.\"O .\" The time in jiffies of the process's next timeout. -.\" プロセスの次のタイムアウト時間(単位 jiffies)。 -.\"O .\" timeout was removed sometime around 2.1/2.2 -\fInum_threads\fP %ld -.\"O Number of threads in this process (since Linux 2.6). -このプロセスのスレッド数 (Linux 2.6 以降)。 -.\"O Before kernel 2.6, this field was hard coded to 0 as a placeholder -.\"O for an earlier removed field. -カーネル 2.6 より前では、このフィールドは削除されたフィールドの -場所埋めとして 0 にハードコードされていた。 -.TP -.\" field 21 -\fIitrealvalue\fP %ld -.\"O The time in jiffies before the next -.\"O .B SIGALRM -.\"O is sent to the process due to an interval timer. -.\"O Since kernel 2.6.17, this field is no longer maintained, -.\"O and is hard coded as 0. -インターバルタイマによって、次に -.B SIGALRM -がプロセスへ送られるまでの時間 (単位 jiffies)。 -カーネル 2.6.17 以降では、このフィールドはメンテナンスされなくなり、 -0 にハードコードされている。 -.TP -.\"O \fIstarttime\fP %llu (was %lu before Linux 2.6) -\fIstarttime\fP %llu (Linux 2.6 より前は %lu) -.\"O The time in jiffies the process started after system boot. -プロセスの起動時刻。システムが起動した時刻が起点 (単位 jiffies)。 -.TP -\fIvsize\fP %lu -.\"O Virtual memory size in bytes. -仮想メモリのサイズ。単位はバイト。 -.TP -\fIrss\fP %ld -.\"O Resident Set Size: number of pages the process has in real memory. -.\"O This is just the pages which -.\"O count towards text, data, or stack space. -.\"O This does not include pages -.\"O which have not been demand-loaded in, or which are swapped out. -Resident Set Size。プロセスが持っている実メモリ上のページ数。 -これはちょうどテキスト、データ、スタック空間に使われているページ数である。 -デマンドロードされていないページや -スワップアウトされたページの数は含んでいない。 -.TP -\fIrsslim\fP %lu -.\"O Current soft limit in bytes on the rss of the process; -.\"O see the description of -.\"O .B RLIMIT_RSS -.\"O in -.\"O .BR getpriority (2). -このプロセスの rss の現在のソフト・リミット (バイト単位)。 -.BR getpriority (2) -の -.B RLIMIT_RSS -の説明を参照。 -.TP -\fIstartcode\fP %lu -.\"O The address above which program text can run. -プログラムテキストが実行可能であるような領域の先頭アドレス。 -.TP -\fIendcode\fP %lu -.\"O The address below which program text can run. -プログラムテキストが実行可能であるような領域の末尾アドレス。 -.TP -\fIstartstack\fP %lu -.\"O The address of the start (i.e., bottom) of the stack. -スタックの開始アドレス (すなわち、スタックの底)。 -.TP -\fIkstkesp\fP %lu -.\"O The current value of ESP (stack pointer), as found in the -.\"O kernel stack page for the process. -現在の ESP (スタックポインタ) の値。 -プロセスのカーネルスタックページにある。 -.TP -\fIkstkeip\fP %lu -.\"O The current EIP (instruction pointer). -現在の EIP (インストラクションポインタ) の値。 -.TP -.\" field 31 -\fIsignal\fP %lu -.\"O The bitmap of pending signals, displayed as a decimal number. -.\"O Obsolete, because it does not provide information on real-time signals; use -.\"O .I /proc/[pid]/status -.\"O instead. -処理待ちのシグナルのビットマップ。 -10 進数で表示される。 -このフィールドは廃止予定である。 -リアルタイム・シグナルに関する情報は表示されないからである。 -代わりに -.I /proc/[pid]/status -を使うこと。 -.TP -\fIblocked\fP %lu -.\"O The bitmap of blocked signals, displayed as a decimal number. -.\"O Obsolete, because it does not provide information on real-time signals; use -.\"O .I /proc/[pid]/status -.\"O instead. -ブロックされた (blocked) シグナルのビットマップ。 -10 進数で表示される。 -このフィールドは廃止予定である。 -リアルタイム・シグナルに関する情報は表示されないからである。 -代わりに -.I /proc/[pid]/status -を使うこと。 -.TP -\fIsigignore\fP %lu -.\"O The bitmap of ignored signals, displayed as a decimal number. -.\"O Obsolete, because it does not provide information on real-time signals; use -.\"O .I /proc/[pid]/status -.\"O instead. -無視された (ignored) シグナルのビットマップ。 -10 進数で表示される。 -このフィールドは廃止予定である。 -リアルタイム・シグナルに関する情報は表示されないからである。 -代わりに -.I /proc/[pid]/status -を使うこと。 -.TP -\fIsigcatch\fP %lu -.\"O The bitmap of caught signals, displayed as a decimal number. -.\"O Obsolete, because it does not provide information on real-time signals; use -.\"O .I /proc/[pid]/status -.\"O instead. -捕捉された (caught) シグナルのビットマップ。 -10 進数で表示される。 -このフィールドは廃止予定である。 -リアルタイム・シグナルに関する情報は表示されないからである。 -代わりに -.I /proc/[pid]/status -を使うこと。 -.TP -\fIwchan\fP %lu -.\"O This is the "channel" in which the process is waiting. -.\"O It is the -.\"O address of a system call, and can be looked up in a namelist if you -.\"O need a textual name. -.\"O (If you have an up-to-date -.\"O .IR /etc/psdatabase , -.\"O then -.\"O try \fIps \-l\fP to see the WCHAN field in action.) -プロセスが待っている「チャネル」。 -これはシステムコールのアドレスであり、文字名が必要ならば -(アドレスとシステムコール名との) 対応表から見つけられる -(もし -.I /etc/psdatabase -[訳注: このファイル名はパッケージによる] を更新しているならば、 -\fIps \-l\fP して WCHAN フィールドを見よ)。 -.TP -\fInswap\fP %lu -.\" nswap was added in 2.0 -.\"O Number of pages swapped (not maintained). -スワップされたページ数 (メンテナンスされていない)。 -.TP -\fIcnswap\fP %lu -.\" cnswap was added in 2.0 -.\"O Cumulative \fInswap\fP for child processes (not maintained). -子プロセスの \fInswap\fP の累計 (メンテナンスされていない)。 -.TP -.\"O \fIexit_signal\fP %d (since Linux 2.1.22) -\fIexit_signal\fP %d (Linux 2.1.22 以降) -.\"O Signal to be sent to parent when we die. -プロセスが死んだときに親プロセスに送られるシグナル。 -.TP -.\"O \fIprocessor\fP %d (since Linux 2.2.8) -\fIprocessor\fP %d (Linux 2.2.8 以降) -.\"O CPU number last executed on. -このプロセスを最後に実行した CPU の番号。 -.TP -.\"O \fIrt_priority\fP %u (since Linux 2.5.19; was %lu before Linux 2.6.22) -\fIrt_priority\fP %u (Linux 2.5.19 以降; Linux 2.6.22 より前は %lu) -.\"O Real-time scheduling priority, a number in the range 1 to 99 for -.\"O processes scheduled under a real-time policy, -.\"O or 0, for non-real-time processes (see -.\"O .BR sched_setscheduler (2)). -リアルタイム・スケジューリングの優先度。 -リアルタイム・ポリシーの元でスケジューリングされるプロセスでは -1 から 99 の範囲の値となり、 -リアルタイム以外のスケジューリングポリシーのプロセスでは 0 となる -.RB ( sched_setscheduler (2) -参照)。 -.TP -.\" field 41 -.\"O \fIpolicy\fP %u (since Linux 2.5.19; was %lu before Linux 2.6.22) -\fIpolicy\fP %u (Linux 2.5.19 以降; Linux 2.6.22 より前は %lu) -.\"O Scheduling policy (see -.\"O .BR sched_setscheduler (2)). -.\"O Decode using the SCHED_* constants in -.\"O .IR linux/sched.h . -スケジューリング・ポリシー -.RB ( sched_setscheduler (2) -参照)。 -値は、 -.I linux/sched.h -の SCHED_* 定数を使ってデコードすればよい。 -.TP -.\"O \fIdelayacct_blkio_ticks\fP %llu (since Linux 2.6.18) -\fIdelayacct_blkio_ticks\fP %llu (Linux 2.6.18 以降) -.\"O Aggregated block I/O delays, measured in clock ticks (centiseconds). -(clock tick (100分の1秒) 単位での) ブロック I/O の総遅延量。 -.TP -.\"O \fIguest_time\fP %lu (since Linux 2.6.24) -\fIguest_time\fP %lu (Linux 2.6.24 以降) -.\"O Guest time of the process (time spent running a virtual CPU -.\"O for a guest operating system), measured in clock ticks (divide by -.\"O .IR sysconf(_SC_CLK_TCK) . -プロセスのゲスト時間 (ゲスト OS の仮想 CPU を実行するのに消費された時間)。 -clock tick 単位で計測される -.RI ( sysconf(_SC_CLK_TCK) -で割った値が表示される)。 -.TP -.\"O \fIcguest_time\fP %ld (since Linux 2.6.24) -\fIcguest_time\fP %ld (Linux 2.6.24 以降) -.\"O Guest time of the process's children, measured in clock ticks (divide by -.\"O .IR sysconf(_SC_CLK_TCK) . -プロセスの子プロセスのゲスト時間。 -clock tick 単位で計測される -.RI ( sysconf(_SC_CLK_TCK) -で割った値が表示される)。 -.RE -.TP -.I /proc/[pid]/statm -.\"O Provides information about memory usage, measured in pages. -(ページ単位で計測した) メモリ使用量についての情報を提供する。 -.\"O The columns are: -各列は以下の通りである。 -.in +4n -.nf - -.\"O size total program size -.\"O (same as VmSize in \fI/proc/[pid]/status\fP) -.\"O resident resident set size -.\"O (same as VmRSS in \fI/proc/[pid]/status\fP) -.\"O share shared pages (from shared mappings) -.\"O text text (code) -.\"O .\" (not including libs; broken, includes data segment) -.\"O lib library (unused in Linux 2.6) -.\"O data data + stack -.\"O .\" (including libs; broken, includes library text) -.\"O dt dirty pages (unused in Linux 2.6) -size プログラムサイズの総計 - (\fI/proc/[pid]/status\fP の VmSize と同じ) -resident 実メモリ上に存在するページ - (\fI/proc/[pid]/status\fP の VmRSS と同じ) -share 共有ページ (共有マッピングされているページ) -text テキスト (コード) -.\" (libs は含まれない; おかしなことに、data セグメントは含まれる) -lib ライブラリ (Linux 2.6 では未使用) -data データ + スタック -.\" (libs を含む; おかしなことに、library text も含まれる) -dt ダーティページ (Linux 2.6 では未使用) -.fi -.in -.TP -.I /proc/[pid]/status -.\"O Provides much of the information in -.\"O .I /proc/[pid]/stat -.\"O and -.\"O .I /proc/[pid]/statm -.\"O in a format that's easier for humans to parse. -.I /proc/[pid]/stat -と -.I /proc/[pid]/statm -にある多くの情報を、人間が解析しやすい形式で提供する。 -.\"O Here's an example: -以下に例を示す。 -.in +4n -.nf - -.RB "$" " cat /proc/$$/status" -Name: bash -State: S (sleeping) -Tgid: 3515 -Pid: 3515 -PPid: 3452 -TracerPid: 0 -Uid: 1000 1000 1000 1000 -Gid: 100 100 100 100 -FDSize: 256 -Groups: 16 33 100 -VmPeak: 9136 kB -VmSize: 7896 kB -VmLck: 0 kB -VmHWM: 7572 kB -VmRSS: 6316 kB -VmData: 5224 kB -VmStk: 88 kB -VmExe: 572 kB -VmLib: 1708 kB -VmPTE: 20 kB -Threads: 1 -SigQ: 0/3067 -SigPnd: 0000000000000000 -ShdPnd: 0000000000000000 -SigBlk: 0000000000010000 -SigIgn: 0000000000384004 -SigCgt: 000000004b813efb -CapInh: 0000000000000000 -CapPrm: 0000000000000000 -CapEff: 0000000000000000 -CapBnd: ffffffffffffffff -Cpus_allowed: 00000001 -Cpus_allowed_list: 0 -Mems_allowed: 1 -Mems_allowed_list: 0 -voluntary_ctxt_switches: 150 -nonvoluntary_ctxt_switches: 545 -.fi -.in -.IP -.\"O The fields are as follows: -フィールドの詳細は以下の通りである。 -.RS -.IP * 2 -.IR Name : -.\"O Command run by this process. -このプロセスにより実行されたコマンド。 -.IP * -.IR State : -.\"O Current state of the process. One of -.\"O "R (running)", -.\"O "S (sleeping)", -.\"O "D (disk sleep)", -.\"O "T (stopped)", -.\"O "T (tracing stop)", -.\"O "Z (zombie)", -.\"O or -.\"O "X (dead)". -プロセスの現在の状態。 -"R (running; 実行中)", -"S (sleeping; 休眠状態)", -"D (disk sleep; ディスク待ちの休眠状態)", -"T (stopped; 停止状態)", -"T (tracing stop; トレースによる停止)", -"Z (zombie; ゾンビ状態)", -"X (dead; 死亡)" -のいずれかである。 -.IP * -.IR Tgid : -.\"O Thread group ID (i.e., Process ID). -スレッドグループ ID (すなわち、プロセス ID)。 -.IP * -.IR Pid : -.\"O Thread ID (see -.\"O .BR gettid (2)). -スレッド ID -.RB ( gettid (2) -参照)。 -.IP * -.IR TracerPid : -.\"O PID of process tracing this process (0 if not being traced). -このプロセスをトレースしているプロセスの PID -(トレースされていない場合は 0)。 -.IP * -.IR Uid ", " Gid : -.\"O Real, effective, saved set, and file system UIDs (GIDs). -実 UID/GID、実効 UID/GID、保存 set-UID/GID、ファイルシステム UID/GID。 -.IP * -.IR FDSize : -.\"O Number of file descriptor slots currently allocated. -現在割り当てられているファイルディスクリプタのスロット数。 -.IP * -.IR Groups : -.\"O Supplementary group list. -補助グループのリスト。 -.IP * -.IR VmPeak : -.\"O Peak virtual memory size. -仮想メモリサイズのピーク値。 -.IP * -.IR VmSize : -.\"O Virtual memory size. -仮想メモリサイズ。 -.IP * -.IR VmLck : -.\"O Locked memory size (see -.\"O .BR mlock (3)). -ロックされているメモリサイズ -.RB ( mlock (3) -参照)。 -.IP * -.IR VmHWM : -.\"O Peak resident set size ("high water mark"). -実メモリ上に存在するページサイズ (resident set size) -のピーク値 ("high water mark")。 -.IP * -.IR VmRSS : -.\"O Resident set size. -実メモリ上に存在するページサイズ。 -.IP * -.IR VmData ", " VmStk ", " VmExe : -.\"O Size of data, stack, and text segments. -データ、スタック、テキストセグメントのサイズ。 -.IP * -.IR VmLib : -.\"O Shared library code size. -共有ライブラリ・コードのサイズ。 -.IP * -.IR VmPTE : -.\"O Page table entries size (since Linux 2.6.10). -ページ・テーブル・エントリのサイズ (Linux 2.6.10 以降)。 -.IP * -.IR Threads : -.\"O Number of threads in process containing this thread. -このスレッドが属するプロセスのスレッド数。 -.IP * -.IR SigPnd ", " ShdPnd : -.\"O Number of signals pending for thread and for process as a whole (see -.\"O .BR pthreads (7) -.\"O and -.\"O .BR signal (7)). -スレッド宛およびプロセス全体宛の処理待ちシグナルの数 -.RB ( pthreads (7), -.BR signal (7) -参照)。 -.IP * -.IR SigBlk ", " SigIgn ", " SigCgt : -.\"O Masks indicating signals being blocked, ignored, and caught (see -.\"O .BR signal (7)). -ブロックされるシグナル、無視されるシグナル、捕捉待ちのシグナルを -示すマスク値 -.RB ( signal (7))。 -.IP * -.IR CapInh ", " CapPrm ", " CapEff : -.\"O Masks of capabilities enabled in inheritable, permitted, and effective sets -.\"O (see -.\"O .BR capabilities (7)). -継承可能 (inheritable)、許可 (permitted)、実効 (effective) -の各ケーパビリティセットで有効になっているケーパビリティのマスク値 -.RB ( capabilities (7) -参照)。 -.IP * -.IR CapBnd : -.\"O Capability Bounding set -.\"O (since kernel 2.6.26, see -.\"O .BR capabilities (7)). -ケーパビリティ・バウンディングセット -(カーネル 2.6.26 以降、 -.BR capabilities (7) -参照)。 -.IP * -.IR Cpus_allowed : -.\"O Mask of CPUs on which this process may run -.\"O (since Linux 2.6.24, see -.\"O .BR cpuset (7)). -このプロセスが実行を許可されている CPU のマスク値 -(Linux 2.6.24 以降、 -.BR cpuset (7) -参照)。 -.IP * -.IR Cpus_allowed_list : -.\"O Same as previous, but in "list format" -.\"O (since Linux 2.6.26, see -.\"O .BR cpuset (7)). -前項と同じだが、「リスト形式」での表示 -(Linux 2.6.26 以降、 -.BR cpuset (7) -参照)。 -.IP * -.IR Mems_allowed : -.\"O Mask of memory nodes allowed to this process -.\"O (since Linux 2.6.24, see -.\"O .BR cpuset (7)). -このプロセスが使用できるメモリノードのマスク値 -(Linux 2.6.24 以降、 -.BR cpuset (7) -参照)。 -.IP * -.IR Mems_allowed_list : -.\"O Same as previous, but in "list format" -.\"O (since Linux 2.6.26, see -.\"O .BR cpuset (7)). -前項と同じだが、「リスト形式」での表示 -(Linux 2.6.26 以降、 -.BR cpuset (7) -参照)。 -.IP * -.IR voluntary_context_switches ", " nonvoluntary_context_switches : -.\"O Number of voluntary and involuntary context switches (since Linux 2.6.23). -自発的/非自発的なコンテキストスイッチの回数 -(Linux 2.6.23 以降)。 -.RE -.TP -.\"O .IR /proc/[pid]/task " (since Linux 2.6.0-test6)" -.IR /proc/[pid]/task " (Linux 2.6.0-test6 以降)" -.\"O This is a directory that contains one subdirectory -.\"O for each thread in the process. -このディレクトリには、そのプロセスのスレッド情報を含む -サブディレクトリが 1 スレッドにつき 1 つ置かれる。 -.\"O The name of each subdirectory is the numerical thread ID -.\"O .RI ( [tid] ) -.\"O of the thread (see -.\"O .BR gettid (2)). -各サブディレクトリの名前はスレッドのスレッド ID -.RI ( [tid] ) -を示す数字である -.BR ( gettid (2) -を参照)。 -.\"O Within each of these subdirectories, there is a set of -.\"O files with the same names and contents as under the -.\"O .I /proc/[pid] -.\"O directories. -これらの各サブディレクトリには、 -.I /proc/[pid] -ディレクトリ以下と同じ名前と内容のファイル群がある。 -.\"O For attributes that are shared by all threads, the contents for -.\"O each of the files under the -.\"O .I task/[tid] -.\"O subdirectories will be the same as in the corresponding -.\"O file in the parent -.\"O .I /proc/[pid] -.\"O directory -.\"O (e.g., in a multithreaded process, all of the -.\"O .I task/[tid]/cwd -.\"O files will have the same value as the -.\"O .I /proc/[pid]/cwd -.\"O file in the parent directory, since all of the threads in a process -.\"O share a working directory). -すべてのスレッドで共有される属性の場合、 -.I task/[tid] -サブディレクトリ以下の各ファイルの内容は -親ディレクトリ -.I /proc/[pid] -の対応するファイルと同じになることだろう -(例えば、マルチスレッド・プロセスではファイル -.I task/[tid]/cwd -はいずれも親ディレクトリ内の -.I /proc/[pid]/cwd -と同じ値を持つことになる。なぜなら、一つのプロセスに属すすべての -スレッドは作業ディレクトリを共有するからである)。 -.\"O For attributes that are distinct for each thread, -.\"O the corresponding files under -.\"O .I task/[tid] -.\"O may have different values (e.g., various fields in each of the -.\"O .I task/[tid]/status -.\"O files may be different for each thread). -スレッド毎に独立な属性の場合、 -.I task/[tid] -サブディレクトリ以下の各ファイルは異なる値を持つことがある -(例えば、ファイル -.I task/[tid]/status -はスレッド毎に異なる値を持つ可能性がある)。 - -.\"O .\" The following was still true as at kernel 2.6.13 -.\" 以下の内容は カーネル 2.6.13 ではまだ正しい。 -.\"O In a multithreaded process, the contents of the -.\"O .I /proc/[pid]/task -.\"O directory are not available if the main thread has already terminated -.\"O (typically by calling -.\"O .BR pthread_exit (3)). -マルチスレッドプロセスでは、メインスレッドがすでに終了している場合、 -.I /proc/[pid]/task -ディレクトリの内容は参照できない -(スレッドの終了は通常 -.BR pthread_exit (3) -を呼び出しにより行われる)。 -.TP -.I /proc/apm -.\"O Advanced power management version and battery information when -.\"O .B CONFIG_APM -.\"O is defined at kernel compilation time. -Advanced Power Management のバージョンとバッテリ情報。 -カーネルのコンパイル時に -.B CONFIG_APM -を定義したときに存在する。 -.TP -.I /proc/bus -.\"O Contains subdirectories for installed busses. -インストールされている各バス用にサブディレクトリがある。 -.TP -.I /proc/bus/pccard -.\"O Subdirectory for PCMCIA devices when -.\"O .B CONFIG_PCMCIA -.\"O is set at kernel compilation time. -PCMCIA デバイスの情報が書かれるサブディレクトリ。 -カーネルのコンパイル時に -.B CONFIG_PCMCIA -を定義したときに存在する。 -.TP -.I /proc/bus/pccard/drivers -.TP -.I /proc/bus/pci -.\"O Contains various bus subdirectories and pseudo-files containing -.\"O information about PCI busses, installed devices, and device -.\"O drivers. -.\"O Some of these files are not ASCII. -いくつかのサブディレクトリがあり、 -PCI バス・インストールされているデバイス・ -デバイスドライバの情報が書かれた仮想ファイルがある。 -これらのファイルのうちいくつかは ASCII フォーマットではない。 -.TP -.I /proc/bus/pci/devices -.\"O Information about PCI devices. -.\"O They may be accessed through -.\"O .BR lspci (8) -.\"O and -.\"O .BR setpci (8). -PCI デバイスの情報。 -.BR lspci (8) -や -.BR setpci (8) -でアクセスすることができる。 -.TP -.I /proc/cmdline -.\"O Arguments passed to the Linux kernel at boot time. -.\"O Often done via a boot manager such as -.\"O .BR lilo (8) -.\"O or -.\"O .BR grub (8). -ブート時に Linux カーネルに渡された引き数。 -引き数の受け渡しは、たいてい -.BR lilo (8) -や -.BR grub (8) -といったブートマネージャを使って行われる。 -.TP -.\"O .IR /proc/config.gz " (since Linux 2.6)" -.IR /proc/config.gz " (Linux 2.6 以降)" -.\"O This file exposes the configuration options that were used -.\"O to build the currently running kernel, -.\"O in the same format as they would be shown in the -.\"O .I .config -.\"O file that resulted when configuring the kernel (using -.\"O .IR "make xconfig" , -.\"O .IR "make config" , -.\"O or similar). -このファイルでは、現在実行中のカーネルの構築時に使用された -設定オプションを参照できる。 -書式は、 -.RI ( "make xconfig" , -.IR "make config" -などを使って) カーネルの設定を変更した際に生成される -.I .config -ファイルのものと同じである。 -.\"O The file contents are compressed; view or search them using -.\"O .BR zcat (1), -.\"O .BR zgrep (1), -.\"O etc. -.\"O As long as no changes have been made to the following file, -.\"O the contents of -.\"O .I /proc/config.gz -.\"O are the same as those provided by : -ファイルの内容は圧縮されており、 -.BR zcat (1), -.BR zgrep (1) -などを使うと、表示や検索ができる。 -ファイルが変更されていない限り、 -.I /proc/config.gz -の内容は次のコマンドで得られる内容と同じである。 -.in +4n -.nf - -cat /lib/modules/$(uname -r)/build/.config -.fi -.in -.IP -.\"O .I /proc/config.gz -.\"O is only provided if the kernel is configured with -.\"O .BR CONFIG_IKCONFIG_PROC . -.I /proc/config.gz -が提供されるのは、カーネルの設定で -.B CONFIG_IKCONFIG_PROC -が有効になっている場合のみである。 -.TP -.I /proc/cpuinfo -.\"O This is a collection of CPU and system architecture dependent items, -.\"O for each supported architecture a different list. -.\"O Two common entries are \fIprocessor\fP which gives CPU number and -.\"O \fIbogomips\fP; a system constant that is calculated -.\"O during kernel initialization. -.\"O SMP machines have information for -.\"O each CPU. -このファイルは、CPU およびシステムアーキテクチャに依存する項目を -集めたもので、リストの内容はサポートされているアーキテクチャ毎に異なる。 -2 つだけ共通の項目がある。 -\fIprocessor\fP はプロセッサ番号で、 -\fIbogomips\fP はカーネルの初期化時に計算されるシステム定数である。 -SMP マシンでは各 CPU についての情報が書かれている。 -.TP -.I /proc/devices -.\"O Text listing of major numbers and device groups. -.\"O This can be used by MAKEDEV scripts for consistency with the kernel. -メジャーデバイス番号とデバイスグループのテキスト形式のリスト。 -MAKEDEV スクリプトはこのファイルを使って、 -カーネルとの整合性を保つことができる。 -.TP -.\"O .IR /proc/diskstats " (since Linux 2.5.69)" -.IR /proc/diskstats " (Linux 2.5.69 以降)" -.\"O This file contains disk I/O statistics for each disk device. -.\"O See the kernel source file -.\"O .I Documentation/iostats.txt -.\"O for further information. -このファイルには各ディスクデバイスのディスク I/O 統計情報が書かれている。 -更に詳しい情報は、カーネルソースファイル -.I Documentation/iostats.txt -を参照すること。 -.TP -.I /proc/dma -.\"O This is a list of the registered \fIISA\fP DMA (direct memory access) -.\"O channels in use. -登録されている \fIISA\fP DMA (direct memory access) チャネルのリスト。 -.TP -.I /proc/driver -.\"O Empty subdirectory. -空のサブディレクトリ。 -.TP -.I /proc/execdomains -.\"O List of the execution domains (ABI personalities). -実行ドメインのリスト (ABI パーソナリティ)。 -.TP -.I /proc/fb -.\"O Frame buffer information when -.\"O .B CONFIG_FB -.\"O is defined during kernel compilation. -カーネルのコンパイル時に -.B CONFIG_FB -が定義されている場合、フレームバッファの情報が書かれる。 -.TP -.I /proc/filesystems -.\"O A text listing of the file systems which are supported by the kernel, -.\"O namely file systems which were compiled into the kernel or whose kernel -.\"O modules are currently loaded. -.\"O (See also -.\"O .BR filesystems (5).) -.\"O If a file system is marked with "nodev", -.\"O this means that it does not require a block device to be mounted -.\"O (e.g., virtual file system, network file system). -カーネルが対応しているファイルシステムのテキスト形式のリスト。 -カーネルに組み込まれてコンパイルされたファイルシステムと、 -カーネルモジュールが現在ロードされているファイルシステムが列挙される -.RB ( filesystems (5) -参照)。 -ファイルシステムに "nodev" という印が付いている場合、 -そのファイルシステムがマウントするためのブロックデバイスを -必要としないことを意味する (例えば、 -仮想ファイルシステム、ネットワークファイルシステムなど)。 - -.\"O Incidentally, this file may be used by -.\"O .BR mount (8) -.\"O when no file system is specified and it didn't manage to determine the -.\"O file system type. -.\"O Then file systems contained in this file are tried -.\"O (excepted those that are marked with "nodev"). -ちなみに、マウント時にファイルシステムが指定されず、 -どうやってもファイルシステムの種類を判定できなかった際に、 -このファイルを -.BR mount (8) -が使用するかもしれない。 -その場合、このファイルに含まれるファイルシステムが試される -(ただし、"nodev" の印がついたものは除く)。 -.TP -.I /proc/fs -.\"O Empty subdirectory. -空のサブディレクトリ。 -.TP -.I /proc/ide -.\"O This directory -.\"O exists on systems with the IDE bus. -.\"O There are directories for each IDE channel and attached device. -.\"O Files include: -このディレクトリは IDE バスをもつシステムに存在する。 -各 IDE チャネルとそれに取り付けられている各デバイスごとにディレクトリがあり、 -以下のファイルが含まれている。 - -.in +4n -.nf -.\"O cache buffer size in KB -cache バッファサイズ (KB) -.\"O capacity number of sectors -capacity セクタ数 -.\"O driver driver version -driver ドライバのバージョン -.\"O geometry physical and logical geometry -geometry 物理ジオメトリと論理ジオメトリ -.\"O identify in hexadecimal -identify 16 進数表記 -.\"O media media type -media メディアのタイプ -.\"O model manufacturer's model number -model 製造者のモデル番号 -.\"O settings drive settings -settings ドライブの設定 -.\"O smart_thresholds in hexadecimal -smart_thresholds 16 進数表記 -.\"O smart_values in hexadecimal -smart_values 16 進数表記 -.fi -.in - -.\"O The -.\"O .BR hdparm (8) -.\"O utility provides access to this information in a friendly format. -.BR hdparm (8) -ユーティリティは、分かりやすい形式で -この情報にアクセスするための手段を提供する。 -.TP -.I /proc/interrupts -.\"O This is used to record the number of interrupts per CPU per IO device. -.\"O Since Linux 2.6.24, -.\"O for the i386 and x86_64 architectures, at least, this also includes -.\"O interrupts internal to the system (that is, not associated with a device -.\"O as such), such as NMI (nonmaskable interrupt), LOC (local timer interrupt), -.\"O and for SMP systems, TLB (TLB flush interrupt), RES (rescheduling -.\"O interrupt), CAL (remote function call interrupt), and possibly others. -.\"O Very easy to read formatting, done in ASCII. -IO デバイス毎の CPU 別の割り込み回数の記録に使われる。 -Linux 2.6.24 以降、少なくとも i386 と x86_64 アーキテクチャでは、 -(デバイスと関連がない) システム内部の割り込みについても記録される。 -システム内部の割り込みには、NMI (nonmaskable interrupt), -LOC (local timer interrupt) や、SMP システムでは TLB (TLB flush interrupt), -RES (rescheduling interrupt), CAL (remote function call interrupt) -などがある。 -簡単に読むことのできるフォーマットで、ASCII で表記されている。 -.TP -.I /proc/iomem -.\"O I/O memory map in Linux 2.4. -Linux 2.4 における I/O メモリマップ。 -.TP -.I /proc/ioports -.\"O This is a list of currently registered Input-Output port regions that -.\"O are in use. -現在登録され使われている I/O ポート領域のリスト。 -.TP -.\"O .IR /proc/kallsyms " (since Linux 2.5.71)" -.IR /proc/kallsyms " (Linux 2.5.71 以降)" -.\"O This holds the kernel exported symbol definitions used by the -.\"O .BR modules (X) -.\"O tools to dynamically link and bind loadable modules. -カーネルの外部シンボル定義を保持する。 -.BR modules (X) -関係のツールがローダブルモジュールを動的にリンクしたり -バインド (bind) するのに使われる。 -.\"O In Linux 2.5.47 and earlier, a similar file with slightly different syntax -.\"O was named -.\"O .IR ksyms . -Linux 2.5.47 以前では、微妙に異なる書式の似たようなファイルが -.I ksyms -という名前であった。 -.TP -.I /proc/kcore -.\"O This file represents the physical memory of the system and is stored -.\"O in the ELF core file format. -.\"O With this pseudo-file, and an unstripped -.\"O kernel -.\"O .RI ( /usr/src/linux/vmlinux ) -.\"O binary, GDB can be used to -.\"O examine the current state of any kernel data structures. -このファイルはシステムの物理メモリを表現しており、 -ELF コアファイル形式 (core file format) で保持されている。 -この擬似ファイルと strip されていないカーネルのバイナリ -.RI ( /usr/src/linux/vmlinux ) -[訳注: パッケージに依存する]) があれば、 -GDB はカーネル内の任意のデータ構造の現在の状態を調べられる。 - -.\"O The total length of the file is the size of physical memory (RAM) plus -.\"O 4KB. -このファイルの大きさは物理メモリ (RAM) のサイズに 4KB を加えた値である。 -.TP -.I /proc/kmsg -.\"O This file can be used instead of the -.\"O .BR syslog (2) -.\"O system call to read kernel messages. -.\"O A process must have superuser -.\"O privileges to read this file, and only one process should read this -.\"O file. -.\"O This file should not be read if a syslog process is running -.\"O which uses the -.\"O .BR syslog (2) -.\"O system call facility to log kernel messages. -このファイルは -.BR syslog (2) -システムコールでカーネルメッセージを読み出す代りに使える。 -プロセスがこのファイルを読むためにはスーパーユーザー権限が必要であり、 -ファイルを読み出すのは 1 つのプロセスのみに限るべきである。 -カーネルメッセージを記録するために、 -.BR syslog (2) -システムコールの機能を使う syslog プロセスが稼働している場合、 -このファイルを読み出すべきではない。 - -.\"O Information in this file is retrieved with the -.\"O .BR dmesg (1) -.\"O program. -このファイルの中の情報は -.BR dmesg (1) -によって表示される。 -.TP -.IR /proc/ksyms " (Linux 1.1.23-2.5.47)" -.\"O See -.\"O .IR /proc/kallsyms . -.I /proc/kallsyms -を参照。 -.TP -.I /proc/loadavg -.\"O The first three fields in this file are load average figures -.\"O giving the number of jobs in the run queue (state R) -.\"O or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes. -.\"O They are the same as the load average numbers given by -.\"O .BR uptime (1) -.\"O and other programs. -このファイルの最初の 3 つのフィールドはロードアベレージの数値で、 -1, 5, 15 分あたりの実行キュー内 (state R) または -ディスク I/O 待ち (state D) のジョブ数を与える。 -これは -.BR uptime (1) -などのプログラムによって得られる値と同じである。 -.\"O The fourth field consists of two numbers separated by a slash (/). -4 番目のフィールドはスラッシュ (/) で区切られた 2 つの数値から構成される。 -.\"O The first of these is the number of currently executing kernel -.\"O scheduling entities (processes, threads); -.\"O this will be less than or equal to the number of CPUs. -この数値のうち最初のものは、現在実行されている -カーネルスケジュールエンティティ (プロセス、スレッド) の数である。 -この数値は CPU の数以下になる。 -.\"O The value after the slash is the number of kernel scheduling entities -.\"O that currently exist on the system. -スラッシュの後の数値は、現在システム上に存在する -カーネルスケジュールエンティティの数である。 -.\"O The fifth field is the PID of the process that was most -.\"O recently created on the system. -5 番目のフィールドはシステム上に最も最近生成されたプロセスの PID である。 -.TP -.I /proc/locks -.\"O This file shows current file locks -.\"O .RB ( flock "(2) and " fcntl (2)) -.\"O and leases -.\"O .RB ( fcntl (2)). -このファイルは現在のファイルロック -.RB ( flock "(2) と " fcntl (2)) -とリース -.RB ( fcntl (2)) -を表示する。 -.TP -.\"O .IR /proc/malloc " (only up to and including Linux 2.2)" -.IR /proc/malloc " (Linux 2.2 以前のみ)" -.\" It looks like this only ever did something back in 1.0 days -.\"O This file is only present if -.\"O .B CONFIG_DEBUG_MALLOC -.\"O was defined during compilation. -コンパイルのときに -.B CONFIGDEBUGMALLOC -が定義されているときのみ、このファイルは存在する。 -.TP -.I /proc/meminfo -.\"O This file reports statistics about memory usage on the system. -.\"O It is used by -.\"O .BR free (1) -.\"O to report the amount of free and used memory (both physical and swap) -.\"O on the system as well as the shared memory and buffers used by the -.\"O kernel. -このファイルはシステム上のメモリ使用量に関する統計情報を表示する。 -.BR free (1) -は、このファイルを参照し、 -システムの未使用および使用中のメモリ量 (物理メモリとスワップ) と、 -カーネルに使われている共有メモリとバッファの情報を報告する。 -.TP -.I /proc/modules -.\"O A text list of the modules that have been loaded by the system. -現在システムにロードされているモジュールのテキスト形式のリスト。 -.\"O See also -.\"O .BR lsmod (8). -.BR lsmod (8) -も参照。 -.TP -.I /proc/mounts -.\"O Before kernel 2.4.19, this file was a list -.\"O of all the file systems currently mounted on the system. -.\"O With the introduction of per-process mount namespaces in -.\"O Linux 2.4.19, this file became a link to -.\"O .IR /proc/self/mounts , -.\"O which lists the mount points of the process's own mount namespace. -.\"O The format of this file is documented in -.\"O .BR fstab (5). -カーネル 2.4.19 より前では、このファイルは現在システムにマウントされている -全てのファイルシステムのリストであった。 -Linux 2.4.19 でプロセス単位のマウント名前空間が導入されたことに伴い、 -このファイルは -.I /proc/self/mounts -へのリンクとなった。 -.I /proc/self/mounts -はそのプロセス自身のマウント名前空間のマウントポイントのリストである。 -このファイルのフォーマットは -.BR fstab (5) -に記述されている。 -.TP -.I /proc/mtrr -.\"O Memory Type Range Registers. -.\"O See the kernel source file -.\"O .I Documentation/mtrr.txt -.\"O for details. -Memory Type Range Registers。 -詳細は、カーネルソースファイル -.I Documentation/mtrr.txt -を参照すること。 -.TP -.I /proc/net -.\"O various net pseudo-files, all of which give the status of some part of -.\"O the networking layer. -.\"O These files contain ASCII structures and are, -.\"O therefore, readable with -.\"O .BR cat (1). -.\"O However, the standard -.\"O .BR netstat (8) -.\"O suite provides much cleaner access to these files. -さまざまなネットワークについての擬似ファイルで、 -それぞれがネットワーク層の各種の状態を与える。 -これらのファイルの内容は ASCII 形式なので、 -.BR cat (1) -で読み出せる。 -とはいえ基本コマンドの -.BR netstat (8) -はこれらのファイルの内容のよりすっきりとした表示を提供する。 -.TP -.I /proc/net/arp -.\"O This holds an ASCII readable dump of the kernel ARP table used for -.\"O address resolutions. -.\"O It will show both dynamically learned and preprogrammed ARP entries. -.\"O The format is: -アドレス解決に使われるカーネルの ARP テーブルの -ASCII 可読なダンプを保持している。 -動的結合されたものと固定 (preprogrammed) の両方の -APP エントリを見ることができる。フォーマットは以下のとおり: - -.nf -.ft CW -.in 8n -IP address HW type Flags HW address Mask Device -192.168.0.50 0x1 0x2 00:50:BF:25:68:F3 * eth0 -192.168.0.250 0x1 0xc 00:00:00:00:00:00 * eth0 -.ft -.fi -.in - -.\"O Here "IP address" is the IPv4 address of the machine and the "HW type" -.\"O is the hardware type of the address from RFC\ 826. -.\"O The flags are the internal -.\"O flags of the ARP structure (as defined in -.\"O .IR /usr/include/linux/if_arp.h ) -.\"O and -.\"O the "HW address" is the data link layer mapping for that IP address if -.\"O it is known. -ここで IP address はマシンの IPv4 アドレス、 -HW type はそのアドレスの RFC\ 826 で定められているハードウェアの形式、 -Flags は ARP 構造体 -.RI ( /usr/include/linux/if_arp.h -内で定義されている) の内部フラグ、 -HW address はその IP アドレスにマップされているデータリンク層のアドレス -(もしわかっていれば) である。 -.TP -.I /proc/net/dev -.\"O The dev pseudo-file contains network device status information. -.\"O This gives -.\"O the number of received and sent packets, the number of errors and -.\"O collisions -.\"O and other basic statistics. -.\"O These are used by the -.\"O .BR ifconfig (8) -.\"O program to report device status. -.\"O The format is: -擬似ファイル dev はネットワークデバイスの状態情報を含んでいる。 -これは送受信したパケット数、エラーとコリジョン (collision) の回数、 -その他の基本的な統計を与える。 -これらは -.BR ifconfig (8) -がデバイスの状態を報告するのに使われる。 -フォーマットは以下のとおり: - -.nf -.ft CW -.in 1n -Inter-| Receive | Transmit - face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed - lo: 2776770 11307 0 0 0 0 0 0 2776770 11307 0 0 0 0 0 0 - eth0: 1215645 2751 0 0 0 0 0 0 1782404 4324 0 0 0 427 0 0 - ppp0: 1622270 5552 1 0 0 0 0 0 354130 5669 0 0 0 0 0 0 - tap0: 7714 81 0 0 0 0 0 0 7714 81 0 0 0 0 0 0 -.in -.ft -.fi -.\" .TP -.\" .I /proc/net/ipx -.\"O .\" No information. -.\" 情報なし。 -.\" .TP -.\" .I /proc/net/ipx_route -.\"O .\" No information. -.\" 情報なし。 -.TP -.I /proc/net/dev_mcast -.\"O Defined in -.\"O .IR /usr/src/linux/net/core/dev_mcast.c : -.I /usr/src/linux/net/core/dev_mcast.c -で定義されており、以下の形式である。 -.nf -.in +5 -indx interface_name dmi_u dmi_g dmi_address -2 eth0 1 0 01005e000001 -3 eth1 1 0 01005e000001 -4 eth2 1 0 01005e000001 -.in -.fi -.TP -.I /proc/net/igmp -.\"O Internet Group Management Protocol. -.\"O Defined in -.\"O .IR /usr/src/linux/net/core/igmp.c . -Internet Group Management Protocol (インターネットグループ管理プロトコル)。 -.I /usr/src/linux/net/core/igmp.c -で定義されている。 -.TP -.I /proc/net/rarp -.\"O This file uses the same format as the -.\"O .I arp -.\"O file and contains the current reverse mapping database used to provide -.\"O .BR rarp (8) -.\"O reverse address lookup services. -.\"O If RARP is not configured into the -.\"O kernel, -.\"O this file will not be present. -このファイルは -.I arp -と同じフォーマットで -逆アドレス解決サービス (reverse address lookup services) -.BR rarp (8) -に提供するために使われる現在の逆マップデータベースの内容を含んでいる。 -RARP がカーネルコンフィグレーションに設定されていなければ、 -このファイルは存在しない。 -.TP -.I /proc/net/raw -.\"O Holds a dump of the RAW socket table. -.\"O Much of the information is not of -.\"O use -.\"O apart from debugging. -.\"O The "sl" value is the kernel hash slot for the -.\"O socket, -.\"O the "local_address" is the local address and protocol number pair. -.\"O \&"St" is -.\"O the internal status of the socket. -.\"O The "tx_queue" and "rx_queue" are the -.\"O outgoing and incoming data queue in terms of kernel memory usage. -.\"O The "tr", "tm\->when", and "rexmits" fields are not used by RAW. -.\"O The "uid" -.\"O field holds the effective UID of the creator of the socket. -RAW ソケットテーブルのダンプを保持している。 -ほとんどの情報はデバッグ以外では使われない。 -\&"sl" の値はソケットのカーネルハッシュスロット、 -\&"local_address" はローカルアドレスとプロトコル番号のペア -[訳者追加: "rem_address" はリモートアドレスとプロトコル番号のペア]。 -\&"st" はソケットの内部状態。 -\&"tx_queue" と "rx_queue" はカーネルメモリを消費している -送信/受信データキューのサイズ。 -\&"tr" と "tm\->when" と "rexmits" フィールドは RAW では使われていない。 -\&"uid" フィールドはソケット生成者の実効 UID を保持している。 -.\" .TP -.\" .I /proc/net/route -.\"O .\" No information, but looks similar to -.\"O .\" .BR route (8). -.\" 情報なし。 -.\" .BR route (8) -.\" (の出力) のように見える。 -.TP -.I /proc/net/snmp -.\"O This file holds the ASCII data needed for the IP, ICMP, TCP, and UDP -.\"O management -.\"O information bases for an SNMP agent. -このファイルは SNMP エージェントが必要とする -IP, ICMP, TCP, UDP 管理情報を ASCII データとして保持している。 -.TP -.I /proc/net/tcp -.\"O Holds a dump of the TCP socket table. -.\"O Much of the information is not -.\"O of use apart from debugging. -.\"O The "sl" value is the kernel hash slot -.\"O for the socket, the "local_address" is the local address and port number pair. -.\"O The "rem_address" is the remote address and port number pair -.\"O (if connected). -.\"O \&"St" is the internal status of the socket. -.\"O The "tx_queue" and "rx_queue" are the -.\"O outgoing and incoming data queue in terms of kernel memory usage. -.\"O The "tr", "tm\->when", and "rexmits" fields hold internal information of -.\"O the kernel socket state and are only useful for debugging. -.\"O The "uid" -.\"O field holds the effective UID of the creator of the socket. -TCP ソケットテーブルのダンプを保持している。 -大部分の情報はデバッグ以外には使われない。 -sl はソケットのカーネルハッシュスロットの値、 -\&"local_address" はローカルアドレスとポート番号のペアである。 -(ソケットが接続している場合は) -\&"rem_address" はリモートアドレスとポート番号の対である。 -\&"st" はソケットの内部状態である。 -\&"tx_queue" と "rx_queue" はカーネルメモリを消費している -送信/受信データキューのサイズ。 -\&"tr" と "tm\->when" と "rexmits" フィールドはソケット状態のカーネル -内部情報を保持しているが、これらはデバッグのときにしか役に立たない。 -\&"uid" フィールドはソケット生成者の実効 UID を保持している。 -.TP -.I /proc/net/udp -.\"O Holds a dump of the UDP socket table. -.\"O Much of the information is not of -.\"O use apart from debugging. -.\"O The "sl" value is the kernel hash slot for the -.\"O socket, the "local_address" is the local address and port number pair. -.\"O The "rem_address" is the remote address and port number pair -.\"O (if connected). "St" is the internal status of the socket. -.\"O The "tx_queue" and "rx_queue" are the outgoing and incoming data queue -.\"O in terms of kernel memory usage. -.\"O The "tr", "tm\->when", and "rexmits" fields -.\"O are not used by UDP. -.\"O The "uid" -.\"O field holds the effective UID of the creator of the socket. -.\"O The format is: -UDP ソケットテーブルのダンプを保持している。 -大部分の情報はデバッグ以外には使われない。 -sl はソケットのカーネルハッシュスロットの値、 -"local_address" はローカルアドレスとポート番号のペアである。 -(ソケットが接続している場合は) -"rem_address" はリモートアドレスとポート番号のペアである。 -"st" はソケットの内部状態である。 -"tx_queue" と "rx_queue" はカーネルメモリを消費している -送信/受信データキューのサイズ。 -"tr" と "tm\->when" と "rexmits" フィールドは UDP では使われていない。 -"uid" フィールドはソケット生成者の実効 UID を保持している。 -フォーマットは以下のとおり: - -.nf -.ft CW -.in 1n -sl local_address rem_address st tx_queue rx_queue tr rexmits tm\->when uid - 1: 01642C89:0201 0C642C89:03FF 01 00000000:00000001 01:000071BA 00000000 0 - 1: 00000000:0801 00000000:0000 0A 00000000:00000000 00:00000000 6F000100 0 - 1: 00000000:0201 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 -.in -.ft -.fi -.TP -.I /proc/net/unix -.\"O Lists the Unix domain sockets present within the system and their -.\"O status. -.\"O The format is: -Unix ドメインソケットのリスト。 -フォーマットは以下のとおり: -.nf -.sp .5 -.ft CW -Num RefCount Protocol Flags Type St Path - 0: 00000002 00000000 00000000 0001 03 - 1: 00000001 00000000 00010000 0001 01 /dev/printer -.ft -.sp .5 -.fi - -.\"O Here "Num" is the kernel table slot number, "RefCount" is the number -.\"O of users of the socket, "Protocol" is currently always 0, "Flags" -.\"O represent the internal kernel flags holding the status of the -.\"O socket. -.\"O Currently, type is always "1" (Unix domain datagram sockets are -.\"O not yet supported in the kernel). -.\"O \&"St" is the internal state of the -.\"O socket and Path is the bound path (if any) of the socket. -ここで、Num はカーネルのテーブルスロット数、 -RefCount はソケットを使用しているユーザー数、 -Protocol はいまのところいつも 0 で、Flags はソケットの状態を保持している -カーネル内部のフラグである。 -Type はいまのところいつも 1 -(UNIX ドメインのデータグラムソケットは、現在のカーネルではサポートされていない -[訳注: 2.0.34 ではサポートされているようだ])。 -St はソケットの内部状態で、Path は (もしあれば) ソケットのパス名である。 -.TP -.I /proc/partitions -.\"O Contains major and minor numbers of each partition as well as number -.\"O of blocks and partition name. -各パーティションのメジャー番号とマイナー番号が書かれている。 -さらに、ブロック数とパーティション名も書かれている。 -.TP -.I /proc/pci -.\"O This is a listing of all PCI devices found during kernel initialization -.\"O and their configuration. -カーネルの初期化時に見つかったすべての PCI デバイスのリストと -その設定。 - -.\"O This file has been deprecated in favor of a new -.\"O .I /proc -.\"O interface for PCI -.\"O .RI ( /proc/bus/pci ). -.\"O It became optional in Linux 2.2 (available with -.\"O .B CONFIG_PCI_OLD_PROC -.\"O set at kernel compilation). -.\"O It became once more nonoptionally enabled in Linux 2.4. -.\"O Next, it was deprecated in Linux 2.6 (still available with -.\"O .B CONFIG_PCI_LEGACY_PROC -.\"O set), and finally removed altogether since Linux 2.6.17. -このファイルは非推奨であり、新しい PCI 用の -.I /proc -インターフェイス -.RI ( /proc/bus/pci ) -を使うこと。 -このファイルは Linux 2.2 でオプションになった (カーネルのコンパイル時に -.B CONFIG_PCI_OLD_PROC -をセットすると利用可能であった)。 -Linux 2.4 で再びオプションなしで有効に戻った。 -さらに、Linux 2.6 で非推奨となり -.RB ( CONFIG_PCI_LEGACY_PROC -をセットするとまだ利用可能であった)、 -最終的に Linux 2.6.17 以降で完全に削除された。 -.\" FIXME /proc/sched_debug -.\" .TP -.\" .IR /proc/sched_debug " (since Linux 2.6.23)" -.\" See also /proc/[pid]/sched -.TP -.I /proc/scsi -.\"O A directory with the -.\"O .I scsi -.\"O mid-level pseudo-file and various SCSI low-level -.\"O driver directories, -.\"O which contain a file for each SCSI host in this system, all of -.\"O which give the status of some part of the SCSI IO subsystem. -.\"O These files contain ASCII structures and are, therefore, readable with -.\"O .BR cat (1). -.I scsi -中間レベル擬似ファイルといくつかの SCSI 低レベルドライバの -ディレクトリを含むディレクトリ。 -これらのファイルは ASCII で表現されているので -.BR cat (1) -で読める。 - -.\"O You can also write to some of the files to reconfigure the subsystem or -.\"O switch certain features on or off. -いくつかのファイルは書き込み可能で、サブシステムの設定を変更したり、 -特定の機能をオン/オフすることができる。 -.TP -.I /proc/scsi/scsi -.\"O This is a listing of all SCSI devices known to the kernel. -.\"O The listing is similar to the one seen during bootup. -.\"O scsi currently supports only the \fIadd-single-device\fP command which -.\"O allows root to add a hotplugged device to the list of known devices. -カーネルが知っているすべての SCSI デバイスのリスト。 -このリストは起動時に (コンソールで) 見られるものとほぼ同じである。 -scsi は現在のところ \fIadd-single-device\fP コマンドのみをサポートしている。 -これによりルート (root) は既知のデバイスリストへ活線挿抜 (hotplugged) -デバイスを加えることができる。 - -.\"O The command -.\"O .in +4n -.\"O .nf -.\"O -.\"O echo \(aqscsi add-single-device 1 0 5 0\(aq > /proc/scsi/scsi -.\"O -.\"O .fi -.\"O .in -.\"O will cause -.\"O host scsi1 to scan on SCSI channel 0 for a device on ID 5 LUN 0. -.\"O If there -.\"O is already a device known on this address or the address is invalid, an -.\"O error will be returned. -次のコマンドを実行すると、 -.in +4n -.nf - -echo \(aqscsi add-single-device 1 0 5 0\(aq > /proc/scsi/scsi - -.fi -.in -ホストアダプタ scsi1 は SCSI チャネル 0 で -ID 5 LUN 0 のデバイスを探す。 -もしこのアドレスに既知のデバイスがあるか、 -不正なアドレスであったならばエラーが返る。 -.TP -.I /proc/scsi/[drivername] -.\"O \fI[drivername]\fP can currently be NCR53c7xx, aha152x, aha1542, aha1740, -.\"O aic7xxx, buslogic, eata_dma, eata_pio, fdomain, in2000, pas16, qlogic, -.\"O scsi_debug, seagate, t128, u15-24f, ultrastore, or wd7000. -.\"O These directories show up for all drivers that registered at least one -.\"O SCSI HBA. -.\"O Every directory contains one file per registered host. -.\"O Every host-file is named after the number the host was assigned during -.\"O initialization. -いまのところ \fI[drivername]\fP は NCR53c7xx, aha152x, aha1542, aha1740, -aic7xxx, buslogic, eata_dma, eata_pio, fdomain, in2000, pas16, qlogic, -scsi_debug, seagate, t128, u15-24f, ultrastore, wd7000 -のどれかである。 -少なくとも 1 つの SCSI ホストバスアダプタ (HBA) に -ドライバが割り当てられていると、そのドライバに対応したディレクトリが現れる。 -それぞれのディレクトリには、 -登録されたホストアダプタに対応してファイルが作られる。 -このファイルの名前は、システムの初期化の際に -ホストアダプタに割り当てられた番号になる。 - -.\"O Reading these files will usually show driver and host configuration, -.\"O statistics, etc. -これらのファイルを読めばドライバとホストアダプタの設定や -統計などを見ることができる。 - -.\"O Writing to these files allows different things on different hosts. -.\"O For example, with the \fIlatency\fP and \fInolatency\fP commands, -.\"O root can switch on and off command latency measurement code in the -.\"O eata_dma driver. -.\"O With the \fIlockup\fP and \fIunlock\fP commands, -.\"O root can control bus lockups simulated by the scsi_debug driver. -これらのファイルへの書き込みはホストアダプタごとに異なる動作を引き起こす。 -たとえば \fIlatency\fP と \fInolatency\fP コマンドを用いると、 -ルート (root、スーパーユーザー) は eata_dma ドライバの隠し測定コードの -オン/オフを切り替えることができる。 -また \fI lockup\fP と \fIunlock\fP コマンドを用いると、ルートは -scsi_debug ドライバがシミュレートするバスロックアップ (bus lockup) を -制御することができる。 -.TP -.I /proc/self -.\"O This directory refers to the process accessing the -.\"O .I /proc -.\"O file system, -.\"O and is identical to the -.\"O .I /proc -.\"O directory named by the process ID of the same process. -このディレクトリはプロセスに (プロセス自身の) -.I /proc -ファイルシステムへのアクセスを参照させる。 -これは -.I /proc -内の (このプロセスの) プロセス ID が名前となっている -ディレクトリと全く同一である。 -.TP -.I /proc/slabinfo -.\"O Information about kernel caches. -.\"O Since Linux 2.6.16 this file is only present if the -.\"O .B CONFIG_SLAB -.\"O kernel configuration option is enabled. -Linux 2.6.16 以降では、 -カーネル設定オプション -.B CONFIG_SLAB -が有効の場合にのみ、このファイルは存在する。 -.\"O The columns in -.\"O .I /proc/slabinfo -.\"O are: -カーネルキャッシュの情報。 -.I /proc/slabinfo -のフィールドは以下のとおり。 -.in +4n -.nf - -cache-name -num-active-objs -total-objs -object-size -num-active-slabs -total-slabs -num-pages-per-slab -.fi -.in - -.\"O See -.\"O .BR slabinfo (5) -.\"O for details. -詳細は -.BR slabinfo (5) -を参照すること。 -.TP -.I /proc/stat -.\"O kernel/system statistics. -.\"O Varies with architecture. -.\"O Common -.\"O entries include: -カーネル/システムの統計。 -アーキテクチャによって異なる。 -共通エントリには以下のものが含まれる。 -.RS -.TP -\fIcpu 3357 0 4313 1362393\fP -.\"O The amount of time, measured in units of -.\"O USER_HZ (1/100ths of a second on most architectures, use -.\"O .IR sysconf(_SC_CLK_TCK) -.\"O to obtain the right value), -.\"O .\" 1024 on Alpha and ia64 -.\"O that the system spent in user mode, -.\"O user mode with low priority (nice), system mode, and the -.\"O idle task, respectively. -.\"O .\" FIXME Actually, the following info about the /proc/stat 'cpu' field -.\"O .\" does not seem to be quite right (at least in 2.6.12) -.\"O The last value should be USER_HZ times the -.\"O second entry in the uptime pseudo-file. -ユーザーモード、 -低い優先度 (nice) でのユーザーモード、 -システムモード、 -タスク待ち (idle task)、 -でそれぞれシステムが消費した時間を -USER_HZ を単位として計測した積算値。 -(ほとんどのアーキテクチャでは USER_HZ は 1/100 秒である。 -正しい値は -.I sysconf(_SC_CLK_TCK) -を使って取得できる。) -.\" Alpha と ia64 では 1024 である。 -.\" FIXME: 実際には、/proc/stat の 'cpu' フィールドについての以下の情報は -.\" 正しいとは言えないようである (少なくとも 2.6.12 では)。 -最後の値 (タスク待ち) は疑似ファイル uptime の 2番目のエントリの値を -USER_HZ 倍したものである。 - -.\"O In Linux 2.6 this line includes three additional columns: -.\"O .I iowait -.\"O \- time waiting for I/O to complete (since 2.5.41); -.\"O .I irq -.\"O \- time servicing interrupts (since 2.6.0-test4); -.\"O .I softirq -.\"O \- time servicing softirqs (since 2.6.0-test4). -Linux 2.6 では、この行に 3つの欄が追加されている: -.I iowait -(I/O の完了を待っていた時間; 2.5.41 以降); -.I irq -(割り込み処理を行った時間; 2.6.0-test4 以降); -.I softirq -(ソフト割り込みの処理を行った時間; 2.6.0-test4 以降)。 - -.\"O Since Linux 2.6.11, there is an eighth column, -.\"O .I steal -.\"O \- stolen time, which is the time spent in other operating systems when -.\"O running in a virtualized environment -Linux 2.6.11 以降では、8 個目の欄として -.I steal -(盗まれた時間; stolen time) が存在する。 -これは、仮想化環境での動作時に他のオペレーティングシステムにより -消費された時間である。 - -.\"O Since Linux 2.6.24, there is a ninth column, -.\"O .IR guest , -.\"O which is the time spent running a virtual CPU for guest -.\"O operating systems under the control of the Linux kernel. -Linux 2.6.24 以降では、9 個目の欄として、 -.I guest -がある。これは、 -Linux カーネルの制御下のゲストオペレーティングシステムの仮想 CPU の -実行に消費された時間である。 -.\" See Changelog entry for 5e84cfde51cf303d368fcb48f22059f37b3872de -.TP -\fIpage 5741 1808\fP -.\"O The number of pages the system paged in and the number that were paged -.\"O out (from disk). -システムが (ディスクから) ページイン/ページアウトしたページ数。 -.TP -\fIswap 1 0\fP -.\"O The number of swap pages that have been brought in and out. -スワップイン/スワップアウトされたページ数。 -.TP -.\"O .\" FIXME The following is not the full picture for the 'intr' of -.\"O .\" /proc/stat on 2.6: -.\" FIXME 以下の説明は、カーネル 2.6 の /proc/stat 'intr' フィールドの -.\" 完全な説明ではない。書かれていないことがある。 -\fIintr 1462898\fP -.\"O This line shows counts of interrupts serviced since boot time, -.\"O for each of the possible system interrupts. -.\"O The first column is the total of all interrupts serviced; -.\"O each subsequent column is the total for a particular interrupt. -この行はシステム起動時以降に処理された割り込みの回数を示す。 -最初の欄は処理された割り込み全ての合計であり、それ以降の欄は -個々の割り込みについての合計数である。 -.TP -\fIdisk_io: (2,0):(31,30,5764,1,2) (3,0):\fP... -.\"O (major,disk_idx):(noinfo, read_io_ops, blks_read, write_io_ops, blks_written) -.\"O .br -.\"O (Linux 2.4 only) -(メジャー番号, ディスクインデックス番号):(情報なし (noinfo), 読み込み回数, -読み込みブロック数, 書き出し回数, 書き出しブロック数) -.br -(Linux 2.4 のみ) -.TP -\fIctxt 115315\fP -.\"O The number of context switches that the system underwent. -コンテクスト・スイッチの延べ回数。 -.TP -\fIbtime 769041601\fP -.\"O boot time, in seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). -起動時刻、紀元 (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) からの秒数。 -.TP -\fIprocesses 86031\fP -.\"O Number of forks since boot. -システム起動時からの延べフォーク (fork) 数。 -.TP -\fIprocs_running 6\fP -.\"O Number of processes in runnable state. -.\"O (Linux 2.5.45 onwards.) -実行中状態のプロセス数 (Linux 2.5.45 以降)。 -.TP -\fIprocs_blocked 2\fP -.\"O Number of processes blocked waiting for I/O to complete. -.\"O (Linux 2.5.45 onwards.) -I/O 完了待ちで停止 (blocked) しているプロセス数 -(Linux 2.5.45 以降)。 -.RE -.TP -.I /proc/swaps -.\"O Swap areas in use. -.\"O See also -.\"O .BR swapon (8). -使用中のスワップ領域。 -.BR swapon (8) -も参照すること。 -.TP -.I /proc/sys -.\"O This directory (present since 1.3.57) contains a number of files -.\"O and subdirectories corresponding to kernel variables. -.\"O These variables can be read and sometimes modified using -.\"O the \fI/proc\fP file system, and the (deprecated) -.\"O .BR sysctl (2) -.\"O system call. -.\"O Presently, there are subdirectories -.\"O .IR abi ", " debug ", " dev ", " fs ", " kernel ", " net ", " proc ", " -.\"O .IR rxrpc ", " sunrpc " and " vm -.\"O that each contain more files and subdirectories. -このディレクトリ (1.3.57 以降に存在) はカーネル変数に対応するいくつかの -ファイルとサブディレクトリを含む。 -これらの変数は読み出し可能である。 -また場合によっては \fI/proc\fP ファイルシステムや、 -(非推奨の) システムコール -.BR sysctl (2) -を用いて書き換えることもできる。 -いまのところ -.IR abi ", " debug ", " dev ", " fs ", " kernel ", " net ", " proc ", " -.IR rxrpc ", " sunrpc ", " vm -というサブディレクトリがあって、 -それぞれがファイルとサブディレクトリを含んでいる。 -.TP -.\"O .IR /proc/sys/abi " (since Linux 2.4.10)" -.IR /proc/sys/abi " (Linux 2.4.10 以降)" -.\"O This directory may contain files with application binary information. -.\"O .\" On some systems, it is not present. -.\"O See the kernel source file -.\"O .I Documentation/sysctl/abi.txt -.\"O for more information. -このディレクトリにはアプリケーションのバイナリ情報が入ったファイルが置かれる。 -.\" このファイルが存在しないシステムもある。 -更に詳しい情報は、カーネルソースファイル -.I Documentation/sysctl/abi.txt -を参照すること。 -.TP -.I /proc/sys/debug -.\"O This directory may be empty. -このディレクトリは空の場合もある。 -.TP -.I /proc/sys/dev -.\"O This directory contains device-specific information (e.g., -.\"O .IR dev/cdrom/info ). -.\"O On -.\"O some systems, it may be empty. -このディレクトリにはデバイス特有の情報 (たとえば -.IR dev/cdrom/info ) -が含まれる。 -このディレクトリが空になっているシステムもある。 -.TP -.I /proc/sys/fs -.\"O This contains the subdirectories -.\"O .IR binfmt_misc ", " epoll ", " inotify ", and " mqueue , -.\"O and files -.\"O .IR dentry-state ", " dir-notify-enable ", " dquot-nr ", " file-max ", " -.\"O .IR file-nr ", " inode-max ", " inode-nr ", " inode-state ", " -.\"O .IR lease-break-time ", " leases-enable ", " -.\"O .IR overflowgid ", " overflowuid ", " -.\"O .IR suid_dumpable ", " -.\"O .IR super-max ", and " super-nr . -このディレクトリには、サブディレクトリ -.IR binfmt_misc ", " epoll ", " inotify ", " mqueue -と以下のファイルがある: -.IR dentry-state ", " dir-notify-enable ", " dquot-nr ", " file-max ", " -.IR file-nr ", " inode-max ", " inode-nr ", " inode-state ", " -.IR lease-break-time ", " leases-enable ", " -.IR overflowgid ", " overflowuid ", " -.IR suid_dumpable ", " -.IR super-max ", " super-nr . -.TP -.I /proc/sys/fs/binfmt_misc -.\"O Documentation for files in this directory can be found -.\"O in the kernel sources in -.\"O .IR Documentation/binfmt_misc.txt . -このディレクトリ以下のファイルについてのドキュメントは、 -カーネルソースの -.I Documentation/binfmt_misc.txt -にある。 -.TP -.\"O .IR /proc/sys/fs/dentry-state " (since Linux 2.2)" -.IR /proc/sys/fs/dentry-state " (Linux 2.2 以降)" -.\"O This file contains information about the status of the -.\"O directory cache (dcache). -.\"O The file contains six numbers, -.\"O .IR nr_dentry ", " nr_unused ", " age_limit " (age in seconds), " -.\"O .I want_pages -.\"O (pages requested by system) and two dummy values. -このファイルには、ディレクトリキャッシュ (dcache) の状態に関する情報が -入っている。ファイルには、 -.IR nr_dentry ", " nr_unused ", " age_limit " (秒単位の age), " want_pages -(システムがリクエストしたページ数), ダミーの 2 つの値、 -という 6 つの数字が書かれている。 -.RS -.IP * 2 -.\"O .I nr_dentry -.\"O is the number of allocated dentries (dcache entries). -.\"O This field is unused in Linux 2.2. -.I nr_dentry -は割り当てられた dentry (dcache エントリ) の数である。 -このフィールドは Linux 2.2 では使用されない。 -.IP * -.\"O .I nr_unused -.\"O is the number of unused dentries. -.I nr_unused -は未使用の dentry 数である。 -.IP * -.\"O .I age_limit -.\"O .\" looks like this is unused in kernels 2.2 to 2.6 -.\"O is the age in seconds after which dcache entries -.\"O can be reclaimed when memory is short. -.I age_limit -は、メモリが不足している場合に次に dcache entry を再要求できるように -なるまでの残り時間 (秒数) である。 -.IP * -.\"O .I want_pages -.\" looks like this is unused in kernels 2.2 to 2.6 -.\"O is nonzero when the kernel has called shrink_dcache_pages() and the -.\"O dcache isn't pruned yet. -.I want_pages -は、カーネルが shrink_dcache_pages() を呼び出したが -dcache がまだ縮小されていない場合に、0 以外の値となる。 -.RE -.TP -.I /proc/sys/fs/dir-notify-enable -.\"O This file can be used to disable or enable the -.\"O .I dnotify -.\"O interface described in -.\"O .BR fcntl (2) -.\"O on a system-wide basis. -このファイルは -.BR fcntl (2) -に記述されている -.I dnotify -インターフェースをシステム全体で無効にしたり有効にしたりする。 -.\"O A value of 0 in this file disables the interface, -.\"O and a value of 1 enables it. -このファイルに値 0 が書かれている場合はインターフェースが無効になり、 -値 1 の場合は有効になる。 -.TP -.I /proc/sys/fs/dquot-max -.\"O This file shows the maximum number of cached disk quota entries. -このファイルにはキャッシュされるディスク quota エントリの最大数が書かれている。 -.\"O On some (2.4) systems, it is not present. -(2.4 系の) システムの中には、このファイルが存在しないものもある。 -.\"O If the number of free cached disk quota entries is very low and -.\"O you have some awesome number of simultaneous system users, -.\"O you might want to raise the limit. -キャッシュされるディスク quota エントリの空きが非常に少なく、 -とても多くのシステムユーザーが同時に存在する場合、 -この制限を上げるといいかもしれない。 -.TP -.I /proc/sys/fs/dquot-nr -.\"O This file shows the number of allocated disk quota -.\"O entries and the number of free disk quota entries. -このファイルには割り当てられているディスク quota のエントリ数と、 -空いているディスク quota のエントリ数が書かれている。 -.TP -.\"O .IR /proc/sys/fs/epoll " (since Linux 2.6.28)" -.IR /proc/sys/fs/epoll " (Linux 2.6.28 以降)" -.\"O This directory contains the file -.\"O .IR max_user_watches , -.\"O which can be used to limit the amount of kernel memory consumed by the -.\"O .I epoll -.\"O interface. -.\"O For further details, see -.\"O .BR epoll (7). -このディレクトリには、ファイル -.I max_user_watches -がある。 -これらは、 -.I epoll -インタフェースが消費するカーネルメモリ量を制限するのに使用できる。 -詳細は -.BR epoll (7) -を参照。 -.TP -.I /proc/sys/fs/file-max -.\"O This file defines -.\"O a system-wide limit on the number of open files for all processes. -このファイルはシステム全体でプロセスがオープンできる -ファイル数の上限を定義する。 -.\"O (See also -.\"O .BR setrlimit (2), -.\"O which can be used by a process to set the per-process limit, -.\"O .BR RLIMIT_NOFILE , -.\"O on the number of files it may open.) -(各プロセスがオープンできるファイル数の上限を -.B RLIMIT_NOFILE -によって設定する -.BR setrlimit (2) -も参照すること。) -.\"O If you get lots -.\"O of error messages about running out of file handles, -.\"O try increasing this value: -ファイルハンドルを使い果たして大量にエラーメッセージが出る場合は、 -以下のようにしてこの値を増加させてみよ: -.br - -.br -.nf -.ft CW -echo 100000 > /proc/sys/fs/file-max -.fi -.ft - -.\"O The kernel constant -.\"O .B NR_OPEN -.\"O imposes an upper limit on the value that may be placed in -.\"O .IR file-max . -.I file-max -に書かれている値は、カーネル定数 -.B NR_OPEN -に制限される。 - -.\"O If you increase -.\"O .IR /proc/sys/fs/file-max "," -.\"O be sure to increase -.\"O .I /proc/sys/fs/inode-max -.\"O to 3-4 times the new -.\"O value of -.\"O .IR /proc/sys/fs/file-max "," -.\"O or you will run out of inodes. -.I /proc/sys/fs/file-max -を増やした場合は、 -.I /proc/sys/fs/inode-max -を新しい -.I /proc/sys/fs/file-max -の値の 3-4 倍に増やしておくこと。 -こうしないと inode を使い果たしてしまうだろう。 -.TP -.I /proc/sys/fs/file-nr -.\"O This (read-only) file gives the number of files presently opened. -(このファイルは読み出し専用で) 読み出すと -現在オープンされているファイルの数が得られる。 -.\"O It contains three numbers: the number of allocated file handles; -.\"O the number of free file handles; and the maximum number of file handles. -.\"O The kernel allocates file handles dynamically, but it -.\"O doesn't free them again. -.\"O If the number of allocated files is close to the -.\"O maximum, you should consider increasing the maximum. -このファイルには、割り当てられているファイルハンドル数・ -空いているファイルハンドル数・ファイルハンドル数の最大値、 -という 3 つの数値が書かれている。 -カーネルはファイルハンドルを動的に割り当てるが、 -それを再び解放しない。 -割り当てられているファイル数が最大値に近づいた場合は、 -最大値を大きくすることを考慮すべきである。 -.\"O When the number of free file handles is -.\"O large, you've encountered a peak in your usage of file -.\"O handles and you probably don't need to increase the maximum. -空いているファイルハンドル数が多い場合は、 -ファイルハンドルの使用のピークを経験したことがあり、 -最大値を大きくする必要はないだろう。 -.TP -.I /proc/sys/fs/inode-max -.\"O This file contains the maximum number of in-memory inodes. -このファイルには、メモリ内 inode の最大値が書かれている。 -.\"O On some (2.4) systems, it may not be present. -.\"O This value should be 3-4 times larger -.\"O than the value in -.\"O .IR file-max , -.\"O since \fIstdin\fP, \fIstdout\fP -.\"O and network sockets also need an inode to handle them. -.\"O When you regularly run out of inodes, you need to increase this value. -(2.4 系の) システムによっては、このファイルが存在しないかもしれない。 -この値は -.I file-max -の値の 3-4 倍にすべきである。 -これは \fIstdin\fP, \fIstdout\fP, ネットワークソケットを扱うにも -inode が必要なためである。 -日常的に inode を使い果たしている場合は、この値を増やす必要がある。 -.TP -.I /proc/sys/fs/inode-nr -.\"O This file contains the first two values from -.\"O .IR inode-state . -このファイルには、 -.I inode-state -の最初の 2 つの値が書かれている。 -.TP -.I /proc/sys/fs/inode-state -.\"O This file -.\"O contains seven numbers: -.\"O .IR nr_inodes , -.\"O .IR nr_free_inodes , -.\"O .IR preshrink , -.\"O and four dummy values. -.\"O .I nr_inodes -.\"O is the number of inodes the system has allocated. -.\"O This can be slightly more than -.\"O .I inode-max -.\"O because Linux allocates them one page full at a time. -.\"O .I nr_free_inodes -.\"O represents the number of free inodes. -.\"O .I preshrink -.\"O is nonzero when the -.\"O .I nr_inodes -.\"O > -.\"O .I inode-max -.\"O and the system needs to prune the inode list instead of allocating more. -このファイルには 7 個の値が書かれている: -.IR nr_inodes, -.IR nr_free_inodes , -.IR preshrink -と 4 つのダミーの値である。 -.I nr_inodes -はシステムが確保する inode の数である。 -Linux は 1 度に 1 ページ分いっぱいに nr_inode を確保するので、この値が -.I inode-max -より幾分大きくなることもある。 -.\"Osato: pageful の意味がよく分からない。 -.I nr_free_inodes -は空いている inode の数を表す。 -.IR nr_inodes " > " inode-max -の場合、 -.I preshrink -は 0 以外の値になる。 -この場合システムは inode をさらに確保するのではなく、 -inode リストを切り詰める必要がある。 -.TP -.\"O .IR /proc/sys/fs/inotify " (since Linux 2.6.13)" -.IR /proc/sys/fs/inotify " (Linux 2.6.13 以降)" -.\"O This directory contains files -.\"O .IR max_queued_events ", " max_user_instances ", and " max_user_watches , -.\"O that can be used to limit the amount of kernel memory consumed by the -.\"O .I inotify -.\"O interface. -.\"O For further details, see -.\"O .BR inotify (7). -このディレクトリには、ファイル -.IR max_queued_events ", " max_user_instances ", and " max_user_watches -がある。これらは、 -.I inotify -インタフェースが消費するカーネルメモリ量を制限するのに利用できる。 -詳細は -.BR inotify (7) -を参照。 -.TP -.I /proc/sys/fs/lease-break-time -.\"O This file specifies the grace period that the kernel grants to a process -.\"O holding a file lease -.\"O .RB ( fcntl (2)) -.\"O after it has sent a signal to that process notifying it -.\"O that another process is waiting to open the file. -このファイルは、ファイルを保持しているプロセスに対して -カーネルがシグナルを送り、 -他のプロセスがそのファイルをオープンするのを待っていることを通知してから、 -そのプロセスに対してカーネルがファイルのリース (lease, 貸し出し) -.RB ( fcntl (2) -を参照) を許す猶予期間を指定する。 -.\"O If the lease holder does not remove or downgrade the lease within -.\"O this grace period, the kernel forcibly breaks the lease. -リースホルダ (lease holder: ファイルの貸し出しを受けているプロセス) が -猶予期間中にリースを削除するか階級を低くしない場合、 -カーネルはファイルのリースを強制的に止める。 -.TP -.I /proc/sys/fs/leases-enable -.\"O This file can be used to enable or disable file leases -.\"O .RB ( fcntl (2)) -.\"O on a system-wide basis. -このファイルはシステム全体でのファイルリース -.RB ( fcntl (2) -を参照) を有効または無効にする。 -.\"O If this file contains the value 0, leases are disabled. -.\"O A nonzero value enables leases. -ファイルに値 0 が書き込まれている場合、リースは無効である。 -0 以外の場合にはリースは有効である。 -.TP -.\"O .IR /proc/sys/fs/mqueue " (since Linux 2.6.6)" -.IR /proc/sys/fs/mqueue " (Linux 2.6.6 以降)" -.\"O This directory contains files -.\"O .IR msg_max ", " msgsize_max ", and " queues_max , -.\"O controlling the resources used by POSIX message queues. -このディレクトリにはファイル -.IR msg_max ", " msgsize_max ", and " queues_max -がある。これらは POSIX メッセージキューで使用されるリソースの -制御を行う。 -.\"O See -.\"O .BR mq_overview (7) -.\"O for details. -詳細は -.BR mq_overview (7) -を参照。 -.TP -.\"O .IR /proc/sys/fs/overflowgid " and " /proc/sys/fs/overflowuid -.IR /proc/sys/fs/overflowgid " と " /proc/sys/fs/overflowuid -.\"O These files -.\"O allow you to change the value of the fixed UID and GID. -.\"O The default is 65534. -これらのファイルにより、ユーザーは固定 UID と固定 GID の値を変更できる。 -デフォルトは 65534 である。 -.\"O Some file systems only support 16-bit UIDs and GIDs, although in Linux -.\"O UIDs and GIDs are 32 bits. -.\"O When one of these file systems is mounted -.\"O with writes enabled, any UID or GID that would exceed 65535 is translated -.\"O to the overflow value before being written to disk. -Linux の UID と GID は 32 ビットであるが、 -16 ビットの UID と GID しかサポートしないファイルシステムもある。 -このようなファイルシステムが書き込みを許可してマウントされた場合、 -65535 を超える UID と GID は、 -ディスクに書き込まれる前にオーバーフロー値に変換される。 -.TP -.\"O .IR /proc/sys/fs/suid_dumpable " (since Linux 2.6.13)" -.IR /proc/sys/fs/suid_dumpable " (Linux 2.6.13 以降)" -.\"O .\" The following is based on text from Documentation/sysctl/kernel.txt -.\"O The value in this file determines whether core dump files are -.\"O produced for set-user-ID or otherwise protected/tainted binaries. -.\"O Three different integer values can be specified: -.\" 以下は Documentation/sysctl/kernel.txt の内容に基いている。 -このファイルの値により、set-user-ID されたバイナリや、 -保護がかかった (protected) バイナリ / tainted な (汚染された; -ライセンスがカーネルと適合しない) バイナリに対して、コアダンプファイルを -生成するかどうかが決定される。 -以下の 3つの値を指定することができる: -.sp -\fI0\ (default)\fP -.\"O This provides the traditional (pre-Linux 2.6.13) behavior. -.\"O A core dump will not be produced for a process which has -.\"O changed credentials (by calling -.\"O .BR seteuid (2), -.\"O .BR setgid (2), -.\"O or similar, or by executing a set-user-ID or set-group-ID program) -.\"O or whose binary does not have read permission enabled. -この値を指定すると、以前と同じ (Linux 2.6.13 より前の) 動作をする。 -.RB ( seteuid (2), -.BR setgid (2) -などを呼び出すことや、set-user-ID や set-group-ID されたプログラムを -実行することで) 資格情報 (credentials) が変更されているプロセスや、 -プロセスの実行バイナリの読み出し許可がないプロセスに対して、 -コアダンプを生成しない。 -.sp -\fI1\ ("debug")\fP -.\"O All processes dump core when possible. -.\"O The core dump is owned by the file system user ID of the dumping process -.\"O and no security is applied. -.\"O This is intended for system debugging situations only. -.\"O Ptrace is unchecked. -すべてのプロセスで、可能であればコアダンプを行う。 -コアダンプファイルの所有者は、ダンプを行うプロセスのファイルシステム UID -となり、セキュリティ上の考慮は行われない。 -この値は、システムデバッグの場面だけを想定して設けられている。 -ptrace のチェックも行われない。 -.sp -\fI2\ ("suidsafe")\fP -.\"O Any binary which normally would not be dumped (see "0" above) -.\"O is dumped readable by root only. -.\"O This allows the user to remove the core dump file but not to read it. -.\"O For security reasons core dumps in this mode will not overwrite one -.\"O another or other files. -.\"O This mode is appropriate when administrators are -.\"O attempting to debug problems in a normal environment. -.\"O -.\"Omotoki: "overwrite one another or other files" の訳に自信なし。 -.\"O -通常はダンプされないようなバイナリ (上記の "0" 参照) を -root だけが読み出し可能な形でダンプする。 -この場合、ユーザはそのコアダンプファイルを削除することはできるが、 -読むことはできない。 -セキュリティ上の理由から、このモードのコアダンプでは、 -既存のダンプファイルや他のファイルを上書きすることはない。 -このモードは、管理者が通常の環境で問題を解析しようとする際に -適している。 -.TP -.\"O .I /proc/sys/fs/super-max -.\"O This file -.\"O controls the maximum number of superblocks, and -.\"O thus the maximum number of mounted file systems the kernel -.\"O can have. -.\"O You only need to increase -.\"O .I super-max -.\"O if you need to mount more file systems than the current value in -.\"O .I super-max -.\"O allows you to. -このファイルはスーパブロックの値を制御する。 -この値はカーネルがマウントできるファイルシステムの最大値になる。 -現在、 -.I super-max -で許可されているファイルシステム数以上に -マウントする必要がある場合は、この値を増加させるだけでよい。 -.TP -.I /proc/sys/fs/super-nr -.\"O This file -.\"O contains the number of file systems currently mounted. -このファイルには現在マウントされているファイルシステム数が書かれている。 -.TP -.I /proc/sys/kernel -.\"O This directory contains files controlling a range of kernel parameters, -.\"O as described below. -このディレクトリには、以下で説明する様々なカーネルパラメータを -制御するためのファイルが配置されている。 -.TP -.I /proc/sys/kernel/acct -.\"O This file -.\"O contains three numbers: -.\"O .IR highwater , -.\"O .IR lowwater , -.\"O and -.\"O .IR frequency . -このファイルには 3 つの値が含まれている: -.IR highwater , -.IR lowwater , -.IR frequency -である。 -.\"O If BSD-style process accounting is enabled these values control -.\"O its behavior. -.\"O If free space on file system where the log lives goes below -.\"O .I lowwater -.\"O percent accounting suspends. -.\"O If free space gets above -.\"O .I highwater -.\"O percent accounting resumes. -.\"O .I frequency -.\"O determines -.\"O how often the kernel checks the amount of free space (value is in -.\"O seconds). -.\"O Default values are 4, 2 and 30. -BSD-style process accounting が有効になっている場合、 -これら 3 つの値が動作を制御する。 -ログファイルのあるファイルシステムの空き領域が -.I lowwater -パーセント以下になった場合は、ログ記録を一時停止する。 -空き領域が -.I highwater -パーセント以上になった場合に、ログ記録を再開する。 -.I frequency -はカーネルが空き領域のチェックをする頻度である (単位は秒)。 -デフォルトの値は、4, 2, 30 である。 -.\"O That is, suspend accounting if 2% or less space is free; resume it -.\"O if 4% or more space is free; consider information about amount of free space -.\"O valid for 30 seconds. -つまり、空き領域が 2% 以下になるとログ記録を一時停止し、 -空き領域が 4% 以上となったときに再開する。 -空き領域についての情報は 30 秒間有効である点に注意すること。 -.TP -.\"O .IR /proc/sys/kernel/cap-bound " (from Linux 2.2 to 2.6.24)" -.IR /proc/sys/kernel/cap-bound " (Linux 2.2 to 2.6.24 以降)" -.I /proc/sys/kernel/cap-bound -.\"O This file holds the value of the kernel -.\"O .I "capability bounding set" -.\"O (expressed as a signed decimal number). -このファイルにはカーネルの -.I "capability bounding set" -(符号付き 10 進数表現) の値が書かれている。 -.\"O This set is ANDed against the capabilities permitted to a process -.\"O during -.\"O .BR execve (2). -.BR execve (2) -中は、このセットとプロセスに許可されている権限の AND がとられる。 -.\"O Starting with Linux 2.6.25, -.\"O the system-wide capability bounding set disappeared, -.\"O and was replaced by a per-thread bounding set; see -.\"O .BR capabilities (7). -Linux 2.6.25 以降では、システム全体のケーパビリティバウンディングセットは -なくなり、スレッド単位のバウンディングセットに置き換えられた。 -.BR capabilities (7) -を参照。 -.TP -.I /proc/sys/kernel/core_pattern -.\"O See -.\"O .BR core (5). -.BR core (5) -参照。 -.TP -.I /proc/sys/kernel/core_uses_pid -.\"O See -.\"O .BR core (5). -.BR core (5) -参照。 -.TP -.I /proc/sys/kernel/ctrl-alt-del -.\"O This file -.\"O controls the handling of Ctrl-Alt-Del from the keyboard. -このファイルはキーボードの Ctrl-Alt-Del の扱いを制御する。 -.\"O When the value in this file is 0, Ctrl-Alt-Del is trapped and -.\"O sent to the -.\"O .BR init (8) -.\"O program to handle a graceful restart. -このファイルにある値が 0 の場合、 -Ctrl-Alt-Del が捕捉されると -.BR init (8) -プログラムに送られて、正しく再起動される。 -.\"O When the value is greater than zero, Linux's reaction to a Vulcan -.\"O Nerve Pinch (tm) will be an immediate reboot, without even -.\"O syncing its dirty buffers. -値が 0 より大きい場合、Vulcan Nerve Pinch (tm) に反応して、 -Linux はダーティバッファを同期させることなく、すぐに再起動を行う。 -.\"O Note: when a program (like dosemu) has the keyboard in "raw" -.\"O mode, the ctrl-alt-del is intercepted by the program before it -.\"O ever reaches the kernel tty layer, and it's up to the program -.\"O to decide what to do with it. -注意: プログラム (dosemu など) に "raw" モードのキーボードがある場合、 -ctrl-alt-del はカーネルの tty レイヤーに到達する前に -プログラムに遮断され、 -プログラムに送られてどのように扱うかが決められる。 -.TP -.I /proc/sys/kernel/hotplug -.\"O This file -.\"O contains the path for the hotplug policy agent. -.\"O The default value in this file is -.\"O .IR /sbin/hotplug . -このファイルはホットプラグ・ポリシー・エージェントのパスが書かれている。 -このファイルのデフォルト値は -.I /sbin/hotplug -である。 -.TP -.\"O .IR /proc/sys/kernel/domainname " and " /proc/sys/kernel/hostname -.IR /proc/sys/kernel/domainname " と " /proc/sys/kernel/hostname -.\"O can be used to set the NIS/YP domainname and the -.\"O hostname of your box in exactly the same way as the commands -.\"O .BR domainname (1) -.\"O and -.\"O .BR hostname (1), -.\"O that is: -これらのファイルは、コマンド -.BR domainname (1), -.BR hostname (1) -と全く同じ方法で、 -マシンの NIS/YP ドメイン名とホスト名の設定に使える。 -すなわち - -.in +4n -.nf -.RB "#" " echo \(aqdarkstar\(aq > /proc/sys/kernel/hostname" -.RB "#" " echo \(aqmydomain\(aq > /proc/sys/kernel/domainname" -.fi -.in - -.\"O has the same effect as -は、以下と同じ効果がある。 - -.in +4n -.nf -.RB "#" " hostname \(aqdarkstar\(aq" -.RB "#" " domainname \(aqmydomain\(aq" -.fi -.in - -.\"O Note, however, that the classic darkstar.frop.org has the -.\"O hostname "darkstar" and DNS (Internet Domain Name Server) -.\"O domainname "frop.org", not to be confused with the NIS (Network -.\"O Information Service) or YP (Yellow Pages) domainname. -.\"O These two -.\"O domain names are in general different. -.\"O For a detailed discussion -.\"O see the -.\"O .BR hostname (1) -.\"O man page. -注意: 典型的な darkstar.frop.org という名前には、 -ホスト名 "darkstar" と DNS (Internet Domain Name Server) -ドメイン名 "frop.org" が含まれているが、DNS ドメイン名と -NIS (Network Information Service) または -YP (Yellow Pages) のドメイン名を混同してはならない。 -一般にこれら 2 つのドメイン名は異なる。 -詳細な議論は、 -.BR hostname (1) -の man ページを参照すること。 -.TP -.I /proc/sys/kernel/htab-reclaim -.\"O (PowerPC only) If this file is set to a nonzero value, -.\"O the PowerPC htab -.\"O (see kernel file -.\"O .IR Documentation/powerpc/ppc_htab.txt ) -.\"O is pruned -.\"O each time the system hits the idle loop. -(PowerPC のみ) このファイルを 0 以外の値に設定すると、 -PowerPC htab -(カーネルソースファイル -.I Documentation/powerpc/ppc_htab.txt -参照) を、システムがアイドルループになるたびに切り詰める。 -.TP -.I /proc/sys/kernel/l2cr -.\"O (PowerPC only) This file -.\"O contains a flag that controls the L2 cache of G3 processor -.\"O boards. -.\"O If 0, the cache is disabled. -.\"O Enabled if nonzero. -(PowerPC のみ) このファイルには G3 プロセッサボードの -L2 キャッシュを制御するフラグが含まれる。 -0 の場合、キャッシュは無効になる。 -0 以外の場合は有効になる。 -.TP -.I /proc/sys/kernel/modprobe -.\"O This file contains the path for the kernel module loader. -.\"O The default value is -.\"O .IR /sbin/modprobe . -.\"O The file is only present if the kernel is built with the -.\"O .B CONFIG_KMOD -.\"O option enabled. -このファイルには、カーネルモジュールローダへのパスが含まれる。 -デフォルトの値は -.I /sbin/modprobe -である。このファイルは、 -.B CONFIG_KMOD -オプションを有効にしてカーネルが作成されている場合にのみ存在する。 -.\"O It is described by the kernel source file -.\"O .I Documentation/kmod.txt -.\"O (only present in kernel 2.4 and earlier). -このファイルについては、カーネルソースファイル -.I Documentation/kmod.txt -(カーネル 2.4 以前のみに存在) に記述されている。 -.TP -.I /proc/sys/kernel/msgmax -.\"O This file defines -.\"O a system-wide limit specifying the maximum number of bytes in -.\"O a single message written on a System V message queue. -このファイルは、System V メッセージキューに書き込まれる 1 つのメッセージの -最大バイト数を、システム全体で制限する。 -.TP -.I /proc/sys/kernel/msgmni -.\"O This file defines the system-wide limit on the number of -.\"O message queue identifiers. -.\"O (This file is only present in Linux 2.4 onwards.) -このファイルはメッセージキュー識別子の最大数をシステム全体で制限する。 -(このファイルは Linux 2.4 以降にしか存在しない)。 -.TP -.I /proc/sys/kernel/msgmnb -.\"O This file defines a system-wide parameter used to initialize the -.\"O .I msg_qbytes -.\"O setting for subsequently created message queues. -このファイルは、 -.I msg_qbytes -の設定を初期化するシステム全体のパラメータである。 -.I msg_qbytes -は以降で作成されるメッセージキューで使われる。 -.\"O The -.\"O .I msg_qbytes -.\"O setting specifies the maximum number of bytes that may be written to the -.\"O message queue. -.I msg_qbytes -設定では、メッセージキューに書き込まれる最大バイト数を指定する。 -.TP -.\"O .IR /proc/sys/kernel/ostype " and " /proc/sys/kernel/osrelease -.IR /proc/sys/kernel/ostype " と " /proc/sys/kernel/osrelease -.\"O These files -.\"O give substrings of -.\"O .IR /proc/version . -これらのファイルは文字列 -.I /proc/version -の各部分を与える。 -.TP -.\"O .IR /proc/sys/kernel/overflowgid " and " /proc/sys/kernel/overflowuid -.IR /proc/sys/kernel/overflowgid " と " /proc/sys/kernel/overflowuid -.\"O These files duplicate the files -.\"O .I /proc/sys/fs/overflowgid -.\"O and -.\"O .IR /proc/sys/fs/overflowuid . -これらのファイルは -.I /proc/sys/fs/overflowgid -と -.I /proc/sys/fs/overflowuid -を複製したものである。 -.TP -.I /proc/sys/kernel/panic -.\"O This file gives read/write access to the kernel variable -.\"O .IR panic_timeout . -.\"O If this is zero, the kernel will loop on a panic; if nonzero -.\"O it indicates that the kernel should autoreboot after this number -.\"O of seconds. -.\"O When you use the -.\"O software watchdog device driver, the recommended setting is 60. -このファイルはカーネル変数 -.I panic_timeout -への読み出しと書き込みのアクセスを与える。 -この値が 0 ならば、パニック時にカーネルは (無限) ループに入る。 -0 でなければ、その秒数だけ待ってから自動的に再起動する。 -ソフトウェア watchdog ドライバを使っている場合、 -推奨される設定は 60 である。 -.TP -.\"O .IR /proc/sys/kernel/panic_on_oops " (since Linux 2.5.68)" -.IR /proc/sys/kernel/panic_on_oops " (Linux 2.5.68 以降)" -.\"O This file controls the kernel's behavior when an oops -.\"O or BUG is encountered. -.\"O If this file contains 0, then the system -.\"O tries to continue operation. -.\"O If it contains 1, then the system -.\"O delays a few seconds (to give klogd time to record the oops output) -.\"O and then panics. -このファイルは、oops や BUG が起こった場合のカーネルの動作を制御する。 -ファイルに 0 が書かれている場合、システムは操作を続行しようとする。 -1 が書かれている場合、システムは -(klogd が oops 出力を記録する時間を与えるために) 数秒間遅延した後、 -panic を起こす。 -.\"O If the -.\"O .I /proc/sys/kernel/panic -.\"O file is also nonzero then the machine will be rebooted. -.I /proc/sys/kernel/panic -ファイルも 0 でない場合、マシンは再起動される。 -.TP -.\"O .IR /proc/sys/kernel/pid_max " (since Linux 2.5.34)" -.IR /proc/sys/kernel/pid_max " (Linux 2.5.34 以降)" -.\"O This file specifies the value at which PIDs wrap around -.\"O (i.e., the value in this file is one greater than the maximum PID). -このファイルは、PID をいくつで終了にするかを指定する -(すなわち、このファイルの値は最大 PID より 1 大きい)。 -.\"O The default value for this file, 32768, -.\"O results in the same range of PIDs as on earlier kernels. -このファイルのデフォルト値は 32768 であり、 -その場合には以前のカーネルと同じ PID の範囲になる。 -.\"O On 32-bit platforms, 32768 is the maximum value for -.\"O .IR pid_max . -.\"O On 64-bit systems, -.\"O .I pid_max -.\"O can be set to any value up to 2^22 -.\"O .RB ( PID_MAX_LIMIT , -.\"O approximately 4 million). -32ビットのプラットフォームでは、 -.I pid_max -の最大値は 32768 である。 -64ビットのプラットフォームでは、 -2^22 -.RB ( PID_MAX_LIMIT , -約 4,000,000) までの任意の値を設定できる。 -.\" Prior to 2.6.10, pid_max could also be raised above 32768 on 32-bit -.\" platforms, but this broke /proc/[pid] -.\" See http://marc.theaimsgroup.com/?l=linux-kernel&m=109513010926152&w=2 -.TP -.\"O .IR /proc/sys/kernel/powersave-nap " (PowerPC only)" -.IR /proc/sys/kernel/powersave-nap " (PowerPC のみ)" -.\"O This file contains a flag. -.\"O If set, Linux-PPC will use the "nap" mode of -.\"O powersaving, -.\"O otherwise the "doze" mode will be used. -このファイルにはフラグが書かれている。 -フラグが設定されると、Linux-PPC は -省電力の "nap" モードを使う。 -設定されない場合は、"doze" モードが使われる。 -.TP -.I /proc/sys/kernel/printk -.\"O The four values in this file are -.\"O .IR console_loglevel , -.\"O .IR default_message_loglevel , -.\"O .IR minimum_console_level , -.\"O and -.\"O .IR default_console_loglevel . -.\"O These values influence -.\"O .I printk() -.\"O behavior when printing or logging error messages. -.\"O See -.\"O .BR syslog (2) -.\"O for more info on the different loglevels. -このファイルにある 4 つの値は、 -.IR console_loglevel , -.IR default_message_loglevel , -.IR minimum_console_loglevel , -.IR default_console_loglevel -である。 -.\"Osato: -.\"Osato: minimum_console_level は minimum_console_loglevel の間違い? -.\"Osato: -これらの値はエラーメッセージを表示したり記録したりする -.I printk() -の動作に影響する。 -各 loglevel の情報については、 -.BR syslog (2) -を参照すること。 -.\"O Messages with a higher priority than -.\"O .I console_loglevel -.\"O will be printed to the console. -.\"O Messages without an explicit priority will be printed with priority -.\"O .IR default_message_level . -.\"O .I minimum_console_loglevel -.\"O is the minimum (highest) value to which -.\"O .I console_loglevel -.\"O can be set. -.\"O .I default_console_loglevel -.\"O is the default value for -.\"O .IR console_loglevel . -優先度が -.I console_loglevel -以上のメッセージは、コンソールに表示される。 -優先度が明示されていないメッセージは、優先度が -.I default_message_level -のときに表示される。 -.I minimum_console_loglevel -は -.I console_loglevel -に設定できる最小 (最高) の値である。 -.I default_console_loglevel -は -.I console_loglevel -のデフォルトの値である。 -.TP -.\"O .IR /proc/sys/kernel/pty " (since Linux 2.6.4)" -.IR /proc/sys/kernel/pty " (Linux 2.6.4 以降)" -.\"O This directory contains two files relating to the number of Unix 98 -.\"O pseudo-terminals (see -.\"O .BR pts (4)) -.\"O on the system. -このディレクトリは、Unix 98 疑似端末 -.RB ( pts (4) -を参照) の数に関連する 2 つのファイルを含む。 -.TP -.I /proc/sys/kernel/pty/max -.\"O This file defines the maximum number of pseudo-terminals. -このファイルは疑似端末の最大数を定義する。 -.TP -.I /proc/sys/kernel/pty/nr -.\"O This read-only file -.\"O indicates how many pseudo-terminals are currently in use. -この読み出し専用のファイルは、現在いくつの疑似端末が使われているかを表す。 -.TP -.I /proc/sys/kernel/random -.\"O This directory -.\"O .I random -.\"O contains various parameters controlling the operation of the file -.\"O .IR /dev/random . -.\"O See -.\"O .BR random (4) -.\"O for further information. -このディレクトリは、ファイル -.I /dev/random -の操作を制御する様々なパラメータが書かれている。 -詳細は -.BR random (4) -を参照。 -.TP -.I /proc/sys/kernel/real-root-dev -.\"O This file is documented in the kernel source file -.\"O .IR Documentation/initrd.txt . -このファイルはカーネルソースファイル -.I Documentation/initrd.txt -に記述されている。 -.TP -.\"O .IR /proc/sys/kernel/reboot-cmd " (Sparc only) " -.IR /proc/sys/kernel/reboot-cmd " (Sparc のみ) " -.\"O This file seems to be a way to give an argument to the SPARC -.\"O ROM/Flash boot loader. -.\"O Maybe to tell it what to do after -.\"O rebooting? -このファイルは SPARC ROM/Flash ブートローダに引き数を渡す方法を -提供しているように思われる。 -再起動後に何をするかを指定しているのだろうか? -.TP -.I /proc/sys/kernel/rtsig-max -.\"O (Only in kernels up to and including 2.6.7; see -.\"O .BR setrlimit (2)) -(2.6.7 までのカーネルにのみ存在する。 -.BR setrlimit (2) -を参照すること) -.\"O This file can be used to tune the maximum number -.\"O of POSIX real-time (queued) signals that can be outstanding -.\"O in the system. -このファイルはシステムで発行される POSIX real-time (queued) signal の -最大数を調整するのに使用される。 -.TP -.I /proc/sys/kernel/rtsig-nr -.\"O (Only in kernels up to and including 2.6.7.) -(2.6.7 までのカーネルにのみ存在する) -.\"O This file shows the number POSIX real-time signals currently queued. -このファイルは現在キューに入っている POSIX real-time signal の数を表す。 -.TP -.\"O .IR /proc/sys/kernel/sem " (since Linux 2.4)" -.IR /proc/sys/kernel/sem " (Linux 2.4 以降)" -.\"O This file contains 4 numbers defining limits for System V IPC semaphores. -このファイルには System V IPC セマフォを制限する 4 つの値が書かれている。 -.\"O These fields are, in order: -これらのフィールドは次の順番に並んでいる: -.RS -.IP SEMMSL 8 -.\"O The maximum semaphores per semaphore set. -セマフォ集合ごとのセマフォ数の最大値。 -.IP SEMMNS 8 -.\"O A system-wide limit on the number of semaphores in all semaphore sets. -システム全体での、全てのセマフォ集合におけるセマフォ数の制限。 -.IP SEMOPM 8 -.\"O The maximum number of operations that may be specified in a -.\"O .BR semop (2) -.\"O call. -.BR semop (2) -コールに指定されるオペレーション数の最大値。 -.IP SEMMNI 8 -.\"O A system-wide limit on the maximum number of semaphore identifiers. -システム全体でのセマフォ識別子の最大値。 -.RE -.TP -.I /proc/sys/kernel/sg-big-buff -.\"O This file -.\"O shows the size of the generic SCSI device (sg) buffer. -このファイルは、汎用 SCSI デバイス (sg) のバッファサイズの最大値を表す。 -.\"O You can't tune it just yet, but you could change it at -.\"O compile time by editing -.\"O .I include/scsi/sg.h -.\"O and changing -.\"O the value of -.\"O .BR SG_BIG_BUFF . -.\"O However, there shouldn't be any reason to change this value. -今はこれを変更することはできないが、 -コンパイル時に -.I include/scsi/sg.h -を編集して -.B SG_BIG_BUFF -の値を変えれば変更できる。 -ただし、この値を変更する理由はないだろう。 -.TP -.I /proc/sys/kernel/shmall -.\"O This file -.\"O contains the system-wide limit on the total number of pages of -.\"O System V shared memory. -このファイルには System V 共有メモリの総ページ数の -システム全体での制限が書かれている。 -.TP -.I /proc/sys/kernel/shmmax -.\"O This file -.\"O can be used to query and set the run-time limit -.\"O on the maximum (System V IPC) shared memory segment size that can be -.\"O created. -このファイルを通じて、(System V IPC) 共有メモリセグメントを作成するときの -最大サイズの実行時上限 (run-time limit) を取得または設定できる。 -.\"O Shared memory segments up to 1GB are now supported in the -.\"O kernel. -.\"O This value defaults to -.\"O .BR SHMMAX . -現在は 1GB までの共有メモリセグメントが -カーネルでサポートされている。 -この値のデフォルトは -.B SHMMAX -である。 -.TP -.I /proc/sys/kernel/shmmni -.\"O (available in Linux 2.4 and onwards) -(Linux 2.4 以降で使用可能) -.\"O This file -.\"O specifies the system-wide maximum number of System V shared memory -.\"O segments that can be created. -このファイルは、システム全体で作成可能な -System V 共有メモリセグメント数を指定する。 -.TP -.I /proc/sys/kernel/sysrq -.\"O This file controls the functions allowed to be invoked by the SysRq key. -.\"O By default, -.\"O the file contains 1 meaning that every possible SysRq request is allowed -.\"O (in older kernel versions, SysRq was disabled by default, -.\"O and you were required to specifically enable it at run-time, -.\"O but this is not the case any more). -このファイルは、SysRq キーにより起動が許可されている関数群を制御する -ものである。デフォルトでは、ファイルの内容は 1 であり、 -これは起こり得る全ての SysRq リクエストが許可されることを意味する -(古いバージョンのカーネルでは、SysRq はデフォルトでは無効になっており、 -実行時に明示的に有効にする必要があったが、今はそうではない)。 -.\"O Possible values in this file are: -このファイルで指定可能な値は以下の通り。 - -.\"O 0 - disable sysrq completely -.\"O 1 - enable all functions of sysrq -.\"O >1 - bitmask of allowed sysrq functions, as follows: -.\"O 2 - enable control of console logging level -.\"O 4 - enable control of keyboard (SAK, unraw) -.\"O 8 - enable debugging dumps of processes etc. -.\"O 16 - enable sync command -.\"O 32 - enable remount read-only -.\"O 64 - enable signalling of processes (term, kill, oom-kill) -.\"O 128 - allow reboot/poweroff -.\"O 256 - allow nicing of all real-time tasks - 0 - sysrq を完全に無効にする - 1 - sysrq の全ての関数を有効にする - >1 - 許可する sysrq 関数のビットマスク。内訳は以下の通り。 - 2 - コンソールのログ・レベルの制御を有効にする - 4 - キーボードの制御を有効にする (SAK, unraw) - 8 - プロセスなどのデバッグ・ダンプを有効にする - 16 - sync コマンドを有効にする - 32 - 読み出し専用での再マウントを有効にする - 64 - プロセスへのシグナル発行を有効にする (term, kill, oom-kill) - 128 - リブート/電源オフを許可する - 256 - 全てのリアルタイム・タスクの nice 値の変更を許可する - -.\"O This file is only present if the -.\"O .B CONFIG_MAGIC_SYSRQ -.\"O kernel configuration option is enabled. -.\"O For further details see the kernel source file -.\"O .IR Documentation/sysrq.txt . -カーネル設定オプション -.B CONFIG_MAGIC_SYSRQ -が有効な場合のみ、このファイルは存在する。 -詳細は、カーネルソースファイル -.I Documentation/sysrq.txt -を参照のこと。 -.TP -.I /proc/sys/kernel/version -.\"O This file contains a string like: -このファイルには、以下のような文字列が書かれている: - - #5 Wed Feb 25 21:49:24 MET 1998 - -.\"O The "#5" means that -.\"O this is the fifth kernel built from this source base and the -.\"O date behind it indicates the time the kernel was built. -\&"#5" はこのソースで構築された 5 番目のカーネルであることを意味する。 -その後にある日付はカーネルが構築された時刻を表す。 -.TP -.\"O .IR /proc/sys/kernel/threads-max " (since Linux 2.3.11)" -.IR /proc/sys/kernel/threads-max " (Linux 2.3.11 以降)" -.\"O This file specifies the system-wide limit on the number of -.\"O threads (tasks) that can be created on the system. -このファイルは、システム全体で作成可能なスレッド数 -(タスク数) の上限を指定する。 -.TP -.\"O .IR /proc/sys/kernel/zero-paged " (PowerPC only) " -.IR /proc/sys/kernel/zero-paged " (PowerPC のみ) " -.\"O This file -.\"O contains a flag. -.\"O When enabled (nonzero), Linux-PPC will pre-zero pages in -.\"O the idle loop, possibly speeding up get_free_pages. -このファイルはフラグを含む。 -(0 以外の値で) 有効された場合、Linux-PPC はアイドルループで -pre-zero page を行うので、get_free_pages の速度が向上する可能性がある。 -.\"Osato: -.\"Osato: pre-zero page の訳語が分からない。 -.\"Osato: -.TP -.I /proc/sys/net -.\"O This directory contains networking stuff. -.\"O Explanations for some of the files under this directory can be found in -.\"O .BR tcp (7) -.\"O and -.\"O .BR ip (7). -このディレクトリにはネットワーク関係の情報が入っている。 -このディレクトリにあるファイルのいくつかについては、 -.BR tcp (7) -や -.BR ip (7) -に説明がある。 -.TP -.I /proc/sys/net/core/somaxconn -.\"O This file defines a ceiling value for the -.\"O .I backlog -.\"O argument of -.\"O .BR listen (2); -.\"O see the -.\"O .BR listen (2) -.\"O manual page for details. -このファイルは -.BR listen (2) -の -.I backlog -引き数の上限値を規定する。 -詳細は -.BR listen (2) -のマニュアルページを参照。 -.TP -.I /proc/sys/proc -.\"O This directory may be empty. -このディレクトリはたぶん空である。 -.TP -.I /proc/sys/sunrpc -.\"O This directory supports Sun remote procedure call for network file system -.\"O (NFS). -.\"O On some systems, it is not present. -このディレクトリはネットワークファイルシステム (NFS) への -Sun remote procedure call (遠隔手続き呼び出し) をサポートする。 -これが存在しないシステムもある。 -.TP -.I /proc/sys/vm -.\"O This directory contains files for memory management tuning, buffer and -.\"O cache management. -このディレクトリにはメモリ管理の調整、バッファやキャッシュ管理のための -ファイルがある。 -.TP -.\"O .IR /proc/sys/vm/drop_caches " (since Linux 2.6.16)" -.IR /proc/sys/vm/drop_caches " (Linux 2.6.16 以降)" -.\"O Writing to this file causes the kernel to drop clean caches, dentries and -.\"O inodes from memory, causing that memory to become free. -このファイルに書き込みを行うことで、クリーンなキャッシュ、dentry、 -inode をメモリ上から外し、そのメモリを解放する。 - -.\"O To free pagecache, use -.\"O .IR "echo 1 > /proc/sys/vm/drop_caches" ; -.\"O to free dentries and inodes, use -.\"O .IR "echo 2 > /proc/sys/vm/drop_caches" ; -.\"O to free pagecache, dentries and inodes, use -.\"O .IR "echo 3 > /proc/sys/vm/drop_caches" . -ページキャッシュを解放するには、 -.I "echo 1 > /proc/sys/vm/drop_caches" -とする。 dentry、inode を解放するには、 -.I "echo 2 > /proc/sys/vm/drop_caches" -とする。ページキャッシュ、dentry、inode を解放するには、 -.IR "echo 3 > /proc/sys/vm/drop_caches" -とする。 - -.\"O Because this is a nondestructive operation and dirty objects -.\"O are not freeable, the -.\"O user should run -.\"O .BR sync (8) -.\"O first. -この操作は非破壊的な操作で、ダーティな (dirty) オブジェクトは -解放されないので、この操作を行う際は最初に -.BR sync (8) -を実行しておくべきである。 -.TP -.IR /proc/sys/vm/swappiness -.\" The following is from Documentation/sysctl/vm.txt -.\"O The value in this file controls how aggressively the kernel will swap -.\"O memory pages. -.\"O Higher values increase aggressiveness, lower values -.\"O descrease aggressiveness. -.\"O The default value is 60. -このファイルの値により、カーネルがどの程度激しくメモリページの -スワップを行うかが制御される。 -大きな値ほどスワップが激しくなり、小さい値ほど激しくなくなる。 -デフォルト値は 60 である。 -.TP -.\"O .IR /proc/sys/vm/legacy_va_layout " (since Linux 2.6.9)" -.IR /proc/sys/vm/legacy_va_layout " (Linux 2.6.9 以降)" -.\"O .\" The following is from Documentation/filesystems/proc.txt -.\"O If nonzero, this disables the new 32-bit memory-mapping layout; -.\"O the kernel will use the legacy (2.4) layout for all processes. -.\" 以下の記述は Documentation/filesystems/proc.txt からの引用である。 -0 以外の場合、新しい 32ビットメモリマッピング配置が無効になり、 -カーネルは全てのプロセスに対して従来の (カーネル 2.4 の) 配置方法を -使用する。 -.TP -.\"O .IR /proc/sys/vm/oom_dump_tasks " (since Linux 2.6.25)" -.IR /proc/sys/vm/oom_dump_tasks " (Linux 2.6.25 以降)" -.\" The following is from Documentation/sysctl/vm.txt -.\"O Enables a system-wide task dump (excluding kernel threads) to be -.\"O produced when the kernel performs an OOM-killing. -カーネルが OOM-killing を実行する際に、システム全体のタスク・ダンプ -(カーネルスレッドを除く) を生成するかを制御する。 -.\"O The dump includes the following information -.\"O for each task (thread, process): -.\"O thread ID, real user ID, thread group ID (process ID), -.\"O virtual memory size, resident set size, -.\"O the CPU that the task is scheduled on, -.\"O oom_adj score (see the description of -.\"O .IR /proc/[pid]/oom_adj ), -.\"O and command name. -ダンプには、タスク (スレッド、プロセス) 毎に以下の情報が出力される: -スレッド ID、実ユーザ ID、スレッドグループ ID (プロセス ID)、 -仮想メモリサイズ、Resident Set Size (実メモリ上に存在するページサイズ)、 -タスクがスケジューリングされた CPU、 -oom_adj スコア -.RI ( /proc/[pid]/oom_adj -の説明を参照)、コマンド名。 -.\"O This is helpful to determine why the OOM-killer was invoked -.\"O and to identify the rogue task that caused it. -このダンプ情報は、なぜ OOM-killer が起動されたかを知り、 -その原因となったならず者のタスクを特定するのに役に立つ。 - -.\"O If this contains the value zero, this information is suppressed. -.\"O On very large systems with thousands of tasks, -.\"O it may not be feasible to dump the memory state information for each one. -.\"O Such systems should not be forced to incur a performance penalty in -.\"O OOM situations when the information may not be desired. -このファイルの内容が値 0 の場合、ダンプ情報の出力は行われない。 -タスクが何千もある非常に巨大なシステムでは、 -各々のタスクについてメモリ状態をダンプするのは適切でないかもしれない。 -そのようなシステムでは、ダンプ情報が必要でもないときに -メモリ不足 (OOM) の状況で性能面の不利益が起こらないようにすべきだろう。 - -.\"O If this is set to nonzero, this information is shown whenever the -.\"O OOM-killer actually kills a memory-hogging task. -このファイルの内容が 0 以外の場合、 -OOM-killer が実際にメモリを占有したタスクを kill する度に -ダンプ情報が出力される。 - -.\"O The default value is 0. -デフォルト値は 0 である。 -.TP -.\"O .IR /proc/sys/vm/oom_kill_allocating_task " (since Linux 2.6.24)" -.IR /proc/sys/vm/oom_kill_allocating_task " (Linux 2.6.24 以降)" -.\" The following is from Documentation/sysctl/vm.txt -.\"O This enables or disables killing the OOM-triggering task in -.\"O out-of-memory situations. -このファイルは、メモリ不足 (OOM) の状況が起こった際に、 -メモリ不足のきっかけとなったタスクを kill するかどうかを制御する。 - -.\"O If this is set to zero, the OOM-killer will scan through the entire -.\"O tasklist and select a task based on heuristics to kill. -.\"O This normally selects a rogue memory-hogging task that -.\"O frees up a large amount of memory when killed. -このファイルが 0 に設定された場合、 -OOM-killer はタスクリスト全体をスキャンし、経験則に基づき -kill するタスクを選択する。 -通常は、kill した場合に多くのメモリが解放できる、 -ならず者のメモリ占有タスクが選択される。 - -.\"O If this is set to nonzero, the OOM-killer simply kills the task that -.\"O triggered the out-of-memory condition. -.\"O This avoids a possibly expensive tasklist scan. -このファイルが 0 以外に設定された場合、 -OOM-killer はメモリ不足の状況が発生するきっかけとなったタスクを -単純に kill するだけである。 -これにより、たいていは重い処理となるタスクリストのスキャンを回避できる。 - -.\"O If -.\"O .I /proc/sys/vm/panic_on_oom -.\"O is nonzero, it takes precedence over whatever value is used in -.\"O .IR /proc/sys/vm/oom_kill_allocating_task . -.I /proc/sys/vm/panic_on_oom -が 0 以外の場合、 -.I /proc/sys/vm/oom_kill_allocating_task -にどのような値が入っていたとしても、 -.I /proc/sys/vm/panic_on_oom -の方が優先される。 - -.\"O The default value is 0. -デフォルト値は 0 である。 -.TP -.I /proc/sys/vm/overcommit_memory -.\"O This file contains the kernel virtual memory accounting mode. -.\"O Values are: -このファイルにはカーネル仮想メモリのアカウントモードが書かれている。 -値は以下の通り: -.RS -.IP -.\"O 0: heuristic overcommit (this is the default) -0: 発見的なオーバーコミット (heuristic overcommit) (これがデフォルトである) -.br -.\"O 1: always overcommit, never check -1: 常にオーバーコミットし、チェックしない。 -.br -.\"O 2: always check, never overcommit -2: 常にチェックし、オーバーコミットしない。 -.RE -.IP -.\"O In mode 0, calls of -.\"O .BR mmap (2) -.\"O with -.\"O .B MAP_NORESERVE -.\"O are not checked, and the default check is very weak, -.\"O leading to the risk of getting a process "OOM-killed". -モード 0 では、 -.B MAP_NORESERVE -を設定して呼び出された -.BR mmap (2) -はチェックされない。 -またデフォルトのチェックはとても脆弱で、 -プロセスを "OOM-kill" してしまうリスクを引き起こす。 -.\"O Under Linux 2.4 any nonzero value implies mode 1. -Linux 2.4 では 0 以外の値はモード 1 を意味する。 -.\"O In mode 2 (available since Linux 2.6), the total virtual address space -.\"O on the system is limited to (SS + RAM*(r/100)), -.\"O where SS is the size of the swap space, and RAM -.\"O is the size of the physical memory, and r is the contents of the file -.\"O .IR /proc/sys/vm/overcommit_ratio . -(Linux 2.6 以降で利用可能な) モード 2 では、 -システム上の仮想アドレス空間の合計が (SS + RAM*(r/100)) に制限されている。 -ここで、SS はスワップ空間のサイズ、 -RAM は物理メモリのサイズ、r はファイル -.I /proc/sys/vm/overcommit_ratio -の内容である。 -.TP -.I /proc/sys/vm/overcommit_ratio -.\"O See the description of -.\"O .IR /proc/sys/vm/overcommit_memory . -.I /proc/sys/vm/overcommit_memory -の説明を参照すること。 -.TP -.\"O .IR /proc/sys/vm/panic_on_oom " (since Linux 2.6.18)" -.IR /proc/sys/vm/panic_on_oom " (Linux 2.6.18 以降)" -.\" The following is adapted from Documentation/sysctl/vm.txt -.\"O This enables or disables a kernel panic in -.\"O an out-of-memory situation. -このファイルは、メモリ不足時にカーネルパニックを -起こすか起こさないかを制御する。 - -.\"O If this file is set to the value 0, -.\"O the kernel's OOM-killer will kill some rogue process. -.\"O Usually, the OOM-killer is able to kill a rogue process and the -.\"O system will survive. -このファイルに値 0 を設定すると、 -カーネルの OOM-killer がならず者のプロセスを kill する。 -普通は、OOM-killer がならず者のプロセスを kill することができ、 -システムは何とか動き続けることができる。 - -.\"O If this file is set to the value 1, -.\"O then the kernel normally panics when out-of-memory happens. -.\"O However, if a process limits allocations to certain nodes -.\"O using memory policies -.\"O .RB ( mbind (2) -.\"O .BR MPOL_BIND ) -.\"O or cpusets -.\"O .RB ( cpuset (7)) -.\"O and those nodes reach memory exhaustion status, -.\"O one process may be killed by the OOM-killer. -.\"O No panic occurs in this case: -.\"O because other nodes' memory may be free, -.\"O this means the system as a whole may not have reached -.\"O an out-of-memory situation yet. -このファイルに値 1 を設定すると、 -メモリ不足の状況が発生すると、カーネルは普通はパニックする。 -しかしながら、プロセスが -メモリポリシー -.RB ( mbind (2) -の -.BR MPOL_BIND ) -や cpusets -.RB ( cpuset (7)) -を使って特定のノードへのメモリ割り当てを制限していて、 -それらのノードでメモリ枯渇状態に至った場合は、 -一つのプロセスが OOM-killer により kill されるだけかもしれない。 -この場合には、カーネルパニックは発生しない。 -なぜなら、他のノードのメモリには空きがあるかもしれず、 -したがって、システム全体としてはメモリ不足の状況にまだ達していないかも -しれないからである。 - -.\"O If this file is set to the value 2, -.\"O the kernel always panics when an out-of-memory condition occurs. -このファイルに値 2 を設定すると、 -メモリ不足の状況が発生するとカーネルは常にパニックを起こす。 - -.\"O The default value is 0. -.\"O 1 and 2 are for failover of clustering. -.\"O Select either according to your policy of failover. -デフォルト値は 0 である。 -1 と 2 はクラスタリングのフェイルオーバー用である。 -フェイルオーバーの方針に応じてどちらかの値を選択すること。 -.TP -.\"O .IR /proc/sysrq-trigger " (since Linux 2.4.21)" -.IR /proc/sysrq-trigger " (Linux 2.4.21 以降)" -.\"O Writing a character to this file triggers the same SysRq function as -.\"O typing ALT-SysRq- (see the description of -.\"O .IR /proc/sys/kernel/sysrq ). -.\"O This file is normally only writable by -.\"O .IR root . -.\"O For further details see the kernel source file -.\"O .IR Documentation/sysrq.txt . -このファイルに文字 character を書き込むと、 -キーボードから ALT-SysRq- を入力した場合と -同じ SysRq 関数が起動される -.RI ( /proc/sys/kernel/sysrq -の説明を参照)。 -通常、このファイルへ書き込みができるのは -.I root -だけである。詳細については、カーネルソースファイルの -.I Documentation/sysrq.txt -を参照のこと。 -.TP -.I /proc/sysvipc -.\"O Subdirectory containing the pseudo-files -.\"O .IR msg ", " sem " and " shm "." -疑似ファイル -.IR msg ", " sem ", " shm -を含むサブディレクトリ。 -.\"O These files list the System V Interprocess Communication (IPC) objects -.\"O (respectively: message queues, semaphores, and shared memory) -.\"O that currently exist on the system, -.\"O providing similar information to that available via -.\"O .BR ipcs (1). -これらのファイルは、現在システム上に存在する -System V プロセス間通信 (Interprocess Communication, IPC) オブジェクト -(それぞれ: メッセージキュー、セマフォ、共有メモリ) -のリストであり、 -.BR ipcs (1) -で取得できる情報と同じものを提供する。 -.\"O These files have headers and are formatted (one IPC object per line) -.\"O for easy understanding. -これらのファイルにはヘッダがあり、理解しやすいように -(1 行につき 1 個の IPC オブジェクトの形式で) フォーマットされている。 -.\"O .BR svipc (7) -.\"O provides further background on the information shown by these files. -.BR svipc (7) -にはこれらのファイルから分かる情報の詳細な背景が書かれている。 -.TP -.I /proc/tty -.\"O Subdirectory containing the pseudo-files and subdirectories for -.\"O tty drivers and line disciplines. -疑似ファイルを含むサブディレクトリ。 -tty ドライバとライン設定 (line discipline) の書かれた -サブディレクトリも含まれる。 -.TP -.I /proc/uptime -.\"O This file contains two numbers: the uptime of the system (seconds), -.\"O and the amount of time spent in idle process (seconds). -このファイルは -システム起動時から経過した時間 (秒) と -アイドル (idle) しているプロセスが消費した時間 (秒) の 2 つの数を含む。 -.TP -.I /proc/version -.\"O This string identifies the kernel version that is currently running. -.\"O It includes the contents of -.\"O .IR /proc/sys/kernel/ostype , -.\"O .I /proc/sys/kernel/osrelease -.\"O and -.\"O .IR /proc/sys/kernel/version . -.\"O For example: -現在稼働しているカーネルのバージョン識別å­ã§ã‚る文字列。 -これには -.IR /proc/sys/ostype , -.IR /proc/sys/osrelease , -.I /proc/sys/version -の内容が含まれる。 -たとえばこのように: -.nf -.in -2 -.ft CW -Linux version 1.0.9 (quinlan@phaze) #1 Sat May 14 01:51:54 EDT 1994 -.ft -.in +2 -.fi -.\" FIXME Document /proc/timer_list -.\" .TP -.\" .IR /proc/timer_list " (since Linux 2.6.21)" -.\" See the 2.6.21 Change log -.\" FIXME Document /proc/timer_stats -.\" .TP -.\" .IR /proc/timer_stats " (since Linux 2.6.21)" -.\" See the 2.6.21 Change log -.TP -.\"O .IR /proc/vmstat " (since Linux 2.6)" -.IR /proc/vmstat " (Linux 2.6 以降)" -.\"O This file displays various virtual memory statistics. -このファイルは仮想メモリの様々な統計情報を表示する。 -.TP -.\"O .IR /proc/zoneinfo " (since Linux 2.6.13)" -.IR /proc/zoneinfo " (Linux 2.6.13 以降)" -.\"O This file display information about memory zones. -.\"O This is useful for analyzing virtual memory behavior. -.\"O .\" FIXME more should be said about /proc/zoneinfo -このファイルはメモリのゾーン (memory zone) に関する情報を表示する。 -仮想メモリの振舞いを分析するのに役立つ。 -.\" FIXME -- /proc/zoneinfo についてもっと説明が必要だ -.\"O .SH NOTES -.SH 注意 -.\"O Many strings (i.e., the environment and command line) are in -.\"O the internal format, with subfields terminated by null bytes (\(aq\\0\(aq), -.\"O so you -.\"O may find that things are more readable if you use \fIod \-c\fP or \fItr -.\"O "\\000" "\\n"\fP to read them. -ほとんどの文字列 (たとえば環境変数やコマンド行) は内部表現のままなので、 -各フィールドは NULL バイト (\(aq\\0\(aq) で区切られている。 -だから、\fIod \-c\fP や \fItr "\\000" "\\n"\fP を使えば、 -それらはより読みやすくなる。 -.\"O Alternatively, \fIecho \`cat \`\fP works well. -また \fIecho \`cat \`\fP でもよい。 - -.\"O This manual page is incomplete, possibly inaccurate, and is the kind -.\"O of thing that needs to be updated very often. -このマニュアルは不完全であり、たぶん不正確で、しばしば更新される必要がある。 -.\"O .\" .SH ACKNOWLEDGEMENTS -.\" .SH 謝辞 -.\"O .\" The material on /proc/sys/fs and /proc/sys/kernel is closely based on -.\"O .\" kernel source documentation files written by Rik van Riel. -.\" /proc/sys/fs と /proc/sys/kernel の資料は、 -.\" Rik van Riel が書いたカーネルソースファイルのドキュメントに -.\" 密接に基づいている。 -.\"O .SH SEE ALSO -.SH 関連項目 -.BR cat (1), -.BR dmesg (1), -.BR find (1), -.BR free (1), -.BR ps (1), -.BR tr (1), -.BR uptime (1), -.BR chroot (2), -.BR mmap (2), -.BR readlink (2), -.BR syslog (2), -.BR slabinfo (5), -.BR hier (7), -.BR time (7), -.BR arp (8), -.BR hdparm (8), -.BR ifconfig (8), -.BR init (8), -.BR lsmod (8), -.BR lspci (8), -.BR mount (8), -.BR netstat (8), -.BR procinfo (8), -.BR route (8) -.br -.\"O The kernel source files: -カーネルのソースファイル: -.IR Documentation/filesystems/proc.txt , -.IR Documentation/sysctl/vm.txt diff --git a/draft/man5/shells.5 b/draft/man5/shells.5 index 2cdc310e..3e2602b2 100644 --- a/draft/man5/shells.5 +++ b/draft/man5/shells.5 @@ -24,58 +24,29 @@ .\" Modified Sat Jul 24 17:11:07 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified Sun Nov 21 10:49:38 1993 by Michael Haardt .\" Modified Sun Feb 26 15:09:15 1995 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1996-2000 -.\" Takashi ISHIOKA and NAKANO Takeo, all rights reserved. -.\" Translated 9 Sep 1996 by Takashi ISHIOKA -.\" Modified Sat 25 Jul 1998 by NAKANO Takeo -.\" Updated Mon 11 Dec 2000 by NAKANO Takeo +.\" This file was generated with po4a. Translate the source file. .\" -.TH SHELLS 5 1993-11-21 "" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O shells \- pathnames of valid login shells +.\"******************************************************************* +.TH SHELLS 5 1993\-11\-21 "" "Linux Programmer's Manual" .SH 名前 shells \- ログインシェルとして有効なファイルのパス名 -.\"O .SH DESCRIPTION .SH 説明 -.\"O .I /etc/shells -.\"O is a text file which contains the full pathnames of valid login shells. -.\"O This file is consulted by -.\"O .BR chsh (1) -.\"O and available to be queried by other programs. -.I /etc/shells -はログインシェルとして有効なファイルのフルパスが書かれた -テキストファイルである。 -.BR chsh (1) -はこのファイルを参照する。 -他のプログラムもこのファイルを参照できる。 +\fI/etc/shells\fP はログインシェルとして有効なファイルのフルパスが書かれた テキストファイルである。 \fBchsh\fP(1) +はこのファイルを参照する。 他のプログラムもこのファイルを参照できる。 .PP -.\"O Be aware that there are programs which consult this file to -.\"O find out if a user is a normal user. -.\"O E.g.: ftp daemons traditionally -.\"O disallow access to users with shells not included in this file. -注意して欲しいのだが、プログラムによっては、 -ユーザーが通常のユーザーかどうかを判断する際に、 -このファイルの内容を参考にすることがある。 -例えば ftp デーモンは、 -ログインシェルがこのファイルに書かれていない -ユーザーからのアクセスを許さないのが以前から一般的である。 -.\"O .SH FILES +注意して欲しいのだが、プログラムによっては、 ユーザーが通常のユーザーかどうかを判断する際に、 このファイルの内容を参考にすることがある。 例えば +ftp デーモンは、 ログインシェルがこのファイルに書かれていない ユーザーからのアクセスを許さないのが以前から一般的である。 .SH ファイル -.I /etc/shells -.\"O .SH EXAMPLE -.\"O .I /etc/shells -.\"O may contain the following paths: +\fI/etc/shells\fP .SH 例 -.I /etc/shells -には以下のようなパスが含まれているだろう。 +\fI/etc/shells\fP には以下のようなパスが含まれているだろう。 .sp .RS -.I /bin/sh +\fI/bin/sh\fP .br -.I /bin/csh +\fI/bin/csh\fP .RE -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR chsh (1), -.BR getusershell (3) +\fBchsh\fP(1), \fBgetusershell\fP(3) diff --git a/draft/man5/slabinfo.5 b/draft/man5/slabinfo.5 index 0a6e6b13..b17b47cc 100644 --- a/draft/man5/slabinfo.5 +++ b/draft/man5/slabinfo.5 @@ -20,31 +20,19 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved. -.\" Translated Thu Aug 16 2001 by NAKANO Takeo +.\"******************************************************************* .\" -.TH SLABINFO 5 2007-09-30 "" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O /proc/slabinfo \- Kernel slab allocator statistics +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH SLABINFO 5 2007\-09\-30 "" "Linux Programmer's Manual" .SH 名前 /proc/slabinfo \- カーネル slab アロケータの統計 -.\"O .SH SYNOPSIS .SH 書式 -.B cat /proc/slabinfo -.\"O .SH DESCRIPTION +\fBcat /proc/slabinfo\fP .SH 説明 -.\"O Frequently used objects in the Linux kernel -.\"O (buffer heads, inodes, dentries, etc.) -.\"O have their own cache. -.\"O The file -.\"O .I /proc/slabinfo -.\"O gives statistics. -.\"O For example: -Linux カーネルの内部で良く利用されるオブジェクト -(バッファヘッド、i-ノード、ディレクトリ・エントリなど) -は、それぞれ自分用のキャッシュを備えている。ファイル -.I /proc/slabinfo -はこれらの統計を与える。例を示す。 +Linux カーネルの内部で良く利用されるオブジェクト (バッファヘッド、i\-ノード、ディレクトリ・エントリなど) +は、それぞれ自分用のキャッシュを備えている。ファイル \fI/proc/slabinfo\fP はこれらの統計を与える。例を示す。 .LP .in +4n .nf @@ -59,133 +47,50 @@ filp 726 760 96 19 19 1 buffer_head 67131 71240 96 1776 1781 1 vm_area_struct 1204 1652 64 23 28 1 \&... -size-8192 1 17 8192 1 17 2 -size-4096 41 73 4096 41 73 1 +size\-8192 1 17 8192 1 17 2 +size\-4096 41 73 4096 41 73 1 \&... .fi .in .LP -.\"O For each slab cache, the cache name, the number of currently -.\"O active objects, the total number of available objects, the -.\"O size of each object in bytes, the number of pages with at -.\"O least one active object, the total number of allocated pages, -.\"O and the number of pages per slab are given. -それぞれの slab キャッシュごとに、キャッシュの名前、 -現在アクティブなオブジェクトの数、利用可能なオブジェクトの総数、 -各オブジェクトのサイズ (バイト単位)、少なくとも一つのアクティブな -オブジェクトを有するページの数、アロケートされたページの総数、 -slab あたりのページ数、が与えられている。 +それぞれの slab キャッシュごとに、キャッシュの名前、 現在アクティブなオブジェクトの数、利用可能なオブジェクトの総数、 各オブジェクトのサイズ +(バイト単位)、少なくとも一つのアクティブな オブジェクトを有するページの数、アロケートされたページの総数、 slab +あたりのページ数、が与えられている。 -.\"O Note that because of object alignment and slab cache overhead, -.\"O objects are not normally packed tightly into pages. -.\"O Pages with even one in-use object are considered in-use and cannot be -.\"O freed. -なお、 -オブジェクトのアラインメントと slab キャッシュのオーバーヘッドとにより、 -オブジェクトは通常ページの内部にきっちりとは収められていない。 -利用中のオブジェクトをひとつでも保持しているページは、 -利用中であるとみなされ、解放できない。 +なお、 オブジェクトのアラインメントと slab キャッシュのオーバーヘッドとにより、 オブジェクトは通常ページの内部にきっちりとは収められていない。 +利用中のオブジェクトをひとつでも保持しているページは、 利用中であるとみなされ、解放できない。 -.\"O Kernels compiled with slab cache statistics will also have -.\"O "(statistics)" in the first line of output, and will have 5 -.\"O additional columns, namely: the high water mark of active -.\"O objects; the number of times objects have been allocated; -.\"O the number of times the cache has grown (new pages added -.\"O to this cache); the number of times the cache has been -.\"O reaped (unused pages removed from this cache); and the -.\"O number of times there was an error allocating new pages -.\"O to this cache. -.\"O If slab cache statistics are not enabled -.\"O for this kernel, these columns will not be shown. -slab キャッシュ統計の機能を有効にしてコンパイルされたカーネルでは、 -出力の最初の行に "(statistics)" と表示され、 5 つのカラムが追加される。 -それぞれ、アクティブなオブジェクトの瞬間最大値、 -.\"nakano でいいのかなあ > high water mark -オブジェクトがアロケートされた回数、 -キャッシュの大きさが拡張された -(新しいページがこのキャッシュに追加された) 回数、 -キャッシュの大きさが縮小された -(使っていないページがこのキャッシュから削除された) 回数、 -新たなページをこのキャッシュにアロケートする際に起きたエラーの回数、である。 -slab キャッシュ統計が使えないカーネルでは、これらのカラムは表示されない。 +slab キャッシュ統計の機能を有効にしてコンパイルされたカーネルでは、 出力の最初の行に "(statistics)" と表示され、 5 +つのカラムが追加される。 それぞれ、アクティブなオブジェクトの瞬間最大値、 オブジェクトがアロケートされた回数、 キャッシュの大きさが拡張された +(新しいページがこのキャッシュに追加された) 回数、 キャッシュの大きさが縮小された (使っていないページがこのキャッシュから削除された) 回数、 +新たなページをこのキャッシュにアロケートする際に起きたエラーの回数、である。 slab +キャッシュ統計が使えないカーネルでは、これらのカラムは表示されない。 -.\"O SMP systems will also have "(SMP)" in the first line of -.\"O output, and will have two additional columns for each slab, -.\"O reporting the slab allocation policy for the CPU-local -.\"O cache (to reduce the need for inter-CPU synchronization -.\"O when allocating objects from the cache). -.\"O The first column is the per-CPU limit: the maximum number of objects that -.\"O will be cached for each CPU. -.\"O The second column is the -.\"O batchcount: the maximum number of free objects in the -.\"O global cache that will be transferred to the per-CPU cache -.\"O if it is empty, or the number of objects to be returned -.\"O to the global cache if the per-CPU cache is full. -SMP システムでは、出力の最初の行に "(SMP)" と表示され、 -各 slab ごとに 2 つのカラムが追加される。 -これらは各 CPU が持つローカルなキャッシュ (per-CPU キャッシュ) の -slab アロケーションポリシーを表示する -(per-CPU キャッシュは、 -オブジェクトをキャッシュからアロケートする際に -CPU 間での同期を減少させるために設けられている)。 -最初のカラムは per-CPU 制限、 -すなわち各 CPU ごとにキャッシュできるオブジェクトの最大数である。 -二番目のカラムはバッチカウント、 -すなわち per-CPU キャッシュが空だったり一杯だったりした場合に、 -グローバルなキャッシュと受け渡しできるフリーなオブジェクトの最大数である。 +SMP システムでは、出力の最初の行に "(SMP)" と表示され、 各 slab ごとに 2 つのカラムが追加される。 これらは各 CPU +が持つローカルなキャッシュ (per\-CPU キャッシュ) の slab アロケーションポリシーを表示する (per\-CPU キャッシュは、 +オブジェクトをキャッシュからアロケートする際に CPU 間での同期を減少させるために設けられている)。 最初のカラムは per\-CPU 制限、 +すなわち各 CPU ごとにキャッシュできるオブジェクトの最大数である。 二番目のカラムはバッチカウント、 すなわち per\-CPU +キャッシュが空だったり一杯だったりした場合に、 グローバルなキャッシュと受け渡しできるフリーなオブジェクトの最大数である。 -.\"O If both slab cache statistics and SMP are defined, there -.\"O will be four additional columns, reporting the per-CPU -.\"O cache statistics. -.\"O The first two are the per-CPU cache -.\"O allocation hit and miss counts: the number of times an -.\"O object was or was not available in the per-CPU cache -.\"O for allocation. -.\"O The next two are the per-CPU cache free -.\"O hit and miss counts: the number of times a freed object -.\"O could or could not fit within the per-CPU cache limit, -.\"O before flushing objects to the global cache. -slab キャッシュ統計と SMP が両方有効になっている場合は、 -per-CPU キャッシュの統計を表示する 4 つのカラムがさらに追加される。 -最初の 2 つは per-CPU キャッシュの -アロケーションヒットカウントとアロケーションミスカウントである。 -すなわち、あるオブジェクトをアロケートしたときに、 -それが per-CPU キャッシュの内部に あった/なかった 回数である。 -続く 2 つは、per-CPU キャッシュのフリーヒットカウントとミスカウントである。 -すなわち解放されたオブジェクトをグローバルなキャッシュにフラッシュする前に、 -per-CPU キャッシュの制限の範囲に 収まった/収まらなかった 回数である。 +slab キャッシュ統計と SMP が両方有効になっている場合は、 per\-CPU キャッシュの統計を表示する 4 つのカラムがさらに追加される。 +最初の 2 つは per\-CPU キャッシュの アロケーションヒットカウントとアロケーションミスカウントである。 +すなわち、あるオブジェクトをアロケートしたときに、 それが per\-CPU キャッシュの内部に あった/なかった 回数である。 続く 2 +つは、per\-CPU キャッシュのフリーヒットカウントとミスカウントである。 +すなわち解放されたオブジェクトをグローバルなキャッシュにフラッシュする前に、 per\-CPU キャッシュの制限の範囲に 収まった/収まらなかった +回数である。 -.\"O It is possible to tune the SMP per-CPU slab cache limit -.\"O and batchcount via: -SMP において per-CPU slab キャッシュの制限値や -バッチカウントを変更するには、以下のようにすればよい: +SMP において per\-CPU slab キャッシュの制限値や バッチカウントを変更するには、以下のようにすればよい: .in +4n .nf echo "\fIcache_name limit batchcount\fP" > /proc/slabinfo .fi .in -.\"O .SH FILES .SH ファイル -.I -.\"O .SH VERSIONS +\fI\fP .SH バージョン -.\"O .I /proc/slabinfo -.\"O exists since Linux 2.1.23. -.\"O SMP per-CPU caches exist since Linux 2.4.0-test3. -.I /proc/slabinfo -は Linux 2.1.23 以降に存在する。 -SMP における CPU ごとのキャッシュは Linux 2.4.0-test3 以降に存在する。 -.\"O .SH NOTES +\fI/proc/slabinfo\fP は Linux 2.1.23 以降に存在する。 SMP における CPU ごとのキャッシュは Linux +2.4.0\-test3 以降に存在する。 .SH 注意 -.\"O Since Linux 2.6.16 the file -.\"O .I /proc/slabinfo -.\"O is only present if the -.\"O .B CONFIG_SLAB -.\"O kernel configuration option is enabled. -Linux 2.6.16 以降では、 -.I /proc/slabinfo -ファイルは、カーネル設定オプション -.B CONFIG_SLAB +Linux 2.6.16 以降では、 \fI/proc/slabinfo\fP ファイルは、カーネル設定オプション \fBCONFIG_SLAB\fP を有効にした場合のみ存在する。 - diff --git a/draft/man5/tzfile.5 b/draft/man5/tzfile.5 deleted file mode 100644 index e18258e3..00000000 --- a/draft/man5/tzfile.5 +++ /dev/null @@ -1,234 +0,0 @@ -.\" @(#)tzfile.5 7.11 -.\" This file is in the public domain, so clarified as of -.\" 1996-06-05 by Arthur David Olson . -.\" -.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. -.\" Translated Tue Sep 14 1999 by NAKANO Takeo -.\" -.\"WORD: transition time 遷移時間 -.\"WORD: local time types ローカル時間型 -.\"WORD: timezone abbreviatio strint タイムゾーン略式文字列 -.\" -.TH TZFILE 5 1996-06-05 "" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O tzfile \- timezone information -.\"O .SH SYNOPSIS -.SH 名前 -tzfile \- タイムゾーンの情報 -.SH 書式 -.B #include -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The timezone information files used by -.\"O .BR tzset (3) -.\"O begin with the magic characters "TZif" to identify then as -.\"O timezone information files, -.\"O followed by sixteen bytes reserved for future use, -.\"O followed by six four-byte values of type -.\"O .IR long , -.\"O written in a "standard" byte order -.\"O (the high-order byte of the value is written first). -.\"O These values are, -.\"O in order: -.BR tzset (3) -によって用いられるタイムゾーン情報のファイルは、 -識別のための magic 文字列 "TZif" で始まり、 -将来のための 16 バイトの予約領域が続き、 -.I long -型の 4 バイトの値が 6 個続く。 -この値は「標準」バイトオーダー (高位バイトが先に書かれる) -で記述される。これらの値は、順に以下のようなものである。 -.TP -.I tzh_ttisgmtcnt -.\"O The number of UTC/local indicators stored in the file. -ファイルに記述されている UTC/local インジケータ (indicator) の個数。 -.TP -.I tzh_ttisstdcnt -.\"O The number of standard/wall indicators stored in the file. -ファイルに記述されている standard/wall インジケータの個数。 -.TP -.I tzh_leapcnt -.\"O The number of leap seconds for which data is stored in the file. -ファイルに記述されている閏秒データの個数。 -.TP -.I tzh_timecnt -.\"O The number of "transition times" for which data is stored -.\"O in the file. -ファイルに記述されている「遷移時間 (transition time)」データの個数。 -.TP -.I tzh_typecnt -.\"O The number of "local time types" for which data is stored -.\"O in the file (must not be zero). -ファイルに記述されている「ローカル時間型 (local time types)」データの個数 -(0 であってはいけない)。 -.TP -.I tzh_charcnt -.\"O The number of characters of "timezone abbreviation strings" -.\"O stored in the file. -ファイルに記述されている「タイムゾーン略式文字列 (timezone -abbreviation string)」の個数。 -.PP -.\"O The above header is followed by -.\"O .I tzh_timecnt -.\"O four-byte values of type -.\"O .IR long , -.\"O sorted in ascending order. -.\"O These values are written in "standard" byte order. -.\"O Each is used as a transition time (as returned by -.\"O .BR time (2)) -.\"O at which the rules for computing local time change. -上記のヘッダに続いて -.I tzh_timecnt -という 4 バイトの -.I long -型の値が (複数個) 続く。昇順で保管されている。 -これらの値は「標準」バイトオーダーで記述されている。 -それぞれは遷移時間 -.RB ( time (2) -が返す値) として用いられ、 -それぞれにおいてローカル時間の計算ルールが変更される。 -.\"O Next come -.\"O .I tzh_timecnt -.\"O one-byte values of type -.\"O .IR "unsigned char" ; -.\"O each one tells which of the different types of "local time" types -.\"O described in the file is associated with the same-indexed transition time. -.\"O These values serve as indices into an array of -.\"O .I ttinfo -.\"O structures that appears next in the file; -次に来るのは -.I tzh_timecnt -で、これは -.I "unsigned char" -型の 1 バイトの値である (複数個続くこともある)。 -この値は、ファイルで記述されている異なったタイプの「ローカル時間」が、 -それぞれ同じようにインデックスされた遷移時間のどれに関連づけられて -いるかを示す。 -これらの値は -.I ttinifo -構造体の配列に対するインデックスとして提供されている。 -.I ttinfo -構造体はファイル中で次の位置に置かれる。 -.\"O these structures are defined as follows: -この構造体は以下のように定義されている: -.in +4n -.sp -.nf -struct ttinfo { - long tt_gmtoff; - int tt_isdst; - unsigned int tt_abbrind; -}; -.in -.fi -.sp -.\"O Each structure is written as a four-byte value for -.\"O .I tt_gmtoff -.\"O of type -.\"O .B long , -.\"O in a standard byte order, followed by a one-byte value for -.\"O .I tt_isdst -.\"O and a one-byte value for -.\"O .IR tt_abbrind . -それぞれの構造体は、 4 バイトの \fIlong\fP 型の値 \fItt_gmtoff\fP、 -1 バイトの値 \fItt_isdst\fP, -1 バイトの値 \fItt_abbrind\fP から構成される。 -.\"NAKANO int なのに 4 バイトなの? -.\"O In each structure, -.\"O .I tt_gmtoff -.\"O gives the number of seconds to be added to UTC, -.\"O .I tt_isdst -.\"O tells whether -.\"O .I tm_isdst -.\"O should be set by -.\"O .BR localtime (3), -.\"O and -.\"O .I tt_abbrind -.\"O serves as an index into the array of timezone abbreviation characters -.\"O that follow the -.\"O .I ttinfo -.\"O structure(s) in the file. -それぞれの構造体において、 -.I tt_gmtoff -は UTC に加えるべき秒数を与え、 -.I tt_isdst -は -.I tm_isdst -を -.BR localtime (3) -にセットすべきかどうかを示し、 -.I tt_abbrind -はファイル中で \fIttinfo\fP 構造体 (配列) のあとに置かれる -タイムゾーン略式文字列の配列に対するインデックスである。 -.PP -.\"O Then there are -.\"O .I tzh_leapcnt -.\"O pairs of four-byte values, written in standard byte order; -.\"O the first value of each pair gives the time -.\"O (as returned by -.\"O .IR time(2)) -.\"O at which a leap second occurs; -.\"O the second gives the -.\"O .I total -.\"O number of leap seconds to be applied after the given time. -.\"O The pairs of values are sorted in ascending order by time. -次には 4 バイト値のペアである -.I tzh_leapcnt -が (複数個) 続く。標準バイトオーダーで記述される。 -それぞれのペアの最初の値は閏秒の起きた時刻を ( -.IR time (2) -の返す形式で) 与え、二番目の値はその時刻に加えるべき閏秒数の -全秒数を与える。これらのペアは時刻の古い順に記述する。 -.PP -.\"O Then there are -.\"O .I tzh_ttisstdcnt -.\"O standard/wall indicators, each stored as a one-byte value; -.\"O they tell whether the transition times associated with local time types -.\"O were specified as standard time or wall clock time, -.\"O and are used when a timezone file is used in handling POSIX-style -.\"O timezone environment variables. -次には -.I tzh_ttisstdcnt -が置かれる。これは standard/wall インジケータで、それぞれ 1 バイトの -値を保管する。これらはローカル時間のタイプに関連づけられた遷移時間が -標準時刻 (standard time) と壁時計時刻 (wall clock time) の -どちらで指定されているかを示す。またこの値は、 -POSIX スタイルのタイムゾーン環境変数を処理するときに -タイムゾーンファイルが使われるときにも利用される。 -.PP -.\"O Finally, there are -.\"O .I tzh_ttisgmtcnt -.\"O UTC/local indicators, each stored as a one-byte value; -.\"O they tell whether the transition times associated with local time types -.\"O were specified as UTC or local time, -.\"O and are used when a timezone file is used in handling POSIX-style -.\"O timezone environment variables. -最後に -.I tzh_ttisgmtcnt -が置かれる。これは UTC/local インジケータで、それぞれ 1 バイトの -値を保管する。これらはローカル時間のタイプに関連づけられた遷移時間が -UTC とローカル時刻のどちらで指定されているかを示す。またこの値は、 -POSIX スタイルのタイムゾーン環境変数を処理するときに -タイムゾーンファイルが使われるときにも利用される。 -.PP -.\"O .I Localtime -.\"O uses the first standard-time -.\"O .I ttinfo -.\"O structure in the file -.\"O (or simply the first -.\"O .I ttinfo -.\"O structure in the absence of a standard-time structure) -.\"O if either -.\"O .I tzh_timecnt -.\"O is zero or the time argument is less than the first transition time recorded -.\"O in the file. -.I localtime -は、 -.I tzh_timeout -が 0 であるか time 引数がファイルに記録されていた最初の遷移時刻 -よりも小さい場合には、 -ファイルに最初に現れる標準時刻の -.I ttinfo -構造体を使う (または標準時刻の構造体がない場合は、単に最初の -.I ttinfo -構造体を使う)。 diff --git a/draft/man6/intro.6 b/draft/man6/intro.6 index e722413f..44cff12b 100644 --- a/draft/man6/intro.6 +++ b/draft/man6/intro.6 @@ -22,29 +22,16 @@ .\" USA. .\" .\" Modified Sat Jul 24 17:19:57 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 MAEHARA Kohichi -.\" all rights reserved. -.\" Translated Thu Nov 16 18:00:00 JST 1997 -.\" by MAEHARA Kohichi +.\" This file was generated with po4a. Translate the source file. .\" -.TH INTRO 6 2007-10-23 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH INTRO 6 2007\-10\-23 Linux "Linux Programmer's Manual" .SH 名前 -.\"O intro \- Introduction to games intro \- ゲームプログラムの紹介 -.\"O .SH DESCRIPTION .SH 説明 -.\"O Section 6 of the manual describes all the games and funny little programs -.\"O available on the system. -マニュアルの 6 章は、本システムで利用可能なすべてのゲームと -楽しい小物プログラムについて記載している。 -.\"O .SH NOTES -.SH 備考 -.\"O .SS Authors and Copyright Conditions +マニュアルの 6 章は、本システムで利用可能なすべてのゲームと 楽しい小物プログラムについて記載している。 +.SH 注意 .SS 著者と著作権 -.\"O Look at the header of the manual page source for the author(s) and copyright -.\"O conditions. -.\"O Note that these can be different from page to page! -著者(達)と権利条件についてはマニュアルページのソースのヘッダを参照すること。 -ただしページによっては異なるものもあることに注意せよ。 +著者と著作権に関しては各マニュアルページのソースのヘッダを参照すること。 これらはページごとに異なる可能性があることに注意してほしい。 diff --git a/draft/man7/armscii-8.7 b/draft/man7/armscii-8.7 new file mode 100644 index 00000000..812bf00c --- /dev/null +++ b/draft/man7/armscii-8.7 @@ -0,0 +1,142 @@ +.\" t -*- coding: UTF-8 -*- +.\" Copyright 2009 Lefteris Dimitroulakis +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.\" +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ARMSCII\-8 7 2010\-09\-20 Linux "Linux Programmer's Manual" +.nh +.SH 名前 +armscii\-8 \- アルメニア語文字集合の 8進数、10進数、16進数による符号化 +.SH 説明 +情報交換用アルメニア標準コード (Armenian Standard Code for Information Interchange) で、 +8 ビットコードの文字集合である。 +.SS "ArmSCII\-8 文字" +以下の表は ArmSCII\-8 の表示可能な文字のうち +\fBascii\fP(7) マニュアルページに載っていないものを示している。 +4列目は ArmSCII\-8 用に設定された環境でのみ正しく表示できるだろう。 +.TS +l l l c lp-1. +Oct Dec Hex Char Description +_ +240 160 A0 \ NO\-BREAK SPACE +242 162 A2 և ARMENIAN SMALL LIGATURE ECH YIWN +243 163 A3 ։ ARMENIAN FULL STOP +244 164 A4 ) RIGHT PARENTHESIS +245 165 A5 ( LEFT PARENTHESIS +246 166 A6 » RIGHT\-POINTING DOUBLE ANGLE QUOTATION MARK +247 167 A7 « LEFT\-POINTING DOUBLE ANGLE QUOTATION MARK +250 168 A8 — EM DASH +251 169 A9 . FULL STOP +252 170 AA ՝ ARMENIAN COMMA +253 171 AB , COMMA +254 172 AC \- HYPHEN\-MINUS +255 173 AD ֊ ARMENIAN HYPHEN +256 174 AE … HORIZONTAL ELLIPSIS +257 175 AF ՜ ARMENIAN EXCLAMATION MARK +260 176 B0 ՛ ARMENIAN EMPHASIS MARK +261 177 B1 ՞ ARMENIAN QUESTION MARK +262 178 B2 Ô± ARMENIAN CAPITAL LETTER AYB +263 179 B3 Õ¡ ARMENIAN SMALL LETTER AYB +264 180 B4 Ô² ARMENIAN CAPITAL LETTER BEN +265 181 B5 Õ¢ ARMENIAN SMALL LETTER BEN +266 182 B6 Ô³ ARMENIAN CAPITAL LETTER GIM +267 183 B7 Õ£ ARMENIAN SMALL LETTER GIM +270 184 B8 Ô´ ARMENIAN CAPITAL LETTER DA +271 185 B9 Õ¤ ARMENIAN SMALL LETTER DA +272 186 BA Ôµ ARMENIAN CAPITAL LETTER ECH +273 187 BB Õ¥ ARMENIAN SMALL LETTER ECH +274 188 BC Ô¶ ARMENIAN CAPITAL LETTER ZA +275 189 BD Õ¦ ARMENIAN SMALL LETTER ZA +276 190 BE Ô· ARMENIAN CAPITAL LETTER EH +277 191 BF Õ§ ARMENIAN SMALL LETTER EH +300 192 C0 Ô¸ ARMENIAN CAPITAL LETTER ET +301 193 C1 Õ¨ ARMENIAN SMALL LETTER ET +302 194 C2 Ô¹ ARMENIAN CAPITAL LETTER TO +303 195 C3 Õ© ARMENIAN SMALL LETTER TO +304 196 C4 Ôº ARMENIAN CAPITAL LETTER ZHE +305 197 C5 Õª ARMENIAN SMALL LETTER ZHE +306 198 C6 Ô» ARMENIAN CAPITAL LETTER INI +307 199 C7 Õ« ARMENIAN SMALL LETTER INI +310 200 C8 Ô¼ ARMENIAN CAPITAL LETTER LIWN +311 201 C9 Õ¬ ARMENIAN SMALL LETTER LIWN +312 202 CA Ô½ ARMENIAN CAPITAL LETTER XEH +313 203 CB Õ­ ARMENIAN SMALL LETTER XEH +314 204 CC Ô¾ ARMENIAN CAPITAL LETTER CA +315 205 CD Õ® ARMENIAN SMALL LETTER CA +316 206 CE Ô¿ ARMENIAN CAPITAL LETTER KEN +317 207 CF Õ¯ ARMENIAN SMALL LETTER KEN +320 208 D0 Հ ARMENIAN CAPITAL LETTER HO +321 209 D1 Õ° ARMENIAN SMALL LETTER HO +322 210 D2 Ձ ARMENIAN CAPITAL LETTER JA +323 211 D3 Õ± ARMENIAN SMALL LETTER JA +324 212 D4 Ղ ARMENIAN CAPITAL LETTER GHAD +325 213 D5 Õ² ARMENIAN SMALL LETTER GHAD +326 214 D6 Ճ ARMENIAN CAPITAL LETTER CHEH +327 215 D7 Õ³ ARMENIAN SMALL LETTER CHEH +330 216 D8 Մ ARMENIAN CAPITAL LETTER MEN +331 217 D9 Õ´ ARMENIAN SMALL LETTER MEN +332 218 DA Յ ARMENIAN CAPITAL LETTER YI +333 219 DB Õµ ARMENIAN SMALL LETTER YI +334 220 DC Ն ARMENIAN CAPITAL LETTER NOW +335 221 DD Õ¶ ARMENIAN SMALL LETTER NOW +336 222 DE Շ ARMENIAN CAPITAL LETTER SHA +337 223 DF Õ· ARMENIAN SMALL LETTER SHA +340 224 E0 Ո ARMENIAN CAPITAL LETTER VO +341 225 E1 Õ¸ ARMENIAN SMALL LETTER VO +342 226 E2 Չ ARMENIAN CAPITAL LETTER CHA +343 227 E3 Õ¹ ARMENIAN SMALL LETTER CHA +344 228 E4 Պ ARMENIAN CAPITAL LETTER PEH +345 229 E5 Õº ARMENIAN SMALL LETTER PEH +346 230 E6 Ջ ARMENIAN CAPITAL LETTER JHEH +347 231 E7 Õ» ARMENIAN SMALL LETTER JHEH +350 232 E8 Ռ ARMENIAN CAPITAL LETTER RA +351 233 E9 Õ¼ ARMENIAN SMALL LETTER RA +352 234 EA Ս ARMENIAN CAPITAL LETTER SEH +353 235 EB Õ½ ARMENIAN SMALL LETTER SEH +354 236 EC Վ ARMENIAN CAPITAL LETTER VEW +355 237 ED Õ¾ ARMENIAN SMALL LETTER VEW +356 238 EE Տ ARMENIAN CAPITAL LETTER TIWN +357 239 EF Õ¿ ARMENIAN SMALL LETTER TIWN +360 240 F0 Ր ARMENIAN CAPITAL LETTER REH +361 241 F1 ր ARMENIAN SMALL LETTER REH +362 242 F2 Ց ARMENIAN CAPITAL LETTER CO +363 243 F3 ց ARMENIAN SMALL LETTER CO +364 244 F4 Ւ ARMENIAN CAPITAL LETTER YIWN +365 245 F5 ւ ARMENIAN SMALL LETTER YIWN +366 246 F6 Փ ARMENIAN CAPITAL LETTER PIWR +367 247 F7 փ ARMENIAN SMALL LETTER PIWR +370 248 F8 Ք ARMENIAN CAPITAL LETTER KEH +371 249 F9 ք ARMENIAN SMALL LETTER KEH +372 250 FA Օ ARMENIAN CAPITAL LETTER OH +373 251 FB օ ARMENIAN SMALL LETTER OH +374 252 FC Ֆ ARMENIAN CAPITAL LETTER FEH +375 253 FD ֆ ARMENIAN SMALL LETTER FEH +376 254 FE ՚ ARMENIAN APOSTROPHE +.TE +.SH 関連項目 +\fBascii\fP(7) + diff --git a/draft/man7/ascii.7 b/draft/man7/ascii.7 index 9800f3dd..bb97b6db 100644 --- a/draft/man7/ascii.7 +++ b/draft/man7/ascii.7 @@ -1,5 +1,5 @@ -'\" t -.\" Copyright (c) 1993 Michael Haardt (u31b3hs@pool.informatik.rwth-aachen.de) +.\" t +.\" Copyright (c) 1993 Michael Haardt (michael@moria.de) .\" Created Fri Apr 2 11:32:09 MET DST 1993 .\" .\" This is free documentation; you can redistribute it and/or @@ -19,7 +19,7 @@ .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, write to the Free -.\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 .\" USA. .\" .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) @@ -31,35 +31,24 @@ .\" Modified 1999-08-08 by Michael Haardt (michael@moria.de) .\" Modified 2004-04-01 by aeb .\" -.\" Japanese Version Copyright (c) 1997-1999 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1997-06-03, HANATAKA Shinya -.\" Modified 1999-11-27, HANATAKA Shinya -.\" Modified 2005-02-21, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH ASCII 7 2009-02-12 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ASCII 7 2009\-02\-12 Linux "Linux Programmer's Manual" .SH 名前 -.\"O ascii \- ASCII character set encoded in octal, decimal, and hexadecimal ascii \- ASCII 文字集合の 8 進数、10 進数、16 進数による符号化 -.\"O .SH DESCRIPTION .SH 説明 -.\"O ASCII is the American Standard Code for Information Interchange. -.\"O It is a 7-bit code. -.\"O Many 8-bit codes (such as ISO 8859-1, the -.\"O Linux default character set) contain ASCII as their lower half. -.\"O The international counterpart of ASCII is known as ISO 646. ASCII は、情報交換用米国標準コード (American Standard Code for Information Interchange) の略で、7 ビットのコードである。 -(ISO 8859-1 のような) 多くの 8 ビットのコードでは下半分に +(ISO 8859\-1 のような) 多くの 8 ビットのコードでは下半分に ASCII を含んでいる。ASCII は国際的な規格では ISO 646 として知られている。 .LP -.\"O The following table contains the 128 ASCII characters. 以下の表は 128 文字の ASCII 文字をまとめたものである。 .LP -.\"O C program \f(CW\(aq\eX\(aq\fP escapes are noted. C プログラムでの \f(CW\(aq\eX\(aq\fP エスケープも注記してある。 -.if t \{\ +.if t \{\ .in 1i .ft CW \} @@ -68,37 +57,6 @@ l l l l l l l l. Oct Dec Hex Char Oct Dec Hex Char _ 000 0 00 NUL \(aq\e0\(aq 100 64 40 @ -.\"O 001 1 01 SOH (start of heading) 101 65 41 A -.\"O 002 2 02 STX (start of text) 102 66 42 B -.\"O 003 3 03 ETX (end of text) 103 67 43 C -.\"O 004 4 04 EOT (end of transmission) 104 68 44 D -.\"O 005 5 05 ENQ (enquiry) 105 69 45 E -.\"O 006 6 06 ACK (acknowledge) 106 70 46 F -.\"O 007 7 07 BEL \(aq\ea\(aq (bell) 107 71 47 G -.\"O 010 8 08 BS \(aq\eb\(aq (backspace) 110 72 48 H -.\"O 011 9 09 HT \(aq\et\(aq (horizontal tab) 111 73 49 I -.\"O 012 10 0A LF \(aq\en\(aq (new line) 112 74 4A J -.\"O 013 11 0B VT \(aq\ev\(aq (vertical tab) 113 75 4B K -.\"O 014 12 0C FF \(aq\ef\(aq (form feed) 114 76 4C L -.\"O 015 13 0D CR \(aq\er\(aq (carriage ret) 115 77 4D M -.\"O 016 14 0E SO (shift out) 116 78 4E N -.\"O 017 15 0F SI (shift in) 117 79 4F O -.\"O 020 16 10 DLE (data link escape) 120 80 50 P -.\"O 021 17 11 DC1 (device control 1) 121 81 51 Q -.\"O 022 18 12 DC2 (device control 2) 122 82 52 R -.\"O 023 19 13 DC3 (device control 3) 123 83 53 S -.\"O 024 20 14 DC4 (device control 4) 124 84 54 T -.\"O 025 21 15 NAK (negative ack.) 125 85 55 U -.\"O 026 22 16 SYN (synchronous idle) 126 86 56 V -.\"O 027 23 17 ETB (end of trans. blk) 127 87 57 W -.\"O 030 24 18 CAN (cancel) 130 88 58 X -.\"O 031 25 19 EM (end of medium) 131 89 59 Y -.\"O 032 26 1A SUB (substitute) 132 90 5A Z -.\"O 033 27 1B ESC (escape) 133 91 5B [ -.\"O 034 28 1C FS (file separator) 134 92 5C \e \(aq\e\e\(aq -.\"O 035 29 1D GS (group separator) 135 93 5D ] -.\"O 036 30 1E RS (record separator) 136 94 5E ^ -.\"O 037 31 1F US (unit separator) 137 95 5F \&_ 001 1 01 SOH (ヘッダ開始) 101 65 41 A 002 2 02 STX (テキスト開始) 102 66 42 B 003 3 03 ETX (テキスト終了) 103 67 43 C @@ -163,22 +121,20 @@ _ 076 62 3E > 176 126 7E ~ 077 63 3F ? 177 127 7F DEL .TE -.if t \{\ +.if t \{\ .in .ft P \} -.\"O .SS TABLES .SS 表 -.\"O For convenience, let us give more compact tables in hex and decimal. 便利なので、16進形式と10進形式の簡潔な表を載せておく。 .sp .nf -.if t \{\ +.if t \{\ .in 1i .ft CW \} 2 3 4 5 6 7 30 40 50 60 70 80 90 100 110 120 - ------------- --------------------------------- + \-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- 0: 0 @ P \` p 0: ( 2 < F P Z d n x 1: ! 1 A Q a q 1: ) 3 = G Q [ e o y 2: " 2 B R b r 2: * 4 > H R \e f p z @@ -195,44 +151,25 @@ C: , < L \e l | D: \- = M ] m } E: . > N ^ n ~ F: / ? O _ o DEL -.if t \{\ +.if t \{\ .in .ft P \} .fi -.\"O .SH NOTES -.\"O .SS History .SH 備考 .SS 歴史 -.\"O An -.\"O .B ascii -.\"O manual page appeared in Version 7 of AT&T UNIX. -.B ascii -のマニュアルは AT&T UNIX Version 7 で登場した。 +\fBascii\fP のマニュアルは AT&T UNIX Version 7 で登場した。 .LP -.\"O On older terminals, the underscore code is displayed as a left arrow, -.\"O called backarrow, the caret is displayed as an up-arrow and the vertical -.\"O bar has a hole in the middle. 古い端末では、アンダースコアがバックアロー (backarrow) と呼ばれる 左向きの矢印で表示される、またキャレットが上向きの矢印で表示され、 縦棒 (vertcal bar) では真ん中に穴がある。 .LP -.\"O Uppercase and lowercase characters differ by just one bit and the -.\"O ASCII character 2 differs from the double quote by just one bit, too. -.\"O That made it much easier to encode characters mechanically or with a -.\"O non-microcontroller-based electronic keyboard and that pairing was found -.\"O on old teletypes. 大文字 (uppercase) と小文字 (lowercase) は 1 ビットだけ異なっている。 ASCII の文字 2 はダブルクォートとは 1 ビットだけ異なっている。 これによって機械式キーボードやマイコン制御でない電子キーボードで キーコード化することが簡単になる。また、古いテレタイプでもこの 組み合わせが使用されていた。(訳注: JIS キー配列もその一種) .LP -.\"O The ASCII standard was published by the United States of America -.\"O Standards Institute (USASI) in 1968. -ASCII 規格は米国規格協会 -(USASI : United States of America Standards Institute) によって -1968年に発行された。 .\" .\" ASA was the American Standards Association and X3 was an ASA sectional .\" committee on computers and data processing. Its name changed to @@ -245,19 +182,11 @@ ASCII 規格は米国規格協会 .\" American National Standards Institute (ANSI) in 1969 and is the .\" U.S. member body of ISO; private and nonprofit. .\" -.\"O .SH "SEE ALSO" +ASCII 規格は米国規格協会 +(USASI : United States of America Standards Institute) によって +1968年に発行された。 .SH 関連項目 -.BR iso_8859-1 (7), -.BR iso_8859-10 (7), -.BR iso_8859-13 (7), -.BR iso_8859-14 (7), -.BR iso_8859-15 (7), -.BR iso_8859-16 (7), -.BR iso_8859-2 (7), -.BR iso_8859-3 (7), -.BR iso_8859-4 (7), -.BR iso_8859-5 (7), -.BR iso_8859-6 (7), -.BR iso_8859-7 (7), -.BR iso_8859-8 (7), -.BR iso_8859-9 (7) +\fBiso_8859\-1\fP(7), \fBiso_8859\-10\fP(7), \fBiso_8859\-13\fP(7), \fBiso_8859\-14\fP(7), +\fBiso_8859\-15\fP(7), \fBiso_8859\-16\fP(7), \fBiso_8859\-2\fP(7), \fBiso_8859\-3\fP(7), +\fBiso_8859\-4\fP(7), \fBiso_8859\-5\fP(7), \fBiso_8859\-6\fP(7), \fBiso_8859\-7\fP(7), +\fBiso_8859\-8\fP(7), \fBiso_8859\-9\fP(7) diff --git a/draft/man7/charsets.7 b/draft/man7/charsets.7 index 52306491..3cf16f60 100644 --- a/draft/man7/charsets.7 +++ b/draft/man7/charsets.7 @@ -10,29 +10,15 @@ .\" research by esr. Portions derive from a writeup by Roman Czyborra. .\" .\" Last changed by David Starner . +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1996,1997,1998 -.\" ISHIKAWA Mutsumi, all rights reserved. -.\" Translated Mon Jul 21 03:46:21 JST 1997 -.\" by ISHIKAWA Mutsumi -.\" Updated Fri Dec 3 JST 1999 by Kentaro Shirakata -.\" Updated Fri Jan 4 JST 2002 by Kentaro Shirakata +.\" This file was generated with po4a. Translate the source file. .\" -.\" WORD: ligature 合字 -.\" -.TH CHARSETS 7 2008-06-03 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O charsets \- programmer's view of character sets and internationalization +.\"******************************************************************* +.TH CHARSETS 7 2008\-06\-03 Linux "Linux Programmer's Manual" .SH 名前 charsets \- プログラマの視点から見た文字セットと国際化 -.\"O .SH DESCRIPTION .SH 説明 -.\"O Linux is an international operating system. -.\"O Various of its utilities -.\"O and device drivers (including the console driver) support multilingual -.\"O character sets including Latin-alphabet letters with diacritical -.\"O marks, accents, ligatures, and entire non-Latin alphabets including -.\"O Greek, Cyrillic, Arabic, and Hebrew. Linux は国際化されたオペレーティングシステムである。 Linux の様々なユーティリティや、 console ドライバなどの デバイスドライバは、非ラテンアルファベットなどの @@ -42,105 +28,56 @@ Linux の様々なユーティリティや、 console ドライバなどの 発音区別符号 (diacritical marks)・アクセント・合字 (ligatures) なども 使うことができる。 .LP -.\"O This manual page presents a programmer's-eye view of different -.\"O character-set standards and how they fit together on Linux. -.\"O Standards -.\"O discussed include ASCII, ISO 8859, KOI8-R, Unicode, ISO 2022 and -.\"O ISO 4873. -.\"O The primary emphasis is on character sets actually used as -.\"O locale character sets, not the myriad others that can be found in data -.\"O from other systems. このマニュアルページでは、プログラマの視点からみた異なる文字集合規格 -(character-set standards) と、それらを Linux にどう適合させるかというこ -とについて述べる。ここでは、ASCII, ISO 8859, KOI8-R, Unicode, ISO 2022, +(character\-set standards) と、それらを Linux にどう適合させるかというこ +とについて述べる。ここでは、ASCII, ISO 8859, KOI8\-R, Unicode, ISO 2022, ISO 4873 の各規格について議論する。 ここでは実際にロケール文字セットとして使われている文字セットに注目し、 その他のシステムで使われている無数のものは重視しない。 .LP -.\"O A complete list of charsets used in an officially supported locale in glibc -.\"O 2.2.3 is: ISO-8859-{1,2,3,5,6,7,8,9,13,15}, CP1251, UTF-8, EUC-{KR,JP,TW}, -.\"O KOI8-{R,U}, GB2312, GB18030, GBK, BIG5, BIG5-HKSCS and TIS-620 (in no -.\"O particular order.) -.\"O(Romanian may be switching to ISO-8859-16.) glibc 2.2.3 で公式に対応しているロケールで用いられている文字セットの 完全なリストは以下の通り: -ISO-8859-{1,2,3,5,6,7,8,9,13,15}, CP1251, UTF-8, EUC-{KR,JP,TW}, -KOI8-{R,U}, GB2312, GB18030, GBK, BIG5, BIG5-HKSCS, TIS-620 (順不同) -(ルーマニア語は ISO-8859-16 に切り替わっているかもしれない) +ISO\-8859\-{1,2,3,5,6,7,8,9,13,15}, CP1251, UTF\-8, EUC\-{KR,JP,TW}, +KOI8\-{R,U}, GB2312, GB18030, GBK, BIG5, BIG5\-HKSCS, TIS\-620 (順不同) +(ルーマニア語は ISO\-8859\-16 に切り替わっているかもしれない) .SS ASCII -.\"O ASCII (American Standard Code For Information Interchange) is the original -.\"O 7-bit character set, originally designed for American English. -.\"O It is currently described by the ECMA-6 standard. ASCII (American Standard Code For Information Interchange) は 7 ビット文字集合の元となったものであり、 もともとは米語(American English) のためにデザインされた。 -現在は、ECMA-6 標準の中で説明されている。 +現在は、ECMA\-6 標準の中で説明されている。 .LP -.\"O Various ASCII variants replacing the dollar sign with other currency -.\"O symbols and replacing punctuation with non-English alphabetic characters -.\"O to cover German, French, Spanish and others in 7 bits exist. -.\"O All are -.\"O deprecated; glibc doesn't support locales whose character sets aren't -.\"O true supersets of ASCII. -.\"O (These sets are also known as ISO-646, a close -.\"O relative of ASCII that permitted replacing these characters.) ドイツ語、フランス語、スペイン語などに 7 ビットで対応するため、 ASCII のドル記号を他の通貨記号に置き換え、 句読点を非英語文字のものに置き換えた様々な変種が存在する。 これらは全て使うべきではない。 glibc は ASCII の完全なスーパーセットでない文字セットのロケールに 対応していない。 -(これらの文字セットは ISO-646 として知られる。 +(これらの文字セットは ISO\-646 として知られる。 これは ASCII と近い関係にあり、これらの文字を置き換えることを認めている) .LP -.\"O As Linux was written for hardware designed in the US, it natively -.\"O supports ASCII. Linux は米国で設計されたハードウェアのために書かれたので、 はじめから ASCII をサポートしている。 -.SS ISO 8859 -.\"O ISO 8859 is a series of 15 8-bit character sets all of which have US -.\"O ASCII in their low (7-bit) half, invisible control characters in -.\"O positions 128 to 159, and 96 fixed-width graphics in positions 160-255. +.SS "ISO 8859" ISO 8859 は 15 組の一連の 8 ビット文字集合である。それらは全て 下位 (7 ビット) に US ASCII を含み、 128 から 159 には制御文字が配置され、 160 から 255 には 96 個の固定幅図形文字が配置されている。 .LP -.\"O Of these, the most important is ISO 8859-1 (Latin-1). -.\"O It is natively -.\"O supported in the Linux console driver, fairly well supported in X11R6, -.\"O and is the base character set of HTML. -これらのうちで、もっとも重要なのは ISO 8859-1 (Latin-1) である。これ +これらのうちで、もっとも重要なのは ISO 8859\-1 (Latin\-1) である。これ は Linux コンソールドライバにおいてネイティブにサポートされており、 -.\"nakano でいいんじゃないかと思います。 X11R6 においても同様にサポートされている。さらに、 HTML の基本文字集合である。 .LP -.\"O Console support for the other 8859 character sets is available under -.\"O Linux through user-mode utilities (such as -.\"O .BR setfont (8)) -.\"O .\" // some distributions still have the deprecated consolechars -.\"O that modify keyboard bindings and the EGA graphics -.\"O table and employ the "user mapping" font table in the console -.\"O driver. +.\" // some distributions still have the deprecated consolechars コンソールにおける、その他の 8859 文字集合のサポートは -.RB ( setfont (8)) -のようなユーザモード・ユーティリティを利用する事で可能になる。 +(\fBsetfont\fP(8)) のようなユーザモード・ユーティリティを利用する事で可能になる。 このようなユーティリティを利用することにより、コンソールドライバにおけ -るキーボードと EGA グラフィックテーブルの割り当てを変更し、"ユーザ割 -り当て(user mapping)"フォントテーブルを使用することができる。 +るキーボードと EGA グラフィックテーブルの割り当てを変更し、 +"ユーザ割り当て(user mapping)"フォントテーブルを使用することができる。 .LP -.\"O Here are brief descriptions of each set: 以下は、それぞれの集合の簡単な説明である。 -.TP -.\"O 8859-1 (Latin-1) -.\"O Latin-1 covers most Western European languages such as Albanian, Catalan, -.\"O Danish, Dutch, English, Faroese, Finnish, French, German, Galician, -.\"O Irish, Icelandic, Italian, Norwegian, Portuguese, Spanish, and -.\"O Swedish. -.\"O The lack of the ligatures Dutch ij, French oe and old-style -.\"O ,,German`` quotation marks is considered tolerable. -8859-1 (Latin-1) -Latin-1 は アルバニア語(Albanian)、カタロニア語(Catalan)、デンマーク語 +.TP +8859\-1 (Latin\-1) +Latin\-1 は アルバニア語(Albanian)、カタロニア語(Catalan)、デンマーク語 (Danish)、オランダ語(Dutch)、英語(English)、フェロー語(Faroese)、 フィンランド語(Finnish)、フランス語(French)、ドイツ語(German)、 ガリシア語(Galician)、アイルランド語(Irish)、アイスランド語(Icelandic)、 @@ -148,436 +85,222 @@ Latin-1 は アルバニア語(Albanian)、カタロニア語(Catalan)、デン スペイン語(Spanish)、スウェーデン語(Swedish)といったほとんどの 西ヨーロッパ言語をカバーする。 ドイツ語の ij やフランス語の oe の合字、および古いスタイルの -,,ドイツ語`` 引用符はないが、許容範囲と考えられている。 -.TP -.\"O 8859-2 (Latin-2) -.\"O Latin-2 supports most Latin-written Slavic and Central European -.\"O languages: Croatian, Czech, German, Hungarian, Polish, Rumanian, -.\"O Slovak, and Slovene. -8859-2 (Latin-2) -Latin-2 はスラヴ語(Slavic)、クロアチア語(Croatian)、チェコ +,,ドイツ語\*(lq 引用符はないが、許容範囲と考えられている。 +.TP +8859\-2 (Latin\-2) +Latin\-2 はスラヴ語(Slavic)、クロアチア語(Croatian)、チェコ 語(Czech)、ドイツ語(German)、ハンガリー語(Hungarian)、ポーランド語 (Polish)、ルーマニア語(Rumanian)、スロヴァキア語(Slovak)、 スロベニア語(Slovene)といった、書き文字としてラテン文字を 使用する、スラブ系言語と中央ヨーロッパの言語のほとんどをサポートする。 -.TP -.\"O 8859-3 (Latin-3) -.\"O Latin-3 is popular with authors of Esperanto, Galician, and Maltese. -.\"O (Turkish is now written with 8859-9 instead.) -8859-3 (Latin-3) -Latin-3 はエスペラント(Esperanto)、ガリシア語(Galician)、マルタ語 +.TP +8859\-3 (Latin\-3) +Latin\-3 はエスペラント(Esperanto)、ガリシア語(Galician)、マルタ語 (Maltese)などの書き手の間で良く用いられる。 -(トルコ語(Turkish)はこれの代わりに 8859-9 で書かれるようになっている) -.TP -.\"O 8859-4 (Latin-4) -.\"O Latin-4 introduced letters for Estonian, Latvian, and Lithuanian. -.\"O It is essentially obsolete; see 8859-10 (Latin-6) and 8859-13 (Latin-7). -8859-4 (Latin-4) -Latin-4 はエストニア語(Estonian)、ラトビア語(Latvian)、リトアニア語 -(Lithuanian)の文字を提供する。Latain-4 は、 +(トルコ語(Turkish)はこれの代わりに 8859\-9 で書かれるようになっている) +.TP +8859\-4 (Latin\-4) +Latin\-4 はエストニア語(Estonian)、ラトビア語(Latvian)、リトアニア語 +(Lithuanian)の文字を提供する。Latain\-4 は、 本質的には廃止されている(obsolate である)。 -8859-10 (Latin-6) と 8859-13 (Latin-7) を参照のこと。 -.TP -.\"O 8859-5 -.\"O Cyrillic letters supporting Bulgarian, Byelorussian, Macedonian, -.\"O Russian, Serbian and Ukrainian. -.\"O Ukrainians read the letter "ghe" -.\"O with downstroke as "heh" and would need a ghe with upstroke to write a -.\"O correct ghe. -.\"O See the discussion of KOI8-R below. -8859-5 -.br +8859\-10 (Latin\-6) と 8859\-13 (Latin\-7) を参照のこと。 +.TP +8859\-5 ブルガリア語(Bulgarian)、ベラルーシ語(Byelorussian)、マケドニア語 (Macedonian)、ロシア語(Russian)、セルビア語(Serbian)、ウクライナ語 (Ukrainian) をサポートするキリル文字集合である。 ウクライナ語では downstroke をつけた "ghe" という文字を "heh" と読み、 ghe を正しく書くには ghe に upstroke をつけなければならない。 -この点については、 -下の KOI8-R に関する議論を参照のこと。 -.TP -.\"O 8859-6 -.\"O Supports Arabic. -.\"O The 8859-6 glyph table is a fixed font of separate -.\"O letter forms, but a proper display engine should combine these -.\"O using the proper initial, medial, and final forms. -8859-6 -.br -アラビア語(Arabic)をサポートする。8859-6 のグリフテーブル(glyph table) +この点については、下の KOI8\-R に関する議論を参照のこと。 +.TP +8859\-6 +アラビア語(Arabic)をサポートする。8859\-6 のグリフテーブル(glyph table) は文字の形態を分割した固定幅フォントである。 そのため、適切なディスプレイエンジンが正しい initial, medial, final フォームに結合しなければならない。 -.TP -.\"O 8859-7 -.\"O Supports Modern Greek. -8859-7 +.TP +8859\-7 現代ギリシャ語(Modern Greek)をサポートする。 -.TP -.\"O 8859-8 -.\"O Supports modern Hebrew without niqud (punctuation signs). -.\"O Niqud and full-fledged Biblical Hebrew are outside the scope of this -.\"O character set; under Linux, UTF-8 is the preferred encoding for -.\"O these. -8859-8 +.TP +8859\-8 niqud(句読点記号) のない近代ヘブライ語(Hebrew)をサポートする。 -niqud と完全な聖書風ヘブライ語(Biblical Hebrew)はこの文字セットの -対象外である。 -Linux では、これらのためには UTF-8 が好ましいエンコーディングである。 -.TP -.\"O 8859-9 (Latin-5) -.\"O This is a variant of Latin-1 that replaces Icelandic letters with -.\"O Turkish ones. -8859-9 (Latin-5) -これは、Latin-1 の変種で、アイスランド語の文字をトルコ語(Turkish)文字に +niqud と完全な聖書風ヘブライ語(Biblical Hebrew)はこの文字セットの対象外である。 +Linux では、これらのためには UTF\-8 が好ましいエンコーディングである。 +.TP +8859\-9 (Latin\-5) +これは、Latin\-1 の変種で、アイスランド語の文字をトルコ語(Turkish)文字に 置き換えたものである。 -.TP -.\"O 8859-10 (Latin-6) -.\"O Latin 6 adds the last Inuit (Greenlandic) and Sami (Lappish) letters -.\"O that were missing in Latin 4 to cover the entire Nordic area. -.\"O RFC 1345 listed a preliminary and different "latin6". -.\"O Skolt Sami still -.\"O needs a few more accents than these. -8859-10 (Latin-6) -Latin-6 は北欧(Nordic)地域をカバーするために Latin-4 には含まれていない +.TP +8859\-10 (Latin\-6) +Latin\-6 は北欧(Nordic)地域をカバーするために Latin\-4 には含まれていない イヌイット語(Inuit)(グリーンランド語(Greenlandic)) と サーメ語(Sami)(ラップ語(Lappish)) を加えてある。 RFC 1345 には、この前段階の、異なった "latin6" が載せられている。 スコルト・サーメ語(Skolt Sami)では、 さらにいくつかのアクセント記号が必要とする。 -.TP -.\"O 8859-11 -.\"O This only exists as a rejected draft standard. -.\"O The draft standard -.\"O was identical to TIS-620, which is used under Linux for Thai. -8859-11 +.TP +8859\-11 これは拒絶された草案標準のためだけに存在する。 -この草案標準は Linux でタイ語のために用いられる TIS-620 と同じものである。 -.TP -.\"O 8859-12 -.\"O This set does not exist. -.\"O While Vietnamese has been suggested for this -.\"O space, it does not fit within the 96 (noncombining) characters ISO -.\"O 8859 offers. -.\"O UTF-8 is the preferred character set for Vietnamese use -.\"O under Linux. -8859-12 +この草案標準は Linux でタイ語のために用いられる TIS\-620 と同じものである。 +.TP +8859\-12 この文字セットは存在しない。 ベトナム語がこの場所を使うように提案したが、 ISO 8859 が提案する(合成でない) 96 文字に収まらなかった。 -Linux ではベトナム語を扱う場合は UTF-8 が好ましい文字セットである。 -.TP -.\"O 8859-13 (Latin-7) -.\"O Supports the Baltic Rim languages; in particular, it includes Latvian -.\"O characters not found in Latin-4. -8859-13 (Latin-7) +Linux ではベトナム語を扱う場合は UTF\-8 が好ましい文字セットである。 +.TP +8859\-13 (Latin\-7) バルト海諸国の言語をサポートする。 -特に、Latin-4 に存在しないラトビア語の文字を含む。 -.TP -.\"O 8859-14 (Latin-8) -.\"O This is the Celtic character set, covering Gaelic and Welsh. -.\"O This charset also contains the dotted characters needed for Old Irish. -8859-14 (Latin-8) -これはケルト語の文字セットであり、ゲール語(Gaelic)とウェールズ語(Welsh)に -対応する。 +特に、Latin\-4 に存在しないラトビア語の文字を含む。 +.TP +8859\-14 (Latin\-8) +これはケルト語の文字セットであり、ゲール語(Gaelic)とウェールズ語(Welsh)に対応する。 この文字セットは古代アイルランド語で用いられる付点付き文字も含む。 -.TP -.\"O 8859-15 (Latin-9) -.\"O This adds the Euro sign and French and Finnish letters that were missing in -.\"O Latin-1. -8859-15 (Latin-9) -これはユーロ記号と Latin-1 に入っていないフランス語とフィンランド語の文字が +.TP +8859\-15 (Latin\-9) +これはユーロ記号と Latin\-1 に入っていないフランス語とフィンランド語の文字が 追加されている。 -.TP -8859-16 (Latin-10) -.\"O This set covers many of the languages covered by 8859-2, and supports -.\"O Romanian more completely then that set does. -この文字セットは 8859-2 で対応する多くの言語に対応し、 +.TP +8859\-16 (Latin\-10) +この文字セットは 8859\-2 で対応する多くの言語に対応し、 さらにルーマニア語にはより完全に対応する。 -.SS KOI8-R -.\"O KOI8-R is a non-ISO character set popular in Russia. -.\"O The lower half -.\"O is US ASCII; the upper is a Cyrillic character set somewhat better -.\"O designed than ISO 8859-5. -.\"O KOI8-U is a common character set, based off -.\"O KOI8-R, that has better support for Ukrainian. -.\"O Neither of these sets -.\"O are ISO-2022 compatible, unlike the ISO-8859 series. -KOI8-R はロシアにおいて良く用いられる、ISO でない文字集合である。 -下位半分は US ASCII である。上位半分は ISO 8859-5 より幾分良く +.SS KOI8\-R +KOI8\-R はロシアにおいて良く用いられる、ISO でない文字集合である。 +下位半分は US ASCII である。上位半分は ISO 8859\-5 より幾分良く デザインされたキリル文字集合である。 -KOI8-U は KOI8-R を元にした共通文字セットであり、 +KOI8\-U は KOI8\-R を元にした共通文字セットであり、 ウクライナ語(Ukrainian) によりよく対応する。 -これらのどちらも ISO-8859 シリーズのように ISO-2022 互換ではない。 +これらのどちらも ISO\-8859 シリーズのように ISO\-2022 互換ではない。 .LP -.\"O Console support for KOI8-R is available under Linux through user-mode -.\"O utilities that modify keyboard bindings and the EGA graphics table, -.\"O and employ the "user mapping" font table in the console driver. -Linux での KOI8-R のコンソールサポートは、 +.\" Thanks to Tomohiro KUBOTA for the following sections about +.\" national standards. +Linux での KOI8\-R のコンソールサポートは、 ユーザモードのユーティリティで実現されている。 これはキーボードの割り当てと EGA グラフィックテーブルを変更し、 コンソールドライバのフォントテーブルに "ユーザ割り当て" を行う。 -.\" Thanks to Tomohiro KUBOTA for the following sections about -.\" national standards. -.SS JIS X 0208 -.\"O JIS X 0208 is a Japanese national standard character set. -.\"O Though there are some more Japanese national standard character sets (like -.\"O JIS X 0201, JIS X 0212, and JIS X 0213), this is the most important one. -.\"O Characters are mapped into a 94x94 two-byte matrix, -.\"O whose each byte is in the range 0x21-0x7e. -.\"O Note that JIS X 0208 is a character set, not an encoding. -.\"O This means that JIS X 0208 -.\"O itself is not used for expressing text data. -.\"O JIS X 0208 is used -.\"O as a component to construct encodings such as EUC-JP, Shift_JIS, -.\"O and ISO-2022-JP. -.\"O EUC-JP is the most important encoding for Linux -.\"O and includes US ASCII and JIS X 0208. -.\"O In EUC-JP, JIS X 0208 -.\"O characters are expressed in two bytes, each of which is the -.\"O JIS X 0208 code plus 0x80. +.SS "JIS X 0208" JIS X 0208 は日本語の国定標準文字セットである。 他にもいくつか日本語の国定標準文字セットはある (JIS X 0201, JIS X 0212, JIS X 0213 など)が、これが最も重要である。 文字は 94x94 の 2 バイトマトリックスに配置される。 -各バイトは 0x21-0x7e の値を持つ。 +各バイトは 0x21\-0x7e の値を持つ。 JIS X 0208 は文字セットであり、エンコーディングではないことに注意すること。 これは、 JIS X 0208 自身はテキストデータの表現には使われない、ということである。 JIS X 0208 は、 -EUC-JP, Shift_JIS, ISO-2022-JP といったエンコーディングを +EUC\-JP, Shift_JIS, ISO\-2022\-JP といったエンコーディングを 構成する部品として用いられる。 -EUC-JP が Linux において最も重要なエンコーディングであり、 +EUC\-JP が Linux において最も重要なエンコーディングであり、 US ASCII と JIS X 0208 を含んでいる。 -EUC-JP では、JIS X 0208 文字は 2 バイトで表現され、 +EUC\-JP では、JIS X 0208 文字は 2 バイトで表現され、 各バイトは JIS X 0208 コードに 0x80 を加えたものである。 -.SS KS X 1001 -.\"O KS X 1001 is a Korean national standard character set. -.\"O Just as -.\"O JIS X 0208, characters are mapped into a 94x94 two-byte matrix. -.\"O KS X 1001 is used like JIS X 0208, as a component -.\"O to construct encodings such as EUC-KR, Johab, and ISO-2022-KR. -.\"O EUC-KR is the most important encoding for Linux and includes -.\"O US ASCII and KS X 1001. -.\"O KS C 5601 is an older name for KS X 1001. +.SS "KS X 1001" KS X 1001 は韓国の国定標準文字セットである。 JIS X 0208 と同様に、文字は 94x94 の 2 バイトマトリックスに配置される。 KS X 1001 は JIS X 0208 と同様に、 -EUC-KR, Johab, ISO-2022-KR といったエンコーディングの部品として用いられる。 -EUC-KR は Linux において最も重要なエンコーディングであり、 +EUC\-KR, Johab, ISO\-2022\-KR といったエンコーディングの部品として用いられる。 +EUC\-KR は Linux において最も重要なエンコーディングであり、 US ASCII と KS X 1001 を含んでいる。 KS C 5601 は KS X 1001 の古い名前である。 -.SS GB 2312 -.\"O GB 2312 is a mainland Chinese national standard character set used -.\"O to express simplified Chinese. -.\"O Just like JIS X 0208, characters are -.\"O mapped into a 94x94 two-byte matrix used to construct EUC-CN. -.\"O EUC-CN -.\"O is the most important encoding for Linux and includes US ASCII and -.\"O GB 2312. -.\"O Note that EUC-CN is often called as GB, GB 2312, or CN-GB. +.SS "GB 2312" GB 2312 は、簡体文字を表現するための中国の国定標準文字セットである。 JIS X 0208 と同様に、文字は 94x94 の 2 バイトマトリックスに配置され、 -EUC-CN に用いられる。 -EUC-CN は Linux において最も重要なエンコーディングであり、 +EUC\-CN に用いられる。 +EUC\-CN は Linux において最も重要なエンコーディングであり、 US ASCII と GB 2312 を含んでいる。 -EUC-CN はしばしば GB, GB 2312, CN-GN などと呼ばれる。 +EUC\-CN はしばしば GB, GB 2312, CN\-GN などと呼ばれる。 .SS Big5 -.\"O Big5 is a popular character set in Taiwan to express traditional -.\"O Chinese. -.\"O (Big5 is both a character set and an encoding.) -.\"O It is a superset of US ASCII. -.\"O Non-ASCII characters are expressed in two bytes. -.\"O Bytes 0xa1-0xfe are used as leading bytes for two-byte characters. -.\"O Big5 and its extension is widely used in Taiwan and Hong Kong. -.\"O It is not ISO 2022-compliant. Big5 は台湾で繁体文字を記述するのに一般的に使われる文字セットである。 (Big5 は文字セットとエンコーディングの両方である。) これは US ASCII の上位集合である。 非 ASCII 文字は 2 バイトで表現する。 -0xa1-0xfe のバイトは 2 バイト文字の 1 文字目として用いる。 +0xa1\-0xfe のバイトは 2 バイト文字の 1 文字目として用いる。 Big5 とその拡張は台湾と香港で広く用いられている。 これは ISO 2022 準拠ではない。 -.SS TIS 620 -.\"O TIS 620 is a Thai national standard character set and a superset -.\"O of US ASCII. -.\"O Like ISO 8859 series, Thai characters are mapped into -.\"O 0xa1-0xfe. -.\"O TIS 620 is the only commonly used character set under -.\"O Linux besides UTF-8 to have combining characters. +.SS "TIS 620" TIS 620 はタイの国定標準文字セットで、US ASCII の上位集合である。 -ISO 8859 シリーズと同様に、タイ文字は 0xa1-0xfe に配置される。 +ISO 8859 シリーズと同様に、タイ文字は 0xa1\-0xfe に配置される。 TIS 620 は Linux でのみ一般的に用いられている文字セットであり、 -また、UTF-8 は合成文字も持っている。 +また、UTF\-8 は合成文字も持っている。 .SS UNICODE -.\"O Unicode (ISO 10646) is a standard which aims to unambiguously represent every -.\"O character in every human language. -.\"O Unicode's structure permits 20.1 bits to encode every character. -.\"O Since most computers don't include 20.1-bit -.\"O integers, Unicode is usually encoded as 32-bit integers internally and -.\"O either a series of 16-bit integers (UTF-16) (needing two 16-bit integers -.\"O only when encoding certain rare characters) or a series of 8-bit bytes -.\"O (UTF-8). -.\"O Information on Unicode is available at . Unicode (ISO10646) は、人間が用いる全ての言語の全ての文字を、 明確にあらわすことを目的とした規格である。 Unicode の構造は各文字のエンコードに 20.1 ビットを与えている。 ほとんどのコンピューターは 20.1 ビットの整数を扱えないので、 Unicode は普通内部データとして 32 ビット整数にエンコードされ、 -16 ビット整数の列 (UTF-16)(ある種の珍しい文字をエンコードする場合にだけ +16 ビット整数の列 (UTF\-16)(ある種の珍しい文字をエンコードする場合にだけ 2 つの 16 ビット整数が必要となる)か、 -8 ビットバイトの列 (UTF-8)として扱われる。 +8 ビットバイトの列 (UTF\-8)として扱われる。 Unicode についての情報は、 から得られる。 .LP -.\"O Linux represents Unicode using the 8-bit Unicode Transformation Format -.\"O (UTF-8). -.\"O UTF-8 is a variable length encoding of Unicode. -.\"O It uses 1 -.\"O byte to code 7 bits, 2 bytes for 11 bits, 3 bytes for 16 bits, 4 bytes -.\"O for 21 bits, 5 bytes for 26 bits, 6 bytes for 31 bits. -Linux は 8-bit Unicode Transformation Form(UTF-8) を用いて Unicode を -あらわす。 UTF-8 は Unicode の可変長表現である。UTF-8 は 7 ビットを +Linux は 8\-bit Unicode Transformation Form(UTF\-8) を用いて Unicode を +あらわす。 UTF\-8 は Unicode の可変長表現である。UTF\-8 は 7 ビットを 符号化するのに 1 バイトを、 11 ビットでは 2 バイトを、 16 ビットでは 3 バイトを、 21 ビットでは 4 バイトを、 26 ビットでは 5 バイトを、 31 ビットでは 6 バイトを用いる。 .LP -.\"O Let 0,1,x stand for a zero, one, or arbitrary bit. -.\"O A byte 0xxxxxxx -.\"O stands for the Unicode 00000000 0xxxxxxx which codes the same symbol -.\"O as the ASCII 0xxxxxxx. -.\"O Thus, ASCII goes unchanged into UTF-8, and -.\"O people using only ASCII do not notice any change: not in code, and not -.\"O in file size. 0,1,x をゼロ、1、任意のビットとすると、あるバイト 0xxxxxxx は Unicode では 00000000 0xxxxxxx とあらわされる。これは、ASCII の 0xxxxxxx と同じ -シンボルのコードである。このように、ASCII は変更なしに UTF-8 に変換でき、 +シンボルのコードである。このように、ASCII は変更なしに UTF\-8 に変換でき、 ASCII のみを使う場合は、コードにおいてもファイルサイズにおいても、 変更に関して何も気にしなくてよい。 .LP -.\"O A byte 110xxxxx is the start of a 2-byte code, and 110xxxxx 10yyyyyy -.\"O is assembled into 00000xxx xxyyyyyy. -.\"O A byte 1110xxxx is the start -.\"O of a 3-byte code, and 1110xxxx 10yyyyyy 10zzzzzz is assembled -.\"O into xxxxyyyy yyzzzzzz. -.\"O (When UTF-8 is used to code the 31-bit ISO 10646 -.\"O then this progression continues up to 6-byte codes.) 110xxxxx というバイトは 2 バイトコードの始まりである、そして、110xxxxx 10yyyyyy は 00000xxx xxyyyyyy というように組み立てられる。また、 1110xxxx は 3 バイトコードの始まりであり、1110xxxx 10yyyyyy 10zzzzzz -は xxxxyyyy yyzzzzzz というように組み立てられる(UTF-8 が 31 ビット +は xxxxyyyy yyzzzzzz というように組み立てられる(UTF\-8 が 31 ビット ISO 10646 コードを利用するときは、この工程は 6 バイトコードまで発展させられる)。 .LP -.\"O For most people who use ISO-8859 character sets, this means that the -.\"O characters outside of ASCII are now coded with two bytes. -.\"O This tends -.\"O to expand ordinary text files by only one or two percent. -.\"O For Russian -.\"O or Greek users, this expands ordinary text files by 100%, since text in -.\"O those languages is mostly outside of ASCII. -.\"O For Japanese users this means -.\"O that the 16-bit codes now in common use will take three bytes. -.\"O While there -.\"O are algorithmic conversions from some character sets (esp. ISO-8859-1) to -.\"O Unicode, general conversion requires carrying around conversion tables, -.\"O which can be quite large for 16-bit codes. -ISO-8859-1 文字セットを使うほとんどのユーザにとって、 +ISO\-8859\-1 文字セットを使うほとんどのユーザにとって、 この事実は、ASCII の範囲外を使った文字は 二つのバイトに符号化されるということを意味する。このことから -(UTF-8 を使うと、ISO-8859-1を使用している)元々のテキストファイルのサイズから +(UTF\-8 を使うと、ISO\-8859\-1を使用している)元々のテキストファイルのサイズから 1 〜 2 パーセント大きくなってしまうことになる。 ロシア語やギリシャ語を利用するユーザーにとっては、 これによって元のテキストは 2 倍の大きさになることになる。 なぜならこれらの言語はほとんどが ASCII の範囲外だからである。 -現在 16-bit コードを広く利用している日本語を利用するユーザには +現在 16\-bit コードを広く利用している日本語を利用するユーザには 3 バイト必要となる。 Unicode への変換にアルゴリズム的変換をすればよい文字セットがある -(特に ISO-8859-1)一方、一般的には変換テーブルが必要であり、 +(特に ISO\-8859\-1)一方、一般的には変換テーブルが必要であり、 16 ビットコードの場合はこのテーブルはかなり大きなものとなる。 .LP -.\"O Note that UTF-8 is self-synchronizing: 10xxxxxx is a tail, any other -.\"O byte is the head of a code. -.\"O Note that the only way ASCII bytes occur -.\"O in a UTF-8 stream, is as themselves. -.\"O In particular, there are no -.\"O embedded NULs (\(aq\\0\(aq) or \(aq/\(aqs that form part of some larger code. -UTF-8 は自己同期的である。10xxxxxx は終端であり、ほかのバイトはコードの -先頭である。UTF-8 の文字列における ASCII のバイトは、常にその文字自身を +UTF\-8 は自己同期的である。10xxxxxx は終端であり、ほかのバイトはコードの +先頭である。UTF\-8 の文字列における ASCII のバイトは、常にその文字自身を 表現することに注目してほしい。特に、幾つかの大きなコードのパートを形成 -するために、NUL (\(aq\\0\(aq)) や \(aq/\(aq を埋め込む必要はない。 +するために、NUL (\(aq\e0\(aq) や \(aq/\(aq を埋め込む必要はない。 .LP -.\"O Since ASCII, and, in particular, NUL and \(aq/\(aq, are unchanged, the -.\"O kernel does not notice that UTF-8 is being used. -.\"O It does not care at -.\"O all what the bytes it is handling stand for. -ASCII と NUL と \(aq/\(aq は変更されないため、カーネルは UTF-8 を +ASCII と NUL と \(aq/\(aq は変更されないため、カーネルは UTF\-8 を 使用していることを特に意識しなくても良い。 カーネルはバイトが何をあらわしているかに注意する必要がない。 .LP -.\"O Rendering of Unicode data streams is typically handled through -.\"O "subfont" tables which map a subset of Unicode to glyphs. -.\"O Internally -.\"O the kernel uses Unicode to describe the subfont loaded in video RAM. -.\"O This means that in UTF-8 mode one can use a character set with 512 -.\"O different symbols. -.\"O This is not enough for Japanese, Chinese and -.\"O Korean, but it is enough for most other purposes. Unicode データ列のレンダリングは典型的には Unicode のサブセットから グリフへのマップである"サブフォント(subfont)"テーブルを利用して 行われる。カーネル内部では、Unicode を ビデオ RAM 内部にロードされた -サブフォントとして記述する。これは、UTF-8 モードでは 512 の異なったシンボルを +サブフォントとして記述する。これは、UTF\-8 モードでは 512 の異なったシンボルを 持った文字集合を利用可能であることを意味する。 これは、日本語、中国語、韓国語では十分ではない、しかし、その他の利用では 十分である。 .LP -.\"O At the current time, the console driver does not handle combining -.\"O characters. -.\"O So Thai, Sioux and any other script needing combining -.\"O characters can't be handled on the console. 現在のところ、コンソールドライバは合成文字を扱えない。 従って、タイ語、スー語やその他の合成文字が必要な文章は コンソールでは扱えない。 -.\"O .SS "ISO 2022 AND ISO 4873" -.SS "ISO 2022 と ISO 4873" -.\"O The ISO 2022 and 4873 standards describe a font-control model -.\"O based on VT100 practice. -.\"O This model is (partially) supported -.\"O by the Linux kernel and by -.\"O .BR xterm (1). -.\"O It is popular in Japan and Korea. +.SS "ISO 2022 and ISO 4873" ISO 2022 と ISO 4873 標準では、 VT100 の動作に基づいたフォントコントロールモデルを述べられている。 -このモデルは Linux カーネルや -.BR xterm (1) -において(部分的に)サポートされている。この標準は日本や韓国においてよく -用いられる。 +このモデルは Linux カーネルや \fBxterm\fP(1) において(部分的に)サポートされている。 +この標準は日本や韓国においてよく用いられる。 .LP -.\"O There are 4 graphic character sets, called G0, G1, G2 and G3, -.\"O and one of them is the current character set for codes with -.\"O high bit zero (initially G0), and one of them is the current -.\"O character set for codes with high bit one (initially G1). -.\"O Each graphic character set has 94 or 96 characters, and is -.\"O essentially a 7-bit character set. -.\"O It uses codes either -.\"O 040-0177 (041-0176) or 0240-0377 (0241-0376). -.\"O G0 always has size 94 and uses codes 041-0176. G0, G1, G2, G3 と呼ばれる 4 つの図形文字集合がある。 これらのうちのひとつは、最上位ビットが 0 であるコードのための現在の文字集合 (初期値は G0)、またひとつは最上位ビットが 1 であるコードのための現在の 文字集合(初期値は G1)である。それぞれの図形文字集合は 94 か 96 の文 -字を持ち、基本的に 7-bitの文字集合であり、040-0177 (041-0176) か -0240-0377 (0241-0376)のコードを使う。 -G0 は常に 94 文字で 041-0176 のコードを使用する。 +字を持ち、基本的に 7\-bitの文字集合であり、040\-0177 (041\-0176) か +0240\-0377 (0241\-0376)のコードを使う。 +G0 は常に 94 文字で 041\-0176 のコードを使用する。 .LP -.\"O Switching between character sets is done using the shift functions -.\"O \fB^N\fP (SO or LS1), \fB^O\fP (SI or LS0), ESC n (LS2), ESC o (LS3), -.\"O ESC N (SS2), ESC O (SS3), ESC ~ (LS1R), ESC } (LS2R), ESC | (LS3R). -.\"O The function LS\fIn\fP makes character set G\fIn\fP the current one -.\"O for codes with high bit zero. -.\"O The function LS\fIn\fPR makes character set G\fIn\fP the current one -.\"O for codes with high bit one. -.\"O The function SS\fIn\fP makes character set G\fIn\fP (\fIn\fP=2 or 3) -.\"O the current one for the next character only (regardless of the value -.\"O of its high order bit). 文字集合の切り替えはシフトファンクション \fB^N\fP (SO または LS1), \fB^O\fP (SI または LS0), ESC n (LS2), ESC o (LS3), ESC N (SS2), ESC O (SS3), ESC ~ (LS1R), ESC } (LS2R), ESC | (LS3R) を使って行われる。 @@ -588,17 +311,6 @@ G\fIn\fP に設定する。 ファンクション SS\fIn\fP は(最上位ビットの値にかかわらず)次の文字のみ 文字集合を G\fIn\fP (\fIn\fP=2 または 3)に設定する。 .LP -.\"O A 94-character set is designated as G\fIn\fP character set -.\"O by an escape sequence ESC ( xx (for G0), ESC ) xx (for G1), -.\"O ESC * xx (for G2), ESC + xx (for G3), where xx is a symbol -.\"O or a pair of symbols found in the ISO 2375 International -.\"O Register of Coded Character Sets. -.\"O For example, ESC ( @ selects the ISO 646 character set as G0, -.\"O ESC ( A selects the UK standard character set (with pound -.\"O instead of number sign), ESC ( B selects ASCII (with dollar -.\"O instead of currency sign), ESC ( M selects a character set -.\"O for African languages, ESC ( ! A selects the Cuban character -.\"O set, etc. etc. 94 文字集合では、エスケープシーケンス ESC ( xx (G0 用), ESC ) xx (G1 用), ESC * xx (G2 用), ESC + xx (G3 用) によって、G\fIn\fP 文字集合 を用いるように指示される。 @@ -610,22 +322,12 @@ xx は "ISO 2375 International Register of Coded Character Sets" で ESC ( M は アフリカ言語(African languages) を選択し、ESC ( ! A は キューバ語(Cuban)文字集合を選択する。などなど… .LP -.\"O A 96-character set is designated as G\fIn\fP character set -.\"O by an escape sequence ESC \- xx (for G1), ESC . xx (for G2) -.\"O or ESC / xx (for G3). -.\"O For example, ESC - G selects the Hebrew alphabet as G1. -96-文字集合では、エスケープシーケンス ESC +96\-文字集合では、エスケープシーケンス ESC \- xx (G1 用), ESC . xx (G2 用), ECS / xx (G3 用)を用いることで、 G\fIn\fP 文字集合を使用するように指示される。 -例えば、ESC - G はヘブライアルファベット(Hebrew alphabet) を +例えば、ESC \- G はヘブライアルファベット(Hebrew alphabet) を G1 として選択する。 .LP -.\"O A multibyte character set is designated as G\fIn\fP character set -.\"O by an escape sequence ESC $ xx or ESC $ ( xx (for G0), -.\"O ESC $ ) xx (for G1), ESC $ * xx (for G2), ESC $ + xx (for G3). -.\"O For example, ESC $ ( C selects the Korean character set for G0. -.\"O The Japanese character set selected by ESC $ B has a more -.\"O recent version selected by ESC & @ ESC $ B. マルチバイト文字集合ではエスケープシーケンス E $ xx または ESC $ ( xx (G0 用), ESC $ ) xx (G1 用), ESC $ * xx (G2 用), ESC$ + xx (G3 用) を 用いることで、 G\fIn\fP 文字集合を使用するように指示される。 @@ -633,12 +335,6 @@ G1 として選択する。 ESC $ B によって選択される日本語文字セットは、より最近のバージョンでは ESC & @ ESC $ B によって選択されるようになった。 .LP -.\"O ISO 4873 stipulates a narrower use of character sets, where G0 -.\"O is fixed (always ASCII), so that G1, G2 and G3 -.\"O can only be invoked for codes with the high order bit set. -.\"O In particular, \fB^N\fP and \fB^O\fP are not used anymore, ESC ( xx -.\"O can be used only with xx=B, and ESC ) xx, ESC * xx, ESC + xx -.\"O are equivalent to ESC \- xx, ESC . xx, ESC / xx, respectively. ISO 4873 はより制限された文字集合の利用を規定する、その規定で は、G0 は(常に ASCIIに)固定される。従って、G1, G2, G3 は最上位ビットが セットされたコードとしてのみ呼び出すことができる。 @@ -646,12 +342,6 @@ ISO 4873 はより制限された文字集合の利用を規定する、その 用いることができ、 ESC ) xx, ESC * xx, ESC + xx はそれぞれ ESC \- xx, ESC . xx, ESC / xx と 等価になる。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR console (4), -.BR console_codes (4), -.BR console_ioctl (4), -.BR ascii (7), -.BR iso_8859-1 (7), -.BR unicode (7), -.BR utf-8 (7) +\fBconsole\fP(4), \fBconsole_codes\fP(4), \fBconsole_ioctl\fP(4), \fBascii\fP(7), +\fBiso_8859\-1\fP(7), \fBunicode\fP(7), \fButf\-8\fP(7) diff --git a/draft/man7/cpuset.7 b/draft/man7/cpuset.7 new file mode 100644 index 00000000..e90bade1 --- /dev/null +++ b/draft/man7/cpuset.7 @@ -0,0 +1,1029 @@ +.\" Copyright (c) 2008 Silicon Graphics, Inc. +.\" +.\" Author: Paul Jackson (http://oss.sgi.com/projects/cpusets) +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License +.\" version 2 as published by the Free Software Foundation. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, +.\" MA 02111, USA. +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH CPUSET 7 2008\-11\-12 Linux "Linux Programmer's Manual" +.SH 名前 +cpuset \- confine processes to processor and memory node subsets +.SH 説明 +The cpuset file system is a pseudo\-file\-system interface to the kernel +cpuset mechanism, which is used to control the processor placement and +memory placement of processes. It is commonly mounted at \fI/dev/cpuset\fP. +.PP +On systems with kernels compiled with built in support for cpusets, all +processes are attached to a cpuset, and cpusets are always present. If a +system supports cpusets, then it will have the entry \fBnodev cpuset\fP in the +file \fI/proc/filesystems\fP. By mounting the cpuset file system (see the +\fBEXAMPLE\fP section below), the administrator can configure the cpusets on a +system to control the processor and memory placement of processes on that +system. By default, if the cpuset configuration on a system is not modified +or if the cpuset file system is not even mounted, then the cpuset mechanism, +though present, has no affect on the system's behavior. +.PP +A cpuset defines a list of CPUs and memory nodes. +.PP +The CPUs of a system include all the logical processing units on which a +process can execute, including, if present, multiple processor cores within +a package and Hyper\-Threads within a processor core. Memory nodes include +all distinct banks of main memory; small and SMP systems typically have just +one memory node that contains all the system's main memory, while NUMA +(non\-uniform memory access) systems have multiple memory nodes. +.PP +Cpusets are represented as directories in a hierarchical pseudo\-file system, +where the top directory in the hierarchy (\fI/dev/cpuset\fP) represents the +entire system (all online CPUs and memory nodes) and any cpuset that is the +child (descendant) of another parent cpuset contains a subset of that +parent's CPUs and memory nodes. The directories and files representing +cpusets have normal file\-system permissions. +.PP +Every process in the system belongs to exactly one cpuset. A process is +confined to only run on the CPUs in the cpuset it belongs to, and to +allocate memory only on the memory nodes in that cpuset. When a process +\fBfork\fP(2)s, the child process is placed in the same cpuset as its parent. +With sufficient privilege, a process may be moved from one cpuset to another +and the allowed CPUs and memory nodes of an existing cpuset may be changed. +.PP +When the system begins booting, a single cpuset is defined that includes all +CPUs and memory nodes on the system, and all processes are in that cpuset. +During the boot process, or later during normal system operation, other +cpusets may be created, as subdirectories of this top cpuset, under the +control of the system administrator, and processes may be placed in these +other cpusets. +.PP +Cpusets are integrated with the \fBsched_setaffinity\fP(2) scheduling affinity +mechanism and the \fBmbind\fP(2) and \fBset_mempolicy\fP(2) memory\-placement +mechanisms in the kernel. Neither of these mechanisms let a process make +use of a CPU or memory node that is not allowed by that process's cpuset. +If changes to a process's cpuset placement conflict with these other +mechanisms, then cpuset placement is enforced even if it means overriding +these other mechanisms. The kernel accomplishes this overriding by silently +restricting the CPUs and memory nodes requested by these other mechanisms to +those allowed by the invoking process's cpuset. This can result in these +other calls returning an error, if for example, such a call ends up +requesting an empty set of CPUs or memory nodes, after that request is +restricted to the invoking process's cpuset. +.PP +Typically, a cpuset is used to manage the CPU and memory\-node confinement +for a set of cooperating processes such as a batch scheduler job, and these +other mechanisms are used to manage the placement of individual processes or +memory regions within that set or job. +.SH FILES +Each directory below \fI/dev/cpuset\fP represents a cpuset and contains a fixed +set of pseudo\-files describing the state of that cpuset. +.PP +New cpusets are created using the \fBmkdir\fP(2) system call or the +\fBmkdir\fP(1) command. The properties of a cpuset, such as its flags, +allowed CPUs and memory nodes, and attached processes, are queried and +modified by reading or writing to the appropriate file in that cpuset's +directory, as listed below. +.PP +The pseudo\-files in each cpuset directory are automatically created when the +cpuset is created, as a result of the \fBmkdir\fP(2) invocation. It is not +possible to directly add or remove these pseudo\-files. +.PP +A cpuset directory that contains no child cpuset directories, and has no +attached processes, can be removed using \fBrmdir\fP(2) or \fBrmdir\fP(1). It is +not necessary, or possible, to remove the pseudo\-files inside the directory +before removing it. +.PP +The pseudo\-files in each cpuset directory are small text files that may be +read and written using traditional shell utilities such as \fBcat\fP(1), and +\fBecho\fP(1), or from a program by using file I/O library functions or system +calls, such as \fBopen\fP(2), \fBread\fP(2), \fBwrite\fP(2), and \fBclose\fP(2). +.PP +.\" ====================== tasks ====================== +The pseudo\-files in a cpuset directory represent internal kernel state and +do not have any persistent image on disk. Each of these per\-cpuset files is +listed and described below. +.TP +\fItasks\fP +List of the process IDs (PIDs) of the processes in that cpuset. The list is +formatted as a series of ASCII decimal numbers, each followed by a newline. +A process may be added to a cpuset (automatically removing it from the +cpuset that previously contained it) by writing its PID to that cpuset's +\fItasks\fP file (with or without a trailing newline.) + +.\" =================== notify_on_release =================== +\fBWarning:\fP only one PID may be written to the \fItasks\fP file at a time. If +a string is written that contains more than one PID, only the first one will +be used. +.TP +\fInotify_on_release\fP +.\" ====================== cpus ====================== +Flag (0 or 1). If set (1), that cpuset will receive special handling after +it is released, that is, after all processes cease using it (i.e., terminate +or are moved to a different cpuset) and all child cpuset directories have +been removed. See the \fBNotify On Release\fP section, below. +.TP +\fIcpus\fP +List of the physical numbers of the CPUs on which processes in that cpuset +are allowed to execute. See \fBList Format\fP below for a description of the +format of \fIcpus\fP. + +.\" ==================== cpu_exclusive ==================== +The CPUs allowed to a cpuset may be changed by writing a new list to its +\fIcpus\fP file. +.TP +\fIcpu_exclusive\fP +Flag (0 or 1). If set (1), the cpuset has exclusive use of its CPUs (no +sibling or cousin cpuset may overlap CPUs). By default this is off (0). +Newly created cpusets also initially default this to off (0). + +.\" ====================== mems ====================== +Two cpusets are \fIsibling\fP cpusets if they share the same parent cpuset in +the \fI/dev/cpuset\fP hierarchy. Two cpusets are \fIcousin\fP cpusets if neither +is the ancestor of the other. Regardless of the \fIcpu_exclusive\fP setting, +if one cpuset is the ancestor of another, and if both of these cpusets have +nonempty \fIcpus\fP, then their \fIcpus\fP must overlap, because the \fIcpus\fP of +any cpuset are always a subset of the \fIcpus\fP of its parent cpuset. +.TP +\fImems\fP +.\" ==================== mem_exclusive ==================== +List of memory nodes on which processes in this cpuset are allowed to +allocate memory. See \fBList Format\fP below for a description of the format +of \fImems\fP. +.TP +\fImem_exclusive\fP +Flag (0 or 1). If set (1), the cpuset has exclusive use of its memory nodes +(no sibling or cousin may overlap). Also if set (1), the cpuset is a +\fBHardwall\fP cpuset (see below.) By default this is off (0). Newly created +cpusets also initially default this to off (0). + +.\" ==================== mem_hardwall ==================== +Regardless of the \fImem_exclusive\fP setting, if one cpuset is the ancestor of +another, then their memory nodes must overlap, because the memory nodes of +any cpuset are always a subset of the memory nodes of that cpuset's parent +cpuset. +.TP +\fImem_hardwall\fP (since Linux 2.6.26) +.\" ==================== memory_migrate ==================== +Flag (0 or 1). If set (1), the cpuset is a \fBHardwall\fP cpuset (see below.) +Unlike \fBmem_exclusive\fP, there is no constraint on whether cpusets marked +\fBmem_hardwall\fP may have overlapping memory nodes with sibling or cousin +cpusets. By default this is off (0). Newly created cpusets also initially +default this to off (0). +.TP +\fImemory_migrate\fP (since Linux 2.6.16) +.\" ==================== memory_pressure ==================== +Flag (0 or 1). If set (1), then memory migration is enabled. By default +this is off (0). See the \fBMemory Migration\fP section, below. +.TP +\fImemory_pressure\fP (since Linux 2.6.16) +.\" ================= memory_pressure_enabled ================= +A measure of how much memory pressure the processes in this cpuset are +causing. See the \fBMemory Pressure\fP section, below. Unless +\fImemory_pressure_enabled\fP is enabled, always has value zero (0). This file +is read\-only. See the \fBWARNINGS\fP section, below. +.TP +\fImemory_pressure_enabled\fP (since Linux 2.6.16) +.\" ================== memory_spread_page ================== +Flag (0 or 1). This file is only present in the root cpuset, normally +\fI/dev/cpuset\fP. If set (1), the \fImemory_pressure\fP calculations are enabled +for all cpusets in the system. By default this is off (0). See the +\fBMemory Pressure\fP section, below. +.TP +\fImemory_spread_page\fP (since Linux 2.6.17) +.\" ================== memory_spread_slab ================== +Flag (0 or 1). If set (1), pages in the kernel page cache (file\-system +buffers) are uniformly spread across the cpuset. By default this is off (0) +in the top cpuset, and inherited from the parent cpuset in newly created +cpusets. See the \fBMemory Spread\fP section, below. +.TP +\fImemory_spread_slab\fP (since Linux 2.6.17) +.\" ================== sched_load_balance ================== +Flag (0 or 1). If set (1), the kernel slab caches for file I/O (directory +and inode structures) are uniformly spread across the cpuset. By default +this is off (0) in the top cpuset, and inherited from the parent cpuset in +newly created cpusets. See the \fBMemory Spread\fP section, below. +.TP +\fIsched_load_balance\fP (since Linux 2.6.24) +.\" ================== sched_relax_domain_level ================== +Flag (0 or 1). If set (1, the default) the kernel will automatically load +balance processes in that cpuset over the allowed CPUs in that cpuset. If +cleared (0) the kernel will avoid load balancing processes in this cpuset, +\fIunless\fP some other cpuset with overlapping CPUs has its +\fIsched_load_balance\fP flag set. See \fBScheduler Load Balancing\fP, below, for +further details. +.TP +\fIsched_relax_domain_level\fP (since Linux 2.6.26) +.\" ================== proc cpuset ================== +Integer, between \-1 and a small positive value. The +\fIsched_relax_domain_level\fP controls the width of the range of CPUs over +which the kernel scheduler performs immediate rebalancing of runnable tasks +across CPUs. If \fIsched_load_balance\fP is disabled, then the setting of +\fIsched_relax_domain_level\fP does not matter, as no such load balancing is +done. If \fIsched_load_balance\fP is enabled, then the higher the value of the +\fIsched_relax_domain_level\fP, the wider the range of CPUs over which +immediate load balancing is attempted. See \fBScheduler Relax Domain Level\fP, +below, for further details. +.PP +.\" ================== proc status ================== +In addition to the above pseudo\-files in each directory below +\fI/dev/cpuset\fP, each process has a pseudo\-file, +\fI/proc//cpuset\fP, that displays the path of the process's +cpuset directory relative to the root of the cpuset file system. +.PP +Also the \fI/proc//status\fP file for each process has four added +lines, displaying the process's \fICpus_allowed\fP (on which CPUs it may be +scheduled) and \fIMems_allowed\fP (on which memory nodes it may obtain memory), +in the two formats \fBMask Format\fP and \fBList Format\fP (see below) as shown +in the following example: +.PP +.RS +.nf +Cpus_allowed: ffffffff,ffffffff,ffffffff,ffffffff +Cpus_allowed_list: 0\-127 +Mems_allowed: ffffffff,ffffffff +Mems_allowed_list: 0\-63 +.fi +.RE +.PP +.\" ================== EXTENDED CAPABILITIES ================== +The "allowed" fields were added in Linux 2.6.24; the "allowed_list" fields +were added in Linux 2.6.26. +.SH "EXTENDED CAPABILITIES" +.\" ================== Exclusive Cpusets ================== +In addition to controlling which \fIcpus\fP and \fImems\fP a process is allowed to +use, cpusets provide the following extended capabilities. +.SS "Exclusive Cpusets" +If a cpuset is marked \fIcpu_exclusive\fP or \fImem_exclusive\fP, no other cpuset, +other than a direct ancestor or descendant, may share any of the same CPUs +or memory nodes. +.PP +.\" ================== Hardwall ================== +A cpuset that is \fImem_exclusive\fP restricts kernel allocations for buffer +cache pages and other internal kernel data pages commonly shared by the +kernel across multiple users. All cpusets, whether \fImem_exclusive\fP or not, +restrict allocations of memory for user space. This enables configuring a +system so that several independent jobs can share common kernel data, while +isolating each job's user allocation in its own cpuset. To do this, +construct a large \fImem_exclusive\fP cpuset to hold all the jobs, and +construct child, non\-\fImem_exclusive\fP cpusets for each individual job. Only +a small amount of kernel memory, such as requests from interrupt handlers, +is allowed to be placed on memory nodes outside even a \fImem_exclusive\fP +cpuset. +.SS Hardwall +A cpuset that has \fImem_exclusive\fP or \fImem_hardwall\fP set is a \fIhardwall\fP +cpuset. A \fIhardwall\fP cpuset restricts kernel allocations for page, buffer, +and other data commonly shared by the kernel across multiple users. All +cpusets, whether \fIhardwall\fP or not, restrict allocations of memory for user +space. +.PP +This enables configuring a system so that several independent jobs can share +common kernel data, such as file system pages, while isolating each job's +user allocation in its own cpuset. To do this, construct a large +\fIhardwall\fP cpuset to hold all the jobs, and construct child cpusets for +each individual job which are not \fIhardwall\fP cpusets. +.PP +.\" ================== Notify On Release ================== +Only a small amount of kernel memory, such as requests from interrupt +handlers, is allowed to be taken outside even a \fIhardwall\fP cpuset. +.SS "Notify On Release" +If the \fInotify_on_release\fP flag is enabled (1) in a cpuset, then whenever +the last process in the cpuset leaves (exits or attaches to some other +cpuset) and the last child cpuset of that cpuset is removed, the kernel +will run the command \fI/sbin/cpuset_release_agent\fP, supplying the pathname +(relative to the mount point of the cpuset file system) of the abandoned +cpuset. This enables automatic removal of abandoned cpusets. +.PP +The default value of \fInotify_on_release\fP in the root cpuset at system boot +is disabled (0). The default value of other cpusets at creation is the +current value of their parent's \fInotify_on_release\fP setting. +.PP +The command \fI/sbin/cpuset_release_agent\fP is invoked, with the name +(\fI/dev/cpuset\fP relative path) of the to\-be\-released cpuset in \fIargv[1]\fP. +.PP +The usual contents of the command \fI/sbin/cpuset_release_agent\fP is simply +the shell script: +.in +4n +.nf + +#!/bin/sh +rmdir /dev/cpuset/$1 +.fi +.in +.PP +.\" ================== Memory Pressure ================== +As with other flag values below, this flag can be changed by writing an +ASCII number 0 or 1 (with optional trailing newline) into the file, to +clear or set the flag, respectively. +.SS "Memory Pressure" +The \fImemory_pressure\fP of a cpuset provides a simple per\-cpuset running +average of the rate that the processes in a cpuset are attempting to free up +in\-use memory on the nodes of the cpuset to satisfy additional memory +requests. +.PP +This enables batch managers that are monitoring jobs running in dedicated +cpusets to efficiently detect what level of memory pressure that job is +causing. +.PP +This is useful both on tightly managed systems running a wide mix of +submitted jobs, which may choose to terminate or reprioritize jobs that are +trying to use more memory than allowed on the nodes assigned them, and with +tightly coupled, long\-running, massively parallel scientific computing jobs +that will dramatically fail to meet required performance goals if they start +to use more memory than allowed to them. +.PP +This mechanism provides a very economical way for the batch manager to +monitor a cpuset for signs of memory pressure. It's up to the batch manager +or other user code to decide what action to take if it detects signs of +memory pressure. +.PP +Unless memory pressure calculation is enabled by setting the pseudo\-file +\fI/dev/cpuset/memory_pressure_enabled\fP, it is not computed for any cpuset, +and reads from any \fImemory_pressure\fP always return zero, as represented by +the ASCII string "0\en". See the \fBWARNINGS\fP section, below. +.PP +A per\-cpuset, running average is employed for the following reasons: +.IP * 3 +Because this meter is per\-cpuset rather than per\-process or per virtual +memory region, the system load imposed by a batch scheduler monitoring this +metric is sharply reduced on large systems, because a scan of the tasklist +can be avoided on each set of queries. +.IP * +Because this meter is a running average rather than an accumulating counter, +a batch scheduler can detect memory pressure with a single read, instead of +having to read and accumulate results for a period of time. +.IP * +Because this meter is per\-cpuset rather than per\-process, the batch +scheduler can obtain the key information\(emmemory pressure in a +cpuset\(emwith a single read, rather than having to query and accumulate +results over all the (dynamically changing) set of processes in the cpuset. +.PP +The \fImemory_pressure\fP of a cpuset is calculated using a per\-cpuset simple +digital filter that is kept within the kernel. For each cpuset, this filter +tracks the recent rate at which processes attached to that cpuset enter the +kernel direct reclaim code. +.PP +The kernel direct reclaim code is entered whenever a process has to satisfy +a memory page request by first finding some other page to repurpose, due to +lack of any readily available already free pages. Dirty file system pages +are repurposed by first writing them to disk. Unmodified file system buffer +pages are repurposed by simply dropping them, though if that page is needed +again, it will have to be reread from disk. +.PP +.\" ================== Memory Spread ================== +The \fImemory_pressure\fP file provides an integer number representing the +recent (half\-life of 10 seconds) rate of entries to the direct reclaim code +caused by any process in the cpuset, in units of reclaims attempted per +second, times 1000. +.SS "Memory Spread" +There are two Boolean flag files per cpuset that control where the kernel +allocates pages for the file\-system buffers and related in\-kernel data +structures. They are called \fImemory_spread_page\fP and +\fImemory_spread_slab\fP. +.PP +If the per\-cpuset Boolean flag file \fImemory_spread_page\fP is set, then the +kernel will spread the file\-system buffers (page cache) evenly over all the +nodes that the faulting process is allowed to use, instead of preferring to +put those pages on the node where the process is running. +.PP +If the per\-cpuset Boolean flag file \fImemory_spread_slab\fP is set, then the +kernel will spread some file\-system\-related slab caches, such as those for +inodes and directory entries, evenly over all the nodes that the faulting +process is allowed to use, instead of preferring to put those pages on the +node where the process is running. +.PP +The setting of these flags does not affect the data segment (see \fBbrk\fP(2)) +or stack segment pages of a process. +.PP +By default, both kinds of memory spreading are off and the kernel prefers to +allocate memory pages on the node local to where the requesting process is +running. If that node is not allowed by the process's NUMA memory policy or +cpuset configuration or if there are insufficient free memory pages on that +node, then the kernel looks for the nearest node that is allowed and has +sufficient free memory. +.PP +When new cpusets are created, they inherit the memory spread settings of +their parent. +.PP +Setting memory spreading causes allocations for the affected page or slab +caches to ignore the process's NUMA memory policy and be spread instead. +However, the effect of these changes in memory placement caused by +cpuset\-specified memory spreading is hidden from the \fBmbind\fP(2) or +\fBset_mempolicy\fP(2) calls. These two NUMA memory policy calls always +appear to behave as if no cpuset\-specified memory spreading is in effect, +even if it is. If cpuset memory spreading is subsequently turned off, the +NUMA memory policy most recently specified by these calls is automatically +reapplied. +.PP +Both \fImemory_spread_page\fP and \fImemory_spread_slab\fP are Boolean flag +files. By default they contain "0", meaning that the feature is off for +that cpuset. If a "1" is written to that file, that turns the named feature +on. +.PP +Cpuset\-specified memory spreading behaves similarly to what is known (in +other contexts) as round\-robin or interleave memory placement. +.PP +Cpuset\-specified memory spreading can provide substantial performance +improvements for jobs that: +.IP a) 3 +need to place thread\-local data on memory nodes close to the CPUs which are +running the threads that most frequently access that data; but also +.IP b) +need to access large file\-system data sets that must to be spread across the +several nodes in the job's cpuset in order to fit. +.PP +.\" ================== Memory Migration ================== +Without this policy, the memory allocation across the nodes in the job's +cpuset can become very uneven, especially for jobs that might have just a +single thread initializing or reading in the data set. +.SS "Memory Migration" +Normally, under the default setting (disabled) of \fImemory_migrate\fP, once a +page is allocated (given a physical page of main memory) then that page +stays on whatever node it was allocated, so long as it remains allocated, +even if the cpuset's memory\-placement policy \fImems\fP subsequently changes. +.PP +When memory migration is enabled in a cpuset, if the \fImems\fP setting of the +cpuset is changed, then any memory page in use by any process in the cpuset +that is on a memory node that is no longer allowed will be migrated to a +memory node that is allowed. +.PP +Furthermore, if a process is moved into a cpuset with \fImemory_migrate\fP +enabled, any memory pages it uses that were on memory nodes allowed in its +previous cpuset, but which are not allowed in its new cpuset, will be +migrated to a memory node allowed in the new cpuset. +.PP +.\" ================== Scheduler Load Balancing ================== +The relative placement of a migrated page within the cpuset is preserved +during these migration operations if possible. For example, if the page was +on the second valid node of the prior cpuset, then the page will be placed +on the second valid node of the new cpuset, if possible. +.SS "Scheduler Load Balancing" +The kernel scheduler automatically load balances processes. If one CPU is +underutilized, the kernel will look for processes on other more overloaded +CPUs and move those processes to the underutilized CPU, within the +constraints of such placement mechanisms as cpusets and +\fBsched_setaffinity\fP(2). +.PP +The algorithmic cost of load balancing and its impact on key shared kernel +data structures such as the process list increases more than linearly with +the number of CPUs being balanced. For example, it costs more to load +balance across one large set of CPUs than it does to balance across two +smaller sets of CPUs, each of half the size of the larger set. (The precise +relationship between the number of CPUs being balanced and the cost of load +balancing depends on implementation details of the kernel process scheduler, +which is subject to change over time, as improved kernel scheduler +algorithms are implemented.) +.PP +The per\-cpuset flag \fIsched_load_balance\fP provides a mechanism to suppress +this automatic scheduler load balancing in cases where it is not needed and +suppressing it would have worthwhile performance benefits. +.PP +By default, load balancing is done across all CPUs, except those marked +isolated using the kernel boot time "isolcpus=" argument. (See \fBScheduler +Relax Domain Level\fP, below, to change this default.) +.PP +This default load balancing across all CPUs is not well suited to the +following two situations: +.IP * 3 +On large systems, load balancing across many CPUs is expensive. If the +system is managed using cpusets to place independent jobs on separate sets +of CPUs, full load balancing is unnecessary. +.IP * +Systems supporting real\-time on some CPUs need to minimize system overhead +on those CPUs, including avoiding process load balancing if that is not +needed. +.PP +When the per\-cpuset flag \fIsched_load_balance\fP is enabled (the default +setting), it requests load balancing across all the CPUs in that cpuset's +allowed CPUs, ensuring that load balancing can move a process (not otherwise +pinned, as by \fBsched_setaffinity\fP(2)) from any CPU in that cpuset to any +other. +.PP +When the per\-cpuset flag \fIsched_load_balance\fP is disabled, then the +scheduler will avoid load balancing across the CPUs in that cpuset, +\fIexcept\fP in so far as is necessary because some overlapping cpuset has +\fIsched_load_balance\fP enabled. +.PP +So, for example, if the top cpuset has the flag \fIsched_load_balance\fP +enabled, then the scheduler will load balance across all CPUs, and the +setting of the \fIsched_load_balance\fP flag in other cpusets has no effect, as +we're already fully load balancing. +.PP +Therefore in the above two situations, the flag \fIsched_load_balance\fP should +be disabled in the top cpuset, and only some of the smaller, child cpusets +would have this flag enabled. +.PP +When doing this, you don't usually want to leave any unpinned processes in +the top cpuset that might use nontrivial amounts of CPU, as such processes +may be artificially constrained to some subset of CPUs, depending on the +particulars of this flag setting in descendant cpusets. Even if such a +process could use spare CPU cycles in some other CPUs, the kernel scheduler +might not consider the possibility of load balancing that process to the +underused CPU. +.PP +.\" ================== Scheduler Relax Domain Level ================== +Of course, processes pinned to a particular CPU can be left in a cpuset that +disables \fIsched_load_balance\fP as those processes aren't going anywhere else +anyway. +.SS "Scheduler Relax Domain Level" +The kernel scheduler performs immediate load balancing whenever a CPU +becomes free or another task becomes runnable. This load balancing works to +ensure that as many CPUs as possible are usefully employed running tasks. +The kernel also performs periodic load balancing off the software clock +described in \fItime\fP(7). The setting of \fIsched_relax_domain_level\fP only +applies to immediate load balancing. Regardless of the +\fIsched_relax_domain_level\fP setting, periodic load balancing is attempted +over all CPUs (unless disabled by turning off \fIsched_load_balance\fP.) In +any case, of course, tasks will only be scheduled to run on CPUs allowed by +their cpuset, as modified by \fBsched_setaffinity\fP(2) system calls. +.PP +On small systems, such as those with just a few CPUs, immediate load +balancing is useful to improve system interactivity and to minimize wasteful +idle CPU cycles. But on large systems, attempting immediate load balancing +across a large number of CPUs can be more costly than it is worth, depending +on the particular performance characteristics of the job mix and the +hardware. +.PP +The exact meaning of the small integer values of \fIsched_relax_domain_level\fP +will depend on internal implementation details of the kernel scheduler code +and on the non\-uniform architecture of the hardware. Both of these will +evolve over time and vary by system architecture and kernel version. +.PP +As of this writing, when this capability was introduced in Linux 2.6.26, on +certain popular architectures, the positive values of +\fIsched_relax_domain_level\fP have the following meanings. +.sp +.PD 0 +.IP \fB(1)\fP 4 +Perform immediate load balancing across Hyper\-Thread siblings on the same +core. +.IP \fB(2)\fP +Perform immediate load balancing across other cores in the same package. +.IP \fB(3)\fP +Perform immediate load balancing across other CPUs on the same node or +blade. +.IP \fB(4)\fP +Perform immediate load balancing across over several (implementation detail) +nodes [On NUMA systems]. +.IP \fB(5)\fP +Perform immediate load balancing across over all CPUs in system [On NUMA +systems]. +.PD +.PP +The \fIsched_relax_domain_level\fP value of zero (0) always means don't perform +immediate load balancing, hence that load balancing is only done +periodically, not immediately when a CPU becomes available or another task +becomes runnable. +.PP +The \fIsched_relax_domain_level\fP value of minus one (\-1) always means use +the system default value. The system default value can vary by architecture +and kernel version. This system default value can be changed by kernel +boot\-time "relax_domain_level=" argument. +.PP +In the case of multiple overlapping cpusets which have conflicting +\fIsched_relax_domain_level\fP values, then the highest such value applies to +all CPUs in any of the overlapping cpusets. In such cases, the value +\fBminus one (\-1)\fP is the lowest value, overridden by any other value, and +the value \fBzero (0)\fP is the next lowest value. +.SH FORMATS +.\" ================== Mask Format ================== +The following formats are used to represent sets of CPUs and memory nodes. +.SS "Mask Format" +The \fBMask Format\fP is used to represent CPU and memory\-node bitmasks in the +\fI/proc//status\fP file. +.PP +This format displays each 32\-bit word in hexadecimal (using ASCII characters +"0" \- "9" and "a" \- "f"); words are filled with leading zeros, if required. +For masks longer than one word, a comma separator is used between words. +Words are displayed in big\-endian order, which has the most significant bit +first. The hex digits within a word are also in big\-endian order. +.PP +The number of 32\-bit words displayed is the minimum number needed to display +all bits of the bitmask, based on the size of the bitmask. +.PP +Examples of the \fBMask Format\fP: +.PP +.RS +.nf +00000001 # just bit 0 set +40000000,00000000,00000000 # just bit 94 set +00000001,00000000,00000000 # just bit 64 set +000000ff,00000000 # bits 32\-39 set +00000000,000E3862 # 1,5,6,11\-13,17\-19 set +.fi +.RE +.PP +A mask with bits 0, 1, 2, 4, 8, 16, 32, and 64 set displays as: +.PP +.RS +.nf +00000001,00000001,00010117 +.fi +.RE +.PP +.\" ================== List Format ================== +The first "1" is for bit 64, the second for bit 32, the third for bit 16, +the fourth for bit 8, the fifth for bit 4, and the "7" is for bits 2, 1, and +0. +.SS "List Format" +The \fBList Format\fP for \fIcpus\fP and \fImems\fP is a comma\-separated list of CPU +or memory\-node numbers and ranges of numbers, in ASCII decimal. +.PP +Examples of the \fBList Format\fP: +.PP +.RS +.nf +0\-4,9 # bits 0, 1, 2, 3, 4, and 9 set +0\-2,7,12\-14 # bits 0, 1, 2, 7, 12, 13, and 14 set +.fi +.RE +.\" ================== RULES ================== +.SH RULES +The following rules apply to each cpuset: +.IP * 3 +Its CPUs and memory nodes must be a (possibly equal) subset of its +parent's. +.IP * +It can only be marked \fIcpu_exclusive\fP if its parent is. +.IP * +It can only be marked \fImem_exclusive\fP if its parent is. +.IP * +If it is \fIcpu_exclusive\fP, its CPUs may not overlap any sibling. +.IP * +.\" ================== PERMISSIONS ================== +If it is \fImemory_exclusive\fP, its memory nodes may not overlap any sibling. +.SH PERMISSIONS +The permissions of a cpuset are determined by the permissions of the +directories and pseudo\-files in the cpuset file system, normally mounted at +\fI/dev/cpuset\fP. +.PP +For instance, a process can put itself in some other cpuset (than its +current one) if it can write the \fItasks\fP file for that cpuset. This +requires execute permission on the encompassing directories and write +permission on the \fItasks\fP file. +.PP +An additional constraint is applied to requests to place some other process +in a cpuset. One process may not attach another to a cpuset unless it would +have permission to send that process a signal (see \fBkill\fP(2)). +.PP +A process may create a child cpuset if it can access and write the parent +cpuset directory. It can modify the CPUs or memory nodes in a cpuset if it +can access that cpuset's directory (execute permissions on the each of the +parent directories) and write the corresponding \fIcpus\fP or \fImems\fP file. +.PP +There is one minor difference between the manner in which these permissions +are evaluated and the manner in which normal file\-system operation +permissions are evaluated. The kernel interprets relative pathnames +starting at a process's current working directory. Even if one is operating +on a cpuset file, relative pathnames are interpreted relative to the +process's current working directory, not relative to the process's current +cpuset. The only ways that cpuset paths relative to a process's current +cpuset can be used are if either the process's current working directory is +its cpuset (it first did a \fBcd\fP or \fBchdir\fP(2) to its cpuset directory +beneath \fI/dev/cpuset\fP, which is a bit unusual) or if some user code +converts the relative cpuset path to a full file\-system path. +.PP +.\" ================== WARNINGS ================== +In theory, this means that user code should specify cpusets using absolute +pathnames, which requires knowing the mount point of the cpuset file system +(usually, but not necessarily, \fI/dev/cpuset\fP). In practice, all user level +code that this author is aware of simply assumes that if the cpuset file +system is mounted, then it is mounted at \fI/dev/cpuset\fP. Furthermore, it is +common practice for carefully written user code to verify the presence of +the pseudo\-file \fI/dev/cpuset/tasks\fP in order to verify that the cpuset +pseudo\-file system is currently mounted. +.SH WARNINGS +.SS "Enabling memory_pressure" +By default, the per\-cpuset file \fImemory_pressure\fP always contains zero +(0). Unless this feature is enabled by writing "1" to the pseudo\-file +\fI/dev/cpuset/memory_pressure_enabled\fP, the kernel does not compute +per\-cpuset \fImemory_pressure\fP. +.SS "Using the echo command" +.\" Gack! csh(1)'s echo does this +When using the \fBecho\fP command at the shell prompt to change the values of +cpuset files, beware that the built\-in \fBecho\fP command in some shells does +not display an error message if the \fBwrite\fP(2) system call fails. For +example, if the command: +.in +4n +.nf + +echo 19 > mems + +.fi +.in +failed because memory node 19 was not allowed (perhaps the current system +does not have a memory node 19), then the \fBecho\fP command might not display +any error. It is better to use the \fB/bin/echo\fP external command to change +cpuset file settings, as this command will display \fBwrite\fP(2) errors, as +in the example: +.in +4n +.nf + +/bin/echo 19 > mems +/bin/echo: write error: Invalid argument +.fi +.in +.\" ================== EXCEPTIONS ================== +.SH EXCEPTIONS +.SS "Memory placement" +Not all allocations of system memory are constrained by cpusets, for the +following reasons. +.PP +If hot\-plug functionality is used to remove all the CPUs that are currently +assigned to a cpuset, then the kernel will automatically update the +\fIcpus_allowed\fP of all processes attached to CPUs in that cpuset to allow +all CPUs. When memory hot\-plug functionality for removing memory nodes is +available, a similar exception is expected to apply there as well. In +general, the kernel prefers to violate cpuset placement, rather than +starving a process that has had all its allowed CPUs or memory nodes taken +offline. User code should reconfigure cpusets to only refer to online CPUs +and memory nodes when using hot\-plug to add or remove such resources. +.PP +A few kernel\-critical, internal memory\-allocation requests, marked +GFP_ATOMIC, must be satisfied immediately. The kernel may drop some request +or malfunction if one of these allocations fail. If such a request cannot +be satisfied within the current process's cpuset, then we relax the cpuset, +and look for memory anywhere we can find it. It's better to violate the +cpuset than stress the kernel. +.PP +Allocations of memory requested by kernel drivers while processing an +interrupt lack any relevant process context, and are not confined by +cpusets. +.SS "Renaming cpusets" +.\" ================== ERRORS ================== +You can use the \fBrename\fP(2) system call to rename cpusets. Only simple +renaming is supported; that is, changing the name of a cpuset directory is +permitted, but moving a directory into a different directory is not +permitted. +.SH エラー +The Linux kernel implementation of cpusets sets \fIerrno\fP to specify the +reason for a failed system call affecting cpusets. +.PP +The possible \fIerrno\fP settings and their meaning when set on a failed cpuset +call are as listed below. +.TP +\fBE2BIG\fP +Attempted a \fBwrite\fP(2) on a special cpuset file with a length larger than +some kernel\-determined upper limit on the length of such writes. +.TP +\fBEACCES\fP +Attempted to \fBwrite\fP(2) the process ID (PID) of a process to a cpuset +\fItasks\fP file when one lacks permission to move that process. +.TP +\fBEACCES\fP +Attempted to add, using \fBwrite\fP(2), a CPU or memory node to a cpuset, when +that CPU or memory node was not already in its parent. +.TP +\fBEACCES\fP +Attempted to set, using \fBwrite\fP(2), \fIcpu_exclusive\fP or \fImem_exclusive\fP on +a cpuset whose parent lacks the same setting. +.TP +\fBEACCES\fP +Attempted to \fBwrite\fP(2) a \fImemory_pressure\fP file. +.TP +\fBEACCES\fP +Attempted to create a file in a cpuset directory. +.TP +\fBEBUSY\fP +Attempted to remove, using \fBrmdir\fP(2), a cpuset with attached processes. +.TP +\fBEBUSY\fP +Attempted to remove, using \fBrmdir\fP(2), a cpuset with child cpusets. +.TP +\fBEBUSY\fP +Attempted to remove a CPU or memory node from a cpuset that is also in a +child of that cpuset. +.TP +\fBEEXIST\fP +Attempted to create, using \fBmkdir\fP(2), a cpuset that already exists. +.TP +\fBEEXIST\fP +Attempted to \fBrename\fP(2) a cpuset to a name that already exists. +.TP +\fBEFAULT\fP +Attempted to \fBread\fP(2) or \fBwrite\fP(2) a cpuset file using a buffer that +is outside the writing processes accessible address space. +.TP +\fBEINVAL\fP +Attempted to change a cpuset, using \fBwrite\fP(2), in a way that would violate +a \fIcpu_exclusive\fP or \fImem_exclusive\fP attribute of that cpuset or any of +its siblings. +.TP +\fBEINVAL\fP +Attempted to \fBwrite\fP(2) an empty \fIcpus\fP or \fImems\fP list to a cpuset which +has attached processes or child cpusets. +.TP +\fBEINVAL\fP +Attempted to \fBwrite\fP(2) a \fIcpus\fP or \fImems\fP list which included a range +with the second number smaller than the first number. +.TP +\fBEINVAL\fP +Attempted to \fBwrite\fP(2) a \fIcpus\fP or \fImems\fP list which included an +invalid character in the string. +.TP +\fBEINVAL\fP +Attempted to \fBwrite\fP(2) a list to a \fIcpus\fP file that did not include any +online CPUs. +.TP +\fBEINVAL\fP +Attempted to \fBwrite\fP(2) a list to a \fImems\fP file that did not include any +online memory nodes. +.TP +\fBEINVAL\fP +Attempted to \fBwrite\fP(2) a list to a \fImems\fP file that included a node that +held no memory. +.TP +\fBEIO\fP +Attempted to \fBwrite\fP(2) a string to a cpuset \fItasks\fP file that does not +begin with an ASCII decimal integer. +.TP +\fBEIO\fP +Attempted to \fBrename\fP(2) a cpuset into a different directory. +.TP +\fBENAMETOOLONG\fP +Attempted to \fBread\fP(2) a \fI/proc//cpuset\fP file for a cpuset +path that is longer than the kernel page size. +.TP +\fBENAMETOOLONG\fP +Attempted to create, using \fBmkdir\fP(2), a cpuset whose base directory name +is longer than 255 characters. +.TP +\fBENAMETOOLONG\fP +Attempted to create, using \fBmkdir\fP(2), a cpuset whose full pathname, +including the mount point (typically "/dev/cpuset/") prefix, is longer than +4095 characters. +.TP +\fBENODEV\fP +The cpuset was removed by another process at the same time as a \fBwrite\fP(2) +was attempted on one of the pseudo\-files in the cpuset directory. +.TP +\fBENOENT\fP +Attempted to create, using \fBmkdir\fP(2), a cpuset in a parent cpuset that +doesn't exist. +.TP +\fBENOENT\fP +Attempted to \fBaccess\fP(2) or \fBopen\fP(2) a nonexistent file in a cpuset +directory. +.TP +\fBENOMEM\fP +Insufficient memory is available within the kernel; can occur on a variety +of system calls affecting cpusets, but only if the system is extremely short +of memory. +.TP +\fBENOSPC\fP +Attempted to \fBwrite\fP(2) the process ID (PID) of a process to a cpuset +\fItasks\fP file when the cpuset had an empty \fIcpus\fP or empty \fImems\fP setting. +.TP +\fBENOSPC\fP +Attempted to \fBwrite\fP(2) an empty \fIcpus\fP or \fImems\fP setting to a cpuset +that has tasks attached. +.TP +\fBENOTDIR\fP +Attempted to \fBrename\fP(2) a nonexistent cpuset. +.TP +\fBEPERM\fP +Attempted to remove a file from a cpuset directory. +.TP +\fBERANGE\fP +Specified a \fIcpus\fP or \fImems\fP list to the kernel which included a number +too large for the kernel to set in its bitmasks. +.TP +\fBESRCH\fP +.\" ================== VERSIONS ================== +Attempted to \fBwrite\fP(2) the process ID (PID) of a nonexistent process to a +cpuset \fItasks\fP file. +.SH バージョン +.\" ================== NOTES ================== +Cpusets appeared in version 2.6.12 of the Linux kernel. +.SH 注意 +.\" ================== BUGS ================== +Despite its name, the \fIpid\fP parameter is actually a thread ID, and each +thread in a threaded group can be attached to a different cpuset. The value +returned from a call to \fBgettid\fP(2) can be passed in the argument \fIpid\fP. +.SH バグ +.\" ================== EXAMPLE ================== +\fImemory_pressure\fP cpuset files can be opened for writing, creation, or +truncation, but then the \fBwrite\fP(2) fails with \fIerrno\fP set to \fBEACCES\fP, +and the creation and truncation options on \fBopen\fP(2) have no effect. +.SH EXAMPLE +The following examples demonstrate querying and setting cpuset options using +shell commands. +.SS "Creating and attaching to a cpuset." +To create a new cpuset and attach the current command shell to it, the steps +are: +.sp +.PD 0 +.IP 1) 4 +mkdir /dev/cpuset (if not already done) +.IP 2) +mount \-t cpuset none /dev/cpuset (if not already done) +.IP 3) +Create the new cpuset using \fBmkdir\fP(1). +.IP 4) +Assign CPUs and memory nodes to the new cpuset. +.IP 5) +Attach the shell to the new cpuset. +.PD +.PP +For example, the following sequence of commands will set up a cpuset named +"Charlie", containing just CPUs 2 and 3, and memory node 1, and then attach +the current shell to that cpuset. +.in +4n +.nf + +$\fB mkdir /dev/cpuset\fP +$\fB mount \-t cpuset cpuset /dev/cpuset\fP +$\fB cd /dev/cpuset\fP +$\fB mkdir Charlie\fP +$\fB cd Charlie\fP +$\fB /bin/echo 2\-3 > cpus\fP +$\fB /bin/echo 1 > mems\fP +$\fB /bin/echo $$ > tasks\fP +# The current shell is now running in cpuset Charlie +# The next line should display '/Charlie' +$\fB cat /proc/self/cpuset\fP +.fi +.in +.SS "Migrating a job to different memory nodes." +To migrate a job (the set of processes attached to a cpuset) to different +CPUs and memory nodes in the system, including moving the memory pages +currently allocated to that job, perform the following steps. +.sp +.PD 0 +.IP 1) 4 +Let's say we want to move the job in cpuset \fIalpha\fP (CPUs 4\-7 and memory +nodes 2\-3) to a new cpuset \fIbeta\fP (CPUs 16\-19 and memory nodes 8\-9). +.IP 2) +First create the new cpuset \fIbeta\fP. +.IP 3) +Then allow CPUs 16\-19 and memory nodes 8\-9 in \fIbeta\fP. +.IP 4) +Then enable \fImemory_migration\fP in \fIbeta\fP. +.IP 5) +Then move each process from \fIalpha\fP to \fIbeta\fP. +.PD +.PP +The following sequence of commands accomplishes this. +.in +4n +.nf + +$\fB cd /dev/cpuset\fP +$\fB mkdir beta\fP +$\fB cd beta\fP +$\fB /bin/echo 16\-19 > cpus\fP +$\fB /bin/echo 8\-9 > mems\fP +$\fB /bin/echo 1 > memory_migrate\fP +$\fB while read i; do /bin/echo $i; done < ../alpha/tasks > tasks\fP +.fi +.in +.PP +The above should move any processes in \fIalpha\fP to \fIbeta\fP, and any memory +held by these processes on memory nodes 2\-3 to memory nodes 8\-9, +respectively. +.PP +Notice that the last step of the above sequence did not do: +.in +4n +.nf + +$\fB cp ../alpha/tasks tasks\fP +.fi +.in +.PP +The \fIwhile\fP loop, rather than the seemingly easier use of the \fBcp\fP(1) +command, was necessary because only one process PID at a time may be written +to the \fItasks\fP file. +.PP +The same effect (writing one PID at a time) as the \fIwhile\fP loop can be +accomplished more efficiently, in fewer keystrokes and in syntax that works +on any shell, but alas more obscurely, by using the \fB\-u\fP (unbuffered) +option of \fBsed\fP(1): +.in +4n + +.nf +$\fB sed \-un p < ../alpha/tasks > tasks\fP +.fi +.in +.\" ================== SEE ALSO ================== +.SH 関連項目 +\fBtaskset\fP(1), \fBget_mempolicy\fP(2), \fBgetcpu\fP(2), \fBmbind\fP(2), +\fBsched_getaffinity\fP(2), \fBsched_setaffinity\fP(2), \fBsched_setscheduler\fP(2), +\fBset_mempolicy\fP(2), \fBCPU_SET\fP(3), \fBproc\fP(5), \fBnuma\fP(7), +\fBmigratepages\fP(8), \fBnumactl\fP(8) +.PP +The kernel source file \fIDocumentation/cpusets.txt\fP. diff --git a/draft/man7/epoll.7 b/draft/man7/epoll.7 index c5c9e0be..3e3d67b8 100644 --- a/draft/man7/epoll.7 +++ b/draft/man7/epoll.7 @@ -18,402 +18,100 @@ .\" .\" Davide Libenzi .\" -.\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO -.\" all rights reserved. -.\" Translated Sat Jun 19 07:50:04 JST 2004 -.\" by Yuichi SATO -.\" Updated & Modified 2005-01-18, Yuichi SATO -.\" Updated 2006-07-14, Akihiro MOTOKI -.\" Catch up to LDP v2.34. epoll.4 is renamed to epoll.7. -.\" Updated 2007-09-07, Akihiro MOTOKI, LDP v2.64 -.\" Updated 2008-04-08, Akihiro MOTOKI, LDP v2.79 -.\" Updated 2009-02-23, Akihiro MOTOKI, LDP v3.19 +.\"******************************************************************* .\" -.TH EPOLL 7 2009-02-01 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH EPOLL 7 2012\-04\-17 Linux "Linux Programmer's Manual" .SH 名前 -.\"O epoll \- I/O event notification facility epoll \- I/O イベント通知機能 -.\"O .SH SYNOPSIS .SH 書式 -.B #include -.\"O .SH DESCRIPTION +\fB#include \fP .SH 説明 -.\"O .B epoll -.\"O is a variant of -.\"O .BR poll (2) -.\"O that can be used either as an edge-triggered or a level-triggered -.\"O interface and scales well to large numbers of watched file descriptors. -.\"O The following system calls are provided to -.\"O create and manage an -.\"O .B epoll -.\"O instance: -.B epoll -は -.BR poll (2) -の一種であり、エッジトリガインタフェースと -レベルトリガインタフェースのどちらとしても使用することができ、 -監視するファイルディスクリプタの数が多い場合にも使用できる。 -.B epoll -インスタンスの作成や管理を行うために +\fBepoll\fP API は \fBpoll\fP(2) と同様の処理を行う、つまり、複数のファイルディスク +リプタを監視し、その中のいずれかが入出力可能な状態であるかを確認する。 +\fBepoll\fP API は、エッジトリガインタフェースとレベルトリガインタフェースの +いずれとしても使用することができ、監視するファイルディスクリプタの数が多い +場合にも使用できる。 \fBepoll\fP インスタンスの作成や管理を行うために 以下のシステムコールが提供されている: .IP * 3 -.\"O An -.\"O .B epoll -.\"O instance created by -.\"O .BR epoll_create (2), -.\"O which returns a file descriptor referring to the epoll instance. -.\"O (The more recent -.\"O .BR epoll_create1 (2) -.\"O extends the functionality of -.\"O .BR epoll_create (2).) -.B epoll -インスタンスは -.BR epoll_create (2) -で作成される。 -.BR epoll_create (2) -は作成した epoll インスタンスを参照するファイルディスクリプタを返す。 -(もっと新しい -.BR epoll_create1 (2) -では、 -.BR epoll_create (2) -の機能が拡張されている)。 +\fBepoll_create\fP(2) は \fBepoll\fP インスタンスを作成し、そのインスタンスを参照する +ファイルディスクリプタを返す。(もっと新しい \fBepoll_create1\fP(2) では、 +\fBepoll_create\fP(2) の機能が拡張されている)。 .IP * -.\"O Interest in particular file descriptors is then registered via -.\"O .BR epoll_ctl (2). -特定のファイルディスクリプタに対する監視内容を -.BR epoll_ctl (2) -で登録する。 -.\"O The set of file descriptors currently registered on an -.\"O .B epoll -.\"O instance is sometimes called an -.\"O .I epoll -.\"O set. -.B epoll -インスタンスに現在登録されているファイルディスクリプタの集合は -.I epoll -集合と呼ばれることもある。 +特定のファイルディスクリプタに対する監視内容を \fBepoll_ctl\fP(2) で登録する。 \fBepoll\fP +インスタンスに現在登録されているファイルディスクリプタの集合は \fIepoll\fP 集合と呼ばれることもある。 .IP * -.\"O Finally, the actual wait is started by -.\"O .BR epoll_wait (2). -最後に -.BR epoll_wait (2) -で実際のイベント待ちを開始する。 -.\"O .SS Level-Triggered and Edge-Triggered +\fBepoll_wait\fP(2) は I/O イベントを待つ。 +現在利用可能な状態のイベントがなければ、呼び出したスレッドを停止する。 .SS レベルトリガとエッジトリガ -.\"O The -.\"O .B epoll -.\"O event distribution interface is able to behave both as edge-triggered -.\"O (ET) and as level-triggered (LT). -.\"O The difference between the two mechanisms -.\"O can be described as follows. -.\"O Suppose that -.\"O this scenario happens: -.B epoll -イベント配送 (distribution) インタフェースは、 -エッジトリガ (ET) としてもレベルトリガ (LT) としても動作させることができる。 -二つの配送機構の違いは、次のように説明できる。 -このようなシナリオが起こったとしよう: +\fBepoll\fP イベント配送 (distribution) インタフェースは、 エッジトリガ (ET) としてもレベルトリガ (LT) +としても動作させることができる。 二つの配送機構の違いは、次のように説明できる。 このようなシナリオが起こったとしよう: .IP 1. 3 -.\"O The file descriptor that represents the read side of a pipe -.\"O .RI ( rfd ) -.\"O is registered on the -.\"O .B epoll -.\"O instance. -パイプの読み込み側を表すファイルディスクリプタ -.RI ( rfd ) -が -.B epoll -インスタンスに登録される。 +パイプの読み込み側を表すファイルディスクリプタ (\fIrfd\fP) が \fBepoll\fP インスタンスに登録される。 .IP 2. -.\"O A pipe writer writes 2 kB of data on the write side of the pipe. パイプへ書き込むプログラムが 2 kB のデータをパイプの書き込み側へ書き込む。 .IP 3. -.\"O A call to -.\"O .BR epoll_wait (2) -.\"O is done that will return -.\"O .I rfd -.\"O as a ready file descriptor. -.BR epoll_wait (2) -を呼び出すと、読み込み可能 (ready) なファイルディスクリプタとして -.I rfd -が返る。 +\fBepoll_wait\fP(2) を呼び出すと、読み込み可能 (ready) なファイルディスクリプタとして \fIrfd\fP が返る。 .IP 4. -.\"O The pipe reader reads 1 kB of data from -.\"O .IR rfd . -パイプから読み出すプログラムが、1 kB のデータを -.I rfd -から読み出す。 +パイプから読み出すプログラムが、1 kB のデータを \fIrfd\fP から読み出す。 .IP 5. -.\"O A call to -.\"O .BR epoll_wait (2) -.\"O is done. -.BR epoll_wait (2) -の呼び出しが行われる。 +\fBepoll_wait\fP(2) の呼び出しが行われる。 .PP -.\"O If the -.\"O .I rfd -.\"O file descriptor has been added to the -.\"O .B epoll -.\"O interface using the -.\"O .B EPOLLET -.\"O (edge-triggered) -.\"O flag, the call to -.\"O .BR epoll_wait (2) -.\"O done in step -.\"O .B 5 -.\"O will probably hang despite the available data still present in the file -.\"O input buffer; -.\"O meanwhile the remote peer might be expecting a response based on the -.\"O data it already sent. -.\"O The reason for this is that edge-triggered mode only -.\"O delivers events when changes occur on the monitored file descriptor. -.I rfd -ファイルディスクリプタが -.B EPOLLET -フラグ (エッジトリガ) を使って -.B epoll -に追加されていると、 -利用可能なデータがファイル入力バッファにまだ存在するにもかかわらず -ステップ -.B 5 -の -.BR epoll_wait (2) -の呼び出しでハングする可能性がある。 -その一方で、リモートの接続先 (peer) は既に送られたデータに -基づいて応答を期待しているかもしれない。 -このようなことが起こる理由は、エッジトリガイベント配送では、 -モニタしているファイルでイベントが起ったときにのみイベントが -配送されるためである。 -.\"O So, in step -.\"O .B 5 -.\"O the caller might end up waiting for some data that is already present inside -.\"O the input buffer. -したがって、ステップ -.B 5 -では、呼び出し側は結果的に -入力バッファ内にすで存在するデータを待つことになるかもしれない。 -.\"O In the above example, an event on -.\"O .I rfd -.\"O will be generated because of the write done in -.\"O .B 2 -.\"O and the event is consumed in -.\"O .BR 3 . -上記の例では、 -.B 2 -で行われた書き込みによって -.I rfd -に関するイベントが生成され、 -.B 3 -でイベントが消費 (consume) される。 -.\"O Since the read operation done in -.\"O .B 4 -.\"O does not consume the whole buffer data, the call to -.\"O .BR epoll_wait (2) -.\"O done in step -.\"O .B 5 -.\"O might block indefinitely. -.B 4 -で行われる読み込み操作では、全部のバッファデータを消費しないので、 -ステップ -.B 5 -で行われる -.BR epoll_wait (2) -の呼び出しが +\fIrfd\fP ファイルディスクリプタが \fBEPOLLET\fP フラグ (エッジトリガ) を使って \fBepoll\fP に追加されていると、 +利用可能なデータがファイル入力バッファにまだ存在するにもかかわらず ステップ \fB5\fP の \fBepoll_wait\fP(2) +の呼び出しでハングする可能性がある。 その一方で、リモートの接続先 (peer) は既に送られたデータに 基づいて応答を期待しているかもしれない。 +このようなことが起こる理由は、エッジトリガイベント配送では、 モニタしているファイルでイベントが起ったときにのみイベントが 配送されるためである。 +したがって、ステップ \fB5\fP では、呼び出し側は結果的に 入力バッファ内にすで存在するデータを待つことになるかもしれない。 上記の例では、 \fB2\fP +で行われた書き込みによって \fIrfd\fP に関するイベントが生成され、 \fB3\fP でイベントが消費 (consume) される。 \fB4\fP +で行われる読み込み操作では、全部のバッファデータを消費しないので、 ステップ \fB5\fP で行われる \fBepoll_wait\fP(2) の呼び出しが 無期限に停止 (block) するかもしれない。 -.\"O An application that employs the -.\"O .B EPOLLET -.\"O flag should use nonblocking file descriptors to avoid having a blocking -.\"O read or write starve a task that is handling multiple file descriptors. -.B EPOLLET -フラグを採用するアプリケーションでは、 -インタフェースはブロックしない (nonblocking) ファイルディスクリプタを -使うべきである。 -これは、ブロックされる読み込みや書き込みによって、 -複数のファイルディスクリプタを扱うタスクが -停止してしまうのを避けるためである。 -.\"O The suggested way to use -.\"O .B epoll -.\"O as an edge-triggered -.\"O .RB ( EPOLLET ) -.\"O interface is as follows: -.B epoll -をエッジトリガ -.RB ( EPOLLET ) -インタフェースとして使うために提案される方法は以下の通りである。 +\fBEPOLLET\fP フラグを採用するアプリケーションでは、 インタフェースはブロックしない (nonblocking) ファイルディスクリプタを +使うべきである。 これは、ブロックされる読み込みや書き込みによって、 複数のファイルディスクリプタを扱うタスクが 停止してしまうのを避けるためである。 +\fBepoll\fP をエッジトリガ (\fBEPOLLET\fP) インタフェースとして使うために提案される方法は以下の通りである。 .RS -.TP 4 -.B i -.\"O with nonblocking file descriptors; and +.TP 4 +\fBi\fP ブロックしないファイルディスクリプタと共に使う。 -.TP -.B ii -.\"O by waiting for an event only after -.\"O .BR read (2) -.\"O or -.\"O .BR write (2) -.\"O return -.\"O .BR EAGAIN . -.BR read (2) -または -.BR write (2) -が -.B EAGAIN -を返した後でのみ、イベントを待つ。 +.TP +\fBii\fP +\fBread\fP(2) または \fBwrite\fP(2) が \fBEAGAIN\fP を返した後でのみ、イベントを待つ。 .RE .PP -.\"O By contrast, when used as a level-triggered interface -.\"O (the default, when -.\"O .B EPOLLET -.\"O is not specified), -.\"O .B epoll -.\"O is simply a faster -.\"O .BR poll (2), -.\"O and can be used wherever the latter is used since it shares the -.\"O same semantics. 一方、レベルトリガインタフェースとして使う場合 (こちらがデフォルトである、 -.B EPOLLET -が指定されなかった場合)、 -.B epoll -は単に高速な -.BR poll (2) -であり、使い方が同じなので、 -.BR poll (2) -が使われているところではどこでも使用することができる。 +\fBEPOLLET\fP が指定されなかった場合)、 +\fBepoll\fP は単に高速な \fBpoll\fP(2) であり、使い方が同じなので、 +\fBpoll\fP(2) が使われているところではどこでも使用することができる。 -.\"O Since even with edge-triggered -.\"O .BR epoll , -.\"O multiple events can be generated upon receipt of multiple chunks of data, -.\"O the caller has the option to specify the -.\"O .B EPOLLONESHOT -.\"O flag, to tell -.\"O .B epoll -.\"O to disable the associated file descriptor after the receipt of an event with -.\"O .BR epoll_wait (2). -エッジトリガを使った場合でも、複数のデータを受信すると複数の -.B epoll -イベントが生成されるので、 -呼び出し側には -.B EPOLLONESHOT -フラグを指定するオプションがある。 -このフラグは -.B epoll -に対して、 -.BR epoll_wait (2) -によるイベントを受信した後で、関連するファイルディスクリプタを無効にさせる。 -.\"O When the -.\"O .B EPOLLONESHOT -.\"O flag is specified, -.\"O it is the caller's responsibility to rearm the file descriptor using -.\"O .BR epoll_ctl (2) -.\"O with -.\"O .BR EPOLL_CTL_MOD . -.B EPOLLONESHOT -フラグが指定された場合、 -.BR epoll_ctl (2) -に -.B EPOLL_CTL_MOD -を指定してファイルディスクリプタを再度使用できるようにするのは、 +エッジトリガを使った場合でも、複数のデータを受信すると複数の \fBepoll\fP イベントが生成されるので、 呼び出し側には +\fBEPOLLONESHOT\fP フラグを指定するオプションがある。 このフラグは \fBepoll\fP に対して、 \fBepoll_wait\fP(2) +によるイベントを受信した後で、関連するファイルディスクリプタを無効にさせる。 \fBEPOLLONESHOT\fP フラグが指定された場合、 +\fBepoll_ctl\fP(2) に \fBEPOLL_CTL_MOD\fP を指定してファイルディスクリプタを再度使用できるようにするのは、 呼び出し側の責任である。 -.\"O .SS /proc interfaces -.SS /proc インタフェース -.\"O The following interfaces can be used to limit the amount of -.\"O kernel memory consumed by epoll: -epoll が消費するカーネルメモリの量を制限するために、 -以下のインタフェースを使用することができる。 -.TP +.SS "/proc インタフェース" .\" Following was added in 2.6.28, but them removed in 2.6.29 .\" .TP .\" .IR /proc/sys/fs/epoll/max_user_instances " (since Linux 2.6.28)" .\" This specifies an upper limit on the number of epoll instances .\" that can be created per real user ID. -.TP -.\"O .IR /proc/sys/fs/epoll/max_user_watches " (since Linux 2.6.28)" -.IR /proc/sys/fs/epoll/max_user_watches " (Linux 2.6.28 以降)" -.\"O This specifies a limit on the total number of -.\"O file descriptors that a user can register across -.\"O all epoll instances on the system. -.\"O The limit is per real user ID. -.\"O Each registered file descriptor costs roughly 90 bytes on a 32-bit kernel, -.\"O and roughly 160 bytes on a 64-bit kernel. -.\"O Currently, -このファイルは、あるユーザがシステム上の全ての epoll インスタンスに -登録できるファイルディスクリプタの総数の上限を規定する。 -この上限は実ユーザ ID 単位である。 -登録されたファイルディスクリプタ 1 つが消費するメモリ量は、 -32 ビットカーネルでおよそ 90 バイト、 -64 ビットカーネルでおよそ 160 バイトである。 +epoll が消費するカーネルメモリの量を制限するために、 以下のインタフェースを使用することができる。 +.TP +\fI/proc/sys/fs/epoll/max_user_watches\fP (Linux 2.6.28 以降) .\" 2.6.29 (in 2.6.28, the default was 1/32 of lowmem) -.\"O the default value for -.\"O .I max_user_watches -.\"O is 1/25 (4%) of the available low memory, -.\"O divided by the registration cost in bytes. -.\"O motoki: low memory の訳に自信なし。 -現在のところ、 -.I max_user_watches -のデフォルト値は、利用可能なメモリ下限の 1/25 (4%) であり、 -登録で消費されるメモリ量 (バイト単位) で割った値となる。 -.\"O .SS Example for Suggested Usage +このファイルは、あるユーザがシステム上の全ての epoll インスタンスに 登録できるファイルディスクリプタの総数の上限を規定する。 この上限は実ユーザ +ID 単位である。 登録されたファイルディスクリプタ 1 つが消費するメモリ量は、 32 ビットカーネルでおよそ 90 バイト、 64 +ビットカーネルでおよそ 160 バイトである。 現在のところ、 \fImax_user_watches\fP のデフォルト値は、利用可能なメモリ下限の +1/25 (4%) であり、 登録で消費されるメモリ量 (バイト単位) で割った値となる。 .SS おすすめな使用例 -.\"O While the usage of -.\"O .B epoll -.\"O when employed as a level-triggered interface does have the same -.\"O semantics as -.\"O .BR poll (2), -.\"O the edge-triggered usage requires more clarification to avoid stalls -.\"O in the application event loop. -レベルトリガインタフェースとして使用するときの -.B epoll -の使い方は -.BR poll (2) -と同じである。 -しかしエッジトリガとして使う場合は、 -アプリケーションのイベントループでストール (stall) しないように、 -使い方をより明確にしておく必要がある。 -.\"O In this example, listener is a -.\"O nonblocking socket on which -.\"O .BR listen (2) -.\"O has been called. -.\"O The function -.\"O .I do_use_fd() -.\"O uses the new ready file descriptor until -.\"O .B EAGAIN -.\"O is returned by either -.\"O .BR read (2) -.\"O or -.\"O .BR write (2). -この例では、リスナはブロックしないソケットであり、 -.BR listen (2) -が呼ばれている。 -関数 -.I do_use_fd() -は、 -.BR read (2) -または -.BR write (2) -によって -.B EAGAIN -が返されるまでは、新しい準備済みのファイルディスクリプタを使う。 -.\"O An event-driven state machine application should, after having received -.\"O .BR EAGAIN , -.\"O record its current state so that at the next call to -.\"O .I do_use_fd() -.\"O it will continue to -.\"O .BR read (2) -.\"O or -.\"O .BR write (2) -.\"O from where it stopped before. -イベント駆動ステートマシンアプリケーションは、 -.B EAGAIN -を受信した後、カレントの状態を記録しておくべきである。 -これにより、次の -.I do_use_fd() -呼び出しのときに、以前に停止したところから -.BR read (2) -または -.BR write (2) +レベルトリガインタフェースとして使用するときの \fBepoll\fP の使い方は \fBpoll\fP(2) と同じである。 +しかしエッジトリガとして使う場合は、 アプリケーションのイベントループでストール (stall) しないように、 使い方をより明確にしておく必要がある。 +この例では、リスナはブロックしないソケットであり、 \fBlisten\fP(2) が呼ばれている。 関数 \fIdo_use_fd()\fP は、 +\fBread\fP(2) または \fBwrite\fP(2) によって \fBEAGAIN\fP が返されるまでは、新しい準備済みのファイルディスクリプタを使う。 +イベント駆動ステートマシンアプリケーションは、 \fBEAGAIN\fP を受信した後、カレントの状態を記録しておくべきである。 これにより、次の +\fIdo_use_fd()\fP 呼び出しのときに、以前に停止したところから \fBread\fP(2) または \fBwrite\fP(2) を継続することができる。 .in +4n @@ -469,89 +167,23 @@ for (;;) { .fi .in -.\"O When used as an edge-triggered interface, for performance reasons, it is -.\"O possible to add the file descriptor inside the -.\"O .B epoll -.\"O interface -.\"O .RB ( EPOLL_CTL_ADD ) -.\"O once by specifying -.\"O .RB ( EPOLLIN | EPOLLOUT ). -.\"O This allows you to avoid -.\"O continuously switching between -.\"O .B EPOLLIN -.\"O and -.\"O .B EPOLLOUT -.\"O calling -.\"O .BR epoll_ctl (2) -.\"O with -.\"O .BR EPOLL_CTL_MOD . -エッジトリガインタフェースとして使う場合、性能上の理由により、 -一度 -.RB ( EPOLLIN | EPOLLOUT ) -を指定してから -.RB ( EPOLL_CTL_ADD -で) ファイルディスクリプタを -.B epoll -インタフェースに追加することができる。 -これにより、 -.BR epoll_ctl (2) -に -.B EPOLL_CTL_MOD -を指定して呼び出すことで -.B EPOLLIN -と -.B EPOLLOUT +エッジトリガインタフェースとして使う場合、性能上の理由により、 一度 (\fBEPOLLIN\fP|\fBEPOLLOUT\fP) を指定してから +(\fBEPOLL_CTL_ADD\fP で) ファイルディスクリプタを \fBepoll\fP インタフェースに追加することができる。 これにより、 +\fBepoll_ctl\fP(2) に \fBEPOLL_CTL_MOD\fP を指定して呼び出すことで \fBEPOLLIN\fP と \fBEPOLLOUT\fP の連続的な切り替えが避けられる。 -.\"O .SS Questions and Answers .SS 質問と解答 -.TP 4 -.B Q0 -.\"O What is the key used to distinguish the file descriptors registered in an -.\"O .B epoll -.\"O set? -.B epoll -集合内の登録されたファイルディスクリプタを区別するには、 -何をキーとして使えばよいか? -.TP -.B A0 -.\"O The key is the combination of the file descriptor number and -.\"O the open file description -.\"O (also known as an "open file handle", -.\"O the kernel's internal representation of an open file). -キーはファイルディスクリプタ番号とオープンファイル記述 (open file -description) の組である (オープンファイル記述は "open file handle" とも -呼ばれ、オープンされたファイルのカーネルの内部表現である)。 -.TP -.B Q1 -.\"O What happens if you register the same file descriptor on an -.\"O .B epoll -.\"O instance twice? -1 つの -.B epoll -インスタンスに同じファイルディスクリプタを 2 回登録するとどうなるか? -.TP -.B A1 -.\"O You will probably get -.\"O .BR EEXIST . -.\"O However, it is possible to add a duplicate -.\"O .RB ( dup (2), -.\"O .BR dup2 (2), -.\"O .BR fcntl (2) -.\"O .BR F_DUPFD ) -.\"O descriptor to the same -.\"O .B epoll -.\"O instance. -たぶん -.B EEXIST -を受け取るだろう。 -しかしながら、同じ -.B epoll -インスタンスに対して複製されたディスクリプタを追加することは可能である -.RB ( dup (2), -.BR dup2 (2), -.BR fcntl (2) -.B F_DUPFD -など)。 +.TP 4 +\fBQ0\fP +\fBepoll\fP 集合内の登録されたファイルディスクリプタを区別するには、 何をキーとして使えばよいか? +.TP +\fBA0\fP +キーはファイルディスクリプタ番号とオープンファイル記述 (open file description) の組である (オープンファイル記述は "open +file handle" とも 呼ばれ、オープンされたファイルのカーネルの内部表現である)。 +.TP +\fBQ1\fP +1 つの \fBepoll\fP インスタンスに同じファイルディスクリプタを 2 回登録するとどうなるか? +.TP +\fBA1\fP .\" But a descriptor duplicated by fork(2) can't be added to the .\" set, because the [file *, fd] pair is already in the epoll set. .\" That is a somewhat ugly inconsistency. On the one hand, a child process @@ -567,383 +199,111 @@ description) の組である (オープンファイル記述は "open file handl .\" "epoll design problems with common fork/exec patterns" .\" .\" mtk, Feb 2008 -.\"O This can be a useful technique for filtering events, -.\"O if the duplicate file descriptors are registered with different -.\"O .I events -.\"O masks. -複製したファイルディスクリプタを異なる -.I events -マスクで登録すれば、イベントをフィルタリングするのに +たぶん \fBEEXIST\fP を受け取るだろう。 しかしながら、同じ \fBepoll\fP +インスタンスに対して複製されたディスクリプタを追加することは可能である (\fBdup\fP(2), \fBdup2\fP(2), \fBfcntl\fP(2) +\fBF_DUPFD\fP など)。 複製したファイルディスクリプタを異なる \fIevents\fP マスクで登録すれば、イベントをフィルタリングするのに この機能は有用な手法である。 -.TP -.B Q2 -.\"O Can two -.\"O .B epoll -.\"O instances wait for the same file descriptor? -.\"O If so, are events reported to both -.\"O .B epoll -.\"O file descriptors? -2 つの -.B epoll -インスタンスが同じファイルディスクリプタを待ち受けることは可能か? -もし可能であれば、イベントは両方の -.B epoll +.TP +\fBQ2\fP +2 つの \fBepoll\fP インスタンスが同じファイルディスクリプタを待ち受けることは可能か? もし可能であれば、イベントは両方の \fBepoll\fP ファイルディスクリプタに報告されるか? -.TP -.B A2 -.\"O Yes, and events would be reported to both. -.\"O However, careful programming may be needed to do this correctly. -イベントは両方に報告される。 -しかしながら、これを正しく扱うには注意深くプログラミングする必要が -あるかもしれない。 -.TP -.B Q3 -.\"O Is the -.\"O .B epoll -.\"O file descriptor itself poll/epoll/selectable? -.B epoll -ファイルディスクリプタ自身は poll/epoll/select が可能か? -.TP -.B A3 -.\"O Yes. -.\"O If an -.\"O .B epoll -.\"O file descriptor has events waiting then it will -.\"O indicate as being readable. -可能である。 -.B epoll -ファイルディスクリプタに処理待ちのイベントがある場合は、 -読み出し可能だと通知されることだろう。 -.TP -.B Q4 -.\"O What happens if one attempts to put an -.\"O .B epoll -.\"O file descriptor into its own file descriptor set? -.B epoll -ファイルディスクリプタを自身のファイルディスクリプタ集合に -入れようとするとどうなるか? -.TP -.B A4 -.\"O The -.\"O .BR epoll_ctl (2) -.\"O call will fail -.\"O .RB ( EINVAL ). -.\"O However, you can add an -.\"O .B epoll -.\"O file descriptor inside another -.\"O .B epoll -.\"O file descriptor set. -.BR epoll_ctl (2) -の呼び出しは -.RB ( EINVAL -で) 失敗するだろう。 -ただし -.B epoll -ファイルディスクリプタを他の -.B epoll -ファイルディスクリプタ集合の内部に追加することは可能である。 -.TP -.B Q5 -.\"O Can I send an -.\"O .B epoll -.\"O file descriptor over a UNIX domain socket to another process? -.B epoll -ファイルディスクリプタを UNIX ドメインソケットで他のプロセスに送ることは可能か? -.TP -.B A5 -.\"O Yes, but it does not make sense to do this, since the receiving process -.\"O would not have copies of the file descriptors in the -.\"O .B epoll -.\"O set. -可能だが、これをすることに意味はない。 -なぜなら、受信側のプロセスが -.B epoll -集合内のファイルディスクリプタのコピーを持っていないからである。 -.TP -.B Q6 -.\"O Will closing a file descriptor cause it to be removed from all -.\"O .B epoll -.\"O sets automatically? -ファイルディスクリプタをクローズすると、そのファイルディスクリプタは全ての -.B epoll -集合から自動的に削除されるか? -.TP -.B A6 -.\"O Yes, but be aware of the following point. -削除されるが、以下の点に注意が必要である。 -.\"O A file descriptor is a reference to an open file description (see -.\"O .BR open (2)). -ファイルディスクリプタはオープンファイル記述 -.RB ( open (2) -参照) への参照である。 -.\"O Whenever a descriptor is duplicated via -.\"O .BR dup (2), -.\"O .BR dup2 (2), -.\"O .BR fcntl (2) -.\"O .BR F_DUPFD , -.\"O or -.\"O .BR fork (2), -.\"O a new file descriptor referring to the same open file description is -.\"O created. -ディスクリプタの複製を -.BR dup (2), -.BR dup2 (2), -.BR fcntl (2) -の -.B F_DUPFD -や -.BR fork (2) -経由で行う度に、同じオープンファイル記述を参照する新規のファイル -ディスクリプタが生成される。 -.\"O An open file description continues to exist until all -.\"O file descriptors referring to it have been closed. -オープンファイル記述自体は、自身を参照する全てのファイルディスクリプタ -がクローズされるまで存在し続ける。 -.\"O A file descriptor is removed from an -.\"O .B epoll -.\"O set only after all the file descriptors referring to the underlying -.\"O open file description have been closed -.\"O (or before if the descriptor is explicitly removed using -.\"O .BR epoll_ctl (2) -.\"O .BR EPOLL_CTL_DEL ). -ファイルディスクリプタが -.B epoll -集合から削除されるのは、対応するオープンファイル記述を参照している -全てのファイルディスクリプタがクローズされた後である -.RB ( epoll_ctl (2) -.B EPOLL_CTL_DEL -を使ってそのディスクリプタを明示的に削除した場合にも削除される)。 -.\"O This means that even after a file descriptor that is part of an -.\"O .B epoll -.\"O set has been closed, -.\"O events may be reported for that file descriptor if other file -.\"O descriptors referring to the same underlying file description remain open. -このことは、 -.B epoll -集合に属しているあるファイルディスクリプタをクローズした後であっても、 -同じファイル記述を参照する他のファイルディスクリプタがオープンされている間は、 -クローズしたファイルディスクリプタ宛にイベントが報告される可能性があると +.TP +\fBA2\fP +イベントは両方に報告される。 しかしながら、これを正しく扱うには注意深くプログラミングする必要が あるかもしれない。 +.TP +\fBQ3\fP +\fBepoll\fP ファイルディスクリプタ自身は poll/epoll/select が可能か? +.TP +\fBA3\fP +可能である。 \fBepoll\fP ファイルディスクリプタに処理待ちのイベントがある場合は、 読み出し可能だと通知されることだろう。 +.TP +\fBQ4\fP +\fBepoll\fP ファイルディスクリプタを自身のファイルディスクリプタ集合に 入れようとするとどうなるか? +.TP +\fBA4\fP +\fBepoll_ctl\fP(2) の呼び出しは (\fBEINVAL\fP で) 失敗するだろう。 ただし \fBepoll\fP ファイルディスクリプタを他の +\fBepoll\fP ファイルディスクリプタ集合の内部に追加することは可能である。 +.TP +\fBQ5\fP +\fBepoll\fP ファイルディスクリプタを UNIX ドメインソケットで他のプロセスに送ることは可能か? +.TP +\fBA5\fP +可能だが、これをすることに意味はない。 なぜなら、受信側のプロセスが \fBepoll\fP 集合内のファイルディスクリプタのコピーを持っていないからである。 +.TP +\fBQ6\fP +ファイルディスクリプタをクローズすると、そのファイルディスクリプタは全ての \fBepoll\fP 集合から自動的に削除されるか? +.TP +\fBA6\fP +削除されるが、以下の点に注意が必要である。 ファイルディスクリプタはオープンファイル記述 (\fBopen\fP(2) 参照) への参照である。 +ディスクリプタの複製を \fBdup\fP(2), \fBdup2\fP(2), \fBfcntl\fP(2) の \fBF_DUPFD\fP や \fBfork\fP(2) +経由で行う度に、同じオープンファイル記述を参照する新規のファイル ディスクリプタが生成される。 +オープンファイル記述自体は、自身を参照する全てのファイルディスクリプタ がクローズされるまで存在し続ける。 ファイルディスクリプタが \fBepoll\fP +集合から削除されるのは、対応するオープンファイル記述を参照している 全てのファイルディスクリプタがクローズされた後である +(\fBepoll_ctl\fP(2) \fBEPOLL_CTL_DEL\fP を使ってそのディスクリプタを明示的に削除した場合にも削除される)。 このことは、 +\fBepoll\fP 集合に属しているあるファイルディスクリプタをクローズした後であっても、 +同じファイル記述を参照する他のファイルディスクリプタがオープンされている間は、 クローズしたファイルディスクリプタ宛にイベントが報告される可能性があると いうことを意味する。 -.TP -.B Q7 -.\"O If more than one event occurs between -.\"O .BR epoll_wait (2) -.\"O calls, are they combined or reported separately? -2 つ以上のイベントが -.BR epoll_wait (2) -コールの間に発生した場合、それらはまとめて報告されるか、 -それとも別々に報告されるか? -.TP -.B A7 -.\"O They will be combined. +.TP +\fBQ7\fP +2 つ以上のイベントが \fBepoll_wait\fP(2) コールの間に発生した場合、それらはまとめて報告されるか、 それとも別々に報告されるか? +.TP +\fBA7\fP まとめて報告されるだろう。 -.TP -.B Q8 -.\"O Does an operation on a file descriptor affect the -.\"O already collected but not yet reported events? -ファイルディスクリプタに対する操作は、 -既に集められているがまだ報告されていないイベントに影響するか? -.TP -.B A8 -.\"O You can do two operations on an existing file descriptor. -.\"O Remove would be meaningless for -.\"O this case. -.\"O Modify will reread available I/O. -既存のファイルディスクリプタに対して 2 つの操作を行うことができる。 -この場合、削除には意味がない。 -変更すると、使用可能な I/O が再び読み込まれる。 -.TP -.B Q9 -.\"O Do I need to continuously read/write a file descriptor -.\"O until -.\"O .B EAGAIN -.\"O when using the -.\"O .B EPOLLET -.\"O flag (edge-triggered behavior) ? -.B EPOLLET -フラグ (エッジトリガ動作) を使っている場合、 -.B EAGAIN -を受け取るまで、 +.TP +\fBQ8\fP +ファイルディスクリプタに対する操作は、 既に集められているがまだ報告されていないイベントに影響するか? +.TP +\fBA8\fP +既存のファイルディスクリプタに対して 2 つの操作を行うことができる。 この場合、削除には意味がない。 変更すると、使用可能な I/O +が再び読み込まれる。 +.TP +\fBQ9\fP +\fBEPOLLET\fP フラグ (エッジトリガ動作) を使っている場合、 \fBEAGAIN\fP を受け取るまで、 継続してファイルディスクリプタを読み書きする必要があるか? -.TP -.B A9 -.\"O Receiving an event from -.\"O .BR epoll_wait (2) -.\"O should suggest to you that such -.\"O file descriptor is ready for the requested I/O operation. -.BR epoll_wait (2) -からイベントを受け取ることは、 -そのファイルディスクリプタが要求された I/O 操作に対して準備済みである、 -ということをユーザに示すものである。 -.\"O You must consider it ready until the next (nonblocking) -.\"O read/write yields -.\"O .BR EAGAIN . -次の (ブロックしない) read/write で -.B EAGAIN -を受け取るまではファイルディスクリプタは準備済みであると -考えなければならない。 -.\"O When and how you will use the file descriptor is entirely up to you. -そのファイルディスクリプタをいつどのように使うかは、 +.TP +\fBA9\fP +\fBepoll_wait\fP(2) からイベントを受け取ることは、 そのファイルディスクリプタが要求された I/O 操作に対して準備済みである、 +ということをユーザに示すものである。 次の (ブロックしない) read/write で \fBEAGAIN\fP +を受け取るまではファイルディスクリプタは準備済みであると 考えなければならない。 そのファイルディスクリプタをいつどのように使うかは、 全くユーザに任されてる。 .sp -.\"O For packet/token-oriented files (e.g., datagram socket, -.\"O terminal in canonical mode), -.\"O the only way to detect the end of the read/write I/O space -.\"O is to continue to read/write until -.\"O .BR EAGAIN . -パケット指向やトークン指向のファイル (例えば、データグラムソケット、 -canonical モードの端末) では、 -読み込み用 / 書き込み用の I/O 空間の末尾を検知する唯一の方法は -.B EAGAIN -になるまで read/write を行うことである。 +パケット指向やトークン指向のファイル (例えば、データグラムソケット、 canonical モードの端末) では、 読み込み用 / 書き込み用の I/O +空間の末尾を検知する唯一の方法は \fBEAGAIN\fP になるまで read/write を行うことである。 .sp -.\"O For stream-oriented files (e.g., pipe, FIFO, stream socket), the -.\"O condition that the read/write I/O space is exhausted can also be detected by -.\"O checking the amount of data read from / written to the target file -.\"O descriptor. -ストリーム指向のファイル (例えば、パイプ、FIFO、ストリームソケット) では、 -読み込み用 / 書き込み用の I/O 空間が使い尽くされた状態は、 -対象となるファイルディスクリプタから読み込んだデータ量または -書き込んだデータ量をチェックすることでも検知できる。 -.\"O For example, if you call -.\"O .BR read (2) -.\"O by asking to read a certain amount of data and -.\"O .BR read (2) -.\"O returns a lower number of bytes, you -.\"O can be sure of having exhausted the read I/O space for the file -.\"O descriptor. -.\"O The same is true when writing using -.\"O .BR write (2). -.\"O (Avoid this latter technique if you cannot guarantee that -.\"O the monitored file descriptor always refers to a stream-oriented file.) -例えば、ある特定の量のデータを読み込むために -.BR read (2) -を呼んだときに、 -.BR read (2) -が返したバイト数がそれより少なかった場合、 -そのファイルディスクリプタの読み込み用 I/O 空間が -使い尽くされたことが分かる。 -.BR write (2) -を使って書き込みをするときも、同じことが言える -(監視しているファイルディスクリプタが常にストリーム指向のファイルを +ストリーム指向のファイル (例えば、パイプ、FIFO、ストリームソケット) では、 読み込み用 / 書き込み用の I/O 空間が使い尽くされた状態は、 +対象となるファイルディスクリプタから読み込んだデータ量または 書き込んだデータ量をチェックすることでも検知できる。 +例えば、ある特定の量のデータを読み込むために \fBread\fP(2) を呼んだときに、 \fBread\fP(2) +が返したバイト数がそれより少なかった場合、 そのファイルディスクリプタの読み込み用 I/O 空間が 使い尽くされたことが分かる。 \fBwrite\fP(2) +を使って書き込みをするときも、同じことが言える (監視しているファイルディスクリプタが常にストリーム指向のファイルを 参照していることを保証できない場合には、後者の手法の使用を避けること)。 -.\"O .SS Possible Pitfalls and Ways to Avoid Them .SS ありがちな落とし穴と回避方法 -.TP -.\"O .B o Starvation (edge-triggered) -.B o 飢餓 (starvation) (エッジトリガ) +.TP +\fBo 飢餓 (starvation) (エッジトリガ)\fP .PP -.\"O If there is a large amount of I/O space, -.\"O it is possible that by trying to drain -.\"O it the other files will not get processed causing starvation. -.\"O (This problem is not specific to -.\"O .BR epoll .) -大きな I/O 空間がある場合、 -その I/O 空間のデータを全て処理 (drain) しようとすると、 -他のファイルが処理されず、飢餓を発生させることがある -(この問題は -.B epoll -に固有のものではない)。 +大きな I/O 空間がある場合、 その I/O 空間のデータを全て処理 (drain) しようとすると、 +他のファイルが処理されず、飢餓を発生させることがある (この問題は \fBepoll\fP に固有のものではない)。 .PP -.\"O The solution is to maintain a ready list -.\"O and mark the file descriptor as ready -.\"O in its associated data structure, thereby allowing the application to -.\"O remember which files need to be processed but still round robin amongst -.\"O all the ready files. -.\"O This also supports ignoring subsequent events you -.\"O receive for file descriptors that are already ready. -この問題の解決法は、準備済み状態のリストを管理して、 -関連する data 構造体の中でファイルディスクリプタが -利用可能であるとマークすることである。 -それによって、利用可能なすべてのファイルの中で -どのファイルを処理する必要があるかを憶えることができ、 -しかも順番に処理 (round robin) することができる。 -既に利用可能であるファイルディスクリプタに対して -それ以後に受け取るイベントを無視することもできる。 -.TP -.\"O .B o If using an event cache... -.B o イベントキャッシュを使っている場合 +この問題の解決法は、準備済み状態のリストを管理して、 関連する data 構造体の中でファイルディスクリプタが 利用可能であるとマークすることである。 +それによって、利用可能なすべてのファイルの中で どのファイルを処理する必要があるかを憶えることができ、 しかも順番に処理 (round robin) +することができる。 既に利用可能であるファイルディスクリプタに対して それ以後に受け取るイベントを無視することもできる。 +.TP +\fBo イベントキャッシュを使っている場合\fP .PP -.\"O If you use an event cache or store all the file descriptors returned from -.\"O .BR epoll_wait (2), -.\"O then make sure to provide a way to mark -.\"O its closure dynamically (i.e., caused by -.\"O a previous event's processing). -.\"O Suppose you receive 100 events from -.\"O .BR epoll_wait (2), -.\"O and in event #47 a condition causes event #13 to be closed. -イベントキャッシュを使っている場合、 -または -.BR epoll_wait (2) -から返された全てのファイルディスクリプタを格納している場合、 -クローズされたことを動的にマークする -(つまり前のイベントの処理によってマークされる) 方法を提供すべきである。 -.BR epoll_wait (2) -から 100 個のイベントを受け取り、 -イベント #47 ではある条件でイベント #13 が閉じられると仮定する。 -.\"O If you remove the structure and -.\"O .BR close (2) -.\"O the file descriptor for event #13, then your -.\"O event cache might still say there are events waiting for that -.\"O file descriptor causing confusion. -イベント #13 の構造体を削除しファイルディスクリプタを -.BR close (2) -すると、イベントキャッシュはそのファイルディスクリプタを待つイベントが +イベントキャッシュを使っている場合、 または \fBepoll_wait\fP(2) から返された全てのファイルディスクリプタを格納している場合、 +クローズされたことを動的にマークする (つまり前のイベントの処理によってマークされる) 方法を提供すべきである。 \fBepoll_wait\fP(2) +から 100 個のイベントを受け取り、 イベント #47 ではある条件でイベント #13 が閉じられると仮定する。 イベント #13 +の構造体を削除しファイルディスクリプタを \fBclose\fP(2) すると、イベントキャッシュはそのファイルディスクリプタを待つイベントが 存在するといって、混乱が起きる。 .PP -.\"O One solution for this is to call, during the processing of event 47, -.\"O .BR epoll_ctl ( EPOLL_CTL_DEL ) -.\"O to delete file descriptor 13 and -.\"O .BR close (2), -.\"O then mark its associated -.\"O data structure as removed and link it to a cleanup list. -.\"O If you find another -.\"O event for file descriptor 13 in your batch processing, -.\"O you will discover the file descriptor had been -.\"O previously removed and there will be no confusion. -この問題を解決する 1 つの方法は、イベント 47 の処理をしている間に、 -ファイルディスクリプタ 13 を削除して -.BR close (2) -するために -.BR epoll_ctl ( EPOLL_CTL_DEL ) -を呼び出し、関連付けられた data 構造体を削除済みとマークして、 -クリーンアップリストにリンクすることである。 -バッチ処理の中でファイルディスクリプタ 13 についての -他のイベントを見つけた場合、 -そのファイルディスクリプタが以前に削除されたものであると分かるので、 -混乱は起きない。 -.\"O .SH VERSIONS +この問題を解決する 1 つの方法は、イベント 47 の処理をしている間に、 ファイルディスクリプタ 13 を削除して \fBclose\fP(2) +するために \fBepoll_ctl\fP(\fBEPOLL_CTL_DEL\fP) を呼び出し、関連付けられた data 構造体を削除済みとマークして、 +クリーンアップリストにリンクすることである。 バッチ処理の中でファイルディスクリプタ 13 についての 他のイベントを見つけた場合、 +そのファイルディスクリプタが以前に削除されたものであると分かるので、 混乱は起きない。 .SH バージョン -.\"O The -.\"O .B epoll -.\"O API was introduced in Linux kernel 2.5.44. -.B epoll -API は Linux カーネル 2.5.44 に導入された。 -.\"O .\" Its interface should be finalized in Linux kernel 2.5.66. -.\" インタフェースは Linux カーネル 2.5.66 で確定されるべきである。 -.\"O Support was added to glibc in version 2.3.2. -glibc でのサポートはバージョン 2.3.2 で追加された。 -.\"O .SH CONFORMING TO +.\" Its interface should be finalized in Linux kernel 2.5.66. +\fBepoll\fP API は Linux カーネル 2.5.44 に導入された。 glibc でのサポートはバージョン 2.3.2 で追加された。 .SH 準拠 -.\"O The -.\"O .B epoll -.\"O API is Linux-specific. -.\"O Some other systems provide similar -.\"O mechanisms, for example, FreeBSD has -.\"O .IR kqueue , -.\"O and Solaris has -.\"O .IR /dev/poll . -.B epoll -API は Linux 固有である。 -他のシステムでも同様の機構が提供されている場合がある。 -例えば、FreeBSD の -.I kqueue -や Solaris の -.I /dev/poll -などである。 -.\"O .SH "SEE ALSO" +\fBepoll\fP API は Linux 固有である。 他のシステムでも同様の機構が提供されている場合がある。 例えば、FreeBSD の +\fIkqueue\fP や Solaris の \fI/dev/poll\fP などである。 .SH 関連項目 -.BR epoll_create (2), -.BR epoll_create1 (2), -.BR epoll_ctl (2), -.BR epoll_wait (2) +\fBepoll_create\fP(2), \fBepoll_create1\fP(2), \fBepoll_ctl\fP(2), \fBepoll_wait\fP(2) diff --git a/draft/man7/feature_test_macros.7 b/draft/man7/feature_test_macros.7 deleted file mode 100644 index 68e15fe9..00000000 --- a/draft/man7/feature_test_macros.7 +++ /dev/null @@ -1,917 +0,0 @@ -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" This manpage is Copyright (C) 2006, Michael Kerrisk -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved. -.\" Translated 2006-07-16, Akihiro MOTOKI -.\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46 -.\" Updated 2007-09-08, Akihiro MOTOKI, LDP v2.64 -.\" Updated 2009-04-23, Akihiro MOTOKI, LDP v3.21 -.\" -.\"WORD: feature test macro 機能検査マクロ -.\"WORD: feature test macro requirements 機能検査マクロの要件 -.\" -.TH FEATURE_TEST_MACROS 7 2010-09-10 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O feature_test_macros \- feature test macros -feature_test_macros \- 機能検査マクロ -.\"O .SH SYNOPSIS -.SH 書式 -.nf -.B #include -.fi -.\"O .SH DESCRIPTION -.SH 説明 -.\"O Feature test macros allow the programmer to control the definitions that -.\"O are exposed by system header files when a program is compiled. -機能検査マクロ (feature test macro) により、プログラマは -プログラムがコンパイルされる際にシステムのヘッダファイルにより -公開される定義を制御することができる。 - -.\"O .B NOTE: -.B 注意: -.\"O In order to be effective, a feature test macro -.\"O .IR "must be defined before including any header files" . -.\"O This can be done either in the compilation command -.\"O .RI ( "cc \-DMACRO=value" ) -.\"O or by defining the macro within the source code before -.\"O including any headers. -機能検査マクロを機能させるには、機能検査マクロの定義を -「どのヘッダファイルのインクルードよりも前で」行わなければならない。 -これを実現するには、 -コンパイルコマンドで指定する方法 -.RI ( "cc \-DMACRO=value" ) -と、ソースコード内で必要なマクロの定義を -どのヘッダのインクルードよりも前で行う方法がある。 - -.\"O Some feature test macros are useful for creating portable applications, -.\"O by preventing nonstandard definitions from being exposed. -.\"O Other macros can be used to expose nonstandard definitions that -.\"O are not exposed by default. -.\"O The precise effects of each of the feature test macros described below -.\"O can be ascertained by inspecting the -.\"O .I -.\"O header file. -機能検査マクロを使うと、非標準の定義が公開されないようにでき、 -移植性のあるアプリケーションを作成するのに役立つ。 -他のマクロを使うと、デフォルトでは公開されない非標準の定義を -公開することができる。 -以下で説明する機能検査マクロのそれぞれの正確な影響を確認するには、 -ヘッダファイル -.I -を調べればよい。 - -.\"O .SS Specification of feature test macro requirements in manual pages -.SS マニュアルページでの機能検査マクロの要件の規定 -.\"O When a function requires that a feature test macro is defined, -.\"O the manual page SYNOPSIS typically includes a note of the following form -.\"O (this example from the -.\"O .BR acct (2) -.\"O manual page): -関数が機能検査マクロの定義を必要とする場合、 -マニュアルページの書式 (SYNOPSIS) の節に -以下の形式の注釈を入れる -(以下の例は -.BR acct (2) -のマニュアルページからの引用である)。 -.RS 8 -.sp -.B #include -.sp -.BI "int acct(const char *" filename ); -.sp -.nf -.in -4n -.\"O Feature Test Macro Requirements for glibc (see -.\"O .BR feature_test_macros (7)): -glibc 向けの機能検査マクロの要件 -.RB ( feature_test_macros (7) -参照): -.fi -.in -.sp -.BR acct (): -_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) -.RE -.PP -.\"O The \fB||\fP means that in order to obtain the declaration of -.\"O .BR acct (2) -.\"O from -.\"O .IR , -.\"O \fIeither\fP of the following macro -.\"O definitions must be made before including any header files: -\fB||\fP は、 -.BR acct (2) -の定義を -.I -から得るには、以下のマクロの定義のいずれかを、どのヘッダファイルの -インクルードよりも前で行わなければならないことを意味する。 -.RS -.nf - -#define _BSD_SOURCE -#define _XOPEN_SOURCE /* or any value < 500 */ -.fi -.RE -.PP -.\"O Alternatively, equivalent definitions can be included in the -.\"O compilation command: -別の方法としては、等価な定義をコンパイル用のコマンドで -指定することもできる。 -.RS -.nf - -cc \-D_BSD_SOURCE -cc \-D_XOPEN_SOURCE # Or any value < 500 -.fi -.RE -.PP -.\"O Note that, as described below, -.\"O .BR "some feature test macros are defined by default" , -.\"O so that it may not always be necessary to -.\"O explicitly specify the feature test macro(s) shown in the -.\"O SYNOPSIS. -後で述べるが、 -.B 「いくつかの機能検査マクロはデフォルトで定義される」 -点に注意すること。 -このため、「書式」に記載された機能検査マクロを常に -明示的に指定する必要があるわけではない。 - -.\"O In a few cases, manual pages use a shorthand for expressing the -.\"O feature test macro requirements (this example from -.\"O .BR readahead (2)): -あまり多くないが、マニュアルページによっては、 -機能検査マクロの要件を以下のように簡単な表現で記載する場合がある。 -(以下の例は -.BR readahead (2) -のマニュアルページからの引用である)。 -.RS -.nf - -.B #define _GNU_SOURCE -.B #include -.sp -.BI "ssize_t readahead(int " fd ", off64_t *" offset ", size_t " count ); -.fi -.RE -.PP -.\"O This format is employed in cases where only a single -.\"O feature test macro can be used to expose the function -.\"O declaration, and that macro is not defined by default. -関数定義の公開に使える機能検査マクロが一つだけで、 -デフォルトではそのマクロが定義されない場合に、 -この形式の表現を利用する。 -.\"O .SS Feature test macros understood by glibc -.SS glibc が解釈する機能検査マクロ -.\"O The following paragraphs explain how feature test macros are handled -.\"O in Linux glibc 2.\fIx\fP, \fIx\fP > 0. -以下では、Linux glibc 2.\fIx\fP (\fIx\fP > 0) において、 -機能検査マクロがどのように扱われるかを説明する。 -.\" The details in glibc 2.0 are simpler, but combining a -.\" a description of them with the details in later glibc versions -.\" would make for a complicated description. - -.\"O Linux glibc understands the following feature test macros: -Linux/glibc は以下の機能検査マクロを解釈する: -.TP -.B __STRICT_ANSI__ -.\"O ISO Standard C. -.\"O This macro is implicitly defined by -.\"O .BR gcc (1) -.\"O when invoked with, for example, the -.\"O .I -std=c99 -.\"O or -.\"O .I -ansi -.\"O flag. -ISO 標準の C。 -.BR gcc (1) -を -.I -std=c99 -や -.I -ansi -などのフラグを付けて起動した場合、 -このマクロは暗黙のうちに定義される。 -.TP -.B _POSIX_C_SOURCE -.\"O Defining this macro causes header files to expose definitions as follows: -このマクロを定義すると、ヘッダファイルで -以下の定義が公開される。 -.RS -.IP \(bu 3 -.\"O The value 1 exposes definitions conforming to POSIX.1-1990 and -.\"O ISO C (1990). -値が 1 の場合、POSIX.1-1990 と ISO C (1990) に準拠する定義が公開される。 -.IP \(bu -.\"O The value 2 or greater additionally exposes -.\"O definitions for POSIX.2-1992. -値が 2 以上の場合、 -POSIX.2-1992 関連の定義も追加で公開される。 -.IP \(bu -.\"O The value 199309L or greater additionally exposes -.\"O definitions for POSIX.1b (real-time extensions). -値が 199309 以上の場合、 -POSIX.1b (リアルタイム拡張) 関連の定義が追加で公開される。 -.\" 199506L functionality is only available since glibc 2.1 -.IP \(bu -.\"O The value 199506L or greater additionally exposes -.\"O definitions for POSIX.1c (threads). -値が 199506 以上の場合、 -POSIX.1c (スレッド) 関連の定義が追加で公開される。 -.IP \(bu -.\"O (Since glibc 2.3.3) -.\"O The value 200112L or greater exposes definitions corresponding -.\"O to the POSIX.1-2001 base specification (excluding the XSI extension). -(glibc 2.3.3 以降) -値が 200112L 以上の場合、 -(XSI 拡張を除く) POSIX.1-2001 基本仕様に対応する定義が公開される。 -.IP \(bu -.\"O (Since glibc 2.10) -.\"O The value 200809L or greater exposes definitions corresponding -.\"O to the POSIX.1-2008 base specification (excluding the XSI extension). -(glibc 2.10 以降) -値が 200809L 以上の場合、 -(XSI 拡張を除く) POSIX.1-2008 基本仕様に対応する定義が公開される。 -.RE -.TP -.B _POSIX_SOURCE -.\"O Defining this obsolete macro with any value is equivalent to defining -.\"O .B _POSIX_C_SOURCE -.\"O with the value 1. -このマクロは廃止予定である。 -このマクロが定義されると、値に関わらず、 -.B _POSIX_C_SOURCE -を値 1 で定義するのと等価となる。 -.TP -.B _XOPEN_SOURCE -.\"O Defining this macro causes header files to expose definitions as follows: -このマクロを定義すると、ヘッダファイルで以下の定義が公開される。 -.RS -.IP \(bu 3 -.\"O Defining with any value exposes -.\"O definitions conforming to POSIX.1, POSIX.2, and XPG4. -どんな値でも、ヘッダファイルで -POSIX.1, POSIX.2, XPG4 に準拠する定義が公開される。 -.IP \(bu -.\"O The value 500 or greater additionally exposes -.\"O definitions for SUSv2 (UNIX 98). -値が 500 以上の場合、 -SUSv2 (UNIX 98) 関連の定義が追加で公開される。 -.IP \(bu -.\"O (Since glibc 2.2) The value 600 or greater additionally exposes -.\"O definitions for SUSv3 (UNIX 03; i.e., the POSIX.1-2001 base specification -.\"O plus the XSI extension) and C99 definitions. -(glibc 2.2 以降) -値が 600 以上の場合、 -SUSv3 (UNIX 03; POSIX.1-2001 基本仕様 + XSI 拡張と同じ) -関連の定義と C99 での定義が追加で公開される。 -.IP \(bu -.\"O (Since glibc 2.10) The value 700 or greater additionally exposes -.\"O definitions for SUSv4 (i.e., the POSIX.1-2008 base specification -.\"O plus the XSI extension). -(glibc 2.10 以降) -値が 700 以上の場合、 -SUSv4 (POSIX.1-2008 基本仕様 + XSI 拡張と同じ) -関連の定義が追加で公開される。 -.RE -.TP -.B _XOPEN_SOURCE_EXTENDED -.\"O If this macro is defined, and -.\"O .B _XOPEN_SOURCE -.\"O is defined, then expose definitions corresponding to the XPG4v2 -.\"O (SUSv1) UNIX extensions (UNIX 95). -.\"O This macro is also implicitly defined if -.\"O .B _XOPEN_SOURCE -.\"O is defined with a value of 500 or more. -このマクロが定義され、さらに -.B _XOPEN_SOURCE -が定義されていると、XPG4v2 (SUSv1) UNIX 拡張 (UNIX 95) -に対応する定義が公開される。 -.B _XOPEN_SOURCE -が 500 以上の値で定義された場合、このマクロは暗黙のうちに定義される。 -.TP -.B _ISOC99_SOURCE -.\"O Exposes C99 extensions to ISO C (1990). -ISO C (1990) の C99 拡張を公開する。 -.\"O This macro is recognized since glibc 2.1.3; -このマクロは glibc 2.1.3 以降で認識される。 -.\"O earlier glibc 2.1.x versions recognized an equivalent macro named -.\"O .B _ISOC9X_SOURCE -.\"O (because the C99 standard had not then been finalized). -.\"O Although the use of the latter macro is obsolete, glibc continues -.\"O to recognize it for backward compatibility. -初期のバージョン 2.1.x の glibc では、これと等価な -.B _ISOC9X_SOURCE -という名前のマクロが使われていた -(なぜなら、C99 標準はまだ確定していなかったからである)。 -.B _ISOC9X_SOURCE -マクロの使用は廃止されているが、 -glibc は過去との互換性のため今でもこのマクロを認識する。 -.TP -.B _LARGEFILE64_SOURCE -.\"O Expose definitions for the alternative API specified by the -.\"O LFS (Large File Summit) as a "transitional extension" to the -.\"O Single UNIX Specification. -.\"O (See http://opengroup.org/platform/lfs.html.) -LFS (Large File Summit) により -"暫定拡張 (transitional extension)" Single UNIX Specification -として規定された代替 API (alternative API) に関する定義を公開する -(http://opengroup.org/platform/lfs.html 参照)。 -.\"O The alternative API consists of a set of new objects -.\"O (i.e., functions and types) whose names are suffixed with "64" -.\"O (e.g., -.\"O .I off64_t -.\"O versus -.\"O .IR off_t , -.\"O .BR lseek64 () -.\"O versus -.\"O .BR lseek (), -.\"O etc.). -代替 API は新規オブジェクト (関数と型) の集合で構成され、 -その名前は "64" で終わる (例えば、 -.I off_t -に対応するのは -.IR off64_t 、 -.BR lseek () -に対応するのは -.BR lseek64 () -である)。 -.\"O New programs should not employ this interface; instead -.\"O .I _FILE_OFFSET_BITS=64 -.\"O should be employed. -新しいプログラムではこのインタフェースを利用しないこと。 -代わりに -.I _FILE_OFFSET_BITS=64 -を利用すること。 -.TP -.B _FILE_OFFSET_BITS -.\"O Defining this macro with the value 64 -.\"O automatically converts references to 32-bit functions and data types -.\"O related to file I/O and file system operations into references to -.\"O their 64-bit counterparts. -.\"O This is useful for performing I/O on large files (> 2 Gigabytes) -.\"O on 32-bit systems. -.\"O (Defining this macro permits correctly written programs to use -.\"O large files with only a recompilation being required.) -.\"O 64-bit systems naturally permit file sizes greater than 2 Gigabytes, -.\"O and on those systems this macro has no effect. -このマクロを値 64 で定義すると、ファイル I/O とファイルシステム操作に -関連する 32 ビット版の関数とデータタイプは自動的に 64 ビット版に -変換される。 -これは、32 ビットシステムで大きなファイル (> 2 ギガバイト) の I/O -を実行する際に役立つ -(このマクロを定義すると、コンパイルし直すだけで大きなファイルを -扱えるプログラムを書くことができる)。 -64 ビットシステムは、もともと 2 ギガバイトより大きなファイルを -扱えるので、64 ビットシステムではこのマクロは効果を持たない。 -.TP -.B _BSD_SOURCE -.\"O Defining this macro with any value causes header files to expose -.\"O BSD-derived definitions. -.\"O Defining this macro also causes BSD definitions to be preferred in -.\"O some situations where standards conflict, unless one or more of -.\"O .BR _SVID_SOURCE , -.\"O .BR _POSIX_SOURCE , -.\"O .BR _POSIX_C_SOURCE , -.\"O .BR _XOPEN_SOURCE , -.\"O .BR _XOPEN_SOURCE_EXTENDED , -.\"O or -.\"O .B _GNU_SOURCE -.\"O is defined, in which case BSD definitions are disfavored. -このマクロを定義すると (値に関わらず) ヘッダファイルで -BSD 由来の定義が公開される。 -また、このマクロを定義すると、相容れない標準が存在する状況において -BSD 由来の定義を優先するようになる。 -ただし、 -.BR _SVID_SOURCE , -.BR _POSIX_SOURCE , -.BR _POSIX_C_SOURCE , -.BR _XOPEN_SOURCE , -.BR _XOPEN_SOURCE_EXTENDED , -.B _GNU_SOURCE -が一つでも定義された場合には、BSD 由来の定義は優先されなくなる。 -.TP -.B _SVID_SOURCE -.\"O Defining this macro with any value causes header files to expose -.\"O System V-derived definitions. -.\"O (SVID == System V Interface Definition; see -.\"O .BR standards (7).) -このマクロを定義すると (値に関わらず) ヘッダファイルで -System V 由来の定義が公開される -(SVID == System V Interface Definition; -.BR standards (7) -参照)。 -.TP -.\"O .BR _ATFILE_SOURCE " (since glibc 2.4)" -.BR _ATFILE_SOURCE " (glibc 2.4 以降)" -.\"O Defining this macro with any value causes header files to expose -.\"O declarations of a range of functions with the suffix "at"; -.\"O see -.\"O .BR openat (2). -.\"O Since glibc 2.10, this macro is also implicitly defined if -.\"O .BR _POSIX_C_SOURCE -.\"O is defined with a value greater than or equal to 200809L. -このマクロを定義すると (値に関わらず) ヘッダファイルで -名前の末尾が "at" の各種の関数の定義が公開される。 -.BR openat (2) -参照。 -glibc 2.10 以降では、 -.B _POSIX_C_SOURCE -が 200809L 以上の値で定義された場合には、 -このマクロも暗黙のうちに定義される。 -.TP -.B _GNU_SOURCE -.\"O Defining this macro (with any value) is equivalent to defining -.\"O .BR _BSD_SOURCE , -.\"O .BR _SVID_SOURCE , -.\"O .BR _ATFILE_SOURCE , -.\"O .BR _LARGEFILE64_SOURCE , -.\"O .BR _ISOC99_SOURCE , -.\"O .BR _XOPEN_SOURCE_EXTENDED , -.\"O .BR _POSIX_SOURCE , -.\"O .B _POSIX_C_SOURCE -.\"O with the value 200809L -.\"O (200112L in glibc versions before 2.10; -.\"O 199506L in glibc versions before 2.5; -.\"O 199309L in glibc versions before 2.1) -.\"O and -.\"O .B _XOPEN_SOURCE -.\"O with the value 700 -.\"O (600 in glibc versions before 2.10; -.\"O 500 in glibc versions before 2.2). -.\"O In addition, various GNU-specific extensions are also exposed. -.\"O Where standards conflict, BSD definitions are disfavored. -このマクロを定義すると (値に関わらず) 以下のマクロを定義するのと -等価になる: -.BR _BSD_SOURCE , -.BR _SVID_SOURCE , -.BR _ATFILE_SOURCE , -.BR _LARGEFILE64_SOURCE , -.BR _ISOC99_SOURCE , -.BR _XOPEN_SOURCE_EXTENDED , -.BR _POSIX_SOURCE , -値 200809L の -.B _POSIX_C_SOURCE -(バージョン 2.10 より前の glibc では値は 200112L、 -バージョン 2.5 より前の glibc では値は 199506L、 -バージョン 2.1 より前の glibc では値は 199309L), -値 700 の -.B _XOPEN_SOURCE -(バージョン 2.10 より前の glibc では値は 600、 -バージョン 2.2 より前の glibc では値は 500)。 -さらに、各種の GNU 固有の拡張も公開される。 -指定された標準に矛盾があった場合は、 -BSD 由来の定義が優先されなくなる。 -.TP -.B _REENTRANT -.\"O Defining this macro exposes definitions of certain reentrant functions. -.\"O For multithreaded programs, use -.\"O .I "cc\ \-pthread" -.\"O instead. -このマクロを定義すると、いくつかのリエントラント (再入可能) な関数 -定義が公開される。マルチスレッド・プログラムでは、この代わりに -.I "cc\ \-pthread" -を使用すること。 -.TP -.B _THREAD_SAFE -.\"O Synonym for -.\"O .BR _REENTRANT , -.\"O provided for compatibility with some other implementations. -.B _REENTRANT -の同義語。 -他のいくつかの実装との互換性を提供するためのもの。 -.TP -.\"O .BR _FORTIFY_SOURCE " (since glibc 2.3.4)" -.BR _FORTIFY_SOURCE " (glibc 2.3.4 以降)" -.\" For more detail, see: -.\" http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html -.\" [PATCH] Object size checking to prevent (some) buffer overflows -.\" * From: Jakub Jelinek -.\" * To: gcc-patches at gcc dot gnu dot org -.\" * Date: Tue, 21 Sep 2004 04:16:40 -0400 -.\"O Defining this macro causes some lightweight checks to be performed -.\"O to detect some buffer overflow errors when employing -.\"O various string and memory manipulation functions. -.\"O Not all buffer overflows are detected, just some common cases. -このマクロを定義すると、文字列やメモリの操作を行う様々な関数を -使用する際にバッファオーバーフローを検出するための軽めのチェックが -実行されるようになる。すべてのバッファオーバーフローが検出される -わけではなく、あくまでよくある例についてだけである。 -.\"O In the current implementation checks are added for -.\"O calls to -現在の実装では、以下の関数にチェックが追加されている: -.BR memcpy (3), -.BR mempcpy (3), -.BR memmove (3), -.BR memset (3), -.BR stpcpy (3), -.BR strcpy (3), -.BR strncpy (3), -.BR strcat (3), -.BR strncat (3), -.BR sprintf (3), -.BR snprintf (3), -.BR vsprintf (3), -.BR vsnprintf (3), -.\"O and -.BR gets (3). -.\"O If -.\"O .B _FORTIFY_SOURCE -.\"O is set to 1, with compiler optimization level 1 -.\"O .RI ( "gcc\ \-O1" ) -.\"O and above, checks that shouldn't change the behavior of -.\"O conforming programs are performed. -.\"O With -.\"O .B _FORTIFY_SOURCE -.\"O set to 2 some more checking is added, but -.\"O some conforming programs might fail. -.B _FORTIFY_SOURCE -が 1 に設定された場合、コンパイラの最適化レベルが 1 -.RI ( "gcc\ \-O1" ) -かそれ以上であれば、規格に準拠するプログラムの振る舞いを -変化させないようなチェックが実行される。 -.B _FORTIFY_SOURCE -が 2 に設定された場合、さらなるチェックが追加されるが、 -規格に準拠するプログラムのいくつかが失敗する可能性がある。 -.\"O Some of the checks can be performed at compile time, -.\"O and result in compiler warnings; -.\"O other checks take place at run time, -.\"O and result in a run-time error if the check fails. -いくつかのチェックはコンパイル時に実行でき、コンパイラの警告として -表示される。他のチェックは実行時に行われ、チェックに失敗した場合 -には実行時エラーとなる。 -.\"O Use of this macro requires compiler support, available with -.\"O .BR gcc (1) -.\"O since version 4.0. -このマクロを使用するにはコンパイラの対応が必要であり、 -バージョン 4.0 以降の -.BR gcc (1) -で利用できる。 -.\"O .SS Default definitions, implicit definitions, and combining definitions -.SS デフォルトの定義、暗黙の定義、組み合わせ定義 -.PP -.\"O If no feature test macros are explicitly defined, -.\"O then the following feature test macros are defined by default: -.\"O .BR _BSD_SOURCE , -.\"O .BR _SVID_SOURCE , -.\"O .BR _POSIX_SOURCE , -.\"O and -.\"O .BR _POSIX_C_SOURCE =200809L -.\"O (200112L in glibc versions before 2.10; -.\"O 199506L in glibc versions before 2.4; -.\"O 199309L in glibc versions before 2.1). -機能検査マクロが一つも明示的に定義されなかった場合、 -デフォルトで機能検査マクロ -.BR _BSD_SOURCE , -.BR _SVID_SOURCE , -.BR _POSIX_SOURCE , -.BR _POSIX_C_SOURCE =200809L -が定義される -(バージョン 2.10 より前の glibc では値は 200112L、 -バージョン 2.4 より前の glibc では値は 199506L、 -バージョン 2.1 より前の glibc では値は 199309L)。 -.PP -.\"O If any of -.\"O .BR __STRICT_ANSI__ , -.\"O .BR _ISOC99_SOURCE , -.\"O .BR _POSIX_SOURCE , -.\"O .BR _POSIX_C_SOURCE , -.\"O .BR _XOPEN_SOURCE , -.\"O .BR _XOPEN_SOURCE_EXTENDED , -.\"O .BR _BSD_SOURCE , -.\"O or -.\"O .B _SVID_SOURCE -.\"O is explicitly defined, then -.\"O .BR _BSD_SOURCE , -.\"O and -.\"O .B _SVID_SOURCE -.\"O are not defined by default. -.BR __STRICT_ANSI__ , -.BR _ISOC99_SOURCE , -.BR _POSIX_SOURCE , -.BR _POSIX_C_SOURCE , -.BR _XOPEN_SOURCE , -.BR _XOPEN_SOURCE_EXTENDED , -.BR _BSD_SOURCE , -.B _SVID_SOURCE -のいずれかが明示的に定義された場合、 -.B _BSD_SOURCE -と -.B _SVID_SOURCE -はデフォルトでは定義されない。 - -.\"O If -.\"O .B _POSIX_SOURCE -.\"O and -.\"O .B _POSIX_C_SOURCE -.\"O are not explicitly defined, -.\"O and either -.\"O .B __STRICT_ANSI__ -.\"O is not defined or -.\"O .B _XOPEN_SOURCE -.\"O is defined with a value of 500 or more, then -.B _POSIX_SOURCE -と -.B _POSIX_C_SOURCE -が明示的に定義されない場合で、 -.B __STRICT_ANSI__ -が定義されない、もしくは -.B _XOPEN_SOURCE -が 500 以上の値で定義されたときには、 -.RS 3 -.IP * 3 -.\"O .B _POSIX_SOURCE -.\"O is defined with the value 1; and -.B _POSIX_SOURCE -が値 1 で定義され、かつ -.IP * -.\"O .B _POSIX_C_SOURCE -.\"O is defined with one of the following values: -.B _POSIX_C_SOURCE -は以下の値のいずれか一つで定義される。 -.RS 6 -.IP \(bu 3 -.\"O 2, -.\"O if -.\"O .B XOPEN_SOURCE -.\"O is defined with a value less than 500; -2 -.RB ( _XOPEN_SOURCE -が 500 未満の値で定義された場合) -.IP \(bu -.\"O 199506L, -.\"O if -.\"O .B XOPEN_SOURCE -.\"O is defined with a value greater than or equal to 500 and less than 600; -.\"O or -199506L -.RB ( _XOPEN_SOURCE -が 500 以上 600 未満の値で定義された場合) -.IP \(bu -.\"O (since glibc 2.4) 200112L, -.\"O if -.\"O .B XOPEN_SOURCE -.\"O is defined with a value greater than or equal to 600 and less than 700. -(glibc 2.4 以降) -200112L -.RB ( XOPEN_SOURCE -が 600 以上 700 未満の値で定義された場合) -.IP \(bu -.\"O (Since glibc 2.10) -.\"O 200809L, -.\"O if -.\"O .B XOPEN_SOURCE -.\"O is defined with a value greater than or equal to 700. -(glibc 2.10 以降) -200809L -.RB ( XOPEN_SOURCE -が 700 以上の値で定義された場合) -.IP \(bu -.\"O Older versions of glibc do not know about the values -.\"O 200112L and 200809L for -.\"O .BR _POSIX_C_SOURCE , -.\"O and the setting of this macro will depend on the glibc version. -古いバージョンの glibc では -.B _POSIX_C_SOURCE -の値として 200112L や 200809L は存在せず、 -.B _POSIX_C_SOURCE -の値がどうなるかは glibc のバージョンにより異なる。 -.IP \(bu -.\"O If -.\"O .B _XOPEN_SOURCE -.\"O is undefined, then the setting of -.\"O .B _POSIX_C_SOURCE -.\"O depends on the glibc version: -.\"O 199506L, in glibc versions before 2.4; -.\"O 200112L, in glibc 2.4 to 2.9; and -.\"O 200809L, since glibc 2.10. -.B _XOPEN_SOURCE -が未定義の場合、 -.B _POSIX_C_SOURCE -の値は glibc のバージョンにより異なる。 -バージョン 2.4 より前の glibc では 199506L、 -バージョン 2.4 以降 2.9 未満では 200112L、 -glibc 2.10 以降では 200809L となる。 -.RE -.RE -.PP -.\"O Multiple macros can be defined; the results are additive. -また、複数のマクロを定義することもできる。 -この場合、定義したマクロはすべて有効になる。 -.\"O .SH CONFORMING TO -.SH 準拠 -.\"O POSIX.1 specifies -.\"O .BR _POSIX_C_SOURCE , -.\"O .BR _POSIX_SOURCE , -.\"O and -.\"O .BR _XOPEN_SOURCE . -.\"O .B _XOPEN_SOURCE_EXTENDED -.\"O was specified by XPG4v2 (aka SUSv1). -POSIX.1 では -.BR _POSIX_C_SOURCE , -.BR _POSIX_SOURCE , -.B _XOPEN_SOURCE -が規定されている。 -.B _XOPEN_SOURCE_EXTENDED -は XPG4v2 (別名 SUSv1) で規定されていた。 - -.\"O .B _FILE_OFFSET_BITS -.\"O is not specified by any standard, -.\"O but is employed on some other implementations. -.B _FILE_OFFSET_BITS -はどの標準でも規定されていないが、 -他のいくつかの実装で採用されている。 - -.\"O .BR _BSD_SOURCE , -.\"O .BR _SVID_SOURCE , -.\"O .BR _ATFILE_SOURCE , -.\"O .BR _GNU_SOURCE , -.\"O .BR _FORTIFY_SOURCE , -.\"O .BR _REENTRANT , -.\"O and -.\"O .B _THREAD_SAFE -.\"O are specific to Linux (glibc). -.BR _BSD_SOURCE , -.BR _SVID_SOURCE , -.BR _ATFILE_SOURCE , -.BR _GNU_SOURCE , -.BR _FORTIFY_SOURCE , -.BR _REENTRANT , -.B _THREAD_SAFE -は Linux (glibc) 固有である。 -.\"O .SH NOTES -.SH 注意 -.\"O .I -.\"O is a Linux/glibc-specific header file. -.\"O Other systems have an analogous file, but typically with a different name. -.\"O This header file is automatically included by other header files as -.\"O required: it is not necessary to explicitly include it in order to -.\"O employ feature test macros. -.I -は Linux/glibc 固有のヘッダファイルである。 -他のシステムにも同様の目的のファイルがあるが、普通は違う名前である。 -このヘッダファイルは、他のヘッダファイルにより必要に応じて -自動的にインクルードされる。機能検査マクロを利用するために -明示的にインクルードする必要はない。 - -.\"O According to which of the above feature test macros are defined, -.\"O .I -.\"O internally defines various other macros that are checked by -.\"O other glibc header files. -.\"O These macros have names prefixed by two underscores (e.g., -.\"O .BR __USE_MISC ). -.\"O Programs should \fInever\fP define these macros directly: -.\"O instead, the appropriate feature test macro(s) from the -.\"O list above should be employed. -上記の機能検査マクロのうちどれが定義されたかにしたがって、 -.I -は、他の glibc ヘッダファイルでチェックされる各種の他のマクロを、 -内部で定義する。これらのマクロの名前はアンダースコア 2つで始まる -(例えば -.BR __USE_MISC )。 -ユーザプログラムはこれらのマクロを \fI決して\fP 直接定義すべきではない。 -代わりに、上記のリストにある適切な機能検査マクロを利用すべきである。 -.\"O .SH EXAMPLE -.SH 例 -.\"O The program below can be used to explore how the various -.\"O feature test macros are set depending on the glibc version -.\"O and what feature test macros are explicitly set. -.\"O The following shell session, on a system with glibc 2.10, -.\"O shows some examples of what we would see: -下記のプログラムを使うと、各種の機能検査マクロが glibc のバージョン -に応じてどのように設定されるかや、どの機能検査マクロが明示的に -設定されるか、を調べることができる。 -以下に示すシェル・セッションは、 -glibc 2.10 のシステムでの実行結果の例である。 -.in +4n -.nf - -$ \fBcc ftm.c\fP -$ \fB./a.out\fP -_POSIX_SOURCE defined -_POSIX_C_SOURCE defined: 200809L -_BSD_SOURCE defined -_SVID_SOURCE defined -_ATFILE_SOURCE defined -$ \fBcc -D_XOPEN_SOURCE=500 ftm.c\fP -$ \fB./a.out\fP -_POSIX_SOURCE defined -_POSIX_C_SOURCE defined: 199506L -_XOPEN_SOURCE defined: 500 -$ \fBcc -D_GNU_SOURCE ftm.c\fP -$ \fB./a.out\fP -_POSIX_SOURCE defined -_POSIX_C_SOURCE defined: 200809L -_ISOC99_SOURCE defined -_XOPEN_SOURCE defined: 700 -_XOPEN_SOURCE_EXTENDED defined -_LARGEFILE64_SOURCE defined -_BSD_SOURCE defined -_SVID_SOURCE defined -_ATFILE_SOURCE defined -_GNU_SOURCE defined -.fi -.in -.SS Program source -\& -.nf -/* ftm.c */ - -#include -#include -#include - -int -main(int argc, char *argv[]) -{ -#ifdef _POSIX_SOURCE - printf("_POSIX_SOURCE defined\\n"); -#endif - -#ifdef _POSIX_C_SOURCE - printf("_POSIX_C_SOURCE defined: %ldL\\n", (long) _POSIX_C_SOURCE); -#endif - -#ifdef _ISOC99_SOURCE - printf("_ISOC99_SOURCE defined\\n"); -#endif - -#ifdef _XOPEN_SOURCE - printf("_XOPEN_SOURCE defined: %d\\n", _XOPEN_SOURCE); -#endif - -#ifdef _XOPEN_SOURCE_EXTENDED - printf("_XOPEN_SOURCE_EXTENDED defined\\n"); -#endif - -#ifdef _LARGEFILE64_SOURCE - printf("_LARGEFILE64_SOURCE defined\\n"); -#endif - -#ifdef _FILE_OFFSET_BITS - printf("_FILE_OFFSET_BITS defined: %d\\n", _FILE_OFFSET_BITS); -#endif - -#ifdef _BSD_SOURCE - printf("_BSD_SOURCE defined\\n"); -#endif - -#ifdef _SVID_SOURCE - printf("_SVID_SOURCE defined\\n"); -#endif - -#ifdef _ATFILE_SOURCE - printf("_ATFILE_SOURCE defined\\n"); -#endif - -#ifdef _GNU_SOURCE - printf("_GNU_SOURCE defined\\n"); -#endif - -#ifdef _REENTRANT - printf("_REENTRANT defined\\n"); -#endif - -#ifdef _THREAD_SAFE - printf("_THREAD_SAFE defined\\n"); -#endif - -#ifdef _FORTIFY_SOURCE - printf("_FORTIFY_SOURCE defined\\n"); -#endif - - exit(EXIT_SUCCESS); -} -.fi -.\"O .SH SEE ALSO -.SH 関連項目 -.BR libc (7), -.BR standards (7) -.sp -.\"O The section "Feature Test Macros" under -.\"O .IR "info libc" . -.I "info libc" -の "Feature Test Macros" の節。 -.\" But beware: the info libc document is out of date (Jul 07, mtk) -.sp -.I /usr/include/features.h diff --git a/draft/man7/hostname.7 b/draft/man7/hostname.7 new file mode 100644 index 00000000..a4e7ed36 --- /dev/null +++ b/draft/man7/hostname.7 @@ -0,0 +1,82 @@ +.\" Copyright (c) 1987, 1990, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)hostname.7 8.2 (Berkeley) 12/30/93 +.\" $FreeBSD: src/share/man/man7/hostname.7,v 1.7 2004/07/03 18:29:23 ru Exp $ +.\" +.\" 2008-06-11, mtk, Taken from FreeBSD 6.2 and modified for Linux. +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH HOSTNAME 7 2010\-11\-07 Linux "Linux Programmer's Manual" +.SH 名前 +hostname \- hostname resolution description +.SH 説明 +Hostnames are domains, where a domain is a hierarchical, dot\-separated list +of subdomains; for example, the machine monet, in the Berkeley subdomain of +the EDU domain would be represented as "monet.Berkeley.EDU". + +Hostnames are often used with network client and server programs, which must +generally translate the name to an address for use. (This task is generally +performed by either \fBgetaddrinfo\fP(3) or the obsolete \fBgethostbyname\fP(3).) +Hostnames are resolved by the Internet name resolver in the following +fashion. + +If the name consists of a single component, that is, contains no dot, and if +the environment variable \fBHOSTALIASES\fP is set to the name of a file, that +file is searched for any string matching the input hostname. The file +should consist of lines made up of two white\-space separated strings, the +first of which is the hostname alias, and the second of which is the +complete hostname to be substituted for that alias. If a case\-insensitive +match is found between the hostname to be resolved and the first field of a +line in the file, the substituted name is looked up with no further +processing. + +If the input name ends with a trailing dot, the trailing dot is removed, and +the remaining name is looked up with no further processing. + +If the input name does not end with a trailing dot, it is looked up by +searching through a list of domains until a match is found. The default +search list includes first the local domain, then its parent domains with at +least 2 name components (longest first). For example, in the domain +CS.Berkeley.EDU, the name lithium.CChem will be checked first as +lithium.CChem.CS.Berkeley.EDU and then as lithium.CChem.Berkeley.EDU. +Lithium.CChem.EDU will not be tried, as there is only one component +remaining from the local domain. The search path can be changed from the +default by a system\-wide configuration file (see \fBresolver\fP(5)). +.SH 関連項目 +\fBgethostbyname\fP(3), \fBresolver\fP(5), \fBmailaddr\fP(7), \fBnamed\fP(8) +.\" .SH HISTORY +.\" Hostname appeared in +.\" 4.2BSD. diff --git a/draft/man7/inotify.7 b/draft/man7/inotify.7 deleted file mode 100644 index 7acc719b..00000000 --- a/draft/man7/inotify.7 +++ /dev/null @@ -1,698 +0,0 @@ -'\" t -.\" Hey Emacs! This file is -*- nroff -*- source. -.\" -.\" Copyright (C) 2006 Michael Kerrisk -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" Japanese Version Copyright (c) 2006 Yuichi SATO -.\" and Copyright (c) 2007-2008 Akihiro MOTOKI -.\" Translated 2006-07-05 by Yuichi SATO , LDP v2.29 -.\" Updated 2006-07-20 by Yuichi SATO, LDP v2.36 -.\" Updated 2007-06-13, Akihiro MOTOKI , LDP v2.55 -.\" Updated 2008-08-10, Akihiro MOTOKI, LDP v3.05 -.\" Updated 2008-09-19, Akihiro MOTOKI, LDP v3.08 -.\" -.TH INOTIFY 7 2008-11-18 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O inotify \- monitoring file system events -inotify \- ファイルシステムイベントを監視する -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The -.\"O .I inotify -.\"O API provides a mechanism for monitoring file system events. -.I inotify -API はファイルシステムイベントを監視するための機構を提供する。 -.\"O Inotify can be used to monitor individual files, -.\"O or to monitor directories. -inotify は個々のファイルやディレクトリを監視するのに使える。 -.\"O When a directory is monitored, inotify will return events -.\"O for the directory itself, and for files inside the directory. -ディレクトリを監視する場合、inotify はディレクトリ自身と -ディレクトリ内のファイルのイベントを返す。 - -.\"O The following system calls are used with this API: -.\"O .BR inotify_init (2) -.\"O (or -.\"O .BR inotify_init1 (2)), -.\"O .BR inotify_add_watch (2), -.\"O .BR inotify_rm_watch (2), -.\"O .BR read (2), -.\"O and -.\"O .BR close (2). -以下のシステムコールがこの API と共に使用される: -.BR inotify_init (2) -(や -.BR inotify_init1 (2)), -.BR inotify_add_watch (2), -.BR inotify_rm_watch (2), -.BR read (2), -.BR close (2). - -.\"O .BR inotify_init (2) -.\"O creates an inotify instance and returns a file descriptor -.\"O referring to the inotify instance. -.\"O The more recent -.\"O .BR inotify_init1 (2) -.\"O is like -.\"O .BR inotify_init (2), -.\"O but provides some extra functionality. -.BR inotify_init (2) -は inotify インスタンスを作成し、inotify インスタンスを参照する -ファイルディスクリプタを返す。 -もっと新しい -.BR inotify_init1 (2) -も -.BR inotify_init (2) -と同様だが、いくつかの追加の機能が提供されている。 - -.\"O .BR inotify_add_watch (2) -.\"O manipulates the "watch list" associated with an inotify instance. -.BR inotify_add_watch (2) -は inotify インスタンスに関連づけられた「監視対象 (watch) リスト」を操作する。 -.\"O Each item ("watch") in the watch list specifies the pathname of -.\"O a file or directory, -.\"O along with some set of events that the kernel should monitor for the -.\"O file referred to by that pathname. -監視対象リストの各アイテム ("watch") は、 -ファイルまたはディレクトリのパス名と、 -そのパス名で参照されるファイルに対して -カーネルが監視する複数のイベントの集合を指定する。 -.\"O .BR inotify_add_watch (2) -.\"O either creates a new watch item, or modifies an existing watch. -.BR inotify_add_watch (2) -は新しい監視アイテムの作成や既存の監視対象の変更ができる。 -.\"O Each watch has a unique "watch descriptor", an integer -.\"O returned by -.\"O .BR inotify_add_watch (2) -.\"O when the watch is created. -各監視対象は一意の「監視対象ディスクリプタ」を持つ。 -これは監視対象を作成したときに -.BR inotify_add_watch (2) -から返される整数である。 - -.\"O .BR inotify_rm_watch (2) -.\"O removes an item from an inotify watch list. -.BR inotify_rm_watch (2) -は inotify の監視対象リストからアイテムを削除する。 - -.\"O When all file descriptors referring to an inotify -.\"O instance have been closed, -.\"O the underlying object and its resources are -.\"O freed for reuse by the kernel; -.\"O all associated watches are automatically freed. -inotify インスタンスを指している -全てのファイルディスクリプタがクローズされた場合、 -その下層にあるオブジェクトとそのリソースは、 -カーネルで再利用するために解放される。 -関連が切られた監視対象は自動的に解放される。 - -.\"O To determine what events have occurred, an application -.\"O .BR read (2)s -.\"O from the inotify file descriptor. -どのようなイベントが起こっていたかを知るには、 -アプリケーションで inotify ファイルディスクリプタを -.BR read (2) -すればよい。 -.\"O If no events have so far occurred, then, -.\"O assuming a blocking file descriptor, -.\"O .BR read (2) -.\"O will block until at least one event occurs -.\"O (unless interrupted by a signal, -.\"O in which case the call fails with the error -.\"O .BR EINTR ; -.\"O see -.\"O .BR signal (7)). -これまでに何もイベントが起こっていない場合、 -停止 (blocking) モードのファイルディスクリプタであれば、 -少なくとも 1 つのイベントが起こるまで -.BR read (2) -は停止する (シグナルにより割り込まれなかった場合。 -シグナルによる割り込みがあった場合、呼び出しはエラー -.BR EINTR -で失敗する。 -.BR signal (7) -参照)。 - -.\"O Each successful -.\"O .BR read (2) -.\"O returns a buffer containing one or more of the following structures: -.BR read (2) -が成功すると、以下の構造体を 1 つ以上含むバッファが返される: -.in +4n -.nf - -struct inotify_event { -.\"O int wd; /* Watch descriptor */ - int wd; /* 監視対象ディスクリプタ */ -.\" FIXME . The type of the 'wd' field should probably be "int32_t". -.\" I submitted a patch to fix this. See the LKML thread -.\" "[patch] Fix type errors in inotify interfaces", 18 Nov 2008 -.\" Glibc bug filed: http://sources.redhat.com/bugzilla/show_bug.cgi?id=7040 -.\"O uint32_t mask; /* Mask of events */ -.\"O uint32_t cookie; /* Unique cookie associating related -.\"O events (for rename(2)) */ -.\"O uint32_t len; /* Size of \(aqname\(aq field */ -.\"O char name[]; /* Optional null-terminated name */ - uint32_t mask; /* イベントのマスク */ - uint32_t cookie; /* 関連するイベント群を関連づける - 一意なクッキー (rename(2) 用) */ - uint32_t len; /* \(aqname\(aq フィールドのサイズ */ - char name[]; /* NULL で終端された任意の名前 */ -}; -.fi -.in - -.\"O .I wd -.\"O identifies the watch for which this event occurs. -.\"O It is one of the watch descriptors returned by a previous call to -.\"O .BR inotify_add_watch (2). -.I wd -はイベント発生の監視対象を指定する。 -これは、前もって行われた -.BR inotify_add_watch (2) -呼び出しで返された監視対象ディスクリプタのうちの 1 つである。 - -.\"O .I mask -.\"O contains bits that describe the event that occurred (see below). -.I mask -には発生したイベント (下記参照) を記述するためのビットが含まれる。 - -.\"O .I cookie -.\"O is a unique integer that connects related events. -.I cookie -は関連するイベントを関連づけるための一意な整数である。 -.\"O Currently this is only used for rename events, and -.\"O allows the resulting pair of -.\"O .B IN_MOVE_FROM -.\"O and -.\"O .B IN_MOVE_TO -.\"O events to be connected by the application. -現在のところ、この値は rename イベントに対してのみ使われており、 -結果のペアである -.B IN_MOVE_FROM -と -.B IN_MOVE_TO -イベントをアプリケーションで関連づけることができる。 - -.\"O The -.\"O .I name -.\"O field is only present when an event is returned -.\"O for a file inside a watched directory; -.\"O it identifies the file pathname relative to the watched directory. -.I name -フィールドは監視しているディレクトリ内のファイルに対して -イベントが返される場合のためにだけ存在する。 -監視するディレクトリからのファイルの相対パス名を表す。 -.\"O This pathname is null-terminated, -.\"O and may include further null bytes to align subsequent reads to a -.\"O suitable address boundary. -このパス名は NULL で終端され、 -その後の読み込みで適切なアドレス境界に調整するために、 -さらに NULL バイトが含まれる場合もある。 - -.\"O The -.\"O .I len -.\"O field counts all of the bytes in -.\"O .IR name , -.\"O including the null bytes; -.\"O the length of each -.\"O .I inotify_event -.\"O structure is thus -.\"O .IR "sizeof(inotify_event)+len" . -.I len -フィールドは NULL バイトを含む -.I name -の全てのバイト数を表す。 -よって、 -.I inotify_event -構造体のサイズは -.I "sizeof(inotify_event)+len" -である。 - -.\"O The behavior when the buffer given to -.\"O .BR read (2) -.\"O is too small to return information about the next event depends -.\"O on the kernel version: in kernels before 2.6.21, -.\"O .BR read (2) -.\"O returns 0; since kernel 2.6.21, -.\"O .BR read (2) -.\"O fails with the error -.\"O .BR EINVAL . -.BR read (2) -に渡されたバッファが小さすぎて次のイベントに関する情報を返せない -場合の動作はカーネルのバージョンにより異なる。 -2.6.21 より前のカーネルでは、 -.BR read (2) -は 0 を返す。 -2.6.21 以降のカーネルでは、 -.BR read (2) -はエラー -.B EINVAL -で失敗する。 -.\"O .SS inotify events -.SS inotify イベント -.\"O The -.\"O .BR inotify_add_watch (2) -.\"O .I mask -.\"O argument and the -.\"O .I mask -.\"O field of the -.\"O .I inotify_event -.\"O structure returned when -.\"O .BR read (2)ing -.\"O an inotify file descriptor are both bit masks identifying -.\"O inotify events. -.BR inotify_add_watch (2) -の -.I mask -引き数と、inotify ファイル構造体を -.BR read (2) -したときに返される -.I inotify_event -構造体の -.I mask -フィールドは、ともに inotify イベントを識別するための -ビットマスクである。 -.\"O The following bits can be specified in -.\"O .I mask -.\"O when calling -.\"O .BR inotify_add_watch (2) -.\"O and may be returned in the -.\"O .I mask -.\"O field returned by -.\"O .BR read (2): -以下のビットが -.BR inotify_add_watch (2) -を呼ぶときの -.I mask -に指定可能であり、 -.BR read (2) -で返される -.I mask -フィールドで返される: -.RS 4 -.sp -.PD 0 -.TP 18 -.B IN_ACCESS -.\"O File was accessed (read) (*). -ファイルがアクセス (read) された。(*) -.TP -.B IN_ATTRIB -.\"O Metadata changed, e.g., permissions, timestamps, extended attributes, -.\"O link count (since Linux 2.6.25), UID, GID, etc. (*). -メタデータが変更された。 -メタデータとは、例えば、許可 (permission)、タイムスタンプ、拡張属性、 -リンクカウント (Linux 2.6.25 以降)、UID、GID などである。(*) -.TP -.B IN_CLOSE_WRITE -.\"O File opened for writing was closed (*). -書き込みのためにオープンされたファイルがクローズされた。(*) -.TP -.B IN_CLOSE_NOWRITE -.\"O File not opened for writing was closed (*). -書き込み以外のためにオープンされたファイルがクローズされた。(*) -.TP -.B IN_CREATE -.\"O File/directory created in watched directory (*). -監視対象ディレクトリ内でファイルやディレクトリが作成された。(*) -.TP -.B IN_DELETE -.\"O File/directory deleted from watched directory (*). -監視対象ディレクトリ内でファイルやディレクトリが削除された。(*) -.TP -.B IN_DELETE_SELF -.\"O Watched file/directory was itself deleted. -監視対象のディレクトリまたはファイル自身が削除された。 -.TP -.B IN_MODIFY -.\"O File was modified (*). -ファイルが修正された。(*) -.TP -.B IN_MOVE_SELF -.\"O Watched file/directory was itself moved. -監視対象のディレクトリまたはファイル自身が移動された。 -.TP -.B IN_MOVED_FROM -.\"O File moved out of watched directory (*). -ファイルが監視対象ディレクトリ外へ移動された。(*) -.TP -.B IN_MOVED_TO -.\"O File moved into watched directory (*). -ファイルが監視対象ディレクトリ内へ移動された。(*) -.TP -.B IN_OPEN -.\"O File was opened (*). -ファイルがオープンされた。(*) -.PD -.RE -.PP -.\"O When monitoring a directory, -.\"O the events marked with an asterisk (*) above can occur for -.\"O files in the directory, in which case the -.\"O .I name -.\"O field in the returned -.\"O .I inotify_event -.\"O structure identifies the name of the file within the directory. -ディレクトリを監視する場合、 -上記でアスタリスク (*) を付けたイベントは、 -そのディレクトリ内のファイルに対して発生する。 -このとき -.I inotify_event -構造体で返される -.I name -フィールドは、ディレクトリ内のファイル名を表す。 -.PP -.\"O The -.\"O .B IN_ALL_EVENTS -.\"O macro is defined as a bit mask of all of the above events. -.\"O This macro can be used as the -.\"O .I mask -.\"O argument when calling -.\"O .BR inotify_add_watch (2). -.B IN_ALL_EVENTS -マクロは上記のイベント全てのマスクとして定義される。 -このマクロは -.BR inotify_add_watch (2) -を呼び出すときの -.I mask -引き数として使える。 - -.\"O Two additional convenience macros are -.\"O .BR IN_MOVE , -.\"O which equates to -.\"O IN_MOVED_FROM|IN_MOVED_TO, -.\"O and -.\"O .B IN_CLOSE -.\"O which equates to -.\"O IN_CLOSE_WRITE|IN_CLOSE_NOWRITE. -さらに 2 つの便利なマクロがある。 -.B IN_MOVE -は -IN_MOVED_FROM|IN_MOVED_TO -と等しく、 -.B IN_CLOSE -は -IN_CLOSE_WRITE|IN_CLOSE_NOWRITE -と等しい。 -.PP -.\"O The following further bits can be specified in -.\"O .I mask -.\"O when calling -.\"O .BR inotify_add_watch (2): -その他にも以下のビットを -.BR inotify_add_watch (2) -を呼ぶときの -.I mask -に指定できる: -.RS 4 -.sp -.PD 0 -.TP 18 -.B IN_DONT_FOLLOW -.\"O Don't dereference \fIpathname\fP if it is a symbolic link -.\"O (since Linux 2.6.15). -\fIpathname\fP がシンボリックリンクである場合に辿らない。 -(Linux 2.6.15 以降) -.TP -.B IN_MASK_ADD -.\"O Add (OR) events to watch mask for this pathname if -.\"O it already exists (instead of replacing mask). -\fIpathname\fP に対する監視マスクが既に存在する場合、 -(マスクの置き換えではなく) イベントを追加 (OR) する。 -.TP -.B IN_ONESHOT -.\"O Monitor \fIpathname\fP for one event, then remove from -.\"O watch list. -1 つのイベントについて \fIpathname\fP を監視し、 -イベントが発生したら監視対象リストから削除する。 -.TP -.\"O .BR IN_ONLYDIR " (since Linux 2.6.15)" -.BR IN_ONLYDIR " (Linux 2.6.15 以降)" -.\"O Only watch \fIpathname\fP if it is a directory. -\fIpathname\fP がディレクトリの場合にのみ監視する。 -.PD -.RE -.PP -.\"O The following bits may be set in the -.\"O .I mask -.\"O field returned by -.\"O .BR read (2): -以下のビットが -.BR read (2) -で返される -.I mask -フィールドに設定される: -.RS 4 -.sp -.PD 0 -.TP 18 -.B IN_IGNORED -.\"O Watch was removed explicitly (\fBinotify_rm_watch\fP(2)) -.\"O or automatically (file was deleted, or file system was unmounted). -監視対象が (\fBinotify_rm_watch\fP(2) により) 明示的に -削除された。もしくは (ファイルの削除、またはファイル -システムのアンマウントにより) 自動的に削除された。 -.TP -.B IN_ISDIR -.\"O Subject of this event is a directory. -このイベントの対象がディレクトリである。 -.TP -.B IN_Q_OVERFLOW -.\"O Event queue overflowed (\fIwd\fP is \-1 for this event). -イベントキューが溢れた (このイベントの場合、\fIwd\fP は \-1 である)。 -.TP -.B IN_UNMOUNT -.\"O File system containing watched object was unmounted. -監視対象オブジェクトを含むファイルシステムがアンマウントされた。 -.PD -.RE -.\"O .SS /proc interfaces -.SS /proc インターフェース -.\"O The following interfaces can be used to limit the amount of -.\"O kernel memory consumed by inotify: -以下のインターフェースは、inotify で消費される -カーネルメモリの総量を制限するのに使用できる: -.TP -.I /proc/sys/fs/inotify/max_queued_events -.\"O The value in this file is used when an application calls -.\"O .BR inotify_init (2) -.\"O to set an upper limit on the number of events that can be -.\"O queued to the corresponding inotify instance. -このファイルの値は、アプリケーションが -.BR inotify_init (2) -を呼び出すときに使用され、対応する inotify インスタンスについて -キューに入れられるイベントの数の上限を設定する。 -.\"O Events in excess of this limit are dropped, but an -.\"O .B IN_Q_OVERFLOW -.\"O event is always generated. -この制限を超えたイベントは破棄されるが、 -.B IN_Q_OVERFLOW -イベントが常に生成される。 -.TP -.I /proc/sys/fs/inotify/max_user_instances -.\"O This specifies an upper limit on the number of inotify instances -.\"O that can be created per real user ID. -1 つの実ユーザ ID に対して生成できる -inotify インスタンスの数の上限を指定する。 -.TP -.I /proc/sys/fs/inotify/max_user_watches -.\"O This specifies an upper limit on the number of watches -.\"O that can be created per real user ID. -作成可能な監視対象の数の実 UID 単位の上限を指定する。 -.\"O .SH "VERSIONS" -.SH バージョン -.\"O Inotify was merged into the 2.6.13 Linux kernel. -.\"O The required library interfaces were added to glibc in version 2.4. -.\"O .RB ( IN_DONT_FOLLOW , -.\"O .BR IN_MASK_ADD , -.\"O and -.\"O .B IN_ONLYDIR -.\"O were only added in version 2.5.) -inotify は 2.6.13 の Linux カーネルに組込まれた。 -これに必要なライブラリのインターフェースは、 -glibc のバージョン 2.4 に追加された -.RB ( IN_DONT_FOLLOW , -.BR IN_MASK_ADD , -.B IN_ONLYDIR -だけはバージョン 2.5 で追加された)。 -.\"O .SH "CONFORMING TO" -.SH 準拠 -.\"O The inotify API is Linux-specific. -inotify API は Linux 独自のものである。 -.\"O .SH "NOTES" -.SH 注意 -.\"O Inotify file descriptors can be monitored using -.\"O .BR select (2), -.\"O .BR poll (2), -.\"O and -.\"O .BR epoll (7). -inotify ファイルディスクリプタは -.BR select (2), -.BR poll (2), -.BR epoll (7) -を使って監視できる。 -.\"O When an event is available, the file descriptor indicates as readable. -イベントがある場合、ファイルディスクリプタは読み込み可能と通知する。 - -.\"O Since Linux 2.6.25, -.\"O signal-driven I/O notification is available for inotify file descriptors; -.\"O see the discussion of -.\"O .B F_SETFL -.\"O (for setting the -.\"O .B O_ASYNC -.\"O flag), -.\"O .BR F_SETOWN , -.\"O and -.\"O .B F_SETSIG -.\"O in -.\"O .BR fcntl (2). -Linux 2.6.25 以降では、シグナル駆動 (signal-driven) I/O の通知が -inotify ファイルディスクリプタについて利用可能である。 -.BR fcntl (2) -に書かれている -.RB ( O_ASYNC -フラグを設定するための) -.BR F_SETFL , -.BR F_SETOWN , -.B F_SETSIG -の議論を参照のこと。 -.\"O The -.\"O .I siginfo_t -.\"O structure (described in -.\"O .BR sigaction (2)) -.\"O that is passed to the signal handler has the following fields set: -.\"O .IR si_fd -.\"O is set to the inotify file descriptor number; -.\"O .IR si_signo -.\"O is set to the signal number; -.\"O .IR si_code -.\"O is set to -.\"O .BR POLL_IN ; -.\"O and -.\"O .B POLLIN -.\"O is set in -.\"O .IR si_band . -シグナルハンドラに渡される -.I siginfo_t -構造体は、以下のフィールドが設定される -.RI ( siginfo_t -は -.BR sigaction (2) -で説明されている)。 -.I si_fd -には inotify ファイルディスクリプタ番号が、 -.I si_signo -にはシグナル番号が、 -.I si_code -には -.BR POLL_IN -が、 -.I si_band -には -.B POLLIN -が設定される。 - -.\"O If successive output inotify events produced on the -.\"O inotify file descriptor are identical (same -.\"O .IR wd , -.\"O .IR mask , -.\"O .IR cookie , -.\"O and -.\"O .IR name ) -.\"O then they are coalesced into a single event if the -.\"O older event has not yet been read (but see BUGS). -inotify ファイルディスクリプタに対して -連続して生成される出力 inotify イベントが同一の場合 -.RI ( wd , -.IR mask , -.IR cookie , -.I name -が等しい場合)、 -前のイベントがまだ読み込まれていなければ、 -連続するイベントが 1 つのイベントにまとめられる -(ただし「バグ」の節も参照のこと)。 - -.\"O The events returned by reading from an inotify file descriptor -.\"O form an ordered queue. -.\"O Thus, for example, it is guaranteed that when renaming from -.\"O one directory to another, events will be produced in the -.\"O correct order on the inotify file descriptor. -.\"Osato: -.\"Osato: 以下の訳が上手くできていない気がする。 -.\"Osato: -inotify ファイルディスクリプタの読み込みで返されるイベントは、 -順序付けられたキューになる。 -従って、たとえば、あるディレクトリの名前を別の名前に変更した場合、 -inotify ファイルディスクリプタについての正しい順番で -イベントが生成されることが保証される。 - -.\"O The -.\"O .B FIONREAD -.\"O .BR ioctl (2) -.\"O returns the number of bytes available to read from an -.\"O inotify file descriptor. -.B FIONREAD -.BR ioctl (2) -は inotify ファイルディスクリプタから何バイト読み込めるかを返す。 - -.\"O Inotify monitoring of directories is not recursive: -.\"O to monitor subdirectories under a directory, -.\"O additional watches must be created. -inotify によるディレクトリの監視は再帰的に行われない: -あるディレクトリ以下のサブディレクトリを監視する場合、 -監視対象を追加で作成しなければならない。 -.\"O .SH "BUGS" -.SH バグ -.\"O In kernels before 2.6.16, the -.\"O .B IN_ONESHOT -.\"O .I mask -.\"O flag does not work. -2.6.16 以前のカーネルでは -.B IN_ONESHOT -.I mask -フラグが働かない。 - -.\"O Before kernel 2.6.25, -.\"O the kernel code that was intended to coalesce successive identical events -.\"O (i.e., the two most recent events could potentially be coalesced -.\"O if the older had not yet been read) -.\"O instead checked if the most recent event could be coalesced with the -.\"O .I oldest -.\"O unread event. -カーネル 2.6.25 より前では、 -連続する同一のイベントを一つにまとめることを意図したコード -(古い方のイベントがまだ読み込まれていない場合に、 -最新の 2 つのイベントを一つにまとめられる可能性がある) が、 -最新のイベントが「最も古い」読み込まれていないイベントとまとめられるか -をチェックするようになっていた。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR inotify_add_watch (2), -.BR inotify_init (2), -.BR inotify_init1 (2), -.BR inotify_rm_watch (2), -.BR read (2), -.BR stat (2), -.IR Documentation/filesystems/inotify.txt . diff --git a/draft/man7/intro.7 b/draft/man7/intro.7 index 3ddfa13a..36dc45c1 100644 --- a/draft/man7/intro.7 +++ b/draft/man7/intro.7 @@ -24,33 +24,19 @@ .\" .\" Modified by Thomas Koenig (ig25@rz.uni-karlsruhe.de) 24 Apr 1993 .\" Modified Sat Jul 24 17:28:08 1993 by Rik Faith (faith@cs.unc.edu) +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1999-11-27, HANATAKA Shinya -.\" Updated 2005-12-05, Akihiro MOTOKI, Catch up to LDP man-pages 2.16 +.\" This file was generated with po4a. Translate the source file. .\" -.TH INTRO 7 2007-10-23 "Linux" "Linux Programmer's Manual" +.\"******************************************************************* +.TH INTRO 7 2007\-10\-23 Linux "Linux Programmer's Manual" .SH 名前 -.\"O intro \- Introduction to overview, conventions, and miscellany section intro \- 概要、慣習やその他の説明 .SH 説明 -.\"O Section 7 of the manual provides overviews on various topics, and -.\"O describes conventions and protocols, -.\"O character set standards, the standard file system layout, -.\"O and miscellaneous other things. -マニュアルの 7 章には様々な事柄の概要が書かれている。 -習慣、プロトコル、文字集合の規格、ファイルシステムの構成、 +マニュアルの 7 章には様々な事柄の概要が書かれている。 習慣、プロトコル、文字集合の規格、ファイルシステムの構成、 その他の雑多なことについて説明している。 -.\"O .SH NOTES -.SH 備考 -.\"O .SS Authors and Copyright Conditions +.SH 注意 .SS 著者と著作権 -.\"O Look at the header of the manual page source for the author(s) and copyright -.\"O conditions. -.\"O Note that these can be different from page to page! -著者と著作権(copyright)に関しては各マニュアル・ページのソースのヘッダを見ること。 -これらはページごとに異っている。 -.\"O .SH "SEE ALSO" +著者と著作権に関しては各マニュアルページのソースのヘッダを参照すること。 これらはページごとに異なる可能性があることに注意してほしい。 .SH 関連項目 -.BR standards (7) +\fBstandards\fP(7) diff --git a/draft/man7/iso_8859-1.7 b/draft/man7/iso_8859-1.7 index 230bd346..3caf9a53 100644 --- a/draft/man7/iso_8859-1.7 +++ b/draft/man7/iso_8859-1.7 @@ -1,4 +1,4 @@ -'\" t +.\" t .\" Copyright 1993-1995 Daniel Quinlan (quinlan@yggdrasil.com) .\" .\" This is free documentation; you can redistribute it and/or @@ -23,169 +23,152 @@ .\" .\" Slightly rearranged, aeb, 950713 .\" Updated, dpo, 990531 +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Thu Jun 3 19:45:18 JST 1997 -.\" by HANATAKA Shinya -.\" Modified Tue Nov 26 JST 1999 by Kentaro Shirakata -.\" Updated Fri Oct 16 JST 2002 by Kentaro Shirakata -.\" Updated Tue Sep 9 JST 2003 by Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.TH ISO_8859-1 7 1999-05-31 "Linux" "Linux Programmer's Manual" +.\"******************************************************************* +.TH ISO_8859\-1 7 1999\-05\-31 Linux "Linux Programmer's Manual" .nh .SH 名前 -iso_8859-1 \- ISO 8859-1 文字集合の 8進数、10進数、16進数による符号化 +iso_8859\-1 \- ISO 8859\-1 文字集合の 8進数、10進数、16進数による符号化 .SH 説明 ISO 8859 規格は ASCII 文字集合 (ISO 6460IRV としても知られている) の -いくつかの 8 ビット拡張を含んでいる。特に重要なのは ISO 8859-1、 +いくつかの 8 ビット拡張を含んでいる。特に重要なのは ISO 8859\-1、 "ラテン・アルファベット No. 1" で、広く実装され、既に ASCII に代わって 事実上の標準になっているようにみえる。 .P -ISO 8859-1 は以下の言語をサポートしている: アフリカーンス語、バスク語、 +ISO 8859\-1 は以下の言語をサポートしている: アフリカーンス語、バスク語、 カタロニア語、デンマーク語、オランダ語、英語、フェロー語、フィンランド語、 フランス語、ガリシア語、ドイツ語、アイスランド語、アイルランド語、イタリア語、 -ノルウェー語、ポルトガル語、スコットランド語、スペイン語、スウェーデン語 +ノルウェー語、ポルトガル語、スコットランド語、スペイン語、スウェーデン語。 .P -ISO 8859-1 の文字は ISO 10646 (Unicode) の最初の 256 文字であることに +ISO 8859\-1 の文字は ISO 10646 (Unicode) の最初の 256 文字であることに 注意してほしい。 .SS "ISO 8859 アルファベット" 完全な ISO 8859 アルファベットは以下のものを含んでいる: .TS l l. -ISO 8859-1 西ヨーロッパの言語 (Latin-1) -ISO 8859-2 中央および東ヨーロッパの言語 (Latin-2) -ISO 8859-3 東南ヨーロッパやその他の言語 (Latin-3) -ISO 8859-4 スカンジナビア/バルト語派の言語 (Latin-4) -ISO 8859-5 ラテン/キリル文字 -ISO 8859-6 ラテン/アラビア語 -ISO 8859-7 ラテン/ギリシャ語 -ISO 8859-8 ラテン/ヘブライ語 -ISO 8859-9 トルコ語修正を行なった Latin-1 (Latin-5) -ISO 8859-10 ラップ/ノルディック/エスキモーの言語 (Latin-6) -ISO 8859-11 ラテン/タイ語 -ISO 8859-13 バルト諸国の言語 (Latin-7) -ISO 8859-14 ケルト語 (Latin-8) -ISO 8859-15 西ヨーロッパの言語 (Latin-9) -ISO 8859-16 ルーマニア語 (Latin-10) +ISO 8859\-1 西ヨーロッパの言語 (Latin\-1) +ISO 8859\-2 中央および東ヨーロッパの言語 (Latin\-2) +ISO 8859\-3 東南ヨーロッパやその他の言語 (Latin\-3) +ISO 8859\-4 スカンジナビア/バルト語派の言語 (Latin\-4) +ISO 8859\-5 ラテン/キリル文字 +ISO 8859\-6 ラテン/アラビア語 +ISO 8859\-7 ラテン/ギリシャ語 +ISO 8859\-8 ラテン/ヘブライ語 +ISO 8859\-9 トルコ語修正を行なった Latin\-1 (Latin\-5) +ISO 8859\-10 ラップ/ノルディック/エスキモーの言語 (Latin\-6) +ISO 8859\-11 ラテン/タイ語 +ISO 8859\-13 バルト諸国の言語 (Latin\-7) +ISO 8859\-14 ケルト語 (Latin\-8) +ISO 8859\-15 西ヨーロッパの言語 (Latin\-9) +ISO 8859\-16 ルーマニア語 (Latin\-10) .TE -.SS "ISO 8859-1 文字" -.\"O The following table displays the characters in ISO 8859-1 (Latin-1), -.\"O which are printable and unlisted in the -.\"O .BR ascii (7) -.\"O manual page. -.\"O The fourth column will only show the proper glyphs -.\"O in an environment configured for ISO 8859-1. -以下の表は ISO 8859-1 (Latin-1) の表示可能な文字のうち -.BR ascii (7) -マニュアル・ページに載っていないものを示している。 -4列目は ISO 8859-1 用に設定された環境でのみ正しく表示できるだろう。 - -[ 訳注 原文では Char の部分に ISO 8859-1 の文字があったが、 -日本語 EUC との併用は難しいので削除し、JIS X 0208 の同じ文字を -示すようにした。その他の文字に関しては -英語版の iso_8859-1(7) を参照。 ] +.SS "ISO 8859\-1 文字" +以下の表は ISO 8859\-1 (Latin\-1) の表示可能な文字のうち +\fBascii\fP(7) マニュアルページに載っていないものを示している。 +4列目は ISO 8859\-1 用に設定された環境でのみ正しく表示できるだろう。 .TS l l l c lp-1. Oct Dec Hex Char Description _ -240 160 A0 NO-BREAK SPACE -241 161 A1 INVERTED EXCLAMATION MARK +240 160 A0 \ NO\-BREAK SPACE +241 161 A1 ¡ INVERTED EXCLAMATION MARK 242 162 A2 ¢ CENT SIGN 243 163 A3 £ POUND SIGN -244 164 A4 CURRENCY SIGN +244 164 A4 ¤ CURRENCY SIGN 245 165 A5 Â¥ YEN SIGN -246 166 A6 BROKEN BAR +246 166 A6 ¦ BROKEN BAR 247 167 A7 § SECTION SIGN 250 168 A8 ¨ DIAERESIS -251 169 A9 COPYRIGHT SIGN -252 170 AA FEMININE ORDINAL INDICATOR -253 171 AB 《 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +251 169 A9 © COPYRIGHT SIGN +252 170 AA ª FEMININE ORDINAL INDICATOR +253 171 AB « LEFT\-POINTING DOUBLE ANGLE QUOTATION MARK 254 172 AC ¬ NOT SIGN -255 173 AD SOFT HYPHEN -256 174 AE REGISTERED SIGN -257 175 AF MACRON +255 173 AD ­ SOFT HYPHEN +256 174 AE ® REGISTERED SIGN +257 175 AF ¯ MACRON 260 176 B0 ° DEGREE SIGN -261 177 B1 ± PLUS-MINUS SIGN -262 178 B2 SUPERSCRIPT TWO -263 179 B3 SUPERSCRIPT THREE +261 177 B1 ± PLUS\-MINUS SIGN +262 178 B2 ² SUPERSCRIPT TWO +263 179 B3 ³ SUPERSCRIPT THREE 264 180 B4 ´ ACUTE ACCENT -265 181 B5 μ MICRO SIGN +265 181 B5 µ MICRO SIGN 266 182 B6 ¶ PILCROW SIGN -267 183 B7 ・ MIDDLE DOT -270 184 B8 CEDILLA -271 185 B9 SUPERSCRIPT ONE -272 186 BA MASCULINE ORDINAL INDICATOR -273 187 BB 》 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -274 188 BC VULGAR FRACTION ONE QUARTER -275 189 BD VULGAR FRACTION ONE HALF -276 190 BE VULGAR FRACTION THREE QUARTERS -277 191 BF INVERTED QUESTION MARK -300 192 C0 LATIN CAPITAL LETTER A WITH GRAVE -301 193 C1 LATIN CAPITAL LETTER A WITH ACUTE -302 194 C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX -303 195 C3 LATIN CAPITAL LETTER A WITH TILDE -304 196 C4 LATIN CAPITAL LETTER A WITH DIAERESIS -305 197 C5 LATIN CAPITAL LETTER A WITH RING ABOVE -306 198 C6 LATIN CAPITAL LETTER AE -307 199 C7 LATIN CAPITAL LETTER C WITH CEDILLA -310 200 C8 LATIN CAPITAL LETTER E WITH GRAVE -311 201 C9 LATIN CAPITAL LETTER E WITH ACUTE -312 202 CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX -313 203 CB LATIN CAPITAL LETTER E WITH DIAERESIS -314 204 CC LATIN CAPITAL LETTER I WITH GRAVE -315 205 CD LATIN CAPITAL LETTER I WITH ACUTE -316 206 CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX -317 207 CF LATIN CAPITAL LETTER I WITH DIAERESIS -320 208 D0 LATIN CAPITAL LETTER ETH -321 209 D1 LATIN CAPITAL LETTER N WITH TILDE -322 210 D2 LATIN CAPITAL LETTER O WITH GRAVE -323 211 D3 LATIN CAPITAL LETTER O WITH ACUTE -324 212 D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX -325 213 D5 LATIN CAPITAL LETTER O WITH TILDE -326 214 D6 LATIN CAPITAL LETTER O WITH DIAERESIS +267 183 B7 · MIDDLE DOT +270 184 B8 ¸ CEDILLA +271 185 B9 ¹ SUPERSCRIPT ONE +272 186 BA º MASCULINE ORDINAL INDICATOR +273 187 BB » RIGHT\-POINTING DOUBLE ANGLE QUOTATION MARK +274 188 BC ¼ VULGAR FRACTION ONE QUARTER +275 189 BD ½ VULGAR FRACTION ONE HALF +276 190 BE ¾ VULGAR FRACTION THREE QUARTERS +277 191 BF ¿ INVERTED QUESTION MARK +300 192 C0 À LATIN CAPITAL LETTER A WITH GRAVE +301 193 C1 Á LATIN CAPITAL LETTER A WITH ACUTE +302 194 C2  LATIN CAPITAL LETTER A WITH CIRCUMFLEX +303 195 C3 à LATIN CAPITAL LETTER A WITH TILDE +304 196 C4 Ä LATIN CAPITAL LETTER A WITH DIAERESIS +305 197 C5 Å LATIN CAPITAL LETTER A WITH RING ABOVE +306 198 C6 Æ LATIN CAPITAL LETTER AE +307 199 C7 Ç LATIN CAPITAL LETTER C WITH CEDILLA +310 200 C8 È LATIN CAPITAL LETTER E WITH GRAVE +311 201 C9 É LATIN CAPITAL LETTER E WITH ACUTE +312 202 CA Ê LATIN CAPITAL LETTER E WITH CIRCUMFLEX +313 203 CB Ë LATIN CAPITAL LETTER E WITH DIAERESIS +314 204 CC Ì LATIN CAPITAL LETTER I WITH GRAVE +315 205 CD Í LATIN CAPITAL LETTER I WITH ACUTE +316 206 CE Î LATIN CAPITAL LETTER I WITH CIRCUMFLEX +317 207 CF Ï LATIN CAPITAL LETTER I WITH DIAERESIS +320 208 D0 Ð LATIN CAPITAL LETTER ETH +321 209 D1 Ñ LATIN CAPITAL LETTER N WITH TILDE +322 210 D2 Ò LATIN CAPITAL LETTER O WITH GRAVE +323 211 D3 Ó LATIN CAPITAL LETTER O WITH ACUTE +324 212 D4 Ô LATIN CAPITAL LETTER O WITH CIRCUMFLEX +325 213 D5 Õ LATIN CAPITAL LETTER O WITH TILDE +326 214 D6 Ö LATIN CAPITAL LETTER O WITH DIAERESIS 327 215 D7 × MULTIPLICATION SIGN -330 216 D8 LATIN CAPITAL LETTER O WITH STROKE -331 217 D9 LATIN CAPITAL LETTER U WITH GRAVE -332 218 DA LATIN CAPITAL LETTER U WITH ACUTE -333 219 DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX -334 220 DC LATIN CAPITAL LETTER U WITH DIAERESIS -335 221 DD LATIN CAPITAL LETTER Y WITH ACUTE -336 222 DE LATIN CAPITAL LETTER THORN -337 223 DF LATIN SMALL LETTER SHARP S -340 224 E0 LATIN SMALL LETTER A WITH GRAVE -341 225 E1 LATIN SMALL LETTER A WITH ACUTE -342 226 E2 LATIN SMALL LETTER A WITH CIRCUMFLEX -343 227 E3 LATIN SMALL LETTER A WITH TILDE -344 228 E4 LATIN SMALL LETTER A WITH DIAERESIS -345 229 E5 LATIN SMALL LETTER A WITH RING ABOVE -346 230 E6 LATIN SMALL LETTER AE -347 231 E7 LATIN SMALL LETTER C WITH CEDILLA -350 232 E8 LATIN SMALL LETTER E WITH GRAVE -351 233 E9 LATIN SMALL LETTER E WITH ACUTE -352 234 EA LATIN SMALL LETTER E WITH CIRCUMFLEX -353 235 EB LATIN SMALL LETTER E WITH DIAERESIS -354 236 EC LATIN SMALL LETTER I WITH GRAVE -355 237 ED LATIN SMALL LETTER I WITH ACUTE -356 238 EE LATIN SMALL LETTER I WITH CIRCUMFLEX -357 239 EF LATIN SMALL LETTER I WITH DIAERESIS -360 240 F0 LATIN SMALL LETTER ETH -361 241 F1 LATIN SMALL LETTER N WITH TILDE -362 242 F2 LATIN SMALL LETTER O WITH GRAVE -363 243 F3 LATIN SMALL LETTER O WITH ACUTE -364 244 F4 LATIN SMALL LETTER O WITH CIRCUMFLEX -365 245 F5 LATIN SMALL LETTER O WITH TILDE -366 246 F6 LATIN SMALL LETTER O WITH DIAERESIS +330 216 D8 Ø LATIN CAPITAL LETTER O WITH STROKE +331 217 D9 Ù LATIN CAPITAL LETTER U WITH GRAVE +332 218 DA Ú LATIN CAPITAL LETTER U WITH ACUTE +333 219 DB Û LATIN CAPITAL LETTER U WITH CIRCUMFLEX +334 220 DC Ü LATIN CAPITAL LETTER U WITH DIAERESIS +335 221 DD Ý LATIN CAPITAL LETTER Y WITH ACUTE +336 222 DE Þ LATIN CAPITAL LETTER THORN +337 223 DF ß LATIN SMALL LETTER SHARP S +340 224 E0 à LATIN SMALL LETTER A WITH GRAVE +341 225 E1 á LATIN SMALL LETTER A WITH ACUTE +342 226 E2 â LATIN SMALL LETTER A WITH CIRCUMFLEX +343 227 E3 ã LATIN SMALL LETTER A WITH TILDE +344 228 E4 ä LATIN SMALL LETTER A WITH DIAERESIS +345 229 E5 Ã¥ LATIN SMALL LETTER A WITH RING ABOVE +346 230 E6 æ LATIN SMALL LETTER AE +347 231 E7 ç LATIN SMALL LETTER C WITH CEDILLA +350 232 E8 è LATIN SMALL LETTER E WITH GRAVE +351 233 E9 é LATIN SMALL LETTER E WITH ACUTE +352 234 EA ê LATIN SMALL LETTER E WITH CIRCUMFLEX +353 235 EB ë LATIN SMALL LETTER E WITH DIAERESIS +354 236 EC ì LATIN SMALL LETTER I WITH GRAVE +355 237 ED í LATIN SMALL LETTER I WITH ACUTE +356 238 EE î LATIN SMALL LETTER I WITH CIRCUMFLEX +357 239 EF ï LATIN SMALL LETTER I WITH DIAERESIS +360 240 F0 ð LATIN SMALL LETTER ETH +361 241 F1 ñ LATIN SMALL LETTER N WITH TILDE +362 242 F2 ò LATIN SMALL LETTER O WITH GRAVE +363 243 F3 ó LATIN SMALL LETTER O WITH ACUTE +364 244 F4 ô LATIN SMALL LETTER O WITH CIRCUMFLEX +365 245 F5 õ LATIN SMALL LETTER O WITH TILDE +366 246 F6 ö LATIN SMALL LETTER O WITH DIAERESIS 367 247 F7 ÷ DIVISION SIGN -370 248 F8 LATIN SMALL LETTER O WITH STROKE -371 249 F9 LATIN SMALL LETTER U WITH GRAVE -372 250 FA LATIN SMALL LETTER U WITH ACUTE -373 251 FB LATIN SMALL LETTER U WITH CIRCUMFLEX -374 252 FC LATIN SMALL LETTER U WITH DIAERESIS -375 253 FD LATIN SMALL LETTER Y WITH ACUTE -376 254 FE LATIN SMALL LETTER THORN -377 255 FF LATIN SMALL LETTER Y WITH DIAERESIS +370 248 F8 ø LATIN SMALL LETTER O WITH STROKE +371 249 F9 ù LATIN SMALL LETTER U WITH GRAVE +372 250 FA ú LATIN SMALL LETTER U WITH ACUTE +373 251 FB û LATIN SMALL LETTER U WITH CIRCUMFLEX +374 252 FC ü LATIN SMALL LETTER U WITH DIAERESIS +375 253 FD ý LATIN SMALL LETTER Y WITH ACUTE +376 254 FE þ LATIN SMALL LETTER THORN +377 255 FF ÿ LATIN SMALL LETTER Y WITH DIAERESIS .TE .SH 関連項目 -.BR ascii (7), -.BR iso_8859-15 (7) +\fBascii\fP(7), \fBiso_8859\-15\fP(7) diff --git a/draft/man7/iso_8859-10.7 b/draft/man7/iso_8859-10.7 new file mode 100644 index 00000000..85b1f2f4 --- /dev/null +++ b/draft/man7/iso_8859-10.7 @@ -0,0 +1,166 @@ +.\" t -*- coding: UTF-8 -*- +.\" Copyright 2009 Lefteris Dimitroulakis (edimitro@tee.gr) +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ISO_8859\-10 7 2010\-09\-20 Linux "Linux Programmer's Manual" +.SH 名前 +iso_8859\-10 \- ISO 8859\-10 文字集合の 8進数、10進数、16進数による符号化 +.SH 説明 +.\" (Though in my system with glibc-2.8-20080929 +.\" I found only lg_UG using this charset, and certainly UG +.\" is not a "Nordic" country!). +ISO 8859 規格は ASCII 文字集合 (ISO 6460IRV としても知られている) の +いくつかの 8 ビット拡張を含んでいる。 +ISO 8859\-10 は北欧の言語で使用される文字の符号化を規定している。 +.SS "ISO 8859 アルファベット" +完全な ISO 8859 アルファベットは以下のものを含んでいる: +.TS +l l. +ISO 8859\-1 西ヨーロッパの言語 (Latin\-1) +ISO 8859\-2 中央および東ヨーロッパの言語 (Latin\-2) +ISO 8859\-3 東南ヨーロッパやその他の言語 (Latin\-3) +ISO 8859\-4 スカンジナビア/バルト語派の言語 (Latin\-4) +ISO 8859\-5 ラテン/キリル文字 +ISO 8859\-6 ラテン/アラビア語 +ISO 8859\-7 ラテン/ギリシャ語 +ISO 8859\-8 ラテン/ヘブライ語 +ISO 8859\-9 トルコ語修正を行なった Latin\-1 (Latin\-5) +ISO 8859\-10 ラップ/ノルディック/エスキモーの言語 (Latin\-6) +ISO 8859\-11 ラテン/タイ語 +ISO 8859\-13 バルト諸国の言語 (Latin\-7) +ISO 8859\-14 ケルト語 (Latin\-8) +ISO 8859\-15 西ヨーロッパの言語 (Latin\-9) +ISO 8859\-16 ルーマニア語 (Latin\-10) +.TE +.SS "ISO 8859\-10 文字" +以下の表は ISO 8859\-10 の表示可能な文字のうち +\fBascii\fP(7) マニュアルページに載っていないものを示している。 +4列目は ISO 8859\-10 用に設定された環境でのみ正しく表示できるだろう。 +.TS +l l l c lp-1. +Oct Dec Hex Char Description +_ +240 160 A0 \ NO\-BREAK SPACE +241 161 A1 Ą LATIN CAPITAL LETTER A WITH OGONEK +242 162 A2 Ē LATIN CAPITAL LETTER E WITH MACRON +243 163 A3 Ä¢ LATIN CAPITAL LETTER G WITH CEDILLA +244 164 A4 Ī LATIN CAPITAL LETTER I WITH MACRON +245 165 A5 Ĩ LATIN CAPITAL LETTER I WITH TILDE +246 166 A6 Ķ LATIN CAPITAL LETTER K WITH CEDILLA +247 167 A7 § SECTION SIGN +250 168 A8 Ä» LATIN CAPITAL LETTER L WITH CEDILLA +251 169 A9 Đ LATIN CAPITAL LETTER D WITH STROKE +252 170 AA Å  LATIN CAPITAL LETTER S WITH CARON +253 171 AB Ŧ LATIN CAPITAL LETTER T WITH STROKE +254 172 AC Ž LATIN CAPITAL LETTER Z WITH CARON +255 173 AD ­ SOFT HYPHEN +256 174 AE Ū LATIN CAPITAL LETTER U WITH MACRON +257 175 AF Ŋ LATIN CAPITAL LETTER ENG (Sami) +260 176 B0 ° DEGREE SIGN +261 177 B1 ą LATIN SMALL LETTER A WITH OGONEK +262 178 B2 ē LATIN SMALL LETTER E WITH MACRON +263 179 B3 Ä£ LATIN SMALL LETTER G WITH CEDILLA +264 180 B4 Ä« LATIN SMALL LETTER I WITH MACRON +265 181 B5 Ä© LATIN SMALL LETTER I WITH TILDE +266 182 B6 Ä· LATIN SMALL LETTER K WITH CEDILLA +267 183 B7 · MIDDLE DOT +270 184 B8 ļ LATIN SMALL LETTER L WITH CEDILLA +271 185 B9 đ LATIN SMALL LETTER D WITH STROKE +272 186 BA Å¡ LATIN SMALL LETTER S WITH CARON +273 187 BB ŧ LATIN SMALL LETTER T WITH STROKE +274 188 BC ž LATIN SMALL LETTER Z WITH CARON +275 189 BD ― HORIZONTAL BAR +276 190 BE Å« LATIN SMALL LETTER U WITH MACRON +277 191 BF ŋ LATIN SMALL LETTER ENG (Sami) +300 192 C0 Ā LATIN CAPITAL LETTER A WITH MACRON +301 193 C1 Á LATIN CAPITAL LETTER A WITH ACUTE +302 194 C2  LATIN CAPITAL LETTER A WITH CIRCUMFLEX +303 195 C3 à LATIN CAPITAL LETTER A WITH TILDE +304 196 C4 Ä LATIN CAPITAL LETTER A WITH DIAERESIS +305 197 C5 Å LATIN CAPITAL LETTER A WITH RING ABOVE +306 198 C6 Æ LATIN CAPITAL LETTER AE +307 199 C7 Ä® LATIN CAPITAL LETTER I WITH OGONEK +310 200 C8 Č LATIN CAPITAL LETTER C WITH CARON +311 201 C9 É LATIN CAPITAL LETTER E WITH ACUTE +312 202 CA Ę LATIN CAPITAL LETTER E WITH OGONEK +312 202 CB Ë LATIN CAPITAL LETTER E WITH DIAERESIS +314 204 CC Ė LATIN CAPITAL LETTER E WITH DOT ABOVE +315 205 CD Í LATIN CAPITAL LETTER I WITH ACUTE +316 206 CE Î LATIN CAPITAL LETTER I WITH CIRCUMFLEX +317 207 CF Ï LATIN CAPITAL LETTER I WITH DIAERESIS +320 208 D0 Ð LATIN CAPITAL LETTER ETH (Icelandic) +321 209 D1 Ņ LATIN CAPITAL LETTER N WITH CEDILLA +322 210 D2 Ō LATIN CAPITAL LETTER O WITH MACRON +323 211 D3 Ó LATIN CAPITAL LETTER O WITH ACUTE +324 212 D4 Ô LATIN CAPITAL LETTER O WITH CIRCUMFLEX +325 213 D5 Õ LATIN CAPITAL LETTER O WITH TILDE +326 214 D6 Ö LATIN CAPITAL LETTER O WITH DIAERESIS +327 215 D7 Ũ LATIN CAPITAL LETTER U WITH TILDE +330 216 D8 Ø LATIN CAPITAL LETTER O WITH STROKE +331 217 D9 Ų LATIN CAPITAL LETTER U WITH OGONEK +332 218 DA Ú LATIN CAPITAL LETTER U WITH ACUTE +333 219 DB Û LATIN CAPITAL LETTER U WITH CIRCUMFLEX +334 220 DC Ü LATIN CAPITAL LETTER U WITH DIAERESIS +335 221 DD Ý LATIN CAPITAL LETTER Y WITH ACUTE +336 222 DE Þ LATIN CAPITAL LETTER THORN (Icelandic) +337 223 DF ß LATIN SMALL LETTER SHARP S (German) +340 224 E0 ā LATIN SMALL LETTER A WITH MACRON +341 225 E1 á LATIN SMALL LETTER A WITH ACUTE +342 226 E2 â LATIN SMALL LETTER A WITH CIRCUMFLEX +343 227 E3 ã LATIN SMALL LETTER A WITH TILDE +344 228 E4 ä LATIN SMALL LETTER A WITH DIAERESIS +345 229 E5 Ã¥ LATIN SMALL LETTER A WITH RING ABOVE +346 230 E6 æ LATIN SMALL LETTER AE +347 231 E7 į LATIN SMALL LETTER I WITH OGONEK +350 232 E8 č LATIN SMALL LETTER C WITH CARON +351 233 E9 é LATIN SMALL LETTER E WITH ACUTE +352 234 EA ę LATIN SMALL LETTER E WITH OGONEK +353 235 EB ë LATIN SMALL LETTER E WITH DIAERESIS +354 236 EC ė LATIN SMALL LETTER E WITH DOT ABOVE +355 237 ED í LATIN SMALL LETTER I WITH ACUTE +356 238 EE î LATIN SMALL LETTER I WITH CIRCUMFLEX +357 239 EF ï LATIN SMALL LETTER I WITH DIAERESIS +360 240 F0 ð LATIN SMALL LETTER ETH (Icelandic) +361 241 F1 ņ LATIN SMALL LETTER N WITH CEDILLA +362 242 F2 ō LATIN SMALL LETTER O WITH MACRON +363 243 F3 ó LATIN SMALL LETTER O WITH ACUTE +364 244 F4 ô LATIN SMALL LETTER O WITH CIRCUMFLEX +365 245 F5 õ LATIN SMALL LETTER O WITH TILDE +366 246 F6 ö LATIN SMALL LETTER O WITH DIAERESIS +367 247 F7 Å© LATIN SMALL LETTER U WITH TILDE +370 248 F8 ø LATIN SMALL LETTER O WITH STROKE +371 249 F9 ų LATIN SMALL LETTER U WITH OGONEK +372 250 FA ú LATIN SMALL LETTER U WITH ACUTE +373 251 FB û LATIN SMALL LETTER U WITH CIRCUMFLEX +374 252 FC ü LATIN SMALL LETTER U WITH DIAERESIS +375 253 FD ý LATIN SMALL LETTER Y WITH ACUTE +376 254 FE þ LATIN SMALL LETTER THORN (Icelandic) +377 255 FF ĸ LATIN SMALL LETTER KRA (Greenlandic) +.TE +.SH 備考 +ISO 8859\-10 は Latin\-6 としても知られている。 +.SH 関連項目 +\fBascii\fP(7) diff --git a/draft/man7/iso_8859-11.7 b/draft/man7/iso_8859-11.7 new file mode 100644 index 00000000..1bca1ad4 --- /dev/null +++ b/draft/man7/iso_8859-11.7 @@ -0,0 +1,161 @@ +.\" t -*- coding: UTF-8 -*- +.\" Copyright 2009 Lefteris Dimitroulakis +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.\" +.\"Thanomsub Noppaburana made valuable suggestions. +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ISO_8859\-11 7 2010\-09\-20 Linux "Linux Programmer's Manual" +.SH 名前 +iso_8859\-11 \- ISO 8859\-11 文字集合の 8進数、10進数、16進数による符号化 +.SH 説明 +ISO 8859 規格は ASCII 文字集合 (ISO 6460IRV としても知られている) の +いくつかの 8 ビット拡張を含んでいる。 +ISO 8859\-11 はタイ語で使用される文字の符号化を規定している。 +.SS "ISO 8859 アルファベット" +完全な ISO 8859 アルファベットは以下のものを含んでいる: +.TS +l l. +ISO 8859\-1 西ヨーロッパの言語 (Latin\-1) +ISO 8859\-2 中央および東ヨーロッパの言語 (Latin\-2) +ISO 8859\-3 東南ヨーロッパやその他の言語 (Latin\-3) +ISO 8859\-4 スカンジナビア/バルト語派の言語 (Latin\-4) +ISO 8859\-5 ラテン/キリル文字 +ISO 8859\-6 ラテン/アラビア語 +ISO 8859\-7 ラテン/ギリシャ語 +ISO 8859\-8 ラテン/ヘブライ語 +ISO 8859\-9 トルコ語修正を行なった Latin\-1 (Latin\-5) +ISO 8859\-10 ラップ/ノルディック/エスキモーの言語 (Latin\-6) +ISO 8859\-11 ラテン/タイ語 +ISO 8859\-13 バルト諸国の言語 (Latin\-7) +ISO 8859\-14 ケルト語 (Latin\-8) +ISO 8859\-15 西ヨーロッパの言語 (Latin\-9) +ISO 8859\-16 ルーマニア語 (Latin\-10) +.TE +.SS "ISO 8859\-11 文字" +以下の表は ISO 8859\-11 の表示可能な文字のうち +\fBascii\fP(7) マニュアルページに載っていないものを示している。 +4列目は ISO 8859\-11 用に設定された環境でのみ正しく表示できるだろう。 +.TS +l l l c lp-1. +Oct Dec Hex Char Description +_ +240 160 A0 \ NO\-BREAK SPACE +241 161 A1 ก THAI CHARACTER KO KAI +242 162 A2 ข THAI CHARACTER KHO KHAI +243 163 A3 ฃ THAI CHARACTER KHO KHUAT +244 164 A4 ค THAI CHARACTER KHO KHWAI +245 165 A5 ฅ THAI CHARACTER KHO KHON +246 166 A6 ฆ THAI CHARACTER KHO RAKHANG +247 167 A7 ง THAI CHARACTER NGO NGU +250 168 A8 จ THAI CHARACTER CHO CHAN +251 169 A9 ฉ THAI CHARACTER CHO CHING +252 170 AA ช THAI CHARACTER CHO CHANG +253 171 AB ซ THAI CHARACTER SO SO +254 172 AC ฌ THAI CHARACTER CHO CHOE +255 173 AD ญ THAI CHARACTER YO YING +256 174 AE ฎ THAI CHARACTER DO CHADA +257 175 AF ฏ THAI CHARACTER TO PATAK +260 176 B0 ฐ THAI CHARACTER THO THAN +261 177 B1 ฑ THAI CHARACTER THO NANGMONTHO +262 178 B2 ฒ THAI CHARACTER THO PHUTHAO +263 179 B3 ณ THAI CHARACTER NO NEN +264 180 B4 ด THAI CHARACTER DO DEK +265 181 B5 ต THAI CHARACTER TO TAO +266 182 B6 ถ THAI CHARACTER THO THUNG +267 183 B7 ท THAI CHARACTER THO THAHAN +270 184 B8 ธ THAI CHARACTER THO THONG +271 185 B9 น THAI CHARACTER NO NU +272 186 BA บ THAI CHARACTER BO BAIMAI +273 187 BB ป THAI CHARACTER PO PLA +274 188 BC ผ THAI CHARACTER PHO PHUNG +275 189 BD ฝ THAI CHARACTER FO FA +276 190 BE พ THAI CHARACTER PHO PHAN +277 191 BF ฟ THAI CHARACTER FO FAN +300 192 C0 ภ THAI CHARACTER PHO SAMPHAO +301 193 C1 ม THAI CHARACTER MO MA +302 194 C2 ย THAI CHARACTER YO YAK +303 195 C3 ร THAI CHARACTER RO RUA +304 196 C4 ฤ THAI CHARACTER RU +305 197 C5 ล THAI CHARACTER LO LING +306 198 C6 ฦ THAI CHARACTER LU +307 199 C7 ว THAI CHARACTER WO WAEN +310 200 C8 ศ THAI CHARACTER SO SALA +311 201 C9 ษ THAI CHARACTER SO RUSI +312 202 CA ส THAI CHARACTER SO SUA +313 203 CB ห THAI CHARACTER HO HIP +314 204 CC ฬ THAI CHARACTER LO CHULA +315 205 CD อ THAI CHARACTER O ANG +316 206 CE ฮ THAI CHARACTER HO NOKHUK +317 207 CF ฯ THAI CHARACTER PAIYANNOI +320 208 D0 ะ THAI CHARACTER SARA A +321 209 D1 ั THAI CHARACTER MAI HAN\-AKAT +322 210 D2 า THAI CHARACTER SARA AA +323 211 D3 ำ THAI CHARACTER SARA AM +324 212 D4 ิ THAI CHARACTER SARA I +325 213 D5 ี THAI CHARACTER SARA II +326 214 D6 ึ THAI CHARACTER SARA UE +327 215 D7 ื THAI CHARACTER SARA UEE +330 216 D8 ุ THAI CHARACTER SARA U +331 217 D9 ู THAI CHARACTER SARA UU +332 218 DA ฺ THAI CHARACTER PHINTHU +337 223 DF ฿ THAI CURRENCY SYMBOL BAHT +340 224 E0 เ THAI CHARACTER SARA E +341 225 E1 แ THAI CHARACTER SARA AE +342 226 E2 โ THAI CHARACTER SARA O +343 227 E3 ใ THAI CHARACTER SARA AI MAIMUAN +344 228 E4 ไ THAI CHARACTER SARA AI MAIMALAI +345 229 E5 ๅ THAI CHARACTER LAKKHANGYAO +346 230 E6 ๆ THAI CHARACTER MAIYAMOK +347 231 E7 ็ THAI CHARACTER MAITAIKHU +350 232 E8 ่ THAI CHARACTER MAI EK +351 233 E9 ้ THAI CHARACTER MAI THO +352 234 EA ๊ THAI CHARACTER MAI TRI +353 235 EB ๋ THAI CHARACTER MAI CHATTAWA +354 236 EC ์ THAI CHARACTER THANTHAKHAT +355 237 ED ํ THAI CHARACTER NIKHAHIT +356 238 EE ๎ THAI CHARACTER YAMAKKAN +357 239 EF ๏ THAI CHARACTER FONGMAN +360 240 F0 ๐ THAI DIGIT ZERO +361 241 F1 ๑ THAI DIGIT ONE +362 242 F2 ๒ THAI DIGIT TWO +363 243 F3 ๓ THAI DIGIT THREE +364 244 F4 ๔ THAI DIGIT FOUR +365 245 F5 ๕ THAI DIGIT FIVE +366 246 F6 ๖ THAI DIGIT SIX +367 247 F7 ๗ THAI DIGIT SEVEN +370 248 F8 ๘ THAI DIGIT EIGHT +371 249 F9 ๙ THAI DIGIT NINE +372 250 FA ๚ THAI CHARACTER ANGKHANKHU +373 251 FB ๛ THAI CHARACTER KHOMUT +.TE +.SH 備考 +ISO 8859\-11 は TIS (タイ工業規格) 620\-2253 (一般には TIS\-620 として +知られている) と同じだが、位置 a0 の文字だけが異なる。 +位置 a0 は、ISO 8859\-11 では "ハードスペース (nonbreaking space)" として +定義されているが、TIS 620 では未定義のままである。 +.SH 関連項目 +\fBascii\fP(7) diff --git a/draft/man7/iso_8859-13.7 b/draft/man7/iso_8859-13.7 new file mode 100644 index 00000000..aa24da47 --- /dev/null +++ b/draft/man7/iso_8859-13.7 @@ -0,0 +1,165 @@ +.\" t -*- coding: UTF-8 -*- +.\" Copyright 2009 Lefteris Dimitroulakis (edimitro@tee.gr) +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ISO_8859\-13 7 2010\-09\-20 Linux "Linux Programmer's Manual" +.SH 名前 +iso_8859\-13 \- ISO 8859\-13 文字集合の 8進数、10進数、16進数による符号化 +.SH 説明 +.\" In my system with glibc-2.8-20080929 is used for +.\" Lithuanian, Latvian and the Maori language in New Zealand. +ISO 8859 規格は ASCII 文字集合 (ISO 6460IRV としても知られている) の +いくつかの 8 ビット拡張を含んでいる。 +ISO 8859\-13 はバルト諸国の言語で使用される文字の符号化を規定している。 +.SS "ISO 8859 アルファベット" +完全な ISO 8859 アルファベットは以下のものを含んでいる: +.TS +l l. +ISO 8859\-1 西ヨーロッパの言語 (Latin\-1) +ISO 8859\-2 中央および東ヨーロッパの言語 (Latin\-2) +ISO 8859\-3 東南ヨーロッパやその他の言語 (Latin\-3) +ISO 8859\-4 スカンジナビア/バルト語派の言語 (Latin\-4) +ISO 8859\-5 ラテン/キリル文字 +ISO 8859\-6 ラテン/アラビア語 +ISO 8859\-7 ラテン/ギリシャ語 +ISO 8859\-8 ラテン/ヘブライ語 +ISO 8859\-9 トルコ語修正を行なった Latin\-1 (Latin\-5) +ISO 8859\-10 ラップ/ノルディック/エスキモーの言語 (Latin\-6) +ISO 8859\-11 ラテン/タイ語 +ISO 8859\-13 バルト諸国の言語 (Latin\-7) +ISO 8859\-14 ケルト語 (Latin\-8) +ISO 8859\-15 西ヨーロッパの言語 (Latin\-9) +ISO 8859\-16 ルーマニア語 (Latin\-10) +.TE +.SS "ISO 8859\-13 文字" +以下の表は ISO 8859\-13 の表示可能な文字のうち +\fBascii\fP(7) マニュアルページに載っていないものを示している。 +4列目は ISO 8859\-13 用に設定された環境でのみ正しく表示できるだろう。 +.TS +l l l c lp-1. +Oct Dec Hex Char Description +_ +240 160 A0 \ NO\-BREAK SPACE +241 161 A1 ” RIGHT DOUBLE QUOTATION MARK +242 162 A2 ¢ CENT SIGN +243 163 A3 £ POUND SIGN +244 164 A4 ¤ CURRENCY SIGN +245 165 A5 „ DOUBLE LOW\-9 QUOTATION MARK +246 166 A6 ¦ BROKEN BAR +247 167 A7 § SECTION SIGN +250 168 A8 Ø LATIN CAPITAL LETTER O WITH STROKE +251 169 A9 © COPYRIGHT SIGN +252 170 AA Ŗ LATIN CAPITAL LETTER R WITH CEDILLA +253 171 AB « LEFT\-POINTING DOUBLE ANGLE QUOTATION MARK +254 172 AC ¬ NOT SIGN +255 173 AD ­ SOFT HYPHEN +256 174 AE ® REGISTERED SIGN +257 175 AF Æ LATIN CAPITAL LETTER AE +260 176 B0 ° DEGREE SIGN +261 177 B1 ± PLUS\-MINUS SIGN +262 178 B2 ² SUPERSCRIPT TWO +263 179 B3 ³ SUPERSCRIPT THREE +264 180 B4 “ LEFT DOUBLE QUOTATION MARK +265 181 B5 µ MICRO SIGN +266 182 B6 ¶ PILCROW SIGN +267 183 B7 · MIDDLE DOT +270 184 B8 ø LATIN SMALL LETTER O WITH STROKE +271 185 B9 ¹ SUPERSCRIPT ONE +272 186 BA ŗ LATIN SMALL LETTER R WITH CEDILLA +273 187 BB » RIGHT\-POINTING DOUBLE ANGLE QUOTATION MARK +274 188 BC ¼ VULGAR FRACTION ONE QUARTER +275 189 BD ½ VULGAR FRACTION ONE HALF +276 190 BE ¾ VULGAR FRACTION THREE QUARTERS +277 191 BF æ LATIN SMALL LETTER AE +300 192 C0 Ą LATIN CAPITAL LETTER A WITH OGONEK +301 193 C1 Ä® LATIN CAPITAL LETTER I WITH OGONEK +302 194 C2 Ā LATIN CAPITAL LETTER A WITH MACRON +303 195 C3 Ć LATIN CAPITAL LETTER C WITH ACUTE +304 196 C4 Ä LATIN CAPITAL LETTER A WITH DIAERESIS +305 197 C5 Å LATIN CAPITAL LETTER A WITH RING ABOVE +306 198 C6 Ę LATIN CAPITAL LETTER E WITH OGONEK +307 199 C7 Ē LATIN CAPITAL LETTER E WITH MACRON +310 200 C8 Č LATIN CAPITAL LETTER C WITH CARON +311 201 C9 É LATIN CAPITAL LETTER E WITH ACUTE +312 202 CA Ź LATIN CAPITAL LETTER Z WITH ACUTE +313 203 CB Ė LATIN CAPITAL LETTER E WITH DOT ABOVE +314 204 CC Ä¢ LATIN CAPITAL LETTER G WITH CEDILLA +315 205 CD Ķ LATIN CAPITAL LETTER K WITH CEDILLA +316 206 CE Ī LATIN CAPITAL LETTER I WITH MACRON +317 207 CF Ä» LATIN CAPITAL LETTER L WITH CEDILLA +320 208 D0 Å  LATIN CAPITAL LETTER S WITH CARON +321 209 D1 Ń LATIN CAPITAL LETTER N WITH ACUTE +322 210 D2 Ņ LATIN CAPITAL LETTER N WITH CEDILLA +323 211 D3 Ó LATIN CAPITAL LETTER O WITH ACUTE +324 212 D4 Ō LATIN CAPITAL LETTER O WITH MACRON +325 213 D5 Õ LATIN CAPITAL LETTER O WITH TILDE +326 214 D6 Ö LATIN CAPITAL LETTER O WITH DIAERESIS +327 215 D7 × MULTIPLICATION SIGN +330 216 D8 Ų LATIN CAPITAL LETTER U WITH OGONEK +331 217 D9 Ł LATIN CAPITAL LETTER L WITH STROKE +332 218 DA Ś LATIN CAPITAL LETTER S WITH ACUTE +333 219 DB Ū LATIN CAPITAL LETTER U WITH MACRON +334 220 DC Ü LATIN CAPITAL LETTER U WITH DIAERESIS +335 221 DD Å» LATIN CAPITAL LETTER Z WITH DOT ABOVE +336 222 DE Ž LATIN CAPITAL LETTER Z WITH CARON +337 223 DF ß LATIN SMALL LETTER SHARP S +340 224 E0 ą LATIN SMALL LETTER A WITH OGONEK +341 225 E1 į LATIN SMALL LETTER I WITH OGONEK +342 226 E2 ā LATIN SMALL LETTER A WITH MACRON +343 227 E3 ć LATIN SMALL LETTER C WITH ACUTE +344 228 E4 ä LATIN SMALL LETTER A WITH DIAERESIS +345 229 E5 Ã¥ LATIN SMALL LETTER A WITH RING ABOVE +346 230 E6 ę LATIN SMALL LETTER E WITH OGONEK +347 231 E7 ē LATIN SMALL LETTER E WITH MACRON +350 232 E8 č LATIN SMALL LETTER C WITH CARON +351 233 E9 é LATIN SMALL LETTER E WITH ACUTE +352 234 EA ź LATIN SMALL LETTER Z WITH ACUTE +353 235 EB ė LATIN SMALL LETTER E WITH DOT ABOVE +354 236 EC Ä£ LATIN SMALL LETTER G WITH CEDILLA +355 237 ED Ä· LATIN SMALL LETTER K WITH CEDILLA +356 238 EE Ä« LATIN SMALL LETTER I WITH MACRON +357 239 EF ļ LATIN SMALL LETTER L WITH CEDILLA +360 240 F0 Å¡ LATIN SMALL LETTER S WITH CARON +361 241 F1 ń LATIN SMALL LETTER N WITH ACUTE +362 242 F2 ņ LATIN SMALL LETTER N WITH CEDILLA +363 243 F3 ó LATIN SMALL LETTER O WITH ACUTE +364 244 F4 ō LATIN SMALL LETTER O WITH MACRON +365 245 F5 õ LATIN SMALL LETTER O WITH TILDE +366 246 F6 ö LATIN SMALL LETTER O WITH DIAERESIS +367 247 F7 ÷ DIVISION SIGN +370 248 F8 ų LATIN SMALL LETTER U WITH OGONEK +371 249 F9 ł LATIN SMALL LETTER L WITH STROKE +372 250 FA ś LATIN SMALL LETTER S WITH ACUTE +373 251 FB Å« LATIN SMALL LETTER U WITH MACRON +374 252 FC ü LATIN SMALL LETTER U WITH DIAERESIS +375 253 FD ż LATIN SMALL LETTER Z WITH DOT ABOVE +376 254 FE ž LATIN SMALL LETTER Z WITH CARON +377 255 FF ’ RIGHT SINGLE QUOTATION MARK +.TE +.SH 備考 +ISO 8859\-13 は Latin\-7 としても知られている。 +.SH 関連項目 +\fBascii\fP(7) diff --git a/draft/man7/iso_8859-14.7 b/draft/man7/iso_8859-14.7 new file mode 100644 index 00000000..6c363edd --- /dev/null +++ b/draft/man7/iso_8859-14.7 @@ -0,0 +1,163 @@ +.\" t -*- coding: UTF-8 -*- +.\" Copyright 2009 Lefteris Dimitroulakis (edimitro@tee.gr) +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ISO_8859\-14 7 2010\-09\-20 Linux "Linux Programmer's Manual" +.SH 名前 +iso_8859\-14 \- ISO 8859\-14 文字集合の 8進数、10進数、16進数による符号化 +.SH 説明 +ISO 8859 規格は ASCII 文字集合 (ISO 6460IRV としても知られている) の +いくつかの 8 ビット拡張を含んでいる。 +ISO 8859\-14 はケルト語で使用される文字の符号化を規定している。 +.SS "ISO 8859 アルファベット" +完全な ISO 8859 アルファベットは以下のものを含んでいる: +.TS +l l. +ISO 8859\-1 西ヨーロッパの言語 (Latin\-1) +ISO 8859\-2 中央および東ヨーロッパの言語 (Latin\-2) +ISO 8859\-3 東南ヨーロッパやその他の言語 (Latin\-3) +ISO 8859\-4 スカンジナビア/バルト語派の言語 (Latin\-4) +ISO 8859\-5 ラテン/キリル文字 +ISO 8859\-6 ラテン/アラビア語 +ISO 8859\-7 ラテン/ギリシャ語 +ISO 8859\-8 ラテン/ヘブライ語 +ISO 8859\-9 トルコ語修正を行なった Latin\-1 (Latin\-5) +ISO 8859\-10 ラップ/ノルディック/エスキモーの言語 (Latin\-6) +ISO 8859\-11 ラテン/タイ語 +ISO 8859\-13 バルト諸国の言語 (Latin\-7) +ISO 8859\-14 ケルト語 (Latin\-8) +ISO 8859\-15 西ヨーロッパの言語 (Latin\-9) +ISO 8859\-16 ルーマニア語 (Latin\-10) +.TE +.SS "ISO 8859\-14 文字" +以下の表は ISO 8859\-14 の表示可能な文字のうち +\fBascii\fP(7) マニュアルページに載っていないものを示している。 +4列目は ISO 8859\-14 用に設定された環境でのみ正しく表示できるだろう。 +.TS +l l l c lp-1. +Oct Dec Hex Char Description +_ +240 160 A0 \ NO\-BREAK SPACE +241 161 A1 Ḃ LATIN CAPITAL LETTER B WITH DOT ABOVE +242 162 A2 ḃ LATIN SMALL LETTER B WITH DOT ABOVE +243 163 A3 £ POUND SIGN +244 164 A4 Ċ LATIN CAPITAL LETTER C WITH DOT ABOVE +245 165 A5 ċ LATIN SMALL LETTER C WITH DOT ABOVE +246 166 A6 Ḋ LATIN CAPITAL LETTER D WITH DOT ABOVE +247 167 A7 § SECTION SIGN +250 168 A8 Ẁ LATIN CAPITAL LETTER W WITH GRAVE +251 169 A9 © COPYRIGHT SIGN +252 170 AA Ẃ LATIN CAPITAL LETTER W WITH ACUTE +253 171 AB ḋ LATIN SMALL LETTER D WITH DOT ABOVE +254 172 AC Ỳ LATIN CAPITAL LETTER Y WITH GRAVE +255 173 AD ­ SOFT HYPHEN +256 174 AE ® REGISTERED SIGN +257 175 AF Ÿ LATIN CAPITAL LETTER Y WITH DIAERESIS +260 176 B0 Ḟ LATIN CAPITAL LETTER F WITH DOT ABOVE +261 177 B1 ḟ LATIN SMALL LETTER F WITH DOT ABOVE +262 178 B2 Ä  LATIN CAPITAL LETTER G WITH DOT ABOVE +263 179 B3 Ä¡ LATIN SMALL LETTER G WITH DOT ABOVE +264 180 B4 Ṁ LATIN CAPITAL LETTER M WITH DOT ABOVE +265 181 B5 ṁ LATIN SMALL LETTER M WITH DOT ABOVE +266 182 B6 ¶ PILCROW SIGN +267 183 B7 Ṗ LATIN CAPITAL LETTER P WITH DOT ABOVE +270 184 B8 ẁ LATIN SMALL LETTER W WITH GRAVE +271 185 B9 ṗ LATIN SMALL LETTER P WITH DOT ABOVE +272 186 BA ẃ LATIN SMALL LETTER W WITH ACUTE +273 187 BB á¹  LATIN CAPITAL LETTER S WITH DOT ABOVE +274 188 BC ỳ LATIN SMALL LETTER Y WITH GRAVE +275 189 BD Ẅ LATIN CAPITAL LETTER W WITH DIAERESIS +276 190 BE ẅ LATIN SMALL LETTER W WITH DIAERESIS +277 191 BF ṡ LATIN SMALL LETTER S WITH DOT ABOVE +300 192 C0 À LATIN CAPITAL LETTER A WITH GRAVE +301 193 C1 Á LATIN CAPITAL LETTER A WITH ACUTE +302 194 C2  LATIN CAPITAL LETTER A WITH CIRCUMFLEX +303 195 C3 à LATIN CAPITAL LETTER A WITH TILDE +304 196 C4 Ä LATIN CAPITAL LETTER A WITH DIAERESIS +305 197 C5 Å LATIN CAPITAL LETTER A WITH RING ABOVE +306 198 C6 Æ LATIN CAPITAL LETTER AE +307 199 C7 Ç LATIN CAPITAL LETTER C WITH CEDILLA +310 200 C8 È LATIN CAPITAL LETTER E WITH GRAVE +311 201 C9 É LATIN CAPITAL LETTER E WITH ACUTE +312 202 CA Ê LATIN CAPITAL LETTER E WITH CIRCUMFLEX +313 203 CB Ë LATIN CAPITAL LETTER E WITH DIAERESIS +314 204 CC Ì LATIN CAPITAL LETTER I WITH GRAVE +315 205 CD Í LATIN CAPITAL LETTER I WITH ACUTE +316 206 CE Î LATIN CAPITAL LETTER I WITH CIRCUMFLEX +317 207 CF Ï LATIN CAPITAL LETTER I WITH DIAERESIS +320 208 D0 Å´ LATIN CAPITAL LETTER W WITH CIRCUMFLEX +321 209 D1 Ñ LATIN CAPITAL LETTER N WITH TILDE +322 210 D2 Ò LATIN CAPITAL LETTER O WITH GRAVE +323 211 D3 Ó LATIN CAPITAL LETTER O WITH ACUTE +324 212 D4 Ô LATIN CAPITAL LETTER O WITH CIRCUMFLEX +325 213 D5 Õ LATIN CAPITAL LETTER O WITH TILDE +326 214 D6 Ö LATIN CAPITAL LETTER O WITH DIAERESIS +327 215 D7 Ṫ LATIN CAPITAL LETTER T WITH DOT ABOVE +330 216 D8 Ø LATIN CAPITAL LETTER O WITH STROKE +331 217 D9 Ù LATIN CAPITAL LETTER U WITH GRAVE +332 218 DA Ú LATIN CAPITAL LETTER U WITH ACUTE +333 219 DB Û LATIN CAPITAL LETTER U WITH CIRCUMFLEX +334 220 DC Ü LATIN CAPITAL LETTER U WITH DIAERESIS +335 221 DD Ý LATIN CAPITAL LETTER Y WITH ACUTE +336 222 DE Ŷ LATIN CAPITAL LETTER Y WITH CIRCUMFLEX +337 223 DF ß LATIN SMALL LETTER SHARP S +340 224 E0 à LATIN SMALL LETTER A WITH GRAVE +341 225 E1 á LATIN SMALL LETTER A WITH ACUTE +342 226 E2 â LATIN SMALL LETTER A WITH CIRCUMFLEX +343 227 E3 ã LATIN SMALL LETTER A WITH TILDE +344 228 E4 ä LATIN SMALL LETTER A WITH DIAERESIS +345 229 E5 Ã¥ LATIN SMALL LETTER A WITH RING ABOVE +346 230 E6 æ LATIN SMALL LETTER AE +347 231 E7 ç LATIN SMALL LETTER C WITH CEDILLA +350 232 E8 è LATIN SMALL LETTER E WITH GRAVE +351 233 E9 é LATIN SMALL LETTER E WITH ACUTE +352 234 EA ê LATIN SMALL LETTER E WITH CIRCUMFLEX +353 235 EB ë LATIN SMALL LETTER E WITH DIAERESIS +354 236 EC ì LATIN SMALL LETTER I WITH GRAVE +355 237 ED í LATIN SMALL LETTER I WITH ACUTE +356 238 EE î LATIN SMALL LETTER I WITH CIRCUMFLEX +357 239 EF ï LATIN SMALL LETTER I WITH DIAERESIS +360 240 F0 ŵ LATIN SMALL LETTER W WITH CIRCUMFLEX +361 241 F1 ñ LATIN SMALL LETTER N WITH TILDE +362 242 F2 ò LATIN SMALL LETTER O WITH GRAVE +363 243 F3 ó LATIN SMALL LETTER O WITH ACUTE +364 244 F4 ô LATIN SMALL LETTER O WITH CIRCUMFLEX +365 245 F5 õ LATIN SMALL LETTER O WITH TILDE +366 246 F6 ö LATIN SMALL LETTER O WITH DIAERESIS +367 247 F7 ṫ LATIN SMALL LETTER T WITH DOT ABOVE +370 248 F8 ø LATIN SMALL LETTER O WITH STROKE +371 249 F9 ù LATIN SMALL LETTER U WITH GRAVE +372 250 FA ú LATIN SMALL LETTER U WITH ACUTE +373 251 FB û LATIN SMALL LETTER U WITH CIRCUMFLEX +374 252 FC ü LATIN SMALL LETTER U WITH DIAERESIS +375 253 FD ý LATIN SMALL LETTER Y WITH ACUTE +376 254 FE Å· LATIN SMALL LETTER Y WITH CIRCUMFLEX +377 255 FF ÿ LATIN SMALL LETTER Y WITH DIAERESIS +.TE +.SH 備考 +ISO 8859\-14 は Latin\-8 としても知られている。 +.SH 関連項目 +\fBascii\fP(7) diff --git a/draft/man7/iso_8859-15.7 b/draft/man7/iso_8859-15.7 index aa173f02..e0f737f0 100644 --- a/draft/man7/iso_8859-15.7 +++ b/draft/man7/iso_8859-15.7 @@ -1,4 +1,4 @@ -'\" t +.\" t -*- coding: UTF-8 -*- .\" Copyright 1993-1995 Daniel Quinlan (quinlan@yggdrasil.com) .\" Copyright 1999 Dimitri Papadopoulos (dpo@club-internet.fr) .\" @@ -21,207 +21,154 @@ .\" License along with this manual; if not, write to the Free .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, .\" USA. +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Thu Jan 6 01:45:49 JST 2000 -.\" by HANATAKA Shinya -.\" Updated Tue Sep 9 JST 2003 by Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.TH ISO_8859-15 7 1999-05-31 "Linux" "Linux Programmer's Manual" +.\"******************************************************************* +.TH ISO_8859\-15 7 1999\-05\-31 Linux "Linux Programmer's Manual" .nh -.\"O .SH NAME .SH 名前 -.\"O iso_8859-15 \- ISO 8859-15 character set encoded in octal, decimal, -.\"O and hexadecimal -iso_8859-15 \- ISO 8859-15 文字集合の 8進数、10進数、16進数による符号化 -.\"O .SH DESCRIPTION +iso_8859\-15 \- ISO 8859\-15 文字集合の 8進数、10進数、16進数による符号化 .SH 説明 -.\"O The ISO 8859 standard includes several 8-bit extensions to the ASCII -.\"O character set (also known as ISO 646-IRV). -.\"O Especially important is -.\"O ISO 8859-1, the "Latin Alphabet No. 1", which has become widely -.\"O implemented and may already be seen as the de-facto standard ASCII -.\"O replacement. -.\"O However, it lacks the EURO symbol and does not fully -.\"O cover Finnish and French. -.\"O ISO 8859-15 is a modification of ISO 8859-1 -.\"O that covers these needs. -ISO 8859 規格は ASCII 文字集合 (ISO 646-IRV とも呼ばれる) の -いくつかの 8 ビット拡張を含んでいる。特に重要な ISO 8859-1、 +ISO 8859 規格は ASCII 文字集合 (ISO 6460IRV としても知られている) の +いくつかの 8 ビット拡張を含んでいる。特に重要なのは ISO 8859\-1、 "ラテン・アルファベット No. 1" で、広く実装され、既に ASCII に代わって -事実上の標準になっているようにみえる。一方でそれはユーロ (EURO) 記号が -含まれておらず、フィンランド語とフランス語を完全にサポートできていない。 -ISO 8859-15 はこれらの要求を満たすために ISO 8859-1 を修正したものである。 +事実上の標準になっているようにみえる。 +しかしながら、ISO 8859\-1 では ユーロ (EURO) 記号が含まれておらず、 +フィンランド語とフランス語も完全にカバーされていない。 .P -.\"O ISO 8859-15 supports the following languages: Albanian, Basque, Breton, -.\"O Catalan, Danish, Dutch, English, Estonian, Faroese, Finnish, French, -.\"O Frisian, Galician, German, Greenlandic, Icelandic, Irish Gaelic, -.\"O Italian, Latin, Luxemburgish, Norwegian, Portuguese, Rhaeto-Romanic, -.\"O Scottish Gaelic, Spanish, and Swedish. -ISO 8859-15 は以下の言語をサポートしている: アルバニア語、バスク語、 -ブルターニュ語、カタロニア語、デンマーク語、オランダ語、英語、 -エストニア語、フェロー語、フィンランド語、フランス語、フリースランド語、 -ガリシア語、ドイツ語、グリーンランド語、アイスランド語、 -アイルランド・ゲール語、イタリア語、ラテン語、ルクセンブルグ語、 -ノルウェー語、ポルトガル語、レートロマンス語、スコットランド・ゲール語、 -スペイン語、スウェーデン語。 -.\"O .SS "ISO 8859 Alphabets" +ISO 8859\-15 は以下の言語をサポートしている: +アルバニア語、バスク語、ブルターニュ語、カタロニア語、デンマーク語、 +オランダ語、英語、エストニア語、フェロー語、フィンランド語、フランス語、 +フリジア語、ガリシア語、ドイツ語、グリーンランド語、アイスランド語、 +アイリッシュ・ゲール語、イタリア語、ラテン語、ルクセンブルグ語、 +ノルウェー語、ポルトガル語、レートロマンス語、 +スコットランド・ゲール語、スペイン語、スウェーデン語。 .SS "ISO 8859 アルファベット" -.\"O The full set of ISO 8859 alphabets includes: 完全な ISO 8859 アルファベットは以下のものを含んでいる: .TS l l. -.\"O ISO 8859-1 West European languages (Latin-1) -.\"O ISO 8859-2 Central and East European languages (Latin-2) -.\"O ISO 8859-3 Southeast European and miscellaneous languages (Latin-3) -.\"O ISO 8859-4 Scandinavian/Baltic languages (Latin-4) -.\"O ISO 8859-5 Latin/Cyrillic -.\"O ISO 8859-6 Latin/Arabic -.\"O ISO 8859-7 Latin/Greek -.\"O ISO 8859-8 Latin/Hebrew -.\"O ISO 8859-9 Latin-1 modification for Turkish (Latin-5) -.\"O ISO 8859-10 Lappish/Nordic/Eskimo languages (Latin-6) -.\"O ISO 8859-11 Latin/Thai -.\"O ISO 8859-13 Baltic Rim languages (Latin-7) -.\"O ISO 8859-14 Celtic (Latin-8) -.\"O ISO 8859-15 west European languages (Latin-9) -.\"O ISO 8859-16 Romanian (Latin-10) -ISO 8859-1 西ヨーロッパの言語 (Latin-1) -ISO 8859-2 中央・東ヨーロッパの言語 (Latin-2) -ISO 8859-3 東南ヨーロッパやその他の言語 (Latin-3) -ISO 8859-4 スカンジナビア/バルト語派の言語 (Latin-4) -ISO 8859-5 ラテン/キリル文字 -ISO 8859-6 ラテン/アラビア文字 -ISO 8859-7 ラテンギリシャ文字 -ISO 8859-8 ラテン/ヘブライ語 -ISO 8859-9 トルコ語修正を行なった Latin-1 (Latin-5) -ISO 8859-10 ラップ/ノルディック/エスキモーの言語 (Latin-6) -ISO 8859-11 ラテン/タイ語 -ISO 8859-13 バルト諸国の言語 (Latin-7) -ISO 8859-14 ケルト語 (Latin-8) -ISO 8859-15 西ヨーロッパの言語 (Latin-9) -ISO 8859-16 ルーマニア語 (Latin-10) +ISO 8859\-1 西ヨーロッパの言語 (Latin\-1) +ISO 8859\-2 中央および東ヨーロッパの言語 (Latin\-2) +ISO 8859\-3 東南ヨーロッパやその他の言語 (Latin\-3) +ISO 8859\-4 スカンジナビア/バルト語派の言語 (Latin\-4) +ISO 8859\-5 ラテン/キリル文字 +ISO 8859\-6 ラテン/アラビア語 +ISO 8859\-7 ラテン/ギリシャ語 +ISO 8859\-8 ラテン/ヘブライ語 +ISO 8859\-9 トルコ語修正を行なった Latin\-1 (Latin\-5) +ISO 8859\-10 ラップ/ノルディック/エスキモーの言語 (Latin\-6) +ISO 8859\-11 ラテン/タイ語 +ISO 8859\-13 バルト諸国の言語 (Latin\-7) +ISO 8859\-14 ケルト語 (Latin\-8) +ISO 8859\-15 西ヨーロッパの言語 (Latin\-9) +ISO 8859\-16 ルーマニア語 (Latin\-10) .TE -.\"O .SS "ISO 8859-15 Characters" -.SS "ISO 8859-15 文字" -.\"O The following table displays the characters in ISO 8859-15 (Latin-9), -.\"O which are printable and unlisted in the -.\"O .BR ascii (7) -.\"O manual page. -.\"O The fourth column will only show the proper glyphs -.\"O in an environment configured for ISO 8859-15. -以下の表は ISO 8859-15 (Latin-9) の表示可能な文字のうち -.BR ascii (7) -マニュアル・ページに載っていないものを示している。 -4列目は ISO 8859-15 用に設定された環境でのみ正しく表示できるだろう。 - -[ 訳注 原文では Char の部分に ISO 8859-15 の文字があったが、 -日本語 EUC との併用は難しいので削除し、JIS X 0208 の同じ文字を -示すようにした。その他の文字に関しては -英語版の iso_8859-15(7) を適切なフォントを準備して参照。 ] +.SS "ISO 8859\-15 文字" +以下の表は ISO 8859\-15 (Latin\-9) の表示可能な文字のうち +\fBascii\fP(7) マニュアルページに載っていないものを示している。 +4列目は ISO 8859\-15 用に設定された環境でのみ正しく表示できるだろう。 .TS l l l c lp-1. Oct Dec Hex Char Description _ -240 160 A0 NO-BREAK SPACE -241 161 A1 INVERTED EXCLAMATION MARK +240 160 A0 \ NO\-BREAK SPACE +241 161 A1 ¡ INVERTED EXCLAMATION MARK 242 162 A2 ¢ CENT SIGN 243 163 A3 £ POUND SIGN -244 164 A4 EURO SIGN +244 164 A4 € EURO SIGN 245 165 A5 Â¥ YEN SIGN -246 166 A6 LATIN CAPITAL LETTER S WITH CARON +246 166 A6 Å  LATIN CAPITAL LETTER S WITH CARON 247 167 A7 § SECTION SIGN -250 168 A8 LATIN SMALL LETTER S WITH CARON -251 169 A9 COPYRIGHT SIGN -252 170 AA FEMININE ORDINAL INDICATOR -253 171 AB 《 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +250 168 A8 Å¡ LATIN SMALL LETTER S WITH CARON +251 169 A9 © COPYRIGHT SIGN +252 170 AA ª FEMININE ORDINAL INDICATOR +253 171 AB « LEFT\-POINTING DOUBLE ANGLE QUOTATION MARK 254 172 AC ¬ NOT SIGN -255 173 AD SOFT HYPHEN -256 174 AE REGISTERED SIGN -257 175 AF MACRON +255 173 AD ­ SOFT HYPHEN +256 174 AE ® REGISTERED SIGN +257 175 AF ¯ MACRON 260 176 B0 ° DEGREE SIGN -261 177 B1 ± PLUS-MINUS SIGN -262 178 B2 SUPERSCRIPT TWO -263 179 B3 SUPERSCRIPT THREE -264 180 B4 LATIN CAPITAL LETTER Z WITH CARON -265 181 B5 μ MICRO SIGN +261 177 B1 ± PLUS\-MINUS SIGN +262 178 B2 ² SUPERSCRIPT TWO +263 179 B3 ³ SUPERSCRIPT THREE +264 180 B4 Ž LATIN CAPITAL LETTER Z WITH CARON +265 181 B5 µ MICRO SIGN 266 182 B6 ¶ PILCROW SIGN -267 183 B7 ・ MIDDLE DOT -270 184 B8 LATIN SMALL LETTER Z WITH CARON -271 185 B9 SUPERSCRIPT ONE -272 186 BA MASCULINE ORDINAL INDICATOR -273 187 BB 》 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -274 188 BC LATIN CAPITAL LIGATURE OE -275 189 BD LATIN SMALL LIGATURE OE -276 190 BE LATIN CAPITAL LETTER Y WITH DIAERESIS -277 191 BF INVERTED QUESTION MARK -300 192 C0 LATIN CAPITAL LETTER A WITH GRAVE -301 193 C1 LATIN CAPITAL LETTER A WITH ACUTE -302 194 C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX -303 195 C3 LATIN CAPITAL LETTER A WITH TILDE -304 196 C4 LATIN CAPITAL LETTER A WITH DIAERESIS -305 197 C5 LATIN CAPITAL LETTER A WITH RING ABOVE -306 198 C6 LATIN CAPITAL LETTER AE -307 199 C7 LATIN CAPITAL LETTER C WITH CEDILLA -310 200 C8 LATIN CAPITAL LETTER E WITH GRAVE -311 201 C9 LATIN CAPITAL LETTER E WITH ACUTE -312 202 CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX -313 203 CB LATIN CAPITAL LETTER E WITH DIAERESIS -314 204 CC LATIN CAPITAL LETTER I WITH GRAVE -315 205 CD LATIN CAPITAL LETTER I WITH ACUTE -316 206 CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX -317 207 CF LATIN CAPITAL LETTER I WITH DIAERESIS -320 208 D0 LATIN CAPITAL LETTER ETH -321 209 D1 LATIN CAPITAL LETTER N WITH TILDE -322 210 D2 LATIN CAPITAL LETTER O WITH GRAVE -323 211 D3 LATIN CAPITAL LETTER O WITH ACUTE -324 212 D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX -325 213 D5 LATIN CAPITAL LETTER O WITH TILDE -326 214 D6 LATIN CAPITAL LETTER O WITH DIAERESIS +267 183 B7 · MIDDLE DOT +270 184 B8 ž LATIN SMALL LETTER Z WITH CARON +271 185 B9 ¹ SUPERSCRIPT ONE +272 186 BA º MASCULINE ORDINAL INDICATOR +273 187 BB » RIGHT\-POINTING DOUBLE ANGLE QUOTATION MARK +274 188 BC Œ LATIN CAPITAL LIGATURE OE +275 189 BD œ LATIN SMALL LIGATURE OE +276 190 BE Ÿ LATIN CAPITAL LETTER Y WITH DIAERESIS +277 191 BF ¿ INVERTED QUESTION MARK +300 192 C0 À LATIN CAPITAL LETTER A WITH GRAVE +301 193 C1 Á LATIN CAPITAL LETTER A WITH ACUTE +302 194 C2  LATIN CAPITAL LETTER A WITH CIRCUMFLEX +303 195 C3 à LATIN CAPITAL LETTER A WITH TILDE +304 196 C4 Ä LATIN CAPITAL LETTER A WITH DIAERESIS +305 197 C5 Å LATIN CAPITAL LETTER A WITH RING ABOVE +306 198 C6 Æ LATIN CAPITAL LETTER AE +307 199 C7 Ç LATIN CAPITAL LETTER C WITH CEDILLA +310 200 C8 È LATIN CAPITAL LETTER E WITH GRAVE +311 201 C9 É LATIN CAPITAL LETTER E WITH ACUTE +312 202 CA Ê LATIN CAPITAL LETTER E WITH CIRCUMFLEX +313 203 CB Ë LATIN CAPITAL LETTER E WITH DIAERESIS +314 204 CC Ì LATIN CAPITAL LETTER I WITH GRAVE +315 205 CD Í LATIN CAPITAL LETTER I WITH ACUTE +316 206 CE Î LATIN CAPITAL LETTER I WITH CIRCUMFLEX +317 207 CF Ï LATIN CAPITAL LETTER I WITH DIAERESIS +320 208 D0 Ð LATIN CAPITAL LETTER ETH +321 209 D1 Ñ LATIN CAPITAL LETTER N WITH TILDE +322 210 D2 Ò LATIN CAPITAL LETTER O WITH GRAVE +323 211 D3 Ó LATIN CAPITAL LETTER O WITH ACUTE +324 212 D4 Ô LATIN CAPITAL LETTER O WITH CIRCUMFLEX +325 213 D5 Õ LATIN CAPITAL LETTER O WITH TILDE +326 214 D6 Ö LATIN CAPITAL LETTER O WITH DIAERESIS 327 215 D7 × MULTIPLICATION SIGN -330 216 D8 LATIN CAPITAL LETTER O WITH STROKE -331 217 D9 LATIN CAPITAL LETTER U WITH GRAVE -332 218 DA LATIN CAPITAL LETTER U WITH ACUTE -333 219 DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX -334 220 DC LATIN CAPITAL LETTER U WITH DIAERESIS -335 221 DD LATIN CAPITAL LETTER Y WITH ACUTE -336 222 DE LATIN CAPITAL LETTER THORN -337 223 DF LATIN SMALL LETTER SHARP S -340 224 E0 LATIN SMALL LETTER A WITH GRAVE -341 225 E1 LATIN SMALL LETTER A WITH ACUTE -342 226 E2 LATIN SMALL LETTER A WITH CIRCUMFLEX -343 227 E3 LATIN SMALL LETTER A WITH TILDE -344 228 E4 LATIN SMALL LETTER A WITH DIAERESIS -345 229 E5 LATIN SMALL LETTER A WITH RING ABOVE -346 230 E6 LATIN SMALL LETTER AE -347 231 E7 LATIN SMALL LETTER C WITH CEDILLA -350 232 E8 LATIN SMALL LETTER E WITH GRAVE -351 233 E9 LATIN SMALL LETTER E WITH ACUTE -352 234 EA LATIN SMALL LETTER E WITH CIRCUMFLEX -353 235 EB LATIN SMALL LETTER E WITH DIAERESIS -354 236 EC LATIN SMALL LETTER I WITH GRAVE -355 237 ED LATIN SMALL LETTER I WITH ACUTE -356 238 EE LATIN SMALL LETTER I WITH CIRCUMFLEX -357 239 EF LATIN SMALL LETTER I WITH DIAERESIS -360 240 F0 LATIN SMALL LETTER ETH -361 241 F1 LATIN SMALL LETTER N WITH TILDE -362 242 F2 LATIN SMALL LETTER O WITH GRAVE -363 243 F3 LATIN SMALL LETTER O WITH ACUTE -364 244 F4 LATIN SMALL LETTER O WITH CIRCUMFLEX -365 245 F5 LATIN SMALL LETTER O WITH TILDE -366 246 F6 LATIN SMALL LETTER O WITH DIAERESIS +330 216 D8 Ø LATIN CAPITAL LETTER O WITH STROKE +331 217 D9 Ù LATIN CAPITAL LETTER U WITH GRAVE +332 218 DA Ú LATIN CAPITAL LETTER U WITH ACUTE +333 219 DB Û LATIN CAPITAL LETTER U WITH CIRCUMFLEX +334 220 DC Ü LATIN CAPITAL LETTER U WITH DIAERESIS +335 221 DD Ý LATIN CAPITAL LETTER Y WITH ACUTE +336 222 DE Þ LATIN CAPITAL LETTER THORN +337 223 DF ß LATIN SMALL LETTER SHARP S +340 224 E0 à LATIN SMALL LETTER A WITH GRAVE +341 225 E1 á LATIN SMALL LETTER A WITH ACUTE +342 226 E2 â LATIN SMALL LETTER A WITH CIRCUMFLEX +343 227 E3 ã LATIN SMALL LETTER A WITH TILDE +344 228 E4 ä LATIN SMALL LETTER A WITH DIAERESIS +345 229 E5 Ã¥ LATIN SMALL LETTER A WITH RING ABOVE +346 230 E6 æ LATIN SMALL LETTER AE +347 231 E7 ç LATIN SMALL LETTER C WITH CEDILLA +350 232 E8 è LATIN SMALL LETTER E WITH GRAVE +351 233 E9 é LATIN SMALL LETTER E WITH ACUTE +352 234 EA ê LATIN SMALL LETTER E WITH CIRCUMFLEX +353 235 EB ë LATIN SMALL LETTER E WITH DIAERESIS +354 236 EC ì LATIN SMALL LETTER I WITH GRAVE +355 237 ED í LATIN SMALL LETTER I WITH ACUTE +356 238 EE î LATIN SMALL LETTER I WITH CIRCUMFLEX +357 239 EF ï LATIN SMALL LETTER I WITH DIAERESIS +360 240 F0 ð LATIN SMALL LETTER ETH +361 241 F1 ñ LATIN SMALL LETTER N WITH TILDE +362 242 F2 ò LATIN SMALL LETTER O WITH GRAVE +363 243 F3 ó LATIN SMALL LETTER O WITH ACUTE +364 244 F4 ô LATIN SMALL LETTER O WITH CIRCUMFLEX +365 245 F5 õ LATIN SMALL LETTER O WITH TILDE +366 246 F6 ö LATIN SMALL LETTER O WITH DIAERESIS 367 247 F7 ÷ DIVISION SIGN -370 248 F8 LATIN SMALL LETTER O WITH STROKE -371 249 F9 LATIN SMALL LETTER U WITH GRAVE -372 250 FA LATIN SMALL LETTER U WITH ACUTE -373 251 FB LATIN SMALL LETTER U WITH CIRCUMFLEX -374 252 FC LATIN SMALL LETTER U WITH DIAERESIS -375 253 FD LATIN SMALL LETTER Y WITH ACUTE -376 254 FE LATIN SMALL LETTER THORN -377 255 FF LATIN SMALL LETTER Y WITH DIAERESIS +370 248 F8 ø LATIN SMALL LETTER O WITH STROKE +371 249 F9 ù LATIN SMALL LETTER U WITH GRAVE +372 250 FA ú LATIN SMALL LETTER U WITH ACUTE +373 251 FB û LATIN SMALL LETTER U WITH CIRCUMFLEX +374 252 FC ü LATIN SMALL LETTER U WITH DIAERESIS +375 253 FD ý LATIN SMALL LETTER Y WITH ACUTE +376 254 FE þ LATIN SMALL LETTER THORN +377 255 FF ÿ LATIN SMALL LETTER Y WITH DIAERESIS .TE -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR ascii (7), -.BR iso_8859-1 (7) +\fBascii\fP(7), \fBiso_8859\-1\fP(7) diff --git a/draft/man7/iso_8859-16.7 b/draft/man7/iso_8859-16.7 index c51a97f2..44d0a51f 100644 --- a/draft/man7/iso_8859-16.7 +++ b/draft/man7/iso_8859-16.7 @@ -1,5 +1,5 @@ -'\" t -.\" Copyright 2002 Ionel Mugurel Ciobica (IMCiobica@netscape.net) +.\" t -*- coding: UTF-8 -*- +.\" Copyright 2002 Ionel Mugurel Ciobîcă (IMCiobica@netscape.net) .\" .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as @@ -21,201 +21,156 @@ .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, .\" USA. .\" -.\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2003-09-10, Akihiro MOTOKI -.\" Modified 2007-05-04, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH ISO_8859-16 7 2003-03-05 "Linux" "Linux Programmer's Manual" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ISO_8859\-16 7 2003\-03\-05 Linux "Linux Programmer's Manual" .nh -.\"O .SH NAME .SH 名前 -.\"O iso_8859-16 \- ISO 8859-16 character set encoded in octal, decimal, -.\"O and hexadecimal -iso_8859-16 \- ISO 8859-16 文字集合の 8進数、10進数、16進数による符号化 -.\"O .SH DESCRIPTION +iso_8859\-16 \- ISO 8859\-16 文字集合の 8進数、10進数、16進数による符号化 .SH 説明 -.\"O The ISO 8859 standard includes several 8-bit extensions to the ASCII -.\"O character set (also known as ISO 646-IRV). -.\"O ISO 8859-16, the "Latin -.\"O Alphabet No. 10" is used to encode Central and Eastern European Latin -.\"O characters and is not implemented yet by any program vendors. -ISO 8859 規格は ASCII 文字集合 (ISO 646-IRV とも呼ばれる) の -いくつかの 8 ビット拡張を含んでいる。 ISO 8859-16、 -「ラテン・アルファベット No.10」は中央・東ヨーロッパのラテン文字を符号化 -するためのものだが、まだ実装しているプログラム・ベンダはない。 +ISO 8859 規格は ASCII 文字集合 (ISO 646\-IRV とも呼ばれる) の +いくつかの 8 ビット拡張を含んでいる。ISO 8859\-16、 + "ラテン・アルファベット No. 10" は中央ヨーロッパ、東ヨーロッパの +ラテン文字を符号化するために使用されるが、どのプログラム・ベンダーでも +まだ実装されていない。 .P -.\"O ISO 8859-16 supports the following languages: Albanian, Bosnian, -.\"O Croatian, English, Finnish, German, Hungarian, Irish, Polish, -.\"O Romanian, Slovenian and Serbian. -ISO 8859-16 は以下の言語をサポートしている: アルバニア語、ボスニア語、 -クロアチア語、英語、フィンランド語、ドイツ語、ハンガリー語、 -アイルランド語、ポーランド語、ルーマニア語、スロベニア語、セルビア語。 +ISO 8859\-16 は以下の言語をサポートしている: +アルバニア語、ボスニア語、クロアチア語、英語、フィンランド語、 +ドイツ語、ハンガリー語、アイルランド語、ポーランド語、ルーマニア語、 +スロベニア語、セルビア語。 .P -.\"O Also note that the following Cyrillic-based languages have one-to-one -.\"O transliterations to Latin 10: Macedonian and Serbian. -また、以下のキリル文字ベースの言語も Latin 10 に 1 対 1 で変換可能である: -マケドニア語、セルビア語。 -.\"O .SS "ISO 8859 Alphabets" +また、以下のキリル文字起源の言語も 1 対 1 で Latin 10 に置き換えること +ができる: マケドニア語、セルビア語。 .SS "ISO 8859 アルファベット" -.\"O The full set of ISO 8859 alphabets includes: 完全な ISO 8859 アルファベットは以下のものを含んでいる: .TS l l. -.\"O ISO 8859-1 West European languages (Latin-1) -.\"O ISO 8859-2 Central and East European languages (Latin-2) -.\"O ISO 8859-3 Southeast European and miscellaneous languages (Latin-3) -.\"O ISO 8859-4 Scandinavian/Baltic languages (Latin-4) -.\"O ISO 8859-5 Latin/Cyrillic -.\"O ISO 8859-6 Latin/Arabic -.\"O ISO 8859-7 Latin/Greek -.\"O ISO 8859-8 Latin/Hebrew -.\"O ISO 8859-9 Latin-1 modification for Turkish (Latin-5) -.\"O ISO 8859-10 Lappish/Nordic/Eskimo languages (Latin-6) -.\"O ISO 8859-11 Latin/Thai -.\"O ISO 8859-13 Baltic Rim languages (Latin-7) -.\"O ISO 8859-14 Celtic (Latin-8) -.\"O ISO 8859-15 West European languages (Latin-9) -.\"O ISO 8859-16 Romanian (Latin-10) -ISO 8859-1 西ヨーロッパの言語 (Latin-1) -ISO 8859-2 中央・東ヨーロッパの言語 (Latin-2) -ISO 8859-3 東南ヨーロッパやその他の言語 (Latin-3) -ISO 8859-4 スカンジナビア/バルト語派の言語 (Latin-4) -ISO 8859-5 ラテン/キリル文字 -ISO 8859-6 ラテン/アラビア文字 -ISO 8859-7 ラテン/ギリシャ文字 -ISO 8859-8 ラテン/ヘブライ語 -ISO 8859-9 トルコ語用に修正を行なった Latin-1 (Latin-5) -ISO 8859-10 ラップ/ノルディック/エスキモーの言語 (Latin-6) -ISO 8859-11 ラテン/タイ語 -ISO 8859-13 バルト諸国の言語 (Latin-7) -ISO 8859-14 ケルト語 (Latin-8) -ISO 8859-15 西ヨーロッパの言語 (Latin-9) -ISO 8859-16 ルーマニア語 (Latin-10) +ISO 8859\-1 西ヨーロッパの言語 (Latin\-1) +ISO 8859\-2 中央および東ヨーロッパの言語 (Latin\-2) +ISO 8859\-3 東南ヨーロッパやその他の言語 (Latin\-3) +ISO 8859\-4 スカンジナビア/バルト語派の言語 (Latin\-4) +ISO 8859\-5 ラテン/キリル文字 +ISO 8859\-6 ラテン/アラビア語 +ISO 8859\-7 ラテン/ギリシャ語 +ISO 8859\-8 ラテン/ヘブライ語 +ISO 8859\-9 トルコ語修正を行なった Latin\-1 (Latin\-5) +ISO 8859\-10 ラップ/ノルディック/エスキモーの言語 (Latin\-6) +ISO 8859\-11 ラテン/タイ語 +ISO 8859\-13 バルト諸国の言語 (Latin\-7) +ISO 8859\-14 ケルト語 (Latin\-8) +ISO 8859\-15 西ヨーロッパの言語 (Latin\-9) +ISO 8859\-16 ルーマニア語 (Latin\-10) .TE -.\"O .SS "ISO 8859-16 Characters" -.SS "ISO 8859-16 文字" -.\"O The following table displays the characters in ISO 8859-16 (Latin-10), -.\"O which are printable and unlisted in the -.\"O .BR ascii (7) -.\"O manual page. -.\"O The fourth column will only show the proper glyphs -.\"O in an environment configured for ISO 8859-16. -以下の表は ISO 8859-16 (Latin-10) の表示可能な文字のうち -.BR ascii (7) -マニュアル・ページに載っていないものを示している。 -4列目は ISO 8859-16 用に設定された環境でのみ正しく表示できるだろう。 +.SS "ISO 8859\-16 文字" +以下の表は ISO 8859\-16 (Latin\-10) の表示可能な文字のうち +\fBascii\fP(7) マニュアルページに載っていないものを示している。 +4列目は ISO 8859\-16 用に設定された環境でのみ正しく表示できるだろう。 .TS l l l c lp-1. Oct Dec Hex Char Description _ -240 160 A0 NO-BREAK SPACE -241 161 A1 LATIN CAPITAL LETTER A WITH OGONEK -242 162 A2 ¢ LATIN SMALL LETTER A WITH OGONEK -243 163 A3 £ LATIN CAPITAL LETTER L WITH STROKE -244 164 A4 EURO SIGN -245 165 A5 Â¥ DOUBLE LOW-9 QUOTATION MARK -246 166 A6 LATIN CAPITAL LETTER S WITH CARON +240 160 A0 \ NO\-BREAK SPACE +241 161 A1 Ą LATIN CAPITAL LETTER A WITH OGONEK +242 162 A2 ą LATIN SMALL LETTER A WITH OGONEK +243 163 A3 Ł LATIN CAPITAL LETTER L WITH STROKE +244 164 A4 € EURO SIGN +245 165 A5 „ DOUBLE LOW\-9 QUOTATION MARK +246 166 A6 Å  LATIN CAPITAL LETTER S WITH CARON 247 167 A7 § SECTION SIGN -250 168 A8 LATIN SMALL LETTER S WITH CARON -251 169 A9 COPYRIGHT SIGN -252 170 AA LATIN CAPITAL LETTER S WITH COMMA BELOW -253 171 AB 《 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK -254 172 AC ¬ LATIN CAPITAL LETTER Z WITH ACUTE -255 173 AD SOFT HYPHEN -256 174 AE LATIN SMALL LETTER Z WITH ACUTE -257 175 AF LATIN CAPITAL LETTER Z WITH DOT ABOVE +250 168 A8 Å¡ LATIN SMALL LETTER S WITH CARON +251 169 A9 © COPYRIGHT SIGN +252 170 AA Ș LATIN CAPITAL LETTER S WITH COMMA BELOW +253 171 AB « LEFT\-POINTING DOUBLE ANGLE QUOTATION MARK +254 172 AC Ź LATIN CAPITAL LETTER Z WITH ACUTE +255 173 AD ­ SOFT HYPHEN +256 174 AE ź LATIN SMALL LETTER Z WITH ACUTE +257 175 AF Å» LATIN CAPITAL LETTER Z WITH DOT ABOVE 260 176 B0 ° DEGREE SIGN -261 177 B1 ± PLUS-MINUS SIGN -262 178 B2 LATIN CAPITAL LETTER C WITH CARON -263 179 B3 LATIN SMALL LETTER L WITH STROKE -264 180 B4 LATIN CAPITAL LETTER Z WITH CARON -265 181 B5 μ LEFT DOUBLE QUOTATION MARK +261 177 B1 ± PLUS\-MINUS SIGN +262 178 B2 Č LATIN CAPITAL LETTER C WITH CARON +263 179 B3 ł LATIN SMALL LETTER L WITH STROKE +264 180 B4 Ž LATIN CAPITAL LETTER Z WITH CARON +265 181 B5 ” LEFT DOUBLE QUOTATION MARK 266 182 B6 ¶ PILCROW SIGN -267 183 B7 ・ MIDDLE DOT -270 184 B8 LATIN SMALL LETTER Z WITH CARON -271 185 B9 LATIN SMALL LETTER C WITH CARON -272 186 BA LATIN SMALL LETTER S WITH COMMA BELOW -273 187 BB 》 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -274 188 BC LATIN CAPITAL LIGATURE OE -275 189 BD LATIN SMALL LIGATURE OE -276 190 BE LATIN CAPITAL LETTER Y WITH DIAERESIS -277 191 BF LATIN SMALL LETTER Z WITH DOT ABOVE -300 192 C0 LATIN CAPITAL LETTER A WITH GRAVE -301 193 C1 LATIN CAPITAL LETTER A WITH ACUTE -302 194 C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX -303 195 C3 LATIN CAPITAL LETTER A WITH BREVE -304 196 C4 LATIN CAPITAL LETTER A WITH DIAERESIS -305 197 C5 LATIN CAPITAL LETTER C WITH ACUTE -306 198 C6 LATIN CAPITAL LETTER AE -307 199 C7 LATIN CAPITAL LETTER C WITH CEDILLA -310 200 C8 LATIN CAPITAL LETTER E WITH GRAVE -311 201 C9 LATIN CAPITAL LETTER E WITH ACUTE -312 202 CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX -313 203 CB LATIN CAPITAL LETTER E WITH DIAERESIS -314 204 CC LATIN CAPITAL LETTER I WITH GRAVE -315 205 CD LATIN CAPITAL LETTER I WITH ACUTE -316 206 CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX -317 207 CF LATIN CAPITAL LETTER I WITH DIAERESIS -320 208 D0 LATIN CAPITAL LETTER D WITH STROKE -321 209 D1 LATIN CAPITAL LETTER N WITH ACUTE -322 210 D2 LATIN CAPITAL LETTER O WITH GRAVE -323 211 D3 LATIN CAPITAL LETTER O WITH ACUTE -324 212 D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX -325 213 D5 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE -326 214 D6 LATIN CAPITAL LETTER O WITH DIAERESIS -327 215 D7 × LATIN CAPITAL LETTER S WITH ACUTE -330 216 D8 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE -331 217 D9 LATIN CAPITAL LETTER U WITH GRAVE -332 218 DA LATIN CAPITAL LETTER U WITH ACUTE -333 219 DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX -334 220 DC LATIN CAPITAL LETTER U WITH DIAERESIS -335 221 DD LATIN CAPITAL LETTER E WITH OGONEK -336 222 DE LATIN CAPITAL LETTER T WITH COMMA BELOW -337 223 DF LATIN SMALL LETTER SHARP S -340 224 E0 LATIN SMALL LETTER A WITH GRAVE -341 225 E1 LATIN SMALL LETTER A WITH ACUTE -342 226 E2 LATIN SMALL LETTER A WITH CIRCUMFLEX -343 227 E3 LATIN SMALL LETTER A WITH BREVE -344 228 E4 LATIN SMALL LETTER A WITH DIAERESIS -345 229 E5 LATIN SMALL LETTER C WITH ACUTE -346 230 E6 LATIN SMALL LETTER AE -347 231 E7 LATIN SMALL LETTER C WITH CEDILLA -350 232 E8 LATIN SMALL LETTER E WITH GRAVE -351 233 E9 LATIN SMALL LETTER E WITH ACUTE -352 234 EA LATIN SMALL LETTER E WITH CIRCUMFLEX -353 235 EB LATIN SMALL LETTER E WITH DIAERESIS -354 236 EC LATIN SMALL LETTER I WITH GRAVE -355 237 ED LATIN SMALL LETTER I WITH ACUTE -356 238 EE LATIN SMALL LETTER I WITH CIRCUMFLEX -357 239 EF LATIN SMALL LETTER I WITH DIAERESIS -360 240 F0 LATIN SMALL LETTER D WITH STROKE -361 241 F1 LATIN SMALL LETTER N WITH ACUTE -362 242 F2 LATIN SMALL LETTER O WITH GRAVE -363 243 F3 LATIN SMALL LETTER O WITH ACUTE -364 244 F4 LATIN SMALL LETTER O WITH CIRCUMFLEX -365 245 F5 LATIN SMALL LETTER O WITH DOUBLE ACUTE -366 246 F6 LATIN SMALL LETTER O WITH DIAERESIS -367 247 F7 ÷ LATIN SMALL LETTER S WITH ACUTE -370 248 F8 LATIN SMALL LETTER U WITH DOUBLE ACUTE -371 249 F9 LATIN SMALL LETTER U WITH GRAVE -372 250 FA LATIN SMALL LETTER U WITH ACUTE -373 251 FB LATIN SMALL LETTER U WITH CIRCUMFLEX -374 252 FC LATIN SMALL LETTER U WITH DIAERESIS -375 253 FD LATIN SMALL LETTER E WITH OGONEK -376 254 FE LATIN SMALL LETTER T WITH COMMA BELOW -377 255 FF LATIN SMALL LETTER Y WITH DIAERESIS +267 183 B7 · MIDDLE DOT +270 184 B8 ž LATIN SMALL LETTER Z WITH CARON +271 185 B9 č LATIN SMALL LETTER C WITH CARON +272 186 BA ș LATIN SMALL LETTER S WITH COMMA BELOW +273 187 BB » RIGHT\-POINTING DOUBLE ANGLE QUOTATION MARK +274 188 BC Œ LATIN CAPITAL LIGATURE OE +275 189 BD œ LATIN SMALL LIGATURE OE +276 190 BE Ÿ LATIN CAPITAL LETTER Y WITH DIAERESIS +277 191 BF ż LATIN SMALL LETTER Z WITH DOT ABOVE +300 192 C0 À LATIN CAPITAL LETTER A WITH GRAVE +301 193 C1 Á LATIN CAPITAL LETTER A WITH ACUTE +302 194 C2  LATIN CAPITAL LETTER A WITH CIRCUMFLEX +303 195 C3 Ă LATIN CAPITAL LETTER A WITH BREVE +304 196 C4 Ä LATIN CAPITAL LETTER A WITH DIAERESIS +305 197 C5 Ć LATIN CAPITAL LETTER C WITH ACUTE +306 198 C6 Æ LATIN CAPITAL LETTER AE +307 199 C7 Ç LATIN CAPITAL LETTER C WITH CEDILLA +310 200 C8 È LATIN CAPITAL LETTER E WITH GRAVE +311 201 C9 É LATIN CAPITAL LETTER E WITH ACUTE +312 202 CA Ê LATIN CAPITAL LETTER E WITH CIRCUMFLEX +313 203 CB Ë LATIN CAPITAL LETTER E WITH DIAERESIS +314 204 CC Ì LATIN CAPITAL LETTER I WITH GRAVE +315 205 CD Í LATIN CAPITAL LETTER I WITH ACUTE +316 206 CE Î LATIN CAPITAL LETTER I WITH CIRCUMFLEX +317 207 CF Ï LATIN CAPITAL LETTER I WITH DIAERESIS +320 208 D0 Đ LATIN CAPITAL LETTER D WITH STROKE +321 209 D1 Ń LATIN CAPITAL LETTER N WITH ACUTE +322 210 D2 Ò LATIN CAPITAL LETTER O WITH GRAVE +323 211 D3 Ó LATIN CAPITAL LETTER O WITH ACUTE +324 212 D4 Ô LATIN CAPITAL LETTER O WITH CIRCUMFLEX +325 213 D5 Ő LATIN CAPITAL LETTER O WITH DOUBLE ACUTE +326 214 D6 Ö LATIN CAPITAL LETTER O WITH DIAERESIS +327 215 D7 Ś LATIN CAPITAL LETTER S WITH ACUTE +330 216 D8 Å° LATIN CAPITAL LETTER U WITH DOUBLE ACUTE +331 217 D9 Ù LATIN CAPITAL LETTER U WITH GRAVE +332 218 DA Ú LATIN CAPITAL LETTER U WITH ACUTE +333 219 DB Û LATIN CAPITAL LETTER U WITH CIRCUMFLEX +334 220 DC Ü LATIN CAPITAL LETTER U WITH DIAERESIS +335 221 DD Ę LATIN CAPITAL LETTER E WITH OGONEK +336 222 DE Ț LATIN CAPITAL LETTER T WITH COMMA BELOW +337 223 DF ß LATIN SMALL LETTER SHARP S +340 224 E0 à LATIN SMALL LETTER A WITH GRAVE +341 225 E1 á LATIN SMALL LETTER A WITH ACUTE +342 226 E2 â LATIN SMALL LETTER A WITH CIRCUMFLEX +343 227 E3 ă LATIN SMALL LETTER A WITH BREVE +344 228 E4 ä LATIN SMALL LETTER A WITH DIAERESIS +345 229 E5 ć LATIN SMALL LETTER C WITH ACUTE +346 230 E6 æ LATIN SMALL LETTER AE +347 231 E7 ç LATIN SMALL LETTER C WITH CEDILLA +350 232 E8 è LATIN SMALL LETTER E WITH GRAVE +351 233 E9 é LATIN SMALL LETTER E WITH ACUTE +352 234 EA ê LATIN SMALL LETTER E WITH CIRCUMFLEX +353 235 EB ë LATIN SMALL LETTER E WITH DIAERESIS +354 236 EC ì LATIN SMALL LETTER I WITH GRAVE +355 237 ED í LATIN SMALL LETTER I WITH ACUTE +356 238 EE î LATIN SMALL LETTER I WITH CIRCUMFLEX +357 239 EF ï LATIN SMALL LETTER I WITH DIAERESIS +360 240 F0 đ LATIN SMALL LETTER D WITH STROKE +361 241 F1 ń LATIN SMALL LETTER N WITH ACUTE +362 242 F2 ò LATIN SMALL LETTER O WITH GRAVE +363 243 F3 ó LATIN SMALL LETTER O WITH ACUTE +364 244 F4 ô LATIN SMALL LETTER O WITH CIRCUMFLEX +365 245 F5 ő LATIN SMALL LETTER O WITH DOUBLE ACUTE +366 246 F6 ö LATIN SMALL LETTER O WITH DIAERESIS +367 247 F7 ś LATIN SMALL LETTER S WITH ACUTE +370 248 F8 ű LATIN SMALL LETTER U WITH DOUBLE ACUTE +371 249 F9 ù LATIN SMALL LETTER U WITH GRAVE +372 250 FA ú LATIN SMALL LETTER U WITH ACUTE +373 251 FB û LATIN SMALL LETTER U WITH CIRCUMFLEX +374 252 FC ü LATIN SMALL LETTER U WITH DIAERESIS +375 253 FD ę LATIN SMALL LETTER E WITH OGONEK +376 254 FE ț LATIN SMALL LETTER T WITH COMMA BELOW +377 255 FF ÿ LATIN SMALL LETTER Y WITH DIAERESIS .TE -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR ascii (7), -.BR iso_8859-1 (7), -.BR iso_8859-15 (7), -.BR iso_8859-2 (7) +\fBascii\fP(7), \fBiso_8859\-1\fP(7), \fBiso_8859\-15\fP(7), \fBiso_8859\-2\fP(7) .P -.\"O Additional information: -.\"O .I ISO 8859-16 (Latin 10) Resources -.\"O (http://bucovina.chem.tue.nl/fonturi/index-en.html). -補足情報: -.I ISO 8859-16 (Latin 10) Resources -(http://bucovina.chem.tue.nl/fonturi/index-en.html) +追加情報: \fIISO 8859\-16 (Latin 10) Resources\fP +(http://bucovina.chem.tue.nl/fonturi/index\-en.html). diff --git a/draft/man7/iso_8859-2.7 b/draft/man7/iso_8859-2.7 index d16ddd6d..1a607b16 100644 --- a/draft/man7/iso_8859-2.7 +++ b/draft/man7/iso_8859-2.7 @@ -1,4 +1,4 @@ -'\" t +.\" t -*- coding: UTF-8 -*- .\" Copyright 1999 Roman Maurer (roman.maurer@hermes.si) .\" Copyright 1993-1995 Daniel Quinlan (quinlan@yggdrasil.com) .\" @@ -24,207 +24,155 @@ .\" .\" Slightly rearranged, aeb, 950713 .\" Updated, dpo, 990531 +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Thu Jan 6 01:45:18 JST 2000 -.\" by HANATAKA Shinya -.\" Updated Tue Sep 9 JST 2003 by Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.TH ISO_8859-2 7 2007-11-25 "Linux" "Linux Programmer's Manual" +.\"******************************************************************* +.TH ISO_8859\-2 7 2007\-11\-25 Linux "Linux Programmer's Manual" .nh -.\"O .SH NAME .SH 名前 -.\"O iso_8859-2 \- ISO 8859-2 character set encoded in octal, decimal, -.\"O and hexadecimal -iso_8859-2 \- ISO 8859-2 文字集合の 8進数、10進数、16進数による符号化 -.\"O .SH DESCRIPTION -.SH 書式 -.\"O The ISO 8859 standard includes several 8-bit extensions to the ASCII -.\"O character set (also known as ISO 646-IRV). -.\"O ISO 8859-2, the "Latin -.\"O Alphabet No. 2" is used to encode Central and Eastern European Latin -.\"O characters and is implemented by several program vendors. -ISO 8859 規格は ASCII 文字集合 (ISO 646-IRV とも呼ばれる) の -いくつかの 8 ビット拡張を含んでいる。ISO 8859-2、 +iso_8859\-2 \- ISO 8859\-2 文字集合の 8進数、10進数、16進数による符号化 +.SH 説明 +ISO 8859 規格は ASCII 文字集合 (ISO 646\-IRV とも呼ばれる) の +いくつかの 8 ビット拡張を含んでいる。ISO 8859\-2、 "ラテン・アルファベット No. 2" は中央ヨーロッパ、東ヨーロッパの -ラテン文字を符号化するために使用され、いくつかのプログラム・ベンダーも +ラテン文字を符号化するために使用され、いくつかのプログラム・ベンダーが 実装している。 .P -.\"O ISO 8859-2 supports the following languages: Albanian, Bosnian, -.\"O Croatian, Czech, English, Finnish, German, Hungarian, Irish, Polish, -.\"O Slovak, Slovenian and Sorbian. -ISO 8859-2 は以下の言語をサポートしている: アルバニア語、ボスニア語、 +ISO 8859\-2 は以下の言語をサポートしている: アルバニア語、ボスニア語、 クロアチア語、チェコ語、英語、フィンランド語、ドイツ語、ハンガリー語、 アイルランド語、ポーランド語、スロヴァキア語、スロヴェニア語、ソルビア語。 .P -.\"O Also note that the following Cyrillic-based languages have one-to-one -.\"O transliterations to Latin 2: Macedonian and Serbian. -また以下のキリル文字ベースの言語も 1 対 1 で Latin 2 に置き換えること -ができる: マケドニア語、セルビア語 -.\"O .SS "ISO 8859 Alphabets" +また、以下のキリル文字起源の言語も 1 対 1 で Latin 2 に置き換えること +ができる: マケドニア語、セルビア語。 .SS "ISO 8859 アルファベット" -.\"O The full set of ISO 8859 alphabets includes: 完全な ISO 8859 アルファベットは以下のものを含んでいる: .TS l l. -.\"O ISO 8859-1 West European languages (Latin-1) -.\"O ISO 8859-2 Central and East European languages (Latin-2) -.\"O ISO 8859-3 Southeast European and miscellaneous languages (Latin-3) -.\"O ISO 8859-4 Scandinavian/Baltic languages (Latin-4) -.\"O ISO 8859-5 Latin/Cyrillic -.\"O ISO 8859-6 Latin/Arabic -.\"O ISO 8859-7 Latin/Greek -.\"O ISO 8859-8 Latin/Hebrew -.\"O ISO 8859-9 Latin-1 modification for Turkish (Latin-5) -.\"O ISO 8859-10 Lappish/Nordic/Eskimo languages (Latin-6) -.\"O ISO 8859-11 Latin/Thai -.\"O ISO 8859-13 Baltic Rim languages (Latin-7) -.\"O ISO 8859-14 Celtic (Latin-8) -.\"O ISO 8859-15 West European languages (Latin-9) -.\"O ISO 8859-16 Romanian (Latin-10) -ISO 8859-1 西ヨーロッパの言語 (Latin-1) -ISO 8859-2 中央および東ヨーロッパの言語 (Latin-2) -ISO 8859-3 東南ヨーロッパやその他の言語 (Latin-3) -ISO 8859-4 スカンジナビア/バルト語派の言語 (Latin-4) -ISO 8859-5 ラテン/キリル文字 -ISO 8859-6 ラテン/アラビア文字 -ISO 8859-7 ラテン/ギリシャ文字 -ISO 8859-8 ラテン/ヘブライ語 -ISO 8859-9 トルコ語修正を行なった Latin-1 (Latin-5) -ISO 8859-10 ラップ/ノルディック/エスキモーの言語 (Latin-6) -ISO 8859-11 ラテン/タイ語 -ISO 8859-13 バルト諸国の言語 (Latin-7) -ISO 8859-14 ケルト語 (Latin-8) -ISO 8859-15 西ヨーロッパの言語 (Latin-9) -ISO 8859-16 ルーマニア語 (Latin-10) +ISO 8859\-1 西ヨーロッパの言語 (Latin\-1) +ISO 8859\-2 中央および東ヨーロッパの言語 (Latin\-2) +ISO 8859\-3 東南ヨーロッパやその他の言語 (Latin\-3) +ISO 8859\-4 スカンジナビア/バルト語派の言語 (Latin\-4) +ISO 8859\-5 ラテン/キリル文字 +ISO 8859\-6 ラテン/アラビア語 +ISO 8859\-7 ラテン/ギリシャ語 +ISO 8859\-8 ラテン/ヘブライ語 +ISO 8859\-9 トルコ語修正を行なった Latin\-1 (Latin\-5) +ISO 8859\-10 ラップ/ノルディック/エスキモーの言語 (Latin\-6) +ISO 8859\-11 ラテン/タイ語 +ISO 8859\-13 バルト諸国の言語 (Latin\-7) +ISO 8859\-14 ケルト語 (Latin\-8) +ISO 8859\-15 西ヨーロッパの言語 (Latin\-9) +ISO 8859\-16 ルーマニア語 (Latin\-10) .TE -.\"O .SS "ISO 8859-2 Characters" -.SS "ISO 8859-2 文字" -.\"O The following table displays the characters in ISO 8859-2 (Latin-2), -.\"O which are printable and unlisted in the -.\"O .BR ascii (7) -.\"O manual page. -.\"O The fourth column will only show the proper glyphs -.\"O in an environment configured for ISO 8859-2. -以下の表は ISO 8859-2 (Latin-2) の表示可能な文字のうち -.BR ascii (7) -マニュアル・ページに載っていないものを示している。 -4列目は ISO 8859-2 用に設定された環境でのみ正しく表示できるだろう。 - -[ 訳注 原文では Char の部分に ISO 8859-2 の文字があったが、 -日本語 EUC との併用は難しいので削除し、JIS X 0208 の同じ文字を示すよう -にした。その他の文字に関しては英語版の iso_8859-2(7) を -適切なフォントを準備して参照。 ] +.SS "ISO 8859\-2 文字" +以下の表は ISO 8859\-2 (Latin\-2) の表示可能な文字のうち +\fBascii\fP(7) マニュアルページに載っていないものを示している。 +4列目は ISO 8859\-2 用に設定された環境でのみ正しく表示できるだろう。 .TS l l l c lp-1. Oct Dec Hex Char Description _ -240 160 A0 NO-BREAK SPACE -241 161 A1 LATIN CAPITAL LETTER A WITH OGONEK -242 162 A2 BREVE -243 163 A3 LATIN CAPITAL LETTER L WITH STROKE -244 164 A4 CURRENCY SIGN -245 165 A5 LATIN CAPITAL LETTER L WITH CARON -246 166 A6 LATIN CAPITAL LETTER S WITH ACUTE +240 160 A0 \ NO\-BREAK SPACE +241 161 A1 Ą LATIN CAPITAL LETTER A WITH OGONEK +242 162 A2 ˘ BREVE +243 163 A3 Ł LATIN CAPITAL LETTER L WITH STROKE +244 164 A4 ¤ CURRENCY SIGN +245 165 A5 Ľ LATIN CAPITAL LETTER L WITH CARON +246 166 A6 Ś LATIN CAPITAL LETTER S WITH ACUTE 247 167 A7 § SECTION SIGN 250 168 A8 ¨ DIAERESIS -251 169 A9 LATIN CAPITAL LETTER S WITH CARON -252 170 AA LATIN CAPITAL LETTER S WITH CEDILLA -253 171 AB LATIN CAPITAL LETTER T WITH CARON -254 172 AC LATIN CAPITAL LETTER Z WITH ACUTE -255 173 AD SOFT HYPHEN -256 174 AE LATIN CAPITAL LETTER Z WITH CARON -257 175 AF LATIN CAPITAL LETTER Z WITH DOT ABOVE +251 169 A9 Å  LATIN CAPITAL LETTER S WITH CARON +252 170 AA Ş LATIN CAPITAL LETTER S WITH CEDILLA +253 171 AB Ť LATIN CAPITAL LETTER T WITH CARON +254 172 AC Ź LATIN CAPITAL LETTER Z WITH ACUTE +255 173 AD ­\[shc] SOFT HYPHEN +256 174 AE Ž LATIN CAPITAL LETTER Z WITH CARON +257 175 AF Å» LATIN CAPITAL LETTER Z WITH DOT ABOVE 260 176 B0 ° DEGREE SIGN -261 177 B1 LATIN SMALL LETTER A WITH OGONEK -262 178 B2 OGONEK -263 179 B3 LATIN SMALL LETTER L WITH STROKE +261 177 B1 ą LATIN SMALL LETTER A WITH OGONEK +262 178 B2 ˛ OGONEK +263 179 B3 ł LATIN SMALL LETTER L WITH STROKE 264 180 B4 ´ ACUTE ACCENT -265 181 B5 LATIN SMALL LETTER L WITH CARON -266 182 B6 LATIN SMALL LETTER S WITH ACUTE -267 183 B7 CARON -270 184 B8 CEDILLA -271 185 B9 LATIN SMALL LETTER S WITH CARON -272 186 BA LATIN SMALL LETTER S WITH CEDILLA -273 187 BB LATIN SMALL LETTER T WITH CARON -274 188 BC LATIN SMALL LETTER Z WITH ACUTE -275 189 BD DOUBLE ACUTE ACCENT -276 190 BE LATIN SMALL LETTER Z WITH CARON -277 191 BF LATIN SMALL LETTER Z WITH DOT ABOVE -300 192 C0 LATIN CAPITAL LETTER R WITH ACUTE -301 193 C1 LATIN CAPITAL LETTER A WITH ACUTE -302 194 C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX -303 195 C3 LATIN CAPITAL LETTER A WITH BREVE -304 196 C4 LATIN CAPITAL LETTER A WITH DIAERESIS -305 197 C5 LATIN CAPITAL LETTER L WITH ACUTE -306 198 C6 LATIN CAPITAL LETTER C WITH ACUTE -307 199 C7 LATIN CAPITAL LETTER C WITH CEDILLA -310 200 C8 LATIN CAPITAL LETTER C WITH CARON -311 201 C9 LATIN CAPITAL LETTER E WITH ACUTE -312 202 CA LATIN CAPITAL LETTER E WITH OGONEK -313 203 CB LATIN CAPITAL LETTER E WITH DIAERESIS -314 204 CC LATIN CAPITAL LETTER E WITH CARON -315 205 CD LATIN CAPITAL LETTER I WITH ACUTE -316 206 CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX -317 207 CF LATIN CAPITAL LETTER D WITH CARON -320 208 D0 LATIN CAPITAL LETTER D WITH STROKE -321 209 D1 LATIN CAPITAL LETTER N WITH ACUTE -322 210 D2 LATIN CAPITAL LETTER N WITH CARON -323 211 D3 LATIN CAPITAL LETTER O WITH ACUTE -324 212 D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX -325 213 D5 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE -326 214 D6 LATIN CAPITAL LETTER O WITH DIAERESIS +265 181 B5 ľ LATIN SMALL LETTER L WITH CARON +266 182 B6 ś LATIN SMALL LETTER S WITH ACUTE +267 183 B7 ˇ CARON +270 184 B8 ¸ CEDILLA +271 185 B9 Å¡ LATIN SMALL LETTER S WITH CARON +272 186 BA ş LATIN SMALL LETTER S WITH CEDILLA +273 187 BB Å¥ LATIN SMALL LETTER T WITH CARON +274 188 BC ź LATIN SMALL LETTER Z WITH ACUTE +275 189 BD ˝ DOUBLE ACUTE ACCENT +276 190 BE ž LATIN SMALL LETTER Z WITH CARON +277 191 BF ż LATIN SMALL LETTER Z WITH DOT ABOVE +300 192 C0 Ŕ LATIN CAPITAL LETTER R WITH ACUTE +301 193 C1 Á LATIN CAPITAL LETTER A WITH ACUTE +302 194 C2  LATIN CAPITAL LETTER A WITH CIRCUMFLEX +303 195 C3 Ă LATIN CAPITAL LETTER A WITH BREVE +304 196 C4 Ä LATIN CAPITAL LETTER A WITH DIAERESIS +305 197 C5 Ĺ LATIN CAPITAL LETTER L WITH ACUTE +306 198 C6 Ć LATIN CAPITAL LETTER C WITH ACUTE +307 199 C7 Ç LATIN CAPITAL LETTER C WITH CEDILLA +310 200 C8 Č LATIN CAPITAL LETTER C WITH CARON +311 201 C9 É LATIN CAPITAL LETTER E WITH ACUTE +312 202 CA Ę LATIN CAPITAL LETTER E WITH OGONEK +313 203 CB Ë LATIN CAPITAL LETTER E WITH DIAERESIS +314 204 CC Ě LATIN CAPITAL LETTER E WITH CARON +315 205 CD Í LATIN CAPITAL LETTER I WITH ACUTE +316 206 CE Î LATIN CAPITAL LETTER I WITH CIRCUMFLEX +317 207 CF Ď LATIN CAPITAL LETTER D WITH CARON +320 208 D0 Đ LATIN CAPITAL LETTER D WITH STROKE +321 209 D1 Ń LATIN CAPITAL LETTER N WITH ACUTE +322 210 D2 Ň LATIN CAPITAL LETTER N WITH CARON +323 211 D3 Ó LATIN CAPITAL LETTER O WITH ACUTE +324 212 D4 Ô LATIN CAPITAL LETTER O WITH CIRCUMFLEX +325 213 D5 Ő LATIN CAPITAL LETTER O WITH DOUBLE ACUTE +326 214 D6 Ö LATIN CAPITAL LETTER O WITH DIAERESIS 327 215 D7 × MULTIPLICATION SIGN -330 216 D8 LATIN CAPITAL LETTER R WITH CARON -331 217 D9 LATIN CAPITAL LETTER U WITH RING ABOVE -332 218 DA LATIN CAPITAL LETTER U WITH ACUTE -333 219 DB LATIN CAPITAL LETTER U WITH DOUBLE ACUTE -334 220 DC LATIN CAPITAL LETTER U WITH DIAERESIS -335 221 DD LATIN CAPITAL LETTER Y WITH ACUTE -336 222 DE LATIN CAPITAL LETTER T WITH CEDILLA -337 223 DF LATIN SMALL LETTER SHARP S -340 224 E0 LATIN SMALL LETTER R WITH ACUTE -341 225 E1 LATIN SMALL LETTER A WITH ACUTE -342 226 E2 LATIN SMALL LETTER A WITH CIRCUMFLEX -343 227 E3 LATIN SMALL LETTER A WITH BREVE -344 228 E4 LATIN SMALL LETTER A WITH DIAERESIS -345 229 E5 LATIN SMALL LETTER L WITH ACUTE -346 230 E6 LATIN SMALL LETTER C WITH ACUTE -347 231 E7 LATIN SMALL LETTER C WITH CEDILLA -350 232 E8 LATIN SMALL LETTER C WITH CARON -351 233 E9 LATIN SMALL LETTER E WITH ACUTE -352 234 EA LATIN SMALL LETTER E WITH OGONEK -353 235 EB LATIN SMALL LETTER E WITH DIAERESIS -354 236 EC LATIN SMALL LETTER E WITH CARON -355 237 ED LATIN SMALL LETTER I WITH ACUTE -356 238 EE LATIN SMALL LETTER I WITH CIRCUMFLEX -357 239 EF LATIN SMALL LETTER D WITH CARON -360 240 F0 LATIN SMALL LETTER D WITH STROKE -361 241 F1 LATIN SMALL LETTER N WITH ACUTE -362 242 F2 LATIN SMALL LETTER N WITH CARON -363 243 F3 LATIN SMALL LETTER O WITH ACUTE -364 244 F4 LATIN SMALL LETTER O WITH CIRCUMFLEX -365 245 F5 LATIN SMALL LETTER O WITH DOUBLE ACUTE -366 246 F6 LATIN SMALL LETTER O WITH DIAERESIS +330 216 D8 Ř LATIN CAPITAL LETTER R WITH CARON +331 217 D9 Å® LATIN CAPITAL LETTER U WITH RING ABOVE +332 218 DA Ú LATIN CAPITAL LETTER U WITH ACUTE +333 219 DB Å° LATIN CAPITAL LETTER U WITH DOUBLE ACUTE +334 220 DC Ü LATIN CAPITAL LETTER U WITH DIAERESIS +335 221 DD Ý LATIN CAPITAL LETTER Y WITH ACUTE +336 222 DE Å¢ LATIN CAPITAL LETTER T WITH CEDILLA +337 223 DF ß LATIN SMALL LETTER SHARP S +340 224 E0 ŕ LATIN SMALL LETTER R WITH ACUTE +341 225 E1 á LATIN SMALL LETTER A WITH ACUTE +342 226 E2 â LATIN SMALL LETTER A WITH CIRCUMFLEX +343 227 E3 ă LATIN SMALL LETTER A WITH BREVE +344 228 E4 ä LATIN SMALL LETTER A WITH DIAERESIS +345 229 E5 ĺ LATIN SMALL LETTER L WITH ACUTE +346 230 E6 ć LATIN SMALL LETTER C WITH ACUTE +347 231 E7 ç LATIN SMALL LETTER C WITH CEDILLA +350 232 E8 č LATIN SMALL LETTER C WITH CARON +351 233 E9 é LATIN SMALL LETTER E WITH ACUTE +352 234 EA ę LATIN SMALL LETTER E WITH OGONEK +353 235 EB ë LATIN SMALL LETTER E WITH DIAERESIS +354 236 EC ě LATIN SMALL LETTER E WITH CARON +355 237 ED í LATIN SMALL LETTER I WITH ACUTE +356 238 EE î LATIN SMALL LETTER I WITH CIRCUMFLEX +357 239 EF ď LATIN SMALL LETTER D WITH CARON +360 240 F0 đ LATIN SMALL LETTER D WITH STROKE +361 241 F1 ń LATIN SMALL LETTER N WITH ACUTE +362 242 F2 ň LATIN SMALL LETTER N WITH CARON +363 243 F3 ó LATIN SMALL LETTER O WITH ACUTE +364 244 F4 ô LATIN SMALL LETTER O WITH CIRCUMFLEX +365 245 F5 ő LATIN SMALL LETTER O WITH DOUBLE ACUTE +366 246 F6 ö LATIN SMALL LETTER O WITH DIAERESIS 367 247 F7 ÷ DIVISION SIGN -370 248 F8 LATIN SMALL LETTER R WITH CARON -371 249 F9 LATIN SMALL LETTER U WITH RING ABOVE -372 250 FA LATIN SMALL LETTER U WITH ACUTE -373 251 FB LATIN SMALL LETTER U WITH DOUBLE ACUTE -374 252 FC LATIN SMALL LETTER U WITH DIAERESIS -375 253 FD LATIN SMALL LETTER Y WITH ACUTE -376 254 FE LATIN SMALL LETTER T WITH CEDILLA -377 255 FF DOT ABOVE +370 248 F8 ř LATIN SMALL LETTER R WITH CARON +371 249 F9 ů LATIN SMALL LETTER U WITH RING ABOVE +372 250 FA ú LATIN SMALL LETTER U WITH ACUTE +373 251 FB ű LATIN SMALL LETTER U WITH DOUBLE ACUTE +374 252 FC ü LATIN SMALL LETTER U WITH DIAERESIS +375 253 FD ý LATIN SMALL LETTER Y WITH ACUTE +376 254 FE Å£ LATIN SMALL LETTER T WITH CEDILLA +377 255 FF ˙ DOT ABOVE .TE -.\"O .SH SEE ALSO .SH 関連項目 -.BR ascii (7), -.BR iso_8859-1 (7) +\fBascii\fP(7), \fBiso_8859\-1\fP(7), \fBiso_8859\-16\fP(7) .P -.\"O Additional information: -.\"O .I ISO 8859-2 (Latin 2) Resources -.\"O (http://sizif.mf.uni-lj.si/linux/cee/iso8859-2.html). -追加情報: -.I ISO 8859-2 (Latin 2) 情報 -(http://sizif.mf.uni-lj.si/linux/cee/iso8859-2.html). +追加情報: \fIISO 8859\-2 (Latin 2) Resources\fP +(http://sizif.mf.uni\-lj.si/linux/cee/iso8859\-2.html). diff --git a/draft/man7/iso_8859-3.7 b/draft/man7/iso_8859-3.7 new file mode 100644 index 00000000..56ec317f --- /dev/null +++ b/draft/man7/iso_8859-3.7 @@ -0,0 +1,159 @@ +.\" t -*- coding: UTF-8 -*- +.\" Copyright 2009 Lefteris Dimitroulakis (edimitro@tee.gr) +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ISO_8859\-3 7 2010\-09\-20 Linux "Linux Programmer's Manual" +.nh +.SH 名前 +iso_8859\-3 \- ISO 8859\-3 文字集合の 8進数、10進数、16進数による符号化 +.SH 説明 +.\" (Though in my system with glibc-2.8-20080929 +.\" I found only mt_MT (Malta) using this charset). +ISO 8859 規格は ASCII 文字集合 (ISO 6460IRV としても知られている) の +いくつかの 8 ビット拡張を含んでいる。 +ISO 8859\-3 は東南ヨーロッパの言語で使用される文字の符号化を規定している。 +.SS "ISO 8859 アルファベット" +完全な ISO 8859 アルファベットは以下のものを含んでいる: +.TS +l l. +ISO 8859\-1 西ヨーロッパの言語 (Latin\-1) +ISO 8859\-2 中央および東ヨーロッパの言語 (Latin\-2) +ISO 8859\-3 東南ヨーロッパやその他の言語 (Latin\-3) +ISO 8859\-4 スカンジナビア/バルト語派の言語 (Latin\-4) +ISO 8859\-5 ラテン/キリル文字 +ISO 8859\-6 ラテン/アラビア語 +ISO 8859\-7 ラテン/ギリシャ語 +ISO 8859\-8 ラテン/ヘブライ語 +ISO 8859\-9 トルコ語修正を行なった Latin\-1 (Latin\-5) +ISO 8859\-10 ラップ/ノルディック/エスキモーの言語 (Latin\-6) +ISO 8859\-11 ラテン/タイ語 +ISO 8859\-13 バルト諸国の言語 (Latin\-7) +ISO 8859\-14 ケルト語 (Latin\-8) +ISO 8859\-15 西ヨーロッパの言語 (Latin\-9) +ISO 8859\-16 ルーマニア語 (Latin\-10) +.TE +.SS "ISO 8859\-3 文字" +以下の表は ISO 8859\-3 の表示可能な文字のうち +\fBascii\fP(7) マニュアルページに載っていないものを示している。 +4列目は ISO 8859\-3 用に設定された環境でのみ正しく表示できるだろう。 +.TS +l l l c lp-1. +Oct Dec Hex Char Description +_ +240 160 A0 \ NO\-BREAK SPACE +241 161 A1 Ħ LATIN CAPITAL LETTER H WITH STROKE +242 162 A2 ˘ BREVE +243 163 A3 £ POUND SIGN +244 164 A4 ¤ CURRENCY SIGN +246 166 A6 Ĥ LATIN CAPITAL LETTER H WITH CIRCUMFLEX +247 167 A7 § SECTION SIGN +250 168 A8 ¨ DIAERESIS +251 169 A9 Ä° LATIN CAPITAL LETTER I WITH DOT ABOVE +252 170 AA Ş LATIN CAPITAL LETTER S WITH CEDILLA +253 171 AB Ğ LATIN CAPITAL LETTER G WITH BREVE +254 172 AC Ä´ LATIN CAPITAL LETTER J WITH CIRCUMFLEX +255 173 AD ­ SOFT HYPHEN +257 175 AF Å» LATIN CAPITAL LETTER Z WITH DOT ABOVE +260 176 B0 ° DEGREE SIGN +261 177 B1 ħ LATIN SMALL LETTER H WITH STROKE +262 178 B2 ² SUPERSCRIPT TWO +263 179 B3 ³ SUPERSCRIPT THREE +264 180 B4 ´ ACUTE ACCENT +265 181 B5 µ MICRO SIGN +266 182 B6 Ä¥ LATIN SMALL LETTER H WITH CIRCUMFLEX +267 183 B7 · MIDDLE DOT +270 184 B8 ¸ CEDILLA +271 185 B9 ı LATIN SMALL LETTER DOTLESS I +272 186 BA ş LATIN SMALL LETTER S WITH CEDILLA +273 187 BB ğ LATIN SMALL LETTER G WITH BREVE +274 188 BC ĵ LATIN SMALL LETTER J WITH CIRCUMFLEX +275 189 BD ½ VULGAR FRACTION ONE HALF +277 191 BF ż LATIN SMALL LETTER Z WITH DOT ABOVE +300 192 C0 À LATIN CAPITAL LETTER A WITH GRAVE +301 193 C1 Á LATIN CAPITAL LETTER A WITH ACUTE +302 194 C2  LATIN CAPITAL LETTER A WITH CIRCUMFLEX +304 196 C4 Ä LATIN CAPITAL LETTER A WITH DIAERESIS +305 197 C5 Ċ LATIN CAPITAL LETTER C WITH DOT ABOVE +306 198 C6 Ĉ LATIN CAPITAL LETTER C WITH CIRCUMFLEX +307 199 C7 Ç LATIN CAPITAL LETTER C WITH CEDILLA +310 200 C8 È LATIN CAPITAL LETTER E WITH GRAVE +311 201 C9 É LATIN CAPITAL LETTER E WITH ACUTE +312 202 CA Ê LATIN CAPITAL LETTER E WITH CIRCUMFLEX +313 203 CB Ë LATIN CAPITAL LETTER E WITH DIAERESIS +314 204 CC Ì LATIN CAPITAL LETTER I WITH GRAVE +315 205 CD Í LATIN CAPITAL LETTER I WITH ACUTE +316 206 CE Î LATIN CAPITAL LETTER I WITH CIRCUMFLEX +317 207 CF Ï LATIN CAPITAL LETTER I WITH DIAERESIS +321 209 D1 Ñ LATIN CAPITAL LETTER N WITH TILDE +322 210 D2 Ò LATIN CAPITAL LETTER O WITH GRAVE +323 211 D3 Ó LATIN CAPITAL LETTER O WITH ACUTE +324 212 D4 Ô LATIN CAPITAL LETTER O WITH CIRCUMFLEX +325 213 D5 Ä  LATIN CAPITAL LETTER G WITH DOT ABOVE +326 214 D6 Ö LATIN CAPITAL LETTER O WITH DIAERESIS +327 215 D7 × MULTIPLICATION SIGN +330 216 D8 Ĝ LATIN CAPITAL LETTER G WITH CIRCUMFLEX +331 217 D9 Ù LATIN CAPITAL LETTER U WITH GRAVE +332 218 DA Ú LATIN CAPITAL LETTER U WITH ACUTE +333 219 DB Û LATIN CAPITAL LETTER U WITH CIRCUMFLEX +334 220 DC Ü LATIN CAPITAL LETTER U WITH DIAERESIS +335 221 DD Ŭ LATIN CAPITAL LETTER U WITH BREVE +336 222 DE Ŝ LATIN CAPITAL LETTER S WITH CIRCUMFLEX +337 223 DF ß LATIN SMALL LETTER SHARP S (German) +340 224 E0 à LATIN SMALL LETTER A WITH GRAVE +341 225 E1 á LATIN SMALL LETTER A WITH ACUTE +342 226 E2 â LATIN SMALL LETTER A WITH CIRCUMFLEX +344 228 E4 ä LATIN SMALL LETTER A WITH DIAERESIS +345 229 E5 ċ LATIN SMALL LETTER C WITH DOT ABOVE +346 230 E6 ĉ LATIN SMALL LETTER C WITH CIRCUMFLEX +347 231 E7 ç LATIN SMALL LETTER C WITH CEDILLA +350 232 E8 è LATIN SMALL LETTER E WITH GRAVE +351 233 E9 é LATIN SMALL LETTER E WITH ACUTE +352 234 EA ê LATIN SMALL LETTER E WITH CIRCUMFLEX +353 235 EB ë LATIN SMALL LETTER E WITH DIAERESIS +354 236 EC ì LATIN SMALL LETTER I WITH GRAVE +355 237 ED í LATIN SMALL LETTER I WITH ACUTE +356 238 EE î LATIN SMALL LETTER I WITH CIRCUMFLEX +357 239 EF ï LATIN SMALL LETTER I WITH DIAERESIS +361 241 F1 ñ LATIN SMALL LETTER N WITH TILDE +362 242 F2 ò LATIN SMALL LETTER O WITH GRAVE +363 243 F3 ó LATIN SMALL LETTER O WITH ACUTE +364 244 F4 ô LATIN SMALL LETTER O WITH CIRCUMFLEX +365 245 F5 Ä¡ LATIN SMALL LETTER G WITH DOT ABOVE +366 246 F6 ö LATIN SMALL LETTER O WITH DIAERESIS +367 247 F7 ÷ DIVISION SIGN +370 248 F8 ĝ LATIN SMALL LETTER G WITH CIRCUMFLEX +371 249 F9 ù LATIN SMALL LETTER U WITH GRAVE +372 250 FA ú LATIN SMALL LETTER U WITH ACUTE +373 251 FB û LATIN SMALL LETTER U WITH CIRCUMFLEX +374 252 FC ü LATIN SMALL LETTER U WITH DIAERESIS +375 253 FD Å­ LATIN SMALL LETTER U WITH BREVE +376 254 FE ŝ LATIN SMALL LETTER S WITH CIRCUMFLEX +377 255 FF ˙ DOT ABOVE (Mandarin Chinese light tone) +.TE +.SH 備考 +ISO 8859\-3 は Latin\-3 としても知られている。 +.SH 関連項目 +\fBascii\fP(7) diff --git a/draft/man7/iso_8859-4.7 b/draft/man7/iso_8859-4.7 new file mode 100644 index 00000000..87399d27 --- /dev/null +++ b/draft/man7/iso_8859-4.7 @@ -0,0 +1,161 @@ +.\" t -*- coding: UTF-8 -*- +.\" Copyright 2009 Lefteris Dimitroulakis (edimitro@tee.gr) +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ISO_8859\-4 7 2009\-01\-24 Linux "Linux Programmer's Manual" +.SH 名前 +iso_8859\-4 \- ISO 8859\-4 文字集合の 8 進数、10 進数、16 進数による符号化 +.SH 説明 +ISO 8859 規格は ASCII 文字集合 (ISO 6460IRV としても知られている) の +いくつかの 8 ビット拡張を含んでいる。 +ISO 8859\-4 はスカンジナビア/バルト語派の言語で使用される文字の符号化を規定している。 +.SS "ISO 8859 アルファベット" +完全な ISO 8859 アルファベットは以下のものを含んでいる: +.TS +l l. +ISO 8859\-1 西ヨーロッパの言語 (Latin\-1) +ISO 8859\-2 中央および東ヨーロッパの言語 (Latin\-2) +ISO 8859\-3 東南ヨーロッパやその他の言語 (Latin\-3) +ISO 8859\-4 スカンジナビア/バルト語派の言語 (Latin\-4) +ISO 8859\-5 ラテン/キリル文字 +ISO 8859\-6 ラテン/アラビア語 +ISO 8859\-7 ラテン/ギリシャ語 +ISO 8859\-8 ラテン/ヘブライ語 +ISO 8859\-9 トルコ語修正を行なった Latin\-1 (Latin\-5) +ISO 8859\-10 ラップ/ノルディック/エスキモーの言語 (Latin\-6) +ISO 8859\-11 ラテン/タイ語 +ISO 8859\-13 バルト諸国の言語 (Latin\-7) +ISO 8859\-14 ケルト語 (Latin\-8) +ISO 8859\-15 西ヨーロッパの言語 (Latin\-9) +ISO 8859\-16 ルーマニア語 (Latin\-10) +.TE +.SS "ISO 8859\-4 文字" +以下の表は ISO 8859\-4 の表示可能な文字のうち +\fBascii\fP(7) マニュアルページに載っていないものを示している。 +4列目は ISO 8859\-4 用に設定された環境でのみ正しく表示できるだろう。 +.TS +l l l c lp-1. +Oct Dec Hex Char Description +_ +240 160 A0 \ NO\-BREAK SPACE +241 161 A1 Ą LATIN CAPITAL LETTER A WITH OGONEK +242 162 A2 ĸ LATIN SMALL LETTER KRA (Greenlandic) +243 163 A3 Ŗ LATIN CAPITAL LETTER R WITH CEDILLA +244 164 A4 ¤ CURRENCY SIGN +245 165 A5 Ĩ LATIN CAPITAL LETTER I WITH TILDE +246 166 A6 Ä» LATIN CAPITAL LETTER L WITH CEDILLA +247 167 A7 § SECTION SIGN +250 168 A8 ¨ DIAERESIS +251 169 A9 Å  LATIN CAPITAL LETTER S WITH CARON +252 170 AA Ē LATIN CAPITAL LETTER E WITH MACRON +253 171 AB Ä¢ LATIN CAPITAL LETTER G WITH CEDILLA +254 172 AC Ŧ LATIN CAPITAL LETTER T WITH STROKE +255 173 AD ­ SOFT HYPHEN +256 174 AE Ž LATIN CAPITAL LETTER Z WITH CARON +257 175 AF ¯ MACRON +260 176 B0 ° DEGREE SIGN +261 177 B1 ą LATIN SMALL LETTER A WITH OGONEK +262 178 B2 ˛ OGONEK +263 179 B3 ŗ LATIN SMALL LETTER R WITH CEDILLA +264 180 B4 ´ ACUTE ACCENT +265 181 B5 Ä© LATIN SMALL LETTER I WITH TILDE +266 182 B6 ļ LATIN SMALL LETTER L WITH CEDILLA +267 183 B7 ˇ CARON (Mandarin Chinese third tone) +270 184 B8 ¸ CEDILLA +271 185 B9 Å¡ LATIN SMALL LETTER S WITH CARON +272 186 BA ē LATIN SMALL LETTER E WITH MACRON +273 187 BB Ä£ LATIN SMALL LETTER G WITH CEDILLA +274 188 BC ŧ LATIN SMALL LETTER T WITH STROKE +275 189 BD Ŋ LATIN CAPITAL LETTER ENG (Sami) +276 190 BE ž LATIN SMALL LETTER Z WITH CARON +277 191 BF ŋ LATIN SMALL LETTER ENG (Sami) +300 192 C0 Ā LATIN CAPITAL LETTER A WITH MACRON +301 193 C1 Á LATIN CAPITAL LETTER A WITH ACUTE +302 194 C2  LATIN CAPITAL LETTER A WITH CIRCUMFLEX +303 195 C3 à LATIN CAPITAL LETTER A WITH TILDE +304 196 C4 Ä LATIN CAPITAL LETTER A WITH DIAERESIS +305 197 C5 Å LATIN CAPITAL LETTER A WITH RING ABOVE +306 198 C6 Æ LATIN CAPITAL LETTER AE +307 199 C7 Ä® LATIN CAPITAL LETTER I WITH OGONEK +310 200 C8 Č LATIN CAPITAL LETTER C WITH CARON +311 201 C9 É LATIN CAPITAL LETTER E WITH ACUTE +312 202 CA Ę LATIN CAPITAL LETTER E WITH OGONEK +313 203 CB Ë LATIN CAPITAL LETTER E WITH DIAERESIS +314 204 CC Ė LATIN CAPITAL LETTER E WITH DOT ABOVE +315 205 CD Í LATIN CAPITAL LETTER I WITH ACUTE +316 206 CE Î LATIN CAPITAL LETTER I WITH CIRCUMFLEX +317 207 CF Ī LATIN CAPITAL LETTER I WITH MACRON +320 208 D0 Đ LATIN CAPITAL LETTER D WITH STROKE +321 209 D1 Ņ LATIN CAPITAL LETTER N WITH CEDILLA +322 210 D2 Ō LATIN CAPITAL LETTER O WITH MACRON +323 211 D3 Ķ LATIN CAPITAL LETTER K WITH CEDILLA +324 212 D4 Ô LATIN CAPITAL LETTER O WITH CIRCUMFLEX +325 213 D5 Õ LATIN CAPITAL LETTER O WITH TILDE +326 214 D6 Ö LATIN CAPITAL LETTER O WITH DIAERESIS +327 215 D7 × MULTIPLICATION SIGN +330 216 D8 Ø LATIN CAPITAL LETTER O WITH STROKE +331 217 D9 Ų LATIN CAPITAL LETTER U WITH OGONEK +332 218 DA Ú LATIN CAPITAL LETTER U WITH ACUTE +333 219 DB Û LATIN CAPITAL LETTER U WITH CIRCUMFLEX +334 220 DC Ü LATIN CAPITAL LETTER U WITH DIAERESIS +335 221 DD Ũ LATIN CAPITAL LETTER U WITH TILDE +336 222 DE Ū LATIN CAPITAL LETTER U WITH MACRON +337 223 DF ß LATIN SMALL LETTER SHARP S (German) +340 224 E0 ā LATIN SMALL LETTER A WITH MACRON +341 225 E1 á LATIN SMALL LETTER A WITH ACUTE +342 226 E2 â LATIN SMALL LETTER A WITH CIRCUMFLEX +343 227 E3 ã LATIN SMALL LETTER A WITH TILDE +344 228 E4 ä LATIN SMALL LETTER A WITH DIAERESIS +345 229 E5 Ã¥ LATIN SMALL LETTER A WITH RING ABOVE +346 230 E6 æ LATIN SMALL LETTER AE +347 231 E7 į LATIN SMALL LETTER I WITH OGONEK +350 232 E8 č LATIN SMALL LETTER C WITH CARON +351 233 E9 é LATIN SMALL LETTER E WITH ACUTE +352 234 EA ę LATIN SMALL LETTER E WITH OGONEK +353 235 EB ë LATIN SMALL LETTER E WITH DIAERESIS +354 236 EC ė LATIN SMALL LETTER E WITH DOT ABOVE +355 237 ED í LATIN SMALL LETTER I WITH ACUTE +356 238 EE î LATIN SMALL LETTER I WITH CIRCUMFLEX +357 239 EF Ä« LATIN SMALL LETTER I WITH MACRON +360 240 F0 đ LATIN SMALL LETTER D WITH STROKE +361 241 F1 ņ LATIN SMALL LETTER N WITH CEDILLA +362 242 F2 ō LATIN SMALL LETTER O WITH MACRON +363 243 F3 Ä· LATIN SMALL LETTER K WITH CEDILLA +364 244 F4 ô LATIN SMALL LETTER O WITH CIRCUMFLEX +365 245 F5 õ LATIN SMALL LETTER O WITH TILDE +366 246 F6 ö LATIN SMALL LETTER O WITH DIAERESIS +367 247 F7 ÷ DIVISION SIGN +370 248 F8 ø LATIN SMALL LETTER O WITH STROKE +371 249 F9 ų LATIN SMALL LETTER U WITH OGONEK +372 250 FA ú LATIN SMALL LETTER U WITH ACUTE +373 251 FB û LATIN SMALL LETTER U WITH CIRCUMFLEX +374 252 FC ü LATIN SMALL LETTER U WITH DIAERESIS +375 253 FD Å© LATIN SMALL LETTER U WITH TILDE +376 254 FE Å« LATIN SMALL LETTER U WITH MACRON +377 255 FF ˙ DOT ABOVE (Mandarin Chinese light tone) +.TE +.SH 関連項目 +\fBascii\fP(7) diff --git a/draft/man7/iso_8859-5.7 b/draft/man7/iso_8859-5.7 new file mode 100644 index 00000000..513382a4 --- /dev/null +++ b/draft/man7/iso_8859-5.7 @@ -0,0 +1,161 @@ +.\" t -*- coding: UTF-8 -*- +.\" Copyright 2009 Lefteris Dimitroulakis (edimitro@tee.gr) +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ISO_8859\-5 7 2010\-09\-20 Linux "Linux Programmer's Manual" +.SH 名前 +iso_8859\-5 \- ISO 8859\-5 文字集合の 8 進数、10 進数、16 進数による符号化 +.SH 説明 +ISO 8859 規格は ASCII 文字集合 (ISO 6460IRV としても知られている) の +いくつかの 8 ビット拡張を含んでいる。 +ISO 8859\-5 はロシア語とマケドニア語で使用されるキリル文字の符号化を規定している。 +.SS "ISO 8859 アルファベット" +完全な ISO 8859 アルファベットは以下のものを含んでいる: +.TS +l l. +ISO 8859\-1 西ヨーロッパの言語 (Latin\-1) +ISO 8859\-2 中央および東ヨーロッパの言語 (Latin\-2) +ISO 8859\-3 東南ヨーロッパやその他の言語 (Latin\-3) +ISO 8859\-4 スカンジナビア/バルト語派の言語 (Latin\-4) +ISO 8859\-5 ラテン/キリル文字 +ISO 8859\-6 ラテン/アラビア語 +ISO 8859\-7 ラテン/ギリシャ語 +ISO 8859\-8 ラテン/ヘブライ語 +ISO 8859\-9 トルコ語修正を行なった Latin\-1 (Latin\-5) +ISO 8859\-10 ラップ/ノルディック/エスキモーの言語 (Latin\-6) +ISO 8859\-11 ラテン/タイ語 +ISO 8859\-13 バルト諸国の言語 (Latin\-7) +ISO 8859\-14 ケルト語 (Latin\-8) +ISO 8859\-15 西ヨーロッパの言語 (Latin\-9) +ISO 8859\-16 ルーマニア語 (Latin\-10) +.TE +.SS "ISO 8859\-5 文字" +以下の表は ISO 8859\-5 の表示可能な文字のうち +\fBascii\fP(7) マニュアルページに載っていないものを示している。 +4列目は ISO 8859\-5 用に設定された環境でのみ正しく表示できるだろう。 +.TS +l l l c lp-1. +Oct Dec Hex Char Description +_ +240 160 A0 \ NO\-BREAK SPACE +241 161 A1 Ё CYRILLIC CAPITAL LETTER IO +242 162 A2 Ђ CYRILLIC CAPITAL LETTER DJE (Serbocroatian) +243 163 A3 Ѓ CYRILLIC CAPITAL LETTER GJE +244 164 A4 Є CYRILLIC CAPITAL LETTER UKRAINIAN IE +245 165 A5 Ѕ CYRILLIC CAPITAL LETTER DZE +246 166 A6 І CYRILLIC CAPITAL LETTER BYELORUSSIAN\-UKRAINIAN I +247 167 A7 Ї CYRILLIC CAPITAL LETTER YI (Ukrainian) +250 168 A8 Ј CYRILLIC CAPITAL LETTER JE +251 169 A9 Љ CYRILLIC CAPITAL LETTER LJE +252 170 AA Њ CYRILLIC CAPITAL LETTER NJE +253 171 AB Ћ CYRILLIC CAPITAL LETTER TSHE (Serbocroatian) +254 172 AC Ќ CYRILLIC CAPITAL LETTER KJE +255 173 AD ­ SOFT HYPHEN +256 174 AE Ў CYRILLIC CAPITAL LETTER SHORT U (Byelorussian) +257 175 AF Џ CYRILLIC CAPITAL LETTER DZHE +260 176 B0 А CYRILLIC CAPITAL LETTER A +261 177 B1 Б CYRILLIC CAPITAL LETTER BE +262 178 B2 В CYRILLIC CAPITAL LETTER VE +263 179 B3 Г CYRILLIC CAPITAL LETTER GHE +264 180 B4 Д CYRILLIC CAPITAL LETTER DE +265 181 B5 Е CYRILLIC CAPITAL LETTER IE +266 182 B6 Ж CYRILLIC CAPITAL LETTER ZHE +267 183 B7 З CYRILLIC CAPITAL LETTER ZE +270 184 B8 И CYRILLIC CAPITAL LETTER I +271 185 B9 Й CYRILLIC CAPITAL LETTER SHORT I +272 186 BA К CYRILLIC CAPITAL LETTER KA +273 187 BB Л CYRILLIC CAPITAL LETTER EL +274 188 BC М CYRILLIC CAPITAL LETTER EM +275 189 BD Н CYRILLIC CAPITAL LETTER EN +276 190 BE О CYRILLIC CAPITAL LETTER O +277 191 BF П CYRILLIC CAPITAL LETTER PE +300 192 C0 Р CYRILLIC CAPITAL LETTER ER +301 193 C1 С CYRILLIC CAPITAL LETTER ES +302 194 C2 Т CYRILLIC CAPITAL LETTER TE +303 195 C3 У CYRILLIC CAPITAL LETTER U +304 196 C4 Ф CYRILLIC CAPITAL LETTER EF +305 197 C5 Ð¥ CYRILLIC CAPITAL LETTER HA +306 198 C6 Ц CYRILLIC CAPITAL LETTER TSE +307 199 C7 Ч CYRILLIC CAPITAL LETTER CHE +310 200 C8 Ш CYRILLIC CAPITAL LETTER SHA +311 201 C9 Щ CYRILLIC CAPITAL LETTER SHCHA +312 202 CA Ъ CYRILLIC CAPITAL LETTER HARD SIGN +313 203 CB Ы CYRILLIC CAPITAL LETTER YERU +314 204 CC Ь CYRILLIC CAPITAL LETTER SOFT SIGN +315 205 CD Э CYRILLIC CAPITAL LETTER E +316 206 CE Ю CYRILLIC CAPITAL LETTER YU +317 207 CF Я CYRILLIC CAPITAL LETTER YA +320 208 D0 а CYRILLIC SMALL LETTER A +321 209 D1 б CYRILLIC SMALL LETTER BE +322 210 D2 в CYRILLIC SMALL LETTER VE +323 211 D3 г CYRILLIC SMALL LETTER GHE +324 212 D4 д CYRILLIC SMALL LETTER DE +325 213 D5 е CYRILLIC SMALL LETTER IE +326 214 D6 ж CYRILLIC SMALL LETTER ZHE +327 215 D7 з CYRILLIC SMALL LETTER ZE +330 216 D8 и CYRILLIC SMALL LETTER I +331 217 D9 й CYRILLIC SMALL LETTER SHORT I +332 218 DA к CYRILLIC SMALL LETTER KA +333 219 DB л CYRILLIC SMALL LETTER EL +334 220 DC м CYRILLIC SMALL LETTER EM +335 221 DD н CYRILLIC SMALL LETTER EN +336 222 DE о CYRILLIC SMALL LETTER O +337 223 DF п CYRILLIC SMALL LETTER PE +340 224 E0 р CYRILLIC SMALL LETTER ER +341 225 E1 с CYRILLIC SMALL LETTER ES +342 226 E2 т CYRILLIC SMALL LETTER TE +343 227 E3 у CYRILLIC SMALL LETTER U +344 228 E4 ф CYRILLIC SMALL LETTER EF +345 229 E5 х CYRILLIC SMALL LETTER HA +346 230 E6 ц CYRILLIC SMALL LETTER TSE +347 231 E7 ч CYRILLIC SMALL LETTER CHE +350 232 E8 ш CYRILLIC SMALL LETTER SHA +351 233 E9 щ CYRILLIC SMALL LETTER SHCHA +352 234 EA ъ CYRILLIC SMALL LETTER HARD SIGN +353 235 EB ы CYRILLIC SMALL LETTER YERU +354 236 EC ь CYRILLIC SMALL LETTER SOFT SIGN +355 237 ED э CYRILLIC SMALL LETTER E +356 238 EE ю CYRILLIC SMALL LETTER YU +357 239 EF я CYRILLIC SMALL LETTER YA +360 240 F0 № NUMERO SIGN +361 241 F1 ё CYRILLIC SMALL LETTER IO +362 242 F2 ђ CYRILLIC SMALL LETTER DJE (Serbocroatian) +363 243 F3 ѓ CYRILLIC SMALL LETTER GJE +364 244 F4 є CYRILLIC SMALL LETTER UKRAINIAN IE +365 245 F5 ѕ CYRILLIC SMALL LETTER DZE +366 246 F6 і CYRILLIC SMALL LETTER BYELORUSSIAN\-UKRAINIAN I +367 247 F7 ї CYRILLIC SMALL LETTER YI (Ukrainian) +370 248 F8 ј CYRILLIC SMALL LETTER JE +371 249 F9 љ CYRILLIC SMALL LETTER LJE +372 250 FA њ CYRILLIC SMALL LETTER NJE +373 251 FB ј CYRILLIC SMALL LETTER TSHE (Serbocroatian) +374 252 FC ќ CYRILLIC SMALL LETTER KJE +375 253 FD § SECTION SIGN +376 254 FE ў CYRILLIC SMALL LETTER SHORT U (Byelorussian) +377 255 FF џ CYRILLIC SMALL LETTER DZHE +.TE +.SH 関連項目 +\fBascii\fP(7), \fBkoi8\-r\fP(7) diff --git a/draft/man7/iso_8859-6.7 b/draft/man7/iso_8859-6.7 new file mode 100644 index 00000000..d33ee60e --- /dev/null +++ b/draft/man7/iso_8859-6.7 @@ -0,0 +1,119 @@ +.\" t -*- coding: UTF-8 -*- +.\" Copyright 2009 Lefteris Dimitroulakis (edimitro@tee.gr) +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ISO_8859\-6 7 2010\-09\-20 Linux "Linux Programmer's Manual" +.SH 名前 +iso_8859\-6 \- ISO 8859\-6 文字集合の 8 進数、10 進数、16 進数による符号化 +.SH 説明 +ISO 8859 規格は ASCII 文字集合 (ISO 6460IRV としても知られている) の +いくつかの 8 ビット拡張を含んでいる。 +ISO 8859\-6 はアラビア語で使用される文字の符号化を規定している。 +.SS "ISO 8859 アルファベット" +完全な ISO 8859 アルファベットは以下のものを含んでいる: +.TS +l l. +ISO 8859\-1 西ヨーロッパの言語 (Latin\-1) +ISO 8859\-2 中央および東ヨーロッパの言語 (Latin\-2) +ISO 8859\-3 東南ヨーロッパやその他の言語 (Latin\-3) +ISO 8859\-4 スカンジナビア/バルト語派の言語 (Latin\-4) +ISO 8859\-5 ラテン/キリル文字 +ISO 8859\-6 ラテン/アラビア語 +ISO 8859\-7 ラテン/ギリシャ語 +ISO 8859\-8 ラテン/ヘブライ語 +ISO 8859\-9 トルコ語修正を行なった Latin\-1 (Latin\-5) +ISO 8859\-10 ラップ/ノルディック/エスキモーの言語 (Latin\-6) +ISO 8859\-11 ラテン/タイ語 +ISO 8859\-13 バルト諸国の言語 (Latin\-7) +ISO 8859\-14 ケルト語 (Latin\-8) +ISO 8859\-15 西ヨーロッパの言語 (Latin\-9) +ISO 8859\-16 ルーマニア語 (Latin\-10) +.TE +.SS "ISO 8859\-6 文字" +以下の表は ISO 8859\-6 の表示可能な文字のうち +\fBascii\fP(7) マニュアルページに載っていないものを示している。 +4列目は ISO 8859\-6 用に設定された環境でのみ正しく表示できるだろう。 +.TS +l l l c lp-1. +Oct Dec Hex Char Description +_ +240 160 A0 \ NO\-BREAK SPACE +244 164 A4 ¤ CURRENCY SIGN +254 172 AC ، ARABIC COMMA +255 173 AD ­ SOFT HYPHEN +273 187 BB ؛ ARABIC SEMICOLON +277 191 BF ؟ ARABIC QUESTION MARK +301 193 C1 Ø¡ ARABIC LETTER HAMZA +302 194 C2 Ø¢ ARABIC LETTER ALEF WITH MADDA ABOVE +303 195 C3 Ø£ ARABIC LETTER ALEF WITH HAMZA ABOVE +304 196 C4 ؤ ARABIC LETTER WAW WITH HAMZA ABOVE +305 197 C5 Ø¥ ARABIC LETTER ALEF WITH HAMZA BELOW +306 198 C6 ئ ARABIC LETTER YEH WITH HAMZA ABOVE +307 199 C7 ا ARABIC LETTER ALEF +310 200 C8 ب ARABIC LETTER BEH +311 201 C9 Ø© ARABIC LETTER TEH MARBUTA +312 202 CA ت ARABIC LETTER TEH +313 203 CB Ø« ARABIC LETTER THEH +314 204 CC ج ARABIC LETTER JEEM +315 205 CD Ø­ ARABIC LETTER HAH +316 206 CE Ø® ARABIC LETTER KHAH +317 207 CF د ARABIC LETTER DAL +320 208 D0 Ø° ARABIC LETTER THAL +321 209 D1 ر ARABIC LETTER REH +322 210 D2 ز ARABIC LETTER ZAIN +323 211 D3 س ARABIC LETTER SEEN +324 212 D4 Ø´ ARABIC LETTER SHEEN +325 213 D5 ص ARABIC LETTER SAD +326 214 D6 ض ARABIC LETTER DAD +327 215 D7 Ø· ARABIC LETTER TAH +330 216 D8 ظ ARABIC LETTER ZAH +331 217 D9 ع ARABIC LETTER AIN +332 218 DA غ ARABIC LETTER GHAIN +340 224 E0 ـ ARABIC TATWEEL +341 225 E1 ف ARABIC LETTER FEH +342 226 E2 ق ARABIC LETTER QAF +343 227 E3 ك ARABIC LETTER KAF +344 228 E4 ل ARABIC LETTER LAM +345 229 E5 م ARABIC LETTER MEEM +346 230 E6 ن ARABIC LETTER NOON +347 231 E7 ه ARABIC LETTER HEH +350 232 E8 و ARABIC LETTER WAW +351 233 E9 ى ARABIC LETTER ALEF MAKSURA +352 234 EA ي ARABIC LETTER YEH +353 235 EB ً ARABIC FATHATAN +354 236 EC ٌ ARABIC DAMMATAN +355 237 ED ٍ ARABIC KASRATAN +356 238 EE َ ARABIC FATHA +357 239 EF ُ ARABIC DAMMA +360 240 F0 ِ ARABIC KASRA +361 241 F1 ّ ARABIC SHADDA +362 242 F2 ْ ARABIC SUKUN +.TE +.SH 備考 +ISO 8859\-6 では、関連する多くの言語 (ウルドゥー語ヤペルシャ語 (Farsi) など) +で必須の記号が規定されていない。 +.SH 関連項目 +\fBascii\fP(7) diff --git a/draft/man7/iso_8859-7.7 b/draft/man7/iso_8859-7.7 index 2915d92d..260199b7 100644 --- a/draft/man7/iso_8859-7.7 +++ b/draft/man7/iso_8859-7.7 @@ -1,4 +1,4 @@ -'\" t +.\" t -*- coding: UTF-8 -*- .\" Copyright 1999 Dimitri Papadopoulos (dpo@club-internet.fr) .\" .\" This is free documentation; you can redistribute it and/or @@ -20,119 +20,79 @@ .\" License along with this manual; if not, write to the Free .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, .\" USA. +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Thu Jan 6 01:46:08 JST 2000 -.\" by HANATAKA Shinya -.\" Updated Tue Sep 9 JST 2003 by Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.TH ISO_8859-7 7 2008-10-30 "Linux" "Linux Programmer's Manual" +.\"******************************************************************* +.TH ISO_8859\-7 7 2008\-10\-30 Linux "Linux Programmer's Manual" .nh -.\"O .SH NAME .SH 名前 -.\"O iso_8859-7 \- ISO 8859-7 character set encoded in octal, decimal, -.\"O and hexadecimal -iso_8859-7 \- ISO 8859-7 文字集合の 8進数、10進数、16進数による符号化 -.\"O .SH DESCRIPTION +iso_8859\-7 \- ISO 8859\-7 文字集合の 8 進数、10 進数、16 進数による符号化 .SH 説明 -.\"O The ISO 8859 standard includes several 8-bit extensions to the ASCII -.\"O character set (also known as ISO 646-IRV). -.\"O ISO 8859-7 encodes the -.\"O characters used in modern monotonic Greek. -ISO 8859 規格は ASCII 文字集合 (ISO 646-IRV とも呼ばれる) の -いくつかの 8 ビット拡張を含んでいる。ISO 8859-7 は現代の単調の -ギリシア語に使用される文字を符号化している。 +ISO 8859 規格は ASCII 文字集合 (ISO 6460IRV としても知られている) の +いくつかの 8 ビット拡張を含んでいる。 +ISO 8859\-7 は現代ギリシャ語で使用される文字の符号化を規定している。 .SS "ISO 8859 アルファベット" -.\"O The full set of ISO 8859 alphabets includes: 完全な ISO 8859 アルファベットは以下のものを含んでいる: .TS l l. -.\"O ISO 8859-1 West European languages (Latin-1) -.\"O ISO 8859-2 Central and East European languages (Latin-2) -.\"O ISO 8859-3 Southeast European and miscellaneous languages (Latin-3) -.\"O ISO 8859-4 Scandinavian/Baltic languages (Latin-4) -.\"O ISO 8859-5 Latin/Cyrillic -.\"O ISO 8859-6 Latin/Arabic -.\"O ISO 8859-7 Latin/Greek -.\"O ISO 8859-8 Latin/Hebrew -.\"O ISO 8859-9 Latin-1 modification for Turkish (Latin-5) -.\"O ISO 8859-10 Lappish/Nordic/Eskimo languages (Latin-6) -.\"O ISO 8859-11 Latin/Thai -.\"O ISO 8859-13 Baltic Rim languages (Latin-7) -.\"O ISO 8859-14 Celtic (Latin-8) -.\"O ISO 8859-15 West European languages (Latin-9) -.\"O ISO 8859-16 Romanian (Latin-10) -ISO 8859-1 西ヨーロッパの言語 (Latin-1) -ISO 8859-2 中央・東ヨーロッパの言語 (Latin-2) -ISO 8859-3 東南ヨーロッパやその他の言語 (Latin-3) -ISO 8859-4 スカンジナビア/バルト語派の言語 (Latin-4) -ISO 8859-5 ラテン/キリル文字 -ISO 8859-6 ラテン/アラビア文字 -ISO 8859-7 ラテンギリシャ文字 -ISO 8859-8 ラテン/ヘブライ語 -ISO 8859-9 トルコ語修正を行なった Latin-1 (Latin-5) -ISO 8859-10 ラップ/ノルディック/エスキモーの言語 (Latin-6) -ISO 8859-11 ラテン/タイ語 -ISO 8859-13 バルト諸国の言語 (Latin-7) -ISO 8859-14 ケルト語 (Latin-8) -ISO 8859-15 西ヨーロッパの言語 (Latin-9) -ISO 8859-16 ルーマニア語 (Latin-10) +ISO 8859\-1 西ヨーロッパの言語 (Latin\-1) +ISO 8859\-2 中央および東ヨーロッパの言語 (Latin\-2) +ISO 8859\-3 東南ヨーロッパやその他の言語 (Latin\-3) +ISO 8859\-4 スカンジナビア/バルト語派の言語 (Latin\-4) +ISO 8859\-5 ラテン/キリル文字 +ISO 8859\-6 ラテン/アラビア語 +ISO 8859\-7 ラテン/ギリシャ語 +ISO 8859\-8 ラテン/ヘブライ語 +ISO 8859\-9 トルコ語修正を行なった Latin\-1 (Latin\-5) +ISO 8859\-10 ラップ/ノルディック/エスキモーの言語 (Latin\-6) +ISO 8859\-11 ラテン/タイ語 +ISO 8859\-13 バルト諸国の言語 (Latin\-7) +ISO 8859\-14 ケルト語 (Latin\-8) +ISO 8859\-15 西ヨーロッパの言語 (Latin\-9) +ISO 8859\-16 ルーマニア語 (Latin\-10) .TE -.\"O .SS "ISO 8859-7 Characters" -.SS "ISO 8859-7 文字" -.\"O The following table displays the characters in ISO 8859-7, which -.\"O are printable and unlisted in the -.\"O .BR ascii (7) -.\"O manual page. -.\"O The fourth column will only show the proper glyphs -.\"O in an environment configured for ISO 8859-7. - -以下の表は ISO 8859-7 の表示可能な文字のうち -.BR ascii (7) -マニュアル・ページに載っていないものを示している。 -4列目は ISO 8859-7 用に設定された環境でのみ正しく表示できるだろう。 - -[ 訳注 原文では Char の部分に ISO 8859-7 の文字があったが、 -日本語 EUC との併用は難しいので削除し、JIS X 0208 の同じ文字を -示すようにした。その他の文字に関しては -英語版の iso_8859-7(7) を適切なフォントを準備して参照してほしい。 ] +.SS "ISO 8859\-7 文字" +以下の表は ISO 8859\-7 の表示可能な文字のうち +\fBascii\fP(7) マニュアルページに載っていないものを示している。 +4列目は ISO 8859\-7 用に設定された環境でのみ正しく表示できるだろう。 .TS l l l c lp-1. Oct Dec Hex Char Description _ -240 160 A0 NO-BREAK SPACE -241 161 A1 LEFT SINGLE QUOTATION MARK -242 162 A2 RIGHT SINGLE QUOTATION MARK +240 160 A0 \ NO\-BREAK SPACE +241 161 A1 ‘ LEFT SINGLE QUOTATION MARK +242 162 A2 ’ RIGHT SINGLE QUOTATION MARK 243 163 A3 £ POUND SIGN -244 164 A4 EURO SIGN -245 165 A5 DRACHMA SIGN -246 166 A6 BROKEN BAR +244 164 A4 € EURO SIGN +245 165 A5 ₯ DRACHMA SIGN +246 166 A6 ¦ BROKEN BAR 247 167 A7 § SECTION SIGN 250 168 A8 ¨ DIAERESIS -251 169 A9 COPYRIGHT SIGN -252 170 AA GREEK YPOGEGRAMMENI -253 171 AB 《 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +251 169 A9 © COPYRIGHT SIGN +252 170 AA ͺ GREEK YPOGEGRAMMENI +253 171 AB « LEFT\-POINTING DOUBLE ANGLE QUOTATION MARK 254 172 AC ¬ NOT SIGN -255 173 AD SOFT HYPHEN -257 175 AF — HORIZONTAL BAR +255 173 AD ­ SOFT HYPHEN +257 175 AF ― HORIZONTAL BAR 260 176 B0 ° DEGREE SIGN -261 177 B1 ± PLUS-MINUS SIGN -262 178 B2 SUPERSCRIPT TWO -263 179 B3 SUPERSCRIPT THREE -264 180 B4 GREEK TONOS -265 181 B5 GREEK DIALYTIKA TONOS -266 182 B6 GREEK CAPITAL LETTER ALPHA WITH TONOS -267 183 B7 ・ MIDDLE DOT -270 184 B8 GREEK CAPITAL LETTER EPSILON WITH TONOS -271 185 B9 GREEK CAPITAL LETTER ETA WITH TONOS -272 186 BA GREEK CAPITAL LETTER IOTA WITH TONOS -273 187 BB 》 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -274 188 BC GREEK CAPITAL LETTER OMICRON WITH TONOS -275 189 BD VULGAR FRACTION ONE HALF -276 190 BE GREEK CAPITAL LETTER UPSILON WITH TONOS -277 191 BF GREEK CAPITAL LETTER OMEGA WITH TONOS -300 192 C0 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS +261 177 B1 ± PLUS\-MINUS SIGN +262 178 B2 ² SUPERSCRIPT TWO +263 179 B3 ³ SUPERSCRIPT THREE +264 180 B4 ΄ GREEK TONOS +265 181 B5 ΅ GREEK DIALYTIKA TONOS +266 182 B6 Ά GREEK CAPITAL LETTER ALPHA WITH TONOS +267 183 B7 · MIDDLE DOT +270 184 B8 Έ GREEK CAPITAL LETTER EPSILON WITH TONOS +271 185 B9 Ή GREEK CAPITAL LETTER ETA WITH TONOS +272 186 BA Ί GREEK CAPITAL LETTER IOTA WITH TONOS +273 187 BB » RIGHT\-POINTING DOUBLE ANGLE QUOTATION MARK +274 188 BC Ό GREEK CAPITAL LETTER OMICRON WITH TONOS +275 189 BD ½ VULGAR FRACTION ONE HALF +276 190 BE Ύ GREEK CAPITAL LETTER UPSILON WITH TONOS +277 191 BF Ώ GREEK CAPITAL LETTER OMEGA WITH TONOS +300 192 C0 ΐ GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS 301 193 C1 Α GREEK CAPITAL LETTER ALPHA 302 194 C2 Β GREEK CAPITAL LETTER BETA 303 195 C3 Γ GREEK CAPITAL LETTER GAMMA @@ -157,13 +117,13 @@ _ 327 215 D7 Χ GREEK CAPITAL LETTER CHI 330 216 D8 Ψ GREEK CAPITAL LETTER PSI 331 217 D9 Ω GREEK CAPITAL LETTER OMEGA -332 218 DA GREEK CAPITAL LETTER IOTA WITH DIALYTIKA -333 219 DB GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA -334 220 DC GREEK SMALL LETTER ALPHA WITH TONOS -335 221 DD GREEK SMALL LETTER EPSILON WITH TONOS -336 222 DE GREEK SMALL LETTER ETA WITH TONOS -337 223 DF GREEK SMALL LETTER IOTA WITH TONOS -340 224 E0 GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS +332 218 DA Ϊ GREEK CAPITAL LETTER IOTA WITH DIALYTIKA +333 219 DB Ϋ GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA +334 220 DC ά GREEK SMALL LETTER ALPHA WITH TONOS +335 221 DD έ GREEK SMALL LETTER EPSILON WITH TONOS +336 222 DE ή GREEK SMALL LETTER ETA WITH TONOS +337 223 DF ί GREEK SMALL LETTER IOTA WITH TONOS +340 224 E0 ΰ GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS 341 225 E1 α GREEK SMALL LETTER ALPHA 342 226 E2 β GREEK SMALL LETTER BETA 343 227 E3 γ GREEK SMALL LETTER GAMMA @@ -181,7 +141,7 @@ _ 357 239 EF ο GREEK SMALL LETTER OMICRON 360 240 F0 π GREEK SMALL LETTER PI 361 241 F1 ρ GREEK SMALL LETTER RHO -362 242 F2 GREEK SMALL LETTER FINAL SIGMA +362 242 F2 ς GREEK SMALL LETTER FINAL SIGMA 363 243 F3 σ GREEK SMALL LETTER SIGMA 364 244 F4 τ GREEK SMALL LETTER TAU 365 245 F5 υ GREEK SMALL LETTER UPSILON @@ -189,16 +149,13 @@ _ 367 247 F7 χ GREEK SMALL LETTER CHI 370 248 F8 ψ GREEK SMALL LETTER PSI 371 249 F9 ω GREEK SMALL LETTER OMEGA -372 250 FA GREEK SMALL LETTER IOTA WITH DIALYTIKA -373 251 FB GREEK SMALL LETTER UPSILON WITH DIALYTIKA -374 252 FC GREEK SMALL LETTER OMICRON WITH TONOS -375 253 FD GREEK SMALL LETTER UPSILON WITH TONOS -376 254 FE GREEK SMALL LETTER OMEGA WITH TONOS +372 250 FA ϊ GREEK SMALL LETTER IOTA WITH DIALYTIKA +373 251 FB ϋ GREEK SMALL LETTER UPSILON WITH DIALYTIKA +374 252 FC ό GREEK SMALL LETTER OMICRON WITH TONOS +375 253 FD ύ GREEK SMALL LETTER UPSILON WITH TONOS +376 254 FE ώ GREEK SMALL LETTER OMEGA WITH TONOS .TE -.\"O .SH NOTES .SH 備考 -.\"O ISO 8859-7 was formerly known as ELOT-928 or ECMA-118:1986. -ISO 8859-7 は以前は ELOT-928 とか ECMA-118:1986 と呼ばれていた。 -.\"O .SH "SEE ALSO" +ISO 8859\-7 は以前は ELOT\-928 や ECMA\-118:1986 とも呼ばれていた。 .SH 関連項目 -.BR ascii (7) +\fBascii\fP(7) diff --git a/draft/man7/iso_8859-8.7 b/draft/man7/iso_8859-8.7 new file mode 100644 index 00000000..e086fd33 --- /dev/null +++ b/draft/man7/iso_8859-8.7 @@ -0,0 +1,132 @@ +.\" t -*- coding: UTF-8 -*- +.\" Copyright 2009 Lefteris Dimitroulakis (edimitro@tee.gr) +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.\" +.\" Eli Zaretskii made valuable suggestions +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ISO_8859\-8 7 2010\-09\-20 Linux "Linux Programmer's Manual" +.SH 名前 +iso_8859\-8 \- ISO 8859\-8 文字集合の 8 進数、10 進数、16 進数による符号化 +.SH 説明 +ISO 8859 規格は ASCII 文字集合 (ISO 646\-IRV とも呼ばれる) の +いくつかの 8 ビット拡張を含んでいる。ISO 8859\-8、 + "ISO Hebrew (ヘブライ)" は現代ヘブライ語 (Ivrit ともいう) で使用される文字 +を符号化するために使用される。 +短母音も発音区別記号も含まれておらず、イディッシュ語も規定されていない。 +.SS "ISO 8859 アルファベット" +完全な ISO 8859 アルファベットは以下のものを含んでいる: +.TS +l l. +ISO 8859\-1 西ヨーロッパの言語 (Latin\-1) +ISO 8859\-2 中央および東ヨーロッパの言語 (Latin\-2) +ISO 8859\-3 東南ヨーロッパやその他の言語 (Latin\-3) +ISO 8859\-4 スカンジナビア/バルト語派の言語 (Latin\-4) +ISO 8859\-5 ラテン/キリル文字 +ISO 8859\-6 ラテン/アラビア語 +ISO 8859\-7 ラテン/ギリシャ語 +ISO 8859\-8 ラテン/ヘブライ語 +ISO 8859\-9 トルコ語修正を行なった Latin\-1 (Latin\-5) +ISO 8859\-10 ラップ/ノルディック/エスキモーの言語 (Latin\-6) +ISO 8859\-11 ラテン/タイ語 +ISO 8859\-13 バルト諸国の言語 (Latin\-7) +ISO 8859\-14 ケルト語 (Latin\-8) +ISO 8859\-15 西ヨーロッパの言語 (Latin\-9) +ISO 8859\-16 ルーマニア語 (Latin\-10) +.TE +.SS "ISO 8859\-8 文字" +以下の表は ISO 8859\-8 の表示可能な文字のうち +\fBascii\fP(7) マニュアルページに載っていないものを示している。 +4列目は ISO 8859\-8 用に設定された環境でのみ正しく表示できるだろう。 +.TS +l l l c lp-1. +Oct Dec Hex Char Description +_ +240 160 A0 NO\-BREAK SPACE +242 162 A2 ¢ CENT SIGN +243 163 A3 £ POUND SIGN +244 164 A4 ¤ CURRENCY SIGN +245 165 A5 Â¥ YEN SIGN +246 166 A6 ¦ BROKEN BAR +247 167 A7 § SECTION SIGN +250 168 A8 ¨ DIAERESIS +251 169 A9 © COPYRIGHT SIGN +252 170 AA × MULTIPLICATION SIGN +253 171 AB « LEFT\-POINTING DOUBLE ANGLE QUOTATION MARK +254 172 AC ¬ NOT SIGN +255 173 AD ­ SOFT HYPHEN +256 174 AE ® REGISTERED SIGN +257 175 AF ¯ MACRON +260 176 B0 ° DEGREE SIGN +261 177 B1 ± PLUS\-MINUS SIGN +262 178 B2 ² SUPERSCRIPT TWO +263 179 B3 ³ SUPERSCRIPT THREE +264 180 B4 ´ ACUTE ACCENT +265 181 B5 µ MICRO SIGN +266 182 B6 ¶ PILCROW SIGN +267 183 B7 · MIDDLE DOT +270 184 B8 ¸ CEDILLA +271 185 B9 ¹ SUPERSCRIPT ONE +272 186 BA ÷ DIVISION SIGN +273 187 BB » RIGHT\-POINTING DOUBLE ANGLE QUOTATION MARK +274 188 BC ¼ VULGAR FRACTION ONE QUARTER +275 189 BD ½ VULGAR FRACTION ONE HALF +276 190 BE ¾ VULGAR FRACTION THREE QUARTERS +337 223 DF ‗ DOUBLE LOW LINE +340 224 E0 א HEBREW LETTER ALEF +341 225 E1 ב HEBREW LETTER BET +342 226 E2 ג HEBREW LETTER GIMEL +343 227 E3 ד HEBREW LETTER DALET +344 228 E4 ה HEBREW LETTER HE +345 229 E5 ו HEBREW LETTER VAV +346 230 E6 ז HEBREW LETTER ZAYIN +347 231 E7 ח HEBREW LETTER HET +350 232 E8 ט HEBREW LETTER TET +351 233 E9 י HEBREW LETTER YOD +352 234 EA ך HEBREW LETTER FINAL KAF +353 235 EB כ HEBREW LETTER KAF +354 236 EC ל HEBREW LETTER LAMED +355 237 ED ם HEBREW LETTER FINAL MEM +356 238 EE מ HEBREW LETTER MEM +357 239 EF ן HEBREW LETTER FINAL NUN +360 240 F0 ×  HEBREW LETTER NUN +361 241 F1 ס HEBREW LETTER SAMEKH +362 242 F2 ×¢ HEBREW LETTER AYIN +363 243 F3 ×£ HEBREW LETTER FINAL PE +364 244 F4 פ HEBREW LETTER PE +365 245 F5 ×¥ HEBREW LETTER FINAL TSADI +366 246 F6 צ HEBREW LETTER TSADI +367 247 F7 ק HEBREW LETTER QOF +370 248 F8 ר HEBREW LETTER RESH +371 249 F9 ש HEBREW LETTER SHIN +372 250 FA ת HEBREW LETTER TAV +375 253 FD ‎ LEFT\-TO\-RIGHT MARK +376 254 FE ‏ RIGHT\-TO\-LEFT MARK +.TE +.SH 備考 +ISO 8859\-8 は ISO\-IR\-138 としても知られている。 +.SH 関連項目 +\fBascii\fP(7) diff --git a/draft/man7/iso_8859-9.7 b/draft/man7/iso_8859-9.7 index be789066..4f744e88 100644 --- a/draft/man7/iso_8859-9.7 +++ b/draft/man7/iso_8859-9.7 @@ -1,4 +1,4 @@ -'\" t +.\" t -*- coding: UTF-8 -*- .\" Copyright 2002 Dimitri Papadopoulos (dpo@club-internet.fr) .\" .\" This is free documentation; you can redistribute it and/or @@ -20,183 +20,143 @@ .\" License along with this manual; if not, write to the Free .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, .\" USA. +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 2003 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Mon Jan 20 00:58:40 JST 2003 -.\" by Akihiro Motoki -.\" Updated Tue Sep 9 JST 2003 by Akihiro MOTOKI +.\" This file was generated with po4a. Translate the source file. .\" -.TH ISO_8859-9 7 2002-09-24 "Linux" "Linux Programmer's Manual" +.\"******************************************************************* +.TH ISO_8859\-9 7 2002\-09\-24 Linux "Linux Programmer's Manual" .nh -.\"O .SH NAME -.\"O iso_8859-9 \- ISO 8859-9 character set encoded in octal, decimal, -.\"O and hexadecimal .SH 名前 -iso_8859-9 \- ISO 8859-9 文字集合の 8進数、10進数、16進数による符号化 -.\"O .SH DESCRIPTION +iso_8859\-9 \- ISO 8859\-9 文字集合の 8 進数、10 進数、16 進数による符号化 .SH 説明 -.\"O The ISO 8859 standard includes several 8-bit extensions to the ASCII -.\"O character set (also known as ISO 646-IRV). -.\"O ISO 8859-9, also known as -.\"O the "Latin Alphabet No. 5", encodes the characters used in Turkish. -ISO 8859 規格は ASCII 文字集合 (別名、ISO 646-IRV) への 8 ビット拡張 -をいくつか含んでいる。ISO 8859-9 (別名、ラテン・アルファベット No.2) -はトルコ語に使用される文字を符号化している。 -.\"O .SS "ISO 8859 Alphabets" +ISO 8859 規格は ASCII 文字集合 (ISO 646\-IRV とも呼ばれる) の +いくつかの 8 ビット拡張を含んでいる。ISO 8859\-9、 + "ラテン・アルファベット No. 5" はトルコ語の文字を符号化するために使用される。 .SS "ISO 8859 アルファベット" -.\"O The full set of ISO 8859 alphabets includes: 完全な ISO 8859 アルファベットは以下のものを含んでいる: .TS l l. -.\"O ISO 8859-1 West European languages (Latin-1) -.\"O ISO 8859-2 Central and East European languages (Latin-2) -.\"O ISO 8859-3 Southeast European and miscellaneous languages (Latin-3) -.\"O ISO 8859-4 Scandinavian/Baltic languages (Latin-4) -.\"O ISO 8859-5 Latin/Cyrillic -.\"O ISO 8859-6 Latin/Arabic -.\"O ISO 8859-7 Latin/Greek -.\"O ISO 8859-8 Latin/Hebrew -.\"O ISO 8859-9 Latin-1 modification for Turkish (Latin-5) -.\"O ISO 8859-10 Lappish/Nordic/Eskimo languages (Latin-6) -.\"O ISO 8859-11 Latin/Thai -.\"O ISO 8859-13 Baltic Rim languages (Latin-7) -.\"O ISO 8859-14 Celtic (Latin-8) -.\"O ISO 8859-15 West European languages (Latin-9) -.\"O ISO 8859-16 Romanian (Latin-10) -ISO 8859-1 西ヨーロッパの言語 (Latin-1) -ISO 8859-2 中央・東ヨーロッパの言語 (Latin-2) -ISO 8859-3 東南ヨーロッパやその他の言語 (Latin-3) -ISO 8859-4 スカンジナビア/バルト語派の言語 (Latin-4) -ISO 8859-5 ラテン/キリル文字 -ISO 8859-6 ラテン/アラビア文字 -ISO 8859-7 ラテン/ギリシャ文字 -ISO 8859-8 ラテン/ヘブライ語 -ISO 8859-9 トルコ語用に修正を行なった Latin-1 (Latin-5) -ISO 8859-10 ラップ/ノルディック/エスキモーの言語 (Latin-6) -ISO 8859-11 ラテン/タイ語 -ISO 8859-13 バルト諸国の言語 (Latin-7) -ISO 8859-14 ケルト語 (Latin-8) -ISO 8859-15 西ヨーロッパの言語 (Latin-9) -ISO 8859-16 ルーマニア語 (Latin-10) +ISO 8859\-1 西ヨーロッパの言語 (Latin\-1) +ISO 8859\-2 中央および東ヨーロッパの言語 (Latin\-2) +ISO 8859\-3 東南ヨーロッパやその他の言語 (Latin\-3) +ISO 8859\-4 スカンジナビア/バルト語派の言語 (Latin\-4) +ISO 8859\-5 ラテン/キリル文字 +ISO 8859\-6 ラテン/アラビア語 +ISO 8859\-7 ラテン/ギリシャ語 +ISO 8859\-8 ラテン/ヘブライ語 +ISO 8859\-9 トルコ語修正を行なった Latin\-1 (Latin\-5) +ISO 8859\-10 ラップ/ノルディック/エスキモーの言語 (Latin\-6) +ISO 8859\-11 ラテン/タイ語 +ISO 8859\-13 バルト諸国の言語 (Latin\-7) +ISO 8859\-14 ケルト語 (Latin\-8) +ISO 8859\-15 西ヨーロッパの言語 (Latin\-9) +ISO 8859\-16 ルーマニア語 (Latin\-10) .TE -.\"O .SS "ISO 8859-9 Characters" -.SS "ISO 8859-9 文字" -.\"O The following table displays the characters in ISO 8859-9 (Latin-5), -.\"O which are printable and unlisted in the -.\"O .BR ascii (7) -.\"O The fourth column will only show the proper glyphs -.\"O configured for ISO 8859-9. -以下の表は ISO 8859-9 (Latin-5) の表示可能な文字のうち -.BR ascii (7) -マニュアル・ページに載っていないものを示している。 -4列目は ISO 8859-9 用に設定された環境でのみ正しく表示できるだろう。 - -[ 訳注 原文では Char の部分に ISO 8859-9 の文字があったが、 -日本語 EUC との併用は難しいので削除し、JIS X 0208 の同じ文字を -示すようにした。その他の文字に関しては -英語版の iso_8859-9(7) を適切なフォントを準備して参照。 ] +.SS "ISO 8859\-9 文字" +以下の表は ISO 8859\-9 (Latin\-5) の表示可能な文字のうち +\fBascii\fP(7) マニュアルページに載っていないものを示している。 +4列目は ISO 8859\-9 用に設定された環境でのみ正しく表示できるだろう。 .TS l l l c lp-1. Oct Dec Hex Char Description _ -240 160 A0 NO-BREAK SPACE -241 161 A1 INVERTED EXCLAMATION MARK -242 162 A2 CENT SIGN +240 160 A0 \ NO\-BREAK SPACE +241 161 A1 ¡ INVERTED EXCLAMATION MARK +242 162 A2 ¢ CENT SIGN 243 163 A3 £ POUND SIGN -244 164 A4 CURRENCY SIGN -245 165 A5 YEN SIGN -246 166 A6 BROKEN BAR +244 164 A4 ¤ CURRENCY SIGN +245 165 A5 Â¥ YEN SIGN +246 166 A6 ¦ BROKEN BAR 247 167 A7 § SECTION SIGN -250 168 A8 DIAERESIS -251 169 A9 COPYRIGHT SIGN -252 170 AA FEMININE ORDINAL INDICATOR -253 171 AB 《 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +250 168 A8 ¨ DIAERESIS +251 169 A9 © COPYRIGHT SIGN +252 170 AA ª FEMININE ORDINAL INDICATOR +253 171 AB « LEFT\-POINTING DOUBLE ANGLE QUOTATION MARK 254 172 AC ¬ NOT SIGN -255 173 AD SOFT HYPHEN -256 174 AE REGISTERED SIGN -257 175 AF MACRON +255 173 AD ­ SOFT HYPHEN +256 174 AE ® REGISTERED SIGN +257 175 AF ¯ MACRON 260 176 B0 ° DEGREE SIGN -261 177 B1 ± PLUS-MINUS SIGN -262 178 B2 SUPERSCRIPT TWO -263 179 B3 SUPERSCRIPT THREE -264 180 B4 ′ ACUTE ACCENT -265 181 B5 μ MICRO SIGN -266 182 B6 PILCROW SIGN -267 183 B7 ・ MIDDLE DOT -270 184 B8 CEDILLA -271 185 B9 SUPERSCRIPT ONE -272 186 BA MASCULINE ORDINAL INDICATOR -273 187 BB 》 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -274 188 BC 1/4 VULGAR FRACTION ONE QUARTER -275 189 BD 1/2 VULGAR FRACTION ONE HALF -276 190 BE 3/4 VULGAR FRACTION THREE QUARTERS -277 191 BF INVERTED QUESTION MARK -300 192 C0 LATIN CAPITAL LETTER A WITH GRAVE -301 193 C1 LATIN CAPITAL LETTER A WITH ACUTE -302 194 C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX -303 195 C3 LATIN CAPITAL LETTER A WITH TILDE -304 196 C4 LATIN CAPITAL LETTER A WITH DIAERESIS -305 197 C5 LATIN CAPITAL LETTER A WITH RING ABOVE -306 198 C6 LATIN CAPITAL LETTER AE -307 199 C7 LATIN CAPITAL LETTER C WITH CEDILLA -310 200 C8 LATIN CAPITAL LETTER E WITH GRAVE -311 201 C9 LATIN CAPITAL LETTER E WITH ACUTE -312 202 CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX -313 203 CB LATIN CAPITAL LETTER E WITH DIAERESIS -314 204 CC LATIN CAPITAL LETTER I WITH GRAVE -315 205 CD LATIN CAPITAL LETTER I WITH ACUTE -316 206 CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX -317 207 CF LATIN CAPITAL LETTER I WITH DIAERESIS -320 208 D0 LATIN CAPITAL LETTER G WITH BREVE -321 209 D1 LATIN CAPITAL LETTER N WITH TILDE -322 210 D2 LATIN CAPITAL LETTER O WITH GRAVE -323 211 D3 LATIN CAPITAL LETTER O WITH ACUTE -324 212 D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX -325 213 D5 LATIN CAPITAL LETTER O WITH TILDE -326 214 D6 LATIN CAPITAL LETTER O WITH DIAERESIS +261 177 B1 ± PLUS\-MINUS SIGN +262 178 B2 ² SUPERSCRIPT TWO +263 179 B3 ³ SUPERSCRIPT THREE +264 180 B4 ´ ACUTE ACCENT +265 181 B5 µ MICRO SIGN +266 182 B6 ¶ PILCROW SIGN +267 183 B7 · MIDDLE DOT +270 184 B8 ¸ CEDILLA +271 185 B9 ¹ SUPERSCRIPT ONE +272 186 BA º MASCULINE ORDINAL INDICATOR +273 187 BB » RIGHT\-POINTING DOUBLE ANGLE QUOTATION MARK +274 188 BC ¼ VULGAR FRACTION ONE QUARTER +275 189 BD ½ VULGAR FRACTION ONE HALF +276 190 BE ¾ VULGAR FRACTION THREE QUARTERS +277 191 BF ¿ INVERTED QUESTION MARK +300 192 C0 À LATIN CAPITAL LETTER A WITH GRAVE +301 193 C1 Á LATIN CAPITAL LETTER A WITH ACUTE +302 194 C2  LATIN CAPITAL LETTER A WITH CIRCUMFLEX +303 195 C3 à LATIN CAPITAL LETTER A WITH TILDE +304 196 C4 Ä LATIN CAPITAL LETTER A WITH DIAERESIS +305 197 C5 Å LATIN CAPITAL LETTER A WITH RING ABOVE +306 198 C6 Æ LATIN CAPITAL LETTER AE +307 199 C7 Ç LATIN CAPITAL LETTER C WITH CEDILLA +310 200 C8 È LATIN CAPITAL LETTER E WITH GRAVE +311 201 C9 É LATIN CAPITAL LETTER E WITH ACUTE +312 202 CA Ê LATIN CAPITAL LETTER E WITH CIRCUMFLEX +313 203 CB Ë LATIN CAPITAL LETTER E WITH DIAERESIS +314 204 CC Ì LATIN CAPITAL LETTER I WITH GRAVE +315 205 CD Í LATIN CAPITAL LETTER I WITH ACUTE +316 206 CE Î LATIN CAPITAL LETTER I WITH CIRCUMFLEX +317 207 CF Ï LATIN CAPITAL LETTER I WITH DIAERESIS +320 208 D0 Ğ LATIN CAPITAL LETTER G WITH BREVE +321 209 D1 Ñ LATIN CAPITAL LETTER N WITH TILDE +322 210 D2 Ò LATIN CAPITAL LETTER O WITH GRAVE +323 211 D3 Ó LATIN CAPITAL LETTER O WITH ACUTE +324 212 D4 Ô LATIN CAPITAL LETTER O WITH CIRCUMFLEX +325 213 D5 Õ LATIN CAPITAL LETTER O WITH TILDE +326 214 D6 Ö LATIN CAPITAL LETTER O WITH DIAERESIS 327 215 D7 × MULTIPLICATION SIGN -330 216 D8 LATIN CAPITAL LETTER O WITH STROKE -331 217 D9 LATIN CAPITAL LETTER U WITH GRAVE -332 218 DA LATIN CAPITAL LETTER U WITH ACUTE -333 219 DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX -334 220 DC LATIN CAPITAL LETTER U WITH DIAERESIS -335 221 DD LATIN CAPITAL LETTER I WITH DOT ABOVE -336 222 DE LATIN CAPITAL LETTER S WITH CEDILLA -337 223 DF LATIN SMALL LETTER SHARP S -340 224 E0 LATIN SMALL LETTER A WITH GRAVE -341 225 E1 LATIN SMALL LETTER A WITH ACUTE -342 226 E2 LATIN SMALL LETTER A WITH CIRCUMFLEX -343 227 E3 LATIN SMALL LETTER A WITH TILDE -344 228 E4 LATIN SMALL LETTER A WITH DIAERESIS -345 229 E5 LATIN SMALL LETTER A WITH RING ABOVE -346 230 E6 LATIN SMALL LETTER AE -347 231 E7 LATIN SMALL LETTER C WITH CEDILLA -350 232 E8 LATIN SMALL LETTER E WITH GRAVE -351 233 E9 LATIN SMALL LETTER E WITH ACUTE -352 234 EA LATIN SMALL LETTER E WITH CIRCUMFLEX -353 235 EB LATIN SMALL LETTER E WITH DIAERESIS -354 236 EC LATIN SMALL LETTER I WITH GRAVE -355 237 ED LATIN SMALL LETTER I WITH ACUTE -356 238 EE LATIN SMALL LETTER I WITH CIRCUMFLEX -357 239 EF LATIN SMALL LETTER I WITH DIAERESIS -360 240 F0 LATIN SMALL LETTER G WITH BREVE -361 241 F1 LATIN SMALL LETTER N WITH TILDE -362 242 F2 LATIN SMALL LETTER O WITH GRAVE -363 243 F3 LATIN SMALL LETTER O WITH ACUTE -364 244 F4 LATIN SMALL LETTER O WITH CIRCUMFLEX -365 245 F5 LATIN SMALL LETTER O WITH TILDE -366 246 F6 LATIN SMALL LETTER O WITH DIAERESIS +330 216 D8 Ø LATIN CAPITAL LETTER O WITH STROKE +331 217 D9 Ù LATIN CAPITAL LETTER U WITH GRAVE +332 218 DA Ú LATIN CAPITAL LETTER U WITH ACUTE +333 219 DB Û LATIN CAPITAL LETTER U WITH CIRCUMFLEX +334 220 DC Ü LATIN CAPITAL LETTER U WITH DIAERESIS +335 221 DD Ä° LATIN CAPITAL LETTER I WITH DOT ABOVE +336 222 DE Ş LATIN CAPITAL LETTER S WITH CEDILLA +337 223 DF ß LATIN SMALL LETTER SHARP S +340 224 E0 à LATIN SMALL LETTER A WITH GRAVE +341 225 E1 á LATIN SMALL LETTER A WITH ACUTE +342 226 E2 â LATIN SMALL LETTER A WITH CIRCUMFLEX +343 227 E3 ã LATIN SMALL LETTER A WITH TILDE +344 228 E4 ä LATIN SMALL LETTER A WITH DIAERESIS +345 229 E5 Ã¥ LATIN SMALL LETTER A WITH RING ABOVE +346 230 E6 æ LATIN SMALL LETTER AE +347 231 E7 ç LATIN SMALL LETTER C WITH CEDILLA +350 232 E8 è LATIN SMALL LETTER E WITH GRAVE +351 233 E9 é LATIN SMALL LETTER E WITH ACUTE +352 234 EA ê LATIN SMALL LETTER E WITH CIRCUMFLEX +353 235 EB ë LATIN SMALL LETTER E WITH DIAERESIS +354 236 EC ì LATIN SMALL LETTER I WITH GRAVE +355 237 ED í LATIN SMALL LETTER I WITH ACUTE +356 238 EE î LATIN SMALL LETTER I WITH CIRCUMFLEX +357 239 EF ï LATIN SMALL LETTER I WITH DIAERESIS +360 240 F0 ğ LATIN SMALL LETTER G WITH BREVE +361 241 F1 ñ LATIN SMALL LETTER N WITH TILDE +362 242 F2 ò LATIN SMALL LETTER O WITH GRAVE +363 243 F3 ó LATIN SMALL LETTER O WITH ACUTE +364 244 F4 ô LATIN SMALL LETTER O WITH CIRCUMFLEX +365 245 F5 õ LATIN SMALL LETTER O WITH TILDE +366 246 F6 ö LATIN SMALL LETTER O WITH DIAERESIS 367 247 F7 ÷ DIVISION SIGN -370 248 F8 LATIN SMALL LETTER O WITH STROKE -371 249 F9 LATIN SMALL LETTER U WITH GRAVE -372 250 FA LATIN SMALL LETTER U WITH ACUTE -373 251 FB LATIN SMALL LETTER U WITH CIRCUMFLEX -374 252 FC LATIN SMALL LETTER U WITH DIAERESIS -375 253 FD LATIN SMALL LETTER DOTLESS I -376 254 FE LATIN SMALL LETTER S WITH CEDILLA -377 255 FF LATIN SMALL LETTER Y WITH DIAERESIS +370 248 F8 ø LATIN SMALL LETTER O WITH STROKE +371 249 F9 ù LATIN SMALL LETTER U WITH GRAVE +372 250 FA ú LATIN SMALL LETTER U WITH ACUTE +373 251 FB û LATIN SMALL LETTER U WITH CIRCUMFLEX +374 252 FC ü LATIN SMALL LETTER U WITH DIAERESIS +375 253 FD ı LATIN SMALL LETTER DOTLESS I +376 254 FE ş LATIN SMALL LETTER S WITH CEDILLA +377 255 FF ÿ LATIN SMALL LETTER Y WITH DIAERESIS .TE -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR ascii (7) +\fBascii\fP(7) diff --git a/draft/man7/koi8-r.7 b/draft/man7/koi8-r.7 deleted file mode 100644 index 3da692c5..00000000 --- a/draft/man7/koi8-r.7 +++ /dev/null @@ -1,232 +0,0 @@ -'\" t -.\" Copyright 2001 Alexey Mahotkin -.\" -.\" Lots of text ripped from http://koi8.pp.ru/ -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; without even the implied warranty of -.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -.\" GNU General Public License for more details. -.\" -.\" You should have received a copy of the GNU General Public -.\" License along with this manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.\" -.\" Japanese Version Copyright (c) 2001 Yuichi SATO -.\" all rights reserved. -.\" Translated Sat Jul 7 21:41:56 JST 2001 -.\" by Yuichi SATO -.\" -.\"WORD: Cyrillic キリル -.\"WORD: ex-SU 旧ソビエト連邦 -.\"WORD: Ukrainian ウクライナ語 -.\"WORD: Byelorussian ベラルーシ語 -.\" -.TH KOI8-R 7 2010-10-24 "Linux" "Linux Programmer's Manual" -.nh -.\"O .SH NAME -.SH 名前 -.\"O koi8-r \- Russian character set encoded in octal, decimal, and -.\"O hexadecimal -koi8-r \- ロシア語文字集合の 8 進数、10 進数、16 進数による符号化 -.\"O .SH DESCRIPTION -.SH 説明 -.\"O KOI8-R is the character set of choice for encoding Russian texts for -.\"O many UNIX-like operation systems. -.\"O KOI8-R is a successor for KOI-8, a -.\"O de-facto standard for Internet Mail, News, WWW and other interactive -.\"O services at least all over the ex-SU territory. -KOI8-R は多くの UNIX ç³» OS で使われるロシア語文書を符号化する -文字集合の選択枝の一つである。 -KOI8-R は、少なくとも旧ソビエト連邦の全ての圏内において -インターネットのメール・ニュース・WWW・その他の対話的サービスの -事実上の標準であった KOI-8 を継承するものである。 -.PP -.\"O KOI8-R is defined by RFC\ 1489 (Registration of a Cyrillic Character -.\"O Set). -KOI8-R は RFC\ 1489 (キリル文字集合の登録) で定義されている。 -.\"O .SH NOTES -.SH 注意 -.\"O KOI8-R was designed for mixed Russian/English texts and covers -.\"O only Russian Cyrillic characters, so if you're looking for Ukrainian, -.\"O Byelorussian, etc. -.\"O Cyrillic characters, try ISO-IR-111, or KOI8-U -.\"O (Ukrainian Character Set), or KOI8-C (for ancient Russian texts) -.\"O instead, which are identical to KOI8-R in the Russian Cyrillic letters -.\"O area. -KOI8-R はロシア語と英語が混じった文書のためにデザインされ、 -ロシア語キリル文字のみを扱う。 -ウクライナ語やベラルーシ語のキリル文字を使いたいときは、 -ISO-IR-111, KOI8-U (ウクライナ語文字集合), -(古代ロシア語文書のための) KOI8-C などを試すこと。 -これらの文字集合は、ロシア語キリル文字の範囲では KOI8-R と等しい。 -.PP -.\"O A more complete set of Cyrillic characters is also defined by the -.\"O ISO-8859-5 character set. -もっと完全なキリル文字集合は ISO-8859-5 文字集合でも定義されている。 -.\"O .SS "KOI8-R Characters" -.SS "KOI8-R 文字集合" -.\"O The following table displays the characters in KOI8-R, which -.\"O are printable and unlisted in the -.\"O .BR ascii (7) -.\"O manual page. -以下の表は KOI8-R の表示可能な文字のうち -.BR ascii (7) -マニュアル・ページに載っていないものを示している。 - -[ 訳注 原文では Char の部分に KOI8-R の文字があったが、 -日本語 EUC との併用は難しいので削除し、JIS X 0208 の同じ文字を -示すようにした。その他の文字に関しては -英語版の koi8-r(7) を適切なフォントを準備して参照。 ] -.TS -l l l c lp-1. -Oct Dec Hex Char Description -_ -200 128 80 ─ BOX DRAWINGS LIGHT HORIZONTAL -201 129 81 │ BOX DRAWINGS LIGHT VERTICAL -202 130 82 ┌ BOX DRAWINGS LIGHT DOWN AND RIGHT -203 131 83 ┐ BOX DRAWINGS LIGHT DOWN AND LEFT -204 132 84 └ BOX DRAWINGS LIGHT UP AND RIGHT -205 133 85 ┘ BOX DRAWINGS LIGHT UP AND LEFT -206 134 86 ├ BOX DRAWINGS LIGHT VERTICAL AND RIGHT -207 135 87 ┤ BOX DRAWINGS LIGHT VERTICAL AND LEFT -210 136 88 ┬ BOX DRAWINGS LIGHT DOWN AND HORIZONTAL -211 137 89 ┴ BOX DRAWINGS LIGHT UP AND HORIZONTAL -212 138 8A ┼ BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL -213 139 8B UPPER HALF BLOCK -214 140 8C LOWER HALF BLOCK -215 141 8D ■ FULL BLOCK -216 142 8E LEFT HALF BLOCK -217 143 8F RIGHT HALF BLOCK -220 144 90 LIGHT SHADE -221 145 91 MEDIUM SHADE -222 146 92 DARK SHADE -223 147 93 TOP HALF INTEGRAL -224 148 94 BLACK SQUARE -225 149 95 BULLET OPERATOR -226 150 96 √ SQUARE ROOT -227 151 97 ≒ ALMOST EQUAL TO -230 152 98 ≦ LESS-THAN OR EQUAL TO -231 153 99 ≧ GREATER-THAN OR EQUAL TO -232 154 9A NO-BREAK SPACE -233 155 9B BOTTOM HALF INTEGRAL -234 156 9C ゜ DEGREE SIGN -235 157 9D SUPERSCRIPT TWO -236 158 9E ・ MIDDLE DOT -237 159 9F ÷ DIVISION SIGN -240 160 A0 ━ BOX DRAWINGS DOUBLE HORIZONTAL -241 161 A1 ┃ BOX DRAWINGS DOUBLE VERTICAL -242 162 A2 BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE -243 163 A3 ё CYRILLIC SMALL LETTER IO -244 164 A4 BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE -245 165 A5 ┏ BOX DRAWINGS DOUBLE DOWN AND RIGHT -246 166 A6 BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE -247 167 A7 BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE -250 168 A8 ┓ BOX DRAWINGS DOUBLE DOWN AND LEFT -251 169 A9 BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE -252 170 AA BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE -253 171 AB ┗ BOX DRAWINGS DOUBLE UP AND RIGHT -254 172 AC BOX DRAWINGS UP SINGLE AND LEFT DOUBLE -255 173 AD BOX DRAWINGS UP DOUBLE AND LEFT SINGLE -256 174 AE ┛ BOX DRAWINGS DOUBLE UP AND LEFT -257 175 AF ┝ BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE -260 176 B0 ┠ BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE -261 177 B1 ┣ BOX DRAWINGS DOUBLE VERTICAL AND RIGHT -262 178 B2 ┥ BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE -263 179 B3 Ё CYRILLIC CAPITAL LETTER IO -264 180 B4 ┨ BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE -265 181 B5 ┫ BOX DRAWINGS DOUBLE VERTICAL AND LEFT -266 182 B6 ┯ BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE -267 183 B7 ┰ BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE -270 184 B8 ┳ BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL -271 185 B9 ┷ BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE -272 186 BA ┸ BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE -273 187 BB ┻ BOX DRAWINGS DOUBLE UP AND HORIZONTAL -274 188 BC ┿ BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE -275 189 BD ╂ BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE -276 190 BE ╋ BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL -277 191 BF COPYRIGHT SIGN -300 192 C0 ю CYRILLIC SMALL LETTER YU -301 193 C1 а CYRILLIC SMALL LETTER A -302 194 C2 б CYRILLIC SMALL LETTER BE -303 195 C3 ц CYRILLIC SMALL LETTER TSE -304 196 C4 д CYRILLIC SMALL LETTER DE -305 197 C5 е CYRILLIC SMALL LETTER IE -306 198 C6 ф CYRILLIC SMALL LETTER EF -307 199 C7 г CYRILLIC SMALL LETTER GHE -310 200 C8 х CYRILLIC SMALL LETTER HA -311 201 C9 и CYRILLIC SMALL LETTER I -312 202 CA й CYRILLIC SMALL LETTER SHORT I -313 203 CB к CYRILLIC SMALL LETTER KA -314 204 CC л CYRILLIC SMALL LETTER EL -315 205 CD м CYRILLIC SMALL LETTER EM -316 206 CE н CYRILLIC SMALL LETTER EN -317 207 CF о CYRILLIC SMALL LETTER O -320 208 D0 п CYRILLIC SMALL LETTER PE -321 209 D1 я CYRILLIC SMALL LETTER YA -322 210 D2 р CYRILLIC SMALL LETTER ER -323 211 D3 с CYRILLIC SMALL LETTER ES -324 212 D4 т CYRILLIC SMALL LETTER TE -325 213 D5 у CYRILLIC SMALL LETTER U -326 214 D6 ж CYRILLIC SMALL LETTER ZHE -327 215 D7 в CYRILLIC SMALL LETTER VE -330 216 D8 ь CYRILLIC SMALL LETTER SOFT SIGN -331 217 D9 ы CYRILLIC SMALL LETTER YERU -332 218 DA з CYRILLIC SMALL LETTER ZE -333 219 DB ш CYRILLIC SMALL LETTER SHA -334 220 DC э CYRILLIC SMALL LETTER E -335 221 DD щ CYRILLIC SMALL LETTER SHCHA -336 222 DE ч CYRILLIC SMALL LETTER CHE -337 223 DF ъ CYRILLIC SMALL LETTER HARD SIGN -340 224 E0 Ю CYRILLIC CAPITAL LETTER YU -341 225 E1 А CYRILLIC CAPITAL LETTER A -342 226 E2 Б CYRILLIC CAPITAL LETTER BE -343 227 E3 Ц CYRILLIC CAPITAL LETTER TSE -344 228 E4 Д CYRILLIC CAPITAL LETTER DE -345 229 E5 Е CYRILLIC CAPITAL LETTER IE -346 230 E6 Ф CYRILLIC CAPITAL LETTER EF -347 231 E7 Г CYRILLIC CAPITAL LETTER GHE -350 232 E8 Ð¥ CYRILLIC CAPITAL LETTER HA -351 233 E9 И CYRILLIC CAPITAL LETTER I -352 234 EA Й CYRILLIC CAPITAL LETTER SHORT I -353 235 EB К CYRILLIC CAPITAL LETTER KA -354 236 EC Л CYRILLIC CAPITAL LETTER EL -355 237 ED М CYRILLIC CAPITAL LETTER EM -356 238 EE Н CYRILLIC CAPITAL LETTER EN -357 239 EF О CYRILLIC CAPITAL LETTER O -360 240 F0 П CYRILLIC CAPITAL LETTER PE -361 241 F1 Я CYRILLIC CAPITAL LETTER YA -362 242 F2 Р CYRILLIC CAPITAL LETTER ER -363 243 F3 С CYRILLIC CAPITAL LETTER ES -364 244 F4 Т CYRILLIC CAPITAL LETTER TE -365 245 F5 У CYRILLIC CAPITAL LETTER U -366 246 F6 Ж CYRILLIC CAPITAL LETTER ZHE -367 247 F7 В CYRILLIC CAPITAL LETTER VE -370 248 F8 Ь CYRILLIC CAPITAL LETTER SOFT SIGN -371 249 F9 Ы CYRILLIC CAPITAL LETTER YERU -372 250 FA З CYRILLIC CAPITAL LETTER ZE -373 251 FB Ш CYRILLIC CAPITAL LETTER SHA -374 252 FC Э CYRILLIC CAPITAL LETTER E -375 253 FD Щ CYRILLIC CAPITAL LETTER SHCHA -376 254 FE Ч CYRILLIC CAPITAL LETTER CHE -377 255 FF Ъ CYRILLIC CAPITAL LETTER HARD SIGN - -.TE -.\"O .SH SEE ALSO -.SH 関連項目 -.BR ascii (7), -.BR iso-8859-5 (7), -.BR koi8-u (7), -RFC\ 1489, -http://koi8.pp.ru/ diff --git a/draft/man7/mailaddr.7 b/draft/man7/mailaddr.7 index d94401ce..025201be 100644 --- a/draft/man7/mailaddr.7 +++ b/draft/man7/mailaddr.7 @@ -23,161 +23,78 @@ .\" account for changes since 1995. Route-addrs are now even less .\" common, etc. Some minor wording improvements. Same copyright. .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1997-06-03, HANATAKA Shinya -.\" Modified 2005-02-21, Akihiro MOTOKI +.\"******************************************************************* .\" -.TH MAILADDR 7 2004-09-15 "Linux" "Linux User's Manual" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH MAILADDR 7 2004\-09\-15 Linux "Linux User's Manual" .UC 5 -.\"O .SH NAME .SH 名前 -.\"O mailaddr \- mail addressing description mailaddr \- メール・アドレスの説明 -.\"O .SH DESCRIPTION .SH 説明 .nh -.\"O This manual page gives a brief introduction to SMTP mail addresses, as -.\"O used on the Internet. -.\"O These addresses are in the general format -.\"O .PP -.\"O user@domain -.\"O .PP -.\"O where a domain is a hierarchical dot-separated list of subdomains. -.\"O These examples are valid forms of the same address: -このマニュアル・ページでは、インターネットで使用される SMTP メール・ -アドレスの簡単な紹介を行う。メール・アドレスは一般的には +このマニュアル・ページでは、インターネットで使用される SMTP メール・ アドレスの簡単な紹介を行う。メール・アドレスは一般的には .PP - user@domain + user@domain .PP -の形である。 -domain はサブ・ドメインの階層を ドット (.) で -区切ってつないだものである。 -以下の例は全て同じアドレスの正しい表記法である: +の形である。 domain はサブ・ドメインの階層を ドット (.) で 区切ってつないだものである。 以下の例は全て同じアドレスの正しい表記法である: .PP - eric@monet.berkeley.edu + eric@monet.berkeley.edu .br - Eric Allman + Eric Allman .br - eric@monet.berkeley.edu (Eric Allman) + eric@monet.berkeley.edu (Eric Allman) .PP -.\"O The domain part ("monet.berkeley.edu") is a mail-accepting domain. -.\"O It can be a host and in the past it usually was, but it doesn't have to be. -.\"O The domain part is not case sensitive. ドメイン部分 ("monet.berkeley.edu") はメールを受信するドメインである。 -ドメインはホスト名であってもよく、以前はホスト名が普通であったが、 -そうである必要はない。ドメイン部分は大文字、小文字の区別はされない。 +ドメインはホスト名であってもよく、以前はホスト名が普通であったが、 そうである必要はない。ドメイン部分は大文字、小文字の区別はされない。 .PP -.\"O The local part ("eric") is often a username, but its meaning is -.\"O defined by the local software. -.\"O Sometimes it is case sensitive, -.\"O although that is unusual. -.\"O If you see a local-part that looks like -.\"O garbage, it is usually because of a gateway between an internal e-mail -.\"O system and the net, here are some examples: -ローカル部分 ("eric") は普通はユーザーの名前であるが、 -その意味はローカルなソフトウェアによって定義される。 -大文字、小文字を区別してもよいが、普通は区別されない。 -ローカル部分がゴミのように見える場合は、それはたいて内部的な電子メール -システムとインターネットの間にあるゲートウェイのせいである。 -例えば、以下のようなものがある。 +ローカル部分 ("eric") は普通はユーザーの名前であるが、 その意味はローカルなソフトウェアによって定義される。 +大文字、小文字を区別してもよいが、普通は区別されない。 ローカル部分がゴミのように見える場合は、それはたいて内部的な電子メール +システムとインターネットの間にあるゲートウェイのせいである。 例えば、以下のようなものがある。 .PP - "surname/admd=telemail/c=us/o=hp/prmd=hp"@some.where + "surname/admd=telemail/c=us/o=hp/prmd=hp"@some.where .br - USER%SOMETHING@some.where + USER%SOMETHING@some.where .br - machine!machine!name@some.where + machine!machine!name@some.where .br - I2461572@some.where + I2461572@some.where .PP -.\"O (These are, respectively, an X.400 gateway, a gateway to an arbitrary -.\"O internal mail system that lacks proper internet support, an UUCP -.\"O gateway, and the last one is just boring username policy.) -(それぞれ、X.400 ゲートウェイ、 -正しいインターネットサポートを欠いた勝手な内部メールシステム、 -UUCP ゲートウェイでの例である。 +(それぞれ、X.400 ゲートウェイ、 正しいインターネットサポートを欠いた勝手な内部メールシステム、 UUCP ゲートウェイでの例である。 最後のは単に間抜けなユーザー名である。) .PP -.\"O The real-name part ("Eric Allman") can either be placed before -.\"O <>, or in () at the end. -.\"O (Strictly speaking the two aren't the same, -.\"O but the difference is beyond the scope of this page.) -.\"O The name may have to be quoted using "", for example, if it contains ".": 実名部分 ("Eric Allman") は <> の前に置くこともできるし、 -()に入れて最後に置くこともできる。(厳密に言うと、二つは全く同じ -わけではないが、その違いはこのページの目的から外れるので言及しない。) -例えば "." などの文字を含む場合には名前を "" で括る必要がある: +()に入れて最後に置くこともできる。(厳密に言うと、二つは全く同じ わけではないが、その違いはこのページの目的から外れるので言及しない。) 例えば +"." などの文字を含む場合には名前を "" で括る必要がある: .PP - "Eric P. Allman" -.\"O .SS Abbreviation. + "Eric P. Allman" .SS 省略形 .PP -.\"O Many mail systems let users abbreviate the domain name. -.\"O For instance, -.\"O users at berkeley.edu may get away with "eric@monet" to send mail to -.\"O Eric Allman. -.\"O .I "This behavior is deprecated." -.\"O Sometimes it works, but you should not depend on it. -多くのメール・システムがドメイン名の省略形を許している。 -例えば berkeley.edu のユーザーは Eric Allman にメールを送るために -"eric@monet" が使用できるかもしれない。 -『この動作は推奨されるものではない』 -正しく動作する場合もあるが、それをあてにすべきではない。 -.\"O .SS Route-addrs. +多くのメール・システムがドメイン名の省略形を許している。 例えば berkeley.edu のユーザーは Eric Allman にメールを送るために +"eric@monet" が使用できるかもしれない。 『この動作は推奨されるものではない』 正しく動作する場合もあるが、それをあてにすべきではない。 .SS 経路アドレス .PP -.\"O In the past, sometimes one had to route a message through -.\"O several hosts to get it to its final destination. -.\"O Addresses which -.\"O show these relays are termed "route-addrs". -.\"O These use the syntax: -以前は、メッセージが最終目的地へ到達するために通過するホストを -指定しなければならないことが時々あった。 -中継点を指定したアドレスを "経路アドレス (route-addrs)" という。 -以下の書式を使用する: +以前は、メッセージが最終目的地へ到達するために通過するホストを 指定しなければならないことが時々あった。 中継点を指定したアドレスを "経路アドレス +(route\-addrs)" という。 以下の書式を使用する: .PP - <@hosta,@hostb:user@hostc> + <@hosta,@hostb:user@hostc> .PP -.\"O This specifies that the message should be sent to hosta, from there -.\"O to hostb, and finally to hostc. -.\"O Many hosts disregard route-addrs -.\"O and send directly to hostc. これは通信文を hosta に送り、そこから hostb に送り、最終的に hostc に -送ることを指定している。多くのホストは経路アドレスを無視して直接 hostc -に送る。 +送ることを指定している。多くのホストは経路アドレスを無視して直接 hostc に送る。 .PP -.\"O Route-addrs are very unusual now. -.\"O They occur sometimes in old mail -.\"O archives. -.\"O It is generally possible to ignore all but the "user@hostc" -.\"O part of the address to determine the actual address. -今では経路アドレスが使われることはほとんどない。 -古いメール・アーカイブで時々に目にすることがある。 -一般には実際のアドレスを求めるために "user@hostc" 以外の全て部分を無視 -することもできる。 -.\"O .SS Postmaster. +今では経路アドレスが使われることはほとんどない。 古いメール・アーカイブで時々に目にすることがある。 一般には実際のアドレスを求めるために +"user@hostc" 以外の全て部分を無視 することもできる。 .SS "ポストマスター (postmaster)" .PP -.\"O Every site is required to have a user or user alias designated -.\"O "postmaster" to which problems with the mail system may be -.\"O addressed. -.\"O The "postmaster" address is not case sensitive. -全てのサイトは、メール・システムの問題を知らせる宛て先として、 -"postmaster" というユーザか別名定義 (alias) を用意しなければ +全てのサイトは、メール・システムの問題を知らせる宛て先として、 "postmaster" というユーザか別名定義 (alias) を用意しなければ ならない。 "postmaster" のアドレスは大文字、小文字の区別はされない。 -.\"O .SH FILES .SH ファイル -.I /etc/aliases +\fI/etc/aliases\fP .br -.I ~/.forward -.\"O .SH "SEE ALSO" +\fI~/.forward\fP .SH 関連項目 -.BR binmail (1), -.BR mail (1), -.BR mconnect (1), -.BR aliases (5), -.BR forward (5), -.BR sendmail (8), -.BR vrfy (8) +\fBbinmail\fP(1), \fBmail\fP(1), \fBmconnect\fP(1), \fBaliases\fP(5), \fBforward\fP(5), +\fBsendmail\fP(8), \fBvrfy\fP(8) RFC\ 2822 (Internet Message Format) diff --git a/draft/man7/man-pages.7 b/draft/man7/man-pages.7 index f0bf1eef..9ea1a752 100644 --- a/draft/man7/man-pages.7 +++ b/draft/man7/man-pages.7 @@ -25,924 +25,354 @@ .\" 2007-05-30 created by mtk, using text from old man.7 plus .\" rewrites and additional text. .\" -.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI -.\" all rights reserved. -.\" Translated 2007-06-13, Akihiro MOTOKI , LDP v2.54 -.\" Updated 2007-07-04, Akihiro MOTOKI , LDP v2.59 -.\" Updated 2007-09-03, Akihiro MOTOKI , LDP v2.64 -.\" Updated 2008-08-09, Akihiro MOTOKI , LDP v3.05 -.\" -.TH MAN-PAGES 7 2008-10-28 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH MAN\-PAGES 7 2008\-10\-28 Linux "Linux Programmer's Manual" .SH 名前 -.\"O man-pages \- conventions for writing Linux man pages -man-pages \- Linux の man ページを書く際の決まり事 -.\"O .SH SYNOPSIS +man\-pages \- Linux の man ページを書く際の決まり事 .SH 書式 -.B man -.RI [ section ] -.I title -.\"O .SH DESCRIPTION +\fBman\fP [\fIsection\fP] \fItitle\fP .SH 説明 -.\"O This page describes the conventions that should be employed -.\"O when writing man pages for the Linux \fIman-pages\fP project, -.\"O which comprises Sections 2, 3, 4, 5, and 7 of the Linux manual pages. -.\"O The conventions described on this page may also be useful -.\"O for authors writing man pages for other projects. -このページでは、 -Linux \fIman-pages\fP プロジェクトのマニュアルページを書く際に -従うべき決まり事について説明する。 -Linux \fIman-pages\fP は Linux のマニュアルページの -セクション 2, 3, 4, 5, 7 から構成されている。 -このページで説明されている決まり事は、他のプロジェクトの -マニュアルページを書く作者にも役立つことだろう。 -.\"O .SS Sections of the Manual Pages +このページでは、 Linux \fIman\-pages\fP プロジェクトのマニュアルページを書く際に 従うべき決まり事について説明する。 Linux +\fIman\-pages\fP は Linux のマニュアルページの セクション 2, 3, 4, 5, 7 から構成されている。 +このページで説明されている決まり事は、他のプロジェクトの マニュアルページを書く作者にも役立つことだろう。 .SS マニュアルページのセクション .PP -.\"O The manual Sections are traditionally defined as follows: マニュアルのセクションは、習慣的に以下のような定義が用いられている: -.TP 10 -.\"O .B 1 Commands (Programs) -.\"O Those commands that can be executed by the user from within -.\"O a shell. -.B 1 コマンド (プログラム) +.TP 10 +\fB1 コマンド (プログラム)\fP シェルの中からユーザが実行できるコマンド。 -.TP -.\"O .B 2 System calls -.\"O Those functions which must be performed by the kernel. -.B 2 システムコール +.TP +\fB2 システムコール\fP カーネルが処理しなければならない関数。 -.TP -.\"O .B 3 Library calls -.\"O Most of the -.\"O .I libc -.\"O functions. -.B 3 ライブラリコール -.I libc -の関数の大部分。 -.TP -.\"O .B 4 Special files (devices) -.\"O Files found in -.\"O .IR /dev . -.B 4 スペシャルファイル (デバイス) -.I /dev -以下にあるファイル。 -.TP -.\"O .B 5 File formats and conventions -.\"O The format for -.\"O .I /etc/passwd -.\"O and other human-readable files. -.B 5 ファイルのフォーマットと規約 -.I /etc/passwd -などの人が読めるファイルのフォーマット。 -.TP -.\"O .B 6 Games -.B 6 ゲーム -.TP -.\"O .B 7 Conventions and miscellaneous -.\"O Overviews of various topics, conventions and protocols, -.\"O character set standards, and miscellaneous other things. -.B 7 約束事その他 +.TP +\fB3 ライブラリコール\fP +\fIlibc\fP の関数の大部分。 +.TP +\fB4 スペシャルファイル (デバイス)\fP +\fI/dev\fP 以下にあるファイル。 +.TP +\fB5 ファイルのフォーマットと規約\fP +\fI/etc/passwd\fP などの人が読めるファイルのフォーマット。 +.TP +\fB6 ゲーム\fP +.TP +\fB7 約束事その他\fP 様々な事柄の概要、慣習、プロトコル、文字集合の規格、その他雑多なこと。 -.TP -.\"O .B 8 System management commands -.\"O Commands like -.\"O .BR mount (8), -.\"O many of which only root can execute. -.B 8 システム管理コマンド -.BR mount (8) -のような root のみが実行可能なコマンド。 +.TP +\fB8 システム管理コマンド\fP .\" .TP -.\"O .\" .B 9 Kernel routines -.\"O .\" This is an obsolete manual section. -.\"O .\" Once it was thought a good idea to document the Linux kernel here, -.\"O .\" but in fact very little has been documented, and the documentation -.\"O .\" that exists is outdated already. -.\"O .\" There are better sources of -.\"O .\" information for kernel developers. -.\" .B 9 カーネルルーチン -.\" このマニュアルセクションは廃止された。 -.\" かつてはここに Linux カーネルのドキュメントを置くのが良いことだと -.\" 考えられていた。しかし、文書化されたものは非常に少なく、 -.\" またそれらもすでに古いものとなってしまった。 -.\" カーネル開発者にとって、もっとよい情報源が他にあるだろう。 -.\"O .SS Macro package +.\" .B 9 Kernel routines +.\" This is an obsolete manual section. +.\" Once it was thought a good idea to document the Linux kernel here, +.\" but in fact very little has been documented, and the documentation +.\" that exists is outdated already. +.\" There are better sources of +.\" information for kernel developers. +\fBmount\fP(8) のような root のみが実行可能なコマンド。 .SS マクロパッケージ -.\"O New manual pages should be marked up using the -.\"O .B groff an.tmac -.\"O package described in -.\"O .BR man (7). -.\"O This choice is mainly for consistency: the vast majority of -.\"O existing Linux manual pages are marked up using these macros. -新しいマニュアルページは -.BR man (7) -で説明されている -.B groff an.tmac -パッケージを使って記述すべきである。 -この方針は一貫性の確保が主な理由である。既存の Linux のマニュアルページ -の圧倒的多数がこれらのマクロを使って記述されている。 -.\"O .SS Conventions for source file layout +新しいマニュアルページは \fBman\fP(7) で説明されている \fBgroff an.tmac\fP パッケージを使って記述すべきである。 +この方針は一貫性の確保が主な理由である。既存の Linux のマニュアルページ の圧倒的多数がこれらのマクロを使って記述されている。 .SS ソースファイルの配置に関する決まり事 -.\"O Please limit source code line length to no more than about 75 characters -.\"O wherever possible. -.\"O This helps avoid line-wrapping in some mail clients when patches are -.\"O submitted inline. -マニュアルページのソースコードの 1行の長さは -可能な限り 75文字を越えないようにしてほしい。 -こうすることで、パッチをメール本文に載せて送る場合に、 +マニュアルページのソースコードの 1行の長さは 可能な限り 75文字を越えないようにしてほしい。 こうすることで、パッチをメール本文に載せて送る場合に、 メールクライアントによる行折り返しを回避することができる。 -.\"O New sentences should be started on new lines. -.\"O This makes it easier to see the effect of patches, -.\"O which often operate at the level of individual sentences. -新しい文は行頭から開始する。 -これにより、パッチの内容を確認しやすくなる。 -パッチは文単位であることが多いからである。 -.\"O .SS Title line +新しい文は行頭から開始する。 これにより、パッチの内容を確認しやすくなる。 パッチは文単位であることが多いからである。 .SS タイトル行 -.\"O The first command in a man page should be a \fBTH\fP command: man ページの最初の行は \fBTH\fP コマンドにすべきである。 .RS .sp -.B \&.TH -.I "title section date source manual" +\fB\&.TH\fP \fItitle section date source manual\fP .sp .RE -.\"O where: 個々の説明: .RS -.TP 10 -.I title -.\"O The title of the man page, written in all caps (e.g., -.\"O .IR MAN-PAGES ). -man ページのタイトル。全部大文字で記載する (例: -.IR MAN-PAGES )。 -.TP -.I section -.\"O The section number in which the man page should be placed (e.g., -.\"O .IR 7 ). -man ページが属するセクション番号 (例: -.IR 7 )。 -.TP -.I date -.\"O The date of the last revision\(emremember to change this every time a -.\"O change is made to the man page, -.\"O since this is the most general way of doing version control. -.\"O Dates should be written in the form YYYY-MM-DD. -最新のリビジョンの日付\(emman ページに変更を加えたときには -必ずこれを変更すること。 -これが最も一般的なバージョン管理方法である。 -日付は YYYY-MM-DD の形式で記載すべきである。 -.TP -.I source -.\"O The source of the command, function, or system call. +.TP 10 +\fItitle\fP +man ページのタイトル。全部大文字で記載する (例: \fIMAN\-PAGES\fP)。 +.TP +\fIsection\fP +man ページが属するセクション番号 (例: \fI7\fP)。 +.TP +\fIdate\fP +最新のリビジョンの日付\(emman ページに変更を加えたときには 必ずこれを変更すること。 これが最も一般的なバージョン管理方法である。 日付は +YYYY\-MM\-DD の形式で記載すべきである。 +.TP +\fIsource\fP コマンド、関数、システムコールの出自。 -.\"O For those few \fIman-pages\fP pages in Sections 1 and 8, -.\"O probably you just want to write -.\"O .IR GNU . -数少ないセクション 1 と 8 のページの場合、おそらく単に -.I GNU -とだけ書くことが多いだろう。 +数少ないセクション 1 と 8 のページの場合、おそらく単に \fIGNU\fP とだけ書くことが多いだろう。 -.\"O For system calls, just write -.\"O .IR "Linux" . -.\"O (An earlier practice was to write the version number -.\"O of the kernel from which the manual page was being written/checked. -.\"O However, this was never done consistently, and so was -.\"O probably worse than including no version number. -.\"O Henceforth, avoid including a version number.) -システムコールの場合、単に -.I "Linux" -とだけ書く。 -(以前の慣習では、マニュアルページを記載した/内容を確認したカーネルの -バージョン番号を記載していた。しかし、バージョン番号が実際の内容と -一致していることはなく、そのためバージョン番号がないよりも -おそらく悪い形になっていた。 -今後は、バージョン番号を含めるのは避けること。) +システムコールの場合、単に \fILinux\fP とだけ書く。 (以前の慣習では、マニュアルページを記載した/内容を確認したカーネルの +バージョン番号を記載していた。しかし、バージョン番号が実際の内容と 一致していることはなく、そのためバージョン番号がないよりも +おそらく悪い形になっていた。 今後は、バージョン番号を含めるのは避けること。) -.\"O For library calls that are part of glibc or one of the -.\"O other common GNU libraries, just use -.\"O .IR "GNU C Library" ", " GNU , -.\"O or an empty string. -glibc のライブラリコールや -その他の一般的な GNU ライブラリのライブラリコールの場合、 -単に -.IR "GNU C Library" ", " GNU +glibc のライブラリコールや その他の一般的な GNU ライブラリのライブラリコールの場合、 単に \fIGNU C Library\fP, \fIGNU\fP と書くか、空の文字列を使う。 -.\"O For Section 4 pages, use -.\"O .IR "Linux" . -セクション 4 のページでは -.I "Linux" -を使う。 +セクション 4 のページでは \fILinux\fP を使う。 -.\"O In cases of doubt, just write -.\"O .IR Linux ", or " GNU . -よくわからない場合は、 -.I Linux -とか -.I GNU -と書いておく。 -.TP -.I manual -.\"O The title of the manual (e.g., for Section 2 and 3 pages in -.\"O the \fIman-pages\fP package, use -.\"O .IR "Linux Programmer's Manual" ). -マニュアルのタイトル (例: -\fIman-pages\fP パッケージのセクション 2 および 3 のページの場合には、 -.I "Linux Programmer's Manual" -を使うこと)。 +よくわからない場合は、 \fILinux\fP とか \fIGNU\fP と書いておく。 +.TP +\fImanual\fP +マニュアルのタイトル (例: \fIman\-pages\fP パッケージのセクション 2 および 3 のページの場合には、 \fILinux +Programmer's Manual\fP を使うこと)。 .RE -.\"O .SS Sections within a manual page .SS マニュアルページのセクション -.\"O The list below shows conventional or suggested sections. -.\"O Most manual pages should include at least the -.\"O .B highlighted -.\"O sections. -.\"O Arrange a new manual page so that sections -.\"O are placed in the order shown in the list. -昔から使われてきたセクション名を以下のリストに示す。 -これらを使うと良いだろう。 -一般的に、マニュアルページは、少なくとも -.B 色つき -のセクションを持つのが望ましい。 -新しくマニュアルページを作成する際には、だいたい以下のリストに示した -順序でセクションを配置するようにしてもらいたい。 +昔から使われてきたセクション名を以下のリストに示す。 これらを使うと良いだろう。 一般的に、マニュアルページは、少なくとも \fB色つき\fP +のセクションを持つのが望ましい。 新しくマニュアルページを作成する際には、だいたい以下のリストに示した 順序でセクションを配置するようにしてもらいたい。 .in +0.5i .nf -.\"O \fBNAME\fP +.\" May 07: Few current man pages have an ERROR HANDLING section,,, +.\" ERROR HANDLING, +.\" May 07: Almost no current man pages have a USAGE section,,, +.\" USAGE, +.\" DIAGNOSTICS, +.\" May 07: Almost no current man pages have a SECURITY section,,, +.\" SECURITY, +.\" AUTHORS sections are discouraged +.\" AUTHORS [Discouraged] \fB名前\fP -.\"O \fBSYNOPSIS\fP \fB書式\fP -.\"O CONFIGURATION [Normally only in Section 4] 設定 [通常はセクション 4 のみ] -.\"O \fBDESCRIPTION\fP \fB説明\fP -.\"O OPTIONS [Normally only in Sections 1, 8] オプション [通常はセクション 1, 8 のみ] -.\"O EXIT STATUS [Normally only in Sections 1, 8] 終了ステータス [通常はセクション 1, 8 のみ] -.\"O RETURN VALUE [Normally only in Sections 2, 3] 返り値 [通常はセクション 2, 3 のみ] -.\" May 07: Few current man pages have an ERROR HANDLING section,,, -.\"O .\" ERROR HANDLING, -.\" エラー処理 -.\"O ERRORS [Typically only in Sections 2, 3] エラー [たいていはセクション 2, 3 のみ] -.\" May 07: Almost no current man pages have a USAGE section,,, -.\"O .\" USAGE, -.\" 利用法 -.\"O .\" DIAGNOSTICS, -.\" 診断メッセージ -.\" May 07: Almost no current man pages have a SECURITY section,,, -.\"O .\" SECURITY, -.\" セキュリティ -.\"O ENVIRONMENT 環境変数 -.\"O FILES ファイル -.\"O VERSIONS [Normally only in Sections 2, 3] バージョン [通常はセクション 2, 3 のみ] -.\"O CONFORMING TO 準拠 -.\"O NOTES 注意/備考 -.\"O BUGS バグ -.\"O EXAMPLE 例 -.\"O .\" AUTHORS sections are discouraged -.\"O .\" AUTHORS [Discouraged] -.\" 著者 セクションは非推奨である -.\" 著者 -.\"O \fBSEE ALSO\fP \fB関連項目\fP .fi .in -.\"O .IR "Where a traditional heading would apply" ", " "please use it" ; -.\"O this kind of consistency can make the information easier to understand. -.\"O If you must, you can create your own -.\"O headings if they make things easier to understand (this can -.\"O be especially useful for pages in Sections 4 and 5). -.\"O However, before doing this, consider whether you could use the -.\"O traditional headings, with some subsections (\fI.SS\fP) within -.\"O those sections. -「伝統的に使われてきた見出しが使える場合には、それを使ってほしい。」 -この種の一貫性を保つことで、情報を理解しやすくなるからである。 -どうしても必要な場合には、理解しやすくなるように独自の見出しを -作ってもよい (特にセクション 4 や 5 のページではこうした方が -わかりやすくなる)。ただし、そうする前に、伝統的な見出しを使い、 -そのセクション内にサブセクション (\fI.SS\fP) を設けることで +「伝統的に使われてきた見出しが使える場合には、それを使ってほしい。」 この種の一貫性を保つことで、情報を理解しやすくなるからである。 +どうしても必要な場合には、理解しやすくなるように独自の見出しを 作ってもよい (特にセクション 4 や 5 のページではこうした方が +わかりやすくなる)。ただし、そうする前に、伝統的な見出しを使い、 そのセクション内にサブセクション (\fI.SS\fP) を設けることで 対応できないか考えてほしい。 -.\"O The following list elaborates on the contents of each of -.\"O the above sections. -以下のリストでは、上記のセクションのそれぞれの内容について -詳しく説明する。 -.TP 14 -.\"O .B NAME -.B 名前 (NAME) -.\"O The name of this manual page. -.\"O See -.\"O .BR man (7) -.\"O for important details of the line(s) that should follow the -.\"O \fB.SH NAME\fP command. -そのマニュアルページの名前。 -\fB.SH NAME\fP コマンドの行が従うべき大事な点については -.BR man (7) -を参照してほしい。 -.TP -.\"O .B SYNOPSIS -.B 書式 (SYNOPSIS) -.\"O briefly describes the command or function's interface. -.\"O For commands, this shows the syntax of the command and its arguments -.\"O (including options); -.\"O boldface is used for as-is text and italics are used to -.\"O indicate replaceable arguments. -.\"O Brackets ([]) surround optional arguments, vertical bars (|) -.\"O separate choices, and ellipses (\&...) can be repeated. -.\"O For functions, it shows any required data declarations or -.\"O .B #include -.\"O directives, followed by the function declaration. -コマンドや関数のインターフェースを簡潔に記述する。 -コマンドに対しては、コマンドや引き数 (オプション) の文法を書く。 -そのまま書くテキストにはボールド体を用い、置き換える引き数には -イタリック体を用いる。省略可能なオプションはブラケット ([]) で囲い、 -選択肢は縦棒 (|) で区切り、繰り返しには省略符号 (...) を書く。 -関数に対しては、必要なデータ宣言や -.B #include -指定を書き、関数宣言を続ける。 +以下のリストでは、上記のセクションのそれぞれの内容について 詳しく説明する。 +.TP 14 +\fB名前 (NAME)\fP +そのマニュアルページの名前。 \fB.SH NAME\fP コマンドの行が従うべき大事な点については \fBman\fP(7) を参照してほしい。 +.TP +\fB書式 (SYNOPSIS)\fP +コマンドや関数のインターフェースを簡潔に記述する。 コマンドに対しては、コマンドや引き数 (オプション) の文法を書く。 +そのまま書くテキストにはボールド体を用い、置き換える引き数には イタリック体を用いる。省略可能なオプションはブラケット ([]) で囲い、 選択肢は縦棒 +(|) で区切り、繰り返しには省略符号 (...) を書く。 関数に対しては、必要なデータ宣言や \fB#include\fP 指定を書き、関数宣言を続ける。 -.\"O Where a feature test macro must be defined in order to obtain -.\"O the declaration of a function (or a variable) from a header file, -.\"O then the SYNOPSIS should indicate this, as described in -.\"O .BR feature_test_macros (7). -ヘッダファイルから関数 (や変数) の定義を得るために -機能検査マクロ (feature test macro) を定義しなければならない場合、 -書式 (SYNOPSIS) に必要な機能検査マクロを記載すべきである。 -機能検査マクロについては -.BR feature_test_macros (7) -で説明されている。 .\" FIXME . Say something here about compiler options -.TP -.B CONFIGURATION -.\"O Configuration details for a device. -.\"O This section normally only appears in Section 4 pages. -デバイスの設定詳細。 -通常、このセクションは 4 章のマニュアルページでのみ登場する。 -.TP -.\"O .B DESCRIPTION -.B 説明 (DESCRIPTION) -.\"O gives an explanation of what the program, function, or format does. -.\"O Discuss how it interacts with files and standard input, and what it -.\"O produces on standard output or standard error. -.\"O Omit internals and implementation details unless they're critical for -.\"O understanding the interface. -.\"O Describe the usual case; -.\"O for information on command-line options of a program use the -.\"O .B OPTIONS -.\"O section. -プログラム・関数・フォーマットの動作・目的を説明する。 -ファイルや標準入力をどのように処理し、標準出力や標準エラー出力を -どのように生成するかといったことについて述べる。 -内部動作や実装の詳細については省略する -(ただしそれが動作の理解にどうしても必要なら別)。 -通常の場合について記述する。 -プログラムのコマンドライン・オプションの説明には、 -.B オプション -のセクションを用いる。 -.\"O .\" If there is some kind of input grammar or complex set of subcommands, -.\"O .\" consider describing them in a separate -.\"O .\" .B USAGE -.\"O .\" section (and just place an overview in the -.\"O .\" .B DESCRIPTION -.\"O .\" section). -.\" 入力にある種の文法があったり、複雑なサブコマンドがある場合は、 -.\" それらは -.\" .B 利用法 -.\" のセクションに分離することを考えるとよい -.\" .RB ( 説明 -.\" のセクションには概要だけを置くようにする)。 -.TP -.\"O .B OPTIONS -.B オプション (OPTIONS) -.\"O describes the command-line options accepted by a -.\"O program and how they change its behavior. -.\"O This section should only appear for Section 1 and 8 manual pages. -プログラムが受け付けるコマンドライン・オプションと、 -その場合プログラムの振舞いがどう変わるかを説明する。 -このセクションはセクション 1 と 8 のマニュアルページにだけ登場すべきである。 +ヘッダファイルから関数 (や変数) の定義を得るために 機能検査マクロ (feature test macro) を定義しなければならない場合、 書式 +(SYNOPSIS) に必要な機能検査マクロを記載すべきである。 機能検査マクロについては \fBfeature_test_macros\fP(7) +で説明されている。 +.TP +\fBCONFIGURATION\fP +デバイスの設定詳細。 通常、このセクションは 4 章のマニュアルページでのみ登場する。 +.TP +\fB説明 (DESCRIPTION)\fP +.\" If there is some kind of input grammar or complex set of subcommands, +.\" consider describing them in a separate +.\" .B USAGE +.\" section (and just place an overview in the +.\" .B DESCRIPTION +.\" section). +プログラム・関数・フォーマットの動作・目的を説明する。 ファイルや標準入力をどのように処理し、標準出力や標準エラー出力を +どのように生成するかといったことについて述べる。 内部動作や実装の詳細については省略する (ただしそれが動作の理解にどうしても必要なら別)。 +通常の場合について記述する。 プログラムのコマンドライン・オプションの説明には、 \fBオプション\fP のセクションを用いる。 +.TP +\fBオプション (OPTIONS)\fP .\" .TP -.\"O .\" .B USAGE -.\" .B 利用法 (USAGE) -.\"O .\" describes the grammar of any sublanguage this implements. -.\" コマンドなどが実装している副言語 (sublanguage) の文法を記述する。 -.TP -.\"O .B EXIT STATUS -.B 終了ステータス (EXIT STATUS) -.\"O lists the possible exit status values of a program and -.\"O the conditions that cause these values to be returned. -.\"O This section should only appear for Section 1 and 8 manual pages. -プログラムの終了ステータスの値と、それらの値に対応する状況を列挙する。 -このセクションはセクション 1 と 8 のマニュアルページにだけ登場すべきである。 -.TP -.\"O .B RETURN VALUE -.B 返り値 (RETURN VALUE) -.\"O For Section 2 and 3 pages, this section gives a -.\"O list of the values the library routine will return to the caller -.\"O and the conditions that cause these values to be returned. -セクション 2 と 3 のページの場合、このセクションに -ライブラリルーチンが呼び出し元に返す値のリストを記載する。 +.\" .B USAGE +.\" describes the grammar of any sublanguage this implements. +プログラムが受け付けるコマンドライン・オプションと、 その場合プログラムの振舞いがどう変わるかを説明する。 このセクションはセクション 1 と 8 +のマニュアルページにだけ登場すべきである。 +.TP +\fB終了ステータス (EXIT STATUS)\fP +プログラムの終了ステータスの値と、それらの値に対応する状況を列挙する。 このセクションはセクション 1 と 8 +のマニュアルページにだけ登場すべきである。 +.TP +\fB返り値 (RETURN VALUE)\fP +セクション 2 と 3 のページの場合、このセクションに ライブラリルーチンが呼び出し元に返す値のリストを記載する。 それらの値が返された場合の状態に対する説明も書く。 -.TP -.\"O .B ERRORS -.B エラー (ERRORS) -.\"O For Section 2 and 3 manual pages, this is a list of the -.\"O values that may be placed in -.\"O .I errno -.\"O in the event of an error, along with information about the cause -.\"O of the errors. -.\"O .IR "The error list should be in alphabetical order" . -セクション 2 と 3 のマニュアルページでは、 -エラーが発生した場合に -.I errno -に設定される可能性がある値のリストを記載する。 -リストには、エラーの値とエラーの原因についての情報を書く。 -「エラーリストはアルファベット順にすべきである。」 -.TP -.\"O .B ENVIRONMENT -.B 環境変数 (ENVIRONMENT) -.\"O lists all environment variables that affect the program or function -.\"O and how they affect it. +.TP +\fBエラー (ERRORS)\fP +セクション 2 と 3 のマニュアルページでは、 エラーが発生した場合に \fIerrno\fP に設定される可能性がある値のリストを記載する。 +リストには、エラーの値とエラーの原因についての情報を書く。 「エラーリストはアルファベット順にすべきである。」 +.TP +\fB環境変数 (ENVIRONMENT)\fP プログラムや関数に影響する環境変数をリストし、それらの効果を書く。 -.TP -.\"O .B FILES -.B ファイル (FILES) -.\"O lists the files the program or function uses, such as -.\"O configuration files, startup files, -.\"O and files the program directly operates on. -.\"O Give the full pathname of these files, and use the installation -.\"O process to modify the directory part to match user preferences. -.\"O For many programs, the default installation location is in -.\"O .IR /usr/local , -.\"O so your base manual page should use -.\"O .I /usr/local -.\"O as the base. -プログラムや関数が用いるファイルを列記する。 -例えば、設定ファイル、起動ファイル、プログラムが直接操作するファイルなどである。 -これらのファイルのファイル名はフルパスで記載し、 -ディレクトリの部分はユーザーの好みに合わせて -インストール処理で変更できるようにする。 -多くのプログラムではデフォルトのインストール先は -.I /usr/local -である。したがってベースとなるマニュアルページでも -.I /usr/local -が使われていることが多いだろう。 +.TP +\fBファイル (FILES)\fP .\" May 07: Almost no current man pages have a DIAGNOSTICS section; .\" "RETURN VALUE" or "EXIT STATUS" is preferred. .\" .TP -.\"O .\" .B DIAGNOSTICS -.\" .B 診断メッセージ (DIAGNOSTICS) -.\"O .\" gives an overview of the most common error messages and how to -.\"O .\" cope with them. -.\"O .\" You don't need to explain system error messages -.\"O .\" or fatal signals that can appear during execution of any program -.\"O .\" unless they're special in some way to the program. -.\" ごく一般的なエラーメッセージの概要と、 -.\" それらをどう扱うかについて述べる。プログラムの実行時に現れる -.\" システムエラーメッセージや致命的シグナルを全部説明する必要はない。 -.\" ただしそれらがプログラムに対して -.\" 何らかの特殊な意味を持っている場合は別である。 +.\" .B DIAGNOSTICS +.\" gives an overview of the most common error messages and how to +.\" cope with them. +.\" You don't need to explain system error messages +.\" or fatal signals that can appear during execution of any program +.\" unless they're special in some way to the program. .\" .\" May 07: Almost no current man pages have a SECURITY section. .\".TP -.\"O .\".B SECURITY -.\" .B セキュリティ (SECURITY) -.\"O .\"discusses security issues and implications. -.\"O .\"Warn about configurations or environments that should be avoided, -.\"O .\"commands that may have security implications, and so on, especially -.\"O .\"if they aren't obvious. -.\"O .\"Discussing security in a separate section isn't necessary; -.\"O .\"if it's easier to understand, place security information in the -.\"O .\"other sections (such as the -.\"O .\" .B DESCRIPTION -.\"O .\" or -.\"O .\" .B USAGE -.\"O .\" section). -.\"O .\" However, please include security information somewhere! -.\" セキュリティ関連の話題・問題について述べる。 -.\" 避けるべき設定や環境・セキュリティ上の問題を引き起こすコマンド -.\" などについて警告する。それらが明らかでない場合には、これは特に重要である。 -.\" セキュリティに関する話題は、必ずしも独立したセクションにする必要はない。 -.\" もし理解しやすければ、セキュリティの情報は他のセクション -.\" (例えば -.\" .B 説明 -.\" や -.\" .B 利用法 -.\" など) に書いてもよい。 -.\" しかし、セキュリティの情報はどこかには書いておいてほしい! -.TP -.\"O .B VERSIONS -.B バージョン (VERSIONS) -.\"O A brief summary of the Linux kernel or glibc versions where a -.\"O system call or library function appeared, -.\"O or changed significantly in its operation. -システムコールやライブラリ関数が登場したり、動作の重要な変更が行われた、 -Linux カーネルや glibc のバージョンについての簡潔な概要。 -.\"O As a general rule, every new interface should -.\"O include a VERSIONS section in its manual page. -.\"O Unfortunately, -.\"O many existing manual pages don't include this information -.\"O (since there was no policy to do so when they were written). -.\"O Patches to remedy this are welcome, -.\"O but, from the perspective of programmers writing new code, -.\"O this information probably only matters in the case of kernel -.\"O interfaces that have been added in Linux 2.4 or later -.\"O (i.e., changes since kernel 2.2), -.\"O and library functions that have been added to glibc since version 2.1 -.\"O (i.e., changes since glibc 2.0). -一般に、全ての新しいインターフェイスは、マニュアルページに -「バージョン」の節を設けるべきである。 -残念なことに、多くの既存のマニュアルページにこの情報は含まれていない -(これらのページが書かれた時点ではそのようなポリシーはなかったからである)。 -これを改善するパッチは歓迎されるが、 -新しいコードを書くプログラマの観点からすれば、 -おそらくこの情報が重要になるのは、 -Linux 2.4 以降で追加されたカーネルインターフェイス (カーネル 2.2 からの変更) と -glibc バージョン 2.1 以降で追加されたライブラリ関数 (glibc 2.0 からの変更) -についてのみであろう。 +.\".B SECURITY +.\"discusses security issues and implications. +.\"Warn about configurations or environments that should be avoided, +.\"commands that may have security implications, and so on, especially +.\"if they aren't obvious. +.\"Discussing security in a separate section isn't necessary; +.\"if it's easier to understand, place security information in the +.\"other sections (such as the +.\" .B DESCRIPTION +.\" or +.\" .B USAGE +.\" section). +.\" However, please include security information somewhere! +プログラムや関数が用いるファイルを列記する。 例えば、設定ファイル、起動ファイル、プログラムが直接操作するファイルなどである。 +これらのファイルのファイル名はフルパスで記載し、 ディレクトリの部分はユーザーの好みに合わせて インストール処理で変更できるようにする。 +多くのプログラムではデフォルトのインストール先は \fI/usr/local\fP である。したがってベースとなるマニュアルページでも +\fI/usr/local\fP が使われていることが多いだろう。 +.TP +\fBバージョン (VERSIONS)\fP +システムコールやライブラリ関数が登場したり、動作の重要な変更が行われた、 Linux カーネルや glibc のバージョンについての簡潔な概要。 +一般に、全ての新しいインターフェイスは、マニュアルページに 「バージョン」の節を設けるべきである。 +残念なことに、多くの既存のマニュアルページにこの情報は含まれていない (これらのページが書かれた時点ではそのようなポリシーはなかったからである)。 +これを改善するパッチは歓迎されるが、 新しいコードを書くプログラマの観点からすれば、 おそらくこの情報が重要になるのは、 Linux 2.4 +以降で追加されたカーネルインターフェイス (カーネル 2.2 からの変更) と glibc バージョン 2.1 以降で追加されたライブラリ関数 +(glibc 2.0 からの変更) についてのみであろう。 -.\"O The -.\"O .BR syscalls (2) -.\"O manual page also provides information about kernel versions -.\"O in which various system calls first appeared. -.BR syscalls (2) -マニュアルページにも、いろいろなシステムコールが初めて登場した -カーネルバージョンについての情報が書かれている。 -.TP -.\"O .B CONFORMING TO -.B 準拠 (CONFORMING TO) -.\"O describes any standards or conventions that relate to the function -.\"O or command described by the manual page. -.\"O For a page in Section 2 or 3, -.\"O this section should note the POSIX.1 -.\"O version(s) that the call conforms to, -.\"O and also whether the call is specified in C99. -.\"O (Don't worry too much about other standards like SUS, SUSv2, and XPG, -.\"O or the SVr4 and 4.xBSD implementation standards, -.\"O unless the call was specified in those standards, -.\"O but isn't in the current version of POSIX.1.) -.\"O (See -.\"O .BR standards (7).) -そのマニュアルページで説明している関数やコマンドに関連する -標準規格や慣習について記載する。 -セクション 2 や 3 のページでは、このセクションで -システムコールや関数が準拠する POSIX.1 のバージョンと、 -C99 で規定されているかに触れるべきである。 -(SUS, SUSv2, XPG などの他の標準規格や、SVr4 や 4.xBSD の実装標準に -ついては、説明しているコールがこれらの規格で規定されており -POSIX.1 の現行バージョンで規定されていない場合以外は、 -あまり深く気にする必要はない。) -.RB ( standards (7) -参照。) +\fBsyscalls\fP(2) マニュアルページにも、いろいろなシステムコールが初めて登場した カーネルバージョンについての情報が書かれている。 +.TP +\fB準拠 (CONFORMING TO)\fP +そのマニュアルページで説明している関数やコマンドに関連する 標準規格や慣習について記載する。 セクション 2 や 3 のページでは、このセクションで +システムコールや関数が準拠する POSIX.1 のバージョンと、 C99 で規定されているかに触れるべきである。 (SUS, SUSv2, XPG +などの他の標準規格や、SVr4 や 4.xBSD の実装標準に ついては、説明しているコールがこれらの規格で規定されており POSIX.1 +の現行バージョンで規定されていない場合以外は、 あまり深く気にする必要はない。) (\fBstandards\fP(7) 参照。) -.\"O If the call is not governed by any standards but commonly -.\"O exists on other systems, note them. -.\"O If the call is Linux-specific, note this. -そのコールがどの標準にも基づいていないが、 -他のシステムで広く存在する場合は、その旨を記載すること。 -そのコールが Linux 固有の場合は、その旨を記載すること。 +そのコールがどの標準にも基づいていないが、 他のシステムで広く存在する場合は、その旨を記載すること。 そのコールが Linux +固有の場合は、その旨を記載すること。 -.\"O If this section consists of just a list of standards -.\"O (which it commonly does), -.\"O terminate the list with a period (\(aq.\(aq). -(そうなっているページが多いが) このセクションの内容が標準のリスト -だけの場合、リストの最後にピリオド (\(aq.\(aq) を置くこと。 -.TP -.\"O .B NOTES -.B 注意 (NOTES) -.\"O provides miscellaneous notes. -.\"O For Section 2 and 3 man pages you may find it useful to include -.\"O subsections (\fBSS\fP) named \fILinux Notes\fP and \fIGlibc Notes\fP. -その他の注意点を書く。 -セクション 2 と 3 のマニュアルページでは、 -\fILinux での注意 (Linux Notes)\fP や \fIglibc での注意 (Glibc Notes)\fP -という名前のサブセクション (\fBSS\fP) を設けると便利なこともある。 -.TP -.\"O .B BUGS -.B バグ (BUGS) -.\"O lists limitations, known defects or inconveniences, -.\"O and other questionable activities. +(そうなっているページが多いが) このセクションの内容が標準のリスト だけの場合、リストの最後にピリオド (\(aq.\(aq) を置くこと。 +.TP +\fB注意 (NOTES)\fP +その他の注意点を書く。 セクション 2 と 3 のマニュアルページでは、 \fILinux での注意 (Linux Notes)\fP や \fIglibc +での注意 (Glibc Notes)\fP という名前のサブセクション (\fBSS\fP) を設けると便利なこともある。 +.TP +\fBバグ (BUGS)\fP 制限・知られている欠陥や不便な点、その他不思議な動作などを書く。 -.TP -.\"O .B EXAMPLE -.B 例 (EXAMPLE) -.\"O provides one or more examples describing how this function, file or -.\"O command is used. -.\"O For details on writing example programs, -.\"O see \fIExample Programs\fP below. -この関数・ファイル・コマンドをどのように使うかを示した -ひとつまたは複数の例を記述する。 -サンプルプログラムを書く際の詳細は +.TP +\fB例 (EXAMPLE)\fP +この関数・ファイル・コマンドをどのように使うかを示した ひとつまたは複数の例を記述する。 サンプルプログラムを書く際の詳細は 以下の「サンプルプログラム」の節を参照のこと。 -.TP -.\"O .B AUTHORS -.B 著者 (AUTHORS) -.\"O lists authors of the documentation or program. -文書またはプログラムの著者を列記する。 -.\"O \fBUse of an AUTHORS section is strongly discouraged\fP. -.B 著者セクションは極力使用しないこと。 -.\"O Generally, it is better not to clutter every page with a list -.\"O of (over time potentially numerous) authors; -.\"O if you write or significantly amend a page, -.\"O add a copyright notice as a comment in the source file. -一般的には、著者のリストを各ページに撒き散らさない方がよい -(時間がたつと、作者のリストは膨大になる可能性がある)。 -マニュアルページを新規に書いたり、大幅に修正を行った場合には、 -ソースファイルにコメントとして著作権表示を追加すること。 -.\"O If you are the author of a device driver and what to include -.\"O an address for reporting bugs, place this under the BUGS section. -あなたがデバイスドライバの作者で、バグを報告するためのアドレスを +.TP +\fB著者 (AUTHORS)\fP +文書またはプログラムの著者を列記する。 \fB著者セクションは極力使用しないこと。\fP 一般的には、著者のリストを各ページに撒き散らさない方がよい +(時間がたつと、作者のリストは膨大になる可能性がある)。 マニュアルページを新規に書いたり、大幅に修正を行った場合には、 +ソースファイルにコメントとして著作権表示を追加すること。 あなたがデバイスドライバの作者で、バグを報告するためのアドレスを 載せたい場合は、「バグ」セクションの後ろにこのセクションを配置すること。 -.TP -.\"O .B SEE ALSO -.B 関連項目 (SEE ALSO) -.\"O provides a comma-separated list of related man pages, -.\"O ordered by section number and -.\"O then alphabetically by name, possibly followed by -.\"O other related pages or documents. -.\"O Do not terminate this with a period. -関連するマニュアルページを、コンマ区切りのリストで、 -セクション番号順に、セクション内ではアルファベット順で記載する。 -可能なら関連する他の文書も書く。 -慣習では、このセクションは最後に置く。 -リストの末尾にピリオドを置かないこと。 -.\"O .SS Font conventions +.TP +\fB関連項目 (SEE ALSO)\fP +関連するマニュアルページを、コンマ区切りのリストで、 セクション番号順に、セクション内ではアルファベット順で記載する。 可能なら関連する他の文書も書く。 +慣習では、このセクションは最後に置く。 リストの末尾にピリオドを置かないこと。 .SS フォントの慣習 .PP -.\"O For functions, the arguments are always specified using italics, -.\"O .IR "even in the SYNOPSIS section" , -.\"O where the rest of the function is specified in bold: -関数に対しては、引き数には常にイタリック体を用いる。 -「たとえ書式 (SYNOPSIS) セクションであっても、このルールに従う」 +関数に対しては、引き数には常にイタリック体を用いる。 「たとえ書式 (SYNOPSIS) セクションであっても、このルールに従う」 関数の他の部分はボールドを指定する: .PP -.BI " int myfunction(int " argc ", char **" argv ); +\fB int myfunction(int \fP\fIargc\fP\fB, char **\fP\fIargv\fP\fB);\fP .PP -.\"O Variable names should, like argument names, be specified in italics. 引き数名といった変数名はイタリック体を指定すべきである。 .PP -.\"O Filenames (whether pathnames, or references to files in the -.\"O .I /usr/include -.\"O directory) -.\"O are always in italics (e.g., -.\"O .IR ), -.\"O except in the SYNOPSIS section, where included files are in bold (e.g., -.\"O .BR "#include " ). -ファイル名 (パス名、または -.I /usr/include -ディレクトリ内のファイルへの参照) は常にイタリック体にする (例: -.IR )。 -ただし、書式 (SYNOPSIS) セクションは例外で、 -インクルードファイルはボールドにする (例: -.BR "#include " )。 -.\"O When referring to a standard include file under -.\"O .IR /usr/include , -.\"O specify the header file surrounded by angle brackets, -.\"O in the usual C way (e.g., -.\"O .IR ). -.I /usr/include -以下の標準のインクルードファイルを参照する際は、 -通常の C 言語と同様に山括弧でヘッダファイルを囲ぬで指定する (例: -.IR )。 +ファイル名 (パス名、または \fI/usr/include\fP ディレクトリ内のファイルへの参照) は常にイタリック体にする (例: +\fI\fP)。 ただし、書式 (SYNOPSIS) セクションは例外で、 インクルードファイルはボールドにする (例: +\fB#include \fP)。 \fI/usr/include\fP 以下の標準のインクルードファイルを参照する際は、 通常の +C 言語と同様に山括弧でヘッダファイルを囲ぬで指定する (例: \fI\fP)。 .PP -.\"O Special macros, which are usually in upper case, are in bold (e.g., -.\"O .BR MAXINT ). -.\"O Exception: don't boldface NULL. -通常、大文字で表現する特殊マクロはボールドで表す (例えば -.BR MAXINT )。 -例外として NULL はボールドにしない。 +通常、大文字で表現する特殊マクロはボールドで表す (例えば \fBMAXINT\fP)。 例外として NULL はボールドにしない。 .PP -.\"O When enumerating a list of error codes, the codes are in bold (this list -.\"O usually uses the -.\"O .B \&.TP -.\"O macro). -エラーコードのリストを列挙する時には、コードはボールドで表す -(このリストには通常 -.B \&.TP -マクロを用いる)。 +エラーコードのリストを列挙する時には、コードはボールドで表す (このリストには通常 \fB\&.TP\fP マクロを用いる)。 .PP -.\"O Complete commands should, if long, -.\"O be written as in an indented line on their own, for example -完全なコマンドは、長い場合には、例に示すように -字下げした行にコマンドだけを記載すべきである。 +完全なコマンドは、長い場合には、例に示すように 字下げした行にコマンドだけを記載すべきである。 .in +4n .nf -man 7 man-pages +man 7 man\-pages .fi .in -.\"O If the command is short, then it can be included inline in the text, -.\"O in italic format, for example, -.\"O .IR "man 7 man-pages" . -.\"O In this case, it may be worth using nonbreaking spaces -.\"O ("\e\ ") at suitable places in the command. -.\"O Command options should be written in italics, e.g., -.\"O .IR \-l . -コマンドが短い場合は、 -.I "man 7 man-pages" -のようにイタリック体で文中に埋め込んで記載してもよい。 -この場合、コマンド内の適切な位置に、改行できないスペース ("\e\ ") -を使うとよいかもしれない。 -コマンドオプションも -.I \-l +コマンドが短い場合は、 \fIman 7 man\-pages\fP のようにイタリック体で文中に埋め込んで記載してもよい。 +この場合、コマンド内の適切な位置に、改行できないスペース ("\e\ ") を使うとよいかもしれない。 コマンドオプションも \fI\-l\fP のようにイタリック体で記載すべきである。 .PP -.\"O Expressions, if not written on a separate indented line, should -.\"O be specified in italics. -.\"O Again, the use of nonbreaking spaces may be appropriate -.\"O if the expression is inlined with normal text. -式は、専用の字下げした行に記載しない場合、イタリック体を指定すること。 -繰り返しになるが、式を通常の文中に埋め込む場合にも、 +式は、専用の字下げした行に記載しない場合、イタリック体を指定すること。 繰り返しになるが、式を通常の文中に埋め込む場合にも、 改行できないスペースを使うとよいだろう。 .PP -.\"O Any reference to the subject of the current manual page -.\"O should be written with the name in bold. -.\"O If the subject is a function (i.e., this is a Section 2 or 3 page), -.\"O then the name should be followed by a pair of parentheses -.\"O in Roman (normal) font. -.\"O For example, in the -.\"O .BR fcntl (2) -.\"O man page, references to the subject of the page would be written as: -.\"O .BR fcntl (). -.\"O The preferred way to write this in the source file is: -そのマニュアルページの説明対象への参照は、ボールドで名前を記載する。 -対象が関数 (つまり、セクション 2 や 3 のページ) の場合、 -名前の後ろにローマンフォント (通常のフォント) で丸括弧の対を続ける。 -例えば、 -.BR fcntl (2) -のマニュアルページでは、説明対象への参照は -.BR fcntl () -のように記載する。 -マニュアルページのソースファイルには次のように記載するのが望ましい: +そのマニュアルページの説明対象への参照は、ボールドで名前を記載する。 対象が関数 (つまり、セクション 2 や 3 のページ) の場合、 +名前の後ろにローマンフォント (通常のフォント) で丸括弧の対を続ける。 例えば、 \fBfcntl\fP(2) のマニュアルページでは、説明対象への参照は +\fBfcntl\fP() のように記載する。 マニュアルページのソースファイルには次のように記載するのが望ましい: .nf .BR fcntl () .fi -.\"O (Using this format, rather than the use of "\\fB...\\fP()" -.\"O makes it easier to write tools that parse man page source files.) -("\\fB...\\fP()" よりも、この形式を使うこと。 -これにより、マニュアルページのソースファイルを解釈するツールを -書くのが簡単になる。) +("\efB...\efP()" よりも、この形式を使うこと。 これにより、マニュアルページのソースファイルを解釈するツールを 書くのが簡単になる。) .PP -.\"O Any reference to another man page -.\"O should be written with the name in bold, -.\"O \fIalways\fP followed by the section number, -.\"O formatted in Roman (normal) font, without any -.\"O separating spaces (e.g., -.\"O .BR intro (2)). -.\"O The preferred way to write this in the source file is: -別のマニュアルページへの参照は、ボールドで名前を記載し、 -それに続けてセクション番号を「必ず」書く。セクション番号は -ローマンフォント (通常のフォント) で書き、スペースは入れない -(例: -.BR intro (2))。 -マニュアルページのソースファイルには次のように記載するのが望ましい: +別のマニュアルページへの参照は、ボールドで名前を記載し、 それに続けてセクション番号を「必ず」書く。セクション番号は ローマンフォント +(通常のフォント) で書き、スペースは入れない (例: \fBintro\fP(2))。 マニュアルページのソースファイルには次のように記載するのが望ましい: .nf .BR intro (2) .fi -.\"O (Including the section number in cross references lets tools like -.\"O .BR man2html (1) -.\"O create properly hyperlinked pages.) -(相互参照にセクション番号を含めておくと、 -.B man2html -といったツールがページ間のハイパーリンクを適切に生成できる。) -.\"O .SS Spelling -.SS 綴り (spelling) -.\"O Starting with release 2.59, -.\"O .I man-pages -.\"O follows American spelling conventions; -.\"O please write all new pages and patches according to these conventions. -リリース 2.59 からだが、 -.I man-pages -はアメリカ英語の綴りの慣習に従っている。 -新しいページやパッチは全てこの慣習に従って下さい。 -.\"O .SS Example Programs and Shell Sessions +(相互参照にセクション番号を含めておくと、 \fBman2html\fP といったツールがページ間のハイパーリンクを適切に生成できる。) +.SS "綴り (spelling)" +リリース 2.59 からだが、 \fIman\-pages\fP はアメリカ英語の綴りの慣習に従っている。 新しいページやパッチは全てこの慣習に従って下さい。 .SS サンプルプログラムとシェルのセッション -.\"O Manual pages can include example programs demonstrating how to -.\"O use a system call or library function. -.\"O However, note the following: -マニュアルページには、システムコールやライブラリ関数の使い方を示す -サンプルプログラムを含めることができる。 -その際には、以下の点に留意すべきである。 -.TP 3 +マニュアルページには、システムコールやライブラリ関数の使い方を示す サンプルプログラムを含めることができる。 その際には、以下の点に留意すべきである。 +.TP 3 * -.\"O Example programs should be written in C. サンプルプログラムは C で記載すること。 -.TP +.TP * -.\"O An example program is only necessary and useful if it demonstrates -.\"O something beyond what can easily be provided in a textual -.\"O description of the interface. -.\"O An example program that does nothing -.\"O other than call an interface usually serves little purpose. -サンプルプログラムは、 -インタフェースについて文章で簡単に説明できる以上のことを示す場合にだけ -必要かつ有用である。インタフェースを呼び出す以外に何もしないサンプル -プログラムは普通はほとんど役に立たない。 -.TP +サンプルプログラムは、 インタフェースについて文章で簡単に説明できる以上のことを示す場合にだけ +必要かつ有用である。インタフェースを呼び出す以外に何もしないサンプル プログラムは普通はほとんど役に立たない。 +.TP * -.\"O Example programs should be fairly short (preferably less than 100 lines; -.\"O ideally less than 50 lines). -サンプルプログラムはかなり短めにすること -(100行未満が望ましく、50行未満が理想的である)。 -.TP +サンプルプログラムはかなり短めにすること (100行未満が望ましく、50行未満が理想的である)。 +.TP * -.\"O Example programs should do error checking after system calls and -.\"O library function calls. -サンプルプログラムでは、システムコールやライブラリ関数を呼び出した後で -エラーチェックを行うこと。 -.TP +サンプルプログラムでは、システムコールやライブラリ関数を呼び出した後で エラーチェックを行うこと。 +.TP * -.\"O Example programs should be complete, and compile without -.\"O warnings when compiled with \fIcc\ \-Wall\fP. -サンプルプログラムは完結していて、 -\fIcc\ \-Wall\fP -でコンパイルした際に警告なしでコンパイルできること。 -.TP +サンプルプログラムは完結していて、 \fIcc\ \-Wall\fP でコンパイルした際に警告なしでコンパイルできること。 +.TP * -.\"O Where possible and appropriate, example programs should allow -.\"O experimentation, by varying their behavior based on inputs -.\"O (ideally from command-line arguments, or alternatively, via -.\"O input read by the program). -可能かつ適切な場合には、サンプルプログラムで -入力により動作を変化させるなどの実験を行うとよい -(理想的には、コマンドライン引き数や、プログラムが読み込む入力データ -経由で、動作を変化させるのがよい)。 -.TP +可能かつ適切な場合には、サンプルプログラムで 入力により動作を変化させるなどの実験を行うとよい +(理想的には、コマンドライン引き数や、プログラムが読み込む入力データ 経由で、動作を変化させるのがよい)。 +.TP * -.\"O Example programs should be laid out according to Kernighan and -.\"O Ritchie style, with 4-space indents. -サンプルプログラムは、K&R (Kernighan and Ritchie) スタイルで書き、 -字下げはスペース 4文字で行う。 -.\"O (Avoid the use of TAB characters in source code!) -(ソースコードで TAB 文字を使うのは避けること。) +サンプルプログラムは、K&R (Kernighan and Ritchie) スタイルで書き、 字下げはスペース 4文字で行う。 (ソースコードで +TAB 文字を使うのは避けること。) .PP -.\"O For some examples of what example programs should look like, see -.\"O .BR wait (2) -.\"O and -.\"O .BR pipe (2). -サンプルプログラムがどんな風になっていればよいかの例については、 -.BR wait (2) -と -.BR pipe (2) -を参照すること。 +サンプルプログラムがどんな風になっていればよいかの例については、 \fBwait\fP(2) と \fBpipe\fP(2) を参照すること。 -.\"O If you include a shell session demonstrating the use of a program -.\"O or other system feature, boldface the user input text, -.\"O to distinguish it from output produced by the system. -プログラムの使い方や他のシステムの特徴を示すためにシェルのセッション例 -を含める場合、ユーザの入力文をボールドにして、システムが生成する +プログラムの使い方や他のシステムの特徴を示すためにシェルのセッション例 を含める場合、ユーザの入力文をボールドにして、システムが生成する 出力と区別できるようにすること。 -.\"O .SS Indentation of structure definitions, shell session logs, etc. .SS 構造体の定義、シェルのセッションログなどの字下げ -.\"O When structure definitions, shell session logs, etc. are included -.\"O in running text, indent them by 4 spaces (i.e., a block enclosed by -.\"O .I ".in\ +4n" -.\"O and -.\"O .IR ".in" ). -構造体の定義やシェルのセッションログなどを本文中に記載する際は、 -スペース 4個分の字下げを行う (つまり、ブロックを -.I ".in\ +4n" -と -.I ".in" -で囲む)。 -.\"O .SH EXAMPLE +構造体の定義やシェルのセッションログなどを本文中に記載する際は、 スペース 4個分の字下げを行う (つまり、ブロックを \fI.in\ +4n\fP と +\&\fI.in\fP で囲む)。 .SH 例 -.\"O For canonical examples of how man pages in the -.\"O .I man-pages -.\"O package should look, see -.\"O .BR pipe (2) -.\"O and -.\"O .BR fcntl (2). -.I man-pages -パッケージに含まれるマニュアルページの体裁の標準的な例については、 -.BR pipe (2) -と -.BR fcntl (2) +\fIman\-pages\fP パッケージに含まれるマニュアルページの体裁の標準的な例については、 \fBpipe\fP(2) と \fBfcntl\fP(2) を参照すること。 -.\"O .SH SEE ALSO .SH 関連項目 -.BR man (1), -.BR man2html (1), -.BR groff (7), -.BR groff_man (7), -.BR man (7), -.BR mdoc (7) +\fBman\fP(1), \fBman2html\fP(1), \fBgroff\fP(7), \fBgroff_man\fP(7), \fBman\fP(7), +\fBmdoc\fP(7) diff --git a/draft/man7/man.7 b/draft/man7/man.7 deleted file mode 100644 index a6fd71fc..00000000 --- a/draft/man7/man.7 +++ /dev/null @@ -1,903 +0,0 @@ -.\" (C) Copyright 1992-1999 Rickard E. Faith and David A. Wheeler -.\" (faith@cs.unc.edu and dwheeler@ida.org) -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" -.\" Modified Sun Jul 25 11:06:05 1993 by Rik Faith (faith@cs.unc.edu) -.\" Modified Sat Jun 8 00:39:52 1996 by aeb -.\" Modified Wed Jun 16 23:00:00 1999 by David A. Wheeler (dwheeler@ida.org) -.\" Modified Thu Jul 15 12:43:28 1999 by aeb -.\" Modified Sun Jan 6 18:26:25 2002 by Martin Schulze -.\" Modified Tue Jul 27 20:12:02 2004 by Colin Watson -.\" 2007-05-30, mtk: various rewrites and moved much text to new man-pages.7. -.\" -.\" Japanese Version Copyright (c) 1997-2000 OZASA Hiromasa and NAKANO Takeo -.\" all rights reserved. -.\" Translated 1997-07-25, OZASA Hiromasa -.\" Updated 2000-01-14, NAKANO Takeo -.\" Updated 2001-12-27, Kentaro Shirakata -.\" Updated 2002-03-23, Kentaro Shirakata -.\" Updated 2005-02-23, Akihiro MOTOKI -.\" Updated 2005-04-17, Akihiro MOTOKI -.\" Updated 2007-06-13, Akihiro MOTOKI , LDP v2.53 -.\" Updated 2007-06-13, Akihiro MOTOKI , LDP v2.54 -.\" -.\"WORD: prevailing indent 優先インデント -.\" -.TH MAN 7 2007-05-30 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O man \- macros to format man pages -man \- man ページを整形するマクロ -.\"O .SH SYNOPSIS -.SH 書式 -.B groff \-Tascii \-man -.I file -\&... -.LP -.B groff \-Tps \-man -.I file -\&... -.LP -.B man -.RI [ section ] -.I title -.\"O .SH DESCRIPTION -.SH 説明 -.\"O This manual page explains the -.\"O .B "groff an.tmac" -.\"O macro package (often called the -.\"O .B man -.\"O macro package). -.\"O This macro package should be used by developers when -.\"O writing or porting man pages for Linux. -.\"O It is fairly compatible with other -.\"O versions of this macro package, so porting man pages should not be a major -.\"O problem (exceptions include the NET-2 BSD release, which uses a totally -.\"O different macro package called mdoc; see -.\"O .BR mdoc (7)). -このマニュアルページでは、 -.B "groff an.tmac" -のマクロパッケージ -.RB ( man -マクロパッケージとも呼ばれることも多い) について説明する。 -このマクロパッケージは、 -Linux の man ページを書いたり移植したりするときに、 -開発者が用いるものである。 -このマクロパッケージはバージョン間での互換性が高く、 -man page の移植にあたっては大きな問題はないだろう -(但し、NET-2 BSD release は例外である。 -こちらでは mdoc と呼ばれる全く異なるマクロパッケージが使用されている。 -.BR mdoc (7) -を参照)。 -.PP -.\"O Note that NET-2 BSD mdoc man pages can be used with -.\"O .B groff -.\"O simply by specifying the -.\"O .B \-mdoc -.\"O option instead of the -.\"O .B \-man -.\"O option. -.\"O Using the -.\"O .B \-mandoc -.\"O option is, however, recommended, since this will automatically detect which -.\"O macro package is in use. -NET-2 BSD の man ページも、 -.B groff -のオプションとして -.B \-man -の代わりに -.B \-mdoc -を指定するだけで、利用することができる。 -.B \-mandoc -オプションを使えばどのマクロパッケージが用いられているか -自動的に検出できるので、このオプションを使うのがお薦めである。 -.PP -.\"O For conventions that should be employed when writing man pages -.\"O for the Linux \fIman-pages\fP package, see -.\"O .BR man-pages (7). -Linux \fIman-pages\fP プロジェクトのマニュアルページを書く際に -従うべき決まり事については -.BR man-pages (7) -を参照。 -.\"O .SS Title line -.SS タイトル行 -.\"O The first command in a man page (after comment lines, -.\"O that is, lines that start with \fB.\\"\fP) should be -man ページの (コメント行を除く) 最初のコマンドは、 -以下のようにする必要がある。 -コメント行とは \fB.\\"\fP で始まる行のことである。 -.RS -.sp -.B \&.TH -.I "title section date source manual" -.sp -.RE -.\"O For details of the arguments that should be supplied to the \fBTH\fP -.\"O command, see -.\"O .BR man-pages (7). -\fBTH\fP に渡す引き数の詳細については -.BR man-pages (7) -を参照。 -.PP -.\"O Note that BSD mdoc-formatted pages begin with the -.\"O .B Dd -.\"O command, not the -.\"O .B TH -.\"O command. -なお BSD の mdoc フォーマットのページは -.B TH -コマンドではなく -.B Dd -コマンドから始まる。 -.\"O .SS Sections -.SS セクション -.\"O Sections are started with -.\"O .B \&.SH -.\"O followed by the heading name. -.\"O .\" The following doesn't seem to be required (see Debian bug 411303), -.\"O .\" If the name contains spaces and appears -.\"O .\" on the same line as -.\"O .\" .BR \&.SH , -.\"O .\" then place the heading in double quotes. -セクションは -.B \&.SH -で始まり、見出し名がそれに続く。 -.\" 以下は必須ではないようだ (Debian bug 411303 参照), -.\" スペースが含まれている名前を -.\" .BR \&.SH -.\" と同じ行に置く場合は、見出し名はダブルクォートで囲む。 - -.\"O The only mandatory heading is NAME, which should be the first section and -.\"O be followed on the next line by a one line description of the program: -NAME (名前) という見出しだけは必ず置かないといけない。 -この見出しは一番最初のセクションにすべきで、見出しの -次の行にはプログラムの説明を一行で書く。 -.RS -.sp -\&.SH NAME -.br -.sp -.RE -.\"O It is extremely important that this format is followed, and that there is a -.\"O backslash before the single dash which follows the command name. -.\"O This syntax is used by the -.\"O .BR makewhatis (8) -.\"O program to create a database of short command descriptions for the -.\"O .BR whatis (1) -.\"O and -.\"O .BR apropos (1) -.\"O commands. -このフォーマットに従い、コマンド名に続くシングルダッシュ (-) -の前には必ずバックスラッシュを置くこと。 -この文法は、 -.BR makewhatis (8) -プログラムが -.BR whatis (1) -や -.BR apropos (1) -コマンド用の (コマンドの短い説明の) データベースを生成する際に利用される。 -.PP -.\"O For a list of other sections that might appear in a manual page, see -.\"O .BR man-pages (7). -マニュアルページに登場する可能性のあるこれ以外のセクションのリストに -ついては -.BR man-pages (7) -を参照。 -.\"O .SS Fonts -.SS フォント -.\"O The commands to select the type face are: -タイプフェイスを選択するコマンドは以下のように指定する: -.TP 4 -.B \&.B -.\"O Bold -ボールド。 -.TP -.B \&.BI -.\"O Bold alternating with italics -.\"O (especially useful for function specifications) -ボールドとイタリックとを交互に -(特に関数指定に便利)。 -.TP -.B \&.BR -.\"O Bold alternating with Roman -.\"O (especially useful for referring to other -.\"O manual pages) -ボールドとローマンとを交互に -(特に他のマニュアルページを参照するときに便利)。 -.TP -.B \&.I -.\"O Italics -イタリック。 -.TP -.B \&.IB -.\"O Italics alternating with bold -イタリックとボールドとを交互に。 -.TP -.B \&.IR -.\"O Italics alternating with Roman -イタリックとローマンとを交互に。 -.TP -.B \&.RB -.\"O Roman alternating with bold -ローマンとボールドとを交互に。 -.TP -.B \&.RI -.\"O Roman alternating with italics -ローマンとイタリックとを交互に。 -.TP -.B \&.SB -.\"O Small alternating with bold -スモールとボールドを交互に。 -.TP -.B \&.SM -.\"O Small (useful for acronyms) -スモール (頭字語などに用いる) -.LP -.\"O Traditionally, each command can have up to six arguments, but the GNU -.\"O implementation removes this limitation (you might still want to limit -.\"O yourself to 6 arguments for portability's sake). -.\"O Arguments are delimited by -.\"O spaces. -.\"O Double quotes can be used to specify an argument which contains spaces. -.\"O All of the arguments will be printed next to each other without -.\"O intervening spaces, so that the -.\"O .B \&.BR -.\"O command can be used to specify a word in bold followed by a mark of -.\"O punctuation in Roman. -.\"O If no arguments are given, the command is applied to the following line -.\"O of text. -慣例としては、各コマンドは 6 つまでの引き数を持つ事が可能だが、 -GNU の実装では制限はないようだ (しかし移植性を保持するためには -引き数は 6 までに限っておくのが良いだろう)。 -引き数はスペースで区切られる。 -スペースを含んだ引き数を与えるには、ダブルクォートで囲えばよい。 -すべての引き数はスペースを取り除いて並べられるので、 -.B \&.BR -コマンドを使えば、単語はボールドで、句読点をローマンで表すことができる。 -引き数が全く与えられなければ、 -そのコマンドは次の行のテキストに適用される。 -.\"O .SS "Other Macros and Strings" -.SS その他のマクロや文字列 -.PP -.\"O Below are other relevant macros and predefined strings. -.\"O Unless noted otherwise, all macros -.\"O cause a break (end the current line of text). -.\"O Many of these macros set or use the "prevailing indent." -.\"O The "prevailing indent" value is set by any macro with the parameter -.\"O .I i -.\"O below; -.\"O macros may omit -.\"O .I i -.\"O in which case the current prevailing indent will be used. -.\"O As a result, successive indented paragraphs can use the same indent without -.\"O respecifying the indent value. -.\"O A normal (nonindented) paragraph resets the prevailing indent value -.\"O to its default value (0.5 inches). -.\"O By default a given indent is measured in ens; -.\"O try to use ens or ems as units for -.\"O indents, since these will automatically adjust to font size changes. -.\"O The other key macro definitions are: -以下に、他のマクロや定義済みの文字列を示す。 -特に記述がない限り、マクロを使うと改行が行われる -(テキストの現在の行を終了する)。 -多くのマクロは -「優先インデント (prevailing indent)」を設定したり、使用する。 -優先インデントの値は、どのマクロからもパラメータ -.I i -によって指定できる (以下に示す)。 -マクロでは -.I i -を省略することもでき、その場合は現在の優先インデントの値が用いられる。 -これにより結果として、インデントされた段落が連続している場合、 -インデントの値を再指定しなくてもインデント量を同じにすることができる。 -通常の (インデントされていない) 段落が登場すると、 -優先インデントの値はデフォルトの値 (0.5 インチ) にリセットされる。 -デフォルトでは、与えたインデントの値は ens 単位である。 -インデントの単位には ens や ems を用いるとよい。これらの単位は -フォントサイズが変更されると自動的に調整されるからである。 -他の重要なマクロ定義は以下の通り: -.\"O .SS "Normal Paragraphs" -.SS 通常の段落 -.TP 9m -.B \&.LP -.\"O Same as -.\"O .B \&.PP -.\"O (begin a new paragraph). -.B \&.PP -と同じ (新たな段落の開始)。 -.TP -.B \&.P -.\"O Same as -.\"O .B \&.PP -.\"O (begin a new paragraph). -.B \&.PP -と同じ (新たな段落の開始)。 -.TP -.B \&.PP -.\"O Begin a new paragraph and reset prevailing indent. -新しい段落を開始し、インデントをリセットする。 -.\"O .SS "Relative Margin Indent" -.SS 相対マージンインデント -.TP 9m -.BI \&.RS " i" -.\"O Start relative margin indent: moves the left margin -.\"O .I i -.\"O to the right (if -.\"O .I i -.\"O is omitted, the prevailing indent value is used). -.\"O A new prevailing indent is set to 0.5 inches. -.\"O As a result, all following paragraph(s) will be -.\"O indented until the corresponding -.\"O .BR \&.RE . -相対マージンインデント (relative margin indent) を開始する。 -左マージンを -.I i -だけ右に移動する -.RI ( i -が省略されると優先インデントの値が用いられる)。 -新たな優先インデントは 0.5 インチにセットされる。 -結果として、以下の段落は対応する -.B \&.RE -が現れるまでインデントされる。 -.TP -.B \&.RE -.\"O End relative margin indent and -.\"O restores the previous value of the prevailing indent. -相対マージンインデントを終了し、 -優先インデントの値を元に戻す。 -.\"O .SS "Indented Paragraph Macros" -.SS 段落をインデントするマクロ -.TP 9m -.BI \&.HP " i" -.\"O Begin paragraph with a hanging indent -.\"O (the first line of the paragraph is at the left margin of -.\"O normal paragraphs, and the rest of the paragraph's lines are indented). -ぶらさがりインデントの段落を開始する -(段落の先頭行は通常の段落の左マージンとなり、 -段落の残りの行はインデントされる)。 -.TP -.BI \&.IP " x i" -.\"O Indented paragraph with optional hanging tag. -.\"O If the tag -.\"O .I x -.\"O is omitted, the entire following paragraph is indented by -.\"O .IR i . -.\"O If the tag -.\"O .I x -.\"O is provided, it is hung at the left margin -.\"O before the following indented paragraph -.\"O (this is just like -.\"O .B \&.TP -.\"O except the tag is included with the command instead of being on the -.\"O following line). -.\"O If the tag is too long, the text after the tag will be moved down to the -.\"O next line (text will not be lost or garbled). -.\"O For bulleted lists, use this macro with \e(bu (bullet) or \e(em (em dash) -.\"O as the tag, and for numbered lists, use the number or letter followed by -.\"O a period as the tag; -.\"O this simplifies translation to other formats. -インデントされた段落。オプションとしてぶらさがりタグをとる。 -タグ -.I x -が省略されると、以下の段落すべてが -.I i -でインデントされる。タグ -.I x -が与えられると、タグはインデントされた段落の前にぶら下げられる -.RB ( \&.TP -とちょうど同じ。ただしタグを次の行に書く代わりにコマンドに指定する)。 -タグが長すぎる場合には、タグに続くテキストは次の行に移動する -(テキストが失われたり混ざったりすることはない)。 -箇条書きをするには、 \e(bu (点) あるいは \e(em (ダッシュ) -をタグにしてこのマクロを用いるとよい。番号付きで箇条書きをする場合は、 -数字または文字にピリオドを付けたものをタグにすればよい。 -こうすれば他のフォーマットへの変換が簡単になる。 -.TP -.BI \&.TP " i" -.\"O Begin paragraph with hanging tag. -.\"O The tag is given on the next line, but -.\"O its results are like those of the -.\"O .B \&.IP -.\"O command. -ぶらさがりタグの段落を開始する。タグは次の行に指定する。 -結果は -.B \&.IP -コマンドと似たものになる。 -.\"O .SS "Hypertext Link Macros" -.SS ハイパーテキストリンク用のマクロ -.\"O (Feature supported with -.\"O .B groff -.\"O only.) -.\"O In order to use hypertext link macros, it is necessary to load the -.\"O .B www.tmac -.\"O macro package. -.\"O Use the request -.\"O .B .mso www.tmac -.\"O to do this. -.RB ( groff -だけでサポートされている機能) -ハイパーテキストリンク用のマクロを使用するためには、 -.B www.tmac -マクロパッケージをロードする必要がある。 -ロードを行うには -.B .mso www.tmac -リクエストを使用する。 -.TP 9m -.BI \&.URL " link url trailer" -.\" motoki: 原文では .URL url link trailer となっているが、誤記。 -.\"O Inserts a hypertext link to the URI (URL) -.\"O .IR url , -.\"O with -.\"O .I link -.\"O as the text of the link. -.\"O The -.\"O .I trailer -.\"O will be printed immediately afterward. -URI (URL) -.I url -へのハイパーテキストリンクを挿入する。 -.I link -はリンク名のテキストであり、 -.I trailer -の内容はリンクの直後に表示される。 -.\"O When generating HTML this should translate into the HTML command -.\"O \fB\fP\fIlink\fP\fB\fP\fItrailer\fP. -HTML を生成する時に、このマクロは -\fB\fP\fIlink\fP\fB\fP\fItrailer\fP -という HTML コマンドに変換される。 -.\"O .\" The following is a kludge to get a paragraph into the listing. -.\" 以下はリスト表示の中で段落を作るためのその場しのぎの方法である。 -.TP -.B " " -.\"O This and other related macros are new, and -.\"O many tools won't do anything with them, but -.\"O since many tools (including troff) will simply ignore undefined macros -.\"O (or at worst insert their text) these are safe to insert. -このマクロや他の関連マクロは新しく、 -多くのツールはこれらに対しては何もしないであろう。 -(troff を含めた) 多くのツールは未定義のマクロを単に無視するだけ -(あるいは最悪でもマクロをテキストとして挿入するだけ) -なので、これらを書いても危険はない。 -.\"O .\" The following is a kludge to get a paragraph into the listing. -.\" 以下はリスト表示の中で段落を作るためのその場しのぎの方法である。 -.TP -.B " " -.\"O It can be useful to define your own -.\"O .B URL -.\"O macro in manual pages for the benefit of those viewing it with a roff -.\"O viewer other than -.\"O .BR groff . -.\"O That way, the URL, link text, and trailer text (if any) are still visible. -マニュアルページ内で自分で -.B URL -マクロを定義して、 -.B groff -以外の roff ビューアでも表示されるようにするのもいいだろう。 -こうすることで、URL も、リンク用のテキストも、(もしあれば) それに続く -テキストも、表示できるようになる。 -.\"O .\" The following is a kludge to get a paragraph into the listing. -.\" 以下はリスト表示の中で段落を作るためのその場しのぎの方法である。 -.TP -.B " " -.\"O Here's an example: -以下に例を挙げる: -.RS 1.5i -\&.de URL -.br -\\\\$2 \\(laURL: \\\\$1 \\(ra\\\\$3 -.br -\&.. -.br -\&.if \\n[.g] .mso www.tmac -.br -\&.TH -.I ... -.br -.I (later in the page) -.br -This software comes from the -.br -\&.URL "http://www.gnu.org/" "GNU Project" " of the" -.br -\&.URL "http://www.fsf.org/" "Free Software Foundation" . -.RE -.\"O .\" The following is a kludge to get a paragraph into the listing. -.\" 以下はリスト表示の中で段落を作るためのその場しのぎの方法である。 -.TP -.B " " -.\"O In the above, if -.\"O .B groff -.\"O is being used, the -.\"O .B www.tmac -.\"O macro package's definition of the URL macro will supersede the locally -.\"O defined one. -上記の例において、 -.B groff -を使って表示しようとした場合には、 -.B www.tmac -マクロパッケージの URL マクロの定義の方が -ローカルで行われた定義よりも優先される。 -.PP -.\"O A number of other link macros are available. -.\"O See -.\"O .BR groff_www (7) -.\"O for more details. -.\" motoki: groff_mwww (7) の誤記と思われる。 -他にもいくつかのリンク用のマクロが用意されている。 -詳しくは -.BR groff_mwww (7) -を参照のこと。 -.BR -.\"O .SS "Miscellaneous Macros" -.SH その他のマクロ -.TP 9m -.B \&.DT -.\"O Reset tabs to default tab values (every 0.5 inches); -.\"O does not cause a break. -タブをデフォルトのタブ値 (0.5 インチごと) にリセットする。 -改行はしない。 -.TP -.BI \&.PD " d" -.\"O Set inter-paragraph vertical distance to d -.\"O (if omitted, d=0.4v); -.\"O does not cause a break. -パラグラフ間の間隔を引き数にセットする -(省略されると d=0.4v となる)。 -.TP -.BI \&.SS " t" -.\"O Subheading -.\"O .I t -.\"O (like -.\"O .BR \&.SH , -.\"O but used for a subsection inside a section). -サブヘッダ -.I t -.RB ( \&.SH -のようなものだが、サブセクションのために用いる)。 -.\"O .SS "Predefined Strings" -.SS 定義済みの文字列 -.\"O The -.\"O .B man -.\"O package has the following predefined strings: -.B man -パッケージには、以下のような定義済みの文字列がある: -.IP \e*R -.\"O Registration Symbol: \*R -登録シンボル: \*R -.IP \e*S -.\"O Change to default font size -デフォルトフォントサイズを変更する -.IP \e*(Tm -.\"O Trademark Symbol: \*(Tm -商標シンボル: \*(Tm -.IP \e*(lq -.\"O Left angled double quote: \*(lq -左に傾いたダブルクォート: \*(lq -.IP \e*(rq -.\"O Right angled double quote: \*(rq -右に傾いたダブルクォート: \*(rq -.\"O .SS "Safe Subset" -.SS 安全なサブセット -.\"O Although technically -.\"O .B man -.\"O is a troff macro package, in reality a large number of other tools -.\"O process man page files that don't implement all of troff's abilities. -.\"O Thus, it's best to avoid some of troff's more exotic abilities -.\"O where possible to permit these other tools to work correctly. -.\"O Avoid using the various troff preprocessors -.\"O (if you must, go ahead and use -.\"O .BR tbl (1), -.\"O but try to use the -.\"O .B IP -.\"O and -.\"O .B TP -.\"O commands instead for two-column tables). -.\"O Avoid using computations; most other tools can't process them. -.\"O Use simple commands that are easy to translate to other formats. -.\"O The following troff macros are believed to be safe (though in many cases -.\"O they will be ignored by translators): -技術的には -.B man -は troff のマクロパッケージだが、実際には多数の別のツールが -man ページのファイルを処理しており、それらは troff の全ての機能を -実装していないこともある。したがって、他のツールでも正しく処理できるように、 -troff のあまり一般的でない機能は、可能ならば用いないのが望ましい。 -様々な troff プリプロセッサ -も用いないほうが良いだろう (やむを得ない場合は -.BR tbl (1) -は用いても良い。しかし 2 列の表なら、代わりに -.B IP -や -.B TP -コマンドを用いてみよう)。 -計算機能も用いない方が良いだろう。他のツールのほとんどはこれらを処理できない。 -他のフォーマットに変換が容易な、単純なコマンドを使うようにしよう。 -以下の troff コマンドは、使っても問題ないと考えてよいだろう -(多くの場合、変換コマンドによって無視されるかもしれないが)。 -.BR \e" , -.BR . , -.BR ad , -.BR bp , -.BR br , -.BR ce , -.BR de , -.BR ds , -.BR el , -.BR ie , -.BR if , -.BR fi , -.BR ft , -.BR hy , -.BR ig , -.BR in , -.BR na , -.BR ne , -.BR nf , -.BR nh , -.BR ps , -.BR so , -.BR sp , -.BR ti , -.\"O .BR tr . -.B tr -.PP -.\"O You may also use many troff escape sequences (those sequences beginning -.\"O with \e). -.\"O When you need to include the backslash character as normal text, -.\"O use \ee. -.\"O Other sequences you may use, where x or xx are any characters and N -.\"O is any digit, include: -troff のエスケープシーケンスの多くも利用できる -(これらのエスケープシーケンスは \e で始まる)。 -バックスラッシュ文字を通常のテキストとして使いたい場合は \ee とする。 -利用できる他のシーケンスには以下のようなものがある (x や xx -は任意の文字, N は任意の数字): -.BR \e' , -.BR \e` , -.BR \e- , -.BR \e. , -.BR \e" , -.BR \e% , -.BR \e*x , -.BR \e*(xx , -.BR \e(xx , -.BR \e$N , -.BR \enx , -.BR \en(xx , -.BR \efx , -.\"O and -.BR \ef(xx . -.\"O Avoid using the escape sequences for drawing graphics. -グラフィックの描画にはエスケープシーケンスは用いないほうが良い。 -.PP -.\"O Do not use the optional parameter for -.\"O .B bp -.\"O (break page). -.\"O Use only positive values for -.\"O .B sp -.\"O (vertical space). -.\"O Don't define a macro -.\"O .RB ( de ) -.\"O with the same name as a macro in this or the -.\"O mdoc macro package with a different meaning; it's likely that -.\"O such redefinitions will be ignored. -.\"O Every positive indent -.\"O .RB ( in ) -.\"O should be paired with a matching negative indent -.\"O (although you should be using the -.\"O .B RS -.\"O and -.\"O .B RE -.\"O macros instead). -.\"O The condition test -.\"O .RB ( if,ie ) -.\"O should only have \(aqt\(aq or \(aqn\(aq as the condition. -.\"O Only translations -.\"O .RB ( tr ) -.\"O that can be ignored should be used. -.\"O Font changes -.\"O .RB ( ft -.\"O and the \fB\ef\fP escape sequence) -.\"O should only have the values 1, 2, 3, 4, R, I, B, P, or CW -.\"O (the ft command may also have no parameters). -.B bp -(改頁) にはオプションパラメータを用いないこと。 -.B sp -(垂直スペース) には正の値のみを用いること。 -man や mdoc マクロパッケージにあるマクロと、 -名前が同じで機能の異なるマクロを定義 -.RB ( de ) -しないこと。そのような再定義は無視される可能性が高い。 -正方向へのインデント -.RB ( in ) -には、負のインデントを対応させること (このマクロの代わりに -.B RS -と -.B RE -マクロを使った方がよいのだが)。 -条件テスト -.RB ( if , ie ) -は状態として \(aqt\(aq または \(aqn\(aq だけを持つようにすること。 -変換 -.RB ( tr ) -には無視できるものだけを使うこと。 -フォントの変更 -.RB ( ft -と \fB\ef\fP エスケープシーケンス) には -1, 2, 3, 4, R, I, B, P, CW のみを用いること -(ft コマンドの場合はパラメータを指定しなくてもよい)。 -.PP -.\"O If you use capabilities beyond these, check the -.\"O results carefully on several tools. -.\"O Once you've confirmed that the additional capability is safe, -.\"O let the maintainer of this -.\"O document know about the safe command or sequence -.\"O that should be added to this list. -この制限を越えて機能を用いる場合は、いくつかのツールを使って、 -その結果を注意してチェックすること。追加した機能が安全だと -確信したら、この文書の管理者にその安全なコマンドまたはシーケンスを -教えてほしい。リストに追加する。 -.\"O .SH FILES -.SH ファイル -.IR /usr/share/groff/ [*/] tmac/an.tmac -.br -.I /usr/man/whatis -.\"O .SH NOTES -.SH 注意 -.PP -.\"O By all means include full URLs (or URIs) in the text itself; -.\"O some tools such as -.\"O .BR man2html (1) -.\"O can automatically turn them into hypertext links. -.\"O You can also use the new -.\"O .B URL -.\"O macro to identify links to related information. -.\"O If you include URLs, use the full URL -.\"O (e.g., ) to ensure that tools -.\"O can automatically find the URLs. -テキストにはぜひとも完全な URL (または URI) を書くようにすること。 -.BR man2html (1) -のようなツールは、これらを自動的にハイパーテキストリンクに変換する。 -新たに取り入れられた -.B URL -マクロを関連情報へのリンクに用いても良い。 URL を書く場合は、 -例えば のように完全な形式で書き、 -ツールによる URL 自動検知ができるようにすること。 -.PP -.\"O Tools processing these files should open the file and examine the first -.\"O nonwhitespace character. -.\"O A period (.) or single quote (') at the beginning -.\"O of a line indicates a troff-based file (such as man or mdoc). -.\"O A left angle bracket (<) indicates an SGML/XML-based -.\"O file (such as HTML or Docbook). -.\"O Anything else suggests simple ASCII -.\"O text (e.g., a "catman" result). -これらのファイルを処理するツールは、ファイルをオープンして -最初の空白以外の文字を調べる。行の先頭にピリオド (.) -またはシングルクォート (') があると、これは troff ベースの -ファイル (man や mdoc) であるとみなす。左角括弧 (<) は -SGML/XML ベースのファイル (HTML や Docbook) であるとみなす。 -それ以外は単純な ASCII テキスト ("catman" の結果など) とみなす。 -.PP -.\"O Many man pages begin with \fB\'\e"\fP followed by a -.\"O space and a list of characters, -.\"O indicating how the page is to be preprocessed. -.\"O For portability's sake to non-troff translators we recommend -.\"O that you avoid using anything other than -.\"O .BR tbl (1), -.\"O and Linux can detect that automatically. -.\"O However, you might want to include this information so your man page -.\"O can be handled by other (less capable) systems. -.\"O Here are the definitions of the preprocessors invoked by these characters: -多くの man ページは、最初の行が \fB\'\e"\fP とスペースで始まっており、 -そこにはそのページが処理されるべきプリプロセスを表す文字が書いてある。 -troff 以外の変換プログラムへの移植性のため、 -.BR tbl (1) -や、 Linux が自動的に検知できるもの以外は使わないようにすることを勧める。 -しかし、この情報を記述して、書いたページが他の (より低機能な) システムでも -扱えるようにしたい場合もあるかも知れない。 -以下にこれらの文字によって起動されるプリプロセッサの定義を示す: -.TP 3 -.B e -eqn(1) -.TP -.B g -grap(1) -.TP -.B p -pic(1) -.TP -.B r -refer(1) -.TP -.B t -tbl(1) -.TP -.B v -vgrind(1) -.\"O .SH BUGS -.SH バグ -.PP -.\"O Most of the macros describe formatting (e.g., font type and spacing) instead -.\"O of marking semantic content (e.g., this text is a reference to another page), -.\"O compared to formats like mdoc and DocBook (even HTML has more semantic -.\"O markings). -.\"O This situation makes it harder to vary the -.\"O .B man -.\"O format for different media, -.\"O to make the formatting consistent for a given media, and to automatically -.\"O insert cross-references. -.\"O By sticking to the safe subset described above, it should be easier to -.\"O automate transitioning to a different reference page format in the future. -mdoc や DocBook に比べると、 -マクロの多くは書式 (フォントタイプやスペーシングなど) に関するものであり、 -意味上のもの (このテキストは他のページへの参照である、など) ではない -(HTML ですら意味的なマーキングに思える)。 -このため、 -.B man -フォーマットを他のメディアへ変換したり、 -フォーマットを他のメディアで有効なものにしたり、 -相互参照を自動的に挿入したりすることが困難になっている。 -上に挙げたような安全なサブセットを守れば、 -将来別のリファレンスページフォーマットへ変換する作業が簡単になるだろう。 -.LP -.\"O The Sun macro -.\"O .B TX -.\"O is not implemented. -Sun のマクロである -.B TX -は定義されていない。 -.\"O .\" .SH AUTHORS -.\" .SH 著者 -.\"O .\" .IP \(em 3m -.\"O .\" James Clark (jjc@jclark.com) wrote the implementation of the macro package. -.\"O .\" .IP \(em -.\"O .\" Rickard E. Faith (faith@cs.unc.edu) wrote the initial version of -.\"O .\" this manual page. -.\"O .\" .IP \(em -.\"O .\" Jens Schweikhardt (schweikh@noc.fdn.de) wrote the Linux Man-Page Mini-HOWTO -.\"O .\" (which influenced this manual page). -.\"O .\" .IP \(em -.\"O .\" David A. Wheeler (dwheeler@ida.org) heavily modified this -.\"O .\" manual page, such as adding detailed information on sections and macros. -.\" .IP \(em 3m -.\" James Clark (jjc@jclark.com) がマクロパッケージの実装を書いた。 -.\" .IP \(em -.\" Rickard E. Faith (faith@cs.unc.edu) がこのマニュアルページの最初の版を書いた。 -.\" .IP \(em -.\" Jens Schweikhardt (schweikh@noc.fdn.de) は Linux Man-Page Mini-HOWTO -.\" を書いた (本マニュアルページもこの文書の影響を受けている)。 -.\" .IP \(em -.\" David A. Wheeler (dwheeler@ida.org) はこのマニュアルページを大きく変更し、 -.\" セクションやマクロに関する細かな情報を追加するなどを行った。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR apropos (1), -.BR groff (1), -.BR man (1), -.BR man2html (1), -.BR whatis (1), -.BR groff_man (7), -.BR groff_www (7), -.BR man-pages (7), -.BR mdoc (7), -.BR mdoc.samples (7) diff --git a/draft/man7/mdoc.7 b/draft/man7/mdoc.7 index 3bd20cdf..3268edaf 100644 --- a/draft/man7/mdoc.7 +++ b/draft/man7/mdoc.7 @@ -30,370 +30,204 @@ .\" SUCH DAMAGE. .\" .\" @(#)mdoc.7 8.2 (Berkeley) 12/30/93 -.\" $Id: mdoc.7,v 1.6 2000/09/07 07:21:50 hanataka Exp $ +.\" $Id: mdoc.7,v 1.8 1998/12/04 00:51:17 jkoshy Exp $ .\" .\" The December 30, 1993 version .\" Modified by David A. Wheeler (dwheeler@ida.org) on 1999-07-11 .\" to conform to Linux. .\" -.\" Japanese Version Copyright (c) 2000 NAKANO Takeo all rights reserved. -.\" Translated Fri 14 Jan 2000 by NAKANO Takeo -.\" Updated 2008-07-31 by Kentaro Shirakata .\" -.\"WORD: manual domain macro マニュアルドメインマクロ -.\"WORD: general text domain macro 一般テキストドメインマクロ -.\"WORD: callable macro 呼び出し可能マクロ +.\"******************************************************************* .\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* .Dd July 11, 1999 .Dt MDOC 7 .Os Linux -.\"O .Sh NAME .Sh 名前 .Nm mdoc -.\"O .Nd quick reference guide for the -.Nd +.Nd Macro Package .Nm \-mdoc -マクロパッケージのクイックリファレンスガイド -.\"O .Nm \-mdoc -.\"O macro package -.\"O .Sh SYNOPSIS +のクイックリファレンスガイド .Sh 書式 .Nm groff .Fl m Ns Ar doc .Ar files ... -.\"O .Sh DESCRIPTION .Sh 説明 -.\"O The -.\"O .Nm \-mdoc -.\"O package is a set of content-based and domain-based macros -.\"O used to format the -.\"O .Bx -.\"O man pages. -.\"O The macro names and their meanings are -.\"O listed below for quick reference; for -.\"O a detailed explanation on using the package, -.\"O see the tutorial sampler -.\"O .Xr mdoc.samples 7 . .Nm \-mdoc パッケージは .Bx man ページに用いられる内容ベース・ドメインベースのマクロである。 -以下ではクイックリファレンスとしてマクロの名前とその意味をリストする。 -このパッケージの利用法に関する詳細な説明は、 -チュートリアル用の見本である +以下ではクイックリファレンスとしてマクロの名前とその意味をリストする。 このパッケージの利用法に関する詳細な説明は、 チュートリアル用の見本である .Xr mdoc.samples 7 を参照すること。 .Pp -.\"O Note that this is not the usual macro package for Linux documentation, -.\"O although it is used for documentation of several widely used programs; -.\"O see -.\"O .Xr man 7 . -これは Linux の文書で通常用いられているマクロパッケージとは異なる。 -しかし広く用いられているいくつかのプログラムの文書で、 +これは Linux の文書で通常用いられているマクロパッケージとは異なる。 しかし広く用いられているいくつかのプログラムの文書で、 このマクロが利用されている。 .Xr man 7 を見よ。 .Pp -.\"O The macros are described in two groups, the first -.\"O includes the structural and physical page layout macros. -.\"O The second contains the manual and general text domain -.\"O macros which differentiate the -.\"O .Nm \-mdoc -.\"O package from other -.\"O .Xr troff -.\"O formatting packages. -マクロは 2 つのグループに分けて説明する。 -最初のグループは構造や物理的なページレイアウトに関するマクロである。 -2 つめはマニュアルドメインマクロ (manual domain macro) -や一般テキストドメインマクロ (general text domain macro) -で、 +マクロは 2 つのグループに分けて説明する。 最初のグループは構造や物理的なページレイアウトに関するマクロである。 2 つめはマニュアルドメインマクロ +(manual domain macro) や一般テキストドメインマクロ (general text domain macro) で、 .Nm \-mdoc パッケージを他の .Xr troff フォーマットパッケージと差別化しているものである。 -.\"O .Sh PAGE STRUCTURE DOMAIN .Sh ページ構造のドメイン -.\"O .Ss Title Macros .Ss タイトルマクロ -.\"O To create a valid manual page, these three macros, in this order, -.\"O are required: -正しいマニュアルページを生成するためには、これらの 3 つのマクロを -この順番で書く必要がある。 +正しいマニュアルページを生成するためには、これらの 3 つのマクロを この順番で書く必要がある。 .Bl -tag -width "xxxx.Os OPERATINGxSYSTEM [version/release]" -compact .It Li "\&.Dd " Ar "Month day, year" -.\"O Document date. 文書の日付。 .It Li "\&.Dt " Ar "DOCUMENT_TITLE [section] [volume]" -.\"O Title, in upper case. タイトルを大文字で。 .It Li "\&.Os " Ar "OPERATING_SYSTEM [version/release]" -.\"O Operating system オペレーティングシステム .Pq Tn BSD . .El -.\"O .Ss Page Layout Macros .Ss ページレイアウトマクロ -.\"O Section headers, paragraph breaks, lists and displays. セクションヘッダ、段落の終わり、リスト、表示など。 .Bl -tag -width flag -compact .It Li \&.Sh -.\"O Section Headers. -.\"O Valid headers, in the order of presentation: -セクションのヘッダ。 -正しいヘッダは、現れる順に: +セクションのヘッダ。 正しいヘッダは、現れる順に: .Bl -tag -width "RETURN VALUE" -compact .It Ar NAME -.\"O Name section, should include the 名前のセクション。 .Ql \&.Nm -.\"O or , .Ql \&.Fn -.\"O and the , .Ql \&.Nd -.\"O macros. などのマクロを含む。 .It Ar SYNOPSIS -.\"O Usage. 利用法。 .It Ar DESCRIPTION -.\"O General description, should include -.\"O options and parameters. 一般的な説明。オプションやパラメータの説明も含む。 .It Ar RETURN VALUE -.\"O Sections two and three function calls. セクション 2 や 3 の関数コール。 .It Ar ENVIRONMENT -.\"O Describe environment variables. 環境変数を説明する。 .It Ar FILES -.\"O Files associated with the subject. 内容に関係するファイル。 .It Ar EXAMPLES -.\"O Examples and suggestions. 例やおすすめ。 .It Ar DIAGNOSTICS -.\"O Normally used for section four device interface diagnostics. 通常セクション 4 のデバイスインターフェースの診断用。 .It Ar ERRORS -.\"O Sections two and three error and signal -.\"O handling. セクション 2 や 3 のエラーやシグナル処理。 .It Ar SEE ALSO -.\"O Cross references and citations. 相互参照や引用。 .It Ar CONFORMING TO -.\"O Conformance to standards if applicable. 可能なら標準への準拠。 .It Ar HISTORY -.\"O If a standard is not applicable, the history -.\"O of the subject should be given. -標準が適用されていない場合は、 -歴史的な内容を与えるべきである。 +標準が適用されていない場合は、 歴史的な内容を与えるべきである。 .It Ar BUGS -.\"O Gotchas and caveats. 瑕疵や警告。 .It Ar other -.\"O Customized headers may be added at -.\"O the authors discretion. 筆者の判断でヘッダをあつらえてもよい。 .El .It Li \&.Ss -.\"O Subsection Headers. サブセクションのヘッダ。 .It Li \&.Pp -.\"O Paragraph Break. -.\"O Vertical space (one line). -段落の区切り。 -垂直スペース (一行)。 +段落の区切り。 垂直スペース (一行)。 .It Li \&.D1 -.\"O (D-one) Display-one -.\"O Indent and display one text line. -(D-one) Display-one -インデントしてテキストを一行表示。 +(D-one) Display-one インデントしてテキストを一行表示。 .It Li \&.Dl -.\"O (D-ell) Display-one literal. -.\"O Indent and display one line of literal text. -(D-ell) Displey-one literal。 -インデントしてリテラルなテキストを一行表示。 +(D-ell) Displey-one literal。 インデントしてリテラルなテキストを一行表示。 .It Li \&.Bd -.\"O Begin-display block. -.\"O Display options: -表示ブロックの開始。 -表示オプション: +表示ブロックの開始。 表示オプション: .Bl -tag -width "xoffset string " -compact .It Fl ragged -.\"O Unjustified (ragged edges). 揃えない (両端は不揃い)。 .It Fl filled -.\"O Justified. 揃える。 .It Fl literal -.\"O Literal text or code. リテラルなテキストまたはコード。 .It Fl file Ar name -.\"O Read in named -.\"O .Ar file -.\"O and display. 指定された .Ar file を読んで表示する。 .It Fl offset Ar string -.\"O Offset display. -.\"O Acceptable -.\"O .Ar string -.\"O values: -オフセット表示。 -受付ける +オフセット表示。 受付ける .Ar string の値は: .Bl -tag -width indent-two -compact .It Ar left -.\"O Align block on left (default). ブロックを左に揃える (デフォルト)。 .It Ar center -.\"O Approximate center margin. 大まかなセンターマージン。 .It Ar indent -.\"O Six constant width spaces (a tab). 定数幅の空白 6 つ (タブ 1 つ)。 .It Ar indent-two -.\"O Two tabs. タブ 2 つ。 .It Ar right -.\"O Left aligns block 2 inches from -.\"O right. 揃えブロックを右から 2 インチの位置に残す。 -.\"NAKANO ??? .It Ar xx Ns Cm n -.\"O Where -.\"O .Ar xx -.\"O is a number from .Ar xx は .No \&4 Ns Cm n -.\"O to から -.\"O .No \&9\&9 Ns Cm n . .No \&9\&9 Ns Cm n までの数字。 .It Ar Aa -.\"O Where -.\"O .Ar Aa -.\"O is a callable macro name. .Ar Aa は呼びだし可能なマクロの名前。 .It Ar string -.\"O The width of -.\"O .Ar string -.\"O is used. .Ar string の幅が用いられる。 .El .El .It Li \&.Ed -.\"O End-display (matches \&.Bd). 表示終了 (\&.Bd にマッチする)。 .It Li \&.Bl -.\"O Begin-list. -.\"O Create lists or columns. -.\"O Options: -リスト開始。 -リストまたはコラムを生成する。オプションは以下: +リスト開始。 リストまたはコラムを生成する。オプションは以下: .Bl -tag -width flag -compact -.\"O .It Ar List-types .It Ar リスト形式 .Bl -column xbullet -compact -.\"O .It Fl bullet Ta "Bullet Item List" -.\"O .It Fl item Ta "Unlabeled List" -.\"O .It Fl enum Ta "Enumerated List" -.\"O .It Fl tag Ta "Tag Labeled List" -.\"O .It Fl diag Ta "Diagnostic List" -.\"O .It Fl hang Ta "Hanging Labeled List" -.\"O .It Fl ohang Ta "Overhanging Labeled List" -.\"O .It Fl inset Ta "Inset or Run-on Labeled List" -.It Fl bullet Ta "中黒のアイテムリスト" -.It Fl item Ta "ラベルなしリスト" -.It Fl enum Ta "数値付きリスト" -.It Fl tag Ta "タグラベル付きリスト" +.It Fl bullet Ta 中黒のアイテムリスト +.It Fl item Ta ラベルなしリスト +.It Fl enum Ta 数値付きリスト +.It Fl tag Ta タグラベル付きリスト .It Fl diag Ta "診断リスト (diagnostic list)" -.It Fl hang Ta "ぶらさがりラベルリスト" -.It Fl ohang Ta "飛び出しラベルリスト" -.It Fl inset Ta "ラベル付きリストの挿入・継続" +.It Fl hang Ta ぶらさがりラベルリスト +.It Fl ohang Ta 飛び出しラベルリスト +.It Fl inset Ta ラベル付きリストの挿入・継続 .El -.\"O .It List-parameters .It リストパラメータ .Bl -tag -width "xcompact " -compact .It Fl offset -.\"O (All lists.) See -.\"O .Ql \&.Bd -.\"O begin-display above. (全てのリスト) 上記の .Ql \&.Bd ディスプレイ開始 (begin-display) を見よ。 .It Fl width .Pf ( Fl tag -.\"O and および .Fl hang -.\"O lists only.) リストのみ) -.\"O See -.\"O .Ql \&.Bd . .Ql \&.Bd . を見よ。 .It Fl compact -.\"O (All lists.) -.\"O Suppresses blank lines. -(全てのリスト) -空行を抑制する。 +(全てのリスト) 空行を抑制する。 .El .El .It Li \&.El -.\"O End-list. リストの終わり。 .It Li \&.It -.\"O List item. リスト項目。 .El -.\"O .Sh MANUAL AND GENERAL TEXT DOMAIN MACROS .Sh マニュアルドメインマクロと一般テキストドメインマクロ -.\"O The manual and general text domain macros are special in that -.\"O most of them are parsed for callable macros -.\"O for example: -マニュアルドメインマクロと一般テキストドメインマクロとが -他と異なっているのは、 -呼びだし可能マクロ (callable macro) の内部では、 -そのほとんどがパーズされるという点である。 -例えば以下のように変換される: +マニュアルドメインマクロと一般テキストドメインマクロとが 他と異なっているのは、 呼びだし可能マクロ (callable macro) の内部では、 +そのほとんどがパーズされるという点である。 例えば以下のように変換される: .Bl -tag -width ".Op Fl s Ar filex" -offset indent .It Li "\&.Op Fl s Ar file" -.\"O Produces → .Op Fl s Ar file .El .Pp -.\"O In this example, the option enclosure macro -.\"O .Ql \&.Op -.\"O is parsed, and calls the callable content macro -.\"O .Ql \&Fl -.\"O which operates on the argument -.\"O .Ql s -.\"O and then calls the callable content macro -.\"O .Ql \&Ar -.\"O which operates on the argument -.\"O .Ql file . -.\"O Some macros may be callable, but are not parsed and vice versa. -.\"O These macros are indicated in the -.\"O .Em parsed -.\"O and -.\"O .Em callable -.\"O columns below. この例では、囲みマクロ .Ql \&.Op -に与えられたオプションがパーズされ、 -中身の呼びだし可能なマクロである +に与えられたオプションがパーズされ、 中身の呼びだし可能なマクロである .Ql \&Fl が呼ばれ、引数である .Ql s @@ -401,310 +235,164 @@ man ページに用いられる内容ベース・ドメインベースのマク .Ql \&Ar が呼ばれ、引数である .Ql file -に作用する。呼びだし可能であるがパースされないマクロや、 -その逆のマクロも存在する。このようなマクロは以下の +に作用する。呼びだし可能であるがパースされないマクロや、 その逆のマクロも存在する。このようなマクロは以下の .Em parsed カラムや .Em callable カラムで示す。 .Pp -.\"O Unless stated, manual domain macros share a common syntax: 特に記述がなければ、マニュアルドメインマクロは共通の書式をとる: .Pp -.Dl \&.Va argument [\ .\ ,\ ;\ :\ (\ )\ [\ ]\ argument \...\ ] +.Dl \&.Va argument [\ .\ ,\ ;\ :\ (\ )\ [\ ]\ argument ...\ ] .Pp -.\"O .Sy Note : -.\"O Opening and closing -.\"O punctuation characters are only recognized as such if they are presented -.\"O one at a time. -.\"O The string -.\"O .Ql ")," -.\"O is not recognized as punctuation and will be output with a leading white -.\"O space and in what ever font the calling macro uses. .Sy 注意 : 句読文字 (punctuation character) の開き・閉じは、 -それらが一度に単一の文字で現れた場合のみそのように解釈される。 -文字列 +それらが一度に単一の文字で現れた場合のみそのように解釈される。 文字列 .Ql ")," は、句読区切りとはみなされず、その前に空白文字があれば -その文字とともに、また呼び出したマクロが用いるフォントで出力される。 -.\"O The -.\"O argument list -.\"O .Ql "] ) ," -.\"O is recognized as three sequential closing punctuation characters -.\"O and a leading white space is not output between the characters -.\"O and the previous argument (if any). -引数リスト +その文字とともに、また呼び出したマクロが用いるフォントで出力される。 引数リスト .Ql "] ) ," -は 3 つの連続した閉じ句読文字と解釈され、 -それぞれの前にある空白文字は、各文字や (もしあれば) その前にある -引数との間には出力されない。 -.\"O The special meaning of a punctuation character may be escaped -.\"O with the string -.\"O .Ql \e& . -.\"O For example the following string, +は 3 +つの連続した閉じ句読文字と解釈され、 それぞれの前にある空白文字は、各文字や (もしあれば) その前にある 引数との間には出力されない。 特殊な意味を持つ句読文字は、文字列 .Ql \e& -によってエスケープできる。 -例えば以下の左の文字列は右のように変換される。 +によってエスケープできる。 例えば以下の左の文字列は右のように変換される。 .Bl -tag -width "&.Ar file1\ , file2\ , file3\ )\ ." -offset indent .It Li "\&.Ar file1\ , file2\ , file3\ )\ ." -.\"O Produces → .Ar file1 , file2 , file3 ) . .El .ne 1i -.\"O .Ss Manual Domain Macros .Ss マニュアルドメインマクロ -.Bl -column "Name" "Parsed" Callable" -compact -.\"O .It Em Name Parsed Callable Description -.It Em 名前 Parsed Callable 説明 -.\"O .It Li \&Ad Ta Yes Ta Yes Ta "Address. (This macro may be deprecated.)" -.\"O .It Li \&An Ta Yes Ta Yes Ta "Author name." -.\"O .It Li \&Ar Ta Yes Ta Yes Ta "Command-line argument." -.\"O .It Li \&Cd Ta \&No Ta \&No Ta "Configuration declaration (section four only)." -.\"O .It Li \&Cm Ta Yes Ta Yes Ta "Command-line argument modifier." +.Bl -column Name Parsed Callable\(dq -compact +.It Em "名前 Parsed Callable 説明" .It Li \&Ad Ta Yes Ta Yes Ta "アドレス (このマクロは使わない方が良い)" -.It Li \&An Ta Yes Ta Yes Ta "著者の名前" -.It Li \&Ar Ta Yes Ta Yes Ta "コマンドライン引数" +.It Li \&An Ta Yes Ta Yes Ta 著者の名前 +.It Li \&Ar Ta Yes Ta Yes Ta コマンドライン引数 .It Li \&Cd Ta \&No Ta \&No Ta "設定の宣言 (セクション 4 のみ)" -.It Li \&Cm Ta Yes Ta Yes Ta "コマンドライン引数の修正子" -.\"O .It Li \&Dv Ta Yes Ta Yes Ta "Defined variable (source code)." -.\"O .It Li \&Er Ta Yes Ta Yes Ta "Error number (source code)." -.\"O .It Li \&Ev Ta Yes Ta Yes Ta "Environment variable." -.\"O .It Li \&Fa Ta Yes Ta Yes Ta "Function argument." -.\"O .It Li \&Fd Ta Yes Ta Yes Ta "Function declaration." +.It Li \&Cm Ta Yes Ta Yes Ta コマンドライン引数の修正子 .It Li \&Dv Ta Yes Ta Yes Ta "定義済み変数 (ソースコード)" .It Li \&Er Ta Yes Ta Yes Ta "エラー番号 (ソースコード)" -.It Li \&Ev Ta Yes Ta Yes Ta "環境変数" -.It Li \&Fa Ta Yes Ta Yes Ta "関数の引き数" -.It Li \&Fd Ta Yes Ta Yes Ta "関数の宣言" -.\"O .It Li \&Fn Ta Yes Ta Yes Ta "Function call (also .Fo and .Fc)." -.\"O .It Li \&Ic Ta Yes Ta Yes Ta "Interactive command." -.\"O .It Li \&Li Ta Yes Ta Yes Ta "Literal text." -.\"O .It Li \&Nm Ta Yes Ta Yes Ta "Command name." -.\"O .It Li \&Op Ta Yes Ta Yes Ta "Option (also .Oo and .Oc)." +.It Li \&Ev Ta Yes Ta Yes Ta 環境変数 +.It Li \&Fa Ta Yes Ta Yes Ta 関数の引き数 +.It Li \&Fd Ta Yes Ta Yes Ta 関数の宣言 .It Li \&Fn Ta Yes Ta Yes Ta "関数呼びだし (.Fo と .Fc も)" -.It Li \&Ic Ta Yes Ta Yes Ta "インタラクティブなコマンド" -.It Li \&Li Ta Yes Ta Yes Ta "リテラルなテキスト" -.It Li \&Nm Ta Yes Ta Yes Ta "コマンドの名前" +.It Li \&Ic Ta Yes Ta Yes Ta インタラクティブなコマンド +.It Li \&Li Ta Yes Ta Yes Ta リテラルなテキスト +.It Li \&Nm Ta Yes Ta Yes Ta コマンドの名前 .It Li \&Op Ta Yes Ta Yes Ta "オプション (.Oo と .Oc も)" -.\"O .It Li \&Ot Ta Yes Ta Yes Ta "Old style function type (Fortran only)." -.\"O .It Li \&Pa Ta Yes Ta Yes Ta "Pathname or filename." -.\"O .It Li \&St Ta Yes Ta Yes Ta "Standards (\-p1003.2, \-p1003.1 or \-ansiC)" -.\"O .It Li \&Va Ta Yes Ta Yes Ta "Variable name." -.\"O .It Li \&Vt Ta Yes Ta Yes Ta "Variable type (Fortran only)." -.\"O .It Li \&Xr Ta Yes Ta Yes Ta "Manual Page Cross Reference." .It Li \&Ot Ta Yes Ta Yes Ta "古い形式の関数型 (Fortran のみ)." -.It Li \&Pa Ta Yes Ta Yes Ta "パス名またはファイル名" +.It Li \&Pa Ta Yes Ta Yes Ta パス名またはファイル名 .It Li \&St Ta Yes Ta Yes Ta "標準 (\-p1003.2, \-p1003.1, \-ansiC のどれか)" -.It Li \&Va Ta Yes Ta Yes Ta "変数の名前" +.It Li \&Va Ta Yes Ta Yes Ta 変数の名前 .It Li \&Vt Ta Yes Ta Yes Ta "変数の型 (Fortran のみ)" -.It Li \&Xr Ta Yes Ta Yes Ta "マニュアルページの相互参照" +.It Li \&Xr Ta Yes Ta Yes Ta マニュアルページの相互参照 .El -.\"O .Ss General Text Domain Macros .Ss 一般テキストドメインマクロ -.Bl -column "Name" "Parsed" Callable" -compact -.\"O .It Em "Name Parsed Callable Description" -.It Em 名前 Parsed Callable 説明 -.\"O .It Li \&%A Ta Yes Ta \&No Ta "Reference author." -.\"O .It Li \&%B Ta Yes Ta Yes Ta "Reference book title." -.\"O .It Li \&%\&C Ta \&No Ta \&No Ta "Reference place of publishing (city)." -.\"O .It Li \&%\&D Ta \&No Ta \&No Ta "Reference date." -.\"O .It Li \&%J Ta Yes Ta Yes Ta "Reference journal title." -.It Li \&%A Ta Yes Ta \&No Ta "参考文献の著者" -.It Li \&%B Ta Yes Ta Yes Ta "参考文献の書籍タイトル" +.Bl -column Name Parsed Callable\(dq -compact +.It Em "名前 Parsed Callable 説明" +.It Li \&%A Ta Yes Ta \&No Ta 参考文献の著者 +.It Li \&%B Ta Yes Ta Yes Ta 参考文献の書籍タイトル .It Li \&%\&C Ta \&No Ta \&No Ta "参考文献の出版地 (街)" -.It Li \&%\&D Ta \&No Ta \&No Ta "参考文献の日付" -.It Li \&%J Ta Yes Ta Yes Ta "参考文献の雑誌名" -.\"O .It Li \&%N Ta \&No Ta \&No Ta "Reference issue number." -.\"O .It Li \&%\&O Ta \&No Ta \&No Ta "Reference optional information." -.\"O .It Li \&%P Ta \&No Ta \&No Ta "Reference page number(s)." -.\"O .It Li \&%R Ta \&No Ta \&No Ta "Reference report Name." -.\"O .It Li \&%T Ta Yes Ta Yes Ta "Reference article title." -.It Li \&%N Ta \&No Ta \&No Ta "参考文献の号数" -.It Li \&%\&O Ta \&No Ta \&No Ta "参考文献の補助情報" -.It Li \&%P Ta \&No Ta \&No Ta "参考文献のページ" -.It Li \&%R Ta \&No Ta \&No Ta "参考文献のリポート名" -.It Li \&%T Ta Yes Ta Yes Ta "参考文献の記事タイトル" -.\"O .It Li \&%V Ta \&No Ta \&No Ta "Reference volume." -.\"O .It Li \&Ac Ta Yes Ta Yes Ta "Angle close quote." -.\"O .It Li \&Ao Ta Yes Ta Yes Ta "Angle open quote." -.\"O .It Li \&Ap Ta Yes Ta Yes Ta "Apostrophe." -.\"O .It Li \&Aq Ta Yes Ta Yes Ta "Angle quote." -.It Li \&%V Ta \&No Ta \&No Ta "参考文献の巻数" -.It Li \&Ac Ta Yes Ta Yes Ta "アングルクォートの閉じ" -.It Li \&Ao Ta Yes Ta Yes Ta "アングルクォートの開き" -.It Li \&Ap Ta Yes Ta Yes Ta "アポストロフィ" -.It Li \&Aq Ta Yes Ta Yes Ta "アングルクォート" -.\"O .It Li \&At Ta \&No Ta \&No Ta Tn "AT&T UNIX" -.\"O .It Li \&Bc Ta Yes Ta Yes Ta "Bracket close quote." -.\"O .It Li \&Bf Ta \&No Ta \&No Ta "Begin font mode." -.\"O .It Li \&Bo Ta Yes Ta Yes Ta "Bracket open quote." -.\"O .It Li \&Bq Ta Yes Ta Yes Ta "Bracket quote." +.It Li \&%\&D Ta \&No Ta \&No Ta 参考文献の日付 +.It Li \&%J Ta Yes Ta Yes Ta 参考文献の雑誌名 +.It Li \&%N Ta \&No Ta \&No Ta 参考文献の号数 +.It Li \&%\&O Ta \&No Ta \&No Ta 参考文献の補助情報 +.It Li \&%P Ta \&No Ta \&No Ta 参考文献のページ +.It Li \&%R Ta \&No Ta \&No Ta 参考文献のリポート名 +.It Li \&%T Ta Yes Ta Yes Ta 参考文献の記事タイトル +.It Li \&%V Ta \&No Ta \&No Ta 参考文献の巻数 +.It Li \&Ac Ta Yes Ta Yes Ta アングルクォートの閉じ +.It Li \&Ao Ta Yes Ta Yes Ta アングルクォートの開き +.It Li \&Ap Ta Yes Ta Yes Ta アポストロフィ +.It Li \&Aq Ta Yes Ta Yes Ta アングルクォート .It Li \&At Ta \&No Ta \&No Ta Tn "AT&T UNIX" -.It Li \&Bc Ta Yes Ta Yes Ta "ブラケットクォートの閉じ" -.It Li \&Bf Ta \&No Ta \&No Ta "フォントモードの開始" -.It Li \&Bo Ta Yes Ta Yes Ta "ブラケットクォートの開き" -.It Li \&Bq Ta Yes Ta Yes Ta "ブラケットクォート" -.\"O .It Li \&Bx Ta Yes Ta Yes Ta Bx . -.\"O .It Li \&Db Ta \&No Ta \&No Ta "Debug (default is \\*qoff\\*q)" -.\"O .It Li \&Dc Ta Yes Ta Yes Ta "Double close quote." -.\"O .It Li \&Do Ta Yes Ta Yes Ta "Double open quote." -.\"O .It Li \&Dq Ta Yes Ta Yes Ta "Double quote." +.It Li \&Bc Ta Yes Ta Yes Ta ブラケットクォートの閉じ +.It Li \&Bf Ta \&No Ta \&No Ta フォントモードの開始 +.It Li \&Bo Ta Yes Ta Yes Ta ブラケットクォートの開き +.It Li \&Bq Ta Yes Ta Yes Ta ブラケットクォート .It Li \&Bx Ta Yes Ta Yes Ta Bx . -.It Li \&Db Ta \&No Ta \&No Ta "デバッグ (デフォルトは \\*qoff\\*q)" -.It Li \&Dc Ta Yes Ta Yes Ta "ダブルクォートの閉じ" -.It Li \&Do Ta Yes Ta Yes Ta "ダブルクォートの開き" -.It Li \&Dq Ta Yes Ta Yes Ta "ダブルクォート" -.\"O .It Li \&Ec Ta Yes Ta Yes Ta "Enclose string close quote." -.\"O .It Li \&Ef Ta \&No Ta \&No Ta "End font mode." -.\"O .It Li \&Em Ta Yes Ta Yes Ta "Emphasis (traditional English)." -.\"O .It Li \&Eo Ta Yes Ta Yes Ta "Enclose string open quote." -.\"O .It Li \&Fx Ta \&No Ta \&No Ta Tn "FreeBSD operating system" -.It Li \&Ec Ta Yes Ta Yes Ta "エンクローズ文字列引用の閉じ" -.It Li \&Ef Ta \&No Ta \&No Ta "フォントモードの終了" +.It Li \&Db Ta \&No Ta \&No Ta "デバッグ (デフォルトは \*qoff\*q)" +.It Li \&Dc Ta Yes Ta Yes Ta ダブルクォートの閉じ +.It Li \&Do Ta Yes Ta Yes Ta ダブルクォートの開き +.It Li \&Dq Ta Yes Ta Yes Ta ダブルクォート +.It Li \&Ec Ta Yes Ta Yes Ta エンクローズ文字列引用の閉じ +.It Li \&Ef Ta \&No Ta \&No Ta フォントモードの終了 .It Li \&Em Ta Yes Ta Yes Ta "強調 (traditional English)." -.It Li \&Eo Ta Yes Ta Yes Ta "エンクローズ文字列引用の開き" +.It Li \&Eo Ta Yes Ta Yes Ta エンクローズ文字列引用の開き .It Li \&Fx Ta \&No Ta \&No Ta Tn "FreeBSD operating system" -.\"O .It Li \&No Ta Yes Ta Yes Ta "Normal text (no-op)." -.\"O .It Li \&Ns Ta Yes Ta Yes Ta "No space." -.\"O .It Li \&Pc Ta Yes Ta Yes Ta "Parenthesis close quote." -.\"O .It Li \&Pf Ta Yes Ta \&No Ta "Prefix string." -.\"O .It Li \&Po Ta Yes Ta Yes Ta "Parenthesis open quote." .It Li \&No Ta Yes Ta Yes Ta "通常のテキスト (効果なし)" -.It Li \&Ns Ta Yes Ta Yes Ta "スペース無し" -.It Li \&Pc Ta Yes Ta Yes Ta "括弧クォートの閉じ" -.It Li \&Pf Ta Yes Ta \&No Ta "前置文字" -.It Li \&Po Ta Yes Ta Yes Ta "括弧クォートの開き" -.\"O .It Li \&Pq Ta Yes Ta Yes Ta "Parentheses quote." -.\"O .It Li \&Qc Ta Yes Ta Yes Ta "Straight Double close quote." -.\"O .It Li \&Ql Ta Yes Ta Yes Ta "Quoted literal." -.\"O .It Li \&Qo Ta Yes Ta Yes Ta "Straight Double open quote." -.\"O .It Li \&Qq Ta Yes Ta Yes Ta "Straight Double quote." -.It Li \&Pq Ta Yes Ta Yes Ta "括弧クォート" -.It Li \&Qc Ta Yes Ta Yes Ta "ダブルストレートクォートの閉じ" -.It Li \&Ql Ta Yes Ta Yes Ta "クォートされたリテラル" -.It Li \&Qo Ta Yes Ta Yes Ta "ダブルストレートクォートの閉じ" -.It Li \&Qq Ta Yes Ta Yes Ta "ダブルストレートクォートの閉じ" -.\"O .It Li \&Re Ta \&No Ta \&No Ta "Reference end." -.\"O .It Li \&Rs Ta \&No Ta \&No Ta "Reference start." -.\"O .It Li \&Rv Ta \&No Ta \&No Ta "Return values (sections two and three only)." -.\"O .It Li \&Sc Ta Yes Ta Yes Ta "Single close quote." -.\"O .It Li \&So Ta Yes Ta Yes Ta "Single open quote." -.It Li \&Re Ta \&No Ta \&No Ta "参考文献の終了" -.It Li \&Rs Ta \&No Ta \&No Ta "参考文献の開始" +.It Li \&Ns Ta Yes Ta Yes Ta スペース無し +.It Li \&Pc Ta Yes Ta Yes Ta 括弧クォートの閉じ +.It Li \&Pf Ta Yes Ta \&No Ta 前置文字 +.It Li \&Po Ta Yes Ta Yes Ta 括弧クォートの開き +.It Li \&Pq Ta Yes Ta Yes Ta 括弧クォート +.It Li \&Qc Ta Yes Ta Yes Ta ダブルストレートクォートの閉じ +.It Li \&Ql Ta Yes Ta Yes Ta クォートされたリテラル +.It Li \&Qo Ta Yes Ta Yes Ta ダブルストレートクォートの閉じ +.It Li \&Qq Ta Yes Ta Yes Ta ダブルストレートクォートの閉じ +.It Li \&Re Ta \&No Ta \&No Ta 参考文献の終了 +.It Li \&Rs Ta \&No Ta \&No Ta 参考文献の開始 .It Li \&Rv Ta \&No Ta \&No Ta "返り値 (セクション 2, 3 のみ)" -.It Li \&Sc Ta Yes Ta Yes Ta "シングルクォートの閉じ" -.It Li \&So Ta Yes Ta Yes Ta "シングルクォートの開き" -.\"O .It Li \&Sq Ta Yes Ta Yes Ta "Single quote." -.\"O .It Li \&Sm Ta \&No Ta \&No Ta "Space mode (default is \\*qon\\*q)" -.\"O .It Li \&Sx Ta Yes Ta Yes Ta "Section Cross Reference." -.\"O .It Li \&Sy Ta Yes Ta Yes Ta "Symbolic (traditional English)." -.\"O .It Li \&Tn Ta Yes Ta Yes Ta "Trade or type name (small Caps)." -.It Li \&Sq Ta Yes Ta Yes Ta "シングルクォート" -.It Li \&Sm Ta \&No Ta \&No Ta "スペースモード (デフォルトは \\*qon\\*q)" -.It Li \&Sx Ta Yes Ta Yes Ta "セクションの相互参照" +.It Li \&Sc Ta Yes Ta Yes Ta シングルクォートの閉じ +.It Li \&So Ta Yes Ta Yes Ta シングルクォートの開き +.It Li \&Sq Ta Yes Ta Yes Ta シングルクォート +.It Li \&Sm Ta \&No Ta \&No Ta "スペースモード (デフォルトは \*qon\*q)" +.It Li \&Sx Ta Yes Ta Yes Ta セクションの相互参照 .It Li \&Sy Ta Yes Ta Yes Ta "シンボリック (traditional English)." .It Li \&Tn Ta Yes Ta Yes Ta "Trade または型名 (small Caps)." -.\"O .It Li \&Ux Ta Yes Ta Yes Ta Ux -.\"O .It Li \&Xc Ta Yes Ta Yes Ta "Extend argument list close." -.\"O .It Li \&Xo Ta Yes Ta Yes Ta "Extend argument list open." .It Li \&Ux Ta Yes Ta Yes Ta Ux -.It Li \&Xc Ta Yes Ta Yes Ta "拡張引数リストの閉じ" -.It Li \&Xo Ta Yes Ta Yes Ta "拡張引数リストの開き" +.It Li \&Xc Ta Yes Ta Yes Ta 拡張引数リストの閉じ +.It Li \&Xo Ta Yes Ta Yes Ta 拡張引数リストの開き .El .\" .It Sy \&Hf Ta \&No Ta \&No Ta "Include file with header" .Pp -.\"O Macro names ending in -.\"O .Ql q -.\"O quote remaining items on the argument list. -.\"O Macro names ending in -.\"O .Ql o -.\"O begin a quote which may span more than one line of input and -.\"O are close quoted with the matching macro name ending in -.\"O .Ql c . -.\"O Enclosure macros may be nested and are limited to -.\"O eight arguments. .Ql q で終わる名前のマクロは、引数リストの残りの項目をクォートする。 .Ql o -で終わる名前のマクロは一行以上にわたる入力のクォートを開始し、 -これは対応する名前の +で終わる名前のマクロは一行以上にわたる入力のクォートを開始し、 これは対応する名前の .Ql c でおわる名前のマクロで終了する。 囲みマクロはネストでき、引数は 8 つまで取れる。 .Pp -.\"O Note: the extended argument list macros -.\"O .Pf ( Ql \&.Xo , -.\"O .Ql \&.Xc ) -.\"O and the function enclosure macros -.\"O .Pf ( Ql \&.Fo , -.\"O .Ql \&.Fc ) -.\"O are irregular. -.\"O The extended list macros are used when the number of macro arguments -.\"O would exceed the -.\"O .Xr troff -.\"O limitation of nine arguments. 注意: 拡張引数リストマクロ .Pf ( Ql \&.Xo , .Ql \&.Xc ) および関数の囲みマクロ .Pf ( Ql \&.Fo , .Ql \&.Fc ) -は変則である。 -拡張リストマクロはマクロの引数が +は変則である。 拡張リストマクロはマクロの引数が .Xr troff -の制限である 9 個を越えるときに用いられる。 +の制限である 9 +個を越えるときに用いられる。 .Pp -.\"O The macros UR (starting a URI/URL hypertext reference), UE (ending one), -.\"O and UN (identifying a target for a reference) are also available. -.\"O See -.\"O .Xr man 7 -.\"O for more information on these macros. -UR マクロ (URI/URL ハイパーテキスト参照の開始), UE マクロ (終了), -UN マクロ (参照用ターゲットの指定) も利用できる。 +.\" The following does not apply on Linux: +.\" .Sh CONFIGURATION +.\" For site specific configuration of the macro package, +.\" see the file +.\" .Pa /usr/src/share/tmac/README . +UR マクロ (URI/URL ハイパーテキスト参照の開始), UE マクロ (終了), UN マクロ (参照用ターゲットの指定) も利用できる。 これらのマクロに関するより詳しい情報は .Xr man 7 を見よ。 -.\" The following does not apply on Linux: -.\"O .\".Sh CONFIGURATION -.\"O .\"For site specific configuration of the macro package, -.\"O .\"see the file -.\"O .\".Pa /usr/src/share/tmac/README . -.\".Sh 設定 -.\"サイト特有のマクロパッケージの設定に関しては、 -.\".Pa /usr/src/share/tmac/README -.\"ファイルを見よ。 -.\"O .Sh FILES .Sh ファイル -.Bl -tag -width "tmac.doc-ditroff" -compact +.Bl -tag -width tmac.doc-ditroff -compact .It Pa doc.tmac -.\"O Manual and general text domain macros. マニュアルドメインマクロと一般テキストドメインマクロ。 .It Pa tmac/doc-common -.\"O Common structural macros and definitions. 共通の構造マクロと定義。 .It Pa tmac/doc-nroff -.\"O Site dependent -.\"O .Xr nroff -.\"O style file. サイト依存の .Xr nroff スタイルファイル。 .It Pa tmac/doc-ditroff -.\"O Site dependent -.\"O .Xr troff -.\"O style file. サイト依存の .Xr troff スタイルファイル。 .It Pa tmac/doc-syms -.\"O Special defines (such as the standards macro). 特殊定義 (標準マクロなど)。 .El -.\"O .Sh "SEE ALSO" -.Sh 関連項目 +.Sh "関連項目" .Xr groff_mdoc 7 , .Xr mdoc.samples 7 , .Xr man 7 , diff --git a/draft/man7/numa.7 b/draft/man7/numa.7 new file mode 100644 index 00000000..503172b1 --- /dev/null +++ b/draft/man7/numa.7 @@ -0,0 +1,145 @@ +.\" Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk +.\" +.\" and Copyright 2003,2004 Andi Kleen, SuSE Labs. +.\" numa_maps material Copyright (c) 2005 Silicon Graphics Incorporated. +.\" Christoph Lameter, . +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH NUMA 7 2008\-08\-15 Linux "Linux Programmer's Manual" +.SH 名前 +numa \- overview of Non\-Uniform Memory Architecture +.SH 説明 +Non\-Uniform Memory Access (NUMA) refers to multiprocessor systems whose +memory is divided into multiple memory nodes. The access time of a memory +node depends on the relative locations of the accessing CPU and the accessed +node. (This contrasts with a symmetric multiprocessor system, where the +access time for all of the memory is the same for all CPUs.) Normally, each +CPU on a NUMA system has a local memory node whose contents can be accessed +faster than the memory in the node local to another CPU or the memory on a +bus shared by all CPUs. +.SS "NUMA system calls" +The Linux kernel implements the following NUMA\-related system calls: +\fBget_mempolicy\fP(2), \fBmbind\fP(2), \fBmigrate_pages\fP(2), \fBmove_pages\fP(2), and +\fBset_mempolicy\fP(2). However, applications should normally use the +interface provided by \fIlibnuma\fP; see "Library Support" below. +.SS "/proc/[number]/numa_maps (since Linux 2.6.14)" +.\" See also Changelog-2.6.14 +This file displays information about a process's NUMA memory policy and +allocation. + +Each line contains information about a memory range used by the process, +displaying\(emamong other information\(emthe effective memory policy for +that memory range and on which nodes the pages have been allocated. + +\fInuma_maps\fP is a read\-only file. When \fI/proc//numa_maps\fP is +read, the kernel will scan the virtual address space of the process and +report how memory is used. One line is displayed for each unique memory +range of the process. + +The first field of each line shows the starting address of the memory +range. This field allows a correlation with the contents of the +\fI/proc//maps\fP file, which contains the end address of the +range and other information, such as the access permissions and sharing. + +The second field shows the memory policy currently in effect for the memory +range. Note that the effective policy is not necessarily the policy +installed by the process for that memory range. Specifically, if the +process installed a "default" policy for that range, the effective policy +for that range will be the process policy, which may or may not be +"default". + +The rest of the line contains information about the pages allocated in the +memory range, as follows: +.TP +\fIN=\fP +The number of pages allocated on \fI\fP. \fI\fP +includes only pages currently mapped by the process. Page migration and +memory reclaim may have temporarily unmapped pages associated with this +memory range. These pages may only show up again after the process has +attempted to reference them. If the memory range represents a shared memory +area or file mapping, other processes may currently have additional pages +mapped in a corresponding memory range. +.TP +\fIfile=\fP +The file backing the memory range. If the file is mapped as private, write +accesses may have generated COW (Copy\-On\-Write) pages in this memory range. +These pages are displayed as anonymous pages. +.TP +\fIheap\fP +Memory range is used for the heap. +.TP +\fIstack\fP +Memory range is used for the stack. +.TP +\fIhuge\fP +Huge memory range. The page counts shown are huge pages and not regular +sized pages. +.TP +\fIanon=\fP +The number of anonymous page in the range. +.TP +\fIdirty=\fP +Number of dirty pages. +.TP +\fImapped=\fP +Total number of mapped pages, if different from \fIdirty\fP and \fIanon\fP pages. +.TP +\fImapmax=\fP +Maximum mapcount (number of processes mapping a single page) encountered +during the scan. This may be used as an indicator of the degree of sharing +occurring in a given memory range. +.TP +\fIswapcache=\fP +Number of pages that have an associated entry on a swap device. +.TP +\fIactive=\fP +The number of pages on the active list. This field is only shown if +different from the number of pages in this range. This means that some +inactive pages exist in the memory range that may be removed from memory by +the swapper soon. +.TP +\fIwriteback=\fP +Number of pages that are currently being written out to disk. +.SH 注意 +The Linux NUMA system calls and \fI/proc\fP interface are only available if the +kernel was configured and built with the \fBCONFIG_NUMA\fP option. +.SS "Library Support" +Link with \fI\-lnuma\fP to get the system call definitions. \fIlibnuma\fP and the +required \fI\fP header are available in the \fInumactl\fP +package. + +However, applications should not use these system calls directly. Instead, +the higher level interface provided by the \fBnuma\fP(3) functions in the +\fInumactl\fP package is recommended. The \fInumactl\fP package is available at +\fIftp://oss.sgi.com/www/projects/libnuma/download/\fP. The package is also +included in some Linux distributions. Some distributions include the +development library and header in the separate \fInumactl\-devel\fP package. +.SH 準拠 +No standards govern NUMA interfaces. +.SH 関連項目 +\fBget_mempolicy\fP(2), \fBmbind\fP(2), \fBmove_pages\fP(2), \fBset_mempolicy\fP(2), +\fBnuma\fP(3), \fBcpuset\fP(7), \fBnumactl\fP(8) diff --git a/draft/man7/operator.7 b/draft/man7/operator.7 deleted file mode 100644 index 02ad4b85..00000000 --- a/draft/man7/operator.7 +++ /dev/null @@ -1,87 +0,0 @@ -.\" Copyright (c) 1989, 1990, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" @(#)operator.7 8.1 (Berkeley) 6/9/93 -.\" -.\" Copied shamelessly from FreeBSD with minor changes. 2003-05-21 -.\" Brian M. Carlson -.\" -.\" Restored automatic formatting from FreeBSD. 2003-08-24 -.\" Martin Schulze -.\" -.\" 2007-12-08, mtk, Converted from mdoc to man macros -.\" -.\" Japanese Version Copyright (c) 2004 Yuichi SATO -.\" all rights reserved. -.\" Translated Sat Oct 16 11:38:41 JST 2004 -.\" by Yuichi SATO -.\" -.TH OPERATOR 7 2011-09-09 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O operator \- C operator precedence and order of evaluation -operator \- C 言語の演算子の優先順位と評価の順序 -.\"O .SH DESCRIPTION -.SH 説明 -.\"O This manual page lists C operators and their precedence in evaluation. -この man ページでは C 言語の演算子と評価の優先順位をリストする。 -.nf - -.\"O .B "Operator Associativity" -.\"O () [] \-> . left to right -.\"O ! ~ ++ \-\- + \- (type) * & sizeof right to left -.\"O * / % left to right -.\"O + \- left to right -.\"O << >> left to right -.\"O < <= > >= left to right -.\"O == != left to right -.\"O & left to right -.\"O ^ left to right -.\"O | left to right -.\"O && left to right -.\"O || left to right -.\"O ?: right to left -.\"O = += \-= *= /= %= <<= >>= &= ^= |= right to left -.\"O , left to right -.B "演算子 結合の順序" -() [] \-> . 左から右へ -! ~ ++ \-\- + \- (type) * & sizeof 右から左へ -* / % 左から右へ -+ \- 左から右へ -<< >> 左から右へ -< <= > >= 左から右へ -== != 左から右へ -& 左から右へ -^ 左から右へ -| 左から右へ -&& 左から右へ -|| 左から右へ -?: 右から左へ -= += \-= *= /= %= <<= >>= &= ^= |= 右から左へ -, 左から右へ -.fi -.\" diff --git a/draft/man7/posixoptions.7 b/draft/man7/posixoptions.7 deleted file mode 100644 index dafd2be4..00000000 --- a/draft/man7/posixoptions.7 +++ /dev/null @@ -1,1084 +0,0 @@ -.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl) -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; without even the implied warranty of -.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -.\" GNU General Public License for more details. -.\" -.\" You should have received a copy of the GNU General Public -.\" License along with this manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.\" -.\" Japanese Version Copyright (c) 2004 Yuichi SATO -.\" all rights reserved. -.\" Translated Thu Dec 16 03:35:45 JST 2004 -.\" by Yuichi SATO -.\" -.\"WORD: feature test macro 機能テストマクロ -.\" -.TH POSIXOPTIONS 7 2007-12-21 "" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O posixoptions \- optional parts of the POSIX standard -POSIX 標準の選択可能な部分 -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The POSIX standard (the information below is from POSIX.1-2001) -.\"O describes a set of behaviors and interfaces for a compliant system. -POSIX 標準 (以下の情報は POSIX.1-2001 の抜粋) は -互換システムの動作とインタフェースのセットを記述している。 -.\"O However, many interfaces are optional and there are feature test macros -.\"O to test the availability of interfaces at compile time, and functions -.\"O .BR sysconf (3), -.\"O .BR fpathconf (3), -.\"O .BR pathconf (3), -.\"O .BR confstr (3) -.\"O to do this at run time. -.\"O From shell scripts one can use -.\"O .BR getconf (1). -しかし、多くのインタフェースは選択可能であり、 -コンパイル時にインタフェースが使用可能かをテストする機能テストマクロと、 -実行時にテストする関数 -.BR sysconf (3), -.BR fpathconf (3), -.BR pathconf (3), -.BR confstr (3) -がある。 -シェルスクリプトでは -.BR getconf (1) -を使うことができる。 -.\"O For more detail, see -.\"O .BR sysconf (3). -詳細は -.BR sysconf (3) -を参照すること。 -.LP -.\"O We give the name of the POSIX abbreviation, the option, the name of the -.\"O .BR sysconf (3) -.\"O parameter used to inquire about the option, and possibly -.\"O a very short description. -POSIX 省略形の名前・オプション・オプションを調べるための -.BR sysconf (3) -引き数の名前・(可能ならば) 非常に短い説明を記述する。 -.\"O Much more precise detail can be found in the POSIX standard itself, -.\"O versions of which can nowadays be accessed freely on the web. -より正確な詳細は POSIX 標準自身に書かれている。 -POSIX 標準は今日では Web で自由にアクセスできる。 -.SS "ADV - _POSIX_ADVISORY_INFO - _SC_ADVISORY_INFO" -.\"O The following advisory functions are present: -以下のアドバイスの関数が存在する。 -.br -.nf -.in +4 - -.IR posix_fadvise (), -.IR posix_fallocate (), -.IR posix_memalign (), -.IR posix_madvise (). -.br -.in -4 -.fi -.SS "AIO - _POSIX_ASYNCHRONOUS_IO - _SC_ASYNCHRONOUS_IO" -.\"O The header -ヘッダ -.I -.\"O is present. -が存在する。 -.\"O The following functions are present: -以下の関数が存在する。 -.br -.nf -.in +4 - -.IR aio_cancel (), -.IR aio_error (), -.IR aio_fsync (), -.IR aio_read (), -.IR aio_return (), -.IR aio_suspend (), -.IR aio_write (), -.IR lio_listio (). -.br -.in -4 -.fi -.SS "BAR - _POSIX_BARRIERS - _SC_BARRIERS" -.\"O This option implies the -.\"O .B _POSIX_THREADS -.\"O and -.\"O .B _POSIX_THREAD_SAFE_FUNCTIONS -.\"O options. -このオプションは -.B _POSIX_THREADS -と -.B _POSIX_THREAD_SAFE_FUNCTIONS -オプションを暗黙の内に指定する。 -.\"O The following functions are present: -以下の関数が存在する。 -.br -.nf -.in +4 - -.IR pthread_barrier_destroy (), -.IR pthread_barrier_init (), -.IR pthread_barrier_wait (), -.IR pthread_barrierattr_destroy (), -.IR pthread_barrierattr_init (). -.in -4 -.br -.fi -.\" .SS "BE" -.\"O .\" Batch environment. -.\" バッチ環境 -.\" .SS "CD" -.\"O .\" C development. -.\" C による開発 -.SS "--- - POSIX_CHOWN_RESTRICTED" -.\"O If this option is in effect (as it always is under POSIX.1-2001) -.\"O then only root may change the owner of a file, and nonroot can only -.\"O set the group of a file to one of the groups it belongs to. -このオプションが有効な場合 (POSIX.1-2001 では常に有効)、 -root だけがファイル所有者の変更を許され、 -root 以外はファイルのグループを -自分が所属するグループの 1 つに設定することだけができる。 -.\"O This affects the functions -これは以下の関数に影響する。 -.br -.nf -.in +4n - -.IR chown (), -.IR fchown (). -.\"O .\" What about lchown() ? -.\" lchown() はどうなのか? -.in -4 -.br -.fi -.SS "CS - _POSIX_CLOCK_SELECTION - _SC_CLOCK_SELECTION" -.\"O This option implies the -.\"O .B _POSIX_TIMERS -.\"O option. -このオプションは -.B _POSIX_TIMERS -オプションを暗黙の内に指定する。 -.\"O The following functions are present: -以下の関数が存在する。 -.br -.nf -.in +4 - -.IR pthread_condattr_getclock (), -.IR pthread_condattr_setclock (), -.IR clock_nanosleep (). - -.in -4 -.br -.fi -.\"O If -.\"O .B CLOCK_REALTIME -.\"O is changed by the function -.\"O .IR clock_settime (), -.\"O then this affects all timers set for an absolute time. -.B CLOCK_REALTIME -が関数 -.IR clock_settime () -で変更された場合、絶対時間に関係する全てのタイマのセットに影響する。 -.SS "CPT - _POSIX_CPUTIME - _SC_CPUTIME" -.\"O The clockID CLOCK_PROCESS_CPUTIME_ID is supported. -.\"O The initial value of this clock is 0 for each process. -.\"O This option implies the -.\"O .B _POSIX_TIMERS -.\"O option. -clockID CLOCK_PROCESS_CPUTIME_ID がサポートされている。 -このクロックの初期値は、各プロセス毎に 0 となる。 -このオプションは -.B _POSIX_TIMERS -オプションを暗黙の内に指定する。 -.\"O The function -関数 -.IR clock_getcpuclockid () -.\"O is present. -が存在する。 -.\" .SS "FD" -.\"O .\" Fortran development -.\" Fortran による開発 -.\" .SS "FR" -.\"O .\" Fortran runtime -.\" Fortran ランタイム -.SS "--- - _POSIX_FILE_LOCKING - _SC_FILE_LOCKING" -.\"O This option has been deleted. -.\"O Not in final XPG6. -このオプションは削除された。XPG6 最終版にはない。 -.SS "FSC - _POSIX_FSYNC - _SC_FSYNC " -.\"O The function -関数 -.IR fsync () -.\"O is present. -が存在する。 -.SS "IP6 - _POSIX_IPV6 - _SC_IPV6" -.\"O Internet Protocol Version 6 is supported. -Internet Protocol Version 6 がサポートされている。 -.SS "--- - _POSIX_JOB_CONTROL - _SC_JOB_CONTROL" -.\"O If this option is in effect (as it always is under POSIX.1-2001) -.\"O then the system implements POSIX-style job control, -.\"O and the following functions are present: -このオプションが有効な場合 (POSIX.1-2001 では常に有効)、 -システムは POSIX 方式のジョブ制御を実装しており、 -以下の関数が存在する。 -.br -.nf -.in +4 - -.IR setpgid (), -.IR tcdrain (), -.IR tcflush (), -.IR tcgetpgrp (), -.IR tcsendbreak (), -.IR tcsetattr (), -.IR tcsetpgrp (). -.in -4 -.fi -.SS "MF - _POSIX_MAPPED_FILES - _SC_MAPPED_FILES" -.\"O Shared memory is supported. -共有メモリがサポートされている。 -.\"O The include file -インクルードファイル -.I -.\"O is present. -が存在する。 -.\"O The following functions are present: -以下の関数が存在する。 -.br -.nf -.in +4n - -.IR mmap (), -.IR msync (), -.IR munmap (). -.in -4 -.br -.fi -.SS "ML - _POSIX_MEMLOCK - _SC_MEMLOCK" -.\"O Shared memory can be locked into core. -共有メモリがコア内にロックできる。 -.\"O The following functions are present: -以下の関数が存在する。 -.br -.nf -.in +4n - -.IR mlockall (), -.IR munlockall (). -.in -4 -.br -.fi -.SS "MR/MLR - _POSIX_MEMLOCK_RANGE - _SC_MEMLOCK_RANGE" -.\"O More precisely, ranges can be locked into core. -より詳細に、範囲をコア内にロックできる。 -.\"O The following functions are present: -以下の関数が存在する。 -.br -.nf -.in +4n - -.IR mlock (), -.IR munlock (). -.in -4 -.br -.fi -.SS "MPR - _POSIX_MEMORY_PROTECTION - _SC_MEMORY_PROTECTION" -.\"O The function -関数 -.IR mprotect () -.\"O is present. -が存在する。 -.SS "MSG - _POSIX_MESSAGE_PASSING - _SC_MESSAGE_PASSING" -.\"O The include file -インクルードファイル -.I -.\"O is present. -が存在する。 -.\"O The following functions are present: -以下の関数が存在する。 -.br -.nf -.in +4 - -.IR mq_close (), -.IR mq_getattr (), -.IR mq_notify (), -.IR mq_open (), -.IR mq_receive (), -.IR mq_send (), -.IR mq_setattr (), -.IR mq_unlink (). -.br -.in -4 -.fi -.SS "MON - _POSIX_MONOTONIC_CLOCK - _SC_MONOTONIC_CLOCK" -.\"O .B CLOCK_MONOTONIC -.\"O is supported. -.\"O This option implies the -.\"O .B _POSIX_TIMERS -.\"O option. -.B CLOCK_MONOTONIC -がサポートされている。 -このオプションは -.B _POSIX_TIMERS -オプションを暗黙の内に指定する。 -.\"O Affected functions are -影響を受ける関数は以下の通り。 -.nf -.in +4 - -.IR aio_suspend (), -.IR clock_getres (), -.IR clock_gettime (), -.IR clock_settime (), -.IR timer_create (). -.in -4 -.fi -.SS "--- - _POSIX_MULTI_PROCESS - _SC_MULTI_PROCESS" -.\"O This option has been deleted. -.\"O Not in final XPG6. -このオプションは削除された。XPG6 最終版にはない。 -.\" .SS "MX" -.\"O .\" IEC 60559 Floating-Point Option. -.\" IEC 60559 浮動小数点数オプション。 -.SS "--- - _POSIX_NO_TRUNC" -.\"O If this option is in effect (as it always is under POSIX.1-2001) -.\"O then pathname components longer than -.\"O .B NAME_MAX -.\"O are not truncated, -.\"O but give an error. -このオプションが有効な場合 (POSIX.1-2001 では常に有効)、 -.B NAME_MAX -より長いパス名の構成要素は切り詰められないが、エラーになる。 -.\"O This property may be dependent on the path prefix of the component. -この設定は構成要素のパス接頭辞に依存する場合もある。 -.SS "PIO - _POSIX_PRIORITIZED_IO - _SC_PRIORITIZED_IO" -.\"O This option says that one can specify priorities for asynchronous I/O. -このオプションは非同期 I/O の優先度が指定できることを表す。 -.\"O This affects the functions -これは以下の関数に影響する。 -.br -.nf -.in +4 - -.IR aio_read (), -.IR aio_write (). -.in -4 -.fi -.SS "PS - _POSIX_PRIORITY_SCHEDULING - _SC_PRIORITY_SCHEDULING" -.\"O The include file -インクルードファイル -.I -.\"O is present. -が存在する。 -.\"O The following functions are present: -以下の関数が存在する。 -.br -.nf -.in +4 - -.IR sched_get_priority_max (), -.IR sched_get_priority_min (), -.IR sched_getparam (), -.IR sched_getscheduler (), -.IR sched_rr_get_interval (), -.IR sched_setparam (), -.IR sched_setscheduler (), -.IR sched_yield (). - -.in -4 -.fi -.\"O If also -.\"O .B _POSIX_SPAWN -.\"O is in effect, then the following functions are present: -.B _POSIX_SPAWN -も有効な場合は、以下の関数が存在する。 -.br -.nf -.in +4 - -.IR posix_spawnattr_getschedparam (), -.IR posix_spawnattr_getschedpolicy (), -.IR posix_spawnattr_setschedparam (), -.IR posix_spawnattr_setschedpolicy (). -.in -4 -.fi -.SS "RS - _POSIX_RAW_SOCKETS" -.\"O Raw sockets are supported. -raw ソケットがサポートされている。 -.\"O Affected functions are -影響を受ける関数は以下の通り。 -.br -.nf -.in +4n - -.IR getsockopt (), -.IR setsockopt (). -.in -4 -.br -.fi -.SS "--- - _POSIX_READER_WRITER_LOCKS - _SC_READER_WRITER_LOCKS" -.\"O This option implies the -.\"O .B _POSIX_THREADS -.\"O option. -.\"O Conversely, -.\"O under POSIX.1-2001 the -.\"O .B _POSIX_THREADS -.\"O option implies this option. -このオプションは -.B _POSIX_THREADS -オプションを暗黙の内に指定する。 -逆に POSIX.1-2001 では -.B _POSIX_THREADS -オプションはこのオプションを暗黙の内に指定する。 -.\"O The following functions are present: -以下の関数が存在する。 -.nf -.in +4 - -.IR pthread_rwlock_destroy (), -.IR pthread_rwlock_init (), -.IR pthread_rwlock_rdlock (), -.IR pthread_rwlock_tryrdlock (), -.IR pthread_rwlock_trywrlock (), -.IR pthread_rwlock_unlock (), -.IR pthread_rwlock_wrlock (), -.IR pthread_rwlockattr_destroy (), -.IR pthread_rwlockattr_init (). -.in -4 -.fi -.SS "RTS - _POSIX_REALTIME_SIGNALS - _SC_REALTIME_SIGNALS" -.\"O Realtime signals are supported. -リアルタイムシグナルがサポートされている。 -.\"O The following functions are present: -以下の関数が存在する。 -.br -.nf -.in +4 - -.IR sigqueue (), -.IR sigtimedwait (), -.IR sigwaitinfo (). -.br -.in -4 -.fi -.SS "--- - _POSIX_REGEXP - _SC_REGEXP" -.\"O If this option is in effect (as it always is under POSIX.1-2001) -.\"O then POSIX regular expressions are supported -.\"O and the following functions are present: -このオプションが有効な場合 (POSIX.1-2001 では常に有効)、 -POSIX 正規表現がサポートされ、以下の関数が存在する。 -.br -.nf -.in +4 - -.IR regcomp (), -.IR regerror (), -.IR regexec (), -.IR regfree (). -.br -.in -4 -.fi -.SS "--- - _POSIX_SAVED_IDS - _SC_SAVED_IDS" -このオプションが有効な場合 (POSIX.1-2001 では常に有効)、 -プロセスは保存 (saved) set-user-ID と保存 set-group-ID を持つ。 -.\"O Affected functions are -影響を受ける関数は以下の通り。 -.br -.nf -.in +4 - -.IR exec (), -.IR kill (), -.IR seteuid (), -.IR setegid (), -.IR setgid (), -.IR setuid (). -.br -.in -4 -.fi -.\" .SS "SD" -.\"O .\" Software development -.\" Software 開発 -.SS "SEM - _POSIX_SEMAPHORES - _SC_SEMAPHORES" -.\"O The include file -インクルードファイル -.I -.\"O is present. -が存在する。 -.\"O The following functions are present: -以下の関数が存在する。 -.br -.nf -.in +4 - -.IR sem_close (), -.IR sem_destroy (), -.IR sem_getvalue (), -.IR sem_init (), -.IR sem_open (), -.IR sem_post (), -.IR sem_trywait (), -.IR sem_unlink (), -.IR sem_wait (). -.br -.in -4 -.fi -.SS "SHM - _POSIX_SHARED_MEMORY_OBJECTS - _SC_SHARED_MEMORY_OBJECTS" -.\"O The following functions are present: -以下の関数が存在する。 -.br -.nf -.in +4 - -.IR mmap (), -.IR munmap (), -.IR shm_open (), -.IR shm_unlink (). -.br -.in -4 -.fi -.SS "--- - _POSIX_SHELL - _SC_SHELL" -.\"O If this option is in effect (as it always is under POSIX.1-2001), -.\"O the function -このオプションが有効な場合 (POSIX.1-2001 では常に有効)、関数 -.IR system () -.\"O is present. -が存在する。 -.SS "SPN - _POSIX_SPAWN - _SC_SPAWN" -.\"O This option describes support for process creation in a context where -.\"O it is difficult or impossible to use -.\"O .IR fork (), -.\"O for example, because no MMU is present. -このオプションは、例えば MMU が存在しないなどの理由によって、 -.IR fork () -を使用することが難しいか不可能という状況で、 -プロセス生成をサポートすることを表す。 -.\"O If -.\"O .B _POSIX_SPAWN -.\"O is in effect, then the include file -.\"O .I -.\"O and the following functions are present: -.B _POSIX_SPAWN -が有効な場合、インクルードファイル -.I -と、以下の関数が存在する。 -.br -.nf -.in +4 - -.IR posix_spawn (), -.IR posix_spawn_file_actions_addclose (), -.IR posix_spawn_file_actions_adddup2 (), -.IR posix_spawn_file_actions_addopen (), -.IR posix_spawn_file_actions_destroy (), -.IR posix_spawn_file_actions_init (), -.IR posix_spawnattr_destroy (), -.IR posix_spawnattr_getsigdefault (), -.IR posix_spawnattr_getflags (), -.IR posix_spawnattr_getpgroup (), -.IR posix_spawnattr_getsigmask (), -.IR posix_spawnattr_init (), -.IR posix_spawnattr_setsigdefault (), -.IR posix_spawnattr_setflags (), -.IR posix_spawnattr_setpgroup (), -.IR posix_spawnattr_setsigmask (), -.IR posix_spawnp (). - -.in -4 -.br -.fi -.\"O If also -.\"O .B _POSIX_PRIORITY_SCHEDULING -.\"O is in effect, then -.\"O the following functions are present: -.B _POSIX_PRIORITY_SCHEDULING -も有効な場合、以下の関数が存在する。 -.br -.nf -.in +4 - -.IR posix_spawnattr_getschedparam (), -.IR posix_spawnattr_getschedpolicy (), -.IR posix_spawnattr_setschedparam (), -.IR posix_spawnattr_setschedpolicy (). -.in -4 -.fi -.SS "SPI - _POSIX_SPIN_LOCKS - _SC_SPIN_LOCKS" -.\"O This option implies the -.\"O .B _POSIX_THREADS -.\"O and -.\"O .B _POSIX_THREAD_SAFE_FUNCTIONS -.\"O options. -このオプションは -.B _POSIX_THREADS -と -.B _POSIX_THREAD_SAFE_FUNCTIONS -オプションを暗黙の内に指定する。 -.\"O The following functions are present: -以下の関数が存在する。 -.br -.nf -.in +4 - -.IR pthread_spin_destroy (), -.IR pthread_spin_init (), -.IR pthread_spin_lock (), -.IR pthread_spin_trylock (), -.IR pthread_spin_unlock (). -.in -4 -.br -.fi -.SS "SS - _POSIX_SPORADIC_SERVER - _SC_SPORADIC_SERVER" -.\"O The scheduling policy -.\"O .B SCHED_SPORADIC -.\"O is supported. -.\"O This option implies the -.\"O .B _POSIX_PRIORITY_SCHEDULING -.\"O option. -スケジューリングポリシー -.B SCHED_SPORADIC -がサポートされている。 -このオプションは -.B _POSIX_PRIORITY_SCHEDULING -オプションを暗黙の内に指定する。 -.\"O Affected functions are -影響を受ける関数は以下の通り。 -.br -.nf -.in +4 - -.IR sched_setparam (), -.IR sched_setscheduler (). -.in -4 -.br -.fi -.SS "SIO - _POSIX_SYNCHRONIZED_IO - _SC_SYNCHRONIZED_IO" -.\"O Affected functions are -影響を受ける関数は以下の通り。 -.IR open (), -.IR msync (), -.IR fsync (), -.IR fdatasync (). -.SS "TSA - _POSIX_THREAD_ATTR_STACKADDR - _SC_THREAD_ATTR_STACKADDR" -.\"O Affected functions are -影響を受ける関数は以下の通り。 -.br -.nf -.in +4 - -.IR pthread_attr_getstack (), -.IR pthread_attr_getstackaddr (), -.IR pthread_attr_setstack (), -.IR pthread_attr_setstackaddr (). -.in -4 -.br -.fi -.SS "TSS - _POSIX_THREAD_ATTR_STACKSIZE - _SC_THREAD_ATTR_STACKSIZE" -.\"O Affected functions are -影響を受ける関数は以下の通り。 -.br -.nf -.in +4 - -.IR pthread_attr_getstack (), -.IR pthread_attr_getstacksize (), -.IR pthread_attr_setstack (), -.IR pthread_attr_setstacksize (). -.in -4 -.br -.fi -.SS "TCT - _POSIX_THREAD_CPUTIME - _SC_THREAD_CPUTIME" -.\"O The clockID CLOCK_THREAD_CPUTIME_ID is supported. -.\"O This option implies the -.\"O .B _POSIX_TIMERS -.\"O option. -clockID CLOCK_THREAD_CPUTIME_ID がサポートされている。 -このオプションは -.B _POSIX_TIMERS -オプションを暗黙の内に指定する。 -.\"O Affected functions are -影響を受ける関数は以下の通り。 -.br -.nf -.in +4 - -.IR pthread_getcpuclockid (), -.IR clock_getres (), -.IR clock_gettime (), -.IR clock_settime (), -.IR timer_create (). -.in -4 -.br -.fi -.SS "TPI - _POSIX_THREAD_PRIO_INHERIT - _SC_THREAD_PRIO_INHERIT" -.\"O Affected functions are -影響を受ける関数は以下の通り。 -.br -.nf -.in +4 - -.IR pthread_mutexattr_getprotocol (), -.IR pthread_mutexattr_setprotocol (). -.in -4 -.br -.fi -.SS "TPP - _POSIX_THREAD_PRIO_PROTECT - _SC_THREAD_PRIO_PROTECT" -.\"O Affected functions are -影響を受ける関数は以下の通り。 -.br -.nf -.in +4 - -.IR pthread_mutex_getprioceiling (), -.IR pthread_mutex_setprioceiling (), -.IR pthread_mutexattr_getprioceiling (), -.IR pthread_mutexattr_getprotocol (), -.IR pthread_mutexattr_setprioceiling (), -.IR pthread_mutexattr_setprotocol (). -.in -4 -.br -.fi -.SS "TPS - _POSIX_THREAD_PRIORITY_SCHEDULING - _SC_THREAD_PRIORITY_SCHEDULING" -.\"O If this option is in effect, the different threads inside a process -.\"O can run with different priorities and/or different schedulers. -このオプションが有効な場合、1 つのプロセス内の個々のスレッドを -個々の優先度または個々のスケジューラ (またはその両方) で実行できる。 -.\"O Affected functions are -影響を受ける関数は以下の通り。 -.br -.nf -.in +4 - -.IR pthread_attr_getinheritsched (), -.IR pthread_attr_getschedpolicy (), -.IR pthread_attr_getscope (), -.IR pthread_attr_setinheritsched (), -.IR pthread_attr_setschedpolicy (), -.IR pthread_attr_setscope (), -.IR pthread_getschedparam (), -.IR pthread_setschedparam (), -.IR pthread_setschedprio (). -.in -4 -.br -.fi -.SS "TSH - _POSIX_THREAD_PROCESS_SHARED - _SC_THREAD_PROCESS_SHARED" -.\"O Affected functions are -影響を受ける関数は以下の通り。 -.br -.nf -.in +4 - -.IR pthread_barrierattr_getpshared (), -.IR pthread_barrierattr_setpshared (), -.IR pthread_condattr_getpshared (), -.IR pthread_condattr_setpshared (), -.IR pthread_mutexattr_getpshared (), -.IR pthread_mutexattr_setpshared (), -.IR pthread_rwlockattr_getpshared (), -.IR pthread_rwlockattr_setpshared (). -.in -4 -.br -.fi -.SS "TSF - _POSIX_THREAD_SAFE_FUNCTIONS - _SC_THREAD_SAFE_FUNCTIONS" -.\"O Affected functions are -影響を受ける関数は以下の通り。 -.br -.nf -.in +4 - -.IR readdir_r (), -.IR getgrgid_r (), -.IR getgrnam_r (), -.IR getpwnam_r (), -.IR getpwuid_r (), -.IR flockfile (), -.IR ftrylockfile (), -.IR funlockfile (), -.IR getc_unlocked (), -.IR getchar_unlocked (), -.IR putc_unlocked (), -.IR putchar_unlocked (), -.IR rand_r (), -.IR strerror_r (), -.IR strtok_r (), -.IR asctime_r (), -.IR ctime_r (), -.IR gmtime_r (), -.IR localtime_r (). -.in -4 -.br -.fi -.SS "TSP - _POSIX_THREAD_SPORADIC_SERVER - _SC_THREAD_SPORADIC_SERVER" -.\"O This option implies the -.\"O .B _POSIX_THREAD_PRIORITY_SCHEDULING -.\"O option. -このオプションは -.B _POSIX_THREAD_PRIORITY_SCHEDULING -オプションを暗黙の内に指定する。 -.\"O Affected functions are -影響を受ける関数は以下の通り。 -.br -.nf -.in +4 - -.IR sched_getparam (), -.IR sched_setparam (), -.IR sched_setscheduler (). -.in -4 -.br -.fi -.SS "THR - _POSIX_THREADS - _SC_THREADS" -.\"O Basic support for POSIX threads is available. -POSIX スレッドの基本サポートが使用可能である。 -.\"O The following functions are present: -以下の関数が存在する。 -.br -.nf -.in +4 - -.IR pthread_atfork (), -.IR pthread_attr_destroy (), -.IR pthread_attr_getdetachstate (), -.IR pthread_attr_getschedparam (), -.IR pthread_attr_init (), -.IR pthread_attr_setdetachstate (), -.IR pthread_attr_setschedparam (), -.IR pthread_cancel (), -.IR pthread_cleanup_push (), -.IR pthread_cleanup_pop (), -.IR pthread_cond_broadcast (), -.IR pthread_cond_destroy (), -.IR pthread_cond_init (), -.IR pthread_cond_signal (), -.IR pthread_cond_timedwait (), -.IR pthread_cond_wait (), -.IR pthread_condattr_destroy (), -.IR pthread_condattr_init (), -.IR pthread_create (), -.IR pthread_detach (), -.IR pthread_equal (), -.IR pthread_exit (), -.IR pthread_getspecific (), -.IR pthread_join (), -.IR pthread_key_create (), -.IR pthread_key_delete (), -.IR pthread_mutex_destroy (), -.IR pthread_mutex_init (), -.IR pthread_mutex_lock (), -.IR pthread_mutex_trylock (), -.IR pthread_mutex_unlock (), -.IR pthread_mutexattr_destroy (), -.IR pthread_mutexattr_init (), -.IR pthread_once (), -.IR pthread_rwlock_destroy (), -.IR pthread_rwlock_init (), -.IR pthread_rwlock_rdlock (), -.IR pthread_rwlock_tryrdlock (), -.IR pthread_rwlock_trywrlock (), -.IR pthread_rwlock_unlock (), -.IR pthread_rwlock_wrlock (), -.IR pthread_rwlockattr_destroy (), -.IR pthread_rwlockattr_init (), -.IR pthread_self (), -.IR pthread_setcancelstate (), -.IR pthread_setcanceltype (), -.IR pthread_setspecific (), -.IR pthread_testcancel (). -.in -4 -.br -.fi -.SS "TMO - _POSIX_TIMEOUTS - _SC_TIMEOUTS" -.\"O The following functions are present: -以下の関数が存在する。 -.br -.nf -.in +4 - -.IR mq_timedreceive (), -.IR mq_timedsend (), -.IR pthread_mutex_timedlock (), -.IR pthread_rwlock_timedrdlock (), -.IR pthread_rwlock_timedwrlock (), -.IR sem_timedwait (), -.IR posix_trace_timedgetnext_event (). -.in -4 -.br -.fi -.SS "TMR - _POSIX_TIMERS - _SC_TIMERS" -.\"O The following functions are present: -以下の関数が存在する。 -.br -.nf -.in +4 - -.IR clock_getres (), -.IR clock_gettime (), -.IR clock_settime (), -.IR nanosleep (), -.IR timer_create (), -.IR timer_delete (), -.IR timer_gettime (), -.IR timer_getoverrun (), -.IR timer_settime (). -.in -4 -.br -.fi -.SS "TRC - _POSIX_TRACE - _SC_TRACE" -.\"O POSIX tracing is available. -POSIX トレーシング (tracing) が使用可能である。 -.\"O The following functions are present: -以下の関数が存在する。 -.br -.nf -.in +4 - -.IR posix_trace_attr_destroy (), -.IR posix_trace_attr_getclockres (), -.IR posix_trace_attr_getcreatetime (), -.IR posix_trace_attr_getgenversion (), -.IR posix_trace_attr_getmaxdatasize (), -.IR posix_trace_attr_getmaxsystemeventsize (), -.IR posix_trace_attr_getmaxusereventsize (), -.IR posix_trace_attr_getname (), -.IR posix_trace_attr_getstreamfullpolicy (), -.IR posix_trace_attr_getstreamsize (), -.IR posix_trace_attr_init (), -.IR posix_trace_attr_setmaxdatasize (), -.IR posix_trace_attr_setname (), -.IR posix_trace_attr_setstreamsize (), -.IR posix_trace_attr_setstreamfullpolicy (), -.IR posix_trace_clear (), -.IR posix_trace_create (), -.IR posix_trace_event (), -.IR posix_trace_eventid_equal (), -.IR posix_trace_eventid_get_name (), -.IR posix_trace_eventid_open (), -.IR posix_trace_eventtypelist_getnext_id (), -.IR posix_trace_eventtypelist_rewind (), -.IR posix_trace_flush (), -.IR posix_trace_get_attr (), -.IR posix_trace_get_status (), -.IR posix_trace_getnext_event (), -.IR posix_trace_shutdown (), -.IR posix_trace_start (), -.IR posix_trace_stop (), -.IR posix_trace_trygetnext_event (). -.in -4 -.br -.fi -.SS "TEF - _POSIX_TRACE_EVENT_FILTER - _SC_TRACE_EVENT_FILTER" -.\"O This option implies the -.\"O .B _POSIX_TRACE -.\"O option. -このオプションは -.B _POSIX_TRACE -オプションを暗黙の内に指定する。 -.\"O The following functions are present: -以下の関数が存在する。 -.br -.nf -.in +4 - -.IR posix_trace_eventset_add (), -.IR posix_trace_eventset_del (), -.IR posix_trace_eventset_empty (), -.IR posix_trace_eventset_fill (), -.IR posix_trace_eventset_ismember (), -.IR posix_trace_get_filter (), -.IR posix_trace_set_filter (), -.IR posix_trace_trid_eventid_open (). -.in -4 -.br -.fi -.SS "TRI - _POSIX_TRACE_INHERIT - _SC_TRACE_INHERIT" -.\"O Tracing children of the traced process is supported. -トレースされているプロセスの子プロセスのトレースをサポートする。 -.\"O This option implies the -.\"O .B _POSIX_TRACE -.\"O option. -このオプションは -.B _POSIX_TRACE -オプションを暗黙の内に指定する。 -.\"O The following functions are present: -以下の関数が存在する。 -.br -.nf -.in +4 - -.IR posix_trace_attr_getinherited (), -.IR posix_trace_attr_setinherited (). -.in -4 -.br -.fi -.SS "TRL - _POSIX_TRACE_LOG - _SC_TRACE_LOG" -.\"O This option implies the -.\"O .B _POSIX_TRACE -.\"O option. -このオプションは -.B _POSIX_TRACE -オプションを暗黙の内に指定する。 -.\"O The following functions are present: -以下の関数が存在する。 -.br -.nf -.in +4 - -.IR posix_trace_attr_getlogfullpolicy (), -.IR posix_trace_attr_getlogsize (), -.IR posix_trace_attr_setlogfullpolicy (), -.IR posix_trace_attr_setlogsize (), -.IR posix_trace_close (), -.IR posix_trace_create_withlog (), -.IR posix_trace_open (), -.IR posix_trace_rewind (). -.in -4 -.br -.fi -.SS "TYM - _POSIX_TYPED_MEMORY_OBJECTS - _SC_TYPED_MEMORY_OBJECT" -.\"O The following functions are present: -以下の関数が存在する。 -.br -.nf -.in +4 - -.IR posix_mem_offset (), -.IR posix_typed_mem_get_info (), -.IR posix_typed_mem_open (). -.in -4 -.br -.fi -.SS "--- - _POSIX_VDISABLE" -.\"O Always present (probably 0). -.\"O Value to set a changeable special control -.\"O character to indicate that it is disabled. -常に存在する (たぶん 0 である)。 -変更可能な特殊制御文字を設定する値。 -これにより特殊制御文字が無効であることを表す。 -.\"O .SH "XOPEN EXTENSIONS" -.SH "XOPEN 拡張" -.BR _XOPEN_CRYPT , -.BR _XOPEN_LEGACY , -.BR _XOPEN_REALTIME , -.BR _XOPEN_REALTIME_THREADS , -.BR _XOPEN_UNIX . -.\"O .\" To be described. -.\" 記述される予定である。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR sysconf (3), -.BR standards (7) diff --git a/draft/man7/sigevent.7 b/draft/man7/sigevent.7 new file mode 100644 index 00000000..0752032f --- /dev/null +++ b/draft/man7/sigevent.7 @@ -0,0 +1,117 @@ +.\" Copyright (C) 2006, 2010 Michael Kerrisk +.\" Copyright (C) 2009 Petr Baudis +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH SIGEVENT 7 2011\-09\-09 GNU "Linux Programmer's Manual" +.SH 名前 +sigevent \- structure for notification from asynchronous routines +.SH 書式 +.nf + +union sigval { /* Data passed with notification */ + int sival_int; /* Integer value */ + void *sival_ptr; /* Pointer value */ +}; + +struct sigevent { + int sigev_notify; /* Notification method */ + int sigev_signo; /* Notification signal */ + union sigval sigev_value; /* Data passed with + notification */ + void (*sigev_notify_function) (union sigval); + /* Function used for thread + notification (SIGEV_THREAD) */ + void *sigev_notify_attributes; + /* Attributes for notification thread + (SIGEV_THREAD) */ + pid_t sigev_notify_thread_id; + /* ID of thread to signal (SIGEV_THREAD_ID) */ +}; +.fi +.SH 説明 +.PP +The \fIsigevent\fP structure is used by various APIs to describe the way a +process is to be notified about an event (e.g., completion of an +asynchronous request, expiration of a timer, or the arrival of a message). +.PP +The definition shown in the SYNOPSIS is approximate: some of the fields in +the \fIsigevent\fP structure may be defined as part of a union. Programs +should only employ those fields relevant to the value specified in +\fIsigev_notify\fP. +.PP +The \fIsigev_notify\fP field specifies how notification is to be performed. +This field can have one of the following values: +.TP 8 +\fBSIGEV_NONE\fP +A "null" notification: don't do anything when the event occurs. +.TP +\fBSIGEV_SIGNAL\fP +Notify the process by sending the signal specified in \fIsigev_signo\fP. +.IP +If the signal is caught with a signal handler that was registered using the +\fBsigaction\fP(2) \fBSA_SIGINFO\fP flag, then the following fields are set in +the \fIsiginfo_t\fP structure that is passed as the second argument of the +handler: +.RS 8 +.TP 10 +\fIsi_code\fP +This field is set to a value that depends on the API delivering the +notification. +.TP +\fIsi_signo\fP +This field is set to the signal number (i.e., the same value as in +\fIsigev_signo\fP). +.TP +\fIsi_value\fP +This field is set to the value specified in \fIsigev_value\fP. +.RE +.IP +Depending on the API, other fields may also be set in the \fIsiginfo_t\fP +structure. +.IP +The same information is also available if the signal is accepted using +\fBsigwaitinfo\fP(2). +.TP +\fBSIGEV_THREAD\fP +Notify the process by invoking \fIsigev_notify_function\fP "as if" it were the +start function of a new thread. (Among the implementation possibilities +here are that each timer notification could result in the creation of a new +thread, or that a single thread is created to receive all notifications.) +The function is invoked with \fIsigev_value\fP as its sole argument. If +\fIsigev_notify_attributes\fP is not NULL, it should point to a +\fIpthread_attr_t\fP structure that defines attributes for the new thread (see +\fBpthread_attr_init\fP(3)). +.TP +\fBSIGEV_THREAD_ID\fP (Linux\-specific) +.\" | SIGEV_SIGNAL vs not? +Currently used only by POSIX timers; see \fBtimer_create\fP(2). +.SH 準拠 +POSIX.1\-2001. +.SH 関連項目 +\fBtimer_create\fP(2), \fBaio_fsync\fP(3), \fBaio_read\fP(3), \fBaio_write\fP(3), +\fBgetaddrinfo_a\fP(3), \fBlio_listio\fP(3), \fBmq_notify\fP(3), \fBaio\fP(7), +\fBpthreads\fP(7) diff --git a/draft/man7/standards.7 b/draft/man7/standards.7 index 447da1db..85a6e4be 100644 --- a/draft/man7/standards.7 +++ b/draft/man7/standards.7 @@ -22,428 +22,159 @@ .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, .\" USA. .\" -.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved. -.\" Translated 2006-08-12, Akihiro MOTOKI , LDP v2.39 -.\" Updated 2008-08-07, Akihiro MOTOKI, LDP v3.05 -.\" Updated 2008-08-20, Akihiro MOTOKI, LDP v3.07 +.\"******************************************************************* .\" -.\" WORD: standards 標準規格 -.\" WORD: revision 改訂版 -.\" WORD: guide 指針 +.\" This file was generated with po4a. Translate the source file. .\" -.TH STANDARDS 7 2009-06-01 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH STANDARDS 7 2009\-06\-01 Linux "Linux Programmer's Manual" .SH 名前 -.\"O standards \- C and UNIX Standards standards \- C と UNIX の標準規格 -.\"O .SH DESCRIPTION .SH 説明 -.\"O The CONFORMING TO section that appears in many manual pages identifies -.\"O various standards to which the documented interface conforms. -.\"O The following list briefly describes these standards. -多くのマニュアルページの「準拠 (CONFORMING TO)」の章は、 -そのページに記載されたインタフェースが準拠する -各種の標準規格を示すものである。 -以下にこれらの標準規格の簡単な説明を記す。 -.TP -.B V7 -.\"O Version 7, the ancestral UNIX from Bell Labs. +多くのマニュアルページの「準拠 (CONFORMING TO)」の章は、 そのページに記載されたインタフェースが準拠する +各種の標準規格を示すものである。 以下にこれらの標準規格の簡単な説明を記す。 +.TP +\fBV7\fP ベル研究所による元祖 UNIX である Version 7。 -.TP -.B 4.2BSD -.\"O This is an implementation standard defined by the 4.2 release -.\"O of the -.\"O .IR "Berkeley Software Distribution", -.\"O released by the University of California at Berkeley. -.\"O This was the first Berkeley release that contained a TCP/IP -.\"O stack and the sockets API. -.\"O 4.2BSD was released in 1983. -カリフォルニア大バークレー校 (the University of California at Berkeley) -によりリリースされた -.IR "Berkeley Software Distribution" -リリース 4.2 によって規定された、実装に基づく標準規格 -(implementation standard)。 -バークレーによるリリースの中で -TCP/IP スタックとソケット API を含む最初のリリースである。 +.TP +\fB4.2BSD\fP +カリフォルニア大バークレー校 (the University of California at Berkeley) によりリリースされた +\fIBerkeley Software Distribution\fP リリース 4.2 によって規定された、実装に基づく標準規格 +(implementation standard)。 バークレーによるリリースの中で TCP/IP スタックとソケット API +を含む最初のリリースである。 -.\"O Earlier major BSD releases included \fI3BSD\fP (1980), \fI4BSD\fP (1980), -.\"O and \fI4.1BSD\fP (1981). -これより前のBSD の主なリリースとしては -\fI3BSD\fP (1980), \fI4BSD\fP (1980), \fI4.1BSD\fP (1981) がある。 -.TP -.B 4.3BSD -.\"O The successor to 4.2BSD, released in 1986. +これより前のBSD の主なリリースとしては \fI3BSD\fP (1980), \fI4BSD\fP (1980), \fI4.1BSD\fP (1981) がある。 +.TP +\fB4.3BSD\fP 1986 年にリリースされた 4.2BSD の後継。 -.TP -.B 4.4BSD -.\"O The successor to 4.3BSD, released in 1993. -.\"O This was the last major Berkeley release. -1993 年にリリースされた 4.3BSD の後継。 -バークレー (Berkeley) による最後の大きなリリースである。 -.TP -.B System V -.\"O This is an implementation standard defined by AT&T's milestone 1983 -.\"O release of its commercial System V (five) release. -.\"O The previous major AT&T release was -.\"O .IR "System III" , -.\"O released in 1981. -AT&T の商用 System V (5) リリースの 1983 年版により規定された -実装に基づく標準規格。 -一つ前の AT&T の大きなリリースは 1981 年にリリースされた -.I "System III" -である。 -.TP -.B System V release 2 (SVr2) -.\"O This was the next System V release, made in 1985. -.\"O The SVr2 was formally described in the -.\"O .I "System V Interface Definition version 1" -.\"O .RI ( "SVID 1" ) -.\"O published in 1985. -System V の二番目のリリースであり、1985 年に作成された。 -SVr2 は正式には 1985 年に発行された -.I "System V Interface Definition version 1" -.RI ( "SVID 1" ) -に記載されている。 -.TP -.B System V release 3 (SVr3) -.\"O This was the successor to SVr2, released in 1986. -.\"O This release was formally described in the -.\"O .I "System V Interface Definition version 2" -.\"O .RI ( "SVID 2" ). -SVr2 の後継。1986 年にリリースされた。 -このリリースは正式には -.I "System V Interface Definition version 2" -.RI ( "SVID 2" ) -に記載されている。 -.TP -.B System V release 4 (SVr4) -.\"O This was the successor to SVr3, released in 1989. -.\"O This version of System V is described in the "Programmer's Reference -.\"O Manual: Operating System API (Intel processors)" (Prentice-Hall -.\"O 1992, ISBN 0-13-951294-2) -.\"O This release was formally described in the -.\"O .I "System V Interface Definition version 3" -.\"O .RI ( "SVID 3" ), -.\"O and is considered the definitive System V release. -SVr3 の後継。1989 年にリリースされた。 -このバージョンの System V については -"Programmer's Reference Manual: Operating System API (Intel processors)" -(Prentice-Hall 1992, ISBN 0-13-951294-2) に記載されている。 -このリリースは正式には -.I "System V Interface Definition version 3" -.RI ( "SVID 3" ) -に記載されており、System V の最終的なリリースと考えられている。 -.TP -.B SVID 4 -.\"O System V Interface Definition version 4, issued in 1995. -.\"O Available online at http://www.sco.com/developers/devspecs/ . -System V Interface Definition version 4。 -1995 年に発行された。 -インターネットでは http://www.sco.com/developers/devspecs/ -で入手できる。 -.TP -.B C89 -.\"O This was the first C language standard, ratified by ANSI -.\"O (American National Standards Institute) in 1989 -.\"O .RI ( X3.159-1989 ). -.\"O Sometimes this is known as -.\"O .IR "ANSI C" , -.\"O but since C99 is also an -.\"O ANSI standard, this term is ambiguous. -.\"O This standard was also ratified by -.\"O ISO (International Standards Organization) in 1990 -.\"O .RI ( "ISO/IEC 9899:1990" ), -.\"O and is thus occasionally referred to as -.\"O .IR "ISO C90" . -最初の C 言語の標準規格である。 -ANSI (American National Standards Institute) により -1989 年の承認された -.RI ( X3.159-1989 )。 -時には、この規格は -.I "ANSI C" -とも呼ばれるが、 -C99 も ANSI 標準なので、この言い方はあいまいである。 -この規格は 1990 年に ISO (International Standards Organization) による -承認も受けており -.RI ( "ISO/IEC 9899:1990" )、 -そのため -.I "ISO C90" +.TP +\fB4.4BSD\fP +1993 年にリリースされた 4.3BSD の後継。 バークレー (Berkeley) による最後の大きなリリースである。 +.TP +\fBSystem V\fP +AT&T の商用 System V (5) リリースの 1983 年版により規定された 実装に基づく標準規格。 一つ前の AT&T の大きなリリースは +1981 年にリリースされた \fISystem III\fP である。 +.TP +\fBSystem V release 2 (SVr2)\fP +System V の二番目のリリースであり、1985 年に作成された。 SVr2 は正式には 1985 年に発行された \fISystem V +Interface Definition version 1\fP (\fISVID 1\fP) に記載されている。 +.TP +\fBSystem V release 3 (SVr3)\fP +SVr2 の後継。1986 年にリリースされた。 このリリースは正式には \fISystem V Interface Definition version +2\fP (\fISVID 2\fP) に記載されている。 +.TP +\fBSystem V release 4 (SVr4)\fP +SVr3 の後継。1989 年にリリースされた。 このバージョンの System V については "Programmer's Reference +Manual: Operating System API (Intel processors)" (Prentice\-Hall 1992, ISBN +0\-13\-951294\-2) に記載されている。 このリリースは正式には \fISystem V Interface Definition version +3\fP (\fISVID 3\fP) に記載されており、System V の最終的なリリースと考えられている。 +.TP +\fBSVID 4\fP +System V Interface Definition version 4。 1995 年に発行された。 インターネットでは +http://www.sco.com/developers/devspecs/ で入手できる。 +.TP +\fBC89\fP +最初の C 言語の標準規格である。 ANSI (American National Standards Institute) により 1989 +年の承認された (\fIX3.159\-1989\fP)。 時には、この規格は \fIANSI C\fP とも呼ばれるが、 C99 も ANSI +標準なので、この言い方はあいまいである。 この規格は 1990 年に ISO (International Standards +Organization) による 承認も受けており (\fIISO/IEC 9899:1990\fP)、 そのため \fIISO C90\fP として参照されることもたまにある。 -.TP -.B C99 -.\"O This revision of the C language standard was ratified by ISO in 1999 -.\"O .RI ( "ISO/IEC 9899:1999" ). -.\"O Available online at -.\"O http://www.open-std.org/jtc1/sc22/wg14/www/standards. -C 言語の標準規格のこの改訂版は ISO により 1999 年に承認された -.RI ( "ISO/IEC 9899:1999" )。 -http://www.open-std.org/jtc1/sc22/wg14/www/standards -からオンラインで入手可能である。 -.TP -.B POSIX.1-1990 -.\"O "Portable Operating System Interface for Computing Environments". -.\"O IEEE 1003.1-1990 part 1, ratified by ISO in 1990 -.\"O .RI ( "ISO/IEC 9945-1:1990" ). -.\"O The term "POSIX" was coined by Richard Stallman. -"Portable Operating System Interface for Computing Environments". -1990 年に ISO により承認された、IEEE 1003.1-1990 part 1 -.RI ( "ISO/IEC 9945-1:1990" )。 -"POSIX" という言葉は Richard Stallman が初めて作った。 -.TP -.B POSIX.2 -.\"O IEEE Std 1003.2-1992, -.\"O describing commands and utilities, ratified by ISO in 1993 -.\"O .RI ( "ISO/IEC 9945-2:1993" ). -IEEE Std 1003.2-1992. -コマンドとユーティリティについて説明が書かれており、 -1993 年に ISO により承認された -.RI ( "ISO/IEC 9945-2:1993" )。 -.TP -.\"O .BR POSIX.1b " (formerly known as \fIPOSIX.4\fP)" -.BR POSIX.1b " (以前は \fIPOSIX.4\fP とも言われた)" -.\"O IEEE Std 1003.1b-1993 -.\"O describing real-time facilities -.\"O for portable operating systems, ratified by ISO in 1996 -.\"O .RI ( "ISO/IEC 9945-1:1996" ). -IEEE Std 1003.1b-1993. -移植可能なオペレーティングシステムのためのリアルタイム機能について -記載されており、 -1996 年の ISO により承認された -.RI ( "ISO/IEC 9945-1:1996" )。 -.TP -.B POSIX.1c -.\"O IEEE Std 1003.1c-1995 describing the POSIX threads interfaces. -IEEE Std 1003.1c-1995. -POSIX スレッドインタフェースについて記載している。 -.TP -.B POSIX.1d -.\"O IEEE Std 1003.1c-1999 describing additional real-time extensions. -IEEE Std 1003.1c-1999. -追加のリアルタイム拡張について記載している。 -.TP -.B POSIX.1g -.\"O IEEE Std 1003.1g-2000 describing networking APIs (including sockets). -IEEE Std 1003.1g-2000. -(ソケットを含めた) ネットワーク API について記載している。 -.TP -.B POSIX.1j -.\"O IEEE Std 1003.1j-2000 describing advanced real-time extensions. -IEEE Std 1003.1j-2000. -高度なリアルタイム拡張について記載している。 -.TP -.B POSIX.1-1996 -.\"O A 1996 revision of POSIX.1 which incorporated POSIX.1b and POSIX.1c. -POSIX.1 の 1996 年の改訂版。 -POSIX.1b と POSIX.1c を取り込んでいる。 -.TP -.B XPG3 -.\"O Released in 1989, this was the first significant release of the -.\"O .IR "X/Open Portability Guide" , -.\"O produced by the -.\"O X/Open Company, a multivendor consortium. -.\"O This multivolume guide was based on the POSIX standards. -1989 年リリースの、マルチベンダによる業界団体である X/Open 社による -.I "X/Open Portability Guide" -の最初の大きなリリースである。 -この指針は POSIX 標準規格に基づいている。 -.TP -.B XPG4 -.\"O A revision of the X/Open Portability Guide, released in 1992. -1992 年にリリースされた、X/Open Portability Guide (移植性に関する指針) -の改訂版。 -.TP -.B XPG4v2 -.\"O A 1994 revision of XPG4. -.\"O This is also referred to as -.\"O .IR "Spec 1170" , -.\"O where 1170 referred to the number of interfaces -.\"O defined by this standard. -XPG4 の 1994年改訂版。 -.I "Spec 1170" -とも呼ばれる。 -1170 とはこの標準規格が定義しているインタフェースの数を表すものである。 -.TP -.B SUS (SUSv1) -.\"O Single UNIX Specification. -.\"O This was a repackaging of XPG4v2 and other X/Open standards -.\"O (X/Open Curses Issue 4 version 2, -.\"O X/Open Networking Service (XNS) Issue 4). -.\"O Systems conforming to this standard can be branded -.\"O .IR "UNIX 95" . -Single UNIX Specification. -この規格は、XPG4v2 やその他の X/Open による標準規格 -(X/Open Curses Issue 4 version 2, -X/Open Networking Service (XNS) Issue 4) -を再構成したものである。 -この規格に準拠するシステムは -.I "UNIX 95" -を名乗ることができる。 -.TP -.B SUSv2 -.\"O Single UNIX Specification version 2. -.\"O Sometimes also referred to as -.\"O .IR XPG5 . -.\"O This standard appeared in 1997. -.\"O Systems conforming to this standard can be branded -.\"O .IR "UNIX 98" . -.\"O See also -.\"O http://www.UNIX-systems.org/version2/ .) -Single UNIX Specification version 2. -.I XPG5 -と呼ばれることもある。 -この規格は 1997 年に登場した。 -この規格に準拠するシステムは -.I "UNIX 98" -を名乗ることができる。 -http://www.UNIX-systems.org/version2/ +.TP +\fBC99\fP +C 言語の標準規格のこの改訂版は ISO により 1999 年に承認された (\fIISO/IEC 9899:1999\fP)。 +http://www.open\-std.org/jtc1/sc22/wg14/www/standards からオンラインで入手可能である。 +.TP +\fBPOSIX.1\-1990\fP +"Portable Operating System Interface for Computing Environments". 1990 年に +ISO により承認された、IEEE 1003.1\-1990 part 1 (\fIISO/IEC 9945\-1:1990\fP)。 "POSIX" +という言葉は Richard Stallman が初めて作った。 +.TP +\fBPOSIX.2\fP +IEEE Std 1003.2\-1992. コマンドとユーティリティについて説明が書かれており、 1993 年に ISO により承認された +(\fIISO/IEC 9945\-2:1993\fP)。 +.TP +\fBPOSIX.1b\fP (以前は \fIPOSIX.4\fP とも言われた) +IEEE Std 1003.1b\-1993. 移植可能なオペレーティングシステムのためのリアルタイム機能について 記載されており、 1996 年の +ISO により承認された (\fIISO/IEC 9945\-1:1996\fP)。 +.TP +\fBPOSIX.1c\fP +IEEE Std 1003.1c\-1995. POSIX スレッドインタフェースについて記載している。 +.TP +\fBPOSIX.1d\fP +IEEE Std 1003.1c\-1999. 追加のリアルタイム拡張について記載している。 +.TP +\fBPOSIX.1g\fP +IEEE Std 1003.1g\-2000. (ソケットを含めた) ネットワーク API について記載している。 +.TP +\fBPOSIX.1j\fP +IEEE Std 1003.1j\-2000. 高度なリアルタイム拡張について記載している。 +.TP +\fBPOSIX.1\-1996\fP +POSIX.1 の 1996 年の改訂版。 POSIX.1b と POSIX.1c を取り込んでいる。 +.TP +\fBXPG3\fP +1989 年リリースの、マルチベンダによる業界団体である X/Open 社による \fIX/Open Portability Guide\fP +の最初の大きなリリースである。 この指針は POSIX 標準規格に基づいている。 +.TP +\fBXPG4\fP +1992 年にリリースされた、X/Open Portability Guide (移植性に関する指針) の改訂版。 +.TP +\fBXPG4v2\fP +XPG4 の 1994年改訂版。 \fISpec 1170\fP とも呼ばれる。 1170 とはこの標準規格が定義しているインタフェースの数を表すものである。 +.TP +\fBSUS (SUSv1)\fP +Single UNIX Specification. この規格は、XPG4v2 やその他の X/Open による標準規格 (X/Open Curses +Issue 4 version 2, X/Open Networking Service (XNS) Issue 4) を再構成したものである。 +この規格に準拠するシステムは \fIUNIX 95\fP を名乗ることができる。 +.TP +\fBSUSv2\fP +Single UNIX Specification version 2. \fIXPG5\fP と呼ばれることもある。 この規格は 1997 年に登場した。 +この規格に準拠するシステムは \fIUNIX 98\fP を名乗ることができる。 http://www.UNIX\-systems.org/version2/ も参照のこと。 -.TP -.B POSIX.1-2001, SUSv3 -.\"O This was a 2001 revision and consolidation of the -.\"O POSIX.1, POSIX.2, and SUS standards into a single document, -.\"O conducted under the auspices of the Austin group -.\"O (http://www.opengroup.org/austin/ .) -.\"O The standard is available online at -.\"O http://www.unix-systems.org/version3/ , -.\"O and the interfaces that it describes are also available in the Linux -.\"O manual pages package under sections 1p and 3p (e.g., "man 3p open"). -これは POSIX.1, POSIX.2, SUS の 2001年の改訂版である。 -また、POSIX.1, POSIX.2, SUS を一つの文書に統合したものである。 -この統合は Austin Group (http://www.opengroup.org/austin/) -の後援の元で行われた。 -インターネットでは -http://www.unix-systems.org/version3/ で入手できる。 -また、この規格に書かれているインタフェースについては -Linux のマニュアルページ・パッケージの 1p, 3p セクションでも -参照できる (例えば、"man 3p open")。 +.TP +\fBPOSIX.1\-2001, SUSv3\fP +これは POSIX.1, POSIX.2, SUS の 2001年の改訂版である。 また、POSIX.1, POSIX.2, SUS +を一つの文書に統合したものである。 この統合は Austin Group (http://www.opengroup.org/austin/) +の後援の元で行われた。 インターネットでは http://www.unix\-systems.org/version3/ で入手できる。 +また、この規格に書かれているインタフェースについては Linux のマニュアルページ・パッケージの 1p, 3p セクションでも 参照できる +(例えば、"man 3p open")。 -.\"O The standard defines two levels of conformance: -.\"O .IR "POSIX conformance" , -.\"O which is a baseline set of interfaces required of a conforming system; -.\"O and -.\"O .IR "XSI Conformance", -.\"O which additionally mandates a set of interfaces -.\"O (the "XSI extension") which are only optional for POSIX conformance. -.\"O XSI-conformant systems can be branded -.\"O .IR "UNIX 03" . -.\"O (XSI conformance constitutes the -.\"O .I "Single UNIX Specification version 3" -.\"O .RI ( SUSv3 ).) -この規格では、 -.I "POSIX Conformance (POSIX 準拠)" -と -.I "XSI Conformance (XSI 準拠)" -の二段階の適合性を定義している。 -.I "POSIX 準拠" -は準拠するシステムに必要とされるインタフェースの基本セットであり、 -.I "XSI 準拠)" -では "XSI 拡張" という追加のインタフェース群が義務付けられている -(POSIX 準拠では XSI 拡張の実装は任意 (optional) となっている)。 -XSI 準拠のシステムは -.I "UNIX 03" -を名乗ることができる -(XSI 準拠の内容が -.I "Single UNIX Specification version 3" -.RI ( SUSv3 ) -である)。 +この規格では、 \fIPOSIX Conformance (POSIX 準拠)\fP と \fIXSI Conformance (XSI 準拠)\fP +の二段階の適合性を定義している。 \fIPOSIX 準拠\fP は準拠するシステムに必要とされるインタフェースの基本セットであり、 \fIXSI 準拠)\fP では +"XSI 拡張" という追加のインタフェース群が義務付けられている (POSIX 準拠では XSI 拡張の実装は任意 (optional) +となっている)。 XSI 準拠のシステムは \fIUNIX 03\fP を名乗ることができる (XSI 準拠の内容が \fISingle UNIX +Specification version 3\fP (\fISUSv3\fP) である)。 -.\"O The POSIX.1-2001 document is broken into four parts: -POSIX.1-2001 文書は 4つの部分に分けることができる: +POSIX.1\-2001 文書は 4つの部分に分けることができる: -.BR XBD : -.\"O Definitions, terms and concepts, header file specifications. -定義、用語と概念、ヘッダファイルの仕様。 +\fBXBD\fP: 定義、用語と概念、ヘッダファイルの仕様。 -.BR XSH : -.\"O Specifications of functions (i.e., system calls and library -.\"O functions in actual implementations). -関数の仕様 (関数とは、実際の実装でのシステムコールと -ライブラリ関数のことである)。 +\fBXSH\fP: 関数の仕様 (関数とは、実際の実装でのシステムコールと ライブラリ関数のことである)。 -.BR XCU : -.\"O Specifications of commands and utilities -.\"O (i.e., the area formerly described by POSIX.2). -コマンドとユーティリティの仕様 -(以前、 POSIX.2 に記載されていた内容)。 +\fBXCU\fP: コマンドとユーティリティの仕様 (以前、 POSIX.2 に記載されていた内容)。 -.BR XRAT : -.\"O Informative text on the other parts of the standard. -参考情報と規格のそれ以外の部分 +\fBXRAT\fP: 参考情報と規格のそれ以外の部分 -.\"O POSIX.1-2001 is aligned with C99, so that all of the -.\"O library functions standardized in C99 are also -.\"O standardized in POSIX.1-2001. -POSIX.1-2001 は C99 と整合がとられており、 -C99 で標準化されたライブラリ関数は POSIX.1-2001 でも -標準化されている。 +POSIX.1\-2001 は C99 と整合がとられており、 C99 で標準化されたライブラリ関数は POSIX.1\-2001 でも 標準化されている。 -.\"O Two Technical Corrigenda (minor fixes and improvements) -.\"O of the original 2001 standard have occurred: -.\"O TC1 in 2003 (referred to as -.\"O .IR POSIX.1-2003 ), -.\"O and TC2 in 2004 (referred to as -.\"O .IR POSIX.1-2004 ). -元の 2001 年版の標準に対する Technical Corrigenda -(正誤表; 細かな修正と改良) が二つ行われている: -2003 年の TC1 -.RI ( POSIX.1-2003 -と呼ばれる) と 2004 年の TC2 -.RI ( POSIX.1-2004 -と呼ばれる) である。 -.TP -.B POSIX.1-2008, SUSv4 -.\"O Work on the next revision of POSIX.1/SUS was completed and -.\"O ratified in 2008. +元の 2001 年版の標準に対する Technical Corrigenda (正誤表; 細かな修正と改良) が二つ行われている: 2003 年の +TC1 (\fIPOSIX.1\-2003\fP と呼ばれる) と 2004 年の TC2 (\fIPOSIX.1\-2004\fP と呼ばれる) である。 +.TP +\fBPOSIX.1\-2008, SUSv4\fP POSIX.1/SUS の次の改訂版に関する作業は 2008 年に完了し承認された。 -.\"O The changes in this revision are not as large as those -.\"O that occurred for POSIX.1-2001/SUSv3, -.\"O but a number of new interfaces are added -.\"O and various details of existing specifications are modified. -.\"O Many of the interfaces that were optional in -.\"O POSIX.1-2001 become mandatory in the 2008 revision of the standard. -.\"O A few interfaces that are present in POSIX.1-2001 are marked -.\"O as obsolete in POSIX.1-2008, or removed from the standard altogether. -この改訂版での変更は POSIX.1-2001/SUSv3 で行われた変更ほど大きくないが、 -多くの新しいインターフェイスが追加され、既存の仕様に関しても -種々の詳細が変更されている。 -POSIX.1-2001 では任意 (optional) とされていたインターフェイスの多くが -2008 年版の標準では必須 (mandatory) になる。 -POSIX.1-2001 に存在するインターフェイスのいくつかは、 -POSIX.1-2008 では廃止予定の印が付けられたり、 -標準から完全に削除されたりしている。 +この改訂版での変更は POSIX.1\-2001/SUSv3 で行われた変更ほど大きくないが、 +多くの新しいインターフェイスが追加され、既存の仕様に関しても 種々の詳細が変更されている。 POSIX.1\-2001 では任意 (optional) +とされていたインターフェイスの多くが 2008 年版の標準では必須 (mandatory) になる。 POSIX.1\-2001 +に存在するインターフェイスのいくつかは、 POSIX.1\-2008 では廃止予定の印が付けられたり、 標準から完全に削除されたりしている。 -.\"O The revised standard is broken into the same four parts as POSIX.1-2001, -.\"O and again there are two levels of conformance: the baseline -.\"O .IR "POSIX Conformance" , -.\"O and -.\"O .IR "XSI Conformance" , -.\"O which mandates an additional set of interfaces -.\"O beyond those in the base specification. -改訂された標準は POSIX.1-2001 と同じく 4 つの部分に分けられ、 -前回と同様に二段階の適合性を定義している。 -基本セットである -.I "POSIX Conformance (POSIX 準拠)" -と、 -基本仕様のインターフェイスに加えて追加のインターフェイス群が -義務付けられている -.I "XSI Conformance (XSI 準拠)" -の二つである。 +改訂された標準は POSIX.1\-2001 と同じく 4 つの部分に分けられ、 前回と同様に二段階の適合性を定義している。 基本セットである +\fIPOSIX Conformance (POSIX 準拠)\fP と、 基本仕様のインターフェイスに加えて追加のインターフェイス群が 義務付けられている +\fIXSI Conformance (XSI 準拠)\fP の二つである。 -.\"O In general, where the CONFORMING TO section of a manual page -.\"O lists POSIX.1-2001, it can be assumed that the interface also -.\"O conforms to POSIX.1-2008, unless otherwise noted. -一般には、マニュアルページの「準拠」の章のリストに POSIX.1-2001 が -あれば、他に注意書きがなければ、そのインターフェイスは POSIX.1-2008 -にも準拠していると考えてよい。 +一般には、マニュアルページの「準拠」の章のリストに POSIX.1\-2001 が あれば、他に注意書きがなければ、そのインターフェイスは +POSIX.1\-2008 にも準拠していると考えてよい。 -.\"O Further information can be found on the Austin group web site, -.\"O http://www.opengroup.org/austin/ . -詳しい情報は Austin Group のウェブサイト -http://www.opengroup.org/austin/ -に載っている。 -.\"O .SH "SEE ALSO" +詳しい情報は Austin Group のウェブサイト http://www.opengroup.org/austin/ に載っている。 .SH 関連項目 -.BR feature_test_macros (7), -.BR libc (7), -.BR posixoptions (7) +\fBfeature_test_macros\fP(7), \fBlibc\fP(7), \fBposixoptions\fP(7) diff --git a/draft/man7/suffixes.7 b/draft/man7/suffixes.7 deleted file mode 100644 index ba8842f2..00000000 --- a/draft/man7/suffixes.7 +++ /dev/null @@ -1,526 +0,0 @@ -'\" t -.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) -.\" -.\" Permission is granted to make and distribute verbatim copies of this -.\" manual provided the copyright notice and this permission notice are -.\" preserved on all copies. -.\" -.\" Permission is granted to copy and distribute modified versions of this -.\" manual under the conditions for verbatim copying, provided that the -.\" entire resulting derived work is distributed under the terms of a -.\" permission notice identical to this one. -.\" -.\" Since the Linux kernel and libraries are constantly changing, this -.\" manual page may be incorrect or out-of-date. The author(s) assume no -.\" responsibility for errors or omissions, or for damages resulting from -.\" the use of the information contained herein. The author(s) may not -.\" have taken the same level of care in the production of this manual, -.\" which is licensed free of charge, as they might when working -.\" professionally. -.\" -.\" Formatted or processed versions of this manual, if unaccompanied by -.\" the source, must acknowledge the copyright and authors of this work. -.\" License. -.\" Modified Sat Jul 24 17:35:15 1993 by Rik Faith -.\" Modified Sun Feb 19 22:02:32 1995 by Rik Faith -.\" Modified Tue Oct 22 23:28:12 1996 by Eric S. Raymond -.\" Modified Sun Jan 26 21:56:56 1997 by Ralph Schleicher -.\" -.\" Modified Mon Jun 16 20:24:58 1997 by Nicolas Lichtmaier -.\" Modified Sun Oct 18 22:11:28 1998 by Joseph S. Myers -.\" Modified Mon Nov 16 17:24:47 1998 by Andries Brouwer -.\" Modified Mon Jun 16 20:24:58 1997 by Nicolas Lichtmaier -.\" Modified Thu Nov 16 23:28:25 2000 by David A. Wheeler -.\" -.\" -.\" FIXME, mtk, May 2007: rendering this page yields the error: -.\" grotty:suffixes.7:1725: character above first line discarded -.\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Sun Jun 21 18:30:00 JST 1998 -.\" by HANATAKA Shinya -.\" Modified Tue Dec 1 00:25:46 JST 1998 -.\" by HANATAKA Shinya -.\" Modified Tue Nov 26 06:15:52 JST 1999 -.\" by Kentaro Shirakata -.\" Modified Sun Jan 14 13:42:11 JST 2001 -.\" by HANATAKA Shinya -.\" Updated Tue Apr 24 21:51:14 JST 2001 -.\" by Yuichi SATO -.\" -.\"WORD: suffix 接尾 -.\" -.TH SUFFIXES 7 2000-11-16 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.SH 名前 -.\"O suffixes \- list of file suffixes -suffixes \- ファイルの接尾 (suffix) のリスト -.\"O .SH DESCRIPTION -.SH 説明 -.\"O It is customary to indicate the contents of a file with the file suffix, -.\"O which consists of a period, followed by one or more letters. -.\"O Many standard utilities, such as compilers, use this to recognize the type of -.\"O file they are dealing with. -.\"O The -.\"O .BR make (1) -.\"O utility is driven by rules based on file suffix. -習慣的にファイルの接尾 (suffix) はファイルの内容を示している。 -この接尾はピリオド (.) とそれに続く一つ以上の文字からなっている。 -コンパイラーのような、多くの標準的なユーティリティは、 -この接尾を使用して取り扱うファイルの型を理解する。 -.BR make (1) -ユーティリティはファイルの接尾に基づいたルールに従って動作する。 -.PP -.\"O Following is a list of suffixes which are likely to be found on a -.\"O Linux system. -以下は Linux システムでよく見られる接尾のリストである。 -.PP - -.TS -l | l -_ | _ -lI | l . -Suffix File type -.\"O ,v files for RCS (Revision Control System) - ,v RCS (リビジョン・コントロール) のためのファイル -.\"O - backup file - - バックアップ・ファイル -.\"O .C C++ source code, equivalent to \fI.cc\fP - .C C++ のソース・コード、\fI.cc\fP と等価 -.\"O .F Fortran source with \fBcpp\fP(1) directives -.\"O or file compressed using freeze - .F \fBcpp\fP(1)命令をもったフォートランのソース - または freeze(1) で圧縮されたファイル -.\"O .S assembler source with \fBcpp\fP(1) directives - .S \fBcpp\fP(1)命令をもったアセンブラ・ソース -.\"O .Y file compressed using yabba - .Y yabba(1) で圧縮されたファイル -.\"O .Z file compressed using \fBcompress\fP(1) - .Z \fBcompress\fP(1)で圧縮されたファイル -.\"O .[0-9]+gf TeX generic font files - .[0-9]+gf TeX の一般フォント -.\"O .[0-9]+pk TeX packed font files - .[0-9]+pk TeX の圧縮フォント -.\"O .[1-9] manual page for the corresponding section - .[1-9] 対応する章のマニュアル・ページ -.\"O .[1-9][a-z] manual page for section plus subsection - .[1-9][a-z] サブセクション付きマニュアル・ページ -.\"O .a static object code library - .a オブジェクト・コードの静的ライブラリ -.\"O .ad X application default resource file - .ad X のアプリケーション・デフォルト・ファイル -.\"O .ada Ada source (may be body, spec, or combination) - .ada Ada のソース(本体か枝葉か組み合わせ) -.\"O .adb Ada body source - .adb Ada のソース本体 -.\"O .ads Ada spec source - .ads Ada のソース仕様 -.\"O .afm PostScript font metrics - .afm PostScript のフォント・メトリクス -.\"O .al Perl autoload file - .al Perl のオートロード・ファイル -.\"O .am \fBautomake\fP(1) input file - .am \fBautomake\fP(1) の入力ファイル -.\"O .arc \fBarc\fP(1) archive - .arc \fBarc\fP(1)のアーカイブ -.\"O .arj \fBarj\fP(1) archive - .arj \fBarj\fP(1)のアーカイブ -.\"O .asc PGP ASCII-armored data - .asc PGP の ASCII 化されたデータ -.\"O .asm (GNU) assembler source file - .asm (GNU) アセンブラのソース -.\"O .au Audio sound file - .au オーディオ・サウンド・ファイル -.\"O .aux LaTeX auxiliary file - .aux LaTeX の補助ファイル -.\"O .avi (msvideo) movie -.avi (Microsoft ビデオ) ムービー -.\"O .awk AWK language program - .awk AWK 言語のプログラム -.\"O .b LILO boot loader image - .b LILO のブートローダ・イメージ -.\"O .bak backup file - .bak バックアップ・ファイル -.\"O .bash \fBbash\fP(1) shell script - .bash \fBbash\fP(1) シェル・スクリプト -.\"O .bb basic block list data produced by -.\"O gcc \-ftest\-coverage - .bb gcc -ftest-coverage のベーシック・ブロック・リスト -.\"O .bbg basic block graph data produced by -.\"O gcc \-ftest\-coverage - .bbg gcc -ftest-coverage のベーシック・ブロック・グラフ -.\"O .bbl BibTeX output - .bbl BibTeX の出力 -.\"O .bdf X font file - .bdf X のフォントファイル -.\"O .bib TeX bibliographic database, BibTeX input - .bib TeX 文献データベース, BibTeX の入力 -.\"O .bm bitmap source - .bm ビットマップのソース -.\"O .bmp bitmap - .bmp ビットマップ -.\"O .bz2 file compressed using \fBbzip2\fP(1) - .bz2 \fBbzip2\fP(1) を使用して圧縮されたファイル -.\"O .c C source - .c C のソース・コード -.\"O .cat message catalog files - .cat メッセージ・カタログ・ファイル -.\"O .cc C++ source - .cc C++ のソース・コード -.\"O .cf configuration file - .cf 設定ファイル -.\"O .cfg configuration file - .cfg 設定ファイル -.\"O .cgi WWW content generating script or program - .cgi WWW のコンテンツを作成するプログラム -.\"O .cls LaTeX Class definition - .cls LaTeX のクラス定義ファイル -.\"O .class Java compiled byte-code - .class Java のコンパイルされたバイトコード -.\"O .conf configuration file - .conf 設定ファイル -.\"O .config configuration file - .config 設定ファイル -.\"O .cpp equivalent to \fI.cc\fR - .cpp \fI.cc\fR と同じ -.\"O .csh \fBcsh\fP(1) shell script - .csh \fBcsh\fP(1) シェル・スクリプト -.\"O .cxx equivalent to \fI.cc\fR - .cxx \fI.cc\fR と同じ -.\"O .dat data file - .dat データ・ファイル -.\"O .deb Debian software package - .deb Debian のソフトウェア・パッケージ -.\"O .def Modula-2 source for definition modules - .def Modula-2 ソースのモジュール定義ファイル -.\"O .def other definition files - .def その他の定義ファイル -.\"O .desc initial part of mail message unpacked with -.\"O \fBmunpack\fP(1) - .desc \fBmunpack\fP(1) でアンパックされたメールの最初の部分 -.\"O .diff file differences (\fBdiff\fP(1) command output) - .diff ファイル差分 (\fBdiff\fP(1) コマンドの出力) -.\"O .dir dbm data base directory file - .dir dbm データベースのディレクトリ・ファイル -.\"O .doc documentation file - .doc ドキュメント・ファイル -.\"O .dsc Debian Source Control (source package) - .dsc Debian のソース・コントロールファイル - (ソース・パッケージ) -.\"O .dtx LaTeX package source file - .dtx LaTeX パッケージのソース -.\"O .dvi TeX's device independent output - .dvi TeX のデバイス独立出力ファイル -.\"O .el Emacs-Lisp source - .el Emacs-Lisp のソース -.\"O .elc compiled Emacs-Lisp source - .elc コンパイルされた Emacs-Lispのコード -.\"O .eps encapsulated PostScript - .eps カプセル化されたPostScript -.\"O .exp Expect source code - .exp Expect のソースコード -.\"O .f Fortran source - .f Fortran のソース・コード -.\"O .f77 Fortran 77 source - .f77 Fortran 77 のソース・コード -.\"O .f90 Fortran 90 source - .f90 Fortran 90 のソース・コード -.\"O .fas precompiled Common-Lisp - .fas プリコンパイルされた Common-Lispのコード -.\"O .fi Fortran include files - .fi フォートランのインクルード・ファイル -.\"O .fig FIG image file (used by \fBxfig\fP(1)) - .fig FIG イメージ・ファイル (\fBxfig\fR(1) で使用される) -.\"O .fmt TeX format file - .fmt TeX フォーマット・ファイル -.\"O .gif Compuserve Graphics Image File format - .gif グラフィック・イメージ (Compuserve Graphics Image File) -.\"O .gmo GNU format message catalog - .gmo GNU フォーマット・メッセージ・カタログ -.\"O .gsf Ghostscript fonts - .gsf ghostscript のフォント -.\"O .gz file compressed using \fBgzip\fP(1) - .gz \fBgzip\fP(1) を使用して圧縮されたファイル -.\"O .h C or C++ header files - .h C または C++ のヘッダー・ファイル -.\"O .help help file - .help ヘルプ・ファイル -.\"O .hf equivalent to \fI.help\fP - .hf \fI.help\fP に同じ -.\"O .hlp equivalent to \fI.help\fP - .hlp \fI.help\fP に同じ -.\"O .htm poor man's \fI.html\fP - .htm 貧乏人の \fI.html\fP -.\"O .html HTML document used with the World Wide Web - .html World Wide Web で使用する HTML の文書 -.\"O .hqx 7-bit encoded Macintosh file - .hqx 7 ビットエンコードされた Macintosh ファイル -.\"O .i C source after preprocessing - .i プリプロセスを行なった C のソース・コード -.\"O .icon bitmap source - .icon ビットマップのソース -.\"O .idx reference or datum-index file for hypertext -.\"O or database system - .idx ハイパーテキストやデータベースのインデックス・ファイル -.\"O .image bitmap source - .image ビットマップのソース -.\"O .in configuration template, especially for GNU Autoconf - .in コンフィギュレーションのテンプレート (特に GNU Autoconf) -.\"O .info files for the Emacs info browser - .info Emacs info ファイル -.\"O .info-[0-9]+ split info files - .info-[0-9]+ 分割された info ファイル -.\"O .ins LaTeX package install file for docstrip - .ins docstrip の LaTeX パッケージ・インストール・ファイル -.\"O .itcl itcl source code; -.\"O itcl ([incr Tcl]) is an OO extension of tcl - .itcl itcl のソース・コード - itcl (incr tcl) は tcl の OO 拡張 -.\"O .java a Java source file - .java Java のソース・コード -.\"O .jpeg Joint Photographic Experts Group format - .jpeg グラフィックイメージ (Joint Photographic Experts Group) -.\"O .jpg poor man's \fI.jpeg\fP - .jpg 貧乏人の \fI.jpeg\fP -.\"O .kmap \fBlyx\fP(1) keymap - .kmap \fBlyx\fP(1) のキーマップ -.\"O .l equivalent to \fI.lex\fP or \fI.lisp\fP - .l \fI.lex\fP または \fI.lisp\fP に同じ -.\"O .lex \fBlex\fP(1) or \fBflex\fP(1) files - .lex \fBlex\fP(1) または \fBflex\fP(1) ファイル -.\"O .lha lharc archive - .lha lharc アーカイブ -.\"O .lib Common-Lisp library - .lib Common-Lisp のライブラリ -.\"O .lisp Lisp source - .lisp Lisp のソース・コード -.\"O .ln files for use with \fBlint\fP(1) - .ln \fBlint\fP(1) で使用するためのファイル -.\"O .log log file, in particular produced by TeX - .log ログ・ファイル, 特に TeX によって生成される -.\"O .lsm Linux Software Map entry - .lsm Linux ソフトウェア・マップの見出し -.\"O .lsp Common-Lisp source - .lsp Common-Lisp のソース・コード -.\"O .lzh lharc archive - .lzh lharc アーカイブ -.\"O .m Objective-C source code - .m Objective-C ソース・コード -.\"O .m4 \fBm4\fP(1) source - .m4 \fBm4\fP(1) のソース・コード -.\"O .mac macro files for various programs - .mac いろいろなプログラムでのマクロ・ファイル -.\"O .man manual page (usually source rather than formatted) - .man マニュアル・ページ (大抵はフォーマットされていない) -.\"O .map map files for various programs - .map 各種プログラムのマップ・ファイル -.\"O .me Nroff source using the me macro package - .me me マクロ・パッケージを使用した Nroff のソース -.\"O .mf Metafont (font generator for TeX) source - .mf メタフォント (TeX のフォント作成ツール) のソース -.\"O .mgp MagicPoint file - .mgp MagicPoint ファイル -.\"O .mm sources for \fBgroff\fP(1) in mm - format - .mm mm マクロを使用した \fBgroff\fP(1) のソース -.\"O .mo Message catalog binary file - .mo メッセージ・カタログのバイナリ -.\"O .mod Modula-2 source for implementation modules - .mod Modula-2 のモジュール実装のためのソース・コード -.\"O .mov (quicktime) movie - .mov (quicktime) ムービー -.\"O .mp Metapost source - .mp Metapost のソース -.\"O .mp2 MPEG Layer 2 (audio) file - .mp2 MPEG レイヤー 2 (オーディオ) ファイル -.\"O .mp3 MPEG Layer 3 (audio) file - .mp3 MPEG レイヤー 3 (オーディオ) ファイル -.\"O .mpeg movie file - .mpeg ムービー・ファイル -.\"O .o object file - .o オブジェクト・ファイル -.\"O .old old or backup file - .old 古いファイル、またはバックアップ・ファイル -.\"O .orig backup (original) version of a file, from \fBpatch\fP(1) - .orig \fBpatch\fP(1) による (オリジナルの) バックアップ・ファイル -.\"O .out output file, often executable program (a.out) - .out 出力ファイル、大抵は実行プログラムである (a.out) -.\"O .p Pascal source - .p pascal のソース・コード -.\"O .pag dbm data base data file - .pag dbm データベースのデータ・ファイル -.\"O .patch file differences for \fBpatch\fP(1) - .patch \fBpatch\fP(1) で使用するための差分ファイル -.\"O .pbm portable bitmap format - .pbm グラフィック・イメージ (portable bitmap format) -.\"O .pcf X11 font files - .pcf X11 のフォント・ファイル -.\"O .pdf Adobe Portable Data Format -.\"O (use Acrobat/\fBacroread\fP or \fBxpdf\fP) - .pdf Adobe Portable Data Format - (Acrobat/\fBacroread\fP や \fBxpdf\fP で使用する) -.\"O .perl Perl source (see .ph, .pl and .pm) - .perl Perl のソース・コード (.ph, .pl, .pm を参照) -.\"O .pfa PostScript font definition files, ASCII format - .pfa PostScriptのフォント定義 (ASCII フォーマット) -.\"O .pfb PostScript font definition files, binary format - .pfb PostScriptのフォント定義 (バイナリ・フォーマット) -.\"O .pgm portable greymap format - .pgm グラフィック・イメージ (portable greymap format) -.\"O .pgp PGP binary data - .pgp PGP のバイナリ・データ -.\"O .ph Perl header file - .ph Perl のヘッダー・ファイル -.\"O .php PHP program file - .php PHP のプログラム・ファイル -.\"O .php3 PHP3 program file - .php3 PHP3 のプログラム・ファイル -.\"O .pid File to store daemon PID (e.g., crond.pid) - .pid デーモンの PID を格納したファイル (crond.pid など) -.\"O .pl TeX property list file or Perl library file - .pl TeX のプロパティ・リストまたは Perl のライブラリ -.\"O .pm Perl module - .pm Perl のモジュール -.\"O .png Portable Network Graphics file - .png グラフィック・イメージ (Portable Network Graphics) -.\"O .po Message catalog source - .po メッセージ・カタログのソース -.\"O .pod \fBperldoc\fP(1) file - .pod \fBperldoc\fP(1) ファイル -.\"O .ppm portable pixmap format - .ppm グラフィック・イメージ (portable pixmap format) -.\"O .pr bitmap source - .pr ビットマップのソース -.\"O .ps PostScript file - .ps PostScript ファイル -.\"O .py Python source - .py python のソース -.\"O .pyc compiled python - .pyc コンパイルされた python -.\"O .qt quicktime movie - .qt quicktime ムービー -.\"O .r RATFOR source (obsolete) - .r RATFOR のソース (廃語) -.\"O .rej patches that \fBpatch\fP(1) couldn't apply - .rej \fBpatch\fP(1) に失敗した pacth ファイル -.\"O .rpm RPM software package - .rpm RPM のソフトウェア・パッケージ -.\"O .rtf Rich Text Format file - .rtf リッチ・テキスト・フォーマット -.\"O .rules rules for something - .rules 何かのためのルール -.\"O .s assembler source - .s アセンブラのソース -.\"O .sa stub libraries for a.out shared libraries - .sa a.out 共有ライブラリのためのスタブ・ライブラリ -.\"O .sc \fBsc\fP(1) spreadsheet commands - .sc \fBsc\fP(1) のスプレッドシート命令 -.\"O .scm Scheme source code - .scm Scheme のソース・コード -.\"O .sed sed source file - .sed sed のソース・ファイル -.\"O .sgml SGML source file - .sgml SGML ソース -.\"O .sh \fBsh\fP(1) scripts - .sh \fBsh\fP(1) のスクリプト -.\"O .shar archive created by the \fBshar\fP(1) utility - .shar \fBshar\fP(1) ユーティリティで作成されたアーカイブ -.\"O .so Shared library or dynamically loadable object - .so 共有ライブラリまたは動的ロード・オブジェクト -.\"O .sql SQL source - .sql SQL のソース -.\"O .sqml SQML schema or query program - .sqml SQML の schema または query program -.\"O .sty LaTeX style files - .sty LaTeX のスタイル・ファイル -.\"O .sym Modula-2 compiled definition modules - .sym Modula-2 のコンパイルされた定義モジュール -.\"O .tar archive created by the \fBtar\fP(1) utility - .tar \fBtar\fP(1) ユーティリティで作成されたアーカイブ -.\"O .tar.Z tar(1) archive compressed with \fBcompress\fP(1) - .tar.Z \fBcompress\fP(1) で圧縮された \fBtar\fP(1) アーカイブ -.\"O .tar.bz2 tar(1) archive compressed with \fBbzip2\fP(1) - .tar.bz2 \fBbzip2\fP(1) で圧縮された \fBtar\fP(1) アーカイブ -.\"O .tar.gz tar(1) archive compressed with \fBgzip\fP(1) - .tar.gz \fBgzip\fP(1) で圧縮された \fBtar\fP(1) アーカイブ -.\"O .taz tar(1) archive compressed with \fBcompress\fP(1) - .taz \fBcompress\fP(1) で圧縮された \fBtar\fP(1) アーカイブ -.\"O .tcl tcl source code - .tcl tcl のソース・コード -.\"O .tex TeX or LaTeX source - .tex TeX または LaTeX のソース -.\"O .texi equivalent to \fI.texinfo\fP - .texi \fI.texinfo\fP に同じ -.\"O .texinfo Texinfo documentation source - .texinfo texinfo 文書のソース -.\"O .text text file - .text テキスト・ファイル -.\"O .tfm TeX font metric file - .tfm TeX のフォント・メトリック -.\"O .tgz tar archive compressed with \fBgzip\fP(1) - .tgz \fRgzip\fP(1)で圧縮された \fRtar\fP(1) アーカイブ -.\"O .tif poor man's \fI.tiff\fP - .tif 貧乏人の \fI.tiff\fP -.\"O .tiff Tagged Image File Format - .tiff グラフィック・イメージ (Tagged Image File Format) -.\"O .tk tcl/tk script - .tk tcl/tk スクリプト -.\"O .tmp temporary file - .tmp 一時ファイル -.\"O .tmpl template files - .tmpl テンプレート・ファイル -.\"O .txt equivalent to \fI.text\fP - .txt \fI.text\fP に同じ -.\"O .uu equivalent to \fI.uue\fP - .uu \fI.uue\fP に同じ -.\"O .uue binary file encoded with \fBuuencode\fP(1) - .uue \fBuuencode\fP(1) で符号化されたバイナリ・ファイル -.\"O .vf TeX virtual font file - .vf TeX の仮想フォント・ファイル -.\"O .vpl TeX virtual property list file - .vpl TeX の仮想プロパティ・リスト・ファイル -.\"O .w Silvio Levi's CWEB - .w Silvio Levi の CWEB -.\"O .wav wave sound file - .wav ウェーブ・サウンド・ファイル -.\"O .web Donald Knuth's WEB - .web Donald Knuth の WEB -.\"O .wml Source file for Web Meta Language - .wml Web Meta Language のソース・ファイル -.\"O .xbm X11 bitmap source - .xbm X11 ビットマップのソース -.\"O .xcf GIMP graphic - .xcf GIMP グラフィック・ファイル -.\"O .xml eXtended Markup Language file - .xml XML (拡張記述言語)ファイル -.\"O .xpm X11 pixmap source - .xpm X11 ピクスマップのソース -.\"O .xs Perl xsub file produced by h2xs - .xs h2xs で生成される Perl xsub ファイル -.\"O .xsl XSL stylesheet - .xsl XSL スタイルシート -.\"O .y \fByacc\fP(1) or \fBbison\fP(1) (parser generator) files - .y \fByacc\fP(1) または \fBbison\fP(1) のファイル -.\"O .z File compressed using \fBpack\fP(1) (or an old \fBgzip\fP(1)) - .z \fBpack\fP(1) (または古い \fBgzip\fP(1)) で圧縮されたファイル -.\"O .zip \fBzip\fP(1) archive - .zip \fBzip\fP(1) アーカイブ -.\"O .zoo \fBzoo\fP(1) archive - .zoo \fBzoo\fP(1) アーカイブ -.\"O ~ Emacs or \fBpatch\fP(1) backup file - ~ Emacs または \fBpatch\fP(1) のバックアップ・ファイル -.\"O rc startup (`run control') file, e.g., \fI.newsrc\fP - rc 起動ファイル (`run control') (例 \fI.newsrc\fP) -.TE -.\"O .SH "CONFORMING TO" -.SH 準拠 -.\"O General UNIX conventions. -一般的な UNIX の作法。 -.\"O .SH BUGS -.SH バグ -.\"O This list is not exhaustive. -このリストは完全ではない。 -.\"O .SH "SEE ALSO" -.SH 関連項目 -.BR file (1), -.BR make (1) diff --git a/draft/man7/symlink.7 b/draft/man7/symlink.7 new file mode 100644 index 00000000..c82ff0bc --- /dev/null +++ b/draft/man7/symlink.7 @@ -0,0 +1,279 @@ +.\"- +.\" Copyright (c) 1992, 1993, 1994 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)symlink.7 8.3 (Berkeley) 3/31/94 +.\" $FreeBSD: src/bin/ln/symlink.7,v 1.30 2005/02/13 22:25:09 ru Exp $ +.\" +.\" 2008-06-11, mtk, Taken from FreeBSD 6.2 and heavily edited for +.\" specific Linux details, improved readability, and man-pages style. +.\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH SYMLINK 7 2008\-06\-18 Linux "Linux Programmer's Manual" +.SH 名前 +symlink \- symbolic link handling +.SH "SYMBOLIC LINK HANDLING" +Symbolic links are files that act as pointers to other files. To understand +their behavior, you must first understand how hard links work. + +A hard link to a file is indistinguishable from the original file because it +is a reference to the object underlying the original filename. (To be +precise: each of the hard links to a file is a reference to the same +\fIi\-node number\fP, where an i\-node number is an index into the i\-node table, +which contains metadata about all files on a file system. See \fBstat\fP(2).) +Changes to a file are independent of the name used to reference the file. +Hard links may not refer to directories (to prevent the possibility of loops +within the file system tree, which would confuse many programs) and may not +refer to files on different file systems (because i\-node numbers are not +unique across file systems). + +A symbolic link is a special type of file whose contents are a string that +is the pathname another file, the file to which the link refers. In other +words, a symbolic link is a pointer to another name, and not to an +underlying object. For this reason, symbolic links may refer to directories +and may cross file system boundaries. + +There is no requirement that the pathname referred to by a symbolic link +should exist. A symbolic link that refers to a pathname that does not exist +is said to be a \fIdangling link\fP. + +Because a symbolic link and its referenced object coexist in the file system +name space, confusion can arise in distinguishing between the link itself +and the referenced object. On historical systems, commands and system calls +adopted their own link\-following conventions in a somewhat ad\-hoc fashion. +Rules for a more uniform approach, as they are implemented on Linux and +other systems, are outlined here. It is important that site\-local +applications also conform to these rules, so that the user interface can be +as consistent as possible. +.SS "Symbolic link ownership, permissions, and timestamps" +The owner and group of an existing symbolic link can be changed using +\fBlchown\fP(2). The only time that the ownership of a symbolic link matters +is when the link is being removed or renamed in a directory that has the +sticky bit set (see \fBstat\fP(2)). + +The last access and last modification timestamps of a symbolic link can be +changed using \fButimensat\fP(2) or \fBlutimes\fP(3). + +.\" Linux does not currently implement an lchmod(2). +.\" +.\" The +.\" 4.4BSD +.\" system differs from historical +.\" 4BSD +.\" systems in that the system call +.\" .BR chown (2) +.\" has been changed to follow symbolic links. +.\" The +.\" .BR lchown (2) +.\" system call was added later when the limitations of the new +.\" .BR chown (2) +.\" became apparent. +On Linux, the permissions of a symbolic link are not used in any operations; +the permissions are always 0777 (read, write, and execute for all user +categories), and can't be changed. +.SS "Handling of symbolic links by system calls and commands" +Symbolic links are handled either by operating on the link itself, or by +operating on the object referred to by the link. In the latter case, an +application or system call is said to \fIfollow\fP the link. Symbolic links +may refer to other symbolic links, in which case the links are dereferenced +until an object that is not a symbolic link is found, a symbolic link that +refers to a file which does not exist is found, or a loop is detected. +(Loop detection is done by placing an upper limit on the number of links +that may be followed, and an error results if this limit is exceeded.) + +There are three separate areas that need to be discussed. They are as +follows: +.IP 1. 3 +Symbolic links used as filename arguments for system calls. +.IP 2. +Symbolic links specified as command\-line arguments to utilities that are not +traversing a file tree. +.IP 3. +Symbolic links encountered by utilities that are traversing a file tree +(either specified on the command line or encountered as part of the file +hierarchy walk). +.SS "System calls" +The first area is symbolic links used as filename arguments for system +calls. + +Except as noted below, all system calls follow symbolic links. For example, +if there were a symbolic link \fIslink\fP which pointed to a file named +\fIafile\fP, the system call \fIopen("slink" ...\&)\fP would return a file +descriptor referring to the file \fIafile\fP. + +.\" Maybe one day: .BR fchownat (2) +Various system calls do not follow links, and operate on the symbolic link +itself. They are: \fBlchown\fP(2), \fBlgetxattr\fP(2), \fBllistxattr\fP(2), +\fBlremovexattr\fP(2), \fBlsetxattr\fP(2), \fBlstat\fP(2), \fBreadlink\fP(2), +\fBrename\fP(2), \fBrmdir\fP(2), and \fBunlink\fP(2). Certain other system calls +optionally follow symbolic links. They are: \fBfaccessat\fP(2), +\fBfchownat\fP(2), \fBfstatat\fP(2), \fBlinkat\fP(2), \fBopen\fP(2), \fBopenat\fP(2), and +\fButimensat\fP(2); see their manual pages for details. Because \fBremove\fP(3) +is an alias for \fBunlink\fP(2), that library function also does not follow +symbolic links. When \fBrmdir\fP(2) is applied to a symbolic link, it fails +with the error \fBENOTDIR\fP. The \fBlink\fP(2) warrants special discussion. +POSIX.1\-2001 specifies that \fBlink\fP(2) should dereference \fIoldpath\fP if it +is a symbolic link. However, Linux does not do this. (By default Solaris +is the same, but the POSIX.1\-2001 specified behavior can be obtained with +suitable compiler options.) The upcoming POSIX.1 revision changes the +specification to allow either behavior in an implementation. +.SS "Commands not traversing a file tree" +The second area is symbolic links, specified as command\-line filename +arguments, to commands which are not traversing a file tree. + +Except as noted below, commands follow symbolic links named as command\-line +arguments. For example, if there were a symbolic link \fIslink\fP which +pointed to a file named \fIafile\fP, the command \fIcat slink\fP would display the +contents of the file \fIafile\fP. + +It is important to realize that this rule includes commands which may +optionally traverse file trees, e.g., the command \fIchown file\fP is included +in this rule, while the command \fIchown\ \-R file\fP, which performs a tree +traversal, is not. (The latter is described in the third area, below.) + +If it is explicitly intended that the command operate on the symbolic link +instead of following the symbolic link, e.g., it is desired that \fIchown +slink\fP change the ownership of the file that \fIslink\fP is, whether it is a +symbolic link or not, the \fI\-h\fP option should be used. In the above +example, \fIchown root slink\fP would change the ownership of the file referred +to by \fIslink\fP, while \fIchown\ \-h root slink\fP would change the ownership of +\fIslink\fP itself. + +There are some exceptions to this rule: +.IP * 2 +The \fBmv\fP(1) and \fBrm\fP(1) commands do not follow symbolic links named as +arguments, but respectively attempt to rename and delete them. (Note, if +the symbolic link references a file via a relative path, moving it to +another directory may very well cause it to stop working, since the path may +no longer be correct.) +.IP * +The \fBls\fP(1) command is also an exception to this rule. For compatibility +with historic systems (when \fBls\fP(1) is not doing a tree walk, i.e., the +\fI\-R\fP option is not specified), the \fBls\fP(1) command follows symbolic links +named as arguments if the \fI\-H\fP or \fI\-L\fP option is specified, or if the +\fI\-F\fP, \fI\-d\fP, or \fI\-l\fP options are not specified. (The \fBls\fP(1) command is +the only command where the \fI\-H\fP and \fI\-L\fP options affect its behavior even +though it is not doing a walk of a file tree.) +.IP * +.\" +.\"The 4.4BSD system differs from historical 4BSD systems in that the +.\".BR chown (1) +.\"and +.\".BR chgrp (1) +.\"commands follow symbolic links specified on the command line. +The \fBfile\fP(1) command is also an exception to this rule. The \fBfile\fP(1) +command does not follow symbolic links named as argument by default. The +\fBfile\fP(1) command does follow symbolic links named as argument if the +\fI\-L\fP option is specified. +.SS "Commands traversing a file tree" +The following commands either optionally or always traverse file trees: +\fBchgrp\fP(1), \fBchmod\fP(1), \fBchown\fP(1), \fBcp\fP(1), \fBdu\fP(1), \fBfind\fP(1), +\fBls\fP(1), \fBpax\fP(1), \fBrm\fP(1), and \fBtar\fP(1). + +It is important to realize that the following rules apply equally to +symbolic links encountered during the file tree traversal and symbolic links +listed as command\-line arguments. + +The \fIfirst rule\fP applies to symbolic links that reference files other than +directories. Operations that apply to symbolic links are performed on the +links themselves, but otherwise the links are ignored. + +The command \fIrm\ \-r slink directory\fP will remove \fIslink\fP, as well as any +symbolic links encountered in the tree traversal of \fIdirectory\fP, because +symbolic links may be removed. In no case will \fBrm\fP(1) affect the file +referred to by \fIslink\fP. + +The \fIsecond rule\fP applies to symbolic links that refer to directories. +Symbolic links that refer to directories are never followed by default. +This is often referred to as a "physical" walk, as opposed to a "logical" +walk (where symbolic links the refer to directories are followed). + +Certain conventions are (should be) followed as consistently as possible by +commands that perform file tree walks: +.IP * 2 +A command can be made to follow any symbolic links named on the command +line, regardless of the type of file they reference, by specifying the \fI\-H\fP +(for "half\-logical") flag. This flag is intended to make the command\-line +name space look like the logical name space. (Note, for commands that do +not always do file tree traversals, the \fI\-H\fP flag will be ignored if the +\fI\-R\fP flag is not also specified.) + +For example, the command \fIchown\ \-HR user slink\fP will traverse the file +hierarchy rooted in the file pointed to by \fIslink\fP. Note, the \fI\-H\fP is not +the same as the previously discussed \fI\-h\fP flag. The \fI\-H\fP flag causes +symbolic links specified on the command line to be dereferenced for the +purposes of both the action to be performed and the tree walk, and it is as +if the user had specified the name of the file to which the symbolic link +pointed. +.IP * +A command can be made to follow any symbolic links named on the command +line, as well as any symbolic links encountered during the traversal, +regardless of the type of file they reference, by specifying the \fI\-L\fP (for +"logical") flag. This flag is intended to make the entire name space look +like the logical name space. (Note, for commands that do not always do file +tree traversals, the \fI\-L\fP flag will be ignored if the \fI\-R\fP flag is not +also specified.) + +For example, the command \fIchown\ \-LR user slink\fP will change the owner of +the file referred to by \fIslink\fP. If \fIslink\fP refers to a directory, +\fBchown\fP will traverse the file hierarchy rooted in the directory that it +references. In addition, if any symbolic links are encountered in any file +tree that \fBchown\fP traverses, they will be treated in the same fashion as +\fIslink\fP. +.IP * +A command can be made to provide the default behavior by specifying the +\fI\-P\fP (for "physical") flag. This flag is intended to make the entire name +space look like the physical name space. +.PP +For commands that do not by default do file tree traversals, the \fI\-H\fP, +\fI\-L\fP, and \fI\-P\fP flags are ignored if the \fI\-R\fP flag is not also specified. +In addition, you may specify the \fI\-H\fP, \fI\-L\fP, and \fI\-P\fP options more than +once; the last one specified determines the command's behavior. This is +intended to permit you to alias commands to behave one way or the other, and +then override that behavior on the command line. + +The \fBls\fP(1) and \fBrm\fP(1) commands have exceptions to these rules: +.IP * 2 +The \fBrm\fP(1) command operates on the symbolic link, and not the file it +references, and therefore never follows a symbolic link. The \fBrm\fP(1) +command does not support the \fI\-H\fP, \fI\-L\fP, or \fI\-P\fP options. +.IP * +To maintain compatibility with historic systems, the \fBls\fP(1) command acts +a little differently. If you do not specify the \fI\-F\fP, \fI\-d\fP or \fI\-l\fP +options, \fBls\fP(1) will follow symbolic links specified on the command +line. If the \fI\-L\fP flag is specified, \fBls\fP(1) follows all symbolic links, +regardless of their type, whether specified on the command line or +encountered in the tree walk. +.SH 関連項目 +\fBchgrp\fP(1), \fBchmod\fP(1), \fBfind\fP(1), \fBln\fP(1), \fBls\fP(1), \fBmv\fP(1), +\fBrm\fP(1), \fBlchown\fP(2), \fBlink\fP(2), \fBlstat\fP(2), \fBreadlink\fP(2), +\fBrename\fP(2), \fBsymlink\fP(2), \fBunlink\fP(2), \fButimensat\fP(2), \fBlutimes\fP(3), +\fBpath_resolution\fP(7) diff --git a/draft/man7/unicode.7 b/draft/man7/unicode.7 index 91e0f1bc..3a9d90a8 100644 --- a/draft/man7/unicode.7 +++ b/draft/man7/unicode.7 @@ -27,55 +27,23 @@ .\" 2001-05-11 Markus Kuhn .\" Update .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Thu Jun 3 20:36:31 JST 1997 -.\" by HANATAKA Shinya -.\" Updated & Modified Sat Jun 23 07:30:09 JST 2001 -.\" by Yuichi SATO +.\"******************************************************************* .\" -.\"WORD: -.\"WORD: diacritical mark 発音区別符号 -.\"WORD: International Phonetic Alphabet 国際音声字母 -.\"WORD: +.\" This file was generated with po4a. Translate the source file. .\" -.TH UNICODE 7 2001-05-11 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH UNICODE 7 2001\-05\-11 GNU "Linux Programmer's Manual" .SH 名前 -.\"O Unicode \- Universal character set Unicode \- 汎用文字集合 -.\"O .SH DESCRIPTION .SH 説明 -.\"O The international standard -.\"O .B ISO 10646 -.\"O defines the -.\"O .BR "Universal Character Set (UCS)" . -.\"O UCS contains all characters of all other character set standards. -.\"O It also guarantees -.\"O .BR "round-trip compatibility" , -.\"O i.e., conversion tables can be built such that no information is lost -.\"O when a string is converted from any other encoding to UCS and back. -国際規格 -.B ISO 10646 -は -.B "汎用文字集合 (Universal Character Set (UCS))" +国際規格 \fBISO 10646\fP は \fB汎用文字集合 (Universal Character Set (UCS))\fP を定義している。 UCS は他規格の文字集合の文字を全て含んでいる。 さらに、 -.B "双方向の互換性 (round-trip compatibility)" -を保証する。 +\fB双方向の互換性 (round\-trip compatibility)\fP を保証する。 例えば他の符号から UCS に変換しさらに元の符号に変換したとしても、 何の情報も失なわれないように変換テーブルを作成することができる。 -.\"O UCS contains the characters required to represent practically all -.\"O known languages. -.\"O This includes not only the Latin, Greek, Cyrillic, -.\"O Hebrew, Arabic, Armenian, and Georgian scripts, but also Chinese, -.\"O Japanese and Korean Han ideographs as well as scripts such as -.\"O Hiragana, Katakana, Hangul, Devanagari, Bengali, Gurmukhi, Gujarati, -.\"O Oriya, Tamil, Telugu, Kannada, Malayalam, Thai, Lao, Khmer, Bopomofo, -.\"O Tibetan, Runic, Ethiopic, Canadian Syllabics, Cherokee, Mongolian, -.\"O Ogham, Myanmar, Sinhala, Thaana, Yi, and others. UCS は現実的に知られている全ての言語を表現するのに必要な文字を含んでいる。 これにはラテン文字、ギリシャ文字、キリル文字、ヘブライ文字、アラビア文字、 アルメニア文字、グルジア文字だけでなく、中国・日本・韓国で使われている漢字、 @@ -87,152 +55,46 @@ UCS は現実的に知られている全ての言語を表現するのに必要 チェロキー文字、モンゴル文字、 オガム文字、ミャンマー文字、シンハラ文字、 ターナ文字、イ (彝) 文字などが含まれる。 -.\"O For scripts not yet -.\"O covered, research on how to best encode them for computer usage is -.\"O still going on and they will be added eventually. -.\"O This might -.\"O eventually include not only Hieroglyphs and various historic -.\"O Indo-European languages, but even some selected artistic scripts such -.\"O as Tengwar, Cirth, and Klingon. まだカバーされていない文字に付いても、 コンピュータで使用するために どのようなエンコードがもっとも良いかという研究が進められており、 最終的には追加されるだろう。 ヒエログリフや歴史的ないろいろなインド=ヨーロッパ言語だけでなく、 テングワール文字、キアス文字、クリンゴン文字などの人工的な言語も選ばれている。 -.\"O UCS also covers a large number of -.\"O graphical, typographical, mathematical and scientific symbols, -.\"O including those provided by TeX, Postscript, APL, MS-DOS, MS-Windows, -.\"O Macintosh, OCR fonts, as well as many word processing and publishing -.\"O systems, and more are being added. -UCS は、これらの文字に加えて、TeX, PostScript, APL, MS-DOS, MS-Windows, +UCS は、これらの文字に加えて、TeX, PostScript, APL, MS\-DOS, MS\-Windows, Macintosh, OCR フォント、数多くのワードプロセッサーや 出版システム、などが提供する 図形記号・印字記号・数学記号・科学記号などの多くを含むようになった。 -.\"O The UCS standard (ISO 10646) describes a -.\"O .I "31-bit character set architecture" -.\"O consisting of 128 24-bit -.\"O .IR groups , -.\"O each divided into 256 16-bit -.\"O .I planes -.\"O made up of 256 8-bit -.\"O .I rows -.\"O with 256 -.\"O .I column -.\"O positions, one for each character. -UCS 規格 (ISO 10646) は -.I "31ビットの文字集合アーキテクチャー" -を記述しており、128 個の 24 ビット -.IR 群 " (" group ) -から構成されている。 -各群は 256 個の 16 ビット -.IR 面 " (" plane ) -に分割されており、各文字は 256 個の 8 ビット -.IR 区 " (" row ) -の 256 -.IR 点 " (" column ) -の中に位置する。 -.\"O Part 1 of the standard -.\"O .RB ( "ISO 10646-1" ) -.\"O defines the first 65534 code positions (0x0000 to 0xfffd), which form -.\"O the -.\"O .IR "Basic Multilingual Plane (BMP)" , -.\"O that is plane 0 in group 0. -この規格の Part 1 -.RB ( "ISO 10646-1" ) -では、最初の 65534 個のコード位置 (0x0000 〜 0xfffd) を定義している。 -これは第 0 群の第 0 面である -.IR "基本多言語面 (Basic Multilingual Plane (BMP))" -を構成する。 -.\"O Part 2 of the standard -.\"O .RB ( "ISO 10646-2" ) -.\"O adds characters to group 0 outside the BMP in several -.\"O .I "supplementary planes" -.\"O in the range 0x10000 to 0x10ffff. -この規格の Part 2 -.RB ( "ISO 10646-2" ) -では、第 0 群の BMP の外部である -0x10000 〜 0x10ffff の範囲にある -.I "補助面" -に文字を追加した。 -.\"O There are no plans to add characters -.\"O beyond 0x10ffff to the standard, therefore of the entire code space, -.\"O only a small fraction of group 0 will ever be actually used in the -.\"O foreseeable future. +UCS 規格 (ISO 10646) は \fI31ビットの文字集合アーキテクチャー\fP を記述しており、 +128 個の 24 ビット \fI群 (group)\fP から構成されている。 +各群は 256 個の 16 ビット \fI面 (plane)\fP に分割されており、 +各文字は 256 個の 8 ビット \fI区 (row)\fP の 256 \fI点 (column)\fP の中に位置する。 +この規格の Part 1 (\fBISO 10646\-1\fP) では、 +最初の 65534 個のコード位置 (0x0000 〜 0xfffd) を定義している。 +これは第 0 群の第 0 面である \fI基本多言語面 (Basic Multilingual Plane (BMP))\fP を構成する。 +この規格の Part 2 (\fBISO 10646\-2\fP) では、第 0 群の BMP の外部である +0x10000 〜 0x10ffff の範囲にある \fI補助面 (supplementary planes)\fP に文字を追加した。 この規格では 0x10ffff を越えた位置に文字を追加する予定はないので、 予想できる将来においては、 全コード空間のうちグループ 0 の一部分は実際には使われることはない。 -.\"O The BMP contains all characters found in the -.\"O commonly used other character sets. -.\"O The supplemental planes added by -.\"O ISO 10646-2 cover only more exotic characters for special scientific, -.\"O dictionary printing, publishing industry, higher-level protocol and -.\"O enthusiast needs. BMP には他の文字集合で一般に使われる全ての文字が含まれている。 -ISO 10646-2 で追加された補助面は、 +ISO 10646\-2 で追加された補助面は、 特定の科学分野・辞書出版・印刷産業・高次プロトコル・ 何かのファンの間などで使われる特殊な文字だけをカバーする。 .PP -.\"O The representation of each UCS character as a 2-byte word is referred -.\"O to as the -.\"O .B UCS-2 -.\"O form (only for BMP characters), whereas -.\"O .B UCS-4 -.\"O is the representation of each character by a 4-byte word. -UCS 文字を 2 バイトのワードで表現するのが -.B UCS-2 -形式である (BMP 文字のみ)。 -また、 -.B UCS-4 -では文字を 4 バイトのワードで表現する。 -.\"O In addition, there exist two encoding forms -.\"O .B UTF-8 -.\"O for backward compatibility with ASCII processing software and -.\"O .B UTF-16 -.\"O for the backward compatible handling of non-BMP characters up to -.\"O 0x10ffff by UCS-2 software. +UCS 文字を 2 バイトのワードで表現するのが \fBUCS\-2\fP 形式である (BMP 文字のみ)。 +また、\fBUCS\-4\fP では文字を 4 バイトのワードで表現する。 さらに、ASCII を処理するソフトウェアへの下位互換のために -.B UTF-8 -エンコード形式がある。 -また、0x10ffff までの非 BMP 文字を扱う -UCS-2 対応ソフトウェアとの互換のために -.B UTF-16 -エンコード形式がある。 +\fBUTF\-8\fP エンコード形式がある。 +また、0x10ffff までの非 BMP 文字を扱う UCS\-2 対応ソフトウェアとの互換のために +\fBUTF\-16\fP エンコード形式がある。 .PP -.\"O The UCS characters 0x0000 to 0x007f are identical to those of the -.\"O classic -.\"O .B US-ASCII -.\"O character set and the characters in the range 0x0000 to 0x00ff -.\"O are identical to those in -.\"O .BR "ISO 8859-1 Latin-1" . -UCS 文字集合の 0x0000 から 0x007f は、古典的な -.B US-ASCII -文字集合の文字と同じである。 -また 0x0000 から 0x00ff の範囲では、 -.B ISO 8859-1 Latin-1 -文字集合の文字と同じである。 -.\"O .SS Combining Characters +UCS 文字集合の 0x0000 から 0x007f は、古典的な \fBUS\-ASCII\fP 文字集合の文字と同じである。 +また 0x0000 から 0x00ff の範囲では、\fBISO 8859\-1 Latin\-1\fP 文字集合の文字と同じである。 .SS "合成文字 (Combining Characters)" -.\"O Some code points in -.\"O .B UCS -.\"O have been assigned to -.\"O .IR "combining characters" . -.\"O These are similar to the nonspacing accent keys on a typewriter. -.\"O A combining character just adds an accent to the previous character. -.\"O The most important accented characters have codes of their own in UCS, -.\"O however, the combining character mechanism allows us to add accents -.\"O and other diacritical marks to any character. -.\"O The combining characters -.\"O always follow the character which they modify. -.\"O For example, the German -.\"O character Umlaut-A ("Latin capital letter A with diaeresis") can -.\"O either be represented by the precomposed UCS code 0x00c4, or -.\"O alternatively as the combination of a normal "Latin capital letter A" -.\"O followed by a "combining diaeresis": 0x0041 0x0308. -.B UCS -のいくつかのコード・ポイントは -.I "合成文字 (combining characters)" +\fBUCS\fP のいくつかのコード・ポイントは +\fI合成文字 (combining characters)\fP に割り当てられている。 これらはタイプライターの移動しないアクセント・キーに似ている。 合成文字は直前の文字にアクセントのみを加える。 @@ -245,182 +107,62 @@ UCS に前もって準備されたコード 0x00c4 でも、 "combining diaeresis (合成分音記号)" を続けた組合せ (0x0041 0x0308) のどちらでも表現することができる。 .PP -.\"O Combining characters are essential for instance for encoding the Thai -.\"O script or for mathematical typesetting and users of the International -.\"O Phonetic Alphabet. 合成文字は、タイ文字や数学植字のエンコード・ 国際音声字母を使うユーザーなどには必須である。 -.\"O .SS Implementation Levels .SS 実装レベル -.\"O As not all systems are expected to support advanced mechanisms like -.\"O combining characters, ISO 10646-1 specifies the following three -.\"O .I implementation levels -.\"O of UCS: 全てのシステムに合成文字のような進んだサポートを期待しているわけではない。 -ISO 10646-1 は以下の三段階の UCS の実装レベルを指定している。 -.TP 0.9i +ISO 10646\-1 は以下の三段階の UCS の \fI実装レベル\fP を指定している。 +.TP 0.9i Level 1 -.\"O Combining characters and -.\"O .B Hangul Jamo -.\"O (a variant encoding of the Korean script, where a Hangul syllable -.\"O glyph is coded as a triplet or pair of vovel/consonant codes) are not -.\"O supported. -合成文字と -.B ハングル・ジャモ文字 -(いろいろな韓国・朝鮮文字の符号化。 +合成文字と \fBハングル・ジャモ文字\fP (いろいろな韓国・朝鮮文字の符号化。 この符号化では、ハングル音節のグリフが 3 つまたは 2 つの母音・子音コードの組み合わせで符号化される) はサポートしない。 -.TP +.TP Level 2 -.\"O In addition to level 1, combining characters are now allowed for some -.\"O languages where they are essential (e.g., Thai, Lao, Hebrew, -.\"O Arabic, Devanagari, Malayalam, etc.). Level 1 と同様だが、合成文字を必須とする言語のための文字 (例えば、タイ文字・ラオス文字・ヘブライ文字・アラビア文字・ デーヴァナーガリー文字・マレヤーラム文字など) は使える。 -.TP +.TP Level 3 -.\"O All -.\"O .B UCS -.\"O characters are supported. -全ての -.B UCS -文字をサポートする。 +全ての \fBUCS\fP 文字をサポートする。 .PP -.\"O The -.\"O .B Unicode 3.0 Standard -.\"O published by the -.\"O .B Unicode Consortium -.\"O contains exactly the -.\"O .B UCS Basic Multilingual Plane -.\"O at implementation level 3, as described in ISO 10646-1:2000. -.B ユニコード・コンソーシアム (Unicode Consortium) -から発行された -.B Unicode 3.0 Standard -は、ISO 10646-1:2000 に記述された -.B UCS Basic Multilingual Plane +\fBユニコード・コンソーシアム (Unicode Consortium)\fP から発行された \fBUnicode 3.0 Standard\fP +は、ISO 10646\-1:2000 に記述された \fBUCS Basic Multilingual Plane\fP の level 3 実装と全く同じである。 -.\"O .B Unicode 3.1 -.\"O added the supplemental planes of ISO 10646-2. -.\"O The Unicode standard and -.\"O technical reports published by the Unicode Consortium provide much -.\"O additional information on the semantics and recommended usages of -.\"O various characters. -.\"O They provide guidelines and algorithms for -.\"O editing, sorting, comparing, normalizing, converting and displaying -.\"O Unicode strings. -.B Unicode 3.1 -では ISO 10646-2 の補助面が追加されている。 +\fBUnicode 3.1\fP では ISO 10646\-2 の補助面が追加されている。 Unicode Consortium から発行される Unicode 規格と技術レポートにより、 いろいろな文字の意味と推奨される使用法についての更なる情報が得られる。 これらの規格書や技術レポートで、Unicode 文字列を 編集・並べ替え・比較・正規化・変換・表示するための ガイドラインとアルゴリズムが分かる。 -.\"O .SS Unicode Under Linux .SS "Linux における Unicode" -.\"O Under GNU/Linux, the C type -.\"O .B wchar_t -.\"O is a signed 32-bit integer type. -.\"O Its values are always interpreted -.\"O by the C library as -.\"O .B UCS -.\"O code values (in all locales), a convention that is signaled by the GNU -.\"O C library to applications by defining the constant -.\"O .B __STDC_ISO_10646__ -.\"O as specified in the ISO C99 standard. -GNU/Linux では、C 言語の型 -.B wchar_t -は符号付き 32 ビット整数型である。 +GNU/Linux では、C 言語の型 \fBwchar_t\fP は符号付き 32 ビット整数型である。 その値は C ライブラリにより (すべてのロケールにおいて) 常に -.B UCS -コードの値として解釈される。 +\fBUCS\fP コードの値として解釈される。 これを GNU C ライブラリがアプリケーションに知らせるための規約として、 -定数 -.B __STDC_ISO_10646__ -を定義する。 +定数 \fB__STDC_ISO_10646__\fP を定義する。 これは ISO C99 規格で指定されている。 -.\"O UCS/Unicode can be used just like ASCII in input/output streams, -.\"O terminal communication, plaintext files, filenames, and environment -.\"O variables in the ASCII compatible -.\"O .B UTF-8 -.\"O multibyte encoding. -.\"O To signal the use of UTF-8 as the character -.\"O encoding to all applications, a suitable -.\"O .I locale -.\"O has to be selected via environment variables (e.g., -.\"O "LANG=en_GB.UTF-8"). -ASCII 互換の -.B UTF-8 -マルチバイトエンコードでは、入出力ストリーム・端末通信・ +ASCII 互換の \fBUTF\-8\fP マルチバイトエンコードでは、入出力ストリーム・端末通信・ プレーンテキストファイル・ファイル名・環境変数において、 UCS/Unicode を ASCII のように使うことができる。 -UTF-8 を文字エンコードとして使うことを +UTF\-8 を文字エンコードとして使うことを 全てのアプリケーションに知らせるためには、 -("LANG=en_GB.UTF-8" のように) 環境変数を使って適切な -.I ロケール (locale) -を選択しなければならない。 +("LANG=en_GB.UTF\-8" のように) 環境変数を使って適切な +\fIロケール (locale)\fP を選択しなければならない。 .PP -.\"O The -.\"O .B nl_langinfo(CODESET) -.\"O function returns the name of the selected encoding. -.\"O Library functions such as -.\"O .BR wctomb (3) -.\"O and -.\"O .BR mbsrtowcs (3) -.\"O can be used to transform the internal -.\"O .I wchar_t -.\"O characters and strings into the system character encoding and back -.\"O and -.\"O .BR wcwidth (3) -.\"O tells, how many positions (0\(en2) the cursor is advanced by the -.\"O output of a character. -.B nl_langinfo(CODESET) -関数は選択されたエンコードの名前を返す。 -内部的な -.I wchar_t -文字や文字列をシステム文字列エンコードに変換 (逆変換) するのに使われる -.BR wctomb (3) -や -.BR mbsrtowcs (3)、 -さらには -.BR wcwidth (3) -といったライブラリ関数は、 +\fBnl_langinfo(CODESET)\fP 関数は選択されたエンコードの名前を返す。 +内部的な \fIwchar_t\fP 文字や文字列をシステム文字列エンコードに変換 (逆変換) するのに使われる +\fBwctomb\fP(3) や \fBmbsrtowcs\fP(3)、さらには \fBwcwidth\fP(3) といったライブラリ関数は、 文字出力でどれだけカーソルが進んだか (0\(en2) を返す。 .PP -.\"O Under Linux, in general only the BMP at implementation level 1 should -.\"O be used at the moment. -.\"O Up to two combining characters per base -.\"O character for certain scripts (in particular Thai) are also supported -.\"O by some UTF-8 terminal emulators and ISO 10646 fonts (level 2), but in -.\"O general precomposed characters should be preferred where available -.\"O (Unicode calls this -.\"O .BR "Normalization Form C" ). -一般的に言うと、Linux では現在のところ -BMP の level 1 実装のみを使うべきである。 -ある言語の文字 (とくにタイ文字) では、 -ベース文字当たり 2 つまでの合成文字を使うことが -UTF-8 端末エミュレータと ISO 10646 フォント (level 2) でサポートされている。 +一般的に言うと、Linux では現在のところ BMP の level 1 実装のみを使うべきである。 +ある言語の文字 (とくにタイ文字) では、ベース文字当たり 2 つまでの合成文字を使うことが +UTF\-8 端末エミュレータと ISO 10646 フォント (level 2) でサポートされている。 しかし一般的に言えば、もし可能ならばあらかじめ合成した文字を使うべきである -(Unicode では、これを -.B "Normalization Form C (合成文字の正規化形式)" -という)。 -.\"O .SS Private Area +(Unicode では、これを \fBNormalization Form C (合成文字の正規化形式)\fP という)。 .SS プライベート・エリア -.\"O In the -.\"O .BR BMP , -.\"O the range 0xe000 to 0xf8ff will never be assigned to any characters by -.\"O the standard and is reserved for private usage. -.\"O For the Linux -.\"O community, this private area has been subdivided further into the -.\"O range 0xe000 to 0xefff which can be used individually by any end-user -.\"O and the Linux zone in the range 0xf000 to 0xf8ff where extensions are -.\"O coordinated among all Linux users. -.\"O The registry of the characters -.\"O assigned to the Linux zone is currently maintained by H. Peter Anvin -.\"O . -.B BMP -の 0xe000 〜 0xf8ff の範囲は、規格ではいかなる文字も割り当てず、 +\fBBMP\fP の 0xe000 〜 0xf8ff の範囲は、規格ではいかなる文字も割り当てず、 私的な使用のために予約されている。 Linux コミュニティでは、 このプライベート・エリアをさらに細かく分割して使用する。 @@ -429,112 +171,66 @@ Linux コミュニティでは、 全ての Linux ユーザーで共通に使用する。 Linux Zone への文字割り当ての登録は、 現在 H. Peter Anvin によって管理されている。 -.\"O .SS Literature .SS 文献 -.TP 0.2i +.TP 0.2i * -Information technology \(em Universal Multiple-Octet Coded Character -Set (UCS) \(em Part 1: Architecture and Basic Multilingual Plane. -International Standard ISO/IEC 10646-1, International Organization -for Standardization, Geneva, 2000. +Information technology \(em Universal Multiple\-Octet Coded Character Set +(UCS) \(em Part 1: Architecture and Basic Multilingual Plane. International +Standard ISO/IEC 10646\-1, International Organization for Standardization, +Geneva, 2000. -.\"O This is the official specification of -.\"O .BR UCS . -.\"O Available as a PDF file on CD-ROM from http://www.iso.ch/. -これは -.B UCS -の公式な仕様である。 -http://www.iso.ch/ から注文できる CD-ROM で PDF ファイルとして入手できる。 -.TP +これは \fBUCS\fP の公式な仕様である。 +http://www.iso.ch/ から注文できる CD\-ROM で PDF ファイルとして入手できる。 +.TP * -The Unicode Standard, Version 3.0. -The Unicode Consortium, Addison-Wesley, -Reading, MA, 2000, ISBN 0-201-61633-5. -.TP +The Unicode Standard, Version 3.0. The Unicode Consortium, Addison\-Wesley, +Reading, MA, 2000, ISBN 0\-201\-61633\-5. +.TP * -S. Harbison, G. Steele. C: A Reference Manual. Fourth edition, -Prentice Hall, Englewood Cliffs, 1995, ISBN 0-13-326224-3. +S. Harbison, G. Steele. C: A Reference Manual. Fourth edition, Prentice +Hall, Englewood Cliffs, 1995, ISBN 0\-13\-326224\-3. -.\"O A good reference book about the C programming language. -.\"O The fourth -.\"O edition covers the 1994 Amendment 1 to the ISO C90 standard, which -.\"O adds a large number of new C library functions for handling wide and -.\"O multibyte character encodings, but it does not yet cover ISO C99, -.\"O which improved wide and multibyte character support even further. C プログラム言語についてのとても良い参考書である。 第四版では、ワイド文字やマルチバイト文字エンコードを扱うための 多くの新しい C ライブラリ関数が 加えられた ISO C90 規格の 1994 Amendment 1 をカバーしている。 しかし、ワイド文字やマルチバイト文字のサポートを 更に改善した ISO C99 は、まだカバーしていない。 -.TP +.TP * -.\"O Unicode Technical Reports. Unicode 技術レポート。 .RS http://www.unicode.org/unicode/reports/ .RE -.TP +.TP * -.\"O Markus Kuhn: UTF-8 and Unicode FAQ for UNIX/Linux. -Markus Kuhn: UNIX/Linux のための UTF-8 と Unicode の FAQ。 +Markus Kuhn: UNIX/Linux のための UTF\-8 と Unicode の FAQ。 .RS http://www.cl.cam.ac.uk/~mgk25/unicode.html -.\"O Provides subscription information for the -.\"O .I linux-utf8 -.\"O mailing list, which is the best place to look for advice on using -.\"O Unicode under Linux. -.I linux-utf8 -メーリングリストを購読するための情報がある。 +\fIlinux\-utf8\fP メーリングリストを購読するための情報がある。 Linux で Unicode を使う場合のアドバイスを探すのに一番良い場所である。 .RE -.TP +.TP * Bruno Haible: Unicode HOWTO. .RS -ftp://ftp.ilog.fr/pub/Users/haible/utf8/Unicode-HOWTO.html +ftp://ftp.ilog.fr/pub/Users/haible/utf8/Unicode\-HOWTO.html .RE -.\"O .SH BUGS .SH バグ -.\"O When this man page was last revised, the GNU C Library support for -.\"O .B UTF-8 -.\"O locales was mature and XFree86 support was in an advanced state, but -.\"O work on making applications (most notably editors) suitable for use in -.\"O .B UTF-8 -.\"O locales was still fully in progress. -このマニュアル・ページを最後に改訂した時点で、 -GNU C ライブラリの -.B UTF-8 -サポートは完成している。 +.\" .SH AUTHOR +.\" Markus Kuhn +このマニュアルページを最後に改訂した時点で、 +GNU C ライブラリの \fBUTF\-8\fP サポートは完成している。 XFree86 によるサポートは進行中である。 -.B UTF-8 -ロケールで快適に使えるアプリケーション +\fBUTF\-8\fP ロケールで快適に使えるアプリケーション (多くの有名なエディタ) の作成は、まだ進行中である。 -.\"O Current general -.\"O .B UCS -.\"O support under Linux usually provides for CJK double-width characters -.\"O and sometimes even simple overstriking combining characters, but -.\"O usually does not include support for scripts with right-to-left -.\"O writing direction or ligature substitution requirements such as -.\"O Hebrew, Arabic, or the Indic scripts. -Linux での -.B UCS -サポートでは通常 CJK の 2 ワイド文字が提供される。 +Linux での \fBUCS\fP サポートでは通常 CJK の 2 ワイド文字が提供される。 単純な重ね打ちによる合成文字が提供される場合もある。 しかし、右から左へ書く文字やヘブライ文字・アラビア文字・インド語系文字などの 合字の置き換えを必要とする文字はサポートされていない。 -.\"O These scripts are currently only -.\"O supported in certain GUI applications (HTML viewers, word processors) -.\"O with sophisticated text rendering engines. 現在、これらの文字は洗練されたテキスト描画エンジンを備えた GUI アプリケーション (HTML ビューア・ワードプロセッサ) でのみ サポートされている。 -.\"O .\" .SH AUTHOR -.\" .SH 著者 -.\" Markus Kuhn -.\"O .SH SEE ALSO .SH 関連項目 -.BR setlocale (3), -.BR charsets (7), -.BR utf-8 (7) +\fBsetlocale\fP(3), \fBcharsets\fP(7), \fButf\-8\fP(7) diff --git a/draft/man7/units.7 b/draft/man7/units.7 index 5ce2dfb8..d3f49b80 100644 --- a/draft/man7/units.7 +++ b/draft/man7/units.7 @@ -1,4 +1,4 @@ -'\" t +.\" t .\" Copyright (C) 2001 Andries Brouwer .\" .\" Permission is granted to make and distribute verbatim copies of this @@ -21,59 +21,32 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved. -.\" Translated Wed 2 Jan 2002 by NAKANO Takeo +.\"******************************************************************* .\" -.TH UNITS 7 2001-12-22 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O units, kilo, kibi, mega, mebi, giga, gibi \- decimal and binary prefixes +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH UNITS 7 2001\-12\-22 Linux "Linux Programmer's Manual" .SH 名前 units, kilo, kibi, mega, mebi, giga, gibi \- 10 進および 2 進の接頭語 -.\"O .SH DESCRIPTION .SH 説明 -.\"O .SS Decimal prefixes -.SS 10 進の接頭語 -.\"O The SI system of units uses prefixes that indicate powers of ten. -.\"O A kilometer is 1000 meter, and a megawatt is 1000000 watt. -.\"O Below the standard prefixes. -SI 単位系では 10 の累乗を示す接頭語を用いる。 -キロメートルは 1000 メートル、メガワットは 1000000 ワットである。 +.SS "10 進の接頭語" +SI 単位系では 10 の累乗を示す接頭語を用いる。 キロメートルは 1000 メートル、メガワットは 1000000 ワットである。 次に標準的な接頭語を示す。 .RS .TS l l l. -.\"O Prefix Name Value 接頭語 名前 値 -.\"O y yocto 10^-24 = 0.000000000000000000000001 -.\"O z zepto 10^-21 = 0.000000000000000000001 -.\"O a atto 10^-18 = 0.000000000000000001 -.\"O f femto 10^-15 = 0.000000000000001 -.\"O p pico 10^-12 = 0.000000000001 -.\"O n nano 10^-9 = 0.000000001 -.\"O u micro 10^-6 = 0.000001 -.\"O m milli 10^-3 = 0.001 -.\"O c centi 10^-2 = 0.01 -.\"O d deci 10^-1 = 0.1 -.\"O da deka 10^ 1 = 10 -.\"O h hecto 10^ 2 = 100 -.\"O k kilo 10^ 3 = 1000 -.\"O M mega 10^ 6 = 1000000 -.\"O G giga 10^ 9 = 1000000000 -.\"O T tera 10^12 = 1000000000000 -.\"O P peta 10^15 = 1000000000000000 -.\"O E exa 10^18 = 1000000000000000000 -.\"O Z zetta 10^21 = 1000000000000000000000 -.\"O Y yotta 10^24 = 1000000000000000000000000 -y ヨクト(yocto) 10^-24 = 0.000000000000000000000001 -z ゼプト(zepto) 10^-21 = 0.000000000000000000001 -a アト(atto) 10^-18 = 0.000000000000000001 -f フェムト(femto) 10^-15 = 0.000000000000001 -p ピコ(pico) 10^-12 = 0.000000000001 -n ナノ(nano) 10^-9 = 0.000000001 -u マイクロ(micro) 10^-6 = 0.000001 -m ミリ(milli) 10^-3 = 0.001 -c センチ(centi) 10^-2 = 0.01 -d デシ(deci) 10^-1 = 0.1 +y ヨクト(yocto) 10^\-24 = 0.000000000000000000000001 +z ゼプト(zepto) 10^\-21 = 0.000000000000000000001 +a アト(atto) 10^\-18 = 0.000000000000000001 +f フェムト(femto) 10^\-15 = 0.000000000000001 +p ピコ(pico) 10^\-12 = 0.000000000001 +n ナノ(nano) 10^\-9 = 0.000000001 +u マイクロ(micro) 10^\-6 = 0.000001 +m ミリ(milli) 10^\-3 = 0.001 +c センチ(centi) 10^\-2 = 0.01 +d デシ(deci) 10^\-1 = 0.1 da デカ(deka) 10^ 1 = 10 h ヘクト(hecto) 10^ 2 = 100 k キロ(kilo) 10^ 3 = 1000 @@ -86,43 +59,20 @@ Z ゼタ(zetta) 10^21 = 1000000000000000000000 Y ヨタ(yotta) 10^24 = 1000000000000000000000000 .TE .RE -.\"O -.sp -.\"O The symbol for micro is the Greek letter mu, often written u -.\"O in an ASCII context where this Greek letter is not available. -.\"O See also -マイクロの記号はギリシャ文字のμであるが、 -ASCII でテキストが記述されていて、ギリシャ文字が使えない場合は -u と書かれることが多い。 + +マイクロの記号はギリシャ文字のμであるが、 ASCII でテキストが記述されていて、ギリシャ文字が使えない場合は u と書かれることが多い。 +以下も参考にしてほしい。 .sp .RS http://physics.nist.gov/cuu/Units/prefixes.html .RE -.sp -も参考にしてほしい。 -.\"O .SS Binary prefixes -.SS 2 進の接頭語 -.\"O The binary prefixes resemble the decimal ones, -.\"O but have an additional \(aqi\(aq -.\"O (and "Ki" starts with a capital \(aqK\(aq). -.\"O The names are formed by taking the -.\"O first syllable of the names of the decimal prefix with roughly the same -.\"O size, followed by "bi" for "binary". -2 進の接頭語は 10 進の接頭語と似ているが、後ろに \(aqi\(aq が付く -(また "Ki" については大文字の \(aqK\(aq) で始まる)。 -名前は、だいたい同じくらいの 10 進接頭語の最初の音節に、 -2 進数であることを意味する "bi" を足したものになる。 +.SS "2 進の接頭語" +2 進の接頭語は 10 進の接頭語と似ているが、後ろに \(aqi\(aq が付く (また "Ki" については大文字の \(aqK\(aq) +で始まる)。 名前は、だいたい同じくらいの 10 進接頭語の最初の音節に、 2 進数であることを意味する "bi" を足したものになる。 .RS .TS l l l. -.\"O Prefix Name Value 接頭語 名前 値 -.\"O Ki kibi 2^10 = 1024 -.\"O Mi mebi 2^20 = 1048576 -.\"O Gi gibi 2^30 = 1073741824 -.\"O Ti tebi 2^40 = 1099511627776 -.\"O Pi pebi 2^50 = 1125899906842624 -.\"O Ei exbi 2^60 = 1152921504606846976 Ki キビ(kibi) 2^10 = 1024 Mi メビ(mebi) 2^20 = 1048576 Gi ギビ(gibi) 2^30 = 1073741824 @@ -131,76 +81,34 @@ Pi ペビ(pebi) 2^50 = 1125899906842624 Ei エクシビ(exbi) 2^60 = 1152921504606846976 .TE .RE -.\"O -.\"O See also -.sp -.RS + http://physics.nist.gov/cuu/Units/binary.html -.RE .sp +.RS も参考にしてほしい。 -.\"O .SS Discussion +.RE .SS 考察 -.\"O Before these binary prefixes were introduced, it was fairly -.\"O common to use k=1000 and K=1024, just like b=bit, B=byte. -.\"O Unfortunately, the M is capital already, and cannot be -.\"O capitalized to indicate binary-ness. -これらの 2 進の接頭語が導入される前は、 -k=1000 と K=1024 のように使うのが割に良く知られた習慣だった -(b=ビット、B=バイト の関係に似ている)。 -残念ながら M は最初から大文字なので、 -2 進であることを示すためにさらに大文字にすることはできなかった。 +これらの 2 進の接頭語が導入される前は、 k=1000 と K=1024 のように使うのが割に良く知られた習慣だった (b=ビット、B=バイト +の関係に似ている)。 残念ながら M は最初から大文字なので、 2 進であることを示すためにさらに大文字にすることはできなかった。 -.\"O At first that didn't matter too much, since memory modules -.\"O and disks came in sizes that were powers of two, so everyone -.\"O knew that in such contexts "kilobyte" and "megabyte" meant -.\"O 1024 and 1048576 bytes, respectively. -.\"O What originally was a -.\"O sloppy use of the prefixes "kilo" and "mega" started to become -.\"O regarded as the "real true meaning" when computers were involved. -.\"O But then disk technology changed, and disk sizes became arbitrary numbers. -.\"O After a period of uncertainty all disk manufacturers settled on the -.\"O standard, namely k=1000, M=1000k, G=1000M. -当初はこのことはあまり大きな問題ではなかった。 -なぜならメモリモジュールやディスクは 2 の累乗になるものだったので、 -皆そのようなところでは「キロバイト」を 1024 バイト、 -「メガバイト」を 1048576 バイトであるとみなしていたからである。 -最初は接頭語の「キロ」とか「メガ」を曖昧に援用していたのだが、 -そのうちコンピュータに関連する話題では、こちらが「実際の意味」になっていった。 -しかしその後ディスクのテクノロジーが代わり、 -ディスクサイズは任意の数値をとるようになった。 -どっちつかずの時期がしばらく続いたあと、 -ディスクのメーカーすべてが、標準を使うことに合意した。 -すなわち k=1000, M=1000k, G=1000M である。 +当初はこのことはあまり大きな問題ではなかった。 なぜならメモリモジュールやディスクは 2 の累乗になるものだったので、 +皆そのようなところでは「キロバイト」を 1024 バイト、 「メガバイト」を 1048576 バイトであるとみなしていたからである。 +最初は接頭語の「キロ」とか「メガ」を曖昧に援用していたのだが、 そのうちコンピュータに関連する話題では、こちらが「実際の意味」になっていった。 +しかしその後ディスクのテクノロジーが代わり、 ディスクサイズは任意の数値をとるようになった。 どっちつかずの時期がしばらく続いたあと、 +ディスクのメーカーすべてが、標準を使うことに合意した。 すなわち k=1000, M=1000k, G=1000M である。 -.\"O The situation was messy: in the 14k4 modems, k=1000; in the 1.44MB -.\"O .\" also common: 14.4k modem -.\"O diskettes, M=1024000; etc. -.\"O In 1998 the IEC approved the standard -.\"O that defines the binary prefixes given above, enabling people -.\"O to be precise and unambiguous. -状況はひどくなった。14.4k モデムでは k=1000, -1.44MB フロッピーでは M=1024000 になった。 -1998 年に、IEC は上記のような 2 進用の接頭語を承認し、 -これによって両者をはっきり区別することが可能になった。 +.\" also common: 14.4k modem +状況はひどくなった。14.4k モデムでは k=1000, 1.44MB フロッピーでは M=1024000 になった。 1998 年に、IEC +は上記のような 2 進用の接頭語を承認し、 これによって両者をはっきり区別することが可能になった。 -.\"O Thus, today, MB = 1000000B and MiB = 1048576B. したがって今日では、MB=1000000B で、MiB = 1048576B なのである。 -.\"O In the free software world programs are slowly -.\"O being changed to conform. -.\"O When the Linux kernel boots and says -フリーソフトウェアの世界でも、 -プログラムたちはゆっくりとこれらに準拠してきている。 -Linux カーネルは、ブートすると次のようなメッセージを出す。 -.\"O -.sp +フリーソフトウェアの世界でも、 プログラムたちはゆっくりとこれらに準拠してきている。 Linux カーネルは、ブートすると次のようなメッセージを出す。 + .RS .nf hda: 120064896 sectors (61473 MB) w/2048KiB Cache .fi .RE -.\"O -.sp -.\"O the MB are megabytes and the KiB are kibibytes. + MB はメガバイトで、KiB はキビバイトである。 diff --git a/draft/man7/utf-8.7 b/draft/man7/utf-8.7 index 17398730..e2a720e2 100644 --- a/draft/man7/utf-8.7 +++ b/draft/man7/utf-8.7 @@ -27,299 +27,120 @@ .\" 2001-05-11 Markus Kuhn .\" Update .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated Thu Jun 3 20:40:01 JST 1997 -.\" by HANATAKA Shinya -.\" Updated (add SECURITY section) & modified Mon Feb 26 2001 -.\" by NAKANO Takeo -.\" Updated & Modified Sun Jul 1 09:28:47 JST 2001 -.\" by Yuichi SATO +.\"******************************************************************* .\" -.TH UTF-8 7 2001-05-11 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O UTF-8 \- an ASCII compatible multibyte Unicode encoding +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH UTF\-8 7 2001\-05\-11 GNU "Linux Programmer's Manual" .SH 名前 -UTF-8 \- ASCII と互換性のある多バイト Unicode の符号化 -.\"O .SH DESCRIPTION +UTF\-8 \- ASCII と互換性のある多バイト Unicode の符号化 .SH 説明 -.\"O The -.\"O .B Unicode 3.0 -.\"O character set occupies a 16-bit code space. -.\"O The most obvious -.\"O Unicode encoding (known as -.\"O .BR UCS-2 ) -.\"O consists of a sequence of 16-bit words. -.\"O Such strings can contain as -.\"O parts of many 16-bit characters bytes -.\"O like \(aq\\0\(aq or \(aq/\(aq which have a -.\"O special meaning in filenames and other C library function arguments. -.\"O In addition, the majority of UNIX tools expects ASCII files and can't -.\"O read 16-bit words as characters without major modifications. -.\"O For these reasons, -.\"O .B UCS-2 -.\"O is not a suitable external encoding of -.\"O .B Unicode -.\"O in filenames, text files, environment variables, etc. -.\"O The -.\"O .BR "ISO 10646 Universal Character Set (UCS)" , -.\"O a superset of Unicode, occupies even a 31-bit code space and the obvious -.\"O .B UCS-4 -.\"O encoding for it (a sequence of 32-bit words) has the same problems. -.B "ユニコード (Unicode) 3.0" -文字集合は 16 ビットのコード空間を占める。 -最も単純な Unicode の符号化方法 -.RB ( UCS-2 ) +\fBユニコード (Unicode) 3.0\fP 文字集合は 16 ビットのコード空間を占める。 +最も単純な Unicode の符号化方法 (\fBUCS\-2\fP) では、文字は 16 ビット・ワード (16 ビット文字の列) で構成される。 この列には、 -\(aq\\0\(aq や \(aq/\(aq のような (ファイル名や C のライブラリ関数の引き数の内部で) +\(aq\e0\(aq や \(aq/\(aq のような (ファイル名や C のライブラリ関数の引き数の内部で) 特殊な意味を持つ 16 ビット文字が含まれることがある。 さらに、ほとんどの UNIX ツールは ASCII ファイルを入力として期待するので、 大幅な変更なしには 16 ビットワードを文字として読むことができない。 -これらの理由から、 -.B UCS-2 -はファイル名・テキストファイル・環境変数などに用いる、外部用の -.B Unicode -符号としては不適切である。 +これらの理由から、\fBUCS\-2\fP はファイル名・テキストファイル・環境変数などに用いる、 +外部用の \fBUnicode\fP 符号としては不適切である。 Unicode のスーパーセットである -.B "ISO 10646 Universal Character Set (UCS)" +\fBISO 10646 Universal Character Set (UCS)\fP は 31 ビットのコード空間を占めるが、その最も単純な符号化である -.B UCS-4 -にも (32 ビット・ワードの列として) 同じ問題がある。 -.PP -.\"O The -.\"O .B UTF-8 -.\"O encoding of -.\"O .B Unicode -.\"O and -.\"O .B UCS -.\"O does not have these problems and is the common way in which -.\"O .B Unicode -.\"O is used on UNIX-style operating systems. -.B Unicode -と -.B UCS -の -.B UTF-8 -符号化にはこれらの問題がないので、UNIX 形式の OS 上で -.B Unicode -文字集合を使用するための一般的な方法となっている。 -.\"O .SS Properties +\fBUCS\-4\fP にも (32 ビット・ワードの列として) 同じ問題がある。 + +\fBUnicode\fP と \fBUCS\fP の \fBUTF\-8\fP 符号化にはこれらの問題がないので、 +UNIX 形式の OS 上で \fBUnicode\fP 文字集合を使用するための一般的な方法となっている。 .SS 性質 -.\"O The -.\"O .B UTF-8 -.\"O encoding has the following nice properties: -.B UTF-8 -符号化は以下のような素晴しい性質を備えている: -.TP 0.2i +\fBUTF\-8\fP 符号化は以下のような素晴しい性質を備えている: +.TP 0.2i * -.\"O .B UCS -.\"O characters 0x00000000 to 0x0000007f (the classic -.\"O .B US-ASCII -.\"O characters) are encoded simply as bytes 0x00 to 0x7f (ASCII -.\"O compatibility). -.\"O This means that files and strings which contain only -.\"O 7-bit ASCII characters have the same encoding under both -.\"O .B ASCII -.\"O and -.\"O .BR UTF-8 . -.B UCS -文字のうち 0x00000000 から 0x0000007f まで (古典的な -.B US-ASCII -の文字) は (ASCII との互換性のために) 単純に 0x00 から 0x7f のバイトに -符号化する。これは 7 ビット ASCII 文字のみを含むファイルや文字列に -関しては、 -.B ASCII -と -.B UTF-8 -で同じ符号化を行なうことを意味する。 -.TP +\fBUCS\fP 文字のうち 0x00000000 から 0x0000007f まで (古典的な \fBUS\-ASCII\fP の文字) は +(ASCII との互換性のために) 単純に 0x00 から 0x7f のバイトに符号化する。 +これは 7 ビット ASCII 文字のみを含むファイルや文字列に関しては、 +\fBASCII\fP と \fBUTF\-8\fP で同じ符号化を行なうことを意味する。 +.TP * -.\"O All -.\"O .B UCS -.\"O characters greater than 0x7f are encoded as a multibyte sequence -.\"O consisting only of bytes in the range 0x80 to 0xfd, so no ASCII -.\"O byte can appear as part of another character and there are no -.\"O problems with, for example, \(aq\\0\(aq or \(aq/\(aq. 0x7f より大きいのすべての -.B UCS -文字は、 0x80 から 0xfd までの範囲のバイトのみを含む +\fBUCS\fP 文字は、 0x80 から 0xfd までの範囲のバイトのみを含む 多バイト文字列に符号化される。 したがって文字列に -ASCII バイトが含まれることがなく、\(aq\\0\(aq や \(aq/\(aq の問題は発生しない。 -.TP +ASCII バイトが含まれることがなく、\(aq\e0\(aq や \(aq/\(aq の問題は発生しない。 +.TP * -.\"O The lexicographic sorting order of -.\"O .B UCS-4 -.\"O strings is preserved. -.B UCS-4 +\fBUCS\-4\fP 文字列では辞書的ソートの順序が保たれる。 -.TP +.TP * -.\"O All possible 2^31 UCS codes can be encoded using -.\"O .BR UTF-8 . -2^31 ビットのすべての UCS コード が -.B UTF-8 -を使用して符号化できる。 -.TP +2^31 ビットのすべての UCS コード が \fBUTF\-8\fP を使用して符号化できる。 +.TP * -.\"O The bytes 0xfe and 0xff are never used in the -.\"O .B UTF-8 -.\"O encoding. -.B UTF-8 -符号化では 0xfe と 0xff のバイトは絶対に使用しない。 -.TP +\fBUTF\-8\fP 符号化では 0xfe と 0xff のバイトは絶対に使用しない。 +.TP * -.\"O The first byte of a multibyte sequence which represents a single non-ASCII -.\"O .B UCS -.\"O character is always in the range 0xc0 to 0xfd and indicates how long -.\"O this multibyte sequence is. -.\"O All further bytes in a multibyte sequence -.\"O are in the range 0x80 to 0xbf. -.\"O This allows easy resynchronization and -.\"O makes the encoding stateless and robust against missing bytes. -ASCII でない -.B UCS -文字の多バイト列の最初のバイトは、 +ASCII でない \fBUCS\fP 文字の多バイト列の最初のバイトは、 常に 0xc0 から 0xfd の範囲で表現され、 その文字が何バイトで構成されているかを示す。 多バイト列の残りの部分のバイトは、それぞれ 0x80 から 0xbf の範囲にある。 これにより同期が容易になり、ステートレスな符号化が可能になり、 バイトの紛失に対して堅固になる。 -.TP +.TP * -.\"O .B UTF-8 -.\"O encoded -.\"O .B UCS -.\"O characters may be up to six bytes long, however the -.\"O .B Unicode -.\"O standard specifies no characters above 0x10ffff, so Unicode characters -.\"O can only be up to four bytes long in -.\"O .BR UTF-8 . -.B UTF-8 -を使用した -.B UCS -文字の符号化は最大 6 バイトの長さになる。 -しかし、 -.B Unicode -規格では 0x10ffff より先の文字を指定しないので、Unicode 文字は -.B UTF-8 -では 4 バイトまでにしかならない。 -.\"O .SS Encoding +\fBUTF\-8\fP を使用した \fBUCS\fP 文字の符号化は最大 6 バイトの長さになる。 +しかし、\fBUnicode\fP 規格では 0x10ffff より先の文字を指定しないので、 +Unicode 文字は \fBUTF\-8\fP では 4 バイトまでにしかならない。 .SS 符号化 -.\"O The following byte sequences are used to represent a character. -.\"O The sequence to be used depends on the UCS code number of the character: 以下のバイト列が文字の表現に使用される。 どのバイト列を使用するかは文字の UCS コード番号に依存する: -.TP 0.4i +.TP 0.4i 0x00000000 \- 0x0000007F: -.RI 0 xxxxxxx -.TP +0\fIxxxxxxx\fP +.TP 0x00000080 \- 0x000007FF: -.RI 110 xxxxx -.RI 10 xxxxxx -.TP +110\fIxxxxx\fP 10\fIxxxxxx\fP +.TP 0x00000800 \- 0x0000FFFF: -.RI 1110 xxxx -.RI 10 xxxxxx -.RI 10 xxxxxx -.TP +1110\fIxxxx\fP 10\fIxxxxxx\fP 10\fIxxxxxx\fP +.TP 0x00010000 \- 0x001FFFFF: -.RI 11110 xxx -.RI 10 xxxxxx -.RI 10 xxxxxx -.RI 10 xxxxxx -.TP +11110\fIxxx\fP 10\fIxxxxxx\fP 10\fIxxxxxx\fP 10\fIxxxxxx\fP +.TP 0x00200000 \- 0x03FFFFFF: -.RI 111110 xx -.RI 10 xxxxxx -.RI 10 xxxxxx -.RI 10 xxxxxx -.RI 10 xxxxxx -.TP +111110\fIxx\fP 10\fIxxxxxx\fP 10\fIxxxxxx\fP 10\fIxxxxxx\fP 10\fIxxxxxx\fP +.TP 0x04000000 \- 0x7FFFFFFF: -.RI 1111110 x -.RI 10 xxxxxx -.RI 10 xxxxxx -.RI 10 xxxxxx -.RI 10 xxxxxx -.RI 10 xxxxxx +1111110\fIx\fP 10\fIxxxxxx\fP 10\fIxxxxxx\fP 10\fIxxxxxx\fP 10\fIxxxxxx\fP 10\fIxxxxxx\fP .PP -.\"O The -.\"O .I xxx -.\"O bit positions are filled with the bits of the character code number in -.\"O binary representation. -.\"O Only the shortest possible multibyte sequence -.\"O which can represent the code number of the character can be used. -.I xxx -ビットの部分には 2 進数で表わした文字コードのビット部分が対応する。 +\fIxxx\fP ビットの部分には 2 進数で表わした文字コードのビット部分が対応する。 その文字を表現するのに最も短いバイト列のみが使用できる。 .PP -.\"O The -.\"O .B UCS -.\"O code values 0xd800\(en0xdfff (UTF-16 surrogates) as well as 0xfffe and -.\"O 0xffff (UCS noncharacters) should not appear in conforming -.\"O .B UTF-8 -.\"O streams. -0xd800\(en0xdfff (UTF-16 サロゲート) や -0xfffe, 0xffff (UCS の noncharacter) という -.B UCS -コードの値は、 -.B UTF-8 -に準拠したストリームに入れるべきではない。 -.\"O .SS Example +0xd800\(en0xdfff (UTF\-16 サロゲート) や +0xfffe, 0xffff (UCS の noncharacter) という \fBUCS\fP コードの値は、 +\fBUTF\-8\fP に準拠したストリームに入れるべきではない。 .SS 例 -.\"O .B Unicode -.\"O character 0xa9 = 1010 1001 (the copyright sign) is encoded -.\"O in UTF-8 as -.B Unicode -文字の 0xa9 = 1010 1001 (コピーライト・マーク) は UTF-8 で符号化すると -.sp +\fBUnicode\fP 文字の 0xa9 = 1010 1001 (コピーライト・マーク) は UTF\-8 で符号化すると +以下のようになる。 +.PP .RS 11000010 10101001 = 0xc2 0xa9 .RE -.sp -になる。 .PP -.\"O and character 0x2260 = 0010 0010 0110 0000 (the "not equal" symbol) is -.\"O encoded as: -0x2260 = 0010 0010 0110 0000 (不等号) は -.sp +0x2260 = 0010 0010 0110 0000 (不等号) は以下の通り。 +.PP .RS 11100010 10001001 10100000 = 0xe2 0x89 0xa0 .RE -.sp -になる。 -.\"O .SS Application Notes .SS アプリケーションにおける注意 -.\"O Users have to select a -.\"O .B UTF-8 -.\"O locale, for example with -.\"O .PP -.\"O .RS -.\"O export LANG=en_GB.UTF-8 -.\"O .RE -.\"O .PP -.\"O in order to activate the -.\"O .B UTF-8 -.\"O support in applications. -ユーザーはアプリケーションの -.B UTF-8 -サポートを有効にするために、以下のようにして -.B UTF-8 -ロケールを選択しなければならない。 +ユーザーはアプリケーションの \fBUTF\-8\fP サポートを有効にするために、 .PP .RS -export LANG=en_GB.UTF-8 +export LANG=en_GB.UTF\-8 .RE .PP -.\"O Application software that has to be aware of the used character -.\"O encoding should always set the locale with for example -.\"O .PP -.\"O .RS -.\"O setlocale(LC_CTYPE, "") -.\"O .RE -.\"O .PP +のようにして \fBUTF\-8\fP ロケールを選択しなければならない。 +.PP 使用されている文字符号化を分かっていなければならない アプリケーションソフトウェアは、 以下のようにして常にロケールを設定すべきである。 @@ -328,168 +149,58 @@ export LANG=en_GB.UTF-8 setlocale(LC_CTYPE, "") .RE .PP -.\"O and programmers can then test the expression -.\"O .PP -.\"O .RS -.\"O strcmp(nl_langinfo(CODESET), "UTF-8") == 0 -.\"O .RE -.\"O .PP -.\"O to determine whether a -.\"O .B UTF-8 -.\"O locale has been selected and whether -.\"O therefore all plaintext standard input and output, terminal -.\"O communication, plaintext file content, filenames and environment -.\"O variables are encoded in -.\"O .BR UTF-8 . -また -.B UTF-8 -ロケールが選択されていて、プレーンテキストの標準入出力・端末間通信・ -プレーンテキストファイルの内容・ファイル名・環境変数が -.B UTF-8 -で符号化されているかをチェックするために、 -プログラマーは以下のような式を試すことができる。 +また、プログラマーは .PP .RS -strcmp(nl_langinfo(CODESET), "UTF-8") == 0 +strcmp(nl_langinfo(CODESET), "UTF\-8") == 0 .RE .PP -.\"O Programmers accustomed to single-byte encodings such as -.\"O .B US-ASCII -.\"O or -.\"O .B ISO 8859 -.\"O have to be aware that two assumptions made so far are no longer valid -.\"O in -.\"O .B UTF-8 -.\"O locales. -.B US-ASCII -や -.B ISO 8859 +という式を評価することで、 +\fBUTF\-8\fP ロケールが選択されていて、プレーンテキストの標準入出力・端末間通信・ +プレーンテキストファイルの内容・ファイル名・環境変数が +\fBUTF\-8\fP で符号化されているかをチェックすることができる。 +.PP +\fBUS\-ASCII\fP や \fBISO 8859\fP といったシングルバイトの符号化が習慣になっているプログラマーは、 これまでの 2 つの仮定が -.B UTF-8 -ロケールにおいては最早有効ではなくなったことを知っておくべきだ。 -.\"O Firstly, a single byte does not necessarily correspond any -.\"O more to a single character. +\fBUTF\-8\fP ロケールにおいては最早有効ではなくなったことを知っておくべきだ。 1 番目の変更点は、1 バイトが必ずしも 1 つの文字に対応しないという点である。 -.\"O Secondly, since modern terminal emulators -.\"O in -.\"O .B UTF-8 -.\"O mode also support Chinese, Japanese, and Korean -.\"O .B double-width characters -.\"O as well as nonspacing -.\"O .BR "combining characters" , -.\"O outputting a single character does not necessarily advance the cursor -.\"O by one position as it did in -.\"O .BR ASCII . 2 番目の変更点は、最近の端末エミュレータは -.B UTF-8 -モードにおいて中国語・日本語・韓国朝鮮語の -.B 全角文字 -やスペースが入らない (nonspacing) -.B "合成文字 (combining characters)" -に対応しているので、 -.B ASCII -のときのように 1 文字出力した後で +\fBUTF\-8\fP モードにおいて中国語・日本語・韓国朝鮮語の +\fB全角文字\fP やスペースが入らない (nonspacing) +\fB合成文字 (combining characters)\fP に対応しているので、 +\fBASCII\fP のときのように 1 文字出力した後で カーソルを必ずしも 1 つだけ進めるわけではないという点である。 -.\"O Library functions such as -.\"O .BR mbsrtowcs (3) -.\"O and -.\"O .BR wcswidth (3) -.\"O should be used today to count characters and cursor positions. 今日では、文字やカーソルの位置を数えるのに -.BR mbsrtowcs (3) -や -.BR wcswidth (3) +\fBmbsrtowcs\fP(3) や \fBwcswidth\fP(3) といったライブラリ関数を使うべきである。 .PP -.\"O The official ESC sequence to switch from an -.\"O .B ISO 2022 -.\"O encoding scheme (as used for instance by VT100 terminals) to -.\"O .B UTF-8 -.\"O is ESC % G -.\"O ("\\x1b%G"). -.\"O The corresponding return sequence from -.\"O .B UTF-8 -.\"O to ISO 2022 is ESC % @ ("\\x1b%@"). -.\"O Other ISO 2022 sequences (such as -.\"O for switching the G0 and G1 sets) are not applicable in UTF-8 mode. -(VT100 端末などで使われる) -.B ISO 2022 -符号化形式から -.B UTF-8 -へ切替える公式なエスケープシーケンスは ESC % G ("\\x1b%G") である。 -これに対応する -.B UTF-8 -から -.B ISO 2022 -へのリターンシーケンスは ESC % @ ("\\x1b%@") である。 +(VT100 端末などで使われる) \fBISO 2022\fP 符号化形式から +\fBUTF\-8\fP へ切替える公式なエスケープシーケンスは ESC % G ("\x1b%G") である。 +これに対応する \fBUTF\-8\fP から \fBISO 2022\fP へのリターンシーケンスは +ESC % @ ("\x1b%@") である。 (G0 セットと G1 セットを切替えるといった) -その他の ISO 2022 シーケンスは、UTF-8 モードでは使えない。 +その他の ISO 2022 シーケンスは、UTF\-8 モードでは使えない。 .PP -.\"O It can be hoped that in the foreseeable future, -.\"O .B UTF-8 -.\"O will replace -.\"O .B ASCII -.\"O and -.\"O .B ISO 8859 -.\"O at all levels as the common character encoding on POSIX systems, -.\"O leading to a significantly richer environment for handling plain text. 予知できる将来では、POSIX システム上の一般的な文字符号化の全てのレベルで -.B UTF-8 -が -.B ASCII -と -.B ISO 8859 -を置き換え、プレーンテキストを扱う非常に優れた環境が作られることが期待できる。 -.\"O .SS Security +\fBUTF\-8\fP が \fBASCII\fP と \fBISO 8859\fP を置き換え、 +プレーンテキストを扱う非常に優れた環境が作られることが期待できる。 .SS セキュリティ -.\"O The -.\"O .BR Unicode " and " UCS -.\"O standards require that producers of -.\"O .B UTF-8 -.\"O shall use the shortest form possible, for example, producing a two-byte -.\"O sequence with first byte 0xc0 is nonconforming. -.BR Unicode " と " UCS -の規格では、 -.B UTF-8 -の生成者はできるだけ短い形式を用いるよう要求している。 +\fBUnicode\fP と \fBUCS\fP の規格では、 +\fBUTF\-8\fP の生成者はできるだけ短い形式を用いるよう要求している。 例えば、先頭バイトが 0xc0 であるような 2 バイト列を 生成するのは準拠しているとはいえない。 -.\"O .B Unicode 3.1 -.\"O has added the requirement that conforming programs must not accept -.\"O non-shortest forms in their input. -.\"O This is for security reasons: if -.\"O user input is checked for possible security violations, a program -.\"O might check only for the -.\"O .B ASCII -.\"O version of "/../" or ";" or NUL and overlook that there are many -.\"O .RB non- ASCII -.\"O ways to represent these things in a non-shortest -.\"O .B UTF-8 -.\"O encoding. -.B Unicode 3.1 -では、規格に準拠するプログラムは +\fBUnicode 3.1\fP では、規格に準拠するプログラムは 最短の表現形式ではない入力を受け付けない、という要求事項が追加された。 これはセキュリティ上の理由による。 ユーザー入力がセキュリティ上の危険に対しチェックされる場合、 -プログラムは -.B ASCII -版の "/../" や ";" や "NUL" だけをチェックし、 +プログラムは \fBASCII\fP 版の "/../" や ";" や "NUL" だけをチェックし、 最短に符号化されてないこれらの文字を見過ごしてしまうかもしれないからである。 -なぜなら、最短ではない -.B UTF-8 -符号化では、これらの文字を表現するような様々な -.B ASCII -以外の形式が存在するためである。 -.\"O .SS Standards -.SS 準拠 -ISO/IEC 10646-1:2000, Unicode 3.1, RFC\ 2279, Plan 9. -.\"O .\" .SH AUTHOR -.\" .SH 著者 +なぜなら、最短ではない \fBUTF\-8\fP 符号化では、これらの文字を表現するような様々な +\fBASCII\fP 以外の形式が存在するためである。 +.SS 標準 +.\" .SH AUTHOR .\" Markus Kuhn -.\"O .SH "SEE ALSO" +ISO/IEC 10646\-1:2000, Unicode 3.1, RFC\ 2279, Plan 9. .SH 関連項目 -.BR nl_langinfo (3), -.BR setlocale (3), -.BR charsets (7), -.BR unicode (7) +\fBnl_langinfo\fP(3), \fBsetlocale\fP(3), \fBcharsets\fP(7), \fBunicode\fP(7) diff --git a/draft/man8/intro.8 b/draft/man8/intro.8 index 5c4aef03..b9422f87 100644 --- a/draft/man8/intro.8 +++ b/draft/man8/intro.8 @@ -25,43 +25,20 @@ .\" Modified Sat Jul 24 17:35:48 1993 by Rik Faith (faith@cs.unc.edu) .\" 2007-10-23 mtk: minor rewrites, and added paragraph on exit status .\" -.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya -.\" all rights reserved. -.\" Translated 1997-05-08, HANATAKA Shinya -.\" Updated 2008-02-09, Akihiro MOTOKI , LDP v2.77 +.\"******************************************************************* .\" -.TH INTRO 8 2007-10-23 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH INTRO 8 2007\-10\-23 Linux "Linux Programmer's Manual" .SH 名前 -.\"O intro \- Introduction to administration and privileged commands intro \- 管理コマンドと特権コマンドの説明 -.\"O .SH DESCRIPTION .SH 説明 -.\"O Section 8 of the manual describes commands -.\"O which either can be or are only used by the superuser, -.\"O like system-administration commands, daemons, -.\"O and hardware-related commands. -マニュアルの 8 章は、システム管理用のコマンド、デーモン (daemon)、 -ハードウェア関連のコマンドといった、スーパー・ユーザーによってのみ +マニュアルの 8 章は、システム管理用のコマンド、デーモン (daemon)、 ハードウェア関連のコマンドといった、スーパー・ユーザーによってのみ 使用される/できるコマンドについて説明している。 -.\"O As with the commands in described section 1, the commands described -.\"O in this section terminate with an exit status that indicates -.\"O whether the command succeeded or failed. -.\"O See -.\"O .BR intro (1) -.\"O for more information. -1 章で説明されているコマンドと同様、この章で説明されるコマンドは -コマンドの成功・失敗を示す終了ステータスで終了する。 -さらなる情報は -.BR intro (1) -を参照のこと。 -.\"O .SH NOTES -.SH 備考 -.\"O .SS Authors and Copyright Conditions +1 章で説明されているコマンドと同様、この章で説明されるコマンドは コマンドの成功・失敗を示す終了ステータスで終了する。 さらなる情報は +\fBintro\fP(1) を参照のこと。 +.SH 注意 .SS 著者と著作権 -.\"O Look at the header of the manual page source for the author(s) and copyright -.\"O conditions. -.\"O Note that these can be different from page to page! -著者と著作権 (copyright) に関しては各マニュアル・ページのソースのヘッダーを見ること。 -これらはページごとに異っている。 +著者と著作権に関しては各マニュアルページのソースのヘッダを参照すること。 これらはページごとに異なる可能性があることに注意してほしい。 diff --git a/draft/man8/ld.so.8 b/draft/man8/ld.so.8 deleted file mode 100644 index 0626a743..00000000 --- a/draft/man8/ld.so.8 +++ /dev/null @@ -1,671 +0,0 @@ -.\" This is in the public domain -.\" -.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. -.\" Translated 1998-05-23, NAKANO Takeo -.\" Updated & Modified 1999-09-14, NAKANO Takeo -.\" Updated & Modified 2002-01-17, Yuichi SATO -.\" Updated & Modified 2002-07-15, Yuichi SATO -.\" Updated 2007-06-13, Akihiro MOTOKI , LDP v2.55 -.\" Updated 2010-04-23, Akihiro MOTOKI, LDP v3.24 -.\" -.TH LD.SO 8 2009-01-12 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O ld.so, ld-linux.so* \- dynamic linker/loader -.SH 名前 -ld.so, ld-linux.so* \- 動的なリンカ/ローダ -.\"O .SH SYNOPSIS -.SH 書式 -.\"O The dynamic linker can be run either indirectly by running some -.\"O dynamically linked program or library (in which case no command-line options -.\"O to the dynamic linker can be passed and, in the ELF case, the dynamic linker -.\"O which is stored in the -.\"O .B .interp -.\"O section of the program is executed) or directly by running: -.\"O .P -.\"O .I /lib/ld-linux.so.* -.\"O [OPTIONS] [PROGRAM [ARGUMENTS]] -動的リンカは、動的にリンクされたプログラムやライブラリの実行によって -間接的に実行することができる -(ELF の場合、動的リンカにコマンドラインオプションを渡すことはできず、 -プログラムの -.B .interp -セクションに入っている動的リンカが実行される)。 -また以下のように直接実行することもできる -.P -.I /lib/ld-linux.so.* -[OPTIONS] [PROGRAM [ARGUMENTS]] -.\"O .SH DESCRIPTION -.SH 説明 -.\"O The programs -.\"O .B ld.so -.\"O and -.\"O .B ld-linux.so* -.\"O find and load the shared libraries needed by a program, prepare -.\"O the program to run, and then run it. -プログラム -.B ld.so -と -.B ld-linux.so* -はプログラムに必要な共有ライブラリを見つけてロードし、 -プログラムの実行を準備してから起動させる。 -.LP -.\"O Linux binaries require dynamic linking (linking at run time) -.\"O unless the -.\"O .B \-static -.\"O option was given to -.\"O .BR ld (1) -.\"O during compilation. -Linux のバイナリは、コンパイルの時に -.BR ld (1) -に対して -.B \-static -オプションが指定されていない限り、動的リンク (実行時リンク) が必要となる。 -.LP -.\"O The program -.\"O .B ld.so -.\"O handles a.out binaries, a format used long ago; -プログラム -.B ld.so -は a.out バイナリを扱う。 -これはずっと昔に使われていたフォーマットである。 -.\"O .B ld-linux.so* -.\"O handles ELF (\fI/lib/ld-linux.so.1\fP for libc5, \fI/lib/ld-linux.so.2\fP -.\"O for glibc2), which everybody has been using for years now. -.B ld-linux.so* -(libc5 では \fI/lib/ld-linux.so.1\fP, -glibc2 では \fI/lib/ld-linux.so.2\fP) -は ELF バイナリを扱う。 -このフォーマットは多くの人が最近何年も使っている。 -.\"O Otherwise both have the same behavior, and use the same -.\"O support files and programs -.\"O .BR ldd (1), -.\"O .BR ldconfig (8) -.\"O and -.\"O .IR /etc/ld.so.conf . -それ以外の点では両方とも同じように動作し、 -同じサポートファイルとプログラム -.BR ldd (1), -.BR ldconfig (8), -.I /etc/ld.so.conf -を使用する。 -.LP -.\"O The shared libraries needed by the program are searched for -.\"O in the following order: -プログラムで必要とされる共有ライブラリは、 -以下の順序で検索される。 -.IP o 3 -.\"O (ELF only) Using the directories specified in the -.\"O DT_RPATH dynamic section attribute -.\"O of the binary if present and DT_RUNPATH attribute does not exist. -.\"O Use of DT_RPATH is deprecated. -(ELF のみ) -バイナリの動的セクション属性 DT_RPATH が存在し、 -DT_RUNPATH 属性が存在しない場合は、 -DT_RPATH で指定されたディレクトリを使用する。 -DT_RPATH の使用は推奨されない。 -.IP o -.\"O Using the environment variable -.\"O .BR LD_LIBRARY_PATH . -.\"O Except if the executable is a set-user-ID/set-group-ID binary, -.\"O in which case it is ignored. -環境変数 -.B LD_LIBRARY_PATH -を用いる。 -ただし実行ファイルが set-user-ID/set-group-ID バイナリの場合、 -これは無視される。 -.IP o -.\"O (ELF only) Using the directories specified in the -.\"O DT_RUNPATH dynamic section attribute -.\"O of the binary if present. -(ELF のみ) -バイナリの動的セクション属性 DT_RUNPATH が存在すれば、 -DT_RUNPATH で指定されたディレクトリを使用する。 -.IP o -.\"O From the cache file -.\"O .I /etc/ld.so.cache -.\"O which contains a compiled list of candidate libraries previously found -.\"O in the augmented library path. -.\"O If, however, the binary was linked with the -.\"O .B \-z nodeflib -.\"O linker option, libraries in the default library paths are skipped. -キャッシュファイル -.I /etc/ld.so.cache -を探す。このファイルは、 -(ld.so.conf で追加指定されたものも含めた) ライブラリ検索パスから -見つかったライブラリファイルの情報を集めたものである。 -ただしバイナリがリンカオプション -.B \-z nodeflib -でリンクされている場合は、デフォルトのライブラリパスにある -ライブラリはスキップされる。 -.IP o -.\"O In the default path -.\"O .IR /lib , -.\"O and then -.\"O .IR /usr/lib . -デフォルトパスである -.IR /lib 、 -次いで -.I /usr/lib -を用いる。 -.\"O If the binary was linked with the -.\"O .B \-z nodeflib -.\"O linker option, this step is skipped. -バイナリがリンカオプション -.B \-z nodeflib -でリンクされている場合、このステップはスキップされる。 -.\"O .SS $ORIGIN and rpath -.SS $ORIGIN と rpath -.PP -.\"O .B ld.so -.\"O understands the string -.\"O .I $ORIGIN -.\"O (or equivalently -.\"O .IR ${ORIGIN} ) -.\"O in an rpath specification (DT_RPATH or DT_RUNPATH) to mean -.\"O the directory containing the application executable. -.B ld.so -では、rpath 指定 (DT_RPATH や DT_RUNPATH) 中に -.I $ORIGIN -という文字列 -.RI ( ${ORIGIN} -も等価) を使うことができる。 -.I $ORIGIN -はアプリケーションの実行ファイルが入っているディレクトリを表す。 -.\"O Thus, an application located in -.\"O .I somedir/app -.\"O could be compiled with -.\"O .I gcc -Wl,-rpath,\(aq$ORIGIN/../lib\(aq -.\"O so that it finds an associated shared library in -.\"O .I somedir/lib -.\"O no matter where -.\"O .I somedir -.\"O is located in the directory hierarchy. -これを使って -.I somedir/app -に置かれたアプリケーションを -.I gcc -Wl,-rpath,'$ORIGIN/../lib' -でコンパイルすると、 -.I somedir -がディレクトリ階層のどこにあっても、アプリケーションは -.I somedir/lib -にある対応する共有ライブラリを見つけることができる。 -.\"O This facilitates the creation of "turn-key" applications that -.\"O do not need to be installed into special directories, -.\"O but can instead be unpacked into any directory -.\"O and still find their own shared libraries. -この機能を使うと、 -特別なディレクトリではなく任意のディレクトリにインストールしても -"ややこしい設定なしで" -独自の共有ライブラリを使えるアプリケーションを作成することができる。 -.\" ld.so also understands $LIB, with the same meaning as $ORIGIN/lib, -.\" it appears. -.\" -.\" There is also $PLATFORM. This is a kind of wildcard -.\" of directories related at AT_HWCAP. To get an idea of the -.\" places that $PLATFORM would match, look at the output of the -.\" following: -.\" -.\" mkdir /tmp/d -.\" LD_LIBRARY_PATH=/tmp/d strace -e open /bin/date 2>&1 | grep /tmp/d -.\" -.\" ld.so lets names be abbreviated, so $O will work for $ORIGIN; -.\" Don't do this!! -.\"O .SH OPTIONS -.SH オプション -.TP -.B \-\-list -.\"O List all dependencies and how they are resolved. -全ての依存関係とその解決法をリストする。 -.TP -.B \-\-verify -.\"O Verify that program is dynamically linked and this dynamic linker can handle -.\"O it. -プログラムが動的にリンクされているかと、 -動的リンカがそのプログラムを扱えるかを検証する。 -.TP -.B \-\-library\-path PATH -.\"O Override -.\"O .B LD_LIBRARY_PATH -.\"O environment variable setting (see below). -.B LD_LIBRARY_PATH -環境変数の設定を上書きする (下記参照)。 -.TP -.B \-\-inhibit\-rpath LIST -.\"O Ignore RPATH and RUNPATH information in object names in LIST. -.\"O This option is ignored if -.\"O .B ld.so -.\"O is set-user-ID or set-group-ID. -LIST にあるオブジェクト名の RPATH と RUNPATH の情報を無視する。 -.B ld.so -が set-user-ID か set-group-ID されている場合、 -このオプションは無視される。 -.\"O .SH ENVIRONMENT -.SH 環境変数 -.\"O There are four important environment variables. -4 つの重要な環境変数がある。 -.TP -.B LD_BIND_NOW -.\"O (libc5; glibc since 2.1.1) -.\"O If set to a nonempty string, -.\"O causes the dynamic linker to resolve all symbols -.\"O at program startup instead of deferring function call resolution to the point -.\"O when they are first referenced. -.\"O This is useful when using a debugger. -(libc5; glibc 2.1.1 以降) -空文字列でない場合、 -動的リンカはプログラムの開始時に全てのシンボルを解決する。 -空文字列の場合、解決しなければならない関数呼び出しが -最初に参照された時点で解決する。 -デバッガを使っているときに役立つ。 -.TP -.B LD_LIBRARY_PATH -.\"O A colon-separated list of directories in which to search for -.\"O ELF libraries at execution-time. -.\"O Similar to the -.\"O .B PATH -.\"O environment variable. -コロン区切りのディレクトリリスト。 -実行時に ELF ライブラリを検索するディレクトリを指定する。 -.B PATH -環境変数と同じように指定する。 -.TP -.B LD_PRELOAD -.\"O A whitespace-separated list of additional, user-specified, ELF shared -.\"O libraries to be loaded before all others. -.\"O This can be used to selectively override functions in other shared libraries. -スペース区切りで ELF 共有ライブラリを指定する。 -これはユーザーが指定でき、すべてのライブラリに先立ってロードされる。 -他の共有ライブラリにある関数を選択的に置き換えるために用いることができる。 -.\"O For set-user-ID/set-group-ID ELF binaries, -.\"O only libraries in the standard search -.\"O directories that are also set-user-ID will be loaded. -set-user-ID/set-group-ID された ELF バイナリに対して、 -標準的な検索パスにあるライブラリのうち set-user-ID されているものはロードしない。 -.TP -.B LD_TRACE_LOADED_OBJECTS -.\"O (ELF only) -.\"O If set to a nonempty string, causes the program to list its dynamic library -.\"O dependencies, as if run by -.\"O .BR ldd (1), -.\"O instead of running normally. -(ELF のみ) -空文字列でない場合、 -プログラムを普通に実行するのではなく、 -.BR ldd (1) -を実行したときのように動的ライブラリの依存関係をリスト表示させる。 -.LP -.\"O Then there are lots of more or less obscure variables, -.\"O many obsolete or only for internal use. -そして、それほど知られていない環境変数もある。 -多くは廃れてしまったものか内部でのみ使用される環境変数である。 -.TP -.B LD_AOUT_LIBRARY_PATH -(libc5) -.\"O Version of -.\"O .B LD_LIBRARY_PATH -.\"O for a.out binaries only. -.\"O Old versions of ld\-linux.so.1 also supported -.\"O .BR LD_ELF_LIBRARY_PATH . -a.out バイナリにのみ使われる環境変数で、 -.B LD_LIBRARY_PATH -と同じ役割をする。 -ld\-linux.so.1 の古いバージョンでは -.B LD_ELF_LIBRARY_PATH -もサポートしていた。 -.TP -.B LD_AOUT_PRELOAD -(libc5) -.\"O Version of -.\"O .B LD_PRELOAD -.\"O for a.out binaries only. -.\"O Old versions of ld\-linux.so.1 also supported -.\"O .BR LD_ELF_PRELOAD . -a.out バイナリにのみ使われる環境変数で、 -.B LD_PRELOAD -と同じ役割をする。 -ld\-linux.so.1 の古いバージョンでは -.B LD_ELF_PRELOAD -もサポートしていた。 -.TP -.B LD_AUDIT -.\"O (glibc since 2.4) -(glibc 2.4 以降) -.\"O A colon-separated list of user-specified, ELF shared objects -.\"O to be loaded before all others in a separate linker namespace -.\"O (i.e., one that does not intrude upon the normal symbol bindings that -.\"O would occur in the process). -.\"O These libraries can be used to audit the operation of the dynamic linker. -.\"O .B LD_AUDIT -.\"O is ignored for set-user-ID/set-group-ID binaries. -他のオブジェクトよりも前に、別のリンカ名前空間 (そのプロセスで行われる -通常のシンボル結合 (symbol bindigns) には関与しない名前空間) で -ロードされる、ユーザ指定の ELF 共有オブジェクトのコロン区切りのリスト。 -これらのライブラリを使って、動的リンカの動作を監査することができる。 -set-user-ID/set-group-ID されたバイナリでは、 -.B LD_AUDIT -は無視される。 - -.\"O The dynamic linker will notify the audit -.\"O libraries at so-called auditing checkpoints\(emfor example, -.\"O loading a new library, resolving a symbol, -.\"O or calling a symbol from another shared object\(emby -.\"O calling an appropriate function within the audit library. -動的リンカは、いわゆる監査チェックポイント (auditing checkpoints) -において、監査 (audit) ライブラリの適切な関数を呼び出すことで、 -監査ライブラリへの通知を行う。監査チェックポイントの例としては、 -新たなライブラリのロード、シンボルの解決、別の共有オブジェクト -からのシンボルの呼び出し、などがある。 -.\"O For details, see -.\"O .BR rtld-audit (7). -.\"O The auditing interface is largely compatible with that provided on Solaris, -.\"O as described in its -.\"O .IR "Linker and Libraries Guide" , -.\"O in the chapter -.\"O .IR "Runtime Linker Auditing Interface" . -詳細は -.BR rtld-audit (7) -を参照してほしい。 -audit インタフェースは、Solaris で提供されているものと -大部分は互換性がある。Solaris の audit インタフェースについては、 -.I "Linker and Libraries Guide" -の -.I "Runtime Linker Auditing Interface" -の章に説明がある。 -.TP -.B LD_BIND_NOT -.\"O (glibc since 2.1.95) -.\"O Do not update the GOT (global offset table) and PLT (procedure linkage table) -.\"O after resolving a symbol. -(glibc 2.1.95 以降) -シンボルを解決した後、GOT (global offset table) と -PLT (procedure linkage table) を更新しない。 -.TP -.B LD_DEBUG -.\"O (glibc since 2.1) -.\"O Output verbose debugging information about the dynamic linker. -.\"O If set to -.\"O .B all -.\"O prints all debugging information it has, if set to -.\"O .B help -.\"O prints a help message about which categories can be specified in this -.\"O environment variable. -.\"O Since glibc 2.3.4, -.\"O .B LD_DEBUG -.\"O is ignored for set-user-ID/set-group-ID binaries. -(glibc 2.1 以降) -動的リンカの詳細なデバッグ情報を出力する。 -.B all -に設定した場合、全ての動的リンカが持つデバッグ情報を表示する。 -.B help -に設定した場合、この環境変数で指定されるカテゴリのヘルプ情報を表示する。 -glibc 2.3.4 以降、 -set-user-ID/set-group-ID されたバイナリでは -.B LD_DEBUG -は無視される。 -.TP -.B LD_DEBUG_OUTPUT -.\"O (glibc since 2.1) -.\"O File where -.\"O .B LD_DEBUG -.\"O output should be fed into, default is standard output. -.\"O .B LD_DEBUG_OUTPUT -.\"O is ignored for set-user-ID/set-group-ID binaries. -(glibc 2.1 以降) -.B LD_DEBUG -の出力を書き込むファイル。 -デフォルトは標準出力である。 -set-user-ID/set-group-ID されたバイナリでは、 -.B LD_DEBUG_OUTPUT -は無視される。 -.TP -.B LD_DYNAMIC_WEAK -.\"O (glibc since 2.1.91) -.\"O Allow weak symbols to be overridden (reverting to old glibc behavior). -.\"O For security reasons, since glibc 2.3.4, -.\"O .B LD_DYNAMIC_WEAK -.\"O is ignored for set-user-ID/set-group-ID binaries. -(glibc 2.1.19 以降) -上書きされる弱いシンボル (昔の glibc の挙動を逆にする)。 -セキュリティ上の理由から、glibc 2.3.4 以降、 -set-user-ID/set-group-ID されたバイナリでは -.B LD_DYNAMIC_WEAK -は無視される。 -.TP -.B LD_HWCAP_MASK -.\"O (glibc since 2.1) -.\"O Mask for hardware capabilities. -(glibc 2.1 以降) -ハードウェア機能のマスク。 -.TP -.B LD_KEEPDIR -.\"O (a.out only)(libc5) -.\"O Don't ignore the directory in the names of a.out libraries to be loaded. -.\"O Use of this option is strongly discouraged. -(a.out のみ)(libc5) -ロードする a.out ライブラリの名前において、ディレクトリを無視しない。 -このオプションは用いるべきではない。 -.TP -.B LD_NOWARN -.\"O (a.out only)(libc5) -.\"O Suppress warnings about a.out libraries with incompatible minor -.\"O version numbers. -(a.out のみ)(libc5) -a.out ライブラリにおけるマイナーバージョン番号の非互換に -対する警告メッセージを抑制する。 -.TP -.B LD_ORIGIN_PATH -.\"O (glibc since 2.1) -.\"O Path where the binary is found (for non-set-user-ID programs). -.\"O For security reasons, since glibc 2.4, -.\"O .B LD_ORIGIN_PATH -.\"O is ignored for set-user-ID/set-group-ID binaries. -(glibc 2.1 以降) -バイナリへのパス (set-user-ID されていないプログラムについて)。 -セキュリティ上の理由から、glibc 2.3.4 以降、 -set-user-ID/set-group-ID されたバイナリでは -.B LD_ORIGIN_PATH -は無視される。 -.\" Only used if $ORIGIN can't be determined by normal means -.\" (from the origin path saved at load time, or from /proc/self/exe)? -.TP -.B LD_POINTER_GUARD -.\"O (glibc since 2.4) -(glibc 2.4 以降) -.\"O Set to 0 to disable pointer guarding. -.\"O Any other value enables pointer guarding, which is also the default. -.\"O Pointer guarding is a security mechanism whereby some pointers to code -.\"O stored in writable program memory (return addresses saved by -.\"O .BR setjmp (3) -.\"O or function pointers used by various glibc internals) are mangled -.\"O semi-randomly to make it more difficult for an attacker to hijack -.\"O the pointers for use in the event of a buffer overrun or -.\"O stack-smashing attack. -0 に設定すると、ポインタ保護 (pointer guarding) が無効になる。 -それ以外の値の場合はポインタ保護が有効になる。 -デフォルトはポインタ保護有効である。 -ポインタ保護はセキュリティ機構の一つで、書き込み可能なプログラムメモリ -に格納されたコードへのポインタをほぼランダム化することで、 -攻撃者がバッファオーバーランやスタック破壊 (stack-smashing) 攻撃の際に -ポインタを乗っ取ることを困難にするものである。 -.TP -.B LD_PROFILE -.\"O (glibc since 2.1) -.\"O Shared object to be profiled, -.\"O specified either as a pathname or a soname. -.\"O Profiling output is written to the file whose name is: -.\"O "\fI$LD_PROFILE_OUTPUT\fP/\fI$LD_PROFILE\fP.profile". -(glibc 2.1 以降) -プロファイルを行う共有オブジェクト。 -パス名か共有オブジェクト名 (soname) で指定される。 -プロフィールの出力は -"\fI$LD_PROFILE_OUTPUT\fP/\fI$LD_PROFILE\fP.profile" という名前の -ファイルに書き込まれる。 -.TP -.B LD_PROFILE_OUTPUT -.\"O (glibc since 2.1) -.\"O Directory where -.\"O .B LD_PROFILE -.\"O output should be written. -.\"O If this variable is not defined, or is defined as an empty string, -.\"O then the default is -.\"O .IR /var/tmp . -.\"O .B LD_PROFILE_OUTPUT -.\"O is ignored for set-user-ID and set-group-ID programs, -.\"O which always use -.\"O .IR /var/profile . -(glibc 2.1 以降) -.B LD_PROFILE -の出力が書き込まれるディレクトリ。 -この変数が定義されていないか、空の文字列が定義されている場合、 -デフォルト値は -.I /var/tmp -となる。 -set-user-ID/set-group-ID されたプログラムでは、 -LD_PROFILE_OUTPUT は無視される。 -出力ファイルは常に -.I /var/profile -が使用される。 -.TP -.B LD_SHOW_AUXV -.\"O (glibc since 2.1) -.\"O Show auxiliary array passed up from the kernel. -.\"O For security reasons, since glibc 2.3.5, -.\"O .B LD_SHOW_AUXV -.\"O is ignored for set-user-ID/set-group-ID binaries. -(glibc 2.1 以降) -カーネルから渡される補助的な (パラメータの) 配列を表示する。 -セキュリティ上の理由から、glibc 2.3.4 以降、 -set-user-ID/set-group-ID されたバイナリでは -.B LD_SHOW_AUXV -は無視される。 -.\" FIXME -.\" Document LD_TRACE_PRELINKING (e.g.: LD_TRACE_PRELINKING=libx1.so ./prog) -.\" Since glibc 2.3 -.\" Also enables DL_DEBUG_PRELINK -.TP -.B LD_USE_LOAD_BIAS -.\" http://sources.redhat.com/ml/libc-hacker/2003-11/msg00127.html -.\" Subject: [PATCH] Support LD_USE_LOAD_BIAS -.\" Jakub Jelinek -.\"O By default (i.e., if this variable is not defined) -.\"O executables and prelinked -.\"O shared objects will honor base addresses of their dependent libraries -.\"O and (nonprelinked) position-independent executables (PIEs) -.\"O and other shared objects will not honor them. -デフォルトでは (つまり、この変数が定義されていない場合)、 -実行ファイルと prelink された共有オブジェクトでは、それらが依存する -ライブラリのベースアドレスが尊重される一方、 -(prelink されていない) position-independent executables (PIEs) と -他の共有オブジェクトでは依存するライブラリのベースアドレスは -尊重されない。 -.\"O If -.\"O .B LD_USE_LOAD_BIAS -.\"O is defined wit the value, both executables and PIEs -.\"O will honor the base addresses. -.B LD_USE_LOAD_BIAS -に値が定義された場合、実行ファイルと PIE のどちらでも -ベースアドレスが尊重される。 -.\"O If -.\"O .B LD_USE_LOAD_BIAS -.\"O is defined with the value 0, -.\"O neither executables nor PIEs will honor the base addresses. -.B LD_USE_LOAD_BIAS -が値 0 で定義された場合、実行ファイルと PIE のどちらでも -ベースアドレスは尊重されない。 -.\"O This variable is ignored by set-user-ID and set-group-ID programs. -set-user-ID や set-group-ID されたプログラムでは、 -この変数は無視される。 -.TP -.B LD_VERBOSE -.\"O (glibc since 2.1) -.\"O If set to a nonempty string, -.\"O output symbol versioning information about the -.\"O program if querying information about the program (i.e., either -.\"O .B LD_TRACE_LOADED_OBJECTS -.\"O has been set, or -.\"O .B \-\-list -.\"O or -.\"O .B \-\-verify -.\"O options have been given to the dynamic linker). -(glibc 2.1 以降) -空文字列でない場合に、 -.RB ( LD_TRACE_LOADED_OBJECTS -を設定するか、 -.B \-\-list -または -.B \-\-verify -オプションを動的リンカに指定することにより) -プログラムについての情報を問い合わせると、 -プログラムのシンボルバージョン情報を表示する。 -.TP -.B LD_WARN -.\"O (ELF only)(glibc since 2.1.3) -.\"O If set to a nonempty string, warn about unresolved symbols. -(ELF のみ)(glibc 2.1.3 以降) -空文字列でない場合、解決されていないシンボルがあれば警告を出す。 -.TP -.B LDD_ARGV0 -(libc5) -.\"O .IR argv [0] -.\"O to be used by -.\"O .BR ldd (1) -.\"O when none is present. -.BR ldd (1) -の引き数がない場合に、 -.IR argv [0] -として使われる値。 -.\"O .TP -.\"O .SH FILES -.SH ファイル -.PD 0 -.TP -.I /lib/ld.so -.\"O a.out dynamic linker/loader -a.out の動的リンカ/ローダ -.TP -.IR /lib/ld\-linux.so. { 1 , 2 } -.\"O ELF dynamic linker/loader -ELF の動的リンカ/ローダ -.TP -.I /etc/ld.so.cache -.\"O File containing a compiled list of directories in which to search for -.\"O libraries and an ordered list of candidate libraries. -ライブラリを検索するディレクトリを集めたリストと、 -共有ライブラリの候補の整列リストを含むファイル。 -.TP -.I /etc/ld.so.preload -.\"O File containing a whitespace separated list of ELF shared libraries to -.\"O be loaded before the program. -プログラムの前にロードすべき ELF 共有ライブラリを -スペースで区切ったリストが書かれているファイル。 -.TP -.B lib*.so* -.\"O shared libraries -共有ライブラリ -.PD -.\"O .SH NOTES -.SH 注意 -.\"O The -.\"O .B ld.so -.\"O functionality is available for executables compiled using libc version -.\"O 4.4.3 or greater. -.B ld.so -の機能は libc のバージョン 4.4.3 以上を用いてコンパイルされた -実行ファイルで使用可能である。 -.\"O ELF functionality is available since Linux 1.1.52 and libc5. -ELF の機能は Linux 1.1.52 以降と libc5 以降で使用可能である。 -.\"O .SH SEE ALSO -.SH 関連項目 -.BR ldd (1), -.BR rtld-audit (7), -.BR ldconfig (8) -.\"O .\" .SH AUTHORS -.\" .SH 著者 -.\" ld.so: David Engel, Eric Youngdale, Peter MacDonald, Hongjiu Lu, Linus -.\" Torvalds, Lars Wirzenius and Mitch D'Souza -.\"O .\" ld-linux.so: Roland McGrath, Ulrich Drepper and others. -.\" ld-linux.so: Roland McGrath, Ulrich Drepper, その他の人々 -.\" -.\"O .\" In the above, (libc5) stands for David Engel's ld.so/ld-linux.so. -.\" 上記の説明において、(libc5) は David Engel の -.\" ld.so/ld-linux.so を表している。 diff --git a/draft/man8/ldconfig.8 b/draft/man8/ldconfig.8 index a6840c23..2c115891 100644 --- a/draft/man8/ldconfig.8 +++ b/draft/man8/ldconfig.8 @@ -19,261 +19,84 @@ .\" .\" Modified, 6 May 2002, Michael Kerrisk, .\" Change listed order of /usr/lib and /lib +.\"******************************************************************* .\" -.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. -.\" Translated Sat May 23 1998 by NAKANO Takeo -.\" Updated & Modified Tue Sep 14 1999 by NAKANO Takeo -.\" Updated & Modified Mon Jun 4 20:13:57 JST 2001 -.\" by Yuichi SATO +.\" This file was generated with po4a. Translate the source file. .\" -.\"WORD: verbose mode 詳細表示モード -.\"WORD: quiet mode メッセージ抑制モード -.\" -.TH LDCONFIG 8 2009-04-15 "GNU" "Linux Programmer's Manual" -.\"O .SH NAME +.\"******************************************************************* +.TH LDCONFIG 8 2009\-04\-15 GNU "Linux Programmer's Manual" .SH 名前 -.\"O /sbin/ldconfig \- configure dynamic linker run-time bindings /sbin/ldconfig \- 動的リンカによる実行時の結合関係を設定する -.\"O .SH SYNOPSIS .SH 書式 -.B /sbin/ldconfig -[ -.B \-nNvXV -] -[ -.BR \-f\ conf -] -[ -.BR \-C\ cache -] -[ -.BR \-r\ root -] -.IR directory \ ... +\fB/sbin/ldconfig\fP [ \fB\-nNvXV\fP ] [ \fB\-f\ conf\fP ] [ \fB\-C\ cache\fP ] [ \fB\-r\ root\fP ] \fIdirectory\fP\ ... .PD 0 .PP .PD -.B /sbin/ldconfig -.B \-l -[ -.B \-v -] -.IR library \ ... +\fB/sbin/ldconfig\fP \fB\-l\fP [ \fB\-v\fP ] \fIlibrary\fP\ ... .PD 0 .PP .PD -.B /sbin/ldconfig -.B \-p -.\"O .SH DESCRIPTION +\fB/sbin/ldconfig\fP \fB\-p\fP .SH 説明 -.\"O .B ldconfig -.\"O creates the necessary links and cache to the most recent shared -.\"O libraries found in the directories specified on the command line, -.\"O in the file -.\"O .IR /etc/ld.so.conf , -.\"O and in the trusted directories -.\"O .RI ( /lib -.\"O and -.\"O .IR /usr/lib ). -.B ldcofig -は最新の共有ライブラリに対して必要なリンクを作成したり、 -ライブラリをキャッシュしたりする。 -ライブラリは、コマンドラインや -.I /etc/ld.so.conf -ファイルで指定されたディレクトリや、共有ライブラリが -通常置かれるディレクトリ -.RI ( /lib " と " /usr/lib ) -から検索される。 -.\"O The cache is used by the run-time linker, -.\"O .I ld.so -.\"O or -.\"O .IR ld-linux.so . -キャッシュは実行時リンカ -.I ld.so -または -.I ld-linux.so -によって使われる。 -.\"O .B ldconfig -.\"O checks the header and filenames of the libraries it encounters when -.\"O determining which versions should have their links updated. -.B ldconfig -は処理するライブラリのヘッダ部分とファイル名をチェックし、 -どのバージョンに対してリンクを更新すべきかを判断する。 +\fBldcofig\fP は最新の共有ライブラリに対して必要なリンクを作成したり、 ライブラリをキャッシュしたりする。 ライブラリは、コマンドラインや +\fI/etc/ld.so.conf\fP ファイルで指定されたディレクトリや、共有ライブラリが 通常置かれるディレクトリ (\fI/lib\fP と +\fI/usr/lib\fP) から検索される。 キャッシュは実行時リンカ \fIld.so\fP または \fIld\-linux.so\fP によって使われる。 +\fBldconfig\fP は処理するライブラリのヘッダ部分とファイル名をチェックし、 どのバージョンに対してリンクを更新すべきかを判断する。 .PP -.\"O .B ldconfig -.\"O will attempt to deduce the type of ELF libs (i.e., libc5 or libc6/glibc) -.\"O based on what C libs, if any, the library was linked against. -.\"O .\" The following sentence looks suspect -.\"O .\" (perhaps historical cruft) -- MTK, Jul 2005 -.\"O .\" Therefore, when making dynamic libraries, -.\"O .\" it is wise to explicitly link against libc (use \-lc). -.B ldconfig -は ELF ライブラリの種類 (libc5 か libc6/glibc か) を判断するとき、 -そのライブラリがリンクしている C ライブラリを参考にする。 -.\" 以下の文の内容は本当かどうか疑わしい -.\" (おそらく過去の遺物であろう) -- MTK, Jul 2005 -.\" したがってダイナミックライブラリを作成するときには、 -.\" libc に対するリンクを (\-lc をつかって) 明示しておくと良い。 +.\" The following sentence looks suspect +.\" (perhaps historical cruft) -- MTK, Jul 2005 +.\" Therefore, when making dynamic libraries, +.\" it is wise to explicitly link against libc (use \-lc). +\fBldconfig\fP は ELF ライブラリの種類 (libc5 か libc6/glibc か) を判断するとき、 そのライブラリがリンクしている +C ライブラリを参考にする。 .PP -.\"O Some existing libs do not contain enough information to allow the deduction of -.\"O their type. -.\"O Therefore, the -.\"O .I /etc/ld.so.conf -.\"O file format allows the specification of an expected type. -.\"O This is -.\"O .I only -.\"O used for those ELF libs which we can not work out. -.\"O The format -.\"O is "dirname=TYPE", where TYPE can be libc4, libc5, or libc6. -.\"O (This syntax also works on the command line.) -.\"O Spaces are -.\"O .I not -.\"O allowed. -.\"O Also see the -.\"O .B \-p -.\"O option. -すでに存在しているライブラリの中には、種類を区別するために充分な -情報が含まれていないものもある。 -このため -.I /etc/ld.so.conf -ファイルでライブラリの形式を指定することができるようになっている。 -これは区別不能な ELF ライブラリ「だけ」に用いるものである。 -フォーマットは "dirname=TYPE" とする。 -ここで TYPE は libc4, libc5, libc6 のいずれかである -(この書式はコマンドラインでも使える)。 -「スペースを入れてはならない」。 -.B \-p -オプションも見ておくこと。 -.\"O .B ldconfig -.\"O should normally be run by the superuser as it may require write -.\"O permission on some root owned directories and files. -.B ldconfig -は通常スーパーユーザー権限で実行しなければならない。 -root が所有しているディレクトリやファイルへの書き込み権限が -必要になるからである。 -.\"O .SH OPTIONS +すでに存在しているライブラリの中には、種類を区別するために充分な 情報が含まれていないものもある。 このため \fI/etc/ld.so.conf\fP +ファイルでライブラリの形式を指定することができるようになっている。 これは区別不能な ELF ライブラリ「だけ」に用いるものである。 フォーマットは +"dirname=TYPE" とする。 ここで TYPE は libc4, libc5, libc6 のいずれかである +(この書式はコマンドラインでも使える)。 「スペースを入れてはならない」。 \fB\-p\fP オプションも見ておくこと。 \fBldconfig\fP +は通常スーパーユーザー権限で実行しなければならない。 root が所有しているディレクトリやファイルへの書き込み権限が 必要になるからである。 .SH オプション -.TP -.B \-v -.\"O Verbose mode. -.\"O Print current version number, the name of each directory as it -.\"O is scanned, and any links that are created. -.\"O Overrides quiet mode. -詳細表示モード。 -現在のバージョン番号を表示する。 -またそれぞれのディレクトリをスキャンし、 -新しいリンクを生成するたびに、その内容を表示する。 +.TP +\fB\-v\fP +詳細表示モード。 現在のバージョン番号を表示する。 またそれぞれのディレクトリをスキャンし、 新しいリンクを生成するたびに、その内容を表示する。 メッセージ抑制モードを上書きする。 -.TP -.B \-n -.\"O Only process directories specified on the command line. -.\"O Don't process the trusted directories -.\"O .RI ( /lib -.\"O and -.\"O .IR /usr/lib ) -.\"O nor those specified in -.\"O .IR /etc/ld.so.conf . -.\"O Implies -.\"O .BR \-N . - -コマンドラインで指定されたディレクトリのみを処理する。 -通常共有ライブラリが置かれるディレクトリ -.RI ( /lib " と " /usr/lib ) -や -.I /etc/ld.so.conf -で指定されたディレクトリは処理しない。 -暗黙のうちに -.B \-N -が指定される。 -.TP -.B \-N -.\"O Don't rebuild the cache. -.\"O Unless -.\"O .B \-X -.\"O is also specified, links are still updated. -キャッシュを再構成しない。 -同時に -.B \-X -が同時に指定されなければ、リンクのほうは更新される。 -.TP -.B \-X -.\"O Don't update links. -.\"O Unless -.\"O .B \-N -.\"O is also specified, the cache is still rebuilt. -リンクを更新しない。 -.B \-N -が同時に指定されなければ、キャッシュのほうは再構成される。 -.TP -.B \-f conf -.\"O Use -.\"O .B conf -.\"O instead of -.\"O .IR /etc/ld.so.conf . -.B conf -を -.I /etc/ld.so.conf -の代わりに用いる。 -.TP -.B \-C cache -.\"O Use -.\"O .B cache -.\"O instead of -.\"O .IR /etc/ld.so.cache . -.B cache -を -.I /etc/ld.so.cache -の代わりに用いる。 -.TP -.B \-r root -.\"O Change to and use -.\"O .I root -.\"O as the root directory. -.I root -にカレントディレクトリを変更し、ここをルートディレクトリとして用いる。 -.TP -.B \-l -.\"O Library mode. -.\"O Manually link individual libraries. -.\"O Intended for use by experts only. -ライブラリモード。それぞれのライブラリを手動でリンクする。 -熟練者のみが用いるべきである。 -.TP -.B \-p -.\"O Print the lists of directories and candidate libraries stored in -.\"O the current cache. -現在のキャッシュに保存されているディレクトリのリストと、 -ライブラリの候補を表示する。 -.\"O .SH FILES +.TP +\fB\-n\fP +コマンドラインで指定されたディレクトリのみを処理する。 通常共有ライブラリが置かれるディレクトリ (\fI/lib\fP と \fI/usr/lib\fP) や +\fI/etc/ld.so.conf\fP で指定されたディレクトリは処理しない。 暗黙のうちに \fB\-N\fP が指定される。 +.TP +\fB\-N\fP +キャッシュを再構成しない。 同時に \fB\-X\fP が同時に指定されなければ、リンクのほうは更新される。 +.TP +\fB\-X\fP +リンクを更新しない。 \fB\-N\fP が同時に指定されなければ、キャッシュのほうは再構成される。 +.TP +\fB\-f conf\fP +\fBconf\fP を \fI/etc/ld.so.conf\fP の代わりに用いる。 +.TP +\fB\-C cache\fP +\fBcache\fP を \fI/etc/ld.so.cache\fP の代わりに用いる。 +.TP +\fB\-r root\fP +\fIroot\fP にカレントディレクトリを変更し、ここをルートディレクトリとして用いる。 +.TP +\fB\-l\fP +ライブラリモード。それぞれのライブラリを手動でリンクする。 熟練者のみが用いるべきである。 +.TP +\fB\-p\fP +現在のキャッシュに保存されているディレクトリのリストと、 ライブラリの候補を表示する。 .SH ファイル .PD 0 -.TP 20 -.I /lib/ld.so -.\"O run-time linker/loader +.TP 20 +\fI/lib/ld.so\fP 実行時リンカ/ローダー。 -.TP 20 -.I /etc/ld.so.conf -.\"O File containing a list of colon, space, tab, newline, or comma-spearated -.\"O directories in which to search for libraries. -コロン・スペース・タブ・改行・コンマで区切られたディレクトリのリスト。 -それぞれのディレクトリでライブラリが検索される。 -.TP 20 -.I /etc/ld.so.cache -.\"O File containing an ordered list of libraries found in the directories -.\"O specified in -.\"O .IR /etc/ld.so.conf , -.\"O as well as those found in -.\"O .I /lib -.\"O and -.\"O .IR /usr/lib . -.I /etc/ld.so.conf -で指定されたディレクトリにあるライブラリ、および -.I /lib -と -.I /usr/lib +.TP 20 +\fI/etc/ld.so.conf\fP +コロン・スペース・タブ・改行・コンマで区切られたディレクトリのリスト。 それぞれのディレクトリでライブラリが検索される。 +.TP 20 +\fI/etc/ld.so.cache\fP +\fI/etc/ld.so.conf\fP で指定されたディレクトリにあるライブラリ、および \fI/lib\fP と \fI/usr/lib\fP にあるライブラリの順序付きリスト。 .PD -.\"O .SH SEE ALSO .SH 関連項目 -.BR ldd (1), -.BR ld.so (8) +\fBldd\fP(1), \fBld.so\fP(8) diff --git a/draft/man8/tzselect.8 b/draft/man8/tzselect.8 index 6806331a..0149031d 100644 --- a/draft/man8/tzselect.8 +++ b/draft/man8/tzselect.8 @@ -1,83 +1,40 @@ .\" This page is in the public domain .\" -.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. -.\" Translated Sat Aug 14 1999 -.\" by NAKANO Takeo -.\" Updated Wed Apr 4 2001 -.\" by Yuichi SATO -.\" Updated & Modified Sun Dec 23 08:41:42 JST 2001 by Yuichi SATO +.\"******************************************************************* .\" -.\"WORD: country code 国別コード +.\" This file was generated with po4a. Translate the source file. .\" -.TH TZSELECT 8 2007-05-18 "" "Linux System Administration" -.\"O .SH NAME -.\"O tzselect \- select a timezone +.\"******************************************************************* +.TH TZSELECT 8 2007\-05\-18 "" "Linux System Administration" .SH 名前 tzselect \- タイムゾーンを選択する -.\"O .SH SYNOPSIS .SH 書式 -.B tzselect -.\"O .SH DESCRIPTION +\fBtzselect\fP .SH 説明 -.\"O The -.\"O .B tzselect -.\"O program asks the user for information about the current location, -.\"O and outputs the resulting timezone description to standard output. -.\"O The output is suitable as a value for the -.\"O .B TZ -.\"O environment variable. -.B tzselect -プログラムは、ユーザーが現在いる場所の情報を尋ねて、 -その結果得られたタイムゾーンの表記を標準出力に表示する。 -この出力は -.B TZ -環境変数の値にすると良い。 +\fBtzselect\fP プログラムは、ユーザーが現在いる場所の情報を尋ねて、 その結果得られたタイムゾーンの表記を標準出力に表示する。 この出力は +\fBTZ\fP 環境変数の値にすると良い。 .PP -.\"O All interaction with the user is done via standard input and standard error. ユーザとの対話は、全て標準入力と標準エラー出力とで行われる。 -.\"O .SH "EXIT STATUS" -.SH 返り値 -.\"O The exit status is zero if a timezone was successfully obtained -.\"O from the user, nonzero otherwise. -ユーザからの入力によってタイムゾーンが正しく取得できた場合は 0 を -返す。それ以外の場合は 0 以外を返す。 -.\"O .SH ENVIRONMENT -.SH 環境 -.TP +.SH 終了ステータス +ユーザからの入力によってタイムゾーンが正しく取得できた場合は 0 を 返す。それ以外の場合は 0 以外を返す。 +.SH 環境変数 +.TP \fBAWK\fP -.\"O Name of a Posix-compliant -Posix 互換の -.I awk -.\"O program (default: -.\"O .BR awk ). -プログラム (デフォルトは -.BR awk )。 -.TP +Posix 互換の \fIawk\fP プログラム (デフォルトは \fBawk\fP)。 +.TP \fBTZDIR\fP -.\"O Name of the directory containing timezone data files (default: -.\"O .IR /usr/share/zoneinfo ). -.\"O .\" or perhaps /usr/local/etc/zoneinfo in some older systems. -タイムゾーンデータファイルが置かれているディレクトリの名前 (デフォルトは -.IR /usr/share/zoneinfo )。 -.\" 古いシステムでは /usr/local/etc/zoneinfo だろう -.\"O .SH FILES +.\" or perhaps /usr/local/etc/zoneinfo in some older systems. +タイムゾーンデータファイルが置かれているディレクトリの名前 (デフォルトは \fI/usr/share/zoneinfo\fP)。 .SH ファイル -.TP +.TP \fBTZDIR\fP\fI/iso3166.tab\fP -.\"O Table of ISO 3166 2-letter country codes and country names. 2 文字の国別コード (countory code) と国の名前からなる ISO 3166 の表。 -.TP +.TP \fBTZDIR\fP\fI/zone.tab\fP -.\"O Table of country codes, latitude and longitude, TZ values, and -.\"O descriptive comments. 国別コード、経度・緯度、TZ の値、説明文からなる表。 -.TP +.TP \fBTZDIR\fP\fI/\fP\fITZ\fP -.\"O Time zone data file for timezone \fITZ\fP. タイムゾーン \fITZ\fP に対するタイムゾーンデータのファイル。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR tzfile (5), -.BR zdump (8), -.BR zic (8) +\fBtzfile\fP(5), \fBzdump\fP(8), \fBzic\fP(8) .\" @(#)tzselect.8 1.3 diff --git a/draft/man8/zdump.8 b/draft/man8/zdump.8 index 9472cf60..d6340526 100644 --- a/draft/man8/zdump.8 +++ b/draft/man8/zdump.8 @@ -1,71 +1,28 @@ .\" This page is in the public domain .\" -.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. -.\" Translated Tue Sep 14 1999 -.\" by NAKANO Takeo +.\"******************************************************************* .\" -.TH ZDUMP 8 2007-05-18 "" "Linux System Administration" -.\"O .SH NAME -.\"O zdump \- timezone dumper +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH ZDUMP 8 2007\-05\-18 "" "Linux System Administration" .SH 名前 zdump \- タイムゾーンをダンプする -.\"O .SH SYNOPSIS .SH 書式 -.B zdump -[ -.B \-v -] [ -.B \-c -cutoffyear ] [ zonename ... ] -.\"O .SH DESCRIPTION +\fBzdump\fP [ \fB\-v\fP ] [ \fB\-c\fP cutoffyear ] [ zonename ... ] .SH 説明 -.\"O .I Zdump -.\"O prints the current time in each -.\"O .I zonename -.\"O named on the command line. -.I zdump -は -コマンドラインで指定した -.I zonename -それぞれにおける現在時刻を表示する。 +\fIzdump\fP は コマンドラインで指定した \fIzonename\fP それぞれにおける現在時刻を表示する。 .PP -.\"O These options are available: 以下のオプションを指定できる: -.TP -.B \-v -.\"O For each -.\"O .I zonename -.\"O on the command line, -.\"O print the time at the lowest possible time value, -.\"O the time one day after the lowest possible time value, -.\"O the times both one second before and exactly at -.\"O each detected time discontinuity, -.\"O the time at one day less than the highest possible time value, -.\"O and the time at the highest possible time value. -.\"O Each line ends with -.\"O .B isdst=1 -.\"O if the given time is Daylight Saving Time or -.\"O .B isdst=0 -.\"O otherwise. -コマンドラインで与えられた -.I zonename -それぞれに対して、指定可能な最低位の時刻値 (time value)、 -最低位の時刻値の一日後の時刻、 -見付かった時間不連続の一秒前と丁度その時刻、 -最高位時刻値の一日前の時刻、 -指定可能な最高位の時刻値、を表示する。 -それぞれの行の末尾には、 -与えられている時刻がサマータイム (Daylight Saving Time) なら -.B isdst=1 -が、そうでなければ -.B isdst=0 -が付加される。 -.TP -.BI "\-c " cutoffyear -.\"O Cut off the verbose output near the start of the given year. +.TP +\fB\-v\fP +コマンドラインで与えられた \fIzonename\fP それぞれに対して、指定可能な最低位の時刻値 (time value)、 +最低位の時刻値の一日後の時刻、 見付かった時間不連続の一秒前と丁度その時刻、 最高位時刻値の一日前の時刻、 指定可能な最高位の時刻値、を表示する。 +それぞれの行の末尾には、 与えられている時刻がサマータイム (Daylight Saving Time) なら \fBisdst=1\fP が、そうでなければ +\fBisdst=0\fP が付加される。 +.TP +\fB\-c \fP\fIcutoffyear\fP 与えられた年の最初の頃における余計な出力を切り捨てる。 -.\"O .SH "SEE ALSO" .SH 関連項目 -.BR tzfile (5), -.BR zic (8) +\fBtzfile\fP(5), \fBzic\fP(8) .\" @(#)zdump.8 7.3 diff --git a/draft/man8/zic.8 b/draft/man8/zic.8 index 3cf5483a..699b40ad 100644 --- a/draft/man8/zic.8 +++ b/draft/man8/zic.8 @@ -1,167 +1,65 @@ .\" This page is in the public domain .\" -.\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved. -.\" Translated Sat Aug 14 1999 -.\" by NAKANO Takeo -.\" Updated Wed Apr 4 2001 -.\" by Yuichi SATO +.\"******************************************************************* .\" -.\"WORD: time value 時刻値 -.\"WORD: rule line ルール行 -.\"WORD: zone line ゾーン行 -.\"WORD: link line リンク行 -.\"WORD: continuation line 継続行 -.\"WORD: wall clock (time) 壁時計 (時刻) -.\"WORD: standard (time) 標準 (時刻) +.\" This file was generated with po4a. Translate the source file. .\" -.TH ZIC 8 2010-02-25 "" "Linux System Administration" -.\"O .SH NAME +.\"******************************************************************* +.TH ZIC 8 2010\-02\-25 "" "Linux System Administration" .SH 名前 -.\"O zic \- timezone compiler zic \- タイムゾーンコンパイラ -.\"O .SH SYNOPSIS .SH 書式 -.B zic -[ -.B \-v -] [ -.B \-d -.I directory -] [ -.B \-l -.I localtime -] [ -.B \-p -.I posixrules -] [ -.B \-L -.I leapsecondfilename -] [ -.B \-s -] [ -.B \-y -.I command -] [ -.I filename -\&... ] -.\"O .SH DESCRIPTION +\fBzic\fP [ \fB\-v\fP ] [ \fB\-d\fP \fIdirectory\fP ] [ \fB\-l\fP \fIlocaltime\fP ] [ \fB\-p\fP +\fIposixrules\fP ] [ \fB\-L\fP \fIleapsecondfilename\fP ] [ \fB\-s\fP ] [ \fB\-y\fP \fIcommand\fP +] [ \fIfilename\fP \&... ] .SH 説明 -.if t .ds lq `` -.if t .ds rq '' -.if n .ds lq \&"\" -.if n .ds rq \&"\" -.de q +.if t .ds lq `` +.if t .ds rq '' +.if n .ds lq \&"\" +.if n .ds rq \&"\" +.de q \\$3\*(lq\\$1\*(rq\\$2 .. -.\"O .I Zic -.\"O reads text from the file(s) named on the command line -.\"O and creates the time conversion information files specified in this input. -.\"O If a -.\"O .I filename -.\"O is -.\"O .BR \- , -.\"O the standard input is read. -.I zic -はコマンドラインで指定されたファイル (複数指定可) からテキストを読み、 -時刻変換情報ファイルを生成する。ファイル名も読み込みテキストで指定しておく。 -.I filename -が -.B \- -の場合は、標準入力から読み込む。 +\fIzic\fP はコマンドラインで指定されたファイル (複数指定可) からテキストを読み、 +時刻変換情報ファイルを生成する。ファイル名も読み込みテキストで指定しておく。 \fIfilename\fP が \fB\-\fP の場合は、標準入力から読み込む。 .PP -.\"O These options are available: 以下のオプションを指定できる: -.TP -.BI "\-d " directory -.\"O Create time conversion information files in the named directory rather than -.\"O in the standard directory named below. -時刻変換情報ファイルを生成するディレクトリを、標準のディレクトリ -(以下を参照) ではなく指定したディレクトリにする。 -.TP -.BI "\-l " timezone -.\"O Use the given timezone as local time. -.\"O .I Zic -.\"O will act as if the input contained a link line of the form -指定したタイムゾーンをローカルタイムに用いる。 -.I zic -は入力に以下の書式のリンク行が含まれているかのように振る舞う。 +.TP +\fB\-d \fP\fIdirectory\fP +時刻変換情報ファイルを生成するディレクトリを、標準のディレクトリ (以下を参照) ではなく指定したディレクトリにする。 +.TP +\fB\-l \fP\fItimezone\fP +指定したタイムゾーンをローカルタイムに用いる。 \fIzic\fP は入力に以下の書式のリンク行が含まれているかのように振る舞う。 .sp .ti +.5i Link \fItimezone\fP localtime -.TP -.BI "\-p " timezone -.\"O Use the given timezone's rules when handling POSIX-format -.\"O timezone environment variables. -.\"O .I Zic -.\"O will act as if the input contained a link line of the form -POSIX 形式のタイムゾーン環境変数を扱うとき、 -指定したタイムゾーンのルールを用いる。 -.I zic +.TP +\fB\-p \fP\fItimezone\fP +POSIX 形式のタイムゾーン環境変数を扱うとき、 指定したタイムゾーンのルールを用いる。 \fIzic\fP は入力に以下の書式のリンク行が含まれているかのように振る舞う。 .sp .ti +.5i Link \fItimezone\fP posixrules -.TP -.BI "\-L " leapsecondfilename -.\"O Read leap second information from the file with the given name. -.\"O If this option is not used, -.\"O no leap second information appears in output files. -閏秒情報を与えられた名前のファイルから読み込む。 -このオプションが指定されなかった場合には、 -出力ファイルには閏秒の情報は含まれない。 -.TP -.B \-v -.\"O Complain if a year that appears in a data file is outside the range -.\"O of years representable by -.\"O .BR time (2) -.\"O values. -データファイルに現れる年が -.BR time (2) -で表記できる範囲を越えている場合に文句を言う。 -.TP -.B \-s -.\"O Limit time values stored in output files to values that are the same -.\"O whether they're taken to be signed or unsigned. -.\"O You can use this option to generate SVVS-compatible files. -出力ファイルに格納される時刻の値を、 signed で評価しても unsigned で -評価しても同じ値になるような範囲に制限する。 +.TP +\fB\-L \fP\fIleapsecondfilename\fP +閏秒情報を与えられた名前のファイルから読み込む。 このオプションが指定されなかった場合には、 出力ファイルには閏秒の情報は含まれない。 +.TP +\fB\-v\fP +データファイルに現れる年が \fBtime\fP(2) で表記できる範囲を越えている場合に文句を言う。 +.TP +\fB\-s\fP +出力ファイルに格納される時刻の値を、 signed で評価しても unsigned で 評価しても同じ値になるような範囲に制限する。 このオプションを使うと SVVS 互換なファイルを生成することができる。 -.TP -.BI "\-y " command -.\"O Use the given -.\"O .I command -.\"O rather than -.\"O .B yearistype -.\"O when checking year types (see below). -年の型のチェック (以下参照) に -.B yearistype -ではなく指定した -.I command -を用いる。 +.TP +\fB\-y \fP\fIcommand\fP +年の型のチェック (以下参照) に \fByearistype\fP ではなく指定した \fIcommand\fP を用いる。 .PP -.\"O Input lines are made up of fields. -.\"O Fields are separated from one another by any number of white space characters. -.\"O Leading and trailing white space on input lines is ignored. -.\"O An unquoted sharp character (#) in the input introduces a comment which extends -.\"O to the end of the line the sharp character appears on. -.\"O White space characters and sharp characters may be enclosed in double quotes -.\"O (") if they're to be used as part of a field. -.\"O Any line that is blank (after comment stripping) is ignored. -.\"O Nonblank lines are expected to be of one of three types: -.\"O rule lines, zone lines, and link lines. -入力行はフィールドからなる。 -フィールド間は、連続した任意の個数の空白文字によって区切られる。 -行頭・行末の空白文字は無視される。 -クォートされていないシャープ文字 (#) が入力行に現れた場合は、 -そこから行末まではコメントとして扱われる。 -空白文字やシャープ文字をダブルクォート (") で囲めば、 -フィールドの一部として用いることができる。 -(コメント除去処理を行った後のものを含めて) 空行は無視される。 -空行以外の行は、 3 種類あるタイプの行のいずれかであるとみなされる。 -3 つのタイプとは、ルール行 (rule line)、ゾーン行 (zone line)、 -リンク行 (link line) である。 +入力行はフィールドからなる。 フィールド間は、連続した任意の個数の空白文字によって区切られる。 行頭・行末の空白文字は無視される。 +クォートされていないシャープ文字 (#) が入力行に現れた場合は、 そこから行末まではコメントとして扱われる。 空白文字やシャープ文字をダブルクォート +(") で囲めば、 フィールドの一部として用いることができる。 (コメント除去処理を行った後のものを含めて) 空行は無視される。 空行以外の行は、 3 +種類あるタイプの行のいずれかであるとみなされる。 3 つのタイプとは、ルール行 (rule line)、ゾーン行 (zone line)、 リンク行 +(link line) である。 .PP -.\"O A rule line has the form ルール行の書式は以下のようなものである。 .nf .ti +.5i @@ -169,123 +67,43 @@ Link \fItimezone\fP posixrules .sp Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S .sp -.\"O For example: 例: .ti +.5i .sp Rule US 1967 1973 \- Apr lastSun 2:00 1:00 D .sp .fi -.\"O The fields that make up a rule line are: ルール行を構成するフィールドは以下の通り: -.TP "\w'LETTER/S'u" -.B NAME -.\"O Gives the (arbitrary) name of the set of rules this rule is part of. +.TP "\w'LETTER/S'u" +\fBNAME\fP このルールが所属するルールセットの名前を与える (任意)。 -.TP -.B FROM -.\"O Gives the first year in which the rule applies. -.\"O Any integer year can be supplied; the Gregorian calendar is assumed. -.\"O The word -.\"O .I minimum -.\"O (or an abbreviation) means the minimum year representable as an integer. -.\"O The word -.\"O .I maximum -.\"O (or an abbreviation) means the maximum year representable as an integer. -.\"O Rules can describe times that are not representable as time values, -.\"O with the unrepresentable times ignored; this allows rules to be portable -.\"O among hosts with differing time value types. -このルールが適用される最初の年を与える。 -任意の整数を年として与えることができる。グレゴリオ暦が仮定される。 -.I minimum -(あるいはその短縮) は整数表記できる最小の年を意味する。 -.I maximum -(あるいはその短縮) は整数表記できる最大の年を意味する。 -ルールでは時刻値 (time value) では表記できない時刻も記述できる。 -表記できない時刻は無視される。つまりルールは -異なった時刻値の型を持つホスト間でポータブルである。 -.TP -.B TO -.\"O Gives the final year in which the rule applies. -.\"O In addition to -.\"O .I minimum -.\"O and -.\"O .I maximum -.\"O (as above), -.\"O the word -.\"O .I only -.\"O (or an abbreviation) -.\"O may be used to repeat the value of the -.\"O .B FROM -.\"O field. -このルールが適用される最後の年を与える。 -.I minimum -と -.I maximum -(上述) に加え、 -.I only -(またはその短縮) を用いることができ、この場合は -.B FROM -フィールドに指定した値と同じ値が用いられる。 -.TP -.B TYPE -.\"O Gives the type of year in which the rule applies. -.\"O If -.\"O .B TYPE -.\"O is -.\"O .B \- -.\"O then the rule applies in all years between -.\"O .B FROM -.\"O and -.\"O .B TO -.\"O inclusive. -.\"O If -.\"O .B TYPE -.\"O is something else, then -.\"O .I zic -.\"O executes the command -ルールの適用される年のタイプを与える。 -.B TYPE -が -.B \- -であれば、このルールは -.B FROM -から -.B TO -に挟まれた (両端含む) 全ての年に適用される。 -.B TYPE -がそれ以外の場合には、 -.I zic -は以下のコマンドを実行して年のタイプをチェックする。 +.TP +\fBFROM\fP +このルールが適用される最初の年を与える。 任意の整数を年として与えることができる。グレゴリオ暦が仮定される。 \fIminimum\fP (あるいはその短縮) +は整数表記できる最小の年を意味する。 \fImaximum\fP (あるいはその短縮) は整数表記できる最大の年を意味する。 ルールでは時刻値 (time +value) では表記できない時刻も記述できる。 表記できない時刻は無視される。つまりルールは 異なった時刻値の型を持つホスト間でポータブルである。 +.TP +\fBTO\fP +このルールが適用される最後の年を与える。 \fIminimum\fP と \fImaximum\fP (上述) に加え、 \fIonly\fP (またはその短縮) +を用いることができ、この場合は \fBFROM\fP フィールドに指定した値と同じ値が用いられる。 +.TP +\fBTYPE\fP +ルールの適用される年のタイプを与える。 \fBTYPE\fP が \fB\-\fP であれば、このルールは \fBFROM\fP から \fBTO\fP に挟まれた (両端含む) +全ての年に適用される。 \fBTYPE\fP がそれ以外の場合には、 \fIzic\fP は以下のコマンドを実行して年のタイプをチェックする。 .ti +.5i \fByearistype\fP \fIyear\fP \fItype\fP .br -.\"O to check the type of a year: -.\"O an exit status of zero is taken to mean that the year is of the given type; -.\"O an exit status of one is taken to mean that the year is not of the given type. -返り値が 0 の場合は、その年は与えられたタイプに含まれ、 -返り値が 1 の場合は含まれないことになる。 -.TP -.B IN -.\"O Names the month in which the rule takes effect. -.\"O Month names may be abbreviated. -ルールが効力を持つ月の名前を指定する。 -月名は短縮できる。 -.TP -.B ON -.\"O Gives the day on which the rule takes effect. -.\"O Recognized forms include: -ルールが効力を持つ日の名前を指定する。 -以下のような書式を認識する: +返り値が 0 の場合は、その年は与えられたタイプに含まれ、 返り値が 1 の場合は含まれないことになる。 +.TP +\fBIN\fP +ルールが効力を持つ月の名前を指定する。 月名は短縮できる。 +.TP +\fBON\fP +ルールが効力を持つ日の名前を指定する。 以下のような書式を認識する: .nf .in +.5i .sp .ta \w'Sun<=25\0\0'u -.\"O 5 the fifth of the month -.\"O lastSun the last Sunday in the month -.\"O lastMon the last Monday in the month -.\"O Sun>=8 first Sunday on or after the eighth -.\"O Sun<=25 last Sunday on or before the 25th 5 その月の第 5 日 lastSun その月の最後の日曜日 lastMon その月の最後の月曜日 @@ -294,28 +112,14 @@ Sun<=25 第 25 日以前の最後の日曜日 .fi .in -.5i .sp -.\"O Names of days of the week may be abbreviated or spelled out in full. -.\"O Note that there must be no spaces within the -.\"O .B ON -.\"O field. -曜日の名前は短縮できる。全部綴っても良い。 -.B ON -フィールドの内部にはスペースを入れてはいけないことに注意。 -.TP -.B AT -.\"O Gives the time of day at which the rule takes effect. -.\"O Recognized forms include: -ルールが効力を持つ一日のうちの時刻を与える。 -以下のような書式を認識する: +曜日の名前は短縮できる。全部綴っても良い。 \fBON\fP フィールドの内部にはスペースを入れてはいけないことに注意。 +.TP +\fBAT\fP +ルールが効力を持つ一日のうちの時刻を与える。 以下のような書式を認識する: .nf .in +.5i .sp .ta \w'1:28:13\0\0'u -.\"O 2 time in hours -.\"O 2:00 time in hours and minutes -.\"O 15:00 24-hour format time (for times after noon) -.\"O 1:28:14 time in hours, minutes, and seconds -.\"O \- equivalent to 0 2 時間での表記 2:00 時間と分での表記 15:00 24 時間形式の時間 (正午以降) @@ -324,80 +128,19 @@ Sun<=25 第 25 日以前の最後の日曜日 .fi .in -.5i .sp -.\"O where hour 0 is midnight at the start of the day, -.\"O and hour 24 is midnight at the end of the day. -.\"O Any of these forms may be followed by the letter -.\"O .I w -.\"O if the given time is local -.\"O .q "wall clock" -.\"O time, -.\"O .I s -.\"O if the given time is local -.\"O .q standard -.\"O time, or -.\"O .I u -.\"O (or -.\"O .I g -.\"O or -.\"O .IR z ) -.\"O if the given time is universal time; -.\"O in the absence of an indicator, -.\"O wall clock time is assumed. -ここで 0 時はその日のはじまりであり、 -24 時はその日の終わりである。 -これらの書式のあとには、以下の文字のいずれかを指定することができる。 -.I w -与えられた時刻がローカルな +ここで 0 時はその日のはじまりであり、 24 時はその日の終わりである。 これらの書式のあとには、以下の文字のいずれかを指定することができる。 +\fIw\fP 与えられた時刻がローカルな .q "壁時計 (wall clock)" -時刻である; -.I s -与えられた時刻がローカルな +時刻である; \fIs\fP 与えられた時刻がローカルな .q "標準 (standard)" -時刻である; -.I u -(または -.I g -または -.IR z ) -与えられた時刻が標準時 (universal time) である。 -これらの表意文字がいずれも指定されなかった場合は、 -壁時計時刻が仮定される。 -.TP -.B SAVE -.\"O Gives the amount of time to be added to local standard time when the rule is in -.\"O effect. -.\"O This field has the same format as the -.\"O .B AT -.\"O field -.\"O (although, of course, the -.\"O .I w -.\"O and -.\"O .I s -.\"O suffixes are not used). -ルールが効力を持っているとき、ローカルな標準時刻に追加すべき -時間の量を与える。このフィールドの書式は -.B AT -フィールドのものと同じである (ただしもちろん -.I w -と -.I s -の後置文字は用いられない)。 -.TP -.B LETTER/S -.\"O Gives the -.\"O .q "variable part" -.\"O (for example, the -.\"O .q S -.\"O or -.\"O .q D -.\"O in -.\"O .q EST -.\"O or -.\"O .q EDT ) -.\"O of timezone abbreviations to be used when this rule is in effect. -.\"O If this field is -.\"O .BR \- , -.\"O the variable part is null. +時刻である; \fIu\fP (または \fIg\fP または \fIz\fP) 与えられた時刻が標準時 (universal +time) である。 これらの表意文字がいずれも指定されなかった場合は、 壁時計時刻が仮定される。 +.TP +\fBSAVE\fP +ルールが効力を持っているとき、ローカルな標準時刻に追加すべき 時間の量を与える。このフィールドの書式は \fBAT\fP フィールドのものと同じである +(ただしもちろん \fIw\fP と \fIs\fP の後置文字は用いられない)。 +.TP +\fBLETTER/S\fP このルールが効力を持っている場合に用いられるタイムゾーン短縮型の .q "可変部 (variable part) を与える (例えば @@ -408,13 +151,9 @@ Sun<=25 第 25 日以前の最後の日曜日 .q S や .q D -など)。 -このフィールドが -.B \- -であった場合には、 +など)。 このフィールドが \fB\-\fP であった場合には、 可変部は存在しない。 .PP -.\"O A zone line has the form ゾーン行の書式は以下のようなものである。 .sp .nf @@ -422,147 +161,60 @@ Sun<=25 第 25 日以前の最後の日曜日 .ta \w'Zone\0\0'u +\w'Australia/Adelaide\0\0'u +\w'UTCOFF\0\0'u +\w'RULES/SAVE\0\0'u +\w'FORMAT\0\0'u Zone NAME UTCOFF RULES/SAVE FORMAT [UNTIL] .sp -.\"O For example: 例: .sp .ti +.5i Zone Australia/Adelaide 9:30 Aus CST 1971 Oct 31 2:00 .sp .fi -.\"O The fields that make up a zone line are: ゾーン行を構成するフィールドは以下の通り: -.TP "\w'UTCOFF'u" -.B NAME -.\"O The name of the timezone. -.\"O This is the name used in creating the time conversion information file for the -.\"O zone. -タイムゾーンの名前。この名前がこのゾーンの時刻変換情報ファイルを -生成するときに用いられる。 -.TP -.B UTCOFF -.\"O The amount of time to add to UTC to get standard time in this zone. -.\"O This field has the same format as the -.\"O .B AT -.\"O and -.\"O .B SAVE -.\"O fields of rule lines; -.\"O begin the field with a minus sign if time must be subtracted from UTC. -このゾーンの標準時刻を得るために、 UTC に加える時間。 -このフィールドの書式は、ルール行の -.B AT -および -.B SAVE -フィールドのものと同じである。時間を UTC から引く必要がある場合は -マイナス記号を前置する。 -.TP -.B RULES/SAVE -.\"O The name of the rule(s) that apply in the timezone or, -.\"O alternately, an amount of time to add to local standard time. -.\"O If this field is -.\"O .B \- -.\"O then standard time always applies in the timezone. -タイムゾーンに適用されるルールの名前か、あるいは -ローカル標準時刻に加えるべき時間の量を指定する。 -このフィールドが -.B \- +.TP "\w'UTCOFF'u" +\fBNAME\fP +タイムゾーンの名前。この名前がこのゾーンの時刻変換情報ファイルを 生成するときに用いられる。 +.TP +\fBUTCOFF\fP +このゾーンの標準時刻を得るために、 UTC に加える時間。 このフィールドの書式は、ルール行の \fBAT\fP および \fBSAVE\fP +フィールドのものと同じである。時間を UTC から引く必要がある場合は マイナス記号を前置する。 +.TP +\fBRULES/SAVE\fP +タイムゾーンに適用されるルールの名前か、あるいは ローカル標準時刻に加えるべき時間の量を指定する。 このフィールドが \fB\-\fP ならば、常に標準時刻がこのゾーンに対して用いられる。 -.TP -.B FORMAT -.\"O The format for timezone abbreviations in this timezone. -.\"O The pair of characters -.\"O .B %s -.\"O is used to show where the -.\"O .q "variable part" -.\"O of the timezone abbreviation goes. -.\"O Alternately, -.\"O a slash (/) -.\"O separates standard and daylight abbreviations. -このタイムゾーンに対するタイムゾーン短縮名の書式。 -2 文字の文字列 -.B %s -を用いて、どこが +.TP +\fBFORMAT\fP +このタイムゾーンに対するタイムゾーン短縮名の書式。 2 文字の文字列 \fB%s\fP を用いて、どこが .q 可変部 -になるかを指定できる。あるいはスラッシュ文字 (/) を用いて -標準の短縮名とサマータイム短縮名を区切ることができる。 -.TP -.B UNTIL -.\"O The time at which the UTC offset or the rule(s) change for a location. -.\"O It is specified as a year, a month, a day, and a time of day. -.\"O If this is specified, -.\"O the timezone information is generated from the given UTC offset -.\"O and rule change until the time specified. -.\"O The month, day, and time of day have the same format as the IN, ON, and AT -.\"O columns of a rule; trailing columns can be omitted, and default to the -.\"O earliest possible value for the missing columns. -UTC に対するオフセットか、その場所におけるルールが変更される時刻。 -年・月・日・時刻で指定する。 -これが指定された場合には、タイムゾーンの情報は与えられている -UTC オフセットから生成され、ルールは指定時刻になると変更される。 -月・日・時刻は、ルールの IN, ON, AT カラムと同じ書式で指定する。 -この後に続くカラムは省略できる。 -省略されたカラムに対しては、 +になるかを指定できる。あるいはスラッシュ文字 (/) を用いて 標準の短縮名とサマータイム短縮名を区切ることができる。 +.TP +\fBUNTIL\fP +UTC に対するオフセットか、その場所におけるルールが変更される時刻。 年・月・日・時刻で指定する。 +これが指定された場合には、タイムゾーンの情報は与えられている UTC オフセットから生成され、ルールは指定時刻になると変更される。 +月・日・時刻は、ルールの IN, ON, AT カラムと同じ書式で指定する。 この後に続くカラムは省略できる。 省略されたカラムに対しては、 可能性のあるもののうち最も早い値がデフォルトで用いられる。 .IP -.\"O The next line must be a -.\"O .q continuation -.\"O line; this has the same form as a zone line except that the -.\"O string -.\"O .q Zone -.\"O and the name are omitted, as the continuation line will -.\"O place information starting at the time specified as the -.\"O .B UNTIL -.\"O field in the previous line in the file used by the previous line. -.\"O Continuation lines may contain an -.\"O .B UNTIL -.\"O field, just as zone lines do, indicating that the next line is a further -.\"O continuation. この行には必ず .q 継続 (continuation) -行が続く。 -継続行はゾーン行と同じ書式を持つが、 +行が続く。 継続行はゾーン行と同じ書式を持つが、 .q Zone -と名前は省略される。なぜなら継続行は直前の行の -.B UNTIL -フィールドで指定された時刻以降の情報を与えるものだからである。 -継続行にもゾーン行と同じように -.B UNTIL -フィールドを指定することができ、この場合はその次の行が -さらなる継続行になることとなる。 +と名前は省略される。なぜなら継続行は直前の行の \fBUNTIL\fP フィールドで指定された時刻以降の情報を与えるものだからである。 +継続行にもゾーン行と同じように \fBUNTIL\fP フィールドを指定することができ、この場合はその次の行が さらなる継続行になることとなる。 .PP -.\"O A link line has the form リンク行の書式は以下のようなものである。 .sp .nf .ti +.5i .ta \w'Link\0\0'u +\w'Europe/Istanbul\0\0'u -Link LINK-FROM LINK-TO +Link LINK\-FROM LINK\-TO .sp -.\"O For example: 例: .sp .ti +.5i Link Europe/Istanbul Asia/Istanbul .sp .fi -.\"O The -.\"O .B LINK-FROM -.\"O field should appear as the -.\"O .B NAME -.\"O field in some zone line; -.\"O the -.\"O .B LINK-TO -.\"O field is used as an alternate name for that zone. +\fBLINK\-FROM\fP フィールドはゾーン行の \fBNAME\fP フィールドが記述される。 \fBLINK\-TO\fP フィールドはそのゾーンの別名である。 .PP -.\"O Except for continuation lines, -.\"O lines may appear in any order in the input. -.B LINK-FROM -フィールドはゾーン行の -.B NAME -フィールドが記述される。 -.B LINK-TO -フィールドはそのゾーンの別名である。 +Except for continuation lines, lines may appear in any order in the input. .PP -.\"O Lines in the file that describes leap seconds have the following form: ファイル中で閏秒を記述する行は以下のような書式を持つ。 .nf .ti +.5i @@ -570,40 +222,12 @@ Link Europe/Istanbul Asia/Istanbul .sp Leap YEAR MONTH DAY HH:MM:SS CORR R/S .sp -.\"O For example: 例: .ti +.5i .sp Leap 1974 Dec 31 23:59:60 + S .sp .fi -.\"O The -.\"O .BR YEAR , -.\"O .BR MONTH , -.\"O .BR DAY , -.\"O and -.\"O .B HH:MM:SS -.\"O fields tell when the leap second happened. -.\"O The -.\"O .B CORR -.\"O field -.\"O should be -.\"O .q + -.\"O if a second was added -.\"O or -.\"O .q - -.\"O if a second was skipped. -.BR YEAR , -.BR MONTH , -.BR DAY , -.B HH:MM:SS -は閏秒の生じた瞬間を示す。 -.B CORR -フィールドには、秒が挿入された場合 -.q + -を、秒がスキップされた場合 -.q - -を指定する。 .\" There's no need to document the following, since it's impossible for more .\" than one leap second to be inserted or deleted at a time. .\" The C Standard is in error in suggesting the possibility. @@ -615,44 +239,23 @@ Leap 1974 Dec 31 23:59:60 + S .\" or .\" .q -- .\" if two seconds were skipped. -.\"O The -.\"O .B R/S -.\"O field -.\"O should be (an abbreviation of) -.\"O .q Stationary -.\"O if the leap second time given by the other fields should be interpreted as UTC -.\"O or -.\"O (an abbreviation of) -.\"O .q Rolling -.\"O if the leap second time given by the other fields should be interpreted as -.\"O local wall clock time. -.B R/S -フィールドには、他のフィールドが記述している閏秒の時刻が -UTC ならば +\fBYEAR\fP, \fBMONTH\fP, \fBDAY\fP, \fBHH:MM:SS\fP は閏秒の生じた瞬間を示す。 \fBCORR\fP +フィールドには、秒が挿入された場合 +.q + +を、秒がスキップされた場合 +.q \- +を指定する。 \fBR/S\fP +フィールドには、他のフィールドが記述している閏秒の時刻が UTC ならば .q Stationary -(あるいはその短縮形) を、ローカルな壁時計時刻なら +(あるいはその短縮形) +を、ローカルな壁時計時刻なら .q Rolling (あるいはその短縮形) を指定する。 -.\"O .SH FILES .SH ファイル -.\"O /usr/local/etc/zoneinfo standard directory used for created files /usr/local/etc/zoneinfo 生成されたファイル用の標準ディレクトリ -.\"O .SH NOTES .SH 注意 -.\"O For areas with more than two types of local time, -.\"O you may need to use local standard time in the -.\"O .B AT -.\"O field of the earliest transition time's rule to ensure that -.\"O the earliest transition time recorded in the compiled file is correct. -二つ以上のローカルタイムを持っている地域では、 -ローカルな標準時を -最も早い方の時刻変換ルールの -.B AT -フィールドに用いる必要があるだろう。さもないと -コンパイルされたファイルに記録された最も早い変換時刻が -正しいことが保証されない。 -.\"O .SH "SEE ALSO" +二つ以上のローカルタイムを持っている地域では、 ローカルな標準時を 最も早い方の時刻変換ルールの \fBAT\fP +フィールドに用いる必要があるだろう。さもないと コンパイルされたファイルに記録された最も早い変換時刻が 正しいことが保証されない。 .SH 関連項目 -.BR tzfile (5), -.BR zdump (8) +\fBtzfile\fP(5), \fBzdump\fP(8) .\" @(#)zic.8 7.19 -- 2.11.0